diff --git a/404.html b/404.html index 8b6dee757..0192d23d7 100644 --- a/404.html +++ b/404.html @@ -15,13 +15,13 @@ - - + +
Skip to main content

404: Page Not Found

If you navigated here from a broken link on the OpenFGA website, please open an issue on GitHub.

Otherwise, try navigating to the home page, and then find or search for the content you need from there.

- - + + \ No newline at end of file diff --git a/api/service.html b/api/service.html index f04ad12df..a1ab972ca 100644 --- a/api/service.html +++ b/api/service.html @@ -15,13 +15,13 @@ - - + +
Skip to main content
Loading...
- - + + \ No newline at end of file diff --git a/assets/js/6786195a.70e2ef86.js b/assets/js/6786195a.443111d6.js similarity index 70% rename from assets/js/6786195a.70e2ef86.js rename to assets/js/6786195a.443111d6.js index 4d3111e0a..5915a6435 100644 --- a/assets/js/6786195a.70e2ef86.js +++ b/assets/js/6786195a.443111d6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkopenfga_dev=self.webpackChunkopenfga_dev||[]).push([[3077],{19637:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>K,contentTitle:()=>X,default:()=>te,frontMatter:()=>Y,metadata:()=>J,toc:()=>$});var a,o,r,i,l=n(87462),s=n(67294),h=n(3905),d=n(5270);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:n,...l}=e;return s.createElement("svg",u({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},l),t?s.createElement("title",{id:n},t):null,a||(a=s.createElement("rect",{width:36,height:36,rx:6.42,fill:"#EFF0F2"})),o||(o=s.createElement("path",{d:"M24.977 13.087V26a1.996 1.996 0 0 1-1.996 1.996h-9.985A1.996 1.996 0 0 1 11 26V10.01c0-1.103.894-1.997 1.996-1.997h6.993l4.988 5.074Z",fill:"#C4C4C4"})),r||(r=s.createElement("path",{d:"M24.985 13.055H21.61a1.65 1.65 0 0 1-1.65-1.65V8l5.026 5.055Z",fill:"#65676E"})),i||(i=s.createElement("path",{d:"M20.993 17h-5.986c-.555 0-1.007.447-1.007 1 0 .552.45 1 1.007 1h5.986c.555 0 1.007-.447 1.007-1 0-.553-.45-1-1.007-1ZM19.05 20h-4.1c-.524 0-.95.447-.95 1 0 .552.425 1 .95 1h4.1c.524 0 .95-.447.95-1 0-.553-.426-1-.95-1Z",fill:"#9B9D9F"})))};var p,c,k,f,g,y;function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:n,...a}=e;return s.createElement("svg",w({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},a),t?s.createElement("title",{id:n},t):null,p||(p=s.createElement("rect",{width:36,height:36,rx:6.42,fill:"#EFF0F2"})),c||(c=s.createElement("path",{d:"M25.999 26.013H15.985V10H26a2 2 0 0 1 2 2.001v12.011a2 2 0 0 1-2 2.001Z",fill:"#C4C4C4"})),k||(k=s.createElement("path",{d:"M10.001 26.013h5.995V10h-5.995A2 2 0 0 0 8 12.001v12.011a2 2 0 0 0 2.001 2.001Z",fill:"#65676E"})),f||(f=s.createElement("path",{d:"M10.575 13.076a.572.572 0 1 0 0-1.144.572.572 0 0 0 0 1.144Z",fill:"#C4C4C4"})),g||(g=s.createElement("path",{d:"M12.548 16.008h-2.05a.493.493 0 1 1 0-.986h2.05a.493.493 0 1 1 0 .986ZM12.548 20.016h-2.05a.493.493 0 1 1 0-.986h2.05a.493.493 0 1 1 0 .986ZM13.545 18.011h-3.047a.493.493 0 1 1 0-.986h3.047a.493.493 0 1 1 0 .986Z",fill:"#9B9D9F"})),y||(y=s.createElement("path",{d:"M11.496 24.015h-.998a.493.493 0 1 1 0-.987h.998a.493.493 0 1 1 0 .987Z",fill:"#C4C4C4"})))};var N,v,x,T,_,C,j,A,z,S,F;function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:n,...a}=e;return s.createElement("svg",U({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},a),t?s.createElement("title",{id:n},t):null,N||(N=s.createElement("rect",{width:36,height:36,rx:6.42,fill:"#EFF0F2"})),v||(v=s.createElement("path",{d:"M8.5 11.4c0-1.05.85-1.9 1.9-1.9h8.867c1.049 0 1.9.85 1.9 1.9v14.989H10.4a1.9 1.9 0 0 1-1.9-1.9V11.4Z",fill:"#C4C4C4"})),x||(x=s.createElement("path",{d:"M21.167 13.722H25.6c1.05 0 1.9.85 1.9 1.9v8.867a1.9 1.9 0 0 1-1.9 1.9h-4.433V13.722Z",fill:"#65676E"})),T||(T=s.createElement("rect",{x:11.667,y:12.667,width:2.111,height:2.111,rx:1,fill:"#65676E"})),_||(_=s.createElement("rect",{x:11.667,y:16.889,width:2.111,height:2.111,rx:1,fill:"#65676E"})),C||(C=s.createElement("rect",{x:11.667,y:21.111,width:2.111,height:2.111,rx:1,fill:"#65676E"})),j||(j=s.createElement("rect",{x:15.889,y:12.667,width:2.111,height:2.111,rx:1,fill:"#65676E"})),A||(A=s.createElement("rect",{x:15.889,y:16.889,width:2.111,height:2.111,rx:1,fill:"#65676E"})),z||(z=s.createElement("rect",{x:23.278,y:16.889,width:2.111,height:2.111,rx:1,fill:"#C4C4C4"})),S||(S=s.createElement("rect",{x:23.278,y:21.111,width:2.111,height:2.111,rx:1,fill:"#C4C4C4"})),F||(F=s.createElement("rect",{x:15.889,y:21.111,width:2.111,height:2.111,rx:1,fill:"#65676E"})))};var B,E,I;function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:n,...a}=e;return s.createElement("svg",M({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},a),t?s.createElement("title",{id:n},t):null,B||(B=s.createElement("rect",{width:36,height:36,rx:6.42,fill:"#EFF0F2"})),s.createElement("mask",{id:"a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:8,y:8,width:20,height:19},E||(E=s.createElement("path",{fill:"#C4C4C4",d:"M8 8.8h20v18.095H8z"}))),I||(I=s.createElement("g",{mask:"url(#a)"},s.createElement("path",{d:"m18 14.729-3.333-5.714L8 20.443l3.81 5.714L18 14.73Z",fill:"#9B9D9F"}),s.createElement("path",{d:"M21.333 20.443H28L21.758 9.014h-7.091l6.666 11.43Z",fill:"#C4C4C4"}),s.createElement("path",{d:"m14.854 20.443-3.044 5.714 12.992.089L28 20.443H14.854Z",fill:"#65676E"}))))};var Z,D,O,L,W,H,V;function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:n,...a}=e;return s.createElement("svg",G({width:106,height:106,viewBox:"0 0 106 106",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},a),t?s.createElement("title",{id:n},t):null,Z||(Z=s.createElement("rect",{y:.026,width:105.948,height:105.948,rx:20.252,fill:"#BEC4CE"})),D||(D=s.createElement("path",{d:"M64.013 73.904c-7.832 0-14.18-6.349-14.18-14.18 0-7.832 6.348-14.18 14.18-14.18s14.18 6.348 14.18 14.18c0 7.831-6.348 14.18-14.18 14.18Z",fill:"#2D2D37"})),O||(O=s.createElement("path",{d:"M31.194 12.758h44.687c7.813 0 14.145 6.347 14.145 14.177v.006c0 7.83-6.332 14.177-14.145 14.177H31.194c-7.812 0-14.145-6.347-14.145-14.177v-.006c0-7.83 6.333-14.177 14.145-14.177Z",fill:"url(#a)"})),L||(L=s.createElement("path",{d:"M45.408 26.903v52.166c0 7.812-6.347 14.145-14.178 14.145h-.005c-7.83 0-14.178-6.333-14.178-14.145V26.903c0-7.812 6.348-14.145 14.178-14.145h.005c7.83 0 14.178 6.333 14.178 14.145Z",fill:"url(#b)"})),W||(W=s.createElement("path",{d:"M31.228 93.243c-7.832 0-14.18-6.35-14.18-14.181 0-7.832 6.348-14.18 14.18-14.18 7.831 0 14.18 6.348 14.18 14.18s-6.349 14.18-14.18 14.18Z",fill:"#fff"})),H||(H=s.createElement("path",{d:"M64.03 73.938c7.832 0 14.18-6.35 14.18-14.18 0-7.833-6.348-14.181-14.18-14.181s-14.18 6.349-14.18 14.18c0 7.832 6.348 14.18 14.18 14.18Z",fill:"#000"})),V||(V=s.createElement("defs",null,s.createElement("linearGradient",{id:"a",x1:90.016,y1:26.938,x2:17.04,y2:26.938,gradientUnits:"userSpaceOnUse"},s.createElement("stop",{stopColor:"#635DFF"}),s.createElement("stop",{offset:1,stopColor:"#3885FF"})),s.createElement("linearGradient",{id:"b",x1:31.228,y1:93.217,x2:31.228,y2:12.762,gradientUnits:"userSpaceOnUse"},s.createElement("stop",{stopColor:"#FF4F40"}),s.createElement("stop",{offset:1,stopColor:"#F4D"})))))},Y={title:"Get Started with Modeling",description:"An introduction to modeling",sidebar_position:1,slug:"/modeling/getting-started"},X="Get Started with Modeling",J={unversionedId:"content/modeling/getting-started",id:"content/modeling/getting-started",title:"Get Started with Modeling",description:"An introduction to modeling",source:"@site/docs/content/modeling/getting-started.mdx",sourceDirName:"content/modeling",slug:"/modeling/getting-started",permalink:"/docs/modeling/getting-started",draft:!1,editUrl:"https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/getting-started.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Get Started with Modeling",description:"An introduction to modeling",sidebar_position:1,slug:"/modeling/getting-started"},sidebar:"docs",previous:{title:"Modeling Guides",permalink:"/docs/modeling"},next:{title:"Direct Access",permalink:"/docs/modeling/direct-access"}},K={},$=[{value:"Introduction To Modeling",id:"introduction-to-modeling",level:2},{value:"A Process For Defining Authorization Models",id:"a-process-for-defining-authorization-models",level:2},{value:"01. Pick The Most Important Feature",id:"01-pick-the-most-important-feature",level:3},{value:"Write It In Plain Language",id:"write-it-in-plain-language",level:4},{value:"02. List The Object Types",id:"02-list-the-object-types",level:3},{value:"03. List Relations For Those Types",id:"03-list-relations-for-those-types",level:3},{value:"04. Define Relations",id:"04-define-relations",level:3},{value:"Type: Organization",id:"type-organization",level:4},{value:"Relation: Member",id:"relation-member",level:5},{value:"Complete Type Definition",id:"complete-type-definition",level:5},{value:"Type: Document",id:"type-document",level:4},{value:"Relation: Owner",id:"relation-owner",level:5},{value:"Relation: Editor",id:"relation-editor",level:5},{value:"Relation: Viewer",id:"relation-viewer",level:5},{value:"Relation: Parent",id:"relation-parent",level:5},{value:"Relation: can_share",id:"relation-can_share",level:5},{value:"Relation: can_view",id:"relation-can_view",level:5},{value:"Relation: can_write",id:"relation-can_write",level:5},{value:"Relation: can_change_owner",id:"relation-can_change_owner",level:5},{value:"Complete Type Definition",id:"complete-type-definition-1",level:5},{value:"05. Test The Model",id:"05-test-the-model",level:3},{value:"Write Relationship Tuples",id:"write-relationship-tuples",level:4},{value:"Create Assertions",id:"create-assertions",level:4},{value:"Run Assertions",id:"run-assertions",level:4},{value:"06. Iterate",id:"06-iterate",level:3},{value:"Related Sections",id:"related-sections",level:2}],Q={toc:$},ee="wrapper";function te(e){let{components:t,...a}=e;return(0,h.kt)(ee,(0,l.Z)({},Q,a,{components:t,mdxType:"MDXLayout"}),(0,h.kt)("h1",{id:"get-started-with-modeling"},"Get Started with Modeling"),(0,h.kt)(d.AH,{mdxType:"DocumentationNotice"}),(0,h.kt)("p",null,"Creating a ",(0,h.kt)(d.UV,{linkName:"Relationship Based Access Control (ReBAC)",section:"what-is-relationship-based-access-control-rebac",mdxType:"IntroductionSection"})," authorization model might feel odd at first. Most of us tend to think about authorization models in terms of roles and permissions. After all, most software works like that. Your existing systems are likely built on a model using roles and permissions."),(0,h.kt)("p",null,"This guide outlines a process for defining your ",(0,h.kt)(d.uH,{section:"what-is-an-authorization-model",linkName:"authorization model",mdxType:"ProductConcept"})," with ",(0,h.kt)(d.rZ,{format:d.v7.ProductLink,mdxType:"ProductName"}),"."),(0,h.kt)("h2",{id:"introduction-to-modeling"},"Introduction To Modeling"),(0,h.kt)("p",null,"To define a ReBAC model in ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," we recommend:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"If you have an existing system: forget about how your system works today and start thinking about how you want it to work in the future."),(0,h.kt)("li",{parentName:"ul"},"Thinking about authorization starting from the resources, or objects as ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," calls them.")),(0,h.kt)("p",null,"If that sounds hard, don't worry! We'll guide you through it."),(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," is built to quickly and reliably make ",(0,h.kt)(d.uH,{section:"what-is-a-check-request",linkName:"authorization checks",mdxType:"ProductConcept"}),'. This means providing an answer to a question: "Can user U perform action A on object O?"',(0,h.kt)("p",null,"ReBAC systems determine access from a ",(0,h.kt)(d.uH,{section:"what-is-a-user",linkName:"user's",mdxType:"ProductConcept"})," ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation",mdxType:"ProductConcept"})," to an ",(0,h.kt)(d.uH,{section:"what-is-an-object",linkName:"object",mdxType:"ProductConcept"}),'. Authorization decisions are then yes or no answers to the question: "Does user U have relation R with object O?".'),(0,h.kt)(d.X3,{cols:2,style:{marginTop:"2rem",marginBottom:"2rem"},mdxType:"ColumnLayout"},(0,h.kt)(d.S1,{title:"General Authorization Check",description:(0,h.kt)("p",null,'"Can user ',(0,h.kt)("b",null,"U")," ",(0,h.kt)("u",null,"perform an action")," ",(0,h.kt)("b",null,"A")," on object ",(0,h.kt)("b",null,"O"),'?"'),appearance:"filled",mdxType:"CardBox"}),(0,h.kt)(d.S1,{title:"{ProductName} (ReBAC) Authorization Check",description:(0,h.kt)("p",null,'"Does user ',(0,h.kt)("b",null,"U")," ",(0,h.kt)("u",null,"have relation")," ",(0,h.kt)("b",null,"R")," with object ",(0,h.kt)("b",null,"O"),'?"'),mdxType:"CardBox"})),(0,h.kt)("p",null,"In the previous example, a relation R should be defined that implies permission to action A. For example:"),(0,h.kt)(d.X3,{cols:2,style:{marginTop:"2rem",marginBottom:"2rem"},mdxType:"ColumnLayout"},(0,h.kt)(d.S1,{title:"General Authorization Check",description:(0,h.kt)("p",null,'"Can user ',(0,h.kt)("b",null,"Jane")," ",(0,h.kt)("u",null,"perform action")," ",(0,h.kt)("b",null,"view")," on object ",(0,h.kt)("b",null,"project sandcastle"),'?"'),appearance:"filled",mdxType:"CardBox"}),(0,h.kt)(d.S1,{title:"{ProductName} (ReBAC) Authorization Check",description:(0,h.kt)("p",null,'"Can user ',(0,h.kt)("b",null,"Jane")," ",(0,h.kt)("u",null,"have relation")," ",(0,h.kt)("b",null,"view")," with object ",(0,h.kt)("b",null,"project sandcastle"),'?"'),mdxType:"CardBox"})),(0,h.kt)("p",null,"We'll provide more detailed examples throughout this article."),(0,h.kt)("p",null,"When you are modeling, you need to answer a more general question:"),(0,h.kt)("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(q,{mdxType:"FGAIcon"}),alignment:"left"},title:"Why could user U perform an action A on an object O?",mdxType:"CardBox"})),(0,h.kt)("p",null,"If you can answer that question for all types of objects in your system, then you can codify that into an authorization model."),(0,h.kt)("p",null,"Let's get started!"),(0,h.kt)("hr",null),(0,h.kt)("h2",{id:"a-process-for-defining-authorization-models"},"A Process For Defining Authorization Models"),(0,h.kt)("p",null,'Defining an authorization model requires codifying an answer to the question "why could user U perform an action A on an object O?" for all use cases or actions in your system. This is an iterative process. For the purpose of this guide, we\'ll go through one iteration of this process using a simplified Google Drive like system as an example.'),(0,h.kt)("p",null,"Steps for defining your authorization model:"),(0,h.kt)("ol",null,(0,h.kt)("li",{parentName:"ol"},(0,h.kt)("a",{parentName:"li",href:"#01-pick-the-most-important-feature"},"Pick the most important feature")),(0,h.kt)("li",{parentName:"ol"},(0,h.kt)("a",{parentName:"li",href:"#02-list-the-object-types"},"List the object types")),(0,h.kt)("li",{parentName:"ol"},(0,h.kt)("a",{parentName:"li",href:"#03-list-relations-for-those-types"},"List relations for those types")),(0,h.kt)("li",{parentName:"ol"},(0,h.kt)("a",{parentName:"li",href:"#04-define-relations"},"Define relations")),(0,h.kt)("li",{parentName:"ol"},(0,h.kt)("a",{parentName:"li",href:"#05-test-the-model"},"Test the model")),(0,h.kt)("li",{parentName:"ol"},(0,h.kt)("a",{parentName:"li",href:"#06-iterate"},"Iterate"))),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"The starting point",src:n(4636).Z,width:"911",height:"188"})),(0,h.kt)("h3",{id:"01-pick-the-most-important-feature"},"01. Pick The Most Important Feature"),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"Pick the most important feature",src:n(66979).Z,width:"911",height:"188"})),(0,h.kt)("p",null,"A feature, in the context of this document, is an action or related set of actions your users can perform in your system. We'll introduce an example feature later in this section."),(0,h.kt)("p",null,"Start with the most important feature. It doesn't have to be the most complex one, but it should be the most important one. You're probably more familiar with the authorization requirements for this feature than other less important use cases."),(0,h.kt)("admonition",{title:"Important",type:"caution"},(0,h.kt)("ul",{parentName:"admonition"},(0,h.kt)("li",{parentName:"ul"},"Requirement clarity is fundamental when defining an authorization model."),(0,h.kt)("li",{parentName:"ul"},"The scope of the feature is not important at this point. You can always iterate later."))),(0,h.kt)("h4",{id:"write-it-in-plain-language"},"Write It In Plain Language"),(0,h.kt)("p",null,'Once you\'ve picked a feature, describe its authorization related scope using simple language. Avoid using the word "roles", as this ties you to an RBAC way of thinking.'),(0,h.kt)("admonition",{type:"info"},(0,h.kt)("p",{parentName:"admonition"},'Roles don\'t "disappear" in ReBAC systems like ',(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),". Your users might ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/roles-and-permissions"},"have roles on a given object, rather than the entire system"),'. But starting from the term "role" might lead you down the wrong path. Instead it is better to discover roles while you are modeling.')),(0,h.kt)("p",null,"Your feature description should include the ",(0,h.kt)(d.uH,{section:"what-is-an-object",linkName:"objects",mdxType:"ProductConcept"}),", ",(0,h.kt)(d.uH,{section:"what-is-a-user",linkName:"users",mdxType:"ProductConcept"})," and ",(0,h.kt)(d.uH,{section:"what-is-a-user",linkName:"groups of users",mdxType:"ProductConcept"})," participating in the system. Sentences should look like this:"),(0,h.kt)("div",{style:{marginBottom:"2rem"}},(0,h.kt)(d.S1,{title:"A user {user} can perform action {action} to/on/in {object types} ... IF {conditions}",appearance:"filled",centerTitle:!0,mdxType:"CardBox"})),"Let's look at an example of a simplified Google Drive like system. We'll focus on the feature allowing users to create, read, update, delete, and share documents with other users.",(0,h.kt)("br",null),(0,h.kt)("br",null),(0,h.kt)("p",null,"This feature can be described with these sentences:"),(0,h.kt)(d.S1,{appearance:"filled",monoFontChildren:!0,mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can create a document in a drive if they are the owner of the drive."),(0,h.kt)("li",{parentName:"ul"},"A user can create a folder in a drive if they are the owner of the drive."),(0,h.kt)("li",{parentName:"ul"},"A user can create a document in a folder if they are the owner of the folder. The folder is the parent of the document."),(0,h.kt)("li",{parentName:"ul"},"A user can create a folder in a folder if they are the owner of the folder. The existing folder is the parent of the new folder.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can share a folder with another user or an organization as a viewer if they are an owner of the folder.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can view a document if they are an owner, viewer or editor of the document or if they are a viewer or owner of the folder/drive that is the parent of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can edit a document if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can change the owner of a document if they are an owner of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can change the owner of a folder if they are an owner of the folder.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("p",{parentName:"li"},"A user can be a member of an organization."),(0,h.kt)("span",{style:{color:"gray"}},"How a user is added as a member to an organization is beyond the scope of the feature we picked to write down."))),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can view a folder if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder."))),(0,h.kt)("h3",{id:"02-list-the-object-types"},"02. List The Object Types"),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"List the object types",src:n(65326).Z,width:"911",height:"188"})),(0,h.kt)("p",null,"Next make a list of the ",(0,h.kt)(d.uH,{section:"what-is-a-type",linkName:"types",mdxType:"ProductConcept"})," of objects in your system. You might be able to identify the objects in your system from your existing domain/database model."),(0,h.kt)("p",null,"Find all the objects in the previous step using this template:"),(0,h.kt)("div",{style:{marginBottom:"2rem"}},(0,h.kt)(d.S1,{title:"A user {user} can perform action {action} to/on/in {object type} ... IF {conditions}",appearance:"filled",centerTitle:!0,mdxType:"CardBox"})),(0,h.kt)("p",null,"These are all the object types from the previous step (in order of appearance) based on that template:"),(0,h.kt)(d.X3,{cols:3,style:{marginTop:"2rem",marginBottom:"2rem"},mdxType:"ColumnLayout"},(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(m,{mdxType:"DocIcon"}),alignment:"left",label:"Document"},mdxType:"CardBox"}),(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(b,{mdxType:"DirIcon"}),alignment:"left",label:"Folder"},mdxType:"CardBox"}),(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(P,{mdxType:"OrgIcon"}),alignment:"left",label:"Organization"},mdxType:"CardBox"})),(0,h.kt)("p",null,"Let's highlight all object types in ",(0,h.kt)("span",{className:"blue-highlight-text"},"blue"),":"),(0,h.kt)("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},(0,h.kt)(d.S1,{appearance:"filled",monoFontChildren:!0,mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can create a ",(0,h.kt)("span",{className:"blue-highlight-text"},"document")," in a drive if they are the owner of the drive."),(0,h.kt)("li",{parentName:"ul"},"A user can create a ",(0,h.kt)("span",{className:"blue-highlight-text"},"folder")," in a drive if they are the owner of the drive."),(0,h.kt)("li",{parentName:"ul"},"A user can create a ",(0,h.kt)("span",{className:"blue-highlight-text"},"document")," in a folder if they are the owner of the folder."),(0,h.kt)("li",{parentName:"ul"},"A user can create a ",(0,h.kt)("span",{className:"blue-highlight-text"},"folder")," in a folder if they are the owner of the folder.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can share a ",(0,h.kt)("span",{className:"blue-highlight-text"},"document")," with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can share a ",(0,h.kt)("span",{className:"blue-highlight-text"},"folder")," with another user or an organization as a viewer if they are an owner of the folder.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can view a ",(0,h.kt)("span",{className:"blue-highlight-text"},"document")," if they are an owner, viewer or editor of the document or if they are a viewer, owner of the folder/drive that is the parent of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can edit a ",(0,h.kt)("span",{className:"blue-highlight-text"},"document")," if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can change the owner of a ",(0,h.kt)("span",{className:"blue-highlight-text"},"document")," if they are an owner of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can change the owner of a ",(0,h.kt)("span",{className:"blue-highlight-text"},"folder")," if they are an owner of the folder.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("p",{parentName:"li"},"A user can be a member of an ",(0,h.kt)("span",{className:"blue-highlight-text"},"organization"),"."),(0,h.kt)("span",{style:{color:"gray"}},"How a user is added as a member to an organization is beyond the scope of the feature we picked to write down."))),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can view a ",(0,h.kt)("span",{className:"blue-highlight-text"},"folder")," if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder.")))),(0,h.kt)("p",null,"However, the list of object types is not finished. To complete the list of object types you must also add all the second nouns that appear in conditions as part of expressions of this format: ",(0,h.kt)("strong",{parentName:"p"},'"{first noun} of a/the {second noun}"'),"."),(0,h.kt)("div",{style:{marginBottom:"2rem"}},(0,h.kt)(d.S1,{centerTitle:!0,title:"... IF {first noun} of a/the {second noun}",appearance:"filled",mdxType:"CardBox"})),(0,h.kt)("p",null,"Let's highlight those expressions in ",(0,h.kt)("span",{className:"green-highlight-text"},"green"),":"),(0,h.kt)("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},(0,h.kt)(d.S1,{monoFontChildren:!0,appearance:"filled",mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can create a document in a drive if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the drive"),"."),(0,h.kt)("li",{parentName:"ul"},"A user can create a folder in a drive if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the drive"),"."),(0,h.kt)("li",{parentName:"ul"},"A user can create a document in a folder if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),". The folder is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),"."),(0,h.kt)("li",{parentName:"ul"},"A user can create a folder in a folder if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),". The existing folder is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the new folder")," .")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can share a document with another user or an organization as either editor or viewer if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner or editor of a document")," or if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder/drive")," that is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can share a folder with another user or an organization as a viewer if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can view a document if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner, viewer or editor of the document")," or if they are a ",(0,h.kt)("span",{className:"green-highlight-text"},"viewer or owner of the folder/drive")," that is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can edit a document if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner or editor of the document")," or if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder/drive")," that is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can change the owner of a document if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can change the owner of a folder if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("p",{parentName:"li"},"A user can be a member of an organization."),(0,h.kt)("span",{style:{color:"gray"}},"How a user is added as a member to an organization is beyond the scope of the feature we picked to write down."))),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can view a folder if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),", or a ",(0,h.kt)("span",{className:"green-highlight-text"},"viewer or owner of either the parent folder of the folder, or the parent drive of the folder"),".")))),(0,h.kt)("p",null,'The only second noun we didn\'t have in our object type list is "Drive", so we\'ll add it to the list.\nWe will also need to add "User" to the list as it establishes the type of user who can establish relations.'),(0,h.kt)(d.X3,{cols:5,style:{marginTop:"2rem",marginBottom:"2rem"},mdxType:"ColumnLayout"},(0,h.kt)(d.S1,{icon:{alignment:"left",label:"User"},mdxType:"CardBox"}),(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(m,{mdxType:"DocIcon"}),alignment:"left",label:"Document"},mdxType:"CardBox"}),(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(b,{mdxType:"DirIcon"}),alignment:"left",label:"Folder"},mdxType:"CardBox"}),(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(P,{mdxType:"OrgIcon"}),alignment:"left",label:"Organization"},mdxType:"CardBox"}),(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(R,{mdxType:"DriveIcon"}),alignment:"left",label:"Drive"},mdxType:"CardBox"})),(0,h.kt)("p",null,"Now that we have a list of object types we can start defining them using the ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"}),":"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document"},{type:"folder"},{type:"organization"},{type:"drive"}]},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("admonition",{title:"Caution",type:"info"},(0,h.kt)("p",{parentName:"admonition"},"You're now in the process of building a version you can use. The model above is not yet a valid authorization model accepted by ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),".")),(0,h.kt)("admonition",{title:"Important",type:"info"},(0,h.kt)("p",{parentName:"admonition"},'In a few cases other users can be part of determining whether an action can be performed on an action or not. Social media is an example of this "a user can comment on a picture if they are a friend of the user that published it".'),(0,h.kt)("p",{parentName:"admonition"},"In those cases ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/object-to-object-relationships"},(0,h.kt)("strong",{parentName:"a"},"User")," should also be an object type"),'. Following the last recommendation, we would discover the User type because it is a second noun in an expression: "friend of the user".')),(0,h.kt)("h3",{id:"03-list-relations-for-those-types"},"03. List Relations For Those Types"),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"List relations for those types",src:n(81566).Z,width:"911",height:"188"})),(0,h.kt)("p",null,"Each of the previously defined types has a set of relations. ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"Relations",mdxType:"ProductConcept"})," are an important component in your model. After all, ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," is a ",(0,h.kt)(d.UV,{linkName:"Relationship Based Access Control (ReBAC)",section:"what-is-relationship-based-access-control-rebac",mdxType:"IntroductionSection"})," system."),(0,h.kt)("p",null,"To identify relations for a type we in the write-up we can perform an exercise similar to the one we did in ",(0,h.kt)("a",{parentName:"p",href:"#02-list-the-object-types"},"list the type of objects in your system"),"."),(0,h.kt)("p",null,"Relations for a type {type} will be all of these:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},'any noun that is the {noun} of a "{noun} of a/an/the {type}" expression. ',(0,h.kt)("strong",{parentName:"li"},"These are typically the Foreign Keys in a database.")," We'll highlight these in ",(0,h.kt)("span",{className:"green-highlight-text"},"green"),"."),(0,h.kt)("li",{parentName:"ul"},'any verb or action that is the {action} of a "can {action} (in) a/an {type}" expression. ',(0,h.kt)("strong",{parentName:"li"},"These are typically the permissions for a type.")," We'll highlight these in ",(0,h.kt)("span",{className:"yellow-highlight-text"},"yellow"),".")),(0,h.kt)("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},(0,h.kt)(d.S1,{monoFontChildren:!0,appearance:"filled",mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can create a document in a drive")," if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the drive"),"."),(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can create a folder in a drive")," if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the drive"),"."),(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can create a document in a folder")," if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),". The folder is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),"."),(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can create a folder in a folder")," if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),". The existing folder is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the new folder"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can share a document with another user or an organization")," as either editor or viewer if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner or editor of a document")," or if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder/drive")," that is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can share a folder with another user or an organization")," as a viewer if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can view a document")," if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner, viewer or editor of the document")," or if they are a ",(0,h.kt)("span",{className:"green-highlight-text"},"viewer or owner of the folder/drive")," that is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can edit a document")," if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner or editor of the document")," or if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder/drive")," that is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can change the owner of a document")," if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can change the owner of a folder")," if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("p",{parentName:"li"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can be a member of an organization"),"."),(0,h.kt)("span",{style:{color:"gray"}},"How a user is added as a member to an organization is beyond the scope of the feature we picked to write down."))),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can view a folder")," if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),", or a ",(0,h.kt)("span",{className:"green-highlight-text"},"viewer or owner of either the parent folder of the folder, or the parent drive of the folder"),".")))),(0,h.kt)("p",null,"The resulting list is:"),(0,h.kt)(d.X3,{cols:4,equalWidth:!0,style:{marginTop:"2rem",marginBottom:"2rem"},mdxType:"ColumnLayout"},(0,h.kt)(d.S1,{smallFontChildren:!0,icon:{icon:(0,h.kt)(m,{mdxType:"DocIcon"}),alignment:"middle",label:"Document"},mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"parent"),(0,h.kt)("li",{parentName:"ul"},"can_share"),(0,h.kt)("li",{parentName:"ul"},"owner"),(0,h.kt)("li",{parentName:"ul"},"editor"),(0,h.kt)("li",{parentName:"ul"},"can_write"),(0,h.kt)("li",{parentName:"ul"},"can_view"),(0,h.kt)("li",{parentName:"ul"},"viewer"),(0,h.kt)("li",{parentName:"ul"},"can_change_owner"))),(0,h.kt)(d.S1,{smallFontChildren:!0,icon:{icon:(0,h.kt)(b,{mdxType:"DirIcon"}),alignment:"middle",label:"Folder"},mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"can_create_document"),(0,h.kt)("li",{parentName:"ul"},"owner"),(0,h.kt)("li",{parentName:"ul"},"can_create_folder"),(0,h.kt)("li",{parentName:"ul"},"can_view"),(0,h.kt)("li",{parentName:"ul"},"viewer"),(0,h.kt)("li",{parentName:"ul"},"parent"))),(0,h.kt)(d.S1,{smallFontChildren:!0,icon:{icon:(0,h.kt)(P,{mdxType:"OrgIcon"}),alignment:"middle",label:"Organization"},mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"member"))),(0,h.kt)(d.S1,{smallFontChildren:!0,icon:{icon:(0,h.kt)(R,{mdxType:"DriveIcon"}),alignment:"middle",label:"Drive"},mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"can_create_document"),(0,h.kt)("li",{parentName:"ul"},"owner"),(0,h.kt)("li",{parentName:"ul"},"can_create_folder")))),(0,h.kt)("admonition",{type:"info"},(0,h.kt)("p",{parentName:"admonition"},"In ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),", relations can only have alphanumeric characters, underscores and hyphens. We recommend using underscore (","_",') to separate words and removing prepositions. E.g.: "can create a document" can become "can_create_document" or "create_document" if you are into brevity.')),(0,h.kt)("p",null,"Using the ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"})," we can enumerate the relations for each type:"),(0,h.kt)("pre",null,(0,h.kt)("code",{parentName:"pre",className:"language-dsl.openfga"},"model\n schema 1.1\ntype user\ntype document\n relations\n define parent:\n define owner:\n define editor:\n define viewer:\n define can_share:\n define can_view:\n define can_write:\n define can_change_owner:\ntype folder\n relations\n define owner:\n define parent:\n define viewer:\n define can_create_folder:\n define can_create_document:\n define can_view:\ntype organization\n relations\n define member:\ntype drive\n relations\n define owner:\n define can_create_document:\n define can_create_folder:\n")),(0,h.kt)("admonition",{title:"Caution",type:"info"},(0,h.kt)("p",{parentName:"admonition"},"You're now in the process of building a version you can use. The model above is not yet a valid authorization model accepted by ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),".")),(0,h.kt)("h3",{id:"04-define-relations"},"04. Define Relations"),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"Define relations",src:n(78300).Z,width:"911",height:"188"})),(0,h.kt)("p",null,"We will use the ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"})," to create a ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation definition",mdxType:"ProductConcept"})," for each of the relations we identified. At this stage we will encode the answers to the question we asked at the beginning of the document:."),(0,h.kt)("div",{style:{marginBottom:"2rem"}},(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(q,{mdxType:"FGAIcon"}),alignment:"left"},title:"Why could a user U, perform an action A on an object O?",mdxType:"CardBox"})),(0,h.kt)("p",null,"We are going to go over each type and each of its relations and create a definition for it."),(0,h.kt)("div",{style:{display:"inline-block"}},(0,h.kt)(P,{mdxType:"OrgIcon"}),(0,h.kt)("div",{style:{float:"right",marginLeft:"16px"}},(0,h.kt)("h4",{id:"type-organization"},"Type: Organization"))),(0,h.kt)("p",null,'We recommend starting from objects that represent groups/containers of users. For features in most systems these are easy to define and help reason about the other types. Examples of type names for these are "team", "group", "organization", etc.'),(0,h.kt)("h5",{id:"relation-member"},"Relation: Member"),(0,h.kt)("p",null,"The member relation is used to tell ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," about the members of an organization."),(0,h.kt)("admonition",{title:"Important",type:"info"},(0,h.kt)("p",{parentName:"admonition"},"Relation names in ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),' are arbitrary strings. There are no reserved relation names. You can use "member" or "part_of" or anything else to refer to a user that is part of a team/organization.')),(0,h.kt)("p",null,"Remember ",(0,h.kt)("em",{parentName:"p"},'"How a user is added as a member to an organization is beyond the scope of this feature."')," For the purposes of this model the relation definition should be:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"organization",relations:{member:{this:""}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("p",null,"Why? This relation definition states:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("p",{parentName:"li"},"That organizations have members")),(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("p",{parentName:"li"},"That the members of an organization with id {id} are all users described by tuples of the form:"),(0,h.kt)("p",{parentName:"li"},(0,h.kt)("inlineCode",{parentName:"p"},'{ user: {user-id}, relation: "member", object: "organization:{id}" }')))),(0,h.kt)("admonition",{title:"Important",type:"info"},(0,h.kt)("p",{parentName:"admonition"},"Relation definitions of the form \u201cdefine {relation}: ","[user, organization#member]",'" are fairly common. They are used to express that relationships "to the object with that relation" (e.g. "users" of type user or "member of organization") can be assigned by your system and that only the users that have that relation are those with a ',(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/direct-relationships"},"direct relationship"),".")),(0,h.kt)("p",null,"You can read more about group membership and types in ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/user-groups"},"Modeling User Groups"),"."),(0,h.kt)("p",null,"For the direct relationships, we need to figure out the object types that makes sense for the relationship tuples' user. In our organization example, it makes sense for member relations to have user of type"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"user"),(0,h.kt)("li",{parentName:"ul"},"organization#member (i.e., other organization's member)")),(0,h.kt)("p",null,"However, it will not make sense for organization member's user to be of type document, folder or drive."),(0,h.kt)("p",null,"We will specify this logic as part of directly ",(0,h.kt)(d.uH,{section:"what-is-a-directly-related-user-type",linkName:"directly related user type",mdxType:"ProductConcept"}),"."),(0,h.kt)("admonition",{title:"Side note",type:"note"},(0,h.kt)("p",{parentName:"admonition"},'This also automatically supports nested organizational membership if you want such a feature in your system. You could use relationship tuples like the following one to express that "members of organization A are members of organization B":'),(0,h.kt)("pre",{parentName:"admonition"},(0,h.kt)("code",{parentName:"pre"},'{ user: "organization:A#member", relation: "member", object: "organization:B"}\n')),(0,h.kt)("p",{parentName:"admonition"},"If you want to learn more, you can read further about this in ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/user-groups"},"Modeling User Groups")," and ",(0,h.kt)("a",{parentName:"p",href:"/docs/interacting/managing-relationships-between-objects"},"Managing Relationships Between Objects"),".")),(0,h.kt)("h5",{id:"complete-type-definition"},"Complete Type Definition"),(0,h.kt)("p",null,"The complete ",(0,h.kt)(d.uH,{section:"what-is-a-type-definition",linkName:"type definition",mdxType:"ProductConcept"})," for the ",(0,h.kt)("strong",{parentName:"p"},"organization")," type is:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"organization",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("div",{style:{display:"inline-block"}},(0,h.kt)(m,{mdxType:"DocIcon"}),(0,h.kt)("div",{style:{float:"right",marginLeft:"16px"}},(0,h.kt)("h4",{id:"type-document"},"Type: Document"))),(0,h.kt)("p",null,'After defining your "group" like types, continue with the most important type for the feature: the one that allows the main use case. In this case "document", since the main use case for users is to create, write, read and collaborate on documents.'),(0,h.kt)("p",null,"Defining relations for the main type lets you to focus on your core use case, and will likely make other type definitions easier."),(0,h.kt)("h5",{id:"relation-owner"},"Relation: Owner"),(0,h.kt)("p",null,"The owner relation is used to tell ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," which users are owners of the document."),(0,h.kt)("admonition",{title:"Important",type:"info"},(0,h.kt)("p",{parentName:"admonition"},"In the current version, there is no way to state that there is only one owner in the authorization model. The application must limit this ",(0,h.kt)(d.uH,{section:"what-is-a-user",linkName:"set of users",mdxType:"ProductConcept"})," to just one owner if that is a requirement.")),(0,h.kt)("p",null,"When a document is created, a relationship tuple will be stored in ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," representing this relationship between owner and document. This is an example of a ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/direct-access"},"user to object relationship"),"."),(0,h.kt)("p",null,"The relation definition then should be:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"document",relations:{owner:{this:""}},metadata:{relations:{owner:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("p",null,"Why? This ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation definition",mdxType:"ProductConcept"})," states that:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"each document can have one or more owners"),(0,h.kt)("li",{parentName:"ul"},"owners of a document are assignable by creating a tuple of the format\n",(0,h.kt)("inlineCode",{parentName:"li"},'{ user: "{user_id}", relation: "owner", object: "document:{id}" }')," for individual users")),(0,h.kt)("h5",{id:"relation-editor"},"Relation: Editor"),(0,h.kt)("p",null,"The editor relation is used to tell ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," which users are editors of the document."),(0,h.kt)("p",null,"When a user shares a document with another user or set of users as editor, a relationship tuple will be stored in ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," representing this relationship between editor and document. This is an example of a ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/direct-access"},"users to object relationship"),"."),(0,h.kt)("p",null,"The relation definition then should be:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"document",relations:{editor:{this:""}},metadata:{relations:{editor:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("p",null,"Why? This relation definition states that:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"each document can have editors"),(0,h.kt)("li",{parentName:"ul"},"the editor(s) of a document are assignable by creating a tuple with shape\n",(0,h.kt)("inlineCode",{parentName:"li"},'{ user: "{user_id}", relation: "editor", object: "document:{id}" }')," for individual users")),(0,h.kt)("p",null,"This also supports making all members in an organization editors of the document, through a ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/user-groups"},"group to object relationship"),". A relationship tuple like the following one states that the members of organization A are editors of document 0001."),(0,h.kt)(d.Wz,{relationshipTuples:[{user:"organization:A#member",relation:"editor",object:"document:0001"}],mdxType:"RelationshipTuplesViewer"}),(0,h.kt)("p",null,"You can learn more about this in ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/user-groups"},"Modeling User Groups"),"."),(0,h.kt)("h5",{id:"relation-viewer"},"Relation: Viewer"),(0,h.kt)("p",null,"The viewer relation is similar to the document's ",(0,h.kt)("a",{parentName:"p",href:"#relation-editor"},"editor relation"),". It will be defined like this:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"document",relations:{viewer:{this:""}},metadata:{relations:{viewer:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("h5",{id:"relation-parent"},"Relation: Parent"),(0,h.kt)("p",null,"The parent relation is used to tell ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," which folder or drive is the parent of the document."),(0,h.kt)("admonition",{title:"Important",type:"caution"},(0,h.kt)("p",{parentName:"admonition"},"Relation names in ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),' are arbitrary strings. There are no reserved relation names. You can use "parent", "container" or "ancestor" to refer to a "parent folder".')),(0,h.kt)("p",null,"This relation is different from the others we have seen so far, as it is a relation between two objects (a ",(0,h.kt)("strong",{parentName:"p"},"folder")," and or ",(0,h.kt)("strong",{parentName:"p"},"drive")," that is the parent of the ",(0,h.kt)("strong",{parentName:"p"},"document"),"). This is known as an ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/object-to-object-relationships"},"object to object relationship"),", of which ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/parent-child"},"parent-child is a particular case"),"."),(0,h.kt)("p",null,"When a document is created a relationship tuple will be stored in ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," to represent this relationship between parent and document. The relation definition then should be:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"document",relations:{parent:{this:""}},metadata:{relations:{parent:{directly_related_user_types:[{type:"folder"},{type:"drive"}]}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("p",null,"Why? This relation definition states that:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"documents may have a parent"),(0,h.kt)("li",{parentName:"ul"},"the parent(s) of a document with id {id} is either a folder or a drive, described by one of these relationship tuples:",(0,h.kt)("ul",{parentName:"li"},(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("inlineCode",{parentName:"li"},'{ user: "folder:{id}", relation: "parent", object: "document:{id}" }')),(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("inlineCode",{parentName:"li"},'{ user: "drive:{id}", relation: "parent", object: "document:{id}" }'))))),(0,h.kt)("p",null,"We can use ",(0,h.kt)("a",{parentName:"p",href:"/docs/configuration-language#the-direct-relationship-type-restrictions"},"direct type restriction")," to ensure a document's parent can only be an object of type either drive or folder."),(0,h.kt)("admonition",{title:"Side note",type:"note"},(0,h.kt)("p",{parentName:"admonition"},'You might have noticed that the "user" in the tuple is an object. This is a special syntax ',(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),' accepts in the "user" parameter to write ',(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/object-to-object-relationships"},"object to object relationships"),". You can read more about writing data to manage object to object relationships in ",(0,h.kt)("a",{parentName:"p",href:"/docs/interacting/managing-relationships-between-objects"},"Managing Relationships Between Objects"),".")),(0,h.kt)("h5",{id:"relation-can_share"},"Relation: can_share"),(0,h.kt)("p",null,"We need to express the following in the ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation definition",mdxType:"ProductConcept"}),":"),(0,h.kt)("p",null,(0,h.kt)("em",{parentName:"p"},"A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder that is the parent of the document.")),(0,h.kt)("p",null,"We can achieve that with the following definition using ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"}),":"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,skipVersion:!0,configuration:{schema_version:"1.1",type_definitions:[{can_share:{union:{child:[{computedUserset:{object:"",relation:"owner"}},{computedUserset:{object:"",relation:"editor"}},{tupleToUserset:{computedUserset:{object:"",relation:"owner"},tupleset:{object:"",relation:"parent"}}}]}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("p",null,"There are a few key things here:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("strong",{parentName:"li"},"We don't use a ",(0,h.kt)("a",{parentName:"strong",href:"/docs/configuration-language#the-direct-relationship-type-restrictions"},"direct relationship type restriction")," as part of the definition.")," can_share is a common example of representing a permission that is defined in terms of other relations but is not directly assignable by the system."),(0,h.kt)("li",{parentName:"ul"},"The relation definition contains a ",(0,h.kt)("a",{parentName:"li",href:"/docs/configuration-language#the-union-operator"},"union operator"),' separating a list of relations that the user must have with the object in order to "be able to share the document". It is any of:',(0,h.kt)("ul",{parentName:"li"},(0,h.kt)("li",{parentName:"ul"},"Being an owner of the document"),(0,h.kt)("li",{parentName:"ul"},"Being an editor of the document"),(0,h.kt)("li",{parentName:"ul"},"Being an owner of the parent of the document. Whether the parent is a drive or a folder is not important, as they both have an owner relation.")))),(0,h.kt)("p",null,"You can read more about the aforementioned items in ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/roles-and-permissions"},"Modeling Roles and Permissions"),"."),(0,h.kt)("h5",{id:"relation-can_view"},"Relation: can_view"),(0,h.kt)("p",null,"We need to express the following in the ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation definition",mdxType:"ProductConcept"}),":"),(0,h.kt)("p",null,(0,h.kt)("em",{parentName:"p"},"A user can view a document if they are an owner, viewer or editor of a document or if they are a viewer, owner of the folder/drive that is the parent of the document.")),(0,h.kt)("p",null,"Similar to the ",(0,h.kt)("a",{parentName:"p",href:"#relation-can_share"},"can_share relation"),", we can achieve that with the following definition using ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"}),":"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,skipVersion:!0,configuration:{schema_version:"1.1",type_definitions:[{can_view:{union:{child:[{computedUserset:{object:"",relation:"viewer"}},{computedUserset:{object:"",relation:"editor"}},{computedUserset:{object:"",relation:"owner"}},{tupleToUserset:{computedUserset:{object:"",relation:"viewer"},tupleset:{object:"",relation:"parent"}}},{tupleToUserset:{computedUserset:{object:"",relation:"owner"},tupleset:{object:"",relation:"parent"}}}]}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("h5",{id:"relation-can_write"},"Relation: can_write"),(0,h.kt)("p",null,"We need to express the following in the ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation definition",mdxType:"ProductConcept"}),":"),(0,h.kt)("p",null,(0,h.kt)("em",{parentName:"p"},"A user can write a document if they are an owner or editor of a document or if they are an owner or editor of the folder/drive that is the parent of the document.")),(0,h.kt)("p",null,"Similar to the ",(0,h.kt)("a",{parentName:"p",href:"#relation-can_share"},"can_share relation"),", we can achieve that with the following definition using ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"}),":"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,skipVersion:!0,configuration:{schema_version:"1.1",type_definitions:[{can_write:{union:{child:[{computedUserset:{object:"",relation:"editor"}},{computedUserset:{object:"",relation:"owner"}},{tupleToUserset:{computedUserset:{object:"",relation:"owner"},tupleset:{object:"",relation:"parent"}}}]}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("h5",{id:"relation-can_change_owner"},"Relation: can_change_owner"),(0,h.kt)("p",null,"We need to express the following in the ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation definition",mdxType:"ProductConcept"}),":"),(0,h.kt)("p",null,(0,h.kt)("em",{parentName:"p"},"A user can change the owner of a document if they are an owner of the document.")),(0,h.kt)("p",null,"Similar to the ",(0,h.kt)("a",{parentName:"p",href:"#relation-can_share"},"can_share relation"),", we can achieve that with the following definition using ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"}),":"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,skipVersion:!0,configuration:{schema_version:"1.1",type_definitions:[{can_change_owner:{computedUserset:{object:"",relation:"owner"}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("h5",{id:"complete-type-definition-1"},"Complete Type Definition"),(0,h.kt)("p",null,"The complete ",(0,h.kt)(d.uH,{section:"what-is-a-type-definition",linkName:"type definition",mdxType:"ProductConcept"})," for the document type is:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"document",relations:{owner:{this:{}},editor:{this:{}},viewer:{this:{}},parent:{this:{}},can_share:{union:{child:[{computedUserset:{object:"",relation:"owner"}},{computedUserset:{object:"",relation:"editor"}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"owner"}}}]}},can_view:{union:{child:[{computedUserset:{object:"",relation:"viewer"}},{computedUserset:{object:"",relation:"editor"}},{computedUserset:{object:"",relation:"owner"}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"viewer"}}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"editor"}}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"owner"}}}]}},can_write:{union:{child:[{computedUserset:{object:"",relation:"editor"}},{computedUserset:{object:"",relation:"owner"}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"owner"}}}]}},can_change_owner:{computedUserset:{object:"",relation:"owner"}}},metadata:{relations:{owner:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]},editor:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]},viewer:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]},parent:{directly_related_user_types:[{type:"folder"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("p",null,"Combining the type definitions for document and organization, we have"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"organization",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]}}}},{type:"document",relations:{owner:{this:{}},editor:{this:{}},viewer:{this:{}},parent:{this:{}},can_share:{union:{child:[{computedUserset:{object:"",relation:"owner"}},{computedUserset:{object:"",relation:"editor"}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"owner"}}}]}},can_view:{union:{child:[{computedUserset:{object:"",relation:"viewer"}},{computedUserset:{object:"",relation:"editor"}},{computedUserset:{object:"",relation:"owner"}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"viewer"}}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"editor"}}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"owner"}}}]}},can_write:{union:{child:[{computedUserset:{object:"",relation:"editor"}},{computedUserset:{object:"",relation:"owner"}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"owner"}}}]}},can_change_owner:{computedUserset:{object:"",relation:"owner"}}},metadata:{relations:{owner:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]},editor:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]},viewer:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]},parent:{directly_related_user_types:[{type:"folder"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("admonition",{type:"note"},(0,h.kt)("p",{parentName:"admonition"},"The ",(0,h.kt)(d.rZ,{mdxType:"ProductName"})," authorization model API and SDK only accepts JSON in its input. To convert from DSL to JSON, you may use the ",(0,h.kt)("a",{parentName:"p",href:"https://github.com/openfga/cli"},"FGA CLI")," to run ",(0,h.kt)("inlineCode",{parentName:"p"},"fga model transform"),".")),(0,h.kt)("h3",{id:"05-test-the-model"},"05. Test The Model"),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"Test the model",src:n(77478).Z,width:"911",height:"188"})),(0,h.kt)("p",null,"Once you have defined your group like types and the most important type for your feature you want to ensure everything is working as expected. This means testing the model."),(0,h.kt)("p",null,"How? Remember from the introduction that ",(0,h.kt)("strong",{parentName:"p"},(0,h.kt)(d.rZ,{format:d.v7.LongForm,mdxType:"ProductName"}),"'s")," main job is to answer the question:"),(0,h.kt)("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(q,{mdxType:"FGAIcon"}),alignment:"left"},title:"Can user U, perform an action A on an object O?",mdxType:"CardBox"})),(0,h.kt)("p",null,"The ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," service does that by checking if a user has a particular relationship to an object, based on your authorization model and relationship tuples."),(0,h.kt)(d.X3,{cols:2,style:{marginTop:"2rem",marginBottom:"2rem"},mdxType:"ColumnLayout"},(0,h.kt)(d.S1,{title:"General Authorization Check",description:(0,h.kt)("p",null,'"Can user ',(0,h.kt)("b",null,"U")," ",(0,h.kt)("u",null,"perform action")," ",(0,h.kt)("b",null,"A")," on object ",(0,h.kt)("b",null,"O"),'?"'),appearance:"filled",mdxType:"CardBox"}),(0,h.kt)(d.S1,{title:"{ProductName} (ReBAC) Authorization Check",description:(0,h.kt)("p",null,'"Can user ',(0,h.kt)("b",null,"U")," ",(0,h.kt)("u",null,"have relation")," ",(0,h.kt)("b",null,"R")," with object ",(0,h.kt)("b",null,"O"),'?"'),mdxType:"CardBox"})),(0,h.kt)("p",null,"What we want is to ensure that given our current authorization model and some sample relationship tuples, we get the expected results for those questions."),(0,h.kt)("p",null,"So we'll write some relationship tuples and assertions. An ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," assertion takes one of these forms:"),(0,h.kt)("ol",null,(0,h.kt)("li",{parentName:"ol"},"user U ",(0,h.kt)("strong",{parentName:"li"},"has")," relation R with object O"),(0,h.kt)("li",{parentName:"ol"},"user U ",(0,h.kt)("strong",{parentName:"li"},"does not have")," relation R with object O")),(0,h.kt)("p",null,"Much like automated tests and assertions work for programming languages, you can use assertions to prevent regressions while you change your tuples and authorization model. Essentially, assertions help you ensure things work like you expect them to work as you iterate."),(0,h.kt)("h4",{id:"write-relationship-tuples"},"Write Relationship Tuples"),(0,h.kt)("p",null,"The relationship tuples should represent real examples from your system with fake data."),(0,h.kt)("p",null,"At this point you haven't defined the drive or folder types, so you can only test things based on users or organization members' relationships to documents. Let's imagine an example setup and write the relationship tuples for it:"),(0,h.kt)("table",null,(0,h.kt)("thead",{parentName:"table"},(0,h.kt)("tr",{parentName:"thead"},(0,h.kt)("th",{parentName:"tr",align:null},"System Action"),(0,h.kt)("th",{parentName:"tr",align:null},"Relationship Tuple"))),(0,h.kt)("tbody",{parentName:"table"},(0,h.kt)("tr",{parentName:"tbody"},(0,h.kt)("td",{parentName:"tr",align:null},"Anne is a member of the contoso organization"),(0,h.kt)("td",{parentName:"tr",align:null},(0,h.kt)("inlineCode",{parentName:"td"},'{ user:"user:anne", relation: "member", object: "organization:contoso"}'))),(0,h.kt)("tr",{parentName:"tbody"},(0,h.kt)("td",{parentName:"tr",align:null},"Beth is a member of fabrikam organization"),(0,h.kt)("td",{parentName:"tr",align:null},(0,h.kt)("inlineCode",{parentName:"td"},'{ user:"user:beth", relation: "member", object: "organization:fabrikam"}'))),(0,h.kt)("tr",{parentName:"tbody"},(0,h.kt)("td",{parentName:"tr",align:null},"Anne creates document:1, becomes its owner."),(0,h.kt)("td",{parentName:"tr",align:null},(0,h.kt)("inlineCode",{parentName:"td"},'{ user:"user:anne", relation: "owner", object: "document:1"}'))),(0,h.kt)("tr",{parentName:"tbody"},(0,h.kt)("td",{parentName:"tr",align:null},"Anne shares document:1 with all members of the fabrikam organization as editor."),(0,h.kt)("td",{parentName:"tr",align:null},(0,h.kt)("inlineCode",{parentName:"td"},'{ user:"organization:fabrikam#member", relation: "editor", object: "document:1"}'))),(0,h.kt)("tr",{parentName:"tbody"},(0,h.kt)("td",{parentName:"tr",align:null},"Beth creates document:2 and becomes its owner."),(0,h.kt)("td",{parentName:"tr",align:null},(0,h.kt)("inlineCode",{parentName:"td"},'{ user:"user:beth", relation: "owner", object: "document:2"}'))),(0,h.kt)("tr",{parentName:"tbody"},(0,h.kt)("td",{parentName:"tr",align:null},"Beth shares document:2 with all members of the contoso organization as viewer"),(0,h.kt)("td",{parentName:"tr",align:null},(0,h.kt)("inlineCode",{parentName:"td"},'{ user:"organization:contoso#member", relation: "viewer", object: "document:2"}'))))),(0,h.kt)("p",null,"Follow these steps to create relationship tuples."),(0,h.kt)("h4",{id:"create-assertions"},"Create Assertions"),(0,h.kt)("p",null,"According to our ",(0,h.kt)("a",{parentName:"p",href:"#write-it-in-plain-language"},"written down model")," and the ",(0,h.kt)("a",{parentName:"p",href:"#write-relationship-tuples"},"relationship tuples")," from the previous step, these assertions should be specified:"),(0,h.kt)("p",null,"Because anne is the owner of document:1:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_share")," with document:1"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_write")," with document:1"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_view")," with document:1"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_change_owner")," with document:1")),(0,h.kt)("p",null,"Because beth is a member of organization:fabrikam and members of organization:fabrikam are writer of document:1:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," does not have relation ",(0,h.kt)("strong",{parentName:"li"},"can_share")," with document:1"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_write")," with document:1"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_view")," with document:1"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," does not have relation ",(0,h.kt)("strong",{parentName:"li"},"can_change_owner")," with document:1")),(0,h.kt)("p",null,"Because beth is the owner of document:2:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_share")," with document:2"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_write")," with document:2"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_view")," with document:2"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_change_owner")," with document:2")),(0,h.kt)("p",null,"Because anne is a member of organization:contoso and members of organization:contoso are viewer of document:2:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," does not have relation ",(0,h.kt)("strong",{parentName:"li"},"can_share")," with document:2"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," does not have relation ",(0,h.kt)("strong",{parentName:"li"},"can_write")," with document:2"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_view")," with document:2"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," does not have relation ",(0,h.kt)("strong",{parentName:"li"},"can_change_owner")," with document:2")),(0,h.kt)("p",null,"Follow these steps to create assertions."),(0,h.kt)("h4",{id:"run-assertions"},"Run Assertions"),(0,h.kt)("p",null,"Run the assertions. They should all pass. If they don't you can use the query view to understand what is causing them to fail, and then update your authorization model and relation tuples accordingly."),(0,h.kt)("p",null,"Once all the assertions are working, you should continue the iterative process of working on your model."),(0,h.kt)("h3",{id:"06-iterate"},"06. Iterate"),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"Iterate",src:n(56882).Z,width:"911",height:"208"})),(0,h.kt)("p",null,"We'll leave the exercise of defining the drive and folder relations, then adding relationship tuples and assertions to you. Once you are finished, check out the complete example to see how you did."),(0,h.kt)("p",null,"When defining the authorization model for your own system, you would continue iterating on the ",(0,h.kt)(d.uH,{section:"what-is-an-authorization-model",linkName:"authorization model",mdxType:"ProductConcept"})," with the ",(0,h.kt)("a",{parentName:"p",href:"#01-pick-the-most-important-feature"},"next feature")," and so on."),(0,h.kt)("p",null,"If you have any questions about this model or others, or would like some help creating your model, drop by our ",(0,h.kt)("a",{parentName:"p",href:"https://discord.gg/8naAwJfWN6"},"Discord"),"."),(0,h.kt)("h2",{id:"related-sections"},"Related Sections"),(0,h.kt)(d.$q,{description:"Check the following sections for more on how to model with {ProductName}.",relatedLinks:[{title:"{ProductName} Concepts",description:"Learn about the {ProductName} Concepts.",link:"../concepts",id:"../concepts"},{title:"Configuration Language",description:"Learn about {ProductName} Configuration Language.",link:"../configuration-language",id:"../configuration-language"},{title:"Direct Access",description:"Learn about modeling user access to an object.",link:"./direct-access",id:"./direct-access"}],mdxType:"RelatedSection"}))}te.isMDXComponent=!0},4636:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-01-55e7a873e7fdd4aa810922af9606ad0c.svg"},66979:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-02-46c38ef0a05b5eac7e8a85c3ca02e20f.svg"},65326:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-03-3734cdad8827d03f6a76db672f13be46.svg"},81566:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-04-e8b2110197173b6308a3f797e76aa471.svg"},78300:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-05-ffffd65d9b3eb843353c35f2f663a0c5.svg"},77478:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-06-8eb4b8f4a925670b0ff05fa86c4b890e.svg"},56882:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-07-110858004c2892e28df4c404a50abce2.svg"}}]); \ No newline at end of file +"use strict";(self.webpackChunkopenfga_dev=self.webpackChunkopenfga_dev||[]).push([[3077],{19637:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>K,contentTitle:()=>X,default:()=>te,frontMatter:()=>Y,metadata:()=>J,toc:()=>$});var a,o,r,i,l=n(87462),s=n(67294),h=n(3905),d=n(5270);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:n,...l}=e;return s.createElement("svg",u({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},l),t?s.createElement("title",{id:n},t):null,a||(a=s.createElement("rect",{width:36,height:36,rx:6.42,fill:"#EFF0F2"})),o||(o=s.createElement("path",{d:"M24.977 13.087V26a1.996 1.996 0 0 1-1.996 1.996h-9.985A1.996 1.996 0 0 1 11 26V10.01c0-1.103.894-1.997 1.996-1.997h6.993l4.988 5.074Z",fill:"#C4C4C4"})),r||(r=s.createElement("path",{d:"M24.985 13.055H21.61a1.65 1.65 0 0 1-1.65-1.65V8l5.026 5.055Z",fill:"#65676E"})),i||(i=s.createElement("path",{d:"M20.993 17h-5.986c-.555 0-1.007.447-1.007 1 0 .552.45 1 1.007 1h5.986c.555 0 1.007-.447 1.007-1 0-.553-.45-1-1.007-1ZM19.05 20h-4.1c-.524 0-.95.447-.95 1 0 .552.425 1 .95 1h4.1c.524 0 .95-.447.95-1 0-.553-.426-1-.95-1Z",fill:"#9B9D9F"})))};var p,c,k,f,g,y;function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:n,...a}=e;return s.createElement("svg",w({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},a),t?s.createElement("title",{id:n},t):null,p||(p=s.createElement("rect",{width:36,height:36,rx:6.42,fill:"#EFF0F2"})),c||(c=s.createElement("path",{d:"M25.999 26.013H15.985V10H26a2 2 0 0 1 2 2.001v12.011a2 2 0 0 1-2 2.001Z",fill:"#C4C4C4"})),k||(k=s.createElement("path",{d:"M10.001 26.013h5.995V10h-5.995A2 2 0 0 0 8 12.001v12.011a2 2 0 0 0 2.001 2.001Z",fill:"#65676E"})),f||(f=s.createElement("path",{d:"M10.575 13.076a.572.572 0 1 0 0-1.144.572.572 0 0 0 0 1.144Z",fill:"#C4C4C4"})),g||(g=s.createElement("path",{d:"M12.548 16.008h-2.05a.493.493 0 1 1 0-.986h2.05a.493.493 0 1 1 0 .986ZM12.548 20.016h-2.05a.493.493 0 1 1 0-.986h2.05a.493.493 0 1 1 0 .986ZM13.545 18.011h-3.047a.493.493 0 1 1 0-.986h3.047a.493.493 0 1 1 0 .986Z",fill:"#9B9D9F"})),y||(y=s.createElement("path",{d:"M11.496 24.015h-.998a.493.493 0 1 1 0-.987h.998a.493.493 0 1 1 0 .987Z",fill:"#C4C4C4"})))};var N,v,x,T,C,_,j,A,z,S,F;function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:n,...a}=e;return s.createElement("svg",U({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},a),t?s.createElement("title",{id:n},t):null,N||(N=s.createElement("rect",{width:36,height:36,rx:6.42,fill:"#EFF0F2"})),v||(v=s.createElement("path",{d:"M8.5 11.4c0-1.05.85-1.9 1.9-1.9h8.867c1.049 0 1.9.85 1.9 1.9v14.989H10.4a1.9 1.9 0 0 1-1.9-1.9V11.4Z",fill:"#C4C4C4"})),x||(x=s.createElement("path",{d:"M21.167 13.722H25.6c1.05 0 1.9.85 1.9 1.9v8.867a1.9 1.9 0 0 1-1.9 1.9h-4.433V13.722Z",fill:"#65676E"})),T||(T=s.createElement("rect",{x:11.667,y:12.667,width:2.111,height:2.111,rx:1,fill:"#65676E"})),C||(C=s.createElement("rect",{x:11.667,y:16.889,width:2.111,height:2.111,rx:1,fill:"#65676E"})),_||(_=s.createElement("rect",{x:11.667,y:21.111,width:2.111,height:2.111,rx:1,fill:"#65676E"})),j||(j=s.createElement("rect",{x:15.889,y:12.667,width:2.111,height:2.111,rx:1,fill:"#65676E"})),A||(A=s.createElement("rect",{x:15.889,y:16.889,width:2.111,height:2.111,rx:1,fill:"#65676E"})),z||(z=s.createElement("rect",{x:23.278,y:16.889,width:2.111,height:2.111,rx:1,fill:"#C4C4C4"})),S||(S=s.createElement("rect",{x:23.278,y:21.111,width:2.111,height:2.111,rx:1,fill:"#C4C4C4"})),F||(F=s.createElement("rect",{x:15.889,y:21.111,width:2.111,height:2.111,rx:1,fill:"#65676E"})))};var B,E,I;function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:n,...a}=e;return s.createElement("svg",M({width:36,height:36,viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},a),t?s.createElement("title",{id:n},t):null,B||(B=s.createElement("rect",{width:36,height:36,rx:6.42,fill:"#EFF0F2"})),s.createElement("mask",{id:"a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:8,y:8,width:20,height:19},E||(E=s.createElement("path",{fill:"#C4C4C4",d:"M8 8.8h20v18.095H8z"}))),I||(I=s.createElement("g",{mask:"url(#a)"},s.createElement("path",{d:"m18 14.729-3.333-5.714L8 20.443l3.81 5.714L18 14.73Z",fill:"#9B9D9F"}),s.createElement("path",{d:"M21.333 20.443H28L21.758 9.014h-7.091l6.666 11.43Z",fill:"#C4C4C4"}),s.createElement("path",{d:"m14.854 20.443-3.044 5.714 12.992.089L28 20.443H14.854Z",fill:"#65676E"}))))};var Z,D,O,L,W,H,V;function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:n,...a}=e;return s.createElement("svg",G({width:106,height:106,viewBox:"0 0 106 106",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},a),t?s.createElement("title",{id:n},t):null,Z||(Z=s.createElement("rect",{y:.026,width:105.948,height:105.948,rx:20.252,fill:"#BEC4CE"})),D||(D=s.createElement("path",{d:"M64.013 73.904c-7.832 0-14.18-6.349-14.18-14.18 0-7.832 6.348-14.18 14.18-14.18s14.18 6.348 14.18 14.18c0 7.831-6.348 14.18-14.18 14.18Z",fill:"#2D2D37"})),O||(O=s.createElement("path",{d:"M31.194 12.758h44.687c7.813 0 14.145 6.347 14.145 14.177v.006c0 7.83-6.332 14.177-14.145 14.177H31.194c-7.812 0-14.145-6.347-14.145-14.177v-.006c0-7.83 6.333-14.177 14.145-14.177Z",fill:"url(#a)"})),L||(L=s.createElement("path",{d:"M45.408 26.903v52.166c0 7.812-6.347 14.145-14.178 14.145h-.005c-7.83 0-14.178-6.333-14.178-14.145V26.903c0-7.812 6.348-14.145 14.178-14.145h.005c7.83 0 14.178 6.333 14.178 14.145Z",fill:"url(#b)"})),W||(W=s.createElement("path",{d:"M31.228 93.243c-7.832 0-14.18-6.35-14.18-14.181 0-7.832 6.348-14.18 14.18-14.18 7.831 0 14.18 6.348 14.18 14.18s-6.349 14.18-14.18 14.18Z",fill:"#fff"})),H||(H=s.createElement("path",{d:"M64.03 73.938c7.832 0 14.18-6.35 14.18-14.18 0-7.833-6.348-14.181-14.18-14.181s-14.18 6.349-14.18 14.18c0 7.832 6.348 14.18 14.18 14.18Z",fill:"#000"})),V||(V=s.createElement("defs",null,s.createElement("linearGradient",{id:"a",x1:90.016,y1:26.938,x2:17.04,y2:26.938,gradientUnits:"userSpaceOnUse"},s.createElement("stop",{stopColor:"#635DFF"}),s.createElement("stop",{offset:1,stopColor:"#3885FF"})),s.createElement("linearGradient",{id:"b",x1:31.228,y1:93.217,x2:31.228,y2:12.762,gradientUnits:"userSpaceOnUse"},s.createElement("stop",{stopColor:"#FF4F40"}),s.createElement("stop",{offset:1,stopColor:"#F4D"})))))},Y={title:"Get Started with Modeling",description:"An introduction to modeling",sidebar_position:1,slug:"/modeling/getting-started"},X="Get Started with Modeling",J={unversionedId:"content/modeling/getting-started",id:"content/modeling/getting-started",title:"Get Started with Modeling",description:"An introduction to modeling",source:"@site/docs/content/modeling/getting-started.mdx",sourceDirName:"content/modeling",slug:"/modeling/getting-started",permalink:"/docs/modeling/getting-started",draft:!1,editUrl:"https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/getting-started.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Get Started with Modeling",description:"An introduction to modeling",sidebar_position:1,slug:"/modeling/getting-started"},sidebar:"docs",previous:{title:"Modeling Guides",permalink:"/docs/modeling"},next:{title:"Direct Access",permalink:"/docs/modeling/direct-access"}},K={},$=[{value:"Introduction To Modeling",id:"introduction-to-modeling",level:2},{value:"A Process For Defining Authorization Models",id:"a-process-for-defining-authorization-models",level:2},{value:"01. Pick The Most Important Feature",id:"01-pick-the-most-important-feature",level:3},{value:"Write It In Plain Language",id:"write-it-in-plain-language",level:4},{value:"02. List The Object Types",id:"02-list-the-object-types",level:3},{value:"03. List Relations For Those Types",id:"03-list-relations-for-those-types",level:3},{value:"04. Define Relations",id:"04-define-relations",level:3},{value:"Type: Organization",id:"type-organization",level:4},{value:"Relation: Member",id:"relation-member",level:5},{value:"Complete Type Definition",id:"complete-type-definition",level:5},{value:"Type: Document",id:"type-document",level:4},{value:"Relation: Owner",id:"relation-owner",level:5},{value:"Relation: Editor",id:"relation-editor",level:5},{value:"Relation: Viewer",id:"relation-viewer",level:5},{value:"Relation: Parent",id:"relation-parent",level:5},{value:"Relation: can_share",id:"relation-can_share",level:5},{value:"Relation: can_view",id:"relation-can_view",level:5},{value:"Relation: can_write",id:"relation-can_write",level:5},{value:"Relation: can_change_owner",id:"relation-can_change_owner",level:5},{value:"Complete Type Definition",id:"complete-type-definition-1",level:5},{value:"05. Test The Model",id:"05-test-the-model",level:3},{value:"Write Relationship Tuples",id:"write-relationship-tuples",level:4},{value:"Create Assertions",id:"create-assertions",level:4},{value:"Run Assertions",id:"run-assertions",level:4},{value:"06. Iterate",id:"06-iterate",level:3},{value:"Related Sections",id:"related-sections",level:2}],Q={toc:$},ee="wrapper";function te(e){let{components:t,...a}=e;return(0,h.kt)(ee,(0,l.Z)({},Q,a,{components:t,mdxType:"MDXLayout"}),(0,h.kt)("h1",{id:"get-started-with-modeling"},"Get Started with Modeling"),(0,h.kt)(d.AH,{mdxType:"DocumentationNotice"}),(0,h.kt)("p",null,"Creating a ",(0,h.kt)(d.UV,{linkName:"Relationship Based Access Control (ReBAC)",section:"what-is-relationship-based-access-control-rebac",mdxType:"IntroductionSection"})," authorization model might feel odd at first. Most of us tend to think about authorization models in terms of roles and permissions. After all, most software works like that. Your existing systems are likely built on a model using roles and permissions."),(0,h.kt)("p",null,"This guide outlines a process for defining your ",(0,h.kt)(d.uH,{section:"what-is-an-authorization-model",linkName:"authorization model",mdxType:"ProductConcept"})," with ",(0,h.kt)(d.rZ,{format:d.v7.ProductLink,mdxType:"ProductName"}),"."),(0,h.kt)("h2",{id:"introduction-to-modeling"},"Introduction To Modeling"),(0,h.kt)("p",null,"To define a ReBAC model in ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," we recommend:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"If you have an existing system: forget about how your system works today and start thinking about how you want it to work in the future."),(0,h.kt)("li",{parentName:"ul"},"Thinking about authorization starting from the resources, or objects as ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," calls them.")),(0,h.kt)("p",null,"If that sounds hard, don't worry! We'll guide you through it."),(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," is built to quickly and reliably make ",(0,h.kt)(d.uH,{section:"what-is-a-check-request",linkName:"authorization checks",mdxType:"ProductConcept"}),'. This means providing an answer to a question: "Can user U perform action A on object O?"',(0,h.kt)("p",null,"ReBAC systems determine access from a ",(0,h.kt)(d.uH,{section:"what-is-a-user",linkName:"user's",mdxType:"ProductConcept"})," ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation",mdxType:"ProductConcept"})," to an ",(0,h.kt)(d.uH,{section:"what-is-an-object",linkName:"object",mdxType:"ProductConcept"}),'. Authorization decisions are then yes or no answers to the question: "Does user U have relation R with object O?".'),(0,h.kt)(d.X3,{cols:2,style:{marginTop:"2rem",marginBottom:"2rem"},mdxType:"ColumnLayout"},(0,h.kt)(d.S1,{title:"General Authorization Check",description:(0,h.kt)("p",null,'"Can user ',(0,h.kt)("b",null,"U")," ",(0,h.kt)("u",null,"perform an action")," ",(0,h.kt)("b",null,"A")," on object ",(0,h.kt)("b",null,"O"),'?"'),appearance:"filled",mdxType:"CardBox"}),(0,h.kt)(d.S1,{title:"{ProductName} (ReBAC) Authorization Check",description:(0,h.kt)("p",null,'"Does user ',(0,h.kt)("b",null,"U")," ",(0,h.kt)("u",null,"have relation")," ",(0,h.kt)("b",null,"R")," with object ",(0,h.kt)("b",null,"O"),'?"'),mdxType:"CardBox"})),(0,h.kt)("p",null,"In the previous example, a relation R should be defined that implies permission to action A. For example:"),(0,h.kt)(d.X3,{cols:2,style:{marginTop:"2rem",marginBottom:"2rem"},mdxType:"ColumnLayout"},(0,h.kt)(d.S1,{title:"General Authorization Check",description:(0,h.kt)("p",null,'"Can user ',(0,h.kt)("b",null,"Jane")," ",(0,h.kt)("u",null,"perform action")," ",(0,h.kt)("b",null,"view")," on object ",(0,h.kt)("b",null,"project sandcastle"),'?"'),appearance:"filled",mdxType:"CardBox"}),(0,h.kt)(d.S1,{title:"{ProductName} (ReBAC) Authorization Check",description:(0,h.kt)("p",null,'"Can user ',(0,h.kt)("b",null,"Jane")," ",(0,h.kt)("u",null,"have relation")," ",(0,h.kt)("b",null,"view")," with object ",(0,h.kt)("b",null,"project sandcastle"),'?"'),mdxType:"CardBox"})),(0,h.kt)("p",null,"We'll provide more detailed examples throughout this article."),(0,h.kt)("p",null,"When you are modeling, you need to answer a more general question:"),(0,h.kt)("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(q,{mdxType:"FGAIcon"}),alignment:"left"},title:"Why could user U perform an action A on an object O?",mdxType:"CardBox"})),(0,h.kt)("p",null,"If you can answer that question for all types of objects in your system, then you can codify that into an authorization model."),(0,h.kt)("p",null,"Let's get started!"),(0,h.kt)("hr",null),(0,h.kt)("h2",{id:"a-process-for-defining-authorization-models"},"A Process For Defining Authorization Models"),(0,h.kt)("p",null,'Defining an authorization model requires codifying an answer to the question "why could user U perform an action A on an object O?" for all use cases or actions in your system. This is an iterative process. For the purpose of this guide, we\'ll go through one iteration of this process using a simplified Google Drive like system as an example.'),(0,h.kt)("p",null,"Steps for defining your authorization model:"),(0,h.kt)("ol",null,(0,h.kt)("li",{parentName:"ol"},(0,h.kt)("a",{parentName:"li",href:"#01-pick-the-most-important-feature"},"Pick the most important feature")),(0,h.kt)("li",{parentName:"ol"},(0,h.kt)("a",{parentName:"li",href:"#02-list-the-object-types"},"List the object types")),(0,h.kt)("li",{parentName:"ol"},(0,h.kt)("a",{parentName:"li",href:"#03-list-relations-for-those-types"},"List relations for those types")),(0,h.kt)("li",{parentName:"ol"},(0,h.kt)("a",{parentName:"li",href:"#04-define-relations"},"Define relations")),(0,h.kt)("li",{parentName:"ol"},(0,h.kt)("a",{parentName:"li",href:"#05-test-the-model"},"Test the model")),(0,h.kt)("li",{parentName:"ol"},(0,h.kt)("a",{parentName:"li",href:"#06-iterate"},"Iterate"))),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"The starting point",src:n(4636).Z,width:"911",height:"188"})),(0,h.kt)("h3",{id:"01-pick-the-most-important-feature"},"01. Pick The Most Important Feature"),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"Pick the most important feature",src:n(66979).Z,width:"911",height:"188"})),(0,h.kt)("p",null,"A feature, in the context of this document, is an action or related set of actions your users can perform in your system. We'll introduce an example feature later in this section."),(0,h.kt)("p",null,"Start with the most important feature. It doesn't have to be the most complex one, but it should be the most important one. You're probably more familiar with the authorization requirements for this feature than other less important use cases."),(0,h.kt)("admonition",{title:"Important",type:"caution"},(0,h.kt)("ul",{parentName:"admonition"},(0,h.kt)("li",{parentName:"ul"},"Requirement clarity is fundamental when defining an authorization model."),(0,h.kt)("li",{parentName:"ul"},"The scope of the feature is not important at this point. You can always iterate later."))),(0,h.kt)("h4",{id:"write-it-in-plain-language"},"Write It In Plain Language"),(0,h.kt)("p",null,'Once you\'ve picked a feature, describe its authorization related scope using simple language. Avoid using the word "roles", as this ties you to an RBAC way of thinking.'),(0,h.kt)("admonition",{type:"info"},(0,h.kt)("p",{parentName:"admonition"},'Roles don\'t "disappear" in ReBAC systems like ',(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),". Your users might ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/roles-and-permissions"},"have roles on a given object, rather than the entire system"),'. But starting from the term "role" might lead you down the wrong path. Instead it is better to discover roles while you are modeling.')),(0,h.kt)("p",null,"Your feature description should include the ",(0,h.kt)(d.uH,{section:"what-is-an-object",linkName:"objects",mdxType:"ProductConcept"}),", ",(0,h.kt)(d.uH,{section:"what-is-a-user",linkName:"users",mdxType:"ProductConcept"})," and ",(0,h.kt)(d.uH,{section:"what-is-a-user",linkName:"groups of users",mdxType:"ProductConcept"})," participating in the system. Sentences should look like this:"),(0,h.kt)("div",{style:{marginBottom:"2rem"}},(0,h.kt)(d.S1,{title:"A user {user} can perform action {action} to/on/in {object types} ... IF {conditions}",appearance:"filled",centerTitle:!0,mdxType:"CardBox"})),"Let's look at an example of a simplified Google Drive like system. We'll focus on the feature allowing users to create, read, update, delete, and share documents with other users.",(0,h.kt)("br",null),(0,h.kt)("br",null),(0,h.kt)("p",null,"This feature can be described with these sentences:"),(0,h.kt)(d.S1,{appearance:"filled",monoFontChildren:!0,mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can create a document in a drive if they are the owner of the drive."),(0,h.kt)("li",{parentName:"ul"},"A user can create a folder in a drive if they are the owner of the drive."),(0,h.kt)("li",{parentName:"ul"},"A user can create a document in a folder if they are the owner of the folder. The folder is the parent of the document."),(0,h.kt)("li",{parentName:"ul"},"A user can create a folder in a folder if they are the owner of the folder. The existing folder is the parent of the new folder.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can share a folder with another user or an organization as a viewer if they are an owner of the folder.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can view a document if they are an owner, viewer or editor of the document or if they are a viewer or owner of the folder/drive that is the parent of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can edit a document if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can change the owner of a document if they are an owner of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can change the owner of a folder if they are an owner of the folder.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("p",{parentName:"li"},"A user can be a member of an organization."),(0,h.kt)("span",{style:{color:"gray"}},"How a user is added as a member to an organization is beyond the scope of the feature we picked to write down."))),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can view a folder if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder."))),(0,h.kt)("h3",{id:"02-list-the-object-types"},"02. List The Object Types"),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"List the object types",src:n(65326).Z,width:"911",height:"188"})),(0,h.kt)("p",null,"Next make a list of the ",(0,h.kt)(d.uH,{section:"what-is-a-type",linkName:"types",mdxType:"ProductConcept"})," of objects in your system. You might be able to identify the objects in your system from your existing domain/database model."),(0,h.kt)("p",null,"Find all the objects in the previous step using this template:"),(0,h.kt)("div",{style:{marginBottom:"2rem"}},(0,h.kt)(d.S1,{title:"A user {user} can perform action {action} to/on/in {object type} ... IF {conditions}",appearance:"filled",centerTitle:!0,mdxType:"CardBox"})),(0,h.kt)("p",null,"These are all the object types from the previous step (in order of appearance) based on that template:"),(0,h.kt)(d.X3,{cols:3,style:{marginTop:"2rem",marginBottom:"2rem"},mdxType:"ColumnLayout"},(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(m,{mdxType:"DocIcon"}),alignment:"left",label:"Document"},mdxType:"CardBox"}),(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(b,{mdxType:"DirIcon"}),alignment:"left",label:"Folder"},mdxType:"CardBox"}),(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(P,{mdxType:"OrgIcon"}),alignment:"left",label:"Organization"},mdxType:"CardBox"})),(0,h.kt)("p",null,"Let's highlight all object types in ",(0,h.kt)("span",{className:"blue-highlight-text"},"blue"),":"),(0,h.kt)("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},(0,h.kt)(d.S1,{appearance:"filled",monoFontChildren:!0,mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can create a ",(0,h.kt)("span",{className:"blue-highlight-text"},"document")," in a drive if they are the owner of the drive."),(0,h.kt)("li",{parentName:"ul"},"A user can create a ",(0,h.kt)("span",{className:"blue-highlight-text"},"folder")," in a drive if they are the owner of the drive."),(0,h.kt)("li",{parentName:"ul"},"A user can create a ",(0,h.kt)("span",{className:"blue-highlight-text"},"document")," in a folder if they are the owner of the folder."),(0,h.kt)("li",{parentName:"ul"},"A user can create a ",(0,h.kt)("span",{className:"blue-highlight-text"},"folder")," in a folder if they are the owner of the folder.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can share a ",(0,h.kt)("span",{className:"blue-highlight-text"},"document")," with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can share a ",(0,h.kt)("span",{className:"blue-highlight-text"},"folder")," with another user or an organization as a viewer if they are an owner of the folder.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can view a ",(0,h.kt)("span",{className:"blue-highlight-text"},"document")," if they are an owner, viewer or editor of the document or if they are a viewer, owner of the folder/drive that is the parent of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can edit a ",(0,h.kt)("span",{className:"blue-highlight-text"},"document")," if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can change the owner of a ",(0,h.kt)("span",{className:"blue-highlight-text"},"document")," if they are an owner of the document.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can change the owner of a ",(0,h.kt)("span",{className:"blue-highlight-text"},"folder")," if they are an owner of the folder.")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("p",{parentName:"li"},"A user can be a member of an ",(0,h.kt)("span",{className:"blue-highlight-text"},"organization"),"."),(0,h.kt)("span",{style:{color:"gray"}},"How a user is added as a member to an organization is beyond the scope of the feature we picked to write down."))),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can view a ",(0,h.kt)("span",{className:"blue-highlight-text"},"folder")," if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder.")))),(0,h.kt)("p",null,"However, the list of object types is not finished. To complete the list of object types you must also add all the second nouns that appear in conditions as part of expressions of this format: ",(0,h.kt)("strong",{parentName:"p"},'"{first noun} of a/the {second noun}"'),"."),(0,h.kt)("div",{style:{marginBottom:"2rem"}},(0,h.kt)(d.S1,{centerTitle:!0,title:"... IF {first noun} of a/the {second noun}",appearance:"filled",mdxType:"CardBox"})),(0,h.kt)("p",null,"Let's highlight those expressions in ",(0,h.kt)("span",{className:"green-highlight-text"},"green"),":"),(0,h.kt)("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},(0,h.kt)(d.S1,{monoFontChildren:!0,appearance:"filled",mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can create a document in a drive if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the drive"),"."),(0,h.kt)("li",{parentName:"ul"},"A user can create a folder in a drive if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the drive"),"."),(0,h.kt)("li",{parentName:"ul"},"A user can create a document in a folder if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),". The folder is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),"."),(0,h.kt)("li",{parentName:"ul"},"A user can create a folder in a folder if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),". The existing folder is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the new folder")," .")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can share a document with another user or an organization as either editor or viewer if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner or editor of a document")," or if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder/drive")," that is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can share a folder with another user or an organization as a viewer if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can view a document if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner, viewer or editor of the document")," or if they are a ",(0,h.kt)("span",{className:"green-highlight-text"},"viewer or owner of the folder/drive")," that is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can edit a document if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner or editor of the document")," or if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder/drive")," that is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can change the owner of a document if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can change the owner of a folder if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("p",{parentName:"li"},"A user can be a member of an organization."),(0,h.kt)("span",{style:{color:"gray"}},"How a user is added as a member to an organization is beyond the scope of the feature we picked to write down."))),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user can view a folder if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),", or a ",(0,h.kt)("span",{className:"green-highlight-text"},"viewer or owner of either the parent folder of the folder, or the parent drive of the folder"),".")))),(0,h.kt)("p",null,'The only second noun we didn\'t have in our object type list is "Drive", so we\'ll add it to the list.\nWe will also need to add "User" to the list as it establishes the type of user who can establish relations.'),(0,h.kt)(d.X3,{cols:5,style:{marginTop:"2rem",marginBottom:"2rem"},mdxType:"ColumnLayout"},(0,h.kt)(d.S1,{icon:{alignment:"left",label:"User"},mdxType:"CardBox"}),(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(m,{mdxType:"DocIcon"}),alignment:"left",label:"Document"},mdxType:"CardBox"}),(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(b,{mdxType:"DirIcon"}),alignment:"left",label:"Folder"},mdxType:"CardBox"}),(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(P,{mdxType:"OrgIcon"}),alignment:"left",label:"Organization"},mdxType:"CardBox"}),(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(R,{mdxType:"DriveIcon"}),alignment:"left",label:"Drive"},mdxType:"CardBox"})),(0,h.kt)("p",null,"Now that we have a list of object types we can start defining them using the ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"}),":"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document"},{type:"folder"},{type:"organization"},{type:"drive"}]},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("admonition",{title:"Caution",type:"info"},(0,h.kt)("p",{parentName:"admonition"},"You're now in the process of building a version you can use. The model above is not yet a valid authorization model accepted by ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),".")),(0,h.kt)("admonition",{title:"Important",type:"info"},(0,h.kt)("p",{parentName:"admonition"},'In a few cases other users can be part of determining whether an action can be performed on an action or not. Social media is an example of this "a user can comment on a picture if they are a friend of the user that published it".'),(0,h.kt)("p",{parentName:"admonition"},"In those cases ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/object-to-object-relationships"},(0,h.kt)("strong",{parentName:"a"},"User")," should also be an object type"),'. Following the last recommendation, we would discover the User type because it is a second noun in an expression: "friend of the user".')),(0,h.kt)("h3",{id:"03-list-relations-for-those-types"},"03. List Relations For Those Types"),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"List relations for those types",src:n(81566).Z,width:"911",height:"188"})),(0,h.kt)("p",null,"Each of the previously defined types has a set of relations. ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"Relations",mdxType:"ProductConcept"})," are an important component in your model. After all, ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," is a ",(0,h.kt)(d.UV,{linkName:"Relationship Based Access Control (ReBAC)",section:"what-is-relationship-based-access-control-rebac",mdxType:"IntroductionSection"})," system."),(0,h.kt)("p",null,"To identify relations for a type we in the write-up we can perform an exercise similar to the one we did in ",(0,h.kt)("a",{parentName:"p",href:"#02-list-the-object-types"},"list the type of objects in your system"),"."),(0,h.kt)("p",null,"Relations for a type {type} will be all of these:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},'any noun that is the {noun} of a "{noun} of a/an/the {type}" expression. ',(0,h.kt)("strong",{parentName:"li"},"These are typically the Foreign Keys in a database.")," We'll highlight these in ",(0,h.kt)("span",{className:"green-highlight-text"},"green"),"."),(0,h.kt)("li",{parentName:"ul"},'any verb or action that is the {action} of a "can {action} (in) a/an {type}" expression. ',(0,h.kt)("strong",{parentName:"li"},"These are typically the permissions for a type.")," We'll highlight these in ",(0,h.kt)("span",{className:"yellow-highlight-text"},"yellow"),".")),(0,h.kt)("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},(0,h.kt)(d.S1,{monoFontChildren:!0,appearance:"filled",mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can create a document in a drive")," if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the drive"),"."),(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can create a folder in a drive")," if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the drive"),"."),(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can create a document in a folder")," if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),". The folder is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),"."),(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can create a folder in a folder")," if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),". The existing folder is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the new folder"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can share a document with another user or an organization")," as either editor or viewer if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner or editor of a document")," or if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder/drive")," that is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can share a folder with another user or an organization")," as a viewer if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can view a document")," if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner, viewer or editor of the document")," or if they are a ",(0,h.kt)("span",{className:"green-highlight-text"},"viewer or owner of the folder/drive")," that is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can edit a document")," if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner or editor of the document")," or if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder/drive")," that is the ",(0,h.kt)("span",{className:"green-highlight-text"},"parent of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can change the owner of a document")," if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the document"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can change the owner of a folder")," if they are an ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),".")),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("p",{parentName:"li"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can be a member of an organization"),"."),(0,h.kt)("span",{style:{color:"gray"}},"How a user is added as a member to an organization is beyond the scope of the feature we picked to write down."))),(0,h.kt)("hr",null),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"A user ",(0,h.kt)("span",{className:"yellow-highlight-text"},"can view a folder")," if they are the ",(0,h.kt)("span",{className:"green-highlight-text"},"owner of the folder"),", or a ",(0,h.kt)("span",{className:"green-highlight-text"},"viewer or owner of either the parent folder of the folder, or the parent drive of the folder"),".")))),(0,h.kt)("p",null,"The resulting list is:"),(0,h.kt)(d.X3,{cols:4,equalWidth:!0,style:{marginTop:"2rem",marginBottom:"2rem"},mdxType:"ColumnLayout"},(0,h.kt)(d.S1,{smallFontChildren:!0,icon:{icon:(0,h.kt)(m,{mdxType:"DocIcon"}),alignment:"middle",label:"Document"},mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"parent"),(0,h.kt)("li",{parentName:"ul"},"can_share"),(0,h.kt)("li",{parentName:"ul"},"owner"),(0,h.kt)("li",{parentName:"ul"},"editor"),(0,h.kt)("li",{parentName:"ul"},"can_write"),(0,h.kt)("li",{parentName:"ul"},"can_view"),(0,h.kt)("li",{parentName:"ul"},"viewer"),(0,h.kt)("li",{parentName:"ul"},"can_change_owner"))),(0,h.kt)(d.S1,{smallFontChildren:!0,icon:{icon:(0,h.kt)(b,{mdxType:"DirIcon"}),alignment:"middle",label:"Folder"},mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"can_create_document"),(0,h.kt)("li",{parentName:"ul"},"owner"),(0,h.kt)("li",{parentName:"ul"},"can_create_folder"),(0,h.kt)("li",{parentName:"ul"},"can_view"),(0,h.kt)("li",{parentName:"ul"},"viewer"),(0,h.kt)("li",{parentName:"ul"},"parent"))),(0,h.kt)(d.S1,{smallFontChildren:!0,icon:{icon:(0,h.kt)(P,{mdxType:"OrgIcon"}),alignment:"middle",label:"Organization"},mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"member"))),(0,h.kt)(d.S1,{smallFontChildren:!0,icon:{icon:(0,h.kt)(R,{mdxType:"DriveIcon"}),alignment:"middle",label:"Drive"},mdxType:"CardBox"},(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"can_create_document"),(0,h.kt)("li",{parentName:"ul"},"owner"),(0,h.kt)("li",{parentName:"ul"},"can_create_folder")))),(0,h.kt)("admonition",{type:"info"},(0,h.kt)("p",{parentName:"admonition"},"In ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),", relations can only have alphanumeric characters, underscores and hyphens. We recommend using underscore (","_",') to separate words and removing prepositions. E.g.: "can create a document" can become "can_create_document" or "create_document" if you are into brevity.')),(0,h.kt)("p",null,"Using the ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"})," we can enumerate the relations for each type:"),(0,h.kt)("pre",null,(0,h.kt)("code",{parentName:"pre",className:"language-dsl.openfga"},"model\n schema 1.1\ntype user\ntype document\n relations\n define parent:\n define owner:\n define editor:\n define viewer:\n define can_share:\n define can_view:\n define can_write:\n define can_change_owner:\ntype folder\n relations\n define owner:\n define parent:\n define viewer:\n define can_create_folder:\n define can_create_document:\n define can_view:\ntype organization\n relations\n define member:\ntype drive\n relations\n define owner:\n define can_create_document:\n define can_create_folder:\n")),(0,h.kt)("admonition",{title:"Caution",type:"info"},(0,h.kt)("p",{parentName:"admonition"},"You're now in the process of building a version you can use. The model above is not yet a valid authorization model accepted by ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),".")),(0,h.kt)("h3",{id:"04-define-relations"},"04. Define Relations"),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"Define relations",src:n(78300).Z,width:"911",height:"188"})),(0,h.kt)("p",null,"We will use the ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"})," to create a ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation definition",mdxType:"ProductConcept"})," for each of the relations we identified. At this stage we will encode the answers to the question we asked at the beginning of the document:."),(0,h.kt)("div",{style:{marginBottom:"2rem"}},(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(q,{mdxType:"FGAIcon"}),alignment:"left"},title:"Why could a user U, perform an action A on an object O?",mdxType:"CardBox"})),(0,h.kt)("p",null,"We are going to go over each type and each of its relations and create a definition for it."),(0,h.kt)("div",{style:{display:"inline-block"}},(0,h.kt)(P,{mdxType:"OrgIcon"}),(0,h.kt)("div",{style:{float:"right",marginLeft:"16px"}},(0,h.kt)("h4",{id:"type-organization"},"Type: Organization"))),(0,h.kt)("p",null,'We recommend starting from objects that represent groups/containers of users. For features in most systems these are easy to define and help reason about the other types. Examples of type names for these are "team", "group", "organization", etc.'),(0,h.kt)("h5",{id:"relation-member"},"Relation: Member"),(0,h.kt)("p",null,"The member relation is used to tell ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," about the members of an organization."),(0,h.kt)("admonition",{title:"Important",type:"info"},(0,h.kt)("p",{parentName:"admonition"},"Relation names in ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),' are arbitrary strings. There are no reserved relation names. You can use "member" or "part_of" or anything else to refer to a user that is part of a team/organization.')),(0,h.kt)("p",null,"Remember ",(0,h.kt)("em",{parentName:"p"},'"How a user is added as a member to an organization is beyond the scope of this feature."')," For the purposes of this model the relation definition should be:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"organization",relations:{member:{this:""}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("p",null,"Why? This relation definition states:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("p",{parentName:"li"},"That organizations have members")),(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("p",{parentName:"li"},"That the members of an organization with id {id} are all users described by tuples of the form:"),(0,h.kt)("p",{parentName:"li"},(0,h.kt)("inlineCode",{parentName:"p"},'{ user: {user-id}, relation: "member", object: "organization:{id}" }')))),(0,h.kt)("admonition",{title:"Important",type:"info"},(0,h.kt)("p",{parentName:"admonition"},"Relation definitions of the form \u201cdefine {relation}: ","[user, organization#member]",'" are fairly common. They are used to express that relationships "to the object with that relation" (e.g. "users" of type user or "member of organization") can be assigned by your system and that only the users that have that relation are those with a ',(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/direct-relationships"},"direct relationship"),".")),(0,h.kt)("p",null,"You can read more about group membership and types in ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/user-groups"},"Modeling User Groups"),"."),(0,h.kt)("p",null,"For the direct relationships, we need to figure out the object types that makes sense for the relationship tuples' user. In our organization example, it makes sense for member relations to have user of type"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"user"),(0,h.kt)("li",{parentName:"ul"},"organization#member (i.e., other organization's member)")),(0,h.kt)("p",null,"However, it will not make sense for organization member's user to be of type document, folder or drive."),(0,h.kt)("p",null,"We will specify this logic as part of directly ",(0,h.kt)(d.uH,{section:"what-is-a-directly-related-user-type",linkName:"directly related user type",mdxType:"ProductConcept"}),"."),(0,h.kt)("admonition",{title:"Side note",type:"note"},(0,h.kt)("p",{parentName:"admonition"},'This also automatically supports nested organizational membership if you want such a feature in your system. You could use relationship tuples like the following one to express that "members of organization A are members of organization B":'),(0,h.kt)("pre",{parentName:"admonition"},(0,h.kt)("code",{parentName:"pre"},'{ user: "organization:A#member", relation: "member", object: "organization:B"}\n')),(0,h.kt)("p",{parentName:"admonition"},"If you want to learn more, you can read further about this in ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/user-groups"},"Modeling User Groups")," and ",(0,h.kt)("a",{parentName:"p",href:"/docs/interacting/managing-relationships-between-objects"},"Managing Relationships Between Objects"),".")),(0,h.kt)("h5",{id:"complete-type-definition"},"Complete Type Definition"),(0,h.kt)("p",null,"The complete ",(0,h.kt)(d.uH,{section:"what-is-a-type-definition",linkName:"type definition",mdxType:"ProductConcept"})," for the ",(0,h.kt)("strong",{parentName:"p"},"organization")," type is:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"organization",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("div",{style:{display:"inline-block"}},(0,h.kt)(m,{mdxType:"DocIcon"}),(0,h.kt)("div",{style:{float:"right",marginLeft:"16px"}},(0,h.kt)("h4",{id:"type-document"},"Type: Document"))),(0,h.kt)("p",null,'After defining your "group" like types, continue with the most important type for the feature: the one that allows the main use case. In this case "document", since the main use case for users is to create, write, read and collaborate on documents.'),(0,h.kt)("p",null,"Defining relations for the main type lets you to focus on your core use case, and will likely make other type definitions easier."),(0,h.kt)("h5",{id:"relation-owner"},"Relation: Owner"),(0,h.kt)("p",null,"The owner relation is used to tell ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," which users are owners of the document."),(0,h.kt)("admonition",{title:"Important",type:"info"},(0,h.kt)("p",{parentName:"admonition"},"In the current version, there is no way to state that there is only one owner in the authorization model. The application must limit this ",(0,h.kt)(d.uH,{section:"what-is-a-user",linkName:"set of users",mdxType:"ProductConcept"})," to just one owner if that is a requirement.")),(0,h.kt)("p",null,"When a document is created, a relationship tuple will be stored in ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," representing this relationship between owner and document. This is an example of a ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/direct-access"},"user to object relationship"),"."),(0,h.kt)("p",null,"The relation definition then should be:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"document",relations:{owner:{this:""}},metadata:{relations:{owner:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("p",null,"Why? This ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation definition",mdxType:"ProductConcept"})," states that:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"each document can have one or more owners"),(0,h.kt)("li",{parentName:"ul"},"owners of a document are assignable by creating a tuple of the format\n",(0,h.kt)("inlineCode",{parentName:"li"},'{ user: "{user_id}", relation: "owner", object: "document:{id}" }')," for individual users")),(0,h.kt)("h5",{id:"relation-editor"},"Relation: Editor"),(0,h.kt)("p",null,"The editor relation is used to tell ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," which users are editors of the document."),(0,h.kt)("p",null,"When a user shares a document with another user or set of users as editor, a relationship tuple will be stored in ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," representing this relationship between editor and document. This is an example of a ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/direct-access"},"users to object relationship"),"."),(0,h.kt)("p",null,"The relation definition then should be:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"document",relations:{editor:{this:""}},metadata:{relations:{editor:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("p",null,"Why? This relation definition states that:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"each document can have editors"),(0,h.kt)("li",{parentName:"ul"},"the editor(s) of a document are assignable by creating a tuple with shape\n",(0,h.kt)("inlineCode",{parentName:"li"},'{ user: "{user_id}", relation: "editor", object: "document:{id}" }')," for individual users")),(0,h.kt)("p",null,"This also supports making all members in an organization editors of the document, through a ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/user-groups"},"group to object relationship"),". A relationship tuple like the following one states that the members of organization A are editors of document 0001."),(0,h.kt)(d.Wz,{relationshipTuples:[{user:"organization:A#member",relation:"editor",object:"document:0001"}],mdxType:"RelationshipTuplesViewer"}),(0,h.kt)("p",null,"You can learn more about this in ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/user-groups"},"Modeling User Groups"),"."),(0,h.kt)("h5",{id:"relation-viewer"},"Relation: Viewer"),(0,h.kt)("p",null,"The viewer relation is similar to the document's ",(0,h.kt)("a",{parentName:"p",href:"#relation-editor"},"editor relation"),". It will be defined like this:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"document",relations:{viewer:{this:""}},metadata:{relations:{viewer:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("h5",{id:"relation-parent"},"Relation: Parent"),(0,h.kt)("p",null,"The parent relation is used to tell ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," which folder or drive is the parent of the document."),(0,h.kt)("admonition",{title:"Important",type:"caution"},(0,h.kt)("p",{parentName:"admonition"},"Relation names in ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),' are arbitrary strings. There are no reserved relation names. You can use "parent", "container" or "ancestor" to refer to a "parent folder".')),(0,h.kt)("p",null,"This relation is different from the others we have seen so far, as it is a relation between two objects (a ",(0,h.kt)("strong",{parentName:"p"},"folder")," and or ",(0,h.kt)("strong",{parentName:"p"},"drive")," that is the parent of the ",(0,h.kt)("strong",{parentName:"p"},"document"),"). This is known as an ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/object-to-object-relationships"},"object to object relationship"),", of which ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/parent-child"},"parent-child is a particular case"),"."),(0,h.kt)("p",null,"When a document is created a relationship tuple will be stored in ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," to represent this relationship between parent and document. The relation definition then should be:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{type:"document",relations:{parent:{this:""}},metadata:{relations:{parent:{directly_related_user_types:[{type:"folder"},{type:"drive"}]}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("p",null,"Why? This relation definition states that:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"documents may have a parent"),(0,h.kt)("li",{parentName:"ul"},"the parent(s) of a document with id {id} is either a folder or a drive, described by one of these relationship tuples:",(0,h.kt)("ul",{parentName:"li"},(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("inlineCode",{parentName:"li"},'{ user: "folder:{id}", relation: "parent", object: "document:{id}" }')),(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("inlineCode",{parentName:"li"},'{ user: "drive:{id}", relation: "parent", object: "document:{id}" }'))))),(0,h.kt)("p",null,"We can use ",(0,h.kt)("a",{parentName:"p",href:"/docs/configuration-language#the-direct-relationship-type-restrictions"},"direct type restriction")," to ensure a document's parent can only be an object of type either drive or folder."),(0,h.kt)("admonition",{title:"Side note",type:"note"},(0,h.kt)("p",{parentName:"admonition"},'You might have noticed that the "user" in the tuple is an object. This is a special syntax ',(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"}),' accepts in the "user" parameter to write ',(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/object-to-object-relationships"},"object to object relationships"),". You can read more about writing data to manage object to object relationships in ",(0,h.kt)("a",{parentName:"p",href:"/docs/interacting/managing-relationships-between-objects"},"Managing Relationships Between Objects"),".")),(0,h.kt)("h5",{id:"relation-can_share"},"Relation: can_share"),(0,h.kt)("p",null,"We need to express the following in the ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation definition",mdxType:"ProductConcept"}),":"),(0,h.kt)("p",null,(0,h.kt)("em",{parentName:"p"},"A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder that is the parent of the document.")),(0,h.kt)("p",null,"We can achieve that with the following definition using ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"}),":"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,skipVersion:!0,configuration:{type:"document",relations:{can_share:{union:{child:[{computedUserset:{object:"",relation:"owner"}},{computedUserset:{object:"",relation:"editor"}},{tupleToUserset:{computedUserset:{object:"",relation:"owner"},tupleset:{object:"",relation:"parent"}}}]}}}},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("p",null,"There are a few key things here:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},(0,h.kt)("strong",{parentName:"li"},"We don't use a ",(0,h.kt)("a",{parentName:"strong",href:"/docs/configuration-language#the-direct-relationship-type-restrictions"},"direct relationship type restriction")," as part of the definition.")," can_share is a common example of representing a permission that is defined in terms of other relations but is not directly assignable by the system."),(0,h.kt)("li",{parentName:"ul"},"The relation definition contains a ",(0,h.kt)("a",{parentName:"li",href:"/docs/configuration-language#the-union-operator"},"union operator"),' separating a list of relations that the user must have with the object in order to "be able to share the document". It is any of:',(0,h.kt)("ul",{parentName:"li"},(0,h.kt)("li",{parentName:"ul"},"Being an owner of the document"),(0,h.kt)("li",{parentName:"ul"},"Being an editor of the document"),(0,h.kt)("li",{parentName:"ul"},"Being an owner of the parent of the document. Whether the parent is a drive or a folder is not important, as they both have an owner relation.")))),(0,h.kt)("p",null,"You can read more about the aforementioned items in ",(0,h.kt)("a",{parentName:"p",href:"/docs/modeling/roles-and-permissions"},"Modeling Roles and Permissions"),"."),(0,h.kt)("h5",{id:"relation-can_view"},"Relation: can_view"),(0,h.kt)("p",null,"We need to express the following in the ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation definition",mdxType:"ProductConcept"}),":"),(0,h.kt)("p",null,(0,h.kt)("em",{parentName:"p"},"A user can view a document if they are an owner, viewer or editor of a document or if they are a viewer, owner of the folder/drive that is the parent of the document.")),(0,h.kt)("p",null,"Similar to the ",(0,h.kt)("a",{parentName:"p",href:"#relation-can_share"},"can_share relation"),", we can achieve that with the following definition using ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"}),":"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,skipVersion:!0,configuration:{type:"document",relations:{can_view:{union:{child:[{computedUserset:{object:"",relation:"viewer"}},{computedUserset:{object:"",relation:"editor"}},{computedUserset:{object:"",relation:"owner"}},{tupleToUserset:{computedUserset:{object:"",relation:"viewer"},tupleset:{object:"",relation:"parent"}}},{tupleToUserset:{computedUserset:{object:"",relation:"owner"},tupleset:{object:"",relation:"parent"}}}]}}}},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("h5",{id:"relation-can_write"},"Relation: can_write"),(0,h.kt)("p",null,"We need to express the following in the ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation definition",mdxType:"ProductConcept"}),":"),(0,h.kt)("p",null,(0,h.kt)("em",{parentName:"p"},"A user can write a document if they are an owner or editor of a document or if they are an owner or editor of the folder/drive that is the parent of the document.")),(0,h.kt)("p",null,"Similar to the ",(0,h.kt)("a",{parentName:"p",href:"#relation-can_share"},"can_share relation"),", we can achieve that with the following definition using ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"}),":"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,skipVersion:!0,configuration:{type:"document",relations:{can_write:{union:{child:[{computedUserset:{object:"",relation:"editor"}},{computedUserset:{object:"",relation:"owner"}},{tupleToUserset:{computedUserset:{object:"",relation:"owner"},tupleset:{object:"",relation:"parent"}}}]}}}},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("h5",{id:"relation-can_change_owner"},"Relation: can_change_owner"),(0,h.kt)("p",null,"We need to express the following in the ",(0,h.kt)(d.uH,{section:"what-is-a-relation",linkName:"relation definition",mdxType:"ProductConcept"}),":"),(0,h.kt)("p",null,(0,h.kt)("em",{parentName:"p"},"A user can change the owner of a document if they are an owner of the document.")),(0,h.kt)("p",null,"Similar to the ",(0,h.kt)("a",{parentName:"p",href:"#relation-can_share"},"can_share relation"),", we can achieve that with the following definition using ",(0,h.kt)(d.DC,{link:"../configuration-language",name:"{ProductName} Configuration Language",mdxType:"UpdateProductNameInLinks"}),":"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,skipVersion:!0,configuration:{type:"document",relations:{can_change_owner:{computedUserset:{object:"",relation:"owner"}}}},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("h5",{id:"complete-type-definition-1"},"Complete Type Definition"),(0,h.kt)("p",null,"The complete ",(0,h.kt)(d.uH,{section:"what-is-a-type-definition",linkName:"type definition",mdxType:"ProductConcept"})," for the document type is:"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"document",relations:{owner:{this:{}},editor:{this:{}},viewer:{this:{}},parent:{this:{}},can_share:{union:{child:[{computedUserset:{object:"",relation:"owner"}},{computedUserset:{object:"",relation:"editor"}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"owner"}}}]}},can_view:{union:{child:[{computedUserset:{object:"",relation:"viewer"}},{computedUserset:{object:"",relation:"editor"}},{computedUserset:{object:"",relation:"owner"}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"viewer"}}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"editor"}}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"owner"}}}]}},can_write:{union:{child:[{computedUserset:{object:"",relation:"editor"}},{computedUserset:{object:"",relation:"owner"}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"owner"}}}]}},can_change_owner:{computedUserset:{object:"",relation:"owner"}}},metadata:{relations:{owner:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]},editor:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]},viewer:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]},parent:{directly_related_user_types:[{type:"folder"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("p",null,"Combining the type definitions for document and organization, we have"),(0,h.kt)(d.lG,{onlyShow:d.kf.Friendly2,configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"organization",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]}}}},{type:"document",relations:{owner:{this:{}},editor:{this:{}},viewer:{this:{}},parent:{this:{}},can_share:{union:{child:[{computedUserset:{object:"",relation:"owner"}},{computedUserset:{object:"",relation:"editor"}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"owner"}}}]}},can_view:{union:{child:[{computedUserset:{object:"",relation:"viewer"}},{computedUserset:{object:"",relation:"editor"}},{computedUserset:{object:"",relation:"owner"}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"viewer"}}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"editor"}}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"owner"}}}]}},can_write:{union:{child:[{computedUserset:{object:"",relation:"editor"}},{computedUserset:{object:"",relation:"owner"}},{tupleToUserset:{tupleset:{object:"",relation:"parent"},computedUserset:{object:"",relation:"owner"}}}]}},can_change_owner:{computedUserset:{object:"",relation:"owner"}}},metadata:{relations:{owner:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]},editor:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]},viewer:{directly_related_user_types:[{type:"user"},{type:"organization",relation:"member"}]},parent:{directly_related_user_types:[{type:"folder"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,h.kt)("admonition",{type:"note"},(0,h.kt)("p",{parentName:"admonition"},"The ",(0,h.kt)(d.rZ,{mdxType:"ProductName"})," authorization model API and SDK only accepts JSON in its input. To convert from DSL to JSON, you may use the ",(0,h.kt)("a",{parentName:"p",href:"https://github.com/openfga/cli"},"FGA CLI")," to run ",(0,h.kt)("inlineCode",{parentName:"p"},"fga model transform"),".")),(0,h.kt)("h3",{id:"05-test-the-model"},"05. Test The Model"),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"Test the model",src:n(77478).Z,width:"911",height:"188"})),(0,h.kt)("p",null,"Once you have defined your group like types and the most important type for your feature you want to ensure everything is working as expected. This means testing the model."),(0,h.kt)("p",null,"How? Remember from the introduction that ",(0,h.kt)("strong",{parentName:"p"},(0,h.kt)(d.rZ,{format:d.v7.LongForm,mdxType:"ProductName"}),"'s")," main job is to answer the question:"),(0,h.kt)("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},(0,h.kt)(d.S1,{icon:{icon:(0,h.kt)(q,{mdxType:"FGAIcon"}),alignment:"left"},title:"Can user U, perform an action A on an object O?",mdxType:"CardBox"})),(0,h.kt)("p",null,"The ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," service does that by checking if a user has a particular relationship to an object, based on your authorization model and relationship tuples."),(0,h.kt)(d.X3,{cols:2,style:{marginTop:"2rem",marginBottom:"2rem"},mdxType:"ColumnLayout"},(0,h.kt)(d.S1,{title:"General Authorization Check",description:(0,h.kt)("p",null,'"Can user ',(0,h.kt)("b",null,"U")," ",(0,h.kt)("u",null,"perform action")," ",(0,h.kt)("b",null,"A")," on object ",(0,h.kt)("b",null,"O"),'?"'),appearance:"filled",mdxType:"CardBox"}),(0,h.kt)(d.S1,{title:"{ProductName} (ReBAC) Authorization Check",description:(0,h.kt)("p",null,'"Can user ',(0,h.kt)("b",null,"U")," ",(0,h.kt)("u",null,"have relation")," ",(0,h.kt)("b",null,"R")," with object ",(0,h.kt)("b",null,"O"),'?"'),mdxType:"CardBox"})),(0,h.kt)("p",null,"What we want is to ensure that given our current authorization model and some sample relationship tuples, we get the expected results for those questions."),(0,h.kt)("p",null,"So we'll write some relationship tuples and assertions. An ",(0,h.kt)(d.rZ,{format:d.v7.ShortForm,mdxType:"ProductName"})," assertion takes one of these forms:"),(0,h.kt)("ol",null,(0,h.kt)("li",{parentName:"ol"},"user U ",(0,h.kt)("strong",{parentName:"li"},"has")," relation R with object O"),(0,h.kt)("li",{parentName:"ol"},"user U ",(0,h.kt)("strong",{parentName:"li"},"does not have")," relation R with object O")),(0,h.kt)("p",null,"Much like automated tests and assertions work for programming languages, you can use assertions to prevent regressions while you change your tuples and authorization model. Essentially, assertions help you ensure things work like you expect them to work as you iterate."),(0,h.kt)("h4",{id:"write-relationship-tuples"},"Write Relationship Tuples"),(0,h.kt)("p",null,"The relationship tuples should represent real examples from your system with fake data."),(0,h.kt)("p",null,"At this point you haven't defined the drive or folder types, so you can only test things based on users or organization members' relationships to documents. Let's imagine an example setup and write the relationship tuples for it:"),(0,h.kt)("table",null,(0,h.kt)("thead",{parentName:"table"},(0,h.kt)("tr",{parentName:"thead"},(0,h.kt)("th",{parentName:"tr",align:null},"System Action"),(0,h.kt)("th",{parentName:"tr",align:null},"Relationship Tuple"))),(0,h.kt)("tbody",{parentName:"table"},(0,h.kt)("tr",{parentName:"tbody"},(0,h.kt)("td",{parentName:"tr",align:null},"Anne is a member of the contoso organization"),(0,h.kt)("td",{parentName:"tr",align:null},(0,h.kt)("inlineCode",{parentName:"td"},'{ user:"user:anne", relation: "member", object: "organization:contoso"}'))),(0,h.kt)("tr",{parentName:"tbody"},(0,h.kt)("td",{parentName:"tr",align:null},"Beth is a member of fabrikam organization"),(0,h.kt)("td",{parentName:"tr",align:null},(0,h.kt)("inlineCode",{parentName:"td"},'{ user:"user:beth", relation: "member", object: "organization:fabrikam"}'))),(0,h.kt)("tr",{parentName:"tbody"},(0,h.kt)("td",{parentName:"tr",align:null},"Anne creates document:1, becomes its owner."),(0,h.kt)("td",{parentName:"tr",align:null},(0,h.kt)("inlineCode",{parentName:"td"},'{ user:"user:anne", relation: "owner", object: "document:1"}'))),(0,h.kt)("tr",{parentName:"tbody"},(0,h.kt)("td",{parentName:"tr",align:null},"Anne shares document:1 with all members of the fabrikam organization as editor."),(0,h.kt)("td",{parentName:"tr",align:null},(0,h.kt)("inlineCode",{parentName:"td"},'{ user:"organization:fabrikam#member", relation: "editor", object: "document:1"}'))),(0,h.kt)("tr",{parentName:"tbody"},(0,h.kt)("td",{parentName:"tr",align:null},"Beth creates document:2 and becomes its owner."),(0,h.kt)("td",{parentName:"tr",align:null},(0,h.kt)("inlineCode",{parentName:"td"},'{ user:"user:beth", relation: "owner", object: "document:2"}'))),(0,h.kt)("tr",{parentName:"tbody"},(0,h.kt)("td",{parentName:"tr",align:null},"Beth shares document:2 with all members of the contoso organization as viewer"),(0,h.kt)("td",{parentName:"tr",align:null},(0,h.kt)("inlineCode",{parentName:"td"},'{ user:"organization:contoso#member", relation: "viewer", object: "document:2"}'))))),(0,h.kt)("p",null,"Follow these steps to create relationship tuples."),(0,h.kt)("h4",{id:"create-assertions"},"Create Assertions"),(0,h.kt)("p",null,"According to our ",(0,h.kt)("a",{parentName:"p",href:"#write-it-in-plain-language"},"written down model")," and the ",(0,h.kt)("a",{parentName:"p",href:"#write-relationship-tuples"},"relationship tuples")," from the previous step, these assertions should be specified:"),(0,h.kt)("p",null,"Because anne is the owner of document:1:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_share")," with document:1"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_write")," with document:1"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_view")," with document:1"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_change_owner")," with document:1")),(0,h.kt)("p",null,"Because beth is a member of organization:fabrikam and members of organization:fabrikam are writer of document:1:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," does not have relation ",(0,h.kt)("strong",{parentName:"li"},"can_share")," with document:1"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_write")," with document:1"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_view")," with document:1"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," does not have relation ",(0,h.kt)("strong",{parentName:"li"},"can_change_owner")," with document:1")),(0,h.kt)("p",null,"Because beth is the owner of document:2:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_share")," with document:2"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_write")," with document:2"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_view")," with document:2"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"beth")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_change_owner")," with document:2")),(0,h.kt)("p",null,"Because anne is a member of organization:contoso and members of organization:contoso are viewer of document:2:"),(0,h.kt)("ul",null,(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," does not have relation ",(0,h.kt)("strong",{parentName:"li"},"can_share")," with document:2"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," does not have relation ",(0,h.kt)("strong",{parentName:"li"},"can_write")," with document:2"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," has relation ",(0,h.kt)("strong",{parentName:"li"},"can_view")," with document:2"),(0,h.kt)("li",{parentName:"ul"},"user ",(0,h.kt)("strong",{parentName:"li"},"anne")," does not have relation ",(0,h.kt)("strong",{parentName:"li"},"can_change_owner")," with document:2")),(0,h.kt)("p",null,"Follow these steps to create assertions."),(0,h.kt)("h4",{id:"run-assertions"},"Run Assertions"),(0,h.kt)("p",null,"Run the assertions. They should all pass. If they don't you can use the query view to understand what is causing them to fail, and then update your authorization model and relation tuples accordingly."),(0,h.kt)("p",null,"Once all the assertions are working, you should continue the iterative process of working on your model."),(0,h.kt)("h3",{id:"06-iterate"},"06. Iterate"),(0,h.kt)("p",null,(0,h.kt)("img",{alt:"Iterate",src:n(56882).Z,width:"911",height:"208"})),(0,h.kt)("p",null,"We'll leave the exercise of defining the drive and folder relations, then adding relationship tuples and assertions to you. Once you are finished, check out the complete example to see how you did."),(0,h.kt)("p",null,"When defining the authorization model for your own system, you would continue iterating on the ",(0,h.kt)(d.uH,{section:"what-is-an-authorization-model",linkName:"authorization model",mdxType:"ProductConcept"})," with the ",(0,h.kt)("a",{parentName:"p",href:"#01-pick-the-most-important-feature"},"next feature")," and so on."),(0,h.kt)("p",null,"If you have any questions about this model or others, or would like some help creating your model, drop by our ",(0,h.kt)("a",{parentName:"p",href:"https://discord.gg/8naAwJfWN6"},"Discord"),"."),(0,h.kt)("h2",{id:"related-sections"},"Related Sections"),(0,h.kt)(d.$q,{description:"Check the following sections for more on how to model with {ProductName}.",relatedLinks:[{title:"{ProductName} Concepts",description:"Learn about the {ProductName} Concepts.",link:"../concepts",id:"../concepts"},{title:"Configuration Language",description:"Learn about {ProductName} Configuration Language.",link:"../configuration-language",id:"../configuration-language"},{title:"Direct Access",description:"Learn about modeling user access to an object.",link:"./direct-access",id:"./direct-access"}],mdxType:"RelatedSection"}))}te.isMDXComponent=!0},4636:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-01-55e7a873e7fdd4aa810922af9606ad0c.svg"},66979:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-02-46c38ef0a05b5eac7e8a85c3ca02e20f.svg"},65326:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-03-3734cdad8827d03f6a76db672f13be46.svg"},81566:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-04-e8b2110197173b6308a3f797e76aa471.svg"},78300:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-05-ffffd65d9b3eb843353c35f2f663a0c5.svg"},77478:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-06-8eb4b8f4a925670b0ff05fa86c4b890e.svg"},56882:(e,t,n)=>{n.d(t,{Z:()=>a});const a=n.p+"assets/images/getting-started-diagram-07-110858004c2892e28df4c404a50abce2.svg"}}]); \ No newline at end of file diff --git a/assets/js/97140aee.320f26c4.js b/assets/js/97140aee.320f26c4.js deleted file mode 100644 index de1a79f95..000000000 --- a/assets/js/97140aee.320f26c4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkopenfga_dev=self.webpackChunkopenfga_dev||[]).push([[521],{1840:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>c,frontMatter:()=>o,metadata:()=>l,toc:()=>u});var n=a(87462),i=(a(67294),a(3905)),r=a(5270);const o={title:"Entitlements",description:"Modeling entitlements for a system",sidebar_position:1,slug:"/modeling/advanced/entitlements"},s="Modeling Entitlements for a System with ",l={unversionedId:"content/modeling/advanced/entitlements",id:"content/modeling/advanced/entitlements",title:"Entitlements",description:"Modeling entitlements for a system",source:"@site/docs/content/modeling/advanced/entitlements.mdx",sourceDirName:"content/modeling/advanced",slug:"/modeling/advanced/entitlements",permalink:"/docs/modeling/advanced/entitlements",draft:!1,editUrl:"https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/advanced/entitlements.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Entitlements",description:"Modeling entitlements for a system",sidebar_position:1,slug:"/modeling/advanced/entitlements"},sidebar:"docs",previous:{title:"IoT",permalink:"/docs/modeling/advanced/iot"},next:{title:"Migrating",permalink:"/docs/modeling/migrating"}},p={},u=[{value:"Before You Start",id:"before-you-start",level:2},{value:" Concepts",id:"-concepts",level:3},{value:"Modeling Object-to-Object Relationships",id:"modeling-object-to-object-relationships",level:4},{value:"Direct Relationships",id:"direct-relationships",level:4},{value:"Concepts & Configuration Language",id:"concepts--configuration-language",level:4},{value:"What You Will Be Modeling",id:"what-you-will-be-modeling",level:2},{value:"Requirements",id:"requirements",level:3},{value:"Defined Scenarios",id:"defined-scenarios",level:3},{value:"Modeling Entitlements For GitHub",id:"modeling-entitlements-for-github",level:2},{value:"01. Building The Initial Authorization Model And Relationship Tuples",id:"01-building-the-initial-authorization-model-and-relationship-tuples",level:3},{value:"02. Populating The Relationship Tuples",id:"02-populating-the-relationship-tuples",level:3},{value:"Verification",id:"verification",level:4},{value:"03. Updating The Authorization Model",id:"03-updating-the-authorization-model",level:3},{value:"Adding Modeling Pattern Of Parent-Child Objects",id:"adding-modeling-pattern-of-parent-child-objects",level:4},{value:"Adding Subscriber Relationship With Another Object Related To x associated_plan",id:"adding-subscriber-relationship-with-another-object-related-to-x-associated_plan",level:4},{value:"Disallow Direct Relationship",id:"disallow-direct-relationship",level:4},{value:"Verification",id:"verification-1",level:4},{value:"Summary",id:"summary",level:2}],d={toc:u},m="wrapper";function c(e){let{components:t,...o}=e;return(0,i.kt)(m,(0,n.Z)({},d,o,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"modeling-entitlements-for-a-system-with-"},"Modeling Entitlements for a System with ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})),(0,i.kt)(r.AH,{mdxType:"DocumentationNotice"}),(0,i.kt)("p",null,"This tutorial explains how to model entitlements for a platform like GitHub using ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}),"."),(0,i.kt)(r.S1,{title:"What you will learn",mdxType:"CardBox"},(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"How to model an entitlement use case in ",(0,i.kt)(r.rZ,{format:r.v7.ProductLink,mdxType:"ProductName"})),(0,i.kt)("li",{parentName:"ul"},"How to start with a given set of requirements and scenarios and iterate on the ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," model until those requirements are met"))),(0,i.kt)(r.XQ,{title:"Entitlements",preset:"entitlements",example:"Entitlements",store:"entitlements",mdxType:"Playground"}),(0,i.kt)("h2",{id:"before-you-start"},"Before You Start"),(0,i.kt)("p",null,"In order to understand this guide correctly you must be familiar with some ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," concepts and know how to develop the things that we will list below."),(0,i.kt)("details",null,(0,i.kt)("summary",null,(0,i.kt)("h3",{id:"-concepts"},(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," Concepts"),(0,i.kt)("p",null,"It would be helpful to have an understanding of some concepts of ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," before you start.")),(0,i.kt)("h4",{id:"modeling-object-to-object-relationships"},"Modeling Object-to-Object Relationships"),(0,i.kt)("p",null,"You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. ",(0,i.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/object-to-object-relationships"},"Learn more \u2192")),(0,i.kt)("p",null,"Used here to indicate that members of an org are subscriber members of the plan the org is subscriber to, and subscriber members of a plan get access to all the plan's features."),(0,i.kt)("h4",{id:"direct-relationships"},"Direct Relationships"),(0,i.kt)("p",null,"You need to know how to disallow granting direct relation to an object and requiring the user to have a relation with another object that would imply a relation with the first one. ",(0,i.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/direct-relationships"},"Learn more \u2192")),(0,i.kt)("p",null,'Used here to indicate that "access" to a feature cannot be directly granted to a user, but is implied through the users organization subscribing to a plan that offers that feature.'),(0,i.kt)("h4",{id:"concepts--configuration-language"},"Concepts & Configuration Language"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Some ",(0,i.kt)(r.uH,{mdxType:"ProductConcept"})),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/docs/configuration-language"},"Configuration Language")))),(0,i.kt)("h2",{id:"what-you-will-be-modeling"},"What You Will Be Modeling"),(0,i.kt)("p",null,"In many product offerings, the features are behind multiple tiers. In this tutorial, you will build an authorization model for a subset of ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/pricing"},"GitHub's entitlements")," (detailed below) using ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"}),". You will use some scenarios to validate the model."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"GitHub Pricing Plan",src:a(9843).Z,width:"1200",height:"763"})),(0,i.kt)("p",null,'At their core, entitlements is just asking: does a user X have access to feature Y? In GitHub\'s case for example, they have a concept called "Draft Pull Requests". Once the user loads the Pull Request page, the frontend needs to know whether it can show the "Draft Pull Request" option, as in it needs to know: "Does the current user have access to feature Draft Pull Request?".'),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"GitHub PR Page with Draft Pull Request",src:a(48847).Z,width:"1796",height:"756"}),"\n",(0,i.kt)("img",{alt:"GitHub PR Page without Draft Pull Request",src:a(15084).Z,width:"1796",height:"756"})),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Note: For brevity, this tutorial will not model all of GitHub entitlements. Instead, it will focus on modeling for the scenarios outlined below")),(0,i.kt)("h3",{id:"requirements"},"Requirements"),(0,i.kt)("p",null,"You will model an entitlement system similar to GitHub's, focusing on a few scenarios."),(0,i.kt)("p",null,'GitHub has 3 plans: "Free", "Team" and "Enterprise", with each of them offering several features. The higher-priced plans include all the features of the lower priced plans. You will be focusing on a subset of the features offered.'),(0,i.kt)("p",null,"A summary of GitHub's entitlement system:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Free",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Issues"))),(0,i.kt)("li",{parentName:"ul"},"Team",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"Everything from the free plan")),(0,i.kt)("li",{parentName:"ul"},"Draft Pull Requests"))),(0,i.kt)("li",{parentName:"ul"},"Enterprise",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"Everything from the team plan")),(0,i.kt)("li",{parentName:"ul"},"SAML Single Sign-On")))),(0,i.kt)("h3",{id:"defined-scenarios"},"Defined Scenarios"),(0,i.kt)("p",null,"Use the following scenarios to be able to validate whether the model of the requirements is correct."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"Take these three organizations"),(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Alpha Beta Gamma (",(0,i.kt)("inlineCode",{parentName:"li"},"alpha"),"), a ",(0,i.kt)("strong",{parentName:"li"},"subscriber")," on the ",(0,i.kt)("strong",{parentName:"li"},"free")," plan"),(0,i.kt)("li",{parentName:"ul"},"Bayer Water Supplies (",(0,i.kt)("inlineCode",{parentName:"li"},"bayer"),"), a ",(0,i.kt)("strong",{parentName:"li"},"subscriber")," on the ",(0,i.kt)("strong",{parentName:"li"},"team")," plan"),(0,i.kt)("li",{parentName:"ul"},"Cups and Dishes (",(0,i.kt)("inlineCode",{parentName:"li"},"cups"),"), a ",(0,i.kt)("strong",{parentName:"li"},"subscriber")," on the ",(0,i.kt)("strong",{parentName:"li"},"enterprise")," plan"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"Take these three users"),(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne"),", ",(0,i.kt)("strong",{parentName:"li"},"member")," of ",(0,i.kt)("strong",{parentName:"li"},"Alpha Beta Gamma")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth"),", ",(0,i.kt)("strong",{parentName:"li"},"member")," of ",(0,i.kt)("strong",{parentName:"li"},"Bayer Water Supplies")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles"),", ",(0,i.kt)("strong",{parentName:"li"},"member")," of ",(0,i.kt)("strong",{parentName:"li"},"Cups and Dishes"))))),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Image showing requirements",src:a(17638).Z,width:"940",height:"750"})),(0,i.kt)("p",null,"By the end of this tutorial, you should be able to query ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," with queries like:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Issues")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Draft Pull Requests")," (expecting",(0,i.kt)("inlineCode",{parentName:"li"}," no"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Single Sign-on")," (expecting",(0,i.kt)("inlineCode",{parentName:"li"}," no"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Issues")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Draft Pull Requests")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Single Sign-on")," (expecting",(0,i.kt)("inlineCode",{parentName:"li"}," no"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Issues")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Draft Pull Requests")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Single Sign-on")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")")),(0,i.kt)("h2",{id:"modeling-entitlements-for-github"},"Modeling Entitlements For GitHub"),(0,i.kt)("h3",{id:"01-building-the-initial-authorization-model-and-relationship-tuples"},"01. Building The Initial Authorization Model And Relationship Tuples"),(0,i.kt)("p",null,"In this tutorial you are going to take a different approach to previous tutorials. You will start with a simple",(0,i.kt)(r.uH,{section:"what-is-an-authorization-model",linkName:"authorization model",mdxType:"ProductConcept"}),", add ",(0,i.kt)(r.uH,{section:"what-is-a-relationship-tuple",linkName:"relationship tuples",mdxType:"ProductConcept"})," to represent some sample scenarios, and iterate until those scenarios return the results you expect."),(0,i.kt)("p",null,"In the scenarios outlined above, you have ",(0,i.kt)("inlineCode",{parentName:"p"},"organizations"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"plans")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"features"),"."),(0,i.kt)("p",null,"Similar to the example above, start with a basic listing of the types and their relations:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"A ",(0,i.kt)("inlineCode",{parentName:"li"},"feature")," has a ",(0,i.kt)("inlineCode",{parentName:"li"},"plan")," associated to it, we'll call the relation between them ",(0,i.kt)("inlineCode",{parentName:"li"},"associated_plan")),(0,i.kt)("li",{parentName:"ul"},"A ",(0,i.kt)("inlineCode",{parentName:"li"},"plan")," has an organization as a ",(0,i.kt)("inlineCode",{parentName:"li"},"subscriber")," to it"),(0,i.kt)("li",{parentName:"ul"},"An ",(0,i.kt)("inlineCode",{parentName:"li"},"organization")," has users as ",(0,i.kt)("inlineCode",{parentName:"li"},"members"))),(0,i.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"feature",relations:{associated_plan:{this:{}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]}}}},{type:"plan",relations:{subscriber:{this:{}}},metadata:{relations:{subscriber:{directly_related_user_types:[{type:"organization"}]}}}},{type:"organization",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("h3",{id:"02-populating-the-relationship-tuples"},"02. Populating The Relationship Tuples"),(0,i.kt)("p",null,"Now you can add the relationship tuples to represent these relationships mentioned in the ",(0,i.kt)("a",{parentName:"p",href:"#requirements"},"requirements")," and ",(0,i.kt)("a",{parentName:"p",href:"#defined-scenarios"},"scenarios")," sections:"),(0,i.kt)("p",null,"The relations between the features and plans are as follows:"),(0,i.kt)(r.Gb,{relationshipTuples:[{_description:"the free plan is the associated plan of the issues feature",user:"plan:free",relation:"associated_plan",object:"feature:issues"},{_description:"the team plan is the associated plan of the issues feature",user:"plan:team",relation:"associated_plan",object:"feature:issues"},{_description:"the team plan is the associated plan of the draft pull requests feature",user:"plan:team",relation:"associated_plan",object:"feature:draft_prs"},{_description:"the enterprise plan is the associated plan of the issues feature",user:"plan:enterprise",relation:"associated_plan",object:"feature:issues"},{_description:"the enterprise plan is the associated plan of the draft pull requests feature",user:"plan:enterprise",relation:"associated_plan",object:"feature:draft_prs"},{_description:"the enterprise plan is the associated plan of the SAML Single Sign-on feature",user:"plan:enterprise",relation:"associated_plan",object:"feature:sso"}],mdxType:"WriteRequestViewer"}),(0,i.kt)("p",null,"The relations between the plans and the organizations are as follows:"),(0,i.kt)(r.Gb,{relationshipTuples:[{_description:"the Alpha Beta Gamma organization is a subscriber of the free plan",user:"organization:alpha",relation:"subscriber",object:"plan:free"},{_description:"the Bayer Water Supplies organization is a subscriber of the team plan",user:"organization:bayer",relation:"subscriber",object:"plan:team"},{_description:"the Cups and Dishes organization is a subscriber of the enterprise plan",user:"organization:cups",relation:"subscriber",object:"plan:enterprise"}],mdxType:"WriteRequestViewer"}),(0,i.kt)("p",null,"The relations between the organizations and the users are as follows:"),(0,i.kt)(r.Gb,{relationshipTuples:[{_description:"anne is a member of the Alpha Beta Gamma organization",user:"user:anne",relation:"member",object:"organization:alpha"},{_description:"beth is a member of the Bayer Water Supplies",user:"user:beth",relation:"member",object:"organization:bayer"},{_description:"charles is a member of the Cups and Dishes organization",user:"user:charles",relation:"member",object:"organization:cups"}],mdxType:"WriteRequestViewer"}),(0,i.kt)("p",null,"So far you have given ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," a representation of the current state of your system's relationships. You will keep iterating and updating the authorization model until the results of the queries match what you expect."),(0,i.kt)("admonition",{type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"In production, it is highly recommended to use unique, immutable identifiers. Names are used in this article to make it easier to read and follow.\nFor example, the relationship tuple indicating that ",(0,i.kt)("em",{parentName:"p"},"anne is a member of organization:alpha")," could be written as:"),(0,i.kt)("ul",{parentName:"admonition"},(0,i.kt)("li",{parentName:"ul"},"user: user:2b4840f2-7c9c-42c8-9329-911002051524"),(0,i.kt)("li",{parentName:"ul"},"relation: member"),(0,i.kt)("li",{parentName:"ul"},"object: project:52e529c6-c571-4d5c-b78a-bc574cf98b54"))),(0,i.kt)("h4",{id:"verification"},"Verification"),(0,i.kt)("p",null,"Now that you have some data, you can start using it to ask is ${USER} related to ${OBJECT} as ${RELATION}?"),(0,i.kt)("p",null,"First, you will ",(0,i.kt)(r.uH,{section:"what-is-a-check-request",linkName:"check",mdxType:"ProductConcept"})," if ",(0,i.kt)("inlineCode",{parentName:"p"},"anne")," is a member of ",(0,i.kt)("inlineCode",{parentName:"p"},"organization:alpha"),". This is one of the relationship tuples you previously added, you will make sure ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," can detect a relation in this case."),(0,i.kt)(r.uT,{user:"user:anne",relation:"member",object:"organization:alpha",allowed:!0,mdxType:"CheckRequestViewer"}),(0,i.kt)("p",null,"Querying for relationship tuples that you fed into ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," earlier should work, try a few before proceeding to make sure everything is working well."),(0,i.kt)(r.uT,{user:"user:anne",relation:"member",object:"organization:bayer",allowed:!1,mdxType:"CheckRequestViewer"}),(0,i.kt)(r.uT,{user:"organization:bayer",relation:"subscriber",object:"plan:team",allowed:!0,mdxType:"CheckRequestViewer"}),(0,i.kt)(r.uT,{user:"plan:free",relation:"associated_plan",object:"feature:issues",allowed:!0,mdxType:"CheckRequestViewer"}),(0,i.kt)("h3",{id:"03-updating-the-authorization-model"},"03. Updating The Authorization Model"),(0,i.kt)("p",null,"You are working towards ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," returning the correct answer when you query whether ",(0,i.kt)("inlineCode",{parentName:"p"},"anne")," has ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," to ",(0,i.kt)("inlineCode",{parentName:"p"},"feature:issues"),". It won't work yet, but you will keep updating your configuration to reach that goal."),(0,i.kt)("p",null,"To start, try to run that query on ",(0,i.kt)("inlineCode",{parentName:"p"},"is anne related to feature:issues as access?")),(0,i.kt)(r.uT,{user:"user:anne",relation:"access",object:"feature:issues",mdxType:"CheckRequestViewer"}),(0,i.kt)("p",null,"The ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," service is returning that the query tuple is invalid. That is because you are asking for relation as ",(0,i.kt)("inlineCode",{parentName:"p"},"access"),", but that relation is not in the configuration of the ",(0,i.kt)("inlineCode",{parentName:"p"},"feature")," type!"),(0,i.kt)("p",null,"Add it now. Like so:"),(0,i.kt)(r.lG,{configuration:{schema_version:"1.1",type:"feature",relations:{associated_plan:{this:{}},access:{this:{}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]},access:{directly_related_user_types:[{type:"user"}]}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("admonition",{type:"info"},(0,i.kt)("p",{parentName:"admonition"},(0,i.kt)("inlineCode",{parentName:"p"},"access")," ",(0,i.kt)(r.uH,{section:"what-is-a-relation",linkName:"relation",mdxType:"ProductConcept"})," was added to the configuration of the ",(0,i.kt)("inlineCode",{parentName:"p"},"feature")," ",(0,i.kt)(r.uH,{section:"what-is-a-type",linkName:"type",mdxType:"ProductConcept"}),".")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"In this tutorial, you will find the phrases ",(0,i.kt)(r.uH,{section:"what-are-direct-and-implied-relationships",linkName:"direct relationship and implied relationship",mdxType:"ProductConcept"}),"."),(0,i.kt)("p",{parentName:"admonition"},"A ",(0,i.kt)("em",{parentName:"p"},"direct relationship")," R between user X and object Y means the relationship tuple (user=X, relation=R, object=Y) exists, and the ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," authorization model for that relation allows this direct relationship (by use of ",(0,i.kt)("a",{parentName:"p",href:"/docs/configuration-language#the-direct-relationship-type-restrictions"},"direct relationship type restrictions"),")."),(0,i.kt)("p",{parentName:"admonition"},"An ",(0,i.kt)("em",{parentName:"p"},"implied relationship")," R exists between user X and object Y if user X is related to an object Z that is in direct or implied relationship with object Y, and the ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," authorization model allows it.")),(0,i.kt)("p",null,"The resulting updated configuration would be:"),(0,i.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"feature",relations:{associated_plan:{this:{}},access:{this:{}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]},access:{directly_related_user_types:[{type:"user"}]}}}},{type:"plan",relations:{subscriber:{this:{}}},metadata:{relations:{subscriber:{directly_related_user_types:[{type:"organization"}]}}}},{type:"organization",relations:{member:{this:{}}},metadata:{relations:{subscriber:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("h4",{id:"adding-modeling-pattern-of-parent-child-objects"},"Adding Modeling Pattern Of Parent-Child Objects"),(0,i.kt)("p",null,"Now we can ask the following query: ",(0,i.kt)("inlineCode",{parentName:"p"},"is anne related to feature:issues as access?")," again."),(0,i.kt)(r.uT,{user:"user:anne",relation:"access",object:"feature:issues",allowed:!1,mdxType:"CheckRequestViewer"}),(0,i.kt)("p",null,"So far so good. ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," understood your query, but said that no ",(0,i.kt)(r.uH,{section:"what-is-a-relation",linkName:"relation",mdxType:"ProductConcept"})," exists. That is because according to the configuration provided so far, there is no ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation between ",(0,i.kt)("inlineCode",{parentName:"p"},"anne")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"feature:issues"),"."),(0,i.kt)("p",null,"We can also try to query ",(0,i.kt)("inlineCode",{parentName:"p"},"is organization:alpha related to feature:issues as access?")," and we see that there is no relationship."),(0,i.kt)(r.uT,{user:"organization:alpha",relation:"access",object:"feature:issues",allowed:!1,mdxType:"CheckRequestViewer"}),(0,i.kt)("p",null,"If you have already completed some of the other tutorials you might have encountered the modeling pattern of ",(0,i.kt)("a",{parentName:"p",href:"/docs/modeling/parent-child"},"parent-child objects")," which is modeled as such:"),(0,i.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"object",relations:{viewer:{tupleToUserset:{tupleset:{relation:"parent"},computedUserset:{relation:"all_objects_viewer"}}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("admonition",{type:"info"},(0,i.kt)("p",{parentName:"admonition"},"With this, when asked to check a user's ",(0,i.kt)("inlineCode",{parentName:"p"},"viewer")," relationship with the object, ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," will:"),(0,i.kt)("ol",{parentName:"admonition"},(0,i.kt)("li",{parentName:"ol"},"Read all relationship tuples of users related to this particular object as relation ",(0,i.kt)("inlineCode",{parentName:"li"},"parent")),(0,i.kt)("li",{parentName:"ol"},"For each relationship tuple, return all ",(0,i.kt)("em",{parentName:"li"},"usersets")," that have ",(0,i.kt)("inlineCode",{parentName:"li"},"all_objects_viewer")," relation to the objects in those relationship tuples"),(0,i.kt)("li",{parentName:"ol"},"If the user is in any of those ",(0,i.kt)("em",{parentName:"li"},"usersets"),", return yes, as the user is a ",(0,i.kt)("inlineCode",{parentName:"li"},"viewer")," on this object.\nIn other words, users related as ",(0,i.kt)("inlineCode",{parentName:"li"},"all_objects_viewer")," to any of this object's ",(0,i.kt)("inlineCode",{parentName:"li"},"parents")," are related as ",(0,i.kt)("inlineCode",{parentName:"li"},"viewer")," to this object."))),(0,i.kt)("p",null,"If you want to give all subscribers on a plan access to a feature, you can do it like so:"),(0,i.kt)(r.lG,{configuration:{schema_version:"1.1",type:"feature",relations:{associated_plan:{this:{}},access:{union:{child:[{this:{}},{tupleToUserset:{tupleset:{relation:"associated_plan"},computedUserset:{relation:"subscriber"}}}]}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]},access:{directly_related_user_types:[{type:"user"}]}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("admonition",{type:"info"},(0,i.kt)("p",{parentName:"admonition"},"Users related to ",(0,i.kt)("inlineCode",{parentName:"p"},"feature")," as ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," are the union of (any of):"),(0,i.kt)("ul",{parentName:"admonition"},(0,i.kt)("li",{parentName:"ul"},"the set of users with a direct ",(0,i.kt)("inlineCode",{parentName:"li"},"access")," relation"),(0,i.kt)("li",{parentName:"ul"},"the set of users related to the ",(0,i.kt)("inlineCode",{parentName:"li"},"associated_plan")," as ",(0,i.kt)("inlineCode",{parentName:"li"},"subscriber")," (the feature's associated plans' subscribers)")),(0,i.kt)("p",{parentName:"admonition"},"So everyone who has direct access, as well as the subscribers of the associated plan")),(0,i.kt)("p",null,"That would mean that in order for an object to have an ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation to a feature y, there needs to be either:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a ",(0,i.kt)(r.uH,{section:"what-are-direct-and-implied-relationships",linkName:"direct relationship",mdxType:"ProductConcept"})," via a relationship tuple:\ne.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'{ "user": "user:x", "relation": "access", "object": "feature:y" }')),(0,i.kt)("li",{parentName:"ul"},"a subscriber relationship with another object related to x associated_plan:\ne.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'{ "user": "user:x", "relation": "subscriber", "object": "plan:z" } { "user": "plan:z", "relation": "associated_plan", "object": "feature:y" }'))),(0,i.kt)("p",null,"That brings you close. That will allow you to grant organizations access to the feature (as organizations have a subscriber relation with the plan)."),(0,i.kt)("h4",{id:"adding-subscriber-relationship-with-another-object-related-to-x-associated_plan"},"Adding Subscriber Relationship With Another Object Related To x associated_plan"),(0,i.kt)("p",null,"One way forward would be to add a direct ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation between a user and a feature e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},'{ "user": "anne", "relation": "access", "object": "feature:y" }')," whenever the organization anne is subscribed to a plan, or the organization anne is in subscribes to a new plan.\nBut there are several downsides to this:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Your application layer now needs to worry about computing this relationship. Instead of letting ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," figure this all out, the app layer needs to do the checks whenever a user is being added or removed"),(0,i.kt)("li",{parentName:"ul"},"If an organization changes its subscription, your application layer has to loop through all the users and update their ",(0,i.kt)("inlineCode",{parentName:"li"},"access")," relationships to features accordingly")),(0,i.kt)("p",null,"Later in this tutorial, you will remove the possibility of having a direct ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation completely, but for now you will make sure the changes to the store you have made so far are working."),(0,i.kt)("p",null,"Replace all the existing code you had previously with the updated authorization model from the below snippet."),(0,i.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"feature",relations:{associated_plan:{this:{}},access:{union:{child:[{this:{}},{tupleToUserset:{tupleset:{relation:"associated_plan"},computedUserset:{relation:"subscriber"}}}]}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]},access:{directly_related_user_types:[{type:"user"}]}}}},{type:"plan",relations:{subscriber:{this:{}}},metadata:{relations:{subscriber:{directly_related_user_types:[{type:"organization"}]}}}},{type:"organization",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("p",null,"Now we can ask following query: ",(0,i.kt)("inlineCode",{parentName:"p"},"is organization:alpha related to feature:issues as access?")," again."),(0,i.kt)(r.uT,{user:"organization:alpha",relation:"access",object:"feature:issues",allowed:!0,mdxType:"CheckRequestViewer"}),(0,i.kt)("p",null,"You will notice that ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," now did find a relation, as ",(0,i.kt)("inlineCode",{parentName:"p"},"organization:alpha")," is a ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber")," to ",(0,i.kt)("inlineCode",{parentName:"p"},"plan:free")," which has an ",(0,i.kt)("inlineCode",{parentName:"p"},"associated_plan")," relation to ",(0,i.kt)("inlineCode",{parentName:"p"},"feature:issues"),". From that and the authorization model you updated above, ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," deduced that ",(0,i.kt)("inlineCode",{parentName:"p"},"organization:alpha")," has an implied ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation to ",(0,i.kt)("inlineCode",{parentName:"p"},"feature:issues"),"."),(0,i.kt)("p",null,"That is good, but you want to be able to ask ",(0,i.kt)("inlineCode",{parentName:"p"},"is anne related to feature:issues as access?"),", not ",(0,i.kt)("inlineCode",{parentName:"p"},"is organization:alpha related to feature:issues as access?"),". As in, you want the subscriber members to have access to the feature, not the subscriber itself."),(0,i.kt)("p",null,"In order to do that, you will add a relation on the plan, that indicates that all members of an organization subscribed to it, have a ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber_member")," relation to the plan. And you can modify the change you did above to give implied access to the ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber_member")," instead of the subscriber. Like so:"),(0,i.kt)(r.lG,{description:"Notice that `subscriber` has been updated to `subscriber_member` in the `access` relation of the `feature` type.\n Under the `plan` type, in order for someone to have a `subscriber_member` relation to the plan, they have to be related as a `member` to the object related as a `subscriber` to the plan (as in they have to be a member of on of the plan's subscribers).",configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"feature",relations:{associated_plan:{this:{}},access:{union:{child:[{this:{}},{tupleToUserset:{tupleset:{relation:"associated_plan"},computedUserset:{relation:"subscriber_member"}}}]}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]},access:{directly_related_user_types:[{type:"user"}]}}}},{type:"plan",relations:{subscriber:{this:{}},subscriber_member:{tupleToUserset:{tupleset:{relation:"subscriber"},computedUserset:{relation:"member"}}}},metadata:{relations:{subscriber:{directly_related_user_types:[{type:"organization"}]}}}},{type:"organization",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("admonition",{type:"info"},(0,i.kt)("p",{parentName:"admonition"},"Notice that ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber")," has been updated to ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber_member")," in the ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation of the ",(0,i.kt)("inlineCode",{parentName:"p"},"feature")," type."),(0,i.kt)("p",{parentName:"admonition"},"Under the ",(0,i.kt)("inlineCode",{parentName:"p"},"plan")," type, in order for someone to have a ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber_member")," relation to the plan, they have to be related as a ",(0,i.kt)("inlineCode",{parentName:"p"},"member")," to the object related as a ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber")," to the plan (as in they have to be a member of on of the plan's subscribers).")),(0,i.kt)("p",null,"Now ask the following query: ",(0,i.kt)("inlineCode",{parentName:"p"},"is anne related to feature:issues as access?")),(0,i.kt)(r.uT,{user:"user:anne",relation:"access",object:"feature:issues",allowed:!0,mdxType:"CheckRequestViewer"}),(0,i.kt)("h4",{id:"disallow-direct-relationship"},"Disallow Direct Relationship"),(0,i.kt)("p",null,"So far, with just a ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," authorization model, and the initial relationship tuples indicating the relations you know, you configured ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," to give you the correct response."),(0,i.kt)("p",null,"Earlier on, the idea of not allowing a direct ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation between a user and a ",(0,i.kt)("inlineCode",{parentName:"p"},"feature")," was discussed, e.g. adding a relationship tuple like ",(0,i.kt)("inlineCode",{parentName:"p"},'{ "user": "user:anne", "relation": "access", "object": "feature:y" }'),". You will remove it now."),(0,i.kt)("p",null,"To disallow a direct relationship, you need to remove the direct relationship type restriction. The following snippet:"),(0,i.kt)(r.lG,{configuration:{schema_version:"1.1",type:"feature",relations:{associated_plan:{this:{}},access:{union:{child:[{this:{}},{tupleToUserset:{tupleset:{relation:"associated_plan"},computedUserset:{relation:"subscriber_member"}}}]}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]},access:{directly_related_user_types:[{type:"user"}]}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("p",null,"becomes"),(0,i.kt)(r.lG,{configuration:{schema_version:"1.1",type:"feature",relations:{associated_plan:{this:{}},access:{tupleToUserset:{tupleset:{relation:"associated_plan"},computedUserset:{relation:"subscriber_member"}}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("p",null,"With this change, even if your app layer added the following relationship tuple:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'{ "user": "user:anne", "relation": "access", "object": feature:issues }'))),(0,i.kt)("p",null,"a subsequent check for ",(0,i.kt)("inlineCode",{parentName:"p"},"is anne related to feature:issues as access?")," would return no relation. The only way for a relation to exist is if the following three relationship tuples do:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'{ "user": "user:anne", "relation": "member", "object": "organization:z" }')),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'{ "user": "organization:z", "relation": "subscriber", "object": "plan:y" }')),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'{ "user": "plan:y", "relation": "associated_plan", "object": "feature:issues" }'))),(0,i.kt)("h4",{id:"verification-1"},"Verification"),(0,i.kt)("p",null,"Ensure that your authorization model matches the one below"),(0,i.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"feature",relations:{associated_plan:{this:{}},access:{tupleToUserset:{tupleset:{relation:"associated_plan"},computedUserset:{relation:"subscriber_member"}}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]}}}},{type:"plan",relations:{subscriber:{this:{}},subscriber_member:{tupleToUserset:{tupleset:{relation:"subscriber"},computedUserset:{relation:"member"}}}},metadata:{relations:{subscriber:{directly_related_user_types:[{type:"organization"}]}}}},{type:"organization",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("p",null,"You will now verify that the configuration is correct by running checks for all the scenarios mentioned at the beginning of the tutorial:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Issues")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Draft Pull Requests")," (expecting",(0,i.kt)("inlineCode",{parentName:"li"}," no"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Single Sign-on")," (expecting",(0,i.kt)("inlineCode",{parentName:"li"}," no"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Issues")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Draft Pull Requests")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Single Sign-on")," (expecting",(0,i.kt)("inlineCode",{parentName:"li"}," no"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Issues")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Draft Pull Requests")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Single Sign-on")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")")),(0,i.kt)(r.uT,{user:"user:anne",relation:"access",object:"feature:issues",allowed:!0,mdxType:"CheckRequestViewer"}),(0,i.kt)("p",null,"Try to verify for the other user, object and relation combinations as listed below."),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:null},"User"),(0,i.kt)("th",{parentName:"tr",align:null},"Object"),(0,i.kt)("th",{parentName:"tr",align:null},"Relation"),(0,i.kt)("th",{parentName:"tr",align:null},"Query"),(0,i.kt)("th",{parentName:"tr",align:null},"Relation?"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"anne")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:issues")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is anne related to feature:issues as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"anne")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:draft_prs")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is anne related to feature:draft_prs as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"No")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"anne")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:sso")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is anne related to feature:sso as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"No")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"beth")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:issues")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is beth related to feature:issues as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"beth")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:draft_prs")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is beth related to feature:draft_prs as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"beth")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:sso")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is beth related to feature:sso as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"No")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"charles")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:issues")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is charles related to feature:issues as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"charles")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:draft_prs")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is charles related to feature:draft_prs as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"charles")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:sso")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is charles related to feature:sso as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")))),(0,i.kt)("h2",{id:"summary"},"Summary"),(0,i.kt)("p",null,"In this tutorial, you learned:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"to model entitlements for a system in ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})),(0,i.kt)("li",{parentName:"ul"},"how to start with a set of requirements and scenarios and iterate on the ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," authorization model until the checks match the expected scenarios"),(0,i.kt)("li",{parentName:"ul"},"how to model ",(0,i.kt)("a",{parentName:"li",href:"/docs/modeling/parent-child"},(0,i.kt)("strong",{parentName:"a"},"parent-child relationships"))," to indicate that a user having a relationship with a certain object implies having a relationship with another object in ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})),(0,i.kt)("li",{parentName:"ul"},"how to use ",(0,i.kt)("a",{parentName:"li",href:"/docs/configuration-language#the-union-operator"},(0,i.kt)("strong",{parentName:"a"},"the union operator"))," condition to indicate multiple possible paths for a relationship between two objects to be computed"),(0,i.kt)("li",{parentName:"ul"},"using ",(0,i.kt)("a",{parentName:"li",href:"/docs/configuration-language#the-direct-relationship-type-restrictions"},(0,i.kt)("strong",{parentName:"a"},"direct relationship type restrictions"))," in a ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," authorization model, and how to block direct relationships by removing it")),(0,i.kt)(r.XQ,{title:"Entitlements",preset:"entitlements",example:"Entitlements",store:"entitlements",mdxType:"Playground"}),(0,i.kt)("p",null,"Upcoming tutorials will dive deeper into ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}),", introducing concepts that will improve on the model you built today, and tackling different permission systems, with other relations and requirements that need to be met."))}c.isMDXComponent=!0},48847:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/entitlements-image-github-draft-pr-2ee031c09e3924b41681861e56aab2e7.svg"},15084:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/entitlements-image-github-no-draft-pr-785626465cfe1b8183918ee6bd3aefb1.svg"},9843:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/entitlements-image-pricing-github-2276507856dd07b091bcecc2376dde05.svg"},17638:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/entitlements-requirements-fdd4048edc4d4b3b78785f4c0671e0b1.svg"}}]); \ No newline at end of file diff --git a/assets/js/97140aee.92fade11.js b/assets/js/97140aee.92fade11.js new file mode 100644 index 000000000..eb45f83e7 --- /dev/null +++ b/assets/js/97140aee.92fade11.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkopenfga_dev=self.webpackChunkopenfga_dev||[]).push([[521],{1840:(e,t,a)=>{a.r(t),a.d(t,{assets:()=>p,contentTitle:()=>s,default:()=>c,frontMatter:()=>o,metadata:()=>l,toc:()=>u});var n=a(87462),i=(a(67294),a(3905)),r=a(5270);const o={title:"Entitlements",description:"Modeling entitlements for a system",sidebar_position:1,slug:"/modeling/advanced/entitlements"},s="Modeling Entitlements for a System with ",l={unversionedId:"content/modeling/advanced/entitlements",id:"content/modeling/advanced/entitlements",title:"Entitlements",description:"Modeling entitlements for a system",source:"@site/docs/content/modeling/advanced/entitlements.mdx",sourceDirName:"content/modeling/advanced",slug:"/modeling/advanced/entitlements",permalink:"/docs/modeling/advanced/entitlements",draft:!1,editUrl:"https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/advanced/entitlements.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Entitlements",description:"Modeling entitlements for a system",sidebar_position:1,slug:"/modeling/advanced/entitlements"},sidebar:"docs",previous:{title:"IoT",permalink:"/docs/modeling/advanced/iot"},next:{title:"Migrating",permalink:"/docs/modeling/migrating"}},p={},u=[{value:"Before You Start",id:"before-you-start",level:2},{value:" Concepts",id:"-concepts",level:3},{value:"Modeling Object-to-Object Relationships",id:"modeling-object-to-object-relationships",level:4},{value:"Direct Relationships",id:"direct-relationships",level:4},{value:"Concepts & Configuration Language",id:"concepts--configuration-language",level:4},{value:"What You Will Be Modeling",id:"what-you-will-be-modeling",level:2},{value:"Requirements",id:"requirements",level:3},{value:"Defined Scenarios",id:"defined-scenarios",level:3},{value:"Modeling Entitlements For GitHub",id:"modeling-entitlements-for-github",level:2},{value:"01. Building The Initial Authorization Model And Relationship Tuples",id:"01-building-the-initial-authorization-model-and-relationship-tuples",level:3},{value:"02. Populating The Relationship Tuples",id:"02-populating-the-relationship-tuples",level:3},{value:"Verification",id:"verification",level:4},{value:"03. Updating The Authorization Model",id:"03-updating-the-authorization-model",level:3},{value:"Adding Modeling Pattern Of Parent-Child Objects",id:"adding-modeling-pattern-of-parent-child-objects",level:4},{value:"Adding Subscriber Relationship With Another Object Related To x associated_plan",id:"adding-subscriber-relationship-with-another-object-related-to-x-associated_plan",level:4},{value:"Disallow Direct Relationship",id:"disallow-direct-relationship",level:4},{value:"Verification",id:"verification-1",level:4},{value:"Summary",id:"summary",level:2}],d={toc:u},m="wrapper";function c(e){let{components:t,...o}=e;return(0,i.kt)(m,(0,n.Z)({},d,o,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"modeling-entitlements-for-a-system-with-"},"Modeling Entitlements for a System with ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})),(0,i.kt)(r.AH,{mdxType:"DocumentationNotice"}),(0,i.kt)("p",null,"This tutorial explains how to model entitlements for a platform like GitHub using ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}),"."),(0,i.kt)(r.S1,{title:"What you will learn",mdxType:"CardBox"},(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"How to model an entitlement use case in ",(0,i.kt)(r.rZ,{format:r.v7.ProductLink,mdxType:"ProductName"})),(0,i.kt)("li",{parentName:"ul"},"How to start with a given set of requirements and scenarios and iterate on the ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," model until those requirements are met"))),(0,i.kt)(r.XQ,{title:"Entitlements",preset:"entitlements",example:"Entitlements",store:"entitlements",mdxType:"Playground"}),(0,i.kt)("h2",{id:"before-you-start"},"Before You Start"),(0,i.kt)("p",null,"In order to understand this guide correctly you must be familiar with some ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," concepts and know how to develop the things that we will list below."),(0,i.kt)("details",null,(0,i.kt)("summary",null,(0,i.kt)("h3",{id:"-concepts"},(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," Concepts"),(0,i.kt)("p",null,"It would be helpful to have an understanding of some concepts of ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," before you start.")),(0,i.kt)("h4",{id:"modeling-object-to-object-relationships"},"Modeling Object-to-Object Relationships"),(0,i.kt)("p",null,"You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. ",(0,i.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/object-to-object-relationships"},"Learn more \u2192")),(0,i.kt)("p",null,"Used here to indicate that members of an org are subscriber members of the plan the org is subscriber to, and subscriber members of a plan get access to all the plan's features."),(0,i.kt)("h4",{id:"direct-relationships"},"Direct Relationships"),(0,i.kt)("p",null,"You need to know how to disallow granting direct relation to an object and requiring the user to have a relation with another object that would imply a relation with the first one. ",(0,i.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/direct-relationships"},"Learn more \u2192")),(0,i.kt)("p",null,'Used here to indicate that "access" to a feature cannot be directly granted to a user, but is implied through the users organization subscribing to a plan that offers that feature.'),(0,i.kt)("h4",{id:"concepts--configuration-language"},"Concepts & Configuration Language"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Some ",(0,i.kt)(r.uH,{mdxType:"ProductConcept"})),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"/docs/configuration-language"},"Configuration Language")))),(0,i.kt)("h2",{id:"what-you-will-be-modeling"},"What You Will Be Modeling"),(0,i.kt)("p",null,"In many product offerings, the features are behind multiple tiers. In this tutorial, you will build an authorization model for a subset of ",(0,i.kt)("a",{parentName:"p",href:"https://github.com/pricing"},"GitHub's entitlements")," (detailed below) using ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"}),". You will use some scenarios to validate the model."),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"GitHub Pricing Plan",src:a(9843).Z,width:"1200",height:"763"})),(0,i.kt)("p",null,'At their core, entitlements is just asking: does a user X have access to feature Y? In GitHub\'s case for example, they have a concept called "Draft Pull Requests". Once the user loads the Pull Request page, the frontend needs to know whether it can show the "Draft Pull Request" option, as in it needs to know: "Does the current user have access to feature Draft Pull Request?".'),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"GitHub PR Page with Draft Pull Request",src:a(48847).Z,width:"1796",height:"756"}),"\n",(0,i.kt)("img",{alt:"GitHub PR Page without Draft Pull Request",src:a(15084).Z,width:"1796",height:"756"})),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},"Note: For brevity, this tutorial will not model all of GitHub entitlements. Instead, it will focus on modeling for the scenarios outlined below")),(0,i.kt)("h3",{id:"requirements"},"Requirements"),(0,i.kt)("p",null,"You will model an entitlement system similar to GitHub's, focusing on a few scenarios."),(0,i.kt)("p",null,'GitHub has 3 plans: "Free", "Team" and "Enterprise", with each of them offering several features. The higher-priced plans include all the features of the lower priced plans. You will be focusing on a subset of the features offered.'),(0,i.kt)("p",null,"A summary of GitHub's entitlement system:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Free",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Issues"))),(0,i.kt)("li",{parentName:"ul"},"Team",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"Everything from the free plan")),(0,i.kt)("li",{parentName:"ul"},"Draft Pull Requests"))),(0,i.kt)("li",{parentName:"ul"},"Enterprise",(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("em",{parentName:"li"},"Everything from the team plan")),(0,i.kt)("li",{parentName:"ul"},"SAML Single Sign-On")))),(0,i.kt)("h3",{id:"defined-scenarios"},"Defined Scenarios"),(0,i.kt)("p",null,"Use the following scenarios to be able to validate whether the model of the requirements is correct."),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"Take these three organizations"),(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},"Alpha Beta Gamma (",(0,i.kt)("inlineCode",{parentName:"li"},"alpha"),"), a ",(0,i.kt)("strong",{parentName:"li"},"subscriber")," on the ",(0,i.kt)("strong",{parentName:"li"},"free")," plan"),(0,i.kt)("li",{parentName:"ul"},"Bayer Water Supplies (",(0,i.kt)("inlineCode",{parentName:"li"},"bayer"),"), a ",(0,i.kt)("strong",{parentName:"li"},"subscriber")," on the ",(0,i.kt)("strong",{parentName:"li"},"team")," plan"),(0,i.kt)("li",{parentName:"ul"},"Cups and Dishes (",(0,i.kt)("inlineCode",{parentName:"li"},"cups"),"), a ",(0,i.kt)("strong",{parentName:"li"},"subscriber")," on the ",(0,i.kt)("strong",{parentName:"li"},"enterprise")," plan"))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},"Take these three users"),(0,i.kt)("ul",{parentName:"li"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne"),", ",(0,i.kt)("strong",{parentName:"li"},"member")," of ",(0,i.kt)("strong",{parentName:"li"},"Alpha Beta Gamma")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth"),", ",(0,i.kt)("strong",{parentName:"li"},"member")," of ",(0,i.kt)("strong",{parentName:"li"},"Bayer Water Supplies")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles"),", ",(0,i.kt)("strong",{parentName:"li"},"member")," of ",(0,i.kt)("strong",{parentName:"li"},"Cups and Dishes"))))),(0,i.kt)("p",null,(0,i.kt)("img",{alt:"Image showing requirements",src:a(17638).Z,width:"940",height:"750"})),(0,i.kt)("p",null,"By the end of this tutorial, you should be able to query ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," with queries like:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Issues")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Draft Pull Requests")," (expecting",(0,i.kt)("inlineCode",{parentName:"li"}," no"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Single Sign-on")," (expecting",(0,i.kt)("inlineCode",{parentName:"li"}," no"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Issues")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Draft Pull Requests")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Single Sign-on")," (expecting",(0,i.kt)("inlineCode",{parentName:"li"}," no"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Issues")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Draft Pull Requests")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Single Sign-on")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")")),(0,i.kt)("h2",{id:"modeling-entitlements-for-github"},"Modeling Entitlements For GitHub"),(0,i.kt)("h3",{id:"01-building-the-initial-authorization-model-and-relationship-tuples"},"01. Building The Initial Authorization Model And Relationship Tuples"),(0,i.kt)("p",null,"In this tutorial you are going to take a different approach to previous tutorials. You will start with a simple",(0,i.kt)(r.uH,{section:"what-is-an-authorization-model",linkName:"authorization model",mdxType:"ProductConcept"}),", add ",(0,i.kt)(r.uH,{section:"what-is-a-relationship-tuple",linkName:"relationship tuples",mdxType:"ProductConcept"})," to represent some sample scenarios, and iterate until those scenarios return the results you expect."),(0,i.kt)("p",null,"In the scenarios outlined above, you have ",(0,i.kt)("inlineCode",{parentName:"p"},"organizations"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"plans")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"features"),"."),(0,i.kt)("p",null,"Similar to the example above, start with a basic listing of the types and their relations:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"A ",(0,i.kt)("inlineCode",{parentName:"li"},"feature")," has a ",(0,i.kt)("inlineCode",{parentName:"li"},"plan")," associated to it, we'll call the relation between them ",(0,i.kt)("inlineCode",{parentName:"li"},"associated_plan")),(0,i.kt)("li",{parentName:"ul"},"A ",(0,i.kt)("inlineCode",{parentName:"li"},"plan")," has an organization as a ",(0,i.kt)("inlineCode",{parentName:"li"},"subscriber")," to it"),(0,i.kt)("li",{parentName:"ul"},"An ",(0,i.kt)("inlineCode",{parentName:"li"},"organization")," has users as ",(0,i.kt)("inlineCode",{parentName:"li"},"members"))),(0,i.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"feature",relations:{associated_plan:{this:{}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]}}}},{type:"plan",relations:{subscriber:{this:{}}},metadata:{relations:{subscriber:{directly_related_user_types:[{type:"organization"}]}}}},{type:"organization",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("h3",{id:"02-populating-the-relationship-tuples"},"02. Populating The Relationship Tuples"),(0,i.kt)("p",null,"Now you can add the relationship tuples to represent these relationships mentioned in the ",(0,i.kt)("a",{parentName:"p",href:"#requirements"},"requirements")," and ",(0,i.kt)("a",{parentName:"p",href:"#defined-scenarios"},"scenarios")," sections:"),(0,i.kt)("p",null,"The relations between the features and plans are as follows:"),(0,i.kt)(r.Gb,{relationshipTuples:[{_description:"the free plan is the associated plan of the issues feature",user:"plan:free",relation:"associated_plan",object:"feature:issues"},{_description:"the team plan is the associated plan of the issues feature",user:"plan:team",relation:"associated_plan",object:"feature:issues"},{_description:"the team plan is the associated plan of the draft pull requests feature",user:"plan:team",relation:"associated_plan",object:"feature:draft_prs"},{_description:"the enterprise plan is the associated plan of the issues feature",user:"plan:enterprise",relation:"associated_plan",object:"feature:issues"},{_description:"the enterprise plan is the associated plan of the draft pull requests feature",user:"plan:enterprise",relation:"associated_plan",object:"feature:draft_prs"},{_description:"the enterprise plan is the associated plan of the SAML Single Sign-on feature",user:"plan:enterprise",relation:"associated_plan",object:"feature:sso"}],mdxType:"WriteRequestViewer"}),(0,i.kt)("p",null,"The relations between the plans and the organizations are as follows:"),(0,i.kt)(r.Gb,{relationshipTuples:[{_description:"the Alpha Beta Gamma organization is a subscriber of the free plan",user:"organization:alpha",relation:"subscriber",object:"plan:free"},{_description:"the Bayer Water Supplies organization is a subscriber of the team plan",user:"organization:bayer",relation:"subscriber",object:"plan:team"},{_description:"the Cups and Dishes organization is a subscriber of the enterprise plan",user:"organization:cups",relation:"subscriber",object:"plan:enterprise"}],mdxType:"WriteRequestViewer"}),(0,i.kt)("p",null,"The relations between the organizations and the users are as follows:"),(0,i.kt)(r.Gb,{relationshipTuples:[{_description:"anne is a member of the Alpha Beta Gamma organization",user:"user:anne",relation:"member",object:"organization:alpha"},{_description:"beth is a member of the Bayer Water Supplies",user:"user:beth",relation:"member",object:"organization:bayer"},{_description:"charles is a member of the Cups and Dishes organization",user:"user:charles",relation:"member",object:"organization:cups"}],mdxType:"WriteRequestViewer"}),(0,i.kt)("p",null,"So far you have given ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," a representation of the current state of your system's relationships. You will keep iterating and updating the authorization model until the results of the queries match what you expect."),(0,i.kt)("admonition",{type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"In production, it is highly recommended to use unique, immutable identifiers. Names are used in this article to make it easier to read and follow.\nFor example, the relationship tuple indicating that ",(0,i.kt)("em",{parentName:"p"},"anne is a member of organization:alpha")," could be written as:"),(0,i.kt)("ul",{parentName:"admonition"},(0,i.kt)("li",{parentName:"ul"},"user: user:2b4840f2-7c9c-42c8-9329-911002051524"),(0,i.kt)("li",{parentName:"ul"},"relation: member"),(0,i.kt)("li",{parentName:"ul"},"object: project:52e529c6-c571-4d5c-b78a-bc574cf98b54"))),(0,i.kt)("h4",{id:"verification"},"Verification"),(0,i.kt)("p",null,"Now that you have some data, you can start using it to ask is ${USER} related to ${OBJECT} as ${RELATION}?"),(0,i.kt)("p",null,"First, you will ",(0,i.kt)(r.uH,{section:"what-is-a-check-request",linkName:"check",mdxType:"ProductConcept"})," if ",(0,i.kt)("inlineCode",{parentName:"p"},"anne")," is a member of ",(0,i.kt)("inlineCode",{parentName:"p"},"organization:alpha"),". This is one of the relationship tuples you previously added, you will make sure ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," can detect a relation in this case."),(0,i.kt)(r.uT,{user:"user:anne",relation:"member",object:"organization:alpha",allowed:!0,mdxType:"CheckRequestViewer"}),(0,i.kt)("p",null,"Querying for relationship tuples that you fed into ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," earlier should work, try a few before proceeding to make sure everything is working well."),(0,i.kt)(r.uT,{user:"user:anne",relation:"member",object:"organization:bayer",allowed:!1,mdxType:"CheckRequestViewer"}),(0,i.kt)(r.uT,{user:"organization:bayer",relation:"subscriber",object:"plan:team",allowed:!0,mdxType:"CheckRequestViewer"}),(0,i.kt)(r.uT,{user:"plan:free",relation:"associated_plan",object:"feature:issues",allowed:!0,mdxType:"CheckRequestViewer"}),(0,i.kt)("h3",{id:"03-updating-the-authorization-model"},"03. Updating The Authorization Model"),(0,i.kt)("p",null,"You are working towards ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," returning the correct answer when you query whether ",(0,i.kt)("inlineCode",{parentName:"p"},"anne")," has ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," to ",(0,i.kt)("inlineCode",{parentName:"p"},"feature:issues"),". It won't work yet, but you will keep updating your configuration to reach that goal."),(0,i.kt)("p",null,"To start, try to run that query on ",(0,i.kt)("inlineCode",{parentName:"p"},"is anne related to feature:issues as access?")),(0,i.kt)(r.uT,{user:"user:anne",relation:"access",object:"feature:issues",mdxType:"CheckRequestViewer"}),(0,i.kt)("p",null,"The ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," service is returning that the query tuple is invalid. That is because you are asking for relation as ",(0,i.kt)("inlineCode",{parentName:"p"},"access"),", but that relation is not in the configuration of the ",(0,i.kt)("inlineCode",{parentName:"p"},"feature")," type!"),(0,i.kt)("p",null,"Add it now. Like so:"),(0,i.kt)(r.lG,{configuration:{type:"feature",relations:{associated_plan:{this:{}},access:{this:{}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]},access:{directly_related_user_types:[{type:"user"}]}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("admonition",{type:"info"},(0,i.kt)("p",{parentName:"admonition"},(0,i.kt)("inlineCode",{parentName:"p"},"access")," ",(0,i.kt)(r.uH,{section:"what-is-a-relation",linkName:"relation",mdxType:"ProductConcept"})," was added to the configuration of the ",(0,i.kt)("inlineCode",{parentName:"p"},"feature")," ",(0,i.kt)(r.uH,{section:"what-is-a-type",linkName:"type",mdxType:"ProductConcept"}),".")),(0,i.kt)("admonition",{type:"note"},(0,i.kt)("p",{parentName:"admonition"},"In this tutorial, you will find the phrases ",(0,i.kt)(r.uH,{section:"what-are-direct-and-implied-relationships",linkName:"direct relationship and implied relationship",mdxType:"ProductConcept"}),"."),(0,i.kt)("p",{parentName:"admonition"},"A ",(0,i.kt)("em",{parentName:"p"},"direct relationship")," R between user X and object Y means the relationship tuple (user=X, relation=R, object=Y) exists, and the ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," authorization model for that relation allows this direct relationship (by use of ",(0,i.kt)("a",{parentName:"p",href:"/docs/configuration-language#the-direct-relationship-type-restrictions"},"direct relationship type restrictions"),")."),(0,i.kt)("p",{parentName:"admonition"},"An ",(0,i.kt)("em",{parentName:"p"},"implied relationship")," R exists between user X and object Y if user X is related to an object Z that is in direct or implied relationship with object Y, and the ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," authorization model allows it.")),(0,i.kt)("p",null,"The resulting updated configuration would be:"),(0,i.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"feature",relations:{associated_plan:{this:{}},access:{this:{}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]},access:{directly_related_user_types:[{type:"user"}]}}}},{type:"plan",relations:{subscriber:{this:{}}},metadata:{relations:{subscriber:{directly_related_user_types:[{type:"organization"}]}}}},{type:"organization",relations:{member:{this:{}}},metadata:{relations:{subscriber:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("h4",{id:"adding-modeling-pattern-of-parent-child-objects"},"Adding Modeling Pattern Of Parent-Child Objects"),(0,i.kt)("p",null,"Now we can ask the following query: ",(0,i.kt)("inlineCode",{parentName:"p"},"is anne related to feature:issues as access?")," again."),(0,i.kt)(r.uT,{user:"user:anne",relation:"access",object:"feature:issues",allowed:!1,mdxType:"CheckRequestViewer"}),(0,i.kt)("p",null,"So far so good. ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," understood your query, but said that no ",(0,i.kt)(r.uH,{section:"what-is-a-relation",linkName:"relation",mdxType:"ProductConcept"})," exists. That is because according to the configuration provided so far, there is no ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation between ",(0,i.kt)("inlineCode",{parentName:"p"},"anne")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"feature:issues"),"."),(0,i.kt)("p",null,"We can also try to query ",(0,i.kt)("inlineCode",{parentName:"p"},"is organization:alpha related to feature:issues as access?")," and we see that there is no relationship."),(0,i.kt)(r.uT,{user:"organization:alpha",relation:"access",object:"feature:issues",allowed:!1,mdxType:"CheckRequestViewer"}),(0,i.kt)("p",null,"If you have already completed some of the other tutorials you might have encountered the modeling pattern of ",(0,i.kt)("a",{parentName:"p",href:"/docs/modeling/parent-child"},"parent-child objects")," which is modeled as such:"),(0,i.kt)(r.lG,{configuration:{type:"resource",relations:{viewer:{tupleToUserset:{tupleset:{relation:"parent"},computedUserset:{relation:"all_objects_viewer"}}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("admonition",{type:"info"},(0,i.kt)("p",{parentName:"admonition"},"With this, when asked to check a user's ",(0,i.kt)("inlineCode",{parentName:"p"},"viewer")," relationship with the object, ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," will:"),(0,i.kt)("ol",{parentName:"admonition"},(0,i.kt)("li",{parentName:"ol"},"Read all relationship tuples of users related to this particular object as relation ",(0,i.kt)("inlineCode",{parentName:"li"},"parent")),(0,i.kt)("li",{parentName:"ol"},"For each relationship tuple, return all ",(0,i.kt)("em",{parentName:"li"},"usersets")," that have ",(0,i.kt)("inlineCode",{parentName:"li"},"all_objects_viewer")," relation to the objects in those relationship tuples"),(0,i.kt)("li",{parentName:"ol"},"If the user is in any of those ",(0,i.kt)("em",{parentName:"li"},"usersets"),", return yes, as the user is a ",(0,i.kt)("inlineCode",{parentName:"li"},"viewer")," on this object.\nIn other words, users related as ",(0,i.kt)("inlineCode",{parentName:"li"},"all_objects_viewer")," to any of this object's ",(0,i.kt)("inlineCode",{parentName:"li"},"parents")," are related as ",(0,i.kt)("inlineCode",{parentName:"li"},"viewer")," to this object."))),(0,i.kt)("p",null,"If you want to give all subscribers on a plan access to a feature, you can do it like so:"),(0,i.kt)(r.lG,{configuration:{type:"feature",relations:{associated_plan:{this:{}},access:{union:{child:[{this:{}},{tupleToUserset:{tupleset:{relation:"associated_plan"},computedUserset:{relation:"subscriber"}}}]}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]},access:{directly_related_user_types:[{type:"user"}]}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("admonition",{type:"info"},(0,i.kt)("p",{parentName:"admonition"},"Users related to ",(0,i.kt)("inlineCode",{parentName:"p"},"feature")," as ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," are the union of (any of):"),(0,i.kt)("ul",{parentName:"admonition"},(0,i.kt)("li",{parentName:"ul"},"the set of users with a direct ",(0,i.kt)("inlineCode",{parentName:"li"},"access")," relation"),(0,i.kt)("li",{parentName:"ul"},"the set of users related to the ",(0,i.kt)("inlineCode",{parentName:"li"},"associated_plan")," as ",(0,i.kt)("inlineCode",{parentName:"li"},"subscriber")," (the feature's associated plans' subscribers)")),(0,i.kt)("p",{parentName:"admonition"},"So everyone who has direct access, as well as the subscribers of the associated plan")),(0,i.kt)("p",null,"That would mean that in order for an object to have an ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation to a feature y, there needs to be either:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"a ",(0,i.kt)(r.uH,{section:"what-are-direct-and-implied-relationships",linkName:"direct relationship",mdxType:"ProductConcept"})," via a relationship tuple:\ne.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'{ "user": "user:x", "relation": "access", "object": "feature:y" }')),(0,i.kt)("li",{parentName:"ul"},"a subscriber relationship with another object related to x associated_plan:\ne.g. ",(0,i.kt)("inlineCode",{parentName:"li"},'{ "user": "user:x", "relation": "subscriber", "object": "plan:z" } { "user": "plan:z", "relation": "associated_plan", "object": "feature:y" }'))),(0,i.kt)("p",null,"That brings you close. That will allow you to grant organizations access to the feature (as organizations have a subscriber relation with the plan)."),(0,i.kt)("h4",{id:"adding-subscriber-relationship-with-another-object-related-to-x-associated_plan"},"Adding Subscriber Relationship With Another Object Related To x associated_plan"),(0,i.kt)("p",null,"One way forward would be to add a direct ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation between a user and a feature e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},'{ "user": "anne", "relation": "access", "object": "feature:y" }')," whenever the organization anne is subscribed to a plan, or the organization anne is in subscribes to a new plan.\nBut there are several downsides to this:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Your application layer now needs to worry about computing this relationship. Instead of letting ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," figure this all out, the app layer needs to do the checks whenever a user is being added or removed"),(0,i.kt)("li",{parentName:"ul"},"If an organization changes its subscription, your application layer has to loop through all the users and update their ",(0,i.kt)("inlineCode",{parentName:"li"},"access")," relationships to features accordingly")),(0,i.kt)("p",null,"Later in this tutorial, you will remove the possibility of having a direct ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation completely, but for now you will make sure the changes to the store you have made so far are working."),(0,i.kt)("p",null,"Replace all the existing code you had previously with the updated authorization model from the below snippet."),(0,i.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"feature",relations:{associated_plan:{this:{}},access:{union:{child:[{this:{}},{tupleToUserset:{tupleset:{relation:"associated_plan"},computedUserset:{relation:"subscriber"}}}]}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]},access:{directly_related_user_types:[{type:"user"}]}}}},{type:"plan",relations:{subscriber:{this:{}}},metadata:{relations:{subscriber:{directly_related_user_types:[{type:"organization"}]}}}},{type:"organization",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("p",null,"Now we can ask following query: ",(0,i.kt)("inlineCode",{parentName:"p"},"is organization:alpha related to feature:issues as access?")," again."),(0,i.kt)(r.uT,{user:"organization:alpha",relation:"access",object:"feature:issues",allowed:!0,mdxType:"CheckRequestViewer"}),(0,i.kt)("p",null,"You will notice that ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," now did find a relation, as ",(0,i.kt)("inlineCode",{parentName:"p"},"organization:alpha")," is a ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber")," to ",(0,i.kt)("inlineCode",{parentName:"p"},"plan:free")," which has an ",(0,i.kt)("inlineCode",{parentName:"p"},"associated_plan")," relation to ",(0,i.kt)("inlineCode",{parentName:"p"},"feature:issues"),". From that and the authorization model you updated above, ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," deduced that ",(0,i.kt)("inlineCode",{parentName:"p"},"organization:alpha")," has an implied ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation to ",(0,i.kt)("inlineCode",{parentName:"p"},"feature:issues"),"."),(0,i.kt)("p",null,"That is good, but you want to be able to ask ",(0,i.kt)("inlineCode",{parentName:"p"},"is anne related to feature:issues as access?"),", not ",(0,i.kt)("inlineCode",{parentName:"p"},"is organization:alpha related to feature:issues as access?"),". As in, you want the subscriber members to have access to the feature, not the subscriber itself."),(0,i.kt)("p",null,"In order to do that, you will add a relation on the plan, that indicates that all members of an organization subscribed to it, have a ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber_member")," relation to the plan. And you can modify the change you did above to give implied access to the ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber_member")," instead of the subscriber. Like so:"),(0,i.kt)(r.lG,{description:"Notice that `subscriber` has been updated to `subscriber_member` in the `access` relation of the `feature` type.\n Under the `plan` type, in order for someone to have a `subscriber_member` relation to the plan, they have to be related as a `member` to the object related as a `subscriber` to the plan (as in they have to be a member of on of the plan's subscribers).",configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"feature",relations:{associated_plan:{this:{}},access:{union:{child:[{this:{}},{tupleToUserset:{tupleset:{relation:"associated_plan"},computedUserset:{relation:"subscriber_member"}}}]}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]},access:{directly_related_user_types:[{type:"user"}]}}}},{type:"plan",relations:{subscriber:{this:{}},subscriber_member:{tupleToUserset:{tupleset:{relation:"subscriber"},computedUserset:{relation:"member"}}}},metadata:{relations:{subscriber:{directly_related_user_types:[{type:"organization"}]}}}},{type:"organization",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("admonition",{type:"info"},(0,i.kt)("p",{parentName:"admonition"},"Notice that ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber")," has been updated to ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber_member")," in the ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation of the ",(0,i.kt)("inlineCode",{parentName:"p"},"feature")," type."),(0,i.kt)("p",{parentName:"admonition"},"Under the ",(0,i.kt)("inlineCode",{parentName:"p"},"plan")," type, in order for someone to have a ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber_member")," relation to the plan, they have to be related as a ",(0,i.kt)("inlineCode",{parentName:"p"},"member")," to the object related as a ",(0,i.kt)("inlineCode",{parentName:"p"},"subscriber")," to the plan (as in they have to be a member of on of the plan's subscribers).")),(0,i.kt)("p",null,"Now ask the following query: ",(0,i.kt)("inlineCode",{parentName:"p"},"is anne related to feature:issues as access?")),(0,i.kt)(r.uT,{user:"user:anne",relation:"access",object:"feature:issues",allowed:!0,mdxType:"CheckRequestViewer"}),(0,i.kt)("h4",{id:"disallow-direct-relationship"},"Disallow Direct Relationship"),(0,i.kt)("p",null,"So far, with just a ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," authorization model, and the initial relationship tuples indicating the relations you know, you configured ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," to give you the correct response."),(0,i.kt)("p",null,"Earlier on, the idea of not allowing a direct ",(0,i.kt)("inlineCode",{parentName:"p"},"access")," relation between a user and a ",(0,i.kt)("inlineCode",{parentName:"p"},"feature")," was discussed, e.g. adding a relationship tuple like ",(0,i.kt)("inlineCode",{parentName:"p"},'{ "user": "user:anne", "relation": "access", "object": "feature:y" }'),". You will remove it now."),(0,i.kt)("p",null,"To disallow a direct relationship, you need to remove the direct relationship type restriction. The following snippet:"),(0,i.kt)(r.lG,{configuration:{type:"feature",relations:{associated_plan:{this:{}},access:{union:{child:[{this:{}},{tupleToUserset:{tupleset:{relation:"associated_plan"},computedUserset:{relation:"subscriber_member"}}}]}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]},access:{directly_related_user_types:[{type:"user"}]}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("p",null,"becomes"),(0,i.kt)(r.lG,{configuration:{type:"feature",relations:{associated_plan:{this:{}},access:{tupleToUserset:{tupleset:{relation:"associated_plan"},computedUserset:{relation:"subscriber_member"}}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("p",null,"With this change, even if your app layer added the following relationship tuple:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'{ "user": "user:anne", "relation": "access", "object": feature:issues }'))),(0,i.kt)("p",null,"a subsequent check for ",(0,i.kt)("inlineCode",{parentName:"p"},"is anne related to feature:issues as access?")," would return no relation. The only way for a relation to exist is if the following three relationship tuples do:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'{ "user": "user:anne", "relation": "member", "object": "organization:z" }')),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'{ "user": "organization:z", "relation": "subscriber", "object": "plan:y" }')),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},'{ "user": "plan:y", "relation": "associated_plan", "object": "feature:issues" }'))),(0,i.kt)("h4",{id:"verification-1"},"Verification"),(0,i.kt)("p",null,"Ensure that your authorization model matches the one below"),(0,i.kt)(r.lG,{configuration:{type_definitions:[{type:"user"},{type:"feature",relations:{associated_plan:{this:{}},access:{tupleToUserset:{tupleset:{relation:"associated_plan"},computedUserset:{relation:"subscriber_member"}}}},metadata:{relations:{associated_plan:{directly_related_user_types:[{type:"plan"}]}}}},{type:"plan",relations:{subscriber:{this:{}},subscriber_member:{tupleToUserset:{tupleset:{relation:"subscriber"},computedUserset:{relation:"member"}}}},metadata:{relations:{subscriber:{directly_related_user_types:[{type:"organization"}]}}}},{type:"organization",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,i.kt)("p",null,"You will now verify that the configuration is correct by running checks for all the scenarios mentioned at the beginning of the tutorial:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Issues")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Draft Pull Requests")," (expecting",(0,i.kt)("inlineCode",{parentName:"li"}," no"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Anne")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Single Sign-on")," (expecting",(0,i.kt)("inlineCode",{parentName:"li"}," no"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Issues")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Draft Pull Requests")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Beth")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Single Sign-on")," (expecting",(0,i.kt)("inlineCode",{parentName:"li"}," no"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Issues")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Draft Pull Requests")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"Charles")," has access to ",(0,i.kt)("strong",{parentName:"li"},"Single Sign-on")," (expecting ",(0,i.kt)("inlineCode",{parentName:"li"},"yes"),")")),(0,i.kt)(r.uT,{user:"user:anne",relation:"access",object:"feature:issues",allowed:!0,mdxType:"CheckRequestViewer"}),(0,i.kt)("p",null,"Try to verify for the other user, object and relation combinations as listed below."),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:null},"User"),(0,i.kt)("th",{parentName:"tr",align:null},"Object"),(0,i.kt)("th",{parentName:"tr",align:null},"Relation"),(0,i.kt)("th",{parentName:"tr",align:null},"Query"),(0,i.kt)("th",{parentName:"tr",align:null},"Relation?"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"anne")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:issues")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is anne related to feature:issues as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"anne")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:draft_prs")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is anne related to feature:draft_prs as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"No")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"anne")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:sso")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is anne related to feature:sso as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"No")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"beth")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:issues")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is beth related to feature:issues as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"beth")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:draft_prs")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is beth related to feature:draft_prs as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"beth")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:sso")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is beth related to feature:sso as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"No")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"charles")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:issues")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is charles related to feature:issues as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"charles")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:draft_prs")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is charles related to feature:draft_prs as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"charles")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"feature:sso")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"access")),(0,i.kt)("td",{parentName:"tr",align:null},(0,i.kt)("inlineCode",{parentName:"td"},"is charles related to feature:sso as access?")),(0,i.kt)("td",{parentName:"tr",align:null},"Yes")))),(0,i.kt)("h2",{id:"summary"},"Summary"),(0,i.kt)("p",null,"In this tutorial, you learned:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"to model entitlements for a system in ",(0,i.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})),(0,i.kt)("li",{parentName:"ul"},"how to start with a set of requirements and scenarios and iterate on the ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," authorization model until the checks match the expected scenarios"),(0,i.kt)("li",{parentName:"ul"},"how to model ",(0,i.kt)("a",{parentName:"li",href:"/docs/modeling/parent-child"},(0,i.kt)("strong",{parentName:"a"},"parent-child relationships"))," to indicate that a user having a relationship with a certain object implies having a relationship with another object in ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})),(0,i.kt)("li",{parentName:"ul"},"how to use ",(0,i.kt)("a",{parentName:"li",href:"/docs/configuration-language#the-union-operator"},(0,i.kt)("strong",{parentName:"a"},"the union operator"))," condition to indicate multiple possible paths for a relationship between two objects to be computed"),(0,i.kt)("li",{parentName:"ul"},"using ",(0,i.kt)("a",{parentName:"li",href:"/docs/configuration-language#the-direct-relationship-type-restrictions"},(0,i.kt)("strong",{parentName:"a"},"direct relationship type restrictions"))," in a ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," authorization model, and how to block direct relationships by removing it")),(0,i.kt)(r.XQ,{title:"Entitlements",preset:"entitlements",example:"Entitlements",store:"entitlements",mdxType:"Playground"}),(0,i.kt)("p",null,"Upcoming tutorials will dive deeper into ",(0,i.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}),", introducing concepts that will improve on the model you built today, and tackling different permission systems, with other relations and requirements that need to be met."))}c.isMDXComponent=!0},48847:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/entitlements-image-github-draft-pr-2ee031c09e3924b41681861e56aab2e7.svg"},15084:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/entitlements-image-github-no-draft-pr-785626465cfe1b8183918ee6bd3aefb1.svg"},9843:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/entitlements-image-pricing-github-2276507856dd07b091bcecc2376dde05.svg"},17638:(e,t,a)=>{a.d(t,{Z:()=>n});const n=a.p+"assets/images/entitlements-requirements-fdd4048edc4d4b3b78785f4c0671e0b1.svg"}}]); \ No newline at end of file diff --git a/assets/js/b2fd7883.5bd500b7.js b/assets/js/b2fd7883.19911445.js similarity index 73% rename from assets/js/b2fd7883.5bd500b7.js rename to assets/js/b2fd7883.19911445.js index a8a99312e..3f47441cd 100644 --- a/assets/js/b2fd7883.5bd500b7.js +++ b/assets/js/b2fd7883.19911445.js @@ -1 +1 @@ -"use strict";(self.webpackChunkopenfga_dev=self.webpackChunkopenfga_dev||[]).push([[8371],{22436:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>d,contentTitle:()=>s,default:()=>c,frontMatter:()=>a,metadata:()=>l,toc:()=>m});var i=o(87462),n=(o(67294),o(3905)),r=o(5270);const a={title:"Google Drive",description:"Modeling Google Drive permissions",sidebar_position:1,slug:"/modeling/advanced/gdrive"},s="Modeling Google Drive permissions with ",l={unversionedId:"content/modeling/advanced/gdrive",id:"content/modeling/advanced/gdrive",title:"Google Drive",description:"Modeling Google Drive permissions",source:"@site/docs/content/modeling/advanced/gdrive.mdx",sourceDirName:"content/modeling/advanced",slug:"/modeling/advanced/gdrive",permalink:"/docs/modeling/advanced/gdrive",draft:!1,editUrl:"https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/advanced/gdrive.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Google Drive",description:"Modeling Google Drive permissions",sidebar_position:1,slug:"/modeling/advanced/gdrive"},sidebar:"docs",previous:{title:"Advanced Use-Cases",permalink:"/docs/modeling/advanced"},next:{title:"GitHub",permalink:"/docs/modeling/advanced/github"}},d={},m=[{value:"Before You Start",id:"before-you-start",level:2},{value:" Concepts",id:"-concepts",level:3},{value:"Modeling Concentric Relationships",id:"modeling-concentric-relationships",level:4},{value:"Modeling Object-to-Object Relationships",id:"modeling-object-to-object-relationships",level:4},{value:"Modeling Public Access",id:"modeling-public-access",level:4},{value:"Concepts & Configuration Language",id:"concepts--configuration-language",level:4},{value:"What You Will Be Modeling",id:"what-you-will-be-modeling",level:2},{value:"Requirements",id:"requirements",level:3},{value:"Defined Scenarios",id:"defined-scenarios",level:3},{value:"Modeling Google Drive's Permissions",id:"modeling-google-drives-permissions",level:2},{value:"01. Individual Permissions",id:"01-individual-permissions",level:3},{value:"02. Organization Permissions",id:"02-organization-permissions",level:3},{value:"03. Folder Permission Propagation",id:"03-folder-permission-propagation",level:3},{value:"04. Sharing Files And Folders Publicly",id:"04-sharing-files-and-folders-publicly",level:3},{value:"Related Sections",id:"related-sections",level:2}],p={toc:m},u="wrapper";function c(e){let{components:t,...a}=e;return(0,n.kt)(u,(0,i.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"modeling-google-drive-permissions-with-"},"Modeling Google Drive permissions with ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})),(0,n.kt)(r.AH,{mdxType:"DocumentationNotice"}),(0,n.kt)("p",null,"This tutorial explains how to represent ",(0,n.kt)("a",{parentName:"p",href:"https://www.google.com/intl/en-GB/drive/"},"Google Drive")," permissions model with ",(0,n.kt)(r.rZ,{format:r.v7.ProductLink,mdxType:"ProductName"}),"."),(0,n.kt)(r.S1,{title:"What you will learn",mdxType:"CardBox"},(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Indicate ",(0,n.kt)(r.uH,{section:"what-is-a-relationship",linkName:"relationships",mdxType:"ProductConcept"})," between a group of ",(0,n.kt)("strong",{parentName:"li"},(0,n.kt)(r.uH,{section:"what-is-a-user",linkName:"users",mdxType:"ProductConcept"}))," and an ",(0,n.kt)("strong",{parentName:"li"},(0,n.kt)(r.uH,{section:"what-is-an-object",linkName:"object",mdxType:"ProductConcept"})),". See ",(0,n.kt)("a",{parentName:"li",href:"/docs/modeling/user-groups"},"Modeling User Groups")," for more.",(0,n.kt)("br",null),"\nUsed here to indicate that all users within a domain can access a document (sharing a document within an organization)."),(0,n.kt)("li",{parentName:"ul"},"Model ",(0,n.kt)("strong",{parentName:"li"},"concentric relationship")," to have a certain ",(0,n.kt)(r.uH,{section:"what-is-a-relation",linkName:"relation",mdxType:"ProductConcept"})," on an object imply another relation on the same object. See ",(0,n.kt)("a",{parentName:"li",href:"/docs/modeling/building-blocks/concentric-relationships"},"Modeling Concepts: Concentric Relationships")," for more.",(0,n.kt)("br",null),"\nUsed here is to indicate that writers are also commenters and viewers."),(0,n.kt)("li",{parentName:"ul"},"Using ",(0,n.kt)("a",{parentName:"li",href:"/docs/configuration-language#the-union-operator"},(0,n.kt)("strong",{parentName:"a"},"the union operator"))," condition to indicate that a user might have a certain relation with an object if they match any of the criteria indicated.",(0,n.kt)("br",null),"\nUsed here to indicate that a user can be a viewer on a document, or can have the viewer relationship implied through commenter."),(0,n.kt)("li",{parentName:"ul"},"Using the ",(0,n.kt)("strong",{parentName:"li"},(0,n.kt)(r.uH,{section:"what-is-type-bound-public-access",linkName:"type bound public access",mdxType:"ProductConcept"}))," in a ",(0,n.kt)(r.uH,{section:"what-is-a-relationship-tuple",linkName:"relationship tuple's",mdxType:"ProductConcept"})," user field to indicate that everyone has a certain relation with an object. See ",(0,n.kt)("a",{parentName:"li",href:"/docs/modeling/public-access"},"Modeling Public Access")," for more.",(0,n.kt)("br",null),"\nUsed here to ",(0,n.kt)("a",{parentName:"li",href:"#04-sharing-files-and-folders-publicly"},"share documents publicly"),"."),(0,n.kt)("li",{parentName:"ul"},"Model ",(0,n.kt)("a",{parentName:"li",href:"/docs/modeling/parent-child"},(0,n.kt)("strong",{parentName:"a"},"parent-child objects"))," to indicate that a user having a relationship with a certain object implies having a relationship with another object in ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}),".",(0,n.kt)("br",null),"\nUsed here is to indicate that a writer on a folder is a writer on all documents inside that folder."))),(0,n.kt)(r.XQ,{title:"Google Drive",preset:"drive",example:"Google Drive",store:"gdrive",mdxType:"Playground"}),(0,n.kt)("h2",{id:"before-you-start"},"Before You Start"),(0,n.kt)("p",null,"In order to understand this guide correctly you must be familiar with some ",(0,n.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," concepts and know how to develop the things that we will list below."),(0,n.kt)("details",null,(0,n.kt)("summary",null,(0,n.kt)("h3",{id:"-concepts"},(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," Concepts"),(0,n.kt)("p",null,"It would be helpful to have an understanding of some concepts of ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," before you start.")),(0,n.kt)("h4",{id:"modeling-concentric-relationships"},"Modeling Concentric Relationships"),(0,n.kt)("p",null,"You need to know how to update the authorization model to allow having nested relations such as all writers are readers. ",(0,n.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/concentric-relationships"},"Learn more \u2192")),(0,n.kt)("h4",{id:"modeling-object-to-object-relationships"},"Modeling Object-to-Object Relationships"),(0,n.kt)("p",null,"You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. ",(0,n.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/object-to-object-relationships"},"Learn more \u2192")),(0,n.kt)("p",null,"Used here to indicate that users who have access to view a folder have access to view all documents inside it."),(0,n.kt)("h4",{id:"modeling-public-access"},"Modeling Public Access"),(0,n.kt)("p",null,"You need to know how to add a relationship tuple to indicate that a resource is publicly available. ",(0,n.kt)("a",{parentName:"p",href:"/docs/modeling/public-access"},"Learn more \u2192")),(0,n.kt)("h4",{id:"concepts--configuration-language"},"Concepts & Configuration Language"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"The ",(0,n.kt)(r.uH,{mdxType:"ProductConcept"})),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/docs/configuration-language"},"Configuration Language")))),(0,n.kt)("h2",{id:"what-you-will-be-modeling"},"What You Will Be Modeling"),(0,n.kt)("p",null,"Google Drive is a system to store, share, and collaborate on files and folders. ",(0,n.kt)("a",{parentName:"p",href:"https://www.google.com/drive/"},"Source")),(0,n.kt)("p",null,"In this tutorial, you will build a subset of the Google Drive permission model (detailed below) in ",(0,n.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"}),", using some scenarios to validate the model."),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"Note: For brevity, this tutorial will not model all of Google Drive's permissions. Instead, it will focus on modeling for the scenarios outlined below")),(0,n.kt)("h3",{id:"requirements"},"Requirements"),(0,n.kt)("p",null,"Google Drive's permission model is represented in ",(0,n.kt)("a",{parentName:"p",href:"https://developers.google.com/drive/api/v3/ref-roles"},"their documentation"),"."),(0,n.kt)("p",null,"In this tutorial, you will be focusing on a subset of these permissions."),(0,n.kt)("p",null,"Requirements:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Users can be owners, editors, commenters and viewers of documents"),(0,n.kt)("li",{parentName:"ul"},"Documents can be shared with all users in a domain"),(0,n.kt)("li",{parentName:"ul"},"Folders can contain documents and users with a certain permission on a folder have that same permission to a document in that folder"),(0,n.kt)("li",{parentName:"ul"},"Documents and folders can be shared publicly")),(0,n.kt)("h3",{id:"defined-scenarios"},"Defined Scenarios"),(0,n.kt)("p",null,"There will be the following users:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Anne, who is in the xyz domain"),(0,n.kt)("li",{parentName:"ul"},"Beth, who is in the xyz domain"),(0,n.kt)("li",{parentName:"ul"},"Charles, who is in the xyz domain"),(0,n.kt)("li",{parentName:"ul"},"Diane, who is NOT in the xyz domain"),(0,n.kt)("li",{parentName:"ul"},"Erik, who is NOT in the xyz domain")),(0,n.kt)("p",null,"There will be:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a 2021-budget document, owned by Anne, shared for commenting with Beth and viewable by all members of the xyz domain."),(0,n.kt)("li",{parentName:"ul"},"a 2021-planning folder, viewable by Diane and contains the 2021-budget document"),(0,n.kt)("li",{parentName:"ul"},"a 2021-public-roadmap document, owned by Anne, available for members xyz domain to comment on and is publicly viewable")),(0,n.kt)("h2",{id:"modeling-google-drives-permissions"},"Modeling Google Drive's Permissions"),(0,n.kt)("h3",{id:"01-individual-permissions"},"01. Individual Permissions"),(0,n.kt)("p",null,"To keep thing simple and focus on ",(0,n.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," features rather than Google Drive complexity we will model only four ",(0,n.kt)("a",{parentName:"p",href:"https://developers.google.com/drive/api/v3/ref-roles"},"roles")," (Viewer, Commenter, Writer, Owner)."),(0,n.kt)("p",null,"At the end of this section we want to have the following permissions represented:"),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Image showing permissions",src:o(99459).Z,width:"940",height:"357"})),(0,n.kt)("p",null,"To represent permissions in ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," we use ",(0,n.kt)(r.uH,{section:"what-is-a-relation",linkName:"relations",mdxType:"ProductConcept"}),". For document permissions we need to create the following ",(0,n.kt)(r.uH,{section:"what-is-an-authorization-model",linkName:"authorization model",mdxType:"ProductConcept"}),":"),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document",relations:{owner:{this:{}},writer:{this:{}},commenter:{this:{}},viewer:{this:{}}},metadata:{relations:{owner:{directly_related_user_types:[{type:"user"}]},writer:{directly_related_user_types:[{type:"user"}]},commenter:{directly_related_user_types:[{type:"user"}]},viewer:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("p",null,"The ",(0,n.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," service determines if a ",(0,n.kt)(r.uH,{section:"what-is-a-user",linkName:"user",mdxType:"ProductConcept"})," has access to an ",(0,n.kt)(r.uH,{section:"what-is-an-object",linkName:"object",mdxType:"ProductConcept"})," by ",(0,n.kt)(r.uH,{section:"what-is-a-check-request",linkName:"checking",mdxType:"ProductConcept"})," if the user has a relation to that object. Let us examine one of those relations in detail:"),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type:"document",relations:{viewer:{this:{}}},metadata:{relations:{viewer:{directly_related_user_types:[{type:"user"}]}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("admonition",{type:"info"},(0,n.kt)("p",{parentName:"admonition"},'The snippet above indicates that objects of type document have users related to them as "viewer" if those users belong to the userset of all users related to the document as "viewer".'),(0,n.kt)("p",{parentName:"admonition"},"This means that a user can be ",(0,n.kt)(r.uH,{section:"what-are-direct-and-implied-relationships",linkName:"directly related",mdxType:"ProductConcept"}),' as a viewer to an object of type "document"')),(0,n.kt)("p",null,"If we want to say ",(0,n.kt)("inlineCode",{parentName:"p"},"beth")," is a commenter of ",(0,n.kt)("strong",{parentName:"p"},"document:2021-budget")," we create this relationship tuple:"),(0,n.kt)(r.Gb,{relationshipTuples:[{user:"user:beth",relation:"commenter",object:"document:2021-budget"}],mdxType:"WriteRequestViewer"}),(0,n.kt)("p",null,"We can now ask ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}),' "is ',(0,n.kt)("inlineCode",{parentName:"p"},"beth")," a commenter of repository ",(0,n.kt)("strong",{parentName:"p"},"document:2021-budget"),'?"'),(0,n.kt)(r.uT,{user:"user:beth",relation:"commenter",object:"document:2021-budget",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)("p",null,"We could also say that ",(0,n.kt)("inlineCode",{parentName:"p"},"anne")," is an owner of the same document:"),(0,n.kt)(r.Gb,{relationshipTuples:[{user:"user:anne",relation:"owner",object:"document:2021-budget"}],mdxType:"WriteRequestViewer"}),(0,n.kt)("p",null,"And ",(0,n.kt)(r.uH,{section:"what-is-a-check-request",linkName:"ask",mdxType:"ProductConcept"})," some questions to ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}),":"),(0,n.kt)(r.uT,{user:"user:anne",relation:"owner",object:"document:2021-budget",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)(r.uT,{user:"user:anne",relation:"writer",object:"document:2021-budget",allowed:!1,mdxType:"CheckRequestViewer"}),(0,n.kt)("p",null,"The first reply makes sense but the second one does not. Intuitively, if ",(0,n.kt)("inlineCode",{parentName:"p"},"anne")," was an ",(0,n.kt)("strong",{parentName:"p"},"owner"),", she was also be a ",(0,n.kt)("strong",{parentName:"p"},"writer"),". In fact, Google Drive explains this in ",(0,n.kt)("a",{parentName:"p",href:"https://developers.google.com/drive/api/v3/ref-roles"},"their documentation")),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Image showing roles",src:o(38035).Z,width:"677",height:"789"})),(0,n.kt)("p",null,"To make ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}),' aware of this "concentric" permission model we need to update our definitions:'),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document",relations:{owner:{this:{}},writer:{union:{child:[{this:{}},{computedUserset:{relation:"owner"}}]}},commenter:{union:{child:[{this:{}},{computedUserset:{relation:"writer"}}]}},viewer:{union:{child:[{this:{}},{computedUserset:{relation:"commenter"}}]}}},metadata:{relations:{owner:{directly_related_user_types:[{type:"user"}]},writer:{directly_related_user_types:[{type:"user"}]},commenter:{directly_related_user_types:[{type:"user"}]},viewer:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("admonition",{type:"info"},(0,n.kt)("p",{parentName:"admonition"},"Let's examine one of those relations in detail:"),(0,n.kt)("p",{parentName:"admonition"},'objects of type document have users related to them as "viewer": if they belong to any of (the union of) the following:'),(0,n.kt)("ul",{parentName:"admonition"},(0,n.kt)("li",{parentName:"ul"},'the userset of all users related to the document as "viewer"'),(0,n.kt)("li",{parentName:"ul"},'the userset of all users related to the document as "commenter"'))),(0,n.kt)("p",null,"With this update our model now supports nested definitions and now:"),(0,n.kt)(r.uT,{user:"user:anne",relation:"owner",object:"document:2021-budget",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)(r.uT,{user:"user:anne",relation:"writer",object:"document:2021-budget",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)("h3",{id:"02-organization-permissions"},"02. Organization Permissions"),(0,n.kt)("p",null,"Google Drive allows you to share a file with everyone in your organization as a viewer, commenter or writer/editor."),(0,n.kt)("p",null,(0,n.kt)("img",{src:o(79368).Z,width:"1302",height:"724"})),(0,n.kt)("p",null,"At the end of this section we want to end up with the following permissions represented:"),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Image showing permissions",src:o(38836).Z,width:"940",height:"542"})),(0,n.kt)("p",null,"To add support for domains and members all we need to do is add this object to the ",(0,n.kt)(r.rZ,{format:r.v7.ProductLink,mdxType:"ProductName"})," ",(0,n.kt)(r.uH,{section:"what-is-a-type-definition",linkName:"authorization model",mdxType:"ProductConcept"}),". In addition, update the model to allow domain member to be assigned to document:"),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document",relations:{owner:{this:{}},writer:{union:{child:[{this:{}},{computedUserset:{relation:"owner"}}]}},commenter:{union:{child:[{this:{}},{computedUserset:{relation:"writer"}}]}},viewer:{union:{child:[{this:{}},{computedUserset:{relation:"commenter"}}]}}},metadata:{relations:{owner:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},writer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},commenter:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},viewer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]}}}},{type:"domain",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("admonition",{type:"info"},(0,n.kt)("p",{parentName:"admonition"},'Objects of type "domain" have users related to them as "member" if they belong to the userset of all users related to the domain as "member".'),(0,n.kt)("p",{parentName:"admonition"},"In other words, users can be direct members of a domain.")),(0,n.kt)("p",null,"Let's now create a domain, add members to it and make all members ",(0,n.kt)("strong",{parentName:"p"},"viewers")," of ",(0,n.kt)("strong",{parentName:"p"},"document:2021-budget"),"."),(0,n.kt)(r.Gb,{relationshipTuples:[{_description:"make anne, beth, charles a member of the xyz domain",user:"user:anne",relation:"member",object:"domain:xyz"},{user:"user:beth",relation:"member",object:"domain:xyz"},{user:"user:charles",relation:"member",object:"domain:xyz"},{_description:"make members of xyz domain viewers of document:2021-budget",user:"domain:xyz#member",relation:"viewer",object:"document:2021-budget"}],mdxType:"WriteRequestViewer"}),(0,n.kt)("p",null,"The last relationship tuple introduces a new ",(0,n.kt)("strong",{parentName:"p"},(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}))," concept. A ",(0,n.kt)("strong",{parentName:"p"},(0,n.kt)(r.uH,{section:"what-is-a-user",linkName:"userset",mdxType:"ProductConcept"})),". When the value of a user is formatted like this ",(0,n.kt)("strong",{parentName:"p"},"objectType:objectId#relation"),", ",(0,n.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," will automatically expand the userset into all its individual user identifiers:"),(0,n.kt)(r.uT,{user:"user:charles",relation:"viewer",object:"document:2021-budget",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)("h3",{id:"03-folder-permission-propagation"},"03. Folder Permission Propagation"),(0,n.kt)("p",null,(0,n.kt)("a",{parentName:"p",href:"https://developers.google.com/drive/api/v3/manage-sharing#permission_propagation"},"Permission propagation")," happens between folders and files: if you are a viewer in a folder, you can view its documents. This applies even when you are not explicitly a viewer in a document.\n",(0,n.kt)("img",{parentName:"p",src:"https://pbs.twimg.com/media/Eme_FlYW4AEAYfi?format=jpg&name=large",alt:"Image"})),(0,n.kt)("p",null,"At the end of this section we want to end up with the following permissions represented. Note that a folder is an object in the ",(0,n.kt)("strong",{parentName:"p"},"document")," type, as we do not need a separate type:"),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Image showing permissions",src:o(33888).Z,width:"940",height:"578"})),(0,n.kt)("p",null,"We need to add the notion that a ",(0,n.kt)("strong",{parentName:"p"},"document")," can be the ",(0,n.kt)("strong",{parentName:"p"},"parent")," of another ",(0,n.kt)("strong",{parentName:"p"},"document"),". We know how to do that:"),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document",relations:{parent:{this:{}},owner:{this:{}},writer:{union:{child:[{this:{}},{computedUserset:{relation:"owner"}}]}},commenter:{union:{child:[{this:{}},{computedUserset:{relation:"writer"}}]}},viewer:{union:{child:[{this:{}},{computedUserset:{relation:"commenter"}}]}}},metadata:{relations:{parent:{directly_related_user_types:[{type:"document"}]},owner:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},writer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},commenter:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},viewer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("admonition",{type:"info"},(0,n.kt)("p",{parentName:"admonition"},'Notice the newly added "parent" relation in the configuration above.')),(0,n.kt)("p",null,"We can indicate this relation by adding the following relationship tuples"),(0,n.kt)(r.Gb,{relationshipTuples:[{_description:"Diane is a viewer of document:2021-planning",user:"user:diane",relation:"viewer",object:"document:2021-planning"},{_description:"document:2021-planning is a parent of document:2021-budget",user:"document:2021-planning",relation:"parent",object:"document:2021-budget"}],mdxType:"WriteRequestViewer"}),(0,n.kt)("p",null,"What we still lack is the ability to propagate permissions from parent to children. We want to say that a user is a viewer of a document if either:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"[done]"," they have a viewer relationship (directly or through domain membership)"),(0,n.kt)("li",{parentName:"ul"},"[pending]"," they have a viewer relationship with the parent document")),(0,n.kt)("p",null,"We need a way to consider the parent viewers, not just direct viewers of the document when getting a check for:"),(0,n.kt)(r.uT,{user:"user:diane",relation:"viewer",object:"document:2021-budget",mdxType:"CheckRequestViewer"}),(0,n.kt)("p",null,"More details on this technique can be found in the section ",(0,n.kt)("a",{parentName:"p",href:"/docs/modeling/parent-child"},"Modeling Parent-Child Objects"),"."),(0,n.kt)("p",null,"We express it like this:"),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"document",relations:{viewer:{union:{child:[{this:{}},{computedUserset:{relation:"commenter"}},{tupleToUserset:{tupleset:{relation:"parent"},computedUserset:{relation:"viewer"}}}]}}},metadata:{relations:{viewer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]}}}}]},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("admonition",{type:"info"},(0,n.kt)("p",{parentName:"admonition"},'The users with a viewer relationship to a certain object of type "document" are any of:'),(0,n.kt)("ul",{parentName:"admonition"},(0,n.kt)("li",{parentName:"ul"},'the "viewers": the set of users who are ',(0,n.kt)(r.uH,{section:"what-are-direct-and-implied-relationships",linkName:"directly related",mdxType:"ProductConcept"}),' to the document as a "viewer"'),(0,n.kt)("li",{parentName:"ul"},'the "commenters": the set of users who are related to the object as "commenter"'),(0,n.kt)("li",{parentName:"ul"},'the "viewers of the parents": from the objects who are related to the doc as parent, return the sets of users who are related to those objects as "viewer"')),(0,n.kt)("p",{parentName:"admonition"},"What the added section is doing is:"),(0,n.kt)("ol",{parentName:"admonition"},(0,n.kt)("li",{parentName:"ol"},"read all relationship tuples related to document:2021-budget as parent which returns:")),(0,n.kt)("p",{parentName:"admonition"},(0,n.kt)("inlineCode",{parentName:"p"},'[{ "object": "document:2021-budget", "relation": "parent", "user": "document:2021-planning" }]')),(0,n.kt)("ol",{parentName:"admonition",start:2},(0,n.kt)("li",{parentName:"ol"},"for each relationship tuple read, return all usersets that match the following, returning tuples of shape:")),(0,n.kt)("p",{parentName:"admonition"},(0,n.kt)("inlineCode",{parentName:"p"},'{ "object": "document:2021-planning", "viewer", "user": ??? }')),(0,n.kt)("p",{parentName:"admonition"},"including: ",(0,n.kt)("inlineCode",{parentName:"p"},'{ "object": "document:2021-planning", "viewer", "user": "user:diane" }'))),(0,n.kt)("p",null,"The updated authorization model looks like this:"),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document",relations:{owner:{union:{child:[{this:{}},{tupleToUserset:{computedUserset:{relation:"owner"},tupleset:{relation:"parent"}}}]}},writer:{union:{child:[{this:{}},{computedUserset:{relation:"owner"}},{tupleToUserset:{computedUserset:{relation:"writer"},tupleset:{relation:"parent"}}}]}},commenter:{union:{child:[{this:{}},{computedUserset:{relation:"writer"}},{tupleToUserset:{computedUserset:{relation:"commenter"},tupleset:{relation:"parent"}}}]}},viewer:{union:{child:[{this:{}},{computedUserset:{relation:"commenter"}},{tupleToUserset:{computedUserset:{relation:"viewer"},tupleset:{relation:"parent"}}}]}},parent:{this:{}}},metadata:{relations:{parent:{directly_related_user_types:[{type:"document"}]},owner:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},writer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},commenter:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},viewer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]}}}},{type:"domain",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("h3",{id:"04-sharing-files-and-folders-publicly"},"04. Sharing Files And Folders Publicly"),(0,n.kt)("p",null,"Google Drive has a feature which allows ",(0,n.kt)("a",{parentName:"p",href:"https://support.google.com/a/users/answer/9308873?hl=en"},"sharing a file or folder publicly"),", and specifying the permissions a public user might have (writer/commenter/viewer)."),(0,n.kt)("p",null,"Assume that ",(0,n.kt)("inlineCode",{parentName:"p"},"Anne")," has created a new document: ",(0,n.kt)("inlineCode",{parentName:"p"},"2021-public-roadmap"),", has shared it with commenter permissions to the ",(0,n.kt)("inlineCode",{parentName:"p"},"xyz.com"),", and has shared it as view only with the public at large."),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Image showing requirements",src:o(63597).Z,width:"940",height:"649"})),(0,n.kt)("p",null,"Here's where another ",(0,n.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," feature, ",(0,n.kt)(r.uH,{section:"what-is-type-bound-public-access",linkName:"type bound public access",mdxType:"ProductConcept"})," (as in everyone), would come in handy."),(0,n.kt)("p",null,"First, we will need to update our model to allow for public access with type ",(0,n.kt)("inlineCode",{parentName:"p"},"user")," for viewer relation."),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document",relations:{owner:{union:{child:[{this:{}},{tupleToUserset:{computedUserset:{relation:"owner"},tupleset:{relation:"parent"}}}]}},writer:{union:{child:[{this:{}},{computedUserset:{relation:"owner"}},{tupleToUserset:{computedUserset:{relation:"writer"},tupleset:{relation:"parent"}}}]}},commenter:{union:{child:[{this:{}},{computedUserset:{relation:"writer"}},{tupleToUserset:{computedUserset:{relation:"commenter"},tupleset:{relation:"parent"}}}]}},viewer:{union:{child:[{this:{}},{computedUserset:{relation:"commenter"}},{tupleToUserset:{computedUserset:{relation:"viewer"},tupleset:{relation:"parent"}}}]}},parent:{this:{}}},metadata:{relations:{parent:{directly_related_user_types:[{type:"document"}]},owner:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},writer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},commenter:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},viewer:{directly_related_user_types:[{type:"user"},{type:"user",wildcard:{}},{type:"domain",relation:"member"}]}}}},{type:"domain",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("p",null,"To mark Anne as the owner, the domain members as commenters and the public as viewers, we need to add the following relationship tuples:"),(0,n.kt)(r.Gb,{relationshipTuples:[{_description:"Anne is the owner of document:2021-public-roadmap",user:"user:anne",relation:"owner",object:"document:2021-public-roadmap"},{_description:"Members of the domain:xyz can comment on document:2021-public-roadmap",user:"domain:xyz#member",relation:"commenter",object:"document:2021-public-roadmap"},{_description:"Everyone with type `user` can view document:2021-public-roadmap",user:"user:*",relation:"viewer",object:"document:2021-public-roadmap"}],mdxType:"WriteRequestViewer"}),(0,n.kt)("p",null,"Anne is an owner of the document"),(0,n.kt)(r.uT,{user:"user:anne",relation:"owner",object:"document:2021-public-roadmap",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)("p",null,"Beth is a member of the xyz.com domain, and so can comment but cannot write"),(0,n.kt)(r.uT,{user:"user:beth",relation:"writer",object:"document:2021-public-roadmap",allowed:!1,mdxType:"CheckRequestViewer"}),(0,n.kt)(r.uT,{user:"user:beth",relation:"commenter",object:"document:2021-public-roadmap",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)("p",null,"Erik is NOT a member of the xyz.com domain, and so can only view the document"),(0,n.kt)(r.uT,{user:"user:erik",relation:"writer",object:"document:2021-public-roadmap",allowed:!1,mdxType:"CheckRequestViewer"}),(0,n.kt)(r.uT,{user:"user:erik",relation:"viewer",object:"document:2021-public-roadmap",allowed:!1,mdxType:"CheckRequestViewer"}),(0,n.kt)(r.XQ,{title:"Google Drive",preset:"drive",example:"Google Drive",store:"gdrive",mdxType:"Playground"}),(0,n.kt)("h2",{id:"related-sections"},"Related Sections"),(0,n.kt)(r.$q,{description:"Take a look at the following sections for more information.",relatedLinks:[{title:"Search with permissions",description:"Give your users search results with objects that they have access to",link:"../../interacting/search-with-permissions"}],mdxType:"RelatedSection"}))}c.isMDXComponent=!0},99459:(e,t,o)=>{o.d(t,{Z:()=>i});const i=o.p+"assets/images/gdrive-gdrive1-22dac26c1f55a55daeb65acff88ee193.svg"},38836:(e,t,o)=>{o.d(t,{Z:()=>i});const i=o.p+"assets/images/gdrive-gdrive2-abe697d20cfce6658d6a09aed7af8d97.svg"},33888:(e,t,o)=>{o.d(t,{Z:()=>i});const i=o.p+"assets/images/gdrive-gdrive3-e82c9d5308de7d3b5e7b74b59d87044f.svg"},63597:(e,t,o)=>{o.d(t,{Z:()=>i});const i=o.p+"assets/images/gdrive-gdrive4-9b75eafa345dde22742988b225671a69.svg"},79368:(e,t,o)=>{o.d(t,{Z:()=>i});const i=o.p+"assets/images/gdrive-org-fe69008225e62f28ff2280708e875f09.svg"},38035:(e,t,o)=>{o.d(t,{Z:()=>i});const i=o.p+"assets/images/gdrive-roles-ac60dede6567bd76e873d1a81d642532.svg"}}]); \ No newline at end of file +"use strict";(self.webpackChunkopenfga_dev=self.webpackChunkopenfga_dev||[]).push([[8371],{22436:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>d,contentTitle:()=>s,default:()=>c,frontMatter:()=>a,metadata:()=>l,toc:()=>m});var i=o(87462),n=(o(67294),o(3905)),r=o(5270);const a={title:"Google Drive",description:"Modeling Google Drive permissions",sidebar_position:1,slug:"/modeling/advanced/gdrive"},s="Modeling Google Drive permissions with ",l={unversionedId:"content/modeling/advanced/gdrive",id:"content/modeling/advanced/gdrive",title:"Google Drive",description:"Modeling Google Drive permissions",source:"@site/docs/content/modeling/advanced/gdrive.mdx",sourceDirName:"content/modeling/advanced",slug:"/modeling/advanced/gdrive",permalink:"/docs/modeling/advanced/gdrive",draft:!1,editUrl:"https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/advanced/gdrive.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Google Drive",description:"Modeling Google Drive permissions",sidebar_position:1,slug:"/modeling/advanced/gdrive"},sidebar:"docs",previous:{title:"Advanced Use-Cases",permalink:"/docs/modeling/advanced"},next:{title:"GitHub",permalink:"/docs/modeling/advanced/github"}},d={},m=[{value:"Before You Start",id:"before-you-start",level:2},{value:" Concepts",id:"-concepts",level:3},{value:"Modeling Concentric Relationships",id:"modeling-concentric-relationships",level:4},{value:"Modeling Object-to-Object Relationships",id:"modeling-object-to-object-relationships",level:4},{value:"Modeling Public Access",id:"modeling-public-access",level:4},{value:"Concepts & Configuration Language",id:"concepts--configuration-language",level:4},{value:"What You Will Be Modeling",id:"what-you-will-be-modeling",level:2},{value:"Requirements",id:"requirements",level:3},{value:"Defined Scenarios",id:"defined-scenarios",level:3},{value:"Modeling Google Drive's Permissions",id:"modeling-google-drives-permissions",level:2},{value:"01. Individual Permissions",id:"01-individual-permissions",level:3},{value:"02. Organization Permissions",id:"02-organization-permissions",level:3},{value:"03. Folder Permission Propagation",id:"03-folder-permission-propagation",level:3},{value:"04. Sharing Files And Folders Publicly",id:"04-sharing-files-and-folders-publicly",level:3},{value:"Related Sections",id:"related-sections",level:2}],p={toc:m},u="wrapper";function c(e){let{components:t,...a}=e;return(0,n.kt)(u,(0,i.Z)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"modeling-google-drive-permissions-with-"},"Modeling Google Drive permissions with ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})),(0,n.kt)(r.AH,{mdxType:"DocumentationNotice"}),(0,n.kt)("p",null,"This tutorial explains how to represent ",(0,n.kt)("a",{parentName:"p",href:"https://www.google.com/intl/en-GB/drive/"},"Google Drive")," permissions model with ",(0,n.kt)(r.rZ,{format:r.v7.ProductLink,mdxType:"ProductName"}),"."),(0,n.kt)(r.S1,{title:"What you will learn",mdxType:"CardBox"},(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Indicate ",(0,n.kt)(r.uH,{section:"what-is-a-relationship",linkName:"relationships",mdxType:"ProductConcept"})," between a group of ",(0,n.kt)("strong",{parentName:"li"},(0,n.kt)(r.uH,{section:"what-is-a-user",linkName:"users",mdxType:"ProductConcept"}))," and an ",(0,n.kt)("strong",{parentName:"li"},(0,n.kt)(r.uH,{section:"what-is-an-object",linkName:"object",mdxType:"ProductConcept"})),". See ",(0,n.kt)("a",{parentName:"li",href:"/docs/modeling/user-groups"},"Modeling User Groups")," for more.",(0,n.kt)("br",null),"\nUsed here to indicate that all users within a domain can access a document (sharing a document within an organization)."),(0,n.kt)("li",{parentName:"ul"},"Model ",(0,n.kt)("strong",{parentName:"li"},"concentric relationship")," to have a certain ",(0,n.kt)(r.uH,{section:"what-is-a-relation",linkName:"relation",mdxType:"ProductConcept"})," on an object imply another relation on the same object. See ",(0,n.kt)("a",{parentName:"li",href:"/docs/modeling/building-blocks/concentric-relationships"},"Modeling Concepts: Concentric Relationships")," for more.",(0,n.kt)("br",null),"\nUsed here is to indicate that writers are also commenters and viewers."),(0,n.kt)("li",{parentName:"ul"},"Using ",(0,n.kt)("a",{parentName:"li",href:"/docs/configuration-language#the-union-operator"},(0,n.kt)("strong",{parentName:"a"},"the union operator"))," condition to indicate that a user might have a certain relation with an object if they match any of the criteria indicated.",(0,n.kt)("br",null),"\nUsed here to indicate that a user can be a viewer on a document, or can have the viewer relationship implied through commenter."),(0,n.kt)("li",{parentName:"ul"},"Using the ",(0,n.kt)("strong",{parentName:"li"},(0,n.kt)(r.uH,{section:"what-is-type-bound-public-access",linkName:"type bound public access",mdxType:"ProductConcept"}))," in a ",(0,n.kt)(r.uH,{section:"what-is-a-relationship-tuple",linkName:"relationship tuple's",mdxType:"ProductConcept"})," user field to indicate that everyone has a certain relation with an object. See ",(0,n.kt)("a",{parentName:"li",href:"/docs/modeling/public-access"},"Modeling Public Access")," for more.",(0,n.kt)("br",null),"\nUsed here to ",(0,n.kt)("a",{parentName:"li",href:"#04-sharing-files-and-folders-publicly"},"share documents publicly"),"."),(0,n.kt)("li",{parentName:"ul"},"Model ",(0,n.kt)("a",{parentName:"li",href:"/docs/modeling/parent-child"},(0,n.kt)("strong",{parentName:"a"},"parent-child objects"))," to indicate that a user having a relationship with a certain object implies having a relationship with another object in ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}),".",(0,n.kt)("br",null),"\nUsed here is to indicate that a writer on a folder is a writer on all documents inside that folder."))),(0,n.kt)(r.XQ,{title:"Google Drive",preset:"drive",example:"Google Drive",store:"gdrive",mdxType:"Playground"}),(0,n.kt)("h2",{id:"before-you-start"},"Before You Start"),(0,n.kt)("p",null,"In order to understand this guide correctly you must be familiar with some ",(0,n.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," concepts and know how to develop the things that we will list below."),(0,n.kt)("details",null,(0,n.kt)("summary",null,(0,n.kt)("h3",{id:"-concepts"},(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," Concepts"),(0,n.kt)("p",null,"It would be helpful to have an understanding of some concepts of ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," before you start.")),(0,n.kt)("h4",{id:"modeling-concentric-relationships"},"Modeling Concentric Relationships"),(0,n.kt)("p",null,"You need to know how to update the authorization model to allow having nested relations such as all writers are readers. ",(0,n.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/concentric-relationships"},"Learn more \u2192")),(0,n.kt)("h4",{id:"modeling-object-to-object-relationships"},"Modeling Object-to-Object Relationships"),(0,n.kt)("p",null,"You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. ",(0,n.kt)("a",{parentName:"p",href:"/docs/modeling/building-blocks/object-to-object-relationships"},"Learn more \u2192")),(0,n.kt)("p",null,"Used here to indicate that users who have access to view a folder have access to view all documents inside it."),(0,n.kt)("h4",{id:"modeling-public-access"},"Modeling Public Access"),(0,n.kt)("p",null,"You need to know how to add a relationship tuple to indicate that a resource is publicly available. ",(0,n.kt)("a",{parentName:"p",href:"/docs/modeling/public-access"},"Learn more \u2192")),(0,n.kt)("h4",{id:"concepts--configuration-language"},"Concepts & Configuration Language"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"The ",(0,n.kt)(r.uH,{mdxType:"ProductConcept"})),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/docs/configuration-language"},"Configuration Language")))),(0,n.kt)("h2",{id:"what-you-will-be-modeling"},"What You Will Be Modeling"),(0,n.kt)("p",null,"Google Drive is a system to store, share, and collaborate on files and folders. ",(0,n.kt)("a",{parentName:"p",href:"https://www.google.com/drive/"},"Source")),(0,n.kt)("p",null,"In this tutorial, you will build a subset of the Google Drive permission model (detailed below) in ",(0,n.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"}),", using some scenarios to validate the model."),(0,n.kt)("blockquote",null,(0,n.kt)("p",{parentName:"blockquote"},"Note: For brevity, this tutorial will not model all of Google Drive's permissions. Instead, it will focus on modeling for the scenarios outlined below")),(0,n.kt)("h3",{id:"requirements"},"Requirements"),(0,n.kt)("p",null,"Google Drive's permission model is represented in ",(0,n.kt)("a",{parentName:"p",href:"https://developers.google.com/drive/api/v3/ref-roles"},"their documentation"),"."),(0,n.kt)("p",null,"In this tutorial, you will be focusing on a subset of these permissions."),(0,n.kt)("p",null,"Requirements:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Users can be owners, editors, commenters and viewers of documents"),(0,n.kt)("li",{parentName:"ul"},"Documents can be shared with all users in a domain"),(0,n.kt)("li",{parentName:"ul"},"Folders can contain documents and users with a certain permission on a folder have that same permission to a document in that folder"),(0,n.kt)("li",{parentName:"ul"},"Documents and folders can be shared publicly")),(0,n.kt)("h3",{id:"defined-scenarios"},"Defined Scenarios"),(0,n.kt)("p",null,"There will be the following users:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Anne, who is in the xyz domain"),(0,n.kt)("li",{parentName:"ul"},"Beth, who is in the xyz domain"),(0,n.kt)("li",{parentName:"ul"},"Charles, who is in the xyz domain"),(0,n.kt)("li",{parentName:"ul"},"Diane, who is NOT in the xyz domain"),(0,n.kt)("li",{parentName:"ul"},"Erik, who is NOT in the xyz domain")),(0,n.kt)("p",null,"There will be:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"a 2021-budget document, owned by Anne, shared for commenting with Beth and viewable by all members of the xyz domain."),(0,n.kt)("li",{parentName:"ul"},"a 2021-planning folder, viewable by Diane and contains the 2021-budget document"),(0,n.kt)("li",{parentName:"ul"},"a 2021-public-roadmap document, owned by Anne, available for members xyz domain to comment on and is publicly viewable")),(0,n.kt)("h2",{id:"modeling-google-drives-permissions"},"Modeling Google Drive's Permissions"),(0,n.kt)("h3",{id:"01-individual-permissions"},"01. Individual Permissions"),(0,n.kt)("p",null,"To keep thing simple and focus on ",(0,n.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," features rather than Google Drive complexity we will model only four ",(0,n.kt)("a",{parentName:"p",href:"https://developers.google.com/drive/api/v3/ref-roles"},"roles")," (Viewer, Commenter, Writer, Owner)."),(0,n.kt)("p",null,"At the end of this section we want to have the following permissions represented:"),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Image showing permissions",src:o(99459).Z,width:"940",height:"357"})),(0,n.kt)("p",null,"To represent permissions in ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"})," we use ",(0,n.kt)(r.uH,{section:"what-is-a-relation",linkName:"relations",mdxType:"ProductConcept"}),". For document permissions we need to create the following ",(0,n.kt)(r.uH,{section:"what-is-an-authorization-model",linkName:"authorization model",mdxType:"ProductConcept"}),":"),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document",relations:{owner:{this:{}},writer:{this:{}},commenter:{this:{}},viewer:{this:{}}},metadata:{relations:{owner:{directly_related_user_types:[{type:"user"}]},writer:{directly_related_user_types:[{type:"user"}]},commenter:{directly_related_user_types:[{type:"user"}]},viewer:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("p",null,"The ",(0,n.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," service determines if a ",(0,n.kt)(r.uH,{section:"what-is-a-user",linkName:"user",mdxType:"ProductConcept"})," has access to an ",(0,n.kt)(r.uH,{section:"what-is-an-object",linkName:"object",mdxType:"ProductConcept"})," by ",(0,n.kt)(r.uH,{section:"what-is-a-check-request",linkName:"checking",mdxType:"ProductConcept"})," if the user has a relation to that object. Let us examine one of those relations in detail:"),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type:"document",relations:{viewer:{this:{}}},metadata:{relations:{viewer:{directly_related_user_types:[{type:"user"}]}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("admonition",{type:"info"},(0,n.kt)("p",{parentName:"admonition"},'The snippet above indicates that objects of type document have users related to them as "viewer" if those users belong to the userset of all users related to the document as "viewer".'),(0,n.kt)("p",{parentName:"admonition"},"This means that a user can be ",(0,n.kt)(r.uH,{section:"what-are-direct-and-implied-relationships",linkName:"directly related",mdxType:"ProductConcept"}),' as a viewer to an object of type "document"')),(0,n.kt)("p",null,"If we want to say ",(0,n.kt)("inlineCode",{parentName:"p"},"beth")," is a commenter of ",(0,n.kt)("strong",{parentName:"p"},"document:2021-budget")," we create this relationship tuple:"),(0,n.kt)(r.Gb,{relationshipTuples:[{user:"user:beth",relation:"commenter",object:"document:2021-budget"}],mdxType:"WriteRequestViewer"}),(0,n.kt)("p",null,"We can now ask ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}),' "is ',(0,n.kt)("inlineCode",{parentName:"p"},"beth")," a commenter of repository ",(0,n.kt)("strong",{parentName:"p"},"document:2021-budget"),'?"'),(0,n.kt)(r.uT,{user:"user:beth",relation:"commenter",object:"document:2021-budget",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)("p",null,"We could also say that ",(0,n.kt)("inlineCode",{parentName:"p"},"anne")," is an owner of the same document:"),(0,n.kt)(r.Gb,{relationshipTuples:[{user:"user:anne",relation:"owner",object:"document:2021-budget"}],mdxType:"WriteRequestViewer"}),(0,n.kt)("p",null,"And ",(0,n.kt)(r.uH,{section:"what-is-a-check-request",linkName:"ask",mdxType:"ProductConcept"})," some questions to ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}),":"),(0,n.kt)(r.uT,{user:"user:anne",relation:"owner",object:"document:2021-budget",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)(r.uT,{user:"user:anne",relation:"writer",object:"document:2021-budget",allowed:!1,mdxType:"CheckRequestViewer"}),(0,n.kt)("p",null,"The first reply makes sense but the second one does not. Intuitively, if ",(0,n.kt)("inlineCode",{parentName:"p"},"anne")," was an ",(0,n.kt)("strong",{parentName:"p"},"owner"),", she was also be a ",(0,n.kt)("strong",{parentName:"p"},"writer"),". In fact, Google Drive explains this in ",(0,n.kt)("a",{parentName:"p",href:"https://developers.google.com/drive/api/v3/ref-roles"},"their documentation")),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Image showing roles",src:o(38035).Z,width:"677",height:"789"})),(0,n.kt)("p",null,"To make ",(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}),' aware of this "concentric" permission model we need to update our definitions:'),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document",relations:{owner:{this:{}},writer:{union:{child:[{this:{}},{computedUserset:{relation:"owner"}}]}},commenter:{union:{child:[{this:{}},{computedUserset:{relation:"writer"}}]}},viewer:{union:{child:[{this:{}},{computedUserset:{relation:"commenter"}}]}}},metadata:{relations:{owner:{directly_related_user_types:[{type:"user"}]},writer:{directly_related_user_types:[{type:"user"}]},commenter:{directly_related_user_types:[{type:"user"}]},viewer:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("admonition",{type:"info"},(0,n.kt)("p",{parentName:"admonition"},"Let's examine one of those relations in detail:"),(0,n.kt)("p",{parentName:"admonition"},'objects of type document have users related to them as "viewer": if they belong to any of (the union of) the following:'),(0,n.kt)("ul",{parentName:"admonition"},(0,n.kt)("li",{parentName:"ul"},'the userset of all users related to the document as "viewer"'),(0,n.kt)("li",{parentName:"ul"},'the userset of all users related to the document as "commenter"'))),(0,n.kt)("p",null,"With this update our model now supports nested definitions and now:"),(0,n.kt)(r.uT,{user:"user:anne",relation:"owner",object:"document:2021-budget",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)(r.uT,{user:"user:anne",relation:"writer",object:"document:2021-budget",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)("h3",{id:"02-organization-permissions"},"02. Organization Permissions"),(0,n.kt)("p",null,"Google Drive allows you to share a file with everyone in your organization as a viewer, commenter or writer/editor."),(0,n.kt)("p",null,(0,n.kt)("img",{src:o(79368).Z,width:"1302",height:"724"})),(0,n.kt)("p",null,"At the end of this section we want to end up with the following permissions represented:"),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Image showing permissions",src:o(38836).Z,width:"940",height:"542"})),(0,n.kt)("p",null,"To add support for domains and members all we need to do is add this object to the ",(0,n.kt)(r.rZ,{format:r.v7.ProductLink,mdxType:"ProductName"})," ",(0,n.kt)(r.uH,{section:"what-is-a-type-definition",linkName:"authorization model",mdxType:"ProductConcept"}),". In addition, update the model to allow domain member to be assigned to document:"),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document",relations:{owner:{this:{}},writer:{union:{child:[{this:{}},{computedUserset:{relation:"owner"}}]}},commenter:{union:{child:[{this:{}},{computedUserset:{relation:"writer"}}]}},viewer:{union:{child:[{this:{}},{computedUserset:{relation:"commenter"}}]}}},metadata:{relations:{owner:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},writer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},commenter:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},viewer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]}}}},{type:"domain",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("admonition",{type:"info"},(0,n.kt)("p",{parentName:"admonition"},'Objects of type "domain" have users related to them as "member" if they belong to the userset of all users related to the domain as "member".'),(0,n.kt)("p",{parentName:"admonition"},"In other words, users can be direct members of a domain.")),(0,n.kt)("p",null,"Let's now create a domain, add members to it and make all members ",(0,n.kt)("strong",{parentName:"p"},"viewers")," of ",(0,n.kt)("strong",{parentName:"p"},"document:2021-budget"),"."),(0,n.kt)(r.Gb,{relationshipTuples:[{_description:"make anne, beth, charles a member of the xyz domain",user:"user:anne",relation:"member",object:"domain:xyz"},{user:"user:beth",relation:"member",object:"domain:xyz"},{user:"user:charles",relation:"member",object:"domain:xyz"},{_description:"make members of xyz domain viewers of document:2021-budget",user:"domain:xyz#member",relation:"viewer",object:"document:2021-budget"}],mdxType:"WriteRequestViewer"}),(0,n.kt)("p",null,"The last relationship tuple introduces a new ",(0,n.kt)("strong",{parentName:"p"},(0,n.kt)(r.rZ,{format:r.v7.ShortForm,mdxType:"ProductName"}))," concept. A ",(0,n.kt)("strong",{parentName:"p"},(0,n.kt)(r.uH,{section:"what-is-a-user",linkName:"userset",mdxType:"ProductConcept"})),". When the value of a user is formatted like this ",(0,n.kt)("strong",{parentName:"p"},"objectType:objectId#relation"),", ",(0,n.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," will automatically expand the userset into all its individual user identifiers:"),(0,n.kt)(r.uT,{user:"user:charles",relation:"viewer",object:"document:2021-budget",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)("h3",{id:"03-folder-permission-propagation"},"03. Folder Permission Propagation"),(0,n.kt)("p",null,(0,n.kt)("a",{parentName:"p",href:"https://developers.google.com/drive/api/v3/manage-sharing#permission_propagation"},"Permission propagation")," happens between folders and files: if you are a viewer in a folder, you can view its documents. This applies even when you are not explicitly a viewer in a document.\n",(0,n.kt)("img",{parentName:"p",src:"https://pbs.twimg.com/media/Eme_FlYW4AEAYfi?format=jpg&name=large",alt:"Image"})),(0,n.kt)("p",null,"At the end of this section we want to end up with the following permissions represented. Note that a folder is an object in the ",(0,n.kt)("strong",{parentName:"p"},"document")," type, as we do not need a separate type:"),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Image showing permissions",src:o(33888).Z,width:"940",height:"578"})),(0,n.kt)("p",null,"We need to add the notion that a ",(0,n.kt)("strong",{parentName:"p"},"document")," can be the ",(0,n.kt)("strong",{parentName:"p"},"parent")," of another ",(0,n.kt)("strong",{parentName:"p"},"document"),". We know how to do that:"),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document",relations:{parent:{this:{}},owner:{this:{}},writer:{union:{child:[{this:{}},{computedUserset:{relation:"owner"}}]}},commenter:{union:{child:[{this:{}},{computedUserset:{relation:"writer"}}]}},viewer:{union:{child:[{this:{}},{computedUserset:{relation:"commenter"}}]}}},metadata:{relations:{parent:{directly_related_user_types:[{type:"document"}]},owner:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},writer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},commenter:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},viewer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("admonition",{type:"info"},(0,n.kt)("p",{parentName:"admonition"},'Notice the newly added "parent" relation in the configuration above.')),(0,n.kt)("p",null,"We can indicate this relation by adding the following relationship tuples"),(0,n.kt)(r.Gb,{relationshipTuples:[{_description:"Diane is a viewer of document:2021-planning",user:"user:diane",relation:"viewer",object:"document:2021-planning"},{_description:"document:2021-planning is a parent of document:2021-budget",user:"document:2021-planning",relation:"parent",object:"document:2021-budget"}],mdxType:"WriteRequestViewer"}),(0,n.kt)("p",null,"What we still lack is the ability to propagate permissions from parent to children. We want to say that a user is a viewer of a document if either:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"[done]"," they have a viewer relationship (directly or through domain membership)"),(0,n.kt)("li",{parentName:"ul"},"[pending]"," they have a viewer relationship with the parent document")),(0,n.kt)("p",null,"We need a way to consider the parent viewers, not just direct viewers of the document when getting a check for:"),(0,n.kt)(r.uT,{user:"user:diane",relation:"viewer",object:"document:2021-budget",mdxType:"CheckRequestViewer"}),(0,n.kt)("p",null,"More details on this technique can be found in the section ",(0,n.kt)("a",{parentName:"p",href:"/docs/modeling/parent-child"},"Modeling Parent-Child Objects"),"."),(0,n.kt)("p",null,"We express it like this:"),(0,n.kt)(r.lG,{configuration:{type:"document",relations:{viewer:{union:{child:[{this:{}},{computedUserset:{relation:"commenter"}},{tupleToUserset:{tupleset:{relation:"parent"},computedUserset:{relation:"viewer"}}}]}}},metadata:{relations:{viewer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]}}}},skipVersion:!0,mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("admonition",{type:"info"},(0,n.kt)("p",{parentName:"admonition"},'The users with a viewer relationship to a certain object of type "document" are any of:'),(0,n.kt)("ul",{parentName:"admonition"},(0,n.kt)("li",{parentName:"ul"},'the "viewers": the set of users who are ',(0,n.kt)(r.uH,{section:"what-are-direct-and-implied-relationships",linkName:"directly related",mdxType:"ProductConcept"}),' to the document as a "viewer"'),(0,n.kt)("li",{parentName:"ul"},'the "commenters": the set of users who are related to the object as "commenter"'),(0,n.kt)("li",{parentName:"ul"},'the "viewers of the parents": from the objects who are related to the doc as parent, return the sets of users who are related to those objects as "viewer"')),(0,n.kt)("p",{parentName:"admonition"},"What the added section is doing is:"),(0,n.kt)("ol",{parentName:"admonition"},(0,n.kt)("li",{parentName:"ol"},"read all relationship tuples related to document:2021-budget as parent which returns:")),(0,n.kt)("p",{parentName:"admonition"},(0,n.kt)("inlineCode",{parentName:"p"},'[{ "object": "document:2021-budget", "relation": "parent", "user": "document:2021-planning" }]')),(0,n.kt)("ol",{parentName:"admonition",start:2},(0,n.kt)("li",{parentName:"ol"},"for each relationship tuple read, return all usersets that match the following, returning tuples of shape:")),(0,n.kt)("p",{parentName:"admonition"},(0,n.kt)("inlineCode",{parentName:"p"},'{ "object": "document:2021-planning", "viewer", "user": ??? }')),(0,n.kt)("p",{parentName:"admonition"},"including: ",(0,n.kt)("inlineCode",{parentName:"p"},'{ "object": "document:2021-planning", "viewer", "user": "user:diane" }'))),(0,n.kt)("p",null,"The updated authorization model looks like this:"),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document",relations:{owner:{union:{child:[{this:{}},{tupleToUserset:{computedUserset:{relation:"owner"},tupleset:{relation:"parent"}}}]}},writer:{union:{child:[{this:{}},{computedUserset:{relation:"owner"}},{tupleToUserset:{computedUserset:{relation:"writer"},tupleset:{relation:"parent"}}}]}},commenter:{union:{child:[{this:{}},{computedUserset:{relation:"writer"}},{tupleToUserset:{computedUserset:{relation:"commenter"},tupleset:{relation:"parent"}}}]}},viewer:{union:{child:[{this:{}},{computedUserset:{relation:"commenter"}},{tupleToUserset:{computedUserset:{relation:"viewer"},tupleset:{relation:"parent"}}}]}},parent:{this:{}}},metadata:{relations:{parent:{directly_related_user_types:[{type:"document"}]},owner:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},writer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},commenter:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},viewer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]}}}},{type:"domain",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("h3",{id:"04-sharing-files-and-folders-publicly"},"04. Sharing Files And Folders Publicly"),(0,n.kt)("p",null,"Google Drive has a feature which allows ",(0,n.kt)("a",{parentName:"p",href:"https://support.google.com/a/users/answer/9308873?hl=en"},"sharing a file or folder publicly"),", and specifying the permissions a public user might have (writer/commenter/viewer)."),(0,n.kt)("p",null,"Assume that ",(0,n.kt)("inlineCode",{parentName:"p"},"Anne")," has created a new document: ",(0,n.kt)("inlineCode",{parentName:"p"},"2021-public-roadmap"),", has shared it with commenter permissions to the ",(0,n.kt)("inlineCode",{parentName:"p"},"xyz.com"),", and has shared it as view only with the public at large."),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"Image showing requirements",src:o(63597).Z,width:"940",height:"649"})),(0,n.kt)("p",null,"Here's where another ",(0,n.kt)(r.rZ,{format:r.v7.LongForm,mdxType:"ProductName"})," feature, ",(0,n.kt)(r.uH,{section:"what-is-type-bound-public-access",linkName:"type bound public access",mdxType:"ProductConcept"})," (as in everyone), would come in handy."),(0,n.kt)("p",null,"First, we will need to update our model to allow for public access with type ",(0,n.kt)("inlineCode",{parentName:"p"},"user")," for viewer relation."),(0,n.kt)(r.lG,{configuration:{schema_version:"1.1",type_definitions:[{type:"user"},{type:"document",relations:{owner:{union:{child:[{this:{}},{tupleToUserset:{computedUserset:{relation:"owner"},tupleset:{relation:"parent"}}}]}},writer:{union:{child:[{this:{}},{computedUserset:{relation:"owner"}},{tupleToUserset:{computedUserset:{relation:"writer"},tupleset:{relation:"parent"}}}]}},commenter:{union:{child:[{this:{}},{computedUserset:{relation:"writer"}},{tupleToUserset:{computedUserset:{relation:"commenter"},tupleset:{relation:"parent"}}}]}},viewer:{union:{child:[{this:{}},{computedUserset:{relation:"commenter"}},{tupleToUserset:{computedUserset:{relation:"viewer"},tupleset:{relation:"parent"}}}]}},parent:{this:{}}},metadata:{relations:{parent:{directly_related_user_types:[{type:"document"}]},owner:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},writer:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},commenter:{directly_related_user_types:[{type:"user"},{type:"domain",relation:"member"}]},viewer:{directly_related_user_types:[{type:"user"},{type:"user",wildcard:{}},{type:"domain",relation:"member"}]}}}},{type:"domain",relations:{member:{this:{}}},metadata:{relations:{member:{directly_related_user_types:[{type:"user"}]}}}}]},mdxType:"AuthzModelSnippetViewer"}),(0,n.kt)("p",null,"To mark Anne as the owner, the domain members as commenters and the public as viewers, we need to add the following relationship tuples:"),(0,n.kt)(r.Gb,{relationshipTuples:[{_description:"Anne is the owner of document:2021-public-roadmap",user:"user:anne",relation:"owner",object:"document:2021-public-roadmap"},{_description:"Members of the domain:xyz can comment on document:2021-public-roadmap",user:"domain:xyz#member",relation:"commenter",object:"document:2021-public-roadmap"},{_description:"Everyone with type `user` can view document:2021-public-roadmap",user:"user:*",relation:"viewer",object:"document:2021-public-roadmap"}],mdxType:"WriteRequestViewer"}),(0,n.kt)("p",null,"Anne is an owner of the document"),(0,n.kt)(r.uT,{user:"user:anne",relation:"owner",object:"document:2021-public-roadmap",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)("p",null,"Beth is a member of the xyz.com domain, and so can comment but cannot write"),(0,n.kt)(r.uT,{user:"user:beth",relation:"writer",object:"document:2021-public-roadmap",allowed:!1,mdxType:"CheckRequestViewer"}),(0,n.kt)(r.uT,{user:"user:beth",relation:"commenter",object:"document:2021-public-roadmap",allowed:!0,mdxType:"CheckRequestViewer"}),(0,n.kt)("p",null,"Erik is NOT a member of the xyz.com domain, and so can only view the document"),(0,n.kt)(r.uT,{user:"user:erik",relation:"writer",object:"document:2021-public-roadmap",allowed:!1,mdxType:"CheckRequestViewer"}),(0,n.kt)(r.uT,{user:"user:erik",relation:"viewer",object:"document:2021-public-roadmap",allowed:!1,mdxType:"CheckRequestViewer"}),(0,n.kt)(r.XQ,{title:"Google Drive",preset:"drive",example:"Google Drive",store:"gdrive",mdxType:"Playground"}),(0,n.kt)("h2",{id:"related-sections"},"Related Sections"),(0,n.kt)(r.$q,{description:"Take a look at the following sections for more information.",relatedLinks:[{title:"Search with permissions",description:"Give your users search results with objects that they have access to",link:"../../interacting/search-with-permissions"}],mdxType:"RelatedSection"}))}c.isMDXComponent=!0},99459:(e,t,o)=>{o.d(t,{Z:()=>i});const i=o.p+"assets/images/gdrive-gdrive1-22dac26c1f55a55daeb65acff88ee193.svg"},38836:(e,t,o)=>{o.d(t,{Z:()=>i});const i=o.p+"assets/images/gdrive-gdrive2-abe697d20cfce6658d6a09aed7af8d97.svg"},33888:(e,t,o)=>{o.d(t,{Z:()=>i});const i=o.p+"assets/images/gdrive-gdrive3-e82c9d5308de7d3b5e7b74b59d87044f.svg"},63597:(e,t,o)=>{o.d(t,{Z:()=>i});const i=o.p+"assets/images/gdrive-gdrive4-9b75eafa345dde22742988b225671a69.svg"},79368:(e,t,o)=>{o.d(t,{Z:()=>i});const i=o.p+"assets/images/gdrive-org-fe69008225e62f28ff2280708e875f09.svg"},38035:(e,t,o)=>{o.d(t,{Z:()=>i});const i=o.p+"assets/images/gdrive-roles-ac60dede6567bd76e873d1a81d642532.svg"}}]); \ No newline at end of file diff --git a/assets/js/common.4ce83303.js b/assets/js/common.4ce83303.js deleted file mode 100644 index d2575784a..000000000 --- a/assets/js/common.4ce83303.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see common.4ce83303.js.LICENSE.txt */ -(self.webpackChunkopenfga_dev=self.webpackChunkopenfga_dev||[]).push([[8592],{3905:(e,t,n)=>{"use strict";n.d(t,{Zo:()=>u,kt:()=>f});var r=n(67294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),c=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},u=function(e){var t=c(e.components);return r.createElement(l.Provider,{value:t},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,o=e.originalType,l=e.parentName,u=a(e,["components","mdxType","originalType","parentName"]),d=c(n),h=i,f=d["".concat(l,".").concat(h)]||d[h]||p[h]||o;return n?r.createElement(f,s(s({ref:t},u),{},{components:n})):r.createElement(f,s({ref:t},u))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=n.length,s=new Array(o);s[0]=h;var a={};for(var l in t)hasOwnProperty.call(t,l)&&(a[l]=t[l]);a.originalType=e,a[d]="string"==typeof e?e:i,s[1]=a;for(var c=2;c{"use strict";function n(e,t){if(t)return e;throw new Error("Unhandled discriminated union member: "+JSON.stringify(e))}t.ZP=n},23612:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(67294),i=n(34334),o=n(35281),s=n(95999);const a={admonition:"admonition_LlT9",admonitionHeading:"admonitionHeading_tbUL",admonitionIcon:"admonitionIcon_kALy",admonitionContent:"admonitionContent_S0QG"};const l={note:{infimaClassName:"secondary",iconComponent:function(){return r.createElement("svg",{viewBox:"0 0 14 16"},r.createElement("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"}))},label:r.createElement(s.Z,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)"},"note")},tip:{infimaClassName:"success",iconComponent:function(){return r.createElement("svg",{viewBox:"0 0 12 16"},r.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))},label:r.createElement(s.Z,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)"},"tip")},danger:{infimaClassName:"danger",iconComponent:function(){return r.createElement("svg",{viewBox:"0 0 12 16"},r.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"}))},label:r.createElement(s.Z,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)"},"danger")},info:{infimaClassName:"info",iconComponent:function(){return r.createElement("svg",{viewBox:"0 0 14 16"},r.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))},label:r.createElement(s.Z,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)"},"info")},caution:{infimaClassName:"warning",iconComponent:function(){return r.createElement("svg",{viewBox:"0 0 16 16"},r.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"}))},label:r.createElement(s.Z,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)"},"caution")}},c={secondary:"note",important:"info",success:"tip",warning:"danger"};function u(e){const{mdxAdmonitionTitle:t,rest:n}=function(e){const t=r.Children.toArray(e),n=t.find((e=>r.isValidElement(e)&&"mdxAdmonitionTitle"===e.props?.mdxType)),i=r.createElement(r.Fragment,null,t.filter((e=>e!==n)));return{mdxAdmonitionTitle:n,rest:i}}(e.children);return{...e,title:e.title??t,children:n}}function d(e){const{children:t,type:n,title:s,icon:d}=u(e),p=function(e){const t=c[e]??e,n=l[t];return n||(console.warn(`No admonition config found for admonition type "${t}". Using Info as fallback.`),l.info)}(n),h=s??p.label,{iconComponent:f}=p,m=d??r.createElement(f,null);return r.createElement("div",{className:(0,i.Z)(o.k.common.admonition,o.k.common.admonitionType(e.type),"alert",`alert--${p.infimaClassName}`,a.admonition)},r.createElement("div",{className:a.admonitionHeading},r.createElement("span",{className:a.admonitionIcon},m),h),r.createElement("div",{className:a.admonitionContent},t))}},74464:(e,t,n)=>{"use strict";n.d(t,{Z:()=>G});var r=n(87462),i=n(67294),o=n(72389),s=n(34334),a=n(92949),l=n(86668);function c(){const{prism:e}=(0,l.L)(),{colorMode:t}=(0,a.I)(),n=e.theme,r=e.darkTheme||n;return"dark"===t?r:n}var u=n(35281),d=n(87594),p=n.n(d);const h=/title=(?["'])(?.*?)\1/,f=/\{(?<range>[\d,-]+)\}/,m={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}};function g(e,t){const n=e.map((e=>{const{start:n,end:r}=m[e];return`(?:${n}\\s*(${t.flatMap((e=>[e.line,e.block?.start,e.block?.end].filter(Boolean))).join("|")})\\s*${r})`})).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)}function b(e,t){let n=e.replace(/\n$/,"");const{language:r,magicComments:i,metastring:o}=t;if(o&&f.test(o)){const e=o.match(f).groups.range;if(0===i.length)throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${o}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);const t=i[0].className,r=p()(e).filter((e=>e>0)).map((e=>[e-1,[t]]));return{lineClassNames:Object.fromEntries(r),code:n}}if(void 0===r)return{lineClassNames:{},code:n};const s=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return g(["js","jsBlock"],t);case"jsx":case"tsx":return g(["js","jsBlock","jsx"],t);case"html":return g(["js","jsBlock","html"],t);case"python":case"py":case"bash":return g(["bash"],t);case"markdown":case"md":return g(["html","jsx","bash"],t);default:return g(Object.keys(m),t)}}(r,i),a=n.split("\n"),l=Object.fromEntries(i.map((e=>[e.className,{start:0,range:""}]))),c=Object.fromEntries(i.filter((e=>e.line)).map((e=>{let{className:t,line:n}=e;return[n,t]}))),u=Object.fromEntries(i.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.start,t]}))),d=Object.fromEntries(i.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.end,t]})));for(let p=0;p<a.length;){const e=a[p].match(s);if(!e){p+=1;continue}const t=e.slice(1).find((e=>void 0!==e));c[t]?l[c[t]].range+=`${p},`:u[t]?l[u[t]].start=p:d[t]&&(l[d[t]].range+=`${l[d[t]].start}-${p-1},`),a.splice(p,1)}n=a.join("\n");const h={};return Object.entries(l).forEach((e=>{let[t,{range:n}]=e;p()(n).forEach((e=>{h[e]??=[],h[e].push(t)}))})),{lineClassNames:h,code:n}}const y={codeBlockContainer:"codeBlockContainer_Ckt0"};function v(e){let{as:t,...n}=e;const o=function(e){const t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach((e=>{let[r,i]=e;const o=t[r];o&&"string"==typeof i&&(n[o]=i)})),n}(c());return i.createElement(t,(0,r.Z)({},n,{style:o,className:(0,s.Z)(n.className,y.codeBlockContainer,u.k.common.codeBlock)}))}const w={codeBlockContent:"codeBlockContent_biex",codeBlockTitle:"codeBlockTitle_Ktv7",codeBlock:"codeBlock_bY9V",codeBlockStandalone:"codeBlockStandalone_MEMb",codeBlockLines:"codeBlockLines_e6Vv",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_o6Pm",buttonGroup:"buttonGroup__atx"};function x(e){let{children:t,className:n}=e;return i.createElement(v,{as:"pre",tabIndex:0,className:(0,s.Z)(w.codeBlockStandalone,"thin-scrollbar",n)},i.createElement("code",{className:w.codeBlockLines},t))}var S=n(902);const E={attributes:!0,characterData:!0,childList:!0,subtree:!0};function T(e,t){const[n,r]=(0,i.useState)(),o=(0,i.useCallback)((()=>{r(e.current?.closest("[role=tabpanel][hidden]"))}),[e,r]);(0,i.useEffect)((()=>{o()}),[o]),function(e,t,n){void 0===n&&(n=E);const r=(0,S.zX)(t),o=(0,S.Ql)(n);(0,i.useEffect)((()=>{const t=new MutationObserver(r);return e&&t.observe(e,o),()=>t.disconnect()}),[e,r,o])}(n,(e=>{e.forEach((e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),o())}))}),{attributes:!0,characterData:!1,childList:!1,subtree:!1})}const C={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]};var k={Prism:n(11205).Z,theme:C};function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(){return O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(this,arguments)}var N=/\r\n|\r|\n/,_=function(e){0===e.length?e.push({types:["plain"],content:"\n",empty:!0}):1===e.length&&""===e[0].content&&(e[0].content="\n",e[0].empty=!0)},D=function(e,t){var n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)};function I(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}var L=function(e){function t(){for(var t=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];e.apply(this,n),A(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var n=e.theme?function(e,t){var n=e.plain,r=Object.create(null),i=e.styles.reduce((function(e,n){var r=n.languages,i=n.style;return r&&!r.includes(t)||n.types.forEach((function(t){var n=O({},e[t],i);e[t]=n})),e}),r);return i.root=n,i.plain=O({},n,{backgroundColor:null}),i}(e.theme,e.language):void 0;return t.themeDict=n})),A(this,"getLineProps",(function(e){var n=e.key,r=e.className,i=e.style,o=O({},I(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),s=t.getThemeDict(t.props);return void 0!==s&&(o.style=s.plain),void 0!==i&&(o.style=void 0!==o.style?O({},o.style,i):i),void 0!==n&&(o.key=n),r&&(o.className+=" "+r),o})),A(this,"getStyleForToken",(function(e){var n=e.types,r=e.empty,i=n.length,o=t.getThemeDict(t.props);if(void 0!==o){if(1===i&&"plain"===n[0])return r?{display:"inline-block"}:void 0;if(1===i&&!r)return o[n[0]];var s=r?{display:"inline-block"}:{},a=n.map((function(e){return o[e]}));return Object.assign.apply(Object,[s].concat(a))}})),A(this,"getTokenProps",(function(e){var n=e.key,r=e.className,i=e.style,o=e.token,s=O({},I(e,["key","className","style","token"]),{className:"token "+o.types.join(" "),children:o.content,style:t.getStyleForToken(o),key:void 0});return void 0!==i&&(s.style=void 0!==s.style?O({},s.style,i):i),void 0!==n&&(s.key=n),r&&(s.className+=" "+r),s})),A(this,"tokenize",(function(e,t,n,r){var i={code:t,grammar:n,language:r,tokens:[]};e.hooks.run("before-tokenize",i);var o=i.tokens=e.tokenize(i.code,i.grammar,i.language);return e.hooks.run("after-tokenize",i),o}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,n=e.language,r=e.code,i=e.children,o=this.getThemeDict(this.props),s=t.languages[n];return i({tokens:function(e){for(var t=[[]],n=[e],r=[0],i=[e.length],o=0,s=0,a=[],l=[a];s>-1;){for(;(o=r[s]++)<i[s];){var c=void 0,u=t[s],d=n[s][o];if("string"==typeof d?(u=s>0?u:["plain"],c=d):(u=D(u,d.type),d.alias&&(u=D(u,d.alias)),c=d.content),"string"==typeof c){var p=c.split(N),h=p.length;a.push({types:u,content:p[0]});for(var f=1;f<h;f++)_(a),l.push(a=[]),a.push({types:u,content:p[f]})}else s++,t.push(u),n.push(c),r.push(0),i.push(c.length)}s--,t.pop(),n.pop(),r.pop(),i.pop()}return _(a),l}(void 0!==s?this.tokenize(t,r,s,n):[r]),className:"prism-code language-"+n,style:void 0!==o?o.root:{},getLineProps:this.getLineProps,getTokenProps:this.getTokenProps})},t}(i.Component);const P=L,$={codeLine:"codeLine_lJS_",codeLineNumber:"codeLineNumber_Tfdd",codeLineContent:"codeLineContent_feaV"};function j(e){let{line:t,classNames:n,showLineNumbers:o,getLineProps:a,getTokenProps:l}=e;1===t.length&&"\n"===t[0].content&&(t[0].content="");const c=a({line:t,className:(0,s.Z)(n,o&&$.codeLine)}),u=t.map(((e,t)=>i.createElement("span",(0,r.Z)({key:t},l({token:e,key:t})))));return i.createElement("span",c,o?i.createElement(i.Fragment,null,i.createElement("span",{className:$.codeLineNumber}),i.createElement("span",{className:$.codeLineContent},u)):u,i.createElement("br",null))}var R=n(95999);function q(e){return i.createElement("svg",(0,r.Z)({viewBox:"0 0 24 24"},e),i.createElement("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"}))}function M(e){return i.createElement("svg",(0,r.Z)({viewBox:"0 0 24 24"},e),i.createElement("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))}const B={copyButtonCopied:"copyButtonCopied_obH4",copyButtonIcons:"copyButtonIcons_eSgA",copyButtonIcon:"copyButtonIcon_y97N",copyButtonSuccessIcon:"copyButtonSuccessIcon_LjdS"};function F(e){let{code:t,className:n}=e;const[r,o]=(0,i.useState)(!1),a=(0,i.useRef)(void 0),l=(0,i.useCallback)((()=>{!function(e,t){let{target:n=document.body}=void 0===t?{}:t;if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const r=document.createElement("textarea"),i=document.activeElement;r.value=e,r.setAttribute("readonly",""),r.style.contain="strict",r.style.position="absolute",r.style.left="-9999px",r.style.fontSize="12pt";const o=document.getSelection(),s=o.rangeCount>0&&o.getRangeAt(0);n.append(r),r.select(),r.selectionStart=0,r.selectionEnd=e.length;let a=!1;try{a=document.execCommand("copy")}catch{}r.remove(),s&&(o.removeAllRanges(),o.addRange(s)),i&&i.focus()}(t),o(!0),a.current=window.setTimeout((()=>{o(!1)}),1e3)}),[t]);return(0,i.useEffect)((()=>()=>window.clearTimeout(a.current)),[]),i.createElement("button",{type:"button","aria-label":r?(0,R.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,R.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,R.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,s.Z)("clean-btn",n,B.copyButton,r&&B.copyButtonCopied),onClick:l},i.createElement("span",{className:B.copyButtonIcons,"aria-hidden":"true"},i.createElement(q,{className:B.copyButtonIcon}),i.createElement(M,{className:B.copyButtonSuccessIcon})))}function U(e){return i.createElement("svg",(0,r.Z)({viewBox:"0 0 24 24"},e),i.createElement("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}))}const H={wordWrapButtonIcon:"wordWrapButtonIcon_Bwma",wordWrapButtonEnabled:"wordWrapButtonEnabled_EoeP"};function z(e){let{className:t,onClick:n,isEnabled:r}=e;const o=(0,R.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return i.createElement("button",{type:"button",onClick:n,className:(0,s.Z)("clean-btn",t,r&&H.wordWrapButtonEnabled),"aria-label":o,title:o},i.createElement(U,{className:H.wordWrapButtonIcon,"aria-hidden":"true"}))}function V(e){let{children:t,className:n="",metastring:o,title:a,showLineNumbers:u,language:d}=e;const{prism:{defaultLanguage:p,magicComments:f}}=(0,l.L)(),m=d??function(e){const t=e.split(" ").find((e=>e.startsWith("language-")));return t?.replace(/language-/,"")}(n)??p,g=c(),y=function(){const[e,t]=(0,i.useState)(!1),[n,r]=(0,i.useState)(!1),o=(0,i.useRef)(null),s=(0,i.useCallback)((()=>{const n=o.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t((e=>!e))}),[o,e]),a=(0,i.useCallback)((()=>{const{scrollWidth:e,clientWidth:t}=o.current,n=e>t||o.current.querySelector("code").hasAttribute("style");r(n)}),[o]);return T(o,a),(0,i.useEffect)((()=>{a()}),[e,a]),(0,i.useEffect)((()=>(window.addEventListener("resize",a,{passive:!0}),()=>{window.removeEventListener("resize",a)})),[a]),{codeBlockRef:o,isEnabled:e,isCodeScrollable:n,toggle:s}}(),x=function(e){return e?.match(h)?.groups.title??""}(o)||a,{lineClassNames:S,code:E}=b(t,{metastring:o,language:m,magicComments:f}),C=u??function(e){return Boolean(e?.includes("showLineNumbers"))}(o);return i.createElement(v,{as:"div",className:(0,s.Z)(n,m&&!n.includes(`language-${m}`)&&`language-${m}`)},x&&i.createElement("div",{className:w.codeBlockTitle},x),i.createElement("div",{className:w.codeBlockContent},i.createElement(P,(0,r.Z)({},k,{theme:g,code:E,language:m??"text"}),(e=>{let{className:t,tokens:n,getLineProps:r,getTokenProps:o}=e;return i.createElement("pre",{tabIndex:0,ref:y.codeBlockRef,className:(0,s.Z)(t,w.codeBlock,"thin-scrollbar")},i.createElement("code",{className:(0,s.Z)(w.codeBlockLines,C&&w.codeBlockLinesWithNumbering)},n.map(((e,t)=>i.createElement(j,{key:t,line:e,getLineProps:r,getTokenProps:o,classNames:S[t],showLineNumbers:C})))))})),i.createElement("div",{className:w.buttonGroup},(y.isEnabled||y.isCodeScrollable)&&i.createElement(z,{className:w.codeButton,onClick:()=>y.toggle(),isEnabled:y.isEnabled}),i.createElement(F,{className:w.codeButton,code:E}))))}function G(e){let{children:t,...n}=e;const s=(0,o.Z)(),a=function(e){return i.Children.toArray(e).some((e=>(0,i.isValidElement)(e)))?e:Array.isArray(e)?e.join(""):e}(t),l="string"==typeof a?V:x;return i.createElement(l,(0,r.Z)({key:String(s)},n),a)}},34673:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(87462),i=n(67294),o=n(34334),s=n(87459),a=n(72389),l=n(86043);const c={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};function u(e){return!!e&&("SUMMARY"===e.tagName||u(e.parentElement))}function d(e,t){return!!e&&(e===t||d(e.parentElement,t))}function p(e){let{summary:t,children:n,...o}=e;const p=(0,a.Z)(),h=(0,i.useRef)(null),{collapsed:f,setCollapsed:m}=(0,l.u)({initialState:!o.open}),[g,b]=(0,i.useState)(o.open),y=i.isValidElement(t)?t:i.createElement("summary",null,t??"Details");return i.createElement("details",(0,r.Z)({},o,{ref:h,open:g,"data-collapsed":f,className:(0,s.Z)(c.details,p&&c.isBrowser,o.className),onMouseDown:e=>{u(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const t=e.target;u(t)&&d(t,h.current)&&(e.preventDefault(),f?(m(!1),b(!0)):m(!0))}}),y,i.createElement(l.z,{lazy:!1,collapsed:f,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{m(e),b(!e)}},i.createElement("div",{className:c.collapsibleContent},n)))}const h={details:"details_b_Ee"},f="alert alert--info";function m(e){let{...t}=e;return i.createElement(p,(0,r.Z)({},t,{className:(0,o.Z)(f,h.details,t.className)}))}},85162:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(67294),i=n(34334);const o={tabItem:"tabItem_Ymn6"};function s(e){let{children:t,hidden:n,className:s}=e;return r.createElement("div",{role:"tabpanel",className:(0,i.Z)(o.tabItem,s),hidden:n},t)}},74866:(e,t,n)=>{"use strict";n.d(t,{Z:()=>x});var r=n(87462),i=n(67294),o=n(34334),s=n(12466),a=n(16550),l=n(91980),c=n(67392),u=n(50012);function d(e){return function(e){return i.Children.map(e,(e=>{if(!e||(0,i.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:i}}=e;return{value:t,label:n,attributes:r,default:i}}))}function p(e){const{values:t,children:n}=e;return(0,i.useMemo)((()=>{const e=t??d(n);return function(e){const t=(0,c.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[t,n])}function h(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const r=(0,a.k6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l._X)(o),(0,i.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(r.location.search);t.set(o,e),r.replace({...r.location,search:t.toString()})}),[o,r])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,o=p(e),[s,a]=(0,i.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(t){if(!h({value:t,tabValues:n}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:o}))),[l,c]=f({queryString:n,groupId:r}),[d,m]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,o]=(0,u.Nk)(n);return[r,(0,i.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:r}),g=(()=>{const e=l??d;return h({value:e,tabValues:o})?e:null})();(0,i.useLayoutEffect)((()=>{g&&a(g)}),[g]);return{selectedValue:s,selectValue:(0,i.useCallback)((e=>{if(!h({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);a(e),c(e),m(e)}),[c,m,o]),tabValues:o}}var g=n(72389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function y(e){let{className:t,block:n,selectedValue:a,selectValue:l,tabValues:c}=e;const u=[],{blockElementScrollPositionUntilNextRender:d}=(0,s.o5)(),p=e=>{const t=e.currentTarget,n=u.indexOf(t),r=c[n].value;r!==a&&(d(t),l(r))},h=e=>{let t=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const n=u.indexOf(e.currentTarget)+1;t=u[n]??u[0];break}case"ArrowLeft":{const n=u.indexOf(e.currentTarget)-1;t=u[n]??u[u.length-1];break}}t?.focus()};return i.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":n},t)},c.map((e=>{let{value:t,label:n,attributes:s}=e;return i.createElement("li",(0,r.Z)({role:"tab",tabIndex:a===t?0:-1,"aria-selected":a===t,key:t,ref:e=>u.push(e),onKeyDown:h,onClick:p},s,{className:(0,o.Z)("tabs__item",b.tabItem,s?.className,{"tabs__item--active":a===t})}),n??t)})))}function v(e){let{lazy:t,children:n,selectedValue:r}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===r));return e?(0,i.cloneElement)(e,{className:"margin-top--md"}):null}return i.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,i.cloneElement)(e,{key:t,hidden:e.props.value!==r}))))}function w(e){const t=m(e);return i.createElement("div",{className:(0,o.Z)("tabs-container",b.tabList)},i.createElement(y,(0,r.Z)({},e,t)),i.createElement(v,(0,r.Z)({},e,t)))}function x(e){const t=(0,g.Z)();return i.createElement(w,(0,r.Z)({key:String(t)},e))}},5270:(e,t,n)=>{"use strict";n.d(t,{lG:()=>m,S1:()=>T,gy:()=>I,uT:()=>oe,X3:()=>A,AH:()=>_,s0:()=>ae,DM:()=>L,UV:()=>q,wA:()=>ce,XQ:()=>v,uH:()=>R,rZ:()=>$,v7:()=>P,J_:()=>de,Nq:()=>he,$q:()=>B,Wz:()=>U,j3:()=>te,YY:()=>H,eU:()=>z,kf:()=>s,DC:()=>j,IA:()=>be,Gb:()=>me,UB:()=>V});var r=n(40801),i=n(44096);const{SchemaVersion:o}=i.constants.enums;let s=function(e){return e.Api="api",e.Friendly2="friendly_v2",e}({});var a=n(67294),l=n(39960),c=n(74866),u=n(85162),d=n(23612),p=n(74464);const h=e=>{let{configuration:t,syntaxFormat:n,skipVersion:l}=e;return a.createElement(p.Z,{className:`language-${n===s.Api?"json":i.tools.PrismExtensions.LANGUAGE_NAME}`},function(e,t,n){void 0===t&&(t=s.Api);let i=e;switch(t){case s.Friendly2:return!i.type_definitions&&i.type&&(i={schema_version:o.OneDotOne,type_definitions:[i]},n=!0),n?r.transformer.transformJSONToDSL(i).replace("model\n schema 1.1\n",""):r.transformer.transformJSONToDSL(i);case s.Api:default:return n?JSON.stringify(i,null," ").replace(' "schema_version": "1.1",\n',""):JSON.stringify(i,null," ")}}(t,n,l))},f=e=>{let{onlyShow:t,configuration:n,skipVersion:r,showSchemaOneDotZero:o}=e;return t?a.createElement(h,{configuration:n,syntaxFormat:t,skipVersion:r}):o?a.createElement(a.Fragment,null,a.createElement(c.Z,{groupId:"dsl"},a.createElement(u.Z,{value:"dsl",label:"DSL"},a.createElement(h,{configuration:n,syntaxFormat:s.Friendly2,skipVersion:r})),a.createElement(u.Z,{value:"dsl-onedotzero",label:"DSL (Version 1.0)"},a.createElement(h,{configuration:{...n,schema_version:i.constants.enums.SchemaVersion.OneDotZero},syntaxFormat:s.Friendly2,skipVersion:r})),a.createElement(u.Z,{value:"json",label:"JSON"},a.createElement(h,{configuration:n,syntaxFormat:s.Api,skipVersion:r})))):a.createElement(a.Fragment,null,a.createElement(c.Z,{groupId:"dsl"},a.createElement(u.Z,{value:"dsl",label:"DSL"},a.createElement(h,{configuration:n,syntaxFormat:s.Friendly2,skipVersion:r})),a.createElement(u.Z,{value:"json",label:"JSON"},a.createElement(h,{configuration:n,syntaxFormat:s.Api,skipVersion:r}))))},m=e=>{let{configuration:t,onlyShow:n,showWrite:r,skipVersion:i,showSchemaOneDotZero:o}=e;return a.createElement(a.Fragment,null,a.createElement(f,{configuration:t,skipVersion:i,onlyShow:n,showSchemaOneDotZero:o}),r?a.createElement("details",null,a.createElement("summary",null,"Write the Authorization Model"),a.createElement(d.Z,{type:"note"},a.createElement("div",null,"The OpenFGA API only accepts an authorization model in the API's JSON syntax."),a.createElement("div",null,"To convert between the API Syntax and the friendly DSL, you can use the"," ",a.createElement(l.Z,{href:"https://github.com/openfga/cli/"},"FGA CLI"),".")),a.createElement(be,{authorizationModel:t,skipSetup:!0})):void 0)},g={"documentation-banner":"documentation-banner_hL3X","documentation-banner-icon":"documentation-banner-icon_zVr_","documentation-banner-icon-slack":"documentation-banner-icon-slack__g7S","documentation-banner-icon-drive":"documentation-banner-icon-drive_FABO","documentation-banner-icon-github":"documentation-banner-icon-github_p3sP","documentation-banner-icon-iot":"documentation-banner-icon-iot_nAKg","documentation-banner-icon-playground":"documentation-banner-icon-playground_sgp9","documentation-banner-icon-entitlements":"documentation-banner-icon-entitlements_QMIV","documentation-banner-content":"documentation-banner-content_N4KI","documentation-banner-title":"documentation-banner-title_tH3s","documentation-banner-description":"documentation-banner-description_rLpl","documentation-banner-chevron":"documentation-banner-chevron_qBL2"},b=e=>{let{title:t,description:n,link:r,preset:i}=e;const o="documentation-banner";return a.createElement(l.Z,{to:r,className:g[o]},a.createElement("div",{className:g[o+"-icon"]},i&&a.createElement("div",{className:g[o+"-icon-"+i]})),a.createElement("div",{className:g[o+"-content"]},a.createElement("h4",{className:g[o+"-title"]},t),a.createElement("p",{className:g[o+"-description"]},n)),a.createElement("div",{className:g[o+"-chevron"]},a.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M9 18L15 12L9 6",stroke:"#65676E",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))))};var y=n(52263);function v(e){let{example:t,intro:n,preset:r,store:i,title:o}=e;const{siteConfig:s}=(0,y.Z)(),l=i?`samples/${i}`:"",c=(n?"Get started ":t?`Explore the ${t} sample `:"Try this guide out ")+`on the ${s.customFields.playgroundName}`;return s.customFields.playgroundURL?a.createElement(b,{title:o||"The Playground",preset:r||"playground",description:`${c}`,link:`${s.customFields.playgroundURL}${l}`}):a.createElement(a.Fragment,null)}const w={"documentation-link":"documentation-link_vRVq","documentation-link-show-arrow-on-hover":"documentation-link-show-arrow-on-hover_XIYB"};function x(e){let{href:t,to:n,className:r,children:i,onClick:o,showArrowOnHover:s=!1}=e;return a.createElement(l.Z,{className:[r,s?w["documentation-link-show-arrow-on-hover"]:void 0].join(" "),href:t,to:n,onClick:o},a.createElement(a.Fragment,null,i))}const S={"documentation-card-box":"documentation-card-box_SNqO","documentation-card-box-border":"documentation-card-box-border_zlYB","documentation-card-box-fitcontent":"documentation-card-box-fitcontent_koVg","documentation-card-box-children":"documentation-card-box-children_i280","documentation-card-box-children-small":"documentation-card-box-children-small_Bayp","documentation-card-box-children-mono":"documentation-card-box-children-mono_WQfY","documentation-card-box-icon":"documentation-card-box-icon_ZcC1","documentation-card-box-icon-large":"documentation-card-box-icon-large_nsCS","documentation-card-box-icon-label":"documentation-card-box-icon-label_ctwe","documentation-card-box-icon-title":"documentation-card-box-icon-title_zmVE","documentation-card-box-alignment-left":"documentation-card-box-alignment-left__zex","documentation-card-box-alignment-center":"documentation-card-box-alignment-center_zUxy","documentation-card-box-gradient":"documentation-card-box-gradient_ZcEA","documentation-card-box-filled":"documentation-card-box-filled_F0BA","documentation-card-box-description":"documentation-card-box-description_u7_j","documentation-card-box-content":"documentation-card-box-content_Z5TD","documentation-card-box-links":"documentation-card-box-links_XUmL","documentation-card-box-link":"documentation-card-box-link_yEiX","documentation-card-box-links-justify-start":"documentation-card-box-links-justify-start_wwT4","documentation-card-box-links-bold":"documentation-card-box-links-bold__aiB","documentation-card-box-links-none":"documentation-card-box-links-none_sQ2X","documentation-card-box-links-numbered":"documentation-card-box-links-numbered_Ebqk","documentation-card-box-title":"documentation-card-box-title_sKX3","documentation-card-box-title-center":"documentation-card-box-title-center_Hqm8"};let E=function(e){return e.None="none",e.Numbered="numbered",e.Bullets="bullets",e}({});const T=e=>{const{title:t,description:n,links:r,appearance:i,border:o,icon:s,centerTitle:l=!1,monoFontChildren:c=!1,smallFontChildren:u=!1,children:d,linkOpts:p}=e,{bulletType:h=E.None,shouldJustifyStart:f=!1,shouldBold:m=!1,shouldShowArrowOnHover:g=!1}=p||{},{siteConfig:b}=(0,y.Z)(),v=t?t.replace("{ProductName}",b.customFields.productName):t,w=n&&"string"==typeof n?n.replace("{ProductName}",b.customFields.productName):n,T="documentation-card-box";return a.createElement("div",{className:`${(()=>{switch(i){case"gradient":return S[T+"-gradient"];case"filled":return S[T+"-filled"];default:return S[T]}})()} ${s&&!d&&S[T+"-fitcontent"]} ${o&&S[T+"-border"]}`},a.createElement("div",{className:S[T+"-content"]},s&&a.createElement("div",{className:"left"===s.alignment?S[T+"-alignment-left"]:S[T+"-alignment-center"]},a.createElement("div",{className:v?S[T+"-icon-large"]:S[T+"-icon"]},s.icon),s.label&&a.createElement("p",{className:S[T+"-icon-label"]},s.label),v&&a.createElement("span",{className:S[T+"-icon-title"]},v)),v&&!s&&a.createElement("span",{className:S[T+(l?"-title-center":"-title")]},v),w&&("string"==typeof w?a.createElement("p",{className:S[T+"-description"]},w):w),r&&a.createElement("div",{className:[S[T+"-links"],S[T+"-links-"+h],f?S[T+"-links-justify-start"]:void 0,m?S[T+"-links-bold"]:void 0].join(" ")},a.createElement("ul",null,r?.map((e=>a.createElement("li",{key:`li-${e.to}`},a.createElement(x,{className:S[T+"-link"],key:`link-${e.to}`,to:e.to,showArrowOnHover:g},e.label)))))),a.createElement("div",{className:S[T+(u?"-children-small":c?"-children-mono":"-children")]},d)))};var C=n(87462);const k={"column-layout-2":"column-layout-2_O2db","column-layout-3":"column-layout-3_YXBy","column-layout-4":"column-layout-4_SipK","column-layout-4-equal-width":"column-layout-4-equal-width_WOGz","column-layout-5":"column-layout-5_K6O8","column-layout-5-equal-width":"column-layout-5-equal-width_CiKk"},A=e=>{let{cols:t,children:n,equalWidth:r,...i}=e;return a.createElement("div",(0,C.Z)({},i,{className:k["column-layout-"+t+(r?"-equal-width":"")]}),n)};var O=n(91036),N=n.n(O);function _(){const{siteConfig:e}=(0,y.Z)(),t=e.customFields.notice;return t?a.createElement(d.Z,{type:"note"},a.createElement("div",{dangerouslySetInnerHTML:{__html:N()(t)}})):a.createElement(a.Fragment,null)}function D(e){return"string"==typeof e?[{label:"Click to navigate",to:e}]:e.map((e=>{let{to:t,label:n}=e;return{label:n,to:t}}))}function I(e){let{top:t,middle:n,bottom:r}=e;const i=t?.map(((e,t)=>a.createElement(T,(0,C.Z)({},e,{appearance:t%2==0?"gradient":"filled",links:D(e.to),key:`card-grid-overview-top-${t}`})))),o=n?.map(((e,t)=>a.createElement(T,(0,C.Z)({},e,{links:D(e.to),key:`card-grid-overview-middle-${t}`})))),s=r?.map(((e,t)=>a.createElement(T,(0,C.Z)({},e,{links:D(e.to),key:`card-grid-overview-bottom-${t}`}))));return a.createElement("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},i&&a.createElement(A,{cols:2,style:{marginTop:"2rem"}},i),o&&a.createElement(A,{cols:3,style:{marginTop:"2rem"}},o),n&&r&&a.createElement("div",{style:{marginTop:"2rem",border:"1px solid #DADFE8"}}),s&&a.createElement(A,{cols:2,style:{marginTop:"2rem"}},s))}function L(e){let{title:t,description:n,listItems:r}=e;const{siteConfig:i}=(0,y.Z)(),o=t.replace("{ProductName}",i.customFields.productName),s=n.replace("{ProductName}",i.customFields.productName);return a.createElement("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},a.createElement(T,{title:o,description:a.createElement("div",{style:{marginTop:"0.75rem"}},a.createElement("p",{className:S["documentation-card-box-description"]},s),r&&a.createElement("ul",{style:{marginTop:"2rem"}},r.map(((e,t)=>a.createElement("li",{key:`list-description-${t}`},e.replace("{ProductName}",i.customFields.productName)))))),links:[]}))}let P=function(e){return e.ShortForm="shortForm",e.LongForm="longForm",e.ProductLink="productLink",e}({});function $(e){const{siteConfig:t}=(0,y.Z)(),n=t.baseUrl+(t.customFields.introLink+t.customFields.productDescriptionSection);switch(e.format){case P.ProductLink:return a.createElement("a",{href:n},t.customFields.productName);case P.LongForm:return a.createElement(a.Fragment,null,t.customFields.longProductName);case P.ShortForm:default:return a.createElement(a.Fragment,null,t.customFields.productName)}}function j(e){const{siteConfig:t}=(0,y.Z)(),n=e.name.replace("{ProductName}",t.customFields.productName),r=e.link.replace("{ProductConcept}",t.customFields.conceptLink);return a.createElement("a",{href:r},n)}function R(e){const{siteConfig:t}=(0,y.Z)(),n=t.baseUrl+t.customFields.conceptLink,r=e.section?n+"#"+e.section:n,i=e.linkName?e.linkName:t.customFields.productName+" Concepts";return a.createElement("a",{href:r},i)}function q(e){const{siteConfig:t}=(0,y.Z)(),n=t.baseUrl+t.customFields.introLink,r=e.section?n+"#"+e.section:n,i=e.linkName;return a.createElement("a",{href:r},i)}const M={"documentation-related-section-title":"documentation-related-section-title_FCU2","documentation-related-section-description":"documentation-related-section-description_Un_N"};function B(e){const{siteConfig:t}=(0,y.Z)(),{description:n,relatedLinks:r}=e,i="documentation-related-section",o=n.replace("{ProductName}",t.customFields.productName);return a.createElement("div",{className:M[i]},a.createElement("div",{className:M[i+"-description"]},a.createElement("span",null,o)),a.createElement(A,{cols:3},r?.map((e=>function(e){const{siteConfig:t}=(0,y.Z)(),n=e.link.replace("{ProductConcept}",t.customFields.conceptLink),r=e.title.replace("{ProductName}",t.customFields.productName),i=e.description.replace("{ProductName}",t.customFields.productName);return a.createElement(T,{key:n,title:r,description:i,links:[{label:"More",to:n}]})}(e)))))}var F=function(e){return e.JSON="json",e}(F||{});function U(e){return a.createElement(a.Fragment,null,a.createElement(p.Z,{className:"language-json5"},function(e,t){return F.JSON,`[${t.relationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n ${i?`// ${i}\n `:""}{\n "user": "${t}",\n "relation": "${n}",\n "object": "${r}",\n },`})).join("")}\n]`}(F.JSON,e)))}function H(){return a.createElement(a.Fragment,null,"Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.")}let z=function(e){return e.CLI="cli",e.JS_SDK="js-sdk",e.GO_SDK="go-sdk",e.DOTNET_SDK="dotnet-sdk",e.PYTHON_SDK="python-sdk",e.CURL="curl",e.RPC="rpc",e.PLAYGROUND="playground",e}({});const V=new Map([[z.CLI,"CLI"],[z.JS_SDK,"Node.js"],[z.GO_SDK,"Go"],[z.DOTNET_SDK,".NET"],[z.PYTHON_SDK,"Python"],[z.CURL,"curl"],[z.RPC,"Pseudocode"],[z.PLAYGROUND,"Playground"]]),G=new Map([[z.CLI,"shell"],[z.JS_SDK,"javascript"],[z.GO_SDK,"go"],[z.DOTNET_SDK,"dotnet"],[z.PYTHON_SDK,"python"],[z.CURL,"shell"],[z.RPC,"shell"],[z.PLAYGROUND,"shell"]]),Z=(e,t)=>e?t?e.filter((e=>t.includes(e))):e:t||[];function K(e){const{allowedLanguages:t}=e;return t.map((e=>({label:V.get(e),value:e})))}const J="1uHxCSuTP0VKPYSnkq1pbb1jeZw";var W=n(34673),Y=n(46242);function X(e,t){switch(e){case z.JS_SDK:return t.js;case z.GO_SDK:return t.go;case z.DOTNET_SDK:return t.dotnet;case z.PYTHON_SDK:return t.python}return{importStatement:"",apiName:"",setupNote:""}}function Q(e,t){return X(e,t).importStatement}function ee(e,t){switch(e){case z.CURL:case z.CLI:return"Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)\n";case z.JS_SDK:return`// import the SDK\n${Q(e,t)}\n\n// Initialize the SDK with no auth - see "How to setup SDK client" for more options\nconst fgaClient = new ${t.js.apiName}({\n apiScheme: process.env.FGA_API_SCHEME, // Either "http" or "https", defaults to "https"\n apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)\n storeId: process.env.FGA_STORE_ID,\n authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request\n});`;case z.GO_SDK:return`import (\n ${Q(e,t)}\n "os"\n)\n\nfunc main() {\n // Initialize the SDK with no auth - see "How to setup SDK client" for more options\n fgaClient, err := NewSdkClient(&ClientConfiguration{\n ApiScheme: os.Getenv("FGA_SCHEME"), // Either "http" or "https", defaults to "https"\n ApiHost: os.Getenv("FGA_API_HOST"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)\n StoreId: os.Getenv("FGA_STORE_ID"), // optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods\n AuthorizationModelId: openfga.PtrString(os.Getenv("FGA_MODEL_ID")), // Optional, can be overridden per request\n })\n\n if err != nil {\n // .. Handle error\n }\n}`;case z.DOTNET_SDK:return`// import the SDK\n${Q(e,t)}\nusing Environment = System.Environment;\n\nnamespace Example;\n\nclass Example {\n public static async Task Main() {\n // Initialize the SDK with no auth - see "How to setup SDK client" for more options\n var configuration = new ClientConfiguration() {\n ApiScheme = Environment.GetEnvironmentVariable("FGA_API_SCHEME"), // Either "http" or "https", defaults to "https"\n ApiHost = Environment.GetEnvironmentVariable("FGA_API_HOST"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)\n StoreId = Environment.GetEnvironmentVariable("FGA_STORE_ID"), // optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods\n AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_MODEL_ID"), // Optional, can be overridden per request\n };\n var fgaClient = new ${t.js.apiName}(configuration);\n }\n}`;case z.PYTHON_SDK:return`\n${Q(e,t)}\n\nconfiguration = openfga_sdk.ClientConfiguration(\n api_scheme = os.environ.get('FGA_API_SCHEME'), # Either "http" or "https", defaults to "https"\n api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)\n store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods\n authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request\n)\n\n# Enter a context with an instance of the OpenFgaClient\nasync with OpenFgaClient(configuration) as fga_client:\n api_response = await fga_client.read_authorization_models()\n await fga_client.close()\n`;case z.RPC:case z.PLAYGROUND:throw new Error(`Lang ${e} support has not been implemented`);default:(0,Y.ZP)(e)}}function te(e){let{lang:t}=e;const{siteConfig:n}=(0,y.Z)();return ne({allowedLanguage:t,content:ee(t,n.customFields.languageMapping)})}function ne(e){let{allowedLanguage:t,content:n}=e;return a.createElement(p.Z,{className:`language-${G.get(t)}`},n)}function re(e,t,n){const{siteConfig:r}=(0,y.Z)(),i=r.customFields.languageMapping;return a.createElement(a.Fragment,null,a.createElement(c.Z,{groupId:"languages",values:K({allowedLanguages:e})},e.map((e=>a.createElement(u.Z,{value:e,key:e},function(e,t){const{siteConfig:n}=(0,y.Z)(),r=n.customFields.languageMapping;if(t)return;let i,o="Initialize the SDK";const s=G.get(e);switch(e){case z.JS_SDK:case z.GO_SDK:case z.DOTNET_SDK:case z.PYTHON_SDK:i=X(e,r).setupNote+ee(e,r);break;case z.CLI:i=ee(z.CLI,r),o="Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)";break;case z.CURL:i=ee(z.CURL,r),o="Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)";break;case z.PLAYGROUND:case z.RPC:return;default:(0,Y.ZP)(e)}return a.createElement(a.Fragment,null,a.createElement(W.Z,{summary:a.createElement("summary",null,o)},a.createElement(p.Z,{className:`language-${s}`},i)))}(e,t.skipSetup),ne({allowedLanguage:e,content:n(e,t,i)}))))))}function ie(e,t){const{user:n,relation:r,object:i,allowed:o,contextualTuples:s}=t,a=t.authorizationModelId?t.authorizationModelId:J;switch(e){case z.PLAYGROUND:return`is ${n} related to ${i} as ${r}?\n${s?"\n# Note: Contextual Tuples are not supported on the playground":""}\n\n# Response: ${o?"A green path from the user to the object":"A red object"} indicating that the response from the API is \`{"allowed":${o?"true":"false"}}\`\n`;case z.CLI:return`fga query check --store-id=$FGA_STORE_ID --model-id=${a} ${n} ${r} ${i}${s?` --contextual_tuples ${s.map((e=>`"${e.user} ${e.relation} ${e.object}"`)).join(" ")}`:""}\n\n# Response: {"allowed":${o}}`;case z.CURL:return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" \\\n -d '{"authorization_model_id": "${a}", "tuple_key":{"user":"${n}","relation":"${r}","object":"${i}"}${s?`,"contextual_tuples":{"tuple_keys":[${s.map((e=>`{"user":"${e.user}","relation":"${e.relation}","object":"${e.object}"}`)).join(",")}]}}`:"}"}'\n\n# Response: {"allowed":${o}}`;case z.JS_SDK:return`\n// Run a check\nconst { allowed } = await fgaClient.check({\n user: '${n}',\n relation: '${r}',\n object: '${i}',${s?`\n contextual_tuples: [${s.map((e=>`\n {\n user: "${e.user}",\n relation: "${e.relation}",\n object: "${e.object}"\n }`)).join(",")}\n ]`:"\n"}}, {\n authorization_model_id: '${a}',\n});\n\n// allowed = ${o}`;case z.GO_SDK:return`\noptions := ClientCheckOptions{\n\tAuthorizationModelId: openfga.PtrString("${a}"),\n}\nbody := ClientCheckRequest{\n\tUser: "${n}",\n\tRelation: "${r}",\n\tObject: "${i}",${s?`\n\tContextualTuples: &[]ClientTupleKey{\n${s?s.map((e=>`\t\t{\n\t\t\tUser: "${e.user}",\n\t\t\tRelation: "${e.relation}",\n\t\t\tObject: "${e.object}",\n\t\t}`)).join(",\n"):""}\n\t}`:""}\n}\n\ndata, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute()\n\n// data = { allowed: ${o} }`;case z.DOTNET_SDK:return`\nvar options = new ClientCheckOptions {\n AuthorizationModelId = "${a}",\n};\nvar body = new ClientCheckRequest {\n User = "${n}",\n Relation = "${r}",\n Object = "${i}",${s?`,\n ContextualTuples = new List<ClientTupleKey>({\n ${s.map((e=>`new(user: "${e.user}", relation: "${e.relation}", _object: "${e.object}")`)).join(",\n ")}\n})`:""}\n};\nvar response = await fgaClient.Check(body, options);\n\n// response.Allowed = ${o}`;case z.PYTHON_SDK:return`options = {\n "authorization_model_id": "${a}"\n}\nbody = ClientCheckRequest(\n user="${n}",\n relation="${r}",\n object="${i}",${s?`\n contextual_tuples=[\n ${s.map((e=>`ClientTupleKey(user="${e.user}", relation="${e.relation}", object="${e.object}")`)).join(",\n ")}\n ],`:""}\n)\n\nresponse = await fga_client.check(body, options)\n\n# response.allowed = ${o}\n`;case z.RPC:return`check(\n user = "${n}", // check if the user \`${n}\`\n relation = "${r}", // has an \`${r}\` relation\n object = "${i}", // with the object \`${i}\`\n ${s?`contextual_tuples = [ // Assuming the following is true\n ${s.map((e=>`{user = "${e.user}", relation = "${e.relation}", object = "${e.object}"}`)).join(",\n ")}\n ],`:""} authorization_id = "${a}"\n);\n\nReply: ${o}`;default:(0,Y.ZP)(e)}}function oe(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CLI,z.CURL,z.RPC];return re(Z(e.allowedLanguages,t),e,ie)}function se(e,t){const n=t.authorizationModelId?t.authorizationModelId:J;switch(e){case z.CLI:return`fga query expand --store-id=\${FGA_STORE_ID} --model-id=${n} ${t.relation} ${t.object}\n\n# Response: {"tree": ...}`;case z.CURL:return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/expand \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" \\\n -d '{"tuple_key":{"relation":"${t.relation}","object":"${t.object}"}, "authorization_model_id": "${n}"}'\n\n# Response: {"tree": ...}`;case z.JS_SDK:return`\nconst { tree } = await fgaClient.expand({\n relation: '${t.relation}', // expand all who has '${t.relation}' relation\n object: '${t.object}', // with the object '${t.object}'\n}, {\n authorization_model_id: '${n}'\n});\n\n// tree = ...`;case z.GO_SDK:return`\noptions := ClientExpandOptions{\n AuthorizationModelId: openfga.PtrString("${n}"),\n}\nbody := ClientExpandRequest{\n Relation: "${t.relation}", // expand all who has "${t.relation}" relation\n Object: "${t.object}", // with the object "${t.object}"\n}\ndata, err := fgaClient.Expand(context.Background()).Body(requestBody).Options(options).Execute()\n\n// data = { tree: ...}`;case z.DOTNET_SDK:return`\nvar options = new ClientCheckOptions {\n AuthorizationModelId = "${n}",\n};\nvar body = new ClientExpandRequest {\n Relation = "${t.relation}", // expand all who has "${t.relation}" relation\n Object = "${t.object}" // with the object "${t.object}"\n};\nvar response = await fgaClient.Expand(body, options);\n\n// response = { tree: ... }`;case z.RPC:return`expand(\n "${t.relation}", // expand all who has \`${t.relation}\` relation\n "${t.object}", // with the object \`${t.object}\`\n authorization_model_id="${n}"\n);\n\nReply: {tree:...}`;case z.PYTHON_SDK:return`\noptions = {\n "authorization_model_id": "${t.authorizationModelId?t.authorizationModelId:J}"\n}\nbody = ClientExpandRequest(\n relation: "${t.relation}",\n object: "${t.object}",\n)\n\nresponse = await fga_client.expand(body. options)\n\n# response = ExpandResponse({"tree":...})\n`;case z.PLAYGROUND:return"";default:(0,Y.ZP)(e)}}function ae(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CLI,z.CURL,z.RPC];return re(Z(e.allowedLanguages,t),e,se)}function le(e,t){const{user:n,relation:r,objectType:i,contextualTuples:o,expectedResults:s}=t,a=t.authorizationModelId?t.authorizationModelId:J;switch(e){case z.PLAYGROUND:return"# Note: List Objects is not currently supported on the playground";case z.CLI:return`fga query list-objects --store-id=\${FGA_STORE_ID} --model-id=${a} ${n} ${r} ${i}${o?` --contextual_tuples ${o.map((e=>`"${e.user} ${e.relation} ${e.object}"`)).join(" ")}`:""}\n\n# Response: {"objects": [${s.map((e=>`"${e}"`)).join(", ")}]}`;case z.CURL:return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/list-objects \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" \\\n -d '{ "authorization_model_id": "${a}",\n "type": "${i}",\n "relation": "${r}",\n "user":"${n}"${o?`,\n "contextual_tuples": {\n "tuple_keys": [${o.map((e=>`\n {"object": "${e.object}", "relation": "${e.relation}", "user": "${e.user}"}`)).join(",")}\n ]\n }\n }'`:"\n }'"}\n\n# Response: {"objects": [${s.map((e=>`"${e}"`)).join(", ")}]}`;case z.JS_SDK:return`const response = await fgaClient.listObjects({\n user: "${n}",\n relation: "${r}",\n type: "${i}",${o?.length?`\n contextual_tuples: {\n tuple_keys: [${o.map((e=>`{\n user: "${e.user}",\n relation: "${e.relation}",\n object: "${e.object}"\n }`)).join(", ")}]\n },`:""}\n}, {\n authorization_model_id: "${a}",\n});\n// response.objects = [${s.map((e=>`"${e}"`)).join(", ")}]`;case z.GO_SDK:return`\noptions := ClientListObjectsOptions{\n AuthorizationModelId: openfga.PtrString("${a}"),\n}\nbody := ClientListObjectsRequest{\n\tUser: "${n}",\n\tRelation: "${r}",\n\tType: "${i}",${o?`\n\tContextualTuples: &[]ClientTupleKey{\n${o?o.map((e=>`\t\t{\n\t\t\tUser: "${e.user}",\n\t\t\tRelation: "${e.relation}",\n\t\t\tObject: "${e.object}",\n\t\t}`)).join(",\n"):""}\n\t}`:""}\n}\ndata, err := fgaClient.ListObjects(context.Background()).\n Body(requestBody).\n Options(options).\n Execute()\n\n// data = { "objects": [${s.map((e=>`"${e}"`)).join(", ")}] }`;case z.DOTNET_SDK:return`\nvar options = new ClientListObjectsOptions {\n AuthorizationModelId = "${a}",\n};\nvar body = new ClientListObjectsRequest {\n User = "${n}",\n Relation = "${r}",\n Type = "${i}",${o?`,\n ContextualTuples = new List<ClientTupleKey>({\n ${o.map((e=>`new(user: "${e.user}", relation: "${e.relation}", _object: "${e.object}")`)).join(",\n ")}\n})`:""}\n};\n\nvar response = await fgaClient.ListObjects(body, options);\n\n// response.Objects = [${s.map((e=>`"${e}"`)).join(", ")}]`;case z.PYTHON_SDK:return`\noptions = {\n "authorization_model_id": "${a}"\n}\nbody = ClientListObjectsRequest(\n user="${n}",\n relation="${r}",\n type="${i}",${o?`\n contextual_tuples=[\n ${o.map((e=>`ClientTupleKey(user="${e.user}", relation="${e.relation}", object="${e.object}")`)).join(",\n ")}\n ],`:""}\n)\n\nresponse = await fga_client.list_objects(body, options)\n\n# response.objects = [${s.map((e=>`"${e}"`)).join(", ")}]\n`;case z.RPC:return`listObjects(\n "${n}", // list the objects that the user \`${n}\`\n "${r}", // has an \`${r}\` relation\n "${i}", // and that are of type \`${i}\`\n authorization_model_id = "${a}", // for this particular authorization model id ${o?`\n contextual_tuples = [ // Assuming the following is true\n ${o.map((e=>`{user = "${e.user}", relation = "${e.relation}", object = "${e.object}"}`)).join(",\n ")}\n ]`:""}\n);\n\nReply: [${s.map((e=>`"${e}"`)).join(", ")}]`;default:(0,Y.ZP)(e)}}function ce(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CLI,z.CURL,z.RPC];return re(Z(e.allowedLanguages,t),e,le)}function ue(e,t){switch(e){case z.CLI:return"fga tuple changes --store-id=${FGA_STORE_ID}"+(t.type?` --type ${t.type}`:"");case z.CURL:return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/changes \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" \\\n -d '{${""+(t.type?'"type": '+t.type+'", ':"")}${""+(t.continuationToken?'"continuation_token": "'+t.continuationToken+'", ':"")}${""+(t.pageSize?'"page_size": '+t.pageSize:"")}}'`;case z.JS_SDK:return`${""+('var type = "'+(t.type?t.type:"")+'";\n')}${""+('var continuationToken = "'+(t.continuationToken?t.continuationToken:"")+'";\n')}${""+("var pageSize = "+(t.pageSize?t.pageSize:"")+";\n")}\nawait fgaClient.readChanges({ type }, { pageSize, continuationToken });`;case z.GO_SDK:return`options := ClientReadChangesOptions{${t.pageSize?`\n\tPageSize: openfga.PtrInt32(${t.pageSize}),\n`:""}${t.continuationToken?`\n\tContinuationToken: openfga.PtrString("${t.continuationToken}"),\n`:""}}\nbody := ClientReadChangesRequest{${t.type?`\n\tType: "${t.type}",`:""}\n}\n\ndata, err := fgaClient.ReadChanges(context.Background()).Body(body).Options(options).Execute()\n\nif err != nil {\n // .. Handle error\n}`;case z.DOTNET_SDK:return`var body = new ClientReadChangesRequest { ${t.type?`Type = "${t.type}"`:""} };\nvar options = new ClientReadChangesOptions {\n ${t.pageSize?`PageSize = ${t.pageSize},\n`:""}\n ${t.continuationToken?`ContinuationToken = "${t.continuationToken}",\n`:""}\n};\n\nvar response = await fgaClient.ReadChanges(body, options);`;case z.PYTHON_SDK:return`\nbody = ClientReadChangesRequest(${t.type?`"${t.type}"`:""})\noptions = new ClientReadChangesOptions {\n ${t.pageSize?`page_size: ${t.pageSize},\n`:""}\n ${t.continuationToken?`continuation_token: "${t.continuationToken}",\n`:""}\n};\nresponse = await fga_client.read_changes(body, options)`;default:return""}}function de(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CLI,z.CURL];return re(Z(e.allowedLanguages,t),e,ue)}function pe(e,t){const n=t.tuples?t.tuples.map((e=>{let{user:t,relation:n,object:r}=e;return`{"key": {"user":"${t}","relation":"${n}","object":"${r}"}, "timestamp": "2021-10-06T15:32:11.128Z"}`})).join(","):"";switch(e){case z.CLI:return`fga tuple read --store-id=\${FGA_STORE_ID}${t.user?` --user ${t.user}`:""}${t.relation?` --relation ${t.relation}`:""}${t.object?` --object ${t.object}`:""}`;case z.CURL:{const e=t.object?(t.user?`"user":"${t.user}",`:"")+(t.relation?`"relation":"${t.relation}",`:"")+`"object":"${t.object}"`:"";return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" ${e?`\\\n -d '{"tuple_key":{${e}}}`:""}'\n\n# Response: "tuples": {[${n}]}`}case z.JS_SDK:return`\n// Execute a read\nconst { tuples } = await fgaClient.read({\n ${t.object?(t.user?`user:'${t.user}',\n`:"")+(t.relation?`relation:'${t.relation}',\n`:"")+`object:'${t.object}',`:""}\n});\n\n// tuples = [${n}]\n`;case z.GO_SDK:return`options := ClientReadOptions{}\nbody := ClientReadRequest{\n${t.object?(t.user?`\tUser: openfga.PtrString("${t.user}"),\n`:"")+(t.relation?`\tRelation: openfga.PtrString("${t.relation}"),\n`:"")+`\tObject: openfga.PtrString("${t.object}"),\n`:""}\n}\n\ndata, err := fgaClient.Read(context.Background()).Body(requestBody).Options(options).Execute()\n\n// data = { "tuples": [${n}] }`;case z.DOTNET_SDK:return`var options = new ClientReadOptions {}\nvar body = new ClientReadRequest() {\n${t.object?(t.user?` User = "${t.user}",\n`:"")+(t.relation?` Relation = "${t.relation}",\n`:"")+` Object = "${t.object}",`:""}\n};\n\nvar response = await fgaClient.Read(body, options);\n\n// data = { "tuples": [${n}] }`;case z.PYTHON_SDK:return`\noptions = {}\nbody = TupleKey(\n${t.object?(t.user?` user="${t.user}",\n`:"")+(t.relation?` relation="${t.relation}",\n`:"")+` object="${t.object}",\n`:""}\n)\n\nresponse = await fga_client.read(body, options)\n\n# response = ReadResponse({"tuples":[${n}]})`;case z.RPC:{const e=t.object?":"===t.object.slice(-1)?"type":"object":"";return`read(\n // read all stored tuples\n${t.object?(t.user?` "${t.user}", // where user \`${t.user}\` has $(opts.relation ? '': 'any ' )relation\n`:" // for users who have relation\n")+(t.relation?` "${t.relation}", // \`${t.relation}\`\n`:"")+` "${t.object}", // with the ${e} \`${t.object}\``:""}\n);\n\nReply: tuples:[${t.tuples?t.tuples.map((e=>{let{user:t,relation:n,object:r}=e;return`{"key": {"user":"${t}","relation":"${n}","object":"${r}"}, "timestamp": "2021-10-06T15:32:11.128Z"}`})).join(","):""}]`}case z.PLAYGROUND:return"";default:(0,Y.ZP)(e)}}function he(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CLI,z.CURL,z.RPC];return re(Z(e.allowedLanguages,t),e,pe)}function fe(e,t){const n=t.authorizationModelId?t.authorizationModelId:J;switch(e){case z.CLI:return`${t.relationshipTuples?.length?t.relationshipTuples.map((e=>`fga tuple write --store-id=\${FGA_STORE_ID} --model-id=${n} ${e.user} ${e.relation} ${e.object}`)).join("\n"):""}\n\n${t.deleteRelationshipTuples?.length?t.deleteRelationshipTuples.map((e=>`fga tuple delete --store-id=\${FGA_STORE_ID} ${e.user} ${e.relation} ${e.object}`)).join("\n"):""}`;case z.CURL:{const e=`"writes": { "tuple_keys" : [${t.relationshipTuples?t.relationshipTuples.map((e=>{let{user:t,relation:n,object:r}=e;return`{"user":"${t}","relation":"${n}","object":"${r}"}`})).join(","):""}] }`,r=`"deletes": { "tuple_keys" : [${t.deleteRelationshipTuples?t.deleteRelationshipTuples.map((e=>{let{user:t,relation:n,object:r}=e;return`{"user":"${t}","relation":"${n}","object":"${r}"}`})).join(","):""}] }`,i=""+(t.deleteRelationshipTuples&&t.relationshipTuples?",":"");return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" \\\n -d '{${t.relationshipTuples?e:""}${i}${t.deleteRelationshipTuples?r:""}, "authorization_model_id": "${n}"}'`}case z.JS_SDK:{const e=`writes: [${t.relationshipTuples?t.relationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n ${i?`// ${i}\n `:""}{ user: '${t}', relation: '${n}', object: '${r}'}`})).join(","):""}]\n }`,r=`deletes: [${t.deleteRelationshipTuples?t.deleteRelationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n ${i?`// ${i}\n `:""}{ user: '${t}', relation: '${n}', object: '${r}'}`})).join(","):""}]\n }`,i=""+(t.deleteRelationshipTuples&&t.relationshipTuples?",\n ":"");return`\nawait fgaClient.write({\n ${t.relationshipTuples?e:""}${i}${t.deleteRelationshipTuples?r:""},\n}, {\n authorization_model_id: "${n}" \n});`}case z.GO_SDK:{const e=`\tWrites: &[]ClientTupleKey{${t.relationshipTuples?t.relationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n\t\t\t{\n\t\t\t\t${i?`// ${i}\n\t\t\t\t`:""}User: openfga.PtrString("${t}"),\n\t\t\t\tRelation: openfga.PtrString("${n}"),\n\t\t\t\tObject: openfga.PtrString("${r}"),\n\t\t\t}, `})).join(""):""}}`,r=`\tDeletes: &[]ClientTupleKey{${t.deleteRelationshipTuples?t.deleteRelationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n\t\t\t{\n\t\t\t\t${i?`// ${i}\n\t\t\t\t`:""}User: openfga.PtrString("${t}"),\n\t\t\t\tRelation: openfga.PtrString("${n}"),\n\t\t\t\tObject: openfga.PtrString("${r}"),\n\t\t\t}, `})).join(""):""}}`;return`\noptions := ClientWriteOptions{\n\tAuthorizationModelId: openfga.PtrString("${n}"),\n}\nbody := fgaClient.ClientWriteRequest{\n${t.relationshipTuples?e:""}${t.deleteRelationshipTuples?r:""} }\ndata, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute()\n\nif err != nil {\n // .. Handle error\n}\n`}case z.DOTNET_SDK:{const e=`Writes = new List<ClientTupleKey>() {\n${t.relationshipTuples?t.relationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`${i?` // ${i}\n`:""} new() { User = "${t}", Relation = "${n}", Object = "${r}" }`})).join(",\n"):""}\n }`,r=`Deletes = new List<ClientTupleKey>() {\n${t.deleteRelationshipTuples?t.deleteRelationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`${i?` // ${i}\n`:""} new() { User = "${t}", Relation = "${n}", Object = "${r}" }`})).join(",\n"):""}\n }`,i=""+(t.deleteRelationshipTuples&&t.relationshipTuples?",\n ":"");return`\nvar options = new ClientListObjectsOptions {\n AuthorizationModelId = "${n}",\n};\nvar body = new ClientWriteRequest() {\n ${t.relationshipTuples?e:""}${i}${t.deleteRelationshipTuples?r:""},\n};\nvar response = await fgaClient.Write(body, options);`}case z.PYTHON_SDK:{const e=` writes=[${t.relationshipTuples?t.relationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n ClientTuple(\n${i?` # ${i}\n `:" "}user="${t}",\n relation="${n}",\n object="${r}",\n ),`})).join(""):""},\n ),\n`,r=` deletes==[${t.deleteRelationshipTuples?t.deleteRelationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n ClientTuple(\n${i?` # ${i}\n `:" "}user="${t}",\n relation="${n}",\n object="${r}",\n ),`})).join(""):""}],\n ),\n`;return`options = {\n "authorization_model_id": "${n}"\n}\nbody = body = ClientWriteRequest(\n ${t.relationshipTuples?e:""}${t.deleteRelationshipTuples?r:""}",\n)\n\nresponse = await fga_client.write(body, options)\n`}case z.RPC:{const e=t.relationshipTuples?.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`${i?`\n // ${i}`:""}\n {\n "user":"${t}",\n "relation":"${n}",\n "object":"${r}"\n }`})).join(","),r=t.deleteRelationshipTuples?.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`${i?`\n // ${i}`:""}\n {\n "user":"${t}",\n "relation":"${n}",\n "object":"${r}"\n }`})).join(","),i=`write([${e}\n], authorization_model_id="${n}")`,o=`delete([${r}\n], authorization_model_id="${n}")`,s=""+(t.deleteRelationshipTuples&&t.relationshipTuples?",":"");return`${t.relationshipTuples?i:""}${s}\n${t.deleteRelationshipTuples?o:""}`}case z.PLAYGROUND:return"";default:(0,Y.ZP)(e)}}function me(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CURL,z.CLI,z.RPC];return re(Z(e.allowedLanguages,t),e,fe)}function ge(e,t,n){switch(e){case z.CLI:return r=t.authorizationModel,`fga model write --store-id=\${FGA_STORE_ID} ${JSON.stringify(r)}`;case z.CURL:return function(e){return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/authorization-models \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" \\\n -d '${JSON.stringify(e)}'`}(t.authorizationModel);case z.JS_SDK:return function(e){return`\nconst { authorization_model_id: id } = await fgaClient.writeAuthorizationModel(${JSON.stringify(e,null,2)});\n// id = "1uHxCSuTP0VKPYSnkq1pbb1jeZw"`}(t.authorizationModel);case z.GO_SDK:return function(e,t){return`\n var writeAuthorizationModelRequestString = ${JSON.stringify(JSON.stringify(e))}\n var body WriteAuthorizationModelRequest\n if err := json.Unmarshal([]byte(writeAuthorizationModelRequestString), &body); err != nil {\n t.Errorf("%v", err)\n // .. Handle error\n return\n }\n\n data, response, err := fgaClient.${t}.WriteAuthorizationModel(context.Background()).Body(body).Execute()\n if err != nil {\n // .. Handle error\n }\n\n // data.AuthorizationModelId = "1uHxCSuTP0VKPYSnkq1pbb1jeZw"\n `}(t.authorizationModel,n.go.apiName);case z.DOTNET_SDK:return function(e){return`\n var modelJson = ${JSON.stringify(JSON.stringify(e))};\n var body = JsonSerializer.Deserialize<OpenFga.Sdk.Model.WriteAuthorizationModelRequest>(modelJson);\n\n var response = await fgaClient.WriteAuthorizationModel(body);\n // response.AuthorizationModelId = "1uHxCSuTP0VKPYSnkq1pbb1jeZw"`}(t.authorizationModel);case z.PYTHON_SDK:return function(e){return`\n# from openfga_sdk.models.write_authorization_model_request import WriteAuthorizationModelRequest\n\nasync def write_authorization_model():\n body_string = ${JSON.stringify(JSON.stringify(e))}\n response = await fga_client_instance.write_authorization_model(json.loads(body))\n # response.authorization_model_id = "1uHxCSuTP0VKPYSnkq1pbb1jeZw"\n`}(t.authorizationModel);case z.RPC:case z.PLAYGROUND:return"";default:(0,Y.ZP)(e)}var r}function be(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CLI,z.CURL];return re(Z(e.allowedLanguages,t),e,ge)}},9996:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(n){return!1}}function a(e,t,n){var i={};return n.isMergeableObject(e)&&o(e).forEach((function(t){i[t]=r(e[t],n)})),o(t).forEach((function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&n.isMergeableObject(t[o])?i[o]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(o,n)(e[o],t[o],n):i[o]=r(t[o],n))})),i}function l(e,n,o){(o=o||{}).arrayMerge=o.arrayMerge||i,o.isMergeableObject=o.isMergeableObject||t,o.cloneUnlessOtherwiseSpecified=r;var s=Array.isArray(n);return s===Array.isArray(e)?s?o.arrayMerge(e,n,o):a(e,n,o):r(n,o)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return l(e,n,t)}),{})};var c=l;e.exports=c},17837:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.attributeNames=t.elementNames=void 0,t.elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((function(e){return[e.toLowerCase(),e]}))),t.attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((function(e){return[e.toLowerCase(),e]})))},97220:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.render=void 0;var a=s(n(99960)),l=n(45863),c=n(17837),u=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function d(e){return e.replace(/"/g,""")}var p=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function h(e,t){void 0===t&&(t={});for(var n=("length"in e?e:[e]),r="",i=0;i<n.length;i++)r+=f(n[i],t);return r}function f(e,t){switch(e.type){case a.Root:return h(e.children,t);case a.Doctype:case a.Directive:return"<".concat(e.data,">");case a.Comment:return function(e){return"\x3c!--".concat(e.data,"--\x3e")}(e);case a.CDATA:return function(e){return"<![CDATA[".concat(e.children[0].data,"]]>")}(e);case a.Script:case a.Style:case a.Tag:return function(e,t){var n;"foreign"===t.xmlMode&&(e.name=null!==(n=c.elementNames.get(e.name))&&void 0!==n?n:e.name,e.parent&&m.has(e.parent.name)&&(t=r(r({},t),{xmlMode:!1})));!t.xmlMode&&g.has(e.name)&&(t=r(r({},t),{xmlMode:"foreign"}));var i="<".concat(e.name),o=function(e,t){var n;if(e){var r=!1===(null!==(n=t.encodeEntities)&&void 0!==n?n:t.decodeEntities)?d:t.xmlMode||"utf8"!==t.encodeEntities?l.encodeXML:l.escapeAttribute;return Object.keys(e).map((function(n){var i,o,s=null!==(i=e[n])&&void 0!==i?i:"";return"foreign"===t.xmlMode&&(n=null!==(o=c.attributeNames.get(n))&&void 0!==o?o:n),t.emptyAttrs||t.xmlMode||""!==s?"".concat(n,'="').concat(r(s),'"'):n})).join(" ")}}(e.attribs,t);o&&(i+=" ".concat(o));0===e.children.length&&(t.xmlMode?!1!==t.selfClosingTags:t.selfClosingTags&&p.has(e.name))?(t.xmlMode||(i+=" "),i+="/>"):(i+=">",e.children.length>0&&(i+=h(e.children,t)),!t.xmlMode&&p.has(e.name)||(i+="</".concat(e.name,">")));return i}(e,t);case a.Text:return function(e,t){var n,r=e.data||"";!1===(null!==(n=t.encodeEntities)&&void 0!==n?n:t.decodeEntities)||!t.xmlMode&&e.parent&&u.has(e.parent.name)||(r=t.xmlMode||"utf8"!==t.encodeEntities?(0,l.encodeXML)(r):(0,l.escapeText)(r));return r}(e,t)}}t.render=h,t.default=h;var m=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),g=new Set(["svg","math"])},99960:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},47915:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var o=n(99960),s=n(97790);i(n(97790),t);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function e(e,t,n){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=a),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:a,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?o.ElementType.Tag:void 0,r=new s.Element(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===o.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new s.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment)this.lastNode.data+=e;else{var t=new s.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new s.Text(""),t=new s.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new s.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=l,t.default=l},97790:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.cloneNode=t.hasChildren=t.isDocument=t.isDirective=t.isComment=t.isText=t.isCDATA=t.isTag=t.Element=t.Document=t.CDATA=t.NodeWithChildren=t.ProcessingInstruction=t.Comment=t.Text=t.DataNode=t.Node=void 0;var s=n(99960),a=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return void 0===e&&(e=!1),S(this,e)},e}();t.Node=a;var l=function(e){function t(t){var n=e.call(this)||this;return n.data=t,n}return i(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),t}(a);t.DataNode=l;var c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.Text,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(l);t.Text=c;var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.Comment,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(l);t.Comment=u;var d=function(e){function t(t,n){var r=e.call(this,n)||this;return r.name=t,r.type=s.ElementType.Directive,r}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(l);t.ProcessingInstruction=d;var p=function(e){function t(t){var n=e.call(this)||this;return n.children=t,n}return i(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(a);t.NodeWithChildren=p;var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.CDATA,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(p);t.CDATA=h;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.Root,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(p);t.Document=f;var m=function(e){function t(t,n,r,i){void 0===r&&(r=[]),void 0===i&&(i="script"===t?s.ElementType.Script:"style"===t?s.ElementType.Style:s.ElementType.Tag);var o=e.call(this,r)||this;return o.name=t,o.attribs=n,o.type=i,o}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(p);function g(e){return(0,s.isTag)(e)}function b(e){return e.type===s.ElementType.CDATA}function y(e){return e.type===s.ElementType.Text}function v(e){return e.type===s.ElementType.Comment}function w(e){return e.type===s.ElementType.Directive}function x(e){return e.type===s.ElementType.Root}function S(e,t){var n;if(void 0===t&&(t=!1),y(e))n=new c(e.data);else if(v(e))n=new u(e.data);else if(g(e)){var r=t?E(e.children):[],i=new m(e.name,o({},e.attribs),r);r.forEach((function(e){return e.parent=i})),null!=e.namespace&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]=o({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]=o({},e["x-attribsPrefix"])),n=i}else if(b(e)){r=t?E(e.children):[];var s=new h(r);r.forEach((function(e){return e.parent=s})),n=s}else if(x(e)){r=t?E(e.children):[];var a=new f(r);r.forEach((function(e){return e.parent=a})),e["x-mode"]&&(a["x-mode"]=e["x-mode"]),n=a}else{if(!w(e))throw new Error("Not implemented yet: ".concat(e.type));var l=new d(e.name,e.data);null!=e["x-name"]&&(l["x-name"]=e["x-name"],l["x-publicId"]=e["x-publicId"],l["x-systemId"]=e["x-systemId"]),n=l}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function E(e){for(var t=e.map((function(e){return S(e,!0)})),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}t.Element=m,t.isTag=g,t.isCDATA=b,t.isText=y,t.isComment=v,t.isDirective=w,t.isDocument=x,t.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")},t.cloneNode=S},16996:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFeed=void 0;var r=n(43346),i=n(23905);t.getFeed=function(e){var t=l(d,e);return t?"feed"===t.name?function(e){var t,n=e.children,r={type:"atom",items:(0,i.getElementsByTagName)("entry",n).map((function(e){var t,n=e.children,r={media:a(n)};u(r,"id","id",n),u(r,"title","title",n);var i=null===(t=l("link",n))||void 0===t?void 0:t.attribs.href;i&&(r.link=i);var o=c("summary",n)||c("content",n);o&&(r.description=o);var s=c("updated",n);return s&&(r.pubDate=new Date(s)),r}))};u(r,"id","id",n),u(r,"title","title",n);var o=null===(t=l("link",n))||void 0===t?void 0:t.attribs.href;o&&(r.link=o);u(r,"description","subtitle",n);var s=c("updated",n);s&&(r.updated=new Date(s));return u(r,"author","email",n,!0),r}(t):function(e){var t,n,r=null!==(n=null===(t=l("channel",e.children))||void 0===t?void 0:t.children)&&void 0!==n?n:[],o={type:e.name.substr(0,3),id:"",items:(0,i.getElementsByTagName)("item",e.children).map((function(e){var t=e.children,n={media:a(t)};u(n,"id","guid",t),u(n,"title","title",t),u(n,"link","link",t),u(n,"description","description",t);var r=c("pubDate",t)||c("dc:date",t);return r&&(n.pubDate=new Date(r)),n}))};u(o,"title","title",r),u(o,"link","link",r),u(o,"description","description",r);var s=c("lastBuildDate",r);s&&(o.updated=new Date(s));return u(o,"author","managingEditor",r,!0),o}(t):null};var o=["url","type","lang"],s=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function a(e){return(0,i.getElementsByTagName)("media:content",e).map((function(e){for(var t=e.attribs,n={medium:t.medium,isDefault:!!t.isDefault},r=0,i=o;r<i.length;r++){t[c=i[r]]&&(n[c]=t[c])}for(var a=0,l=s;a<l.length;a++){var c;t[c=l[a]]&&(n[c]=parseInt(t[c],10))}return t.expression&&(n.expression=t.expression),n}))}function l(e,t){return(0,i.getElementsByTagName)(e,t,!0,1)[0]}function c(e,t,n){return void 0===n&&(n=!1),(0,r.textContent)((0,i.getElementsByTagName)(e,t,n,1)).trim()}function u(e,t,n,r,i){void 0===i&&(i=!1);var o=c(n,r,i);o&&(e[t]=o)}function d(e){return"rss"===e||"feed"===e||"rdf:RDF"===e}},74975:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uniqueSort=t.compareDocumentPosition=t.DocumentPosition=t.removeSubsets=void 0;var r,i=n(47915);function o(e,t){var n=[],o=[];if(e===t)return 0;for(var s=(0,i.hasChildren)(e)?e:e.parent;s;)n.unshift(s),s=s.parent;for(s=(0,i.hasChildren)(t)?t:t.parent;s;)o.unshift(s),s=s.parent;for(var a=Math.min(n.length,o.length),l=0;l<a&&n[l]===o[l];)l++;if(0===l)return r.DISCONNECTED;var c=n[l-1],u=c.children,d=n[l],p=o[l];return u.indexOf(d)>u.indexOf(p)?c===t?r.FOLLOWING|r.CONTAINED_BY:r.FOLLOWING:c===e?r.PRECEDING|r.CONTAINS:r.PRECEDING}t.removeSubsets=function(e){for(var t=e.length;--t>=0;){var n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0)e.splice(t,1);else for(var r=n.parent;r;r=r.parent)if(e.includes(r)){e.splice(t,1);break}}return e},function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"}(r=t.DocumentPosition||(t.DocumentPosition={})),t.compareDocumentPosition=o,t.uniqueSort=function(e){return(e=e.filter((function(e,t,n){return!n.includes(e,t+1)}))).sort((function(e,t){var n=o(e,t);return n&r.PRECEDING?-1:n&r.FOLLOWING?1:0})),e}},89432:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasChildren=t.isDocument=t.isComment=t.isText=t.isCDATA=t.isTag=void 0,i(n(43346),t),i(n(85010),t),i(n(26765),t),i(n(98043),t),i(n(23905),t),i(n(74975),t),i(n(16996),t);var o=n(47915);Object.defineProperty(t,"isTag",{enumerable:!0,get:function(){return o.isTag}}),Object.defineProperty(t,"isCDATA",{enumerable:!0,get:function(){return o.isCDATA}}),Object.defineProperty(t,"isText",{enumerable:!0,get:function(){return o.isText}}),Object.defineProperty(t,"isComment",{enumerable:!0,get:function(){return o.isComment}}),Object.defineProperty(t,"isDocument",{enumerable:!0,get:function(){return o.isDocument}}),Object.defineProperty(t,"hasChildren",{enumerable:!0,get:function(){return o.hasChildren}})},23905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getElementsByTagType=t.getElementsByTagName=t.getElementById=t.getElements=t.testElement=void 0;var r=n(47915),i=n(98043),o={tag_name:function(e){return"function"==typeof e?function(t){return(0,r.isTag)(t)&&e(t.name)}:"*"===e?r.isTag:function(t){return(0,r.isTag)(t)&&t.name===e}},tag_type:function(e){return"function"==typeof e?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return"function"==typeof e?function(t){return(0,r.isText)(t)&&e(t.data)}:function(t){return(0,r.isText)(t)&&t.data===e}}};function s(e,t){return"function"==typeof t?function(n){return(0,r.isTag)(n)&&t(n.attribs[e])}:function(n){return(0,r.isTag)(n)&&n.attribs[e]===t}}function a(e,t){return function(n){return e(n)||t(n)}}function l(e){var t=Object.keys(e).map((function(t){var n=e[t];return Object.prototype.hasOwnProperty.call(o,t)?o[t](n):s(t,n)}));return 0===t.length?null:t.reduce(a)}t.testElement=function(e,t){var n=l(e);return!n||n(t)},t.getElements=function(e,t,n,r){void 0===r&&(r=1/0);var o=l(e);return o?(0,i.filter)(o,t,n,r):[]},t.getElementById=function(e,t,n){return void 0===n&&(n=!0),Array.isArray(t)||(t=[t]),(0,i.findOne)(s("id",e),t,n)},t.getElementsByTagName=function(e,t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=1/0),(0,i.filter)(o.tag_name(e),t,n,r)},t.getElementsByTagType=function(e,t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=1/0),(0,i.filter)(o.tag_type(e),t,n,r)}},26765:(e,t)=>{"use strict";function n(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children,n=t.lastIndexOf(e);n>=0&&t.splice(n,1)}e.next=null,e.prev=null,e.parent=null}Object.defineProperty(t,"__esModule",{value:!0}),t.prepend=t.prependChild=t.append=t.appendChild=t.replaceElement=t.removeElement=void 0,t.removeElement=n,t.replaceElement=function(e,t){var n=t.prev=e.prev;n&&(n.next=t);var r=t.next=e.next;r&&(r.prev=t);var i=t.parent=e.parent;if(i){var o=i.children;o[o.lastIndexOf(e)]=t,e.parent=null}},t.appendChild=function(e,t){if(n(t),t.next=null,t.parent=e,e.children.push(t)>1){var r=e.children[e.children.length-2];r.next=t,t.prev=r}else t.prev=null},t.append=function(e,t){n(t);var r=e.parent,i=e.next;if(t.next=i,t.prev=e,e.next=t,t.parent=r,i){if(i.prev=t,r){var o=r.children;o.splice(o.lastIndexOf(i),0,t)}}else r&&r.children.push(t)},t.prependChild=function(e,t){if(n(t),t.parent=e,t.prev=null,1!==e.children.unshift(t)){var r=e.children[1];r.prev=t,t.next=r}else t.next=null},t.prepend=function(e,t){n(t);var r=e.parent;if(r){var i=r.children;i.splice(i.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=r,t.prev=e.prev,t.next=e,e.prev=t}},98043:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAll=t.existsOne=t.findOne=t.findOneChild=t.find=t.filter=void 0;var r=n(47915);function i(e,t,n,i){for(var o=[],s=[t],a=[0];;)if(a[0]>=s[0].length){if(1===a.length)return o;s.shift(),a.shift()}else{var l=s[0][a[0]++];if(e(l)&&(o.push(l),--i<=0))return o;n&&(0,r.hasChildren)(l)&&l.children.length>0&&(a.unshift(0),s.unshift(l.children))}}t.filter=function(e,t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=1/0),i(e,Array.isArray(t)?t:[t],n,r)},t.find=i,t.findOneChild=function(e,t){return t.find(e)},t.findOne=function e(t,n,i){void 0===i&&(i=!0);for(var o=null,s=0;s<n.length&&!o;s++){var a=n[s];(0,r.isTag)(a)&&(t(a)?o=a:i&&a.children.length>0&&(o=e(t,a.children,!0)))}return o},t.existsOne=function e(t,n){return n.some((function(n){return(0,r.isTag)(n)&&(t(n)||e(t,n.children))}))},t.findAll=function(e,t){for(var n=[],i=[t],o=[0];;)if(o[0]>=i[0].length){if(1===i.length)return n;i.shift(),o.shift()}else{var s=i[0][o[0]++];(0,r.isTag)(s)&&(e(s)&&n.push(s),s.children.length>0&&(o.unshift(0),i.unshift(s.children)))}}},43346:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.innerText=t.textContent=t.getText=t.getInnerHTML=t.getOuterHTML=void 0;var i=n(47915),o=r(n(97220)),s=n(99960);function a(e,t){return(0,o.default)(e,t)}t.getOuterHTML=a,t.getInnerHTML=function(e,t){return(0,i.hasChildren)(e)?e.children.map((function(e){return a(e,t)})).join(""):""},t.getText=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,i.isTag)(t)?"br"===t.name?"\n":e(t.children):(0,i.isCDATA)(t)?e(t.children):(0,i.isText)(t)?t.data:""},t.textContent=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,i.hasChildren)(t)&&!(0,i.isComment)(t)?e(t.children):(0,i.isText)(t)?t.data:""},t.innerText=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,i.hasChildren)(t)&&(t.type===s.ElementType.Tag||(0,i.isCDATA)(t))?e(t.children):(0,i.isText)(t)?t.data:""}},85010:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prevElementSibling=t.nextElementSibling=t.getName=t.hasAttrib=t.getAttributeValue=t.getSiblings=t.getParent=t.getChildren=void 0;var r=n(47915);function i(e){return(0,r.hasChildren)(e)?e.children:[]}function o(e){return e.parent||null}t.getChildren=i,t.getParent=o,t.getSiblings=function(e){var t=o(e);if(null!=t)return i(t);for(var n=[e],r=e.prev,s=e.next;null!=r;)n.unshift(r),r=r.prev;for(;null!=s;)n.push(s),s=s.next;return n},t.getAttributeValue=function(e,t){var n;return null===(n=e.attribs)||void 0===n?void 0:n[t]},t.hasAttrib=function(e,t){return null!=e.attribs&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&null!=e.attribs[t]},t.getName=function(e){return e.name},t.nextElementSibling=function(e){for(var t=e.next;null!==t&&!(0,r.isTag)(t);)t=t.next;return t},t.prevElementSibling=function(e){for(var t=e.prev;null!==t&&!(0,r.isTag)(t);)t=t.prev;return t}},44076:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXML=t.decodeHTMLStrict=t.decodeHTMLAttribute=t.decodeHTML=t.determineBranch=t.EntityDecoder=t.DecodingMode=t.BinTrieFlags=t.fromCodePoint=t.replaceCodePoint=t.decodeCodePoint=t.xmlDecodeTree=t.htmlDecodeTree=void 0;var a=s(n(63704));t.htmlDecodeTree=a.default;var l=s(n(22060));t.xmlDecodeTree=l.default;var c=o(n(26));t.decodeCodePoint=c.default;var u,d=n(26);Object.defineProperty(t,"replaceCodePoint",{enumerable:!0,get:function(){return d.replaceCodePoint}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return d.fromCodePoint}}),function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"}(u||(u={}));var p,h,f;function m(e){return e>=u.ZERO&&e<=u.NINE}function g(e){return e===u.EQUALS||function(e){return e>=u.UPPER_A&&e<=u.UPPER_Z||e>=u.LOWER_A&&e<=u.LOWER_Z||m(e)}(e)}!function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(p=t.BinTrieFlags||(t.BinTrieFlags={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(h||(h={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(f=t.DecodingMode||(t.DecodingMode={}));var b=function(){function e(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=h.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=f.Strict}return e.prototype.startEntity=function(e){this.decodeMode=e,this.state=h.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},e.prototype.write=function(e,t){switch(this.state){case h.EntityStart:return e.charCodeAt(t)===u.NUM?(this.state=h.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=h.NamedEntity,this.stateNamedEntity(e,t));case h.NumericStart:return this.stateNumericStart(e,t);case h.NumericDecimal:return this.stateNumericDecimal(e,t);case h.NumericHex:return this.stateNumericHex(e,t);case h.NamedEntity:return this.stateNamedEntity(e,t)}},e.prototype.stateNumericStart=function(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===u.LOWER_X?(this.state=h.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=h.NumericDecimal,this.stateNumericDecimal(e,t))},e.prototype.addToNumericResult=function(e,t,n,r){if(t!==n){var i=n-t;this.result=this.result*Math.pow(r,i)+parseInt(e.substr(t,i),r),this.consumed+=i}},e.prototype.stateNumericHex=function(e,t){for(var n,r=t;t<e.length;){var i=e.charCodeAt(t);if(!(m(i)||(n=i,n>=u.UPPER_A&&n<=u.UPPER_F||n>=u.LOWER_A&&n<=u.LOWER_F)))return this.addToNumericResult(e,r,t,16),this.emitNumericEntity(i,3);t+=1}return this.addToNumericResult(e,r,t,16),-1},e.prototype.stateNumericDecimal=function(e,t){for(var n=t;t<e.length;){var r=e.charCodeAt(t);if(!m(r))return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2);t+=1}return this.addToNumericResult(e,n,t,10),-1},e.prototype.emitNumericEntity=function(e,t){var n;if(this.consumed<=t)return null===(n=this.errors)||void 0===n||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===u.SEMI)this.consumed+=1;else if(this.decodeMode===f.Strict)return 0;return this.emitCodePoint((0,c.replaceCodePoint)(this.result),this.consumed),this.errors&&(e!==u.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed},e.prototype.stateNamedEntity=function(e,t){for(var n=this.decodeTree,r=n[this.treeIndex],i=(r&p.VALUE_LENGTH)>>14;t<e.length;t++,this.excess++){var o=e.charCodeAt(t);if(this.treeIndex=v(n,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return 0===this.result||this.decodeMode===f.Attribute&&(0===i||g(o))?0:this.emitNotTerminatedNamedEntity();if(0!==(i=((r=n[this.treeIndex])&p.VALUE_LENGTH)>>14)){if(o===u.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==f.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1},e.prototype.emitNotTerminatedNamedEntity=function(){var e,t=this.result,n=(this.decodeTree[t]&p.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,n,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed},e.prototype.emitNamedEntityData=function(e,t,n){var r=this.decodeTree;return this.emitCodePoint(1===t?r[e]&~p.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n},e.prototype.end=function(){var e;switch(this.state){case h.NamedEntity:return 0===this.result||this.decodeMode===f.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case h.NumericDecimal:return this.emitNumericEntity(0,2);case h.NumericHex:return this.emitNumericEntity(0,3);case h.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case h.EntityStart:return 0}},e}();function y(e){var t="",n=new b(e,(function(e){return t+=(0,c.fromCodePoint)(e)}));return function(e,r){for(var i=0,o=0;(o=e.indexOf("&",o))>=0;){t+=e.slice(i,o),n.startEntity(r);var s=n.write(e,o+1);if(s<0){i=o+n.end();break}i=o+s,o=0===s?i+1:i}var a=t+e.slice(i);return t="",a}}function v(e,t,n,r){var i=(t&p.BRANCH_LENGTH)>>7,o=t&p.JUMP_TABLE;if(0===i)return 0!==o&&r===o?n:-1;if(o){var s=r-o;return s<0||s>=i?-1:e[n+s]-1}for(var a=n,l=a+i-1;a<=l;){var c=a+l>>>1,u=e[c];if(u<r)a=c+1;else{if(!(u>r))return e[c+i];l=c-1}}return-1}t.EntityDecoder=b,t.determineBranch=v;var w=y(a.default),x=y(l.default);t.decodeHTML=function(e,t){return void 0===t&&(t=f.Legacy),w(e,t)},t.decodeHTMLAttribute=function(e){return w(e,f.Attribute)},t.decodeHTMLStrict=function(e){return w(e,f.Strict)},t.decodeXML=function(e){return x(e,f.Strict)}},26:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.replaceCodePoint=t.fromCodePoint=void 0;var r=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function i(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=r.get(e))&&void 0!==t?t:e}t.fromCodePoint=null!==(n=String.fromCodePoint)&&void 0!==n?n:function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)},t.replaceCodePoint=i,t.default=function(e){return(0,t.fromCodePoint)(i(e))}},87322:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.encodeNonAsciiHTML=t.encodeHTML=void 0;var i=r(n(94021)),o=n(24625),s=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function a(e,t){for(var n,r="",s=0;null!==(n=e.exec(t));){var a=n.index;r+=t.substring(s,a);var l=t.charCodeAt(a),c=i.default.get(l);if("object"==typeof c){if(a+1<t.length){var u=t.charCodeAt(a+1),d="number"==typeof c.n?c.n===u?c.o:void 0:c.n.get(u);if(void 0!==d){r+=d,s=e.lastIndex+=1;continue}}c=c.v}if(void 0!==c)r+=c,s=a+1;else{var p=(0,o.getCodePoint)(t,a);r+="&#x".concat(p.toString(16),";"),s=e.lastIndex+=Number(p!==l)}}return r+t.substr(s)}t.encodeHTML=function(e){return a(s,e)},t.encodeNonAsciiHTML=function(e){return a(o.xmlReplacer,e)}},24625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.getCodePoint=t.xmlReplacer=void 0,t.xmlReplacer=/["&'<>$\x80-\uFFFF]/g;var n=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);function r(e){for(var r,i="",o=0;null!==(r=t.xmlReplacer.exec(e));){var s=r.index,a=e.charCodeAt(s),l=n.get(a);void 0!==l?(i+=e.substring(o,s)+l,o=s+1):(i+="".concat(e.substring(o,s),"&#x").concat((0,t.getCodePoint)(e,s).toString(16),";"),o=t.xmlReplacer.lastIndex+=Number(55296==(64512&a)))}return i+e.substr(o)}function i(e,t){return function(n){for(var r,i=0,o="";r=e.exec(n);)i!==r.index&&(o+=n.substring(i,r.index)),o+=t.get(r[0].charCodeAt(0)),i=r.index+1;return o+n.substring(i)}}t.getCodePoint=null!=String.prototype.codePointAt?function(e,t){return e.codePointAt(t)}:function(e,t){return 55296==(64512&e.charCodeAt(t))?1024*(e.charCodeAt(t)-55296)+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t)},t.encodeXML=r,t.escape=r,t.escapeUTF8=i(/[&<>'"]/g,n),t.escapeAttribute=i(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),t.escapeText=i(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]))},63704:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Uint16Array('\u1d41<\xd5\u0131\u028a\u049d\u057b\u05d0\u0675\u06de\u07a2\u07d6\u080f\u0a4a\u0a91\u0da1\u0e6d\u0f09\u0f26\u10ca\u1228\u12e1\u1415\u149d\u14c3\u14df\u1525\0\0\0\0\0\0\u156b\u16cd\u198d\u1c12\u1ddd\u1f7e\u2060\u21b0\u228d\u23c0\u23fb\u2442\u2824\u2912\u2d08\u2e48\u2fce\u3016\u32ba\u3639\u37ac\u38fe\u3a28\u3a71\u3ae0\u3b2e\u0800EMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig\u803b\xc6\u40c6P\u803b&\u4026cute\u803b\xc1\u40c1reve;\u4102\u0100iyx}rc\u803b\xc2\u40c2;\u4410r;\uc000\ud835\udd04rave\u803b\xc0\u40c0pha;\u4391acr;\u4100d;\u6a53\u0100gp\x9d\xa1on;\u4104f;\uc000\ud835\udd38plyFunction;\u6061ing\u803b\xc5\u40c5\u0100cs\xbe\xc3r;\uc000\ud835\udc9cign;\u6254ilde\u803b\xc3\u40c3ml\u803b\xc4\u40c4\u0400aceforsu\xe5\xfb\xfe\u0117\u011c\u0122\u0127\u012a\u0100cr\xea\xf2kslash;\u6216\u0176\xf6\xf8;\u6ae7ed;\u6306y;\u4411\u0180crt\u0105\u010b\u0114ause;\u6235noullis;\u612ca;\u4392r;\uc000\ud835\udd05pf;\uc000\ud835\udd39eve;\u42d8c\xf2\u0113mpeq;\u624e\u0700HOacdefhilorsu\u014d\u0151\u0156\u0180\u019e\u01a2\u01b5\u01b7\u01ba\u01dc\u0215\u0273\u0278\u027ecy;\u4427PY\u803b\xa9\u40a9\u0180cpy\u015d\u0162\u017aute;\u4106\u0100;i\u0167\u0168\u62d2talDifferentialD;\u6145leys;\u612d\u0200aeio\u0189\u018e\u0194\u0198ron;\u410cdil\u803b\xc7\u40c7rc;\u4108nint;\u6230ot;\u410a\u0100dn\u01a7\u01adilla;\u40b8terDot;\u40b7\xf2\u017fi;\u43a7rcle\u0200DMPT\u01c7\u01cb\u01d1\u01d6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01e2\u01f8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020foubleQuote;\u601duote;\u6019\u0200lnpu\u021e\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6a74\u0180git\u022f\u0236\u023aruent;\u6261nt;\u622fourIntegral;\u622e\u0100fr\u024c\u024e;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6a2fcr;\uc000\ud835\udc9ep\u0100;C\u0284\u0285\u62d3ap;\u624d\u0580DJSZacefios\u02a0\u02ac\u02b0\u02b4\u02b8\u02cb\u02d7\u02e1\u02e6\u0333\u048d\u0100;o\u0179\u02a5trahd;\u6911cy;\u4402cy;\u4405cy;\u440f\u0180grs\u02bf\u02c4\u02c7ger;\u6021r;\u61a1hv;\u6ae4\u0100ay\u02d0\u02d5ron;\u410e;\u4414l\u0100;t\u02dd\u02de\u6207a;\u4394r;\uc000\ud835\udd07\u0100af\u02eb\u0327\u0100cm\u02f0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031ccute;\u40b4o\u0174\u030b\u030d;\u42d9bleAcute;\u42ddrave;\u4060ilde;\u42dcond;\u62c4ferentialD;\u6146\u0470\u033d\0\0\0\u0342\u0354\0\u0405f;\uc000\ud835\udd3b\u0180;DE\u0348\u0349\u034d\u40a8ot;\u60dcqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03cf\u03e2\u03f8ontourIntegra\xec\u0239o\u0274\u0379\0\0\u037b\xbb\u0349nArrow;\u61d3\u0100eo\u0387\u03a4ft\u0180ART\u0390\u0396\u03a1rrow;\u61d0ightArrow;\u61d4e\xe5\u02cang\u0100LR\u03ab\u03c4eft\u0100AR\u03b3\u03b9rrow;\u67f8ightArrow;\u67faightArrow;\u67f9ight\u0100AT\u03d8\u03derrow;\u61d2ee;\u62a8p\u0241\u03e9\0\0\u03efrrow;\u61d1ownArrow;\u61d5erticalBar;\u6225n\u0300ABLRTa\u0412\u042a\u0430\u045e\u047f\u037crrow\u0180;BU\u041d\u041e\u0422\u6193ar;\u6913pArrow;\u61f5reve;\u4311eft\u02d2\u043a\0\u0446\0\u0450ightVector;\u6950eeVector;\u695eector\u0100;B\u0459\u045a\u61bdar;\u6956ight\u01d4\u0467\0\u0471eeVector;\u695fector\u0100;B\u047a\u047b\u61c1ar;\u6957ee\u0100;A\u0486\u0487\u62a4rrow;\u61a7\u0100ct\u0492\u0497r;\uc000\ud835\udc9frok;\u4110\u0800NTacdfglmopqstux\u04bd\u04c0\u04c4\u04cb\u04de\u04e2\u04e7\u04ee\u04f5\u0521\u052f\u0536\u0552\u055d\u0560\u0565G;\u414aH\u803b\xd0\u40d0cute\u803b\xc9\u40c9\u0180aiy\u04d2\u04d7\u04dcron;\u411arc\u803b\xca\u40ca;\u442dot;\u4116r;\uc000\ud835\udd08rave\u803b\xc8\u40c8ement;\u6208\u0100ap\u04fa\u04fecr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65fberySmallSquare;\u65ab\u0100gp\u0526\u052aon;\u4118f;\uc000\ud835\udd3csilon;\u4395u\u0100ai\u053c\u0549l\u0100;T\u0542\u0543\u6a75ilde;\u6242librium;\u61cc\u0100ci\u0557\u055ar;\u6130m;\u6a73a;\u4397ml\u803b\xcb\u40cb\u0100ip\u056a\u056fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058d\u05b2\u05ccy;\u4424r;\uc000\ud835\udd09lled\u0253\u0597\0\0\u05a3mallSquare;\u65fcerySmallSquare;\u65aa\u0370\u05ba\0\u05bf\0\0\u05c4f;\uc000\ud835\udd3dAll;\u6200riertrf;\u6131c\xf2\u05cb\u0600JTabcdfgorst\u05e8\u05ec\u05ef\u05fa\u0600\u0612\u0616\u061b\u061d\u0623\u066c\u0672cy;\u4403\u803b>\u403emma\u0100;d\u05f7\u05f8\u4393;\u43dcreve;\u411e\u0180eiy\u0607\u060c\u0610dil;\u4122rc;\u411c;\u4413ot;\u4120r;\uc000\ud835\udd0a;\u62d9pf;\uc000\ud835\udd3eeater\u0300EFGLST\u0635\u0644\u064e\u0656\u065b\u0666qual\u0100;L\u063e\u063f\u6265ess;\u62dbullEqual;\u6267reater;\u6aa2ess;\u6277lantEqual;\u6a7eilde;\u6273cr;\uc000\ud835\udca2;\u626b\u0400Aacfiosu\u0685\u068b\u0696\u069b\u069e\u06aa\u06be\u06caRDcy;\u442a\u0100ct\u0690\u0694ek;\u42c7;\u405eirc;\u4124r;\u610clbertSpace;\u610b\u01f0\u06af\0\u06b2f;\u610dizontalLine;\u6500\u0100ct\u06c3\u06c5\xf2\u06a9rok;\u4126mp\u0144\u06d0\u06d8ownHum\xf0\u012fqual;\u624f\u0700EJOacdfgmnostu\u06fa\u06fe\u0703\u0707\u070e\u071a\u071e\u0721\u0728\u0744\u0778\u078b\u078f\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803b\xcd\u40cd\u0100iy\u0713\u0718rc\u803b\xce\u40ce;\u4418ot;\u4130r;\u6111rave\u803b\xcc\u40cc\u0180;ap\u0720\u072f\u073f\u0100cg\u0734\u0737r;\u412ainaryI;\u6148lie\xf3\u03dd\u01f4\u0749\0\u0762\u0100;e\u074d\u074e\u622c\u0100gr\u0753\u0758ral;\u622bsection;\u62c2isible\u0100CT\u076c\u0772omma;\u6063imes;\u6062\u0180gpt\u077f\u0783\u0788on;\u412ef;\uc000\ud835\udd40a;\u4399cr;\u6110ilde;\u4128\u01eb\u079a\0\u079ecy;\u4406l\u803b\xcf\u40cf\u0280cfosu\u07ac\u07b7\u07bc\u07c2\u07d0\u0100iy\u07b1\u07b5rc;\u4134;\u4419r;\uc000\ud835\udd0dpf;\uc000\ud835\udd41\u01e3\u07c7\0\u07ccr;\uc000\ud835\udca5rcy;\u4408kcy;\u4404\u0380HJacfos\u07e4\u07e8\u07ec\u07f1\u07fd\u0802\u0808cy;\u4425cy;\u440cppa;\u439a\u0100ey\u07f6\u07fbdil;\u4136;\u441ar;\uc000\ud835\udd0epf;\uc000\ud835\udd42cr;\uc000\ud835\udca6\u0580JTaceflmost\u0825\u0829\u082c\u0850\u0863\u09b3\u09b8\u09c7\u09cd\u0a37\u0a47cy;\u4409\u803b<\u403c\u0280cmnpr\u0837\u083c\u0841\u0844\u084dute;\u4139bda;\u439bg;\u67ealacetrf;\u6112r;\u619e\u0180aey\u0857\u085c\u0861ron;\u413ddil;\u413b;\u441b\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087e\u08a9\u08b1\u08e0\u08e6\u08fc\u092f\u095b\u0390\u096a\u0100nr\u0883\u088fgleBracket;\u67e8row\u0180;BR\u0899\u089a\u089e\u6190ar;\u61e4ightArrow;\u61c6eiling;\u6308o\u01f5\u08b7\0\u08c3bleBracket;\u67e6n\u01d4\u08c8\0\u08d2eeVector;\u6961ector\u0100;B\u08db\u08dc\u61c3ar;\u6959loor;\u630aight\u0100AV\u08ef\u08f5rrow;\u6194ector;\u694e\u0100er\u0901\u0917e\u0180;AV\u0909\u090a\u0910\u62a3rrow;\u61a4ector;\u695aiangle\u0180;BE\u0924\u0925\u0929\u62b2ar;\u69cfqual;\u62b4p\u0180DTV\u0937\u0942\u094cownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61bfar;\u6958ector\u0100;B\u0965\u0966\u61bcar;\u6952ight\xe1\u039cs\u0300EFGLST\u097e\u098b\u0995\u099d\u09a2\u09adqualGreater;\u62daullEqual;\u6266reater;\u6276ess;\u6aa1lantEqual;\u6a7dilde;\u6272r;\uc000\ud835\udd0f\u0100;e\u09bd\u09be\u62d8ftarrow;\u61daidot;\u413f\u0180npw\u09d4\u0a16\u0a1bg\u0200LRlr\u09de\u09f7\u0a02\u0a10eft\u0100AR\u09e6\u09ecrrow;\u67f5ightArrow;\u67f7ightArrow;\u67f6eft\u0100ar\u03b3\u0a0aight\xe1\u03bfight\xe1\u03caf;\uc000\ud835\udd43er\u0100LR\u0a22\u0a2ceftArrow;\u6199ightArrow;\u6198\u0180cht\u0a3e\u0a40\u0a42\xf2\u084c;\u61b0rok;\u4141;\u626a\u0400acefiosu\u0a5a\u0a5d\u0a60\u0a77\u0a7c\u0a85\u0a8b\u0a8ep;\u6905y;\u441c\u0100dl\u0a65\u0a6fiumSpace;\u605flintrf;\u6133r;\uc000\ud835\udd10nusPlus;\u6213pf;\uc000\ud835\udd44c\xf2\u0a76;\u439c\u0480Jacefostu\u0aa3\u0aa7\u0aad\u0ac0\u0b14\u0b19\u0d91\u0d97\u0d9ecy;\u440acute;\u4143\u0180aey\u0ab4\u0ab9\u0aberon;\u4147dil;\u4145;\u441d\u0180gsw\u0ac7\u0af0\u0b0eative\u0180MTV\u0ad3\u0adf\u0ae8ediumSpace;\u600bhi\u0100cn\u0ae6\u0ad8\xeb\u0ad9eryThi\xee\u0ad9ted\u0100GL\u0af8\u0b06reaterGreate\xf2\u0673essLes\xf3\u0a48Line;\u400ar;\uc000\ud835\udd11\u0200Bnpt\u0b22\u0b28\u0b37\u0b3areak;\u6060BreakingSpace;\u40a0f;\u6115\u0680;CDEGHLNPRSTV\u0b55\u0b56\u0b6a\u0b7c\u0ba1\u0beb\u0c04\u0c5e\u0c84\u0ca6\u0cd8\u0d61\u0d85\u6aec\u0100ou\u0b5b\u0b64ngruent;\u6262pCap;\u626doubleVerticalBar;\u6226\u0180lqx\u0b83\u0b8a\u0b9bement;\u6209ual\u0100;T\u0b92\u0b93\u6260ilde;\uc000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0bb6\u0bb7\u0bbd\u0bc9\u0bd3\u0bd8\u0be5\u626fqual;\u6271ullEqual;\uc000\u2267\u0338reater;\uc000\u226b\u0338ess;\u6279lantEqual;\uc000\u2a7e\u0338ilde;\u6275ump\u0144\u0bf2\u0bfdownHump;\uc000\u224e\u0338qual;\uc000\u224f\u0338e\u0100fs\u0c0a\u0c27tTriangle\u0180;BE\u0c1a\u0c1b\u0c21\u62eaar;\uc000\u29cf\u0338qual;\u62ecs\u0300;EGLST\u0c35\u0c36\u0c3c\u0c44\u0c4b\u0c58\u626equal;\u6270reater;\u6278ess;\uc000\u226a\u0338lantEqual;\uc000\u2a7d\u0338ilde;\u6274ested\u0100GL\u0c68\u0c79reaterGreater;\uc000\u2aa2\u0338essLess;\uc000\u2aa1\u0338recedes\u0180;ES\u0c92\u0c93\u0c9b\u6280qual;\uc000\u2aaf\u0338lantEqual;\u62e0\u0100ei\u0cab\u0cb9verseElement;\u620cghtTriangle\u0180;BE\u0ccb\u0ccc\u0cd2\u62ebar;\uc000\u29d0\u0338qual;\u62ed\u0100qu\u0cdd\u0d0cuareSu\u0100bp\u0ce8\u0cf9set\u0100;E\u0cf0\u0cf3\uc000\u228f\u0338qual;\u62e2erset\u0100;E\u0d03\u0d06\uc000\u2290\u0338qual;\u62e3\u0180bcp\u0d13\u0d24\u0d4eset\u0100;E\u0d1b\u0d1e\uc000\u2282\u20d2qual;\u6288ceeds\u0200;EST\u0d32\u0d33\u0d3b\u0d46\u6281qual;\uc000\u2ab0\u0338lantEqual;\u62e1ilde;\uc000\u227f\u0338erset\u0100;E\u0d58\u0d5b\uc000\u2283\u20d2qual;\u6289ilde\u0200;EFT\u0d6e\u0d6f\u0d75\u0d7f\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uc000\ud835\udca9ilde\u803b\xd1\u40d1;\u439d\u0700Eacdfgmoprstuv\u0dbd\u0dc2\u0dc9\u0dd5\u0ddb\u0de0\u0de7\u0dfc\u0e02\u0e20\u0e22\u0e32\u0e3f\u0e44lig;\u4152cute\u803b\xd3\u40d3\u0100iy\u0dce\u0dd3rc\u803b\xd4\u40d4;\u441eblac;\u4150r;\uc000\ud835\udd12rave\u803b\xd2\u40d2\u0180aei\u0dee\u0df2\u0df6cr;\u414cga;\u43a9cron;\u439fpf;\uc000\ud835\udd46enCurly\u0100DQ\u0e0e\u0e1aoubleQuote;\u601cuote;\u6018;\u6a54\u0100cl\u0e27\u0e2cr;\uc000\ud835\udcaaash\u803b\xd8\u40d8i\u016c\u0e37\u0e3cde\u803b\xd5\u40d5es;\u6a37ml\u803b\xd6\u40d6er\u0100BP\u0e4b\u0e60\u0100ar\u0e50\u0e53r;\u603eac\u0100ek\u0e5a\u0e5c;\u63deet;\u63b4arenthesis;\u63dc\u0480acfhilors\u0e7f\u0e87\u0e8a\u0e8f\u0e92\u0e94\u0e9d\u0eb0\u0efcrtialD;\u6202y;\u441fr;\uc000\ud835\udd13i;\u43a6;\u43a0usMinus;\u40b1\u0100ip\u0ea2\u0eadncareplan\xe5\u069df;\u6119\u0200;eio\u0eb9\u0eba\u0ee0\u0ee4\u6abbcedes\u0200;EST\u0ec8\u0ec9\u0ecf\u0eda\u627aqual;\u6aaflantEqual;\u627cilde;\u627eme;\u6033\u0100dp\u0ee9\u0eeeuct;\u620fortion\u0100;a\u0225\u0ef9l;\u621d\u0100ci\u0f01\u0f06r;\uc000\ud835\udcab;\u43a8\u0200Ufos\u0f11\u0f16\u0f1b\u0f1fOT\u803b"\u4022r;\uc000\ud835\udd14pf;\u611acr;\uc000\ud835\udcac\u0600BEacefhiorsu\u0f3e\u0f43\u0f47\u0f60\u0f73\u0fa7\u0faa\u0fad\u1096\u10a9\u10b4\u10bearr;\u6910G\u803b\xae\u40ae\u0180cnr\u0f4e\u0f53\u0f56ute;\u4154g;\u67ebr\u0100;t\u0f5c\u0f5d\u61a0l;\u6916\u0180aey\u0f67\u0f6c\u0f71ron;\u4158dil;\u4156;\u4420\u0100;v\u0f78\u0f79\u611cerse\u0100EU\u0f82\u0f99\u0100lq\u0f87\u0f8eement;\u620builibrium;\u61cbpEquilibrium;\u696fr\xbb\u0f79o;\u43a1ght\u0400ACDFTUVa\u0fc1\u0feb\u0ff3\u1022\u1028\u105b\u1087\u03d8\u0100nr\u0fc6\u0fd2gleBracket;\u67e9row\u0180;BL\u0fdc\u0fdd\u0fe1\u6192ar;\u61e5eftArrow;\u61c4eiling;\u6309o\u01f5\u0ff9\0\u1005bleBracket;\u67e7n\u01d4\u100a\0\u1014eeVector;\u695dector\u0100;B\u101d\u101e\u61c2ar;\u6955loor;\u630b\u0100er\u102d\u1043e\u0180;AV\u1035\u1036\u103c\u62a2rrow;\u61a6ector;\u695biangle\u0180;BE\u1050\u1051\u1055\u62b3ar;\u69d0qual;\u62b5p\u0180DTV\u1063\u106e\u1078ownVector;\u694feeVector;\u695cector\u0100;B\u1082\u1083\u61bear;\u6954ector\u0100;B\u1091\u1092\u61c0ar;\u6953\u0100pu\u109b\u109ef;\u611dndImplies;\u6970ightarrow;\u61db\u0100ch\u10b9\u10bcr;\u611b;\u61b1leDelayed;\u69f4\u0680HOacfhimoqstu\u10e4\u10f1\u10f7\u10fd\u1119\u111e\u1151\u1156\u1161\u1167\u11b5\u11bb\u11bf\u0100Cc\u10e9\u10eeHcy;\u4429y;\u4428FTcy;\u442ccute;\u415a\u0280;aeiy\u1108\u1109\u110e\u1113\u1117\u6abcron;\u4160dil;\u415erc;\u415c;\u4421r;\uc000\ud835\udd16ort\u0200DLRU\u112a\u1134\u113e\u1149ownArrow\xbb\u041eeftArrow\xbb\u089aightArrow\xbb\u0fddpArrow;\u6191gma;\u43a3allCircle;\u6218pf;\uc000\ud835\udd4a\u0272\u116d\0\0\u1170t;\u621aare\u0200;ISU\u117b\u117c\u1189\u11af\u65a1ntersection;\u6293u\u0100bp\u118f\u119eset\u0100;E\u1197\u1198\u628fqual;\u6291erset\u0100;E\u11a8\u11a9\u6290qual;\u6292nion;\u6294cr;\uc000\ud835\udcaear;\u62c6\u0200bcmp\u11c8\u11db\u1209\u120b\u0100;s\u11cd\u11ce\u62d0et\u0100;E\u11cd\u11d5qual;\u6286\u0100ch\u11e0\u1205eeds\u0200;EST\u11ed\u11ee\u11f4\u11ff\u627bqual;\u6ab0lantEqual;\u627dilde;\u627fTh\xe1\u0f8c;\u6211\u0180;es\u1212\u1213\u1223\u62d1rset\u0100;E\u121c\u121d\u6283qual;\u6287et\xbb\u1213\u0580HRSacfhiors\u123e\u1244\u1249\u1255\u125e\u1271\u1276\u129f\u12c2\u12c8\u12d1ORN\u803b\xde\u40deADE;\u6122\u0100Hc\u124e\u1252cy;\u440by;\u4426\u0100bu\u125a\u125c;\u4009;\u43a4\u0180aey\u1265\u126a\u126fron;\u4164dil;\u4162;\u4422r;\uc000\ud835\udd17\u0100ei\u127b\u1289\u01f2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128e\u1298kSpace;\uc000\u205f\u200aSpace;\u6009lde\u0200;EFT\u12ab\u12ac\u12b2\u12bc\u623cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uc000\ud835\udd4bipleDot;\u60db\u0100ct\u12d6\u12dbr;\uc000\ud835\udcafrok;\u4166\u0ae1\u12f7\u130e\u131a\u1326\0\u132c\u1331\0\0\0\0\0\u1338\u133d\u1377\u1385\0\u13ff\u1404\u140a\u1410\u0100cr\u12fb\u1301ute\u803b\xda\u40dar\u0100;o\u1307\u1308\u619fcir;\u6949r\u01e3\u1313\0\u1316y;\u440eve;\u416c\u0100iy\u131e\u1323rc\u803b\xdb\u40db;\u4423blac;\u4170r;\uc000\ud835\udd18rave\u803b\xd9\u40d9acr;\u416a\u0100di\u1341\u1369er\u0100BP\u1348\u135d\u0100ar\u134d\u1350r;\u405fac\u0100ek\u1357\u1359;\u63dfet;\u63b5arenthesis;\u63ddon\u0100;P\u1370\u1371\u62c3lus;\u628e\u0100gp\u137b\u137fon;\u4172f;\uc000\ud835\udd4c\u0400ADETadps\u1395\u13ae\u13b8\u13c4\u03e8\u13d2\u13d7\u13f3rrow\u0180;BD\u1150\u13a0\u13a4ar;\u6912ownArrow;\u61c5ownArrow;\u6195quilibrium;\u696eee\u0100;A\u13cb\u13cc\u62a5rrow;\u61a5own\xe1\u03f3er\u0100LR\u13de\u13e8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13f9\u13fa\u43d2on;\u43a5ing;\u416ecr;\uc000\ud835\udcb0ilde;\u4168ml\u803b\xdc\u40dc\u0480Dbcdefosv\u1427\u142c\u1430\u1433\u143e\u1485\u148a\u1490\u1496ash;\u62abar;\u6aeby;\u4412ash\u0100;l\u143b\u143c\u62a9;\u6ae6\u0100er\u1443\u1445;\u62c1\u0180bty\u144c\u1450\u147aar;\u6016\u0100;i\u144f\u1455cal\u0200BLST\u1461\u1465\u146a\u1474ar;\u6223ine;\u407ceparator;\u6758ilde;\u6240ThinSpace;\u600ar;\uc000\ud835\udd19pf;\uc000\ud835\udd4dcr;\uc000\ud835\udcb1dash;\u62aa\u0280cefos\u14a7\u14ac\u14b1\u14b6\u14bcirc;\u4174dge;\u62c0r;\uc000\ud835\udd1apf;\uc000\ud835\udd4ecr;\uc000\ud835\udcb2\u0200fios\u14cb\u14d0\u14d2\u14d8r;\uc000\ud835\udd1b;\u439epf;\uc000\ud835\udd4fcr;\uc000\ud835\udcb3\u0480AIUacfosu\u14f1\u14f5\u14f9\u14fd\u1504\u150f\u1514\u151a\u1520cy;\u442fcy;\u4407cy;\u442ecute\u803b\xdd\u40dd\u0100iy\u1509\u150drc;\u4176;\u442br;\uc000\ud835\udd1cpf;\uc000\ud835\udd50cr;\uc000\ud835\udcb4ml;\u4178\u0400Hacdefos\u1535\u1539\u153f\u154b\u154f\u155d\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417d;\u4417ot;\u417b\u01f2\u1554\0\u155boWidt\xe8\u0ad9a;\u4396r;\u6128pf;\u6124cr;\uc000\ud835\udcb5\u0be1\u1583\u158a\u1590\0\u15b0\u15b6\u15bf\0\0\0\0\u15c6\u15db\u15eb\u165f\u166d\0\u1695\u169b\u16b2\u16b9\0\u16becute\u803b\xe1\u40e1reve;\u4103\u0300;Ediuy\u159c\u159d\u15a1\u15a3\u15a8\u15ad\u623e;\uc000\u223e\u0333;\u623frc\u803b\xe2\u40e2te\u80bb\xb4\u0306;\u4430lig\u803b\xe6\u40e6\u0100;r\xb2\u15ba;\uc000\ud835\udd1erave\u803b\xe0\u40e0\u0100ep\u15ca\u15d6\u0100fp\u15cf\u15d4sym;\u6135\xe8\u15d3ha;\u43b1\u0100ap\u15dfc\u0100cl\u15e4\u15e7r;\u4101g;\u6a3f\u0264\u15f0\0\0\u160a\u0280;adsv\u15fa\u15fb\u15ff\u1601\u1607\u6227nd;\u6a55;\u6a5clope;\u6a58;\u6a5a\u0380;elmrsz\u1618\u1619\u161b\u161e\u163f\u164f\u1659\u6220;\u69a4e\xbb\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163a\u163c\u163e;\u69a8;\u69a9;\u69aa;\u69ab;\u69ac;\u69ad;\u69ae;\u69aft\u0100;v\u1645\u1646\u621fb\u0100;d\u164c\u164d\u62be;\u699d\u0100pt\u1654\u1657h;\u6222\xbb\xb9arr;\u637c\u0100gp\u1663\u1667on;\u4105f;\uc000\ud835\udd52\u0380;Eaeiop\u12c1\u167b\u167d\u1682\u1684\u1687\u168a;\u6a70cir;\u6a6f;\u624ad;\u624bs;\u4027rox\u0100;e\u12c1\u1692\xf1\u1683ing\u803b\xe5\u40e5\u0180cty\u16a1\u16a6\u16a8r;\uc000\ud835\udcb6;\u402amp\u0100;e\u12c1\u16af\xf1\u0288ilde\u803b\xe3\u40e3ml\u803b\xe4\u40e4\u0100ci\u16c2\u16c8onin\xf4\u0272nt;\u6a11\u0800Nabcdefiklnoprsu\u16ed\u16f1\u1730\u173c\u1743\u1748\u1778\u177d\u17e0\u17e6\u1839\u1850\u170d\u193d\u1948\u1970ot;\u6aed\u0100cr\u16f6\u171ek\u0200ceps\u1700\u1705\u170d\u1713ong;\u624cpsilon;\u43f6rime;\u6035im\u0100;e\u171a\u171b\u623dq;\u62cd\u0176\u1722\u1726ee;\u62bded\u0100;g\u172c\u172d\u6305e\xbb\u172drk\u0100;t\u135c\u1737brk;\u63b6\u0100oy\u1701\u1741;\u4431quo;\u601e\u0280cmprt\u1753\u175b\u1761\u1764\u1768aus\u0100;e\u010a\u0109ptyv;\u69b0s\xe9\u170cno\xf5\u0113\u0180ahw\u176f\u1771\u1773;\u43b2;\u6136een;\u626cr;\uc000\ud835\udd1fg\u0380costuvw\u178d\u179d\u17b3\u17c1\u17d5\u17db\u17de\u0180aiu\u1794\u1796\u179a\xf0\u0760rc;\u65efp\xbb\u1371\u0180dpt\u17a4\u17a8\u17adot;\u6a00lus;\u6a01imes;\u6a02\u0271\u17b9\0\0\u17becup;\u6a06ar;\u6605riangle\u0100du\u17cd\u17d2own;\u65bdp;\u65b3plus;\u6a04e\xe5\u1444\xe5\u14adarow;\u690d\u0180ako\u17ed\u1826\u1835\u0100cn\u17f2\u1823k\u0180lst\u17fa\u05ab\u1802ozenge;\u69ebriangle\u0200;dlr\u1812\u1813\u1818\u181d\u65b4own;\u65beeft;\u65c2ight;\u65b8k;\u6423\u01b1\u182b\0\u1833\u01b2\u182f\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183e\u184d\u0100;q\u1843\u1846\uc000=\u20e5uiv;\uc000\u2261\u20e5t;\u6310\u0200ptwx\u1859\u185e\u1867\u186cf;\uc000\ud835\udd53\u0100;t\u13cb\u1863om\xbb\u13cctie;\u62c8\u0600DHUVbdhmptuv\u1885\u1896\u18aa\u18bb\u18d7\u18db\u18ec\u18ff\u1905\u190a\u1910\u1921\u0200LRlr\u188e\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18a1\u18a2\u18a4\u18a6\u18a8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18b3\u18b5\u18b7\u18b9;\u655d;\u655a;\u655c;\u6559\u0380;HLRhlr\u18ca\u18cb\u18cd\u18cf\u18d1\u18d3\u18d5\u6551;\u656c;\u6563;\u6560;\u656b;\u6562;\u655fox;\u69c9\u0200LRlr\u18e4\u18e6\u18e8\u18ea;\u6555;\u6552;\u6510;\u650c\u0280;DUdu\u06bd\u18f7\u18f9\u18fb\u18fd;\u6565;\u6568;\u652c;\u6534inus;\u629flus;\u629eimes;\u62a0\u0200LRlr\u1919\u191b\u191d\u191f;\u655b;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193b\u6502;\u656a;\u6561;\u655e;\u653c;\u6524;\u651c\u0100ev\u0123\u1942bar\u803b\xa6\u40a6\u0200ceio\u1951\u1956\u195a\u1960r;\uc000\ud835\udcb7mi;\u604fm\u0100;e\u171a\u171cl\u0180;bh\u1968\u1969\u196b\u405c;\u69c5sub;\u67c8\u016c\u1974\u197el\u0100;e\u1979\u197a\u6022t\xbb\u197ap\u0180;Ee\u012f\u1985\u1987;\u6aae\u0100;q\u06dc\u06db\u0ce1\u19a7\0\u19e8\u1a11\u1a15\u1a32\0\u1a37\u1a50\0\0\u1ab4\0\0\u1ac1\0\0\u1b21\u1b2e\u1b4d\u1b52\0\u1bfd\0\u1c0c\u0180cpr\u19ad\u19b2\u19ddute;\u4107\u0300;abcds\u19bf\u19c0\u19c4\u19ca\u19d5\u19d9\u6229nd;\u6a44rcup;\u6a49\u0100au\u19cf\u19d2p;\u6a4bp;\u6a47ot;\u6a40;\uc000\u2229\ufe00\u0100eo\u19e2\u19e5t;\u6041\xee\u0693\u0200aeiu\u19f0\u19fb\u1a01\u1a05\u01f0\u19f5\0\u19f8s;\u6a4don;\u410ddil\u803b\xe7\u40e7rc;\u4109ps\u0100;s\u1a0c\u1a0d\u6a4cm;\u6a50ot;\u410b\u0180dmn\u1a1b\u1a20\u1a26il\u80bb\xb8\u01adptyv;\u69b2t\u8100\xa2;e\u1a2d\u1a2e\u40a2r\xe4\u01b2r;\uc000\ud835\udd20\u0180cei\u1a3d\u1a40\u1a4dy;\u4447ck\u0100;m\u1a47\u1a48\u6713ark\xbb\u1a48;\u43c7r\u0380;Ecefms\u1a5f\u1a60\u1a62\u1a6b\u1aa4\u1aaa\u1aae\u65cb;\u69c3\u0180;el\u1a69\u1a6a\u1a6d\u42c6q;\u6257e\u0261\u1a74\0\0\u1a88rrow\u0100lr\u1a7c\u1a81eft;\u61baight;\u61bb\u0280RSacd\u1a92\u1a94\u1a96\u1a9a\u1a9f\xbb\u0f47;\u64c8st;\u629birc;\u629aash;\u629dnint;\u6a10id;\u6aefcir;\u69c2ubs\u0100;u\u1abb\u1abc\u6663it\xbb\u1abc\u02ec\u1ac7\u1ad4\u1afa\0\u1b0aon\u0100;e\u1acd\u1ace\u403a\u0100;q\xc7\xc6\u026d\u1ad9\0\0\u1ae2a\u0100;t\u1ade\u1adf\u402c;\u4040\u0180;fl\u1ae8\u1ae9\u1aeb\u6201\xee\u1160e\u0100mx\u1af1\u1af6ent\xbb\u1ae9e\xf3\u024d\u01e7\u1afe\0\u1b07\u0100;d\u12bb\u1b02ot;\u6a6dn\xf4\u0246\u0180fry\u1b10\u1b14\u1b17;\uc000\ud835\udd54o\xe4\u0254\u8100\xa9;s\u0155\u1b1dr;\u6117\u0100ao\u1b25\u1b29rr;\u61b5ss;\u6717\u0100cu\u1b32\u1b37r;\uc000\ud835\udcb8\u0100bp\u1b3c\u1b44\u0100;e\u1b41\u1b42\u6acf;\u6ad1\u0100;e\u1b49\u1b4a\u6ad0;\u6ad2dot;\u62ef\u0380delprvw\u1b60\u1b6c\u1b77\u1b82\u1bac\u1bd4\u1bf9arr\u0100lr\u1b68\u1b6a;\u6938;\u6935\u0270\u1b72\0\0\u1b75r;\u62dec;\u62dfarr\u0100;p\u1b7f\u1b80\u61b6;\u693d\u0300;bcdos\u1b8f\u1b90\u1b96\u1ba1\u1ba5\u1ba8\u622arcap;\u6a48\u0100au\u1b9b\u1b9ep;\u6a46p;\u6a4aot;\u628dr;\u6a45;\uc000\u222a\ufe00\u0200alrv\u1bb5\u1bbf\u1bde\u1be3rr\u0100;m\u1bbc\u1bbd\u61b7;\u693cy\u0180evw\u1bc7\u1bd4\u1bd8q\u0270\u1bce\0\0\u1bd2re\xe3\u1b73u\xe3\u1b75ee;\u62ceedge;\u62cfen\u803b\xa4\u40a4earrow\u0100lr\u1bee\u1bf3eft\xbb\u1b80ight\xbb\u1bbde\xe4\u1bdd\u0100ci\u1c01\u1c07onin\xf4\u01f7nt;\u6231lcty;\u632d\u0980AHabcdefhijlorstuwz\u1c38\u1c3b\u1c3f\u1c5d\u1c69\u1c75\u1c8a\u1c9e\u1cac\u1cb7\u1cfb\u1cff\u1d0d\u1d7b\u1d91\u1dab\u1dbb\u1dc6\u1dcdr\xf2\u0381ar;\u6965\u0200glrs\u1c48\u1c4d\u1c52\u1c54ger;\u6020eth;\u6138\xf2\u1133h\u0100;v\u1c5a\u1c5b\u6010\xbb\u090a\u016b\u1c61\u1c67arow;\u690fa\xe3\u0315\u0100ay\u1c6e\u1c73ron;\u410f;\u4434\u0180;ao\u0332\u1c7c\u1c84\u0100gr\u02bf\u1c81r;\u61catseq;\u6a77\u0180glm\u1c91\u1c94\u1c98\u803b\xb0\u40b0ta;\u43b4ptyv;\u69b1\u0100ir\u1ca3\u1ca8sht;\u697f;\uc000\ud835\udd21ar\u0100lr\u1cb3\u1cb5\xbb\u08dc\xbb\u101e\u0280aegsv\u1cc2\u0378\u1cd6\u1cdc\u1ce0m\u0180;os\u0326\u1cca\u1cd4nd\u0100;s\u0326\u1cd1uit;\u6666amma;\u43ddin;\u62f2\u0180;io\u1ce7\u1ce8\u1cf8\u40f7de\u8100\xf7;o\u1ce7\u1cf0ntimes;\u62c7n\xf8\u1cf7cy;\u4452c\u026f\u1d06\0\0\u1d0arn;\u631eop;\u630d\u0280lptuw\u1d18\u1d1d\u1d22\u1d49\u1d55lar;\u4024f;\uc000\ud835\udd55\u0280;emps\u030b\u1d2d\u1d37\u1d3d\u1d42q\u0100;d\u0352\u1d33ot;\u6251inus;\u6238lus;\u6214quare;\u62a1blebarwedg\xe5\xfan\u0180adh\u112e\u1d5d\u1d67ownarrow\xf3\u1c83arpoon\u0100lr\u1d72\u1d76ef\xf4\u1cb4igh\xf4\u1cb6\u0162\u1d7f\u1d85karo\xf7\u0f42\u026f\u1d8a\0\0\u1d8ern;\u631fop;\u630c\u0180cot\u1d98\u1da3\u1da6\u0100ry\u1d9d\u1da1;\uc000\ud835\udcb9;\u4455l;\u69f6rok;\u4111\u0100dr\u1db0\u1db4ot;\u62f1i\u0100;f\u1dba\u1816\u65bf\u0100ah\u1dc0\u1dc3r\xf2\u0429a\xf2\u0fa6angle;\u69a6\u0100ci\u1dd2\u1dd5y;\u445fgrarr;\u67ff\u0900Dacdefglmnopqrstux\u1e01\u1e09\u1e19\u1e38\u0578\u1e3c\u1e49\u1e61\u1e7e\u1ea5\u1eaf\u1ebd\u1ee1\u1f2a\u1f37\u1f44\u1f4e\u1f5a\u0100Do\u1e06\u1d34o\xf4\u1c89\u0100cs\u1e0e\u1e14ute\u803b\xe9\u40e9ter;\u6a6e\u0200aioy\u1e22\u1e27\u1e31\u1e36ron;\u411br\u0100;c\u1e2d\u1e2e\u6256\u803b\xea\u40ealon;\u6255;\u444dot;\u4117\u0100Dr\u1e41\u1e45ot;\u6252;\uc000\ud835\udd22\u0180;rs\u1e50\u1e51\u1e57\u6a9aave\u803b\xe8\u40e8\u0100;d\u1e5c\u1e5d\u6a96ot;\u6a98\u0200;ils\u1e6a\u1e6b\u1e72\u1e74\u6a99nters;\u63e7;\u6113\u0100;d\u1e79\u1e7a\u6a95ot;\u6a97\u0180aps\u1e85\u1e89\u1e97cr;\u4113ty\u0180;sv\u1e92\u1e93\u1e95\u6205et\xbb\u1e93p\u01001;\u1e9d\u1ea4\u0133\u1ea1\u1ea3;\u6004;\u6005\u6003\u0100gs\u1eaa\u1eac;\u414bp;\u6002\u0100gp\u1eb4\u1eb8on;\u4119f;\uc000\ud835\udd56\u0180als\u1ec4\u1ece\u1ed2r\u0100;s\u1eca\u1ecb\u62d5l;\u69e3us;\u6a71i\u0180;lv\u1eda\u1edb\u1edf\u43b5on\xbb\u1edb;\u43f5\u0200csuv\u1eea\u1ef3\u1f0b\u1f23\u0100io\u1eef\u1e31rc\xbb\u1e2e\u0269\u1ef9\0\0\u1efb\xed\u0548ant\u0100gl\u1f02\u1f06tr\xbb\u1e5dess\xbb\u1e7a\u0180aei\u1f12\u1f16\u1f1als;\u403dst;\u625fv\u0100;D\u0235\u1f20D;\u6a78parsl;\u69e5\u0100Da\u1f2f\u1f33ot;\u6253rr;\u6971\u0180cdi\u1f3e\u1f41\u1ef8r;\u612fo\xf4\u0352\u0100ah\u1f49\u1f4b;\u43b7\u803b\xf0\u40f0\u0100mr\u1f53\u1f57l\u803b\xeb\u40ebo;\u60ac\u0180cip\u1f61\u1f64\u1f67l;\u4021s\xf4\u056e\u0100eo\u1f6c\u1f74ctatio\xee\u0559nential\xe5\u0579\u09e1\u1f92\0\u1f9e\0\u1fa1\u1fa7\0\0\u1fc6\u1fcc\0\u1fd3\0\u1fe6\u1fea\u2000\0\u2008\u205allingdotse\xf1\u1e44y;\u4444male;\u6640\u0180ilr\u1fad\u1fb3\u1fc1lig;\u8000\ufb03\u0269\u1fb9\0\0\u1fbdg;\u8000\ufb00ig;\u8000\ufb04;\uc000\ud835\udd23lig;\u8000\ufb01lig;\uc000fj\u0180alt\u1fd9\u1fdc\u1fe1t;\u666dig;\u8000\ufb02ns;\u65b1of;\u4192\u01f0\u1fee\0\u1ff3f;\uc000\ud835\udd57\u0100ak\u05bf\u1ff7\u0100;v\u1ffc\u1ffd\u62d4;\u6ad9artint;\u6a0d\u0100ao\u200c\u2055\u0100cs\u2011\u2052\u03b1\u201a\u2030\u2038\u2045\u2048\0\u2050\u03b2\u2022\u2025\u2027\u202a\u202c\0\u202e\u803b\xbd\u40bd;\u6153\u803b\xbc\u40bc;\u6155;\u6159;\u615b\u01b3\u2034\0\u2036;\u6154;\u6156\u02b4\u203e\u2041\0\0\u2043\u803b\xbe\u40be;\u6157;\u615c5;\u6158\u01b6\u204c\0\u204e;\u615a;\u615d8;\u615el;\u6044wn;\u6322cr;\uc000\ud835\udcbb\u0880Eabcdefgijlnorstv\u2082\u2089\u209f\u20a5\u20b0\u20b4\u20f0\u20f5\u20fa\u20ff\u2103\u2112\u2138\u0317\u213e\u2152\u219e\u0100;l\u064d\u2087;\u6a8c\u0180cmp\u2090\u2095\u209dute;\u41f5ma\u0100;d\u209c\u1cda\u43b3;\u6a86reve;\u411f\u0100iy\u20aa\u20aerc;\u411d;\u4433ot;\u4121\u0200;lqs\u063e\u0642\u20bd\u20c9\u0180;qs\u063e\u064c\u20c4lan\xf4\u0665\u0200;cdl\u0665\u20d2\u20d5\u20e5c;\u6aa9ot\u0100;o\u20dc\u20dd\u6a80\u0100;l\u20e2\u20e3\u6a82;\u6a84\u0100;e\u20ea\u20ed\uc000\u22db\ufe00s;\u6a94r;\uc000\ud835\udd24\u0100;g\u0673\u061bmel;\u6137cy;\u4453\u0200;Eaj\u065a\u210c\u210e\u2110;\u6a92;\u6aa5;\u6aa4\u0200Eaes\u211b\u211d\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6a8arox\xbb\u2124\u0100;q\u212e\u212f\u6a88\u0100;q\u212e\u211bim;\u62e7pf;\uc000\ud835\udd58\u0100ci\u2143\u2146r;\u610am\u0180;el\u066b\u214e\u2150;\u6a8e;\u6a90\u8300>;cdlqr\u05ee\u2160\u216a\u216e\u2173\u2179\u0100ci\u2165\u2167;\u6aa7r;\u6a7aot;\u62d7Par;\u6995uest;\u6a7c\u0280adels\u2184\u216a\u2190\u0656\u219b\u01f0\u2189\0\u218epro\xf8\u209er;\u6978q\u0100lq\u063f\u2196les\xf3\u2088i\xed\u066b\u0100en\u21a3\u21adrtneqq;\uc000\u2269\ufe00\xc5\u21aa\u0500Aabcefkosy\u21c4\u21c7\u21f1\u21f5\u21fa\u2218\u221d\u222f\u2268\u227dr\xf2\u03a0\u0200ilmr\u21d0\u21d4\u21d7\u21dbrs\xf0\u1484f\xbb\u2024il\xf4\u06a9\u0100dr\u21e0\u21e4cy;\u444a\u0180;cw\u08f4\u21eb\u21efir;\u6948;\u61adar;\u610firc;\u4125\u0180alr\u2201\u220e\u2213rts\u0100;u\u2209\u220a\u6665it\xbb\u220alip;\u6026con;\u62b9r;\uc000\ud835\udd25s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223a\u223e\u2243\u225e\u2263rr;\u61fftht;\u623bk\u0100lr\u2249\u2253eftarrow;\u61a9ightarrow;\u61aaf;\uc000\ud835\udd59bar;\u6015\u0180clt\u226f\u2274\u2278r;\uc000\ud835\udcbdas\xe8\u21f4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xbb\u1c5b\u0ae1\u22a3\0\u22aa\0\u22b8\u22c5\u22ce\0\u22d5\u22f3\0\0\u22f8\u2322\u2367\u2362\u237f\0\u2386\u23aa\u23b4cute\u803b\xed\u40ed\u0180;iy\u0771\u22b0\u22b5rc\u803b\xee\u40ee;\u4438\u0100cx\u22bc\u22bfy;\u4435cl\u803b\xa1\u40a1\u0100fr\u039f\u22c9;\uc000\ud835\udd26rave\u803b\xec\u40ec\u0200;ino\u073e\u22dd\u22e9\u22ee\u0100in\u22e2\u22e6nt;\u6a0ct;\u622dfin;\u69dcta;\u6129lig;\u4133\u0180aop\u22fe\u231a\u231d\u0180cgt\u2305\u2308\u2317r;\u412b\u0180elp\u071f\u230f\u2313in\xe5\u078ear\xf4\u0720h;\u4131f;\u62b7ed;\u41b5\u0280;cfot\u04f4\u232c\u2331\u233d\u2341are;\u6105in\u0100;t\u2338\u2339\u621eie;\u69dddo\xf4\u2319\u0280;celp\u0757\u234c\u2350\u235b\u2361al;\u62ba\u0100gr\u2355\u2359er\xf3\u1563\xe3\u234darhk;\u6a17rod;\u6a3c\u0200cgpt\u236f\u2372\u2376\u237by;\u4451on;\u412ff;\uc000\ud835\udd5aa;\u43b9uest\u803b\xbf\u40bf\u0100ci\u238a\u238fr;\uc000\ud835\udcben\u0280;Edsv\u04f4\u239b\u239d\u23a1\u04f3;\u62f9ot;\u62f5\u0100;v\u23a6\u23a7\u62f4;\u62f3\u0100;i\u0777\u23aelde;\u4129\u01eb\u23b8\0\u23bccy;\u4456l\u803b\xef\u40ef\u0300cfmosu\u23cc\u23d7\u23dc\u23e1\u23e7\u23f5\u0100iy\u23d1\u23d5rc;\u4135;\u4439r;\uc000\ud835\udd27ath;\u4237pf;\uc000\ud835\udd5b\u01e3\u23ec\0\u23f1r;\uc000\ud835\udcbfrcy;\u4458kcy;\u4454\u0400acfghjos\u240b\u2416\u2422\u2427\u242d\u2431\u2435\u243bppa\u0100;v\u2413\u2414\u43ba;\u43f0\u0100ey\u241b\u2420dil;\u4137;\u443ar;\uc000\ud835\udd28reen;\u4138cy;\u4445cy;\u445cpf;\uc000\ud835\udd5ccr;\uc000\ud835\udcc0\u0b80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248d\u2491\u250e\u253d\u255a\u2580\u264e\u265e\u2665\u2679\u267d\u269a\u26b2\u26d8\u275d\u2768\u278b\u27c0\u2801\u2812\u0180art\u2477\u247a\u247cr\xf2\u09c6\xf2\u0395ail;\u691barr;\u690e\u0100;g\u0994\u248b;\u6a8bar;\u6962\u0963\u24a5\0\u24aa\0\u24b1\0\0\0\0\0\u24b5\u24ba\0\u24c6\u24c8\u24cd\0\u24f9ute;\u413amptyv;\u69b4ra\xee\u084cbda;\u43bbg\u0180;dl\u088e\u24c1\u24c3;\u6991\xe5\u088e;\u6a85uo\u803b\xab\u40abr\u0400;bfhlpst\u0899\u24de\u24e6\u24e9\u24eb\u24ee\u24f1\u24f5\u0100;f\u089d\u24e3s;\u691fs;\u691d\xeb\u2252p;\u61abl;\u6939im;\u6973l;\u61a2\u0180;ae\u24ff\u2500\u2504\u6aabil;\u6919\u0100;s\u2509\u250a\u6aad;\uc000\u2aad\ufe00\u0180abr\u2515\u2519\u251drr;\u690crk;\u6772\u0100ak\u2522\u252cc\u0100ek\u2528\u252a;\u407b;\u405b\u0100es\u2531\u2533;\u698bl\u0100du\u2539\u253b;\u698f;\u698d\u0200aeuy\u2546\u254b\u2556\u2558ron;\u413e\u0100di\u2550\u2554il;\u413c\xec\u08b0\xe2\u2529;\u443b\u0200cqrs\u2563\u2566\u256d\u257da;\u6936uo\u0100;r\u0e19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694bh;\u61b2\u0280;fgqs\u258b\u258c\u0989\u25f3\u25ff\u6264t\u0280ahlrt\u2598\u25a4\u25b7\u25c2\u25e8rrow\u0100;t\u0899\u25a1a\xe9\u24f6arpoon\u0100du\u25af\u25b4own\xbb\u045ap\xbb\u0966eftarrows;\u61c7ight\u0180ahs\u25cd\u25d6\u25derrow\u0100;s\u08f4\u08a7arpoon\xf3\u0f98quigarro\xf7\u21f0hreetimes;\u62cb\u0180;qs\u258b\u0993\u25falan\xf4\u09ac\u0280;cdgs\u09ac\u260a\u260d\u261d\u2628c;\u6aa8ot\u0100;o\u2614\u2615\u6a7f\u0100;r\u261a\u261b\u6a81;\u6a83\u0100;e\u2622\u2625\uc000\u22da\ufe00s;\u6a93\u0280adegs\u2633\u2639\u263d\u2649\u264bppro\xf8\u24c6ot;\u62d6q\u0100gq\u2643\u2645\xf4\u0989gt\xf2\u248c\xf4\u099bi\xed\u09b2\u0180ilr\u2655\u08e1\u265asht;\u697c;\uc000\ud835\udd29\u0100;E\u099c\u2663;\u6a91\u0161\u2669\u2676r\u0100du\u25b2\u266e\u0100;l\u0965\u2673;\u696alk;\u6584cy;\u4459\u0280;acht\u0a48\u2688\u268b\u2691\u2696r\xf2\u25c1orne\xf2\u1d08ard;\u696bri;\u65fa\u0100io\u269f\u26a4dot;\u4140ust\u0100;a\u26ac\u26ad\u63b0che\xbb\u26ad\u0200Eaes\u26bb\u26bd\u26c9\u26d4;\u6268p\u0100;p\u26c3\u26c4\u6a89rox\xbb\u26c4\u0100;q\u26ce\u26cf\u6a87\u0100;q\u26ce\u26bbim;\u62e6\u0400abnoptwz\u26e9\u26f4\u26f7\u271a\u272f\u2741\u2747\u2750\u0100nr\u26ee\u26f1g;\u67ecr;\u61fdr\xeb\u08c1g\u0180lmr\u26ff\u270d\u2714eft\u0100ar\u09e6\u2707ight\xe1\u09f2apsto;\u67fcight\xe1\u09fdparrow\u0100lr\u2725\u2729ef\xf4\u24edight;\u61ac\u0180afl\u2736\u2739\u273dr;\u6985;\uc000\ud835\udd5dus;\u6a2dimes;\u6a34\u0161\u274b\u274fst;\u6217\xe1\u134e\u0180;ef\u2757\u2758\u1800\u65cange\xbb\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277c\u2785\u2787r\xf2\u08a8orne\xf2\u1d8car\u0100;d\u0f98\u2783;\u696d;\u600eri;\u62bf\u0300achiqt\u2798\u279d\u0a40\u27a2\u27ae\u27bbquo;\u6039r;\uc000\ud835\udcc1m\u0180;eg\u09b2\u27aa\u27ac;\u6a8d;\u6a8f\u0100bu\u252a\u27b3o\u0100;r\u0e1f\u27b9;\u601arok;\u4142\u8400<;cdhilqr\u082b\u27d2\u2639\u27dc\u27e0\u27e5\u27ea\u27f0\u0100ci\u27d7\u27d9;\u6aa6r;\u6a79re\xe5\u25f2mes;\u62c9arr;\u6976uest;\u6a7b\u0100Pi\u27f5\u27f9ar;\u6996\u0180;ef\u2800\u092d\u181b\u65c3r\u0100du\u2807\u280dshar;\u694ahar;\u6966\u0100en\u2817\u2821rtneqq;\uc000\u2268\ufe00\xc5\u281e\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288e\u2893\u28a0\u28a5\u28a8\u28da\u28e2\u28e4\u0a83\u28f3\u2902Dot;\u623a\u0200clpr\u284e\u2852\u2863\u287dr\u803b\xaf\u40af\u0100et\u2857\u2859;\u6642\u0100;e\u285e\u285f\u6720se\xbb\u285f\u0100;s\u103b\u2868to\u0200;dlu\u103b\u2873\u2877\u287bow\xee\u048cef\xf4\u090f\xf0\u13d1ker;\u65ae\u0100oy\u2887\u288cmma;\u6a29;\u443cash;\u6014asuredangle\xbb\u1626r;\uc000\ud835\udd2ao;\u6127\u0180cdn\u28af\u28b4\u28c9ro\u803b\xb5\u40b5\u0200;acd\u1464\u28bd\u28c0\u28c4s\xf4\u16a7ir;\u6af0ot\u80bb\xb7\u01b5us\u0180;bd\u28d2\u1903\u28d3\u6212\u0100;u\u1d3c\u28d8;\u6a2a\u0163\u28de\u28e1p;\u6adb\xf2\u2212\xf0\u0a81\u0100dp\u28e9\u28eeels;\u62a7f;\uc000\ud835\udd5e\u0100ct\u28f8\u28fdr;\uc000\ud835\udcc2pos\xbb\u159d\u0180;lm\u2909\u290a\u290d\u43bctimap;\u62b8\u0c00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297e\u2989\u2998\u29da\u29e9\u2a15\u2a1a\u2a58\u2a5d\u2a83\u2a95\u2aa4\u2aa8\u2b04\u2b07\u2b44\u2b7f\u2bae\u2c34\u2c67\u2c7c\u2ce9\u0100gt\u2947\u294b;\uc000\u22d9\u0338\u0100;v\u2950\u0bcf\uc000\u226b\u20d2\u0180elt\u295a\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61cdightarrow;\u61ce;\uc000\u22d8\u0338\u0100;v\u297b\u0c47\uc000\u226a\u20d2ightarrow;\u61cf\u0100Dd\u298e\u2993ash;\u62afash;\u62ae\u0280bcnpt\u29a3\u29a7\u29ac\u29b1\u29ccla\xbb\u02deute;\u4144g;\uc000\u2220\u20d2\u0280;Eiop\u0d84\u29bc\u29c0\u29c5\u29c8;\uc000\u2a70\u0338d;\uc000\u224b\u0338s;\u4149ro\xf8\u0d84ur\u0100;a\u29d3\u29d4\u666el\u0100;s\u29d3\u0b38\u01f3\u29df\0\u29e3p\u80bb\xa0\u0b37mp\u0100;e\u0bf9\u0c00\u0280aeouy\u29f4\u29fe\u2a03\u2a10\u2a13\u01f0\u29f9\0\u29fb;\u6a43on;\u4148dil;\u4146ng\u0100;d\u0d7e\u2a0aot;\uc000\u2a6d\u0338p;\u6a42;\u443dash;\u6013\u0380;Aadqsx\u0b92\u2a29\u2a2d\u2a3b\u2a41\u2a45\u2a50rr;\u61d7r\u0100hr\u2a33\u2a36k;\u6924\u0100;o\u13f2\u13f0ot;\uc000\u2250\u0338ui\xf6\u0b63\u0100ei\u2a4a\u2a4ear;\u6928\xed\u0b98ist\u0100;s\u0ba0\u0b9fr;\uc000\ud835\udd2b\u0200Eest\u0bc5\u2a66\u2a79\u2a7c\u0180;qs\u0bbc\u2a6d\u0be1\u0180;qs\u0bbc\u0bc5\u2a74lan\xf4\u0be2i\xed\u0bea\u0100;r\u0bb6\u2a81\xbb\u0bb7\u0180Aap\u2a8a\u2a8d\u2a91r\xf2\u2971rr;\u61aear;\u6af2\u0180;sv\u0f8d\u2a9c\u0f8c\u0100;d\u2aa1\u2aa2\u62fc;\u62facy;\u445a\u0380AEadest\u2ab7\u2aba\u2abe\u2ac2\u2ac5\u2af6\u2af9r\xf2\u2966;\uc000\u2266\u0338rr;\u619ar;\u6025\u0200;fqs\u0c3b\u2ace\u2ae3\u2aeft\u0100ar\u2ad4\u2ad9rro\xf7\u2ac1ightarro\xf7\u2a90\u0180;qs\u0c3b\u2aba\u2aealan\xf4\u0c55\u0100;s\u0c55\u2af4\xbb\u0c36i\xed\u0c5d\u0100;r\u0c35\u2afei\u0100;e\u0c1a\u0c25i\xe4\u0d90\u0100pt\u2b0c\u2b11f;\uc000\ud835\udd5f\u8180\xac;in\u2b19\u2b1a\u2b36\u40acn\u0200;Edv\u0b89\u2b24\u2b28\u2b2e;\uc000\u22f9\u0338ot;\uc000\u22f5\u0338\u01e1\u0b89\u2b33\u2b35;\u62f7;\u62f6i\u0100;v\u0cb8\u2b3c\u01e1\u0cb8\u2b41\u2b43;\u62fe;\u62fd\u0180aor\u2b4b\u2b63\u2b69r\u0200;ast\u0b7b\u2b55\u2b5a\u2b5flle\xec\u0b7bl;\uc000\u2afd\u20e5;\uc000\u2202\u0338lint;\u6a14\u0180;ce\u0c92\u2b70\u2b73u\xe5\u0ca5\u0100;c\u0c98\u2b78\u0100;e\u0c92\u2b7d\xf1\u0c98\u0200Aait\u2b88\u2b8b\u2b9d\u2ba7r\xf2\u2988rr\u0180;cw\u2b94\u2b95\u2b99\u619b;\uc000\u2933\u0338;\uc000\u219d\u0338ghtarrow\xbb\u2b95ri\u0100;e\u0ccb\u0cd6\u0380chimpqu\u2bbd\u2bcd\u2bd9\u2b04\u0b78\u2be4\u2bef\u0200;cer\u0d32\u2bc6\u0d37\u2bc9u\xe5\u0d45;\uc000\ud835\udcc3ort\u026d\u2b05\0\0\u2bd6ar\xe1\u2b56m\u0100;e\u0d6e\u2bdf\u0100;q\u0d74\u0d73su\u0100bp\u2beb\u2bed\xe5\u0cf8\xe5\u0d0b\u0180bcp\u2bf6\u2c11\u2c19\u0200;Ees\u2bff\u2c00\u0d22\u2c04\u6284;\uc000\u2ac5\u0338et\u0100;e\u0d1b\u2c0bq\u0100;q\u0d23\u2c00c\u0100;e\u0d32\u2c17\xf1\u0d38\u0200;Ees\u2c22\u2c23\u0d5f\u2c27\u6285;\uc000\u2ac6\u0338et\u0100;e\u0d58\u2c2eq\u0100;q\u0d60\u2c23\u0200gilr\u2c3d\u2c3f\u2c45\u2c47\xec\u0bd7lde\u803b\xf1\u40f1\xe7\u0c43iangle\u0100lr\u2c52\u2c5ceft\u0100;e\u0c1a\u2c5a\xf1\u0c26ight\u0100;e\u0ccb\u2c65\xf1\u0cd7\u0100;m\u2c6c\u2c6d\u43bd\u0180;es\u2c74\u2c75\u2c79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2c8f\u2c94\u2c99\u2c9e\u2ca3\u2cb0\u2cb6\u2cd3\u2ce3ash;\u62adarr;\u6904p;\uc000\u224d\u20d2ash;\u62ac\u0100et\u2ca8\u2cac;\uc000\u2265\u20d2;\uc000>\u20d2nfin;\u69de\u0180Aet\u2cbd\u2cc1\u2cc5rr;\u6902;\uc000\u2264\u20d2\u0100;r\u2cca\u2ccd\uc000<\u20d2ie;\uc000\u22b4\u20d2\u0100At\u2cd8\u2cdcrr;\u6903rie;\uc000\u22b5\u20d2im;\uc000\u223c\u20d2\u0180Aan\u2cf0\u2cf4\u2d02rr;\u61d6r\u0100hr\u2cfa\u2cfdk;\u6923\u0100;o\u13e7\u13e5ear;\u6927\u1253\u1a95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2d2d\0\u2d38\u2d48\u2d60\u2d65\u2d72\u2d84\u1b07\0\0\u2d8d\u2dab\0\u2dc8\u2dce\0\u2ddc\u2e19\u2e2b\u2e3e\u2e43\u0100cs\u2d31\u1a97ute\u803b\xf3\u40f3\u0100iy\u2d3c\u2d45r\u0100;c\u1a9e\u2d42\u803b\xf4\u40f4;\u443e\u0280abios\u1aa0\u2d52\u2d57\u01c8\u2d5alac;\u4151v;\u6a38old;\u69bclig;\u4153\u0100cr\u2d69\u2d6dir;\u69bf;\uc000\ud835\udd2c\u036f\u2d79\0\0\u2d7c\0\u2d82n;\u42dbave\u803b\xf2\u40f2;\u69c1\u0100bm\u2d88\u0df4ar;\u69b5\u0200acit\u2d95\u2d98\u2da5\u2da8r\xf2\u1a80\u0100ir\u2d9d\u2da0r;\u69beoss;\u69bbn\xe5\u0e52;\u69c0\u0180aei\u2db1\u2db5\u2db9cr;\u414dga;\u43c9\u0180cdn\u2dc0\u2dc5\u01cdron;\u43bf;\u69b6pf;\uc000\ud835\udd60\u0180ael\u2dd4\u2dd7\u01d2r;\u69b7rp;\u69b9\u0380;adiosv\u2dea\u2deb\u2dee\u2e08\u2e0d\u2e10\u2e16\u6228r\xf2\u1a86\u0200;efm\u2df7\u2df8\u2e02\u2e05\u6a5dr\u0100;o\u2dfe\u2dff\u6134f\xbb\u2dff\u803b\xaa\u40aa\u803b\xba\u40bagof;\u62b6r;\u6a56lope;\u6a57;\u6a5b\u0180clo\u2e1f\u2e21\u2e27\xf2\u2e01ash\u803b\xf8\u40f8l;\u6298i\u016c\u2e2f\u2e34de\u803b\xf5\u40f5es\u0100;a\u01db\u2e3as;\u6a36ml\u803b\xf6\u40f6bar;\u633d\u0ae1\u2e5e\0\u2e7d\0\u2e80\u2e9d\0\u2ea2\u2eb9\0\0\u2ecb\u0e9c\0\u2f13\0\0\u2f2b\u2fbc\0\u2fc8r\u0200;ast\u0403\u2e67\u2e72\u0e85\u8100\xb6;l\u2e6d\u2e6e\u40b6le\xec\u0403\u0269\u2e78\0\0\u2e7bm;\u6af3;\u6afdy;\u443fr\u0280cimpt\u2e8b\u2e8f\u2e93\u1865\u2e97nt;\u4025od;\u402eil;\u6030enk;\u6031r;\uc000\ud835\udd2d\u0180imo\u2ea8\u2eb0\u2eb4\u0100;v\u2ead\u2eae\u43c6;\u43d5ma\xf4\u0a76ne;\u660e\u0180;tv\u2ebf\u2ec0\u2ec8\u43c0chfork\xbb\u1ffd;\u43d6\u0100au\u2ecf\u2edfn\u0100ck\u2ed5\u2eddk\u0100;h\u21f4\u2edb;\u610e\xf6\u21f4s\u0480;abcdemst\u2ef3\u2ef4\u1908\u2ef9\u2efd\u2f04\u2f06\u2f0a\u2f0e\u402bcir;\u6a23ir;\u6a22\u0100ou\u1d40\u2f02;\u6a25;\u6a72n\u80bb\xb1\u0e9dim;\u6a26wo;\u6a27\u0180ipu\u2f19\u2f20\u2f25ntint;\u6a15f;\uc000\ud835\udd61nd\u803b\xa3\u40a3\u0500;Eaceinosu\u0ec8\u2f3f\u2f41\u2f44\u2f47\u2f81\u2f89\u2f92\u2f7e\u2fb6;\u6ab3p;\u6ab7u\xe5\u0ed9\u0100;c\u0ece\u2f4c\u0300;acens\u0ec8\u2f59\u2f5f\u2f66\u2f68\u2f7eppro\xf8\u2f43urlye\xf1\u0ed9\xf1\u0ece\u0180aes\u2f6f\u2f76\u2f7approx;\u6ab9qq;\u6ab5im;\u62e8i\xed\u0edfme\u0100;s\u2f88\u0eae\u6032\u0180Eas\u2f78\u2f90\u2f7a\xf0\u2f75\u0180dfp\u0eec\u2f99\u2faf\u0180als\u2fa0\u2fa5\u2faalar;\u632eine;\u6312urf;\u6313\u0100;t\u0efb\u2fb4\xef\u0efbrel;\u62b0\u0100ci\u2fc0\u2fc5r;\uc000\ud835\udcc5;\u43c8ncsp;\u6008\u0300fiopsu\u2fda\u22e2\u2fdf\u2fe5\u2feb\u2ff1r;\uc000\ud835\udd2epf;\uc000\ud835\udd62rime;\u6057cr;\uc000\ud835\udcc6\u0180aeo\u2ff8\u3009\u3013t\u0100ei\u2ffe\u3005rnion\xf3\u06b0nt;\u6a16st\u0100;e\u3010\u3011\u403f\xf1\u1f19\xf4\u0f14\u0a80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30e0\u310e\u312b\u3147\u3162\u3172\u318e\u3206\u3215\u3224\u3229\u3258\u326e\u3272\u3290\u32b0\u32b7\u0180art\u3047\u304a\u304cr\xf2\u10b3\xf2\u03ddail;\u691car\xf2\u1c65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307f\u308f\u3094\u30cc\u0100eu\u306d\u3071;\uc000\u223d\u0331te;\u4155i\xe3\u116emptyv;\u69b3g\u0200;del\u0fd1\u3089\u308b\u308d;\u6992;\u69a5\xe5\u0fd1uo\u803b\xbb\u40bbr\u0580;abcfhlpstw\u0fdc\u30ac\u30af\u30b7\u30b9\u30bc\u30be\u30c0\u30c3\u30c7\u30cap;\u6975\u0100;f\u0fe0\u30b4s;\u6920;\u6933s;\u691e\xeb\u225d\xf0\u272el;\u6945im;\u6974l;\u61a3;\u619d\u0100ai\u30d1\u30d5il;\u691ao\u0100;n\u30db\u30dc\u6236al\xf3\u0f1e\u0180abr\u30e7\u30ea\u30eer\xf2\u17e5rk;\u6773\u0100ak\u30f3\u30fdc\u0100ek\u30f9\u30fb;\u407d;\u405d\u0100es\u3102\u3104;\u698cl\u0100du\u310a\u310c;\u698e;\u6990\u0200aeuy\u3117\u311c\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xec\u0ff2\xe2\u30fa;\u4440\u0200clqs\u3134\u3137\u313d\u3144a;\u6937dhar;\u6969uo\u0100;r\u020e\u020dh;\u61b3\u0180acg\u314e\u315f\u0f44l\u0200;ips\u0f78\u3158\u315b\u109cn\xe5\u10bbar\xf4\u0fa9t;\u65ad\u0180ilr\u3169\u1023\u316esht;\u697d;\uc000\ud835\udd2f\u0100ao\u3177\u3186r\u0100du\u317d\u317f\xbb\u047b\u0100;l\u1091\u3184;\u696c\u0100;v\u318b\u318c\u43c1;\u43f1\u0180gns\u3195\u31f9\u31fcht\u0300ahlrst\u31a4\u31b0\u31c2\u31d8\u31e4\u31eerrow\u0100;t\u0fdc\u31ada\xe9\u30c8arpoon\u0100du\u31bb\u31bfow\xee\u317ep\xbb\u1092eft\u0100ah\u31ca\u31d0rrow\xf3\u0feaarpoon\xf3\u0551ightarrows;\u61c9quigarro\xf7\u30cbhreetimes;\u62ccg;\u42daingdotse\xf1\u1f32\u0180ahm\u320d\u3210\u3213r\xf2\u0feaa\xf2\u0551;\u600foust\u0100;a\u321e\u321f\u63b1che\xbb\u321fmid;\u6aee\u0200abpt\u3232\u323d\u3240\u3252\u0100nr\u3237\u323ag;\u67edr;\u61fer\xeb\u1003\u0180afl\u3247\u324a\u324er;\u6986;\uc000\ud835\udd63us;\u6a2eimes;\u6a35\u0100ap\u325d\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6a12ar\xf2\u31e3\u0200achq\u327b\u3280\u10bc\u3285quo;\u603ar;\uc000\ud835\udcc7\u0100bu\u30fb\u328ao\u0100;r\u0214\u0213\u0180hir\u3297\u329b\u32a0re\xe5\u31f8mes;\u62cai\u0200;efl\u32aa\u1059\u1821\u32ab\u65b9tri;\u69celuhar;\u6968;\u611e\u0d61\u32d5\u32db\u32df\u332c\u3338\u3371\0\u337a\u33a4\0\0\u33ec\u33f0\0\u3428\u3448\u345a\u34ad\u34b1\u34ca\u34f1\0\u3616\0\0\u3633cute;\u415bqu\xef\u27ba\u0500;Eaceinpsy\u11ed\u32f3\u32f5\u32ff\u3302\u330b\u330f\u331f\u3326\u3329;\u6ab4\u01f0\u32fa\0\u32fc;\u6ab8on;\u4161u\xe5\u11fe\u0100;d\u11f3\u3307il;\u415frc;\u415d\u0180Eas\u3316\u3318\u331b;\u6ab6p;\u6abaim;\u62e9olint;\u6a13i\xed\u1204;\u4441ot\u0180;be\u3334\u1d47\u3335\u62c5;\u6a66\u0380Aacmstx\u3346\u334a\u3357\u335b\u335e\u3363\u336drr;\u61d8r\u0100hr\u3350\u3352\xeb\u2228\u0100;o\u0a36\u0a34t\u803b\xa7\u40a7i;\u403bwar;\u6929m\u0100in\u3369\xf0nu\xf3\xf1t;\u6736r\u0100;o\u3376\u2055\uc000\ud835\udd30\u0200acoy\u3382\u3386\u3391\u33a0rp;\u666f\u0100hy\u338b\u338fcy;\u4449;\u4448rt\u026d\u3399\0\0\u339ci\xe4\u1464ara\xec\u2e6f\u803b\xad\u40ad\u0100gm\u33a8\u33b4ma\u0180;fv\u33b1\u33b2\u33b2\u43c3;\u43c2\u0400;deglnpr\u12ab\u33c5\u33c9\u33ce\u33d6\u33de\u33e1\u33e6ot;\u6a6a\u0100;q\u12b1\u12b0\u0100;E\u33d3\u33d4\u6a9e;\u6aa0\u0100;E\u33db\u33dc\u6a9d;\u6a9fe;\u6246lus;\u6a24arr;\u6972ar\xf2\u113d\u0200aeit\u33f8\u3408\u340f\u3417\u0100ls\u33fd\u3404lsetm\xe9\u336ahp;\u6a33parsl;\u69e4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341c\u341d\u6aaa\u0100;s\u3422\u3423\u6aac;\uc000\u2aac\ufe00\u0180flp\u342e\u3433\u3442tcy;\u444c\u0100;b\u3438\u3439\u402f\u0100;a\u343e\u343f\u69c4r;\u633ff;\uc000\ud835\udd64a\u0100dr\u344d\u0402es\u0100;u\u3454\u3455\u6660it\xbb\u3455\u0180csu\u3460\u3479\u349f\u0100au\u3465\u346fp\u0100;s\u1188\u346b;\uc000\u2293\ufe00p\u0100;s\u11b4\u3475;\uc000\u2294\ufe00u\u0100bp\u347f\u348f\u0180;es\u1197\u119c\u3486et\u0100;e\u1197\u348d\xf1\u119d\u0180;es\u11a8\u11ad\u3496et\u0100;e\u11a8\u349d\xf1\u11ae\u0180;af\u117b\u34a6\u05b0r\u0165\u34ab\u05b1\xbb\u117car\xf2\u1148\u0200cemt\u34b9\u34be\u34c2\u34c5r;\uc000\ud835\udcc8tm\xee\xf1i\xec\u3415ar\xe6\u11be\u0100ar\u34ce\u34d5r\u0100;f\u34d4\u17bf\u6606\u0100an\u34da\u34edight\u0100ep\u34e3\u34eapsilo\xee\u1ee0h\xe9\u2eafs\xbb\u2852\u0280bcmnp\u34fb\u355e\u1209\u358b\u358e\u0480;Edemnprs\u350e\u350f\u3511\u3515\u351e\u3523\u352c\u3531\u3536\u6282;\u6ac5ot;\u6abd\u0100;d\u11da\u351aot;\u6ac3ult;\u6ac1\u0100Ee\u3528\u352a;\u6acb;\u628alus;\u6abfarr;\u6979\u0180eiu\u353d\u3552\u3555t\u0180;en\u350e\u3545\u354bq\u0100;q\u11da\u350feq\u0100;q\u352b\u3528m;\u6ac7\u0100bp\u355a\u355c;\u6ad5;\u6ad3c\u0300;acens\u11ed\u356c\u3572\u3579\u357b\u3326ppro\xf8\u32faurlye\xf1\u11fe\xf1\u11f3\u0180aes\u3582\u3588\u331bppro\xf8\u331aq\xf1\u3317g;\u666a\u0680123;Edehlmnps\u35a9\u35ac\u35af\u121c\u35b2\u35b4\u35c0\u35c9\u35d5\u35da\u35df\u35e8\u35ed\u803b\xb9\u40b9\u803b\xb2\u40b2\u803b\xb3\u40b3;\u6ac6\u0100os\u35b9\u35bct;\u6abeub;\u6ad8\u0100;d\u1222\u35c5ot;\u6ac4s\u0100ou\u35cf\u35d2l;\u67c9b;\u6ad7arr;\u697bult;\u6ac2\u0100Ee\u35e4\u35e6;\u6acc;\u628blus;\u6ac0\u0180eiu\u35f4\u3609\u360ct\u0180;en\u121c\u35fc\u3602q\u0100;q\u1222\u35b2eq\u0100;q\u35e7\u35e4m;\u6ac8\u0100bp\u3611\u3613;\u6ad4;\u6ad6\u0180Aan\u361c\u3620\u362drr;\u61d9r\u0100hr\u3626\u3628\xeb\u222e\u0100;o\u0a2b\u0a29war;\u692alig\u803b\xdf\u40df\u0be1\u3651\u365d\u3660\u12ce\u3673\u3679\0\u367e\u36c2\0\0\0\0\0\u36db\u3703\0\u3709\u376c\0\0\0\u3787\u0272\u3656\0\0\u365bget;\u6316;\u43c4r\xeb\u0e5f\u0180aey\u3666\u366b\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uc000\ud835\udd31\u0200eiko\u3686\u369d\u36b5\u36bc\u01f2\u368b\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369b\u43b8ym;\u43d1\u0100cn\u36a2\u36b2k\u0100as\u36a8\u36aeppro\xf8\u12c1im\xbb\u12acs\xf0\u129e\u0100as\u36ba\u36ae\xf0\u12c1rn\u803b\xfe\u40fe\u01ec\u031f\u36c6\u22e7es\u8180\xd7;bd\u36cf\u36d0\u36d8\u40d7\u0100;a\u190f\u36d5r;\u6a31;\u6a30\u0180eps\u36e1\u36e3\u3700\xe1\u2a4d\u0200;bcf\u0486\u36ec\u36f0\u36f4ot;\u6336ir;\u6af1\u0100;o\u36f9\u36fc\uc000\ud835\udd65rk;\u6ada\xe1\u3362rime;\u6034\u0180aip\u370f\u3712\u3764d\xe5\u1248\u0380adempst\u3721\u374d\u3740\u3751\u3757\u375c\u375fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65b5own\xbb\u1dbbeft\u0100;e\u2800\u373e\xf1\u092e;\u625cight\u0100;e\u32aa\u374b\xf1\u105aot;\u65ecinus;\u6a3alus;\u6a39b;\u69cdime;\u6a3bezium;\u63e2\u0180cht\u3772\u377d\u3781\u0100ry\u3777\u377b;\uc000\ud835\udcc9;\u4446cy;\u445brok;\u4167\u0100io\u378b\u378ex\xf4\u1777head\u0100lr\u3797\u37a0eftarro\xf7\u084fightarrow\xbb\u0f5d\u0900AHabcdfghlmoprstuw\u37d0\u37d3\u37d7\u37e4\u37f0\u37fc\u380e\u381c\u3823\u3834\u3851\u385d\u386b\u38a9\u38cc\u38d2\u38ea\u38f6r\xf2\u03edar;\u6963\u0100cr\u37dc\u37e2ute\u803b\xfa\u40fa\xf2\u1150r\u01e3\u37ea\0\u37edy;\u445eve;\u416d\u0100iy\u37f5\u37farc\u803b\xfb\u40fb;\u4443\u0180abh\u3803\u3806\u380br\xf2\u13adlac;\u4171a\xf2\u13c3\u0100ir\u3813\u3818sht;\u697e;\uc000\ud835\udd32rave\u803b\xf9\u40f9\u0161\u3827\u3831r\u0100lr\u382c\u382e\xbb\u0957\xbb\u1083lk;\u6580\u0100ct\u3839\u384d\u026f\u383f\0\0\u384arn\u0100;e\u3845\u3846\u631cr\xbb\u3846op;\u630fri;\u65f8\u0100al\u3856\u385acr;\u416b\u80bb\xa8\u0349\u0100gp\u3862\u3866on;\u4173f;\uc000\ud835\udd66\u0300adhlsu\u114b\u3878\u387d\u1372\u3891\u38a0own\xe1\u13b3arpoon\u0100lr\u3888\u388cef\xf4\u382digh\xf4\u382fi\u0180;hl\u3899\u389a\u389c\u43c5\xbb\u13faon\xbb\u389aparrows;\u61c8\u0180cit\u38b0\u38c4\u38c8\u026f\u38b6\0\0\u38c1rn\u0100;e\u38bc\u38bd\u631dr\xbb\u38bdop;\u630eng;\u416fri;\u65f9cr;\uc000\ud835\udcca\u0180dir\u38d9\u38dd\u38e2ot;\u62f0lde;\u4169i\u0100;f\u3730\u38e8\xbb\u1813\u0100am\u38ef\u38f2r\xf2\u38a8l\u803b\xfc\u40fcangle;\u69a7\u0780ABDacdeflnoprsz\u391c\u391f\u3929\u392d\u39b5\u39b8\u39bd\u39df\u39e4\u39e8\u39f3\u39f9\u39fd\u3a01\u3a20r\xf2\u03f7ar\u0100;v\u3926\u3927\u6ae8;\u6ae9as\xe8\u03e1\u0100nr\u3932\u3937grt;\u699c\u0380eknprst\u34e3\u3946\u394b\u3952\u395d\u3964\u3996app\xe1\u2415othin\xe7\u1e96\u0180hir\u34eb\u2ec8\u3959op\xf4\u2fb5\u0100;h\u13b7\u3962\xef\u318d\u0100iu\u3969\u396dgm\xe1\u33b3\u0100bp\u3972\u3984setneq\u0100;q\u397d\u3980\uc000\u228a\ufe00;\uc000\u2acb\ufe00setneq\u0100;q\u398f\u3992\uc000\u228b\ufe00;\uc000\u2acc\ufe00\u0100hr\u399b\u399fet\xe1\u369ciangle\u0100lr\u39aa\u39afeft\xbb\u0925ight\xbb\u1051y;\u4432ash\xbb\u1036\u0180elr\u39c4\u39d2\u39d7\u0180;be\u2dea\u39cb\u39cfar;\u62bbq;\u625alip;\u62ee\u0100bt\u39dc\u1468a\xf2\u1469r;\uc000\ud835\udd33tr\xe9\u39aesu\u0100bp\u39ef\u39f1\xbb\u0d1c\xbb\u0d59pf;\uc000\ud835\udd67ro\xf0\u0efbtr\xe9\u39b4\u0100cu\u3a06\u3a0br;\uc000\ud835\udccb\u0100bp\u3a10\u3a18n\u0100Ee\u3980\u3a16\xbb\u397en\u0100Ee\u3992\u3a1e\xbb\u3990igzag;\u699a\u0380cefoprs\u3a36\u3a3b\u3a56\u3a5b\u3a54\u3a61\u3a6airc;\u4175\u0100di\u3a40\u3a51\u0100bg\u3a45\u3a49ar;\u6a5fe\u0100;q\u15fa\u3a4f;\u6259erp;\u6118r;\uc000\ud835\udd34pf;\uc000\ud835\udd68\u0100;e\u1479\u3a66at\xe8\u1479cr;\uc000\ud835\udccc\u0ae3\u178e\u3a87\0\u3a8b\0\u3a90\u3a9b\0\0\u3a9d\u3aa8\u3aab\u3aaf\0\0\u3ac3\u3ace\0\u3ad8\u17dc\u17dftr\xe9\u17d1r;\uc000\ud835\udd35\u0100Aa\u3a94\u3a97r\xf2\u03c3r\xf2\u09f6;\u43be\u0100Aa\u3aa1\u3aa4r\xf2\u03b8r\xf2\u09eba\xf0\u2713is;\u62fb\u0180dpt\u17a4\u3ab5\u3abe\u0100fl\u3aba\u17a9;\uc000\ud835\udd69im\xe5\u17b2\u0100Aa\u3ac7\u3acar\xf2\u03cer\xf2\u0a01\u0100cq\u3ad2\u17b8r;\uc000\ud835\udccd\u0100pt\u17d6\u3adcr\xe9\u17d4\u0400acefiosu\u3af0\u3afd\u3b08\u3b0c\u3b11\u3b15\u3b1b\u3b21c\u0100uy\u3af6\u3afbte\u803b\xfd\u40fd;\u444f\u0100iy\u3b02\u3b06rc;\u4177;\u444bn\u803b\xa5\u40a5r;\uc000\ud835\udd36cy;\u4457pf;\uc000\ud835\udd6acr;\uc000\ud835\udcce\u0100cm\u3b26\u3b29y;\u444el\u803b\xff\u40ff\u0500acdefhiosw\u3b42\u3b48\u3b54\u3b58\u3b64\u3b69\u3b6d\u3b74\u3b7a\u3b80cute;\u417a\u0100ay\u3b4d\u3b52ron;\u417e;\u4437ot;\u417c\u0100et\u3b5d\u3b61tr\xe6\u155fa;\u43b6r;\uc000\ud835\udd37cy;\u4436grarr;\u61ddpf;\uc000\ud835\udd6bcr;\uc000\ud835\udccf\u0100jn\u3b85\u3b87;\u600dj;\u600c'.split("").map((function(e){return e.charCodeAt(0)})))},22060:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Uint16Array("\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022".split("").map((function(e){return e.charCodeAt(0)})))},94021:(e,t)=>{"use strict";function n(e){for(var t=1;t<e.length;t++)e[t][0]+=e[t-1][0]+1;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Map(n([[9," "],[0," "],[22,"!"],[0,"""],[0,"#"],[0,"$"],[0,"%"],[0,"&"],[0,"'"],[0,"("],[0,")"],[0,"*"],[0,"+"],[0,","],[1,"."],[0,"/"],[10,":"],[0,";"],[0,{v:"<",n:8402,o:"<⃒"}],[0,{v:"=",n:8421,o:"=⃥"}],[0,{v:">",n:8402,o:">⃒"}],[0,"?"],[0,"@"],[26,"["],[0,"\"],[0,"]"],[0,"^"],[0,"_"],[0,"`"],[5,{n:106,o:"fj"}],[20,"{"],[0,"|"],[0,"}"],[34," "],[0,"¡"],[0,"¢"],[0,"£"],[0,"¤"],[0,"¥"],[0,"¦"],[0,"§"],[0,"¨"],[0,"©"],[0,"ª"],[0,"«"],[0,"¬"],[0,"­"],[0,"®"],[0,"¯"],[0,"°"],[0,"±"],[0,"²"],[0,"³"],[0,"´"],[0,"µ"],[0,"¶"],[0,"·"],[0,"¸"],[0,"¹"],[0,"º"],[0,"»"],[0,"¼"],[0,"½"],[0,"¾"],[0,"¿"],[0,"À"],[0,"Á"],[0,"Â"],[0,"Ã"],[0,"Ä"],[0,"Å"],[0,"Æ"],[0,"Ç"],[0,"È"],[0,"É"],[0,"Ê"],[0,"Ë"],[0,"Ì"],[0,"Í"],[0,"Î"],[0,"Ï"],[0,"Ð"],[0,"Ñ"],[0,"Ò"],[0,"Ó"],[0,"Ô"],[0,"Õ"],[0,"Ö"],[0,"×"],[0,"Ø"],[0,"Ù"],[0,"Ú"],[0,"Û"],[0,"Ü"],[0,"Ý"],[0,"Þ"],[0,"ß"],[0,"à"],[0,"á"],[0,"â"],[0,"ã"],[0,"ä"],[0,"å"],[0,"æ"],[0,"ç"],[0,"è"],[0,"é"],[0,"ê"],[0,"ë"],[0,"ì"],[0,"í"],[0,"î"],[0,"ï"],[0,"ð"],[0,"ñ"],[0,"ò"],[0,"ó"],[0,"ô"],[0,"õ"],[0,"ö"],[0,"÷"],[0,"ø"],[0,"ù"],[0,"ú"],[0,"û"],[0,"ü"],[0,"ý"],[0,"þ"],[0,"ÿ"],[0,"Ā"],[0,"ā"],[0,"Ă"],[0,"ă"],[0,"Ą"],[0,"ą"],[0,"Ć"],[0,"ć"],[0,"Ĉ"],[0,"ĉ"],[0,"Ċ"],[0,"ċ"],[0,"Č"],[0,"č"],[0,"Ď"],[0,"ď"],[0,"Đ"],[0,"đ"],[0,"Ē"],[0,"ē"],[2,"Ė"],[0,"ė"],[0,"Ę"],[0,"ę"],[0,"Ě"],[0,"ě"],[0,"Ĝ"],[0,"ĝ"],[0,"Ğ"],[0,"ğ"],[0,"Ġ"],[0,"ġ"],[0,"Ģ"],[1,"Ĥ"],[0,"ĥ"],[0,"Ħ"],[0,"ħ"],[0,"Ĩ"],[0,"ĩ"],[0,"Ī"],[0,"ī"],[2,"Į"],[0,"į"],[0,"İ"],[0,"ı"],[0,"IJ"],[0,"ij"],[0,"Ĵ"],[0,"ĵ"],[0,"Ķ"],[0,"ķ"],[0,"ĸ"],[0,"Ĺ"],[0,"ĺ"],[0,"Ļ"],[0,"ļ"],[0,"Ľ"],[0,"ľ"],[0,"Ŀ"],[0,"ŀ"],[0,"Ł"],[0,"ł"],[0,"Ń"],[0,"ń"],[0,"Ņ"],[0,"ņ"],[0,"Ň"],[0,"ň"],[0,"ʼn"],[0,"Ŋ"],[0,"ŋ"],[0,"Ō"],[0,"ō"],[2,"Ő"],[0,"ő"],[0,"Œ"],[0,"œ"],[0,"Ŕ"],[0,"ŕ"],[0,"Ŗ"],[0,"ŗ"],[0,"Ř"],[0,"ř"],[0,"Ś"],[0,"ś"],[0,"Ŝ"],[0,"ŝ"],[0,"Ş"],[0,"ş"],[0,"Š"],[0,"š"],[0,"Ţ"],[0,"ţ"],[0,"Ť"],[0,"ť"],[0,"Ŧ"],[0,"ŧ"],[0,"Ũ"],[0,"ũ"],[0,"Ū"],[0,"ū"],[0,"Ŭ"],[0,"ŭ"],[0,"Ů"],[0,"ů"],[0,"Ű"],[0,"ű"],[0,"Ų"],[0,"ų"],[0,"Ŵ"],[0,"ŵ"],[0,"Ŷ"],[0,"ŷ"],[0,"Ÿ"],[0,"Ź"],[0,"ź"],[0,"Ż"],[0,"ż"],[0,"Ž"],[0,"ž"],[19,"ƒ"],[34,"Ƶ"],[63,"ǵ"],[65,"ȷ"],[142,"ˆ"],[0,"ˇ"],[16,"˘"],[0,"˙"],[0,"˚"],[0,"˛"],[0,"˜"],[0,"˝"],[51,"̑"],[127,"Α"],[0,"Β"],[0,"Γ"],[0,"Δ"],[0,"Ε"],[0,"Ζ"],[0,"Η"],[0,"Θ"],[0,"Ι"],[0,"Κ"],[0,"Λ"],[0,"Μ"],[0,"Ν"],[0,"Ξ"],[0,"Ο"],[0,"Π"],[0,"Ρ"],[1,"Σ"],[0,"Τ"],[0,"Υ"],[0,"Φ"],[0,"Χ"],[0,"Ψ"],[0,"Ω"],[7,"α"],[0,"β"],[0,"γ"],[0,"δ"],[0,"ε"],[0,"ζ"],[0,"η"],[0,"θ"],[0,"ι"],[0,"κ"],[0,"λ"],[0,"μ"],[0,"ν"],[0,"ξ"],[0,"ο"],[0,"π"],[0,"ρ"],[0,"ς"],[0,"σ"],[0,"τ"],[0,"υ"],[0,"φ"],[0,"χ"],[0,"ψ"],[0,"ω"],[7,"ϑ"],[0,"ϒ"],[2,"ϕ"],[0,"ϖ"],[5,"Ϝ"],[0,"ϝ"],[18,"ϰ"],[0,"ϱ"],[3,"ϵ"],[0,"϶"],[10,"Ё"],[0,"Ђ"],[0,"Ѓ"],[0,"Є"],[0,"Ѕ"],[0,"І"],[0,"Ї"],[0,"Ј"],[0,"Љ"],[0,"Њ"],[0,"Ћ"],[0,"Ќ"],[1,"Ў"],[0,"Џ"],[0,"А"],[0,"Б"],[0,"В"],[0,"Г"],[0,"Д"],[0,"Е"],[0,"Ж"],[0,"З"],[0,"И"],[0,"Й"],[0,"К"],[0,"Л"],[0,"М"],[0,"Н"],[0,"О"],[0,"П"],[0,"Р"],[0,"С"],[0,"Т"],[0,"У"],[0,"Ф"],[0,"Х"],[0,"Ц"],[0,"Ч"],[0,"Ш"],[0,"Щ"],[0,"Ъ"],[0,"Ы"],[0,"Ь"],[0,"Э"],[0,"Ю"],[0,"Я"],[0,"а"],[0,"б"],[0,"в"],[0,"г"],[0,"д"],[0,"е"],[0,"ж"],[0,"з"],[0,"и"],[0,"й"],[0,"к"],[0,"л"],[0,"м"],[0,"н"],[0,"о"],[0,"п"],[0,"р"],[0,"с"],[0,"т"],[0,"у"],[0,"ф"],[0,"х"],[0,"ц"],[0,"ч"],[0,"ш"],[0,"щ"],[0,"ъ"],[0,"ы"],[0,"ь"],[0,"э"],[0,"ю"],[0,"я"],[1,"ё"],[0,"ђ"],[0,"ѓ"],[0,"є"],[0,"ѕ"],[0,"і"],[0,"ї"],[0,"ј"],[0,"љ"],[0,"њ"],[0,"ћ"],[0,"ќ"],[1,"ў"],[0,"џ"],[7074," "],[0," "],[0," "],[0," "],[1," "],[0," "],[0," "],[0," "],[0,"​"],[0,"‌"],[0,"‍"],[0,"‎"],[0,"‏"],[0,"‐"],[2,"–"],[0,"—"],[0,"―"],[0,"‖"],[1,"‘"],[0,"’"],[0,"‚"],[1,"“"],[0,"”"],[0,"„"],[1,"†"],[0,"‡"],[0,"•"],[2,"‥"],[0,"…"],[9,"‰"],[0,"‱"],[0,"′"],[0,"″"],[0,"‴"],[0,"‵"],[3,"‹"],[0,"›"],[3,"‾"],[2,"⁁"],[1,"⁃"],[0,"⁄"],[10,"⁏"],[7,"⁗"],[7,{v:" ",n:8202,o:"  "}],[0,"⁠"],[0,"⁡"],[0,"⁢"],[0,"⁣"],[72,"€"],[46,"⃛"],[0,"⃜"],[37,"ℂ"],[2,"℅"],[4,"ℊ"],[0,"ℋ"],[0,"ℌ"],[0,"ℍ"],[0,"ℎ"],[0,"ℏ"],[0,"ℐ"],[0,"ℑ"],[0,"ℒ"],[0,"ℓ"],[1,"ℕ"],[0,"№"],[0,"℗"],[0,"℘"],[0,"ℙ"],[0,"ℚ"],[0,"ℛ"],[0,"ℜ"],[0,"ℝ"],[0,"℞"],[3,"™"],[1,"ℤ"],[2,"℧"],[0,"ℨ"],[0,"℩"],[2,"ℬ"],[0,"ℭ"],[1,"ℯ"],[0,"ℰ"],[0,"ℱ"],[1,"ℳ"],[0,"ℴ"],[0,"ℵ"],[0,"ℶ"],[0,"ℷ"],[0,"ℸ"],[12,"ⅅ"],[0,"ⅆ"],[0,"ⅇ"],[0,"ⅈ"],[10,"⅓"],[0,"⅔"],[0,"⅕"],[0,"⅖"],[0,"⅗"],[0,"⅘"],[0,"⅙"],[0,"⅚"],[0,"⅛"],[0,"⅜"],[0,"⅝"],[0,"⅞"],[49,"←"],[0,"↑"],[0,"→"],[0,"↓"],[0,"↔"],[0,"↕"],[0,"↖"],[0,"↗"],[0,"↘"],[0,"↙"],[0,"↚"],[0,"↛"],[1,{v:"↝",n:824,o:"↝̸"}],[0,"↞"],[0,"↟"],[0,"↠"],[0,"↡"],[0,"↢"],[0,"↣"],[0,"↤"],[0,"↥"],[0,"↦"],[0,"↧"],[1,"↩"],[0,"↪"],[0,"↫"],[0,"↬"],[0,"↭"],[0,"↮"],[1,"↰"],[0,"↱"],[0,"↲"],[0,"↳"],[1,"↵"],[0,"↶"],[0,"↷"],[2,"↺"],[0,"↻"],[0,"↼"],[0,"↽"],[0,"↾"],[0,"↿"],[0,"⇀"],[0,"⇁"],[0,"⇂"],[0,"⇃"],[0,"⇄"],[0,"⇅"],[0,"⇆"],[0,"⇇"],[0,"⇈"],[0,"⇉"],[0,"⇊"],[0,"⇋"],[0,"⇌"],[0,"⇍"],[0,"⇎"],[0,"⇏"],[0,"⇐"],[0,"⇑"],[0,"⇒"],[0,"⇓"],[0,"⇔"],[0,"⇕"],[0,"⇖"],[0,"⇗"],[0,"⇘"],[0,"⇙"],[0,"⇚"],[0,"⇛"],[1,"⇝"],[6,"⇤"],[0,"⇥"],[15,"⇵"],[7,"⇽"],[0,"⇾"],[0,"⇿"],[0,"∀"],[0,"∁"],[0,{v:"∂",n:824,o:"∂̸"}],[0,"∃"],[0,"∄"],[0,"∅"],[1,"∇"],[0,"∈"],[0,"∉"],[1,"∋"],[0,"∌"],[2,"∏"],[0,"∐"],[0,"∑"],[0,"−"],[0,"∓"],[0,"∔"],[1,"∖"],[0,"∗"],[0,"∘"],[1,"√"],[2,"∝"],[0,"∞"],[0,"∟"],[0,{v:"∠",n:8402,o:"∠⃒"}],[0,"∡"],[0,"∢"],[0,"∣"],[0,"∤"],[0,"∥"],[0,"∦"],[0,"∧"],[0,"∨"],[0,{v:"∩",n:65024,o:"∩︀"}],[0,{v:"∪",n:65024,o:"∪︀"}],[0,"∫"],[0,"∬"],[0,"∭"],[0,"∮"],[0,"∯"],[0,"∰"],[0,"∱"],[0,"∲"],[0,"∳"],[0,"∴"],[0,"∵"],[0,"∶"],[0,"∷"],[0,"∸"],[1,"∺"],[0,"∻"],[0,{v:"∼",n:8402,o:"∼⃒"}],[0,{v:"∽",n:817,o:"∽̱"}],[0,{v:"∾",n:819,o:"∾̳"}],[0,"∿"],[0,"≀"],[0,"≁"],[0,{v:"≂",n:824,o:"≂̸"}],[0,"≃"],[0,"≄"],[0,"≅"],[0,"≆"],[0,"≇"],[0,"≈"],[0,"≉"],[0,"≊"],[0,{v:"≋",n:824,o:"≋̸"}],[0,"≌"],[0,{v:"≍",n:8402,o:"≍⃒"}],[0,{v:"≎",n:824,o:"≎̸"}],[0,{v:"≏",n:824,o:"≏̸"}],[0,{v:"≐",n:824,o:"≐̸"}],[0,"≑"],[0,"≒"],[0,"≓"],[0,"≔"],[0,"≕"],[0,"≖"],[0,"≗"],[1,"≙"],[0,"≚"],[1,"≜"],[2,"≟"],[0,"≠"],[0,{v:"≡",n:8421,o:"≡⃥"}],[0,"≢"],[1,{v:"≤",n:8402,o:"≤⃒"}],[0,{v:"≥",n:8402,o:"≥⃒"}],[0,{v:"≦",n:824,o:"≦̸"}],[0,{v:"≧",n:824,o:"≧̸"}],[0,{v:"≨",n:65024,o:"≨︀"}],[0,{v:"≩",n:65024,o:"≩︀"}],[0,{v:"≪",n:new Map(n([[824,"≪̸"],[7577,"≪⃒"]]))}],[0,{v:"≫",n:new Map(n([[824,"≫̸"],[7577,"≫⃒"]]))}],[0,"≬"],[0,"≭"],[0,"≮"],[0,"≯"],[0,"≰"],[0,"≱"],[0,"≲"],[0,"≳"],[0,"≴"],[0,"≵"],[0,"≶"],[0,"≷"],[0,"≸"],[0,"≹"],[0,"≺"],[0,"≻"],[0,"≼"],[0,"≽"],[0,"≾"],[0,{v:"≿",n:824,o:"≿̸"}],[0,"⊀"],[0,"⊁"],[0,{v:"⊂",n:8402,o:"⊂⃒"}],[0,{v:"⊃",n:8402,o:"⊃⃒"}],[0,"⊄"],[0,"⊅"],[0,"⊆"],[0,"⊇"],[0,"⊈"],[0,"⊉"],[0,{v:"⊊",n:65024,o:"⊊︀"}],[0,{v:"⊋",n:65024,o:"⊋︀"}],[1,"⊍"],[0,"⊎"],[0,{v:"⊏",n:824,o:"⊏̸"}],[0,{v:"⊐",n:824,o:"⊐̸"}],[0,"⊑"],[0,"⊒"],[0,{v:"⊓",n:65024,o:"⊓︀"}],[0,{v:"⊔",n:65024,o:"⊔︀"}],[0,"⊕"],[0,"⊖"],[0,"⊗"],[0,"⊘"],[0,"⊙"],[0,"⊚"],[0,"⊛"],[1,"⊝"],[0,"⊞"],[0,"⊟"],[0,"⊠"],[0,"⊡"],[0,"⊢"],[0,"⊣"],[0,"⊤"],[0,"⊥"],[1,"⊧"],[0,"⊨"],[0,"⊩"],[0,"⊪"],[0,"⊫"],[0,"⊬"],[0,"⊭"],[0,"⊮"],[0,"⊯"],[0,"⊰"],[1,"⊲"],[0,"⊳"],[0,{v:"⊴",n:8402,o:"⊴⃒"}],[0,{v:"⊵",n:8402,o:"⊵⃒"}],[0,"⊶"],[0,"⊷"],[0,"⊸"],[0,"⊹"],[0,"⊺"],[0,"⊻"],[1,"⊽"],[0,"⊾"],[0,"⊿"],[0,"⋀"],[0,"⋁"],[0,"⋂"],[0,"⋃"],[0,"⋄"],[0,"⋅"],[0,"⋆"],[0,"⋇"],[0,"⋈"],[0,"⋉"],[0,"⋊"],[0,"⋋"],[0,"⋌"],[0,"⋍"],[0,"⋎"],[0,"⋏"],[0,"⋐"],[0,"⋑"],[0,"⋒"],[0,"⋓"],[0,"⋔"],[0,"⋕"],[0,"⋖"],[0,"⋗"],[0,{v:"⋘",n:824,o:"⋘̸"}],[0,{v:"⋙",n:824,o:"⋙̸"}],[0,{v:"⋚",n:65024,o:"⋚︀"}],[0,{v:"⋛",n:65024,o:"⋛︀"}],[2,"⋞"],[0,"⋟"],[0,"⋠"],[0,"⋡"],[0,"⋢"],[0,"⋣"],[2,"⋦"],[0,"⋧"],[0,"⋨"],[0,"⋩"],[0,"⋪"],[0,"⋫"],[0,"⋬"],[0,"⋭"],[0,"⋮"],[0,"⋯"],[0,"⋰"],[0,"⋱"],[0,"⋲"],[0,"⋳"],[0,"⋴"],[0,{v:"⋵",n:824,o:"⋵̸"}],[0,"⋶"],[0,"⋷"],[1,{v:"⋹",n:824,o:"⋹̸"}],[0,"⋺"],[0,"⋻"],[0,"⋼"],[0,"⋽"],[0,"⋾"],[6,"⌅"],[0,"⌆"],[1,"⌈"],[0,"⌉"],[0,"⌊"],[0,"⌋"],[0,"⌌"],[0,"⌍"],[0,"⌎"],[0,"⌏"],[0,"⌐"],[1,"⌒"],[0,"⌓"],[1,"⌕"],[0,"⌖"],[5,"⌜"],[0,"⌝"],[0,"⌞"],[0,"⌟"],[2,"⌢"],[0,"⌣"],[9,"⌭"],[0,"⌮"],[7,"⌶"],[6,"⌽"],[1,"⌿"],[60,"⍼"],[51,"⎰"],[0,"⎱"],[2,"⎴"],[0,"⎵"],[0,"⎶"],[37,"⏜"],[0,"⏝"],[0,"⏞"],[0,"⏟"],[2,"⏢"],[4,"⏧"],[59,"␣"],[164,"Ⓢ"],[55,"─"],[1,"│"],[9,"┌"],[3,"┐"],[3,"└"],[3,"┘"],[3,"├"],[7,"┤"],[7,"┬"],[7,"┴"],[7,"┼"],[19,"═"],[0,"║"],[0,"╒"],[0,"╓"],[0,"╔"],[0,"╕"],[0,"╖"],[0,"╗"],[0,"╘"],[0,"╙"],[0,"╚"],[0,"╛"],[0,"╜"],[0,"╝"],[0,"╞"],[0,"╟"],[0,"╠"],[0,"╡"],[0,"╢"],[0,"╣"],[0,"╤"],[0,"╥"],[0,"╦"],[0,"╧"],[0,"╨"],[0,"╩"],[0,"╪"],[0,"╫"],[0,"╬"],[19,"▀"],[3,"▄"],[3,"█"],[8,"░"],[0,"▒"],[0,"▓"],[13,"□"],[8,"▪"],[0,"▫"],[1,"▭"],[0,"▮"],[2,"▱"],[1,"△"],[0,"▴"],[0,"▵"],[2,"▸"],[0,"▹"],[3,"▽"],[0,"▾"],[0,"▿"],[2,"◂"],[0,"◃"],[6,"◊"],[0,"○"],[32,"◬"],[2,"◯"],[8,"◸"],[0,"◹"],[0,"◺"],[0,"◻"],[0,"◼"],[8,"★"],[0,"☆"],[7,"☎"],[49,"♀"],[1,"♂"],[29,"♠"],[2,"♣"],[1,"♥"],[0,"♦"],[3,"♪"],[2,"♭"],[0,"♮"],[0,"♯"],[163,"✓"],[3,"✗"],[8,"✠"],[21,"✶"],[33,"❘"],[25,"❲"],[0,"❳"],[84,"⟈"],[0,"⟉"],[28,"⟦"],[0,"⟧"],[0,"⟨"],[0,"⟩"],[0,"⟪"],[0,"⟫"],[0,"⟬"],[0,"⟭"],[7,"⟵"],[0,"⟶"],[0,"⟷"],[0,"⟸"],[0,"⟹"],[0,"⟺"],[1,"⟼"],[2,"⟿"],[258,"⤂"],[0,"⤃"],[0,"⤄"],[0,"⤅"],[6,"⤌"],[0,"⤍"],[0,"⤎"],[0,"⤏"],[0,"⤐"],[0,"⤑"],[0,"⤒"],[0,"⤓"],[2,"⤖"],[2,"⤙"],[0,"⤚"],[0,"⤛"],[0,"⤜"],[0,"⤝"],[0,"⤞"],[0,"⤟"],[0,"⤠"],[2,"⤣"],[0,"⤤"],[0,"⤥"],[0,"⤦"],[0,"⤧"],[0,"⤨"],[0,"⤩"],[0,"⤪"],[8,{v:"⤳",n:824,o:"⤳̸"}],[1,"⤵"],[0,"⤶"],[0,"⤷"],[0,"⤸"],[0,"⤹"],[2,"⤼"],[0,"⤽"],[7,"⥅"],[2,"⥈"],[0,"⥉"],[0,"⥊"],[0,"⥋"],[2,"⥎"],[0,"⥏"],[0,"⥐"],[0,"⥑"],[0,"⥒"],[0,"⥓"],[0,"⥔"],[0,"⥕"],[0,"⥖"],[0,"⥗"],[0,"⥘"],[0,"⥙"],[0,"⥚"],[0,"⥛"],[0,"⥜"],[0,"⥝"],[0,"⥞"],[0,"⥟"],[0,"⥠"],[0,"⥡"],[0,"⥢"],[0,"⥣"],[0,"⥤"],[0,"⥥"],[0,"⥦"],[0,"⥧"],[0,"⥨"],[0,"⥩"],[0,"⥪"],[0,"⥫"],[0,"⥬"],[0,"⥭"],[0,"⥮"],[0,"⥯"],[0,"⥰"],[0,"⥱"],[0,"⥲"],[0,"⥳"],[0,"⥴"],[0,"⥵"],[0,"⥶"],[1,"⥸"],[0,"⥹"],[1,"⥻"],[0,"⥼"],[0,"⥽"],[0,"⥾"],[0,"⥿"],[5,"⦅"],[0,"⦆"],[4,"⦋"],[0,"⦌"],[0,"⦍"],[0,"⦎"],[0,"⦏"],[0,"⦐"],[0,"⦑"],[0,"⦒"],[0,"⦓"],[0,"⦔"],[0,"⦕"],[0,"⦖"],[3,"⦚"],[1,"⦜"],[0,"⦝"],[6,"⦤"],[0,"⦥"],[0,"⦦"],[0,"⦧"],[0,"⦨"],[0,"⦩"],[0,"⦪"],[0,"⦫"],[0,"⦬"],[0,"⦭"],[0,"⦮"],[0,"⦯"],[0,"⦰"],[0,"⦱"],[0,"⦲"],[0,"⦳"],[0,"⦴"],[0,"⦵"],[0,"⦶"],[0,"⦷"],[1,"⦹"],[1,"⦻"],[0,"⦼"],[1,"⦾"],[0,"⦿"],[0,"⧀"],[0,"⧁"],[0,"⧂"],[0,"⧃"],[0,"⧄"],[0,"⧅"],[3,"⧉"],[3,"⧍"],[0,"⧎"],[0,{v:"⧏",n:824,o:"⧏̸"}],[0,{v:"⧐",n:824,o:"⧐̸"}],[11,"⧜"],[0,"⧝"],[0,"⧞"],[4,"⧣"],[0,"⧤"],[0,"⧥"],[5,"⧫"],[8,"⧴"],[1,"⧶"],[9,"⨀"],[0,"⨁"],[0,"⨂"],[1,"⨄"],[1,"⨆"],[5,"⨌"],[0,"⨍"],[2,"⨐"],[0,"⨑"],[0,"⨒"],[0,"⨓"],[0,"⨔"],[0,"⨕"],[0,"⨖"],[0,"⨗"],[10,"⨢"],[0,"⨣"],[0,"⨤"],[0,"⨥"],[0,"⨦"],[0,"⨧"],[1,"⨩"],[0,"⨪"],[2,"⨭"],[0,"⨮"],[0,"⨯"],[0,"⨰"],[0,"⨱"],[1,"⨳"],[0,"⨴"],[0,"⨵"],[0,"⨶"],[0,"⨷"],[0,"⨸"],[0,"⨹"],[0,"⨺"],[0,"⨻"],[0,"⨼"],[2,"⨿"],[0,"⩀"],[1,"⩂"],[0,"⩃"],[0,"⩄"],[0,"⩅"],[0,"⩆"],[0,"⩇"],[0,"⩈"],[0,"⩉"],[0,"⩊"],[0,"⩋"],[0,"⩌"],[0,"⩍"],[2,"⩐"],[2,"⩓"],[0,"⩔"],[0,"⩕"],[0,"⩖"],[0,"⩗"],[0,"⩘"],[1,"⩚"],[0,"⩛"],[0,"⩜"],[0,"⩝"],[1,"⩟"],[6,"⩦"],[3,"⩪"],[2,{v:"⩭",n:824,o:"⩭̸"}],[0,"⩮"],[0,"⩯"],[0,{v:"⩰",n:824,o:"⩰̸"}],[0,"⩱"],[0,"⩲"],[0,"⩳"],[0,"⩴"],[0,"⩵"],[1,"⩷"],[0,"⩸"],[0,"⩹"],[0,"⩺"],[0,"⩻"],[0,"⩼"],[0,{v:"⩽",n:824,o:"⩽̸"}],[0,{v:"⩾",n:824,o:"⩾̸"}],[0,"⩿"],[0,"⪀"],[0,"⪁"],[0,"⪂"],[0,"⪃"],[0,"⪄"],[0,"⪅"],[0,"⪆"],[0,"⪇"],[0,"⪈"],[0,"⪉"],[0,"⪊"],[0,"⪋"],[0,"⪌"],[0,"⪍"],[0,"⪎"],[0,"⪏"],[0,"⪐"],[0,"⪑"],[0,"⪒"],[0,"⪓"],[0,"⪔"],[0,"⪕"],[0,"⪖"],[0,"⪗"],[0,"⪘"],[0,"⪙"],[0,"⪚"],[2,"⪝"],[0,"⪞"],[0,"⪟"],[0,"⪠"],[0,{v:"⪡",n:824,o:"⪡̸"}],[0,{v:"⪢",n:824,o:"⪢̸"}],[1,"⪤"],[0,"⪥"],[0,"⪦"],[0,"⪧"],[0,"⪨"],[0,"⪩"],[0,"⪪"],[0,"⪫"],[0,{v:"⪬",n:65024,o:"⪬︀"}],[0,{v:"⪭",n:65024,o:"⪭︀"}],[0,"⪮"],[0,{v:"⪯",n:824,o:"⪯̸"}],[0,{v:"⪰",n:824,o:"⪰̸"}],[2,"⪳"],[0,"⪴"],[0,"⪵"],[0,"⪶"],[0,"⪷"],[0,"⪸"],[0,"⪹"],[0,"⪺"],[0,"⪻"],[0,"⪼"],[0,"⪽"],[0,"⪾"],[0,"⪿"],[0,"⫀"],[0,"⫁"],[0,"⫂"],[0,"⫃"],[0,"⫄"],[0,{v:"⫅",n:824,o:"⫅̸"}],[0,{v:"⫆",n:824,o:"⫆̸"}],[0,"⫇"],[0,"⫈"],[2,{v:"⫋",n:65024,o:"⫋︀"}],[0,{v:"⫌",n:65024,o:"⫌︀"}],[2,"⫏"],[0,"⫐"],[0,"⫑"],[0,"⫒"],[0,"⫓"],[0,"⫔"],[0,"⫕"],[0,"⫖"],[0,"⫗"],[0,"⫘"],[0,"⫙"],[0,"⫚"],[0,"⫛"],[8,"⫤"],[1,"⫦"],[0,"⫧"],[0,"⫨"],[0,"⫩"],[1,"⫫"],[0,"⫬"],[0,"⫭"],[0,"⫮"],[0,"⫯"],[0,"⫰"],[0,"⫱"],[0,"⫲"],[0,"⫳"],[9,{v:"⫽",n:8421,o:"⫽⃥"}],[44343,{n:new Map(n([[56476,"𝒜"],[1,"𝒞"],[0,"𝒟"],[2,"𝒢"],[2,"𝒥"],[0,"𝒦"],[2,"𝒩"],[0,"𝒪"],[0,"𝒫"],[0,"𝒬"],[1,"𝒮"],[0,"𝒯"],[0,"𝒰"],[0,"𝒱"],[0,"𝒲"],[0,"𝒳"],[0,"𝒴"],[0,"𝒵"],[0,"𝒶"],[0,"𝒷"],[0,"𝒸"],[0,"𝒹"],[1,"𝒻"],[1,"𝒽"],[0,"𝒾"],[0,"𝒿"],[0,"𝓀"],[0,"𝓁"],[0,"𝓂"],[0,"𝓃"],[1,"𝓅"],[0,"𝓆"],[0,"𝓇"],[0,"𝓈"],[0,"𝓉"],[0,"𝓊"],[0,"𝓋"],[0,"𝓌"],[0,"𝓍"],[0,"𝓎"],[0,"𝓏"],[52,"𝔄"],[0,"𝔅"],[1,"𝔇"],[0,"𝔈"],[0,"𝔉"],[0,"𝔊"],[2,"𝔍"],[0,"𝔎"],[0,"𝔏"],[0,"𝔐"],[0,"𝔑"],[0,"𝔒"],[0,"𝔓"],[0,"𝔔"],[1,"𝔖"],[0,"𝔗"],[0,"𝔘"],[0,"𝔙"],[0,"𝔚"],[0,"𝔛"],[0,"𝔜"],[1,"𝔞"],[0,"𝔟"],[0,"𝔠"],[0,"𝔡"],[0,"𝔢"],[0,"𝔣"],[0,"𝔤"],[0,"𝔥"],[0,"𝔦"],[0,"𝔧"],[0,"𝔨"],[0,"𝔩"],[0,"𝔪"],[0,"𝔫"],[0,"𝔬"],[0,"𝔭"],[0,"𝔮"],[0,"𝔯"],[0,"𝔰"],[0,"𝔱"],[0,"𝔲"],[0,"𝔳"],[0,"𝔴"],[0,"𝔵"],[0,"𝔶"],[0,"𝔷"],[0,"𝔸"],[0,"𝔹"],[1,"𝔻"],[0,"𝔼"],[0,"𝔽"],[0,"𝔾"],[1,"𝕀"],[0,"𝕁"],[0,"𝕂"],[0,"𝕃"],[0,"𝕄"],[1,"𝕆"],[3,"𝕊"],[0,"𝕋"],[0,"𝕌"],[0,"𝕍"],[0,"𝕎"],[0,"𝕏"],[0,"𝕐"],[1,"𝕒"],[0,"𝕓"],[0,"𝕔"],[0,"𝕕"],[0,"𝕖"],[0,"𝕗"],[0,"𝕘"],[0,"𝕙"],[0,"𝕚"],[0,"𝕛"],[0,"𝕜"],[0,"𝕝"],[0,"𝕞"],[0,"𝕟"],[0,"𝕠"],[0,"𝕡"],[0,"𝕢"],[0,"𝕣"],[0,"𝕤"],[0,"𝕥"],[0,"𝕦"],[0,"𝕧"],[0,"𝕨"],[0,"𝕩"],[0,"𝕪"],[0,"𝕫"]]))}],[8906,"ff"],[0,"fi"],[0,"fl"],[0,"ffi"],[0,"ffl"]]))},45863:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXMLStrict=t.decodeHTML5Strict=t.decodeHTML4Strict=t.decodeHTML5=t.decodeHTML4=t.decodeHTMLAttribute=t.decodeHTMLStrict=t.decodeHTML=t.decodeXML=t.DecodingMode=t.EntityDecoder=t.encodeHTML5=t.encodeHTML4=t.encodeNonAsciiHTML=t.encodeHTML=t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.encode=t.decodeStrict=t.decode=t.EncodingMode=t.EntityLevel=void 0;var r,i,o=n(44076),s=n(87322),a=n(24625);function l(e,t){if(void 0===t&&(t=r.XML),("number"==typeof t?t:t.level)===r.HTML){var n="object"==typeof t?t.mode:void 0;return(0,o.decodeHTML)(e,n)}return(0,o.decodeXML)(e)}!function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"}(r=t.EntityLevel||(t.EntityLevel={})),function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"}(i=t.EncodingMode||(t.EncodingMode={})),t.decode=l,t.decodeStrict=function(e,t){var n;void 0===t&&(t=r.XML);var i="number"==typeof t?{level:t}:t;return null!==(n=i.mode)&&void 0!==n||(i.mode=o.DecodingMode.Strict),l(e,i)},t.encode=function(e,t){void 0===t&&(t=r.XML);var n="number"==typeof t?{level:t}:t;return n.mode===i.UTF8?(0,a.escapeUTF8)(e):n.mode===i.Attribute?(0,a.escapeAttribute)(e):n.mode===i.Text?(0,a.escapeText)(e):n.level===r.HTML?n.mode===i.ASCII?(0,s.encodeNonAsciiHTML)(e):(0,s.encodeHTML)(e):(0,a.encodeXML)(e)};var c=n(24625);Object.defineProperty(t,"encodeXML",{enumerable:!0,get:function(){return c.encodeXML}}),Object.defineProperty(t,"escape",{enumerable:!0,get:function(){return c.escape}}),Object.defineProperty(t,"escapeUTF8",{enumerable:!0,get:function(){return c.escapeUTF8}}),Object.defineProperty(t,"escapeAttribute",{enumerable:!0,get:function(){return c.escapeAttribute}}),Object.defineProperty(t,"escapeText",{enumerable:!0,get:function(){return c.escapeText}});var u=n(87322);Object.defineProperty(t,"encodeHTML",{enumerable:!0,get:function(){return u.encodeHTML}}),Object.defineProperty(t,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return u.encodeNonAsciiHTML}}),Object.defineProperty(t,"encodeHTML4",{enumerable:!0,get:function(){return u.encodeHTML}}),Object.defineProperty(t,"encodeHTML5",{enumerable:!0,get:function(){return u.encodeHTML}});var d=n(44076);Object.defineProperty(t,"EntityDecoder",{enumerable:!0,get:function(){return d.EntityDecoder}}),Object.defineProperty(t,"DecodingMode",{enumerable:!0,get:function(){return d.DecodingMode}}),Object.defineProperty(t,"decodeXML",{enumerable:!0,get:function(){return d.decodeXML}}),Object.defineProperty(t,"decodeHTML",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(t,"decodeHTMLStrict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTMLAttribute",{enumerable:!0,get:function(){return d.decodeHTMLAttribute}}),Object.defineProperty(t,"decodeHTML4",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(t,"decodeHTML5",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(t,"decodeHTML4Strict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTML5Strict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(t,"decodeXMLStrict",{enumerable:!0,get:function(){return d.decodeXML}})},63150:e=>{"use strict";e.exports=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}},50763:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0;var s=o(n(39889)),a=n(44076),l=new Set(["input","option","optgroup","select","button","datalist","textarea"]),c=new Set(["p"]),u=new Set(["thead","tbody"]),d=new Set(["dd","dt"]),p=new Set(["rt","rp"]),h=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",c],["h1",c],["h2",c],["h3",c],["h4",c],["h5",c],["h6",c],["select",l],["input",l],["output",l],["button",l],["datalist",l],["textarea",l],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",d],["dt",d],["address",c],["article",c],["aside",c],["blockquote",c],["details",c],["div",c],["dl",c],["fieldset",c],["figcaption",c],["figure",c],["footer",c],["form",c],["header",c],["hr",c],["main",c],["nav",c],["ol",c],["pre",c],["section",c],["table",c],["ul",c],["rt",p],["rp",p],["tbody",u],["tfoot",u]]),f=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),m=new Set(["math","svg"]),g=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),b=/\s|\//,y=function(){function e(e,t){var n,r,i,o,a;void 0===t&&(t={}),this.options=t,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.foreignContext=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=null!=e?e:{},this.lowerCaseTagNames=null!==(n=t.lowerCaseTags)&&void 0!==n?n:!t.xmlMode,this.lowerCaseAttributeNames=null!==(r=t.lowerCaseAttributeNames)&&void 0!==r?r:!t.xmlMode,this.tokenizer=new(null!==(i=t.Tokenizer)&&void 0!==i?i:s.default)(this.options,this),null===(a=(o=this.cbs).onparserinit)||void 0===a||a.call(o,this)}return e.prototype.ontext=function(e,t){var n,r,i=this.getSlice(e,t);this.endIndex=t-1,null===(r=(n=this.cbs).ontext)||void 0===r||r.call(n,i),this.startIndex=t},e.prototype.ontextentity=function(e){var t,n,r=this.tokenizer.getSectionStart();this.endIndex=r-1,null===(n=(t=this.cbs).ontext)||void 0===n||n.call(t,(0,a.fromCodePoint)(e)),this.startIndex=r},e.prototype.isVoidElement=function(e){return!this.options.xmlMode&&f.has(e)},e.prototype.onopentagname=function(e,t){this.endIndex=t;var n=this.getSlice(e,t);this.lowerCaseTagNames&&(n=n.toLowerCase()),this.emitOpenTag(n)},e.prototype.emitOpenTag=function(e){var t,n,r,i;this.openTagStart=this.startIndex,this.tagname=e;var o=!this.options.xmlMode&&h.get(e);if(o)for(;this.stack.length>0&&o.has(this.stack[this.stack.length-1]);){var s=this.stack.pop();null===(n=(t=this.cbs).onclosetag)||void 0===n||n.call(t,s,!0)}this.isVoidElement(e)||(this.stack.push(e),m.has(e)?this.foreignContext.push(!0):g.has(e)&&this.foreignContext.push(!1)),null===(i=(r=this.cbs).onopentagname)||void 0===i||i.call(r,e),this.cbs.onopentag&&(this.attribs={})},e.prototype.endOpenTag=function(e){var t,n;this.startIndex=this.openTagStart,this.attribs&&(null===(n=(t=this.cbs).onopentag)||void 0===n||n.call(t,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""},e.prototype.onopentagend=function(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1},e.prototype.onclosetag=function(e,t){var n,r,i,o,s,a;this.endIndex=t;var l=this.getSlice(e,t);if(this.lowerCaseTagNames&&(l=l.toLowerCase()),(m.has(l)||g.has(l))&&this.foreignContext.pop(),this.isVoidElement(l))this.options.xmlMode||"br"!==l||(null===(r=(n=this.cbs).onopentagname)||void 0===r||r.call(n,"br"),null===(o=(i=this.cbs).onopentag)||void 0===o||o.call(i,"br",{},!0),null===(a=(s=this.cbs).onclosetag)||void 0===a||a.call(s,"br",!1));else{var c=this.stack.lastIndexOf(l);if(-1!==c)if(this.cbs.onclosetag)for(var u=this.stack.length-c;u--;)this.cbs.onclosetag(this.stack.pop(),0!==u);else this.stack.length=c;else this.options.xmlMode||"p"!==l||(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=t+1},e.prototype.onselfclosingtag=function(e){this.endIndex=e,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)},e.prototype.closeCurrentTag=function(e){var t,n,r=this.tagname;this.endOpenTag(e),this.stack[this.stack.length-1]===r&&(null===(n=(t=this.cbs).onclosetag)||void 0===n||n.call(t,r,!e),this.stack.pop())},e.prototype.onattribname=function(e,t){this.startIndex=e;var n=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?n.toLowerCase():n},e.prototype.onattribdata=function(e,t){this.attribvalue+=this.getSlice(e,t)},e.prototype.onattribentity=function(e){this.attribvalue+=(0,a.fromCodePoint)(e)},e.prototype.onattribend=function(e,t){var n,r;this.endIndex=t,null===(r=(n=this.cbs).onattribute)||void 0===r||r.call(n,this.attribname,this.attribvalue,e===s.QuoteType.Double?'"':e===s.QuoteType.Single?"'":e===s.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""},e.prototype.getInstructionName=function(e){var t=e.search(b),n=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(n=n.toLowerCase()),n},e.prototype.ondeclaration=function(e,t){this.endIndex=t;var n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){var r=this.getInstructionName(n);this.cbs.onprocessinginstruction("!".concat(r),"!".concat(n))}this.startIndex=t+1},e.prototype.onprocessinginstruction=function(e,t){this.endIndex=t;var n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){var r=this.getInstructionName(n);this.cbs.onprocessinginstruction("?".concat(r),"?".concat(n))}this.startIndex=t+1},e.prototype.oncomment=function(e,t,n){var r,i,o,s;this.endIndex=t,null===(i=(r=this.cbs).oncomment)||void 0===i||i.call(r,this.getSlice(e,t-n)),null===(s=(o=this.cbs).oncommentend)||void 0===s||s.call(o),this.startIndex=t+1},e.prototype.oncdata=function(e,t,n){var r,i,o,s,a,l,c,u,d,p;this.endIndex=t;var h=this.getSlice(e,t-n);this.options.xmlMode||this.options.recognizeCDATA?(null===(i=(r=this.cbs).oncdatastart)||void 0===i||i.call(r),null===(s=(o=this.cbs).ontext)||void 0===s||s.call(o,h),null===(l=(a=this.cbs).oncdataend)||void 0===l||l.call(a)):(null===(u=(c=this.cbs).oncomment)||void 0===u||u.call(c,"[CDATA[".concat(h,"]]")),null===(p=(d=this.cbs).oncommentend)||void 0===p||p.call(d)),this.startIndex=t+1},e.prototype.onend=function(){var e,t;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(var n=this.stack.length;n>0;this.cbs.onclosetag(this.stack[--n],!0));}null===(t=(e=this.cbs).onend)||void 0===t||t.call(e)},e.prototype.reset=function(){var e,t,n,r;null===(t=(e=this.cbs).onreset)||void 0===t||t.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,null===(r=(n=this.cbs).onparserinit)||void 0===r||r.call(n,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1},e.prototype.parseComplete=function(e){this.reset(),this.end(e)},e.prototype.getSlice=function(e,t){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();for(var n=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),n+=this.buffers[0].slice(0,t-this.bufferOffset);return n},e.prototype.shiftBuffer=function(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()},e.prototype.write=function(e){var t,n;this.ended?null===(n=(t=this.cbs).onerror)||void 0===n||n.call(t,new Error(".write() after done!")):(this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++))},e.prototype.end=function(e){var t,n;this.ended?null===(n=(t=this.cbs).onerror)||void 0===n||n.call(t,new Error(".end() after done!")):(e&&this.write(e),this.ended=!0,this.tokenizer.end())},e.prototype.pause=function(){this.tokenizer.pause()},e.prototype.resume=function(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()},e.prototype.parseChunk=function(e){this.write(e)},e.prototype.done=function(e){this.end(e)},e}();t.Parser=y},39889:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuoteType=void 0;var r,i,o,s=n(44076);function a(e){return e===r.Space||e===r.NewLine||e===r.Tab||e===r.FormFeed||e===r.CarriageReturn}function l(e){return e===r.Slash||e===r.Gt||a(e)}function c(e){return e>=r.Zero&&e<=r.Nine}!function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Number=35]="Number",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"}(r||(r={})),function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.InSpecialComment=20]="InSpecialComment",e[e.InCommentLike=21]="InCommentLike",e[e.BeforeSpecialS=22]="BeforeSpecialS",e[e.SpecialStartSequence=23]="SpecialStartSequence",e[e.InSpecialTag=24]="InSpecialTag",e[e.BeforeEntity=25]="BeforeEntity",e[e.BeforeNumericEntity=26]="BeforeNumericEntity",e[e.InNamedEntity=27]="InNamedEntity",e[e.InNumericEntity=28]="InNumericEntity",e[e.InHexEntity=29]="InHexEntity"}(i||(i={})),function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"}(o=t.QuoteType||(t.QuoteType={}));var u={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])},d=function(){function e(e,t){var n=e.xmlMode,r=void 0!==n&&n,o=e.decodeEntities,a=void 0===o||o;this.cbs=t,this.state=i.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=i.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=r,this.decodeEntities=a,this.entityTrie=r?s.xmlDecodeTree:s.htmlDecodeTree}return e.prototype.reset=function(){this.state=i.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=i.Text,this.currentSequence=void 0,this.running=!0,this.offset=0},e.prototype.write=function(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()},e.prototype.end=function(){this.running&&this.finish()},e.prototype.pause=function(){this.running=!1},e.prototype.resume=function(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()},e.prototype.getIndex=function(){return this.index},e.prototype.getSectionStart=function(){return this.sectionStart},e.prototype.stateText=function(e){e===r.Lt||!this.decodeEntities&&this.fastForwardTo(r.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=i.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===r.Amp&&(this.state=i.BeforeEntity)},e.prototype.stateSpecialStartSequence=function(e){var t=this.sequenceIndex===this.currentSequence.length;if(t?l(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.isSpecial=!1;this.sequenceIndex=0,this.state=i.InTagName,this.stateInTagName(e)},e.prototype.stateInSpecialTag=function(e){if(this.sequenceIndex===this.currentSequence.length){if(e===r.Gt||a(e)){var t=this.index-this.currentSequence.length;if(this.sectionStart<t){var n=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=n}return this.isSpecial=!1,this.sectionStart=t+2,void this.stateInClosingTagName(e)}this.sequenceIndex=0}(32|e)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:0===this.sequenceIndex?this.currentSequence===u.TitleEnd?this.decodeEntities&&e===r.Amp&&(this.state=i.BeforeEntity):this.fastForwardTo(r.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=Number(e===r.Lt)},e.prototype.stateCDATASequence=function(e){e===u.Cdata[this.sequenceIndex]?++this.sequenceIndex===u.Cdata.length&&(this.state=i.InCommentLike,this.currentSequence=u.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=i.InDeclaration,this.stateInDeclaration(e))},e.prototype.fastForwardTo=function(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1},e.prototype.stateInCommentLike=function(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===u.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=i.Text):0===this.sequenceIndex?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)},e.prototype.isTagStartChar=function(e){return this.xmlMode?!l(e):function(e){return e>=r.LowerA&&e<=r.LowerZ||e>=r.UpperA&&e<=r.UpperZ}(e)},e.prototype.startSpecial=function(e,t){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=t,this.state=i.SpecialStartSequence},e.prototype.stateBeforeTagName=function(e){if(e===r.ExclamationMark)this.state=i.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===r.Questionmark)this.state=i.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){var t=32|e;this.sectionStart=this.index,this.xmlMode||t!==u.TitleEnd[2]?this.state=this.xmlMode||t!==u.ScriptEnd[2]?i.InTagName:i.BeforeSpecialS:this.startSpecial(u.TitleEnd,3)}else e===r.Slash?this.state=i.BeforeClosingTagName:(this.state=i.Text,this.stateText(e))},e.prototype.stateInTagName=function(e){l(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=i.BeforeAttributeName,this.stateBeforeAttributeName(e))},e.prototype.stateBeforeClosingTagName=function(e){a(e)||(e===r.Gt?this.state=i.Text:(this.state=this.isTagStartChar(e)?i.InClosingTagName:i.InSpecialComment,this.sectionStart=this.index))},e.prototype.stateInClosingTagName=function(e){(e===r.Gt||a(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=i.AfterClosingTagName,this.stateAfterClosingTagName(e))},e.prototype.stateAfterClosingTagName=function(e){(e===r.Gt||this.fastForwardTo(r.Gt))&&(this.state=i.Text,this.baseState=i.Text,this.sectionStart=this.index+1)},e.prototype.stateBeforeAttributeName=function(e){e===r.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=i.InSpecialTag,this.sequenceIndex=0):this.state=i.Text,this.baseState=this.state,this.sectionStart=this.index+1):e===r.Slash?this.state=i.InSelfClosingTag:a(e)||(this.state=i.InAttributeName,this.sectionStart=this.index)},e.prototype.stateInSelfClosingTag=function(e){e===r.Gt?(this.cbs.onselfclosingtag(this.index),this.state=i.Text,this.baseState=i.Text,this.sectionStart=this.index+1,this.isSpecial=!1):a(e)||(this.state=i.BeforeAttributeName,this.stateBeforeAttributeName(e))},e.prototype.stateInAttributeName=function(e){(e===r.Eq||l(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=-1,this.state=i.AfterAttributeName,this.stateAfterAttributeName(e))},e.prototype.stateAfterAttributeName=function(e){e===r.Eq?this.state=i.BeforeAttributeValue:e===r.Slash||e===r.Gt?(this.cbs.onattribend(o.NoValue,this.index),this.state=i.BeforeAttributeName,this.stateBeforeAttributeName(e)):a(e)||(this.cbs.onattribend(o.NoValue,this.index),this.state=i.InAttributeName,this.sectionStart=this.index)},e.prototype.stateBeforeAttributeValue=function(e){e===r.DoubleQuote?(this.state=i.InAttributeValueDq,this.sectionStart=this.index+1):e===r.SingleQuote?(this.state=i.InAttributeValueSq,this.sectionStart=this.index+1):a(e)||(this.sectionStart=this.index,this.state=i.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))},e.prototype.handleInAttributeValue=function(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===r.DoubleQuote?o.Double:o.Single,this.index),this.state=i.BeforeAttributeName):this.decodeEntities&&e===r.Amp&&(this.baseState=this.state,this.state=i.BeforeEntity)},e.prototype.stateInAttributeValueDoubleQuotes=function(e){this.handleInAttributeValue(e,r.DoubleQuote)},e.prototype.stateInAttributeValueSingleQuotes=function(e){this.handleInAttributeValue(e,r.SingleQuote)},e.prototype.stateInAttributeValueNoQuotes=function(e){a(e)||e===r.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(o.Unquoted,this.index),this.state=i.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===r.Amp&&(this.baseState=this.state,this.state=i.BeforeEntity)},e.prototype.stateBeforeDeclaration=function(e){e===r.OpeningSquareBracket?(this.state=i.CDATASequence,this.sequenceIndex=0):this.state=e===r.Dash?i.BeforeComment:i.InDeclaration},e.prototype.stateInDeclaration=function(e){(e===r.Gt||this.fastForwardTo(r.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=i.Text,this.sectionStart=this.index+1)},e.prototype.stateInProcessingInstruction=function(e){(e===r.Gt||this.fastForwardTo(r.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=i.Text,this.sectionStart=this.index+1)},e.prototype.stateBeforeComment=function(e){e===r.Dash?(this.state=i.InCommentLike,this.currentSequence=u.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=i.InDeclaration},e.prototype.stateInSpecialComment=function(e){(e===r.Gt||this.fastForwardTo(r.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=i.Text,this.sectionStart=this.index+1)},e.prototype.stateBeforeSpecialS=function(e){var t=32|e;t===u.ScriptEnd[3]?this.startSpecial(u.ScriptEnd,4):t===u.StyleEnd[3]?this.startSpecial(u.StyleEnd,4):(this.state=i.InTagName,this.stateInTagName(e))},e.prototype.stateBeforeEntity=function(e){this.entityExcess=1,this.entityResult=0,e===r.Number?this.state=i.BeforeNumericEntity:e===r.Amp||(this.trieIndex=0,this.trieCurrent=this.entityTrie[0],this.state=i.InNamedEntity,this.stateInNamedEntity(e))},e.prototype.stateInNamedEntity=function(e){if(this.entityExcess+=1,this.trieIndex=(0,s.determineBranch)(this.entityTrie,this.trieCurrent,this.trieIndex+1,e),this.trieIndex<0)return this.emitNamedEntity(),void this.index--;this.trieCurrent=this.entityTrie[this.trieIndex];var t=this.trieCurrent&s.BinTrieFlags.VALUE_LENGTH;if(t){var n=(t>>14)-1;if(this.allowLegacyEntity()||e===r.Semi){var i=this.index-this.entityExcess+1;i>this.sectionStart&&this.emitPartial(this.sectionStart,i),this.entityResult=this.trieIndex,this.trieIndex+=n,this.entityExcess=0,this.sectionStart=this.index+1,0===n&&this.emitNamedEntity()}else this.trieIndex+=n}},e.prototype.emitNamedEntity=function(){if(this.state=this.baseState,0!==this.entityResult)switch((this.entityTrie[this.entityResult]&s.BinTrieFlags.VALUE_LENGTH)>>14){case 1:this.emitCodePoint(this.entityTrie[this.entityResult]&~s.BinTrieFlags.VALUE_LENGTH);break;case 2:this.emitCodePoint(this.entityTrie[this.entityResult+1]);break;case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}},e.prototype.stateBeforeNumericEntity=function(e){(32|e)===r.LowerX?(this.entityExcess++,this.state=i.InHexEntity):(this.state=i.InNumericEntity,this.stateInNumericEntity(e))},e.prototype.emitNumericEntity=function(e){var t=this.index-this.entityExcess-1;t+2+Number(this.state===i.InHexEntity)!==this.index&&(t>this.sectionStart&&this.emitPartial(this.sectionStart,t),this.sectionStart=this.index+Number(e),this.emitCodePoint((0,s.replaceCodePoint)(this.entityResult))),this.state=this.baseState},e.prototype.stateInNumericEntity=function(e){e===r.Semi?this.emitNumericEntity(!0):c(e)?(this.entityResult=10*this.entityResult+(e-r.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},e.prototype.stateInHexEntity=function(e){e===r.Semi?this.emitNumericEntity(!0):c(e)?(this.entityResult=16*this.entityResult+(e-r.Zero),this.entityExcess++):!function(e){return e>=r.UpperA&&e<=r.UpperF||e>=r.LowerA&&e<=r.LowerF}(e)?(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--):(this.entityResult=16*this.entityResult+((32|e)-r.LowerA+10),this.entityExcess++)},e.prototype.allowLegacyEntity=function(){return!this.xmlMode&&(this.baseState===i.Text||this.baseState===i.InSpecialTag)},e.prototype.cleanup=function(){this.running&&this.sectionStart!==this.index&&(this.state===i.Text||this.state===i.InSpecialTag&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):this.state!==i.InAttributeValueDq&&this.state!==i.InAttributeValueSq&&this.state!==i.InAttributeValueNq||(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))},e.prototype.shouldContinue=function(){return this.index<this.buffer.length+this.offset&&this.running},e.prototype.parse=function(){for(;this.shouldContinue();){var e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case i.Text:this.stateText(e);break;case i.SpecialStartSequence:this.stateSpecialStartSequence(e);break;case i.InSpecialTag:this.stateInSpecialTag(e);break;case i.CDATASequence:this.stateCDATASequence(e);break;case i.InAttributeValueDq:this.stateInAttributeValueDoubleQuotes(e);break;case i.InAttributeName:this.stateInAttributeName(e);break;case i.InCommentLike:this.stateInCommentLike(e);break;case i.InSpecialComment:this.stateInSpecialComment(e);break;case i.BeforeAttributeName:this.stateBeforeAttributeName(e);break;case i.InTagName:this.stateInTagName(e);break;case i.InClosingTagName:this.stateInClosingTagName(e);break;case i.BeforeTagName:this.stateBeforeTagName(e);break;case i.AfterAttributeName:this.stateAfterAttributeName(e);break;case i.InAttributeValueSq:this.stateInAttributeValueSingleQuotes(e);break;case i.BeforeAttributeValue:this.stateBeforeAttributeValue(e);break;case i.BeforeClosingTagName:this.stateBeforeClosingTagName(e);break;case i.AfterClosingTagName:this.stateAfterClosingTagName(e);break;case i.BeforeSpecialS:this.stateBeforeSpecialS(e);break;case i.InAttributeValueNq:this.stateInAttributeValueNoQuotes(e);break;case i.InSelfClosingTag:this.stateInSelfClosingTag(e);break;case i.InDeclaration:this.stateInDeclaration(e);break;case i.BeforeDeclaration:this.stateBeforeDeclaration(e);break;case i.BeforeComment:this.stateBeforeComment(e);break;case i.InProcessingInstruction:this.stateInProcessingInstruction(e);break;case i.InNamedEntity:this.stateInNamedEntity(e);break;case i.BeforeEntity:this.stateBeforeEntity(e);break;case i.InHexEntity:this.stateInHexEntity(e);break;case i.InNumericEntity:this.stateInNumericEntity(e);break;default:this.stateBeforeNumericEntity(e)}this.index++}this.cleanup()},e.prototype.finish=function(){this.state===i.InNamedEntity&&this.emitNamedEntity(),this.sectionStart<this.index&&this.handleTrailingData(),this.cbs.onend()},e.prototype.handleTrailingData=function(){var e=this.buffer.length+this.offset;this.state===i.InCommentLike?this.currentSequence===u.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===i.InNumericEntity&&this.allowLegacyEntity()||this.state===i.InHexEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===i.InTagName||this.state===i.BeforeAttributeName||this.state===i.BeforeAttributeValue||this.state===i.AfterAttributeName||this.state===i.InAttributeName||this.state===i.InAttributeValueSq||this.state===i.InAttributeValueDq||this.state===i.InAttributeValueNq||this.state===i.InClosingTagName||this.cbs.ontext(this.sectionStart,e)},e.prototype.emitPartial=function(e,t){this.baseState!==i.Text&&this.baseState!==i.InSpecialTag?this.cbs.onattribdata(e,t):this.cbs.ontext(e,t)},e.prototype.emitCodePoint=function(e){this.baseState!==i.Text&&this.baseState!==i.InSpecialTag?this.cbs.onattribentity(e):this.cbs.ontextentity(e)},e}();t.default=d},23719:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomUtils=t.parseFeed=t.getFeed=t.ElementType=t.Tokenizer=t.createDomStream=t.parseDOM=t.parseDocument=t.DefaultHandler=t.DomHandler=t.Parser=void 0;var a=n(50763),l=n(50763);Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return l.Parser}});var c=n(47915),u=n(47915);function d(e,t){var n=new c.DomHandler(void 0,t);return new a.Parser(n,t).end(e),n.root}function p(e,t){return d(e,t).children}Object.defineProperty(t,"DomHandler",{enumerable:!0,get:function(){return u.DomHandler}}),Object.defineProperty(t,"DefaultHandler",{enumerable:!0,get:function(){return u.DomHandler}}),t.parseDocument=d,t.parseDOM=p,t.createDomStream=function(e,t,n){var r=new c.DomHandler(e,t,n);return new a.Parser(r,t)};var h=n(39889);Object.defineProperty(t,"Tokenizer",{enumerable:!0,get:function(){return s(h).default}}),t.ElementType=o(n(99960));var f=n(89432),m=n(89432);Object.defineProperty(t,"getFeed",{enumerable:!0,get:function(){return m.getFeed}});var g={xmlMode:!0};t.parseFeed=function(e,t){return void 0===t&&(t=g),(0,f.getFeed)(p(e,t))},t.DomUtils=o(n(89432))},26057:(e,t)=>{"use strict";function n(e){return"[object Object]"===Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isPlainObject=function(e){var t,r;return!1!==n(e)&&(void 0===(t=e.constructor)||!1!==n(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}},87594:(e,t)=>{function n(e){let t,n=[];for(let r of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(r))n.push(parseInt(r,10));else if(t=r.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,r,i,o]=t;if(r&&o){r=parseInt(r),o=parseInt(o);const e=r<o?1:-1;"-"!==i&&".."!==i&&"\u2025"!==i||(o+=e);for(let t=r;t!==o;t+=e)n.push(t)}}return n}t.default=n,e.exports=n},79430:function(e,t){var n,r,i;r=[],void 0===(i="function"==typeof(n=function(){return function(e){function t(e){return" "===e||"\t"===e||"\n"===e||"\f"===e||"\r"===e}function n(t){var n,r=t.exec(e.substring(m));if(r)return n=r[0],m+=n.length,n}for(var r,i,o,s,a,l=e.length,c=/^[ \t\n\r\u000c]+/,u=/^[, \t\n\r\u000c]+/,d=/^[^ \t\n\r\u000c]+/,p=/[,]+$/,h=/^\d+$/,f=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,m=0,g=[];;){if(n(u),m>=l)return g;r=n(d),i=[],","===r.slice(-1)?(r=r.replace(p,""),y()):b()}function b(){for(n(c),o="",s="in descriptor";;){if(a=e.charAt(m),"in descriptor"===s)if(t(a))o&&(i.push(o),o="",s="after descriptor");else{if(","===a)return m+=1,o&&i.push(o),void y();if("("===a)o+=a,s="in parens";else{if(""===a)return o&&i.push(o),void y();o+=a}}else if("in parens"===s)if(")"===a)o+=a,s="in descriptor";else{if(""===a)return i.push(o),void y();o+=a}else if("after descriptor"===s)if(t(a));else{if(""===a)return void y();s="in descriptor",m-=1}m+=1}}function y(){var t,n,o,s,a,l,c,u,d,p=!1,m={};for(s=0;s<i.length;s++)l=(a=i[s])[a.length-1],c=a.substring(0,a.length-1),u=parseInt(c,10),d=parseFloat(c),h.test(c)&&"w"===l?((t||n)&&(p=!0),0===u?p=!0:t=u):f.test(c)&&"x"===l?((t||n||o)&&(p=!0),d<0?p=!0:n=d):h.test(c)&&"h"===l?((o||n)&&(p=!0),0===u?p=!0:o=u):p=!0;p?console&&console.log&&console.log("Invalid srcset descriptor found in '"+e+"' at '"+a+"'."):(m.url=r,t&&(m.w=t),n&&(m.d=n),o&&(m.h=o),g.push(m))}}})?n.apply(t,r):n)||(e.exports=i)},74241:e=>{var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t}};e.exports=n(),e.exports.createColors=n},41353:(e,t,n)=>{"use strict";let r=n(21019);class i extends r{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}e.exports=i,i.default=i,r.registerAtRule(i)},69932:(e,t,n)=>{"use strict";let r=n(65631);class i extends r{constructor(e){super(e),this.type="comment"}}e.exports=i,i.default=i},21019:(e,t,n)=>{"use strict";let r,i,o,s,{isClean:a,my:l}=n(65513),c=n(94258),u=n(69932),d=n(65631);function p(e){return e.map((e=>(e.nodes&&(e.nodes=p(e.nodes)),delete e.source,e)))}function h(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)h(t)}class f extends d{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map((e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e))):"every"===t||"some"===t?n=>e[t](((e,...t)=>n(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let s of o)this.proxyOf.nodes.splice(r,0,s);for(let s in this.indexes)n=this.indexes[s],r<=n&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=p(r(e).nodes);else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new c(e)]}else if(e.selector)e=[new i(e)];else if(e.name)e=[new o(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new u(e)]}return e.map((e=>(e[l]||f.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&h(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls((r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,n)=>{let r;try{r=e(t,n)}catch(i){throw t.addToError(i)}return!1!==r&&t.walk&&(r=t.walk(e)),r}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)})):this.walk(((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("atrule"===e.type)return t(e,n)})))}walkComments(e){return this.walk(((t,n)=>{if("comment"===t.type)return e(t,n)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)})):this.walk(((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("decl"===e.type)return t(e,n)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)})):this.walk(((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("rule"===e.type)return t(e,n)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}f.registerParse=e=>{r=e},f.registerRule=e=>{i=e},f.registerAtRule=e=>{o=e},f.registerRoot=e=>{s=e},e.exports=f,f.default=f,f.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,o.prototype):"rule"===e.type?Object.setPrototypeOf(e,i.prototype):"decl"===e.type?Object.setPrototypeOf(e,c.prototype):"comment"===e.type?Object.setPrototypeOf(e,u.prototype):"root"===e.type&&Object.setPrototypeOf(e,s.prototype),e[l]=!0,e.nodes&&e.nodes.forEach((e=>{f.rebuild(e)}))}},42671:(e,t,n)=>{"use strict";let r=n(74241),i=n(22868);class o extends Error{constructor(e,t,n,r,i,s){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),r&&(this.source=r),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,o)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=r.isColorSupported),i&&e&&(t=i(t));let n,o,s=t.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),c=String(l).length;if(e){let{bold:e,gray:t,red:i}=r.createColors(!0);n=t=>e(i(t)),o=e=>t(e)}else n=o=e=>e;return s.slice(a,l).map(((e,t)=>{let r=a+1+t,i=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=o(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+o(i)+e+"\n "+t+n("^")}return" "+o(i)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=o,o.default=o},94258:(e,t,n)=>{"use strict";let r=n(65631);class i extends r{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}e.exports=i,i.default=i},26461:(e,t,n)=>{"use strict";let r,i,o=n(21019);class s extends o{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new r(new i,this,e).stringify()}}s.registerLazyResult=e=>{r=e},s.registerProcessor=e=>{i=e},e.exports=s,s.default=s},50250:(e,t,n)=>{"use strict";let r=n(94258),i=n(47981),o=n(69932),s=n(41353),a=n(5995),l=n(41025),c=n(31675);function u(e,t){if(Array.isArray(e))return e.map((e=>u(e)));let{inputs:n,...d}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:a.prototype};n.map&&(n.map={...n.map,__proto__:i.prototype}),t.push(n)}}if(d.nodes&&(d.nodes=e.nodes.map((e=>u(e,t)))),d.source){let{inputId:e,...n}=d.source;d.source=n,null!=e&&(d.source.input=t[e])}if("root"===d.type)return new l(d);if("decl"===d.type)return new r(d);if("rule"===d.type)return new c(d);if("comment"===d.type)return new o(d);if("atrule"===d.type)return new s(d);throw new Error("Unknown node type: "+e.type)}e.exports=u,u.default=u},5995:(e,t,n)=>{"use strict";let{SourceMapConsumer:r,SourceMapGenerator:i}=n(70209),{fileURLToPath:o,pathToFileURL:s}=n(87414),{isAbsolute:a,resolve:l}=n(99830),{nanoid:c}=n(62961),u=n(22868),d=n(42671),p=n(47981),h=Symbol("fromOffsetCache"),f=Boolean(r&&i),m=Boolean(l&&a);class g{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"\ufffe"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!m||/^\w+:\/\//.test(t.from)||a(t.from)?this.file=t.from:this.file=l(t.from)),m&&f){let e=new p(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+c(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,o,a;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,a=e.col}else o=r.line,a=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,o,a);return i=l?new d(e,void 0===l.endLine?l.line:{column:l.column,line:l.line},void 0===l.endLine?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,r.plugin):new d(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:a,line:o},this.css,this.file,r.plugin),i.input={column:n,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(s&&(i.input.url=s(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,n;if(this[h])n=this[h];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[h]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,i=n.length-2;for(;r<i;)if(t=r+(i-r>>1),e<n[t])i=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:l(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof n&&(i=c.originalPositionFor({column:r,line:n})),l=a(u.source)?s(u.source):new URL(u.source,this.map.consumer().sourceRoot||s(this.map.mapFile));let d={column:u.column,endColumn:i&&i.column,endLine:i&&i.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");d.file=o(l)}let p=c.sourceContentFor(u.source);return p&&(d.source=p),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}e.exports=g,g.default=g,u&&u.registerInput&&u.registerInput(g)},21939:(e,t,n)=>{"use strict";let{isClean:r,my:i}=n(65513),o=n(48505),s=n(67088),a=n(21019),l=n(26461),c=(n(72448),n(83632)),u=n(66939),d=n(41025);const p={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0},m=0;function g(e){return"object"==typeof e&&"function"==typeof e.then}function b(e){let t=!1,n=p[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,m,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,m,n+"Exit"]:[n,n+"Exit"]}function y(e){let t;return t="document"===e.type?["Document",m,"DocumentExit"]:"root"===e.type?["Root",m,"RootExit"]:b(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(e){return e[r]=!1,e.nodes&&e.nodes.forEach((e=>v(e))),e}let w={};class x{constructor(e,t,n){let r;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof x||t instanceof c)r=v(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=u;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{r=e(t,n)}catch(o){this.processed=!0,this.error=o}r&&!r[i]&&a.rebuild(r)}else r=v(t);this.result=new c(e,r,n),this.helpers={...w,postcss:w,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(r){console&&console.error&&console.error(r)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!h[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let n=0;n<this.plugins.length;n++){let t=this.plugins[n],r=this.runOnRoot(t);if(g(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[r];){e[r]=!0;let n=[y(e)];for(;n.length>0;){let e=this.visitTick(n);if(g(e))try{await e}catch(t){let e=n[n.length-1].node;throw this.handleError(t,e)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return g(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=s;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new o(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(g(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[r];)e[r]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){let e;this.result.lastPlugin=r;try{e=i(t,this.helpers)}catch(n){throw this.handleError(n,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(g(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:i}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(i.length>0&&t.visitorIndex<i.length){let[e,r]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return r(n.toProxy(),this.helpers)}catch(s){throw this.handleError(s,n)}}if(0!==t.iterator){let i,o=t.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[r])return i[r]=!0,void e.push(y(i));t.iterator=0,delete n.indexes[o]}let o=t.events;for(;t.eventIndex<o.length;){let e=o[t.eventIndex];if(t.eventIndex+=1,e===m)return void(n.nodes&&n.nodes.length&&(n[r]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[r]=!0;let t=b(e);for(let n of t)if(n===m)e.nodes&&e.each((e=>{e[r]||this.walkSync(e)}));else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}x.registerPostcss=e=>{w=e},e.exports=x,x.default=x,d.registerLazyResult(x),l.registerLazyResult(x)},54715:e=>{"use strict";let t={comma:e=>t.split(e,[","],!0),space:e=>t.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",c=!1;for(let u of e)c?c=!1:"\\"===u?c=!0:a?u===l&&(a=!1):'"'===u||"'"===u?(a=!0,l=u):"("===u?s+=1:")"===u?s>0&&(s-=1):0===s&&t.includes(u)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=u;return(n||""!==i)&&r.push(i.trim()),r}};e.exports=t,t.default=t},48505:(e,t,n)=>{"use strict";let{SourceMapConsumer:r,SourceMapGenerator:i}=n(70209),{dirname:o,relative:s,resolve:a,sep:l}=n(99830),{pathToFileURL:c}=n(87414),u=n(5995),d=Boolean(r&&i),p=Boolean(o&&a&&s&&l);e.exports=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),i=e.root||o(e.file);!1===this.mapOpts.sourcesContent?(t=new r(e.text),t.sourcesContent&&(t.sourcesContent=t.sourcesContent.map((()=>null)))):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(i)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),p&&d&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=i.fromSourceMap(e)}else this.map=new i({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new i({file:this.outputFile()});let e,t,n=1,r=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(s.generated.line=n,s.generated.column=r-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=i.match(/\n/g),e?(n+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=r-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=r-1,this.map.addMapping(s)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?o(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=o(a(n,this.mapOpts.annotation)));let r=s(n,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new u(this.css,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(c){let t=c(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===l&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}},47647:(e,t,n)=>{"use strict";let r=n(48505),i=n(67088),o=(n(72448),n(66939));const s=n(83632);class a{constructor(e,t,n){let o;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let a=i;this.result=new s(this._processor,o,this._opts),this.result.css=t;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new r(a,o,this._opts,t);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=o;try{e=t(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}e.exports=a,a.default=a},65631:(e,t,n)=>{"use strict";let{isClean:r,my:i}=n(65513),o=n(42671),s=n(1062),a=n(67088);function l(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],o=typeof i;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map((e=>l(e,n))):("object"===o&&null!==i&&(i=l(i)),n[r]=i)}return n}class c{constructor(e={}){this.raws={},this[r]=!1,this[i]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=l(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new o(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[r]){this[r]=!1;let e=this;for(;e=e.parent;)e[r]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let o=0;o<e;o++)"\n"===n[o]?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new s).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o))continue;if("parent"===o||"proxyCache"===o)continue;let e=this[o];if(Array.isArray(e))n[o]=e.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof e&&e.toJSON)n[o]=e.toJSON(null,t);else if("source"===o){let r=t.get(e.input);null==r&&(r=i,t.set(e.input,i),i++),n[o]={end:e.end,inputId:r,start:e.start}}else n[o]=e}return r&&(n.inputs=[...t.keys()].map((e=>e.toJSON()))),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=a){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,n){let r={node:this};for(let i in n)r[i]=n[i];return e.warn(t,r)}get proxyOf(){return this}}e.exports=c,c.default=c},66939:(e,t,n)=>{"use strict";let r=n(21019),i=n(68867),o=n(5995);function s(e,t){let n=new o(e,t),r=new i(n);try{r.parse()}catch(s){throw s}return r.root}e.exports=s,s.default=s,r.registerParse(s)},68867:(e,t,n)=>{"use strict";let r=n(94258),i=n(83852),o=n(69932),s=n(41353),a=n(41025),l=n(31675);const c={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new a,this.current=this.root,this.spaces="",this.semicolon=!1,this.customProperty=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,r,i=new s;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(r=l.length-1,n=l[r];n&&"space"===n[0];)n=l[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(e=l[l.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,i=0;for(let[o,s]of e.entries()){if(t=s,n=t[0],"("===n&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new o;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let i,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(i=e.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let r=e.length-1;r>=0;r--){if(i=e[r],"!important"===i[1].toLowerCase()){n.important=!0;let t=this.stringFrom(e,r);t=this.spacesFromEnd(e)+t," !important"!==t&&(n.raws.important=t);break}if("important"===i[1].toLowerCase()){let t=e.slice(0),i="";for(let e=r;e>0;e--){let n=t[e][0];if(0===i.trim().indexOf("!")&&"space"!==n)break;i=t.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,e=t)}if("space"!==i[0]&&"comment"!==i[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(n.raws.between+=a.map((e=>e[1])).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new l;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)i||(i=l),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=l),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,o,s,a,l=n.length,u="",d=!0;for(let p=0;p<l;p+=1)i=n[p],o=i[0],"space"!==o||p!==l-1||r?"comment"===o?(a=n[p-1]?n[p-1][0]:"empty",s=n[p+1]?n[p+1][0]:"empty",c[a]||c[s]||","===u.slice(-1)?d=!1:u+=i[1]):u+=i[1]:d=!1;if(!d){let r=n.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:r,value:u}}e[t]=u}rule(e){e.pop();let t=new l;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}},50020:(e,t,n)=>{"use strict";let r=n(42671),i=n(94258),o=n(21939),s=n(21019),a=n(71723),l=n(67088),c=n(50250),u=n(26461),d=n(11728),p=n(69932),h=n(41353),f=n(83632),m=n(5995),g=n(66939),b=n(54715),y=n(31675),v=n(41025),w=n(65631);function x(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new a(e)}x.plugin=function(e,t){let n,r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": \u91cc\u9762 postcss.plugin \u88ab\u5f03\u7528. \u8fc1\u79fb\u6307\u5357:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new a).version,i}return Object.defineProperty(i,"postcss",{get:()=>(n||(n=i()),n)}),i.process=function(e,t,n){return x([i(n)]).process(e,t)},i},x.stringify=l,x.parse=g,x.fromJSON=c,x.list=b,x.comment=e=>new p(e),x.atRule=e=>new h(e),x.decl=e=>new i(e),x.rule=e=>new y(e),x.root=e=>new v(e),x.document=e=>new u(e),x.CssSyntaxError=r,x.Declaration=i,x.Container=s,x.Processor=a,x.Document=u,x.Comment=p,x.Warning=d,x.AtRule=h,x.Result=f,x.Input=m,x.Rule=y,x.Root=v,x.Node=w,o.registerPostcss(x),e.exports=x,x.default=x},47981:(e,t,n)=>{"use strict";let{SourceMapConsumer:r,SourceMapGenerator:i}=n(70209),{existsSync:o,readFileSync:s}=n(14777),{dirname:a,join:l}=n(99830);class c{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=a(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=a(e),o(e))return this.mapFile=e,s(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=l(a(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}e.exports=c,c.default=c},71723:(e,t,n)=>{"use strict";let r=n(47647),i=n(21939),o=n(26461),s=n(41025);class a{constructor(e=[]){this.version="8.4.31",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin")}return t}process(e,t={}){return 0===this.plugins.length&&void 0===t.parser&&void 0===t.stringifier&&void 0===t.syntax?new r(this,e,t):new i(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=a,a.default=a,s.registerProcessor(a),o.registerProcessor(a)},83632:(e,t,n)=>{"use strict";let r=n(11728);class i{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new r(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}}e.exports=i,i.default=i},41025:(e,t,n)=>{"use strict";let r,i,o=n(21019);class s extends o{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let i of r)i.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new r(new i,this,e).stringify()}}s.registerLazyResult=e=>{r=e},s.registerProcessor=e=>{i=e},e.exports=s,s.default=s,o.registerRoot(s)},31675:(e,t,n)=>{"use strict";let r=n(21019),i=n(54715);class o extends r{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return i.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}e.exports=o,o.default=o,r.registerRule(o)},1062:e=>{"use strict";const t={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class n{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,n,r){let i;if(r||(r=n),n&&(i=e.raws[n],void 0!==i))return i;let o=e.parent;if("before"===r){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return t[r];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[r])return s.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let t="raw"+((a=r)[0].toUpperCase()+a.slice(1));this[t]?i=this[t](s,e):s.walk((e=>{if(i=e.raws[n],void 0!==i)return!1}))}var a;return void 0===i&&(i=t[r]),s.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}e.exports=n,n.default=n},67088:(e,t,n)=>{"use strict";let r=n(1062);function i(e,t){new r(t).stringify(e)}e.exports=i,i.default=i},65513:e=>{"use strict";e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},83852:e=>{"use strict";const t="'".charCodeAt(0),n='"'.charCodeAt(0),r="\\".charCodeAt(0),i="/".charCodeAt(0),o="\n".charCodeAt(0),s=" ".charCodeAt(0),a="\f".charCodeAt(0),l="\t".charCodeAt(0),c="\r".charCodeAt(0),u="[".charCodeAt(0),d="]".charCodeAt(0),p="(".charCodeAt(0),h=")".charCodeAt(0),f="{".charCodeAt(0),m="}".charCodeAt(0),g=";".charCodeAt(0),b="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,x=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,E=/[\da-f]/i;e.exports=function(e,T={}){let C,k,A,O,N,_,D,I,L,P,$=e.css.valueOf(),j=T.ignoreErrors,R=$.length,q=0,M=[],B=[];function F(t){throw e.error("Unclosed "+t,q)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&q>=R},nextToken:function(e){if(B.length)return B.pop();if(q>=R)return;let T=!!e&&e.ignoreUnclosed;switch(C=$.charCodeAt(q),C){case o:case s:case l:case c:case a:k=q;do{k+=1,C=$.charCodeAt(k)}while(C===s||C===o||C===l||C===c||C===a);P=["space",$.slice(q,k)],q=k-1;break;case u:case d:case f:case m:case y:case g:case h:{let e=String.fromCharCode(C);P=[e,e,q];break}case p:if(I=M.length?M.pop()[1]:"",L=$.charCodeAt(q+1),"url"===I&&L!==t&&L!==n&&L!==s&&L!==o&&L!==l&&L!==a&&L!==c){k=q;do{if(_=!1,k=$.indexOf(")",k+1),-1===k){if(j||T){k=q;break}F("bracket")}for(D=k;$.charCodeAt(D-1)===r;)D-=1,_=!_}while(_);P=["brackets",$.slice(q,k+1),q,k],q=k}else k=$.indexOf(")",q+1),O=$.slice(q,k+1),-1===k||S.test(O)?P=["(","(",q]:(P=["brackets",O,q,k],q=k);break;case t:case n:A=C===t?"'":'"',k=q;do{if(_=!1,k=$.indexOf(A,k+1),-1===k){if(j||T){k=q+1;break}F("string")}for(D=k;$.charCodeAt(D-1)===r;)D-=1,_=!_}while(_);P=["string",$.slice(q,k+1),q,k],q=k;break;case v:w.lastIndex=q+1,w.test($),k=0===w.lastIndex?$.length-1:w.lastIndex-2,P=["at-word",$.slice(q,k+1),q,k],q=k;break;case r:for(k=q,N=!0;$.charCodeAt(k+1)===r;)k+=1,N=!N;if(C=$.charCodeAt(k+1),N&&C!==i&&C!==s&&C!==o&&C!==l&&C!==c&&C!==a&&(k+=1,E.test($.charAt(k)))){for(;E.test($.charAt(k+1));)k+=1;$.charCodeAt(k+1)===s&&(k+=1)}P=["word",$.slice(q,k+1),q,k],q=k;break;default:C===i&&$.charCodeAt(q+1)===b?(k=$.indexOf("*/",q+2)+1,0===k&&(j||T?k=$.length:F("comment")),P=["comment",$.slice(q,k+1),q,k],q=k):(x.lastIndex=q+1,x.test($),k=0===x.lastIndex?$.length-1:x.lastIndex-2,P=["word",$.slice(q,k+1),q,k],M.push(P),q=k)}return q++,P},position:function(){return q}}}},72448:e=>{"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},11728:e=>{"use strict";class t{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let n in t)this[n]=t[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},91036:(e,t,n)=>{const r=n(23719),i=n(63150),{isPlainObject:o}=n(26057),s=n(9996),a=n(79430),{parse:l}=n(50020),c=["img","audio","video","picture","svg","object","map","iframe","embed"],u=["script","style"];function d(e,t){e&&Object.keys(e).forEach((function(n){t(e[n],n)}))}function p(e,t){return{}.hasOwnProperty.call(e,t)}function h(e,t){const n=[];return d(e,(function(e){t(e)&&n.push(e)})),n}e.exports=m;const f=/^[^\0\t\n\f\r /<=>]+$/;function m(e,t,n){if(null==e)return"";"number"==typeof e&&(e=e.toString());let b="",y="";function v(e,t){const n=this;this.tag=e,this.attribs=t||{},this.tagPosition=b.length,this.text="",this.mediaChildren=[],this.updateParentNodeText=function(){if(_.length){_[_.length-1].text+=n.text}},this.updateParentNodeMediaChildren=function(){if(_.length&&c.includes(this.tag)){_[_.length-1].mediaChildren.push(this.tag)}}}(t=Object.assign({},m.defaults,t)).parser=Object.assign({},g,t.parser);const w=function(e){return!1===t.allowedTags||(t.allowedTags||[]).indexOf(e)>-1};u.forEach((function(e){w(e)&&!t.allowVulnerableTags&&console.warn(`\n\n\u26a0\ufe0f Your \`allowedTags\` option includes, \`${e}\`, which is inherently\nvulnerable to XSS attacks. Please remove it from \`allowedTags\`.\nOr, to disable this warning, add the \`allowVulnerableTags\` option\nand ensure you are accounting for this risk.\n\n`)}));const x=t.nonTextTags||["script","style","textarea","option"];let S,E;t.allowedAttributes&&(S={},E={},d(t.allowedAttributes,(function(e,t){S[t]=[];const n=[];e.forEach((function(e){"string"==typeof e&&e.indexOf("*")>=0?n.push(i(e).replace(/\\\*/g,".*")):S[t].push(e)})),n.length&&(E[t]=new RegExp("^("+n.join("|")+")$"))})));const T={},C={},k={};d(t.allowedClasses,(function(e,t){if(S&&(p(S,t)||(S[t]=[]),S[t].push("class")),T[t]=e,Array.isArray(e)){const n=[];T[t]=[],k[t]=[],e.forEach((function(e){"string"==typeof e&&e.indexOf("*")>=0?n.push(i(e).replace(/\\\*/g,".*")):e instanceof RegExp?k[t].push(e):T[t].push(e)})),n.length&&(C[t]=new RegExp("^("+n.join("|")+")$"))}}));const A={};let O,N,_,D,I,L,P;d(t.transformTags,(function(e,t){let n;"function"==typeof e?n=e:"string"==typeof e&&(n=m.simpleTransform(e)),"*"===t?O=n:A[t]=n}));let $=!1;R();const j=new r.Parser({onopentag:function(e,n){if(t.enforceHtmlBoundary&&"html"===e&&R(),L)return void P++;const r=new v(e,n);_.push(r);let i=!1;const c=!!r.text;let u;if(p(A,e)&&(u=A[e](e,n),r.attribs=n=u.attribs,void 0!==u.text&&(r.innerText=u.text),e!==u.tagName&&(r.name=e=u.tagName,I[N]=u.tagName)),O&&(u=O(e,n),r.attribs=n=u.attribs,e!==u.tagName&&(r.name=e=u.tagName,I[N]=u.tagName)),(!w(e)||"recursiveEscape"===t.disallowedTagsMode&&!function(e){for(const t in e)if(p(e,t))return!1;return!0}(D)||null!=t.nestingLimit&&N>=t.nestingLimit)&&(i=!0,D[N]=!0,"discard"===t.disallowedTagsMode&&-1!==x.indexOf(e)&&(L=!0,P=1),D[N]=!0),N++,i){if("discard"===t.disallowedTagsMode)return;y=b,b=""}b+="<"+e,"script"===e&&(t.allowedScriptHostnames||t.allowedScriptDomains)&&(r.innerText=""),(!S||p(S,e)||S["*"])&&d(n,(function(n,i){if(!f.test(i))return void delete r.attribs[i];if(""===n&&(t.nonBooleanAttributes.includes(i)||t.nonBooleanAttributes.includes("*")))return void delete r.attribs[i];let c=!1;if(!S||p(S,e)&&-1!==S[e].indexOf(i)||S["*"]&&-1!==S["*"].indexOf(i)||p(E,e)&&E[e].test(i)||E["*"]&&E["*"].test(i))c=!0;else if(S&&S[e])for(const t of S[e])if(o(t)&&t.name&&t.name===i){c=!0;let e="";if(!0===t.multiple){const r=n.split(" ");for(const n of r)-1!==t.values.indexOf(n)&&(""===e?e=n:e+=" "+n)}else t.values.indexOf(n)>=0&&(e=n);n=e}if(c){if(-1!==t.allowedSchemesAppliedToAttributes.indexOf(i)&&M(e,n))return void delete r.attribs[i];if("script"===e&&"src"===i){let e=!0;try{const r=B(n);if(t.allowedScriptHostnames||t.allowedScriptDomains){const n=(t.allowedScriptHostnames||[]).find((function(e){return e===r.url.hostname})),i=(t.allowedScriptDomains||[]).find((function(e){return r.url.hostname===e||r.url.hostname.endsWith(`.${e}`)}));e=n||i}}catch(u){e=!1}if(!e)return void delete r.attribs[i]}if("iframe"===e&&"src"===i){let e=!0;try{const r=B(n);if(r.isRelativeUrl)e=p(t,"allowIframeRelativeUrls")?t.allowIframeRelativeUrls:!t.allowedIframeHostnames&&!t.allowedIframeDomains;else if(t.allowedIframeHostnames||t.allowedIframeDomains){const n=(t.allowedIframeHostnames||[]).find((function(e){return e===r.url.hostname})),i=(t.allowedIframeDomains||[]).find((function(e){return r.url.hostname===e||r.url.hostname.endsWith(`.${e}`)}));e=n||i}}catch(u){e=!1}if(!e)return void delete r.attribs[i]}if("srcset"===i)try{let e=a(n);if(e.forEach((function(e){M("srcset",e.url)&&(e.evil=!0)})),e=h(e,(function(e){return!e.evil})),!e.length)return void delete r.attribs[i];n=h(e,(function(e){return!e.evil})).map((function(e){if(!e.url)throw new Error("URL missing");return e.url+(e.w?` ${e.w}w`:"")+(e.h?` ${e.h}h`:"")+(e.d?` ${e.d}x`:"")})).join(", "),r.attribs[i]=n}catch(u){return void delete r.attribs[i]}if("class"===i){const t=T[e],o=T["*"],a=C[e],l=k[e],c=[a,C["*"]].concat(l).filter((function(e){return e}));if(!(n=F(n,t&&o?s(t,o):t||o,c)).length)return void delete r.attribs[i]}if("style"===i)if(t.parseStyleAttributes)try{const o=function(e,t){if(!t)return e;const n=e.nodes[0];let r;r=t[n.selector]&&t["*"]?s(t[n.selector],t["*"]):t[n.selector]||t["*"];r&&(e.nodes[0].nodes=n.nodes.reduce(function(e){return function(t,n){if(p(e,n.prop)){e[n.prop].some((function(e){return e.test(n.value)}))&&t.push(n)}return t}}(r),[]));return e}(l(e+" {"+n+"}"),t.allowedStyles);if(n=function(e){return e.nodes[0].nodes.reduce((function(e,t){return e.push(`${t.prop}:${t.value}${t.important?" !important":""}`),e}),[]).join(";")}(o),0===n.length)return void delete r.attribs[i]}catch(u){return"undefined"!=typeof window&&console.warn('Failed to parse "'+e+" {"+n+"}\", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547"),void delete r.attribs[i]}else if(t.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.");b+=" "+i,n&&n.length&&(b+='="'+q(n,!0)+'"')}else delete r.attribs[i]})),-1!==t.selfClosing.indexOf(e)?b+=" />":(b+=">",!r.innerText||c||t.textFilter||(b+=q(r.innerText),$=!0)),i&&(b=y+q(b),y="")},ontext:function(e){if(L)return;const n=_[_.length-1];let r;if(n&&(r=n.tag,e=void 0!==n.innerText?n.innerText:e),"discard"!==t.disallowedTagsMode||"script"!==r&&"style"!==r){const n=q(e,!1);t.textFilter&&!$?b+=t.textFilter(n,r):$||(b+=n)}else b+=e;if(_.length){_[_.length-1].text+=e}},onclosetag:function(e,n){if(L){if(P--,P)return;L=!1}const r=_.pop();if(!r)return;if(r.tag!==e)return void _.push(r);L=!!t.enforceHtmlBoundary&&"html"===e,N--;const i=D[N];if(i){if(delete D[N],"discard"===t.disallowedTagsMode)return void r.updateParentNodeText();y=b,b=""}I[N]&&(e=I[N],delete I[N]),t.exclusiveFilter&&t.exclusiveFilter(r)?b=b.substr(0,r.tagPosition):(r.updateParentNodeMediaChildren(),r.updateParentNodeText(),-1!==t.selfClosing.indexOf(e)||n&&!w(e)&&["escape","recursiveEscape"].indexOf(t.disallowedTagsMode)>=0?i&&(b=y,y=""):(b+="</"+e+">",i&&(b=y+q(b),y=""),$=!1))}},t.parser);return j.write(e),j.end(),b;function R(){b="",N=0,_=[],D={},I={},L=!1,P=0}function q(e,n){return"string"!=typeof e&&(e+=""),t.parser.decodeEntities&&(e=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),n&&(e=e.replace(/"/g,"""))),e=e.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(/</g,"<").replace(/>/g,">"),n&&(e=e.replace(/"/g,""")),e}function M(e,n){for(n=n.replace(/[\x00-\x20]+/g,"");;){const e=n.indexOf("\x3c!--");if(-1===e)break;const t=n.indexOf("--\x3e",e+4);if(-1===t)break;n=n.substring(0,e)+n.substring(t+3)}const r=n.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!r)return!!n.match(/^[/\\]{2}/)&&!t.allowProtocolRelative;const i=r[1].toLowerCase();return p(t.allowedSchemesByTag,e)?-1===t.allowedSchemesByTag[e].indexOf(i):!t.allowedSchemes||-1===t.allowedSchemes.indexOf(i)}function B(e){if((e=e.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//")).startsWith("relative:"))throw new Error("relative: exploit attempt");let t="relative://relative-site";for(let r=0;r<100;r++)t+=`/${r}`;const n=new URL(e,t);return{isRelativeUrl:n&&"relative-site"===n.hostname&&"relative:"===n.protocol,url:n}}function F(e,t,n){return t?(e=e.split(/\s+/)).filter((function(e){return-1!==t.indexOf(e)||n.some((function(t){return t.test(e)}))})).join(" "):e}}const g={decodeEntities:!0};m.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","main","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0},m.simpleTransform=function(e,t,n){return n=void 0===n||n,t=t||{},function(r,i){let o;if(n)for(o in t)i[o]=t[o];else i=t;return{tagName:e,attribs:i}}}},22868:()=>{},14777:()=>{},99830:()=>{},70209:()=>{},87414:()=>{},62961:e=>{e.exports={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}}}}]); \ No newline at end of file diff --git a/assets/js/common.faa7560d.js b/assets/js/common.faa7560d.js new file mode 100644 index 000000000..eb9887c36 --- /dev/null +++ b/assets/js/common.faa7560d.js @@ -0,0 +1,2 @@ +/*! For license information please see common.faa7560d.js.LICENSE.txt */ +(self.webpackChunkopenfga_dev=self.webpackChunkopenfga_dev||[]).push([[8592],{3905:(e,t,n)=>{"use strict";n.d(t,{Zo:()=>u,kt:()=>f});var r=n(67294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),c=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},u=function(e){var t=c(e.components);return r.createElement(l.Provider,{value:t},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},h=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,o=e.originalType,l=e.parentName,u=a(e,["components","mdxType","originalType","parentName"]),d=c(n),h=i,f=d["".concat(l,".").concat(h)]||d[h]||p[h]||o;return n?r.createElement(f,s(s({ref:t},u),{},{components:n})):r.createElement(f,s({ref:t},u))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=n.length,s=new Array(o);s[0]=h;var a={};for(var l in t)hasOwnProperty.call(t,l)&&(a[l]=t[l]);a.originalType=e,a[d]="string"==typeof e?e:i,s[1]=a;for(var c=2;c<o;c++)s[c]=n[c];return r.createElement.apply(null,s)}return r.createElement.apply(null,n)}h.displayName="MDXCreateElement"},46242:(e,t)=>{"use strict";function n(e,t){if(t)return e;throw new Error("Unhandled discriminated union member: "+JSON.stringify(e))}t.ZP=n},23612:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(67294),i=n(34334),o=n(35281),s=n(95999);const a={admonition:"admonition_LlT9",admonitionHeading:"admonitionHeading_tbUL",admonitionIcon:"admonitionIcon_kALy",admonitionContent:"admonitionContent_S0QG"};const l={note:{infimaClassName:"secondary",iconComponent:function(){return r.createElement("svg",{viewBox:"0 0 14 16"},r.createElement("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"}))},label:r.createElement(s.Z,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)"},"note")},tip:{infimaClassName:"success",iconComponent:function(){return r.createElement("svg",{viewBox:"0 0 12 16"},r.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))},label:r.createElement(s.Z,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)"},"tip")},danger:{infimaClassName:"danger",iconComponent:function(){return r.createElement("svg",{viewBox:"0 0 12 16"},r.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"}))},label:r.createElement(s.Z,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)"},"danger")},info:{infimaClassName:"info",iconComponent:function(){return r.createElement("svg",{viewBox:"0 0 14 16"},r.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))},label:r.createElement(s.Z,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)"},"info")},caution:{infimaClassName:"warning",iconComponent:function(){return r.createElement("svg",{viewBox:"0 0 16 16"},r.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"}))},label:r.createElement(s.Z,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)"},"caution")}},c={secondary:"note",important:"info",success:"tip",warning:"danger"};function u(e){const{mdxAdmonitionTitle:t,rest:n}=function(e){const t=r.Children.toArray(e),n=t.find((e=>r.isValidElement(e)&&"mdxAdmonitionTitle"===e.props?.mdxType)),i=r.createElement(r.Fragment,null,t.filter((e=>e!==n)));return{mdxAdmonitionTitle:n,rest:i}}(e.children);return{...e,title:e.title??t,children:n}}function d(e){const{children:t,type:n,title:s,icon:d}=u(e),p=function(e){const t=c[e]??e,n=l[t];return n||(console.warn(`No admonition config found for admonition type "${t}". Using Info as fallback.`),l.info)}(n),h=s??p.label,{iconComponent:f}=p,m=d??r.createElement(f,null);return r.createElement("div",{className:(0,i.Z)(o.k.common.admonition,o.k.common.admonitionType(e.type),"alert",`alert--${p.infimaClassName}`,a.admonition)},r.createElement("div",{className:a.admonitionHeading},r.createElement("span",{className:a.admonitionIcon},m),h),r.createElement("div",{className:a.admonitionContent},t))}},74464:(e,t,n)=>{"use strict";n.d(t,{Z:()=>G});var r=n(87462),i=n(67294),o=n(72389),s=n(34334),a=n(92949),l=n(86668);function c(){const{prism:e}=(0,l.L)(),{colorMode:t}=(0,a.I)(),n=e.theme,r=e.darkTheme||n;return"dark"===t?r:n}var u=n(35281),d=n(87594),p=n.n(d);const h=/title=(?<quote>["'])(?<title>.*?)\1/,f=/\{(?<range>[\d,-]+)\}/,m={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}};function g(e,t){const n=e.map((e=>{const{start:n,end:r}=m[e];return`(?:${n}\\s*(${t.flatMap((e=>[e.line,e.block?.start,e.block?.end].filter(Boolean))).join("|")})\\s*${r})`})).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)}function b(e,t){let n=e.replace(/\n$/,"");const{language:r,magicComments:i,metastring:o}=t;if(o&&f.test(o)){const e=o.match(f).groups.range;if(0===i.length)throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${o}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);const t=i[0].className,r=p()(e).filter((e=>e>0)).map((e=>[e-1,[t]]));return{lineClassNames:Object.fromEntries(r),code:n}}if(void 0===r)return{lineClassNames:{},code:n};const s=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return g(["js","jsBlock"],t);case"jsx":case"tsx":return g(["js","jsBlock","jsx"],t);case"html":return g(["js","jsBlock","html"],t);case"python":case"py":case"bash":return g(["bash"],t);case"markdown":case"md":return g(["html","jsx","bash"],t);default:return g(Object.keys(m),t)}}(r,i),a=n.split("\n"),l=Object.fromEntries(i.map((e=>[e.className,{start:0,range:""}]))),c=Object.fromEntries(i.filter((e=>e.line)).map((e=>{let{className:t,line:n}=e;return[n,t]}))),u=Object.fromEntries(i.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.start,t]}))),d=Object.fromEntries(i.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.end,t]})));for(let p=0;p<a.length;){const e=a[p].match(s);if(!e){p+=1;continue}const t=e.slice(1).find((e=>void 0!==e));c[t]?l[c[t]].range+=`${p},`:u[t]?l[u[t]].start=p:d[t]&&(l[d[t]].range+=`${l[d[t]].start}-${p-1},`),a.splice(p,1)}n=a.join("\n");const h={};return Object.entries(l).forEach((e=>{let[t,{range:n}]=e;p()(n).forEach((e=>{h[e]??=[],h[e].push(t)}))})),{lineClassNames:h,code:n}}const y={codeBlockContainer:"codeBlockContainer_Ckt0"};function v(e){let{as:t,...n}=e;const o=function(e){const t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach((e=>{let[r,i]=e;const o=t[r];o&&"string"==typeof i&&(n[o]=i)})),n}(c());return i.createElement(t,(0,r.Z)({},n,{style:o,className:(0,s.Z)(n.className,y.codeBlockContainer,u.k.common.codeBlock)}))}const w={codeBlockContent:"codeBlockContent_biex",codeBlockTitle:"codeBlockTitle_Ktv7",codeBlock:"codeBlock_bY9V",codeBlockStandalone:"codeBlockStandalone_MEMb",codeBlockLines:"codeBlockLines_e6Vv",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_o6Pm",buttonGroup:"buttonGroup__atx"};function x(e){let{children:t,className:n}=e;return i.createElement(v,{as:"pre",tabIndex:0,className:(0,s.Z)(w.codeBlockStandalone,"thin-scrollbar",n)},i.createElement("code",{className:w.codeBlockLines},t))}var S=n(902);const E={attributes:!0,characterData:!0,childList:!0,subtree:!0};function T(e,t){const[n,r]=(0,i.useState)(),o=(0,i.useCallback)((()=>{r(e.current?.closest("[role=tabpanel][hidden]"))}),[e,r]);(0,i.useEffect)((()=>{o()}),[o]),function(e,t,n){void 0===n&&(n=E);const r=(0,S.zX)(t),o=(0,S.Ql)(n);(0,i.useEffect)((()=>{const t=new MutationObserver(r);return e&&t.observe(e,o),()=>t.disconnect()}),[e,r,o])}(n,(e=>{e.forEach((e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),o())}))}),{attributes:!0,characterData:!1,childList:!1,subtree:!1})}const C={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]};var k={Prism:n(11205).Z,theme:C};function A(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(){return O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(this,arguments)}var N=/\r\n|\r|\n/,_=function(e){0===e.length?e.push({types:["plain"],content:"\n",empty:!0}):1===e.length&&""===e[0].content&&(e[0].content="\n",e[0].empty=!0)},D=function(e,t){var n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)};function I(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}var L=function(e){function t(){for(var t=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];e.apply(this,n),A(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var n=e.theme?function(e,t){var n=e.plain,r=Object.create(null),i=e.styles.reduce((function(e,n){var r=n.languages,i=n.style;return r&&!r.includes(t)||n.types.forEach((function(t){var n=O({},e[t],i);e[t]=n})),e}),r);return i.root=n,i.plain=O({},n,{backgroundColor:null}),i}(e.theme,e.language):void 0;return t.themeDict=n})),A(this,"getLineProps",(function(e){var n=e.key,r=e.className,i=e.style,o=O({},I(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),s=t.getThemeDict(t.props);return void 0!==s&&(o.style=s.plain),void 0!==i&&(o.style=void 0!==o.style?O({},o.style,i):i),void 0!==n&&(o.key=n),r&&(o.className+=" "+r),o})),A(this,"getStyleForToken",(function(e){var n=e.types,r=e.empty,i=n.length,o=t.getThemeDict(t.props);if(void 0!==o){if(1===i&&"plain"===n[0])return r?{display:"inline-block"}:void 0;if(1===i&&!r)return o[n[0]];var s=r?{display:"inline-block"}:{},a=n.map((function(e){return o[e]}));return Object.assign.apply(Object,[s].concat(a))}})),A(this,"getTokenProps",(function(e){var n=e.key,r=e.className,i=e.style,o=e.token,s=O({},I(e,["key","className","style","token"]),{className:"token "+o.types.join(" "),children:o.content,style:t.getStyleForToken(o),key:void 0});return void 0!==i&&(s.style=void 0!==s.style?O({},s.style,i):i),void 0!==n&&(s.key=n),r&&(s.className+=" "+r),s})),A(this,"tokenize",(function(e,t,n,r){var i={code:t,grammar:n,language:r,tokens:[]};e.hooks.run("before-tokenize",i);var o=i.tokens=e.tokenize(i.code,i.grammar,i.language);return e.hooks.run("after-tokenize",i),o}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,n=e.language,r=e.code,i=e.children,o=this.getThemeDict(this.props),s=t.languages[n];return i({tokens:function(e){for(var t=[[]],n=[e],r=[0],i=[e.length],o=0,s=0,a=[],l=[a];s>-1;){for(;(o=r[s]++)<i[s];){var c=void 0,u=t[s],d=n[s][o];if("string"==typeof d?(u=s>0?u:["plain"],c=d):(u=D(u,d.type),d.alias&&(u=D(u,d.alias)),c=d.content),"string"==typeof c){var p=c.split(N),h=p.length;a.push({types:u,content:p[0]});for(var f=1;f<h;f++)_(a),l.push(a=[]),a.push({types:u,content:p[f]})}else s++,t.push(u),n.push(c),r.push(0),i.push(c.length)}s--,t.pop(),n.pop(),r.pop(),i.pop()}return _(a),l}(void 0!==s?this.tokenize(t,r,s,n):[r]),className:"prism-code language-"+n,style:void 0!==o?o.root:{},getLineProps:this.getLineProps,getTokenProps:this.getTokenProps})},t}(i.Component);const P=L,$={codeLine:"codeLine_lJS_",codeLineNumber:"codeLineNumber_Tfdd",codeLineContent:"codeLineContent_feaV"};function j(e){let{line:t,classNames:n,showLineNumbers:o,getLineProps:a,getTokenProps:l}=e;1===t.length&&"\n"===t[0].content&&(t[0].content="");const c=a({line:t,className:(0,s.Z)(n,o&&$.codeLine)}),u=t.map(((e,t)=>i.createElement("span",(0,r.Z)({key:t},l({token:e,key:t})))));return i.createElement("span",c,o?i.createElement(i.Fragment,null,i.createElement("span",{className:$.codeLineNumber}),i.createElement("span",{className:$.codeLineContent},u)):u,i.createElement("br",null))}var R=n(95999);function q(e){return i.createElement("svg",(0,r.Z)({viewBox:"0 0 24 24"},e),i.createElement("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"}))}function M(e){return i.createElement("svg",(0,r.Z)({viewBox:"0 0 24 24"},e),i.createElement("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))}const B={copyButtonCopied:"copyButtonCopied_obH4",copyButtonIcons:"copyButtonIcons_eSgA",copyButtonIcon:"copyButtonIcon_y97N",copyButtonSuccessIcon:"copyButtonSuccessIcon_LjdS"};function F(e){let{code:t,className:n}=e;const[r,o]=(0,i.useState)(!1),a=(0,i.useRef)(void 0),l=(0,i.useCallback)((()=>{!function(e,t){let{target:n=document.body}=void 0===t?{}:t;if("string"!=typeof e)throw new TypeError(`Expected parameter \`text\` to be a \`string\`, got \`${typeof e}\`.`);const r=document.createElement("textarea"),i=document.activeElement;r.value=e,r.setAttribute("readonly",""),r.style.contain="strict",r.style.position="absolute",r.style.left="-9999px",r.style.fontSize="12pt";const o=document.getSelection(),s=o.rangeCount>0&&o.getRangeAt(0);n.append(r),r.select(),r.selectionStart=0,r.selectionEnd=e.length;let a=!1;try{a=document.execCommand("copy")}catch{}r.remove(),s&&(o.removeAllRanges(),o.addRange(s)),i&&i.focus()}(t),o(!0),a.current=window.setTimeout((()=>{o(!1)}),1e3)}),[t]);return(0,i.useEffect)((()=>()=>window.clearTimeout(a.current)),[]),i.createElement("button",{type:"button","aria-label":r?(0,R.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,R.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,R.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,s.Z)("clean-btn",n,B.copyButton,r&&B.copyButtonCopied),onClick:l},i.createElement("span",{className:B.copyButtonIcons,"aria-hidden":"true"},i.createElement(q,{className:B.copyButtonIcon}),i.createElement(M,{className:B.copyButtonSuccessIcon})))}function U(e){return i.createElement("svg",(0,r.Z)({viewBox:"0 0 24 24"},e),i.createElement("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"}))}const H={wordWrapButtonIcon:"wordWrapButtonIcon_Bwma",wordWrapButtonEnabled:"wordWrapButtonEnabled_EoeP"};function z(e){let{className:t,onClick:n,isEnabled:r}=e;const o=(0,R.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return i.createElement("button",{type:"button",onClick:n,className:(0,s.Z)("clean-btn",t,r&&H.wordWrapButtonEnabled),"aria-label":o,title:o},i.createElement(U,{className:H.wordWrapButtonIcon,"aria-hidden":"true"}))}function V(e){let{children:t,className:n="",metastring:o,title:a,showLineNumbers:u,language:d}=e;const{prism:{defaultLanguage:p,magicComments:f}}=(0,l.L)(),m=d??function(e){const t=e.split(" ").find((e=>e.startsWith("language-")));return t?.replace(/language-/,"")}(n)??p,g=c(),y=function(){const[e,t]=(0,i.useState)(!1),[n,r]=(0,i.useState)(!1),o=(0,i.useRef)(null),s=(0,i.useCallback)((()=>{const n=o.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t((e=>!e))}),[o,e]),a=(0,i.useCallback)((()=>{const{scrollWidth:e,clientWidth:t}=o.current,n=e>t||o.current.querySelector("code").hasAttribute("style");r(n)}),[o]);return T(o,a),(0,i.useEffect)((()=>{a()}),[e,a]),(0,i.useEffect)((()=>(window.addEventListener("resize",a,{passive:!0}),()=>{window.removeEventListener("resize",a)})),[a]),{codeBlockRef:o,isEnabled:e,isCodeScrollable:n,toggle:s}}(),x=function(e){return e?.match(h)?.groups.title??""}(o)||a,{lineClassNames:S,code:E}=b(t,{metastring:o,language:m,magicComments:f}),C=u??function(e){return Boolean(e?.includes("showLineNumbers"))}(o);return i.createElement(v,{as:"div",className:(0,s.Z)(n,m&&!n.includes(`language-${m}`)&&`language-${m}`)},x&&i.createElement("div",{className:w.codeBlockTitle},x),i.createElement("div",{className:w.codeBlockContent},i.createElement(P,(0,r.Z)({},k,{theme:g,code:E,language:m??"text"}),(e=>{let{className:t,tokens:n,getLineProps:r,getTokenProps:o}=e;return i.createElement("pre",{tabIndex:0,ref:y.codeBlockRef,className:(0,s.Z)(t,w.codeBlock,"thin-scrollbar")},i.createElement("code",{className:(0,s.Z)(w.codeBlockLines,C&&w.codeBlockLinesWithNumbering)},n.map(((e,t)=>i.createElement(j,{key:t,line:e,getLineProps:r,getTokenProps:o,classNames:S[t],showLineNumbers:C})))))})),i.createElement("div",{className:w.buttonGroup},(y.isEnabled||y.isCodeScrollable)&&i.createElement(z,{className:w.codeButton,onClick:()=>y.toggle(),isEnabled:y.isEnabled}),i.createElement(F,{className:w.codeButton,code:E}))))}function G(e){let{children:t,...n}=e;const s=(0,o.Z)(),a=function(e){return i.Children.toArray(e).some((e=>(0,i.isValidElement)(e)))?e:Array.isArray(e)?e.join(""):e}(t),l="string"==typeof a?V:x;return i.createElement(l,(0,r.Z)({key:String(s)},n),a)}},34673:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(87462),i=n(67294),o=n(34334),s=n(87459),a=n(72389),l=n(86043);const c={details:"details_lb9f",isBrowser:"isBrowser_bmU9",collapsibleContent:"collapsibleContent_i85q"};function u(e){return!!e&&("SUMMARY"===e.tagName||u(e.parentElement))}function d(e,t){return!!e&&(e===t||d(e.parentElement,t))}function p(e){let{summary:t,children:n,...o}=e;const p=(0,a.Z)(),h=(0,i.useRef)(null),{collapsed:f,setCollapsed:m}=(0,l.u)({initialState:!o.open}),[g,b]=(0,i.useState)(o.open),y=i.isValidElement(t)?t:i.createElement("summary",null,t??"Details");return i.createElement("details",(0,r.Z)({},o,{ref:h,open:g,"data-collapsed":f,className:(0,s.Z)(c.details,p&&c.isBrowser,o.className),onMouseDown:e=>{u(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const t=e.target;u(t)&&d(t,h.current)&&(e.preventDefault(),f?(m(!1),b(!0)):m(!0))}}),y,i.createElement(l.z,{lazy:!1,collapsed:f,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{m(e),b(!e)}},i.createElement("div",{className:c.collapsibleContent},n)))}const h={details:"details_b_Ee"},f="alert alert--info";function m(e){let{...t}=e;return i.createElement(p,(0,r.Z)({},t,{className:(0,o.Z)(f,h.details,t.className)}))}},85162:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(67294),i=n(34334);const o={tabItem:"tabItem_Ymn6"};function s(e){let{children:t,hidden:n,className:s}=e;return r.createElement("div",{role:"tabpanel",className:(0,i.Z)(o.tabItem,s),hidden:n},t)}},74866:(e,t,n)=>{"use strict";n.d(t,{Z:()=>x});var r=n(87462),i=n(67294),o=n(34334),s=n(12466),a=n(16550),l=n(91980),c=n(67392),u=n(50012);function d(e){return function(e){return i.Children.map(e,(e=>{if(!e||(0,i.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))?.filter(Boolean)??[]}(e).map((e=>{let{props:{value:t,label:n,attributes:r,default:i}}=e;return{value:t,label:n,attributes:r,default:i}}))}function p(e){const{values:t,children:n}=e;return(0,i.useMemo)((()=>{const e=t??d(n);return function(e){const t=(0,c.l)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>e.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[t,n])}function h(e){let{value:t,tabValues:n}=e;return n.some((e=>e.value===t))}function f(e){let{queryString:t=!1,groupId:n}=e;const r=(0,a.k6)(),o=function(e){let{queryString:t=!1,groupId:n}=e;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!n)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:t,groupId:n});return[(0,l._X)(o),(0,i.useCallback)((e=>{if(!o)return;const t=new URLSearchParams(r.location.search);t.set(o,e),r.replace({...r.location,search:t.toString()})}),[o,r])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:r}=e,o=p(e),[s,a]=(0,i.useState)((()=>function(e){let{defaultValue:t,tabValues:n}=e;if(0===n.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(t){if(!h({value:t,tabValues:n}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${t}" but none of its children has the corresponding value. Available values are: ${n.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return t}const r=n.find((e=>e.default))??n[0];if(!r)throw new Error("Unexpected error: 0 tabValues");return r.value}({defaultValue:t,tabValues:o}))),[l,c]=f({queryString:n,groupId:r}),[d,m]=function(e){let{groupId:t}=e;const n=function(e){return e?`docusaurus.tab.${e}`:null}(t),[r,o]=(0,u.Nk)(n);return[r,(0,i.useCallback)((e=>{n&&o.set(e)}),[n,o])]}({groupId:r}),g=(()=>{const e=l??d;return h({value:e,tabValues:o})?e:null})();(0,i.useLayoutEffect)((()=>{g&&a(g)}),[g]);return{selectedValue:s,selectValue:(0,i.useCallback)((e=>{if(!h({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);a(e),c(e),m(e)}),[c,m,o]),tabValues:o}}var g=n(72389);const b={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function y(e){let{className:t,block:n,selectedValue:a,selectValue:l,tabValues:c}=e;const u=[],{blockElementScrollPositionUntilNextRender:d}=(0,s.o5)(),p=e=>{const t=e.currentTarget,n=u.indexOf(t),r=c[n].value;r!==a&&(d(t),l(r))},h=e=>{let t=null;switch(e.key){case"Enter":p(e);break;case"ArrowRight":{const n=u.indexOf(e.currentTarget)+1;t=u[n]??u[0];break}case"ArrowLeft":{const n=u.indexOf(e.currentTarget)-1;t=u[n]??u[u.length-1];break}}t?.focus()};return i.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.Z)("tabs",{"tabs--block":n},t)},c.map((e=>{let{value:t,label:n,attributes:s}=e;return i.createElement("li",(0,r.Z)({role:"tab",tabIndex:a===t?0:-1,"aria-selected":a===t,key:t,ref:e=>u.push(e),onKeyDown:h,onClick:p},s,{className:(0,o.Z)("tabs__item",b.tabItem,s?.className,{"tabs__item--active":a===t})}),n??t)})))}function v(e){let{lazy:t,children:n,selectedValue:r}=e;const o=(Array.isArray(n)?n:[n]).filter(Boolean);if(t){const e=o.find((e=>e.props.value===r));return e?(0,i.cloneElement)(e,{className:"margin-top--md"}):null}return i.createElement("div",{className:"margin-top--md"},o.map(((e,t)=>(0,i.cloneElement)(e,{key:t,hidden:e.props.value!==r}))))}function w(e){const t=m(e);return i.createElement("div",{className:(0,o.Z)("tabs-container",b.tabList)},i.createElement(y,(0,r.Z)({},e,t)),i.createElement(v,(0,r.Z)({},e,t)))}function x(e){const t=(0,g.Z)();return i.createElement(w,(0,r.Z)({key:String(t)},e))}},5270:(e,t,n)=>{"use strict";n.d(t,{lG:()=>m,S1:()=>T,gy:()=>I,uT:()=>oe,X3:()=>A,AH:()=>_,s0:()=>ae,DM:()=>L,UV:()=>q,wA:()=>ce,XQ:()=>v,uH:()=>R,rZ:()=>$,v7:()=>P,J_:()=>de,Nq:()=>he,$q:()=>B,Wz:()=>U,j3:()=>te,YY:()=>H,eU:()=>z,kf:()=>s,DC:()=>j,IA:()=>be,Gb:()=>me,UB:()=>V});var r=n(40801),i=n(44096);const{SchemaVersion:o}=i.constants.enums;let s=function(e){return e.Api="api",e.Friendly2="friendly_v2",e}({});var a=n(67294),l=n(39960),c=n(74866),u=n(85162),d=n(23612),p=n(74464);const h=e=>{let{configuration:t,syntaxFormat:n,skipVersion:l}=e;return a.createElement(p.Z,{className:`language-${n===s.Api?"json":i.tools.PrismExtensions.LANGUAGE_NAME}`},function(e,t,n){void 0===t&&(t=s.Api);let i=e;switch(t){case s.Friendly2:if(!i.type_definitions&&i.type)i={schema_version:o.OneDotOne,type_definitions:[i]},n=!0;else if(!i.type_definitions)throw new Error("invalid partial model");return n?r.transformer.transformJSONToDSL(i).replace("model\n schema 1.1\n",""):r.transformer.transformJSONToDSL(i);case s.Api:default:return n?JSON.stringify(i,null," ").replace(' "schema_version": "1.1",\n',""):JSON.stringify(i,null," ")}}(t,n,l))},f=e=>{let{onlyShow:t,configuration:n,skipVersion:r,showSchemaOneDotZero:o}=e;return t?a.createElement(h,{configuration:n,syntaxFormat:t,skipVersion:r}):o?a.createElement(a.Fragment,null,a.createElement(c.Z,{groupId:"dsl"},a.createElement(u.Z,{value:"dsl",label:"DSL"},a.createElement(h,{configuration:n,syntaxFormat:s.Friendly2,skipVersion:r})),a.createElement(u.Z,{value:"dsl-onedotzero",label:"DSL (Version 1.0)"},a.createElement(h,{configuration:{...n,schema_version:i.constants.enums.SchemaVersion.OneDotZero},syntaxFormat:s.Friendly2,skipVersion:r})),a.createElement(u.Z,{value:"json",label:"JSON"},a.createElement(h,{configuration:n,syntaxFormat:s.Api,skipVersion:r})))):a.createElement(a.Fragment,null,a.createElement(c.Z,{groupId:"dsl"},a.createElement(u.Z,{value:"dsl",label:"DSL"},a.createElement(h,{configuration:n,syntaxFormat:s.Friendly2,skipVersion:r})),a.createElement(u.Z,{value:"json",label:"JSON"},a.createElement(h,{configuration:n,syntaxFormat:s.Api,skipVersion:r}))))},m=e=>{let{configuration:t,onlyShow:n,showWrite:r,skipVersion:i,showSchemaOneDotZero:o}=e;return a.createElement(a.Fragment,null,a.createElement(f,{configuration:t,skipVersion:i,onlyShow:n,showSchemaOneDotZero:o}),r?a.createElement("details",null,a.createElement("summary",null,"Write the Authorization Model"),a.createElement(d.Z,{type:"note"},a.createElement("div",null,"The OpenFGA API only accepts an authorization model in the API's JSON syntax."),a.createElement("div",null,"To convert between the API Syntax and the friendly DSL, you can use the"," ",a.createElement(l.Z,{href:"https://github.com/openfga/cli/"},"FGA CLI"),".")),a.createElement(be,{authorizationModel:t,skipSetup:!0})):void 0)},g={"documentation-banner":"documentation-banner_hL3X","documentation-banner-icon":"documentation-banner-icon_zVr_","documentation-banner-icon-slack":"documentation-banner-icon-slack__g7S","documentation-banner-icon-drive":"documentation-banner-icon-drive_FABO","documentation-banner-icon-github":"documentation-banner-icon-github_p3sP","documentation-banner-icon-iot":"documentation-banner-icon-iot_nAKg","documentation-banner-icon-playground":"documentation-banner-icon-playground_sgp9","documentation-banner-icon-entitlements":"documentation-banner-icon-entitlements_QMIV","documentation-banner-content":"documentation-banner-content_N4KI","documentation-banner-title":"documentation-banner-title_tH3s","documentation-banner-description":"documentation-banner-description_rLpl","documentation-banner-chevron":"documentation-banner-chevron_qBL2"},b=e=>{let{title:t,description:n,link:r,preset:i}=e;const o="documentation-banner";return a.createElement(l.Z,{to:r,className:g[o]},a.createElement("div",{className:g[o+"-icon"]},i&&a.createElement("div",{className:g[o+"-icon-"+i]})),a.createElement("div",{className:g[o+"-content"]},a.createElement("h4",{className:g[o+"-title"]},t),a.createElement("p",{className:g[o+"-description"]},n)),a.createElement("div",{className:g[o+"-chevron"]},a.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M9 18L15 12L9 6",stroke:"#65676E",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))))};var y=n(52263);function v(e){let{example:t,intro:n,preset:r,store:i,title:o}=e;const{siteConfig:s}=(0,y.Z)(),l=i?`samples/${i}`:"",c=(n?"Get started ":t?`Explore the ${t} sample `:"Try this guide out ")+`on the ${s.customFields.playgroundName}`;return s.customFields.playgroundURL?a.createElement(b,{title:o||"The Playground",preset:r||"playground",description:`${c}`,link:`${s.customFields.playgroundURL}${l}`}):a.createElement(a.Fragment,null)}const w={"documentation-link":"documentation-link_vRVq","documentation-link-show-arrow-on-hover":"documentation-link-show-arrow-on-hover_XIYB"};function x(e){let{href:t,to:n,className:r,children:i,onClick:o,showArrowOnHover:s=!1}=e;return a.createElement(l.Z,{className:[r,s?w["documentation-link-show-arrow-on-hover"]:void 0].join(" "),href:t,to:n,onClick:o},a.createElement(a.Fragment,null,i))}const S={"documentation-card-box":"documentation-card-box_SNqO","documentation-card-box-border":"documentation-card-box-border_zlYB","documentation-card-box-fitcontent":"documentation-card-box-fitcontent_koVg","documentation-card-box-children":"documentation-card-box-children_i280","documentation-card-box-children-small":"documentation-card-box-children-small_Bayp","documentation-card-box-children-mono":"documentation-card-box-children-mono_WQfY","documentation-card-box-icon":"documentation-card-box-icon_ZcC1","documentation-card-box-icon-large":"documentation-card-box-icon-large_nsCS","documentation-card-box-icon-label":"documentation-card-box-icon-label_ctwe","documentation-card-box-icon-title":"documentation-card-box-icon-title_zmVE","documentation-card-box-alignment-left":"documentation-card-box-alignment-left__zex","documentation-card-box-alignment-center":"documentation-card-box-alignment-center_zUxy","documentation-card-box-gradient":"documentation-card-box-gradient_ZcEA","documentation-card-box-filled":"documentation-card-box-filled_F0BA","documentation-card-box-description":"documentation-card-box-description_u7_j","documentation-card-box-content":"documentation-card-box-content_Z5TD","documentation-card-box-links":"documentation-card-box-links_XUmL","documentation-card-box-link":"documentation-card-box-link_yEiX","documentation-card-box-links-justify-start":"documentation-card-box-links-justify-start_wwT4","documentation-card-box-links-bold":"documentation-card-box-links-bold__aiB","documentation-card-box-links-none":"documentation-card-box-links-none_sQ2X","documentation-card-box-links-numbered":"documentation-card-box-links-numbered_Ebqk","documentation-card-box-title":"documentation-card-box-title_sKX3","documentation-card-box-title-center":"documentation-card-box-title-center_Hqm8"};let E=function(e){return e.None="none",e.Numbered="numbered",e.Bullets="bullets",e}({});const T=e=>{const{title:t,description:n,links:r,appearance:i,border:o,icon:s,centerTitle:l=!1,monoFontChildren:c=!1,smallFontChildren:u=!1,children:d,linkOpts:p}=e,{bulletType:h=E.None,shouldJustifyStart:f=!1,shouldBold:m=!1,shouldShowArrowOnHover:g=!1}=p||{},{siteConfig:b}=(0,y.Z)(),v=t?t.replace("{ProductName}",b.customFields.productName):t,w=n&&"string"==typeof n?n.replace("{ProductName}",b.customFields.productName):n,T="documentation-card-box";return a.createElement("div",{className:`${(()=>{switch(i){case"gradient":return S[T+"-gradient"];case"filled":return S[T+"-filled"];default:return S[T]}})()} ${s&&!d&&S[T+"-fitcontent"]} ${o&&S[T+"-border"]}`},a.createElement("div",{className:S[T+"-content"]},s&&a.createElement("div",{className:"left"===s.alignment?S[T+"-alignment-left"]:S[T+"-alignment-center"]},a.createElement("div",{className:v?S[T+"-icon-large"]:S[T+"-icon"]},s.icon),s.label&&a.createElement("p",{className:S[T+"-icon-label"]},s.label),v&&a.createElement("span",{className:S[T+"-icon-title"]},v)),v&&!s&&a.createElement("span",{className:S[T+(l?"-title-center":"-title")]},v),w&&("string"==typeof w?a.createElement("p",{className:S[T+"-description"]},w):w),r&&a.createElement("div",{className:[S[T+"-links"],S[T+"-links-"+h],f?S[T+"-links-justify-start"]:void 0,m?S[T+"-links-bold"]:void 0].join(" ")},a.createElement("ul",null,r?.map((e=>a.createElement("li",{key:`li-${e.to}`},a.createElement(x,{className:S[T+"-link"],key:`link-${e.to}`,to:e.to,showArrowOnHover:g},e.label)))))),a.createElement("div",{className:S[T+(u?"-children-small":c?"-children-mono":"-children")]},d)))};var C=n(87462);const k={"column-layout-2":"column-layout-2_O2db","column-layout-3":"column-layout-3_YXBy","column-layout-4":"column-layout-4_SipK","column-layout-4-equal-width":"column-layout-4-equal-width_WOGz","column-layout-5":"column-layout-5_K6O8","column-layout-5-equal-width":"column-layout-5-equal-width_CiKk"},A=e=>{let{cols:t,children:n,equalWidth:r,...i}=e;return a.createElement("div",(0,C.Z)({},i,{className:k["column-layout-"+t+(r?"-equal-width":"")]}),n)};var O=n(91036),N=n.n(O);function _(){const{siteConfig:e}=(0,y.Z)(),t=e.customFields.notice;return t?a.createElement(d.Z,{type:"note"},a.createElement("div",{dangerouslySetInnerHTML:{__html:N()(t)}})):a.createElement(a.Fragment,null)}function D(e){return"string"==typeof e?[{label:"Click to navigate",to:e}]:e.map((e=>{let{to:t,label:n}=e;return{label:n,to:t}}))}function I(e){let{top:t,middle:n,bottom:r}=e;const i=t?.map(((e,t)=>a.createElement(T,(0,C.Z)({},e,{appearance:t%2==0?"gradient":"filled",links:D(e.to),key:`card-grid-overview-top-${t}`})))),o=n?.map(((e,t)=>a.createElement(T,(0,C.Z)({},e,{links:D(e.to),key:`card-grid-overview-middle-${t}`})))),s=r?.map(((e,t)=>a.createElement(T,(0,C.Z)({},e,{links:D(e.to),key:`card-grid-overview-bottom-${t}`}))));return a.createElement("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},i&&a.createElement(A,{cols:2,style:{marginTop:"2rem"}},i),o&&a.createElement(A,{cols:3,style:{marginTop:"2rem"}},o),n&&r&&a.createElement("div",{style:{marginTop:"2rem",border:"1px solid #DADFE8"}}),s&&a.createElement(A,{cols:2,style:{marginTop:"2rem"}},s))}function L(e){let{title:t,description:n,listItems:r}=e;const{siteConfig:i}=(0,y.Z)(),o=t.replace("{ProductName}",i.customFields.productName),s=n.replace("{ProductName}",i.customFields.productName);return a.createElement("div",{style:{marginTop:"2rem",marginBottom:"2rem"}},a.createElement(T,{title:o,description:a.createElement("div",{style:{marginTop:"0.75rem"}},a.createElement("p",{className:S["documentation-card-box-description"]},s),r&&a.createElement("ul",{style:{marginTop:"2rem"}},r.map(((e,t)=>a.createElement("li",{key:`list-description-${t}`},e.replace("{ProductName}",i.customFields.productName)))))),links:[]}))}let P=function(e){return e.ShortForm="shortForm",e.LongForm="longForm",e.ProductLink="productLink",e}({});function $(e){const{siteConfig:t}=(0,y.Z)(),n=t.baseUrl+(t.customFields.introLink+t.customFields.productDescriptionSection);switch(e.format){case P.ProductLink:return a.createElement("a",{href:n},t.customFields.productName);case P.LongForm:return a.createElement(a.Fragment,null,t.customFields.longProductName);case P.ShortForm:default:return a.createElement(a.Fragment,null,t.customFields.productName)}}function j(e){const{siteConfig:t}=(0,y.Z)(),n=e.name.replace("{ProductName}",t.customFields.productName),r=e.link.replace("{ProductConcept}",t.customFields.conceptLink);return a.createElement("a",{href:r},n)}function R(e){const{siteConfig:t}=(0,y.Z)(),n=t.baseUrl+t.customFields.conceptLink,r=e.section?n+"#"+e.section:n,i=e.linkName?e.linkName:t.customFields.productName+" Concepts";return a.createElement("a",{href:r},i)}function q(e){const{siteConfig:t}=(0,y.Z)(),n=t.baseUrl+t.customFields.introLink,r=e.section?n+"#"+e.section:n,i=e.linkName;return a.createElement("a",{href:r},i)}const M={"documentation-related-section-title":"documentation-related-section-title_FCU2","documentation-related-section-description":"documentation-related-section-description_Un_N"};function B(e){const{siteConfig:t}=(0,y.Z)(),{description:n,relatedLinks:r}=e,i="documentation-related-section",o=n.replace("{ProductName}",t.customFields.productName);return a.createElement("div",{className:M[i]},a.createElement("div",{className:M[i+"-description"]},a.createElement("span",null,o)),a.createElement(A,{cols:3},r?.map((e=>function(e){const{siteConfig:t}=(0,y.Z)(),n=e.link.replace("{ProductConcept}",t.customFields.conceptLink),r=e.title.replace("{ProductName}",t.customFields.productName),i=e.description.replace("{ProductName}",t.customFields.productName);return a.createElement(T,{key:n,title:r,description:i,links:[{label:"More",to:n}]})}(e)))))}var F=function(e){return e.JSON="json",e}(F||{});function U(e){return a.createElement(a.Fragment,null,a.createElement(p.Z,{className:"language-json5"},function(e,t){return F.JSON,`[${t.relationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n ${i?`// ${i}\n `:""}{\n "user": "${t}",\n "relation": "${n}",\n "object": "${r}",\n },`})).join("")}\n]`}(F.JSON,e)))}function H(){return a.createElement(a.Fragment,null,"Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.")}let z=function(e){return e.CLI="cli",e.JS_SDK="js-sdk",e.GO_SDK="go-sdk",e.DOTNET_SDK="dotnet-sdk",e.PYTHON_SDK="python-sdk",e.CURL="curl",e.RPC="rpc",e.PLAYGROUND="playground",e}({});const V=new Map([[z.CLI,"CLI"],[z.JS_SDK,"Node.js"],[z.GO_SDK,"Go"],[z.DOTNET_SDK,".NET"],[z.PYTHON_SDK,"Python"],[z.CURL,"curl"],[z.RPC,"Pseudocode"],[z.PLAYGROUND,"Playground"]]),G=new Map([[z.CLI,"shell"],[z.JS_SDK,"javascript"],[z.GO_SDK,"go"],[z.DOTNET_SDK,"dotnet"],[z.PYTHON_SDK,"python"],[z.CURL,"shell"],[z.RPC,"shell"],[z.PLAYGROUND,"shell"]]),Z=(e,t)=>e?t?e.filter((e=>t.includes(e))):e:t||[];function K(e){const{allowedLanguages:t}=e;return t.map((e=>({label:V.get(e),value:e})))}const J="1uHxCSuTP0VKPYSnkq1pbb1jeZw";var W=n(34673),Y=n(46242);function X(e,t){switch(e){case z.JS_SDK:return t.js;case z.GO_SDK:return t.go;case z.DOTNET_SDK:return t.dotnet;case z.PYTHON_SDK:return t.python}return{importStatement:"",apiName:"",setupNote:""}}function Q(e,t){return X(e,t).importStatement}function ee(e,t){switch(e){case z.CURL:case z.CLI:return"Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)\n";case z.JS_SDK:return`// import the SDK\n${Q(e,t)}\n\n// Initialize the SDK with no auth - see "How to setup SDK client" for more options\nconst fgaClient = new ${t.js.apiName}({\n apiScheme: process.env.FGA_API_SCHEME, // Either "http" or "https", defaults to "https"\n apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)\n storeId: process.env.FGA_STORE_ID,\n authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request\n});`;case z.GO_SDK:return`import (\n ${Q(e,t)}\n "os"\n)\n\nfunc main() {\n // Initialize the SDK with no auth - see "How to setup SDK client" for more options\n fgaClient, err := NewSdkClient(&ClientConfiguration{\n ApiScheme: os.Getenv("FGA_SCHEME"), // Either "http" or "https", defaults to "https"\n ApiHost: os.Getenv("FGA_API_HOST"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)\n StoreId: os.Getenv("FGA_STORE_ID"), // optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods\n AuthorizationModelId: openfga.PtrString(os.Getenv("FGA_MODEL_ID")), // Optional, can be overridden per request\n })\n\n if err != nil {\n // .. Handle error\n }\n}`;case z.DOTNET_SDK:return`// import the SDK\n${Q(e,t)}\nusing Environment = System.Environment;\n\nnamespace Example;\n\nclass Example {\n public static async Task Main() {\n // Initialize the SDK with no auth - see "How to setup SDK client" for more options\n var configuration = new ClientConfiguration() {\n ApiScheme = Environment.GetEnvironmentVariable("FGA_API_SCHEME"), // Either "http" or "https", defaults to "https"\n ApiHost = Environment.GetEnvironmentVariable("FGA_API_HOST"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)\n StoreId = Environment.GetEnvironmentVariable("FGA_STORE_ID"), // optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods\n AuthorizationModelId = Environment.GetEnvironmentVariable("FGA_MODEL_ID"), // Optional, can be overridden per request\n };\n var fgaClient = new ${t.js.apiName}(configuration);\n }\n}`;case z.PYTHON_SDK:return`\n${Q(e,t)}\n\nconfiguration = openfga_sdk.ClientConfiguration(\n api_scheme = os.environ.get('FGA_API_SCHEME'), # Either "http" or "https", defaults to "https"\n api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)\n store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods\n authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request\n)\n\n# Enter a context with an instance of the OpenFgaClient\nasync with OpenFgaClient(configuration) as fga_client:\n api_response = await fga_client.read_authorization_models()\n await fga_client.close()\n`;case z.RPC:case z.PLAYGROUND:throw new Error(`Lang ${e} support has not been implemented`);default:(0,Y.ZP)(e)}}function te(e){let{lang:t}=e;const{siteConfig:n}=(0,y.Z)();return ne({allowedLanguage:t,content:ee(t,n.customFields.languageMapping)})}function ne(e){let{allowedLanguage:t,content:n}=e;return a.createElement(p.Z,{className:`language-${G.get(t)}`},n)}function re(e,t,n){const{siteConfig:r}=(0,y.Z)(),i=r.customFields.languageMapping;return a.createElement(a.Fragment,null,a.createElement(c.Z,{groupId:"languages",values:K({allowedLanguages:e})},e.map((e=>a.createElement(u.Z,{value:e,key:e},function(e,t){const{siteConfig:n}=(0,y.Z)(),r=n.customFields.languageMapping;if(t)return;let i,o="Initialize the SDK";const s=G.get(e);switch(e){case z.JS_SDK:case z.GO_SDK:case z.DOTNET_SDK:case z.PYTHON_SDK:i=X(e,r).setupNote+ee(e,r);break;case z.CLI:i=ee(z.CLI,r),o="Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)";break;case z.CURL:i=ee(z.CURL,r),o="Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)";break;case z.PLAYGROUND:case z.RPC:return;default:(0,Y.ZP)(e)}return a.createElement(a.Fragment,null,a.createElement(W.Z,{summary:a.createElement("summary",null,o)},a.createElement(p.Z,{className:`language-${s}`},i)))}(e,t.skipSetup),ne({allowedLanguage:e,content:n(e,t,i)}))))))}function ie(e,t){const{user:n,relation:r,object:i,allowed:o,contextualTuples:s}=t,a=t.authorizationModelId?t.authorizationModelId:J;switch(e){case z.PLAYGROUND:return`is ${n} related to ${i} as ${r}?\n${s?"\n# Note: Contextual Tuples are not supported on the playground":""}\n\n# Response: ${o?"A green path from the user to the object":"A red object"} indicating that the response from the API is \`{"allowed":${o?"true":"false"}}\`\n`;case z.CLI:return`fga query check --store-id=$FGA_STORE_ID --model-id=${a} ${n} ${r} ${i}${s?` --contextual_tuples ${s.map((e=>`"${e.user} ${e.relation} ${e.object}"`)).join(" ")}`:""}\n\n# Response: {"allowed":${o}}`;case z.CURL:return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" \\\n -d '{"authorization_model_id": "${a}", "tuple_key":{"user":"${n}","relation":"${r}","object":"${i}"}${s?`,"contextual_tuples":{"tuple_keys":[${s.map((e=>`{"user":"${e.user}","relation":"${e.relation}","object":"${e.object}"}`)).join(",")}]}}`:"}"}'\n\n# Response: {"allowed":${o}}`;case z.JS_SDK:return`\n// Run a check\nconst { allowed } = await fgaClient.check({\n user: '${n}',\n relation: '${r}',\n object: '${i}',${s?`\n contextual_tuples: [${s.map((e=>`\n {\n user: "${e.user}",\n relation: "${e.relation}",\n object: "${e.object}"\n }`)).join(",")}\n ]`:"\n"}}, {\n authorization_model_id: '${a}',\n});\n\n// allowed = ${o}`;case z.GO_SDK:return`\noptions := ClientCheckOptions{\n\tAuthorizationModelId: openfga.PtrString("${a}"),\n}\nbody := ClientCheckRequest{\n\tUser: "${n}",\n\tRelation: "${r}",\n\tObject: "${i}",${s?`\n\tContextualTuples: &[]ClientTupleKey{\n${s?s.map((e=>`\t\t{\n\t\t\tUser: "${e.user}",\n\t\t\tRelation: "${e.relation}",\n\t\t\tObject: "${e.object}",\n\t\t}`)).join(",\n"):""}\n\t}`:""}\n}\n\ndata, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute()\n\n// data = { allowed: ${o} }`;case z.DOTNET_SDK:return`\nvar options = new ClientCheckOptions {\n AuthorizationModelId = "${a}",\n};\nvar body = new ClientCheckRequest {\n User = "${n}",\n Relation = "${r}",\n Object = "${i}",${s?`,\n ContextualTuples = new List<ClientTupleKey>({\n ${s.map((e=>`new(user: "${e.user}", relation: "${e.relation}", _object: "${e.object}")`)).join(",\n ")}\n})`:""}\n};\nvar response = await fgaClient.Check(body, options);\n\n// response.Allowed = ${o}`;case z.PYTHON_SDK:return`options = {\n "authorization_model_id": "${a}"\n}\nbody = ClientCheckRequest(\n user="${n}",\n relation="${r}",\n object="${i}",${s?`\n contextual_tuples=[\n ${s.map((e=>`ClientTupleKey(user="${e.user}", relation="${e.relation}", object="${e.object}")`)).join(",\n ")}\n ],`:""}\n)\n\nresponse = await fga_client.check(body, options)\n\n# response.allowed = ${o}\n`;case z.RPC:return`check(\n user = "${n}", // check if the user \`${n}\`\n relation = "${r}", // has an \`${r}\` relation\n object = "${i}", // with the object \`${i}\`\n ${s?`contextual_tuples = [ // Assuming the following is true\n ${s.map((e=>`{user = "${e.user}", relation = "${e.relation}", object = "${e.object}"}`)).join(",\n ")}\n ],`:""} authorization_id = "${a}"\n);\n\nReply: ${o}`;default:(0,Y.ZP)(e)}}function oe(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CLI,z.CURL,z.RPC];return re(Z(e.allowedLanguages,t),e,ie)}function se(e,t){const n=t.authorizationModelId?t.authorizationModelId:J;switch(e){case z.CLI:return`fga query expand --store-id=\${FGA_STORE_ID} --model-id=${n} ${t.relation} ${t.object}\n\n# Response: {"tree": ...}`;case z.CURL:return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/expand \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" \\\n -d '{"tuple_key":{"relation":"${t.relation}","object":"${t.object}"}, "authorization_model_id": "${n}"}'\n\n# Response: {"tree": ...}`;case z.JS_SDK:return`\nconst { tree } = await fgaClient.expand({\n relation: '${t.relation}', // expand all who has '${t.relation}' relation\n object: '${t.object}', // with the object '${t.object}'\n}, {\n authorization_model_id: '${n}'\n});\n\n// tree = ...`;case z.GO_SDK:return`\noptions := ClientExpandOptions{\n AuthorizationModelId: openfga.PtrString("${n}"),\n}\nbody := ClientExpandRequest{\n Relation: "${t.relation}", // expand all who has "${t.relation}" relation\n Object: "${t.object}", // with the object "${t.object}"\n}\ndata, err := fgaClient.Expand(context.Background()).Body(requestBody).Options(options).Execute()\n\n// data = { tree: ...}`;case z.DOTNET_SDK:return`\nvar options = new ClientCheckOptions {\n AuthorizationModelId = "${n}",\n};\nvar body = new ClientExpandRequest {\n Relation = "${t.relation}", // expand all who has "${t.relation}" relation\n Object = "${t.object}" // with the object "${t.object}"\n};\nvar response = await fgaClient.Expand(body, options);\n\n// response = { tree: ... }`;case z.RPC:return`expand(\n "${t.relation}", // expand all who has \`${t.relation}\` relation\n "${t.object}", // with the object \`${t.object}\`\n authorization_model_id="${n}"\n);\n\nReply: {tree:...}`;case z.PYTHON_SDK:return`\noptions = {\n "authorization_model_id": "${t.authorizationModelId?t.authorizationModelId:J}"\n}\nbody = ClientExpandRequest(\n relation: "${t.relation}",\n object: "${t.object}",\n)\n\nresponse = await fga_client.expand(body. options)\n\n# response = ExpandResponse({"tree":...})\n`;case z.PLAYGROUND:return"";default:(0,Y.ZP)(e)}}function ae(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CLI,z.CURL,z.RPC];return re(Z(e.allowedLanguages,t),e,se)}function le(e,t){const{user:n,relation:r,objectType:i,contextualTuples:o,expectedResults:s}=t,a=t.authorizationModelId?t.authorizationModelId:J;switch(e){case z.PLAYGROUND:return"# Note: List Objects is not currently supported on the playground";case z.CLI:return`fga query list-objects --store-id=\${FGA_STORE_ID} --model-id=${a} ${n} ${r} ${i}${o?` --contextual_tuples ${o.map((e=>`"${e.user} ${e.relation} ${e.object}"`)).join(" ")}`:""}\n\n# Response: {"objects": [${s.map((e=>`"${e}"`)).join(", ")}]}`;case z.CURL:return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/list-objects \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" \\\n -d '{ "authorization_model_id": "${a}",\n "type": "${i}",\n "relation": "${r}",\n "user":"${n}"${o?`,\n "contextual_tuples": {\n "tuple_keys": [${o.map((e=>`\n {"object": "${e.object}", "relation": "${e.relation}", "user": "${e.user}"}`)).join(",")}\n ]\n }\n }'`:"\n }'"}\n\n# Response: {"objects": [${s.map((e=>`"${e}"`)).join(", ")}]}`;case z.JS_SDK:return`const response = await fgaClient.listObjects({\n user: "${n}",\n relation: "${r}",\n type: "${i}",${o?.length?`\n contextual_tuples: {\n tuple_keys: [${o.map((e=>`{\n user: "${e.user}",\n relation: "${e.relation}",\n object: "${e.object}"\n }`)).join(", ")}]\n },`:""}\n}, {\n authorization_model_id: "${a}",\n});\n// response.objects = [${s.map((e=>`"${e}"`)).join(", ")}]`;case z.GO_SDK:return`\noptions := ClientListObjectsOptions{\n AuthorizationModelId: openfga.PtrString("${a}"),\n}\nbody := ClientListObjectsRequest{\n\tUser: "${n}",\n\tRelation: "${r}",\n\tType: "${i}",${o?`\n\tContextualTuples: &[]ClientTupleKey{\n${o?o.map((e=>`\t\t{\n\t\t\tUser: "${e.user}",\n\t\t\tRelation: "${e.relation}",\n\t\t\tObject: "${e.object}",\n\t\t}`)).join(",\n"):""}\n\t}`:""}\n}\ndata, err := fgaClient.ListObjects(context.Background()).\n Body(requestBody).\n Options(options).\n Execute()\n\n// data = { "objects": [${s.map((e=>`"${e}"`)).join(", ")}] }`;case z.DOTNET_SDK:return`\nvar options = new ClientListObjectsOptions {\n AuthorizationModelId = "${a}",\n};\nvar body = new ClientListObjectsRequest {\n User = "${n}",\n Relation = "${r}",\n Type = "${i}",${o?`,\n ContextualTuples = new List<ClientTupleKey>({\n ${o.map((e=>`new(user: "${e.user}", relation: "${e.relation}", _object: "${e.object}")`)).join(",\n ")}\n})`:""}\n};\n\nvar response = await fgaClient.ListObjects(body, options);\n\n// response.Objects = [${s.map((e=>`"${e}"`)).join(", ")}]`;case z.PYTHON_SDK:return`\noptions = {\n "authorization_model_id": "${a}"\n}\nbody = ClientListObjectsRequest(\n user="${n}",\n relation="${r}",\n type="${i}",${o?`\n contextual_tuples=[\n ${o.map((e=>`ClientTupleKey(user="${e.user}", relation="${e.relation}", object="${e.object}")`)).join(",\n ")}\n ],`:""}\n)\n\nresponse = await fga_client.list_objects(body, options)\n\n# response.objects = [${s.map((e=>`"${e}"`)).join(", ")}]\n`;case z.RPC:return`listObjects(\n "${n}", // list the objects that the user \`${n}\`\n "${r}", // has an \`${r}\` relation\n "${i}", // and that are of type \`${i}\`\n authorization_model_id = "${a}", // for this particular authorization model id ${o?`\n contextual_tuples = [ // Assuming the following is true\n ${o.map((e=>`{user = "${e.user}", relation = "${e.relation}", object = "${e.object}"}`)).join(",\n ")}\n ]`:""}\n);\n\nReply: [${s.map((e=>`"${e}"`)).join(", ")}]`;default:(0,Y.ZP)(e)}}function ce(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CLI,z.CURL,z.RPC];return re(Z(e.allowedLanguages,t),e,le)}function ue(e,t){switch(e){case z.CLI:return"fga tuple changes --store-id=${FGA_STORE_ID}"+(t.type?` --type ${t.type}`:"");case z.CURL:return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/changes \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" \\\n -d '{${""+(t.type?'"type": '+t.type+'", ':"")}${""+(t.continuationToken?'"continuation_token": "'+t.continuationToken+'", ':"")}${""+(t.pageSize?'"page_size": '+t.pageSize:"")}}'`;case z.JS_SDK:return`${""+('var type = "'+(t.type?t.type:"")+'";\n')}${""+('var continuationToken = "'+(t.continuationToken?t.continuationToken:"")+'";\n')}${""+("var pageSize = "+(t.pageSize?t.pageSize:"")+";\n")}\nawait fgaClient.readChanges({ type }, { pageSize, continuationToken });`;case z.GO_SDK:return`options := ClientReadChangesOptions{${t.pageSize?`\n\tPageSize: openfga.PtrInt32(${t.pageSize}),\n`:""}${t.continuationToken?`\n\tContinuationToken: openfga.PtrString("${t.continuationToken}"),\n`:""}}\nbody := ClientReadChangesRequest{${t.type?`\n\tType: "${t.type}",`:""}\n}\n\ndata, err := fgaClient.ReadChanges(context.Background()).Body(body).Options(options).Execute()\n\nif err != nil {\n // .. Handle error\n}`;case z.DOTNET_SDK:return`var body = new ClientReadChangesRequest { ${t.type?`Type = "${t.type}"`:""} };\nvar options = new ClientReadChangesOptions {\n ${t.pageSize?`PageSize = ${t.pageSize},\n`:""}\n ${t.continuationToken?`ContinuationToken = "${t.continuationToken}",\n`:""}\n};\n\nvar response = await fgaClient.ReadChanges(body, options);`;case z.PYTHON_SDK:return`\nbody = ClientReadChangesRequest(${t.type?`"${t.type}"`:""})\noptions = new ClientReadChangesOptions {\n ${t.pageSize?`page_size: ${t.pageSize},\n`:""}\n ${t.continuationToken?`continuation_token: "${t.continuationToken}",\n`:""}\n};\nresponse = await fga_client.read_changes(body, options)`;default:return""}}function de(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CLI,z.CURL];return re(Z(e.allowedLanguages,t),e,ue)}function pe(e,t){const n=t.tuples?t.tuples.map((e=>{let{user:t,relation:n,object:r}=e;return`{"key": {"user":"${t}","relation":"${n}","object":"${r}"}, "timestamp": "2021-10-06T15:32:11.128Z"}`})).join(","):"";switch(e){case z.CLI:return`fga tuple read --store-id=\${FGA_STORE_ID}${t.user?` --user ${t.user}`:""}${t.relation?` --relation ${t.relation}`:""}${t.object?` --object ${t.object}`:""}`;case z.CURL:{const e=t.object?(t.user?`"user":"${t.user}",`:"")+(t.relation?`"relation":"${t.relation}",`:"")+`"object":"${t.object}"`:"";return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" ${e?`\\\n -d '{"tuple_key":{${e}}}`:""}'\n\n# Response: "tuples": {[${n}]}`}case z.JS_SDK:return`\n// Execute a read\nconst { tuples } = await fgaClient.read({\n ${t.object?(t.user?`user:'${t.user}',\n`:"")+(t.relation?`relation:'${t.relation}',\n`:"")+`object:'${t.object}',`:""}\n});\n\n// tuples = [${n}]\n`;case z.GO_SDK:return`options := ClientReadOptions{}\nbody := ClientReadRequest{\n${t.object?(t.user?`\tUser: openfga.PtrString("${t.user}"),\n`:"")+(t.relation?`\tRelation: openfga.PtrString("${t.relation}"),\n`:"")+`\tObject: openfga.PtrString("${t.object}"),\n`:""}\n}\n\ndata, err := fgaClient.Read(context.Background()).Body(requestBody).Options(options).Execute()\n\n// data = { "tuples": [${n}] }`;case z.DOTNET_SDK:return`var options = new ClientReadOptions {}\nvar body = new ClientReadRequest() {\n${t.object?(t.user?` User = "${t.user}",\n`:"")+(t.relation?` Relation = "${t.relation}",\n`:"")+` Object = "${t.object}",`:""}\n};\n\nvar response = await fgaClient.Read(body, options);\n\n// data = { "tuples": [${n}] }`;case z.PYTHON_SDK:return`\noptions = {}\nbody = TupleKey(\n${t.object?(t.user?` user="${t.user}",\n`:"")+(t.relation?` relation="${t.relation}",\n`:"")+` object="${t.object}",\n`:""}\n)\n\nresponse = await fga_client.read(body, options)\n\n# response = ReadResponse({"tuples":[${n}]})`;case z.RPC:{const e=t.object?":"===t.object.slice(-1)?"type":"object":"";return`read(\n // read all stored tuples\n${t.object?(t.user?` "${t.user}", // where user \`${t.user}\` has $(opts.relation ? '': 'any ' )relation\n`:" // for users who have relation\n")+(t.relation?` "${t.relation}", // \`${t.relation}\`\n`:"")+` "${t.object}", // with the ${e} \`${t.object}\``:""}\n);\n\nReply: tuples:[${t.tuples?t.tuples.map((e=>{let{user:t,relation:n,object:r}=e;return`{"key": {"user":"${t}","relation":"${n}","object":"${r}"}, "timestamp": "2021-10-06T15:32:11.128Z"}`})).join(","):""}]`}case z.PLAYGROUND:return"";default:(0,Y.ZP)(e)}}function he(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CLI,z.CURL,z.RPC];return re(Z(e.allowedLanguages,t),e,pe)}function fe(e,t){const n=t.authorizationModelId?t.authorizationModelId:J;switch(e){case z.CLI:return`${t.relationshipTuples?.length?t.relationshipTuples.map((e=>`fga tuple write --store-id=\${FGA_STORE_ID} --model-id=${n} ${e.user} ${e.relation} ${e.object}`)).join("\n"):""}\n\n${t.deleteRelationshipTuples?.length?t.deleteRelationshipTuples.map((e=>`fga tuple delete --store-id=\${FGA_STORE_ID} ${e.user} ${e.relation} ${e.object}`)).join("\n"):""}`;case z.CURL:{const e=`"writes": { "tuple_keys" : [${t.relationshipTuples?t.relationshipTuples.map((e=>{let{user:t,relation:n,object:r}=e;return`{"user":"${t}","relation":"${n}","object":"${r}"}`})).join(","):""}] }`,r=`"deletes": { "tuple_keys" : [${t.deleteRelationshipTuples?t.deleteRelationshipTuples.map((e=>{let{user:t,relation:n,object:r}=e;return`{"user":"${t}","relation":"${n}","object":"${r}"}`})).join(","):""}] }`,i=""+(t.deleteRelationshipTuples&&t.relationshipTuples?",":"");return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" \\\n -d '{${t.relationshipTuples?e:""}${i}${t.deleteRelationshipTuples?r:""}, "authorization_model_id": "${n}"}'`}case z.JS_SDK:{const e=`writes: [${t.relationshipTuples?t.relationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n ${i?`// ${i}\n `:""}{ user: '${t}', relation: '${n}', object: '${r}'}`})).join(","):""}]\n }`,r=`deletes: [${t.deleteRelationshipTuples?t.deleteRelationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n ${i?`// ${i}\n `:""}{ user: '${t}', relation: '${n}', object: '${r}'}`})).join(","):""}]\n }`,i=""+(t.deleteRelationshipTuples&&t.relationshipTuples?",\n ":"");return`\nawait fgaClient.write({\n ${t.relationshipTuples?e:""}${i}${t.deleteRelationshipTuples?r:""},\n}, {\n authorization_model_id: "${n}" \n});`}case z.GO_SDK:{const e=`\tWrites: &[]ClientTupleKey{${t.relationshipTuples?t.relationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n\t\t\t{\n\t\t\t\t${i?`// ${i}\n\t\t\t\t`:""}User: openfga.PtrString("${t}"),\n\t\t\t\tRelation: openfga.PtrString("${n}"),\n\t\t\t\tObject: openfga.PtrString("${r}"),\n\t\t\t}, `})).join(""):""}}`,r=`\tDeletes: &[]ClientTupleKey{${t.deleteRelationshipTuples?t.deleteRelationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n\t\t\t{\n\t\t\t\t${i?`// ${i}\n\t\t\t\t`:""}User: openfga.PtrString("${t}"),\n\t\t\t\tRelation: openfga.PtrString("${n}"),\n\t\t\t\tObject: openfga.PtrString("${r}"),\n\t\t\t}, `})).join(""):""}}`;return`\noptions := ClientWriteOptions{\n\tAuthorizationModelId: openfga.PtrString("${n}"),\n}\nbody := fgaClient.ClientWriteRequest{\n${t.relationshipTuples?e:""}${t.deleteRelationshipTuples?r:""} }\ndata, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute()\n\nif err != nil {\n // .. Handle error\n}\n`}case z.DOTNET_SDK:{const e=`Writes = new List<ClientTupleKey>() {\n${t.relationshipTuples?t.relationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`${i?` // ${i}\n`:""} new() { User = "${t}", Relation = "${n}", Object = "${r}" }`})).join(",\n"):""}\n }`,r=`Deletes = new List<ClientTupleKey>() {\n${t.deleteRelationshipTuples?t.deleteRelationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`${i?` // ${i}\n`:""} new() { User = "${t}", Relation = "${n}", Object = "${r}" }`})).join(",\n"):""}\n }`,i=""+(t.deleteRelationshipTuples&&t.relationshipTuples?",\n ":"");return`\nvar options = new ClientListObjectsOptions {\n AuthorizationModelId = "${n}",\n};\nvar body = new ClientWriteRequest() {\n ${t.relationshipTuples?e:""}${i}${t.deleteRelationshipTuples?r:""},\n};\nvar response = await fgaClient.Write(body, options);`}case z.PYTHON_SDK:{const e=` writes=[${t.relationshipTuples?t.relationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n ClientTuple(\n${i?` # ${i}\n `:" "}user="${t}",\n relation="${n}",\n object="${r}",\n ),`})).join(""):""},\n ),\n`,r=` deletes==[${t.deleteRelationshipTuples?t.deleteRelationshipTuples.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`\n ClientTuple(\n${i?` # ${i}\n `:" "}user="${t}",\n relation="${n}",\n object="${r}",\n ),`})).join(""):""}],\n ),\n`;return`options = {\n "authorization_model_id": "${n}"\n}\nbody = body = ClientWriteRequest(\n ${t.relationshipTuples?e:""}${t.deleteRelationshipTuples?r:""}",\n)\n\nresponse = await fga_client.write(body, options)\n`}case z.RPC:{const e=t.relationshipTuples?.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`${i?`\n // ${i}`:""}\n {\n "user":"${t}",\n "relation":"${n}",\n "object":"${r}"\n }`})).join(","),r=t.deleteRelationshipTuples?.map((e=>{let{user:t,relation:n,object:r,_description:i}=e;return`${i?`\n // ${i}`:""}\n {\n "user":"${t}",\n "relation":"${n}",\n "object":"${r}"\n }`})).join(","),i=`write([${e}\n], authorization_model_id="${n}")`,o=`delete([${r}\n], authorization_model_id="${n}")`,s=""+(t.deleteRelationshipTuples&&t.relationshipTuples?",":"");return`${t.relationshipTuples?i:""}${s}\n${t.deleteRelationshipTuples?o:""}`}case z.PLAYGROUND:return"";default:(0,Y.ZP)(e)}}function me(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CURL,z.CLI,z.RPC];return re(Z(e.allowedLanguages,t),e,fe)}function ge(e,t,n){switch(e){case z.CLI:return r=t.authorizationModel,`fga model write --store-id=\${FGA_STORE_ID} ${JSON.stringify(r)}`;case z.CURL:return function(e){return`curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/authorization-models \\\n -H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization\n -H "content-type: application/json" \\\n -d '${JSON.stringify(e)}'`}(t.authorizationModel);case z.JS_SDK:return function(e){return`\nconst { authorization_model_id: id } = await fgaClient.writeAuthorizationModel(${JSON.stringify(e,null,2)});\n// id = "1uHxCSuTP0VKPYSnkq1pbb1jeZw"`}(t.authorizationModel);case z.GO_SDK:return function(e,t){return`\n var writeAuthorizationModelRequestString = ${JSON.stringify(JSON.stringify(e))}\n var body WriteAuthorizationModelRequest\n if err := json.Unmarshal([]byte(writeAuthorizationModelRequestString), &body); err != nil {\n t.Errorf("%v", err)\n // .. Handle error\n return\n }\n\n data, response, err := fgaClient.${t}.WriteAuthorizationModel(context.Background()).Body(body).Execute()\n if err != nil {\n // .. Handle error\n }\n\n // data.AuthorizationModelId = "1uHxCSuTP0VKPYSnkq1pbb1jeZw"\n `}(t.authorizationModel,n.go.apiName);case z.DOTNET_SDK:return function(e){return`\n var modelJson = ${JSON.stringify(JSON.stringify(e))};\n var body = JsonSerializer.Deserialize<OpenFga.Sdk.Model.WriteAuthorizationModelRequest>(modelJson);\n\n var response = await fgaClient.WriteAuthorizationModel(body);\n // response.AuthorizationModelId = "1uHxCSuTP0VKPYSnkq1pbb1jeZw"`}(t.authorizationModel);case z.PYTHON_SDK:return function(e){return`\n# from openfga_sdk.models.write_authorization_model_request import WriteAuthorizationModelRequest\n\nasync def write_authorization_model():\n body_string = ${JSON.stringify(JSON.stringify(e))}\n response = await fga_client_instance.write_authorization_model(json.loads(body))\n # response.authorization_model_id = "1uHxCSuTP0VKPYSnkq1pbb1jeZw"\n`}(t.authorizationModel);case z.RPC:case z.PLAYGROUND:return"";default:(0,Y.ZP)(e)}var r}function be(e){const t=[z.JS_SDK,z.GO_SDK,z.DOTNET_SDK,z.PYTHON_SDK,z.CLI,z.CURL];return re(Z(e.allowedLanguages,t),e,ge)}},9996:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function i(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(n){return!1}}function a(e,t,n){var i={};return n.isMergeableObject(e)&&o(e).forEach((function(t){i[t]=r(e[t],n)})),o(t).forEach((function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&n.isMergeableObject(t[o])?i[o]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(o,n)(e[o],t[o],n):i[o]=r(t[o],n))})),i}function l(e,n,o){(o=o||{}).arrayMerge=o.arrayMerge||i,o.isMergeableObject=o.isMergeableObject||t,o.cloneUnlessOtherwiseSpecified=r;var s=Array.isArray(n);return s===Array.isArray(e)?s?o.arrayMerge(e,n,o):a(e,n,o):r(n,o)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return l(e,n,t)}),{})};var c=l;e.exports=c},17837:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.attributeNames=t.elementNames=void 0,t.elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map((function(e){return[e.toLowerCase(),e]}))),t.attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map((function(e){return[e.toLowerCase(),e]})))},97220:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.render=void 0;var a=s(n(99960)),l=n(45863),c=n(17837),u=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function d(e){return e.replace(/"/g,""")}var p=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function h(e,t){void 0===t&&(t={});for(var n=("length"in e?e:[e]),r="",i=0;i<n.length;i++)r+=f(n[i],t);return r}function f(e,t){switch(e.type){case a.Root:return h(e.children,t);case a.Doctype:case a.Directive:return"<".concat(e.data,">");case a.Comment:return function(e){return"\x3c!--".concat(e.data,"--\x3e")}(e);case a.CDATA:return function(e){return"<![CDATA[".concat(e.children[0].data,"]]>")}(e);case a.Script:case a.Style:case a.Tag:return function(e,t){var n;"foreign"===t.xmlMode&&(e.name=null!==(n=c.elementNames.get(e.name))&&void 0!==n?n:e.name,e.parent&&m.has(e.parent.name)&&(t=r(r({},t),{xmlMode:!1})));!t.xmlMode&&g.has(e.name)&&(t=r(r({},t),{xmlMode:"foreign"}));var i="<".concat(e.name),o=function(e,t){var n;if(e){var r=!1===(null!==(n=t.encodeEntities)&&void 0!==n?n:t.decodeEntities)?d:t.xmlMode||"utf8"!==t.encodeEntities?l.encodeXML:l.escapeAttribute;return Object.keys(e).map((function(n){var i,o,s=null!==(i=e[n])&&void 0!==i?i:"";return"foreign"===t.xmlMode&&(n=null!==(o=c.attributeNames.get(n))&&void 0!==o?o:n),t.emptyAttrs||t.xmlMode||""!==s?"".concat(n,'="').concat(r(s),'"'):n})).join(" ")}}(e.attribs,t);o&&(i+=" ".concat(o));0===e.children.length&&(t.xmlMode?!1!==t.selfClosingTags:t.selfClosingTags&&p.has(e.name))?(t.xmlMode||(i+=" "),i+="/>"):(i+=">",e.children.length>0&&(i+=h(e.children,t)),!t.xmlMode&&p.has(e.name)||(i+="</".concat(e.name,">")));return i}(e,t);case a.Text:return function(e,t){var n,r=e.data||"";!1===(null!==(n=t.encodeEntities)&&void 0!==n?n:t.decodeEntities)||!t.xmlMode&&e.parent&&u.has(e.parent.name)||(r=t.xmlMode||"utf8"!==t.encodeEntities?(0,l.encodeXML)(r):(0,l.escapeText)(r));return r}(e,t)}}t.render=h,t.default=h;var m=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),g=new Set(["svg","math"])},99960:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},47915:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var o=n(99960),s=n(97790);i(n(97790),t);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function e(e,t,n){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=a),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:a,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?o.ElementType.Tag:void 0,r=new s.Element(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===o.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new s.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment)this.lastNode.data+=e;else{var t=new s.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new s.Text(""),t=new s.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new s.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=l,t.default=l},97790:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.cloneNode=t.hasChildren=t.isDocument=t.isDirective=t.isComment=t.isText=t.isCDATA=t.isTag=t.Element=t.Document=t.CDATA=t.NodeWithChildren=t.ProcessingInstruction=t.Comment=t.Text=t.DataNode=t.Node=void 0;var s=n(99960),a=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return void 0===e&&(e=!1),S(this,e)},e}();t.Node=a;var l=function(e){function t(t){var n=e.call(this)||this;return n.data=t,n}return i(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),t}(a);t.DataNode=l;var c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.Text,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(l);t.Text=c;var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.Comment,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(l);t.Comment=u;var d=function(e){function t(t,n){var r=e.call(this,n)||this;return r.name=t,r.type=s.ElementType.Directive,r}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(l);t.ProcessingInstruction=d;var p=function(e){function t(t){var n=e.call(this)||this;return n.children=t,n}return i(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(a);t.NodeWithChildren=p;var h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.CDATA,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(p);t.CDATA=h;var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=s.ElementType.Root,t}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(p);t.Document=f;var m=function(e){function t(t,n,r,i){void 0===r&&(r=[]),void 0===i&&(i="script"===t?s.ElementType.Script:"style"===t?s.ElementType.Style:s.ElementType.Tag);var o=e.call(this,r)||this;return o.name=t,o.attribs=n,o.type=i,o}return i(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}}))},enumerable:!1,configurable:!0}),t}(p);function g(e){return(0,s.isTag)(e)}function b(e){return e.type===s.ElementType.CDATA}function y(e){return e.type===s.ElementType.Text}function v(e){return e.type===s.ElementType.Comment}function w(e){return e.type===s.ElementType.Directive}function x(e){return e.type===s.ElementType.Root}function S(e,t){var n;if(void 0===t&&(t=!1),y(e))n=new c(e.data);else if(v(e))n=new u(e.data);else if(g(e)){var r=t?E(e.children):[],i=new m(e.name,o({},e.attribs),r);r.forEach((function(e){return e.parent=i})),null!=e.namespace&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]=o({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]=o({},e["x-attribsPrefix"])),n=i}else if(b(e)){r=t?E(e.children):[];var s=new h(r);r.forEach((function(e){return e.parent=s})),n=s}else if(x(e)){r=t?E(e.children):[];var a=new f(r);r.forEach((function(e){return e.parent=a})),e["x-mode"]&&(a["x-mode"]=e["x-mode"]),n=a}else{if(!w(e))throw new Error("Not implemented yet: ".concat(e.type));var l=new d(e.name,e.data);null!=e["x-name"]&&(l["x-name"]=e["x-name"],l["x-publicId"]=e["x-publicId"],l["x-systemId"]=e["x-systemId"]),n=l}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function E(e){for(var t=e.map((function(e){return S(e,!0)})),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}t.Element=m,t.isTag=g,t.isCDATA=b,t.isText=y,t.isComment=v,t.isDirective=w,t.isDocument=x,t.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")},t.cloneNode=S},16996:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFeed=void 0;var r=n(43346),i=n(23905);t.getFeed=function(e){var t=l(d,e);return t?"feed"===t.name?function(e){var t,n=e.children,r={type:"atom",items:(0,i.getElementsByTagName)("entry",n).map((function(e){var t,n=e.children,r={media:a(n)};u(r,"id","id",n),u(r,"title","title",n);var i=null===(t=l("link",n))||void 0===t?void 0:t.attribs.href;i&&(r.link=i);var o=c("summary",n)||c("content",n);o&&(r.description=o);var s=c("updated",n);return s&&(r.pubDate=new Date(s)),r}))};u(r,"id","id",n),u(r,"title","title",n);var o=null===(t=l("link",n))||void 0===t?void 0:t.attribs.href;o&&(r.link=o);u(r,"description","subtitle",n);var s=c("updated",n);s&&(r.updated=new Date(s));return u(r,"author","email",n,!0),r}(t):function(e){var t,n,r=null!==(n=null===(t=l("channel",e.children))||void 0===t?void 0:t.children)&&void 0!==n?n:[],o={type:e.name.substr(0,3),id:"",items:(0,i.getElementsByTagName)("item",e.children).map((function(e){var t=e.children,n={media:a(t)};u(n,"id","guid",t),u(n,"title","title",t),u(n,"link","link",t),u(n,"description","description",t);var r=c("pubDate",t)||c("dc:date",t);return r&&(n.pubDate=new Date(r)),n}))};u(o,"title","title",r),u(o,"link","link",r),u(o,"description","description",r);var s=c("lastBuildDate",r);s&&(o.updated=new Date(s));return u(o,"author","managingEditor",r,!0),o}(t):null};var o=["url","type","lang"],s=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function a(e){return(0,i.getElementsByTagName)("media:content",e).map((function(e){for(var t=e.attribs,n={medium:t.medium,isDefault:!!t.isDefault},r=0,i=o;r<i.length;r++){t[c=i[r]]&&(n[c]=t[c])}for(var a=0,l=s;a<l.length;a++){var c;t[c=l[a]]&&(n[c]=parseInt(t[c],10))}return t.expression&&(n.expression=t.expression),n}))}function l(e,t){return(0,i.getElementsByTagName)(e,t,!0,1)[0]}function c(e,t,n){return void 0===n&&(n=!1),(0,r.textContent)((0,i.getElementsByTagName)(e,t,n,1)).trim()}function u(e,t,n,r,i){void 0===i&&(i=!1);var o=c(n,r,i);o&&(e[t]=o)}function d(e){return"rss"===e||"feed"===e||"rdf:RDF"===e}},74975:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uniqueSort=t.compareDocumentPosition=t.DocumentPosition=t.removeSubsets=void 0;var r,i=n(47915);function o(e,t){var n=[],o=[];if(e===t)return 0;for(var s=(0,i.hasChildren)(e)?e:e.parent;s;)n.unshift(s),s=s.parent;for(s=(0,i.hasChildren)(t)?t:t.parent;s;)o.unshift(s),s=s.parent;for(var a=Math.min(n.length,o.length),l=0;l<a&&n[l]===o[l];)l++;if(0===l)return r.DISCONNECTED;var c=n[l-1],u=c.children,d=n[l],p=o[l];return u.indexOf(d)>u.indexOf(p)?c===t?r.FOLLOWING|r.CONTAINED_BY:r.FOLLOWING:c===e?r.PRECEDING|r.CONTAINS:r.PRECEDING}t.removeSubsets=function(e){for(var t=e.length;--t>=0;){var n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0)e.splice(t,1);else for(var r=n.parent;r;r=r.parent)if(e.includes(r)){e.splice(t,1);break}}return e},function(e){e[e.DISCONNECTED=1]="DISCONNECTED",e[e.PRECEDING=2]="PRECEDING",e[e.FOLLOWING=4]="FOLLOWING",e[e.CONTAINS=8]="CONTAINS",e[e.CONTAINED_BY=16]="CONTAINED_BY"}(r=t.DocumentPosition||(t.DocumentPosition={})),t.compareDocumentPosition=o,t.uniqueSort=function(e){return(e=e.filter((function(e,t,n){return!n.includes(e,t+1)}))).sort((function(e,t){var n=o(e,t);return n&r.PRECEDING?-1:n&r.FOLLOWING?1:0})),e}},89432:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasChildren=t.isDocument=t.isComment=t.isText=t.isCDATA=t.isTag=void 0,i(n(43346),t),i(n(85010),t),i(n(26765),t),i(n(98043),t),i(n(23905),t),i(n(74975),t),i(n(16996),t);var o=n(47915);Object.defineProperty(t,"isTag",{enumerable:!0,get:function(){return o.isTag}}),Object.defineProperty(t,"isCDATA",{enumerable:!0,get:function(){return o.isCDATA}}),Object.defineProperty(t,"isText",{enumerable:!0,get:function(){return o.isText}}),Object.defineProperty(t,"isComment",{enumerable:!0,get:function(){return o.isComment}}),Object.defineProperty(t,"isDocument",{enumerable:!0,get:function(){return o.isDocument}}),Object.defineProperty(t,"hasChildren",{enumerable:!0,get:function(){return o.hasChildren}})},23905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getElementsByTagType=t.getElementsByTagName=t.getElementById=t.getElements=t.testElement=void 0;var r=n(47915),i=n(98043),o={tag_name:function(e){return"function"==typeof e?function(t){return(0,r.isTag)(t)&&e(t.name)}:"*"===e?r.isTag:function(t){return(0,r.isTag)(t)&&t.name===e}},tag_type:function(e){return"function"==typeof e?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return"function"==typeof e?function(t){return(0,r.isText)(t)&&e(t.data)}:function(t){return(0,r.isText)(t)&&t.data===e}}};function s(e,t){return"function"==typeof t?function(n){return(0,r.isTag)(n)&&t(n.attribs[e])}:function(n){return(0,r.isTag)(n)&&n.attribs[e]===t}}function a(e,t){return function(n){return e(n)||t(n)}}function l(e){var t=Object.keys(e).map((function(t){var n=e[t];return Object.prototype.hasOwnProperty.call(o,t)?o[t](n):s(t,n)}));return 0===t.length?null:t.reduce(a)}t.testElement=function(e,t){var n=l(e);return!n||n(t)},t.getElements=function(e,t,n,r){void 0===r&&(r=1/0);var o=l(e);return o?(0,i.filter)(o,t,n,r):[]},t.getElementById=function(e,t,n){return void 0===n&&(n=!0),Array.isArray(t)||(t=[t]),(0,i.findOne)(s("id",e),t,n)},t.getElementsByTagName=function(e,t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=1/0),(0,i.filter)(o.tag_name(e),t,n,r)},t.getElementsByTagType=function(e,t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=1/0),(0,i.filter)(o.tag_type(e),t,n,r)}},26765:(e,t)=>{"use strict";function n(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children,n=t.lastIndexOf(e);n>=0&&t.splice(n,1)}e.next=null,e.prev=null,e.parent=null}Object.defineProperty(t,"__esModule",{value:!0}),t.prepend=t.prependChild=t.append=t.appendChild=t.replaceElement=t.removeElement=void 0,t.removeElement=n,t.replaceElement=function(e,t){var n=t.prev=e.prev;n&&(n.next=t);var r=t.next=e.next;r&&(r.prev=t);var i=t.parent=e.parent;if(i){var o=i.children;o[o.lastIndexOf(e)]=t,e.parent=null}},t.appendChild=function(e,t){if(n(t),t.next=null,t.parent=e,e.children.push(t)>1){var r=e.children[e.children.length-2];r.next=t,t.prev=r}else t.prev=null},t.append=function(e,t){n(t);var r=e.parent,i=e.next;if(t.next=i,t.prev=e,e.next=t,t.parent=r,i){if(i.prev=t,r){var o=r.children;o.splice(o.lastIndexOf(i),0,t)}}else r&&r.children.push(t)},t.prependChild=function(e,t){if(n(t),t.parent=e,t.prev=null,1!==e.children.unshift(t)){var r=e.children[1];r.prev=t,t.next=r}else t.next=null},t.prepend=function(e,t){n(t);var r=e.parent;if(r){var i=r.children;i.splice(i.indexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=r,t.prev=e.prev,t.next=e,e.prev=t}},98043:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findAll=t.existsOne=t.findOne=t.findOneChild=t.find=t.filter=void 0;var r=n(47915);function i(e,t,n,i){for(var o=[],s=[t],a=[0];;)if(a[0]>=s[0].length){if(1===a.length)return o;s.shift(),a.shift()}else{var l=s[0][a[0]++];if(e(l)&&(o.push(l),--i<=0))return o;n&&(0,r.hasChildren)(l)&&l.children.length>0&&(a.unshift(0),s.unshift(l.children))}}t.filter=function(e,t,n,r){return void 0===n&&(n=!0),void 0===r&&(r=1/0),i(e,Array.isArray(t)?t:[t],n,r)},t.find=i,t.findOneChild=function(e,t){return t.find(e)},t.findOne=function e(t,n,i){void 0===i&&(i=!0);for(var o=null,s=0;s<n.length&&!o;s++){var a=n[s];(0,r.isTag)(a)&&(t(a)?o=a:i&&a.children.length>0&&(o=e(t,a.children,!0)))}return o},t.existsOne=function e(t,n){return n.some((function(n){return(0,r.isTag)(n)&&(t(n)||e(t,n.children))}))},t.findAll=function(e,t){for(var n=[],i=[t],o=[0];;)if(o[0]>=i[0].length){if(1===i.length)return n;i.shift(),o.shift()}else{var s=i[0][o[0]++];(0,r.isTag)(s)&&(e(s)&&n.push(s),s.children.length>0&&(o.unshift(0),i.unshift(s.children)))}}},43346:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.innerText=t.textContent=t.getText=t.getInnerHTML=t.getOuterHTML=void 0;var i=n(47915),o=r(n(97220)),s=n(99960);function a(e,t){return(0,o.default)(e,t)}t.getOuterHTML=a,t.getInnerHTML=function(e,t){return(0,i.hasChildren)(e)?e.children.map((function(e){return a(e,t)})).join(""):""},t.getText=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,i.isTag)(t)?"br"===t.name?"\n":e(t.children):(0,i.isCDATA)(t)?e(t.children):(0,i.isText)(t)?t.data:""},t.textContent=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,i.hasChildren)(t)&&!(0,i.isComment)(t)?e(t.children):(0,i.isText)(t)?t.data:""},t.innerText=function e(t){return Array.isArray(t)?t.map(e).join(""):(0,i.hasChildren)(t)&&(t.type===s.ElementType.Tag||(0,i.isCDATA)(t))?e(t.children):(0,i.isText)(t)?t.data:""}},85010:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prevElementSibling=t.nextElementSibling=t.getName=t.hasAttrib=t.getAttributeValue=t.getSiblings=t.getParent=t.getChildren=void 0;var r=n(47915);function i(e){return(0,r.hasChildren)(e)?e.children:[]}function o(e){return e.parent||null}t.getChildren=i,t.getParent=o,t.getSiblings=function(e){var t=o(e);if(null!=t)return i(t);for(var n=[e],r=e.prev,s=e.next;null!=r;)n.unshift(r),r=r.prev;for(;null!=s;)n.push(s),s=s.next;return n},t.getAttributeValue=function(e,t){var n;return null===(n=e.attribs)||void 0===n?void 0:n[t]},t.hasAttrib=function(e,t){return null!=e.attribs&&Object.prototype.hasOwnProperty.call(e.attribs,t)&&null!=e.attribs[t]},t.getName=function(e){return e.name},t.nextElementSibling=function(e){for(var t=e.next;null!==t&&!(0,r.isTag)(t);)t=t.next;return t},t.prevElementSibling=function(e){for(var t=e.prev;null!==t&&!(0,r.isTag)(t);)t=t.prev;return t}},44076:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXML=t.decodeHTMLStrict=t.decodeHTMLAttribute=t.decodeHTML=t.determineBranch=t.EntityDecoder=t.DecodingMode=t.BinTrieFlags=t.fromCodePoint=t.replaceCodePoint=t.decodeCodePoint=t.xmlDecodeTree=t.htmlDecodeTree=void 0;var a=s(n(63704));t.htmlDecodeTree=a.default;var l=s(n(22060));t.xmlDecodeTree=l.default;var c=o(n(26));t.decodeCodePoint=c.default;var u,d=n(26);Object.defineProperty(t,"replaceCodePoint",{enumerable:!0,get:function(){return d.replaceCodePoint}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return d.fromCodePoint}}),function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"}(u||(u={}));var p,h,f;function m(e){return e>=u.ZERO&&e<=u.NINE}function g(e){return e===u.EQUALS||function(e){return e>=u.UPPER_A&&e<=u.UPPER_Z||e>=u.LOWER_A&&e<=u.LOWER_Z||m(e)}(e)}!function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"}(p=t.BinTrieFlags||(t.BinTrieFlags={})),function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"}(h||(h={})),function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"}(f=t.DecodingMode||(t.DecodingMode={}));var b=function(){function e(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=h.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=f.Strict}return e.prototype.startEntity=function(e){this.decodeMode=e,this.state=h.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},e.prototype.write=function(e,t){switch(this.state){case h.EntityStart:return e.charCodeAt(t)===u.NUM?(this.state=h.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=h.NamedEntity,this.stateNamedEntity(e,t));case h.NumericStart:return this.stateNumericStart(e,t);case h.NumericDecimal:return this.stateNumericDecimal(e,t);case h.NumericHex:return this.stateNumericHex(e,t);case h.NamedEntity:return this.stateNamedEntity(e,t)}},e.prototype.stateNumericStart=function(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===u.LOWER_X?(this.state=h.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=h.NumericDecimal,this.stateNumericDecimal(e,t))},e.prototype.addToNumericResult=function(e,t,n,r){if(t!==n){var i=n-t;this.result=this.result*Math.pow(r,i)+parseInt(e.substr(t,i),r),this.consumed+=i}},e.prototype.stateNumericHex=function(e,t){for(var n,r=t;t<e.length;){var i=e.charCodeAt(t);if(!(m(i)||(n=i,n>=u.UPPER_A&&n<=u.UPPER_F||n>=u.LOWER_A&&n<=u.LOWER_F)))return this.addToNumericResult(e,r,t,16),this.emitNumericEntity(i,3);t+=1}return this.addToNumericResult(e,r,t,16),-1},e.prototype.stateNumericDecimal=function(e,t){for(var n=t;t<e.length;){var r=e.charCodeAt(t);if(!m(r))return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2);t+=1}return this.addToNumericResult(e,n,t,10),-1},e.prototype.emitNumericEntity=function(e,t){var n;if(this.consumed<=t)return null===(n=this.errors)||void 0===n||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===u.SEMI)this.consumed+=1;else if(this.decodeMode===f.Strict)return 0;return this.emitCodePoint((0,c.replaceCodePoint)(this.result),this.consumed),this.errors&&(e!==u.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed},e.prototype.stateNamedEntity=function(e,t){for(var n=this.decodeTree,r=n[this.treeIndex],i=(r&p.VALUE_LENGTH)>>14;t<e.length;t++,this.excess++){var o=e.charCodeAt(t);if(this.treeIndex=v(n,r,this.treeIndex+Math.max(1,i),o),this.treeIndex<0)return 0===this.result||this.decodeMode===f.Attribute&&(0===i||g(o))?0:this.emitNotTerminatedNamedEntity();if(0!==(i=((r=n[this.treeIndex])&p.VALUE_LENGTH)>>14)){if(o===u.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==f.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1},e.prototype.emitNotTerminatedNamedEntity=function(){var e,t=this.result,n=(this.decodeTree[t]&p.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,n,this.consumed),null===(e=this.errors)||void 0===e||e.missingSemicolonAfterCharacterReference(),this.consumed},e.prototype.emitNamedEntityData=function(e,t,n){var r=this.decodeTree;return this.emitCodePoint(1===t?r[e]&~p.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n},e.prototype.end=function(){var e;switch(this.state){case h.NamedEntity:return 0===this.result||this.decodeMode===f.Attribute&&this.result!==this.treeIndex?0:this.emitNotTerminatedNamedEntity();case h.NumericDecimal:return this.emitNumericEntity(0,2);case h.NumericHex:return this.emitNumericEntity(0,3);case h.NumericStart:return null===(e=this.errors)||void 0===e||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case h.EntityStart:return 0}},e}();function y(e){var t="",n=new b(e,(function(e){return t+=(0,c.fromCodePoint)(e)}));return function(e,r){for(var i=0,o=0;(o=e.indexOf("&",o))>=0;){t+=e.slice(i,o),n.startEntity(r);var s=n.write(e,o+1);if(s<0){i=o+n.end();break}i=o+s,o=0===s?i+1:i}var a=t+e.slice(i);return t="",a}}function v(e,t,n,r){var i=(t&p.BRANCH_LENGTH)>>7,o=t&p.JUMP_TABLE;if(0===i)return 0!==o&&r===o?n:-1;if(o){var s=r-o;return s<0||s>=i?-1:e[n+s]-1}for(var a=n,l=a+i-1;a<=l;){var c=a+l>>>1,u=e[c];if(u<r)a=c+1;else{if(!(u>r))return e[c+i];l=c-1}}return-1}t.EntityDecoder=b,t.determineBranch=v;var w=y(a.default),x=y(l.default);t.decodeHTML=function(e,t){return void 0===t&&(t=f.Legacy),w(e,t)},t.decodeHTMLAttribute=function(e){return w(e,f.Attribute)},t.decodeHTMLStrict=function(e){return w(e,f.Strict)},t.decodeXML=function(e){return x(e,f.Strict)}},26:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.replaceCodePoint=t.fromCodePoint=void 0;var r=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function i(e){var t;return e>=55296&&e<=57343||e>1114111?65533:null!==(t=r.get(e))&&void 0!==t?t:e}t.fromCodePoint=null!==(n=String.fromCodePoint)&&void 0!==n?n:function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)},t.replaceCodePoint=i,t.default=function(e){return(0,t.fromCodePoint)(i(e))}},87322:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.encodeNonAsciiHTML=t.encodeHTML=void 0;var i=r(n(94021)),o=n(24625),s=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function a(e,t){for(var n,r="",s=0;null!==(n=e.exec(t));){var a=n.index;r+=t.substring(s,a);var l=t.charCodeAt(a),c=i.default.get(l);if("object"==typeof c){if(a+1<t.length){var u=t.charCodeAt(a+1),d="number"==typeof c.n?c.n===u?c.o:void 0:c.n.get(u);if(void 0!==d){r+=d,s=e.lastIndex+=1;continue}}c=c.v}if(void 0!==c)r+=c,s=a+1;else{var p=(0,o.getCodePoint)(t,a);r+="&#x".concat(p.toString(16),";"),s=e.lastIndex+=Number(p!==l)}}return r+t.substr(s)}t.encodeHTML=function(e){return a(s,e)},t.encodeNonAsciiHTML=function(e){return a(o.xmlReplacer,e)}},24625:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.getCodePoint=t.xmlReplacer=void 0,t.xmlReplacer=/["&'<>$\x80-\uFFFF]/g;var n=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);function r(e){for(var r,i="",o=0;null!==(r=t.xmlReplacer.exec(e));){var s=r.index,a=e.charCodeAt(s),l=n.get(a);void 0!==l?(i+=e.substring(o,s)+l,o=s+1):(i+="".concat(e.substring(o,s),"&#x").concat((0,t.getCodePoint)(e,s).toString(16),";"),o=t.xmlReplacer.lastIndex+=Number(55296==(64512&a)))}return i+e.substr(o)}function i(e,t){return function(n){for(var r,i=0,o="";r=e.exec(n);)i!==r.index&&(o+=n.substring(i,r.index)),o+=t.get(r[0].charCodeAt(0)),i=r.index+1;return o+n.substring(i)}}t.getCodePoint=null!=String.prototype.codePointAt?function(e,t){return e.codePointAt(t)}:function(e,t){return 55296==(64512&e.charCodeAt(t))?1024*(e.charCodeAt(t)-55296)+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t)},t.encodeXML=r,t.escape=r,t.escapeUTF8=i(/[&<>'"]/g,n),t.escapeAttribute=i(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),t.escapeText=i(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]))},63704:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Uint16Array('\u1d41<\xd5\u0131\u028a\u049d\u057b\u05d0\u0675\u06de\u07a2\u07d6\u080f\u0a4a\u0a91\u0da1\u0e6d\u0f09\u0f26\u10ca\u1228\u12e1\u1415\u149d\u14c3\u14df\u1525\0\0\0\0\0\0\u156b\u16cd\u198d\u1c12\u1ddd\u1f7e\u2060\u21b0\u228d\u23c0\u23fb\u2442\u2824\u2912\u2d08\u2e48\u2fce\u3016\u32ba\u3639\u37ac\u38fe\u3a28\u3a71\u3ae0\u3b2e\u0800EMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig\u803b\xc6\u40c6P\u803b&\u4026cute\u803b\xc1\u40c1reve;\u4102\u0100iyx}rc\u803b\xc2\u40c2;\u4410r;\uc000\ud835\udd04rave\u803b\xc0\u40c0pha;\u4391acr;\u4100d;\u6a53\u0100gp\x9d\xa1on;\u4104f;\uc000\ud835\udd38plyFunction;\u6061ing\u803b\xc5\u40c5\u0100cs\xbe\xc3r;\uc000\ud835\udc9cign;\u6254ilde\u803b\xc3\u40c3ml\u803b\xc4\u40c4\u0400aceforsu\xe5\xfb\xfe\u0117\u011c\u0122\u0127\u012a\u0100cr\xea\xf2kslash;\u6216\u0176\xf6\xf8;\u6ae7ed;\u6306y;\u4411\u0180crt\u0105\u010b\u0114ause;\u6235noullis;\u612ca;\u4392r;\uc000\ud835\udd05pf;\uc000\ud835\udd39eve;\u42d8c\xf2\u0113mpeq;\u624e\u0700HOacdefhilorsu\u014d\u0151\u0156\u0180\u019e\u01a2\u01b5\u01b7\u01ba\u01dc\u0215\u0273\u0278\u027ecy;\u4427PY\u803b\xa9\u40a9\u0180cpy\u015d\u0162\u017aute;\u4106\u0100;i\u0167\u0168\u62d2talDifferentialD;\u6145leys;\u612d\u0200aeio\u0189\u018e\u0194\u0198ron;\u410cdil\u803b\xc7\u40c7rc;\u4108nint;\u6230ot;\u410a\u0100dn\u01a7\u01adilla;\u40b8terDot;\u40b7\xf2\u017fi;\u43a7rcle\u0200DMPT\u01c7\u01cb\u01d1\u01d6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01e2\u01f8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020foubleQuote;\u601duote;\u6019\u0200lnpu\u021e\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6a74\u0180git\u022f\u0236\u023aruent;\u6261nt;\u622fourIntegral;\u622e\u0100fr\u024c\u024e;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6a2fcr;\uc000\ud835\udc9ep\u0100;C\u0284\u0285\u62d3ap;\u624d\u0580DJSZacefios\u02a0\u02ac\u02b0\u02b4\u02b8\u02cb\u02d7\u02e1\u02e6\u0333\u048d\u0100;o\u0179\u02a5trahd;\u6911cy;\u4402cy;\u4405cy;\u440f\u0180grs\u02bf\u02c4\u02c7ger;\u6021r;\u61a1hv;\u6ae4\u0100ay\u02d0\u02d5ron;\u410e;\u4414l\u0100;t\u02dd\u02de\u6207a;\u4394r;\uc000\ud835\udd07\u0100af\u02eb\u0327\u0100cm\u02f0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031ccute;\u40b4o\u0174\u030b\u030d;\u42d9bleAcute;\u42ddrave;\u4060ilde;\u42dcond;\u62c4ferentialD;\u6146\u0470\u033d\0\0\0\u0342\u0354\0\u0405f;\uc000\ud835\udd3b\u0180;DE\u0348\u0349\u034d\u40a8ot;\u60dcqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03cf\u03e2\u03f8ontourIntegra\xec\u0239o\u0274\u0379\0\0\u037b\xbb\u0349nArrow;\u61d3\u0100eo\u0387\u03a4ft\u0180ART\u0390\u0396\u03a1rrow;\u61d0ightArrow;\u61d4e\xe5\u02cang\u0100LR\u03ab\u03c4eft\u0100AR\u03b3\u03b9rrow;\u67f8ightArrow;\u67faightArrow;\u67f9ight\u0100AT\u03d8\u03derrow;\u61d2ee;\u62a8p\u0241\u03e9\0\0\u03efrrow;\u61d1ownArrow;\u61d5erticalBar;\u6225n\u0300ABLRTa\u0412\u042a\u0430\u045e\u047f\u037crrow\u0180;BU\u041d\u041e\u0422\u6193ar;\u6913pArrow;\u61f5reve;\u4311eft\u02d2\u043a\0\u0446\0\u0450ightVector;\u6950eeVector;\u695eector\u0100;B\u0459\u045a\u61bdar;\u6956ight\u01d4\u0467\0\u0471eeVector;\u695fector\u0100;B\u047a\u047b\u61c1ar;\u6957ee\u0100;A\u0486\u0487\u62a4rrow;\u61a7\u0100ct\u0492\u0497r;\uc000\ud835\udc9frok;\u4110\u0800NTacdfglmopqstux\u04bd\u04c0\u04c4\u04cb\u04de\u04e2\u04e7\u04ee\u04f5\u0521\u052f\u0536\u0552\u055d\u0560\u0565G;\u414aH\u803b\xd0\u40d0cute\u803b\xc9\u40c9\u0180aiy\u04d2\u04d7\u04dcron;\u411arc\u803b\xca\u40ca;\u442dot;\u4116r;\uc000\ud835\udd08rave\u803b\xc8\u40c8ement;\u6208\u0100ap\u04fa\u04fecr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65fberySmallSquare;\u65ab\u0100gp\u0526\u052aon;\u4118f;\uc000\ud835\udd3csilon;\u4395u\u0100ai\u053c\u0549l\u0100;T\u0542\u0543\u6a75ilde;\u6242librium;\u61cc\u0100ci\u0557\u055ar;\u6130m;\u6a73a;\u4397ml\u803b\xcb\u40cb\u0100ip\u056a\u056fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058d\u05b2\u05ccy;\u4424r;\uc000\ud835\udd09lled\u0253\u0597\0\0\u05a3mallSquare;\u65fcerySmallSquare;\u65aa\u0370\u05ba\0\u05bf\0\0\u05c4f;\uc000\ud835\udd3dAll;\u6200riertrf;\u6131c\xf2\u05cb\u0600JTabcdfgorst\u05e8\u05ec\u05ef\u05fa\u0600\u0612\u0616\u061b\u061d\u0623\u066c\u0672cy;\u4403\u803b>\u403emma\u0100;d\u05f7\u05f8\u4393;\u43dcreve;\u411e\u0180eiy\u0607\u060c\u0610dil;\u4122rc;\u411c;\u4413ot;\u4120r;\uc000\ud835\udd0a;\u62d9pf;\uc000\ud835\udd3eeater\u0300EFGLST\u0635\u0644\u064e\u0656\u065b\u0666qual\u0100;L\u063e\u063f\u6265ess;\u62dbullEqual;\u6267reater;\u6aa2ess;\u6277lantEqual;\u6a7eilde;\u6273cr;\uc000\ud835\udca2;\u626b\u0400Aacfiosu\u0685\u068b\u0696\u069b\u069e\u06aa\u06be\u06caRDcy;\u442a\u0100ct\u0690\u0694ek;\u42c7;\u405eirc;\u4124r;\u610clbertSpace;\u610b\u01f0\u06af\0\u06b2f;\u610dizontalLine;\u6500\u0100ct\u06c3\u06c5\xf2\u06a9rok;\u4126mp\u0144\u06d0\u06d8ownHum\xf0\u012fqual;\u624f\u0700EJOacdfgmnostu\u06fa\u06fe\u0703\u0707\u070e\u071a\u071e\u0721\u0728\u0744\u0778\u078b\u078f\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803b\xcd\u40cd\u0100iy\u0713\u0718rc\u803b\xce\u40ce;\u4418ot;\u4130r;\u6111rave\u803b\xcc\u40cc\u0180;ap\u0720\u072f\u073f\u0100cg\u0734\u0737r;\u412ainaryI;\u6148lie\xf3\u03dd\u01f4\u0749\0\u0762\u0100;e\u074d\u074e\u622c\u0100gr\u0753\u0758ral;\u622bsection;\u62c2isible\u0100CT\u076c\u0772omma;\u6063imes;\u6062\u0180gpt\u077f\u0783\u0788on;\u412ef;\uc000\ud835\udd40a;\u4399cr;\u6110ilde;\u4128\u01eb\u079a\0\u079ecy;\u4406l\u803b\xcf\u40cf\u0280cfosu\u07ac\u07b7\u07bc\u07c2\u07d0\u0100iy\u07b1\u07b5rc;\u4134;\u4419r;\uc000\ud835\udd0dpf;\uc000\ud835\udd41\u01e3\u07c7\0\u07ccr;\uc000\ud835\udca5rcy;\u4408kcy;\u4404\u0380HJacfos\u07e4\u07e8\u07ec\u07f1\u07fd\u0802\u0808cy;\u4425cy;\u440cppa;\u439a\u0100ey\u07f6\u07fbdil;\u4136;\u441ar;\uc000\ud835\udd0epf;\uc000\ud835\udd42cr;\uc000\ud835\udca6\u0580JTaceflmost\u0825\u0829\u082c\u0850\u0863\u09b3\u09b8\u09c7\u09cd\u0a37\u0a47cy;\u4409\u803b<\u403c\u0280cmnpr\u0837\u083c\u0841\u0844\u084dute;\u4139bda;\u439bg;\u67ealacetrf;\u6112r;\u619e\u0180aey\u0857\u085c\u0861ron;\u413ddil;\u413b;\u441b\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087e\u08a9\u08b1\u08e0\u08e6\u08fc\u092f\u095b\u0390\u096a\u0100nr\u0883\u088fgleBracket;\u67e8row\u0180;BR\u0899\u089a\u089e\u6190ar;\u61e4ightArrow;\u61c6eiling;\u6308o\u01f5\u08b7\0\u08c3bleBracket;\u67e6n\u01d4\u08c8\0\u08d2eeVector;\u6961ector\u0100;B\u08db\u08dc\u61c3ar;\u6959loor;\u630aight\u0100AV\u08ef\u08f5rrow;\u6194ector;\u694e\u0100er\u0901\u0917e\u0180;AV\u0909\u090a\u0910\u62a3rrow;\u61a4ector;\u695aiangle\u0180;BE\u0924\u0925\u0929\u62b2ar;\u69cfqual;\u62b4p\u0180DTV\u0937\u0942\u094cownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61bfar;\u6958ector\u0100;B\u0965\u0966\u61bcar;\u6952ight\xe1\u039cs\u0300EFGLST\u097e\u098b\u0995\u099d\u09a2\u09adqualGreater;\u62daullEqual;\u6266reater;\u6276ess;\u6aa1lantEqual;\u6a7dilde;\u6272r;\uc000\ud835\udd0f\u0100;e\u09bd\u09be\u62d8ftarrow;\u61daidot;\u413f\u0180npw\u09d4\u0a16\u0a1bg\u0200LRlr\u09de\u09f7\u0a02\u0a10eft\u0100AR\u09e6\u09ecrrow;\u67f5ightArrow;\u67f7ightArrow;\u67f6eft\u0100ar\u03b3\u0a0aight\xe1\u03bfight\xe1\u03caf;\uc000\ud835\udd43er\u0100LR\u0a22\u0a2ceftArrow;\u6199ightArrow;\u6198\u0180cht\u0a3e\u0a40\u0a42\xf2\u084c;\u61b0rok;\u4141;\u626a\u0400acefiosu\u0a5a\u0a5d\u0a60\u0a77\u0a7c\u0a85\u0a8b\u0a8ep;\u6905y;\u441c\u0100dl\u0a65\u0a6fiumSpace;\u605flintrf;\u6133r;\uc000\ud835\udd10nusPlus;\u6213pf;\uc000\ud835\udd44c\xf2\u0a76;\u439c\u0480Jacefostu\u0aa3\u0aa7\u0aad\u0ac0\u0b14\u0b19\u0d91\u0d97\u0d9ecy;\u440acute;\u4143\u0180aey\u0ab4\u0ab9\u0aberon;\u4147dil;\u4145;\u441d\u0180gsw\u0ac7\u0af0\u0b0eative\u0180MTV\u0ad3\u0adf\u0ae8ediumSpace;\u600bhi\u0100cn\u0ae6\u0ad8\xeb\u0ad9eryThi\xee\u0ad9ted\u0100GL\u0af8\u0b06reaterGreate\xf2\u0673essLes\xf3\u0a48Line;\u400ar;\uc000\ud835\udd11\u0200Bnpt\u0b22\u0b28\u0b37\u0b3areak;\u6060BreakingSpace;\u40a0f;\u6115\u0680;CDEGHLNPRSTV\u0b55\u0b56\u0b6a\u0b7c\u0ba1\u0beb\u0c04\u0c5e\u0c84\u0ca6\u0cd8\u0d61\u0d85\u6aec\u0100ou\u0b5b\u0b64ngruent;\u6262pCap;\u626doubleVerticalBar;\u6226\u0180lqx\u0b83\u0b8a\u0b9bement;\u6209ual\u0100;T\u0b92\u0b93\u6260ilde;\uc000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0bb6\u0bb7\u0bbd\u0bc9\u0bd3\u0bd8\u0be5\u626fqual;\u6271ullEqual;\uc000\u2267\u0338reater;\uc000\u226b\u0338ess;\u6279lantEqual;\uc000\u2a7e\u0338ilde;\u6275ump\u0144\u0bf2\u0bfdownHump;\uc000\u224e\u0338qual;\uc000\u224f\u0338e\u0100fs\u0c0a\u0c27tTriangle\u0180;BE\u0c1a\u0c1b\u0c21\u62eaar;\uc000\u29cf\u0338qual;\u62ecs\u0300;EGLST\u0c35\u0c36\u0c3c\u0c44\u0c4b\u0c58\u626equal;\u6270reater;\u6278ess;\uc000\u226a\u0338lantEqual;\uc000\u2a7d\u0338ilde;\u6274ested\u0100GL\u0c68\u0c79reaterGreater;\uc000\u2aa2\u0338essLess;\uc000\u2aa1\u0338recedes\u0180;ES\u0c92\u0c93\u0c9b\u6280qual;\uc000\u2aaf\u0338lantEqual;\u62e0\u0100ei\u0cab\u0cb9verseElement;\u620cghtTriangle\u0180;BE\u0ccb\u0ccc\u0cd2\u62ebar;\uc000\u29d0\u0338qual;\u62ed\u0100qu\u0cdd\u0d0cuareSu\u0100bp\u0ce8\u0cf9set\u0100;E\u0cf0\u0cf3\uc000\u228f\u0338qual;\u62e2erset\u0100;E\u0d03\u0d06\uc000\u2290\u0338qual;\u62e3\u0180bcp\u0d13\u0d24\u0d4eset\u0100;E\u0d1b\u0d1e\uc000\u2282\u20d2qual;\u6288ceeds\u0200;EST\u0d32\u0d33\u0d3b\u0d46\u6281qual;\uc000\u2ab0\u0338lantEqual;\u62e1ilde;\uc000\u227f\u0338erset\u0100;E\u0d58\u0d5b\uc000\u2283\u20d2qual;\u6289ilde\u0200;EFT\u0d6e\u0d6f\u0d75\u0d7f\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uc000\ud835\udca9ilde\u803b\xd1\u40d1;\u439d\u0700Eacdfgmoprstuv\u0dbd\u0dc2\u0dc9\u0dd5\u0ddb\u0de0\u0de7\u0dfc\u0e02\u0e20\u0e22\u0e32\u0e3f\u0e44lig;\u4152cute\u803b\xd3\u40d3\u0100iy\u0dce\u0dd3rc\u803b\xd4\u40d4;\u441eblac;\u4150r;\uc000\ud835\udd12rave\u803b\xd2\u40d2\u0180aei\u0dee\u0df2\u0df6cr;\u414cga;\u43a9cron;\u439fpf;\uc000\ud835\udd46enCurly\u0100DQ\u0e0e\u0e1aoubleQuote;\u601cuote;\u6018;\u6a54\u0100cl\u0e27\u0e2cr;\uc000\ud835\udcaaash\u803b\xd8\u40d8i\u016c\u0e37\u0e3cde\u803b\xd5\u40d5es;\u6a37ml\u803b\xd6\u40d6er\u0100BP\u0e4b\u0e60\u0100ar\u0e50\u0e53r;\u603eac\u0100ek\u0e5a\u0e5c;\u63deet;\u63b4arenthesis;\u63dc\u0480acfhilors\u0e7f\u0e87\u0e8a\u0e8f\u0e92\u0e94\u0e9d\u0eb0\u0efcrtialD;\u6202y;\u441fr;\uc000\ud835\udd13i;\u43a6;\u43a0usMinus;\u40b1\u0100ip\u0ea2\u0eadncareplan\xe5\u069df;\u6119\u0200;eio\u0eb9\u0eba\u0ee0\u0ee4\u6abbcedes\u0200;EST\u0ec8\u0ec9\u0ecf\u0eda\u627aqual;\u6aaflantEqual;\u627cilde;\u627eme;\u6033\u0100dp\u0ee9\u0eeeuct;\u620fortion\u0100;a\u0225\u0ef9l;\u621d\u0100ci\u0f01\u0f06r;\uc000\ud835\udcab;\u43a8\u0200Ufos\u0f11\u0f16\u0f1b\u0f1fOT\u803b"\u4022r;\uc000\ud835\udd14pf;\u611acr;\uc000\ud835\udcac\u0600BEacefhiorsu\u0f3e\u0f43\u0f47\u0f60\u0f73\u0fa7\u0faa\u0fad\u1096\u10a9\u10b4\u10bearr;\u6910G\u803b\xae\u40ae\u0180cnr\u0f4e\u0f53\u0f56ute;\u4154g;\u67ebr\u0100;t\u0f5c\u0f5d\u61a0l;\u6916\u0180aey\u0f67\u0f6c\u0f71ron;\u4158dil;\u4156;\u4420\u0100;v\u0f78\u0f79\u611cerse\u0100EU\u0f82\u0f99\u0100lq\u0f87\u0f8eement;\u620builibrium;\u61cbpEquilibrium;\u696fr\xbb\u0f79o;\u43a1ght\u0400ACDFTUVa\u0fc1\u0feb\u0ff3\u1022\u1028\u105b\u1087\u03d8\u0100nr\u0fc6\u0fd2gleBracket;\u67e9row\u0180;BL\u0fdc\u0fdd\u0fe1\u6192ar;\u61e5eftArrow;\u61c4eiling;\u6309o\u01f5\u0ff9\0\u1005bleBracket;\u67e7n\u01d4\u100a\0\u1014eeVector;\u695dector\u0100;B\u101d\u101e\u61c2ar;\u6955loor;\u630b\u0100er\u102d\u1043e\u0180;AV\u1035\u1036\u103c\u62a2rrow;\u61a6ector;\u695biangle\u0180;BE\u1050\u1051\u1055\u62b3ar;\u69d0qual;\u62b5p\u0180DTV\u1063\u106e\u1078ownVector;\u694feeVector;\u695cector\u0100;B\u1082\u1083\u61bear;\u6954ector\u0100;B\u1091\u1092\u61c0ar;\u6953\u0100pu\u109b\u109ef;\u611dndImplies;\u6970ightarrow;\u61db\u0100ch\u10b9\u10bcr;\u611b;\u61b1leDelayed;\u69f4\u0680HOacfhimoqstu\u10e4\u10f1\u10f7\u10fd\u1119\u111e\u1151\u1156\u1161\u1167\u11b5\u11bb\u11bf\u0100Cc\u10e9\u10eeHcy;\u4429y;\u4428FTcy;\u442ccute;\u415a\u0280;aeiy\u1108\u1109\u110e\u1113\u1117\u6abcron;\u4160dil;\u415erc;\u415c;\u4421r;\uc000\ud835\udd16ort\u0200DLRU\u112a\u1134\u113e\u1149ownArrow\xbb\u041eeftArrow\xbb\u089aightArrow\xbb\u0fddpArrow;\u6191gma;\u43a3allCircle;\u6218pf;\uc000\ud835\udd4a\u0272\u116d\0\0\u1170t;\u621aare\u0200;ISU\u117b\u117c\u1189\u11af\u65a1ntersection;\u6293u\u0100bp\u118f\u119eset\u0100;E\u1197\u1198\u628fqual;\u6291erset\u0100;E\u11a8\u11a9\u6290qual;\u6292nion;\u6294cr;\uc000\ud835\udcaear;\u62c6\u0200bcmp\u11c8\u11db\u1209\u120b\u0100;s\u11cd\u11ce\u62d0et\u0100;E\u11cd\u11d5qual;\u6286\u0100ch\u11e0\u1205eeds\u0200;EST\u11ed\u11ee\u11f4\u11ff\u627bqual;\u6ab0lantEqual;\u627dilde;\u627fTh\xe1\u0f8c;\u6211\u0180;es\u1212\u1213\u1223\u62d1rset\u0100;E\u121c\u121d\u6283qual;\u6287et\xbb\u1213\u0580HRSacfhiors\u123e\u1244\u1249\u1255\u125e\u1271\u1276\u129f\u12c2\u12c8\u12d1ORN\u803b\xde\u40deADE;\u6122\u0100Hc\u124e\u1252cy;\u440by;\u4426\u0100bu\u125a\u125c;\u4009;\u43a4\u0180aey\u1265\u126a\u126fron;\u4164dil;\u4162;\u4422r;\uc000\ud835\udd17\u0100ei\u127b\u1289\u01f2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128e\u1298kSpace;\uc000\u205f\u200aSpace;\u6009lde\u0200;EFT\u12ab\u12ac\u12b2\u12bc\u623cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uc000\ud835\udd4bipleDot;\u60db\u0100ct\u12d6\u12dbr;\uc000\ud835\udcafrok;\u4166\u0ae1\u12f7\u130e\u131a\u1326\0\u132c\u1331\0\0\0\0\0\u1338\u133d\u1377\u1385\0\u13ff\u1404\u140a\u1410\u0100cr\u12fb\u1301ute\u803b\xda\u40dar\u0100;o\u1307\u1308\u619fcir;\u6949r\u01e3\u1313\0\u1316y;\u440eve;\u416c\u0100iy\u131e\u1323rc\u803b\xdb\u40db;\u4423blac;\u4170r;\uc000\ud835\udd18rave\u803b\xd9\u40d9acr;\u416a\u0100di\u1341\u1369er\u0100BP\u1348\u135d\u0100ar\u134d\u1350r;\u405fac\u0100ek\u1357\u1359;\u63dfet;\u63b5arenthesis;\u63ddon\u0100;P\u1370\u1371\u62c3lus;\u628e\u0100gp\u137b\u137fon;\u4172f;\uc000\ud835\udd4c\u0400ADETadps\u1395\u13ae\u13b8\u13c4\u03e8\u13d2\u13d7\u13f3rrow\u0180;BD\u1150\u13a0\u13a4ar;\u6912ownArrow;\u61c5ownArrow;\u6195quilibrium;\u696eee\u0100;A\u13cb\u13cc\u62a5rrow;\u61a5own\xe1\u03f3er\u0100LR\u13de\u13e8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13f9\u13fa\u43d2on;\u43a5ing;\u416ecr;\uc000\ud835\udcb0ilde;\u4168ml\u803b\xdc\u40dc\u0480Dbcdefosv\u1427\u142c\u1430\u1433\u143e\u1485\u148a\u1490\u1496ash;\u62abar;\u6aeby;\u4412ash\u0100;l\u143b\u143c\u62a9;\u6ae6\u0100er\u1443\u1445;\u62c1\u0180bty\u144c\u1450\u147aar;\u6016\u0100;i\u144f\u1455cal\u0200BLST\u1461\u1465\u146a\u1474ar;\u6223ine;\u407ceparator;\u6758ilde;\u6240ThinSpace;\u600ar;\uc000\ud835\udd19pf;\uc000\ud835\udd4dcr;\uc000\ud835\udcb1dash;\u62aa\u0280cefos\u14a7\u14ac\u14b1\u14b6\u14bcirc;\u4174dge;\u62c0r;\uc000\ud835\udd1apf;\uc000\ud835\udd4ecr;\uc000\ud835\udcb2\u0200fios\u14cb\u14d0\u14d2\u14d8r;\uc000\ud835\udd1b;\u439epf;\uc000\ud835\udd4fcr;\uc000\ud835\udcb3\u0480AIUacfosu\u14f1\u14f5\u14f9\u14fd\u1504\u150f\u1514\u151a\u1520cy;\u442fcy;\u4407cy;\u442ecute\u803b\xdd\u40dd\u0100iy\u1509\u150drc;\u4176;\u442br;\uc000\ud835\udd1cpf;\uc000\ud835\udd50cr;\uc000\ud835\udcb4ml;\u4178\u0400Hacdefos\u1535\u1539\u153f\u154b\u154f\u155d\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417d;\u4417ot;\u417b\u01f2\u1554\0\u155boWidt\xe8\u0ad9a;\u4396r;\u6128pf;\u6124cr;\uc000\ud835\udcb5\u0be1\u1583\u158a\u1590\0\u15b0\u15b6\u15bf\0\0\0\0\u15c6\u15db\u15eb\u165f\u166d\0\u1695\u169b\u16b2\u16b9\0\u16becute\u803b\xe1\u40e1reve;\u4103\u0300;Ediuy\u159c\u159d\u15a1\u15a3\u15a8\u15ad\u623e;\uc000\u223e\u0333;\u623frc\u803b\xe2\u40e2te\u80bb\xb4\u0306;\u4430lig\u803b\xe6\u40e6\u0100;r\xb2\u15ba;\uc000\ud835\udd1erave\u803b\xe0\u40e0\u0100ep\u15ca\u15d6\u0100fp\u15cf\u15d4sym;\u6135\xe8\u15d3ha;\u43b1\u0100ap\u15dfc\u0100cl\u15e4\u15e7r;\u4101g;\u6a3f\u0264\u15f0\0\0\u160a\u0280;adsv\u15fa\u15fb\u15ff\u1601\u1607\u6227nd;\u6a55;\u6a5clope;\u6a58;\u6a5a\u0380;elmrsz\u1618\u1619\u161b\u161e\u163f\u164f\u1659\u6220;\u69a4e\xbb\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163a\u163c\u163e;\u69a8;\u69a9;\u69aa;\u69ab;\u69ac;\u69ad;\u69ae;\u69aft\u0100;v\u1645\u1646\u621fb\u0100;d\u164c\u164d\u62be;\u699d\u0100pt\u1654\u1657h;\u6222\xbb\xb9arr;\u637c\u0100gp\u1663\u1667on;\u4105f;\uc000\ud835\udd52\u0380;Eaeiop\u12c1\u167b\u167d\u1682\u1684\u1687\u168a;\u6a70cir;\u6a6f;\u624ad;\u624bs;\u4027rox\u0100;e\u12c1\u1692\xf1\u1683ing\u803b\xe5\u40e5\u0180cty\u16a1\u16a6\u16a8r;\uc000\ud835\udcb6;\u402amp\u0100;e\u12c1\u16af\xf1\u0288ilde\u803b\xe3\u40e3ml\u803b\xe4\u40e4\u0100ci\u16c2\u16c8onin\xf4\u0272nt;\u6a11\u0800Nabcdefiklnoprsu\u16ed\u16f1\u1730\u173c\u1743\u1748\u1778\u177d\u17e0\u17e6\u1839\u1850\u170d\u193d\u1948\u1970ot;\u6aed\u0100cr\u16f6\u171ek\u0200ceps\u1700\u1705\u170d\u1713ong;\u624cpsilon;\u43f6rime;\u6035im\u0100;e\u171a\u171b\u623dq;\u62cd\u0176\u1722\u1726ee;\u62bded\u0100;g\u172c\u172d\u6305e\xbb\u172drk\u0100;t\u135c\u1737brk;\u63b6\u0100oy\u1701\u1741;\u4431quo;\u601e\u0280cmprt\u1753\u175b\u1761\u1764\u1768aus\u0100;e\u010a\u0109ptyv;\u69b0s\xe9\u170cno\xf5\u0113\u0180ahw\u176f\u1771\u1773;\u43b2;\u6136een;\u626cr;\uc000\ud835\udd1fg\u0380costuvw\u178d\u179d\u17b3\u17c1\u17d5\u17db\u17de\u0180aiu\u1794\u1796\u179a\xf0\u0760rc;\u65efp\xbb\u1371\u0180dpt\u17a4\u17a8\u17adot;\u6a00lus;\u6a01imes;\u6a02\u0271\u17b9\0\0\u17becup;\u6a06ar;\u6605riangle\u0100du\u17cd\u17d2own;\u65bdp;\u65b3plus;\u6a04e\xe5\u1444\xe5\u14adarow;\u690d\u0180ako\u17ed\u1826\u1835\u0100cn\u17f2\u1823k\u0180lst\u17fa\u05ab\u1802ozenge;\u69ebriangle\u0200;dlr\u1812\u1813\u1818\u181d\u65b4own;\u65beeft;\u65c2ight;\u65b8k;\u6423\u01b1\u182b\0\u1833\u01b2\u182f\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183e\u184d\u0100;q\u1843\u1846\uc000=\u20e5uiv;\uc000\u2261\u20e5t;\u6310\u0200ptwx\u1859\u185e\u1867\u186cf;\uc000\ud835\udd53\u0100;t\u13cb\u1863om\xbb\u13cctie;\u62c8\u0600DHUVbdhmptuv\u1885\u1896\u18aa\u18bb\u18d7\u18db\u18ec\u18ff\u1905\u190a\u1910\u1921\u0200LRlr\u188e\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18a1\u18a2\u18a4\u18a6\u18a8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18b3\u18b5\u18b7\u18b9;\u655d;\u655a;\u655c;\u6559\u0380;HLRhlr\u18ca\u18cb\u18cd\u18cf\u18d1\u18d3\u18d5\u6551;\u656c;\u6563;\u6560;\u656b;\u6562;\u655fox;\u69c9\u0200LRlr\u18e4\u18e6\u18e8\u18ea;\u6555;\u6552;\u6510;\u650c\u0280;DUdu\u06bd\u18f7\u18f9\u18fb\u18fd;\u6565;\u6568;\u652c;\u6534inus;\u629flus;\u629eimes;\u62a0\u0200LRlr\u1919\u191b\u191d\u191f;\u655b;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193b\u6502;\u656a;\u6561;\u655e;\u653c;\u6524;\u651c\u0100ev\u0123\u1942bar\u803b\xa6\u40a6\u0200ceio\u1951\u1956\u195a\u1960r;\uc000\ud835\udcb7mi;\u604fm\u0100;e\u171a\u171cl\u0180;bh\u1968\u1969\u196b\u405c;\u69c5sub;\u67c8\u016c\u1974\u197el\u0100;e\u1979\u197a\u6022t\xbb\u197ap\u0180;Ee\u012f\u1985\u1987;\u6aae\u0100;q\u06dc\u06db\u0ce1\u19a7\0\u19e8\u1a11\u1a15\u1a32\0\u1a37\u1a50\0\0\u1ab4\0\0\u1ac1\0\0\u1b21\u1b2e\u1b4d\u1b52\0\u1bfd\0\u1c0c\u0180cpr\u19ad\u19b2\u19ddute;\u4107\u0300;abcds\u19bf\u19c0\u19c4\u19ca\u19d5\u19d9\u6229nd;\u6a44rcup;\u6a49\u0100au\u19cf\u19d2p;\u6a4bp;\u6a47ot;\u6a40;\uc000\u2229\ufe00\u0100eo\u19e2\u19e5t;\u6041\xee\u0693\u0200aeiu\u19f0\u19fb\u1a01\u1a05\u01f0\u19f5\0\u19f8s;\u6a4don;\u410ddil\u803b\xe7\u40e7rc;\u4109ps\u0100;s\u1a0c\u1a0d\u6a4cm;\u6a50ot;\u410b\u0180dmn\u1a1b\u1a20\u1a26il\u80bb\xb8\u01adptyv;\u69b2t\u8100\xa2;e\u1a2d\u1a2e\u40a2r\xe4\u01b2r;\uc000\ud835\udd20\u0180cei\u1a3d\u1a40\u1a4dy;\u4447ck\u0100;m\u1a47\u1a48\u6713ark\xbb\u1a48;\u43c7r\u0380;Ecefms\u1a5f\u1a60\u1a62\u1a6b\u1aa4\u1aaa\u1aae\u65cb;\u69c3\u0180;el\u1a69\u1a6a\u1a6d\u42c6q;\u6257e\u0261\u1a74\0\0\u1a88rrow\u0100lr\u1a7c\u1a81eft;\u61baight;\u61bb\u0280RSacd\u1a92\u1a94\u1a96\u1a9a\u1a9f\xbb\u0f47;\u64c8st;\u629birc;\u629aash;\u629dnint;\u6a10id;\u6aefcir;\u69c2ubs\u0100;u\u1abb\u1abc\u6663it\xbb\u1abc\u02ec\u1ac7\u1ad4\u1afa\0\u1b0aon\u0100;e\u1acd\u1ace\u403a\u0100;q\xc7\xc6\u026d\u1ad9\0\0\u1ae2a\u0100;t\u1ade\u1adf\u402c;\u4040\u0180;fl\u1ae8\u1ae9\u1aeb\u6201\xee\u1160e\u0100mx\u1af1\u1af6ent\xbb\u1ae9e\xf3\u024d\u01e7\u1afe\0\u1b07\u0100;d\u12bb\u1b02ot;\u6a6dn\xf4\u0246\u0180fry\u1b10\u1b14\u1b17;\uc000\ud835\udd54o\xe4\u0254\u8100\xa9;s\u0155\u1b1dr;\u6117\u0100ao\u1b25\u1b29rr;\u61b5ss;\u6717\u0100cu\u1b32\u1b37r;\uc000\ud835\udcb8\u0100bp\u1b3c\u1b44\u0100;e\u1b41\u1b42\u6acf;\u6ad1\u0100;e\u1b49\u1b4a\u6ad0;\u6ad2dot;\u62ef\u0380delprvw\u1b60\u1b6c\u1b77\u1b82\u1bac\u1bd4\u1bf9arr\u0100lr\u1b68\u1b6a;\u6938;\u6935\u0270\u1b72\0\0\u1b75r;\u62dec;\u62dfarr\u0100;p\u1b7f\u1b80\u61b6;\u693d\u0300;bcdos\u1b8f\u1b90\u1b96\u1ba1\u1ba5\u1ba8\u622arcap;\u6a48\u0100au\u1b9b\u1b9ep;\u6a46p;\u6a4aot;\u628dr;\u6a45;\uc000\u222a\ufe00\u0200alrv\u1bb5\u1bbf\u1bde\u1be3rr\u0100;m\u1bbc\u1bbd\u61b7;\u693cy\u0180evw\u1bc7\u1bd4\u1bd8q\u0270\u1bce\0\0\u1bd2re\xe3\u1b73u\xe3\u1b75ee;\u62ceedge;\u62cfen\u803b\xa4\u40a4earrow\u0100lr\u1bee\u1bf3eft\xbb\u1b80ight\xbb\u1bbde\xe4\u1bdd\u0100ci\u1c01\u1c07onin\xf4\u01f7nt;\u6231lcty;\u632d\u0980AHabcdefhijlorstuwz\u1c38\u1c3b\u1c3f\u1c5d\u1c69\u1c75\u1c8a\u1c9e\u1cac\u1cb7\u1cfb\u1cff\u1d0d\u1d7b\u1d91\u1dab\u1dbb\u1dc6\u1dcdr\xf2\u0381ar;\u6965\u0200glrs\u1c48\u1c4d\u1c52\u1c54ger;\u6020eth;\u6138\xf2\u1133h\u0100;v\u1c5a\u1c5b\u6010\xbb\u090a\u016b\u1c61\u1c67arow;\u690fa\xe3\u0315\u0100ay\u1c6e\u1c73ron;\u410f;\u4434\u0180;ao\u0332\u1c7c\u1c84\u0100gr\u02bf\u1c81r;\u61catseq;\u6a77\u0180glm\u1c91\u1c94\u1c98\u803b\xb0\u40b0ta;\u43b4ptyv;\u69b1\u0100ir\u1ca3\u1ca8sht;\u697f;\uc000\ud835\udd21ar\u0100lr\u1cb3\u1cb5\xbb\u08dc\xbb\u101e\u0280aegsv\u1cc2\u0378\u1cd6\u1cdc\u1ce0m\u0180;os\u0326\u1cca\u1cd4nd\u0100;s\u0326\u1cd1uit;\u6666amma;\u43ddin;\u62f2\u0180;io\u1ce7\u1ce8\u1cf8\u40f7de\u8100\xf7;o\u1ce7\u1cf0ntimes;\u62c7n\xf8\u1cf7cy;\u4452c\u026f\u1d06\0\0\u1d0arn;\u631eop;\u630d\u0280lptuw\u1d18\u1d1d\u1d22\u1d49\u1d55lar;\u4024f;\uc000\ud835\udd55\u0280;emps\u030b\u1d2d\u1d37\u1d3d\u1d42q\u0100;d\u0352\u1d33ot;\u6251inus;\u6238lus;\u6214quare;\u62a1blebarwedg\xe5\xfan\u0180adh\u112e\u1d5d\u1d67ownarrow\xf3\u1c83arpoon\u0100lr\u1d72\u1d76ef\xf4\u1cb4igh\xf4\u1cb6\u0162\u1d7f\u1d85karo\xf7\u0f42\u026f\u1d8a\0\0\u1d8ern;\u631fop;\u630c\u0180cot\u1d98\u1da3\u1da6\u0100ry\u1d9d\u1da1;\uc000\ud835\udcb9;\u4455l;\u69f6rok;\u4111\u0100dr\u1db0\u1db4ot;\u62f1i\u0100;f\u1dba\u1816\u65bf\u0100ah\u1dc0\u1dc3r\xf2\u0429a\xf2\u0fa6angle;\u69a6\u0100ci\u1dd2\u1dd5y;\u445fgrarr;\u67ff\u0900Dacdefglmnopqrstux\u1e01\u1e09\u1e19\u1e38\u0578\u1e3c\u1e49\u1e61\u1e7e\u1ea5\u1eaf\u1ebd\u1ee1\u1f2a\u1f37\u1f44\u1f4e\u1f5a\u0100Do\u1e06\u1d34o\xf4\u1c89\u0100cs\u1e0e\u1e14ute\u803b\xe9\u40e9ter;\u6a6e\u0200aioy\u1e22\u1e27\u1e31\u1e36ron;\u411br\u0100;c\u1e2d\u1e2e\u6256\u803b\xea\u40ealon;\u6255;\u444dot;\u4117\u0100Dr\u1e41\u1e45ot;\u6252;\uc000\ud835\udd22\u0180;rs\u1e50\u1e51\u1e57\u6a9aave\u803b\xe8\u40e8\u0100;d\u1e5c\u1e5d\u6a96ot;\u6a98\u0200;ils\u1e6a\u1e6b\u1e72\u1e74\u6a99nters;\u63e7;\u6113\u0100;d\u1e79\u1e7a\u6a95ot;\u6a97\u0180aps\u1e85\u1e89\u1e97cr;\u4113ty\u0180;sv\u1e92\u1e93\u1e95\u6205et\xbb\u1e93p\u01001;\u1e9d\u1ea4\u0133\u1ea1\u1ea3;\u6004;\u6005\u6003\u0100gs\u1eaa\u1eac;\u414bp;\u6002\u0100gp\u1eb4\u1eb8on;\u4119f;\uc000\ud835\udd56\u0180als\u1ec4\u1ece\u1ed2r\u0100;s\u1eca\u1ecb\u62d5l;\u69e3us;\u6a71i\u0180;lv\u1eda\u1edb\u1edf\u43b5on\xbb\u1edb;\u43f5\u0200csuv\u1eea\u1ef3\u1f0b\u1f23\u0100io\u1eef\u1e31rc\xbb\u1e2e\u0269\u1ef9\0\0\u1efb\xed\u0548ant\u0100gl\u1f02\u1f06tr\xbb\u1e5dess\xbb\u1e7a\u0180aei\u1f12\u1f16\u1f1als;\u403dst;\u625fv\u0100;D\u0235\u1f20D;\u6a78parsl;\u69e5\u0100Da\u1f2f\u1f33ot;\u6253rr;\u6971\u0180cdi\u1f3e\u1f41\u1ef8r;\u612fo\xf4\u0352\u0100ah\u1f49\u1f4b;\u43b7\u803b\xf0\u40f0\u0100mr\u1f53\u1f57l\u803b\xeb\u40ebo;\u60ac\u0180cip\u1f61\u1f64\u1f67l;\u4021s\xf4\u056e\u0100eo\u1f6c\u1f74ctatio\xee\u0559nential\xe5\u0579\u09e1\u1f92\0\u1f9e\0\u1fa1\u1fa7\0\0\u1fc6\u1fcc\0\u1fd3\0\u1fe6\u1fea\u2000\0\u2008\u205allingdotse\xf1\u1e44y;\u4444male;\u6640\u0180ilr\u1fad\u1fb3\u1fc1lig;\u8000\ufb03\u0269\u1fb9\0\0\u1fbdg;\u8000\ufb00ig;\u8000\ufb04;\uc000\ud835\udd23lig;\u8000\ufb01lig;\uc000fj\u0180alt\u1fd9\u1fdc\u1fe1t;\u666dig;\u8000\ufb02ns;\u65b1of;\u4192\u01f0\u1fee\0\u1ff3f;\uc000\ud835\udd57\u0100ak\u05bf\u1ff7\u0100;v\u1ffc\u1ffd\u62d4;\u6ad9artint;\u6a0d\u0100ao\u200c\u2055\u0100cs\u2011\u2052\u03b1\u201a\u2030\u2038\u2045\u2048\0\u2050\u03b2\u2022\u2025\u2027\u202a\u202c\0\u202e\u803b\xbd\u40bd;\u6153\u803b\xbc\u40bc;\u6155;\u6159;\u615b\u01b3\u2034\0\u2036;\u6154;\u6156\u02b4\u203e\u2041\0\0\u2043\u803b\xbe\u40be;\u6157;\u615c5;\u6158\u01b6\u204c\0\u204e;\u615a;\u615d8;\u615el;\u6044wn;\u6322cr;\uc000\ud835\udcbb\u0880Eabcdefgijlnorstv\u2082\u2089\u209f\u20a5\u20b0\u20b4\u20f0\u20f5\u20fa\u20ff\u2103\u2112\u2138\u0317\u213e\u2152\u219e\u0100;l\u064d\u2087;\u6a8c\u0180cmp\u2090\u2095\u209dute;\u41f5ma\u0100;d\u209c\u1cda\u43b3;\u6a86reve;\u411f\u0100iy\u20aa\u20aerc;\u411d;\u4433ot;\u4121\u0200;lqs\u063e\u0642\u20bd\u20c9\u0180;qs\u063e\u064c\u20c4lan\xf4\u0665\u0200;cdl\u0665\u20d2\u20d5\u20e5c;\u6aa9ot\u0100;o\u20dc\u20dd\u6a80\u0100;l\u20e2\u20e3\u6a82;\u6a84\u0100;e\u20ea\u20ed\uc000\u22db\ufe00s;\u6a94r;\uc000\ud835\udd24\u0100;g\u0673\u061bmel;\u6137cy;\u4453\u0200;Eaj\u065a\u210c\u210e\u2110;\u6a92;\u6aa5;\u6aa4\u0200Eaes\u211b\u211d\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6a8arox\xbb\u2124\u0100;q\u212e\u212f\u6a88\u0100;q\u212e\u211bim;\u62e7pf;\uc000\ud835\udd58\u0100ci\u2143\u2146r;\u610am\u0180;el\u066b\u214e\u2150;\u6a8e;\u6a90\u8300>;cdlqr\u05ee\u2160\u216a\u216e\u2173\u2179\u0100ci\u2165\u2167;\u6aa7r;\u6a7aot;\u62d7Par;\u6995uest;\u6a7c\u0280adels\u2184\u216a\u2190\u0656\u219b\u01f0\u2189\0\u218epro\xf8\u209er;\u6978q\u0100lq\u063f\u2196les\xf3\u2088i\xed\u066b\u0100en\u21a3\u21adrtneqq;\uc000\u2269\ufe00\xc5\u21aa\u0500Aabcefkosy\u21c4\u21c7\u21f1\u21f5\u21fa\u2218\u221d\u222f\u2268\u227dr\xf2\u03a0\u0200ilmr\u21d0\u21d4\u21d7\u21dbrs\xf0\u1484f\xbb\u2024il\xf4\u06a9\u0100dr\u21e0\u21e4cy;\u444a\u0180;cw\u08f4\u21eb\u21efir;\u6948;\u61adar;\u610firc;\u4125\u0180alr\u2201\u220e\u2213rts\u0100;u\u2209\u220a\u6665it\xbb\u220alip;\u6026con;\u62b9r;\uc000\ud835\udd25s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223a\u223e\u2243\u225e\u2263rr;\u61fftht;\u623bk\u0100lr\u2249\u2253eftarrow;\u61a9ightarrow;\u61aaf;\uc000\ud835\udd59bar;\u6015\u0180clt\u226f\u2274\u2278r;\uc000\ud835\udcbdas\xe8\u21f4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xbb\u1c5b\u0ae1\u22a3\0\u22aa\0\u22b8\u22c5\u22ce\0\u22d5\u22f3\0\0\u22f8\u2322\u2367\u2362\u237f\0\u2386\u23aa\u23b4cute\u803b\xed\u40ed\u0180;iy\u0771\u22b0\u22b5rc\u803b\xee\u40ee;\u4438\u0100cx\u22bc\u22bfy;\u4435cl\u803b\xa1\u40a1\u0100fr\u039f\u22c9;\uc000\ud835\udd26rave\u803b\xec\u40ec\u0200;ino\u073e\u22dd\u22e9\u22ee\u0100in\u22e2\u22e6nt;\u6a0ct;\u622dfin;\u69dcta;\u6129lig;\u4133\u0180aop\u22fe\u231a\u231d\u0180cgt\u2305\u2308\u2317r;\u412b\u0180elp\u071f\u230f\u2313in\xe5\u078ear\xf4\u0720h;\u4131f;\u62b7ed;\u41b5\u0280;cfot\u04f4\u232c\u2331\u233d\u2341are;\u6105in\u0100;t\u2338\u2339\u621eie;\u69dddo\xf4\u2319\u0280;celp\u0757\u234c\u2350\u235b\u2361al;\u62ba\u0100gr\u2355\u2359er\xf3\u1563\xe3\u234darhk;\u6a17rod;\u6a3c\u0200cgpt\u236f\u2372\u2376\u237by;\u4451on;\u412ff;\uc000\ud835\udd5aa;\u43b9uest\u803b\xbf\u40bf\u0100ci\u238a\u238fr;\uc000\ud835\udcben\u0280;Edsv\u04f4\u239b\u239d\u23a1\u04f3;\u62f9ot;\u62f5\u0100;v\u23a6\u23a7\u62f4;\u62f3\u0100;i\u0777\u23aelde;\u4129\u01eb\u23b8\0\u23bccy;\u4456l\u803b\xef\u40ef\u0300cfmosu\u23cc\u23d7\u23dc\u23e1\u23e7\u23f5\u0100iy\u23d1\u23d5rc;\u4135;\u4439r;\uc000\ud835\udd27ath;\u4237pf;\uc000\ud835\udd5b\u01e3\u23ec\0\u23f1r;\uc000\ud835\udcbfrcy;\u4458kcy;\u4454\u0400acfghjos\u240b\u2416\u2422\u2427\u242d\u2431\u2435\u243bppa\u0100;v\u2413\u2414\u43ba;\u43f0\u0100ey\u241b\u2420dil;\u4137;\u443ar;\uc000\ud835\udd28reen;\u4138cy;\u4445cy;\u445cpf;\uc000\ud835\udd5ccr;\uc000\ud835\udcc0\u0b80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248d\u2491\u250e\u253d\u255a\u2580\u264e\u265e\u2665\u2679\u267d\u269a\u26b2\u26d8\u275d\u2768\u278b\u27c0\u2801\u2812\u0180art\u2477\u247a\u247cr\xf2\u09c6\xf2\u0395ail;\u691barr;\u690e\u0100;g\u0994\u248b;\u6a8bar;\u6962\u0963\u24a5\0\u24aa\0\u24b1\0\0\0\0\0\u24b5\u24ba\0\u24c6\u24c8\u24cd\0\u24f9ute;\u413amptyv;\u69b4ra\xee\u084cbda;\u43bbg\u0180;dl\u088e\u24c1\u24c3;\u6991\xe5\u088e;\u6a85uo\u803b\xab\u40abr\u0400;bfhlpst\u0899\u24de\u24e6\u24e9\u24eb\u24ee\u24f1\u24f5\u0100;f\u089d\u24e3s;\u691fs;\u691d\xeb\u2252p;\u61abl;\u6939im;\u6973l;\u61a2\u0180;ae\u24ff\u2500\u2504\u6aabil;\u6919\u0100;s\u2509\u250a\u6aad;\uc000\u2aad\ufe00\u0180abr\u2515\u2519\u251drr;\u690crk;\u6772\u0100ak\u2522\u252cc\u0100ek\u2528\u252a;\u407b;\u405b\u0100es\u2531\u2533;\u698bl\u0100du\u2539\u253b;\u698f;\u698d\u0200aeuy\u2546\u254b\u2556\u2558ron;\u413e\u0100di\u2550\u2554il;\u413c\xec\u08b0\xe2\u2529;\u443b\u0200cqrs\u2563\u2566\u256d\u257da;\u6936uo\u0100;r\u0e19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694bh;\u61b2\u0280;fgqs\u258b\u258c\u0989\u25f3\u25ff\u6264t\u0280ahlrt\u2598\u25a4\u25b7\u25c2\u25e8rrow\u0100;t\u0899\u25a1a\xe9\u24f6arpoon\u0100du\u25af\u25b4own\xbb\u045ap\xbb\u0966eftarrows;\u61c7ight\u0180ahs\u25cd\u25d6\u25derrow\u0100;s\u08f4\u08a7arpoon\xf3\u0f98quigarro\xf7\u21f0hreetimes;\u62cb\u0180;qs\u258b\u0993\u25falan\xf4\u09ac\u0280;cdgs\u09ac\u260a\u260d\u261d\u2628c;\u6aa8ot\u0100;o\u2614\u2615\u6a7f\u0100;r\u261a\u261b\u6a81;\u6a83\u0100;e\u2622\u2625\uc000\u22da\ufe00s;\u6a93\u0280adegs\u2633\u2639\u263d\u2649\u264bppro\xf8\u24c6ot;\u62d6q\u0100gq\u2643\u2645\xf4\u0989gt\xf2\u248c\xf4\u099bi\xed\u09b2\u0180ilr\u2655\u08e1\u265asht;\u697c;\uc000\ud835\udd29\u0100;E\u099c\u2663;\u6a91\u0161\u2669\u2676r\u0100du\u25b2\u266e\u0100;l\u0965\u2673;\u696alk;\u6584cy;\u4459\u0280;acht\u0a48\u2688\u268b\u2691\u2696r\xf2\u25c1orne\xf2\u1d08ard;\u696bri;\u65fa\u0100io\u269f\u26a4dot;\u4140ust\u0100;a\u26ac\u26ad\u63b0che\xbb\u26ad\u0200Eaes\u26bb\u26bd\u26c9\u26d4;\u6268p\u0100;p\u26c3\u26c4\u6a89rox\xbb\u26c4\u0100;q\u26ce\u26cf\u6a87\u0100;q\u26ce\u26bbim;\u62e6\u0400abnoptwz\u26e9\u26f4\u26f7\u271a\u272f\u2741\u2747\u2750\u0100nr\u26ee\u26f1g;\u67ecr;\u61fdr\xeb\u08c1g\u0180lmr\u26ff\u270d\u2714eft\u0100ar\u09e6\u2707ight\xe1\u09f2apsto;\u67fcight\xe1\u09fdparrow\u0100lr\u2725\u2729ef\xf4\u24edight;\u61ac\u0180afl\u2736\u2739\u273dr;\u6985;\uc000\ud835\udd5dus;\u6a2dimes;\u6a34\u0161\u274b\u274fst;\u6217\xe1\u134e\u0180;ef\u2757\u2758\u1800\u65cange\xbb\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277c\u2785\u2787r\xf2\u08a8orne\xf2\u1d8car\u0100;d\u0f98\u2783;\u696d;\u600eri;\u62bf\u0300achiqt\u2798\u279d\u0a40\u27a2\u27ae\u27bbquo;\u6039r;\uc000\ud835\udcc1m\u0180;eg\u09b2\u27aa\u27ac;\u6a8d;\u6a8f\u0100bu\u252a\u27b3o\u0100;r\u0e1f\u27b9;\u601arok;\u4142\u8400<;cdhilqr\u082b\u27d2\u2639\u27dc\u27e0\u27e5\u27ea\u27f0\u0100ci\u27d7\u27d9;\u6aa6r;\u6a79re\xe5\u25f2mes;\u62c9arr;\u6976uest;\u6a7b\u0100Pi\u27f5\u27f9ar;\u6996\u0180;ef\u2800\u092d\u181b\u65c3r\u0100du\u2807\u280dshar;\u694ahar;\u6966\u0100en\u2817\u2821rtneqq;\uc000\u2268\ufe00\xc5\u281e\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288e\u2893\u28a0\u28a5\u28a8\u28da\u28e2\u28e4\u0a83\u28f3\u2902Dot;\u623a\u0200clpr\u284e\u2852\u2863\u287dr\u803b\xaf\u40af\u0100et\u2857\u2859;\u6642\u0100;e\u285e\u285f\u6720se\xbb\u285f\u0100;s\u103b\u2868to\u0200;dlu\u103b\u2873\u2877\u287bow\xee\u048cef\xf4\u090f\xf0\u13d1ker;\u65ae\u0100oy\u2887\u288cmma;\u6a29;\u443cash;\u6014asuredangle\xbb\u1626r;\uc000\ud835\udd2ao;\u6127\u0180cdn\u28af\u28b4\u28c9ro\u803b\xb5\u40b5\u0200;acd\u1464\u28bd\u28c0\u28c4s\xf4\u16a7ir;\u6af0ot\u80bb\xb7\u01b5us\u0180;bd\u28d2\u1903\u28d3\u6212\u0100;u\u1d3c\u28d8;\u6a2a\u0163\u28de\u28e1p;\u6adb\xf2\u2212\xf0\u0a81\u0100dp\u28e9\u28eeels;\u62a7f;\uc000\ud835\udd5e\u0100ct\u28f8\u28fdr;\uc000\ud835\udcc2pos\xbb\u159d\u0180;lm\u2909\u290a\u290d\u43bctimap;\u62b8\u0c00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297e\u2989\u2998\u29da\u29e9\u2a15\u2a1a\u2a58\u2a5d\u2a83\u2a95\u2aa4\u2aa8\u2b04\u2b07\u2b44\u2b7f\u2bae\u2c34\u2c67\u2c7c\u2ce9\u0100gt\u2947\u294b;\uc000\u22d9\u0338\u0100;v\u2950\u0bcf\uc000\u226b\u20d2\u0180elt\u295a\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61cdightarrow;\u61ce;\uc000\u22d8\u0338\u0100;v\u297b\u0c47\uc000\u226a\u20d2ightarrow;\u61cf\u0100Dd\u298e\u2993ash;\u62afash;\u62ae\u0280bcnpt\u29a3\u29a7\u29ac\u29b1\u29ccla\xbb\u02deute;\u4144g;\uc000\u2220\u20d2\u0280;Eiop\u0d84\u29bc\u29c0\u29c5\u29c8;\uc000\u2a70\u0338d;\uc000\u224b\u0338s;\u4149ro\xf8\u0d84ur\u0100;a\u29d3\u29d4\u666el\u0100;s\u29d3\u0b38\u01f3\u29df\0\u29e3p\u80bb\xa0\u0b37mp\u0100;e\u0bf9\u0c00\u0280aeouy\u29f4\u29fe\u2a03\u2a10\u2a13\u01f0\u29f9\0\u29fb;\u6a43on;\u4148dil;\u4146ng\u0100;d\u0d7e\u2a0aot;\uc000\u2a6d\u0338p;\u6a42;\u443dash;\u6013\u0380;Aadqsx\u0b92\u2a29\u2a2d\u2a3b\u2a41\u2a45\u2a50rr;\u61d7r\u0100hr\u2a33\u2a36k;\u6924\u0100;o\u13f2\u13f0ot;\uc000\u2250\u0338ui\xf6\u0b63\u0100ei\u2a4a\u2a4ear;\u6928\xed\u0b98ist\u0100;s\u0ba0\u0b9fr;\uc000\ud835\udd2b\u0200Eest\u0bc5\u2a66\u2a79\u2a7c\u0180;qs\u0bbc\u2a6d\u0be1\u0180;qs\u0bbc\u0bc5\u2a74lan\xf4\u0be2i\xed\u0bea\u0100;r\u0bb6\u2a81\xbb\u0bb7\u0180Aap\u2a8a\u2a8d\u2a91r\xf2\u2971rr;\u61aear;\u6af2\u0180;sv\u0f8d\u2a9c\u0f8c\u0100;d\u2aa1\u2aa2\u62fc;\u62facy;\u445a\u0380AEadest\u2ab7\u2aba\u2abe\u2ac2\u2ac5\u2af6\u2af9r\xf2\u2966;\uc000\u2266\u0338rr;\u619ar;\u6025\u0200;fqs\u0c3b\u2ace\u2ae3\u2aeft\u0100ar\u2ad4\u2ad9rro\xf7\u2ac1ightarro\xf7\u2a90\u0180;qs\u0c3b\u2aba\u2aealan\xf4\u0c55\u0100;s\u0c55\u2af4\xbb\u0c36i\xed\u0c5d\u0100;r\u0c35\u2afei\u0100;e\u0c1a\u0c25i\xe4\u0d90\u0100pt\u2b0c\u2b11f;\uc000\ud835\udd5f\u8180\xac;in\u2b19\u2b1a\u2b36\u40acn\u0200;Edv\u0b89\u2b24\u2b28\u2b2e;\uc000\u22f9\u0338ot;\uc000\u22f5\u0338\u01e1\u0b89\u2b33\u2b35;\u62f7;\u62f6i\u0100;v\u0cb8\u2b3c\u01e1\u0cb8\u2b41\u2b43;\u62fe;\u62fd\u0180aor\u2b4b\u2b63\u2b69r\u0200;ast\u0b7b\u2b55\u2b5a\u2b5flle\xec\u0b7bl;\uc000\u2afd\u20e5;\uc000\u2202\u0338lint;\u6a14\u0180;ce\u0c92\u2b70\u2b73u\xe5\u0ca5\u0100;c\u0c98\u2b78\u0100;e\u0c92\u2b7d\xf1\u0c98\u0200Aait\u2b88\u2b8b\u2b9d\u2ba7r\xf2\u2988rr\u0180;cw\u2b94\u2b95\u2b99\u619b;\uc000\u2933\u0338;\uc000\u219d\u0338ghtarrow\xbb\u2b95ri\u0100;e\u0ccb\u0cd6\u0380chimpqu\u2bbd\u2bcd\u2bd9\u2b04\u0b78\u2be4\u2bef\u0200;cer\u0d32\u2bc6\u0d37\u2bc9u\xe5\u0d45;\uc000\ud835\udcc3ort\u026d\u2b05\0\0\u2bd6ar\xe1\u2b56m\u0100;e\u0d6e\u2bdf\u0100;q\u0d74\u0d73su\u0100bp\u2beb\u2bed\xe5\u0cf8\xe5\u0d0b\u0180bcp\u2bf6\u2c11\u2c19\u0200;Ees\u2bff\u2c00\u0d22\u2c04\u6284;\uc000\u2ac5\u0338et\u0100;e\u0d1b\u2c0bq\u0100;q\u0d23\u2c00c\u0100;e\u0d32\u2c17\xf1\u0d38\u0200;Ees\u2c22\u2c23\u0d5f\u2c27\u6285;\uc000\u2ac6\u0338et\u0100;e\u0d58\u2c2eq\u0100;q\u0d60\u2c23\u0200gilr\u2c3d\u2c3f\u2c45\u2c47\xec\u0bd7lde\u803b\xf1\u40f1\xe7\u0c43iangle\u0100lr\u2c52\u2c5ceft\u0100;e\u0c1a\u2c5a\xf1\u0c26ight\u0100;e\u0ccb\u2c65\xf1\u0cd7\u0100;m\u2c6c\u2c6d\u43bd\u0180;es\u2c74\u2c75\u2c79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2c8f\u2c94\u2c99\u2c9e\u2ca3\u2cb0\u2cb6\u2cd3\u2ce3ash;\u62adarr;\u6904p;\uc000\u224d\u20d2ash;\u62ac\u0100et\u2ca8\u2cac;\uc000\u2265\u20d2;\uc000>\u20d2nfin;\u69de\u0180Aet\u2cbd\u2cc1\u2cc5rr;\u6902;\uc000\u2264\u20d2\u0100;r\u2cca\u2ccd\uc000<\u20d2ie;\uc000\u22b4\u20d2\u0100At\u2cd8\u2cdcrr;\u6903rie;\uc000\u22b5\u20d2im;\uc000\u223c\u20d2\u0180Aan\u2cf0\u2cf4\u2d02rr;\u61d6r\u0100hr\u2cfa\u2cfdk;\u6923\u0100;o\u13e7\u13e5ear;\u6927\u1253\u1a95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2d2d\0\u2d38\u2d48\u2d60\u2d65\u2d72\u2d84\u1b07\0\0\u2d8d\u2dab\0\u2dc8\u2dce\0\u2ddc\u2e19\u2e2b\u2e3e\u2e43\u0100cs\u2d31\u1a97ute\u803b\xf3\u40f3\u0100iy\u2d3c\u2d45r\u0100;c\u1a9e\u2d42\u803b\xf4\u40f4;\u443e\u0280abios\u1aa0\u2d52\u2d57\u01c8\u2d5alac;\u4151v;\u6a38old;\u69bclig;\u4153\u0100cr\u2d69\u2d6dir;\u69bf;\uc000\ud835\udd2c\u036f\u2d79\0\0\u2d7c\0\u2d82n;\u42dbave\u803b\xf2\u40f2;\u69c1\u0100bm\u2d88\u0df4ar;\u69b5\u0200acit\u2d95\u2d98\u2da5\u2da8r\xf2\u1a80\u0100ir\u2d9d\u2da0r;\u69beoss;\u69bbn\xe5\u0e52;\u69c0\u0180aei\u2db1\u2db5\u2db9cr;\u414dga;\u43c9\u0180cdn\u2dc0\u2dc5\u01cdron;\u43bf;\u69b6pf;\uc000\ud835\udd60\u0180ael\u2dd4\u2dd7\u01d2r;\u69b7rp;\u69b9\u0380;adiosv\u2dea\u2deb\u2dee\u2e08\u2e0d\u2e10\u2e16\u6228r\xf2\u1a86\u0200;efm\u2df7\u2df8\u2e02\u2e05\u6a5dr\u0100;o\u2dfe\u2dff\u6134f\xbb\u2dff\u803b\xaa\u40aa\u803b\xba\u40bagof;\u62b6r;\u6a56lope;\u6a57;\u6a5b\u0180clo\u2e1f\u2e21\u2e27\xf2\u2e01ash\u803b\xf8\u40f8l;\u6298i\u016c\u2e2f\u2e34de\u803b\xf5\u40f5es\u0100;a\u01db\u2e3as;\u6a36ml\u803b\xf6\u40f6bar;\u633d\u0ae1\u2e5e\0\u2e7d\0\u2e80\u2e9d\0\u2ea2\u2eb9\0\0\u2ecb\u0e9c\0\u2f13\0\0\u2f2b\u2fbc\0\u2fc8r\u0200;ast\u0403\u2e67\u2e72\u0e85\u8100\xb6;l\u2e6d\u2e6e\u40b6le\xec\u0403\u0269\u2e78\0\0\u2e7bm;\u6af3;\u6afdy;\u443fr\u0280cimpt\u2e8b\u2e8f\u2e93\u1865\u2e97nt;\u4025od;\u402eil;\u6030enk;\u6031r;\uc000\ud835\udd2d\u0180imo\u2ea8\u2eb0\u2eb4\u0100;v\u2ead\u2eae\u43c6;\u43d5ma\xf4\u0a76ne;\u660e\u0180;tv\u2ebf\u2ec0\u2ec8\u43c0chfork\xbb\u1ffd;\u43d6\u0100au\u2ecf\u2edfn\u0100ck\u2ed5\u2eddk\u0100;h\u21f4\u2edb;\u610e\xf6\u21f4s\u0480;abcdemst\u2ef3\u2ef4\u1908\u2ef9\u2efd\u2f04\u2f06\u2f0a\u2f0e\u402bcir;\u6a23ir;\u6a22\u0100ou\u1d40\u2f02;\u6a25;\u6a72n\u80bb\xb1\u0e9dim;\u6a26wo;\u6a27\u0180ipu\u2f19\u2f20\u2f25ntint;\u6a15f;\uc000\ud835\udd61nd\u803b\xa3\u40a3\u0500;Eaceinosu\u0ec8\u2f3f\u2f41\u2f44\u2f47\u2f81\u2f89\u2f92\u2f7e\u2fb6;\u6ab3p;\u6ab7u\xe5\u0ed9\u0100;c\u0ece\u2f4c\u0300;acens\u0ec8\u2f59\u2f5f\u2f66\u2f68\u2f7eppro\xf8\u2f43urlye\xf1\u0ed9\xf1\u0ece\u0180aes\u2f6f\u2f76\u2f7approx;\u6ab9qq;\u6ab5im;\u62e8i\xed\u0edfme\u0100;s\u2f88\u0eae\u6032\u0180Eas\u2f78\u2f90\u2f7a\xf0\u2f75\u0180dfp\u0eec\u2f99\u2faf\u0180als\u2fa0\u2fa5\u2faalar;\u632eine;\u6312urf;\u6313\u0100;t\u0efb\u2fb4\xef\u0efbrel;\u62b0\u0100ci\u2fc0\u2fc5r;\uc000\ud835\udcc5;\u43c8ncsp;\u6008\u0300fiopsu\u2fda\u22e2\u2fdf\u2fe5\u2feb\u2ff1r;\uc000\ud835\udd2epf;\uc000\ud835\udd62rime;\u6057cr;\uc000\ud835\udcc6\u0180aeo\u2ff8\u3009\u3013t\u0100ei\u2ffe\u3005rnion\xf3\u06b0nt;\u6a16st\u0100;e\u3010\u3011\u403f\xf1\u1f19\xf4\u0f14\u0a80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30e0\u310e\u312b\u3147\u3162\u3172\u318e\u3206\u3215\u3224\u3229\u3258\u326e\u3272\u3290\u32b0\u32b7\u0180art\u3047\u304a\u304cr\xf2\u10b3\xf2\u03ddail;\u691car\xf2\u1c65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307f\u308f\u3094\u30cc\u0100eu\u306d\u3071;\uc000\u223d\u0331te;\u4155i\xe3\u116emptyv;\u69b3g\u0200;del\u0fd1\u3089\u308b\u308d;\u6992;\u69a5\xe5\u0fd1uo\u803b\xbb\u40bbr\u0580;abcfhlpstw\u0fdc\u30ac\u30af\u30b7\u30b9\u30bc\u30be\u30c0\u30c3\u30c7\u30cap;\u6975\u0100;f\u0fe0\u30b4s;\u6920;\u6933s;\u691e\xeb\u225d\xf0\u272el;\u6945im;\u6974l;\u61a3;\u619d\u0100ai\u30d1\u30d5il;\u691ao\u0100;n\u30db\u30dc\u6236al\xf3\u0f1e\u0180abr\u30e7\u30ea\u30eer\xf2\u17e5rk;\u6773\u0100ak\u30f3\u30fdc\u0100ek\u30f9\u30fb;\u407d;\u405d\u0100es\u3102\u3104;\u698cl\u0100du\u310a\u310c;\u698e;\u6990\u0200aeuy\u3117\u311c\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xec\u0ff2\xe2\u30fa;\u4440\u0200clqs\u3134\u3137\u313d\u3144a;\u6937dhar;\u6969uo\u0100;r\u020e\u020dh;\u61b3\u0180acg\u314e\u315f\u0f44l\u0200;ips\u0f78\u3158\u315b\u109cn\xe5\u10bbar\xf4\u0fa9t;\u65ad\u0180ilr\u3169\u1023\u316esht;\u697d;\uc000\ud835\udd2f\u0100ao\u3177\u3186r\u0100du\u317d\u317f\xbb\u047b\u0100;l\u1091\u3184;\u696c\u0100;v\u318b\u318c\u43c1;\u43f1\u0180gns\u3195\u31f9\u31fcht\u0300ahlrst\u31a4\u31b0\u31c2\u31d8\u31e4\u31eerrow\u0100;t\u0fdc\u31ada\xe9\u30c8arpoon\u0100du\u31bb\u31bfow\xee\u317ep\xbb\u1092eft\u0100ah\u31ca\u31d0rrow\xf3\u0feaarpoon\xf3\u0551ightarrows;\u61c9quigarro\xf7\u30cbhreetimes;\u62ccg;\u42daingdotse\xf1\u1f32\u0180ahm\u320d\u3210\u3213r\xf2\u0feaa\xf2\u0551;\u600foust\u0100;a\u321e\u321f\u63b1che\xbb\u321fmid;\u6aee\u0200abpt\u3232\u323d\u3240\u3252\u0100nr\u3237\u323ag;\u67edr;\u61fer\xeb\u1003\u0180afl\u3247\u324a\u324er;\u6986;\uc000\ud835\udd63us;\u6a2eimes;\u6a35\u0100ap\u325d\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6a12ar\xf2\u31e3\u0200achq\u327b\u3280\u10bc\u3285quo;\u603ar;\uc000\ud835\udcc7\u0100bu\u30fb\u328ao\u0100;r\u0214\u0213\u0180hir\u3297\u329b\u32a0re\xe5\u31f8mes;\u62cai\u0200;efl\u32aa\u1059\u1821\u32ab\u65b9tri;\u69celuhar;\u6968;\u611e\u0d61\u32d5\u32db\u32df\u332c\u3338\u3371\0\u337a\u33a4\0\0\u33ec\u33f0\0\u3428\u3448\u345a\u34ad\u34b1\u34ca\u34f1\0\u3616\0\0\u3633cute;\u415bqu\xef\u27ba\u0500;Eaceinpsy\u11ed\u32f3\u32f5\u32ff\u3302\u330b\u330f\u331f\u3326\u3329;\u6ab4\u01f0\u32fa\0\u32fc;\u6ab8on;\u4161u\xe5\u11fe\u0100;d\u11f3\u3307il;\u415frc;\u415d\u0180Eas\u3316\u3318\u331b;\u6ab6p;\u6abaim;\u62e9olint;\u6a13i\xed\u1204;\u4441ot\u0180;be\u3334\u1d47\u3335\u62c5;\u6a66\u0380Aacmstx\u3346\u334a\u3357\u335b\u335e\u3363\u336drr;\u61d8r\u0100hr\u3350\u3352\xeb\u2228\u0100;o\u0a36\u0a34t\u803b\xa7\u40a7i;\u403bwar;\u6929m\u0100in\u3369\xf0nu\xf3\xf1t;\u6736r\u0100;o\u3376\u2055\uc000\ud835\udd30\u0200acoy\u3382\u3386\u3391\u33a0rp;\u666f\u0100hy\u338b\u338fcy;\u4449;\u4448rt\u026d\u3399\0\0\u339ci\xe4\u1464ara\xec\u2e6f\u803b\xad\u40ad\u0100gm\u33a8\u33b4ma\u0180;fv\u33b1\u33b2\u33b2\u43c3;\u43c2\u0400;deglnpr\u12ab\u33c5\u33c9\u33ce\u33d6\u33de\u33e1\u33e6ot;\u6a6a\u0100;q\u12b1\u12b0\u0100;E\u33d3\u33d4\u6a9e;\u6aa0\u0100;E\u33db\u33dc\u6a9d;\u6a9fe;\u6246lus;\u6a24arr;\u6972ar\xf2\u113d\u0200aeit\u33f8\u3408\u340f\u3417\u0100ls\u33fd\u3404lsetm\xe9\u336ahp;\u6a33parsl;\u69e4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341c\u341d\u6aaa\u0100;s\u3422\u3423\u6aac;\uc000\u2aac\ufe00\u0180flp\u342e\u3433\u3442tcy;\u444c\u0100;b\u3438\u3439\u402f\u0100;a\u343e\u343f\u69c4r;\u633ff;\uc000\ud835\udd64a\u0100dr\u344d\u0402es\u0100;u\u3454\u3455\u6660it\xbb\u3455\u0180csu\u3460\u3479\u349f\u0100au\u3465\u346fp\u0100;s\u1188\u346b;\uc000\u2293\ufe00p\u0100;s\u11b4\u3475;\uc000\u2294\ufe00u\u0100bp\u347f\u348f\u0180;es\u1197\u119c\u3486et\u0100;e\u1197\u348d\xf1\u119d\u0180;es\u11a8\u11ad\u3496et\u0100;e\u11a8\u349d\xf1\u11ae\u0180;af\u117b\u34a6\u05b0r\u0165\u34ab\u05b1\xbb\u117car\xf2\u1148\u0200cemt\u34b9\u34be\u34c2\u34c5r;\uc000\ud835\udcc8tm\xee\xf1i\xec\u3415ar\xe6\u11be\u0100ar\u34ce\u34d5r\u0100;f\u34d4\u17bf\u6606\u0100an\u34da\u34edight\u0100ep\u34e3\u34eapsilo\xee\u1ee0h\xe9\u2eafs\xbb\u2852\u0280bcmnp\u34fb\u355e\u1209\u358b\u358e\u0480;Edemnprs\u350e\u350f\u3511\u3515\u351e\u3523\u352c\u3531\u3536\u6282;\u6ac5ot;\u6abd\u0100;d\u11da\u351aot;\u6ac3ult;\u6ac1\u0100Ee\u3528\u352a;\u6acb;\u628alus;\u6abfarr;\u6979\u0180eiu\u353d\u3552\u3555t\u0180;en\u350e\u3545\u354bq\u0100;q\u11da\u350feq\u0100;q\u352b\u3528m;\u6ac7\u0100bp\u355a\u355c;\u6ad5;\u6ad3c\u0300;acens\u11ed\u356c\u3572\u3579\u357b\u3326ppro\xf8\u32faurlye\xf1\u11fe\xf1\u11f3\u0180aes\u3582\u3588\u331bppro\xf8\u331aq\xf1\u3317g;\u666a\u0680123;Edehlmnps\u35a9\u35ac\u35af\u121c\u35b2\u35b4\u35c0\u35c9\u35d5\u35da\u35df\u35e8\u35ed\u803b\xb9\u40b9\u803b\xb2\u40b2\u803b\xb3\u40b3;\u6ac6\u0100os\u35b9\u35bct;\u6abeub;\u6ad8\u0100;d\u1222\u35c5ot;\u6ac4s\u0100ou\u35cf\u35d2l;\u67c9b;\u6ad7arr;\u697bult;\u6ac2\u0100Ee\u35e4\u35e6;\u6acc;\u628blus;\u6ac0\u0180eiu\u35f4\u3609\u360ct\u0180;en\u121c\u35fc\u3602q\u0100;q\u1222\u35b2eq\u0100;q\u35e7\u35e4m;\u6ac8\u0100bp\u3611\u3613;\u6ad4;\u6ad6\u0180Aan\u361c\u3620\u362drr;\u61d9r\u0100hr\u3626\u3628\xeb\u222e\u0100;o\u0a2b\u0a29war;\u692alig\u803b\xdf\u40df\u0be1\u3651\u365d\u3660\u12ce\u3673\u3679\0\u367e\u36c2\0\0\0\0\0\u36db\u3703\0\u3709\u376c\0\0\0\u3787\u0272\u3656\0\0\u365bget;\u6316;\u43c4r\xeb\u0e5f\u0180aey\u3666\u366b\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uc000\ud835\udd31\u0200eiko\u3686\u369d\u36b5\u36bc\u01f2\u368b\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369b\u43b8ym;\u43d1\u0100cn\u36a2\u36b2k\u0100as\u36a8\u36aeppro\xf8\u12c1im\xbb\u12acs\xf0\u129e\u0100as\u36ba\u36ae\xf0\u12c1rn\u803b\xfe\u40fe\u01ec\u031f\u36c6\u22e7es\u8180\xd7;bd\u36cf\u36d0\u36d8\u40d7\u0100;a\u190f\u36d5r;\u6a31;\u6a30\u0180eps\u36e1\u36e3\u3700\xe1\u2a4d\u0200;bcf\u0486\u36ec\u36f0\u36f4ot;\u6336ir;\u6af1\u0100;o\u36f9\u36fc\uc000\ud835\udd65rk;\u6ada\xe1\u3362rime;\u6034\u0180aip\u370f\u3712\u3764d\xe5\u1248\u0380adempst\u3721\u374d\u3740\u3751\u3757\u375c\u375fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65b5own\xbb\u1dbbeft\u0100;e\u2800\u373e\xf1\u092e;\u625cight\u0100;e\u32aa\u374b\xf1\u105aot;\u65ecinus;\u6a3alus;\u6a39b;\u69cdime;\u6a3bezium;\u63e2\u0180cht\u3772\u377d\u3781\u0100ry\u3777\u377b;\uc000\ud835\udcc9;\u4446cy;\u445brok;\u4167\u0100io\u378b\u378ex\xf4\u1777head\u0100lr\u3797\u37a0eftarro\xf7\u084fightarrow\xbb\u0f5d\u0900AHabcdfghlmoprstuw\u37d0\u37d3\u37d7\u37e4\u37f0\u37fc\u380e\u381c\u3823\u3834\u3851\u385d\u386b\u38a9\u38cc\u38d2\u38ea\u38f6r\xf2\u03edar;\u6963\u0100cr\u37dc\u37e2ute\u803b\xfa\u40fa\xf2\u1150r\u01e3\u37ea\0\u37edy;\u445eve;\u416d\u0100iy\u37f5\u37farc\u803b\xfb\u40fb;\u4443\u0180abh\u3803\u3806\u380br\xf2\u13adlac;\u4171a\xf2\u13c3\u0100ir\u3813\u3818sht;\u697e;\uc000\ud835\udd32rave\u803b\xf9\u40f9\u0161\u3827\u3831r\u0100lr\u382c\u382e\xbb\u0957\xbb\u1083lk;\u6580\u0100ct\u3839\u384d\u026f\u383f\0\0\u384arn\u0100;e\u3845\u3846\u631cr\xbb\u3846op;\u630fri;\u65f8\u0100al\u3856\u385acr;\u416b\u80bb\xa8\u0349\u0100gp\u3862\u3866on;\u4173f;\uc000\ud835\udd66\u0300adhlsu\u114b\u3878\u387d\u1372\u3891\u38a0own\xe1\u13b3arpoon\u0100lr\u3888\u388cef\xf4\u382digh\xf4\u382fi\u0180;hl\u3899\u389a\u389c\u43c5\xbb\u13faon\xbb\u389aparrows;\u61c8\u0180cit\u38b0\u38c4\u38c8\u026f\u38b6\0\0\u38c1rn\u0100;e\u38bc\u38bd\u631dr\xbb\u38bdop;\u630eng;\u416fri;\u65f9cr;\uc000\ud835\udcca\u0180dir\u38d9\u38dd\u38e2ot;\u62f0lde;\u4169i\u0100;f\u3730\u38e8\xbb\u1813\u0100am\u38ef\u38f2r\xf2\u38a8l\u803b\xfc\u40fcangle;\u69a7\u0780ABDacdeflnoprsz\u391c\u391f\u3929\u392d\u39b5\u39b8\u39bd\u39df\u39e4\u39e8\u39f3\u39f9\u39fd\u3a01\u3a20r\xf2\u03f7ar\u0100;v\u3926\u3927\u6ae8;\u6ae9as\xe8\u03e1\u0100nr\u3932\u3937grt;\u699c\u0380eknprst\u34e3\u3946\u394b\u3952\u395d\u3964\u3996app\xe1\u2415othin\xe7\u1e96\u0180hir\u34eb\u2ec8\u3959op\xf4\u2fb5\u0100;h\u13b7\u3962\xef\u318d\u0100iu\u3969\u396dgm\xe1\u33b3\u0100bp\u3972\u3984setneq\u0100;q\u397d\u3980\uc000\u228a\ufe00;\uc000\u2acb\ufe00setneq\u0100;q\u398f\u3992\uc000\u228b\ufe00;\uc000\u2acc\ufe00\u0100hr\u399b\u399fet\xe1\u369ciangle\u0100lr\u39aa\u39afeft\xbb\u0925ight\xbb\u1051y;\u4432ash\xbb\u1036\u0180elr\u39c4\u39d2\u39d7\u0180;be\u2dea\u39cb\u39cfar;\u62bbq;\u625alip;\u62ee\u0100bt\u39dc\u1468a\xf2\u1469r;\uc000\ud835\udd33tr\xe9\u39aesu\u0100bp\u39ef\u39f1\xbb\u0d1c\xbb\u0d59pf;\uc000\ud835\udd67ro\xf0\u0efbtr\xe9\u39b4\u0100cu\u3a06\u3a0br;\uc000\ud835\udccb\u0100bp\u3a10\u3a18n\u0100Ee\u3980\u3a16\xbb\u397en\u0100Ee\u3992\u3a1e\xbb\u3990igzag;\u699a\u0380cefoprs\u3a36\u3a3b\u3a56\u3a5b\u3a54\u3a61\u3a6airc;\u4175\u0100di\u3a40\u3a51\u0100bg\u3a45\u3a49ar;\u6a5fe\u0100;q\u15fa\u3a4f;\u6259erp;\u6118r;\uc000\ud835\udd34pf;\uc000\ud835\udd68\u0100;e\u1479\u3a66at\xe8\u1479cr;\uc000\ud835\udccc\u0ae3\u178e\u3a87\0\u3a8b\0\u3a90\u3a9b\0\0\u3a9d\u3aa8\u3aab\u3aaf\0\0\u3ac3\u3ace\0\u3ad8\u17dc\u17dftr\xe9\u17d1r;\uc000\ud835\udd35\u0100Aa\u3a94\u3a97r\xf2\u03c3r\xf2\u09f6;\u43be\u0100Aa\u3aa1\u3aa4r\xf2\u03b8r\xf2\u09eba\xf0\u2713is;\u62fb\u0180dpt\u17a4\u3ab5\u3abe\u0100fl\u3aba\u17a9;\uc000\ud835\udd69im\xe5\u17b2\u0100Aa\u3ac7\u3acar\xf2\u03cer\xf2\u0a01\u0100cq\u3ad2\u17b8r;\uc000\ud835\udccd\u0100pt\u17d6\u3adcr\xe9\u17d4\u0400acefiosu\u3af0\u3afd\u3b08\u3b0c\u3b11\u3b15\u3b1b\u3b21c\u0100uy\u3af6\u3afbte\u803b\xfd\u40fd;\u444f\u0100iy\u3b02\u3b06rc;\u4177;\u444bn\u803b\xa5\u40a5r;\uc000\ud835\udd36cy;\u4457pf;\uc000\ud835\udd6acr;\uc000\ud835\udcce\u0100cm\u3b26\u3b29y;\u444el\u803b\xff\u40ff\u0500acdefhiosw\u3b42\u3b48\u3b54\u3b58\u3b64\u3b69\u3b6d\u3b74\u3b7a\u3b80cute;\u417a\u0100ay\u3b4d\u3b52ron;\u417e;\u4437ot;\u417c\u0100et\u3b5d\u3b61tr\xe6\u155fa;\u43b6r;\uc000\ud835\udd37cy;\u4436grarr;\u61ddpf;\uc000\ud835\udd6bcr;\uc000\ud835\udccf\u0100jn\u3b85\u3b87;\u600dj;\u600c'.split("").map((function(e){return e.charCodeAt(0)})))},22060:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Uint16Array("\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022".split("").map((function(e){return e.charCodeAt(0)})))},94021:(e,t)=>{"use strict";function n(e){for(var t=1;t<e.length;t++)e[t][0]+=e[t-1][0]+1;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=new Map(n([[9," "],[0," "],[22,"!"],[0,"""],[0,"#"],[0,"$"],[0,"%"],[0,"&"],[0,"'"],[0,"("],[0,")"],[0,"*"],[0,"+"],[0,","],[1,"."],[0,"/"],[10,":"],[0,";"],[0,{v:"<",n:8402,o:"<⃒"}],[0,{v:"=",n:8421,o:"=⃥"}],[0,{v:">",n:8402,o:">⃒"}],[0,"?"],[0,"@"],[26,"["],[0,"\"],[0,"]"],[0,"^"],[0,"_"],[0,"`"],[5,{n:106,o:"fj"}],[20,"{"],[0,"|"],[0,"}"],[34," "],[0,"¡"],[0,"¢"],[0,"£"],[0,"¤"],[0,"¥"],[0,"¦"],[0,"§"],[0,"¨"],[0,"©"],[0,"ª"],[0,"«"],[0,"¬"],[0,"­"],[0,"®"],[0,"¯"],[0,"°"],[0,"±"],[0,"²"],[0,"³"],[0,"´"],[0,"µ"],[0,"¶"],[0,"·"],[0,"¸"],[0,"¹"],[0,"º"],[0,"»"],[0,"¼"],[0,"½"],[0,"¾"],[0,"¿"],[0,"À"],[0,"Á"],[0,"Â"],[0,"Ã"],[0,"Ä"],[0,"Å"],[0,"Æ"],[0,"Ç"],[0,"È"],[0,"É"],[0,"Ê"],[0,"Ë"],[0,"Ì"],[0,"Í"],[0,"Î"],[0,"Ï"],[0,"Ð"],[0,"Ñ"],[0,"Ò"],[0,"Ó"],[0,"Ô"],[0,"Õ"],[0,"Ö"],[0,"×"],[0,"Ø"],[0,"Ù"],[0,"Ú"],[0,"Û"],[0,"Ü"],[0,"Ý"],[0,"Þ"],[0,"ß"],[0,"à"],[0,"á"],[0,"â"],[0,"ã"],[0,"ä"],[0,"å"],[0,"æ"],[0,"ç"],[0,"è"],[0,"é"],[0,"ê"],[0,"ë"],[0,"ì"],[0,"í"],[0,"î"],[0,"ï"],[0,"ð"],[0,"ñ"],[0,"ò"],[0,"ó"],[0,"ô"],[0,"õ"],[0,"ö"],[0,"÷"],[0,"ø"],[0,"ù"],[0,"ú"],[0,"û"],[0,"ü"],[0,"ý"],[0,"þ"],[0,"ÿ"],[0,"Ā"],[0,"ā"],[0,"Ă"],[0,"ă"],[0,"Ą"],[0,"ą"],[0,"Ć"],[0,"ć"],[0,"Ĉ"],[0,"ĉ"],[0,"Ċ"],[0,"ċ"],[0,"Č"],[0,"č"],[0,"Ď"],[0,"ď"],[0,"Đ"],[0,"đ"],[0,"Ē"],[0,"ē"],[2,"Ė"],[0,"ė"],[0,"Ę"],[0,"ę"],[0,"Ě"],[0,"ě"],[0,"Ĝ"],[0,"ĝ"],[0,"Ğ"],[0,"ğ"],[0,"Ġ"],[0,"ġ"],[0,"Ģ"],[1,"Ĥ"],[0,"ĥ"],[0,"Ħ"],[0,"ħ"],[0,"Ĩ"],[0,"ĩ"],[0,"Ī"],[0,"ī"],[2,"Į"],[0,"į"],[0,"İ"],[0,"ı"],[0,"IJ"],[0,"ij"],[0,"Ĵ"],[0,"ĵ"],[0,"Ķ"],[0,"ķ"],[0,"ĸ"],[0,"Ĺ"],[0,"ĺ"],[0,"Ļ"],[0,"ļ"],[0,"Ľ"],[0,"ľ"],[0,"Ŀ"],[0,"ŀ"],[0,"Ł"],[0,"ł"],[0,"Ń"],[0,"ń"],[0,"Ņ"],[0,"ņ"],[0,"Ň"],[0,"ň"],[0,"ʼn"],[0,"Ŋ"],[0,"ŋ"],[0,"Ō"],[0,"ō"],[2,"Ő"],[0,"ő"],[0,"Œ"],[0,"œ"],[0,"Ŕ"],[0,"ŕ"],[0,"Ŗ"],[0,"ŗ"],[0,"Ř"],[0,"ř"],[0,"Ś"],[0,"ś"],[0,"Ŝ"],[0,"ŝ"],[0,"Ş"],[0,"ş"],[0,"Š"],[0,"š"],[0,"Ţ"],[0,"ţ"],[0,"Ť"],[0,"ť"],[0,"Ŧ"],[0,"ŧ"],[0,"Ũ"],[0,"ũ"],[0,"Ū"],[0,"ū"],[0,"Ŭ"],[0,"ŭ"],[0,"Ů"],[0,"ů"],[0,"Ű"],[0,"ű"],[0,"Ų"],[0,"ų"],[0,"Ŵ"],[0,"ŵ"],[0,"Ŷ"],[0,"ŷ"],[0,"Ÿ"],[0,"Ź"],[0,"ź"],[0,"Ż"],[0,"ż"],[0,"Ž"],[0,"ž"],[19,"ƒ"],[34,"Ƶ"],[63,"ǵ"],[65,"ȷ"],[142,"ˆ"],[0,"ˇ"],[16,"˘"],[0,"˙"],[0,"˚"],[0,"˛"],[0,"˜"],[0,"˝"],[51,"̑"],[127,"Α"],[0,"Β"],[0,"Γ"],[0,"Δ"],[0,"Ε"],[0,"Ζ"],[0,"Η"],[0,"Θ"],[0,"Ι"],[0,"Κ"],[0,"Λ"],[0,"Μ"],[0,"Ν"],[0,"Ξ"],[0,"Ο"],[0,"Π"],[0,"Ρ"],[1,"Σ"],[0,"Τ"],[0,"Υ"],[0,"Φ"],[0,"Χ"],[0,"Ψ"],[0,"Ω"],[7,"α"],[0,"β"],[0,"γ"],[0,"δ"],[0,"ε"],[0,"ζ"],[0,"η"],[0,"θ"],[0,"ι"],[0,"κ"],[0,"λ"],[0,"μ"],[0,"ν"],[0,"ξ"],[0,"ο"],[0,"π"],[0,"ρ"],[0,"ς"],[0,"σ"],[0,"τ"],[0,"υ"],[0,"φ"],[0,"χ"],[0,"ψ"],[0,"ω"],[7,"ϑ"],[0,"ϒ"],[2,"ϕ"],[0,"ϖ"],[5,"Ϝ"],[0,"ϝ"],[18,"ϰ"],[0,"ϱ"],[3,"ϵ"],[0,"϶"],[10,"Ё"],[0,"Ђ"],[0,"Ѓ"],[0,"Є"],[0,"Ѕ"],[0,"І"],[0,"Ї"],[0,"Ј"],[0,"Љ"],[0,"Њ"],[0,"Ћ"],[0,"Ќ"],[1,"Ў"],[0,"Џ"],[0,"А"],[0,"Б"],[0,"В"],[0,"Г"],[0,"Д"],[0,"Е"],[0,"Ж"],[0,"З"],[0,"И"],[0,"Й"],[0,"К"],[0,"Л"],[0,"М"],[0,"Н"],[0,"О"],[0,"П"],[0,"Р"],[0,"С"],[0,"Т"],[0,"У"],[0,"Ф"],[0,"Х"],[0,"Ц"],[0,"Ч"],[0,"Ш"],[0,"Щ"],[0,"Ъ"],[0,"Ы"],[0,"Ь"],[0,"Э"],[0,"Ю"],[0,"Я"],[0,"а"],[0,"б"],[0,"в"],[0,"г"],[0,"д"],[0,"е"],[0,"ж"],[0,"з"],[0,"и"],[0,"й"],[0,"к"],[0,"л"],[0,"м"],[0,"н"],[0,"о"],[0,"п"],[0,"р"],[0,"с"],[0,"т"],[0,"у"],[0,"ф"],[0,"х"],[0,"ц"],[0,"ч"],[0,"ш"],[0,"щ"],[0,"ъ"],[0,"ы"],[0,"ь"],[0,"э"],[0,"ю"],[0,"я"],[1,"ё"],[0,"ђ"],[0,"ѓ"],[0,"є"],[0,"ѕ"],[0,"і"],[0,"ї"],[0,"ј"],[0,"љ"],[0,"њ"],[0,"ћ"],[0,"ќ"],[1,"ў"],[0,"џ"],[7074," "],[0," "],[0," "],[0," "],[1," "],[0," "],[0," "],[0," "],[0,"​"],[0,"‌"],[0,"‍"],[0,"‎"],[0,"‏"],[0,"‐"],[2,"–"],[0,"—"],[0,"―"],[0,"‖"],[1,"‘"],[0,"’"],[0,"‚"],[1,"“"],[0,"”"],[0,"„"],[1,"†"],[0,"‡"],[0,"•"],[2,"‥"],[0,"…"],[9,"‰"],[0,"‱"],[0,"′"],[0,"″"],[0,"‴"],[0,"‵"],[3,"‹"],[0,"›"],[3,"‾"],[2,"⁁"],[1,"⁃"],[0,"⁄"],[10,"⁏"],[7,"⁗"],[7,{v:" ",n:8202,o:"  "}],[0,"⁠"],[0,"⁡"],[0,"⁢"],[0,"⁣"],[72,"€"],[46,"⃛"],[0,"⃜"],[37,"ℂ"],[2,"℅"],[4,"ℊ"],[0,"ℋ"],[0,"ℌ"],[0,"ℍ"],[0,"ℎ"],[0,"ℏ"],[0,"ℐ"],[0,"ℑ"],[0,"ℒ"],[0,"ℓ"],[1,"ℕ"],[0,"№"],[0,"℗"],[0,"℘"],[0,"ℙ"],[0,"ℚ"],[0,"ℛ"],[0,"ℜ"],[0,"ℝ"],[0,"℞"],[3,"™"],[1,"ℤ"],[2,"℧"],[0,"ℨ"],[0,"℩"],[2,"ℬ"],[0,"ℭ"],[1,"ℯ"],[0,"ℰ"],[0,"ℱ"],[1,"ℳ"],[0,"ℴ"],[0,"ℵ"],[0,"ℶ"],[0,"ℷ"],[0,"ℸ"],[12,"ⅅ"],[0,"ⅆ"],[0,"ⅇ"],[0,"ⅈ"],[10,"⅓"],[0,"⅔"],[0,"⅕"],[0,"⅖"],[0,"⅗"],[0,"⅘"],[0,"⅙"],[0,"⅚"],[0,"⅛"],[0,"⅜"],[0,"⅝"],[0,"⅞"],[49,"←"],[0,"↑"],[0,"→"],[0,"↓"],[0,"↔"],[0,"↕"],[0,"↖"],[0,"↗"],[0,"↘"],[0,"↙"],[0,"↚"],[0,"↛"],[1,{v:"↝",n:824,o:"↝̸"}],[0,"↞"],[0,"↟"],[0,"↠"],[0,"↡"],[0,"↢"],[0,"↣"],[0,"↤"],[0,"↥"],[0,"↦"],[0,"↧"],[1,"↩"],[0,"↪"],[0,"↫"],[0,"↬"],[0,"↭"],[0,"↮"],[1,"↰"],[0,"↱"],[0,"↲"],[0,"↳"],[1,"↵"],[0,"↶"],[0,"↷"],[2,"↺"],[0,"↻"],[0,"↼"],[0,"↽"],[0,"↾"],[0,"↿"],[0,"⇀"],[0,"⇁"],[0,"⇂"],[0,"⇃"],[0,"⇄"],[0,"⇅"],[0,"⇆"],[0,"⇇"],[0,"⇈"],[0,"⇉"],[0,"⇊"],[0,"⇋"],[0,"⇌"],[0,"⇍"],[0,"⇎"],[0,"⇏"],[0,"⇐"],[0,"⇑"],[0,"⇒"],[0,"⇓"],[0,"⇔"],[0,"⇕"],[0,"⇖"],[0,"⇗"],[0,"⇘"],[0,"⇙"],[0,"⇚"],[0,"⇛"],[1,"⇝"],[6,"⇤"],[0,"⇥"],[15,"⇵"],[7,"⇽"],[0,"⇾"],[0,"⇿"],[0,"∀"],[0,"∁"],[0,{v:"∂",n:824,o:"∂̸"}],[0,"∃"],[0,"∄"],[0,"∅"],[1,"∇"],[0,"∈"],[0,"∉"],[1,"∋"],[0,"∌"],[2,"∏"],[0,"∐"],[0,"∑"],[0,"−"],[0,"∓"],[0,"∔"],[1,"∖"],[0,"∗"],[0,"∘"],[1,"√"],[2,"∝"],[0,"∞"],[0,"∟"],[0,{v:"∠",n:8402,o:"∠⃒"}],[0,"∡"],[0,"∢"],[0,"∣"],[0,"∤"],[0,"∥"],[0,"∦"],[0,"∧"],[0,"∨"],[0,{v:"∩",n:65024,o:"∩︀"}],[0,{v:"∪",n:65024,o:"∪︀"}],[0,"∫"],[0,"∬"],[0,"∭"],[0,"∮"],[0,"∯"],[0,"∰"],[0,"∱"],[0,"∲"],[0,"∳"],[0,"∴"],[0,"∵"],[0,"∶"],[0,"∷"],[0,"∸"],[1,"∺"],[0,"∻"],[0,{v:"∼",n:8402,o:"∼⃒"}],[0,{v:"∽",n:817,o:"∽̱"}],[0,{v:"∾",n:819,o:"∾̳"}],[0,"∿"],[0,"≀"],[0,"≁"],[0,{v:"≂",n:824,o:"≂̸"}],[0,"≃"],[0,"≄"],[0,"≅"],[0,"≆"],[0,"≇"],[0,"≈"],[0,"≉"],[0,"≊"],[0,{v:"≋",n:824,o:"≋̸"}],[0,"≌"],[0,{v:"≍",n:8402,o:"≍⃒"}],[0,{v:"≎",n:824,o:"≎̸"}],[0,{v:"≏",n:824,o:"≏̸"}],[0,{v:"≐",n:824,o:"≐̸"}],[0,"≑"],[0,"≒"],[0,"≓"],[0,"≔"],[0,"≕"],[0,"≖"],[0,"≗"],[1,"≙"],[0,"≚"],[1,"≜"],[2,"≟"],[0,"≠"],[0,{v:"≡",n:8421,o:"≡⃥"}],[0,"≢"],[1,{v:"≤",n:8402,o:"≤⃒"}],[0,{v:"≥",n:8402,o:"≥⃒"}],[0,{v:"≦",n:824,o:"≦̸"}],[0,{v:"≧",n:824,o:"≧̸"}],[0,{v:"≨",n:65024,o:"≨︀"}],[0,{v:"≩",n:65024,o:"≩︀"}],[0,{v:"≪",n:new Map(n([[824,"≪̸"],[7577,"≪⃒"]]))}],[0,{v:"≫",n:new Map(n([[824,"≫̸"],[7577,"≫⃒"]]))}],[0,"≬"],[0,"≭"],[0,"≮"],[0,"≯"],[0,"≰"],[0,"≱"],[0,"≲"],[0,"≳"],[0,"≴"],[0,"≵"],[0,"≶"],[0,"≷"],[0,"≸"],[0,"≹"],[0,"≺"],[0,"≻"],[0,"≼"],[0,"≽"],[0,"≾"],[0,{v:"≿",n:824,o:"≿̸"}],[0,"⊀"],[0,"⊁"],[0,{v:"⊂",n:8402,o:"⊂⃒"}],[0,{v:"⊃",n:8402,o:"⊃⃒"}],[0,"⊄"],[0,"⊅"],[0,"⊆"],[0,"⊇"],[0,"⊈"],[0,"⊉"],[0,{v:"⊊",n:65024,o:"⊊︀"}],[0,{v:"⊋",n:65024,o:"⊋︀"}],[1,"⊍"],[0,"⊎"],[0,{v:"⊏",n:824,o:"⊏̸"}],[0,{v:"⊐",n:824,o:"⊐̸"}],[0,"⊑"],[0,"⊒"],[0,{v:"⊓",n:65024,o:"⊓︀"}],[0,{v:"⊔",n:65024,o:"⊔︀"}],[0,"⊕"],[0,"⊖"],[0,"⊗"],[0,"⊘"],[0,"⊙"],[0,"⊚"],[0,"⊛"],[1,"⊝"],[0,"⊞"],[0,"⊟"],[0,"⊠"],[0,"⊡"],[0,"⊢"],[0,"⊣"],[0,"⊤"],[0,"⊥"],[1,"⊧"],[0,"⊨"],[0,"⊩"],[0,"⊪"],[0,"⊫"],[0,"⊬"],[0,"⊭"],[0,"⊮"],[0,"⊯"],[0,"⊰"],[1,"⊲"],[0,"⊳"],[0,{v:"⊴",n:8402,o:"⊴⃒"}],[0,{v:"⊵",n:8402,o:"⊵⃒"}],[0,"⊶"],[0,"⊷"],[0,"⊸"],[0,"⊹"],[0,"⊺"],[0,"⊻"],[1,"⊽"],[0,"⊾"],[0,"⊿"],[0,"⋀"],[0,"⋁"],[0,"⋂"],[0,"⋃"],[0,"⋄"],[0,"⋅"],[0,"⋆"],[0,"⋇"],[0,"⋈"],[0,"⋉"],[0,"⋊"],[0,"⋋"],[0,"⋌"],[0,"⋍"],[0,"⋎"],[0,"⋏"],[0,"⋐"],[0,"⋑"],[0,"⋒"],[0,"⋓"],[0,"⋔"],[0,"⋕"],[0,"⋖"],[0,"⋗"],[0,{v:"⋘",n:824,o:"⋘̸"}],[0,{v:"⋙",n:824,o:"⋙̸"}],[0,{v:"⋚",n:65024,o:"⋚︀"}],[0,{v:"⋛",n:65024,o:"⋛︀"}],[2,"⋞"],[0,"⋟"],[0,"⋠"],[0,"⋡"],[0,"⋢"],[0,"⋣"],[2,"⋦"],[0,"⋧"],[0,"⋨"],[0,"⋩"],[0,"⋪"],[0,"⋫"],[0,"⋬"],[0,"⋭"],[0,"⋮"],[0,"⋯"],[0,"⋰"],[0,"⋱"],[0,"⋲"],[0,"⋳"],[0,"⋴"],[0,{v:"⋵",n:824,o:"⋵̸"}],[0,"⋶"],[0,"⋷"],[1,{v:"⋹",n:824,o:"⋹̸"}],[0,"⋺"],[0,"⋻"],[0,"⋼"],[0,"⋽"],[0,"⋾"],[6,"⌅"],[0,"⌆"],[1,"⌈"],[0,"⌉"],[0,"⌊"],[0,"⌋"],[0,"⌌"],[0,"⌍"],[0,"⌎"],[0,"⌏"],[0,"⌐"],[1,"⌒"],[0,"⌓"],[1,"⌕"],[0,"⌖"],[5,"⌜"],[0,"⌝"],[0,"⌞"],[0,"⌟"],[2,"⌢"],[0,"⌣"],[9,"⌭"],[0,"⌮"],[7,"⌶"],[6,"⌽"],[1,"⌿"],[60,"⍼"],[51,"⎰"],[0,"⎱"],[2,"⎴"],[0,"⎵"],[0,"⎶"],[37,"⏜"],[0,"⏝"],[0,"⏞"],[0,"⏟"],[2,"⏢"],[4,"⏧"],[59,"␣"],[164,"Ⓢ"],[55,"─"],[1,"│"],[9,"┌"],[3,"┐"],[3,"└"],[3,"┘"],[3,"├"],[7,"┤"],[7,"┬"],[7,"┴"],[7,"┼"],[19,"═"],[0,"║"],[0,"╒"],[0,"╓"],[0,"╔"],[0,"╕"],[0,"╖"],[0,"╗"],[0,"╘"],[0,"╙"],[0,"╚"],[0,"╛"],[0,"╜"],[0,"╝"],[0,"╞"],[0,"╟"],[0,"╠"],[0,"╡"],[0,"╢"],[0,"╣"],[0,"╤"],[0,"╥"],[0,"╦"],[0,"╧"],[0,"╨"],[0,"╩"],[0,"╪"],[0,"╫"],[0,"╬"],[19,"▀"],[3,"▄"],[3,"█"],[8,"░"],[0,"▒"],[0,"▓"],[13,"□"],[8,"▪"],[0,"▫"],[1,"▭"],[0,"▮"],[2,"▱"],[1,"△"],[0,"▴"],[0,"▵"],[2,"▸"],[0,"▹"],[3,"▽"],[0,"▾"],[0,"▿"],[2,"◂"],[0,"◃"],[6,"◊"],[0,"○"],[32,"◬"],[2,"◯"],[8,"◸"],[0,"◹"],[0,"◺"],[0,"◻"],[0,"◼"],[8,"★"],[0,"☆"],[7,"☎"],[49,"♀"],[1,"♂"],[29,"♠"],[2,"♣"],[1,"♥"],[0,"♦"],[3,"♪"],[2,"♭"],[0,"♮"],[0,"♯"],[163,"✓"],[3,"✗"],[8,"✠"],[21,"✶"],[33,"❘"],[25,"❲"],[0,"❳"],[84,"⟈"],[0,"⟉"],[28,"⟦"],[0,"⟧"],[0,"⟨"],[0,"⟩"],[0,"⟪"],[0,"⟫"],[0,"⟬"],[0,"⟭"],[7,"⟵"],[0,"⟶"],[0,"⟷"],[0,"⟸"],[0,"⟹"],[0,"⟺"],[1,"⟼"],[2,"⟿"],[258,"⤂"],[0,"⤃"],[0,"⤄"],[0,"⤅"],[6,"⤌"],[0,"⤍"],[0,"⤎"],[0,"⤏"],[0,"⤐"],[0,"⤑"],[0,"⤒"],[0,"⤓"],[2,"⤖"],[2,"⤙"],[0,"⤚"],[0,"⤛"],[0,"⤜"],[0,"⤝"],[0,"⤞"],[0,"⤟"],[0,"⤠"],[2,"⤣"],[0,"⤤"],[0,"⤥"],[0,"⤦"],[0,"⤧"],[0,"⤨"],[0,"⤩"],[0,"⤪"],[8,{v:"⤳",n:824,o:"⤳̸"}],[1,"⤵"],[0,"⤶"],[0,"⤷"],[0,"⤸"],[0,"⤹"],[2,"⤼"],[0,"⤽"],[7,"⥅"],[2,"⥈"],[0,"⥉"],[0,"⥊"],[0,"⥋"],[2,"⥎"],[0,"⥏"],[0,"⥐"],[0,"⥑"],[0,"⥒"],[0,"⥓"],[0,"⥔"],[0,"⥕"],[0,"⥖"],[0,"⥗"],[0,"⥘"],[0,"⥙"],[0,"⥚"],[0,"⥛"],[0,"⥜"],[0,"⥝"],[0,"⥞"],[0,"⥟"],[0,"⥠"],[0,"⥡"],[0,"⥢"],[0,"⥣"],[0,"⥤"],[0,"⥥"],[0,"⥦"],[0,"⥧"],[0,"⥨"],[0,"⥩"],[0,"⥪"],[0,"⥫"],[0,"⥬"],[0,"⥭"],[0,"⥮"],[0,"⥯"],[0,"⥰"],[0,"⥱"],[0,"⥲"],[0,"⥳"],[0,"⥴"],[0,"⥵"],[0,"⥶"],[1,"⥸"],[0,"⥹"],[1,"⥻"],[0,"⥼"],[0,"⥽"],[0,"⥾"],[0,"⥿"],[5,"⦅"],[0,"⦆"],[4,"⦋"],[0,"⦌"],[0,"⦍"],[0,"⦎"],[0,"⦏"],[0,"⦐"],[0,"⦑"],[0,"⦒"],[0,"⦓"],[0,"⦔"],[0,"⦕"],[0,"⦖"],[3,"⦚"],[1,"⦜"],[0,"⦝"],[6,"⦤"],[0,"⦥"],[0,"⦦"],[0,"⦧"],[0,"⦨"],[0,"⦩"],[0,"⦪"],[0,"⦫"],[0,"⦬"],[0,"⦭"],[0,"⦮"],[0,"⦯"],[0,"⦰"],[0,"⦱"],[0,"⦲"],[0,"⦳"],[0,"⦴"],[0,"⦵"],[0,"⦶"],[0,"⦷"],[1,"⦹"],[1,"⦻"],[0,"⦼"],[1,"⦾"],[0,"⦿"],[0,"⧀"],[0,"⧁"],[0,"⧂"],[0,"⧃"],[0,"⧄"],[0,"⧅"],[3,"⧉"],[3,"⧍"],[0,"⧎"],[0,{v:"⧏",n:824,o:"⧏̸"}],[0,{v:"⧐",n:824,o:"⧐̸"}],[11,"⧜"],[0,"⧝"],[0,"⧞"],[4,"⧣"],[0,"⧤"],[0,"⧥"],[5,"⧫"],[8,"⧴"],[1,"⧶"],[9,"⨀"],[0,"⨁"],[0,"⨂"],[1,"⨄"],[1,"⨆"],[5,"⨌"],[0,"⨍"],[2,"⨐"],[0,"⨑"],[0,"⨒"],[0,"⨓"],[0,"⨔"],[0,"⨕"],[0,"⨖"],[0,"⨗"],[10,"⨢"],[0,"⨣"],[0,"⨤"],[0,"⨥"],[0,"⨦"],[0,"⨧"],[1,"⨩"],[0,"⨪"],[2,"⨭"],[0,"⨮"],[0,"⨯"],[0,"⨰"],[0,"⨱"],[1,"⨳"],[0,"⨴"],[0,"⨵"],[0,"⨶"],[0,"⨷"],[0,"⨸"],[0,"⨹"],[0,"⨺"],[0,"⨻"],[0,"⨼"],[2,"⨿"],[0,"⩀"],[1,"⩂"],[0,"⩃"],[0,"⩄"],[0,"⩅"],[0,"⩆"],[0,"⩇"],[0,"⩈"],[0,"⩉"],[0,"⩊"],[0,"⩋"],[0,"⩌"],[0,"⩍"],[2,"⩐"],[2,"⩓"],[0,"⩔"],[0,"⩕"],[0,"⩖"],[0,"⩗"],[0,"⩘"],[1,"⩚"],[0,"⩛"],[0,"⩜"],[0,"⩝"],[1,"⩟"],[6,"⩦"],[3,"⩪"],[2,{v:"⩭",n:824,o:"⩭̸"}],[0,"⩮"],[0,"⩯"],[0,{v:"⩰",n:824,o:"⩰̸"}],[0,"⩱"],[0,"⩲"],[0,"⩳"],[0,"⩴"],[0,"⩵"],[1,"⩷"],[0,"⩸"],[0,"⩹"],[0,"⩺"],[0,"⩻"],[0,"⩼"],[0,{v:"⩽",n:824,o:"⩽̸"}],[0,{v:"⩾",n:824,o:"⩾̸"}],[0,"⩿"],[0,"⪀"],[0,"⪁"],[0,"⪂"],[0,"⪃"],[0,"⪄"],[0,"⪅"],[0,"⪆"],[0,"⪇"],[0,"⪈"],[0,"⪉"],[0,"⪊"],[0,"⪋"],[0,"⪌"],[0,"⪍"],[0,"⪎"],[0,"⪏"],[0,"⪐"],[0,"⪑"],[0,"⪒"],[0,"⪓"],[0,"⪔"],[0,"⪕"],[0,"⪖"],[0,"⪗"],[0,"⪘"],[0,"⪙"],[0,"⪚"],[2,"⪝"],[0,"⪞"],[0,"⪟"],[0,"⪠"],[0,{v:"⪡",n:824,o:"⪡̸"}],[0,{v:"⪢",n:824,o:"⪢̸"}],[1,"⪤"],[0,"⪥"],[0,"⪦"],[0,"⪧"],[0,"⪨"],[0,"⪩"],[0,"⪪"],[0,"⪫"],[0,{v:"⪬",n:65024,o:"⪬︀"}],[0,{v:"⪭",n:65024,o:"⪭︀"}],[0,"⪮"],[0,{v:"⪯",n:824,o:"⪯̸"}],[0,{v:"⪰",n:824,o:"⪰̸"}],[2,"⪳"],[0,"⪴"],[0,"⪵"],[0,"⪶"],[0,"⪷"],[0,"⪸"],[0,"⪹"],[0,"⪺"],[0,"⪻"],[0,"⪼"],[0,"⪽"],[0,"⪾"],[0,"⪿"],[0,"⫀"],[0,"⫁"],[0,"⫂"],[0,"⫃"],[0,"⫄"],[0,{v:"⫅",n:824,o:"⫅̸"}],[0,{v:"⫆",n:824,o:"⫆̸"}],[0,"⫇"],[0,"⫈"],[2,{v:"⫋",n:65024,o:"⫋︀"}],[0,{v:"⫌",n:65024,o:"⫌︀"}],[2,"⫏"],[0,"⫐"],[0,"⫑"],[0,"⫒"],[0,"⫓"],[0,"⫔"],[0,"⫕"],[0,"⫖"],[0,"⫗"],[0,"⫘"],[0,"⫙"],[0,"⫚"],[0,"⫛"],[8,"⫤"],[1,"⫦"],[0,"⫧"],[0,"⫨"],[0,"⫩"],[1,"⫫"],[0,"⫬"],[0,"⫭"],[0,"⫮"],[0,"⫯"],[0,"⫰"],[0,"⫱"],[0,"⫲"],[0,"⫳"],[9,{v:"⫽",n:8421,o:"⫽⃥"}],[44343,{n:new Map(n([[56476,"𝒜"],[1,"𝒞"],[0,"𝒟"],[2,"𝒢"],[2,"𝒥"],[0,"𝒦"],[2,"𝒩"],[0,"𝒪"],[0,"𝒫"],[0,"𝒬"],[1,"𝒮"],[0,"𝒯"],[0,"𝒰"],[0,"𝒱"],[0,"𝒲"],[0,"𝒳"],[0,"𝒴"],[0,"𝒵"],[0,"𝒶"],[0,"𝒷"],[0,"𝒸"],[0,"𝒹"],[1,"𝒻"],[1,"𝒽"],[0,"𝒾"],[0,"𝒿"],[0,"𝓀"],[0,"𝓁"],[0,"𝓂"],[0,"𝓃"],[1,"𝓅"],[0,"𝓆"],[0,"𝓇"],[0,"𝓈"],[0,"𝓉"],[0,"𝓊"],[0,"𝓋"],[0,"𝓌"],[0,"𝓍"],[0,"𝓎"],[0,"𝓏"],[52,"𝔄"],[0,"𝔅"],[1,"𝔇"],[0,"𝔈"],[0,"𝔉"],[0,"𝔊"],[2,"𝔍"],[0,"𝔎"],[0,"𝔏"],[0,"𝔐"],[0,"𝔑"],[0,"𝔒"],[0,"𝔓"],[0,"𝔔"],[1,"𝔖"],[0,"𝔗"],[0,"𝔘"],[0,"𝔙"],[0,"𝔚"],[0,"𝔛"],[0,"𝔜"],[1,"𝔞"],[0,"𝔟"],[0,"𝔠"],[0,"𝔡"],[0,"𝔢"],[0,"𝔣"],[0,"𝔤"],[0,"𝔥"],[0,"𝔦"],[0,"𝔧"],[0,"𝔨"],[0,"𝔩"],[0,"𝔪"],[0,"𝔫"],[0,"𝔬"],[0,"𝔭"],[0,"𝔮"],[0,"𝔯"],[0,"𝔰"],[0,"𝔱"],[0,"𝔲"],[0,"𝔳"],[0,"𝔴"],[0,"𝔵"],[0,"𝔶"],[0,"𝔷"],[0,"𝔸"],[0,"𝔹"],[1,"𝔻"],[0,"𝔼"],[0,"𝔽"],[0,"𝔾"],[1,"𝕀"],[0,"𝕁"],[0,"𝕂"],[0,"𝕃"],[0,"𝕄"],[1,"𝕆"],[3,"𝕊"],[0,"𝕋"],[0,"𝕌"],[0,"𝕍"],[0,"𝕎"],[0,"𝕏"],[0,"𝕐"],[1,"𝕒"],[0,"𝕓"],[0,"𝕔"],[0,"𝕕"],[0,"𝕖"],[0,"𝕗"],[0,"𝕘"],[0,"𝕙"],[0,"𝕚"],[0,"𝕛"],[0,"𝕜"],[0,"𝕝"],[0,"𝕞"],[0,"𝕟"],[0,"𝕠"],[0,"𝕡"],[0,"𝕢"],[0,"𝕣"],[0,"𝕤"],[0,"𝕥"],[0,"𝕦"],[0,"𝕧"],[0,"𝕨"],[0,"𝕩"],[0,"𝕪"],[0,"𝕫"]]))}],[8906,"ff"],[0,"fi"],[0,"fl"],[0,"ffi"],[0,"ffl"]]))},45863:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXMLStrict=t.decodeHTML5Strict=t.decodeHTML4Strict=t.decodeHTML5=t.decodeHTML4=t.decodeHTMLAttribute=t.decodeHTMLStrict=t.decodeHTML=t.decodeXML=t.DecodingMode=t.EntityDecoder=t.encodeHTML5=t.encodeHTML4=t.encodeNonAsciiHTML=t.encodeHTML=t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.encode=t.decodeStrict=t.decode=t.EncodingMode=t.EntityLevel=void 0;var r,i,o=n(44076),s=n(87322),a=n(24625);function l(e,t){if(void 0===t&&(t=r.XML),("number"==typeof t?t:t.level)===r.HTML){var n="object"==typeof t?t.mode:void 0;return(0,o.decodeHTML)(e,n)}return(0,o.decodeXML)(e)}!function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"}(r=t.EntityLevel||(t.EntityLevel={})),function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"}(i=t.EncodingMode||(t.EncodingMode={})),t.decode=l,t.decodeStrict=function(e,t){var n;void 0===t&&(t=r.XML);var i="number"==typeof t?{level:t}:t;return null!==(n=i.mode)&&void 0!==n||(i.mode=o.DecodingMode.Strict),l(e,i)},t.encode=function(e,t){void 0===t&&(t=r.XML);var n="number"==typeof t?{level:t}:t;return n.mode===i.UTF8?(0,a.escapeUTF8)(e):n.mode===i.Attribute?(0,a.escapeAttribute)(e):n.mode===i.Text?(0,a.escapeText)(e):n.level===r.HTML?n.mode===i.ASCII?(0,s.encodeNonAsciiHTML)(e):(0,s.encodeHTML)(e):(0,a.encodeXML)(e)};var c=n(24625);Object.defineProperty(t,"encodeXML",{enumerable:!0,get:function(){return c.encodeXML}}),Object.defineProperty(t,"escape",{enumerable:!0,get:function(){return c.escape}}),Object.defineProperty(t,"escapeUTF8",{enumerable:!0,get:function(){return c.escapeUTF8}}),Object.defineProperty(t,"escapeAttribute",{enumerable:!0,get:function(){return c.escapeAttribute}}),Object.defineProperty(t,"escapeText",{enumerable:!0,get:function(){return c.escapeText}});var u=n(87322);Object.defineProperty(t,"encodeHTML",{enumerable:!0,get:function(){return u.encodeHTML}}),Object.defineProperty(t,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return u.encodeNonAsciiHTML}}),Object.defineProperty(t,"encodeHTML4",{enumerable:!0,get:function(){return u.encodeHTML}}),Object.defineProperty(t,"encodeHTML5",{enumerable:!0,get:function(){return u.encodeHTML}});var d=n(44076);Object.defineProperty(t,"EntityDecoder",{enumerable:!0,get:function(){return d.EntityDecoder}}),Object.defineProperty(t,"DecodingMode",{enumerable:!0,get:function(){return d.DecodingMode}}),Object.defineProperty(t,"decodeXML",{enumerable:!0,get:function(){return d.decodeXML}}),Object.defineProperty(t,"decodeHTML",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(t,"decodeHTMLStrict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTMLAttribute",{enumerable:!0,get:function(){return d.decodeHTMLAttribute}}),Object.defineProperty(t,"decodeHTML4",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(t,"decodeHTML5",{enumerable:!0,get:function(){return d.decodeHTML}}),Object.defineProperty(t,"decodeHTML4Strict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTML5Strict",{enumerable:!0,get:function(){return d.decodeHTMLStrict}}),Object.defineProperty(t,"decodeXMLStrict",{enumerable:!0,get:function(){return d.decodeXML}})},63150:e=>{"use strict";e.exports=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}},50763:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0;var s=o(n(39889)),a=n(44076),l=new Set(["input","option","optgroup","select","button","datalist","textarea"]),c=new Set(["p"]),u=new Set(["thead","tbody"]),d=new Set(["dd","dt"]),p=new Set(["rt","rp"]),h=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",c],["h1",c],["h2",c],["h3",c],["h4",c],["h5",c],["h6",c],["select",l],["input",l],["output",l],["button",l],["datalist",l],["textarea",l],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",d],["dt",d],["address",c],["article",c],["aside",c],["blockquote",c],["details",c],["div",c],["dl",c],["fieldset",c],["figcaption",c],["figure",c],["footer",c],["form",c],["header",c],["hr",c],["main",c],["nav",c],["ol",c],["pre",c],["section",c],["table",c],["ul",c],["rt",p],["rp",p],["tbody",u],["tfoot",u]]),f=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),m=new Set(["math","svg"]),g=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),b=/\s|\//,y=function(){function e(e,t){var n,r,i,o,a;void 0===t&&(t={}),this.options=t,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.foreignContext=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=null!=e?e:{},this.lowerCaseTagNames=null!==(n=t.lowerCaseTags)&&void 0!==n?n:!t.xmlMode,this.lowerCaseAttributeNames=null!==(r=t.lowerCaseAttributeNames)&&void 0!==r?r:!t.xmlMode,this.tokenizer=new(null!==(i=t.Tokenizer)&&void 0!==i?i:s.default)(this.options,this),null===(a=(o=this.cbs).onparserinit)||void 0===a||a.call(o,this)}return e.prototype.ontext=function(e,t){var n,r,i=this.getSlice(e,t);this.endIndex=t-1,null===(r=(n=this.cbs).ontext)||void 0===r||r.call(n,i),this.startIndex=t},e.prototype.ontextentity=function(e){var t,n,r=this.tokenizer.getSectionStart();this.endIndex=r-1,null===(n=(t=this.cbs).ontext)||void 0===n||n.call(t,(0,a.fromCodePoint)(e)),this.startIndex=r},e.prototype.isVoidElement=function(e){return!this.options.xmlMode&&f.has(e)},e.prototype.onopentagname=function(e,t){this.endIndex=t;var n=this.getSlice(e,t);this.lowerCaseTagNames&&(n=n.toLowerCase()),this.emitOpenTag(n)},e.prototype.emitOpenTag=function(e){var t,n,r,i;this.openTagStart=this.startIndex,this.tagname=e;var o=!this.options.xmlMode&&h.get(e);if(o)for(;this.stack.length>0&&o.has(this.stack[this.stack.length-1]);){var s=this.stack.pop();null===(n=(t=this.cbs).onclosetag)||void 0===n||n.call(t,s,!0)}this.isVoidElement(e)||(this.stack.push(e),m.has(e)?this.foreignContext.push(!0):g.has(e)&&this.foreignContext.push(!1)),null===(i=(r=this.cbs).onopentagname)||void 0===i||i.call(r,e),this.cbs.onopentag&&(this.attribs={})},e.prototype.endOpenTag=function(e){var t,n;this.startIndex=this.openTagStart,this.attribs&&(null===(n=(t=this.cbs).onopentag)||void 0===n||n.call(t,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""},e.prototype.onopentagend=function(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1},e.prototype.onclosetag=function(e,t){var n,r,i,o,s,a;this.endIndex=t;var l=this.getSlice(e,t);if(this.lowerCaseTagNames&&(l=l.toLowerCase()),(m.has(l)||g.has(l))&&this.foreignContext.pop(),this.isVoidElement(l))this.options.xmlMode||"br"!==l||(null===(r=(n=this.cbs).onopentagname)||void 0===r||r.call(n,"br"),null===(o=(i=this.cbs).onopentag)||void 0===o||o.call(i,"br",{},!0),null===(a=(s=this.cbs).onclosetag)||void 0===a||a.call(s,"br",!1));else{var c=this.stack.lastIndexOf(l);if(-1!==c)if(this.cbs.onclosetag)for(var u=this.stack.length-c;u--;)this.cbs.onclosetag(this.stack.pop(),0!==u);else this.stack.length=c;else this.options.xmlMode||"p"!==l||(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=t+1},e.prototype.onselfclosingtag=function(e){this.endIndex=e,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)},e.prototype.closeCurrentTag=function(e){var t,n,r=this.tagname;this.endOpenTag(e),this.stack[this.stack.length-1]===r&&(null===(n=(t=this.cbs).onclosetag)||void 0===n||n.call(t,r,!e),this.stack.pop())},e.prototype.onattribname=function(e,t){this.startIndex=e;var n=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?n.toLowerCase():n},e.prototype.onattribdata=function(e,t){this.attribvalue+=this.getSlice(e,t)},e.prototype.onattribentity=function(e){this.attribvalue+=(0,a.fromCodePoint)(e)},e.prototype.onattribend=function(e,t){var n,r;this.endIndex=t,null===(r=(n=this.cbs).onattribute)||void 0===r||r.call(n,this.attribname,this.attribvalue,e===s.QuoteType.Double?'"':e===s.QuoteType.Single?"'":e===s.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""},e.prototype.getInstructionName=function(e){var t=e.search(b),n=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(n=n.toLowerCase()),n},e.prototype.ondeclaration=function(e,t){this.endIndex=t;var n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){var r=this.getInstructionName(n);this.cbs.onprocessinginstruction("!".concat(r),"!".concat(n))}this.startIndex=t+1},e.prototype.onprocessinginstruction=function(e,t){this.endIndex=t;var n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){var r=this.getInstructionName(n);this.cbs.onprocessinginstruction("?".concat(r),"?".concat(n))}this.startIndex=t+1},e.prototype.oncomment=function(e,t,n){var r,i,o,s;this.endIndex=t,null===(i=(r=this.cbs).oncomment)||void 0===i||i.call(r,this.getSlice(e,t-n)),null===(s=(o=this.cbs).oncommentend)||void 0===s||s.call(o),this.startIndex=t+1},e.prototype.oncdata=function(e,t,n){var r,i,o,s,a,l,c,u,d,p;this.endIndex=t;var h=this.getSlice(e,t-n);this.options.xmlMode||this.options.recognizeCDATA?(null===(i=(r=this.cbs).oncdatastart)||void 0===i||i.call(r),null===(s=(o=this.cbs).ontext)||void 0===s||s.call(o,h),null===(l=(a=this.cbs).oncdataend)||void 0===l||l.call(a)):(null===(u=(c=this.cbs).oncomment)||void 0===u||u.call(c,"[CDATA[".concat(h,"]]")),null===(p=(d=this.cbs).oncommentend)||void 0===p||p.call(d)),this.startIndex=t+1},e.prototype.onend=function(){var e,t;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(var n=this.stack.length;n>0;this.cbs.onclosetag(this.stack[--n],!0));}null===(t=(e=this.cbs).onend)||void 0===t||t.call(e)},e.prototype.reset=function(){var e,t,n,r;null===(t=(e=this.cbs).onreset)||void 0===t||t.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,null===(r=(n=this.cbs).onparserinit)||void 0===r||r.call(n,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1},e.prototype.parseComplete=function(e){this.reset(),this.end(e)},e.prototype.getSlice=function(e,t){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();for(var n=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),n+=this.buffers[0].slice(0,t-this.bufferOffset);return n},e.prototype.shiftBuffer=function(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()},e.prototype.write=function(e){var t,n;this.ended?null===(n=(t=this.cbs).onerror)||void 0===n||n.call(t,new Error(".write() after done!")):(this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++))},e.prototype.end=function(e){var t,n;this.ended?null===(n=(t=this.cbs).onerror)||void 0===n||n.call(t,new Error(".end() after done!")):(e&&this.write(e),this.ended=!0,this.tokenizer.end())},e.prototype.pause=function(){this.tokenizer.pause()},e.prototype.resume=function(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()},e.prototype.parseChunk=function(e){this.write(e)},e.prototype.done=function(e){this.end(e)},e}();t.Parser=y},39889:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuoteType=void 0;var r,i,o,s=n(44076);function a(e){return e===r.Space||e===r.NewLine||e===r.Tab||e===r.FormFeed||e===r.CarriageReturn}function l(e){return e===r.Slash||e===r.Gt||a(e)}function c(e){return e>=r.Zero&&e<=r.Nine}!function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Number=35]="Number",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"}(r||(r={})),function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.InSpecialComment=20]="InSpecialComment",e[e.InCommentLike=21]="InCommentLike",e[e.BeforeSpecialS=22]="BeforeSpecialS",e[e.SpecialStartSequence=23]="SpecialStartSequence",e[e.InSpecialTag=24]="InSpecialTag",e[e.BeforeEntity=25]="BeforeEntity",e[e.BeforeNumericEntity=26]="BeforeNumericEntity",e[e.InNamedEntity=27]="InNamedEntity",e[e.InNumericEntity=28]="InNumericEntity",e[e.InHexEntity=29]="InHexEntity"}(i||(i={})),function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"}(o=t.QuoteType||(t.QuoteType={}));var u={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])},d=function(){function e(e,t){var n=e.xmlMode,r=void 0!==n&&n,o=e.decodeEntities,a=void 0===o||o;this.cbs=t,this.state=i.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=i.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=r,this.decodeEntities=a,this.entityTrie=r?s.xmlDecodeTree:s.htmlDecodeTree}return e.prototype.reset=function(){this.state=i.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=i.Text,this.currentSequence=void 0,this.running=!0,this.offset=0},e.prototype.write=function(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()},e.prototype.end=function(){this.running&&this.finish()},e.prototype.pause=function(){this.running=!1},e.prototype.resume=function(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()},e.prototype.getIndex=function(){return this.index},e.prototype.getSectionStart=function(){return this.sectionStart},e.prototype.stateText=function(e){e===r.Lt||!this.decodeEntities&&this.fastForwardTo(r.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=i.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===r.Amp&&(this.state=i.BeforeEntity)},e.prototype.stateSpecialStartSequence=function(e){var t=this.sequenceIndex===this.currentSequence.length;if(t?l(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.isSpecial=!1;this.sequenceIndex=0,this.state=i.InTagName,this.stateInTagName(e)},e.prototype.stateInSpecialTag=function(e){if(this.sequenceIndex===this.currentSequence.length){if(e===r.Gt||a(e)){var t=this.index-this.currentSequence.length;if(this.sectionStart<t){var n=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=n}return this.isSpecial=!1,this.sectionStart=t+2,void this.stateInClosingTagName(e)}this.sequenceIndex=0}(32|e)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:0===this.sequenceIndex?this.currentSequence===u.TitleEnd?this.decodeEntities&&e===r.Amp&&(this.state=i.BeforeEntity):this.fastForwardTo(r.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=Number(e===r.Lt)},e.prototype.stateCDATASequence=function(e){e===u.Cdata[this.sequenceIndex]?++this.sequenceIndex===u.Cdata.length&&(this.state=i.InCommentLike,this.currentSequence=u.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=i.InDeclaration,this.stateInDeclaration(e))},e.prototype.fastForwardTo=function(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1},e.prototype.stateInCommentLike=function(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===u.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=i.Text):0===this.sequenceIndex?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)},e.prototype.isTagStartChar=function(e){return this.xmlMode?!l(e):function(e){return e>=r.LowerA&&e<=r.LowerZ||e>=r.UpperA&&e<=r.UpperZ}(e)},e.prototype.startSpecial=function(e,t){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=t,this.state=i.SpecialStartSequence},e.prototype.stateBeforeTagName=function(e){if(e===r.ExclamationMark)this.state=i.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===r.Questionmark)this.state=i.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){var t=32|e;this.sectionStart=this.index,this.xmlMode||t!==u.TitleEnd[2]?this.state=this.xmlMode||t!==u.ScriptEnd[2]?i.InTagName:i.BeforeSpecialS:this.startSpecial(u.TitleEnd,3)}else e===r.Slash?this.state=i.BeforeClosingTagName:(this.state=i.Text,this.stateText(e))},e.prototype.stateInTagName=function(e){l(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=i.BeforeAttributeName,this.stateBeforeAttributeName(e))},e.prototype.stateBeforeClosingTagName=function(e){a(e)||(e===r.Gt?this.state=i.Text:(this.state=this.isTagStartChar(e)?i.InClosingTagName:i.InSpecialComment,this.sectionStart=this.index))},e.prototype.stateInClosingTagName=function(e){(e===r.Gt||a(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=i.AfterClosingTagName,this.stateAfterClosingTagName(e))},e.prototype.stateAfterClosingTagName=function(e){(e===r.Gt||this.fastForwardTo(r.Gt))&&(this.state=i.Text,this.baseState=i.Text,this.sectionStart=this.index+1)},e.prototype.stateBeforeAttributeName=function(e){e===r.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=i.InSpecialTag,this.sequenceIndex=0):this.state=i.Text,this.baseState=this.state,this.sectionStart=this.index+1):e===r.Slash?this.state=i.InSelfClosingTag:a(e)||(this.state=i.InAttributeName,this.sectionStart=this.index)},e.prototype.stateInSelfClosingTag=function(e){e===r.Gt?(this.cbs.onselfclosingtag(this.index),this.state=i.Text,this.baseState=i.Text,this.sectionStart=this.index+1,this.isSpecial=!1):a(e)||(this.state=i.BeforeAttributeName,this.stateBeforeAttributeName(e))},e.prototype.stateInAttributeName=function(e){(e===r.Eq||l(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=-1,this.state=i.AfterAttributeName,this.stateAfterAttributeName(e))},e.prototype.stateAfterAttributeName=function(e){e===r.Eq?this.state=i.BeforeAttributeValue:e===r.Slash||e===r.Gt?(this.cbs.onattribend(o.NoValue,this.index),this.state=i.BeforeAttributeName,this.stateBeforeAttributeName(e)):a(e)||(this.cbs.onattribend(o.NoValue,this.index),this.state=i.InAttributeName,this.sectionStart=this.index)},e.prototype.stateBeforeAttributeValue=function(e){e===r.DoubleQuote?(this.state=i.InAttributeValueDq,this.sectionStart=this.index+1):e===r.SingleQuote?(this.state=i.InAttributeValueSq,this.sectionStart=this.index+1):a(e)||(this.sectionStart=this.index,this.state=i.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))},e.prototype.handleInAttributeValue=function(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===r.DoubleQuote?o.Double:o.Single,this.index),this.state=i.BeforeAttributeName):this.decodeEntities&&e===r.Amp&&(this.baseState=this.state,this.state=i.BeforeEntity)},e.prototype.stateInAttributeValueDoubleQuotes=function(e){this.handleInAttributeValue(e,r.DoubleQuote)},e.prototype.stateInAttributeValueSingleQuotes=function(e){this.handleInAttributeValue(e,r.SingleQuote)},e.prototype.stateInAttributeValueNoQuotes=function(e){a(e)||e===r.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(o.Unquoted,this.index),this.state=i.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===r.Amp&&(this.baseState=this.state,this.state=i.BeforeEntity)},e.prototype.stateBeforeDeclaration=function(e){e===r.OpeningSquareBracket?(this.state=i.CDATASequence,this.sequenceIndex=0):this.state=e===r.Dash?i.BeforeComment:i.InDeclaration},e.prototype.stateInDeclaration=function(e){(e===r.Gt||this.fastForwardTo(r.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=i.Text,this.sectionStart=this.index+1)},e.prototype.stateInProcessingInstruction=function(e){(e===r.Gt||this.fastForwardTo(r.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=i.Text,this.sectionStart=this.index+1)},e.prototype.stateBeforeComment=function(e){e===r.Dash?(this.state=i.InCommentLike,this.currentSequence=u.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=i.InDeclaration},e.prototype.stateInSpecialComment=function(e){(e===r.Gt||this.fastForwardTo(r.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=i.Text,this.sectionStart=this.index+1)},e.prototype.stateBeforeSpecialS=function(e){var t=32|e;t===u.ScriptEnd[3]?this.startSpecial(u.ScriptEnd,4):t===u.StyleEnd[3]?this.startSpecial(u.StyleEnd,4):(this.state=i.InTagName,this.stateInTagName(e))},e.prototype.stateBeforeEntity=function(e){this.entityExcess=1,this.entityResult=0,e===r.Number?this.state=i.BeforeNumericEntity:e===r.Amp||(this.trieIndex=0,this.trieCurrent=this.entityTrie[0],this.state=i.InNamedEntity,this.stateInNamedEntity(e))},e.prototype.stateInNamedEntity=function(e){if(this.entityExcess+=1,this.trieIndex=(0,s.determineBranch)(this.entityTrie,this.trieCurrent,this.trieIndex+1,e),this.trieIndex<0)return this.emitNamedEntity(),void this.index--;this.trieCurrent=this.entityTrie[this.trieIndex];var t=this.trieCurrent&s.BinTrieFlags.VALUE_LENGTH;if(t){var n=(t>>14)-1;if(this.allowLegacyEntity()||e===r.Semi){var i=this.index-this.entityExcess+1;i>this.sectionStart&&this.emitPartial(this.sectionStart,i),this.entityResult=this.trieIndex,this.trieIndex+=n,this.entityExcess=0,this.sectionStart=this.index+1,0===n&&this.emitNamedEntity()}else this.trieIndex+=n}},e.prototype.emitNamedEntity=function(){if(this.state=this.baseState,0!==this.entityResult)switch((this.entityTrie[this.entityResult]&s.BinTrieFlags.VALUE_LENGTH)>>14){case 1:this.emitCodePoint(this.entityTrie[this.entityResult]&~s.BinTrieFlags.VALUE_LENGTH);break;case 2:this.emitCodePoint(this.entityTrie[this.entityResult+1]);break;case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}},e.prototype.stateBeforeNumericEntity=function(e){(32|e)===r.LowerX?(this.entityExcess++,this.state=i.InHexEntity):(this.state=i.InNumericEntity,this.stateInNumericEntity(e))},e.prototype.emitNumericEntity=function(e){var t=this.index-this.entityExcess-1;t+2+Number(this.state===i.InHexEntity)!==this.index&&(t>this.sectionStart&&this.emitPartial(this.sectionStart,t),this.sectionStart=this.index+Number(e),this.emitCodePoint((0,s.replaceCodePoint)(this.entityResult))),this.state=this.baseState},e.prototype.stateInNumericEntity=function(e){e===r.Semi?this.emitNumericEntity(!0):c(e)?(this.entityResult=10*this.entityResult+(e-r.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},e.prototype.stateInHexEntity=function(e){e===r.Semi?this.emitNumericEntity(!0):c(e)?(this.entityResult=16*this.entityResult+(e-r.Zero),this.entityExcess++):!function(e){return e>=r.UpperA&&e<=r.UpperF||e>=r.LowerA&&e<=r.LowerF}(e)?(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--):(this.entityResult=16*this.entityResult+((32|e)-r.LowerA+10),this.entityExcess++)},e.prototype.allowLegacyEntity=function(){return!this.xmlMode&&(this.baseState===i.Text||this.baseState===i.InSpecialTag)},e.prototype.cleanup=function(){this.running&&this.sectionStart!==this.index&&(this.state===i.Text||this.state===i.InSpecialTag&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):this.state!==i.InAttributeValueDq&&this.state!==i.InAttributeValueSq&&this.state!==i.InAttributeValueNq||(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))},e.prototype.shouldContinue=function(){return this.index<this.buffer.length+this.offset&&this.running},e.prototype.parse=function(){for(;this.shouldContinue();){var e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case i.Text:this.stateText(e);break;case i.SpecialStartSequence:this.stateSpecialStartSequence(e);break;case i.InSpecialTag:this.stateInSpecialTag(e);break;case i.CDATASequence:this.stateCDATASequence(e);break;case i.InAttributeValueDq:this.stateInAttributeValueDoubleQuotes(e);break;case i.InAttributeName:this.stateInAttributeName(e);break;case i.InCommentLike:this.stateInCommentLike(e);break;case i.InSpecialComment:this.stateInSpecialComment(e);break;case i.BeforeAttributeName:this.stateBeforeAttributeName(e);break;case i.InTagName:this.stateInTagName(e);break;case i.InClosingTagName:this.stateInClosingTagName(e);break;case i.BeforeTagName:this.stateBeforeTagName(e);break;case i.AfterAttributeName:this.stateAfterAttributeName(e);break;case i.InAttributeValueSq:this.stateInAttributeValueSingleQuotes(e);break;case i.BeforeAttributeValue:this.stateBeforeAttributeValue(e);break;case i.BeforeClosingTagName:this.stateBeforeClosingTagName(e);break;case i.AfterClosingTagName:this.stateAfterClosingTagName(e);break;case i.BeforeSpecialS:this.stateBeforeSpecialS(e);break;case i.InAttributeValueNq:this.stateInAttributeValueNoQuotes(e);break;case i.InSelfClosingTag:this.stateInSelfClosingTag(e);break;case i.InDeclaration:this.stateInDeclaration(e);break;case i.BeforeDeclaration:this.stateBeforeDeclaration(e);break;case i.BeforeComment:this.stateBeforeComment(e);break;case i.InProcessingInstruction:this.stateInProcessingInstruction(e);break;case i.InNamedEntity:this.stateInNamedEntity(e);break;case i.BeforeEntity:this.stateBeforeEntity(e);break;case i.InHexEntity:this.stateInHexEntity(e);break;case i.InNumericEntity:this.stateInNumericEntity(e);break;default:this.stateBeforeNumericEntity(e)}this.index++}this.cleanup()},e.prototype.finish=function(){this.state===i.InNamedEntity&&this.emitNamedEntity(),this.sectionStart<this.index&&this.handleTrailingData(),this.cbs.onend()},e.prototype.handleTrailingData=function(){var e=this.buffer.length+this.offset;this.state===i.InCommentLike?this.currentSequence===u.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===i.InNumericEntity&&this.allowLegacyEntity()||this.state===i.InHexEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===i.InTagName||this.state===i.BeforeAttributeName||this.state===i.BeforeAttributeValue||this.state===i.AfterAttributeName||this.state===i.InAttributeName||this.state===i.InAttributeValueSq||this.state===i.InAttributeValueDq||this.state===i.InAttributeValueNq||this.state===i.InClosingTagName||this.cbs.ontext(this.sectionStart,e)},e.prototype.emitPartial=function(e,t){this.baseState!==i.Text&&this.baseState!==i.InSpecialTag?this.cbs.onattribdata(e,t):this.cbs.ontext(e,t)},e.prototype.emitCodePoint=function(e){this.baseState!==i.Text&&this.baseState!==i.InSpecialTag?this.cbs.onattribentity(e):this.cbs.ontextentity(e)},e}();t.default=d},23719:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomUtils=t.parseFeed=t.getFeed=t.ElementType=t.Tokenizer=t.createDomStream=t.parseDOM=t.parseDocument=t.DefaultHandler=t.DomHandler=t.Parser=void 0;var a=n(50763),l=n(50763);Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return l.Parser}});var c=n(47915),u=n(47915);function d(e,t){var n=new c.DomHandler(void 0,t);return new a.Parser(n,t).end(e),n.root}function p(e,t){return d(e,t).children}Object.defineProperty(t,"DomHandler",{enumerable:!0,get:function(){return u.DomHandler}}),Object.defineProperty(t,"DefaultHandler",{enumerable:!0,get:function(){return u.DomHandler}}),t.parseDocument=d,t.parseDOM=p,t.createDomStream=function(e,t,n){var r=new c.DomHandler(e,t,n);return new a.Parser(r,t)};var h=n(39889);Object.defineProperty(t,"Tokenizer",{enumerable:!0,get:function(){return s(h).default}}),t.ElementType=o(n(99960));var f=n(89432),m=n(89432);Object.defineProperty(t,"getFeed",{enumerable:!0,get:function(){return m.getFeed}});var g={xmlMode:!0};t.parseFeed=function(e,t){return void 0===t&&(t=g),(0,f.getFeed)(p(e,t))},t.DomUtils=o(n(89432))},26057:(e,t)=>{"use strict";function n(e){return"[object Object]"===Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isPlainObject=function(e){var t,r;return!1!==n(e)&&(void 0===(t=e.constructor)||!1!==n(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}},87594:(e,t)=>{function n(e){let t,n=[];for(let r of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(r))n.push(parseInt(r,10));else if(t=r.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,r,i,o]=t;if(r&&o){r=parseInt(r),o=parseInt(o);const e=r<o?1:-1;"-"!==i&&".."!==i&&"\u2025"!==i||(o+=e);for(let t=r;t!==o;t+=e)n.push(t)}}return n}t.default=n,e.exports=n},79430:function(e,t){var n,r,i;r=[],void 0===(i="function"==typeof(n=function(){return function(e){function t(e){return" "===e||"\t"===e||"\n"===e||"\f"===e||"\r"===e}function n(t){var n,r=t.exec(e.substring(m));if(r)return n=r[0],m+=n.length,n}for(var r,i,o,s,a,l=e.length,c=/^[ \t\n\r\u000c]+/,u=/^[, \t\n\r\u000c]+/,d=/^[^ \t\n\r\u000c]+/,p=/[,]+$/,h=/^\d+$/,f=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,m=0,g=[];;){if(n(u),m>=l)return g;r=n(d),i=[],","===r.slice(-1)?(r=r.replace(p,""),y()):b()}function b(){for(n(c),o="",s="in descriptor";;){if(a=e.charAt(m),"in descriptor"===s)if(t(a))o&&(i.push(o),o="",s="after descriptor");else{if(","===a)return m+=1,o&&i.push(o),void y();if("("===a)o+=a,s="in parens";else{if(""===a)return o&&i.push(o),void y();o+=a}}else if("in parens"===s)if(")"===a)o+=a,s="in descriptor";else{if(""===a)return i.push(o),void y();o+=a}else if("after descriptor"===s)if(t(a));else{if(""===a)return void y();s="in descriptor",m-=1}m+=1}}function y(){var t,n,o,s,a,l,c,u,d,p=!1,m={};for(s=0;s<i.length;s++)l=(a=i[s])[a.length-1],c=a.substring(0,a.length-1),u=parseInt(c,10),d=parseFloat(c),h.test(c)&&"w"===l?((t||n)&&(p=!0),0===u?p=!0:t=u):f.test(c)&&"x"===l?((t||n||o)&&(p=!0),d<0?p=!0:n=d):h.test(c)&&"h"===l?((o||n)&&(p=!0),0===u?p=!0:o=u):p=!0;p?console&&console.log&&console.log("Invalid srcset descriptor found in '"+e+"' at '"+a+"'."):(m.url=r,t&&(m.w=t),n&&(m.d=n),o&&(m.h=o),g.push(m))}}})?n.apply(t,r):n)||(e.exports=i)},74241:e=>{var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t}};e.exports=n(),e.exports.createColors=n},41353:(e,t,n)=>{"use strict";let r=n(21019);class i extends r{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}e.exports=i,i.default=i,r.registerAtRule(i)},69932:(e,t,n)=>{"use strict";let r=n(65631);class i extends r{constructor(e){super(e),this.type="comment"}}e.exports=i,i.default=i},21019:(e,t,n)=>{"use strict";let r,i,o,s,{isClean:a,my:l}=n(65513),c=n(94258),u=n(69932),d=n(65631);function p(e){return e.map((e=>(e.nodes&&(e.nodes=p(e.nodes)),delete e.source,e)))}function h(e){if(e[a]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)h(t)}class f extends d{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map((e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e))):"every"===t||"some"===t?n=>e[t](((e,...t)=>n(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let s of o)this.proxyOf.nodes.splice(r,0,s);for(let s in this.indexes)n=this.indexes[s],r<=n&&(this.indexes[s]=n+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=p(r(e).nodes);else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new c(e)]}else if(e.selector)e=[new i(e)];else if(e.name)e=[new o(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new u(e)]}return e.map((e=>(e[l]||f.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[a]&&h(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls((r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,n)=>{let r;try{r=e(t,n)}catch(i){throw t.addToError(i)}return!1!==r&&t.walk&&(r=t.walk(e)),r}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)})):this.walk(((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("atrule"===e.type)return t(e,n)})))}walkComments(e){return this.walk(((t,n)=>{if("comment"===t.type)return e(t,n)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)})):this.walk(((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("decl"===e.type)return t(e,n)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)})):this.walk(((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("rule"===e.type)return t(e,n)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}f.registerParse=e=>{r=e},f.registerRule=e=>{i=e},f.registerAtRule=e=>{o=e},f.registerRoot=e=>{s=e},e.exports=f,f.default=f,f.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,o.prototype):"rule"===e.type?Object.setPrototypeOf(e,i.prototype):"decl"===e.type?Object.setPrototypeOf(e,c.prototype):"comment"===e.type?Object.setPrototypeOf(e,u.prototype):"root"===e.type&&Object.setPrototypeOf(e,s.prototype),e[l]=!0,e.nodes&&e.nodes.forEach((e=>{f.rebuild(e)}))}},42671:(e,t,n)=>{"use strict";let r=n(74241),i=n(22868);class o extends Error{constructor(e,t,n,r,i,s){super(e),this.name="CssSyntaxError",this.reason=e,i&&(this.file=i),r&&(this.source=r),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,o)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=r.isColorSupported),i&&e&&(t=i(t));let n,o,s=t.split(/\r?\n/),a=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),c=String(l).length;if(e){let{bold:e,gray:t,red:i}=r.createColors(!0);n=t=>e(i(t)),o=e=>t(e)}else n=o=e=>e;return s.slice(a,l).map(((e,t)=>{let r=a+1+t,i=" "+(" "+r).slice(-c)+" | ";if(r===this.line){let t=o(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+o(i)+e+"\n "+t+n("^")}return" "+o(i)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=o,o.default=o},94258:(e,t,n)=>{"use strict";let r=n(65631);class i extends r{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}e.exports=i,i.default=i},26461:(e,t,n)=>{"use strict";let r,i,o=n(21019);class s extends o{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new r(new i,this,e).stringify()}}s.registerLazyResult=e=>{r=e},s.registerProcessor=e=>{i=e},e.exports=s,s.default=s},50250:(e,t,n)=>{"use strict";let r=n(94258),i=n(47981),o=n(69932),s=n(41353),a=n(5995),l=n(41025),c=n(31675);function u(e,t){if(Array.isArray(e))return e.map((e=>u(e)));let{inputs:n,...d}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:a.prototype};n.map&&(n.map={...n.map,__proto__:i.prototype}),t.push(n)}}if(d.nodes&&(d.nodes=e.nodes.map((e=>u(e,t)))),d.source){let{inputId:e,...n}=d.source;d.source=n,null!=e&&(d.source.input=t[e])}if("root"===d.type)return new l(d);if("decl"===d.type)return new r(d);if("rule"===d.type)return new c(d);if("comment"===d.type)return new o(d);if("atrule"===d.type)return new s(d);throw new Error("Unknown node type: "+e.type)}e.exports=u,u.default=u},5995:(e,t,n)=>{"use strict";let{SourceMapConsumer:r,SourceMapGenerator:i}=n(70209),{fileURLToPath:o,pathToFileURL:s}=n(87414),{isAbsolute:a,resolve:l}=n(99830),{nanoid:c}=n(62961),u=n(22868),d=n(42671),p=n(47981),h=Symbol("fromOffsetCache"),f=Boolean(r&&i),m=Boolean(l&&a);class g{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"\ufffe"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!m||/^\w+:\/\//.test(t.from)||a(t.from)?this.file=t.from:this.file=l(t.from)),m&&f){let e=new p(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+c(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let i,o,a;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,a=e.col}else o=r.line,a=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,o,a);return i=l?new d(e,void 0===l.endLine?l.line:{column:l.column,line:l.line},void 0===l.endLine?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,r.plugin):new d(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:a,line:o},this.css,this.file,r.plugin),i.input={column:n,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(s&&(i.input.url=s(this.file).toString()),i.input.file=this.file),i}fromOffset(e){let t,n;if(this[h])n=this[h];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[h]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,i=n.length-2;for(;r<i;)if(t=r+(i-r>>1),e<n[t])i=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:l(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,l,c=this.map.consumer(),u=c.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof n&&(i=c.originalPositionFor({column:r,line:n})),l=a(u.source)?s(u.source):new URL(u.source,this.map.consumer().sourceRoot||s(this.map.mapFile));let d={column:u.column,endColumn:i&&i.column,endLine:i&&i.line,line:u.line,url:l.toString()};if("file:"===l.protocol){if(!o)throw new Error("file: protocol is not available in this PostCSS build");d.file=o(l)}let p=c.sourceContentFor(u.source);return p&&(d.source=p),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}e.exports=g,g.default=g,u&&u.registerInput&&u.registerInput(g)},21939:(e,t,n)=>{"use strict";let{isClean:r,my:i}=n(65513),o=n(48505),s=n(67088),a=n(21019),l=n(26461),c=(n(72448),n(83632)),u=n(66939),d=n(41025);const p={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},h={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0},m=0;function g(e){return"object"==typeof e&&"function"==typeof e.then}function b(e){let t=!1,n=p[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,m,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,m,n+"Exit"]:[n,n+"Exit"]}function y(e){let t;return t="document"===e.type?["Document",m,"DocumentExit"]:"root"===e.type?["Root",m,"RootExit"]:b(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(e){return e[r]=!1,e.nodes&&e.nodes.forEach((e=>v(e))),e}let w={};class x{constructor(e,t,n){let r;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof x||t instanceof c)r=v(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=u;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{r=e(t,n)}catch(o){this.processed=!0,this.error=o}r&&!r[i]&&a.rebuild(r)}else r=v(t);this.result=new c(e,r,n),this.helpers={...w,postcss:w,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(r){console&&console.error&&console.error(r)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!h[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let n=0;n<this.plugins.length;n++){let t=this.plugins[n],r=this.runOnRoot(t);if(g(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[r];){e[r]=!0;let n=[y(e)];for(;n.length>0;){let e=this.visitTick(n);if(g(e))try{await e}catch(t){let e=n[n.length-1].node;throw this.handleError(t,e)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if("document"===e.type){let t=e.nodes.map((e=>r(e,this.helpers)));await Promise.all(t)}else await r(e,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return g(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=s;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new o(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(g(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[r];)e[r]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){let e;this.result.lastPlugin=r;try{e=i(t,this.helpers)}catch(n){throw this.handleError(n,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(g(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:i}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(i.length>0&&t.visitorIndex<i.length){let[e,r]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return r(n.toProxy(),this.helpers)}catch(s){throw this.handleError(s,n)}}if(0!==t.iterator){let i,o=t.iterator;for(;i=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!i[r])return i[r]=!0,void e.push(y(i));t.iterator=0,delete n.indexes[o]}let o=t.events;for(;t.eventIndex<o.length;){let e=o[t.eventIndex];if(t.eventIndex+=1,e===m)return void(n.nodes&&n.nodes.length&&(n[r]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[r]=!0;let t=b(e);for(let n of t)if(n===m)e.nodes&&e.each((e=>{e[r]||this.walkSync(e)}));else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}x.registerPostcss=e=>{w=e},e.exports=x,x.default=x,d.registerLazyResult(x),l.registerLazyResult(x)},54715:e=>{"use strict";let t={comma:e=>t.split(e,[","],!0),space:e=>t.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],i="",o=!1,s=0,a=!1,l="",c=!1;for(let u of e)c?c=!1:"\\"===u?c=!0:a?u===l&&(a=!1):'"'===u||"'"===u?(a=!0,l=u):"("===u?s+=1:")"===u?s>0&&(s-=1):0===s&&t.includes(u)&&(o=!0),o?(""!==i&&r.push(i.trim()),i="",o=!1):i+=u;return(n||""!==i)&&r.push(i.trim()),r}};e.exports=t,t.default=t},48505:(e,t,n)=>{"use strict";let{SourceMapConsumer:r,SourceMapGenerator:i}=n(70209),{dirname:o,relative:s,resolve:a,sep:l}=n(99830),{pathToFileURL:c}=n(87414),u=n(5995),d=Boolean(r&&i),p=Boolean(o&&a&&s&&l);e.exports=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),i=e.root||o(e.file);!1===this.mapOpts.sourcesContent?(t=new r(e.text),t.sourcesContent&&(t.sourcesContent=t.sourcesContent.map((()=>null)))):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(i)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),p&&d&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=i.fromSourceMap(e)}else this.map=new i({file:this.outputFile()}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new i({file:this.outputFile()});let e,t,n=1,r=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(s.generated.line=n,s.generated.column=r-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=i.match(/\n/g),e?(n+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=r-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=r-1,this.map.addMapping(s)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?o(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=o(a(n,this.mapOpts.annotation)));let r=s(n,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new u(this.css,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(c){let t=c(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===l&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}},47647:(e,t,n)=>{"use strict";let r=n(48505),i=n(67088),o=(n(72448),n(66939));const s=n(83632);class a{constructor(e,t,n){let o;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let a=i;this.result=new s(this._processor,o,this._opts),this.result.css=t;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new r(a,o,this._opts,t);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=o;try{e=t(this._css,this._opts)}catch(n){this.error=n}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}e.exports=a,a.default=a},65631:(e,t,n)=>{"use strict";let{isClean:r,my:i}=n(65513),o=n(42671),s=n(1062),a=n(67088);function l(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let i=e[r],o=typeof i;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map((e=>l(e,n))):("object"===o&&null!==i&&(i=l(i)),n[r]=i)}return n}class c{constructor(e={}){this.raws={},this[r]=!1,this[i]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=l(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new o(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[r]){this[r]=!1;let e=this;for(;e=e.parent;)e[r]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let o=0;o<e;o++)"\n"===n[o]?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new s).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o))continue;if("parent"===o||"proxyCache"===o)continue;let e=this[o];if(Array.isArray(e))n[o]=e.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof e&&e.toJSON)n[o]=e.toJSON(null,t);else if("source"===o){let r=t.get(e.input);null==r&&(r=i,t.set(e.input,i),i++),n[o]={end:e.end,inputId:r,start:e.start}}else n[o]=e}return r&&(n.inputs=[...t.keys()].map((e=>e.toJSON()))),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=a){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,n){let r={node:this};for(let i in n)r[i]=n[i];return e.warn(t,r)}get proxyOf(){return this}}e.exports=c,c.default=c},66939:(e,t,n)=>{"use strict";let r=n(21019),i=n(68867),o=n(5995);function s(e,t){let n=new o(e,t),r=new i(n);try{r.parse()}catch(s){throw s}return r.root}e.exports=s,s.default=s,r.registerParse(s)},68867:(e,t,n)=>{"use strict";let r=n(94258),i=n(83852),o=n(69932),s=n(41353),a=n(41025),l=n(31675);const c={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new a,this.current=this.root,this.spaces="",this.semicolon=!1,this.customProperty=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,r,i=new s;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(r=l.length-1,n=l[r];n&&"space"===n[0];)n=l[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),o&&(e=l[l.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let i=t-1;i>=0&&(n=e[i],"space"===n[0]||(r+=1,2!==r));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,i=0;for(let[o,s]of e.entries()){if(t=s,n=t[0],"("===n&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new o;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=i(this.input)}decl(e,t){let n=new r;this.init(n,e[0][2]);let i,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(i=e.shift(),":"===i[0]){n.raws.between+=i[1];break}"word"===i[0]&&/\w/.test(i[1])&&this.unknownWord([i]),n.raws.between+=i[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let r=e.length-1;r>=0;r--){if(i=e[r],"!important"===i[1].toLowerCase()){n.important=!0;let t=this.stringFrom(e,r);t=this.spacesFromEnd(e)+t," !important"!==t&&(n.raws.important=t);break}if("important"===i[1].toLowerCase()){let t=e.slice(0),i="";for(let e=r;e>0;e--){let n=t[e][0];if(0===i.trim().indexOf("!")&&"space"!==n)break;i=t.pop()[1]+i}0===i.trim().indexOf("!")&&(n.important=!0,n.raws.important=i,e=t)}if("space"!==i[0]&&"comment"!==i[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(n.raws.between+=a.map((e=>e[1])).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new l;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)i||(i=l),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=l),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,o,s,a,l=n.length,u="",d=!0;for(let p=0;p<l;p+=1)i=n[p],o=i[0],"space"!==o||p!==l-1||r?"comment"===o?(a=n[p-1]?n[p-1][0]:"empty",s=n[p+1]?n[p+1][0]:"empty",c[a]||c[s]||","===u.slice(-1)?d=!1:u+=i[1]):u+=i[1]:d=!1;if(!d){let r=n.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:r,value:u}}e[t]=u}rule(e){e.pop();let t=new l;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}},50020:(e,t,n)=>{"use strict";let r=n(42671),i=n(94258),o=n(21939),s=n(21019),a=n(71723),l=n(67088),c=n(50250),u=n(26461),d=n(11728),p=n(69932),h=n(41353),f=n(83632),m=n(5995),g=n(66939),b=n(54715),y=n(31675),v=n(41025),w=n(65631);function x(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new a(e)}x.plugin=function(e,t){let n,r=!1;function i(...n){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": \u91cc\u9762 postcss.plugin \u88ab\u5f03\u7528. \u8fc1\u79fb\u6307\u5357:\nhttps://www.w3ctech.com/topic/2226"));let i=t(...n);return i.postcssPlugin=e,i.postcssVersion=(new a).version,i}return Object.defineProperty(i,"postcss",{get:()=>(n||(n=i()),n)}),i.process=function(e,t,n){return x([i(n)]).process(e,t)},i},x.stringify=l,x.parse=g,x.fromJSON=c,x.list=b,x.comment=e=>new p(e),x.atRule=e=>new h(e),x.decl=e=>new i(e),x.rule=e=>new y(e),x.root=e=>new v(e),x.document=e=>new u(e),x.CssSyntaxError=r,x.Declaration=i,x.Container=s,x.Processor=a,x.Document=u,x.Comment=p,x.Warning=d,x.AtRule=h,x.Result=f,x.Input=m,x.Rule=y,x.Root=v,x.Node=w,o.registerPostcss(x),e.exports=x,x.default=x},47981:(e,t,n)=>{"use strict";let{SourceMapConsumer:r,SourceMapGenerator:i}=n(70209),{existsSync:o,readFileSync:s}=n(14777),{dirname:a,join:l}=n(99830);class c{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=a(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=a(e),o(e))return this.mapFile=e,s(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=l(a(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}e.exports=c,c.default=c},71723:(e,t,n)=>{"use strict";let r=n(47647),i=n(21939),o=n(26461),s=n(41025);class a{constructor(e=[]){this.version="8.4.31",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin")}return t}process(e,t={}){return 0===this.plugins.length&&void 0===t.parser&&void 0===t.stringifier&&void 0===t.syntax?new r(this,e,t):new i(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=a,a.default=a,s.registerProcessor(a),o.registerProcessor(a)},83632:(e,t,n)=>{"use strict";let r=n(11728);class i{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new r(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}}e.exports=i,i.default=i},41025:(e,t,n)=>{"use strict";let r,i,o=n(21019);class s extends o{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let i of r)i.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new r(new i,this,e).stringify()}}s.registerLazyResult=e=>{r=e},s.registerProcessor=e=>{i=e},e.exports=s,s.default=s,o.registerRoot(s)},31675:(e,t,n)=>{"use strict";let r=n(21019),i=n(54715);class o extends r{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return i.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}e.exports=o,o.default=o,r.registerRule(o)},1062:e=>{"use strict";const t={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};class n{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,i=0;for(;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,n,r){let i;if(r||(r=n),n&&(i=e.raws[n],void 0!==i))return i;let o=e.parent;if("before"===r){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return t[r];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[r])return s.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let t="raw"+((a=r)[0].toUpperCase()+a.slice(1));this[t]?i=this[t](s,e):s.walk((e=>{if(i=e.raws[n],void 0!==i)return!1}))}var a;return void 0===i&&(i=t[r]),s.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}e.exports=n,n.default=n},67088:(e,t,n)=>{"use strict";let r=n(1062);function i(e,t){new r(t).stringify(e)}e.exports=i,i.default=i},65513:e=>{"use strict";e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},83852:e=>{"use strict";const t="'".charCodeAt(0),n='"'.charCodeAt(0),r="\\".charCodeAt(0),i="/".charCodeAt(0),o="\n".charCodeAt(0),s=" ".charCodeAt(0),a="\f".charCodeAt(0),l="\t".charCodeAt(0),c="\r".charCodeAt(0),u="[".charCodeAt(0),d="]".charCodeAt(0),p="(".charCodeAt(0),h=")".charCodeAt(0),f="{".charCodeAt(0),m="}".charCodeAt(0),g=";".charCodeAt(0),b="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),w=/[\t\n\f\r "#'()/;[\\\]{}]/g,x=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,S=/.[\r\n"'(/\\]/,E=/[\da-f]/i;e.exports=function(e,T={}){let C,k,A,O,N,_,D,I,L,P,$=e.css.valueOf(),j=T.ignoreErrors,R=$.length,q=0,M=[],B=[];function F(t){throw e.error("Unclosed "+t,q)}return{back:function(e){B.push(e)},endOfFile:function(){return 0===B.length&&q>=R},nextToken:function(e){if(B.length)return B.pop();if(q>=R)return;let T=!!e&&e.ignoreUnclosed;switch(C=$.charCodeAt(q),C){case o:case s:case l:case c:case a:k=q;do{k+=1,C=$.charCodeAt(k)}while(C===s||C===o||C===l||C===c||C===a);P=["space",$.slice(q,k)],q=k-1;break;case u:case d:case f:case m:case y:case g:case h:{let e=String.fromCharCode(C);P=[e,e,q];break}case p:if(I=M.length?M.pop()[1]:"",L=$.charCodeAt(q+1),"url"===I&&L!==t&&L!==n&&L!==s&&L!==o&&L!==l&&L!==a&&L!==c){k=q;do{if(_=!1,k=$.indexOf(")",k+1),-1===k){if(j||T){k=q;break}F("bracket")}for(D=k;$.charCodeAt(D-1)===r;)D-=1,_=!_}while(_);P=["brackets",$.slice(q,k+1),q,k],q=k}else k=$.indexOf(")",q+1),O=$.slice(q,k+1),-1===k||S.test(O)?P=["(","(",q]:(P=["brackets",O,q,k],q=k);break;case t:case n:A=C===t?"'":'"',k=q;do{if(_=!1,k=$.indexOf(A,k+1),-1===k){if(j||T){k=q+1;break}F("string")}for(D=k;$.charCodeAt(D-1)===r;)D-=1,_=!_}while(_);P=["string",$.slice(q,k+1),q,k],q=k;break;case v:w.lastIndex=q+1,w.test($),k=0===w.lastIndex?$.length-1:w.lastIndex-2,P=["at-word",$.slice(q,k+1),q,k],q=k;break;case r:for(k=q,N=!0;$.charCodeAt(k+1)===r;)k+=1,N=!N;if(C=$.charCodeAt(k+1),N&&C!==i&&C!==s&&C!==o&&C!==l&&C!==c&&C!==a&&(k+=1,E.test($.charAt(k)))){for(;E.test($.charAt(k+1));)k+=1;$.charCodeAt(k+1)===s&&(k+=1)}P=["word",$.slice(q,k+1),q,k],q=k;break;default:C===i&&$.charCodeAt(q+1)===b?(k=$.indexOf("*/",q+2)+1,0===k&&(j||T?k=$.length:F("comment")),P=["comment",$.slice(q,k+1),q,k],q=k):(x.lastIndex=q+1,x.test($),k=0===x.lastIndex?$.length-1:x.lastIndex-2,P=["word",$.slice(q,k+1),q,k],M.push(P),q=k)}return q++,P},position:function(){return q}}}},72448:e=>{"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},11728:e=>{"use strict";class t{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let n in t)this[n]=t[n]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},91036:(e,t,n)=>{const r=n(23719),i=n(63150),{isPlainObject:o}=n(26057),s=n(9996),a=n(79430),{parse:l}=n(50020),c=["img","audio","video","picture","svg","object","map","iframe","embed"],u=["script","style"];function d(e,t){e&&Object.keys(e).forEach((function(n){t(e[n],n)}))}function p(e,t){return{}.hasOwnProperty.call(e,t)}function h(e,t){const n=[];return d(e,(function(e){t(e)&&n.push(e)})),n}e.exports=m;const f=/^[^\0\t\n\f\r /<=>]+$/;function m(e,t,n){if(null==e)return"";"number"==typeof e&&(e=e.toString());let b="",y="";function v(e,t){const n=this;this.tag=e,this.attribs=t||{},this.tagPosition=b.length,this.text="",this.mediaChildren=[],this.updateParentNodeText=function(){if(_.length){_[_.length-1].text+=n.text}},this.updateParentNodeMediaChildren=function(){if(_.length&&c.includes(this.tag)){_[_.length-1].mediaChildren.push(this.tag)}}}(t=Object.assign({},m.defaults,t)).parser=Object.assign({},g,t.parser);const w=function(e){return!1===t.allowedTags||(t.allowedTags||[]).indexOf(e)>-1};u.forEach((function(e){w(e)&&!t.allowVulnerableTags&&console.warn(`\n\n\u26a0\ufe0f Your \`allowedTags\` option includes, \`${e}\`, which is inherently\nvulnerable to XSS attacks. Please remove it from \`allowedTags\`.\nOr, to disable this warning, add the \`allowVulnerableTags\` option\nand ensure you are accounting for this risk.\n\n`)}));const x=t.nonTextTags||["script","style","textarea","option"];let S,E;t.allowedAttributes&&(S={},E={},d(t.allowedAttributes,(function(e,t){S[t]=[];const n=[];e.forEach((function(e){"string"==typeof e&&e.indexOf("*")>=0?n.push(i(e).replace(/\\\*/g,".*")):S[t].push(e)})),n.length&&(E[t]=new RegExp("^("+n.join("|")+")$"))})));const T={},C={},k={};d(t.allowedClasses,(function(e,t){if(S&&(p(S,t)||(S[t]=[]),S[t].push("class")),T[t]=e,Array.isArray(e)){const n=[];T[t]=[],k[t]=[],e.forEach((function(e){"string"==typeof e&&e.indexOf("*")>=0?n.push(i(e).replace(/\\\*/g,".*")):e instanceof RegExp?k[t].push(e):T[t].push(e)})),n.length&&(C[t]=new RegExp("^("+n.join("|")+")$"))}}));const A={};let O,N,_,D,I,L,P;d(t.transformTags,(function(e,t){let n;"function"==typeof e?n=e:"string"==typeof e&&(n=m.simpleTransform(e)),"*"===t?O=n:A[t]=n}));let $=!1;R();const j=new r.Parser({onopentag:function(e,n){if(t.enforceHtmlBoundary&&"html"===e&&R(),L)return void P++;const r=new v(e,n);_.push(r);let i=!1;const c=!!r.text;let u;if(p(A,e)&&(u=A[e](e,n),r.attribs=n=u.attribs,void 0!==u.text&&(r.innerText=u.text),e!==u.tagName&&(r.name=e=u.tagName,I[N]=u.tagName)),O&&(u=O(e,n),r.attribs=n=u.attribs,e!==u.tagName&&(r.name=e=u.tagName,I[N]=u.tagName)),(!w(e)||"recursiveEscape"===t.disallowedTagsMode&&!function(e){for(const t in e)if(p(e,t))return!1;return!0}(D)||null!=t.nestingLimit&&N>=t.nestingLimit)&&(i=!0,D[N]=!0,"discard"===t.disallowedTagsMode&&-1!==x.indexOf(e)&&(L=!0,P=1),D[N]=!0),N++,i){if("discard"===t.disallowedTagsMode)return;y=b,b=""}b+="<"+e,"script"===e&&(t.allowedScriptHostnames||t.allowedScriptDomains)&&(r.innerText=""),(!S||p(S,e)||S["*"])&&d(n,(function(n,i){if(!f.test(i))return void delete r.attribs[i];if(""===n&&(t.nonBooleanAttributes.includes(i)||t.nonBooleanAttributes.includes("*")))return void delete r.attribs[i];let c=!1;if(!S||p(S,e)&&-1!==S[e].indexOf(i)||S["*"]&&-1!==S["*"].indexOf(i)||p(E,e)&&E[e].test(i)||E["*"]&&E["*"].test(i))c=!0;else if(S&&S[e])for(const t of S[e])if(o(t)&&t.name&&t.name===i){c=!0;let e="";if(!0===t.multiple){const r=n.split(" ");for(const n of r)-1!==t.values.indexOf(n)&&(""===e?e=n:e+=" "+n)}else t.values.indexOf(n)>=0&&(e=n);n=e}if(c){if(-1!==t.allowedSchemesAppliedToAttributes.indexOf(i)&&M(e,n))return void delete r.attribs[i];if("script"===e&&"src"===i){let e=!0;try{const r=B(n);if(t.allowedScriptHostnames||t.allowedScriptDomains){const n=(t.allowedScriptHostnames||[]).find((function(e){return e===r.url.hostname})),i=(t.allowedScriptDomains||[]).find((function(e){return r.url.hostname===e||r.url.hostname.endsWith(`.${e}`)}));e=n||i}}catch(u){e=!1}if(!e)return void delete r.attribs[i]}if("iframe"===e&&"src"===i){let e=!0;try{const r=B(n);if(r.isRelativeUrl)e=p(t,"allowIframeRelativeUrls")?t.allowIframeRelativeUrls:!t.allowedIframeHostnames&&!t.allowedIframeDomains;else if(t.allowedIframeHostnames||t.allowedIframeDomains){const n=(t.allowedIframeHostnames||[]).find((function(e){return e===r.url.hostname})),i=(t.allowedIframeDomains||[]).find((function(e){return r.url.hostname===e||r.url.hostname.endsWith(`.${e}`)}));e=n||i}}catch(u){e=!1}if(!e)return void delete r.attribs[i]}if("srcset"===i)try{let e=a(n);if(e.forEach((function(e){M("srcset",e.url)&&(e.evil=!0)})),e=h(e,(function(e){return!e.evil})),!e.length)return void delete r.attribs[i];n=h(e,(function(e){return!e.evil})).map((function(e){if(!e.url)throw new Error("URL missing");return e.url+(e.w?` ${e.w}w`:"")+(e.h?` ${e.h}h`:"")+(e.d?` ${e.d}x`:"")})).join(", "),r.attribs[i]=n}catch(u){return void delete r.attribs[i]}if("class"===i){const t=T[e],o=T["*"],a=C[e],l=k[e],c=[a,C["*"]].concat(l).filter((function(e){return e}));if(!(n=F(n,t&&o?s(t,o):t||o,c)).length)return void delete r.attribs[i]}if("style"===i)if(t.parseStyleAttributes)try{const o=function(e,t){if(!t)return e;const n=e.nodes[0];let r;r=t[n.selector]&&t["*"]?s(t[n.selector],t["*"]):t[n.selector]||t["*"];r&&(e.nodes[0].nodes=n.nodes.reduce(function(e){return function(t,n){if(p(e,n.prop)){e[n.prop].some((function(e){return e.test(n.value)}))&&t.push(n)}return t}}(r),[]));return e}(l(e+" {"+n+"}"),t.allowedStyles);if(n=function(e){return e.nodes[0].nodes.reduce((function(e,t){return e.push(`${t.prop}:${t.value}${t.important?" !important":""}`),e}),[]).join(";")}(o),0===n.length)return void delete r.attribs[i]}catch(u){return"undefined"!=typeof window&&console.warn('Failed to parse "'+e+" {"+n+"}\", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547"),void delete r.attribs[i]}else if(t.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.");b+=" "+i,n&&n.length&&(b+='="'+q(n,!0)+'"')}else delete r.attribs[i]})),-1!==t.selfClosing.indexOf(e)?b+=" />":(b+=">",!r.innerText||c||t.textFilter||(b+=q(r.innerText),$=!0)),i&&(b=y+q(b),y="")},ontext:function(e){if(L)return;const n=_[_.length-1];let r;if(n&&(r=n.tag,e=void 0!==n.innerText?n.innerText:e),"discard"!==t.disallowedTagsMode||"script"!==r&&"style"!==r){const n=q(e,!1);t.textFilter&&!$?b+=t.textFilter(n,r):$||(b+=n)}else b+=e;if(_.length){_[_.length-1].text+=e}},onclosetag:function(e,n){if(L){if(P--,P)return;L=!1}const r=_.pop();if(!r)return;if(r.tag!==e)return void _.push(r);L=!!t.enforceHtmlBoundary&&"html"===e,N--;const i=D[N];if(i){if(delete D[N],"discard"===t.disallowedTagsMode)return void r.updateParentNodeText();y=b,b=""}I[N]&&(e=I[N],delete I[N]),t.exclusiveFilter&&t.exclusiveFilter(r)?b=b.substr(0,r.tagPosition):(r.updateParentNodeMediaChildren(),r.updateParentNodeText(),-1!==t.selfClosing.indexOf(e)||n&&!w(e)&&["escape","recursiveEscape"].indexOf(t.disallowedTagsMode)>=0?i&&(b=y,y=""):(b+="</"+e+">",i&&(b=y+q(b),y=""),$=!1))}},t.parser);return j.write(e),j.end(),b;function R(){b="",N=0,_=[],D={},I={},L=!1,P=0}function q(e,n){return"string"!=typeof e&&(e+=""),t.parser.decodeEntities&&(e=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),n&&(e=e.replace(/"/g,"""))),e=e.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(/</g,"<").replace(/>/g,">"),n&&(e=e.replace(/"/g,""")),e}function M(e,n){for(n=n.replace(/[\x00-\x20]+/g,"");;){const e=n.indexOf("\x3c!--");if(-1===e)break;const t=n.indexOf("--\x3e",e+4);if(-1===t)break;n=n.substring(0,e)+n.substring(t+3)}const r=n.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!r)return!!n.match(/^[/\\]{2}/)&&!t.allowProtocolRelative;const i=r[1].toLowerCase();return p(t.allowedSchemesByTag,e)?-1===t.allowedSchemesByTag[e].indexOf(i):!t.allowedSchemes||-1===t.allowedSchemes.indexOf(i)}function B(e){if((e=e.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//")).startsWith("relative:"))throw new Error("relative: exploit attempt");let t="relative://relative-site";for(let r=0;r<100;r++)t+=`/${r}`;const n=new URL(e,t);return{isRelativeUrl:n&&"relative-site"===n.hostname&&"relative:"===n.protocol,url:n}}function F(e,t,n){return t?(e=e.split(/\s+/)).filter((function(e){return-1!==t.indexOf(e)||n.some((function(t){return t.test(e)}))})).join(" "):e}}const g={decodeEntities:!0};m.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","main","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0},m.simpleTransform=function(e,t,n){return n=void 0===n||n,t=t||{},function(r,i){let o;if(n)for(o in t)i[o]=t[o];else i=t;return{tagName:e,attribs:i}}}},22868:()=>{},14777:()=>{},99830:()=>{},70209:()=>{},87414:()=>{},62961:e=>{e.exports={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}}}}]); \ No newline at end of file diff --git a/assets/js/common.4ce83303.js.LICENSE.txt b/assets/js/common.faa7560d.js.LICENSE.txt similarity index 100% rename from assets/js/common.4ce83303.js.LICENSE.txt rename to assets/js/common.faa7560d.js.LICENSE.txt diff --git a/assets/js/main.2aa7aeed.js b/assets/js/main.18bf920b.js similarity index 99% rename from assets/js/main.2aa7aeed.js rename to assets/js/main.18bf920b.js index 5b0ccb766..864b0e41c 100644 --- a/assets/js/main.2aa7aeed.js +++ b/assets/js/main.18bf920b.js @@ -1,2 +1,2 @@ -/*! For license information please see main.2aa7aeed.js.LICENSE.txt */ -(self.webpackChunkopenfga_dev=self.webpackChunkopenfga_dev||[]).push([[179],{34334:(e,t,n)=>{"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}n.d(t,{Z:()=>i});const i=function(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(i&&(i+=" "),i+=t);return i}},11205:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function e(t,n){var i,s;switch(n=n||{},r.util.type(t)){case"Object":if(s=r.util.objId(t),n[s])return n[s];for(var o in i={},n[s]=i,t)t.hasOwnProperty(o)&&(i[o]=e(t[o],n));return i;case"Array":return s=r.util.objId(t),n[s]?n[s]:(i=[],n[s]=i,t.forEach((function(t,r){i[r]=e(t,n)})),i);default:return t}},getLanguage:function(t){for(;t;){var n=e.exec(t.className);if(n)return n[1].toLowerCase();t=t.parentElement}return"none"},setLanguage:function(t,n){t.className=t.className.replace(RegExp(e,"gi"),""),t.classList.add("language-"+n)},isActive:function(e,t,n){for(var r="no-"+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:n,plaintext:n,text:n,txt:n,extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var i in t)n[i]=t[i];return n},insertBefore:function(e,t,n,i){var s=(i=i||r.languages)[e],o={};for(var a in s)if(s.hasOwnProperty(a)){if(a==t)for(var l in n)n.hasOwnProperty(l)&&(o[l]=n[l]);n.hasOwnProperty(a)||(o[a]=s[a])}var c=i[e];return i[e]=o,r.languages.DFS(r.languages,(function(t,n){n===c&&t!=e&&(this[t]=o)})),o},DFS:function e(t,n,i,s){s=s||{};var o=r.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],i||a);var l=t[a],c=r.util.type(l);"Object"!==c||s[o(l)]?"Array"!==c||s[o(l)]||(s[o(l)]=!0,e(l,n,a,s)):(s[o(l)]=!0,e(l,n,null,s))}}},plugins:{},highlight:function(e,t,n){var s={code:e,grammar:t,language:n};return r.hooks.run("before-tokenize",s),s.tokens=r.tokenize(s.code,s.grammar),r.hooks.run("after-tokenize",s),i.stringify(r.util.encode(s.tokens),s.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new a;return l(i,i.head,e),o(e,i,t,i.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(i)},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var i,s=0;i=n[s++];)i(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function s(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var s=i[1].length;i.index+=s,i[0]=i[0].slice(s)}return i}function o(e,t,n,a,u,d){for(var h in n)if(n.hasOwnProperty(h)&&n[h]){var p=n[h];p=Array.isArray(p)?p:[p];for(var f=0;f<p.length;++f){if(d&&d.cause==h+","+f)return;var g=p[f],m=g.inside,y=!!g.lookbehind,b=!!g.greedy,v=g.alias;if(b&&!g.pattern.global){var E=g.pattern.toString().match(/[imsuy]*$/)[0];g.pattern=RegExp(g.pattern.source,E+"g")}for(var _=g.pattern||g,T=a.next,x=u;T!==t.tail&&!(d&&x>=d.reach);x+=T.value.length,T=T.next){var w=T.value;if(t.length>e.length)return;if(!(w instanceof i)){var S,R=1;if(b){if(!(S=s(_,x,e,y))||S.index>=e.length)break;var k=S.index,C=S.index+S[0].length,O=x;for(O+=T.value.length;k>=O;)O+=(T=T.next).value.length;if(x=O-=T.value.length,T.value instanceof i)continue;for(var A=T;A!==t.tail&&(O<C||"string"==typeof A.value);A=A.next)R++,O+=A.value.length;R--,w=e.slice(x,O),S.index-=x}else if(!(S=s(_,0,w,y)))continue;k=S.index;var N=S[0],I=w.slice(0,k),L=w.slice(k+N.length),D=x+w.length;d&&D>d.reach&&(d.reach=D);var P=T.prev;if(I&&(P=l(t,P,I),x+=I.length),c(t,P,R),T=l(t,P,new i(h,m?r.tokenize(N,m):N,v,N)),L&&l(t,T,L),R>1){var M={cause:h+","+f,reach:D};o(e,t,n,T.prev,x,M),d&&M.reach>d.reach&&(d.reach=M.reach)}}}}}}function a(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function c(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}return i.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var i="";return t.forEach((function(t){i+=e(t,n)})),i}var s={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(s.classes,o):s.classes.push(o)),r.hooks.run("wrap",s);var a="";for(var l in s.attributes)a+=" "+l+'="'+(s.attributes[l]||"").replace(/"/g,""")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'"'+a+">"+s.content+"</"+s.tag+">"},r}(),i=r;r.default=r,i.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},i.languages.markup.tag.inside["attr-value"].inside.entity=i.languages.markup.entity,i.languages.markup.doctype.inside["internal-subset"].inside=i.languages.markup,i.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(i.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:i.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:i.languages[t]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},i.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(i.languages.markup.tag,"addAttribute",{value:function(e,t){i.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:i.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.xml=i.languages.extend("markup",{}),i.languages.ssml=i.languages.xml,i.languages.atom=i.languages.xml,i.languages.rss=i.languages.xml,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],s=r.variable[1].inside,o=0;o<i.length;o++)s[i[o]]=e.languages.bash[i[o]];e.languages.shell=e.languages.bash}(i),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},i.languages.c=i.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),i.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),i.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},i.languages.c.string],char:i.languages.c.char,comment:i.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:i.languages.c}}}}),i.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete i.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(i),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(i),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},i={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:i,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:i})}(i),i.languages.javascript=i.languages.extend("clike",{"class-name":[i.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),i.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,i.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:i.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:i.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:i.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:i.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:i.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),i.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),i.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),i.languages.markup&&(i.languages.markup.tag.addInlined("script","javascript"),i.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),i.languages.js=i.languages.javascript,function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(i),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),s=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<value>>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<key>>/g,(function(){return"(?:"+i+"|"+s+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(s),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(i),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var i=t[n];if("code"===i.type){var s=i.content[1],o=i.content[3];if(s&&o&&"code-language"===s.type&&"code-block"===o.type&&"string"==typeof s.content){var a=s.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase());o.alias?"string"==typeof o.alias?o.alias=[o.alias,l]:o.alias.push(l):o.alias=[l]}}else e(i.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,i=t.classes.length;r<i;r++){var s=t.classes[r],c=/language-(.+)/.exec(s);if(c){n=c[1];break}}var u,d=e.languages[n];if(d)t.content=e.highlight((u=t.content,u.replace(o,"").replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n);var r=a[t];return r||e}))),d,n);else if(n&&"none"!==n&&e.plugins.autoloader){var h="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=h,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(h);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var o=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(i),i.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:i.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},i.hooks.add("after-tokenize",(function(e){if("graphql"===e.language)for(var t=e.tokens.filter((function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type})),n=0;n<t.length;){var r=t[n++];if("keyword"===r.type&&"mutation"===r.content){var i=[];if(d(["definition-mutation","punctuation"])&&"("===u(1).content){n+=2;var s=h(/^\($/,/^\)$/);if(-1===s)continue;for(;n<s;n++){var o=u(0);"variable"===o.type&&(p(o,"variable-input"),i.push(o.content))}n=s+1}if(d(["punctuation","property-query"])&&"{"===u(0).content&&(n++,p(u(0),"property-mutation"),i.length>0)){var a=h(/^\{$/,/^\}$/);if(-1===a)continue;for(var l=n;l<a;l++){var c=t[l];"variable"===c.type&&i.indexOf(c.content)>=0&&p(c,"variable-input")}}}}function u(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n<e.length;n++){var r=u(n+t);if(!r||r.type!==e[n])return!1}return!0}function h(e,r){for(var i=1,s=n;s<t.length;s++){var o=t[s],a=o.content;if("punctuation"===o.type&&"string"==typeof a)if(e.test(a))i++;else if(r.test(a)&&0===--i)return s}return-1}function p(e,t){var n=e.alias;n?Array.isArray(n)||(e.alias=n=[n]):e.alias=n=[],n.push(t)}})),i.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,i=r.inside["interpolation-punctuation"],s=r.pattern.source;function o(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function a(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function l(t,n,r){var i={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",i),i.tokens=e.tokenize(i.code,i.grammar),e.hooks.run("after-tokenize",i),i.tokens}function c(t){var n={};n["interpolation-punctuation"]=i;var s=e.tokenize(t,n);if(3===s.length){var o=[1,1];o.push.apply(o,l(s[1],e.languages.javascript,"javascript")),s.splice.apply(s,o)}return new e.Token("interpolation",s,r.alias,t)}function u(t,n,r){var i=e.tokenize(t,{interpolation:{pattern:RegExp(s),lookbehind:!0}}),o=0,u={},d=l(i.map((function(e){if("string"==typeof e)return e;for(var n,i=e.content;-1!==t.indexOf(n=a(o++,r)););return u[n]=i,n})).join(""),n,r),h=Object.keys(u);return o=0,function e(t){for(var n=0;n<t.length;n++){if(o>=h.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var i=h[o],s="string"==typeof r?r:r.content,a=s.indexOf(i);if(-1!==a){++o;var l=s.substring(0,a),d=c(u[i]),p=s.substring(a+i.length),f=[];if(l&&f.push(l),f.push(d),p){var g=[p];e(g),f.push.apply(f,g)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(f)),n+=f.length-1):r.content=f}}else{var m=r.content;Array.isArray(m)?e(m):e([m])}}}(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[o("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),o("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),o("svg",/\bsvg/.source),o("markdown",/\b(?:markdown|md)/.source),o("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),o("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function h(e){return"string"==typeof e?e:Array.isArray(e)?e.map(h).join(""):h(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,i=n.length;r<i;r++){var s=n[r];if("string"!=typeof s){var o=s.content;if(Array.isArray(o))if("template-string"===s.type){var a=o[1];if(3===o.length&&"string"!=typeof a&&"embedded-code"===a.type){var l=h(a),c=a.alias,d=Array.isArray(c)?c[0]:c,p=e.languages[d];if(!p)continue;o[1]=u(l,p,d)}}else t(o);else"string"!=typeof o&&t([o])}}}(t.tokens)}))}(i),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(i),function(e){function t(e,t){return RegExp(e.replace(/<ID>/g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var i=n[r],s=e.languages.javascript[i];"RegExp"===e.util.type(s)&&(s=e.languages.javascript[i]={pattern:s});var o=s.inside||{};s.inside=o,o["maybe-class-name"]=/^[A-Z][\s\S]*/}}(i),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function s(e,t){return e=e.replace(/<S>/g,(function(){return n})).replace(/<BRACES>/g,(function(){return r})).replace(/<SPREAD>/g,(function(){return i})),RegExp(e,t)}i=s(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=s(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:s(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:s(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(o).join(""):""},a=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],s=!1;if("string"!=typeof i&&("tag"===i.type&&i.content[0]&&"tag"===i.content[0].type?"</"===i.content[0].content[0].content?n.length>0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():"/>"===i.content[i.content.length-1].content||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===i.type&&"{"===i.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===i.type&&"}"===i.content?n[n.length-1].openedBraces--:s=!0),(s||"string"==typeof i)&&n.length>0&&0===n[n.length-1].openedBraces){var l=o(i);r<t.length-1&&("string"==typeof t[r+1]||"plain-text"===t[r+1].type)&&(l+=o(t[r+1]),t.splice(r+1,1)),r>0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(l=o(t[r-1])+l,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",l,null,l)}i.content&&"string"!=typeof i.content&&a(i.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||a(e.tokens)}))}(i),function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(i),i.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},i.languages.go=i.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),i.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete i.languages.go["class-name"],function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,i,s){if(n.language===r){var o=n.tokenStack=[];n.code=n.code.replace(i,(function(e){if("function"==typeof s&&!s(e))return e;for(var i,a=o.length;-1!==n.code.indexOf(i=t(r,a));)++a;return o[a]=e,i})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var i=0,s=Object.keys(n.tokenStack);!function o(a){for(var l=0;l<a.length&&!(i>=s.length);l++){var c=a[l];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=s[i],d=n.tokenStack[u],h="string"==typeof c?c:c.content,p=t(r,u),f=h.indexOf(p);if(f>-1){++i;var g=h.substring(0,f),m=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=h.substring(f+p.length),b=[];g&&b.push.apply(b,o([g])),b.push(m),y&&b.push.apply(b,o([y])),"string"==typeof c?a.splice.apply(a,[l,1].concat(b)):c.content=b}}else c.content&&o(c.content)}return a}(n.tokens)}}}})}(i),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")})),e.languages.hbs=e.languages.handlebars}(i),i.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},i.languages.webmanifest=i.languages.json,i.languages.less=i.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),i.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),i.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},i.languages.objectivec=i.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete i.languages.objectivec["class-name"],i.languages.objc=i.languages.objectivec,i.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/},i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},i.languages.python["string-interpolation"].inside.interpolation.inside.rest=i.languages.python,i.languages.py=i.languages.python,i.languages.reason=i.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),i.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete i.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(i),i.languages.scss=i.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),i.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),i.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),i.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),i.languages.scss.atrule.inside.rest=i.languages.scss,function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(i),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(i),i.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/};const s=i},87459:(e,t,n)=>{"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}n.d(t,{Z:()=>i});const i=function(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(i&&(i+=" "),i+=t);return i}},1728:(e,t,n)=>{"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}n.d(t,{Z:()=>i});const i=function(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(i&&(i+=" "),i+=t);return i}},80040:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_SCHEMA_VERSION=void 0;const r=n(42105);t.DEFAULT_SCHEMA_VERSION=r.SchemaVersion.OneDotOne},14533:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_SCHEMA_VERSION=t.LANGUAGE_NAME=t.enums=void 0;const r=n(94660),i=n(42105),s=n(74654);Object.defineProperty(t,"LANGUAGE_NAME",{enumerable:!0,get:function(){return s.LANGUAGE_NAME}});const o=n(80040);Object.defineProperty(t,"DEFAULT_SCHEMA_VERSION",{enumerable:!0,get:function(){return o.DEFAULT_SCHEMA_VERSION}}),t.enums={Keyword:r.Keyword,SchemaVersion:i.SchemaVersion};const a={LANGUAGE_NAME:s.LANGUAGE_NAME,DEFAULT_SCHEMA_VERSION:o.DEFAULT_SCHEMA_VERSION,enums:t.enums};t.default=a},94660:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.ReservedKeywords=t.Keyword=void 0,function(e){e.TYPE="type",e.RELATIONS="relations",e.SELF="self",e.DEFINE="define",e.AS="as",e.OR="or",e.AND="and",e.FROM="from",e.WITH="with",e.BUT_NOT="but not",e.MODEL="model",e.SCHEMA="schema",e.CONDITION="condition"}(n||(t.Keyword=n={})),function(e){e.THIS="this"}(r||(t.ReservedKeywords=r={}))},74654:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LANGUAGE_NAME=void 0,t.LANGUAGE_NAME="dsl.openfga"},42105:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SchemaVersion=void 0,function(e){e.OneDotZero="1.0",e.OneDotOne="1.1"}(n||(t.SchemaVersion=n={}))},45663:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SINGLE_INDENTATION=void 0,t.SINGLE_INDENTATION=" "},33696:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultDocumentationMap=void 0;const i=r(n(73247));function s(e){return i.default.literalNames[e].replace(/'/g,"")}t.defaultDocumentationMap={[s(i.default.TYPE)]:{summary:"A type or grouping of objects that have similar characteristics. For example:\n- workspace\n- repository\n- organization\n- document",link:"https://openfga.dev/docs/concepts#what-is-a-type"},[s(i.default.RELATIONS)]:{summary:"A **relation** defines the possible relationship between an [object](https://openfga.dev/docs/concepts#what-is-an-object) and a [user](https://openfga.dev/docs/concepts#what-is-a-user).",link:"https://openfga.dev/docs/concepts#what-is-a-relation"},[s(i.default.AND)]:{summary:"The intersection operator used to indicate that a relationship exists if the user is in all the sets of users.",link:"https://openfga.dev/docs/configuration-language#the-intersection-operator"},[s(i.default.OR)]:{summary:"The union operator is used to indicate that a relationship exists if the user is in any of the sets of users",link:"https://openfga.dev/docs/configuration-language#the-union-operator"},[s(i.default.BUT_NOT)]:{summary:"The exclusion operator is used to indicate that a relationship exists if the user is in the base userset, but not in the excluded userset.",link:"https://openfga.dev/docs/configuration-language#the-exclusion-operator"},[s(i.default.FROM)]:{summary:"Allows referencing relations on related objects.",link:"https://openfga.dev/docs/configuration-language#referencing-relations-on-related-objects"},[s(i.default.SCHEMA)]:{summary:"Defines the schema version to be used, with currently only support for '1.1'. Note that the 1.0 schema is deprecated.",link:"https://openfga.dev/docs/modeling/migrating/migrating-schema-1-1"}}},44096:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.validator=t.constants=t.sampleAuthorizationModels=t.graphBuilder=t.tools=t.theming=void 0;const a=o(n(14533));t.constants=a.default;const l=o(n(40478));t.validator=l.default,t.theming=s(n(35442)),t.tools=s(n(34936)),t.graphBuilder=s(n(27253));const c=o(n(78002));t.sampleAuthorizationModels=c.default},62524:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertNever=void 0,t.assertNever=function(e){throw new Error(`Assertion failed. Unexpected value: '${e}'`)}},78002:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const o={entitlements:Promise.resolve().then((()=>s(n(98633)))),expenses:Promise.resolve().then((()=>s(n(98547)))),gdrive:Promise.resolve().then((()=>s(n(94014)))),generic:Promise.resolve().then((()=>s(n(56918)))),github:Promise.resolve().then((()=>s(n(84001)))),iot:Promise.resolve().then((()=>s(n(96418)))),slack:Promise.resolve().then((()=>s(n(63542)))),customRoles:Promise.resolve().then((()=>s(n(57904))))};t.default=o},35442:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportedThemes=t.languageDefinition=t.OpenFgaDslThemeTokenType=t.OpenFgaDslThemeToken=t.SupportedTheme=void 0;const r=n(38793),i=n(82428);var s=n(82428);Object.defineProperty(t,"SupportedTheme",{enumerable:!0,get:function(){return s.SupportedTheme}}),Object.defineProperty(t,"OpenFgaDslThemeToken",{enumerable:!0,get:function(){return s.OpenFgaDslThemeToken}}),Object.defineProperty(t,"OpenFgaDslThemeTokenType",{enumerable:!0,get:function(){return s.OpenFgaDslThemeTokenType}});var o=n(24416);Object.defineProperty(t,"languageDefinition",{enumerable:!0,get:function(){return o.languageDefinition}}),t.supportedThemes={[i.SupportedTheme.OpenFgaDark]:r.openfgaDark}},38793:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openfgaDark=void 0;const r=n(82428);t.openfgaDark={name:"openfga-dark",baseTheme:"vs-dark",background:{color:"#141517"},colors:{[r.OpenFgaDslThemeTokenType.DEFAULT]:"#FFFFFF",[r.OpenFgaDslThemeTokenType.COMMENT]:"#737981",[r.OpenFgaDslThemeTokenType.KEYWORD]:"#AAAAAA",[r.OpenFgaDslThemeTokenType.TYPE]:"#79ED83",[r.OpenFgaDslThemeTokenType.RELATION]:"#20F1F5",[r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE]:"#CEEC93"},styles:{}}},82428:(e,t)=>{"use strict";var n,r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.SupportedTheme=t.OpenFgaDslThemeToken=t.OpenFgaDslThemeTokenType=void 0,function(e){e.DEFAULT="default",e.COMMENT="comment",e.KEYWORD="keyword",e.TYPE="type",e.RELATION="relation",e.DIRECTLY_ASSIGNABLE="directly-assignable"}(n||(t.OpenFgaDslThemeTokenType=n={})),function(e){e.COMMENT="comment",e.DELIMITER_BRACKET_RELATION_DEFINITION="delimiter.bracket.relation-definition",e.DELIMITER_BRACKET_TYPE_RESTRICTIONS="delimiter.bracket.type-restrictions",e.DELIMITER_BRACKET_CONDITION_EXPRESSION="delimiter.bracket.condition-expression",e.DELIMITER_COLON_TYPE_RESTRICTIONS="delimiter.colon.type-restrictions",e.DELIMITER_COMMA_TYPE_RESTRICTIONS="delimiter.comma.type-restrictions",e.DELIMITER_DEFINE_COLON="delimiter.colon.define",e.DELIMITER_HASHTAG_TYPE_RESTRICTIONS="delimiter.hashtag.type-restrictions",e.KEYWORD_AS="keyword.as",e.KEYWORD_DEFINE="keyword.define",e.KEYWORD_FROM="keyword.from",e.KEYWORD_MODEL="keyword.model",e.KEYWORD_RELATIONS="keyword.relations",e.KEYWORD_SCHEMA="keyword.schema",e.KEYWORD_SELF="keyword.self",e.KEYWORD_TYPE="keyword.type",e.KEYWORD_CONDITION="keyword.condition",e.KEYWORD_WITH="keyword.with",e.OPERATOR_AND="keyword.operator.word.intersection",e.OPERATOR_BUT_NOT="keyword.operator.word.exclusion",e.OPERATOR_OR="keyword.operator.word.union",e.VALUE_CONDITION="entity.name.function.condition",e.VALUE_RELATION_COMPUTED="computed.relation.value",e.VALUE_RELATION_NAME="entity.name.function.member.relation.name",e.VALUE_RELATION_TUPLE_TO_USERSET_COMPUTED="computed.tupletouserset.relation.value",e.VALUE_RELATION_TUPLE_TO_USERSET_TUPLESET="tupleset.tupletouserset.relation.value",e.VALUE_SCHEMA="schema.value",e.VALUE_TYPE_NAME="support.class.type.name.value",e.VALUE_TYPE_RESTRICTIONS_RELATION="variable.parameter.type-restrictions.relation.value",e.VALUE_TYPE_RESTRICTIONS_TYPE="variable.parameter.type-restrictions.type.value",e.VALUE_TYPE_RESTRICTIONS_WILDCARD="variable.parameter.type-restrictions.wildcard.value",e.CONDITION_PARAM="variable.parameter.name.condition",e.CONDITION_PARAM_TYPE="variable.parameter.type.condition"}(r||(t.OpenFgaDslThemeToken=r={})),function(e){e.OpenFgaDark="openfga-dark"}(i||(t.SupportedTheme=i={}))},72984:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getThemeTokenStyle=void 0;const r=n(82428),i={[r.OpenFgaDslThemeToken.COMMENT]:r.OpenFgaDslThemeTokenType.COMMENT,[r.OpenFgaDslThemeToken.DELIMITER_BRACKET_RELATION_DEFINITION]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.DELIMITER_BRACKET_TYPE_RESTRICTIONS]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.DELIMITER_BRACKET_CONDITION_EXPRESSION]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.DELIMITER_COLON_TYPE_RESTRICTIONS]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.DELIMITER_COMMA_TYPE_RESTRICTIONS]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.DELIMITER_DEFINE_COLON]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.DELIMITER_HASHTAG_TYPE_RESTRICTIONS]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.KEYWORD_AS]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_DEFINE]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_FROM]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_MODEL]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_RELATIONS]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_SCHEMA]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_SELF]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.KEYWORD_TYPE]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.OPERATOR_AND]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.OPERATOR_BUT_NOT]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.OPERATOR_OR]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_CONDITION]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_WITH]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.VALUE_CONDITION]:r.OpenFgaDslThemeTokenType.TYPE,[r.OpenFgaDslThemeToken.VALUE_RELATION_COMPUTED]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.VALUE_RELATION_NAME]:r.OpenFgaDslThemeTokenType.RELATION,[r.OpenFgaDslThemeToken.VALUE_RELATION_TUPLE_TO_USERSET_COMPUTED]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.VALUE_RELATION_TUPLE_TO_USERSET_TUPLESET]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.VALUE_SCHEMA]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.VALUE_TYPE_NAME]:r.OpenFgaDslThemeTokenType.TYPE,[r.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_RELATION]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_TYPE]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_WILDCARD]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.CONDITION_PARAM]:r.OpenFgaDslThemeTokenType.RELATION,[r.OpenFgaDslThemeToken.CONDITION_PARAM_TYPE]:r.OpenFgaDslThemeTokenType.DEFAULT};t.getThemeTokenStyle=function(e,t){var n,s,o;return{foreground:(null===(n=t.rawColorOverrides)||void 0===n?void 0:n[e])||t.colors[i[e||r.OpenFgaDslThemeTokenType.DEFAULT]],fontStyle:(null===(s=t.rawStylesOverrides)||void 0===s?void 0:s[e])||(null===(o=t.styles)||void 0===o?void 0:o[i[e||r.OpenFgaDslThemeTokenType.DEFAULT]])}}},34936:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrismExtensions=t.MonacoExtensions=void 0;var r=n(70843);Object.defineProperty(t,"MonacoExtensions",{enumerable:!0,get:function(){return r.MonacoExtensions}});var i=n(96467);Object.defineProperty(t,"PrismExtensions",{enumerable:!0,get:function(){return i.PrismExtensions}})},70843:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.MonacoExtensions=void 0;const o=n(14533),a=s(n(97135)),l=n(32009),c=n(49857),u=n(94962);t.MonacoExtensions={LANGUAGE_NAME:o.LANGUAGE_NAME,registerDSL:l.registerDSL,monacoThemes:c.monacoThemes,validateDSL:u.validateDSL,languageDefinition:a,buildMonacoTheme:c.buildMonacoTheme}},97135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.getLanguageConfiguration=void 0;const r=n(94660),i=n(14533),s=n(35442);t.getLanguageConfiguration=function(e){return{comments:{lineComment:"#"},brackets:[["[","]"],["(",")"],["{","}"]],autoClosingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:"{",close:"}"}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"}],onEnterRules:[{beforeText:new RegExp("^\\s*(?:type|relations|model|define).*?:\\s*$"),action:{indentAction:e.languages.IndentAction.Indent}}],folding:{offSide:!0,markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}}},t.language={defaultToken:"",tokenPostfix:`.${i.LANGUAGE_NAME}`,keywords:[],operators:[],identifiers:new RegExp(/(?!self)(?:\w|-[a-zA-Z])*/),brackets:[{open:"[",close:"]",token:s.OpenFgaDslThemeToken.DELIMITER_BRACKET_TYPE_RESTRICTIONS},{open:"(",close:")",token:s.OpenFgaDslThemeToken.DELIMITER_BRACKET_RELATION_DEFINITION},{open:"{",close:"}",token:s.OpenFgaDslThemeToken.DELIMITER_BRACKET_CONDITION_EXPRESSION}],tokenizer:{root:[{include:"@whitespace"},[new RegExp(/^(\s*#).*/),s.OpenFgaDslThemeToken.COMMENT],[new RegExp(/(\[)(\s*)(@identifiers)(\s*)(\])/),["@brackets","@whitespace",s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_TYPE,"@whitespace","@brackets"]],[new RegExp(/(,)(\s*)(@identifiers)(\s*)(\])/),[s.OpenFgaDslThemeToken.DELIMITER_COMMA_TYPE_RESTRICTIONS,"@whitespace",s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_TYPE,"@whitespace","@brackets"]],[new RegExp(/(\[)(\s*)(@identifiers)(\s*)(,)/),["@brackets","@whitespace",s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_TYPE,"@whitespace",s.OpenFgaDslThemeToken.DELIMITER_COMMA_TYPE_RESTRICTIONS]],[new RegExp(/[{}[\]()]/),"@brackets"],[new RegExp(/(schema)(\s+)(\d\.\d)/),[s.OpenFgaDslThemeToken.KEYWORD_SCHEMA,"@whitespace",s.OpenFgaDslThemeToken.VALUE_SCHEMA]],[new RegExp(/(type)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.KEYWORD_TYPE,"@whitespace",s.OpenFgaDslThemeToken.VALUE_TYPE_NAME]],[new RegExp(/(define)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.KEYWORD_DEFINE,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_NAME]],[new RegExp(/(or)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.OPERATOR_OR,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_COMPUTED]],[new RegExp(/(and)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.OPERATOR_AND,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_COMPUTED]],[new RegExp(/(but not)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.OPERATOR_BUT_NOT,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_COMPUTED]],[new RegExp(/(\s+)(with)(\s+)/),["@whitespace",s.OpenFgaDslThemeToken.KEYWORD_WITH,"@whitespace"]],[new RegExp(/(as)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.KEYWORD_AS,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_COMPUTED]],[new RegExp(/(:)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.DELIMITER_DEFINE_COLON,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_COMPUTED]],[new RegExp(/(@identifiers)(:)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.CONDITION_PARAM,s.OpenFgaDslThemeToken.DELIMITER_DEFINE_COLON,"@whitespace",s.OpenFgaDslThemeToken.CONDITION_PARAM_TYPE]],[new RegExp(/(condition)(\s)(@identifiers)(\()/),[s.OpenFgaDslThemeToken.KEYWORD_CONDITION,"@whitespace",s.OpenFgaDslThemeToken.VALUE_CONDITION,"@brackets"]],[new RegExp(/(@identifiers)(\s+)(from)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.VALUE_RELATION_TUPLE_TO_USERSET_COMPUTED,"@whitespace",s.OpenFgaDslThemeToken.KEYWORD_FROM,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_TUPLE_TO_USERSET_TUPLESET]],[new RegExp(/(@identifiers)(#)(@identifiers)/),[s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_TYPE,s.OpenFgaDslThemeToken.DELIMITER_HASHTAG_TYPE_RESTRICTIONS,s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_RELATION]],[new RegExp(/(@identifiers)(:)(\*)/),[s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_TYPE,s.OpenFgaDslThemeToken.DELIMITER_COLON_TYPE_RESTRICTIONS,s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_WILDCARD]],[":",s.OpenFgaDslThemeToken.DELIMITER_DEFINE_COLON],[",",s.OpenFgaDslThemeToken.DELIMITER_COMMA_TYPE_RESTRICTIONS],[r.Keyword.BUT_NOT,s.OpenFgaDslThemeToken.OPERATOR_BUT_NOT],[r.Keyword.SELF,s.OpenFgaDslThemeToken.KEYWORD_SELF],[new RegExp(/@identifiers/),{cases:{[r.Keyword.AND]:s.OpenFgaDslThemeToken.OPERATOR_AND,[r.Keyword.OR]:s.OpenFgaDslThemeToken.OPERATOR_OR,[r.Keyword.TYPE]:s.OpenFgaDslThemeToken.KEYWORD_TYPE,[r.Keyword.RELATIONS]:s.OpenFgaDslThemeToken.KEYWORD_RELATIONS,[r.Keyword.DEFINE]:s.OpenFgaDslThemeToken.KEYWORD_DEFINE,[r.Keyword.FROM]:s.OpenFgaDslThemeToken.KEYWORD_FROM,[r.Keyword.WITH]:s.OpenFgaDslThemeToken.KEYWORD_WITH,[r.Keyword.CONDITION]:s.OpenFgaDslThemeToken.KEYWORD_CONDITION,[r.Keyword.AS]:s.OpenFgaDslThemeToken.KEYWORD_AS,[r.Keyword.MODEL]:s.OpenFgaDslThemeToken.KEYWORD_MODEL,[r.Keyword.SCHEMA]:{token:s.OpenFgaDslThemeToken.KEYWORD_SCHEMA},"@default":s.OpenFgaDslThemeToken.VALUE_RELATION_TUPLE_TO_USERSET_TUPLESET}}]],whitespace:[[new RegExp(/\s+/),"white"],[new RegExp(/(^(\s+#).*$)/),s.OpenFgaDslThemeToken.COMMENT]]}}},79428:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.provideCodeActions=void 0;const r=n(40801),i=n(94660),s=n(42105),o=n(45663),a={[r.errors.ValidationError.MissingDefinition]:{[s.SchemaVersion.OneDotZero]:({model:e,marker:t,relation:n})=>{const r=e.getLineContent(t.startLineNumber);return{startColumn:0,title:`Fix: add definition for \`${n}\`.`,text:`${o.SINGLE_INDENTATION}${o.SINGLE_INDENTATION}${i.Keyword.DEFINE} ${n} ${i.Keyword.AS} ${i.Keyword.SELF}\n${r}`}},[s.SchemaVersion.OneDotOne]:({model:e,marker:t,relation:n})=>{const r=e.getLineContent(t.startLineNumber);return{startColumn:0,title:`Fix: add definition for \`${n}\`.`,text:`${o.SINGLE_INDENTATION}${o.SINGLE_INDENTATION}${i.Keyword.DEFINE} ${n}: [typeName]\n${r}`}}},[r.errors.ValidationError.SelfError]:{[s.SchemaVersion.OneDotZero]:({text:e})=>({title:`Fix: replace \`${e}\` by \`self\`.`,text:i.Keyword.SELF}),[s.SchemaVersion.OneDotOne]:({text:e})=>({title:`Fix: replace \`${e}\` with type restrictions.`,text:"[typeName]"})},[r.errors.ValidationError.DuplicatedError]:{[s.SchemaVersion.OneDotZero]:({model:e,marker:t,markerRange:n,text:r})=>({startLineNumber:n.startLineNumber-1,startColumn:e.getLineContent(t.startLineNumber-1).length+1,title:`Fix: remove duplicated \`${r}\`.`,text:""}),[s.SchemaVersion.OneDotOne]:({model:e,marker:t,markerRange:n,text:r})=>({startLineNumber:n.startLineNumber-1,startColumn:e.getLineContent(t.startLineNumber-1).length+1,title:`Fix: remove duplicated \`${r}\`.`,text:""})}};t.provideCodeActions=(e,t)=>(n,r,i)=>{const s=[];return i.markers.map((r=>{const i=n.getOffsetAt({column:r.startColumn,lineNumber:r.startLineNumber}),o=n.getOffsetAt({column:r.endColumn,lineNumber:r.endLineNumber}),l=n.getValue().substr(i,o-i),c=function({markerRange:e,model:t,marker:n,text:r,schemaVersion:i}){var s,o;const{error:l,relation:c}=n.extraInformation||{},u=null===(o=null===(s=a[l])||void 0===s?void 0:s[i])||void 0===o?void 0:o.call(s,{model:t,marker:n,markerRange:e,text:r,relation:c});if(u)return{title:null==u?void 0:u.title,diagnostics:[n],edit:{edits:[{textEdit:{range:e,text:u.text},resource:t.uri,versionId:void 0}]},kind:"quickfix"}}({markerRange:new e.Range(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn),model:n,marker:r,text:l,schemaVersion:t});c&&s.push(c)})).filter((e=>e)),{actions:s,dispose(){}}}},61702:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.provideCompletionItems=void 0;const r=n(40801),i=n(94660),s=n(45663),o=n(62524),a=n(42105);const l=(e,t={})=>(n,o)=>{let l=[];const c=n.getWordUntilPosition(o),u={startLineNumber:o.lineNumber,endLineNumber:o.lineNumber,startColumn:c.startColumn,endColumn:c.endColumn};return l=2===o.column?[{label:i.Keyword.TYPE,kind:e.languages.CompletionItemKind.Function,insertText:`${i.Keyword.TYPE} \${1:typeName}\n${s.SINGLE_INDENTATION}${i.Keyword.RELATIONS}\n${s.SINGLE_INDENTATION}${s.SINGLE_INDENTATION}${i.Keyword.DEFINE} \${2:relationName}: [\${3:typeName}]`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:"type_group",kind:e.languages.CompletionItemKind.Function,insertText:`${i.Keyword.TYPE} \${1:group}\n${s.SINGLE_INDENTATION}${i.Keyword.RELATIONS}\n${s.SINGLE_INDENTATION}${s.SINGLE_INDENTATION}${i.Keyword.DEFINE} \${2:member}: [\${3:user, group#member}]`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:i.Keyword.TYPE,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.TYPE,range:u},{label:i.Keyword.MODEL,kind:e.languages.CompletionItemKind.Function,insertText:`${i.Keyword.MODEL}\n${s.SINGLE_INDENTATION}${i.Keyword.SCHEMA} \${1:1.1}`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:i.Keyword.MODEL,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.TYPE,range:u},{label:i.Keyword.CONDITION,kind:e.languages.CompletionItemKind.Function,insertText:`${i.Keyword.CONDITION} \${1:conditionName}(\${2:parameterName}: \${3:string}) {\n \${4}\n}`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u}]:4===o.column?[{label:i.Keyword.RELATIONS,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.RELATIONS,range:u}]:o.column>6?[{label:i.Keyword.OR,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.OR,range:u},{label:i.Keyword.AND,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.AND,range:u},{label:i.Keyword.BUT_NOT,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.BUT_NOT,range:u},{label:i.Keyword.FROM,kind:e.languages.CompletionItemKind.Function,insertText:`\${1:relation1} ${i.Keyword.FROM} \${1:relation2}`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:i.Keyword.FROM,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.FROM,range:u},{label:i.Keyword.CONDITION,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.CONDITION,range:u}]:6===o.column?[{label:"define-assignable",kind:e.languages.CompletionItemKind.Function,insertText:"define ${1:relationName}: [${2:typeName}]",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:"define-from-other-relation",kind:e.languages.CompletionItemKind.Function,insertText:"define ${1:relationName}: ${2:otherRelationName}",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:"define-from-other-relation-assignable",kind:e.languages.CompletionItemKind.Function,insertText:"define ${1:relationName}: [${2:typeName}] or ${3:otherRelationName}",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:"define-from-object",kind:e.languages.CompletionItemKind.Function,insertText:"define ${1:relationName}: ${2:relationInRelatedObject} from ${3:relationInThisType}}",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:"define",kind:e.languages.CompletionItemKind.Keyword,insertText:"define",range:u}]:function(e,t,n,i={}){const s=[];return["entitlements","expenses","gdrive","generic","github","iot","slack","customRoles"].forEach((o=>{const l=null==i?void 0:i[o];l&&s.push({label:`sample-${o}`,kind:e.languages.CompletionItemKind.Struct,insertText:r.transformer.transformJSONToDSL(n===a.SchemaVersion.OneDotOne?l:{schema_version:a.SchemaVersion.OneDotZero,type_definitions:l.type_definitions.map((e=>({type:e.type,relations:e.relations})))}),range:t})})),s}(e,u,a.SchemaVersion.OneDotOne,t.samples),{suggestions:l}};t.provideCompletionItems=(e,t=a.SchemaVersion.OneDotZero,n={})=>(r,i)=>{switch(t){case a.SchemaVersion.OneDotOne:return l(e,n)(r,i);case a.SchemaVersion.OneDotZero:throw new Error("unsupported schema version");default:(0,o.assertNever)(t)}}},83854:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.providerHover=void 0;const r=n(33696);t.providerHover=(e,t=r.defaultDocumentationMap)=>(n,r)=>{const i=n.getWordAtPosition(r);if(!i)return;const{startColumn:s,endColumn:o,word:a}=i,l=function(e,t){const n=t[e];if(!n)return;const{link:r,summary:i}=n,s=[{value:"**Documentation**"},{value:i}];return r&&s.push({value:`[Learn more](${r})`}),s}(a,t);return l?{range:new e.Range(r.lineNumber,s,r.lineNumber,o),contents:l}:void 0}},32009:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerDSL=void 0;const r=n(14533),i=n(42105),s=n(97135),o=n(83854),a=n(61702),l=n(79428);t.registerDSL=(e,t=i.SchemaVersion.OneDotZero,n)=>{!!e.languages.getLanguages().find((e=>e.id===r.LANGUAGE_NAME))||(e.languages.register({id:r.LANGUAGE_NAME}),e.languages.setLanguageConfiguration(r.LANGUAGE_NAME,(0,s.getLanguageConfiguration)(e)),e.languages.setMonarchTokensProvider(r.LANGUAGE_NAME,s.language),e.languages.registerHoverProvider(r.LANGUAGE_NAME,{provideHover:(0,o.providerHover)(e,n.documentationMap)}),e.languages.registerCompletionItemProvider(r.LANGUAGE_NAME,{provideCompletionItems:(0,a.provideCompletionItems)(e,t)}),e.languages.registerCodeActionProvider(r.LANGUAGE_NAME,{provideCodeActions:(0,l.provideCodeActions)(e,t)}))}},49857:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildMonacoTheme=t.monacoThemes=void 0;const r=n(14533),i=n(35442),s=n(72984);function o(e){return{base:e.baseTheme||"vs",inherit:!0,colors:{"editor.background":e.background.color},rules:Object.values(i.OpenFgaDslThemeToken).map((t=>{const n=(0,s.getThemeTokenStyle)(t,e);return Object.assign({token:`${t}.${r.LANGUAGE_NAME}`},n)}))}}t.buildMonacoTheme=o;const a={};t.monacoThemes=a,Object.values(i.SupportedTheme).forEach((e=>{a[e]=o(i.supportedThemes[e])}))},94962:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateDSL=void 0;const r=n(80104),i=n(40801);t.validateDSL=function(e,t){const n=[];try{i.validator.validateDSL(t)}catch(s){for(const t of s.errors){let i;if(t instanceof r.DSLSyntaxSingleError)i="SyntaxError";else{if(!(t instanceof r.ModelValidationSingleError))throw new Error("Unhandled Exception: "+JSON.stringify(t,null,4));i="ModelValidationError"}const s={},o=t.metadata;o.errorType&&(s.error=o.errorType),["typeName","relation"].forEach((e=>{o[e]&&(s[e]=o[e])})),n.push({message:t.msg,severity:e.MarkerSeverity.Error,startColumn:t.column.start,endColumn:t.column.end,startLineNumber:t.line.start,endLineNumber:t.line.end,source:i,extraInformation:s})}}return n}},96467:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrismExtensions=void 0;const r=n(24416),i=n(14533);t.PrismExtensions={LANGUAGE_NAME:i.LANGUAGE_NAME,languageDefinition:r.languageDefinition}},24416:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.languageDefinition=void 0;const r=n(35442);t.languageDefinition={[r.OpenFgaDslThemeTokenType.COMMENT]:{pattern:/^\s*#.*/},[r.OpenFgaDslThemeTokenType.KEYWORD]:/\b(type|relations|define|and|or|but not|from|as|model|schema)\b/,[r.OpenFgaDslThemeTokenType.TYPE]:{pattern:/(\btype\s+)\w+/i,lookbehind:!0,greedy:!0},[r.OpenFgaDslThemeTokenType.RELATION]:{pattern:/(\bdefine\s+)\w+/i,lookbehind:!0,greedy:!0},[r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE]:/\[.*]|self/}},19762:(e,t)=>{"use strict";var n,r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.RelationType=t.GraphEdgeGroup=t.GraphNodeGroup=void 0,function(e){e.AssignableRelation="assignable-relation",e.NonassignableRelation="nonassignable-relation",e.Type="type",e.StoreName="store-name",e.Default="default",e.Check="check"}(n||(t.GraphNodeGroup=n={})),function(e){e.StoreToType="store-to-type",e.TypeToRelation="type-to-relation",e.RelationToRelation="relation-to-relation",e.AssignableSourceToRelation="assignable-sourcee-to-relation",e.Default="default"}(r||(t.GraphEdgeGroup=r={})),function(e){e.DirectUsers="Direct Users",e.ComputedUserset="Related From Same Object",e.TupleToUserset="Related From Related Objects"}(i||(t.RelationType=i={}))},27253:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthorizationModelGraphBuilder=t.TreeBuilder=t.GraphEdgeGroup=t.GraphNodeGroup=void 0;var r=n(19762);Object.defineProperty(t,"GraphNodeGroup",{enumerable:!0,get:function(){return r.GraphNodeGroup}}),Object.defineProperty(t,"GraphEdgeGroup",{enumerable:!0,get:function(){return r.GraphEdgeGroup}});var i=n(65349);Object.defineProperty(t,"TreeBuilder",{enumerable:!0,get:function(){return i.TreeBuilder}});var s=n(35747);Object.defineProperty(t,"AuthorizationModelGraphBuilder",{enumerable:!0,get:function(){return s.AuthorizationModelGraphBuilder}})},35747:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthorizationModelGraphBuilder=void 0;const r=n(19762);class i{constructor(e,t){this.authorizationModel=e,this.store=t,this._graph={nodes:[],edges:[]},this.buildGraph()}static getStoreId(e){return`store|${e}`}static getTypeId(e){return`type|${e}`}static getRelationId(e,t){return`${e}.relation|${t}`}buildGraph(){var e,t,n;const s=(null===(e=this.store)||void 0===e?void 0:e.name)||(null===(t=this.store)||void 0===t?void 0:t.id)||"Store",o={nodes:[{id:i.getStoreId(s),label:s,group:r.GraphNodeGroup.StoreName}],edges:[]};null===(n=this.authorizationModel.type_definitions)||void 0===n||n.forEach((e=>{const t=this.getTypeGraph(e,o);o.nodes=o.nodes.concat(t.nodes),o.edges=o.edges.concat(t.edges)})),this._graph=o}checkIfRelationAssignable(e){var t,n,r,i;return!!(e.this||(null===(t=e.difference)||void 0===t?void 0:t.base.this)||(null===(n=e.difference)||void 0===n?void 0:n.subtract.this)||((null===(r=e.intersection)||void 0===r?void 0:r.child)||[]).some((e=>this.checkIfRelationAssignable(e)))||((null===(i=e.union)||void 0===i?void 0:i.child)||[]).some((e=>this.checkIfRelationAssignable(e))))}getAssignableSourcesForRelation(e,t){const n={types:[],relations:[],conditions:[],publicTypes:[],isAssignable:!1};if(!this.checkIfRelationAssignable(e))return n;const r=t.directly_related_user_types;return null==r||r.forEach((e=>{(e.relation||e.wildcard||e.condition)&&(e.relation?n.relations.push(i.getRelationId(e.type,e.relation)):(n.isAssignable=!0,n.types.push(i.getTypeId(e.type))))})),n}addRelationToRelationEdge(e,t,n,s){e.edges.push({from:i.getRelationId(t,n),to:i.getRelationId(t,s.relation),group:r.GraphEdgeGroup.RelationToRelation,dashes:!0})}getTypeGraph(e,t,{showAssignable:n}={}){const s=i.getTypeId(e.type),o={nodes:[{id:s,label:e.type,group:r.GraphNodeGroup.Type}],edges:[{from:t.nodes[0].id,to:s,group:r.GraphEdgeGroup.StoreToType}]},a=(null==e?void 0:e.relations)||{};return Object.keys(a).forEach((t=>{var l,c,u;const d=i.getRelationId(s,t),h=a[t]||{},p=this.getAssignableSourcesForRelation(h,(null===(c=null===(l=e.metadata)||void 0===l?void 0:l.relations)||void 0===c?void 0:c[t])||{}),f=p.isAssignable;o.nodes.push({id:d,label:t,group:f?r.GraphNodeGroup.AssignableRelation:r.GraphNodeGroup.NonassignableRelation}),n&&p.types.forEach((e=>{o.edges.push({from:i.getTypeId(e),to:d,group:r.GraphEdgeGroup.AssignableSourceToRelation})})),o.edges.push({from:s,to:d,group:r.GraphEdgeGroup.TypeToRelation}),h.computedUserset?this.addRelationToRelationEdge(o,s,t,h.computedUserset):((null===(u=h.union)||void 0===u?void 0:u.child)||[]).forEach((e=>{e.computedUserset&&this.addRelationToRelationEdge(o,s,t,e.computedUserset)}))})),o}get graph(){return this._graph}}t.AuthorizationModelGraphBuilder=i},65349:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(t){s(t)}}function a(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TreeBuilder=void 0;const i=n(19762),s=e=>{const t=e.split("#"),n="*"===t[1]||"*"===e;return{object:t[0],relation:n?void 0:t[1],isWildcard:n}};t.TreeBuilder=class{constructor(e,t,n,r){this.openFgaApi=e,this.capturedTuple=t,this.existingTree=n,this.authorizationModelId=r,this.expandedTuples={},n&&(this.currentTree=n)}addParent(e,t,n,r){this.currentTree&&(this.currentTree[e]||(this.currentTree[e]={parents:{}}),this.currentTree[e].parents[t]={inActivePath:r,type:n},t===`${this.capturedTuple.object}#${this.capturedTuple.relation}`&&(this.currentTree[this.capturedTuple.object]||(this.currentTree[this.capturedTuple.object]={parents:{},inActivePath:!0}),this.addParent(`${this.capturedTuple.object}#${this.capturedTuple.relation}`,this.capturedTuple.object,void 0,!0)))}expandTuple(e){return r(this,void 0,void 0,(function*(){return this.openFgaApi.expand({tuple_key:{relation:e.relation,object:e.object},authorization_model_id:this.authorizationModelId})}))}walkDirectUser(e,t){return r(this,void 0,void 0,(function*(){const n=s(t);this.addParent(t,e.name,i.RelationType.DirectUsers),n.relation&&(yield this.walk(n))}))}walkDirectUsers(e){var t,n;return r(this,void 0,void 0,(function*(){const i=(null===(n=null===(t=null==e?void 0:e.leaf)||void 0===t?void 0:t.users)||void 0===n?void 0:n.users)||[];yield Promise.all(i.map((t=>r(this,void 0,void 0,(function*(){return this.walkDirectUser(e,t)})))))}))}walkComputedUserSet(e,t,n){return r(this,void 0,void 0,(function*(){if(!t||2!==t.split(":").length)return;this.addParent(t,e.name,n?i.RelationType.TupleToUserset:i.RelationType.ComputedUserset);const r=s(t);yield this.walk(r)}))}walkTupleToUserset(e){var t,n;return r(this,void 0,void 0,(function*(){const r=null===(n=null===(t=e.leaf)||void 0===t?void 0:t.tupleToUserset)||void 0===n?void 0:n.tupleset;if(!r)return;const i=s(r);yield this.walk(i)}))}getNodeType(e){var t,n,r,s,o,a;return(null===(n=null===(t=null==e?void 0:e.leaf)||void 0===t?void 0:t.computed)||void 0===n?void 0:n.userset)?i.RelationType.ComputedUserset:(null===(s=null===(r=null==e?void 0:e.leaf)||void 0===r?void 0:r.tupleToUserset)||void 0===s?void 0:s.computed)?i.RelationType.TupleToUserset:(null===(a=null===(o=null==e?void 0:e.union)||void 0===o?void 0:o.nodes)||void 0===a?void 0:a.length)?void 0:i.RelationType.DirectUsers}walkNode(e){var t,n,s,o,a;return r(this,void 0,void 0,(function*(){const l=[];switch(this.getNodeType(e)){case i.RelationType.DirectUsers:l.push(this.walkDirectUsers(e));break;case i.RelationType.ComputedUserset:const c=null===(n=null===(t=e.leaf)||void 0===t?void 0:t.computed)||void 0===n?void 0:n.userset;l.push(this.walkComputedUserSet(e,c));break;case i.RelationType.TupleToUserset:l.push(this.walkTupleToUserset(e));const u=(null===(o=null===(s=e.leaf)||void 0===s?void 0:s.tupleToUserset)||void 0===o?void 0:o.computed)||[];l.push(...u.map((t=>r(this,void 0,void 0,(function*(){return this.walkComputedUserSet(e,t.userset,!0)})))));break;default:const d=(null===(a=e.union)||void 0===a?void 0:a.nodes)||[];l.push(...d.map((e=>r(this,void 0,void 0,(function*(){return this.walkNode(e)})))))}yield Promise.all(l)}))}walk(e){var t;return r(this,void 0,void 0,(function*(){const n=`${e.object}#${e.relation}`;if(!e.relation||this.expandedTuples[n])return;this.currentTree&&!this.currentTree[n]&&(this.currentTree[n]={parents:{}}),this.expandedTuples[n]=!0;const r=yield this.expandTuple(e),i=null===(t=r.tree)||void 0===t?void 0:t.root;yield this.walkNode(i)}))}deleteHangingNodes(){const{tree:e={}}=this;Object.keys(e).forEach((t=>{const{parents:n}=e[t];Object.keys(n).length||t===this.capturedTuple.object||delete e[t]}))}get tree(){return this.currentTree}buildTree(){return r(this,void 0,void 0,(function*(){this.tree||(this.currentTree={},yield this.walk(this.capturedTuple))}))}fillActivePath(e){const{tree:t={}}=this,{object:n}=this.capturedTuple,r=JSON.parse(JSON.stringify(t));let i=["*",e];const s={};for(;i.length;){const e={};i.forEach((t=>{s[t]||(s[t]=!0,r[t]&&(r[t].parents[n]&&Object.keys(r[t].parents).forEach((e=>{e!==n&&delete r[t].parents[e]})),Object.keys(r[t].parents).forEach((n=>{n!==t&&(r[t].parents[n].inActivePath=!0,e[n]=!0)}))))})),i=Object.keys(e)}return r}buildGraph(e,t){const{capturedTuple:n}=this;let{tree:r={}}=this;const s=!!e,o={nodes:[],edges:[]};let a=!1;return this.deleteHangingNodes(),e&&(r=this.fillActivePath(e)),Object.keys(r).forEach((l=>{const c=r[l],[u,d]=l.split("#");let h;Object.keys(c.parents).forEach((e=>{var s;const u=c.parents[e];if(!r[e])return void(a=!0);if(t&&!u.inActivePath)return;h=!0;const p=null===(s=u.type)||void 0===s?void 0:s.replace(/\s/gu,"");p&&(o.nodes.push({id:`${e}.${p}.${l}`,label:u.type}),o.edges.push({to:`${e}.${p}.${l}`,from:e,isActive:u.inActivePath,group:i.GraphEdgeGroup.Default})),o.edges.push({to:l,from:p?`${e}.${p}.${l}`:e,label:e===n.object?`${d} from`:"",isActive:u.inActivePath,group:i.GraphEdgeGroup.Default})}));const p=l===e||"*"===l&&s,f=l===n.object;if(f||h||!t&&!a){const t=f||p;o.nodes.push({id:l,label:"*"===u&&s?`${e} via everyone (*)`:l,isActive:t})}})),o}}},40478:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={ulidValidate:n(16106).ulidValidate};t.default=r},16106:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ulidValidate=t.ulidPattern=void 0,t.ulidPattern=/[0-9A-HJKMNP-TV-Z]{26}/;t.ulidValidate=e=>t.ulidPattern.test(e)},80104:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConditionNameDoesntMatchError=t.UnsupportedDSLNestingError=t.ConfigurationError=t.ModelValidationError=t.ModelValidationSingleError=t.DSLSyntaxError=t.DSLSyntaxSingleError=t.BaseError=t.ValidationError=void 0,function(e){e.SchemaVersionRequired="schema-version-required",e.SchemaVersionUnsupported="schema-version-unsupported",e.ReservedTypeKeywords="reserved-type-keywords",e.ReservedRelationKeywords="reserved-relation-keywords",e.SelfError="self-error",e.InvalidName="invalid-name",e.MissingDefinition="missing-definition",e.InvalidRelationType="invalid-relation-type",e.InvalidType="invalid-type",e.RelationNoEntrypoint="relation-no-entry-point",e.TuplesetNotDirect="tupleuset-not-direct",e.DuplicatedError="duplicated-error",e.RequireSchema1_0="allowed-type-schema-10",e.AssignableRelationsMustHaveType="assignable-relation-must-have-type",e.AllowedTypesNotValidOnSchema1_0="allowed-type-not-valid-on-schema-1_0",e.InvalidSchema="invalid-schema",e.InvalidSyntax="invalid-syntax",e.TypeRestrictionCannotHaveWildcardAndRelation="type-wildcard-relation",e.ConditionNotDefined="condition-not-defined",e.ConditionNotUsed="condition-not-used"}(n||(t.ValidationError=n={}));class r extends Error{constructor(e,t){super(`${t} error at line=${e.line.start}, column=${e.column.start}: ${e.msg}`),this.properties=e,this.type=t,this.line=e.line,this.column=e.column,this.msg=e.msg}getLine(e=0){return{start:this.line.start+e,end:this.line.end+e}}getColumn(e=0){return{start:this.column.start+e,end:this.column.end+e}}toString(){return this.message}}t.BaseError=r;t.DSLSyntaxSingleError=class extends r{constructor(e,t,n){super(e,"syntax"),this.properties=e,this.metadata=t,(null==n?void 0:n.stack)&&(this.stack=n.stack),this.metadata=t}toString(){return this.message}};class i extends Error{constructor(e){super(`${e.length} error${e.length>1?"s":""} occurred:\n\t* ${e.join("\n\t* ")}\n\n`),this.errors=e,this.errors=e}toString(){return this.message}}t.DSLSyntaxError=i;t.ModelValidationSingleError=class extends r{constructor(e,t){super(e,(null==t?void 0:t.errorType)||"validation"),this.properties=e,this.metadata=t,this.metadata=t}toString(){return this.message}};class s extends Error{constructor(e){super(`${e.length} error${e.length>1?"s":""} occurred:\n\t* ${e.join("\n\t* ")}\n\n`),this.errors=e,this.errors=e}toString(){return this.message}}t.ModelValidationError=s;class o extends Error{constructor(e,t){super(e),this.message=e,this.e=t,(null==t?void 0:t.stack)&&(this.stack=t.stack)}}t.ConfigurationError=o;class a extends Error{constructor(e,t){super(`the '${t}' relation under the '${e}' type has mixed operators which are not supported by the OpenFGA DSL syntax yet`),this.typeName=e,this.relationName=t}}t.UnsupportedDSLNestingError=a;class l extends Error{constructor(e,t){super(`the '${e}' condition has a different nested condition name ('${t}')`),this.conditionName=e,this.conditionNestedName=t}}t.ConditionNameDoesntMatchError=l},7538:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(92529);class i extends r.Lexer{constructor(e){super(e),this._interp=new r.LexerATNSimulator(this,i._ATN,i.DecisionsToDFA,new r.PredictionContextCache)}get grammarFileName(){return"OpenFGALexer.g4"}get literalNames(){return i.literalNames}get symbolicNames(){return i.symbolicNames}get ruleNames(){return i.ruleNames}get serializedATN(){return i._serializedATN}get channelNames(){return i.channelNames}get modeNames(){return i.modeNames}static get _ATN(){return i.__ATN||(i.__ATN=(new r.ATNDeserializer).deserialize(i._serializedATN)),i.__ATN}}i.INDENT=1,i.MODEL=2,i.SCHEMA=3,i.SCHEMA_VERSION=4,i.TYPE=5,i.CONDITION=6,i.RELATIONS=7,i.DEFINE=8,i.WTH=9,i.HASH=10,i.COLON=11,i.WILDCARD=12,i.L_SQUARE=13,i.R_SQUARE=14,i.L_PARANTHESES=15,i.R_PARANTHESES=16,i.L_BRACES=17,i.R_BRACES=18,i.L_ANGLE_BRACKET=19,i.R_ANGLE_BRACKET=20,i.COMMA=21,i.CONDITION_PARAM_CONTAINER=22,i.CONDITION_PARAM_TYPE=23,i.CONDITION_SYMBOL=24,i.AND=25,i.OR=26,i.BUT_NOT=27,i.FROM=28,i.ALPHA_NUMERIC=29,i.NEWLINE=30,i.WS=31,i.EOF=r.Token.EOF,i.channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"],i.literalNames=[null,null,"'model'","'schema'","'1.1'","'type'","'condition'","'relations'","'define'","'with'","'#'","':'","'*'","'['","']'","'('","')'","'{'","'}'","'<'","'>'","','",null,null,null,"'and'","'or'","'but not'","'from'"],i.symbolicNames=[null,"INDENT","MODEL","SCHEMA","SCHEMA_VERSION","TYPE","CONDITION","RELATIONS","DEFINE","WTH","HASH","COLON","WILDCARD","L_SQUARE","R_SQUARE","L_PARANTHESES","R_PARANTHESES","L_BRACES","R_BRACES","L_ANGLE_BRACKET","R_ANGLE_BRACKET","COMMA","CONDITION_PARAM_CONTAINER","CONDITION_PARAM_TYPE","CONDITION_SYMBOL","AND","OR","BUT_NOT","FROM","ALPHA_NUMERIC","NEWLINE","WS"],i.modeNames=["DEFAULT_MODE"],i.ruleNames=["SINGLE_INDENT","DOUBLE_INDENT","BOL","INDENT","MODEL","SCHEMA","SCHEMA_VERSION","TYPE","CONDITION","RELATIONS","DEFINE","WTH","HASH","COLON","WILDCARD","L_SQUARE","R_SQUARE","L_PARANTHESES","R_PARANTHESES","L_BRACES","R_BRACES","L_ANGLE_BRACKET","R_ANGLE_BRACKET","COMMA","CONDITION_PARAM_CONTAINER","CONDITION_PARAM_TYPE","CONDITION_SYMBOL","AND","OR","BUT_NOT","FROM","ALPHA_NUMERIC","NEWLINE","WS"],i._serializedATN=[4,0,31,303,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,1,0,1,0,1,0,3,0,73,8,0,1,1,1,1,1,1,1,1,1,1,1,1,3,1,81,8,1,1,2,4,2,84,8,2,11,2,12,2,85,1,3,1,3,1,3,3,3,91,8,3,1,4,1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,18,1,18,1,19,1,19,1,20,1,20,1,21,1,21,1,22,1,22,1,23,1,23,1,24,1,24,1,24,1,24,1,24,1,24,1,24,3,24,178,8,24,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,3,25,229,8,25,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,3,26,273,8,26,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,30,1,31,4,31,296,8,31,11,31,12,31,297,1,32,1,32,1,33,1,33,0,0,34,1,0,3,0,5,0,7,1,9,2,11,3,13,4,15,5,17,6,19,7,21,8,23,9,25,10,27,11,29,12,31,13,33,14,35,15,37,16,39,17,41,18,43,19,45,20,47,21,49,22,51,23,53,24,55,25,57,26,59,27,61,28,63,29,65,30,67,31,1,0,6,2,0,10,10,12,13,3,0,33,33,45,45,63,63,2,0,37,37,47,47,5,0,45,45,48,57,65,90,95,95,97,122,2,0,10,10,13,13,2,0,9,9,32,32,336,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,1,72,1,0,0,0,3,80,1,0,0,0,5,83,1,0,0,0,7,87,1,0,0,0,9,92,1,0,0,0,11,98,1,0,0,0,13,105,1,0,0,0,15,109,1,0,0,0,17,114,1,0,0,0,19,124,1,0,0,0,21,134,1,0,0,0,23,141,1,0,0,0,25,146,1,0,0,0,27,148,1,0,0,0,29,150,1,0,0,0,31,152,1,0,0,0,33,154,1,0,0,0,35,156,1,0,0,0,37,158,1,0,0,0,39,160,1,0,0,0,41,162,1,0,0,0,43,164,1,0,0,0,45,166,1,0,0,0,47,168,1,0,0,0,49,177,1,0,0,0,51,228,1,0,0,0,53,272,1,0,0,0,55,274,1,0,0,0,57,278,1,0,0,0,59,281,1,0,0,0,61,289,1,0,0,0,63,295,1,0,0,0,65,299,1,0,0,0,67,301,1,0,0,0,69,70,5,32,0,0,70,73,5,32,0,0,71,73,5,9,0,0,72,69,1,0,0,0,72,71,1,0,0,0,73,2,1,0,0,0,74,75,5,32,0,0,75,76,5,32,0,0,76,77,5,32,0,0,77,81,5,32,0,0,78,79,5,9,0,0,79,81,5,9,0,0,80,74,1,0,0,0,80,78,1,0,0,0,81,4,1,0,0,0,82,84,7,0,0,0,83,82,1,0,0,0,84,85,1,0,0,0,85,83,1,0,0,0,85,86,1,0,0,0,86,6,1,0,0,0,87,90,3,5,2,0,88,91,3,3,1,0,89,91,3,1,0,0,90,88,1,0,0,0,90,89,1,0,0,0,91,8,1,0,0,0,92,93,5,109,0,0,93,94,5,111,0,0,94,95,5,100,0,0,95,96,5,101,0,0,96,97,5,108,0,0,97,10,1,0,0,0,98,99,5,115,0,0,99,100,5,99,0,0,100,101,5,104,0,0,101,102,5,101,0,0,102,103,5,109,0,0,103,104,5,97,0,0,104,12,1,0,0,0,105,106,5,49,0,0,106,107,5,46,0,0,107,108,5,49,0,0,108,14,1,0,0,0,109,110,5,116,0,0,110,111,5,121,0,0,111,112,5,112,0,0,112,113,5,101,0,0,113,16,1,0,0,0,114,115,5,99,0,0,115,116,5,111,0,0,116,117,5,110,0,0,117,118,5,100,0,0,118,119,5,105,0,0,119,120,5,116,0,0,120,121,5,105,0,0,121,122,5,111,0,0,122,123,5,110,0,0,123,18,1,0,0,0,124,125,5,114,0,0,125,126,5,101,0,0,126,127,5,108,0,0,127,128,5,97,0,0,128,129,5,116,0,0,129,130,5,105,0,0,130,131,5,111,0,0,131,132,5,110,0,0,132,133,5,115,0,0,133,20,1,0,0,0,134,135,5,100,0,0,135,136,5,101,0,0,136,137,5,102,0,0,137,138,5,105,0,0,138,139,5,110,0,0,139,140,5,101,0,0,140,22,1,0,0,0,141,142,5,119,0,0,142,143,5,105,0,0,143,144,5,116,0,0,144,145,5,104,0,0,145,24,1,0,0,0,146,147,5,35,0,0,147,26,1,0,0,0,148,149,5,58,0,0,149,28,1,0,0,0,150,151,5,42,0,0,151,30,1,0,0,0,152,153,5,91,0,0,153,32,1,0,0,0,154,155,5,93,0,0,155,34,1,0,0,0,156,157,5,40,0,0,157,36,1,0,0,0,158,159,5,41,0,0,159,38,1,0,0,0,160,161,5,123,0,0,161,40,1,0,0,0,162,163,5,125,0,0,163,42,1,0,0,0,164,165,5,60,0,0,165,44,1,0,0,0,166,167,5,62,0,0,167,46,1,0,0,0,168,169,5,44,0,0,169,48,1,0,0,0,170,171,5,109,0,0,171,172,5,97,0,0,172,178,5,112,0,0,173,174,5,108,0,0,174,175,5,105,0,0,175,176,5,115,0,0,176,178,5,116,0,0,177,170,1,0,0,0,177,173,1,0,0,0,178,50,1,0,0,0,179,180,5,98,0,0,180,181,5,111,0,0,181,182,5,111,0,0,182,229,5,108,0,0,183,184,5,115,0,0,184,185,5,116,0,0,185,186,5,114,0,0,186,187,5,105,0,0,187,188,5,110,0,0,188,229,5,103,0,0,189,190,5,105,0,0,190,191,5,110,0,0,191,229,5,116,0,0,192,193,5,117,0,0,193,194,5,105,0,0,194,195,5,110,0,0,195,229,5,116,0,0,196,197,5,100,0,0,197,198,5,111,0,0,198,199,5,117,0,0,199,200,5,98,0,0,200,201,5,108,0,0,201,229,5,101,0,0,202,203,5,100,0,0,203,204,5,117,0,0,204,205,5,114,0,0,205,206,5,97,0,0,206,207,5,116,0,0,207,208,5,105,0,0,208,209,5,111,0,0,209,229,5,110,0,0,210,211,5,116,0,0,211,212,5,105,0,0,212,213,5,109,0,0,213,214,5,101,0,0,214,215,5,115,0,0,215,216,5,116,0,0,216,217,5,97,0,0,217,218,5,109,0,0,218,229,5,112,0,0,219,220,5,105,0,0,220,221,5,112,0,0,221,222,5,97,0,0,222,223,5,100,0,0,223,224,5,100,0,0,224,225,5,114,0,0,225,226,5,101,0,0,226,227,5,115,0,0,227,229,5,115,0,0,228,179,1,0,0,0,228,183,1,0,0,0,228,189,1,0,0,0,228,192,1,0,0,0,228,196,1,0,0,0,228,202,1,0,0,0,228,210,1,0,0,0,228,219,1,0,0,0,229,52,1,0,0,0,230,231,5,61,0,0,231,273,5,61,0,0,232,233,5,33,0,0,233,273,5,61,0,0,234,235,5,105,0,0,235,273,5,110,0,0,236,273,5,60,0,0,237,238,5,60,0,0,238,273,5,61,0,0,239,240,5,62,0,0,240,273,5,61,0,0,241,273,5,62,0,0,242,243,5,38,0,0,243,273,5,38,0,0,244,245,5,124,0,0,245,273,5,124,0,0,246,273,3,31,15,0,247,273,3,33,16,0,248,273,3,39,19,0,249,273,3,35,17,0,250,273,3,37,18,0,251,273,5,46,0,0,252,273,3,47,23,0,253,273,7,1,0,0,254,273,3,27,13,0,255,273,5,43,0,0,256,273,3,29,14,0,257,273,7,2,0,0,258,259,5,116,0,0,259,260,5,114,0,0,260,261,5,117,0,0,261,273,5,101,0,0,262,263,5,102,0,0,263,264,5,97,0,0,264,265,5,108,0,0,265,266,5,115,0,0,266,273,5,101,0,0,267,268,5,110,0,0,268,269,5,117,0,0,269,270,5,108,0,0,270,273,5,108,0,0,271,273,5,34,0,0,272,230,1,0,0,0,272,232,1,0,0,0,272,234,1,0,0,0,272,236,1,0,0,0,272,237,1,0,0,0,272,239,1,0,0,0,272,241,1,0,0,0,272,242,1,0,0,0,272,244,1,0,0,0,272,246,1,0,0,0,272,247,1,0,0,0,272,248,1,0,0,0,272,249,1,0,0,0,272,250,1,0,0,0,272,251,1,0,0,0,272,252,1,0,0,0,272,253,1,0,0,0,272,254,1,0,0,0,272,255,1,0,0,0,272,256,1,0,0,0,272,257,1,0,0,0,272,258,1,0,0,0,272,262,1,0,0,0,272,267,1,0,0,0,272,271,1,0,0,0,273,54,1,0,0,0,274,275,5,97,0,0,275,276,5,110,0,0,276,277,5,100,0,0,277,56,1,0,0,0,278,279,5,111,0,0,279,280,5,114,0,0,280,58,1,0,0,0,281,282,5,98,0,0,282,283,5,117,0,0,283,284,5,116,0,0,284,285,5,32,0,0,285,286,5,110,0,0,286,287,5,111,0,0,287,288,5,116,0,0,288,60,1,0,0,0,289,290,5,102,0,0,290,291,5,114,0,0,291,292,5,111,0,0,292,293,5,109,0,0,293,62,1,0,0,0,294,296,7,3,0,0,295,294,1,0,0,0,296,297,1,0,0,0,297,295,1,0,0,0,297,298,1,0,0,0,298,64,1,0,0,0,299,300,7,4,0,0,300,66,1,0,0,0,301,302,7,5,0,0,302,68,1,0,0,0,9,0,72,80,85,90,177,228,272,297,0],i.DecisionsToDFA=i._ATN.decisionToState.map(((e,t)=>new r.DFA(e,t))),t.default=i},73247:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NameContext=t.SchemaVersionContext=t.NewlineContext=t.SpacingContext=t.MultiLineCommentContext=t.CommentContext=t.ConditionExpressionContext=t.ParameterTypeContext=t.ConditionNameContext=t.ParameterNameContext=t.ConditionParameterContext=t.ConditionContext=t.ConditionsContext=t.TypeNameContext=t.RelationNameContext=t.RewriteTuplesetNameContext=t.RewriteTuplesetComputedusersetNameContext=t.RewriteComputedusersetNameContext=t.RelationDefGroupingContext=t.RelationDefTypeRestrictionUsersetContext=t.RelationDefTypeRestrictionWildcardContext=t.RelationDefTypeRestrictionRelationContext=t.RelationDefTypeRestrictionTypeContext=t.RelationDefTypeRestrictionWithConditionContext=t.RelationDefTypeRestrictionContext=t.RelationDefKeywordFromContext=t.RelationDefOperatorButNotContext=t.RelationDefOperatorOrContext=t.RelationDefOperatorAndContext=t.RelationDefOperatorContext=t.RelationDefRelationOnRelatedObjectContext=t.RelationDefRelationOnSameObjectContext=t.RelationDefRewriteContext=t.RelationDefDirectAssignmentContext=t.RelationDefPartialAllButNotContext=t.RelationDefPartialAllAndContext=t.RelationDefPartialAllOrContext=t.RelationDefPartialsContext=t.RelationDefContext=t.RelationDeclarationContext=t.TypeDefContext=t.TypeDefsContext=t.ModelHeaderContext=t.IndentationContext=t.MainContext=void 0;const r=n(92529);class i extends r.Parser{get grammarFileName(){return"OpenFGAParser.g4"}get literalNames(){return i.literalNames}get symbolicNames(){return i.symbolicNames}get ruleNames(){return i.ruleNames}get serializedATN(){return i._serializedATN}createFailedPredicateException(e,t){return new r.FailedPredicateException(this,e,t)}constructor(e){super(e),this._interp=new r.ParserATNSimulator(this,i._ATN,i.DecisionsToDFA,new r.PredictionContextCache)}main(){let e,t=new s(this,this._ctx,this.state);this.enterRule(t,0,i.RULE_main);try{this.enterOuterAlt(t,1),this.state=90,this.modelHeader(),this.state=91,this.typeDefs(),this.state=92,this.conditions(),this.state=94,this._errHandler.sync(this),e=this._input.LA(1),30===e&&(this.state=93,this.newline()),this.state=96,this.match(i.EOF)}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}indentation(){let e=new o(this,this._ctx,this.state);this.enterRule(e,2,i.RULE_indentation);try{this.enterOuterAlt(e,1),this.state=98,this.match(i.INDENT)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}modelHeader(){let e,t=new a(this,this._ctx,this.state);this.enterRule(t,4,i.RULE_modelHeader);try{this.enterOuterAlt(t,1),this.state=103,this._errHandler.sync(this),e=this._input.LA(1),10!==e&&31!==e||(this.state=100,this.multiLineComment(),this.state=101,this.newline()),this.state=105,this.match(i.MODEL),this.state=107,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=106,this.spacing()),this.state=112,this._errHandler.sync(this),e=this._input.LA(1),30===e&&(this.state=109,this.newline(),this.state=110,this.multiLineComment()),this.state=114,this.indentation(),this.state=115,this.match(i.SCHEMA),this.state=116,this.spacing(),this.state=117,this.schemaVersion(),this.state=119,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=118,this.spacing())}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}typeDefs(){let e=new l(this,this._ctx,this.state);this.enterRule(e,6,i.RULE_typeDefs);try{let t;for(this.enterOuterAlt(e,1),this.state=124,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,5,this._ctx);2!==t&&t!==r.ATN.INVALID_ALT_NUMBER;)1===t&&(this.state=121,this.typeDef()),this.state=126,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,5,this._ctx)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}typeDef(){let e,t=new c(this,this._ctx,this.state);this.enterRule(t,8,i.RULE_typeDef);try{let n;if(this.enterOuterAlt(t,1),this.state=130,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,6,this._ctx))this.state=127,this.newline(),this.state=128,this.multiLineComment();if(this.state=132,this.newline(),this.state=133,this.match(i.TYPE),this.state=134,this.spacing(),this.state=135,this.typeName(),this.state=137,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=136,this.spacing()),this.state=149,this._errHandler.sync(this),e=this._input.LA(1),1===e){this.state=139,this.indentation(),this.state=140,this.match(i.RELATIONS),this.state=142,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=141,this.spacing()),this.state=145,this._errHandler.sync(this),n=1;do{if(1!==n)throw new r.NoViableAltException(this);this.state=144,this.relationDeclaration(),this.state=147,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,9,this._ctx)}while(2!==n&&n!==r.ATN.INVALID_ALT_NUMBER)}}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}relationDeclaration(){let e,t=new u(this,this._ctx,this.state);this.enterRule(t,10,i.RULE_relationDeclaration);try{this.enterOuterAlt(t,1),this.state=154,this._errHandler.sync(this),e=this._input.LA(1),30===e&&(this.state=151,this.newline(),this.state=152,this.multiLineComment()),this.state=156,this.indentation(),this.state=157,this.match(i.DEFINE),this.state=158,this.spacing(),this.state=159,this.relationName(),this.state=161,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=160,this.spacing()),this.state=163,this.match(i.COLON),this.state=165,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=164,this.spacing()),this.state=167,this.relationDef(),this.state=169,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=168,this.spacing())}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}relationDef(){let e=new d(this,this._ctx,this.state);this.enterRule(e,12,i.RULE_relationDef);try{switch(this.enterOuterAlt(e,1),this.state=173,this._errHandler.sync(this),this._input.LA(1)){case 13:this.state=171,this.relationDefDirectAssignment();break;case 29:this.state=172,this.relationDefGrouping();break;default:throw new r.NoViableAltException(this)}if(this.state=176,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,16,this._ctx))this.state=175,this.relationDefPartials()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefPartials(){let e=new h(this,this._ctx,this.state);this.enterRule(e,14,i.RULE_relationDefPartials);try{switch(this.state=181,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,17,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=178,this.relationDefPartialAllOr();break;case 2:this.enterOuterAlt(e,2),this.state=179,this.relationDefPartialAllAnd();break;case 3:this.enterOuterAlt(e,3),this.state=180,this.relationDefPartialAllButNot()}}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefPartialAllOr(){let e=new p(this,this._ctx,this.state);this.enterRule(e,16,i.RULE_relationDefPartialAllOr);try{let t;this.enterOuterAlt(e,1),this.state=188,this._errHandler.sync(this),t=1;do{if(1!==t)throw new r.NoViableAltException(this);this.state=183,this.spacing(),this.state=184,this.relationDefOperatorOr(),this.state=185,this.spacing(),this.state=186,this.relationDefGrouping(),this.state=190,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,18,this._ctx)}while(2!==t&&t!==r.ATN.INVALID_ALT_NUMBER)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefPartialAllAnd(){let e=new f(this,this._ctx,this.state);this.enterRule(e,18,i.RULE_relationDefPartialAllAnd);try{let t;this.enterOuterAlt(e,1),this.state=197,this._errHandler.sync(this),t=1;do{if(1!==t)throw new r.NoViableAltException(this);this.state=192,this.spacing(),this.state=193,this.relationDefOperatorAnd(),this.state=194,this.spacing(),this.state=195,this.relationDefGrouping(),this.state=199,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,19,this._ctx)}while(2!==t&&t!==r.ATN.INVALID_ALT_NUMBER)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefPartialAllButNot(){let e=new g(this,this._ctx,this.state);this.enterRule(e,20,i.RULE_relationDefPartialAllButNot);try{let t;this.enterOuterAlt(e,1),this.state=206,this._errHandler.sync(this),t=1;do{if(1!==t)throw new r.NoViableAltException(this);this.state=201,this.spacing(),this.state=202,this.relationDefOperatorButNot(),this.state=203,this.spacing(),this.state=204,this.relationDefGrouping(),this.state=208,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,20,this._ctx)}while(2!==t&&t!==r.ATN.INVALID_ALT_NUMBER)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefDirectAssignment(){let e,t=new m(this,this._ctx,this.state);this.enterRule(t,22,i.RULE_relationDefDirectAssignment);try{if(this.enterOuterAlt(t,1),this.state=210,this.match(i.L_SQUARE),this.state=212,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=211,this.spacing()),this.state=214,this.relationDefTypeRestriction(),this.state=216,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,22,this._ctx))this.state=215,this.spacing();for(this.state=225,this._errHandler.sync(this),e=this._input.LA(1);21===e;)this.state=218,this.match(i.COMMA),this.state=220,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=219,this.spacing()),this.state=222,this.relationDefTypeRestriction(),this.state=227,this._errHandler.sync(this),e=this._input.LA(1);this.state=229,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=228,this.spacing()),this.state=231,this.match(i.R_SQUARE)}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}relationDefRewrite(){let e=new y(this,this._ctx,this.state);this.enterRule(e,24,i.RULE_relationDefRewrite);try{switch(this.state=235,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,26,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=233,this.relationDefRelationOnSameObject();break;case 2:this.enterOuterAlt(e,2),this.state=234,this.relationDefRelationOnRelatedObject()}}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefRelationOnSameObject(){let e=new b(this,this._ctx,this.state);this.enterRule(e,26,i.RULE_relationDefRelationOnSameObject);try{this.enterOuterAlt(e,1),this.state=237,this.rewriteComputedusersetName()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefRelationOnRelatedObject(){let e=new v(this,this._ctx,this.state);this.enterRule(e,28,i.RULE_relationDefRelationOnRelatedObject);try{this.enterOuterAlt(e,1),this.state=239,this.rewriteTuplesetComputedusersetName(),this.state=240,this.spacing(),this.state=241,this.relationDefKeywordFrom(),this.state=242,this.spacing(),this.state=243,this.rewriteTuplesetName()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefOperator(){let e=new E(this,this._ctx,this.state);this.enterRule(e,30,i.RULE_relationDefOperator);try{switch(this.state=248,this._errHandler.sync(this),this._input.LA(1)){case 26:this.enterOuterAlt(e,1),this.state=245,this.relationDefOperatorOr();break;case 25:this.enterOuterAlt(e,2),this.state=246,this.relationDefOperatorAnd();break;case 27:this.enterOuterAlt(e,3),this.state=247,this.relationDefOperatorButNot();break;default:throw new r.NoViableAltException(this)}}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefOperatorAnd(){let e=new _(this,this._ctx,this.state);this.enterRule(e,32,i.RULE_relationDefOperatorAnd);try{this.enterOuterAlt(e,1),this.state=250,this.match(i.AND)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefOperatorOr(){let e=new T(this,this._ctx,this.state);this.enterRule(e,34,i.RULE_relationDefOperatorOr);try{this.enterOuterAlt(e,1),this.state=252,this.match(i.OR)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefOperatorButNot(){let e=new x(this,this._ctx,this.state);this.enterRule(e,36,i.RULE_relationDefOperatorButNot);try{this.enterOuterAlt(e,1),this.state=254,this.match(i.BUT_NOT)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefKeywordFrom(){let e=new w(this,this._ctx,this.state);this.enterRule(e,38,i.RULE_relationDefKeywordFrom);try{this.enterOuterAlt(e,1),this.state=256,this.match(i.FROM)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefTypeRestriction(){let e=new S(this,this._ctx,this.state);this.enterRule(e,40,i.RULE_relationDefTypeRestriction);try{switch(this.state=262,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,28,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=258,this.relationDefTypeRestrictionType();break;case 2:this.enterOuterAlt(e,2),this.state=259,this.relationDefTypeRestrictionWildcard();break;case 3:this.enterOuterAlt(e,3),this.state=260,this.relationDefTypeRestrictionUserset();break;case 4:this.enterOuterAlt(e,4),this.state=261,this.relationDefTypeRestrictionWithCondition()}}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefTypeRestrictionWithCondition(){let e=new R(this,this._ctx,this.state);this.enterRule(e,42,i.RULE_relationDefTypeRestrictionWithCondition);try{switch(this.enterOuterAlt(e,1),this.state=267,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,29,this._ctx)){case 1:this.state=264,this.relationDefTypeRestrictionType();break;case 2:this.state=265,this.relationDefTypeRestrictionWildcard();break;case 3:this.state=266,this.relationDefTypeRestrictionUserset()}this.state=269,this.spacing(),this.state=270,this.match(i.WTH),this.state=271,this.spacing(),this.state=272,this.conditionName()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefTypeRestrictionType(){let e=new k(this,this._ctx,this.state);this.enterRule(e,44,i.RULE_relationDefTypeRestrictionType);try{this.enterOuterAlt(e,1),this.state=274,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefTypeRestrictionRelation(){let e=new C(this,this._ctx,this.state);this.enterRule(e,46,i.RULE_relationDefTypeRestrictionRelation);try{this.enterOuterAlt(e,1),this.state=276,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefTypeRestrictionWildcard(){let e=new O(this,this._ctx,this.state);this.enterRule(e,48,i.RULE_relationDefTypeRestrictionWildcard);try{if(this.enterOuterAlt(e,1),this.state=278,this.relationDefTypeRestrictionType(),this.state=279,this.match(i.COLON),this.state=280,this.match(i.WILDCARD),this.state=282,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,30,this._ctx))this.state=281,this.spacing()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefTypeRestrictionUserset(){let e=new A(this,this._ctx,this.state);this.enterRule(e,50,i.RULE_relationDefTypeRestrictionUserset);try{this.enterOuterAlt(e,1),this.state=284,this.relationDefTypeRestrictionType(),this.state=285,this.match(i.HASH),this.state=286,this.relationDefTypeRestrictionRelation()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefGrouping(){let e=new N(this,this._ctx,this.state);this.enterRule(e,52,i.RULE_relationDefGrouping);try{this.enterOuterAlt(e,1),this.state=288,this.relationDefRewrite()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}rewriteComputedusersetName(){let e=new I(this,this._ctx,this.state);this.enterRule(e,54,i.RULE_rewriteComputedusersetName);try{this.enterOuterAlt(e,1),this.state=290,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}rewriteTuplesetComputedusersetName(){let e=new L(this,this._ctx,this.state);this.enterRule(e,56,i.RULE_rewriteTuplesetComputedusersetName);try{this.enterOuterAlt(e,1),this.state=292,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}rewriteTuplesetName(){let e=new D(this,this._ctx,this.state);this.enterRule(e,58,i.RULE_rewriteTuplesetName);try{this.enterOuterAlt(e,1),this.state=294,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationName(){let e=new P(this,this._ctx,this.state);this.enterRule(e,60,i.RULE_relationName);try{this.enterOuterAlt(e,1),this.state=296,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}typeName(){let e=new M(this,this._ctx,this.state);this.enterRule(e,62,i.RULE_typeName);try{this.enterOuterAlt(e,1),this.state=298,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}conditions(){let e=new F(this,this._ctx,this.state);this.enterRule(e,64,i.RULE_conditions);try{let t;for(this.enterOuterAlt(e,1),this.state=303,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,31,this._ctx);2!==t&&t!==r.ATN.INVALID_ALT_NUMBER;)1===t&&(this.state=300,this.condition()),this.state=305,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,31,this._ctx)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}condition(){let e,t=new U(this,this._ctx,this.state);this.enterRule(t,66,i.RULE_condition);try{if(this.enterOuterAlt(t,1),this.state=309,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,32,this._ctx))this.state=306,this.newline(),this.state=307,this.multiLineComment();for(this.state=311,this.newline(),this.state=312,this.match(i.CONDITION),this.state=313,this.spacing(),this.state=314,this.conditionName(),this.state=316,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=315,this.spacing()),this.state=318,this.match(i.L_PARANTHESES),this.state=319,this.conditionParameter(),this.state=321,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=320,this.spacing()),this.state=333,this._errHandler.sync(this),e=this._input.LA(1);21===e;)this.state=323,this.match(i.COMMA),this.state=325,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=324,this.spacing()),this.state=327,this.conditionParameter(),this.state=329,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=328,this.spacing()),this.state=335,this._errHandler.sync(this),e=this._input.LA(1);this.state=336,this.match(i.R_PARANTHESES),this.state=338,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=337,this.spacing()),this.state=340,this.match(i.L_BRACES),this.state=341,this.conditionExpression(),this.state=342,this.match(i.R_BRACES)}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}conditionParameter(){let e,t=new j(this,this._ctx,this.state);this.enterRule(t,68,i.RULE_conditionParameter);try{this.enterOuterAlt(t,1),this.state=344,this.parameterName(),this.state=346,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=345,this.spacing()),this.state=348,this.match(i.COLON),this.state=350,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=349,this.spacing()),this.state=352,this.parameterType()}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}parameterName(){let e=new B(this,this._ctx,this.state);this.enterRule(e,70,i.RULE_parameterName);try{this.enterOuterAlt(e,1),this.state=354,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}conditionName(){let e=new H(this,this._ctx,this.state);this.enterRule(e,72,i.RULE_conditionName);try{this.enterOuterAlt(e,1),this.state=356,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}parameterType(){let e=new $(this,this._ctx,this.state);this.enterRule(e,74,i.RULE_parameterType);try{switch(this.state=363,this._errHandler.sync(this),this._input.LA(1)){case 23:this.enterOuterAlt(e,1),this.state=358,this.match(i.CONDITION_PARAM_TYPE);break;case 22:this.enterOuterAlt(e,2),this.state=359,this.match(i.CONDITION_PARAM_CONTAINER),this.state=360,this.match(i.L_ANGLE_BRACKET),this.state=361,this.match(i.CONDITION_PARAM_TYPE),this.state=362,this.match(i.R_ANGLE_BRACKET);break;default:throw new r.NoViableAltException(this)}}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}conditionExpression(){let e,t=new z(this,this._ctx,this.state);this.enterRule(t,76,i.RULE_conditionExpression);try{for(this.enterOuterAlt(t,1),this.state=369,this._errHandler.sync(this),e=this._input.LA(1);0==(-32&e)&&0!=(1<<e&4294705150);){switch(this.state=367,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,42,this._ctx)){case 1:this.state=365,this.match(i.CONDITION_SYMBOL);break;case 2:this.state=366,e=this._input.LA(1),e<=0||18===e?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())}this.state=371,this._errHandler.sync(this),e=this._input.LA(1)}}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}comment(){let e,t=new V(this,this._ctx,this.state);this.enterRule(t,78,i.RULE_comment);try{let n;for(this.enterOuterAlt(t,1),this.state=375,this._errHandler.sync(this),e=this._input.LA(1);31===e;)this.state=372,this.match(i.WS),this.state=377,this._errHandler.sync(this),e=this._input.LA(1);for(this.state=378,this.match(i.HASH),this.state=382,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,45,this._ctx);2!==n&&n!==r.ATN.INVALID_ALT_NUMBER;)1===n&&(this.state=379,e=this._input.LA(1),e<=0||30===e?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())),this.state=384,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,45,this._ctx)}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}multiLineComment(){let e=new G(this,this._ctx,this.state);this.enterRule(e,80,i.RULE_multiLineComment);try{let t;for(this.enterOuterAlt(e,1),this.state=385,this.comment(),this.state=391,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,46,this._ctx);2!==t&&t!==r.ATN.INVALID_ALT_NUMBER;)1===t&&(this.state=386,this.newline(),this.state=387,this.comment()),this.state=393,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,46,this._ctx)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}spacing(){let e=new W(this,this._ctx,this.state);this.enterRule(e,82,i.RULE_spacing);try{let t;this.enterOuterAlt(e,1),this.state=395,this._errHandler.sync(this),t=1;do{if(1!==t)throw new r.NoViableAltException(this);this.state=394,this.match(i.WS),this.state=397,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,47,this._ctx)}while(2!==t&&t!==r.ATN.INVALID_ALT_NUMBER)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}newline(){let e,t=new K(this,this._ctx,this.state);this.enterRule(t,84,i.RULE_newline);try{this.enterOuterAlt(t,1),this.state=400,this._errHandler.sync(this),e=this._input.LA(1);do{this.state=399,this.match(i.NEWLINE),this.state=402,this._errHandler.sync(this),e=this._input.LA(1)}while(30===e)}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}schemaVersion(){let e=new Y(this,this._ctx,this.state);this.enterRule(e,86,i.RULE_schemaVersion);try{this.enterOuterAlt(e,1),this.state=404,this.match(i.SCHEMA_VERSION)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}name(){let e,t=new Z(this,this._ctx,this.state);this.enterRule(t,88,i.RULE_name);try{this.enterOuterAlt(t,1),this.state=407,this._errHandler.sync(this),e=this._input.LA(1);do{this.state=406,this.match(i.ALPHA_NUMERIC),this.state=409,this._errHandler.sync(this),e=this._input.LA(1)}while(29===e)}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}static get _ATN(){return i.__ATN||(i.__ATN=(new r.ATNDeserializer).deserialize(i._serializedATN)),i.__ATN}}i.INDENT=1,i.MODEL=2,i.SCHEMA=3,i.SCHEMA_VERSION=4,i.TYPE=5,i.CONDITION=6,i.RELATIONS=7,i.DEFINE=8,i.WTH=9,i.HASH=10,i.COLON=11,i.WILDCARD=12,i.L_SQUARE=13,i.R_SQUARE=14,i.L_PARANTHESES=15,i.R_PARANTHESES=16,i.L_BRACES=17,i.R_BRACES=18,i.L_ANGLE_BRACKET=19,i.R_ANGLE_BRACKET=20,i.COMMA=21,i.CONDITION_PARAM_CONTAINER=22,i.CONDITION_PARAM_TYPE=23,i.CONDITION_SYMBOL=24,i.AND=25,i.OR=26,i.BUT_NOT=27,i.FROM=28,i.ALPHA_NUMERIC=29,i.NEWLINE=30,i.WS=31,i.EOF=r.Token.EOF,i.RULE_main=0,i.RULE_indentation=1,i.RULE_modelHeader=2,i.RULE_typeDefs=3,i.RULE_typeDef=4,i.RULE_relationDeclaration=5,i.RULE_relationDef=6,i.RULE_relationDefPartials=7,i.RULE_relationDefPartialAllOr=8,i.RULE_relationDefPartialAllAnd=9,i.RULE_relationDefPartialAllButNot=10,i.RULE_relationDefDirectAssignment=11,i.RULE_relationDefRewrite=12,i.RULE_relationDefRelationOnSameObject=13,i.RULE_relationDefRelationOnRelatedObject=14,i.RULE_relationDefOperator=15,i.RULE_relationDefOperatorAnd=16,i.RULE_relationDefOperatorOr=17,i.RULE_relationDefOperatorButNot=18,i.RULE_relationDefKeywordFrom=19,i.RULE_relationDefTypeRestriction=20,i.RULE_relationDefTypeRestrictionWithCondition=21,i.RULE_relationDefTypeRestrictionType=22,i.RULE_relationDefTypeRestrictionRelation=23,i.RULE_relationDefTypeRestrictionWildcard=24,i.RULE_relationDefTypeRestrictionUserset=25,i.RULE_relationDefGrouping=26,i.RULE_rewriteComputedusersetName=27,i.RULE_rewriteTuplesetComputedusersetName=28,i.RULE_rewriteTuplesetName=29,i.RULE_relationName=30,i.RULE_typeName=31,i.RULE_conditions=32,i.RULE_condition=33,i.RULE_conditionParameter=34,i.RULE_parameterName=35,i.RULE_conditionName=36,i.RULE_parameterType=37,i.RULE_conditionExpression=38,i.RULE_comment=39,i.RULE_multiLineComment=40,i.RULE_spacing=41,i.RULE_newline=42,i.RULE_schemaVersion=43,i.RULE_name=44,i.literalNames=[null,null,"'model'","'schema'","'1.1'","'type'","'condition'","'relations'","'define'","'with'","'#'","':'","'*'","'['","']'","'('","')'","'{'","'}'","'<'","'>'","','",null,null,null,"'and'","'or'","'but not'","'from'"],i.symbolicNames=[null,"INDENT","MODEL","SCHEMA","SCHEMA_VERSION","TYPE","CONDITION","RELATIONS","DEFINE","WTH","HASH","COLON","WILDCARD","L_SQUARE","R_SQUARE","L_PARANTHESES","R_PARANTHESES","L_BRACES","R_BRACES","L_ANGLE_BRACKET","R_ANGLE_BRACKET","COMMA","CONDITION_PARAM_CONTAINER","CONDITION_PARAM_TYPE","CONDITION_SYMBOL","AND","OR","BUT_NOT","FROM","ALPHA_NUMERIC","NEWLINE","WS"],i.ruleNames=["main","indentation","modelHeader","typeDefs","typeDef","relationDeclaration","relationDef","relationDefPartials","relationDefPartialAllOr","relationDefPartialAllAnd","relationDefPartialAllButNot","relationDefDirectAssignment","relationDefRewrite","relationDefRelationOnSameObject","relationDefRelationOnRelatedObject","relationDefOperator","relationDefOperatorAnd","relationDefOperatorOr","relationDefOperatorButNot","relationDefKeywordFrom","relationDefTypeRestriction","relationDefTypeRestrictionWithCondition","relationDefTypeRestrictionType","relationDefTypeRestrictionRelation","relationDefTypeRestrictionWildcard","relationDefTypeRestrictionUserset","relationDefGrouping","rewriteComputedusersetName","rewriteTuplesetComputedusersetName","rewriteTuplesetName","relationName","typeName","conditions","condition","conditionParameter","parameterName","conditionName","parameterType","conditionExpression","comment","multiLineComment","spacing","newline","schemaVersion","name"],i._serializedATN=[4,1,31,412,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,1,0,1,0,1,0,1,0,3,0,95,8,0,1,0,1,0,1,1,1,1,1,2,1,2,1,2,3,2,104,8,2,1,2,1,2,3,2,108,8,2,1,2,1,2,1,2,3,2,113,8,2,1,2,1,2,1,2,1,2,1,2,3,2,120,8,2,1,3,5,3,123,8,3,10,3,12,3,126,9,3,1,4,1,4,1,4,3,4,131,8,4,1,4,1,4,1,4,1,4,1,4,3,4,138,8,4,1,4,1,4,1,4,3,4,143,8,4,1,4,4,4,146,8,4,11,4,12,4,147,3,4,150,8,4,1,5,1,5,1,5,3,5,155,8,5,1,5,1,5,1,5,1,5,1,5,3,5,162,8,5,1,5,1,5,3,5,166,8,5,1,5,1,5,3,5,170,8,5,1,6,1,6,3,6,174,8,6,1,6,3,6,177,8,6,1,7,1,7,1,7,3,7,182,8,7,1,8,1,8,1,8,1,8,1,8,4,8,189,8,8,11,8,12,8,190,1,9,1,9,1,9,1,9,1,9,4,9,198,8,9,11,9,12,9,199,1,10,1,10,1,10,1,10,1,10,4,10,207,8,10,11,10,12,10,208,1,11,1,11,3,11,213,8,11,1,11,1,11,3,11,217,8,11,1,11,1,11,3,11,221,8,11,1,11,5,11,224,8,11,10,11,12,11,227,9,11,1,11,3,11,230,8,11,1,11,1,11,1,12,1,12,3,12,236,8,12,1,13,1,13,1,14,1,14,1,14,1,14,1,14,1,14,1,15,1,15,1,15,3,15,249,8,15,1,16,1,16,1,17,1,17,1,18,1,18,1,19,1,19,1,20,1,20,1,20,1,20,3,20,263,8,20,1,21,1,21,1,21,3,21,268,8,21,1,21,1,21,1,21,1,21,1,21,1,22,1,22,1,23,1,23,1,24,1,24,1,24,1,24,3,24,283,8,24,1,25,1,25,1,25,1,25,1,26,1,26,1,27,1,27,1,28,1,28,1,29,1,29,1,30,1,30,1,31,1,31,1,32,5,32,302,8,32,10,32,12,32,305,9,32,1,33,1,33,1,33,3,33,310,8,33,1,33,1,33,1,33,1,33,1,33,3,33,317,8,33,1,33,1,33,1,33,3,33,322,8,33,1,33,1,33,3,33,326,8,33,1,33,1,33,3,33,330,8,33,5,33,332,8,33,10,33,12,33,335,9,33,1,33,1,33,3,33,339,8,33,1,33,1,33,1,33,1,33,1,34,1,34,3,34,347,8,34,1,34,1,34,3,34,351,8,34,1,34,1,34,1,35,1,35,1,36,1,36,1,37,1,37,1,37,1,37,1,37,3,37,364,8,37,1,38,1,38,5,38,368,8,38,10,38,12,38,371,9,38,1,39,5,39,374,8,39,10,39,12,39,377,9,39,1,39,1,39,5,39,381,8,39,10,39,12,39,384,9,39,1,40,1,40,1,40,1,40,5,40,390,8,40,10,40,12,40,393,9,40,1,41,4,41,396,8,41,11,41,12,41,397,1,42,4,42,401,8,42,11,42,12,42,402,1,43,1,43,1,44,4,44,408,8,44,11,44,12,44,409,1,44,0,0,45,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,0,2,1,0,18,18,1,0,30,30,421,0,90,1,0,0,0,2,98,1,0,0,0,4,103,1,0,0,0,6,124,1,0,0,0,8,130,1,0,0,0,10,154,1,0,0,0,12,173,1,0,0,0,14,181,1,0,0,0,16,188,1,0,0,0,18,197,1,0,0,0,20,206,1,0,0,0,22,210,1,0,0,0,24,235,1,0,0,0,26,237,1,0,0,0,28,239,1,0,0,0,30,248,1,0,0,0,32,250,1,0,0,0,34,252,1,0,0,0,36,254,1,0,0,0,38,256,1,0,0,0,40,262,1,0,0,0,42,267,1,0,0,0,44,274,1,0,0,0,46,276,1,0,0,0,48,278,1,0,0,0,50,284,1,0,0,0,52,288,1,0,0,0,54,290,1,0,0,0,56,292,1,0,0,0,58,294,1,0,0,0,60,296,1,0,0,0,62,298,1,0,0,0,64,303,1,0,0,0,66,309,1,0,0,0,68,344,1,0,0,0,70,354,1,0,0,0,72,356,1,0,0,0,74,363,1,0,0,0,76,369,1,0,0,0,78,375,1,0,0,0,80,385,1,0,0,0,82,395,1,0,0,0,84,400,1,0,0,0,86,404,1,0,0,0,88,407,1,0,0,0,90,91,3,4,2,0,91,92,3,6,3,0,92,94,3,64,32,0,93,95,3,84,42,0,94,93,1,0,0,0,94,95,1,0,0,0,95,96,1,0,0,0,96,97,5,0,0,1,97,1,1,0,0,0,98,99,5,1,0,0,99,3,1,0,0,0,100,101,3,80,40,0,101,102,3,84,42,0,102,104,1,0,0,0,103,100,1,0,0,0,103,104,1,0,0,0,104,105,1,0,0,0,105,107,5,2,0,0,106,108,3,82,41,0,107,106,1,0,0,0,107,108,1,0,0,0,108,112,1,0,0,0,109,110,3,84,42,0,110,111,3,80,40,0,111,113,1,0,0,0,112,109,1,0,0,0,112,113,1,0,0,0,113,114,1,0,0,0,114,115,3,2,1,0,115,116,5,3,0,0,116,117,3,82,41,0,117,119,3,86,43,0,118,120,3,82,41,0,119,118,1,0,0,0,119,120,1,0,0,0,120,5,1,0,0,0,121,123,3,8,4,0,122,121,1,0,0,0,123,126,1,0,0,0,124,122,1,0,0,0,124,125,1,0,0,0,125,7,1,0,0,0,126,124,1,0,0,0,127,128,3,84,42,0,128,129,3,80,40,0,129,131,1,0,0,0,130,127,1,0,0,0,130,131,1,0,0,0,131,132,1,0,0,0,132,133,3,84,42,0,133,134,5,5,0,0,134,135,3,82,41,0,135,137,3,62,31,0,136,138,3,82,41,0,137,136,1,0,0,0,137,138,1,0,0,0,138,149,1,0,0,0,139,140,3,2,1,0,140,142,5,7,0,0,141,143,3,82,41,0,142,141,1,0,0,0,142,143,1,0,0,0,143,145,1,0,0,0,144,146,3,10,5,0,145,144,1,0,0,0,146,147,1,0,0,0,147,145,1,0,0,0,147,148,1,0,0,0,148,150,1,0,0,0,149,139,1,0,0,0,149,150,1,0,0,0,150,9,1,0,0,0,151,152,3,84,42,0,152,153,3,80,40,0,153,155,1,0,0,0,154,151,1,0,0,0,154,155,1,0,0,0,155,156,1,0,0,0,156,157,3,2,1,0,157,158,5,8,0,0,158,159,3,82,41,0,159,161,3,60,30,0,160,162,3,82,41,0,161,160,1,0,0,0,161,162,1,0,0,0,162,163,1,0,0,0,163,165,5,11,0,0,164,166,3,82,41,0,165,164,1,0,0,0,165,166,1,0,0,0,166,167,1,0,0,0,167,169,3,12,6,0,168,170,3,82,41,0,169,168,1,0,0,0,169,170,1,0,0,0,170,11,1,0,0,0,171,174,3,22,11,0,172,174,3,52,26,0,173,171,1,0,0,0,173,172,1,0,0,0,174,176,1,0,0,0,175,177,3,14,7,0,176,175,1,0,0,0,176,177,1,0,0,0,177,13,1,0,0,0,178,182,3,16,8,0,179,182,3,18,9,0,180,182,3,20,10,0,181,178,1,0,0,0,181,179,1,0,0,0,181,180,1,0,0,0,182,15,1,0,0,0,183,184,3,82,41,0,184,185,3,34,17,0,185,186,3,82,41,0,186,187,3,52,26,0,187,189,1,0,0,0,188,183,1,0,0,0,189,190,1,0,0,0,190,188,1,0,0,0,190,191,1,0,0,0,191,17,1,0,0,0,192,193,3,82,41,0,193,194,3,32,16,0,194,195,3,82,41,0,195,196,3,52,26,0,196,198,1,0,0,0,197,192,1,0,0,0,198,199,1,0,0,0,199,197,1,0,0,0,199,200,1,0,0,0,200,19,1,0,0,0,201,202,3,82,41,0,202,203,3,36,18,0,203,204,3,82,41,0,204,205,3,52,26,0,205,207,1,0,0,0,206,201,1,0,0,0,207,208,1,0,0,0,208,206,1,0,0,0,208,209,1,0,0,0,209,21,1,0,0,0,210,212,5,13,0,0,211,213,3,82,41,0,212,211,1,0,0,0,212,213,1,0,0,0,213,214,1,0,0,0,214,216,3,40,20,0,215,217,3,82,41,0,216,215,1,0,0,0,216,217,1,0,0,0,217,225,1,0,0,0,218,220,5,21,0,0,219,221,3,82,41,0,220,219,1,0,0,0,220,221,1,0,0,0,221,222,1,0,0,0,222,224,3,40,20,0,223,218,1,0,0,0,224,227,1,0,0,0,225,223,1,0,0,0,225,226,1,0,0,0,226,229,1,0,0,0,227,225,1,0,0,0,228,230,3,82,41,0,229,228,1,0,0,0,229,230,1,0,0,0,230,231,1,0,0,0,231,232,5,14,0,0,232,23,1,0,0,0,233,236,3,26,13,0,234,236,3,28,14,0,235,233,1,0,0,0,235,234,1,0,0,0,236,25,1,0,0,0,237,238,3,54,27,0,238,27,1,0,0,0,239,240,3,56,28,0,240,241,3,82,41,0,241,242,3,38,19,0,242,243,3,82,41,0,243,244,3,58,29,0,244,29,1,0,0,0,245,249,3,34,17,0,246,249,3,32,16,0,247,249,3,36,18,0,248,245,1,0,0,0,248,246,1,0,0,0,248,247,1,0,0,0,249,31,1,0,0,0,250,251,5,25,0,0,251,33,1,0,0,0,252,253,5,26,0,0,253,35,1,0,0,0,254,255,5,27,0,0,255,37,1,0,0,0,256,257,5,28,0,0,257,39,1,0,0,0,258,263,3,44,22,0,259,263,3,48,24,0,260,263,3,50,25,0,261,263,3,42,21,0,262,258,1,0,0,0,262,259,1,0,0,0,262,260,1,0,0,0,262,261,1,0,0,0,263,41,1,0,0,0,264,268,3,44,22,0,265,268,3,48,24,0,266,268,3,50,25,0,267,264,1,0,0,0,267,265,1,0,0,0,267,266,1,0,0,0,268,269,1,0,0,0,269,270,3,82,41,0,270,271,5,9,0,0,271,272,3,82,41,0,272,273,3,72,36,0,273,43,1,0,0,0,274,275,3,88,44,0,275,45,1,0,0,0,276,277,3,88,44,0,277,47,1,0,0,0,278,279,3,44,22,0,279,280,5,11,0,0,280,282,5,12,0,0,281,283,3,82,41,0,282,281,1,0,0,0,282,283,1,0,0,0,283,49,1,0,0,0,284,285,3,44,22,0,285,286,5,10,0,0,286,287,3,46,23,0,287,51,1,0,0,0,288,289,3,24,12,0,289,53,1,0,0,0,290,291,3,88,44,0,291,55,1,0,0,0,292,293,3,88,44,0,293,57,1,0,0,0,294,295,3,88,44,0,295,59,1,0,0,0,296,297,3,88,44,0,297,61,1,0,0,0,298,299,3,88,44,0,299,63,1,0,0,0,300,302,3,66,33,0,301,300,1,0,0,0,302,305,1,0,0,0,303,301,1,0,0,0,303,304,1,0,0,0,304,65,1,0,0,0,305,303,1,0,0,0,306,307,3,84,42,0,307,308,3,80,40,0,308,310,1,0,0,0,309,306,1,0,0,0,309,310,1,0,0,0,310,311,1,0,0,0,311,312,3,84,42,0,312,313,5,6,0,0,313,314,3,82,41,0,314,316,3,72,36,0,315,317,3,82,41,0,316,315,1,0,0,0,316,317,1,0,0,0,317,318,1,0,0,0,318,319,5,15,0,0,319,321,3,68,34,0,320,322,3,82,41,0,321,320,1,0,0,0,321,322,1,0,0,0,322,333,1,0,0,0,323,325,5,21,0,0,324,326,3,82,41,0,325,324,1,0,0,0,325,326,1,0,0,0,326,327,1,0,0,0,327,329,3,68,34,0,328,330,3,82,41,0,329,328,1,0,0,0,329,330,1,0,0,0,330,332,1,0,0,0,331,323,1,0,0,0,332,335,1,0,0,0,333,331,1,0,0,0,333,334,1,0,0,0,334,336,1,0,0,0,335,333,1,0,0,0,336,338,5,16,0,0,337,339,3,82,41,0,338,337,1,0,0,0,338,339,1,0,0,0,339,340,1,0,0,0,340,341,5,17,0,0,341,342,3,76,38,0,342,343,5,18,0,0,343,67,1,0,0,0,344,346,3,70,35,0,345,347,3,82,41,0,346,345,1,0,0,0,346,347,1,0,0,0,347,348,1,0,0,0,348,350,5,11,0,0,349,351,3,82,41,0,350,349,1,0,0,0,350,351,1,0,0,0,351,352,1,0,0,0,352,353,3,74,37,0,353,69,1,0,0,0,354,355,3,88,44,0,355,71,1,0,0,0,356,357,3,88,44,0,357,73,1,0,0,0,358,364,5,23,0,0,359,360,5,22,0,0,360,361,5,19,0,0,361,362,5,23,0,0,362,364,5,20,0,0,363,358,1,0,0,0,363,359,1,0,0,0,364,75,1,0,0,0,365,368,5,24,0,0,366,368,8,0,0,0,367,365,1,0,0,0,367,366,1,0,0,0,368,371,1,0,0,0,369,367,1,0,0,0,369,370,1,0,0,0,370,77,1,0,0,0,371,369,1,0,0,0,372,374,5,31,0,0,373,372,1,0,0,0,374,377,1,0,0,0,375,373,1,0,0,0,375,376,1,0,0,0,376,378,1,0,0,0,377,375,1,0,0,0,378,382,5,10,0,0,379,381,8,1,0,0,380,379,1,0,0,0,381,384,1,0,0,0,382,380,1,0,0,0,382,383,1,0,0,0,383,79,1,0,0,0,384,382,1,0,0,0,385,391,3,78,39,0,386,387,3,84,42,0,387,388,3,78,39,0,388,390,1,0,0,0,389,386,1,0,0,0,390,393,1,0,0,0,391,389,1,0,0,0,391,392,1,0,0,0,392,81,1,0,0,0,393,391,1,0,0,0,394,396,5,31,0,0,395,394,1,0,0,0,396,397,1,0,0,0,397,395,1,0,0,0,397,398,1,0,0,0,398,83,1,0,0,0,399,401,5,30,0,0,400,399,1,0,0,0,401,402,1,0,0,0,402,400,1,0,0,0,402,403,1,0,0,0,403,85,1,0,0,0,404,405,5,4,0,0,405,87,1,0,0,0,406,408,5,29,0,0,407,406,1,0,0,0,408,409,1,0,0,0,409,407,1,0,0,0,409,410,1,0,0,0,410,89,1,0,0,0,50,94,103,107,112,119,124,130,137,142,147,149,154,161,165,169,173,176,181,190,199,208,212,216,220,225,229,235,248,262,267,282,303,309,316,321,325,329,333,338,346,350,363,367,369,375,382,391,397,402,409],i.DecisionsToDFA=i._ATN.decisionToState.map(((e,t)=>new r.DFA(e,t))),t.default=i;class s extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}modelHeader(){return this.getTypedRuleContext(a,0)}typeDefs(){return this.getTypedRuleContext(l,0)}conditions(){return this.getTypedRuleContext(F,0)}EOF(){return this.getToken(i.EOF,0)}newline(){return this.getTypedRuleContext(K,0)}get ruleIndex(){return i.RULE_main}enterRule(e){e.enterMain&&e.enterMain(this)}exitRule(e){e.exitMain&&e.exitMain(this)}}t.MainContext=s;class o extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}INDENT(){return this.getToken(i.INDENT,0)}get ruleIndex(){return i.RULE_indentation}enterRule(e){e.enterIndentation&&e.enterIndentation(this)}exitRule(e){e.exitIndentation&&e.exitIndentation(this)}}t.IndentationContext=o;class a extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}MODEL(){return this.getToken(i.MODEL,0)}indentation(){return this.getTypedRuleContext(o,0)}SCHEMA(){return this.getToken(i.SCHEMA,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}schemaVersion(){return this.getTypedRuleContext(Y,0)}multiLineComment_list(){return this.getTypedRuleContexts(G)}multiLineComment(e){return this.getTypedRuleContext(G,e)}newline_list(){return this.getTypedRuleContexts(K)}newline(e){return this.getTypedRuleContext(K,e)}get ruleIndex(){return i.RULE_modelHeader}enterRule(e){e.enterModelHeader&&e.enterModelHeader(this)}exitRule(e){e.exitModelHeader&&e.exitModelHeader(this)}}t.ModelHeaderContext=a;class l extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}typeDef_list(){return this.getTypedRuleContexts(c)}typeDef(e){return this.getTypedRuleContext(c,e)}get ruleIndex(){return i.RULE_typeDefs}enterRule(e){e.enterTypeDefs&&e.enterTypeDefs(this)}exitRule(e){e.exitTypeDefs&&e.exitTypeDefs(this)}}t.TypeDefsContext=l;class c extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}newline_list(){return this.getTypedRuleContexts(K)}newline(e){return this.getTypedRuleContext(K,e)}TYPE(){return this.getToken(i.TYPE,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}typeName(){return this.getTypedRuleContext(M,0)}multiLineComment(){return this.getTypedRuleContext(G,0)}indentation(){return this.getTypedRuleContext(o,0)}RELATIONS(){return this.getToken(i.RELATIONS,0)}relationDeclaration_list(){return this.getTypedRuleContexts(u)}relationDeclaration(e){return this.getTypedRuleContext(u,e)}get ruleIndex(){return i.RULE_typeDef}enterRule(e){e.enterTypeDef&&e.enterTypeDef(this)}exitRule(e){e.exitTypeDef&&e.exitTypeDef(this)}}t.TypeDefContext=c;class u extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}indentation(){return this.getTypedRuleContext(o,0)}DEFINE(){return this.getToken(i.DEFINE,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}relationName(){return this.getTypedRuleContext(P,0)}COLON(){return this.getToken(i.COLON,0)}relationDef(){return this.getTypedRuleContext(d,0)}newline(){return this.getTypedRuleContext(K,0)}multiLineComment(){return this.getTypedRuleContext(G,0)}get ruleIndex(){return i.RULE_relationDeclaration}enterRule(e){e.enterRelationDeclaration&&e.enterRelationDeclaration(this)}exitRule(e){e.exitRelationDeclaration&&e.exitRelationDeclaration(this)}}t.RelationDeclarationContext=u;class d extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefDirectAssignment(){return this.getTypedRuleContext(m,0)}relationDefGrouping(){return this.getTypedRuleContext(N,0)}relationDefPartials(){return this.getTypedRuleContext(h,0)}get ruleIndex(){return i.RULE_relationDef}enterRule(e){e.enterRelationDef&&e.enterRelationDef(this)}exitRule(e){e.exitRelationDef&&e.exitRelationDef(this)}}t.RelationDefContext=d;class h extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefPartialAllOr(){return this.getTypedRuleContext(p,0)}relationDefPartialAllAnd(){return this.getTypedRuleContext(f,0)}relationDefPartialAllButNot(){return this.getTypedRuleContext(g,0)}get ruleIndex(){return i.RULE_relationDefPartials}enterRule(e){e.enterRelationDefPartials&&e.enterRelationDefPartials(this)}exitRule(e){e.exitRelationDefPartials&&e.exitRelationDefPartials(this)}}t.RelationDefPartialsContext=h;class p extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}relationDefOperatorOr_list(){return this.getTypedRuleContexts(T)}relationDefOperatorOr(e){return this.getTypedRuleContext(T,e)}relationDefGrouping_list(){return this.getTypedRuleContexts(N)}relationDefGrouping(e){return this.getTypedRuleContext(N,e)}get ruleIndex(){return i.RULE_relationDefPartialAllOr}enterRule(e){e.enterRelationDefPartialAllOr&&e.enterRelationDefPartialAllOr(this)}exitRule(e){e.exitRelationDefPartialAllOr&&e.exitRelationDefPartialAllOr(this)}}t.RelationDefPartialAllOrContext=p;class f extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}relationDefOperatorAnd_list(){return this.getTypedRuleContexts(_)}relationDefOperatorAnd(e){return this.getTypedRuleContext(_,e)}relationDefGrouping_list(){return this.getTypedRuleContexts(N)}relationDefGrouping(e){return this.getTypedRuleContext(N,e)}get ruleIndex(){return i.RULE_relationDefPartialAllAnd}enterRule(e){e.enterRelationDefPartialAllAnd&&e.enterRelationDefPartialAllAnd(this)}exitRule(e){e.exitRelationDefPartialAllAnd&&e.exitRelationDefPartialAllAnd(this)}}t.RelationDefPartialAllAndContext=f;class g extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}relationDefOperatorButNot_list(){return this.getTypedRuleContexts(x)}relationDefOperatorButNot(e){return this.getTypedRuleContext(x,e)}relationDefGrouping_list(){return this.getTypedRuleContexts(N)}relationDefGrouping(e){return this.getTypedRuleContext(N,e)}get ruleIndex(){return i.RULE_relationDefPartialAllButNot}enterRule(e){e.enterRelationDefPartialAllButNot&&e.enterRelationDefPartialAllButNot(this)}exitRule(e){e.exitRelationDefPartialAllButNot&&e.exitRelationDefPartialAllButNot(this)}}t.RelationDefPartialAllButNotContext=g;class m extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}L_SQUARE(){return this.getToken(i.L_SQUARE,0)}relationDefTypeRestriction_list(){return this.getTypedRuleContexts(S)}relationDefTypeRestriction(e){return this.getTypedRuleContext(S,e)}R_SQUARE(){return this.getToken(i.R_SQUARE,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}COMMA_list(){return this.getTokens(i.COMMA)}COMMA(e){return this.getToken(i.COMMA,e)}get ruleIndex(){return i.RULE_relationDefDirectAssignment}enterRule(e){e.enterRelationDefDirectAssignment&&e.enterRelationDefDirectAssignment(this)}exitRule(e){e.exitRelationDefDirectAssignment&&e.exitRelationDefDirectAssignment(this)}}t.RelationDefDirectAssignmentContext=m;class y extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefRelationOnSameObject(){return this.getTypedRuleContext(b,0)}relationDefRelationOnRelatedObject(){return this.getTypedRuleContext(v,0)}get ruleIndex(){return i.RULE_relationDefRewrite}enterRule(e){e.enterRelationDefRewrite&&e.enterRelationDefRewrite(this)}exitRule(e){e.exitRelationDefRewrite&&e.exitRelationDefRewrite(this)}}t.RelationDefRewriteContext=y;class b extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}rewriteComputedusersetName(){return this.getTypedRuleContext(I,0)}get ruleIndex(){return i.RULE_relationDefRelationOnSameObject}enterRule(e){e.enterRelationDefRelationOnSameObject&&e.enterRelationDefRelationOnSameObject(this)}exitRule(e){e.exitRelationDefRelationOnSameObject&&e.exitRelationDefRelationOnSameObject(this)}}t.RelationDefRelationOnSameObjectContext=b;class v extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}rewriteTuplesetComputedusersetName(){return this.getTypedRuleContext(L,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}relationDefKeywordFrom(){return this.getTypedRuleContext(w,0)}rewriteTuplesetName(){return this.getTypedRuleContext(D,0)}get ruleIndex(){return i.RULE_relationDefRelationOnRelatedObject}enterRule(e){e.enterRelationDefRelationOnRelatedObject&&e.enterRelationDefRelationOnRelatedObject(this)}exitRule(e){e.exitRelationDefRelationOnRelatedObject&&e.exitRelationDefRelationOnRelatedObject(this)}}t.RelationDefRelationOnRelatedObjectContext=v;class E extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefOperatorOr(){return this.getTypedRuleContext(T,0)}relationDefOperatorAnd(){return this.getTypedRuleContext(_,0)}relationDefOperatorButNot(){return this.getTypedRuleContext(x,0)}get ruleIndex(){return i.RULE_relationDefOperator}enterRule(e){e.enterRelationDefOperator&&e.enterRelationDefOperator(this)}exitRule(e){e.exitRelationDefOperator&&e.exitRelationDefOperator(this)}}t.RelationDefOperatorContext=E;class _ extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}AND(){return this.getToken(i.AND,0)}get ruleIndex(){return i.RULE_relationDefOperatorAnd}enterRule(e){e.enterRelationDefOperatorAnd&&e.enterRelationDefOperatorAnd(this)}exitRule(e){e.exitRelationDefOperatorAnd&&e.exitRelationDefOperatorAnd(this)}}t.RelationDefOperatorAndContext=_;class T extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}OR(){return this.getToken(i.OR,0)}get ruleIndex(){return i.RULE_relationDefOperatorOr}enterRule(e){e.enterRelationDefOperatorOr&&e.enterRelationDefOperatorOr(this)}exitRule(e){e.exitRelationDefOperatorOr&&e.exitRelationDefOperatorOr(this)}}t.RelationDefOperatorOrContext=T;class x extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}BUT_NOT(){return this.getToken(i.BUT_NOT,0)}get ruleIndex(){return i.RULE_relationDefOperatorButNot}enterRule(e){e.enterRelationDefOperatorButNot&&e.enterRelationDefOperatorButNot(this)}exitRule(e){e.exitRelationDefOperatorButNot&&e.exitRelationDefOperatorButNot(this)}}t.RelationDefOperatorButNotContext=x;class w extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}FROM(){return this.getToken(i.FROM,0)}get ruleIndex(){return i.RULE_relationDefKeywordFrom}enterRule(e){e.enterRelationDefKeywordFrom&&e.enterRelationDefKeywordFrom(this)}exitRule(e){e.exitRelationDefKeywordFrom&&e.exitRelationDefKeywordFrom(this)}}t.RelationDefKeywordFromContext=w;class S extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefTypeRestrictionType(){return this.getTypedRuleContext(k,0)}relationDefTypeRestrictionWildcard(){return this.getTypedRuleContext(O,0)}relationDefTypeRestrictionUserset(){return this.getTypedRuleContext(A,0)}relationDefTypeRestrictionWithCondition(){return this.getTypedRuleContext(R,0)}get ruleIndex(){return i.RULE_relationDefTypeRestriction}enterRule(e){e.enterRelationDefTypeRestriction&&e.enterRelationDefTypeRestriction(this)}exitRule(e){e.exitRelationDefTypeRestriction&&e.exitRelationDefTypeRestriction(this)}}t.RelationDefTypeRestrictionContext=S;class R extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}WTH(){return this.getToken(i.WTH,0)}conditionName(){return this.getTypedRuleContext(H,0)}relationDefTypeRestrictionType(){return this.getTypedRuleContext(k,0)}relationDefTypeRestrictionWildcard(){return this.getTypedRuleContext(O,0)}relationDefTypeRestrictionUserset(){return this.getTypedRuleContext(A,0)}get ruleIndex(){return i.RULE_relationDefTypeRestrictionWithCondition}enterRule(e){e.enterRelationDefTypeRestrictionWithCondition&&e.enterRelationDefTypeRestrictionWithCondition(this)}exitRule(e){e.exitRelationDefTypeRestrictionWithCondition&&e.exitRelationDefTypeRestrictionWithCondition(this)}}t.RelationDefTypeRestrictionWithConditionContext=R;class k extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_relationDefTypeRestrictionType}enterRule(e){e.enterRelationDefTypeRestrictionType&&e.enterRelationDefTypeRestrictionType(this)}exitRule(e){e.exitRelationDefTypeRestrictionType&&e.exitRelationDefTypeRestrictionType(this)}}t.RelationDefTypeRestrictionTypeContext=k;class C extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_relationDefTypeRestrictionRelation}enterRule(e){e.enterRelationDefTypeRestrictionRelation&&e.enterRelationDefTypeRestrictionRelation(this)}exitRule(e){e.exitRelationDefTypeRestrictionRelation&&e.exitRelationDefTypeRestrictionRelation(this)}}t.RelationDefTypeRestrictionRelationContext=C;class O extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefTypeRestrictionType(){return this.getTypedRuleContext(k,0)}COLON(){return this.getToken(i.COLON,0)}WILDCARD(){return this.getToken(i.WILDCARD,0)}spacing(){return this.getTypedRuleContext(W,0)}get ruleIndex(){return i.RULE_relationDefTypeRestrictionWildcard}enterRule(e){e.enterRelationDefTypeRestrictionWildcard&&e.enterRelationDefTypeRestrictionWildcard(this)}exitRule(e){e.exitRelationDefTypeRestrictionWildcard&&e.exitRelationDefTypeRestrictionWildcard(this)}}t.RelationDefTypeRestrictionWildcardContext=O;class A extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefTypeRestrictionType(){return this.getTypedRuleContext(k,0)}HASH(){return this.getToken(i.HASH,0)}relationDefTypeRestrictionRelation(){return this.getTypedRuleContext(C,0)}get ruleIndex(){return i.RULE_relationDefTypeRestrictionUserset}enterRule(e){e.enterRelationDefTypeRestrictionUserset&&e.enterRelationDefTypeRestrictionUserset(this)}exitRule(e){e.exitRelationDefTypeRestrictionUserset&&e.exitRelationDefTypeRestrictionUserset(this)}}t.RelationDefTypeRestrictionUsersetContext=A;class N extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefRewrite(){return this.getTypedRuleContext(y,0)}get ruleIndex(){return i.RULE_relationDefGrouping}enterRule(e){e.enterRelationDefGrouping&&e.enterRelationDefGrouping(this)}exitRule(e){e.exitRelationDefGrouping&&e.exitRelationDefGrouping(this)}}t.RelationDefGroupingContext=N;class I extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_rewriteComputedusersetName}enterRule(e){e.enterRewriteComputedusersetName&&e.enterRewriteComputedusersetName(this)}exitRule(e){e.exitRewriteComputedusersetName&&e.exitRewriteComputedusersetName(this)}}t.RewriteComputedusersetNameContext=I;class L extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_rewriteTuplesetComputedusersetName}enterRule(e){e.enterRewriteTuplesetComputedusersetName&&e.enterRewriteTuplesetComputedusersetName(this)}exitRule(e){e.exitRewriteTuplesetComputedusersetName&&e.exitRewriteTuplesetComputedusersetName(this)}}t.RewriteTuplesetComputedusersetNameContext=L;class D extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_rewriteTuplesetName}enterRule(e){e.enterRewriteTuplesetName&&e.enterRewriteTuplesetName(this)}exitRule(e){e.exitRewriteTuplesetName&&e.exitRewriteTuplesetName(this)}}t.RewriteTuplesetNameContext=D;class P extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_relationName}enterRule(e){e.enterRelationName&&e.enterRelationName(this)}exitRule(e){e.exitRelationName&&e.exitRelationName(this)}}t.RelationNameContext=P;class M extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_typeName}enterRule(e){e.enterTypeName&&e.enterTypeName(this)}exitRule(e){e.exitTypeName&&e.exitTypeName(this)}}t.TypeNameContext=M;class F extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}condition_list(){return this.getTypedRuleContexts(U)}condition(e){return this.getTypedRuleContext(U,e)}get ruleIndex(){return i.RULE_conditions}enterRule(e){e.enterConditions&&e.enterConditions(this)}exitRule(e){e.exitConditions&&e.exitConditions(this)}}t.ConditionsContext=F;class U extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}newline_list(){return this.getTypedRuleContexts(K)}newline(e){return this.getTypedRuleContext(K,e)}CONDITION(){return this.getToken(i.CONDITION,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}conditionName(){return this.getTypedRuleContext(H,0)}L_PARANTHESES(){return this.getToken(i.L_PARANTHESES,0)}conditionParameter_list(){return this.getTypedRuleContexts(j)}conditionParameter(e){return this.getTypedRuleContext(j,e)}R_PARANTHESES(){return this.getToken(i.R_PARANTHESES,0)}L_BRACES(){return this.getToken(i.L_BRACES,0)}conditionExpression(){return this.getTypedRuleContext(z,0)}R_BRACES(){return this.getToken(i.R_BRACES,0)}multiLineComment(){return this.getTypedRuleContext(G,0)}COMMA_list(){return this.getTokens(i.COMMA)}COMMA(e){return this.getToken(i.COMMA,e)}get ruleIndex(){return i.RULE_condition}enterRule(e){e.enterCondition&&e.enterCondition(this)}exitRule(e){e.exitCondition&&e.exitCondition(this)}}t.ConditionContext=U;class j extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}parameterName(){return this.getTypedRuleContext(B,0)}COLON(){return this.getToken(i.COLON,0)}parameterType(){return this.getTypedRuleContext($,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}get ruleIndex(){return i.RULE_conditionParameter}enterRule(e){e.enterConditionParameter&&e.enterConditionParameter(this)}exitRule(e){e.exitConditionParameter&&e.exitConditionParameter(this)}}t.ConditionParameterContext=j;class B extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_parameterName}enterRule(e){e.enterParameterName&&e.enterParameterName(this)}exitRule(e){e.exitParameterName&&e.exitParameterName(this)}}t.ParameterNameContext=B;class H extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_conditionName}enterRule(e){e.enterConditionName&&e.enterConditionName(this)}exitRule(e){e.exitConditionName&&e.exitConditionName(this)}}t.ConditionNameContext=H;class $ extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}CONDITION_PARAM_TYPE(){return this.getToken(i.CONDITION_PARAM_TYPE,0)}CONDITION_PARAM_CONTAINER(){return this.getToken(i.CONDITION_PARAM_CONTAINER,0)}L_ANGLE_BRACKET(){return this.getToken(i.L_ANGLE_BRACKET,0)}R_ANGLE_BRACKET(){return this.getToken(i.R_ANGLE_BRACKET,0)}get ruleIndex(){return i.RULE_parameterType}enterRule(e){e.enterParameterType&&e.enterParameterType(this)}exitRule(e){e.exitParameterType&&e.exitParameterType(this)}}t.ParameterTypeContext=$;class z extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}CONDITION_SYMBOL_list(){return this.getTokens(i.CONDITION_SYMBOL)}CONDITION_SYMBOL(e){return this.getToken(i.CONDITION_SYMBOL,e)}R_BRACES_list(){return this.getTokens(i.R_BRACES)}R_BRACES(e){return this.getToken(i.R_BRACES,e)}get ruleIndex(){return i.RULE_conditionExpression}enterRule(e){e.enterConditionExpression&&e.enterConditionExpression(this)}exitRule(e){e.exitConditionExpression&&e.exitConditionExpression(this)}}t.ConditionExpressionContext=z;class V extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}HASH(){return this.getToken(i.HASH,0)}WS_list(){return this.getTokens(i.WS)}WS(e){return this.getToken(i.WS,e)}NEWLINE_list(){return this.getTokens(i.NEWLINE)}NEWLINE(e){return this.getToken(i.NEWLINE,e)}get ruleIndex(){return i.RULE_comment}enterRule(e){e.enterComment&&e.enterComment(this)}exitRule(e){e.exitComment&&e.exitComment(this)}}t.CommentContext=V;class G extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}comment_list(){return this.getTypedRuleContexts(V)}comment(e){return this.getTypedRuleContext(V,e)}newline_list(){return this.getTypedRuleContexts(K)}newline(e){return this.getTypedRuleContext(K,e)}get ruleIndex(){return i.RULE_multiLineComment}enterRule(e){e.enterMultiLineComment&&e.enterMultiLineComment(this)}exitRule(e){e.exitMultiLineComment&&e.exitMultiLineComment(this)}}t.MultiLineCommentContext=G;class W extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}WS_list(){return this.getTokens(i.WS)}WS(e){return this.getToken(i.WS,e)}get ruleIndex(){return i.RULE_spacing}enterRule(e){e.enterSpacing&&e.enterSpacing(this)}exitRule(e){e.exitSpacing&&e.exitSpacing(this)}}t.SpacingContext=W;class K extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}NEWLINE_list(){return this.getTokens(i.NEWLINE)}NEWLINE(e){return this.getToken(i.NEWLINE,e)}get ruleIndex(){return i.RULE_newline}enterRule(e){e.enterNewline&&e.enterNewline(this)}exitRule(e){e.exitNewline&&e.exitNewline(this)}}t.NewlineContext=K;class Y extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}SCHEMA_VERSION(){return this.getToken(i.SCHEMA_VERSION,0)}get ruleIndex(){return i.RULE_schemaVersion}enterRule(e){e.enterSchemaVersion&&e.enterSchemaVersion(this)}exitRule(e){e.exitSchemaVersion&&e.exitSchemaVersion(this)}}t.SchemaVersionContext=Y;class Z extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}ALPHA_NUMERIC_list(){return this.getTokens(i.ALPHA_NUMERIC)}ALPHA_NUMERIC(e){return this.getToken(i.ALPHA_NUMERIC,e)}get ruleIndex(){return i.RULE_name}enterRule(e){e.enterName&&e.enterName(this)}exitRule(e){e.exitName&&e.exitName(this)}}t.NameContext=Z},17752:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(92529);class i extends r.ParseTreeListener{}t.default=i},40801:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.errors=t.transformer=t.validator=void 0,t.validator=s(n(95289)),t.transformer=s(n(30620)),t.errors=s(n(80104))},37351:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.transformDSLToJSON=t.transformDSLToJSONObject=t.parseDSL=void 0;const a=s(n(92529)),l=n(92529),c=o(n(17752)),u=o(n(7538)),d=o(n(73247)),h=n(80104);var p;!function(e){e.RELATION_DEFINITION_OPERATOR_NONE="",e.RELATION_DEFINITION_OPERATOR_OR="or",e.RELATION_DEFINITION_OPERATOR_AND="and",e.RELATION_DEFINITION_OPERATOR_BUT_NOT="but not"}(p||(p={}));class f extends c.default{constructor(){super(...arguments),this.authorizationModel={},this.exitSchemaVersion=e=>{this.authorizationModel.schema_version=e.getText()},this.enterTypeDefs=e=>{this.authorizationModel.type_definitions=[]},this.exitTypeDefs=e=>{var t;(null===(t=this.authorizationModel.type_definitions)||void 0===t?void 0:t.length)||delete this.authorizationModel.type_definitions},this.enterTypeDef=e=>{e.typeName()&&(this.currentTypeDef={type:e.typeName().getText(),relations:{},metadata:{relations:{}}})},this.exitTypeDef=e=>{var t,n,r,i;(null===(t=this.currentTypeDef)||void 0===t?void 0:t.type)&&(Object.keys((null===(r=null===(n=this.currentTypeDef)||void 0===n?void 0:n.metadata)||void 0===r?void 0:r.relations)||{}).length||(this.currentTypeDef.metadata=null),null===(i=this.authorizationModel.type_definitions)||void 0===i||i.push(this.currentTypeDef),this.currentTypeDef=void 0)},this.enterRelationDeclaration=e=>{this.currentRelation={rewrites:[],typeInfo:{directly_related_user_types:[]}}},this.exitRelationDeclaration=e=>{var t,n,r,i,s,o;if(!e.relationName())return;const a=e.relationName().getText();let l;const c=null===(t=this.currentRelation)||void 0===t?void 0:t.rewrites;if(null==c?void 0:c.length){if(1===(null==c?void 0:c.length))l=c[0];else switch(null===(n=this.currentRelation)||void 0===n?void 0:n.operator){case p.RELATION_DEFINITION_OPERATOR_OR:l={union:{child:c}};break;case p.RELATION_DEFINITION_OPERATOR_AND:l={intersection:{child:c}};break;case p.RELATION_DEFINITION_OPERATOR_BUT_NOT:l={difference:{base:c[0],subtract:c[1]}}}if(l){this.currentTypeDef.relations[a]&&(null===(r=e.parser)||void 0===r||r.notifyErrorListeners(`'${a}' is already defined in '${null===(i=this.currentTypeDef)||void 0===i?void 0:i.type}'`,e.relationName().start,void 0)),this.currentTypeDef.relations[a]=l;const t=null===(o=null===(s=this.currentRelation)||void 0===s?void 0:s.typeInfo)||void 0===o?void 0:o.directly_related_user_types;this.currentTypeDef.metadata.relations[a]={directly_related_user_types:t}}this.currentRelation=void 0}},this.enterRelationDefDirectAssignment=e=>{this.currentRelation.typeInfo={directly_related_user_types:[]}},this.exitRelationDefDirectAssignment=e=>{var t,n;null===(n=null===(t=this.currentRelation)||void 0===t?void 0:t.rewrites)||void 0===n||n.push({this:{}})},this.exitRelationDefTypeRestriction=e=>{const t={},n=e.relationDefTypeRestrictionWithCondition();let r,i,s;null!=n?(r=n.relationDefTypeRestrictionType(),i=n.relationDefTypeRestrictionUserset(),s=n.relationDefTypeRestrictionWildcard(),null!=n.conditionName()&&(t.condition=n.conditionName().getText())):(r=e.relationDefTypeRestrictionType(),i=e.relationDefTypeRestrictionUserset(),s=e.relationDefTypeRestrictionWildcard()),r&&(t.type=r.getText()),i&&(t.type=i.relationDefTypeRestrictionType().getText(),t.relation=i.relationDefTypeRestrictionRelation().getText()),s&&(t.type=s.relationDefTypeRestrictionType().getText(),t.wildcard={}),this.currentRelation.typeInfo.directly_related_user_types.push(t)},this.exitRelationDefRelationOnSameObject=e=>{var t,n;const r={computedUserset:{object:"",relation:e.rewriteComputedusersetName().getText()}};null===(n=null===(t=this.currentRelation)||void 0===t?void 0:t.rewrites)||void 0===n||n.push(r)},this.exitRelationDefRelationOnRelatedObject=e=>{var t,n;const r={tupleToUserset:{computedUserset:{object:"",relation:e.rewriteTuplesetComputedusersetName().getText()},tupleset:{object:"",relation:e.rewriteTuplesetName().getText()}}};null===(n=null===(t=this.currentRelation)||void 0===t?void 0:t.rewrites)||void 0===n||n.push(r)},this.enterRelationDefPartialAllOr=e=>{this.currentRelation.operator=p.RELATION_DEFINITION_OPERATOR_OR},this.enterRelationDefPartialAllAnd=e=>{this.currentRelation.operator=p.RELATION_DEFINITION_OPERATOR_AND},this.enterRelationDefPartialAllButNot=e=>{this.currentRelation.operator=p.RELATION_DEFINITION_OPERATOR_BUT_NOT},this.enterCondition=e=>{var t;if(null===e.conditionName())return;this.authorizationModel.conditions||(this.authorizationModel.conditions={});const n=e.conditionName().getText();this.authorizationModel.conditions[n]&&(null===(t=e.parser)||void 0===t||t.notifyErrorListeners(`'${n}' is already defined in the model`,e.conditionName().start,void 0)),this.currentCondition={name:n,expression:"",parameters:{}}},this.exitConditionParameter=e=>{var t,n,r,i;if(!e.parameterName()||!e.parameterType())return;const s=e.parameterName().getText();(null===(n=null===(t=this.currentCondition)||void 0===t?void 0:t.parameters)||void 0===n?void 0:n[s])&&(null===(r=e.parser)||void 0===r||r.notifyErrorListeners(`parameter '${s}' is already defined in the condition ${null===(i=this.currentCondition)||void 0===i?void 0:i.name}`,e.parameterName().start,void 0));const o=e.parameterType().CONDITION_PARAM_CONTAINER(),a={};if(o){a.type_name=`TYPE_NAME_${o.getText().toUpperCase()}`;const t=e.parameterType().CONDITION_PARAM_TYPE()&&`TYPE_NAME_${e.parameterType().CONDITION_PARAM_TYPE().getText().toUpperCase()}`;t&&(a.generic_types=[{type_name:t}])}else a.type_name=`TYPE_NAME_${e.parameterType().getText().toUpperCase()}`;this.currentCondition.parameters[s]=a},this.exitConditionExpression=e=>{this.currentCondition.expression=e.getText()},this.exitCondition=e=>{this.currentCondition&&(this.authorizationModel.conditions[this.currentCondition.name]=this.currentCondition,this.currentCondition=void 0)}}}class g extends l.ErrorListener{constructor(){super(...arguments),this.errors=[]}syntaxError(e,t,n,r,i,s){let o,l=0;t instanceof a.Token&&(o={symbol:t.text},l=o.symbol.length),this.errors.push(new h.DSLSyntaxSingleError({line:{start:n,end:n},column:{start:r,end:r+l},msg:i},o,s))}}function m(e){const t=e.split("\n").map((e=>e.trimEnd())).join("\n"),n=new a.InputStream(t),r=new g,i=new u.default(n);i.removeErrorListeners(),i.addErrorListener(r);const s=new a.CommonTokenStream(i),o=new d.default(s);o.removeErrorListeners(),o.addErrorListener(r);const l=new f;return(new a.ParseTreeWalker).walk(l,o.main()),{listener:l,errorListener:r}}function y(e){const{listener:t,errorListener:n}=m(e);if(n.errors.length)throw new h.DSLSyntaxError(n.errors);return t.authorizationModel}t.parseDSL=m,t.transformDSLToJSONObject=y,t.transformDSLToJSON=function(e){return JSON.stringify(y(e))}},30620:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37351),t),i(n(1035),t)},1035:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformJSONStringToDSL=t.transformJSONToDSL=void 0;const r=n(80104);function i(e){const t=e.type,n=e.relation,r=e.wildcard,i=e.condition;return r?`${t}:*`:n?`${t}#${n}`:i?`${t} with ${i}`:t}function s(e){return`[${function(e){const t=[];for(let n=0;n<(null==e?void 0:e.length);n++)t.push(i(e[n]));return t}(e).join(", ")}]`}function o(e,t,n,i){if(null!=n.this)return s(i);if(null!=n.computedUserset)return function(e){return e.computedUserset.relation}(n);if(null!=n.tupleToUserset)return function(e){var t,n,r,i;return`${null===(n=null===(t=null==e?void 0:e.tupleToUserset)||void 0===t?void 0:t.computedUserset)||void 0===n?void 0:n.relation} from ${null===(i=null===(r=null==e?void 0:e.tupleToUserset)||void 0===r?void 0:r.tupleset)||void 0===i?void 0:i.relation}`}(n);throw new r.UnsupportedDSLNestingError(e,t)}function a(e,t,n={},r={}){let i=` define ${t}: `;const s=r.directly_related_user_types||[];return null!=n.difference?i+=function(e,t,n,r){return`${o(e,t,n.difference.base,r)} but not ${o(e,t,n.difference.subtract,r)}`}(e,t,n,s):null!=n.union?i+=function(e,t,n,r){var i;const s=[],a=null===(i=null==n?void 0:n.union)||void 0===i?void 0:i.child;for(const l of a||[])s.push(o(e,t,l,r));return s.join(" or ")}(e,t,n,s):null!=n.intersection?i+=function(e,t,n,r){var i;const s=[],a=null===(i=null==n?void 0:n.intersection)||void 0===i?void 0:i.child;for(const l of a||[])s.push(o(e,t,l,r));return s.join(" and ")}(e,t,n,s):i+=o(e,t,n,s),i}const l=(e,t)=>{if(e!=t.name)throw new r.ConditionNameDoesntMatchError(e,t.name);return`condition ${e}(${(e=>{const t=[];return Object.keys(e).sort().forEach((n=>{var r;const i=e[n];let s=i.type_name.replace("TYPE_NAME_","").toLowerCase();"list"!==s&&"map"!==s||(s=`${s}<${null===(r=i.generic_types)||void 0===r?void 0:r[0].type_name.replace("TYPE_NAME_","").toLowerCase()}>`),t.push(`${n}: ${s}`)})),t.join(", ")})(t.parameters||{})}) {${t.expression}}\n`};t.transformJSONToDSL=e=>{var t;const n=(null==e?void 0:e.schema_version)||"1.1",r=null===(t=null==e?void 0:e.type_definitions)||void 0===t?void 0:t.map((e=>(e=>{var t,n;const r=e.type;let i=`\ntype ${r}`;const s=e.relations||{},o=e.metadata;if(null===(t=Object.keys(s))||void 0===t?void 0:t.length){i+="\n relations";for(const e in s)i+=`\n${a(r,e,s[e],null===(n=null==o?void 0:o.relations)||void 0===n?void 0:n[e])}`}return i})(e))),i=(e=>{const t=e.conditions||{};if(!Object.keys(t).length)return"";let n="";return Object.keys(t).sort().forEach((e=>{const r=t[e],i=l(e,r);n+=`\n${i}`})),n})(e);return`model\n schema ${n}\n${r?`${r.join("\n")}\n`:""}${i}`};t.transformJSONStringToDSL=e=>{const n=JSON.parse(e);return(0,t.transformJSONToDSL)(n)}},18616:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exceptionCollector=t.createMaximumOneDirectRelationship=t.createSchemaVersionRequiredError=t.createInvalidSchemaVersionError=void 0;const r=n(80104),i=n(56873);t.createInvalidSchemaVersionError=e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:`invalid schema ${o}`,lines:n,lineIndex:i,metadata:{symbol:o,errorType:r.ValidationError.InvalidSchema}}))};t.createSchemaVersionRequiredError=e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:"schema version required",lines:n,lineIndex:i,metadata:{symbol:o,errorType:r.ValidationError.SchemaVersionRequired}}))};function s(e){const{message:t,lines:n,lineIndex:i,customResolver:s,metadata:o}=e,a=n[i],l=new RegExp("\\b"+o.symbol+"\\b");let c=a.search(l)+1;return"function"==typeof s&&(c=s(c,a,o.symbol)),new r.ModelValidationSingleError({line:{start:i+1,end:i+1},column:{start:c,end:c+o.symbol.length},msg:t},{symbol:null==o?void 0:o.symbol,errorType:o.errorType})}t.createMaximumOneDirectRelationship=e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:"each relationship must have at most 1 set of direct relations defined.",lines:n,lineIndex:i,metadata:{symbol:o,errorType:r.ValidationError.AssignableRelationsMustHaveType},customResolver:(e,t,n)=>t.indexOf(n.substring(1))}))};t.exceptionCollector=(e,n)=>({raiseInvalidName(t,i,o,a){((e,t,n)=>{const{errors:i,lines:o,lineIndex:a,symbol:l}=e,c=(n?`relation '${l}' of type '${n}' `:`type '${l}' `)+`does not match naming rule: '${t}'.`;i.push(s({message:c,lines:o,lineIndex:a,metadata:{symbol:l,errorType:r.ValidationError.InvalidName}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o,a)},raiseReservedTypeName(t,o){(e=>{const{errors:t,lines:n,lineIndex:o,symbol:a}=e;t.push(s({message:`a type cannot be named '${i.Keyword.SELF}' or '${i.ReservedKeywords.THIS}'.`,lines:n,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.ReservedTypeKeywords}}))})({errors:e,lines:n,lineIndex:t,symbol:o})},raiseReservedRelationName(t,o){(e=>{const{errors:t,lines:n,lineIndex:o,symbol:a}=e;t.push(s({message:`a relation cannot be named '${i.Keyword.SELF}' or '${i.ReservedKeywords.THIS}'.`,lines:n,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.ReservedRelationKeywords}}))})({errors:e,lines:n,lineIndex:t,symbol:o})},raiseTupleUsersetRequiresDirect(t,i){(e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:`\`${o}\` relation used inside from allows only direct relation.`,lines:n,lineIndex:i,customResolver:(e,t,n)=>{const r=t.indexOf("from")+4+1;return r+t.slice(r).indexOf(n)+1},metadata:{symbol:o,errorType:r.ValidationError.TuplesetNotDirect}}))})({errors:e,lines:n,lineIndex:t,symbol:i})},raiseDuplicateTypeName(t,i){(e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:`the type \`${o}\` is a duplicate.`,lines:n,lineIndex:i,metadata:{symbol:o,errorType:r.ValidationError.DuplicatedError}}))})({errors:e,lines:n,lineIndex:t,symbol:i})},raiseDuplicateTypeRestriction(t,i,o){((e,t)=>{const{errors:n,lines:i,lineIndex:o,symbol:a}=e;n.push(s({message:`the type restriction \`${a}\` is a duplicate in the relation \`${t}\`.`,lines:i,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.DuplicatedError,relation:a}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o)},raiseDuplicateType(t,i,o){((e,t)=>{const{errors:n,lines:i,lineIndex:o,symbol:a}=e;n.push(s({message:`the partial relation definition \`${a}\` is a duplicate in the relation \`${t}\`.`,lines:i,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.DuplicatedError,relation:a}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o)},raiseDuplicateRelationshipDefinition(t,s){(e=>{const{errors:t,lines:n,lineIndex:s,symbol:o}=e,a=n[s];t.push(new r.ModelValidationSingleError({msg:`duplicate definition \`${o}\`.`,line:{start:s+1,end:s+1},column:{start:a.indexOf(i.Keyword.DEFINE)+1,end:a.length+1}},{symbol:o,errorType:r.ValidationError.DuplicatedError}))})({errors:e,lines:n,lineIndex:t,symbol:s})},raiseNoEntryPoint(t,i,o){((e,t)=>{const{errors:n,lines:i,lineIndex:o,symbol:a}=e;n.push(s({message:`\`${a}\` is an impossible relation for \`${t}\` (no entrypoint).`,lines:i,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.RelationNoEntrypoint,relation:a}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o)},raiseInvalidTypeRelation(t,i,o,a){((e,t,n)=>{const{errors:i,lines:o,lineIndex:a,symbol:l}=e;i.push(s({message:`\`${n}\` is not a valid relation for \`${t}\`.`,lines:o,lineIndex:a,metadata:{symbol:l,errorType:r.ValidationError.InvalidRelationType,relation:n,typeName:t}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o,a)},raiseInvalidType(t,i,o){((e,t)=>{const{errors:n,lines:i,lineIndex:o,symbol:a}=e;n.push(s({message:`\`${t}\` is not a valid type.`,lines:i,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.InvalidType,typeName:t}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o)},raiseAssignableRelationMustHaveTypes(t,i){(e=>{const{errors:t,lines:n,lineIndex:i}=e,o=n[i],a=o.includes("[")?o.slice(o.indexOf("["),o.lastIndexOf("]")+1):"self";t.push(s({message:`assignable relation '${a}' must have types`,lines:n,lineIndex:i,customResolver:(e,t,n)=>t.indexOf(n.substring(1)),metadata:{symbol:a,errorType:r.ValidationError.AssignableRelationsMustHaveType}}))})({errors:e,lines:n,lineIndex:t,symbol:i})},raiseAssignableTypeWildcardRelation(t,i){(e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:`type restriction \`${o}\` cannot contain both wildcard and relation`,lines:n,lineIndex:i,metadata:{symbol:o,errorType:r.ValidationError.TypeRestrictionCannotHaveWildcardAndRelation}}))})({errors:e,lines:n,lineIndex:t,symbol:i})},raiseInvalidRelationError(t,i,o){((e,t)=>{const{errors:n,lines:i,lineIndex:o,symbol:a}=e;!(null==t?void 0:t.includes(a))&&n.push(s({message:`the relation \`${a}\` does not exist.`,lines:i,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.MissingDefinition,relation:a}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o)},raiseInvalidSchemaVersion(r,i){(0,t.createInvalidSchemaVersionError)({errors:e,lines:n,lineIndex:r,symbol:i})},raiseSchemaVersionRequired(r,i){(0,t.createSchemaVersionRequiredError)({errors:e,lines:n,lineIndex:r,symbol:i})},raiseMaximumOneDirectRelationship(r,i){(0,t.createMaximumOneDirectRelationship)({errors:e,lines:n,lineIndex:r,symbol:i})},raiseInvalidConditionNameInParameter(t,i,o,a,l){((e,t,n,i)=>{const{errors:o,lines:a,lineIndex:l,symbol:c}=e;o.push(s({message:`\`${i}\` is not a defined condition in the model.`,lines:a,lineIndex:l,customResolver:(e,t,n)=>t.indexOf(n.substring(1)),metadata:{symbol:c,errorType:r.ValidationError.ConditionNotDefined,relation:n,typeName:t}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o,a,l)},raiseUnusedCondition(t,i){(e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:`\`${o}\` condition is not used in the model.`,lines:n,lineIndex:i,metadata:{symbol:o,errorType:r.ValidationError.ConditionNotUsed,conditionName:o}}))})({errors:e,lines:n,lineIndex:t,symbol:i})}})},95289:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(98072),t)},56873:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.ReservedKeywords=t.Keyword=void 0,function(e){e.SELF="self",e.DEFINE="DEFINE"}(n||(t.Keyword=n={})),function(e){e.THIS="this"}(r||(t.ReservedKeywords=r={}))},98072:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateDSL=t.validateJSON=t.defaultRelationRule=t.defaultTypeRule=void 0;const r=n(56873),i=n(30620),s=n(80104),o=n(18616);var a,l;t.defaultTypeRule="^[^:#@\\s]{1,254}$",t.defaultRelationRule="^[^:#@\\s]{1,50}$",function(e){e.Union="union",e.Intersection="intersection",e.Difference="difference"}(a||(a={})),function(e){e.Direct="direct",e.ComputedUserset="computed_userset",e.TupleToUserset="tuple_to_userset"}(l||(l={}));const c=(e,t,n)=>(n||(n=0),t.slice(n).findIndex((t=>t.trim().startsWith(`condition ${e}`)))+n),u=(e,t,n)=>(n||(n=0),t.slice(n).findIndex((t=>t.trim().startsWith(`type ${e}`)))+n),d=(e,t,n)=>(n||(n=0),t.slice(n).findIndex((t=>t.trim().replace(/ {2,}/g," ").startsWith(`define ${e}`)))+n),h=(e,t)=>t.findIndex((t=>t.trim().replace(/ {2,}/g," ").startsWith(`schema ${e}`))),p=e=>{let t=e.type;return e.wildcard?t+=":*":e.relation&&(t+=`#${e.relation}`),e.condition&&(t+=` with ${e.condition}`),t},f=e=>e.map((e=>p(e))),g=e=>{var t,n,r,i;let s,o;e.computedUserset?s=e.computedUserset.relation||void 0:(s=(null===(n=null===(t=e.tupleToUserset)||void 0===t?void 0:t.computedUserset)||void 0===n?void 0:n.relation)||void 0,o=(null===(i=null===(r=e.tupleToUserset)||void 0===r?void 0:r.tupleset)||void 0===i?void 0:i.relation)||void 0);let a=l.Direct;return s&&(a=l.ComputedUserset),o&&(a=l.TupleToUserset),{target:s,from:o,rewrite:a}},m=e=>{const[t,n]=e.split(" with "),r=t.includes(":*"),i=t.replace(":*","").split("#");return{decodedType:i[0],decodedRelation:i[1],isWildcard:r,decodedConditionName:n}},y=e=>!Object.prototype.hasOwnProperty.call(e,a.Union)&&!Object.prototype.hasOwnProperty.call(e,a.Intersection)&&!Object.prototype.hasOwnProperty.call(e,a.Difference),b=e=>{var t;let n=null===(t=e.computedUserset)||void 0===t?void 0:t.relation;const r=g(e);return r.rewrite===l.ComputedUserset?n=r.target:r.rewrite===l.TupleToUserset&&(n=`${r.target} from ${r.from}`),n};function v(e,t,n,r,i){var s;if(!r)return!1;if(r.rewrite===l.Direct)for(const o of i){const{decodedType:n,decodedRelation:r}=m(o);if(!r)return!0;if(E(e,t,n,r))return!0}if(r.from){const i=f((null===(s=e[n].metadata)||void 0===s?void 0:s.relations[r.from].directly_related_user_types)||[]);for(const n of i){const{decodedType:i}=m(n);if(E(e,t,i,r.target))return!0}}else if(E(e,t,n,r.target))return!0;return!1}function E(e,t,n,r){var i,s,o;if(!r)return!1;if(t[n]&&t[n][r])return!1;t[n]||(t[n]={}),t[n][r]=!0;const l=e[n].relations;if(!l||!l[r])return!1;const c=null===(i=e[n].metadata)||void 0===i?void 0:i.relations,u=f(c[r].directly_related_user_types||[]);if(Object.prototype.hasOwnProperty.call(l[r],a.Union)){for(const i of(null===(s=l[r].union)||void 0===s?void 0:s.child)||[])if(v(e,JSON.parse(JSON.stringify(t)),n,g(i),u))return!0;return!1}if(Object.prototype.hasOwnProperty.call(l[r],a.Intersection)){for(const i of(null===(o=l[r].intersection)||void 0===o?void 0:o.child)||[])if(!v(e,JSON.parse(JSON.stringify(t)),n,g(i),u))return!1;return!0}if(Object.prototype.hasOwnProperty.call(l[r],a.Difference))return!(!v(e,JSON.parse(JSON.stringify(t)),n,g(l[r].difference.base),u)||!v(e,JSON.parse(JSON.stringify(t)),n,g(l[r].difference.subtract),u));{const i=g(l[r]);return!!v(e,JSON.parse(JSON.stringify(t)),n,i,u)}}function _(e,t,n,r){var i;const s=new Set;null===(i=n.directly_related_user_types)||void 0===i||i.forEach((n=>{const i=p(n);if(s.has(i)){const s=u(n.type,e),o=d(r,e,s);t.raiseDuplicateTypeRestriction(o,i,r)}s.add(i)}))}function T(e,t,n,r){var i,s,o,l;const c=n.relations[r],h=new Set;null===(s=null===(i=c.union)||void 0===i?void 0:i.child)||void 0===s||s.forEach((i=>{const s=b(i);if(s&&h.has(s)){const i=u(n.type,e),o=d(r,e,i);t.raiseDuplicateType(o,s,r)}h.add(s)}));const p=new Set;if(null===(l=null===(o=c.intersection)||void 0===o?void 0:o.child)||void 0===l||l.forEach((i=>{const s=b(i);if(s&&p.has(s)){const i=u(n.type,e),o=d(r,e,i);t.raiseDuplicateType(o,s,r)}p.add(s)})),Object.prototype.hasOwnProperty.call(c,a.Difference)){const i=b(c.difference.base),s=b(c.difference.subtract);if(i&&i===s){const s=u(n.type,e),o=d(r,e,s);t.raiseDuplicateType(o,i,r)}}}function x(e,t,n,r,i,s,o={}){var a;const c=n[r].relations;if(!c||!c[i])return;const h=null===(a=n[r].metadata)||void 0===a?void 0:a.relations[i];switch(s.rewrite){case l.Direct:{const s=f((null==h?void 0:h.directly_related_user_types)||[]);if(!s.length){const n=u(r,e),s=d(i,e,n);t.raiseAssignableRelationMustHaveTypes(s,i)}for(const a of s){const{decodedType:s,decodedRelation:l,isWildcard:c,decodedConditionName:h}=m(a);if(!n[s]){const n=u(r,e),o=d(i,e,n);t.raiseInvalidType(o,`${s}`,s)}if(h&&!o[h]){const n=u(r,e),s=d(i,e,n);t.raiseInvalidConditionNameInParameter(s,`${h}`,r,i,h)}if(c&&l){const n=u(r,e),s=d(i,e,n);t.raiseAssignableTypeWildcardRelation(s,a)}else if(l&&(!n[s]||!n[s].relations[l])){const n=u(r,e),o=d(i,e,n);t.raiseInvalidTypeRelation(o,`${s}#${l}`,s,l)}}break}case l.ComputedUserset:if(s.target&&!c[s.target]){const n=u(r,e),o=d(i,e,n),a=s.target;t.raiseInvalidRelationError(o,a,Object.keys(c))}break;case l.TupleToUserset:if(s.from&&s.target)if(c[s.from]){const[o,a]=function(e,t,n){var r;const i=[],s=e[t].relations[n],o=f((null===(r=e[t].metadata)||void 0===r?void 0:r.relations[n].directly_related_user_types)||[]),a=y(s);a&&g(s).rewrite===l.Direct&&i.push(...o);return[i,a]}(n,r,s.from);if(a){const a=[];for(const l of o){const{decodedType:o,decodedRelation:c,isWildcard:h}=m(l);if(h){const n=u(r,e),s=d(i,e,n);t.raiseAssignableTypeWildcardRelation(s,l)}else if(c){const n=u(r,e),o=d(i,e,n);t.raiseTupleUsersetRequiresDirect(o,s.from)}else if(!n[o]||!n[o].relations[s.target]){const t=u(r,e),n=d(i,e,t);a.push({lineIndex:n,symbol:`${s.target} from ${s.from}`,typeName:o,relationName:s.target})}}if(a.length===o.length)for(const e of a){const{lineIndex:n,symbol:r,typeName:i,relationName:s}=e;t.raiseInvalidTypeRelation(n,r,i,s)}}else{const n=u(r,e),o=d(i,e,n);t.raiseTupleUsersetRequiresDirect(o,s.from)}}else{const n=u(r,e),o=d(i,e,n);t.raiseInvalidTypeRelation(o,`${s.target} from ${s.from}`,r,s.from)}}}function w(e,t,n,r,i,s){var o,l,c,u;const d=n[r].relations;if(!d||!d[i])return;const h=d[i];if(Object.prototype.hasOwnProperty.call(h,a.Union))for(const a of(null===(o=h.union)||void 0===o?void 0:o.child)||[])x(e,t,n,r,i,g(a),s);else if(Object.prototype.hasOwnProperty.call(h,a.Intersection))for(const a of(null===(l=h.intersection)||void 0===l?void 0:l.child)||[])x(e,t,n,r,i,g(a),s);else Object.prototype.hasOwnProperty.call(h,a.Difference)?((null===(c=h.difference)||void 0===c?void 0:c.base)&&x(e,t,n,r,i,g(h.difference.base),s),(null===(u=h.difference)||void 0===u?void 0:u.subtract)&&x(e,t,n,r,i,g(h.difference.subtract),s)):x(e,t,n,r,i,g(h),s)}function S(e,n,i={}){const a=e.split("\n"),l=[],p=(0,o.exceptionCollector)(l,a),f=i.typeValidation||t.defaultTypeRule,g=i.relationValidation||t.defaultRelationRule,m=new RegExp("[a-zA-Z]*");let y={regex:m,rule:f};try{y={regex:new RegExp(f),rule:f}}catch(x){throw new s.ConfigurationError(`Incorrect type regex specification for ${f}`,x)}let b={regex:m,rule:g};try{b={regex:new RegExp(g),rule:g}}catch(x){throw new s.ConfigurationError(`Incorrect relation regex specification for ${g}`,x)}!function(e,t,n,i,s){var o;null===(o=n.type_definitions)||void 0===o||o.forEach((n=>{const o=n.type;if(o===r.Keyword.SELF||o===r.ReservedKeywords.THIS){const n=u(o,e);t.raiseReservedTypeName(n,o)}if(!i.regex.test(o)){const n=u(o,e);t.raiseInvalidName(n,o,i.rule)}const a={[r.Keyword.SELF]:!0};for(const i in n.relations){const n=i;if(n===r.Keyword.SELF||n===r.ReservedKeywords.THIS){const r=u(o,e),i=d(n,e,r);t.raiseReservedRelationName(i,n)}else if(s.regex.test(n)){if(a[n]){const r=u(o,e),i=d(n,e,r),s=d(n,e,i+1);t.raiseDuplicateDefinition(s,n)}}else{const r=u(o,e),i=d(n,e,r);t.raiseInvalidName(i,n,s.rule,o)}a[n]=!0}}))}(a,p,n,y,b);const v=n.schema_version;switch(v||p.raiseSchemaVersionRequired(0,""),v){case"1.1":!function(e,t,n,r){var i,s,o,a;if(n.length)return;const l={},h=new Set;if(null===(i=r.type_definitions)||void 0===i||i.forEach((e=>{var t,n;const r=e.type;l[r]=e;for(const i in null===(t=e.metadata)||void 0===t?void 0:t.relations)((null===(n=e.metadata)||void 0===n?void 0:n.relations[i].directly_related_user_types)||[]).forEach((e=>{e.condition&&h.add(e.condition)}))})),null===(s=r.type_definitions)||void 0===s||s.forEach((n=>{const i=n.type;for(const s in n.relations)w(e,t,l,i,s,r.conditions)})),0===n.length){const n=new Set;null===(o=r.type_definitions)||void 0===o||o.forEach((r=>{var i,s;const o=r.type;if(n.has(o)){const n=u(o,e);t.raiseDuplicateTypeName(n,o)}n.add(r.type);for(const n in null===(i=r.metadata)||void 0===i?void 0:i.relations)_(e,t,null===(s=r.metadata)||void 0===s?void 0:s.relations[n],n),T(e,t,r,n)}))}0===n.length&&(null===(a=r.type_definitions)||void 0===a||a.forEach((n=>{const r=n.type;for(const i in n.relations)if(!E(l,{},r,i)){const n=u(r,e),s=d(i,e,n);t.raiseNoEntryPoint(s,i,r)}})));for(const u in r.conditions)if(r.conditions[u],!h.has(u)){const n=c(u,e);t.raiseUnusedCondition(n,u)}}(a,p,l,n);break;default:{const e=h(v,a);p.raiseInvalidSchemaVersion(e,v);break}}if(l.length)throw new s.ModelValidationError(l)}t.validateJSON=S,t.validateDSL=function(e,t={}){const{listener:n,errorListener:r}=(0,i.parseDSL)(e);if(r.errors.length)throw new s.DSLSyntaxError(r.errors);S(e,n.authorizationModel,t)}},723:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(67294),i=n(87462),s=n(68356),o=n.n(s),a=n(16887);const l={"01a85c17":[()=>Promise.all([n.e(532),n.e(4013)]).then(n.bind(n,91223)),"@theme/BlogTagsListPage",91223],"028b1cc5":[()=>Promise.all([n.e(532),n.e(8592),n.e(5289)]).then(n.bind(n,20936)),"@site/docs/content/interacting/read-tuple-changes.mdx",20936],"03f1273c":[()=>Promise.all([n.e(8592),n.e(9323)]).then(n.bind(n,55246)),"@site/blog/kubecon-na-2023.md?truncated=true",55246],"0938166f":[()=>Promise.all([n.e(532),n.e(8592),n.e(5721)]).then(n.bind(n,10711)),"@site/docs/content/modeling/migrating/overview.mdx",10711],"0be4346b":[()=>n.e(5222).then(n.t.bind(n,77512,19)),"~blog/default/blog-tags-openfga-87e-list.json",77512],"116d061d":[()=>Promise.all([n.e(532),n.e(8592),n.e(1176)]).then(n.bind(n,45667)),"@site/docs/content/getting-started/setup-openfga/overview.mdx",45667],15369573:[()=>Promise.all([n.e(532),n.e(8592),n.e(2052)]).then(n.bind(n,47756)),"@site/docs/content/modeling/building-blocks/object-to-object-relationships.mdx",47756],17896441:[()=>Promise.all([n.e(532),n.e(8592),n.e(7918)]).then(n.bind(n,78945)),"@theme/DocItem",78945],"18eda3ee":[()=>Promise.all([n.e(532),n.e(8592),n.e(3666)]).then(n.bind(n,1564)),"@site/docs/content/getting-started/framework.mdx",1564],"1a4e3797":[()=>Promise.all([n.e(532),n.e(7920)]).then(n.bind(n,51473)),"@theme/SearchPage",51473],"1bbc0b1c":[()=>Promise.all([n.e(532),n.e(8592),n.e(6418)]).then(n.bind(n,87004)),"@site/docs/content/getting-started/setup-openfga/kubernetes-setup.mdx",87004],"1be78505":[()=>Promise.all([n.e(532),n.e(8505),n.e(9514)]).then(n.bind(n,19963)),"@theme/DocPage",19963],"1df93b7f":[()=>Promise.all([n.e(532),n.e(8592),n.e(203),n.e(3237)]).then(n.bind(n,27116)),"@site/src/pages/index.tsx",27116],"24bd3649":[()=>n.e(6136).then(n.t.bind(n,57569,19)),"~blog/default/blog-tags-conferences-51c.json",57569],"2ca0b854":[()=>n.e(5735).then(n.t.bind(n,49314,19)),"~blog/default/blog-tags-features-685-list.json",49314],"30325ba4":[()=>Promise.all([n.e(532),n.e(8592),n.e(4374)]).then(n.bind(n,55874)),"@site/docs/content/modeling/direct-access.mdx",55874],"33b74eba":[()=>Promise.all([n.e(532),n.e(8592),n.e(1429)]).then(n.bind(n,91117)),"@site/docs/content/configuration-language.mdx",91117],"34a3e208":[()=>Promise.all([n.e(532),n.e(8592),n.e(5863)]).then(n.bind(n,79446)),"@site/docs/content/getting-started/update-tuples.mdx",79446],"34c50772":[()=>n.e(356).then(n.t.bind(n,60966,19)),"~blog/default/blog-tags-kubecon-bd1.json",60966],"3652cf2a":[()=>Promise.all([n.e(532),n.e(8592),n.e(4752)]).then(n.bind(n,2422)),"@site/docs/content/modeling/building-blocks/concentric-relationships.mdx",2422],"3759cf4b":[()=>Promise.all([n.e(532),n.e(8592),n.e(2991)]).then(n.bind(n,380)),"@site/docs/content/getting-started/immutable-models.mdx",380],"3827dd5a":[()=>n.e(2744).then(n.t.bind(n,12776,19)),"/home/runner/work/openfga.dev/openfga.dev/.docusaurus/@easyops-cn/docusaurus-search-local/default/plugin-route-context-module-100.json",12776],"3a191a7b":[()=>Promise.all([n.e(532),n.e(8592),n.e(6075)]).then(n.bind(n,50086)),"@site/docs/content/getting-started/setup-sdk-client.mdx",50086],"3aada504":[()=>Promise.all([n.e(532),n.e(8592),n.e(8705)]).then(n.bind(n,12963)),"@site/docs/content/interacting/managing-user-access.mdx",12963],"3d83e150":[()=>Promise.all([n.e(532),n.e(8592),n.e(3207)]).then(n.bind(n,30663)),"@site/docs/content/interacting/managing-relationships-between-objects.mdx",30663],"4204f988":[()=>Promise.all([n.e(532),n.e(8592),n.e(1794)]).then(n.bind(n,60855)),"@site/docs/content/modeling/building-blocks/direct-relationships.mdx",60855],"4337ba13":[()=>Promise.all([n.e(532),n.e(8592),n.e(7647)]).then(n.bind(n,34839)),"@site/docs/content/interacting/managing-group-access.mdx",34839],"439d46c1":[()=>Promise.all([n.e(532),n.e(8592),n.e(7459)]).then(n.bind(n,80348)),"@site/docs/content/modeling/user-groups.mdx",80348],"4427aa46":[()=>Promise.all([n.e(532),n.e(8592),n.e(6901)]).then(n.bind(n,30051)),"@site/docs/content/modeling/advanced/github.mdx",30051],"487f279c":[()=>Promise.all([n.e(532),n.e(8592),n.e(2623)]).then(n.bind(n,67361)),"@site/docs/content/getting-started/tuples-api-best-practices.mdx",67361],"4920f1c1":[()=>Promise.all([n.e(532),n.e(8592),n.e(9904)]).then(n.bind(n,59580)),"@site/docs/content/modeling/multiple-restrictions.mdx",59580],"4a075682":[()=>Promise.all([n.e(532),n.e(8592),n.e(8883)]).then(n.bind(n,14871)),"@site/docs/content/modeling/overview.mdx",14871],"4c2069ba":[()=>Promise.all([n.e(532),n.e(8592),n.e(5019)]).then(n.bind(n,14697)),"@site/docs/content/getting-started/production-best-practices.mdx",14697],"5ccffc9c":[()=>Promise.all([n.e(532),n.e(8592),n.e(2354)]).then(n.bind(n,5832)),"@site/docs/content/modeling/building-blocks/overview.mdx",5832],"5dfc8d6a":[()=>Promise.all([n.e(8592),n.e(1544)]).then(n.bind(n,34488)),"@site/blog/kubecon-na-2023.md",34488],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,36809)),"@generated/docusaurus.config",36809],"63b646c1":[()=>Promise.all([n.e(532),n.e(8592),n.e(2452)]).then(n.bind(n,32505)),"@site/docs/content/modeling/advanced/overview.mdx",32505],"6786195a":[()=>Promise.all([n.e(532),n.e(8592),n.e(3077)]).then(n.bind(n,19637)),"@site/docs/content/modeling/getting-started.mdx",19637],"6875c492":[()=>Promise.all([n.e(532),n.e(8592),n.e(2529),n.e(8610)]).then(n.bind(n,41714)),"@theme/BlogTagsPostsPage",41714],"69ced8de":[()=>Promise.all([n.e(532),n.e(8592),n.e(5777)]).then(n.bind(n,47996)),"@site/docs/content/modeling/migrating/migrating-schema-1-1.mdx",47996],"69d8fa2b":[()=>n.e(9909).then(n.t.bind(n,94159,19)),"~blog/default/blog-tags-features-685.json",94159],"6a4b619d":[()=>Promise.all([n.e(532),n.e(8592),n.e(7852)]).then(n.bind(n,6340)),"@site/docs/content/modeling/parent-child.mdx",6340],"7284575f":[()=>Promise.all([n.e(532),n.e(8592),n.e(6743)]).then(n.bind(n,31492)),"@site/docs/content/modeling/custom-roles.mdx",31492],"73db2c80":[()=>Promise.all([n.e(532),n.e(8592),n.e(9302)]).then(n.bind(n,31527)),"@site/docs/content/interacting/relationship-queries.mdx",31527],"76c18be1":[()=>Promise.all([n.e(532),n.e(8592),n.e(6055)]).then(n.bind(n,12278)),"@site/docs/content/interacting/search-with-permissions.mdx",12278],"7742897f":[()=>Promise.all([n.e(532),n.e(8592),n.e(9062)]).then(n.bind(n,83166)),"@site/docs/content/getting-started/configure-model.mdx",83166],"78431c72":[()=>Promise.all([n.e(532),n.e(8592),n.e(4706)]).then(n.bind(n,37995)),"@site/docs/content/modeling/advanced/iot.mdx",37995],"78aaed86":[()=>Promise.all([n.e(532),n.e(8592),n.e(569)]).then(n.bind(n,58721)),"@site/docs/content/modeling/public-access.mdx",58721],"7bbc0b76":[()=>n.e(6403).then(n.t.bind(n,15745,19)),"/home/runner/work/openfga.dev/openfga.dev/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",15745],"814f3328":[()=>n.e(2535).then(n.t.bind(n,45641,19)),"~blog/default/blog-post-list-prop-default.json",45641],"87a4c587":[()=>Promise.all([n.e(532),n.e(8592),n.e(4886)]).then(n.bind(n,87872)),"@site/docs/content/modeling/blocklists.mdx",87872],"87c4c920":[()=>Promise.all([n.e(532),n.e(8592),n.e(265)]).then(n.bind(n,51376)),"@site/docs/content/getting-started/install-sdk.mdx",51376],"882ec15a":[()=>Promise.all([n.e(532),n.e(8592),n.e(8128)]).then(n.bind(n,79460)),"@site/docs/content/authorization-and-openfga.mdx",79460],"89e713ce":[()=>n.e(7604).then(n.t.bind(n,56255,19)),"~blog/default/blog-tags-conferences-51c-list.json",56255],"935f2afb":[()=>n.e(53).then(n.t.bind(n,1109,19)),"~docs/default/version-current-metadata-prop-751.json",1109],"9578a8cf":[()=>Promise.all([n.e(532),n.e(8592),n.e(7464)]).then(n.bind(n,42401)),"@site/docs/content/modeling/organization-context-authorization.mdx",42401],"97140aee":[()=>Promise.all([n.e(532),n.e(8592),n.e(521)]).then(n.bind(n,1840)),"@site/docs/content/modeling/advanced/entitlements.mdx",1840],"9c4cd4c4":[()=>Promise.all([n.e(532),n.e(8592),n.e(1105)]).then(n.bind(n,17984)),"@site/docs/content/interacting/overview.mdx",17984],"9e4087bc":[()=>n.e(3608).then(n.bind(n,63169)),"@theme/BlogArchivePage",63169],a09a1188:[()=>Promise.all([n.e(532),n.e(8592),n.e(1217)]).then(n.bind(n,44179)),"@site/docs/content/modeling/building-blocks/usersets.mdx",44179],a2ab5d86:[()=>Promise.all([n.e(8592),n.e(6248)]).then(n.bind(n,25120)),"@site/blog/conditional-tuples-announcement.md",25120],a36c58ef:[()=>n.e(8018).then(n.t.bind(n,83769,19)),"/home/runner/work/openfga.dev/openfga.dev/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",83769],a6aa9e1f:[()=>Promise.all([n.e(532),n.e(8592),n.e(2529),n.e(3089)]).then(n.bind(n,80046)),"@theme/BlogListPage",80046],a7023ddc:[()=>n.e(1713).then(n.t.bind(n,53457,19)),"~blog/default/blog-tags-tags-4c2.json",53457],acf022e4:[()=>Promise.all([n.e(532),n.e(8592),n.e(217),n.e(2450)]).then(n.bind(n,34841)),"@site/src/pages/api/service.tsx",34841],b2b675dd:[()=>n.e(533).then(n.t.bind(n,28017,19)),"~blog/default/blog-c06.json",28017],b2f554cd:[()=>n.e(1477).then(n.t.bind(n,30010,19)),"~blog/default/blog-archive-80c.json",30010],b2fd7883:[()=>Promise.all([n.e(532),n.e(8592),n.e(8371)]).then(n.bind(n,22436)),"@site/docs/content/modeling/advanced/gdrive.mdx",22436],b3e13dba:[()=>n.e(6840).then(n.t.bind(n,3250,19)),"~blog/default/blog-tags-openfga-87e.json",3250],b89f0a14:[()=>Promise.all([n.e(532),n.e(8592),n.e(8425)]).then(n.bind(n,32185)),"@site/docs/content/interacting/managing-group-membership.mdx",32185],bb879dcd:[()=>Promise.all([n.e(532),n.e(8592),n.e(2386)]).then(n.bind(n,24233)),"@site/docs/content/modeling/migrating/migrating-relations.mdx",24233],bd85ffac:[()=>Promise.all([n.e(532),n.e(8592),n.e(6359)]).then(n.bind(n,42376)),"@site/docs/content/concepts.mdx",42376],c0e854c3:[()=>Promise.all([n.e(532),n.e(8592),n.e(5263)]).then(n.bind(n,43302)),"@site/docs/content/getting-started/perform-list-objects.mdx",43302],caf99389:[()=>Promise.all([n.e(8592),n.e(8256)]).then(n.bind(n,81665)),"@site/blog/conditional-tuples-announcement.md?truncated=true",81665],cb8ccc1a:[()=>Promise.all([n.e(532),n.e(8592),n.e(3151)]).then(n.bind(n,57108)),"@site/docs/content/getting-started/perform-check.mdx",57108],ccc49370:[()=>Promise.all([n.e(532),n.e(8592),n.e(2529),n.e(6103)]).then(n.bind(n,65203)),"@theme/BlogPostPage",65203],d3d4dca1:[()=>Promise.all([n.e(532),n.e(8592),n.e(5362)]).then(n.bind(n,99052)),"@site/docs/content/modeling/roles-and-permissions.mdx",99052],da16da38:[()=>Promise.all([n.e(532),n.e(8592),n.e(3325)]).then(n.bind(n,89535)),"@site/docs/content/getting-started/overview.mdx",89535],db2cdc18:[()=>Promise.all([n.e(532),n.e(8592),n.e(8242)]).then(n.bind(n,53346)),"@site/docs/content/getting-started/create-store.mdx",53346],e23d3c5f:[()=>Promise.all([n.e(532),n.e(8592),n.e(3416)]).then(n.bind(n,92452)),"@site/docs/content/getting-started/setup-openfga/docker-setup.mdx",92452],e260e0bb:[()=>Promise.all([n.e(532),n.e(8592),n.e(7226)]).then(n.bind(n,87029)),"@site/docs/content/modeling/contextual-time-based-authorization.mdx",87029],e4a0c232:[()=>n.e(4461).then(n.t.bind(n,24469,19)),"/home/runner/work/openfga.dev/openfga.dev/.docusaurus/docusaurus-plugin-content-blog/default/plugin-route-context-module-100.json",24469],ed2f6563:[()=>Promise.all([n.e(532),n.e(8592),n.e(7287)]).then(n.bind(n,83396)),"@site/docs/content/interacting/transactional-writes.mdx",83396],f5ba7293:[()=>Promise.all([n.e(532),n.e(8592),n.e(4464)]).then(n.bind(n,22313)),"@site/docs/content/modeling/advanced/slack.mdx",22313],f849ae1d:[()=>n.e(2547).then(n.t.bind(n,80387,19)),"~blog/default/blog-tags-kubecon-bd1-list.json",80387]};function c(e){let{error:t,retry:n,pastDelay:i}=e;return t?r.createElement("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"}},r.createElement("p",null,String(t)),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},"Retry"))):i?r.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"}},r.createElement("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb"},r.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2"},r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"8"},r.createElement("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"}))))):null}var u=n(99670),d=n(30226);function h(e,t){if("*"===e)return o()({loading:c,loader:()=>Promise.all([n.e(532),n.e(3604)]).then(n.bind(n,3604)),modules:["@theme/NotFound"],webpack:()=>[3604],render(e,t){const n=e.default;return r.createElement(d.z,{value:{plugin:{name:"native",id:"default"}}},r.createElement(n,t))}});const s=a[`${e}-${t}`],h={},p=[],f=[],g=(0,u.Z)(s);return Object.entries(g).forEach((e=>{let[t,n]=e;const r=l[n];r&&(h[t]=r[0],p.push(r[1]),f.push(r[2]))})),o().Map({loading:c,loader:h,modules:p,webpack:()=>f,render(t,n){const o=JSON.parse(JSON.stringify(s));Object.entries(t).forEach((t=>{let[n,r]=t;const i=r.default;if(!i)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof i&&"function"!=typeof i||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{i[e]=r[e]}));let s=o;const a=n.split(".");a.slice(0,-1).forEach((e=>{s=s[e]})),s[a[a.length-1]]=i}));const a=o.__comp;delete o.__comp;const l=o.__context;return delete o.__context,r.createElement(d.z,{value:l},r.createElement(a,(0,i.Z)({},o,n)))}})}const p=[{path:"/api/service",component:h("/api/service","814"),exact:!0},{path:"/blog",component:h("/blog","c0d"),exact:!0},{path:"/blog/archive",component:h("/blog/archive","404"),exact:!0},{path:"/blog/conditional-tuples-announcement",component:h("/blog/conditional-tuples-announcement","2f7"),exact:!0},{path:"/blog/kubecon-na-2023",component:h("/blog/kubecon-na-2023","a5a"),exact:!0},{path:"/blog/tags",component:h("/blog/tags","75b"),exact:!0},{path:"/blog/tags/conferences",component:h("/blog/tags/conferences","ad4"),exact:!0},{path:"/blog/tags/features",component:h("/blog/tags/features","e37"),exact:!0},{path:"/blog/tags/kubecon",component:h("/blog/tags/kubecon","243"),exact:!0},{path:"/blog/tags/openfga",component:h("/blog/tags/openfga","482"),exact:!0},{path:"/search",component:h("/search","893"),exact:!0},{path:"/docs",component:h("/docs","f29"),routes:[{path:"/docs/authorization-and-openfga",component:h("/docs/authorization-and-openfga","b75"),exact:!0,sidebar:"docs"},{path:"/docs/concepts",component:h("/docs/concepts","c63"),exact:!0,sidebar:"docs"},{path:"/docs/configuration-language",component:h("/docs/configuration-language","284"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started",component:h("/docs/getting-started","45c"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/configure-model",component:h("/docs/getting-started/configure-model","3d5"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/create-store",component:h("/docs/getting-started/create-store","d80"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/framework",component:h("/docs/getting-started/framework","11b"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/immutable-models",component:h("/docs/getting-started/immutable-models","9a4"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/install-sdk",component:h("/docs/getting-started/install-sdk","54c"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/perform-check",component:h("/docs/getting-started/perform-check","64c"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/perform-list-objects",component:h("/docs/getting-started/perform-list-objects","c00"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/running-in-production",component:h("/docs/getting-started/running-in-production","3df"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/setup-openfga/docker",component:h("/docs/getting-started/setup-openfga/docker","41b"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/setup-openfga/kubernetes",component:h("/docs/getting-started/setup-openfga/kubernetes","577"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/setup-openfga/overview",component:h("/docs/getting-started/setup-openfga/overview","dc6"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/setup-sdk-client",component:h("/docs/getting-started/setup-sdk-client","084"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/tuples-api-best-practices",component:h("/docs/getting-started/tuples-api-best-practices","118"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/update-tuples",component:h("/docs/getting-started/update-tuples","98a"),exact:!0,sidebar:"docs"},{path:"/docs/interacting",component:h("/docs/interacting","073"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/managing-group-access",component:h("/docs/interacting/managing-group-access","e78"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/managing-group-membership",component:h("/docs/interacting/managing-group-membership","970"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/managing-relationships-between-objects",component:h("/docs/interacting/managing-relationships-between-objects","36d"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/managing-user-access",component:h("/docs/interacting/managing-user-access","fa6"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/read-tuple-changes",component:h("/docs/interacting/read-tuple-changes","07b"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/relationship-queries",component:h("/docs/interacting/relationship-queries","e5d"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/search-with-permissions",component:h("/docs/interacting/search-with-permissions","86b"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/transactional-writes",component:h("/docs/interacting/transactional-writes","073"),exact:!0,sidebar:"docs"},{path:"/docs/modeling",component:h("/docs/modeling","d15"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/advanced",component:h("/docs/modeling/advanced","3c0"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/advanced/entitlements",component:h("/docs/modeling/advanced/entitlements","260"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/advanced/gdrive",component:h("/docs/modeling/advanced/gdrive","c55"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/advanced/github",component:h("/docs/modeling/advanced/github","0ad"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/advanced/iot",component:h("/docs/modeling/advanced/iot","e2c"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/advanced/slack",component:h("/docs/modeling/advanced/slack","34d"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/blocklists",component:h("/docs/modeling/blocklists","e4f"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/building-blocks",component:h("/docs/modeling/building-blocks","8ce"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/building-blocks/concentric-relationships",component:h("/docs/modeling/building-blocks/concentric-relationships","1b8"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/building-blocks/direct-relationships",component:h("/docs/modeling/building-blocks/direct-relationships","d44"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/building-blocks/object-to-object-relationships",component:h("/docs/modeling/building-blocks/object-to-object-relationships","eaa"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/building-blocks/usersets",component:h("/docs/modeling/building-blocks/usersets","905"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/contextual-time-based-authorization",component:h("/docs/modeling/contextual-time-based-authorization","9fb"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/custom-roles",component:h("/docs/modeling/custom-roles","860"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/direct-access",component:h("/docs/modeling/direct-access","00b"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/getting-started",component:h("/docs/modeling/getting-started","9ce"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/migrating",component:h("/docs/modeling/migrating","780"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/migrating/migrating-relations",component:h("/docs/modeling/migrating/migrating-relations","d6a"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/migrating/migrating-schema-1-1",component:h("/docs/modeling/migrating/migrating-schema-1-1","709"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/multiple-restrictions",component:h("/docs/modeling/multiple-restrictions","74b"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/organization-context-authorization",component:h("/docs/modeling/organization-context-authorization","597"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/parent-child",component:h("/docs/modeling/parent-child","34a"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/public-access",component:h("/docs/modeling/public-access","e9a"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/roles-and-permissions",component:h("/docs/modeling/roles-and-permissions","fef"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/user-groups",component:h("/docs/modeling/user-groups","2d1"),exact:!0,sidebar:"docs"}]},{path:"/",component:h("/","a17"),exact:!0},{path:"*",component:h("*")}]},98934:(e,t,n)=>{"use strict";n.d(t,{_:()=>i,t:()=>s});var r=n(67294);const i=r.createContext(!1);function s(e){let{children:t}=e;const[n,s]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{s(!0)}),[]),r.createElement(i.Provider,{value:n},t)}},22679:(e,t,n)=>{"use strict";var r=n(67294),i=n(73935),s=n(73727),o=n(70405),a=n(10412);const l=[n(32497),n(78221),n(18320),n(43576),n(52295)];var c=n(723),u=n(16550),d=n(18790),h=n(35742),p=n(52263);function f(e){let{children:t}=e;const{siteConfig:n}=(0,p.Z)(),{contentSecurityPolicy:i}=n.customFields;return r.createElement("div",{className:"CustomizedRoot"},r.createElement(h.Z,null,r.createElement("meta",{httpEquiv:"Content-Security-Policy",content:i})),t)}var g=n(87462),m=n(44996),y=n(86668),b=n(1944),v=n(94711),E=n(19727),_=n(43320),T=n(18780),x=n(90197);function w(){const{i18n:{defaultLocale:e,localeConfigs:t}}=(0,p.Z)(),n=(0,v.l)();return r.createElement(h.Z,null,Object.entries(t).map((e=>{let[t,{htmlLang:i}]=e;return r.createElement("link",{key:t,rel:"alternate",href:n.createUrl({locale:t,fullyQualified:!0}),hrefLang:i})})),r.createElement("link",{rel:"alternate",href:n.createUrl({locale:e,fullyQualified:!0}),hrefLang:"x-default"}))}function S(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,p.Z)(),i=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,p.Z)(),{pathname:r}=(0,u.TH)();return e+(0,T.applyTrailingSlash)((0,m.Z)(r),{trailingSlash:n,baseUrl:t})}(),s=t?`${n}${t}`:i;return r.createElement(h.Z,null,r.createElement("meta",{property:"og:url",content:s}),r.createElement("link",{rel:"canonical",href:s}))}function R(){const{i18n:{currentLocale:e}}=(0,p.Z)(),{metadata:t,image:n}=(0,y.L)();return r.createElement(r.Fragment,null,r.createElement(h.Z,null,r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("body",{className:E.h})),n&&r.createElement(b.d,{image:n}),r.createElement(S,null),r.createElement(w,null),r.createElement(x.Z,{tag:_.HX,locale:e}),r.createElement(h.Z,null,t.map(((e,t)=>r.createElement("meta",(0,g.Z)({key:t},e))))))}const k=new Map;function C(e){if(k.has(e.pathname))return{...e,pathname:k.get(e.pathname)};if((0,d.f)(c.Z,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return k.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return k.set(e.pathname,t),{...e,pathname:t}}var O=n(98934),A=n(58940);function N(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=l.map((t=>{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>i.forEach((e=>e?.()))}const I=function(e){let{children:t,location:n,previousLocation:i}=e;return(0,r.useLayoutEffect)((()=>{i!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,i=t.hash===n.hash,s=t.search===n.search;if(r&&i&&!s)return;const{hash:o}=t;if(o){const e=decodeURIComponent(o.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:i}),N("onRouteDidUpdate",{previousLocation:i,location:n}))}),[i,n]),t};function L(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,d.f)(c.Z,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class D extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=a.Z.canUseDOM?N("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=N("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),L(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return r.createElement(I,{previousLocation:this.previousLocation,location:t},r.createElement(u.AW,{location:t,render:()=>e}))}}const P=D,M="__docusaurus-base-url-issue-banner-container",F="__docusaurus-base-url-issue-banner",U="__docusaurus-base-url-issue-banner-suggestion-container",j="__DOCUSAURUS_INSERT_BASEURL_BANNER";function B(e){return`\nwindow['${j}'] = true;\n\ndocument.addEventListener('DOMContentLoaded', maybeInsertBanner);\n\nfunction maybeInsertBanner() {\n var shouldInsert = window['${j}'];\n shouldInsert && insertBanner();\n}\n\nfunction insertBanner() {\n var bannerContainer = document.getElementById('${M}');\n if (!bannerContainer) {\n return;\n }\n var bannerHtml = ${JSON.stringify(function(e){return`\n<div id="${F}" style="border: thick solid red; background-color: rgb(255, 230, 179); margin: 20px; padding: 20px; font-size: 20px;">\n <p style="font-weight: bold; font-size: 30px;">Your Docusaurus site did not load properly.</p>\n <p>A very common reason is a wrong site <a href="https://docusaurus.io/docs/docusaurus.config.js/#baseUrl" style="font-weight: bold;">baseUrl configuration</a>.</p>\n <p>Current configured baseUrl = <span style="font-weight: bold; color: red;">${e}</span> ${"/"===e?" (default value)":""}</p>\n <p>We suggest trying baseUrl = <span id="${U}" style="font-weight: bold; color: green;"></span></p>\n</div>\n`}(e)).replace(/</g,"\\<")};\n bannerContainer.innerHTML = bannerHtml;\n var suggestionContainer = document.getElementById('${U}');\n var actualHomePagePath = window.location.pathname;\n var suggestedBaseUrl = actualHomePagePath.substr(-1) === '/'\n ? actualHomePagePath\n : actualHomePagePath + '/';\n suggestionContainer.innerHTML = suggestedBaseUrl;\n}\n`}function H(){const{siteConfig:{baseUrl:e}}=(0,p.Z)();return(0,r.useLayoutEffect)((()=>{window[j]=!1}),[]),r.createElement(r.Fragment,null,!a.Z.canUseDOM&&r.createElement(h.Z,null,r.createElement("script",null,B(e))),r.createElement("div",{id:M}))}function $(){const{siteConfig:{baseUrl:e,baseUrlIssueBanner:t}}=(0,p.Z)(),{pathname:n}=(0,u.TH)();return t&&n===e?r.createElement(H,null):null}function z(){const{siteConfig:{favicon:e,title:t,noIndex:n},i18n:{currentLocale:i,localeConfigs:s}}=(0,p.Z)(),o=(0,m.Z)(e),{htmlLang:a,direction:l}=s[i];return r.createElement(h.Z,null,r.createElement("html",{lang:a,dir:l}),r.createElement("title",null,t),r.createElement("meta",{property:"og:title",content:t}),r.createElement("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),n&&r.createElement("meta",{name:"robots",content:"noindex, nofollow"}),e&&r.createElement("link",{rel:"icon",href:o}))}var V=n(44763),G=n(72389);function W(){const e=(0,G.Z)();return r.createElement(h.Z,null,r.createElement("html",{"data-has-hydrated":e}))}function K(){const e=(0,d.H)(c.Z),t=(0,u.TH)();return r.createElement(V.Z,null,r.createElement(A.M,null,r.createElement(O.t,null,r.createElement(f,null,r.createElement(z,null),r.createElement(R,null),r.createElement($,null),r.createElement(P,{location:C(t)},e)),r.createElement(W,null))))}var Y=n(16887);const Z=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const i=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;i?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var q=n(99670);const Q=new Set,X=new Set,J=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,ee={prefetch(e){if(!(e=>!J()&&!X.has(e)&&!Q.has(e))(e))return!1;Q.add(e);const t=(0,d.f)(c.Z,e).flatMap((e=>{return t=e.route.path,Object.entries(Y).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,q.Z)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?Z(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!J()&&!X.has(e))(e)&&(X.add(e),L(e))},te=Object.freeze(ee);if(a.Z.canUseDOM){window.docusaurus=te;const e=i.hydrate;L(window.location.pathname).then((()=>{e(r.createElement(o.B6,null,r.createElement(s.VK,null,r.createElement(K,null))),document.getElementById("__docusaurus"))}))}},58940:(e,t,n)=>{"use strict";n.d(t,{_:()=>u,M:()=>d});var r=n(67294),i=n(36809);const s=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"content/authorization-and-openfga","docs":[{"id":"content/authorization-and-openfga","path":"/docs/authorization-and-openfga","sidebar":"docs"},{"id":"content/concepts","path":"/docs/concepts","sidebar":"docs"},{"id":"content/configuration-language","path":"/docs/configuration-language","sidebar":"docs"},{"id":"content/getting-started/configure-model","path":"/docs/getting-started/configure-model","sidebar":"docs"},{"id":"content/getting-started/create-store","path":"/docs/getting-started/create-store","sidebar":"docs"},{"id":"content/getting-started/framework","path":"/docs/getting-started/framework","sidebar":"docs"},{"id":"content/getting-started/immutable-models","path":"/docs/getting-started/immutable-models","sidebar":"docs"},{"id":"content/getting-started/install-sdk","path":"/docs/getting-started/install-sdk","sidebar":"docs"},{"id":"content/getting-started/overview","path":"/docs/getting-started","sidebar":"docs"},{"id":"content/getting-started/perform-check","path":"/docs/getting-started/perform-check","sidebar":"docs"},{"id":"content/getting-started/perform-list-objects","path":"/docs/getting-started/perform-list-objects","sidebar":"docs"},{"id":"content/getting-started/production-best-practices","path":"/docs/getting-started/running-in-production","sidebar":"docs"},{"id":"content/getting-started/setup-openfga/docker-setup","path":"/docs/getting-started/setup-openfga/docker","sidebar":"docs"},{"id":"content/getting-started/setup-openfga/kubernetes-setup","path":"/docs/getting-started/setup-openfga/kubernetes","sidebar":"docs"},{"id":"content/getting-started/setup-openfga/overview","path":"/docs/getting-started/setup-openfga/overview","sidebar":"docs"},{"id":"content/getting-started/setup-sdk-client","path":"/docs/getting-started/setup-sdk-client","sidebar":"docs"},{"id":"content/getting-started/tuples-api-best-practices","path":"/docs/getting-started/tuples-api-best-practices","sidebar":"docs"},{"id":"content/getting-started/update-tuples","path":"/docs/getting-started/update-tuples","sidebar":"docs"},{"id":"content/interacting/managing-group-access","path":"/docs/interacting/managing-group-access","sidebar":"docs"},{"id":"content/interacting/managing-group-membership","path":"/docs/interacting/managing-group-membership","sidebar":"docs"},{"id":"content/interacting/managing-relationships-between-objects","path":"/docs/interacting/managing-relationships-between-objects","sidebar":"docs"},{"id":"content/interacting/managing-user-access","path":"/docs/interacting/managing-user-access","sidebar":"docs"},{"id":"content/interacting/overview","path":"/docs/interacting","sidebar":"docs"},{"id":"content/interacting/read-tuple-changes","path":"/docs/interacting/read-tuple-changes","sidebar":"docs"},{"id":"content/interacting/relationship-queries","path":"/docs/interacting/relationship-queries","sidebar":"docs"},{"id":"content/interacting/search-with-permissions","path":"/docs/interacting/search-with-permissions","sidebar":"docs"},{"id":"content/interacting/transactional-writes","path":"/docs/interacting/transactional-writes","sidebar":"docs"},{"id":"content/modeling/advanced/entitlements","path":"/docs/modeling/advanced/entitlements","sidebar":"docs"},{"id":"content/modeling/advanced/gdrive","path":"/docs/modeling/advanced/gdrive","sidebar":"docs"},{"id":"content/modeling/advanced/github","path":"/docs/modeling/advanced/github","sidebar":"docs"},{"id":"content/modeling/advanced/iot","path":"/docs/modeling/advanced/iot","sidebar":"docs"},{"id":"content/modeling/advanced/overview","path":"/docs/modeling/advanced","sidebar":"docs"},{"id":"content/modeling/advanced/slack","path":"/docs/modeling/advanced/slack","sidebar":"docs"},{"id":"content/modeling/blocklists","path":"/docs/modeling/blocklists","sidebar":"docs"},{"id":"content/modeling/building-blocks/concentric-relationships","path":"/docs/modeling/building-blocks/concentric-relationships","sidebar":"docs"},{"id":"content/modeling/building-blocks/direct-relationships","path":"/docs/modeling/building-blocks/direct-relationships","sidebar":"docs"},{"id":"content/modeling/building-blocks/object-to-object-relationships","path":"/docs/modeling/building-blocks/object-to-object-relationships","sidebar":"docs"},{"id":"content/modeling/building-blocks/overview","path":"/docs/modeling/building-blocks","sidebar":"docs"},{"id":"content/modeling/building-blocks/usersets","path":"/docs/modeling/building-blocks/usersets","sidebar":"docs"},{"id":"content/modeling/contextual-time-based-authorization","path":"/docs/modeling/contextual-time-based-authorization","sidebar":"docs"},{"id":"content/modeling/custom-roles","path":"/docs/modeling/custom-roles","sidebar":"docs"},{"id":"content/modeling/direct-access","path":"/docs/modeling/direct-access","sidebar":"docs"},{"id":"content/modeling/getting-started","path":"/docs/modeling/getting-started","sidebar":"docs"},{"id":"content/modeling/migrating/migrating-relations","path":"/docs/modeling/migrating/migrating-relations","sidebar":"docs"},{"id":"content/modeling/migrating/migrating-schema-1-1","path":"/docs/modeling/migrating/migrating-schema-1-1","sidebar":"docs"},{"id":"content/modeling/migrating/overview","path":"/docs/modeling/migrating","sidebar":"docs"},{"id":"content/modeling/multiple-restrictions","path":"/docs/modeling/multiple-restrictions","sidebar":"docs"},{"id":"content/modeling/organization-context-authorization","path":"/docs/modeling/organization-context-authorization","sidebar":"docs"},{"id":"content/modeling/overview","path":"/docs/modeling","sidebar":"docs"},{"id":"content/modeling/parent-child","path":"/docs/modeling/parent-child","sidebar":"docs"},{"id":"content/modeling/public-access","path":"/docs/modeling/public-access","sidebar":"docs"},{"id":"content/modeling/roles-and-permissions","path":"/docs/modeling/roles-and-permissions","sidebar":"docs"},{"id":"content/modeling/user-groups","path":"/docs/modeling/user-groups","sidebar":"docs"}],"draftIds":[],"sidebars":{"docs":{"link":{"path":"/docs/authorization-and-openfga","label":"What is OpenFGA"}}}}],"breadcrumbs":true}}}'),o=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var a=n(57529);const l=JSON.parse('{"docusaurusVersion":"2.4.3","siteVersion":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"2.4.3"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"2.4.3"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"2.4.3"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"2.4.3"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"2.4.3"},"webpack-overrides-docusaurus-plugin":{"type":"project"},"docusaurus-plugin-client-redirects":{"type":"package","name":"@docusaurus/plugin-client-redirects","version":"2.4.3"},"docusaurus-plugin-local-resolve":{"type":"package","name":"docusaurus-plugin-module-alias","version":"0.0.2"},"@easyops-cn/docusaurus-search-local":{"type":"package","name":"@easyops-cn/docusaurus-search-local","version":"0.36.0"}}}'),c={siteConfig:i.default,siteMetadata:l,globalData:s,i18n:o,codeTranslations:a},u=r.createContext(c);function d(e){let{children:t}=e;return r.createElement(u.Provider,{value:c},t)}},44763:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(67294),i=n(10412),s=n(35742),o=n(18780),a=n(40163);function l(e){let{error:t,tryAgain:n}=e;return r.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"}},r.createElement("h1",{style:{fontSize:"3rem"}},"This page crashed"),r.createElement("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"}},"Try again"),r.createElement(c,{error:t}))}function c(e){let{error:t}=e;const n=(0,o.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return r.createElement("p",{style:{whiteSpace:"pre-wrap"}},n)}function u(e){let{error:t,tryAgain:n}=e;return r.createElement(h,{fallback:()=>r.createElement(l,{error:t,tryAgain:n})},r.createElement(s.Z,null,r.createElement("title",null,"Page Error")),r.createElement(a.Z,null,r.createElement(l,{error:t,tryAgain:n})))}const d=e=>r.createElement(u,e);class h extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){i.Z.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??d)(e)}return e??null}}},10412:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,i={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},35742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(67294),i=n(70405);function s(e){return r.createElement(i.ql,e)}},39960:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(87462),i=n(67294),s=n(73727),o=n(18780),a=n(52263),l=n(13919),c=n(10412);const u=i.createContext({collectLink:()=>{}});var d=n(44996);function h(e,t){let{isNavLink:n,to:h,href:p,activeClassName:f,isActive:g,"data-noBrokenLinkCheck":m,autoAddBaseUrl:y=!0,...b}=e;const{siteConfig:{trailingSlash:v,baseUrl:E}}=(0,a.Z)(),{withBaseUrl:_}=(0,d.C)(),T=(0,i.useContext)(u),x=(0,i.useRef)(null);(0,i.useImperativeHandle)(t,(()=>x.current));const w=h||p;const S=(0,l.Z)(w),R=w?.replace("pathname://","");let k=void 0!==R?(C=R,y&&(e=>e.startsWith("/"))(C)?_(C):C):void 0;var C;k&&S&&(k=(0,o.applyTrailingSlash)(k,{trailingSlash:v,baseUrl:E}));const O=(0,i.useRef)(!1),A=n?s.OL:s.rU,N=c.Z.canUseIntersectionObserver,I=(0,i.useRef)(),L=()=>{O.current||null==k||(window.docusaurus.preload(k),O.current=!0)};(0,i.useEffect)((()=>(!N&&S&&null!=k&&window.docusaurus.prefetch(k),()=>{N&&I.current&&I.current.disconnect()})),[I,k,N,S]);const D=k?.startsWith("#")??!1,P=!k||!S||D;return P||m||T.collectLink(k),P?i.createElement("a",(0,r.Z)({ref:x,href:k},w&&!S&&{target:"_blank",rel:"noopener noreferrer"},b)):i.createElement(A,(0,r.Z)({},b,{onMouseEnter:L,onTouchStart:L,innerRef:e=>{x.current=e,N&&e&&S&&(I.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(I.current.unobserve(e),I.current.disconnect(),null!=k&&window.docusaurus.prefetch(k))}))})),I.current.observe(e))},to:k},n&&{isActive:g,activeClassName:f}))}const p=i.forwardRef(h)},95999:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l,I:()=>a});var r=n(67294);function i(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var s=n(57529);function o(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return s[t??n]??n??t}function a(e,t){let{message:n,id:r}=e;return i(o({message:n,id:r}),t)}function l(e){let{children:t,id:n,values:s}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal <Translate> children",t),new Error("The Docusaurus <Translate> component only accept simple string values");const a=o({message:t,id:n});return r.createElement(r.Fragment,null,i(a,s))}},29935:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});const r="default"},13919:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}n.d(t,{Z:()=>i,b:()=>r})},44996:(e,t,n)=>{"use strict";n.d(t,{C:()=>o,Z:()=>a});var r=n(67294),i=n(52263),s=n(13919);function o(){const{siteConfig:{baseUrl:e,url:t}}=(0,i.Z)(),n=(0,r.useCallback)(((n,r)=>function(e,t,n,r){let{forcePrependBaseUrl:i=!1,absolute:o=!1}=void 0===r?{}:r;if(!n||n.startsWith("#")||(0,s.b)(n))return n;if(i)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;const a=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+a:a}(t,e,n,r)),[t,e]);return{withBaseUrl:n}}function a(e,t){void 0===t&&(t={});const{withBaseUrl:n}=o();return n(e,t)}},52263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(67294),i=n(58940);function s(){return(0,r.useContext)(i._)}},72389:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(67294),i=n(98934);function s(){return(0,r.useContext)(i._)}},99670:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function i(e){const t={};return function e(n,i){Object.entries(n).forEach((n=>{let[s,o]=n;const a=i?`${i}.${s}`:s;r(o)?e(o,a):t[a]=o}))}(e),t}},30226:(e,t,n)=>{"use strict";n.d(t,{_:()=>i,z:()=>s});var r=n(67294);const i=r.createContext(null);function s(e){let{children:t,value:n}=e;const s=r.useContext(i),o=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:s,value:n})),[s,n]);return r.createElement(i.Provider,{value:o},t)}},80143:(e,t,n)=>{"use strict";n.d(t,{Iw:()=>g,gA:()=>h,_r:()=>u,Jo:()=>m,zh:()=>d,yW:()=>f,gB:()=>p});var r=n(16550),i=n(52263),s=n(29935);function o(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,i.Z)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const a=e=>e.versions.find((e=>e.isLast));function l(e,t){const n=function(e,t){const n=a(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})))}(e,t),i=n?.docs.find((e=>!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:i,alternateDocVersions:i?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(i.id):{}}}const c={},u=()=>o("docusaurus-plugin-content-docs")??c,d=e=>function(e,t,n){void 0===t&&(t=s.m),void 0===n&&(n={});const r=o(e),i=r?.[t];if(!i&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return i}("docusaurus-plugin-content-docs",e,{failfast:!0});function h(e){void 0===e&&(e={});const t=u(),{pathname:n}=(0,r.TH)();return function(e,t,n){void 0===n&&(n={});const i=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),s=i?{pluginId:i[0],pluginData:i[1]}:void 0;if(!s&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return s}(t,n,e)}function p(e){return d(e).versions}function f(e){const t=d(e);return a(t)}function g(e){const t=d(e),{pathname:n}=(0,r.TH)();return l(t,n)}function m(e){const t=d(e),{pathname:n}=(0,r.TH)();return function(e,t){const n=a(e);return{latestDocSuggestion:l(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},18320:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(74865),i=n.n(r);i().configure({showSpinner:!1});const s={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{i().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){i().done()}}},78221:(e,t,n)=>{"use strict";n.r(t);var r=n(11205),i=n(36809),s=n(44096);const{OpenFgaDslThemeTokenType:o}=s.theming,{PrismExtensions:a}=s.tools,l={...a.languageDefinition,[o.KEYWORD]:/\b(type|relations|define|and|or|but not|from|as|model|schema|condition)\b/,condition:{pattern:/(\bcondition\s+)\w+/i,lookbehind:!0,greedy:!0},"condition-params":{pattern:/\(.*\)\s*{/,inside:{"condition-param":/\b(\w+)\s*:/i,"condition-param-type":/\b(string|int|map|uint|list|timestamp|bool|duration|double|ipaddress)\b/}}};!function(e){const{themeConfig:{prism:t}}=i.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{n(7464)(`./prism-${e}`)})),e.languages[a.LANGUAGE_NAME]=l,delete globalThis.Prism}(r.Z)},39471:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(67294);const i={iconExternalLink:"iconExternalLink_nPIU"};function s(e){let{width:t=13.5,height:n=13.5}=e;return r.createElement("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:i.iconExternalLink},r.createElement("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"}))}},40163:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Dt});var r=n(67294),i=n(34334),s=n(44763),o=n(1944),a=n(87462),l=n(16550),c=n(95999),u=n(85936);const d="__docusaurus_skipToContent_fallback";function h(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function p(){const e=(0,r.useRef)(null),{action:t}=(0,l.k6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&h(t)}),[]);return(0,u.S)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&h(e.current)})),{containerRef:e,onClick:n}}const f=(0,c.I)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function g(e){const t=e.children??f,{containerRef:n,onClick:i}=p();return r.createElement("div",{ref:n,role:"region","aria-label":f},r.createElement("a",(0,a.Z)({},e,{href:`#${d}`,onClick:i}),t))}var m=n(35281),y=n(19727);const b={skipToContent:"skipToContent_fXgn"};function v(){return r.createElement(g,{className:b.skipToContent})}var E=n(86668),_=n(59689);function T(e){let{width:t=21,height:n=21,color:i="currentColor",strokeWidth:s=1.2,className:o,...l}=e;return r.createElement("svg",(0,a.Z)({viewBox:"0 0 15 15",width:t,height:n},l),r.createElement("g",{stroke:i,strokeWidth:s},r.createElement("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})))}const x={closeButton:"closeButton_CVFx"};function w(e){return r.createElement("button",(0,a.Z)({type:"button","aria-label":(0,c.I)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"})},e,{className:(0,i.Z)("clean-btn close",x.closeButton,e.className)}),r.createElement(T,{width:14,height:14,strokeWidth:3.1}))}const S={content:"content_knG7"};function R(e){const{announcementBar:t}=(0,E.L)(),{content:n}=t;return r.createElement("div",(0,a.Z)({},e,{className:(0,i.Z)(S.content,e.className),dangerouslySetInnerHTML:{__html:n}}))}const k={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function C(){const{announcementBar:e}=(0,E.L)(),{isActive:t,close:n}=(0,_.nT)();if(!t)return null;const{backgroundColor:i,textColor:s,isCloseable:o}=e;return r.createElement("div",{className:k.announcementBar,style:{backgroundColor:i,color:s},role:"banner"},o&&r.createElement("div",{className:k.announcementBarPlaceholder}),r.createElement(R,{className:k.announcementBarContent}),o&&r.createElement(w,{onClick:n,className:k.announcementBarClose}))}var O=n(93163),A=n(12466);var N=n(902),I=n(13102);const L=r.createContext(null);function D(e){let{children:t}=e;const n=function(){const e=(0,O.e)(),t=(0,I.HY)(),[n,i]=(0,r.useState)(!1),s=null!==t.component,o=(0,N.D9)(s);return(0,r.useEffect)((()=>{s&&!o&&i(!0)}),[s,o]),(0,r.useEffect)((()=>{s?e.shown||i(!0):i(!1)}),[e.shown,s]),(0,r.useMemo)((()=>[n,i]),[n])}();return r.createElement(L.Provider,{value:n},t)}function P(e){if(e.component){const t=e.component;return r.createElement(t,e.props)}}function M(){const e=(0,r.useContext)(L);if(!e)throw new N.i6("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,i=(0,r.useCallback)((()=>n(!1)),[n]),s=(0,I.HY)();return(0,r.useMemo)((()=>({shown:t,hide:i,content:P(s)})),[i,s,t])}function F(e){let{header:t,primaryMenu:n,secondaryMenu:s}=e;const{shown:o}=M();return r.createElement("div",{className:"navbar-sidebar"},t,r.createElement("div",{className:(0,i.Z)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":o})},r.createElement("div",{className:"navbar-sidebar__item menu"},n),r.createElement("div",{className:"navbar-sidebar__item menu"},s)))}var U=n(92949),j=n(72389);function B(e){return r.createElement("svg",(0,a.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"}))}function H(e){return r.createElement("svg",(0,a.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"}))}const $={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function z(e){let{className:t,buttonClassName:n,value:s,onChange:o}=e;const a=(0,j.Z)(),l=(0,c.I)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===s?(0,c.I)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,c.I)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return r.createElement("div",{className:(0,i.Z)($.toggle,t)},r.createElement("button",{className:(0,i.Z)("clean-btn",$.toggleButton,!a&&$.toggleButtonDisabled,n),type:"button",onClick:()=>o("dark"===s?"light":"dark"),disabled:!a,title:l,"aria-label":l,"aria-live":"polite"},r.createElement(B,{className:(0,i.Z)($.toggleIcon,$.lightToggleIcon)}),r.createElement(H,{className:(0,i.Z)($.toggleIcon,$.darkToggleIcon)})))}const V=r.memo(z),G={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function W(e){let{className:t}=e;const n=(0,E.L)().navbar.style,i=(0,E.L)().colorMode.disableSwitch,{colorMode:s,setColorMode:o}=(0,U.I)();return i?null:r.createElement(V,{className:t,buttonClassName:"dark"===n?G.darkNavbarColorModeToggle:void 0,value:s,onChange:o})}var K=n(21327);function Y(){return r.createElement(K.Z,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function Z(){const e=(0,O.e)();return r.createElement("button",{type:"button","aria-label":(0,c.I)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle()},r.createElement(T,{color:"var(--ifm-color-emphasis-600)"}))}function q(){return r.createElement("div",{className:"navbar-sidebar__brand"},r.createElement(Y,null),r.createElement(W,{className:"margin-right--md"}),r.createElement(Z,null))}var Q=n(39960),X=n(44996),J=n(13919);function ee(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}var te=n(39471);const ne="openfga_github_stars";function re(e){let{activeBasePath:t,activeBaseRegex:n,to:i,href:s,label:o,html:l,isDropdownLink:c,prependBaseUrlToHref:u,...d}=e;const h=(0,X.Z)(i),p=(0,X.Z)(t),f=(0,X.Z)(s,{forcePrependBaseUrl:!0}),g=o&&s&&!(0,J.Z)(s),[m,y]=(0,r.useState)(null);(0,r.useEffect)((()=>{m||(async()=>{const e=JSON.parse(sessionStorage.getItem(ne));try{if(e){const t=new Date(e.retrievedTime);if(t.setDate(t.getDate()+1),t.getTime()>Date.now())return void y({count:e.count,retrievedTime:Date.now()})}const t=await fetch("https://api.github.com/repos/openfga/openfga");if(!t.ok)throw new Error(`This is an HTTP error: The status is ${t.status}`);const n={count:(await t.json()).stargazers_count,retrievedTime:Date.now()};y(n),sessionStorage.setItem(ne,JSON.stringify(n))}catch(t){y(e||null)}})()}),[]);const b="GitHub"===o&&m?`GitHub | ${m.count}`:o,v=l?{dangerouslySetInnerHTML:{__html:l}}:{children:r.createElement(r.Fragment,null,b,g&&r.createElement(te.Z,c&&{width:12,height:12}))};return s?r.createElement(Q.Z,(0,a.Z)({href:u?f:s},d,v)):r.createElement(Q.Z,(0,a.Z)({to:h,isNavLink:!0},(t||n)&&{isActive:(e,t)=>n?ee(n,t.pathname):t.pathname.startsWith(p)},d,v))}function ie(e){let{className:t,isDropdownItem:n=!1,...s}=e;const o=r.createElement(re,(0,a.Z)({className:(0,i.Z)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n},s));return n?r.createElement("li",null,o):o}function se(e){let{className:t,isDropdownItem:n,...s}=e;return r.createElement("li",{className:"menu__list-item"},r.createElement(re,(0,a.Z)({className:(0,i.Z)("menu__link",t)},s)))}function oe(e){let{mobile:t=!1,position:n,...i}=e;const s=t?se:ie;return r.createElement(s,(0,a.Z)({},i,{activeClassName:i.activeClassName??(t?"menu__link--active":"navbar__link--active")}))}var ae=n(86043),le=n(48596),ce=n(52263);function ue(e,t){return e.some((e=>function(e,t){return!!(0,le.Mg)(e.to,t)||!!ee(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function de(e){let{items:t,position:n,className:s,onClick:o,...l}=e;const c=(0,r.useRef)(null),[u,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{c.current&&!c.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[c]),r.createElement("div",{ref:c,className:(0,i.Z)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":u})},r.createElement(re,(0,a.Z)({"aria-haspopup":"true","aria-expanded":u,role:"button",href:l.to?void 0:"#",className:(0,i.Z)("navbar__link",s)},l,{onClick:l.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!u))}}),l.children??l.label),r.createElement("ul",{className:"dropdown__menu"},t.map(((e,t)=>r.createElement(Ke,(0,a.Z)({isDropdownItem:!0,activeClassName:"dropdown__link--active"},e,{key:t}))))))}function he(e){let{items:t,className:n,position:s,onClick:o,...c}=e;const u=function(){const{siteConfig:{baseUrl:e}}=(0,ce.Z)(),{pathname:t}=(0,l.TH)();return t.replace(e,"/")}(),d=ue(t,u),{collapsed:h,toggleCollapsed:p,setCollapsed:f}=(0,ae.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&f(!d)}),[u,d,f]),r.createElement("li",{className:(0,i.Z)("menu__list-item",{"menu__list-item--collapsed":h})},r.createElement(re,(0,a.Z)({role:"button",className:(0,i.Z)("menu__link menu__link--sublist menu__link--sublist-caret",n)},c,{onClick:e=>{e.preventDefault(),p()}}),c.children??c.label),r.createElement(ae.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:h},t.map(((e,t)=>r.createElement(Ke,(0,a.Z)({mobile:!0,isDropdownItem:!0,onClick:o,activeClassName:"menu__link--active"},e,{key:t}))))))}function pe(e){let{mobile:t=!1,...n}=e;const i=t?he:de;return r.createElement(i,n)}var fe=n(94711);function ge(e){let{width:t=20,height:n=20,...i}=e;return r.createElement("svg",(0,a.Z)({viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0},i),r.createElement("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"}))}const me="iconLanguage_nlXk";var ye=n(61029),be=n(1728),ve=n(10412),Ee=n(60373),_e=n(80143),Te=n(90022),xe=n(98202),we=n(73926),Se=n(91073),Re=n(82539),ke=n(10726);const Ce='<svg width="20" height="20" viewBox="0 0 20 20"><path d="M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linejoin="round"></path></svg>',Oe='<svg width="20" height="20" viewBox="0 0 20 20"><path d="M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg>',Ae='<svg width="20" height="20" viewBox="0 0 20 20"><path d="M17 5H3h14zm0 5H3h14zm0 5H3h14z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linejoin="round"></path></svg>',Ne='<svg width="20" height="20" viewBox="0 0 20 20"><g stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><path d="M18 3v4c0 2-2 4-4 4H2"></path><path d="M8 17l-6-6 6-6"></path></g></svg>',Ie='<svg width="40" height="40" viewBox="0 0 20 20" fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M15.5 4.8c2 3 1.7 7-1 9.7h0l4.3 4.3-4.3-4.3a7.8 7.8 0 01-9.8 1m-2.2-2.2A7.8 7.8 0 0113.2 2.4M2 18L18 2"></path></svg>',Le='<svg viewBox="0 0 24 54"><g stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><path d="M8 6v42M20 27H8.3"></path></g></svg>',De='<svg viewBox="0 0 24 54"><g stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><path d="M8 6v21M20 27H8.3"></path></g></svg>',Pe={searchBar:"searchBar_RVTs",dropdownMenu:"dropdownMenu_qbY6",searchBarLeft:"searchBarLeft_MXDe",suggestion:"suggestion_fB_2",cursor:"cursor_eG29",hitTree:"hitTree_kk6K",hitIcon:"hitIcon_a7Zy",hitPath:"hitPath_ieM4",noResultsIcon:"noResultsIcon_EBY5",hitFooter:"hitFooter_E9YW",hitWrapper:"hitWrapper_sAK8",hitTitle:"hitTitle_vyVt",hitAction:"hitAction_NqkB",hideAction:"hideAction_vcyE",noResults:"noResults_l6Q3",searchBarContainer:"searchBarContainer_NW3z",searchBarLoadingRing:"searchBarLoadingRing_YnHq",searchClearButton:"searchClearButton_qk4g",searchIndexLoading:"searchIndexLoading_EJ1f",searchHintContainer:"searchHintContainer_Pkmr",searchHint:"searchHint_iIMx",focused:"focused_OWtg",input:"input_FOTf",hint:"hint_URu1",suggestions:"suggestions_X8XU",dataset:"dataset_QiCy",empty:"empty_eITn"};function Me(e){let{document:t,type:n,page:r,metadata:i,tokens:s,isInterOfTree:o,isLastOfTree:a}=e;const l=0===n,c=1===n,u=[];o?u.push(Le):a&&u.push(De);const d=u.map((e=>`<span class="${Pe.hitTree}">${e}</span>`)),h=`<span class="${Pe.hitIcon}">${l?Ce:c?Oe:Ae}</span>`,p=[`<span class="${Pe.hitTitle}">${(0,ke.o)(t.t,(0,Se.m)(i,"t"),s)}</span>`];if(!o&&!a&&ye.H6){const e=r?(r.b??[]).concat(r.t).concat(t.s&&t.s!==r.t?t.s:[]):t.b;p.push(`<span class="${Pe.hitPath}">${(0,we.e)(e??[])}</span>`)}else l||p.push(`<span class="${Pe.hitPath}">${(0,Re.C)(r.t||(t.u.startsWith("/docs/api-reference/")?"API Reference":""),s)}</span>`);const f=`<span class="${Pe.hitAction}">${Ne}</span>`;return[...d,h,`<span class="${Pe.hitWrapper}">`,...p,"</span>",f].join("")}function Fe(){return`<span class="${Pe.noResults}"><span class="${Pe.noResultsIcon}">${Ie}</span><span>${(0,c.I)({id:"theme.SearchBar.noResultsText",message:"No results"})}</span></span>`}var Ue=n(80311);async function je(){const e=await Promise.all([n.e(8443),n.e(5525)]).then(n.t.bind(n,68443,23)),t=e.default;return t.noConflict?t.noConflict():e.noConflict&&e.noConflict(),t}const Be="_highlight";const He=function(e){let{handleSearchBarToggle:t}=e;const{siteConfig:{baseUrl:n}}=(0,ce.Z)(),i=(0,_e.gA)();let s=n;try{const{preferredVersion:e}=(0,Ee.J)(i?.pluginId??ye.gQ);e&&!e.isLast&&(s=e.path+"/")}catch(D){if(ye.l9&&!(D instanceof N.i6))throw D}const o=(0,l.k6)(),a=(0,l.TH)(),u=(0,r.useRef)(null),d=(0,r.useRef)(new Map),h=(0,r.useRef)(!1),[p,f]=(0,r.useState)(!1),[g,m]=(0,r.useState)(!1),[y,b]=(0,r.useState)(""),v=(0,r.useRef)(null),E=(0,r.useRef)(""),[_,T]=(0,r.useState)("");(0,r.useEffect)((()=>{if(!Array.isArray(ye.Kc))return;let e="";if(a.pathname.startsWith(s)){const t=a.pathname.substring(s.length),n=ye.Kc.find((e=>t===e||t.startsWith(`${e}/`)));n&&(e=n)}E.current!==e&&(d.current.delete(e),E.current=e),T(e)}),[a.pathname,s]);const x=!!ye.hG&&Array.isArray(ye.Kc)&&""===_,w=(0,r.useCallback)((async()=>{if(x||d.current.get(_))return;d.current.set(_,"loading"),v.current?.autocomplete.destroy(),f(!0);const[{wrappedIndexes:e,zhDictionary:t},r]=await Promise.all([(0,Te.w)(s,_),je()]);if(v.current=r(u.current,{hint:!1,autoselect:!0,openOnFocus:!0,cssClasses:{root:(0,be.Z)(Pe.searchBar,{[Pe.searchBarLeft]:"left"===ye.pu}),noPrefix:!0,dropdownMenu:Pe.dropdownMenu,input:Pe.input,hint:Pe.hint,suggestions:Pe.suggestions,suggestion:Pe.suggestion,cursor:Pe.cursor,dataset:Pe.dataset,empty:Pe.empty}},[{source:(0,xe.v)(e,t,ye.qo),templates:{suggestion:Me,empty:Fe,footer:e=>{let{query:t,isEmpty:r}=e;if(r&&!_)return;const i=(e=>{let{query:t,isEmpty:r}=e;const i=document.createElement("a"),a=new URLSearchParams,l=(0,c.I)({id:"theme.SearchBar.seeAll",message:"See all results"}),u=(0,c.I)({id:"theme.SearchBar.seeAllOutsideContext",message:"See results outside {context}"},{context:_}),d=(0,c.I)({id:"theme.SearchBar.searchInContext",message:"See all results in {context}"},{context:_});let h;if(a.set("q",t),h=_&&r?u:_?d:l,Array.isArray(ye.Kc)&&!r&&a.set("ctx",_),s!==n){if(!s.startsWith(n))throw new Error(`Version url '${s}' does not start with base url '${n}', this is a bug of \`@easyops-cn/docusaurus-search-local\`, please report it.`);a.set("version",s.substring(n.length))}const p=`${n}search?${a.toString()}`;return i.href=p,i.textContent=h,i.addEventListener("click",(e=>{e.ctrlKey||e.metaKey||(e.preventDefault(),v.current?.autocomplete.close(),o.push(p))})),i})({query:t,isEmpty:r}),a=document.createElement("div");return a.className=Pe.hitFooter,a.appendChild(i),a}}}]).on("autocomplete:selected",(function(e,t){let{document:{u:n,h:r},tokens:i}=t;u.current?.blur();let s=n;if(ye.vc&&i.length>0){const e=new URLSearchParams;for(const t of i)e.append(Be,t);s+=`?${e.toString()}`}r&&(s+=r),o.push(s)})).on("autocomplete:closed",(()=>{u.current?.blur()})),d.current.set(_,"done"),f(!1),h.current){const e=u.current;e.value&&v.current?.autocomplete.open(),e.focus()}}),[x,_,s,n,o]);(0,r.useEffect)((()=>{if(!ye.vc)return;const e=ve.Z.canUseDOM?new URLSearchParams(a.search).getAll(Be):[];setTimeout((()=>{const t=document.querySelector("article");if(!t)return;const n=new ye.vc(t);n.unmark(),0!==e.length&&n.mark(e),b(e.join(" ")),v.current?.autocomplete.setVal(e.join(" "))}))}),[a.search,a.pathname]);const[S,R]=(0,r.useState)(!1),k=(0,r.useCallback)((()=>{h.current=!0,w(),R(!0),t?.(!0)}),[t,w]),C=(0,r.useCallback)((()=>{R(!1),t?.(!1)}),[t]),O=(0,r.useCallback)((()=>{w()}),[w]),A=(0,r.useCallback)((e=>{b(e.target.value),e.target.value&&m(!0)}),[]),I=!!ve.Z.canUseDOM&&/mac/i.test(navigator.userAgentData?.platform??navigator.platform);(0,r.useEffect)((()=>{if(!ye.AY)return;const e=e=>{!(I?e.metaKey:e.ctrlKey)||"k"!==e.key&&"K"!==e.key||(e.preventDefault(),u.current?.focus(),k())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[I,k]);const L=(0,r.useCallback)((()=>{const e=new URLSearchParams(a.search);e.delete(Be);const t=e.toString(),n=a.pathname+(""!=t?`?${t}`:"")+a.hash;n!=a.pathname+a.search+a.hash&&o.push(n),b(""),v.current?.autocomplete.setVal("")}),[a.pathname,a.search,a.hash,o]);return r.createElement("div",{className:(0,be.Z)("navbar__search",Pe.searchBarContainer,{[Pe.searchIndexLoading]:p&&g,[Pe.focused]:S}),hidden:x},r.createElement("input",{placeholder:(0,c.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),"aria-label":"Search",className:"navbar__search-input",onMouseEnter:O,onFocus:k,onBlur:C,onChange:A,ref:u,value:y}),r.createElement(Ue.Z,{className:Pe.searchBarLoadingRing}),ye.AY&&ye.t_&&(""!==y?r.createElement("button",{className:Pe.searchClearButton,onClick:L},"\u2715"):ve.Z.canUseDOM&&r.createElement("div",{className:Pe.searchHintContainer},r.createElement("kbd",{className:Pe.searchHint},I?"\u2318":"ctrl"),r.createElement("kbd",{className:Pe.searchHint},"K"))))},$e={searchBox:"searchBox_ZlJk"};function ze(e){let{children:t,className:n}=e;return r.createElement("div",{className:(0,i.Z)(n,$e.searchBox)},t)}var Ve=n(53438);const Ge=e=>e.docs.find((t=>t.id===e.mainDocId));const We={default:oe,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:i,...s}=e;const{i18n:{currentLocale:o,locales:u,localeConfigs:d}}=(0,ce.Z)(),h=(0,fe.l)(),{search:p,hash:f}=(0,l.TH)(),g=[...n,...u.map((e=>{const n=`${`pathname://${h.createUrl({locale:e,fullyQualified:!1})}`}${p}${f}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===o?t?"menu__link--active":"dropdown__link--active":""}})),...i],m=t?(0,c.I)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[o].label;return r.createElement(pe,(0,a.Z)({},s,{mobile:t,label:r.createElement(r.Fragment,null,r.createElement(ge,{className:me}),m),items:g}))},search:function(e){let{mobile:t,className:n}=e;return t?null:r.createElement(ze,{className:n},r.createElement(He,null))},dropdown:pe,html:function(e){let{value:t,className:n,mobile:s=!1,isDropdownItem:o=!1}=e;const a=o?"li":"div";return r.createElement(a,{className:(0,i.Z)({navbar__item:!s&&!o,"menu__list-item":s},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:i,...s}=e;const{activeDoc:o}=(0,_e.Iw)(i),l=(0,Ve.vY)(t,i);return null===l?null:r.createElement(oe,(0,a.Z)({exact:!0},s,{isActive:()=>o?.path===l.path||!!o?.sidebar&&o.sidebar===l.sidebar,label:n??l.id,to:l.path}))},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:i,...s}=e;const{activeDoc:o}=(0,_e.Iw)(i),l=(0,Ve.oz)(t,i).link;if(!l)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return r.createElement(oe,(0,a.Z)({exact:!0},s,{isActive:()=>o?.sidebar===t,label:n??l.label,to:l.path}))},docsVersion:function(e){let{label:t,to:n,docsPluginId:i,...s}=e;const o=(0,Ve.lO)(i)[0],l=t??o.label,c=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(o).path;return r.createElement(oe,(0,a.Z)({},s,{label:l,to:c}))},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:i,dropdownItemsBefore:s,dropdownItemsAfter:o,...u}=e;const{search:d,hash:h}=(0,l.TH)(),p=(0,_e.Iw)(n),f=(0,_e.gB)(n),{savePreferredVersionName:g}=(0,Ee.J)(n),m=[...s,...f.map((e=>{const t=p.alternateDocVersions[e.name]??Ge(e);return{label:e.label,to:`${t.path}${d}${h}`,isActive:()=>e===p.activeVersion,onClick:()=>g(e.name)}})),...o],y=(0,Ve.lO)(n)[0],b=t&&m.length>1?(0,c.I)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):y.label,v=t&&m.length>1?void 0:Ge(y).path;return m.length<=1?r.createElement(oe,(0,a.Z)({},u,{mobile:t,label:b,to:v,isActive:i?()=>!1:void 0})):r.createElement(pe,(0,a.Z)({},u,{mobile:t,label:b,to:v,items:m,isActive:i?()=>!1:void 0}))}};function Ke(e){let{type:t,...n}=e;const i=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),s=We[i];if(!s)throw new Error(`No NavbarItem component found for type "${t}".`);return r.createElement(s,n)}function Ye(){const e=(0,O.e)(),t=(0,E.L)().navbar.items;return r.createElement("ul",{className:"menu__list"},t.map(((t,n)=>r.createElement(Ke,(0,a.Z)({mobile:!0},t,{onClick:()=>e.toggle(),key:n})))))}function Ze(e){return r.createElement("button",(0,a.Z)({},e,{type:"button",className:"clean-btn navbar-sidebar__back"}),r.createElement(c.Z,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"},"\u2190 Back to main menu"))}function qe(){const e=0===(0,E.L)().navbar.items.length,t=M();return r.createElement(r.Fragment,null,!e&&r.createElement(Ze,{onClick:()=>t.hide()}),t.content)}function Qe(){const e=(0,O.e)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?r.createElement(F,{header:r.createElement(q,null),primaryMenu:r.createElement(Ye,null),secondaryMenu:r.createElement(qe,null)}):null}const Xe={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function Je(e){return r.createElement("div",(0,a.Z)({role:"presentation"},e,{className:(0,i.Z)("navbar-sidebar__backdrop",e.className)}))}function et(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:s}}=(0,E.L)(),o=(0,O.e)(),{navbarRef:a,isNavbarVisible:l}=function(e){const[t,n]=(0,r.useState)(e),i=(0,r.useRef)(!1),s=(0,r.useRef)(0),o=(0,r.useCallback)((e=>{null!==e&&(s.current=e.getBoundingClientRect().height)}),[]);return(0,A.RF)(((t,r)=>{let{scrollY:o}=t;if(!e)return;if(o<s.current)return void n(!0);if(i.current)return void(i.current=!1);const a=r?.scrollY,l=document.documentElement.scrollHeight-s.current,c=window.innerHeight;a&&o>=a?n(!1):o+c<l&&n(!0)})),(0,u.S)((t=>{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return i.current=!0,void n(!1);n(!0)})),{navbarRef:o,isNavbarVisible:t}}(n);return r.createElement("nav",{ref:a,"aria-label":(0,c.I)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,i.Z)("navbar","navbar--fixed-top",n&&[Xe.navbarHideable,!l&&Xe.navbarHidden],{"navbar--dark":"dark"===s,"navbar--primary":"primary"===s,"navbar-sidebar--show":o.shown})},t,r.createElement(Je,{onClick:o.toggle}),r.createElement(Qe,null))}var tt=n(18780);const nt={errorBoundaryError:"errorBoundaryError_a6uf"};function rt(e){return r.createElement("button",(0,a.Z)({type:"button"},e),r.createElement(c.Z,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error"},"Try again"))}function it(e){let{error:t}=e;const n=(0,tt.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return r.createElement("p",{className:nt.errorBoundaryError},n)}class st extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const ot="right";function at(e){let{width:t=30,height:n=30,className:i,...s}=e;return r.createElement("svg",(0,a.Z)({className:i,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true"},s),r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"}))}function lt(){const{toggle:e,shown:t}=(0,O.e)();return r.createElement("button",{onClick:e,"aria-label":(0,c.I)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button"},r.createElement(at,null))}const ct={colorModeToggle:"colorModeToggle_DEke"};function ut(e){let{items:t}=e;return r.createElement(r.Fragment,null,t.map(((e,t)=>r.createElement(st,{key:t,onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t})},r.createElement(Ke,e)))))}function dt(e){let{left:t,right:n}=e;return r.createElement("div",{className:"navbar__inner"},r.createElement("div",{className:"navbar__items"},t),r.createElement("div",{className:"navbar__items navbar__items--right"},n))}function ht(){const e=(0,O.e)(),t=(0,E.L)().navbar.items,[n,i]=function(e){function t(e){return"left"===(e.position??ot)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),s=t.find((e=>"search"===e.type));return r.createElement(dt,{left:r.createElement(r.Fragment,null,!e.disabled&&r.createElement(lt,null),r.createElement(Y,null),r.createElement(ut,{items:n})),right:r.createElement(r.Fragment,null,r.createElement(ut,{items:i}),r.createElement(W,{className:ct.colorModeToggle}),!s&&r.createElement(ze,null,r.createElement(He,null)))})}function pt(){return r.createElement(et,null,r.createElement(ht,null))}function ft(e){let{item:t}=e;const{to:n,href:i,label:s,prependBaseUrlToHref:o,...l}=t,c=(0,X.Z)(n),u=(0,X.Z)(i,{forcePrependBaseUrl:!0});return r.createElement(Q.Z,(0,a.Z)({className:"footer__link-item"},i?{href:o?u:i}:{to:c},l),s,i&&!(0,J.Z)(i)&&r.createElement(te.Z,null))}function gt(e){let{item:t}=e;return t.html?r.createElement("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement("li",{key:t.href??t.to,className:"footer__item"},r.createElement(ft,{item:t}))}function mt(e){let{column:t}=e;return r.createElement("div",{className:"col footer__col"},r.createElement("div",{className:"footer__title"},t.title),r.createElement("ul",{className:"footer__items clean-list"},t.items.map(((e,t)=>r.createElement(gt,{key:t,item:e})))))}function yt(e){let{columns:t}=e;return r.createElement("div",{className:"row footer__links"},t.map(((e,t)=>r.createElement(mt,{key:t,column:e}))))}function bt(){return r.createElement("span",{className:"footer__link-separator"},"\xb7")}function vt(e){let{item:t}=e;return t.html?r.createElement("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement(ft,{item:t})}function Et(e){let{links:t}=e;return r.createElement("div",{className:"footer__links text--center"},r.createElement("div",{className:"footer__links"},t.map(((e,n)=>r.createElement(r.Fragment,{key:n},r.createElement(vt,{item:e}),t.length!==n+1&&r.createElement(bt,null))))))}function _t(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?r.createElement(yt,{columns:t}):r.createElement(Et,{links:t})}var Tt=n(50941);const xt={footerLogoLink:"footerLogoLink_BH7S"};function wt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,X.C)(),s={light:n(t.src),dark:n(t.srcDark??t.src)};return r.createElement(Tt.Z,{className:(0,i.Z)("footer__logo",t.className),alt:t.alt,sources:s,width:t.width,height:t.height,style:t.style})}function St(e){let{logo:t}=e;return t.href?r.createElement(Q.Z,{href:t.href,className:xt.footerLogoLink,target:t.target},r.createElement(wt,{logo:t})):r.createElement(wt,{logo:t})}function Rt(e){let{copyright:t}=e;return r.createElement("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function kt(e){let{style:t,links:n,logo:s,copyright:o}=e;return r.createElement("footer",{className:(0,i.Z)("footer",{"footer--dark":"dark"===t})},r.createElement("div",{className:"container container-fluid"},n,(s||o)&&r.createElement("div",{className:"footer__bottom text--center"},s&&r.createElement("div",{className:"margin-bottom--sm"},s),o)))}function Ct(){const{footer:e}=(0,E.L)();if(!e)return null;const{copyright:t,links:n,logo:i,style:s}=e;return r.createElement(kt,{style:s,links:n&&n.length>0&&r.createElement(_t,{links:n}),logo:i&&r.createElement(St,{logo:i}),copyright:t&&r.createElement(Rt,{copyright:t})})}const Ot=r.memo(Ct),At=(0,N.Qc)([U.S,_.pl,A.OC,Ee.L5,o.VC,function(e){let{children:t}=e;return r.createElement(I.n2,null,r.createElement(O.M,null,r.createElement(D,null,t)))}]);function Nt(e){let{children:t}=e;return r.createElement(At,null,t)}function It(e){let{error:t,tryAgain:n}=e;return r.createElement("main",{className:"container margin-vert--xl"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col col--6 col--offset-3"},r.createElement("h1",{className:"hero__title"},r.createElement(c.Z,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed"},"This page crashed.")),r.createElement("div",{className:"margin-vert--lg"},r.createElement(rt,{onClick:n,className:"button button--primary shadow--lw"})),r.createElement("hr",null),r.createElement("div",{className:"margin-vert--md"},r.createElement(it,{error:t})))))}const Lt={mainWrapper:"mainWrapper_z2l0"};function Dt(e){const{children:t,noFooter:n,wrapperClassName:a,title:l,description:c}=e;return(0,y.t)(),r.createElement(Nt,null,r.createElement(o.d,{title:l,description:c}),r.createElement(v,null),r.createElement(C,null),r.createElement(pt,null),r.createElement("div",{id:d,className:(0,i.Z)(m.k.wrapper.main,Lt.mainWrapper,a)},r.createElement(s.Z,{fallback:e=>r.createElement(It,e)},t)),!n&&r.createElement(Ot,null))}},21327:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(87462),i=n(67294),s=n(39960),o=n(44996),a=n(52263),l=n(86668),c=n(50941);function u(e){let{logo:t,alt:n,imageClassName:r}=e;const s={light:(0,o.Z)(t.src),dark:(0,o.Z)(t.srcDark||t.src)},a=i.createElement(c.Z,{className:t.className,sources:s,height:t.height,width:t.width,alt:n,style:t.style});return r?i.createElement("div",{className:r},a):a}function d(e){const{siteConfig:{title:t}}=(0,a.Z)(),{navbar:{title:n,logo:c}}=(0,l.L)(),{imageClassName:d,titleClassName:h,...p}=e,f=(0,o.Z)(c?.href||"/"),g=n?"":t,m=c?.alt??g;return i.createElement(s.Z,(0,r.Z)({to:f},p,c?.target&&{target:c.target}),c&&i.createElement(u,{logo:c,alt:m,imageClassName:d}),null!=n&&i.createElement("b",{className:h},n))}},90197:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(67294),i=n(35742);function s(e){let{locale:t,version:n,tag:s}=e;const o=t;return r.createElement(i.Z,null,t&&r.createElement("meta",{name:"docusaurus_locale",content:t}),n&&r.createElement("meta",{name:"docusaurus_version",content:n}),s&&r.createElement("meta",{name:"docusaurus_tag",content:s}),o&&r.createElement("meta",{name:"docsearch:language",content:o}),n&&r.createElement("meta",{name:"docsearch:version",content:n}),s&&r.createElement("meta",{name:"docsearch:docusaurus_tag",content:s}))}},50941:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(87462),i=n(67294),s=n(34334),o=n(72389),a=n(92949);const l={themedImage:"themedImage_ToTc","themedImage--light":"themedImage--light_HNdA","themedImage--dark":"themedImage--dark_i4oU"};function c(e){const t=(0,o.Z)(),{colorMode:n}=(0,a.I)(),{sources:c,className:u,alt:d,...h}=e,p=t?"dark"===n?["dark"]:["light"]:["light","dark"];return i.createElement(i.Fragment,null,p.map((e=>i.createElement("img",(0,r.Z)({key:e,src:c[e],alt:d,className:(0,s.Z)(l.themedImage,l[`themedImage--${e}`],u)},h)))))}},86043:(e,t,n)=>{"use strict";n.d(t,{u:()=>l,z:()=>m});var r=n(87462),i=n(67294),s=n(10412),o=n(91442);const a="ease-in-out";function l(e){let{initialState:t}=e;const[n,r]=(0,i.useState)(t??!1),s=(0,i.useCallback)((()=>{r((e=>!e))}),[]);return{collapsed:n,setCollapsed:r,toggleCollapsed:s}}const c={display:"none",overflow:"hidden",height:"0px"},u={display:"block",overflow:"visible",height:"auto"};function d(e,t){const n=t?c:u;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function h(e){let{collapsibleRef:t,collapsed:n,animation:r}=e;const s=(0,i.useRef)(!1);(0,i.useEffect)((()=>{const e=t.current;function i(){const t=e.scrollHeight,n=r?.duration??function(e){if((0,o.n)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${r?.easing??a}`,height:`${t}px`}}function l(){const t=i();e.style.transition=t.transition,e.style.height=t.height}if(!s.current)return d(e,n),void(s.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(l(),requestAnimationFrame((()=>{e.style.height=c.height,e.style.overflow=c.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{l()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,r])}function p(e){if(!s.Z.canUseDOM)return e?c:u}function f(e){let{as:t="div",collapsed:n,children:r,animation:s,onCollapseTransitionEnd:o,className:a,disableSSRStyle:l}=e;const c=(0,i.useRef)(null);return h({collapsibleRef:c,collapsed:n,animation:s}),i.createElement(t,{ref:c,style:l?void 0:p(n),onTransitionEnd:e=>{"height"===e.propertyName&&(d(c.current,n),o?.(n))},className:a},r)}function g(e){let{collapsed:t,...n}=e;const[s,o]=(0,i.useState)(!t),[a,l]=(0,i.useState)(t);return(0,i.useLayoutEffect)((()=>{t||o(!0)}),[t]),(0,i.useLayoutEffect)((()=>{s&&l(t)}),[s,t]),s?i.createElement(f,(0,r.Z)({},n,{collapsed:a})):null}function m(e){let{lazy:t,...n}=e;const r=t?g:f;return i.createElement(r,n)}},59689:(e,t,n)=>{"use strict";n.d(t,{nT:()=>f,pl:()=>p});var r=n(67294),i=n(72389),s=n(50012),o=n(902),a=n(86668);const l=(0,s.WA)("docusaurus.announcement.dismiss"),c=(0,s.WA)("docusaurus.announcement.id"),u=()=>"true"===l.get(),d=e=>l.set(String(e)),h=r.createContext(null);function p(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,a.L)(),t=(0,i.Z)(),[n,s]=(0,r.useState)((()=>!!t&&u()));(0,r.useEffect)((()=>{s(u())}),[]);const o=(0,r.useCallback)((()=>{d(!0),s(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=c.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;c.set(t),r&&d(!1),!r&&u()||s(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:o})),[e,n,o])}();return r.createElement(h.Provider,{value:n},t)}function f(){const e=(0,r.useContext)(h);if(!e)throw new o.i6("AnnouncementBarProvider");return e}},92949:(e,t,n)=>{"use strict";n.d(t,{I:()=>m,S:()=>g});var r=n(67294),i=n(10412),s=n(902),o=n(50012),a=n(86668);const l=r.createContext(void 0),c="theme",u=(0,o.WA)(c),d={light:"light",dark:"dark"},h=e=>e===d.dark?d.dark:d.light,p=e=>i.Z.canUseDOM?h(document.documentElement.getAttribute("data-theme")):h(e),f=e=>{u.set(h(e))};function g(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,a.L)(),[i,s]=(0,r.useState)(p(e));(0,r.useEffect)((()=>{t&&u.del()}),[t]);const o=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:i=!0}=r;t?(s(t),i&&f(t)):(s(n?window.matchMedia("(prefers-color-scheme: dark)").matches?d.dark:d.light:e),u.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",h(i))}),[i]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==c)return;const t=u.get();null!==t&&o(h(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,o]);const l=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||l.current?l.current=window.matchMedia("print").matches:o(null)};return e.addListener(r),()=>e.removeListener(r)}),[o,t,n]),(0,r.useMemo)((()=>({colorMode:i,setColorMode:o,get isDarkTheme(){return i===d.dark},setLightTheme(){o(d.light)},setDarkTheme(){o(d.dark)}})),[i,o])}();return r.createElement(l.Provider,{value:n},t)}function m(){const e=(0,r.useContext)(l);if(null==e)throw new s.i6("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},60373:(e,t,n)=>{"use strict";n.d(t,{J:()=>b,L5:()=>m});var r=n(67294),i=n(80143),s=n(29935),o=n(86668),a=n(53438),l=n(902),c=n(50012);const u=e=>`docs-preferred-version-${e}`,d={save:(e,t,n)=>{(0,c.WA)(u(e),{persistence:t}).set(n)},read:(e,t)=>(0,c.WA)(u(e),{persistence:t}).get(),clear:(e,t)=>{(0,c.WA)(u(e),{persistence:t}).del()}},h=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const p=r.createContext(null);function f(){const e=(0,i._r)(),t=(0,o.L)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[s,a]=(0,r.useState)((()=>h(n)));(0,r.useEffect)((()=>{a(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function i(e){const t=d.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(d.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,i(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[s,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){d.save(e,t,n),a((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function g(e){let{children:t}=e;const n=f();return r.createElement(p.Provider,{value:n},t)}function m(e){let{children:t}=e;return a.cE?r.createElement(g,null,t):r.createElement(r.Fragment,null,t)}function y(){const e=(0,r.useContext)(p);if(!e)throw new l.i6("DocsPreferredVersionContextProvider");return e}function b(e){void 0===e&&(e=s.m);const t=(0,i.zh)(e),[n,o]=y(),{preferredVersionName:a}=n[e];return{preferredVersion:t.versions.find((e=>e.name===a))??null,savePreferredVersionName:(0,r.useCallback)((t=>{o.savePreferredVersion(e,t)}),[o,e])}}},1116:(e,t,n)=>{"use strict";n.d(t,{V:()=>l,b:()=>a});var r=n(67294),i=n(902);const s=Symbol("EmptyContext"),o=r.createContext(s);function a(e){let{children:t,name:n,items:i}=e;const s=(0,r.useMemo)((()=>n&&i?{name:n,items:i}:null),[n,i]);return r.createElement(o.Provider,{value:s},t)}function l(){const e=(0,r.useContext)(o);if(e===s)throw new i.i6("DocsSidebarProvider");return e}},93163:(e,t,n)=>{"use strict";n.d(t,{M:()=>d,e:()=>h});var r=n(67294),i=n(13102),s=n(87524),o=n(91980),a=n(86668),l=n(902);const c=r.createContext(void 0);function u(){const e=function(){const e=(0,i.HY)(),{items:t}=(0,a.L)().navbar;return 0===t.length&&!e.component}(),t=(0,s.i)(),n=!e&&"mobile"===t,[l,c]=(0,r.useState)(!1);(0,o.Rb)((()=>{if(l)return c(!1),!1}));const u=(0,r.useCallback)((()=>{c((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&c(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:l})),[e,n,u,l])}function d(e){let{children:t}=e;const n=u();return r.createElement(c.Provider,{value:n},t)}function h(){const e=r.useContext(c);if(void 0===e)throw new l.i6("NavbarMobileSidebarProvider");return e}},13102:(e,t,n)=>{"use strict";n.d(t,{HY:()=>a,Zo:()=>l,n2:()=>o});var r=n(67294),i=n(902);const s=r.createContext(null);function o(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return r.createElement(s.Provider,{value:n},t)}function a(){const e=(0,r.useContext)(s);if(!e)throw new i.i6("NavbarSecondaryMenuContentProvider");return e[0]}function l(e){let{component:t,props:n}=e;const o=(0,r.useContext)(s);if(!o)throw new i.i6("NavbarSecondaryMenuContentProvider");const[,a]=o,l=(0,i.Ql)(n);return(0,r.useEffect)((()=>{a({component:t,props:l})}),[a,t,l]),(0,r.useEffect)((()=>()=>a({component:null,props:null})),[a]),null}},19727:(e,t,n)=>{"use strict";n.d(t,{h:()=>i,t:()=>s});var r=n(67294);const i="navigation-with-keyboard";function s(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(i),"mousedown"===e.type&&document.body.classList.remove(i)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(i),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},87524:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var r=n(67294),i=n(10412);const s={desktop:"desktop",mobile:"mobile",ssr:"ssr"},o=996;function a(){return i.Z.canUseDOM?window.innerWidth>o?s.desktop:s.mobile:s.ssr}const l=!1;function c(){const[e,t]=(0,r.useState)((()=>l?"ssr":a()));return(0,r.useEffect)((()=>{function e(){t(a())}const n=l?window.setTimeout(e,1e3):void 0;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),clearTimeout(n)}}),[]),e}},35281:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{}}},91442:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{n:()=>r})},53438:(e,t,n)=>{"use strict";n.d(t,{Wl:()=>h,_F:()=>g,cE:()=>d,hI:()=>_,lO:()=>b,oz:()=>v,s1:()=>y,vY:()=>E});var r=n(67294),i=n(16550),s=n(18790),o=n(80143),a=n(60373),l=n(1116),c=n(67392),u=n(48596);const d=!!o._r;function h(e){if(e.href)return e.href;for(const t of e.items){if("link"===t.type)return t.href;if("category"===t.type){const e=h(t);if(e)return e}}}const p=(e,t)=>void 0!==e&&(0,u.Mg)(e,t),f=(e,t)=>e.some((e=>g(e,t)));function g(e,t){return"link"===e.type?p(e.href,t):"category"===e.type&&(p(e.href,t)||f(e.items,t))}function m(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const i=[];return function e(t){for(const s of t)if("category"===s.type&&((0,u.Mg)(s.href,n)||e(s.items))||"link"===s.type&&(0,u.Mg)(s.href,n)){return r&&"category"!==s.type||i.unshift(s),!0}return!1}(t),i}function y(){const e=(0,l.V)(),{pathname:t}=(0,i.TH)(),n=(0,o.gA)()?.pluginData.breadcrumbs;return!1!==n&&e?m({sidebarItems:e.items,pathname:t}):null}function b(e){const{activeVersion:t}=(0,o.Iw)(e),{preferredVersion:n}=(0,a.J)(e),i=(0,o.yW)(e);return(0,r.useMemo)((()=>(0,c.j)([t,n,i].filter(Boolean))),[t,n,i])}function v(e,t){const n=b(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function E(e,t){const n=b(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${(0,c.j)(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function _(e){let{route:t,versionMetadata:n}=e;const r=(0,i.TH)(),o=t.routes,a=o.find((e=>(0,i.LX)(r.pathname,e)));if(!a)return null;const l=a.sidebar,c=l?n.docsSidebars[l]:void 0;return{docElement:(0,s.H)(o),sidebarName:l,sidebarItems:c}}},91980:(e,t,n)=>{"use strict";n.d(t,{Rb:()=>a,_X:()=>l});var r=n(67294),i=n(16550),s=n(61688),o=n(902);function a(e){!function(e){const t=(0,i.k6)(),n=(0,o.zX)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}function l(e){return function(e){const t=(0,i.k6)();return(0,s.useSyncExternalStore)(t.listen,(()=>e(t)),(()=>e(t)))}((t=>null===e?null:new URLSearchParams(t.location.search).get(e)))}},67392:(e,t,n)=>{"use strict";function r(e,t){return void 0===t&&(t=(e,t)=>e===t),e.filter(((n,r)=>e.findIndex((e=>t(e,n)))!==r))}function i(e){return Array.from(new Set(e))}n.d(t,{j:()=>i,l:()=>r})},1944:(e,t,n)=>{"use strict";n.d(t,{FG:()=>h,d:()=>u,VC:()=>p});var r=n(67294),i=n(87459),s=n(35742),o=n(30226);function a(){const e=r.useContext(o._);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var l=n(44996),c=n(52263);function u(e){let{title:t,description:n,keywords:i,image:o,children:a}=e;const u=function(e){const{siteConfig:t}=(0,c.Z)(),{title:n,titleDelimiter:r}=t;return e?.trim().length?`${e.trim()} ${r} ${n}`:n}(t),{withBaseUrl:d}=(0,l.C)(),h=o?d(o,{absolute:!0}):void 0;return r.createElement(s.Z,null,t&&r.createElement("title",null,u),t&&r.createElement("meta",{property:"og:title",content:u}),n&&r.createElement("meta",{name:"description",content:n}),n&&r.createElement("meta",{property:"og:description",content:n}),i&&r.createElement("meta",{name:"keywords",content:Array.isArray(i)?i.join(","):i}),h&&r.createElement("meta",{property:"og:image",content:h}),h&&r.createElement("meta",{name:"twitter:image",content:h}),a)}const d=r.createContext(void 0);function h(e){let{className:t,children:n}=e;const o=r.useContext(d),a=(0,i.Z)(o,t);return r.createElement(d.Provider,{value:a},r.createElement(s.Z,null,r.createElement("html",{className:a})),n)}function p(e){let{children:t}=e;const n=a(),s=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const o=`plugin-id-${n.plugin.id}`;return r.createElement(h,{className:(0,i.Z)(s,o)},t)}},902:(e,t,n)=>{"use strict";n.d(t,{D9:()=>o,Qc:()=>c,Ql:()=>l,i6:()=>a,zX:()=>s});var r=n(67294);const i=n(10412).Z.canUseDOM?r.useLayoutEffect:r.useEffect;function s(e){const t=(0,r.useRef)(e);return i((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function o(e){const t=(0,r.useRef)();return i((()=>{t.current=e})),t.current}class a extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?<name>\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function l(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function c(e){return t=>{let{children:n}=t;return r.createElement(r.Fragment,null,e.reduceRight(((e,t)=>r.createElement(t,null,e)),n))}}},48596:(e,t,n)=>{"use strict";n.d(t,{Mg:()=>o,Ns:()=>a});var r=n(67294),i=n(723),s=n(52263);function o(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function a(){const{baseUrl:e}=(0,s.Z)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function i(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(i).flatMap((e=>e.routes??[])))}(n)}({routes:i.Z,baseUrl:e})),[e])}},12466:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>p,OC:()=>l,RF:()=>d,o5:()=>h});var r=n(67294),i=n(10412),s=n(72389),o=n(902);const a=r.createContext(void 0);function l(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return r.createElement(a.Provider,{value:n},t)}function c(){const e=(0,r.useContext)(a);if(null==e)throw new o.i6("ScrollControllerProvider");return e}const u=()=>i.Z.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function d(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=c(),i=(0,r.useRef)(u()),s=(0,o.zX)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=u();s(e,i.current),i.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[s,n,...t])}function h(){const e=c(),t=function(){const e=(0,r.useRef)({elem:null,top:0}),t=(0,r.useCallback)((t=>{e.current={elem:t,top:t.getBoundingClientRect().top}}),[]),n=(0,r.useCallback)((()=>{const{current:{elem:t,top:n}}=e;if(!t)return{restored:!1};const r=t.getBoundingClientRect().top-n;return r&&window.scrollBy({left:0,top:r}),e.current={elem:null,top:0},{restored:0!==r}}),[]);return(0,r.useMemo)((()=>({save:t,restore:n})),[n,t])}(),n=(0,r.useRef)(void 0),i=(0,r.useCallback)((r=>{t.save(r),e.disableScrollEvents(),n.current=()=>{const{restored:r}=t.restore();if(n.current=void 0,r){const t=()=>{e.enableScrollEvents(),window.removeEventListener("scroll",t)};window.addEventListener("scroll",t)}else e.enableScrollEvents()}}),[e,t]);return(0,r.useLayoutEffect)((()=>{queueMicrotask((()=>n.current?.()))})),{blockElementScrollPositionUntilNextRender:i}}function p(){const e=(0,r.useRef)(null),t=(0,s.Z)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const i=document.documentElement.scrollTop;(n&&i>e||!n&&i<e)&&(t=requestAnimationFrame(r),window.scrollTo(0,Math.floor(.85*(i-e))+e))}(),()=>t&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},43320:(e,t,n)=>{"use strict";n.d(t,{HX:()=>r,os:()=>i});n(52263);const r="default";function i(e,t){return`docs-${e}-${t}`}},50012:(e,t,n)=>{"use strict";n.d(t,{Nk:()=>d,WA:()=>u});var r=n(67294),i=n(61688);const s="localStorage";function o(e){let{key:t,oldValue:n,newValue:r,storage:i}=e;if(n===r)return;const s=document.createEvent("StorageEvent");s.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,i),window.dispatchEvent(s)}function a(e){if(void 0===e&&(e=s),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,l||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),l=!0),null}var t}let l=!1;const c={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function u(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(e);const n=a(t?.persistence);return null===n?c:{get:()=>{try{return n.getItem(e)}catch(t){return console.error(`Docusaurus storage error, can't get key=${e}`,t),null}},set:t=>{try{const r=n.getItem(e);n.setItem(e,t),o({key:e,oldValue:r,newValue:t,storage:n})}catch(r){console.error(`Docusaurus storage error, can't set ${e}=${t}`,r)}},del:()=>{try{const t=n.getItem(e);n.removeItem(e),o({key:e,oldValue:t,newValue:null,storage:n})}catch(t){console.error(`Docusaurus storage error, can't delete key=${e}`,t)}},listen:t=>{try{const r=r=>{r.storageArea===n&&r.key===e&&t(r)};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}catch(r){return console.error(`Docusaurus storage error, can't listen for changes of key=${e}`,r),()=>{}}}}}function d(e,t){const n=(0,r.useRef)((()=>null===e?c:u(e,t))).current(),s=(0,r.useCallback)((e=>"undefined"==typeof window?()=>{}:n.listen(e)),[n]);return[(0,i.useSyncExternalStore)(s,(()=>"undefined"==typeof window?null:n.get()),(()=>null)),n]}},94711:(e,t,n)=>{"use strict";n.d(t,{l:()=>o});var r=n(52263),i=n(16550),s=n(18780);function o(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:o,currentLocale:a}}=(0,r.Z)(),{pathname:l}=(0,i.TH)(),c=(0,s.applyTrailingSlash)(l,{trailingSlash:n,baseUrl:e}),u=a===o?e:e.replace(`/${a}/`,"/"),d=c.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===o?`${u}`:`${u}${e}/`}(n)}${d}`}}}},85936:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var r=n(67294),i=n(16550),s=n(902);function o(e){const t=(0,i.TH)(),n=(0,s.D9)(t),o=(0,s.zX)(e);(0,r.useEffect)((()=>{n&&t!==n&&o({location:t,previousLocation:n})}),[o,t,n])}},86668:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});var r=n(52263);function i(){return(0,r.Z)().siteConfig.themeConfig}},8802:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[i]=e.split(/[#?]/),s="/"===i||i===r?i:(o=i,n?function(e){return e.endsWith("/")?e:`${e}/`}(o):function(e){return e.endsWith("/")?e.slice(0,-1):e}(o));var o;return e.replace(i,s)}},54143:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t,...e(t.cause)]:[t]}},18780:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var i=n(8802);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(i).default}});var s=n(54143);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return s.getErrorCausalChain}})},80311:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(67294),i=n(1728);const s={loadingRing:"loadingRing_RJI3","loading-ring":"loading-ring_FB5o"};function o(e){let{className:t}=e;return r.createElement("div",{className:(0,i.Z)(s.loadingRing,t)},r.createElement("div",null),r.createElement("div",null),r.createElement("div",null),r.createElement("div",null))}},90022:(e,t,n)=>{"use strict";n.d(t,{w:()=>a});var r=n(31336),i=n.n(r),s=n(61029);const o=new Map;function a(e,t){const n=`${e}${t}`;let r=o.get(n);return r||(r=async function(e,t){{const n=`${e}${s.J.replace("{dir}",t?`-${t.replace(/\//g,"-")}`:"")}`;if(new URL(n,location.origin).origin!==location.origin)throw new Error("Unexpected version url");const r=await(await fetch(n)).json(),o=r.map(((e,t)=>{let{documents:n,index:r}=e;return{type:t,documents:n,index:i().Index.load(r)}})),a=r.reduce(((e,t)=>{for(const n of t.index.invertedIndex)/\p{Unified_Ideograph}/u.test(n[0][0])&&e.add(n[0]);return e}),new Set);return{wrappedIndexes:o,zhDictionary:Array.from(a)}}return{wrappedIndexes:[],zhDictionary:[]}}(e,t),o.set(n,r)),r}},98202:(e,t,n)=>{"use strict";n.d(t,{v:()=>l});var r=n(31336),i=n.n(r);var s=n(61029);function o(e){return a(e).concat(a(e.filter((e=>{const t=e[e.length-1];return!t.trailing&&t.maybeTyping})),!0))}function a(e,t){return e.map((e=>({tokens:e.map((e=>e.value)),term:e.map((e=>({value:e.value,presence:i().Query.presence.REQUIRED,wildcard:(t?e.trailing||e.maybeTyping:e.trailing)?i().Query.wildcard.TRAILING:i().Query.wildcard.NONE})))})))}function l(e,t,n){return function(r,a){const l=function(e,t){if(1===t.length&&["ja","jp","th"].includes(t[0]))return i()[t[0]].tokenizer(e).map((e=>e.toString()));let n=/[^-\s]+/g;return t.includes("zh")&&(n=/\w+|\p{Unified_Ideograph}+/gu),e.toLowerCase().match(n)||[]}(r,s.dK);if(0===l.length)return void a([]);const c=function(e,t){const n=function(e,t){const n=[];return function e(r,i){if(0===r.length)return void n.push(i);const s=r[0];if(/\p{Unified_Ideograph}/u.test(s)){const n=function(e,t){const n=[];return function e(r,i){let s=0,o=!1;for(const a of t)if(r.substr(0,a.length)===a){const t={missed:i.missed,term:i.term.concat({value:a})};r.length>a.length?e(r.substr(a.length),t):n.push(t),o=!0}else for(let t=a.length-1;t>s;t-=1){const l=a.substr(0,t);if(r.substr(0,t)===l){s=t;const a={missed:i.missed,term:i.term.concat({value:l,trailing:!0})};r.length>t?e(r.substr(t),a):n.push(a),o=!0;break}}o||(r.length>0?e(r.substr(1),{missed:i.missed+1,term:i.term}):i.term.length>0&&n.push(i))}(e,{missed:0,term:[]}),n.sort(((e,t)=>{const n=e.missed>0?1:0,r=t.missed>0?1:0;return n!==r?n-r:e.term.length-t.term.length})).map((e=>e.term))}(s,t);for(const t of n){const n=i.concat(...t);e(r.slice(1),n)}}else{const t=i.concat({value:s});e(r.slice(1),t)}}(e,[]),n}(e,t);if(0===n.length)return[{tokens:e,term:e.map((e=>({value:e,presence:i().Query.presence.REQUIRED,wildcard:i().Query.wildcard.LEADING|i().Query.wildcard.TRAILING})))}];for(const i of n)i[i.length-1].maybeTyping=!0;const r=[];for(const o of s.dK)if("en"===o)s._k||r.unshift(i().stopWordFilter);else{const e=i()[o];e.stopWordFilter&&r.unshift(e.stopWordFilter)}let a;if(r.length>0){const e=e=>r.reduce(((e,t)=>e.filter((e=>t(e.value)))),e);a=[];const t=[];for(const r of n){const n=e(r);a.push(n),n.length<r.length&&n.length>0&&t.push(n)}n.push(...t)}else a=n.slice();const l=[];for(const i of a)if(i.length>2)for(let e=i.length-1;e>=0;e-=1)l.push(i.slice(0,e).concat(i.slice(e+1)));return o(n).concat(o(l))}(l,t),u=[];e:for(const{term:t,tokens:i}of c)for(const{documents:r,index:s,type:o}of e)if(u.push(...s.query((e=>{for(const n of t)e.term(n.value,{wildcard:n.wildcard,presence:n.presence})})).slice(0,n).filter((e=>!u.some((t=>t.document.i.toString()===e.ref)))).slice(0,n-u.length).map((t=>{const n=r.find((e=>e.i.toString()===t.ref));return{document:n,type:o,page:0!==o&&e[0].documents.find((e=>e.i===n.p)),metadata:t.matchData.metadata,tokens:i,score:t.score}}))),u.length>=n)break e;!function(e){e.forEach(((e,t)=>{e.index=t})),e.sort(((t,n)=>{let r=t.type>0&&t.page?e.findIndex((e=>e.document===t.page)):t.index,i=n.type>0&&n.page?e.findIndex((e=>e.document===n.page)):n.index;return-1===r&&(r=t.index),-1===i&&(i=n.index),r===i?0===t.type?-1:0===n.type?1:t.index-n.index:r-i}))}(u),function(e){e.forEach(((t,n)=>{n>0&&t.page&&e.some((e=>e.document===t.page))&&(n<e.length-1&&e[n+1].page===t.page?t.isInterOfTree=!0:t.isLastOfTree=!0)}))}(u),a(u)}}},73926:(e,t,n)=>{"use strict";function r(e){return e.join(" \u203a ")}n.d(t,{e:()=>r})},21690:(e,t,n)=>{"use strict";function r(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}n.d(t,{X:()=>r})},91073:(e,t,n)=>{"use strict";function r(e,t){const n=[];for(const r of Object.values(e))r[t]&&n.push(...r[t].position);return n.sort(((e,t)=>e[0]-t[0]||t[1]-e[1]))}n.d(t,{m:()=>r})},82539:(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var r=n(21690);function i(e,t,n){const s=[];for(const o of t){const n=e.toLowerCase().indexOf(o);if(n>=0){n>0&&s.push(i(e.substr(0,n),t)),s.push(`<mark>${(0,r.X)(e.substr(n,o.length))}</mark>`);const a=n+o.length;a<e.length&&s.push(i(e.substr(a),t));break}}return 0===s.length?n?`<mark>${(0,r.X)(e)}</mark>`:(0,r.X)(e):s.join("")}},10726:(e,t,n)=>{"use strict";n.d(t,{o:()=>l});var r=n(21690),i=n(82539);const s=/\w+|\p{Unified_Ideograph}/u;function o(e){const t=[];let n=0,r=e;for(;r.length>0;){const i=r.match(s);if(!i){t.push(r);break}i.index>0&&t.push(r.substring(0,i.index)),t.push(i[0]),n+=i.index+i[0].length,r=e.substring(n)}return t}var a=n(61029);function l(e,t,n,s){void 0===s&&(s=a.Hk);const{chunkIndex:l,chunks:c}=function(e,t,n){const s=[];let a=0,l=0,c=-1;for(;a<t.length;){const[u,d]=t[a];if(a+=1,!(u<l)){if(u>l){const t=o(e.substring(l,u)).map((e=>({html:(0,r.X)(e),textLength:e.length})));for(const e of t)s.push(e)}-1===c&&(c=s.length),l=u+d,s.push({html:(0,i.C)(e.substring(u,l),n,!0),textLength:d})}}if(l<e.length){const t=o(e.substring(l)).map((e=>({html:(0,r.X)(e),textLength:e.length})));for(const e of t)s.push(e)}return{chunkIndex:c,chunks:s}}(e,t,n),u=c.slice(0,l),d=c[l],h=[d.html],p=c.slice(l+1);let f=d.textLength,g=0,m=0,y=!1,b=!1;for(;f<s;)if((g<=m||0===p.length)&&u.length>0){const e=u.pop();f+e.textLength<=s?(h.unshift(e.html),g+=e.textLength,f+=e.textLength):(y=!0,u.length=0)}else{if(!(p.length>0))break;{const e=p.shift();f+e.textLength<=s?(h.push(e.html),m+=e.textLength,f+=e.textLength):(b=!0,p.length=0)}}return(y||u.length>0)&&h.unshift("\u2026"),(b||p.length>0)&&h.push("\u2026"),h.join("")}},61029:(e,t,n)=>{"use strict";n.d(t,{vc:()=>s,gQ:()=>p,H6:()=>c,hG:()=>m,l9:()=>f,dK:()=>r,_k:()=>i,pu:()=>h,AY:()=>u,t_:()=>d,Kc:()=>g,J:()=>o,Hk:()=>l,qo:()=>a,pQ:()=>y});n(31336);const r=["en"],i=!1,s=null,o="search-index{dir}.json?_=77adf643",a=8,l=50,c=!1,u=!0,d=!0,h="right",p=void 0,f=!0,g=null,m=!1,y=!1},99318:(e,t,n)=>{"use strict";n.d(t,{lX:()=>E,q_:()=>R,ob:()=>p,PP:()=>C,Ep:()=>h});var r=n(87462);function i(e){return"/"===e.charAt(0)}function s(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}const o=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],o=t&&t.split("/")||[],a=e&&i(e),l=t&&i(t),c=a||l;if(e&&i(e)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";if(o.length){var u=o[o.length-1];n="."===u||".."===u||""===u}else n=!1;for(var d=0,h=o.length;h>=0;h--){var p=o[h];"."===p?s(o,h):".."===p?(s(o,h),d++):d&&(s(o,h),d--)}if(!c)for(;d--;d)o.unshift("..");!c||""===o[0]||o[0]&&i(o[0])||o.unshift("");var f=o.join("/");return n&&"/"!==f.substr(-1)&&(f+="/"),f};var a=n(38776);function l(e){return"/"===e.charAt(0)?e:"/"+e}function c(e){return"/"===e.charAt(0)?e.substr(1):e}function u(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function h(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function p(e,t,n,i){var s;"string"==typeof e?(s=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var s=t.indexOf("?");return-1!==s&&(n=t.substr(s),t=t.substr(0,s)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),s.state=t):(void 0===(s=(0,r.Z)({},e)).pathname&&(s.pathname=""),s.search?"?"!==s.search.charAt(0)&&(s.search="?"+s.search):s.search="",s.hash?"#"!==s.hash.charAt(0)&&(s.hash="#"+s.hash):s.hash="",void 0!==t&&void 0===s.state&&(s.state=t));try{s.pathname=decodeURI(s.pathname)}catch(a){throw a instanceof URIError?new URIError('Pathname "'+s.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):a}return n&&(s.key=n),i?s.pathname?"/"!==s.pathname.charAt(0)&&(s.pathname=o(s.pathname,i.pathname)):s.pathname=i.pathname:s.pathname||(s.pathname="/"),s}function f(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var s="function"==typeof e?e(t,n):e;"string"==typeof s?"function"==typeof r?r(s,i):i(!0):i(!1!==s)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var g=!("undefined"==typeof window||!window.document||!window.document.createElement);function m(e,t){t(window.confirm(e))}var y="popstate",b="hashchange";function v(){try{return window.history.state||{}}catch(e){return{}}}function E(e){void 0===e&&(e={}),g||(0,a.Z)(!1);var t,n=window.history,i=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,s=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,c=o.forceRefresh,E=void 0!==c&&c,_=o.getUserConfirmation,T=void 0===_?m:_,x=o.keyLength,w=void 0===x?6:x,S=e.basename?d(l(e.basename)):"";function R(e){var t=e||{},n=t.key,r=t.state,i=window.location,s=i.pathname+i.search+i.hash;return S&&(s=u(s,S)),p(s,r,n)}function k(){return Math.random().toString(36).substr(2,w)}var C=f();function O(e){(0,r.Z)(H,e),H.length=n.length,C.notifyListeners(H.location,H.action)}function A(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||L(R(e.state))}function N(){L(R(v()))}var I=!1;function L(e){if(I)I=!1,O();else{C.confirmTransitionTo(e,"POP",T,(function(t){t?O({action:"POP",location:e}):function(e){var t=H.location,n=P.indexOf(t.key);-1===n&&(n=0);var r=P.indexOf(e.key);-1===r&&(r=0);var i=n-r;i&&(I=!0,F(i))}(e)}))}}var D=R(v()),P=[D.key];function M(e){return S+h(e)}function F(e){n.go(e)}var U=0;function j(e){1===(U+=e)&&1===e?(window.addEventListener(y,A),s&&window.addEventListener(b,N)):0===U&&(window.removeEventListener(y,A),s&&window.removeEventListener(b,N))}var B=!1;var H={length:n.length,action:"POP",location:D,createHref:M,push:function(e,t){var r="PUSH",s=p(e,t,k(),H.location);C.confirmTransitionTo(s,r,T,(function(e){if(e){var t=M(s),o=s.key,a=s.state;if(i)if(n.pushState({key:o,state:a},null,t),E)window.location.href=t;else{var l=P.indexOf(H.location.key),c=P.slice(0,l+1);c.push(s.key),P=c,O({action:r,location:s})}else window.location.href=t}}))},replace:function(e,t){var r="REPLACE",s=p(e,t,k(),H.location);C.confirmTransitionTo(s,r,T,(function(e){if(e){var t=M(s),o=s.key,a=s.state;if(i)if(n.replaceState({key:o,state:a},null,t),E)window.location.replace(t);else{var l=P.indexOf(H.location.key);-1!==l&&(P[l]=s.key),O({action:r,location:s})}else window.location.replace(t)}}))},go:F,goBack:function(){F(-1)},goForward:function(){F(1)},block:function(e){void 0===e&&(e=!1);var t=C.setPrompt(e);return B||(j(1),B=!0),function(){return B&&(B=!1,j(-1)),t()}},listen:function(e){var t=C.appendListener(e);return j(1),function(){j(-1),t()}}};return H}var _="hashchange",T={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+c(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:c,decodePath:l},slash:{encodePath:l,decodePath:l}};function x(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function w(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function S(e){window.location.replace(x(window.location.href)+"#"+e)}function R(e){void 0===e&&(e={}),g||(0,a.Z)(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),i=n.getUserConfirmation,s=void 0===i?m:i,o=n.hashType,c=void 0===o?"slash":o,y=e.basename?d(l(e.basename)):"",b=T[c],v=b.encodePath,E=b.decodePath;function R(){var e=E(w());return y&&(e=u(e,y)),p(e)}var k=f();function C(e){(0,r.Z)(B,e),B.length=t.length,k.notifyListeners(B.location,B.action)}var O=!1,A=null;function N(){var e,t,n=w(),r=v(n);if(n!==r)S(r);else{var i=R(),o=B.location;if(!O&&(t=i,(e=o).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(A===h(i))return;A=null,function(e){if(O)O=!1,C();else{var t="POP";k.confirmTransitionTo(e,t,s,(function(n){n?C({action:t,location:e}):function(e){var t=B.location,n=P.lastIndexOf(h(t));-1===n&&(n=0);var r=P.lastIndexOf(h(e));-1===r&&(r=0);var i=n-r;i&&(O=!0,M(i))}(e)}))}}(i)}}var I=w(),L=v(I);I!==L&&S(L);var D=R(),P=[h(D)];function M(e){t.go(e)}var F=0;function U(e){1===(F+=e)&&1===e?window.addEventListener(_,N):0===F&&window.removeEventListener(_,N)}var j=!1;var B={length:t.length,action:"POP",location:D,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=x(window.location.href)),n+"#"+v(y+h(e))},push:function(e,t){var n="PUSH",r=p(e,void 0,void 0,B.location);k.confirmTransitionTo(r,n,s,(function(e){if(e){var t=h(r),i=v(y+t);if(w()!==i){A=t,function(e){window.location.hash=e}(i);var s=P.lastIndexOf(h(B.location)),o=P.slice(0,s+1);o.push(t),P=o,C({action:n,location:r})}else C()}}))},replace:function(e,t){var n="REPLACE",r=p(e,void 0,void 0,B.location);k.confirmTransitionTo(r,n,s,(function(e){if(e){var t=h(r),i=v(y+t);w()!==i&&(A=t,S(i));var s=P.indexOf(h(B.location));-1!==s&&(P[s]=t),C({action:n,location:r})}}))},go:M,goBack:function(){M(-1)},goForward:function(){M(1)},block:function(e){void 0===e&&(e=!1);var t=k.setPrompt(e);return j||(U(1),j=!0),function(){return j&&(j=!1,U(-1)),t()}},listen:function(e){var t=k.appendListener(e);return U(1),function(){U(-1),t()}}};return B}function k(e,t,n){return Math.min(Math.max(e,t),n)}function C(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,i=t.initialEntries,s=void 0===i?["/"]:i,o=t.initialIndex,a=void 0===o?0:o,l=t.keyLength,c=void 0===l?6:l,u=f();function d(e){(0,r.Z)(E,e),E.length=E.entries.length,u.notifyListeners(E.location,E.action)}function g(){return Math.random().toString(36).substr(2,c)}var m=k(a,0,s.length-1),y=s.map((function(e){return p(e,void 0,"string"==typeof e?g():e.key||g())})),b=h;function v(e){var t=k(E.index+e,0,E.entries.length-1),r=E.entries[t];u.confirmTransitionTo(r,"POP",n,(function(e){e?d({action:"POP",location:r,index:t}):d()}))}var E={length:y.length,action:"POP",location:y[m],index:m,entries:y,createHref:b,push:function(e,t){var r="PUSH",i=p(e,t,g(),E.location);u.confirmTransitionTo(i,r,n,(function(e){if(e){var t=E.index+1,n=E.entries.slice(0);n.length>t?n.splice(t,n.length-t,i):n.push(i),d({action:r,location:i,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",i=p(e,t,g(),E.location);u.confirmTransitionTo(i,r,n,(function(e){e&&(E.entries[E.index]=i,d({action:r,location:i}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=E.index+e;return t>=0&&t<E.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return E}},8679:(e,t,n)=>{"use strict";var r=n(59864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return r.isMemo(e)?o:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=o;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(f){var i=p(n);i&&i!==f&&e(t,i,r)}var o=u(n);d&&(o=o.concat(d(n)));for(var a=l(t),g=l(n),m=0;m<o.length;++m){var y=o[m];if(!(s[y]||r&&r[y]||g&&g[y]||a&&a[y])){var b=h(n,y);try{c(t,y,b)}catch(v){}}}}return t}},41143:e=>{"use strict";e.exports=function(e,t,n,r,i,s,o,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,s,o,a],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},5826:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},31336:(e,t,n)=>{var r,i;!function(){var s,o,a,l,c,u,d,h,p,f,g,m,y,b,v,E,_,T,x,w,S,R,k,C,O,A,N,I,L,D,P=function(e){var t=new P.Builder;return t.pipeline.add(P.trimmer,P.stopWordFilter,P.stemmer),t.searchPipeline.add(P.stemmer),e.call(t,t),t.build()};P.version="2.3.9",P.utils={},P.utils.warn=(s=this,function(e){s.console&&console.warn&&console.warn(e)}),P.utils.asString=function(e){return null==e?"":e.toString()},P.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],s=e[i];if(Array.isArray(s))t[i]=s.slice();else{if("string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s)throw new TypeError("clone is not deep and does not support nested objects");t[i]=s}}return t},P.FieldRef=function(e,t,n){this.docRef=e,this.fieldName=t,this._stringValue=n},P.FieldRef.joiner="/",P.FieldRef.fromString=function(e){var t=e.indexOf(P.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var n=e.slice(0,t),r=e.slice(t+1);return new P.FieldRef(r,n,e)},P.FieldRef.prototype.toString=function(){return null==this._stringValue&&(this._stringValue=this.fieldName+P.FieldRef.joiner+this.docRef),this._stringValue},P.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var t=0;t<this.length;t++)this.elements[e[t]]=!0}else this.length=0},P.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},P.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},P.Set.prototype.contains=function(e){return!!this.elements[e]},P.Set.prototype.intersect=function(e){var t,n,r,i=[];if(e===P.Set.complete)return this;if(e===P.Set.empty)return e;this.length<e.length?(t=this,n=e):(t=e,n=this),r=Object.keys(t.elements);for(var s=0;s<r.length;s++){var o=r[s];o in n.elements&&i.push(o)}return new P.Set(i)},P.Set.prototype.union=function(e){return e===P.Set.complete?P.Set.complete:e===P.Set.empty?this:new P.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},P.idf=function(e,t){var n=0;for(var r in e)"_index"!=r&&(n+=Object.keys(e[r]).length);var i=(t-n+.5)/(n+.5);return Math.log(1+Math.abs(i))},P.Token=function(e,t){this.str=e||"",this.metadata=t||{}},P.Token.prototype.toString=function(){return this.str},P.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},P.Token.prototype.clone=function(e){return e=e||function(e){return e},new P.Token(e(this.str,this.metadata),this.metadata)},P.tokenizer=function(e,t){if(null==e||null==e)return[];if(Array.isArray(e))return e.map((function(e){return new P.Token(P.utils.asString(e).toLowerCase(),P.utils.clone(t))}));for(var n=e.toString().toLowerCase(),r=n.length,i=[],s=0,o=0;s<=r;s++){var a=s-o;if(n.charAt(s).match(P.tokenizer.separator)||s==r){if(a>0){var l=P.utils.clone(t)||{};l.position=[o,a],l.index=i.length,i.push(new P.Token(n.slice(o,s),l))}o=s+1}}return i},P.tokenizer.separator=/[\s\-]+/,P.Pipeline=function(){this._stack=[]},P.Pipeline.registeredFunctions=Object.create(null),P.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&P.utils.warn("Overwriting existing registered function: "+t),e.label=t,P.Pipeline.registeredFunctions[e.label]=e},P.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||P.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},P.Pipeline.load=function(e){var t=new P.Pipeline;return e.forEach((function(e){var n=P.Pipeline.registeredFunctions[e];if(!n)throw new Error("Cannot load unregistered function: "+e);t.add(n)})),t},P.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach((function(e){P.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)}),this)},P.Pipeline.prototype.after=function(e,t){P.Pipeline.warnIfFunctionNotRegistered(t);var n=this._stack.indexOf(e);if(-1==n)throw new Error("Cannot find existingFn");n+=1,this._stack.splice(n,0,t)},P.Pipeline.prototype.before=function(e,t){P.Pipeline.warnIfFunctionNotRegistered(t);var n=this._stack.indexOf(e);if(-1==n)throw new Error("Cannot find existingFn");this._stack.splice(n,0,t)},P.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},P.Pipeline.prototype.run=function(e){for(var t=this._stack.length,n=0;n<t;n++){for(var r=this._stack[n],i=[],s=0;s<e.length;s++){var o=r(e[s],s,e);if(null!=o&&""!==o)if(Array.isArray(o))for(var a=0;a<o.length;a++)i.push(o[a]);else i.push(o)}e=i}return e},P.Pipeline.prototype.runString=function(e,t){var n=new P.Token(e,t);return this.run([n]).map((function(e){return e.toString()}))},P.Pipeline.prototype.reset=function(){this._stack=[]},P.Pipeline.prototype.toJSON=function(){return this._stack.map((function(e){return P.Pipeline.warnIfFunctionNotRegistered(e),e.label}))},P.Vector=function(e){this._magnitude=0,this.elements=e||[]},P.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,n=this.elements.length/2,r=n-t,i=Math.floor(r/2),s=this.elements[2*i];r>1&&(s<e&&(t=i),s>e&&(n=i),s!=e);)r=n-t,i=t+Math.floor(r/2),s=this.elements[2*i];return s==e||s>e?2*i:s<e?2*(i+1):void 0},P.Vector.prototype.insert=function(e,t){this.upsert(e,t,(function(){throw"duplicate index"}))},P.Vector.prototype.upsert=function(e,t,n){this._magnitude=0;var r=this.positionForIndex(e);this.elements[r]==e?this.elements[r+1]=n(this.elements[r+1],t):this.elements.splice(r,0,e,t)},P.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,n=1;n<t;n+=2){var r=this.elements[n];e+=r*r}return this._magnitude=Math.sqrt(e)},P.Vector.prototype.dot=function(e){for(var t=0,n=this.elements,r=e.elements,i=n.length,s=r.length,o=0,a=0,l=0,c=0;l<i&&c<s;)(o=n[l])<(a=r[c])?l+=2:o>a?c+=2:o==a&&(t+=n[l+1]*r[c+1],l+=2,c+=2);return t},P.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},P.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,n=0;t<this.elements.length;t+=2,n++)e[n]=this.elements[t];return e},P.Vector.prototype.toJSON=function(){return this.elements},P.stemmer=(o={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},a={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},d="^("+(c="[^aeiou][^aeiouy]*")+")?"+(u=(l="[aeiouy]")+"[aeiou]*")+c+"("+u+")?$",h="^("+c+")?"+u+c+u+c,p="^("+c+")?"+l,f=new RegExp("^("+c+")?"+u+c),g=new RegExp(h),m=new RegExp(d),y=new RegExp(p),b=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,E=/^(.+?)eed$/,_=/^(.+?)(ed|ing)$/,T=/.$/,x=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),S=new RegExp("^"+c+l+"[^aeiouwxy]$"),R=/^(.+?[^aeiou])y$/,k=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,C=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,O=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,A=/^(.+?)(s|t)(ion)$/,N=/^(.+?)e$/,I=/ll$/,L=new RegExp("^"+c+l+"[^aeiouwxy]$"),D=function(e){var t,n,r,i,s,l,c;if(e.length<3)return e;if("y"==(r=e.substr(0,1))&&(e=r.toUpperCase()+e.substr(1)),s=v,(i=b).test(e)?e=e.replace(i,"$1$2"):s.test(e)&&(e=e.replace(s,"$1$2")),s=_,(i=E).test(e)){var u=i.exec(e);(i=f).test(u[1])&&(i=T,e=e.replace(i,""))}else s.test(e)&&(t=(u=s.exec(e))[1],(s=y).test(t)&&(l=w,c=S,(s=x).test(e=t)?e+="e":l.test(e)?(i=T,e=e.replace(i,"")):c.test(e)&&(e+="e")));return(i=R).test(e)&&(e=(t=(u=i.exec(e))[1])+"i"),(i=k).test(e)&&(t=(u=i.exec(e))[1],n=u[2],(i=f).test(t)&&(e=t+o[n])),(i=C).test(e)&&(t=(u=i.exec(e))[1],n=u[2],(i=f).test(t)&&(e=t+a[n])),s=A,(i=O).test(e)?(t=(u=i.exec(e))[1],(i=g).test(t)&&(e=t)):s.test(e)&&(t=(u=s.exec(e))[1]+u[2],(s=g).test(t)&&(e=t)),(i=N).test(e)&&(t=(u=i.exec(e))[1],s=m,l=L,((i=g).test(t)||s.test(t)&&!l.test(t))&&(e=t)),s=g,(i=I).test(e)&&s.test(e)&&(i=T,e=e.replace(i,"")),"y"==r&&(e=r.toLowerCase()+e.substr(1)),e},function(e){return e.update(D)}),P.Pipeline.registerFunction(P.stemmer,"stemmer"),P.generateStopWordFilter=function(e){var t=e.reduce((function(e,t){return e[t]=t,e}),{});return function(e){if(e&&t[e.toString()]!==e.toString())return e}},P.stopWordFilter=P.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),P.Pipeline.registerFunction(P.stopWordFilter,"stopWordFilter"),P.trimmer=function(e){return e.update((function(e){return e.replace(/^\W+/,"").replace(/\W+$/,"")}))},P.Pipeline.registerFunction(P.trimmer,"trimmer"),P.TokenSet=function(){this.final=!1,this.edges={},this.id=P.TokenSet._nextId,P.TokenSet._nextId+=1},P.TokenSet._nextId=1,P.TokenSet.fromArray=function(e){for(var t=new P.TokenSet.Builder,n=0,r=e.length;n<r;n++)t.insert(e[n]);return t.finish(),t.root},P.TokenSet.fromClause=function(e){return"editDistance"in e?P.TokenSet.fromFuzzyString(e.term,e.editDistance):P.TokenSet.fromString(e.term)},P.TokenSet.fromFuzzyString=function(e,t){for(var n=new P.TokenSet,r=[{node:n,editsRemaining:t,str:e}];r.length;){var i=r.pop();if(i.str.length>0){var s,o=i.str.charAt(0);o in i.node.edges?s=i.node.edges[o]:(s=new P.TokenSet,i.node.edges[o]=s),1==i.str.length&&(s.final=!0),r.push({node:s,editsRemaining:i.editsRemaining,str:i.str.slice(1)})}if(0!=i.editsRemaining){if("*"in i.node.edges)var a=i.node.edges["*"];else{a=new P.TokenSet;i.node.edges["*"]=a}if(0==i.str.length&&(a.final=!0),r.push({node:a,editsRemaining:i.editsRemaining-1,str:i.str}),i.str.length>1&&r.push({node:i.node,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)}),1==i.str.length&&(i.node.final=!0),i.str.length>=1){if("*"in i.node.edges)var l=i.node.edges["*"];else{l=new P.TokenSet;i.node.edges["*"]=l}1==i.str.length&&(l.final=!0),r.push({node:l,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)})}if(i.str.length>1){var c,u=i.str.charAt(0),d=i.str.charAt(1);d in i.node.edges?c=i.node.edges[d]:(c=new P.TokenSet,i.node.edges[d]=c),1==i.str.length&&(c.final=!0),r.push({node:c,editsRemaining:i.editsRemaining-1,str:u+i.str.slice(2)})}}}return n},P.TokenSet.fromString=function(e){for(var t=new P.TokenSet,n=t,r=0,i=e.length;r<i;r++){var s=e[r],o=r==i-1;if("*"==s)t.edges[s]=t,t.final=o;else{var a=new P.TokenSet;a.final=o,t.edges[s]=a,t=a}}return n},P.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var n=t.pop(),r=Object.keys(n.node.edges),i=r.length;n.node.final&&(n.prefix.charAt(0),e.push(n.prefix));for(var s=0;s<i;s++){var o=r[s];t.push({prefix:n.prefix.concat(o),node:n.node.edges[o]})}}return e},P.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",t=Object.keys(this.edges).sort(),n=t.length,r=0;r<n;r++){var i=t[r];e=e+i+this.edges[i].id}return e},P.TokenSet.prototype.intersect=function(e){for(var t=new P.TokenSet,n=void 0,r=[{qNode:e,output:t,node:this}];r.length;){n=r.pop();for(var i=Object.keys(n.qNode.edges),s=i.length,o=Object.keys(n.node.edges),a=o.length,l=0;l<s;l++)for(var c=i[l],u=0;u<a;u++){var d=o[u];if(d==c||"*"==c){var h=n.node.edges[d],p=n.qNode.edges[c],f=h.final&&p.final,g=void 0;d in n.output.edges?(g=n.output.edges[d]).final=g.final||f:((g=new P.TokenSet).final=f,n.output.edges[d]=g),r.push({qNode:p,output:g,node:h})}}}return t},P.TokenSet.Builder=function(){this.previousWord="",this.root=new P.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},P.TokenSet.Builder.prototype.insert=function(e){var t,n=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var r=0;r<e.length&&r<this.previousWord.length&&e[r]==this.previousWord[r];r++)n++;this.minimize(n),t=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(r=n;r<e.length;r++){var i=new P.TokenSet,s=e[r];t.edges[s]=i,this.uncheckedNodes.push({parent:t,char:s,child:i}),t=i}t.final=!0,this.previousWord=e},P.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},P.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;t>=e;t--){var n=this.uncheckedNodes[t],r=n.child.toString();r in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[r]:(n.child._str=r,this.minimizedNodes[r]=n.child),this.uncheckedNodes.pop()}},P.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},P.Index.prototype.search=function(e){return this.query((function(t){new P.QueryParser(e,t).parse()}))},P.Index.prototype.query=function(e){for(var t=new P.Query(this.fields),n=Object.create(null),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=0;a<this.fields.length;a++)r[this.fields[a]]=new P.Vector;e.call(t,t);for(a=0;a<t.clauses.length;a++){var l=t.clauses[a],c=null,u=P.Set.empty;c=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var d=0;d<c.length;d++){var h=c[d];l.term=h;var p=P.TokenSet.fromClause(l),f=this.tokenSet.intersect(p).toArray();if(0===f.length&&l.presence===P.Query.presence.REQUIRED){for(var g=0;g<l.fields.length;g++){s[N=l.fields[g]]=P.Set.empty}break}for(var m=0;m<f.length;m++){var y=f[m],b=this.invertedIndex[y],v=b._index;for(g=0;g<l.fields.length;g++){var E=b[N=l.fields[g]],_=Object.keys(E),T=y+"/"+N,x=new P.Set(_);if(l.presence==P.Query.presence.REQUIRED&&(u=u.union(x),void 0===s[N]&&(s[N]=P.Set.complete)),l.presence!=P.Query.presence.PROHIBITED){if(r[N].upsert(v,l.boost,(function(e,t){return e+t})),!i[T]){for(var w=0;w<_.length;w++){var S,R=_[w],k=new P.FieldRef(R,N),C=E[R];void 0===(S=n[k])?n[k]=new P.MatchData(y,N,C):S.add(y,N,C)}i[T]=!0}}else void 0===o[N]&&(o[N]=P.Set.empty),o[N]=o[N].union(x)}}}if(l.presence===P.Query.presence.REQUIRED)for(g=0;g<l.fields.length;g++){s[N=l.fields[g]]=s[N].intersect(u)}}var O=P.Set.complete,A=P.Set.empty;for(a=0;a<this.fields.length;a++){var N;s[N=this.fields[a]]&&(O=O.intersect(s[N])),o[N]&&(A=A.union(o[N]))}var I=Object.keys(n),L=[],D=Object.create(null);if(t.isNegated()){I=Object.keys(this.fieldVectors);for(a=0;a<I.length;a++){k=I[a];var M=P.FieldRef.fromString(k);n[k]=new P.MatchData}}for(a=0;a<I.length;a++){var F=(M=P.FieldRef.fromString(I[a])).docRef;if(O.contains(F)&&!A.contains(F)){var U,j=this.fieldVectors[M],B=r[M.fieldName].similarity(j);if(void 0!==(U=D[F]))U.score+=B,U.matchData.combine(n[M]);else{var H={ref:F,score:B,matchData:n[M]};D[F]=H,L.push(H)}}}return L.sort((function(e,t){return t.score-e.score}))},P.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map((function(e){return[e,this.invertedIndex[e]]}),this),t=Object.keys(this.fieldVectors).map((function(e){return[e,this.fieldVectors[e].toJSON()]}),this);return{version:P.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},P.Index.load=function(e){var t={},n={},r=e.fieldVectors,i=Object.create(null),s=e.invertedIndex,o=new P.TokenSet.Builder,a=P.Pipeline.load(e.pipeline);e.version!=P.version&&P.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+P.version+"' does not match serialized index '"+e.version+"'");for(var l=0;l<r.length;l++){var c=(d=r[l])[0],u=d[1];n[c]=new P.Vector(u)}for(l=0;l<s.length;l++){var d,h=(d=s[l])[0],p=d[1];o.insert(h),i[h]=p}return o.finish(),t.fields=e.fields,t.fieldVectors=n,t.invertedIndex=i,t.tokenSet=o.root,t.pipeline=a,new P.Index(t)},P.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=P.tokenizer,this.pipeline=new P.Pipeline,this.searchPipeline=new P.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},P.Builder.prototype.ref=function(e){this._ref=e},P.Builder.prototype.field=function(e,t){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=t||{}},P.Builder.prototype.b=function(e){this._b=e<0?0:e>1?1:e},P.Builder.prototype.k1=function(e){this._k1=e},P.Builder.prototype.add=function(e,t){var n=e[this._ref],r=Object.keys(this._fields);this._documents[n]=t||{},this.documentCount+=1;for(var i=0;i<r.length;i++){var s=r[i],o=this._fields[s].extractor,a=o?o(e):e[s],l=this.tokenizer(a,{fields:[s]}),c=this.pipeline.run(l),u=new P.FieldRef(n,s),d=Object.create(null);this.fieldTermFrequencies[u]=d,this.fieldLengths[u]=0,this.fieldLengths[u]+=c.length;for(var h=0;h<c.length;h++){var p=c[h];if(null==d[p]&&(d[p]=0),d[p]+=1,null==this.invertedIndex[p]){var f=Object.create(null);f._index=this.termIndex,this.termIndex+=1;for(var g=0;g<r.length;g++)f[r[g]]=Object.create(null);this.invertedIndex[p]=f}null==this.invertedIndex[p][s][n]&&(this.invertedIndex[p][s][n]=Object.create(null));for(var m=0;m<this.metadataWhitelist.length;m++){var y=this.metadataWhitelist[m],b=p.metadata[y];null==this.invertedIndex[p][s][n][y]&&(this.invertedIndex[p][s][n][y]=[]),this.invertedIndex[p][s][n][y].push(b)}}}},P.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,n={},r={},i=0;i<t;i++){var s=P.FieldRef.fromString(e[i]),o=s.fieldName;r[o]||(r[o]=0),r[o]+=1,n[o]||(n[o]=0),n[o]+=this.fieldLengths[s]}var a=Object.keys(this._fields);for(i=0;i<a.length;i++){var l=a[i];n[l]=n[l]/r[l]}this.averageFieldLength=n},P.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),n=t.length,r=Object.create(null),i=0;i<n;i++){for(var s=P.FieldRef.fromString(t[i]),o=s.fieldName,a=this.fieldLengths[s],l=new P.Vector,c=this.fieldTermFrequencies[s],u=Object.keys(c),d=u.length,h=this._fields[o].boost||1,p=this._documents[s.docRef].boost||1,f=0;f<d;f++){var g,m,y,b=u[f],v=c[b],E=this.invertedIndex[b]._index;void 0===r[b]?(g=P.idf(this.invertedIndex[b],this.documentCount),r[b]=g):g=r[b],m=g*((this._k1+1)*v)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength[o]))+v),m*=h,m*=p,y=Math.round(1e3*m)/1e3,l.insert(E,y)}e[s]=l}this.fieldVectors=e},P.Builder.prototype.createTokenSet=function(){this.tokenSet=P.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},P.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new P.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},P.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},P.MatchData=function(e,t,n){for(var r=Object.create(null),i=Object.keys(n||{}),s=0;s<i.length;s++){var o=i[s];r[o]=n[o].slice()}this.metadata=Object.create(null),void 0!==e&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=r)},P.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),n=0;n<t.length;n++){var r=t[n],i=Object.keys(e.metadata[r]);null==this.metadata[r]&&(this.metadata[r]=Object.create(null));for(var s=0;s<i.length;s++){var o=i[s],a=Object.keys(e.metadata[r][o]);null==this.metadata[r][o]&&(this.metadata[r][o]=Object.create(null));for(var l=0;l<a.length;l++){var c=a[l];null==this.metadata[r][o][c]?this.metadata[r][o][c]=e.metadata[r][o][c]:this.metadata[r][o][c]=this.metadata[r][o][c].concat(e.metadata[r][o][c])}}}},P.MatchData.prototype.add=function(e,t,n){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=n);if(t in this.metadata[e])for(var r=Object.keys(n),i=0;i<r.length;i++){var s=r[i];s in this.metadata[e][t]?this.metadata[e][t][s]=this.metadata[e][t][s].concat(n[s]):this.metadata[e][t][s]=n[s]}else this.metadata[e][t]=n},P.Query=function(e){this.clauses=[],this.allFields=e},P.Query.wildcard=new String("*"),P.Query.wildcard.NONE=0,P.Query.wildcard.LEADING=1,P.Query.wildcard.TRAILING=2,P.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},P.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=P.Query.wildcard.NONE),e.wildcard&P.Query.wildcard.LEADING&&e.term.charAt(0)!=P.Query.wildcard&&(e.term="*"+e.term),e.wildcard&P.Query.wildcard.TRAILING&&e.term.slice(-1)!=P.Query.wildcard&&(e.term=e.term+"*"),"presence"in e||(e.presence=P.Query.presence.OPTIONAL),this.clauses.push(e),this},P.Query.prototype.isNegated=function(){for(var e=0;e<this.clauses.length;e++)if(this.clauses[e].presence!=P.Query.presence.PROHIBITED)return!1;return!0},P.Query.prototype.term=function(e,t){if(Array.isArray(e))return e.forEach((function(e){this.term(e,P.utils.clone(t))}),this),this;var n=t||{};return n.term=e.toString(),this.clause(n),this},P.QueryParseError=function(e,t,n){this.name="QueryParseError",this.message=e,this.start=t,this.end=n},P.QueryParseError.prototype=new Error,P.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},P.QueryLexer.prototype.run=function(){for(var e=P.QueryLexer.lexText;e;)e=e(this)},P.QueryLexer.prototype.sliceString=function(){for(var e=[],t=this.start,n=this.pos,r=0;r<this.escapeCharPositions.length;r++)n=this.escapeCharPositions[r],e.push(this.str.slice(t,n)),t=n+1;return e.push(this.str.slice(t,this.pos)),this.escapeCharPositions.length=0,e.join("")},P.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},P.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},P.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return P.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},P.QueryLexer.prototype.width=function(){return this.pos-this.start},P.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},P.QueryLexer.prototype.backup=function(){this.pos-=1},P.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=P.QueryLexer.EOS&&this.backup()},P.QueryLexer.prototype.more=function(){return this.pos<this.length},P.QueryLexer.EOS="EOS",P.QueryLexer.FIELD="FIELD",P.QueryLexer.TERM="TERM",P.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",P.QueryLexer.BOOST="BOOST",P.QueryLexer.PRESENCE="PRESENCE",P.QueryLexer.lexField=function(e){return e.backup(),e.emit(P.QueryLexer.FIELD),e.ignore(),P.QueryLexer.lexText},P.QueryLexer.lexTerm=function(e){if(e.width()>1&&(e.backup(),e.emit(P.QueryLexer.TERM)),e.ignore(),e.more())return P.QueryLexer.lexText},P.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(P.QueryLexer.EDIT_DISTANCE),P.QueryLexer.lexText},P.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(P.QueryLexer.BOOST),P.QueryLexer.lexText},P.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(P.QueryLexer.TERM)},P.QueryLexer.termSeparator=P.tokenizer.separator,P.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==P.QueryLexer.EOS)return P.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return P.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(P.QueryLexer.TERM),P.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(P.QueryLexer.TERM),P.QueryLexer.lexBoost;if("+"==t&&1===e.width())return e.emit(P.QueryLexer.PRESENCE),P.QueryLexer.lexText;if("-"==t&&1===e.width())return e.emit(P.QueryLexer.PRESENCE),P.QueryLexer.lexText;if(t.match(P.QueryLexer.termSeparator))return P.QueryLexer.lexTerm}else e.escapeCharacter()}},P.QueryParser=function(e,t){this.lexer=new P.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},P.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=P.QueryParser.parseClause;e;)e=e(this);return this.query},P.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},P.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},P.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},P.QueryParser.parseClause=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case P.QueryLexer.PRESENCE:return P.QueryParser.parsePresence;case P.QueryLexer.FIELD:return P.QueryParser.parseField;case P.QueryLexer.TERM:return P.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(n+=" with value '"+t.str+"'"),new P.QueryParseError(n,t.start,t.end)}},P.QueryParser.parsePresence=function(e){var t=e.consumeLexeme();if(null!=t){switch(t.str){case"-":e.currentClause.presence=P.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=P.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+t.str+"'";throw new P.QueryParseError(n,t.start,t.end)}var r=e.peekLexeme();if(null==r){n="expecting term or field, found nothing";throw new P.QueryParseError(n,t.start,t.end)}switch(r.type){case P.QueryLexer.FIELD:return P.QueryParser.parseField;case P.QueryLexer.TERM:return P.QueryParser.parseTerm;default:n="expecting term or field, found '"+r.type+"'";throw new P.QueryParseError(n,r.start,r.end)}}},P.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var n=e.query.allFields.map((function(e){return"'"+e+"'"})).join(", "),r="unrecognised field '"+t.str+"', possible fields: "+n;throw new P.QueryParseError(r,t.start,t.end)}e.currentClause.fields=[t.str];var i=e.peekLexeme();if(null==i){r="expecting term, found nothing";throw new P.QueryParseError(r,t.start,t.end)}if(i.type===P.QueryLexer.TERM)return P.QueryParser.parseTerm;r="expecting term, found '"+i.type+"'";throw new P.QueryParseError(r,i.start,i.end)}},P.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(null!=n)switch(n.type){case P.QueryLexer.TERM:return e.nextClause(),P.QueryParser.parseTerm;case P.QueryLexer.FIELD:return e.nextClause(),P.QueryParser.parseField;case P.QueryLexer.EDIT_DISTANCE:return P.QueryParser.parseEditDistance;case P.QueryLexer.BOOST:return P.QueryParser.parseBoost;case P.QueryLexer.PRESENCE:return e.nextClause(),P.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+n.type+"'";throw new P.QueryParseError(r,n.start,n.end)}else e.nextClause()}},P.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var n=parseInt(t.str,10);if(isNaN(n)){var r="edit distance must be numeric";throw new P.QueryParseError(r,t.start,t.end)}e.currentClause.editDistance=n;var i=e.peekLexeme();if(null!=i)switch(i.type){case P.QueryLexer.TERM:return e.nextClause(),P.QueryParser.parseTerm;case P.QueryLexer.FIELD:return e.nextClause(),P.QueryParser.parseField;case P.QueryLexer.EDIT_DISTANCE:return P.QueryParser.parseEditDistance;case P.QueryLexer.BOOST:return P.QueryParser.parseBoost;case P.QueryLexer.PRESENCE:return e.nextClause(),P.QueryParser.parsePresence;default:r="Unexpected lexeme type '"+i.type+"'";throw new P.QueryParseError(r,i.start,i.end)}else e.nextClause()}},P.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var n=parseInt(t.str,10);if(isNaN(n)){var r="boost must be numeric";throw new P.QueryParseError(r,t.start,t.end)}e.currentClause.boost=n;var i=e.peekLexeme();if(null!=i)switch(i.type){case P.QueryLexer.TERM:return e.nextClause(),P.QueryParser.parseTerm;case P.QueryLexer.FIELD:return e.nextClause(),P.QueryParser.parseField;case P.QueryLexer.EDIT_DISTANCE:return P.QueryParser.parseEditDistance;case P.QueryLexer.BOOST:return P.QueryParser.parseBoost;case P.QueryLexer.PRESENCE:return e.nextClause(),P.QueryParser.parsePresence;default:r="Unexpected lexeme type '"+i.type+"'";throw new P.QueryParseError(r,i.start,i.end)}else e.nextClause()}},void 0===(i="function"==typeof(r=function(){return P})?r.call(t,n,t,e):r)||(e.exports=i)}()},32497:(e,t,n)=>{"use strict";n.r(t)},52295:(e,t,n)=>{"use strict";n.r(t)},43576:(e,t,n)=>{"use strict";n.r(t)},74865:function(e,t,n){var r,i;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function i(e,t,n){return e<t?t:e>n?n:e}function s(e){return 100*(-1+e)}function o(e,t,n){var i;return(i="translate3d"===r.positionUsing?{transform:"translate3d("+s(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+s(e)+"%,0)"}:{"margin-left":s(e)+"%"}).transition="all "+t+"ms "+n,i}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=i(e,r.minimum,1),n.status=1===e?null:e;var s=n.render(!t),c=s.querySelector(r.barSelector),u=r.speed,d=r.easing;return s.offsetWidth,a((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),l(c,o(e,u,d)),1===e?(l(s,{transition:"none",opacity:1}),s.offsetWidth,setTimeout((function(){l(s,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*i(Math.random()*t,.1,.95)),t=i(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var i,o=t.querySelector(r.barSelector),a=e?"-100":s(n.status||0),c=document.querySelector(r.parent);return l(o,{transition:"all 0 linear",transform:"translate3d("+a+"%,0,0)"}),r.showSpinner||(i=t.querySelector(r.spinnerSelector))&&p(i),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var a=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),l=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,i=e.length,s=t.charAt(0).toUpperCase()+t.slice(1);i--;)if((r=e[i]+s)in n)return r;return t}function i(e){return e=n(e),t[e]||(t[e]=r(e))}function s(e,t,n){t=i(t),e.style[t]=n}return function(e,t){var n,r,i=arguments;if(2==i.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&s(e,n,r);else s(e,i[1],i[2])}}();function c(e,t){return("string"==typeof e?e:h(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=h(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=h(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function h(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(i="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=i)},27418:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,i){for(var s,o,a=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var c in s=Object(arguments[l]))n.call(s,c)&&(a[c]=s[c]);if(t){o=t(s);for(var u=0;u<o.length;u++)r.call(s,o[u])&&(a[o[u]]=s[o[u]])}}return a}},14779:(e,t,n)=>{var r=n(5826);e.exports=p,e.exports.parse=s,e.exports.compile=function(e,t){return a(s(e,t),t)},e.exports.tokensToFunction=a,e.exports.tokensToRegExp=h;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function s(e,t){for(var n,r=[],s=0,o=0,a="",u=t&&t.delimiter||"/";null!=(n=i.exec(e));){var d=n[0],h=n[1],p=n.index;if(a+=e.slice(o,p),o=p+d.length,h)a+=h[1];else{var f=e[o],g=n[2],m=n[3],y=n[4],b=n[5],v=n[6],E=n[7];a&&(r.push(a),a="");var _=null!=g&&null!=f&&f!==g,T="+"===v||"*"===v,x="?"===v||"*"===v,w=n[2]||u,S=y||b;r.push({name:m||s++,prefix:g||"",delimiter:w,optional:x,repeat:T,partial:_,asterisk:!!E,pattern:S?c(S):E?".*":"[^"+l(w)+"]+?"})}}return o<e.length&&(a+=e.substr(o)),a&&r.push(a),r}function o(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function a(e,t){for(var n=new Array(e.length),i=0;i<e.length;i++)"object"==typeof e[i]&&(n[i]=new RegExp("^(?:"+e[i].pattern+")$",d(t)));return function(t,i){for(var s="",a=t||{},l=(i||{}).pretty?o:encodeURIComponent,c=0;c<e.length;c++){var u=e[c];if("string"!=typeof u){var d,h=a[u.name];if(null==h){if(u.optional){u.partial&&(s+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(r(h)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(h)+"`");if(0===h.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var p=0;p<h.length;p++){if(d=l(h[p]),!n[c].test(d))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(d)+"`");s+=(0===p?u.prefix:u.delimiter)+d}}else{if(d=u.asterisk?encodeURI(h).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):l(h),!n[c].test(d))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+d+'"');s+=u.prefix+d}}else s+=u}return s}}function l(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function c(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function u(e,t){return e.keys=t,e}function d(e){return e&&e.sensitive?"":"i"}function h(e,t,n){r(t)||(n=t||n,t=[]);for(var i=(n=n||{}).strict,s=!1!==n.end,o="",a=0;a<e.length;a++){var c=e[a];if("string"==typeof c)o+=l(c);else{var h=l(c.prefix),p="(?:"+c.pattern+")";t.push(c),c.repeat&&(p+="(?:"+h+p+")*"),o+=p=c.optional?c.partial?h+"("+p+")?":"(?:"+h+"("+p+"))?":h+"("+p+")"}}var f=l(n.delimiter||"/"),g=o.slice(-f.length)===f;return i||(o=(g?o.slice(0,-f.length):o)+"(?:"+f+"(?=$))?"),o+=s?"$":i&&g?"":"(?="+f+"|$)",u(new RegExp("^"+o,d(n)),t)}function p(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return u(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],i=0;i<e.length;i++)r.push(p(e[i],t,n).source);return u(new RegExp("(?:"+r.join("|")+")",d(n)),t)}(e,t,n):function(e,t,n){return h(s(e,n),t,n)}(e,t,n)}},79016:()=>{!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,n){return"(?:"+t[+n]+")"}))}function n(e,n,r){return RegExp(t(e,n),r||"")}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,(function(){return"(?:"+e+")"}));return e.replace(/<<self>>/g,"[^\\s\\S]")}var i="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",s="class enum interface record struct",o="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",a="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var c=l(s),u=RegExp(l(i+" "+s+" "+o+" "+a)),d=l(s+" "+o+" "+a),h=l(i+" "+s+" "+a),p=r(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),f=r(/\((?:[^()]|<<self>>)*\)/.source,2),g=/@?\b[A-Za-z_]\w*\b/.source,m=t(/<<0>>(?:\s*<<1>>)?/.source,[g,p]),y=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,m]),b=/\[\s*(?:,\s*)*\]/.source,v=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[y,b]),E=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[p,f,b]),_=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[E]),T=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[_,y,b]),x={keyword:u,punctuation:/[<>()?,.:[\]]/},w=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,S=/"(?:\\.|[^\\"\r\n])*"/.source,R=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[R]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[S]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[y]),lookbehind:!0,inside:x},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[g,T]),lookbehind:!0,inside:x},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[g]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[c,m]),lookbehind:!0,inside:x},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[y]),lookbehind:!0,inside:x},{pattern:n(/(\bwhere\s+)<<0>>/.source,[g]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[v]),lookbehind:!0,inside:x},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[T,h,g]),inside:x}],keyword:u,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[g]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[g]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:x},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[T,y]),inside:x,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[T]),lookbehind:!0,inside:x,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[g,p]),inside:{function:n(/^<<0>>/.source,[g]),generic:{pattern:RegExp(p),alias:"class-name",inside:x}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[c,m,g,T,u.source,f,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[m,f]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:u,"class-name":{pattern:RegExp(T),greedy:!0,inside:x},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var k=S+"|"+w,C=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[k]),O=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[C]),2),A=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,N=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[y,O]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[A,N]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[A]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[O]),inside:e.languages.csharp},"class-name":{pattern:RegExp(y),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var I=/:[^}\r\n]+/.source,L=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[C]),2),D=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[L,I]),P=r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[k]),2),M=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[P,I]);function F(t,r){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[r,I]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[D]),lookbehind:!0,greedy:!0,inside:F(D,L)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[M]),lookbehind:!0,greedy:!0,inside:F(M,P)}],char:{pattern:RegExp(w),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism)},22444:()=>{!function(e){var t=/("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/;e.languages.json5=e.languages.extend("json",{property:[{pattern:RegExp(t.source+"(?=\\s*:)"),greedy:!0},{pattern:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/,alias:"unquoted"}],string:{pattern:t,greedy:!0},number:/[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/})}(Prism)},7464:(e,t,n)=>{var r={"./prism-csharp":79016,"./prism-json5":22444};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=s,e.exports=i,i.id=7464},92703:(e,t,n)=>{"use strict";var r=n(50414);function i(){}function s(){}s.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,s,o){if(o!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:i};return n.PropTypes=n,n}},45697:(e,t,n)=>{e.exports=n(92703)()},50414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},64448:(e,t,n)=>{"use strict";var r=n(67294),i=n(27418),s=n(63840);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(o(227));var a=new Set,l={};function c(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(l[e]=t,e=0;e<t.length;e++)a.add(t[e])}var d=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p=Object.prototype.hasOwnProperty,f={},g={};function m(e,t,n,r,i,s,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){y[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];y[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){y[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){y[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){y[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){y[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){y[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){y[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){y[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var b=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function E(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!p.call(g,e)||!p.call(f,e)&&(h.test(e)?g[e]=!0:(f[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(b,v);y[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(b,v);y[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(b,v);y[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){y[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),y.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){y[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var _=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=60103,x=60106,w=60107,S=60108,R=60114,k=60109,C=60110,O=60112,A=60113,N=60120,I=60115,L=60116,D=60121,P=60128,M=60129,F=60130,U=60131;if("function"==typeof Symbol&&Symbol.for){var j=Symbol.for;T=j("react.element"),x=j("react.portal"),w=j("react.fragment"),S=j("react.strict_mode"),R=j("react.profiler"),k=j("react.provider"),C=j("react.context"),O=j("react.forward_ref"),A=j("react.suspense"),N=j("react.suspense_list"),I=j("react.memo"),L=j("react.lazy"),D=j("react.block"),j("react.scope"),P=j("react.opaque.id"),M=j("react.debug_trace_mode"),F=j("react.offscreen"),U=j("react.legacy_hidden")}var B,H="function"==typeof Symbol&&Symbol.iterator;function $(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=H&&e[H]||e["@@iterator"])?e:null}function z(e){if(void 0===B)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);B=t&&t[1]||""}return"\n"+B+e}var V=!1;function G(e,t){if(!e||V)return"";V=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}catch(l){if(l&&r&&"string"==typeof l.stack){for(var i=l.stack.split("\n"),s=r.stack.split("\n"),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(1!==o||1!==a)do{if(o--,0>--a||i[o]!==s[a])return"\n"+i[o].replace(" at new "," at ")}while(1<=o&&0<=a);break}}}finally{V=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?z(e):""}function W(e){switch(e.tag){case 5:return z(e.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return e=G(e.type,!1);case 11:return e=G(e.type.render,!1);case 22:return e=G(e.type._render,!1);case 1:return e=G(e.type,!0);default:return""}}function K(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case w:return"Fragment";case x:return"Portal";case R:return"Profiler";case S:return"StrictMode";case A:return"Suspense";case N:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case k:return(e._context.displayName||"Context")+".Provider";case O:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case I:return K(e.type);case D:return K(e._render);case L:t=e._payload,e=e._init;try{return K(e(t))}catch(n){}}return null}function Y(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Z(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function q(e){e._valueTracker||(e._valueTracker=function(e){var t=Z(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Z(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function X(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function J(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Y(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&E(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=Y(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ie(e,t.type,n):t.hasOwnProperty("defaultValue")&&ie(e,t.type,Y(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ie(e,t,n){"number"===t&&X(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function se(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function oe(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Y(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ae(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function le(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Y(n)}}function ce(e,t){var n=Y(t.value),r=Y(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ue(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var de={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function he(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?he(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var fe,ge,me=(ge=function(e,t){if(e.namespaceURI!==de.svg||"innerHTML"in e)e.innerHTML=t;else{for((fe=fe||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=fe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ge(e,t)}))}:ge);function ye(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var be={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ve=["Webkit","ms","Moz","O"];function Ee(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||be.hasOwnProperty(e)&&be[e]?(""+t).trim():t+"px"}function _e(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=Ee(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(be).forEach((function(e){ve.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),be[t]=be[e]}))}));var Te=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xe(e,t){if(t){if(Te[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(o(62))}}function we(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Se(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Re=null,ke=null,Ce=null;function Oe(e){if(e=ni(e)){if("function"!=typeof Re)throw Error(o(280));var t=e.stateNode;t&&(t=ii(t),Re(e.stateNode,e.type,t))}}function Ae(e){ke?Ce?Ce.push(e):Ce=[e]:ke=e}function Ne(){if(ke){var e=ke,t=Ce;if(Ce=ke=null,Oe(e),t)for(e=0;e<t.length;e++)Oe(t[e])}}function Ie(e,t){return e(t)}function Le(e,t,n,r,i){return e(t,n,r,i)}function De(){}var Pe=Ie,Me=!1,Fe=!1;function Ue(){null===ke&&null===Ce||(De(),Ne())}function je(e,t){var n=e.stateNode;if(null===n)return null;var r=ii(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(o(231,t,typeof n));return n}var Be=!1;if(d)try{var He={};Object.defineProperty(He,"passive",{get:function(){Be=!0}}),window.addEventListener("test",He,He),window.removeEventListener("test",He,He)}catch(ge){Be=!1}function $e(e,t,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var ze=!1,Ve=null,Ge=!1,We=null,Ke={onError:function(e){ze=!0,Ve=e}};function Ye(e,t,n,r,i,s,o,a,l){ze=!1,Ve=null,$e.apply(Ke,arguments)}function Ze(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function qe(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Qe(e){if(Ze(e)!==e)throw Error(o(188))}function Xe(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ze(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(r=i.return)){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Qe(i),e;if(s===r)return Qe(i),t;s=s.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,l=i.child;l;){if(l===n){a=!0,n=i,r=s;break}if(l===r){a=!0,r=i,n=s;break}l=l.sibling}if(!a){for(l=s.child;l;){if(l===n){a=!0,n=s,r=i;break}if(l===r){a=!0,r=s,n=i;break}l=l.sibling}if(!a)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Je(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var et,tt,nt,rt,it=!1,st=[],ot=null,at=null,lt=null,ct=new Map,ut=new Map,dt=[],ht="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pt(e,t,n,r,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:i,targetContainers:[r]}}function ft(e,t){switch(e){case"focusin":case"focusout":ot=null;break;case"dragenter":case"dragleave":at=null;break;case"mouseover":case"mouseout":lt=null;break;case"pointerover":case"pointerout":ct.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ut.delete(t.pointerId)}}function gt(e,t,n,r,i,s){return null===e||e.nativeEvent!==s?(e=pt(t,n,r,i,s),null!==t&&(null!==(t=ni(t))&&tt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function mt(e){var t=ti(e.target);if(null!==t){var n=Ze(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=qe(n)))return e.blockedOn=t,void rt(e.lanePriority,(function(){s.unstable_runWithPriority(e.priority,(function(){nt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function yt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ni(n))&&tt(t),e.blockedOn=n,!1;t.shift()}return!0}function bt(e,t,n){yt(e)&&n.delete(t)}function vt(){for(it=!1;0<st.length;){var e=st[0];if(null!==e.blockedOn){null!==(e=ni(e.blockedOn))&&et(e);break}for(var t=e.targetContainers;0<t.length;){var n=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&st.shift()}null!==ot&&yt(ot)&&(ot=null),null!==at&&yt(at)&&(at=null),null!==lt&&yt(lt)&&(lt=null),ct.forEach(bt),ut.forEach(bt)}function Et(e,t){e.blockedOn===t&&(e.blockedOn=null,it||(it=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,vt)))}function _t(e){function t(t){return Et(t,e)}if(0<st.length){Et(st[0],e);for(var n=1;n<st.length;n++){var r=st[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==ot&&Et(ot,e),null!==at&&Et(at,e),null!==lt&&Et(lt,e),ct.forEach(t),ut.forEach(t),n=0;n<dt.length;n++)(r=dt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<dt.length&&null===(n=dt[0]).blockedOn;)mt(n),null===n.blockedOn&&dt.shift()}function Tt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var xt={animationend:Tt("Animation","AnimationEnd"),animationiteration:Tt("Animation","AnimationIteration"),animationstart:Tt("Animation","AnimationStart"),transitionend:Tt("Transition","TransitionEnd")},wt={},St={};function Rt(e){if(wt[e])return wt[e];if(!xt[e])return e;var t,n=xt[e];for(t in n)if(n.hasOwnProperty(t)&&t in St)return wt[e]=n[t];return e}d&&(St=document.createElement("div").style,"AnimationEvent"in window||(delete xt.animationend.animation,delete xt.animationiteration.animation,delete xt.animationstart.animation),"TransitionEvent"in window||delete xt.transitionend.transition);var kt=Rt("animationend"),Ct=Rt("animationiteration"),Ot=Rt("animationstart"),At=Rt("transitionend"),Nt=new Map,It=new Map,Lt=["abort","abort",kt,"animationEnd",Ct,"animationIteration",Ot,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",At,"transitionEnd","waiting","waiting"];function Dt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];i="on"+(i[0].toUpperCase()+i.slice(1)),It.set(r,t),Nt.set(r,i),c(i,[r])}}(0,s.unstable_now)();var Pt=8;function Mt(e){if(0!=(1&e))return Pt=15,1;if(0!=(2&e))return Pt=14,2;if(0!=(4&e))return Pt=13,4;var t=24&e;return 0!==t?(Pt=12,t):0!=(32&e)?(Pt=11,32):0!==(t=192&e)?(Pt=10,t):0!=(256&e)?(Pt=9,256):0!==(t=3584&e)?(Pt=8,t):0!=(4096&e)?(Pt=7,4096):0!==(t=4186112&e)?(Pt=6,t):0!==(t=62914560&e)?(Pt=5,t):67108864&e?(Pt=4,67108864):0!=(134217728&e)?(Pt=3,134217728):0!==(t=805306368&e)?(Pt=2,t):0!=(1073741824&e)?(Pt=1,1073741824):(Pt=8,e)}function Ft(e,t){var n=e.pendingLanes;if(0===n)return Pt=0;var r=0,i=0,s=e.expiredLanes,o=e.suspendedLanes,a=e.pingedLanes;if(0!==s)r=s,i=Pt=15;else if(0!==(s=134217727&n)){var l=s&~o;0!==l?(r=Mt(l),i=Pt):0!==(a&=s)&&(r=Mt(a),i=Pt)}else 0!==(s=n&~o)?(r=Mt(s),i=Pt):0!==a&&(r=Mt(a),i=Pt);if(0===r)return 0;if(r=n&((0>(r=31-zt(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0==(t&o)){if(Mt(t),i<=Pt)return t;Pt=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-zt(t)),r|=e[n],t&=~i;return r}function Ut(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function jt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Bt(24&~t))?jt(10,t):e;case 10:return 0===(e=Bt(192&~t))?jt(8,t):e;case 8:return 0===(e=Bt(3584&~t))&&(0===(e=Bt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Bt(805306368&~t))&&(t=268435456),t}throw Error(o(358,e))}function Bt(e){return e&-e}function Ht(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $t(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-zt(t)]=n}var zt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Vt(e)/Gt|0)|0},Vt=Math.log,Gt=Math.LN2;var Wt=s.unstable_UserBlockingPriority,Kt=s.unstable_runWithPriority,Yt=!0;function Zt(e,t,n,r){Me||De();var i=Qt,s=Me;Me=!0;try{Le(i,e,t,n,r)}finally{(Me=s)||Ue()}}function qt(e,t,n,r){Kt(Wt,Qt.bind(null,e,t,n,r))}function Qt(e,t,n,r){var i;if(Yt)if((i=0==(4&t))&&0<st.length&&-1<ht.indexOf(e))e=pt(null,e,t,n,r),st.push(e);else{var s=Xt(e,t,n,r);if(null===s)i&&ft(e,r);else{if(i){if(-1<ht.indexOf(e))return e=pt(s,e,t,n,r),void st.push(e);if(function(e,t,n,r,i){switch(t){case"focusin":return ot=gt(ot,e,t,n,r,i),!0;case"dragenter":return at=gt(at,e,t,n,r,i),!0;case"mouseover":return lt=gt(lt,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return ct.set(s,gt(ct.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,ut.set(s,gt(ut.get(s)||null,e,t,n,r,i)),!0}return!1}(s,e,t,n,r))return;ft(e,r)}Dr(e,t,r,null,n)}}}function Xt(e,t,n,r){var i=Se(r);if(null!==(i=ti(i))){var s=Ze(i);if(null===s)i=null;else{var o=s.tag;if(13===o){if(null!==(i=qe(s)))return i;i=null}else if(3===o){if(s.stateNode.hydrate)return 3===s.tag?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Dr(e,t,r,i,n),null}var Jt=null,en=null,tn=null;function nn(){if(tn)return tn;var e,t,n=en,r=n.length,i="value"in Jt?Jt.value:Jt.textContent,s=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[s-t];t++);return tn=i.slice(e,1<t?1-t:void 0)}function rn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function sn(){return!0}function on(){return!1}function an(e){function t(t,n,r,i,s){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=s,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?sn:on,this.isPropagationStopped=on,this}return i(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=sn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=sn)},persist:function(){},isPersistent:sn}),t}var ln,cn,un,dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hn=an(dn),pn=i({},dn,{view:0,detail:0}),fn=an(pn),gn=i({},pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==un&&(un&&"mousemove"===e.type?(ln=e.screenX-un.screenX,cn=e.screenY-un.screenY):cn=ln=0,un=e),ln)},movementY:function(e){return"movementY"in e?e.movementY:cn}}),mn=an(gn),yn=an(i({},gn,{dataTransfer:0})),bn=an(i({},pn,{relatedTarget:0})),vn=an(i({},dn,{animationName:0,elapsedTime:0,pseudoElement:0})),En=i({},dn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_n=an(En),Tn=an(i({},dn,{data:0})),xn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sn[e])&&!!t[e]}function kn(){return Rn}var Cn=i({},pn,{key:function(e){if(e.key){var t=xn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=rn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?wn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kn,charCode:function(e){return"keypress"===e.type?rn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?rn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),On=an(Cn),An=an(i({},gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Nn=an(i({},pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kn})),In=an(i({},dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=i({},gn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Dn=an(Ln),Pn=[9,13,27,32],Mn=d&&"CompositionEvent"in window,Fn=null;d&&"documentMode"in document&&(Fn=document.documentMode);var Un=d&&"TextEvent"in window&&!Fn,jn=d&&(!Mn||Fn&&8<Fn&&11>=Fn),Bn=String.fromCharCode(32),Hn=!1;function $n(e,t){switch(e){case"keyup":return-1!==Pn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Vn=!1;var Gn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Gn[e.type]:"textarea"===t}function Kn(e,t,n,r){Ae(r),0<(t=Mr(t,"onChange")).length&&(n=new hn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yn=null,Zn=null;function qn(e){Cr(e,0)}function Qn(e){if(Q(ri(e)))return e}function Xn(e,t){if("change"===e)return t}var Jn=!1;if(d){var er;if(d){var tr="oninput"in document;if(!tr){var nr=document.createElement("div");nr.setAttribute("oninput","return;"),tr="function"==typeof nr.oninput}er=tr}else er=!1;Jn=er&&(!document.documentMode||9<document.documentMode)}function rr(){Yn&&(Yn.detachEvent("onpropertychange",ir),Zn=Yn=null)}function ir(e){if("value"===e.propertyName&&Qn(Zn)){var t=[];if(Kn(t,Zn,e,Se(e)),e=qn,Me)e(t);else{Me=!0;try{Ie(e,t)}finally{Me=!1,Ue()}}}}function sr(e,t,n){"focusin"===e?(rr(),Zn=n,(Yn=t).attachEvent("onpropertychange",ir)):"focusout"===e&&rr()}function or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Qn(Zn)}function ar(e,t){if("click"===e)return Qn(t)}function lr(e,t){if("input"===e||"change"===e)return Qn(t)}var cr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},ur=Object.prototype.hasOwnProperty;function dr(e,t){if(cr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!ur.call(t,n[r])||!cr(e[n[r]],t[n[r]]))return!1;return!0}function hr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pr(e,t){var n,r=hr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=hr(r)}}function fr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?fr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function gr(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=X((e=t.contentWindow).document)}return t}function mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var yr=d&&"documentMode"in document&&11>=document.documentMode,br=null,vr=null,Er=null,_r=!1;function Tr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;_r||null==br||br!==X(r)||("selectionStart"in(r=br)&&mr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},Er&&dr(Er,r)||(Er=r,0<(r=Mr(vr,"onSelect")).length&&(t=new hn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=br)))}Dt("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Dt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Dt(Lt,2);for(var xr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),wr=0;wr<xr.length;wr++)It.set(xr[wr],0);u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Rr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Sr));function kr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,s,a,l,c){if(Ye.apply(this,arguments),ze){if(!ze)throw Error(o(198));var u=Ve;ze=!1,Ve=null,Ge||(Ge=!0,We=u)}}(r,t,void 0,e),e.currentTarget=null}function Cr(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;kr(i,a,c),s=l}else for(o=0;o<r.length;o++){if(l=(a=r[o]).instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;kr(i,a,c),s=l}}}if(Ge)throw e=We,Ge=!1,We=null,e}function Or(e,t){var n=si(t),r=e+"__bubble";n.has(r)||(Lr(t,e,2,!1),n.add(r))}var Ar="_reactListening"+Math.random().toString(36).slice(2);function Nr(e){e[Ar]||(e[Ar]=!0,a.forEach((function(t){Rr.has(t)||Ir(t,!1,e,null),Ir(t,!0,e,null)})))}function Ir(e,t,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,s=n;if("selectionchange"===e&&9!==n.nodeType&&(s=n.ownerDocument),null!==r&&!t&&Rr.has(e)){if("scroll"!==e)return;i|=2,s=r}var o=si(s),a=e+"__"+(t?"capture":"bubble");o.has(a)||(t&&(i|=4),Lr(s,e,i,t),o.add(a))}function Lr(e,t,n,r){var i=It.get(t);switch(void 0===i?2:i){case 0:i=Zt;break;case 1:i=qt;break;default:i=Qt}n=i.bind(null,t,n,e),i=void 0,!Be||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Dr(e,t,n,r,i){var s=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var a=r.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var l=o.tag;if((3===l||4===l)&&((l=o.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;o=o.return}for(;null!==a;){if(null===(o=ti(a)))return;if(5===(l=o.tag)||6===l){r=s=o;continue e}a=a.parentNode}}r=r.return}!function(e,t,n){if(Fe)return e(t,n);Fe=!0;try{return Pe(e,t,n)}finally{Fe=!1,Ue()}}((function(){var r=s,i=Se(n),o=[];e:{var a=Nt.get(e);if(void 0!==a){var l=hn,c=e;switch(e){case"keypress":if(0===rn(n))break e;case"keydown":case"keyup":l=On;break;case"focusin":c="focus",l=bn;break;case"focusout":c="blur",l=bn;break;case"beforeblur":case"afterblur":l=bn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=mn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Nn;break;case kt:case Ct:case Ot:l=vn;break;case At:l=In;break;case"scroll":l=fn;break;case"wheel":l=Dn;break;case"copy":case"cut":case"paste":l=_n;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=An}var u=0!=(4&t),d=!u&&"scroll"===e,h=u?null!==a?a+"Capture":null:a;u=[];for(var p,f=r;null!==f;){var g=(p=f).stateNode;if(5===p.tag&&null!==g&&(p=g,null!==h&&(null!=(g=je(f,h))&&u.push(Pr(f,g,p)))),d)break;f=f.return}0<u.length&&(a=new l(a,c,null,n,i),o.push({event:a,listeners:u}))}}if(0==(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||0!=(16&t)||!(c=n.relatedTarget||n.fromElement)||!ti(c)&&!c[Jr])&&(l||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?ti(c):null)&&(c!==(d=Ze(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=mn,g="onMouseLeave",h="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(u=An,g="onPointerLeave",h="onPointerEnter",f="pointer"),d=null==l?a:ri(l),p=null==c?a:ri(c),(a=new u(g,f+"leave",l,n,i)).target=d,a.relatedTarget=p,g=null,ti(i)===r&&((u=new u(h,f+"enter",c,n,i)).target=p,u.relatedTarget=d,g=u),d=g,l&&c)e:{for(h=c,f=0,p=u=l;p;p=Fr(p))f++;for(p=0,g=h;g;g=Fr(g))p++;for(;0<f-p;)u=Fr(u),f--;for(;0<p-f;)h=Fr(h),p--;for(;f--;){if(u===h||null!==h&&u===h.alternate)break e;u=Fr(u),h=Fr(h)}u=null}else u=null;null!==l&&Ur(o,a,l,u,!1),null!==c&&null!==d&&Ur(o,d,c,u,!0)}if("select"===(l=(a=r?ri(r):window).nodeName&&a.nodeName.toLowerCase())||"input"===l&&"file"===a.type)var m=Xn;else if(Wn(a))if(Jn)m=lr;else{m=or;var y=sr}else(l=a.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(m=ar);switch(m&&(m=m(e,r))?Kn(o,m,n,i):(y&&y(e,a,r),"focusout"===e&&(y=a._wrapperState)&&y.controlled&&"number"===a.type&&ie(a,"number",a.value)),y=r?ri(r):window,e){case"focusin":(Wn(y)||"true"===y.contentEditable)&&(br=y,vr=r,Er=null);break;case"focusout":Er=vr=br=null;break;case"mousedown":_r=!0;break;case"contextmenu":case"mouseup":case"dragend":_r=!1,Tr(o,n,i);break;case"selectionchange":if(yr)break;case"keydown":case"keyup":Tr(o,n,i)}var b;if(Mn)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else Vn?$n(e,n)&&(v="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(v="onCompositionStart");v&&(jn&&"ko"!==n.locale&&(Vn||"onCompositionStart"!==v?"onCompositionEnd"===v&&Vn&&(b=nn()):(en="value"in(Jt=i)?Jt.value:Jt.textContent,Vn=!0)),0<(y=Mr(r,v)).length&&(v=new Tn(v,e,null,n,i),o.push({event:v,listeners:y}),b?v.data=b:null!==(b=zn(n))&&(v.data=b))),(b=Un?function(e,t){switch(e){case"compositionend":return zn(t);case"keypress":return 32!==t.which?null:(Hn=!0,Bn);case"textInput":return(e=t.data)===Bn&&Hn?null:e;default:return null}}(e,n):function(e,t){if(Vn)return"compositionend"===e||!Mn&&$n(e,t)?(e=nn(),tn=en=Jt=null,Vn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return jn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Mr(r,"onBeforeInput")).length&&(i=new Tn("onBeforeInput","beforeinput",null,n,i),o.push({event:i,listeners:r}),i.data=b))}Cr(o,t)}))}function Pr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Mr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,s=i.stateNode;5===i.tag&&null!==s&&(i=s,null!=(s=je(e,n))&&r.unshift(Pr(e,s,i)),null!=(s=je(e,t))&&r.push(Pr(e,s,i))),e=e.return}return r}function Fr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Ur(e,t,n,r,i){for(var s=t._reactName,o=[];null!==n&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(null!==l&&l===r)break;5===a.tag&&null!==c&&(a=c,i?null!=(l=je(n,s))&&o.unshift(Pr(n,l,a)):i||null!=(l=je(n,s))&&o.push(Pr(n,l,a))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}function jr(){}var Br=null,Hr=null;function $r(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function zr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Vr="function"==typeof setTimeout?setTimeout:void 0,Gr="function"==typeof clearTimeout?clearTimeout:void 0;function Wr(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Kr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Yr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Zr=0;var qr=Math.random().toString(36).slice(2),Qr="__reactFiber$"+qr,Xr="__reactProps$"+qr,Jr="__reactContainer$"+qr,ei="__reactEvents$"+qr;function ti(e){var t=e[Qr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Jr]||n[Qr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Yr(e);null!==e;){if(n=e[Qr])return n;e=Yr(e)}return t}n=(e=n).parentNode}return null}function ni(e){return!(e=e[Qr]||e[Jr])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ri(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function ii(e){return e[Xr]||null}function si(e){var t=e[ei];return void 0===t&&(t=e[ei]=new Set),t}var oi=[],ai=-1;function li(e){return{current:e}}function ci(e){0>ai||(e.current=oi[ai],oi[ai]=null,ai--)}function ui(e,t){ai++,oi[ai]=e.current,e.current=t}var di={},hi=li(di),pi=li(!1),fi=di;function gi(e,t){var n=e.type.contextTypes;if(!n)return di;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,s={};for(i in n)s[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function mi(e){return null!=(e=e.childContextTypes)}function yi(){ci(pi),ci(hi)}function bi(e,t,n){if(hi.current!==di)throw Error(o(168));ui(hi,t),ui(pi,n)}function vi(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var s in r=r.getChildContext())if(!(s in e))throw Error(o(108,K(t)||"Unknown",s));return i({},n,r)}function Ei(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||di,fi=hi.current,ui(hi,e),ui(pi,pi.current),!0}function _i(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=vi(e,t,fi),r.__reactInternalMemoizedMergedChildContext=e,ci(pi),ci(hi),ui(hi,e)):ci(pi),ui(pi,n)}var Ti=null,xi=null,wi=s.unstable_runWithPriority,Si=s.unstable_scheduleCallback,Ri=s.unstable_cancelCallback,ki=s.unstable_shouldYield,Ci=s.unstable_requestPaint,Oi=s.unstable_now,Ai=s.unstable_getCurrentPriorityLevel,Ni=s.unstable_ImmediatePriority,Ii=s.unstable_UserBlockingPriority,Li=s.unstable_NormalPriority,Di=s.unstable_LowPriority,Pi=s.unstable_IdlePriority,Mi={},Fi=void 0!==Ci?Ci:function(){},Ui=null,ji=null,Bi=!1,Hi=Oi(),$i=1e4>Hi?Oi:function(){return Oi()-Hi};function zi(){switch(Ai()){case Ni:return 99;case Ii:return 98;case Li:return 97;case Di:return 96;case Pi:return 95;default:throw Error(o(332))}}function Vi(e){switch(e){case 99:return Ni;case 98:return Ii;case 97:return Li;case 96:return Di;case 95:return Pi;default:throw Error(o(332))}}function Gi(e,t){return e=Vi(e),wi(e,t)}function Wi(e,t,n){return e=Vi(e),Si(e,t,n)}function Ki(){if(null!==ji){var e=ji;ji=null,Ri(e)}Yi()}function Yi(){if(!Bi&&null!==Ui){Bi=!0;var e=0;try{var t=Ui;Gi(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Ui=null}catch(n){throw null!==Ui&&(Ui=Ui.slice(e+1)),Si(Ni,Ki),n}finally{Bi=!1}}}var Zi=_.ReactCurrentBatchConfig;function qi(e,t){if(e&&e.defaultProps){for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Qi=li(null),Xi=null,Ji=null,es=null;function ts(){es=Ji=Xi=null}function ns(e){var t=Qi.current;ci(Qi),e.type._context._currentValue=t}function rs(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function is(e,t){Xi=e,es=Ji=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Mo=!0),e.firstContext=null)}function ss(e,t){if(es!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(es=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Ji){if(null===Xi)throw Error(o(308));Ji=t,Xi.dependencies={lanes:0,firstContext:t,responders:null}}else Ji=Ji.next=t;return e._currentValue}var os=!1;function as(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function ls(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function cs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function us(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function hs(e,t,n,r){var s=e.updateQueue;os=!1;var o=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(null!==l){s.shared.pending=null;var c=l,u=c.next;c.next=null,null===a?o=u:a.next=u,a=c;var d=e.alternate;if(null!==d){var h=(d=d.updateQueue).lastBaseUpdate;h!==a&&(null===h?d.firstBaseUpdate=u:h.next=u,d.lastBaseUpdate=c)}}if(null!==o){for(h=s.baseState,a=0,d=u=c=null;;){l=o.lane;var p=o.eventTime;if((r&l)===l){null!==d&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var f=e,g=o;switch(l=t,p=n,g.tag){case 1:if("function"==typeof(f=g.payload)){h=f.call(p,h,l);break e}h=f;break e;case 3:f.flags=-4097&f.flags|64;case 0:if(null==(l="function"==typeof(f=g.payload)?f.call(p,h,l):f))break e;h=i({},h,l);break e;case 2:os=!0}}null!==o.callback&&(e.flags|=32,null===(l=s.effects)?s.effects=[o]:l.push(o))}else p={eventTime:p,lane:l,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===d?(u=d=p,c=h):d=d.next=p,a|=l;if(null===(o=o.next)){if(null===(l=s.shared.pending))break;o=l.next,l.next=null,s.lastBaseUpdate=l,s.shared.pending=null}}null===d&&(c=h),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,Ha|=a,e.lanes=a,e.memoizedState=h}}function ps(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(o(191,i));i.call(r)}}}var fs=(new r.Component).refs;function gs(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:i({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ms={isMounted:function(e){return!!(e=e._reactInternals)&&Ze(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hl(),i=pl(e),s=cs(r,i);s.payload=t,null!=n&&(s.callback=n),us(e,s),fl(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hl(),i=pl(e),s=cs(r,i);s.tag=1,s.payload=t,null!=n&&(s.callback=n),us(e,s),fl(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hl(),r=pl(e),i=cs(n,r);i.tag=2,null!=t&&(i.callback=t),us(e,i),fl(e,r,n)}};function ys(e,t,n,r,i,s,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,s,o):!t.prototype||!t.prototype.isPureReactComponent||(!dr(n,r)||!dr(i,s))}function bs(e,t,n){var r=!1,i=di,s=t.contextType;return"object"==typeof s&&null!==s?s=ss(s):(i=mi(t)?fi:hi.current,s=(r=null!=(r=t.contextTypes))?gi(e,i):di),t=new t(n,s),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ms,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function vs(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ms.enqueueReplaceState(t,t.state,null)}function Es(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=fs,as(e);var s=t.contextType;"object"==typeof s&&null!==s?i.context=ss(s):(s=mi(t)?fi:hi.current,i.context=gi(e,s)),hs(e,n,i,r),i.state=e.memoizedState,"function"==typeof(s=t.getDerivedStateFromProps)&&(gs(e,t,s,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ms.enqueueReplaceState(i,i.state,null),hs(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var _s=Array.isArray;function Ts(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=r.refs;t===fs&&(t=r.refs={}),null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!=typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function xs(e,t){if("textarea"!==e.type)throw Error(o(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function ws(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Wl(e,t)).index=0,e.sibling=null,e}function s(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function a(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=ql(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=Ts(e,t,n),r.return=e,r):((r=Kl(n.type,n.key,n.props,null,e.mode,r)).ref=Ts(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Ql(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,s){return null===t||7!==t.tag?((t=Yl(n,e.mode,r,s)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=ql(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case T:return(n=Kl(t.type,t.key,t.props,null,e.mode,n)).ref=Ts(e,null,t),n.return=e,n;case x:return(t=Ql(t,e.mode,n)).return=e,t}if(_s(t)||$(t))return(t=Yl(t,e.mode,n,null)).return=e,t;xs(e,t)}return null}function p(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case T:return n.key===i?n.type===w?d(e,t,n.props.children,r,i):c(e,t,n,r):null;case x:return n.key===i?u(e,t,n,r):null}if(_s(n)||$(n))return null!==i?null:d(e,t,n,r,null);xs(e,n)}return null}function f(e,t,n,r,i){if("string"==typeof r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case T:return e=e.get(null===r.key?n:r.key)||null,r.type===w?d(t,e,r.props.children,i,r.key):c(t,e,r,i);case x:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(_s(r)||$(r))return d(t,e=e.get(n)||null,r,i,null);xs(t,r)}return null}function g(i,o,a,l){for(var c=null,u=null,d=o,g=o=0,m=null;null!==d&&g<a.length;g++){d.index>g?(m=d,d=null):m=d.sibling;var y=p(i,d,a[g],l);if(null===y){null===d&&(d=m);break}e&&d&&null===y.alternate&&t(i,d),o=s(y,o,g),null===u?c=y:u.sibling=y,u=y,d=m}if(g===a.length)return n(i,d),c;if(null===d){for(;g<a.length;g++)null!==(d=h(i,a[g],l))&&(o=s(d,o,g),null===u?c=d:u.sibling=d,u=d);return c}for(d=r(i,d);g<a.length;g++)null!==(m=f(d,i,g,a[g],l))&&(e&&null!==m.alternate&&d.delete(null===m.key?g:m.key),o=s(m,o,g),null===u?c=m:u.sibling=m,u=m);return e&&d.forEach((function(e){return t(i,e)})),c}function m(i,a,l,c){var u=$(l);if("function"!=typeof u)throw Error(o(150));if(null==(l=u.call(l)))throw Error(o(151));for(var d=u=null,g=a,m=a=0,y=null,b=l.next();null!==g&&!b.done;m++,b=l.next()){g.index>m?(y=g,g=null):y=g.sibling;var v=p(i,g,b.value,c);if(null===v){null===g&&(g=y);break}e&&g&&null===v.alternate&&t(i,g),a=s(v,a,m),null===d?u=v:d.sibling=v,d=v,g=y}if(b.done)return n(i,g),u;if(null===g){for(;!b.done;m++,b=l.next())null!==(b=h(i,b.value,c))&&(a=s(b,a,m),null===d?u=b:d.sibling=b,d=b);return u}for(g=r(i,g);!b.done;m++,b=l.next())null!==(b=f(g,i,m,b.value,c))&&(e&&null!==b.alternate&&g.delete(null===b.key?m:b.key),a=s(b,a,m),null===d?u=b:d.sibling=b,d=b);return e&&g.forEach((function(e){return t(i,e)})),u}return function(e,r,s,l){var c="object"==typeof s&&null!==s&&s.type===w&&null===s.key;c&&(s=s.props.children);var u="object"==typeof s&&null!==s;if(u)switch(s.$$typeof){case T:e:{for(u=s.key,c=r;null!==c;){if(c.key===u){if(7===c.tag){if(s.type===w){n(e,c.sibling),(r=i(c,s.props.children)).return=e,e=r;break e}}else if(c.elementType===s.type){n(e,c.sibling),(r=i(c,s.props)).ref=Ts(e,c,s),r.return=e,e=r;break e}n(e,c);break}t(e,c),c=c.sibling}s.type===w?((r=Yl(s.props.children,e.mode,l,s.key)).return=e,e=r):((l=Kl(s.type,s.key,s.props,null,e.mode,l)).ref=Ts(e,r,s),l.return=e,e=l)}return a(e);case x:e:{for(c=s.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===s.containerInfo&&r.stateNode.implementation===s.implementation){n(e,r.sibling),(r=i(r,s.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Ql(s,e.mode,l)).return=e,e=r}return a(e)}if("string"==typeof s||"number"==typeof s)return s=""+s,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,s)).return=e,e=r):(n(e,r),(r=ql(s,e.mode,l)).return=e,e=r),a(e);if(_s(s))return g(e,r,s,l);if($(s))return m(e,r,s,l);if(u&&xs(e,s),void 0===s&&!c)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(o(152,K(e.type)||"Component"))}return n(e,r)}}var Ss=ws(!0),Rs=ws(!1),ks={},Cs=li(ks),Os=li(ks),As=li(ks);function Ns(e){if(e===ks)throw Error(o(174));return e}function Is(e,t){switch(ui(As,t),ui(Os,e),ui(Cs,ks),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pe(null,"");break;default:t=pe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ci(Cs),ui(Cs,t)}function Ls(){ci(Cs),ci(Os),ci(As)}function Ds(e){Ns(As.current);var t=Ns(Cs.current),n=pe(t,e.type);t!==n&&(ui(Os,e),ui(Cs,n))}function Ps(e){Os.current===e&&(ci(Cs),ci(Os))}var Ms=li(0);function Fs(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Us=null,js=null,Bs=!1;function Hs(e,t){var n=Vl(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function $s(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function zs(e){if(Bs){var t=js;if(t){var n=t;if(!$s(e,t)){if(!(t=Kr(n.nextSibling))||!$s(e,t))return e.flags=-1025&e.flags|2,Bs=!1,void(Us=e);Hs(Us,n)}Us=e,js=Kr(t.firstChild)}else e.flags=-1025&e.flags|2,Bs=!1,Us=e}}function Vs(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Us=e}function Gs(e){if(e!==Us)return!1;if(!Bs)return Vs(e),Bs=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!zr(t,e.memoizedProps))for(t=js;t;)Hs(e,t),t=Kr(t.nextSibling);if(Vs(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){js=Kr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}js=null}}else js=Us?Kr(e.stateNode.nextSibling):null;return!0}function Ws(){js=Us=null,Bs=!1}var Ks=[];function Ys(){for(var e=0;e<Ks.length;e++)Ks[e]._workInProgressVersionPrimary=null;Ks.length=0}var Zs=_.ReactCurrentDispatcher,qs=_.ReactCurrentBatchConfig,Qs=0,Xs=null,Js=null,eo=null,to=!1,no=!1;function ro(){throw Error(o(321))}function io(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cr(e[n],t[n]))return!1;return!0}function so(e,t,n,r,i,s){if(Qs=s,Xs=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Zs.current=null===e||null===e.memoizedState?Io:Lo,e=n(r,i),no){s=0;do{if(no=!1,!(25>s))throw Error(o(301));s+=1,eo=Js=null,t.updateQueue=null,Zs.current=Do,e=n(r,i)}while(no)}if(Zs.current=No,t=null!==Js&&null!==Js.next,Qs=0,eo=Js=Xs=null,to=!1,t)throw Error(o(300));return e}function oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===eo?Xs.memoizedState=eo=e:eo=eo.next=e,eo}function ao(){if(null===Js){var e=Xs.alternate;e=null!==e?e.memoizedState:null}else e=Js.next;var t=null===eo?Xs.memoizedState:eo.next;if(null!==t)eo=t,Js=e;else{if(null===e)throw Error(o(310));e={memoizedState:(Js=e).memoizedState,baseState:Js.baseState,baseQueue:Js.baseQueue,queue:Js.queue,next:null},null===eo?Xs.memoizedState=eo=e:eo=eo.next=e}return eo}function lo(e,t){return"function"==typeof t?t(e):t}function co(e){var t=ao(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=Js,i=r.baseQueue,s=n.pending;if(null!==s){if(null!==i){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var l=a=s=null,c=i;do{var u=c.lane;if((Qs&u)===u)null!==l&&(l=l.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===e?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===l?(a=l=d,s=r):l=l.next=d,Xs.lanes|=u,Ha|=u}c=c.next}while(null!==c&&c!==i);null===l?s=r:l.next=a,cr(r,t.memoizedState)||(Mo=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function uo(e){var t=ao(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{s=e(s,a.action),a=a.next}while(a!==i);cr(s,t.memoizedState)||(Mo=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function ho(e,t,n){var r=t._getVersion;r=r(t._source);var i=t._workInProgressVersionPrimary;if(null!==i?e=i===r:(e=e.mutableReadLanes,(e=(Qs&e)===e)&&(t._workInProgressVersionPrimary=r,Ks.push(t))),e)return n(t._source);throw Ks.push(t),Error(o(350))}function po(e,t,n,r){var i=La;if(null===i)throw Error(o(349));var s=t._getVersion,a=s(t._source),l=Zs.current,c=l.useState((function(){return ho(i,t,n)})),u=c[1],d=c[0];c=eo;var h=e.memoizedState,p=h.refs,f=p.getSnapshot,g=h.source;h=h.subscribe;var m=Xs;return e.memoizedState={refs:p,source:t,subscribe:r},l.useEffect((function(){p.getSnapshot=n,p.setSnapshot=u;var e=s(t._source);if(!cr(a,e)){e=n(t._source),cr(d,e)||(u(e),e=pl(m),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var r=i.entanglements,o=e;0<o;){var l=31-zt(o),c=1<<l;r[l]|=e,o&=~c}}}),[n,t,r]),l.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=pl(m);i.mutableReadLanes|=r&i.pendingLanes}catch(s){n((function(){throw s}))}}))}),[t,r]),cr(f,n)&&cr(g,t)&&cr(h,r)||((e={pending:null,dispatch:null,lastRenderedReducer:lo,lastRenderedState:d}).dispatch=u=Ao.bind(null,Xs,e),c.queue=e,c.baseQueue=null,d=ho(i,t,n),c.memoizedState=c.baseState=d),d}function fo(e,t,n){return po(ao(),e,t,n)}function go(e){var t=oo();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:lo,lastRenderedState:e}).dispatch=Ao.bind(null,Xs,e),[t.memoizedState,e]}function mo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Xs.updateQueue)?(t={lastEffect:null},Xs.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function yo(e){return e={current:e},oo().memoizedState=e}function bo(){return ao().memoizedState}function vo(e,t,n,r){var i=oo();Xs.flags|=e,i.memoizedState=mo(1|t,n,void 0,void 0===r?null:r)}function Eo(e,t,n,r){var i=ao();r=void 0===r?null:r;var s=void 0;if(null!==Js){var o=Js.memoizedState;if(s=o.destroy,null!==r&&io(r,o.deps))return void mo(t,n,s,r)}Xs.flags|=e,i.memoizedState=mo(1|t,n,s,r)}function _o(e,t){return vo(516,4,e,t)}function To(e,t){return Eo(516,4,e,t)}function xo(e,t){return Eo(4,2,e,t)}function wo(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function So(e,t,n){return n=null!=n?n.concat([e]):null,Eo(4,2,wo.bind(null,t,e),n)}function Ro(){}function ko(e,t){var n=ao();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&io(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Co(e,t){var n=ao();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&io(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Oo(e,t){var n=zi();Gi(98>n?98:n,(function(){e(!0)})),Gi(97<n?97:n,(function(){var n=qs.transition;qs.transition=1;try{e(!1),t()}finally{qs.transition=n}}))}function Ao(e,t,n){var r=hl(),i=pl(e),s={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},o=t.pending;if(null===o?s.next=s:(s.next=o.next,o.next=s),t.pending=s,o=e.alternate,e===Xs||null!==o&&o===Xs)no=to=!0;else{if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var a=t.lastRenderedState,l=o(a,n);if(s.eagerReducer=o,s.eagerState=l,cr(l,a))return}catch(c){}fl(e,i,r)}}var No={readContext:ss,useCallback:ro,useContext:ro,useEffect:ro,useImperativeHandle:ro,useLayoutEffect:ro,useMemo:ro,useReducer:ro,useRef:ro,useState:ro,useDebugValue:ro,useDeferredValue:ro,useTransition:ro,useMutableSource:ro,useOpaqueIdentifier:ro,unstable_isNewReconciler:!1},Io={readContext:ss,useCallback:function(e,t){return oo().memoizedState=[e,void 0===t?null:t],e},useContext:ss,useEffect:_o,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,vo(4,2,wo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vo(4,2,e,t)},useMemo:function(e,t){var n=oo();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=oo();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Ao.bind(null,Xs,e),[r.memoizedState,e]},useRef:yo,useState:go,useDebugValue:Ro,useDeferredValue:function(e){var t=go(e),n=t[0],r=t[1];return _o((function(){var t=qs.transition;qs.transition=1;try{r(e)}finally{qs.transition=t}}),[e]),n},useTransition:function(){var e=go(!1),t=e[0];return yo(e=Oo.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=oo();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},po(r,e,t,n)},useOpaqueIdentifier:function(){if(Bs){var e=!1,t=function(e){return{$$typeof:P,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Zr++).toString(36))),Error(o(355))})),n=go(t)[1];return 0==(2&Xs.mode)&&(Xs.flags|=516,mo(5,(function(){n("r:"+(Zr++).toString(36))}),void 0,null)),t}return go(t="r:"+(Zr++).toString(36)),t},unstable_isNewReconciler:!1},Lo={readContext:ss,useCallback:ko,useContext:ss,useEffect:To,useImperativeHandle:So,useLayoutEffect:xo,useMemo:Co,useReducer:co,useRef:bo,useState:function(){return co(lo)},useDebugValue:Ro,useDeferredValue:function(e){var t=co(lo),n=t[0],r=t[1];return To((function(){var t=qs.transition;qs.transition=1;try{r(e)}finally{qs.transition=t}}),[e]),n},useTransition:function(){var e=co(lo)[0];return[bo().current,e]},useMutableSource:fo,useOpaqueIdentifier:function(){return co(lo)[0]},unstable_isNewReconciler:!1},Do={readContext:ss,useCallback:ko,useContext:ss,useEffect:To,useImperativeHandle:So,useLayoutEffect:xo,useMemo:Co,useReducer:uo,useRef:bo,useState:function(){return uo(lo)},useDebugValue:Ro,useDeferredValue:function(e){var t=uo(lo),n=t[0],r=t[1];return To((function(){var t=qs.transition;qs.transition=1;try{r(e)}finally{qs.transition=t}}),[e]),n},useTransition:function(){var e=uo(lo)[0];return[bo().current,e]},useMutableSource:fo,useOpaqueIdentifier:function(){return uo(lo)[0]},unstable_isNewReconciler:!1},Po=_.ReactCurrentOwner,Mo=!1;function Fo(e,t,n,r){t.child=null===e?Rs(t,null,n,r):Ss(t,e.child,n,r)}function Uo(e,t,n,r,i){n=n.render;var s=t.ref;return is(t,i),r=so(e,t,n,r,s,i),null===e||Mo?(t.flags|=1,Fo(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,sa(e,t,i))}function jo(e,t,n,r,i,s){if(null===e){var o=n.type;return"function"!=typeof o||Gl(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Kl(n.type,null,r,t,t.mode,s)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Bo(e,t,o,r,i,s))}return o=e.child,0==(i&s)&&(i=o.memoizedProps,(n=null!==(n=n.compare)?n:dr)(i,r)&&e.ref===t.ref)?sa(e,t,s):(t.flags|=1,(e=Wl(o,r)).ref=t.ref,e.return=t,t.child=e)}function Bo(e,t,n,r,i,s){if(null!==e&&dr(e.memoizedProps,r)&&e.ref===t.ref){if(Mo=!1,0==(s&i))return t.lanes=e.lanes,sa(e,t,s);0!=(16384&e.flags)&&(Mo=!0)}return zo(e,t,n,r,s)}function Ho(e,t,n){var r=t.pendingProps,i=r.children,s=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},Tl(t,n);else{if(0==(1073741824&n))return e=null!==s?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},Tl(t,e),null;t.memoizedState={baseLanes:0},Tl(t,null!==s?s.baseLanes:n)}else null!==s?(r=s.baseLanes|n,t.memoizedState=null):r=n,Tl(t,r);return Fo(e,t,i,n),t.child}function $o(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function zo(e,t,n,r,i){var s=mi(n)?fi:hi.current;return s=gi(t,s),is(t,i),n=so(e,t,n,r,s,i),null===e||Mo?(t.flags|=1,Fo(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,sa(e,t,i))}function Vo(e,t,n,r,i){if(mi(n)){var s=!0;Ei(t)}else s=!1;if(is(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),bs(t,n,r),Es(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;"object"==typeof c&&null!==c?c=ss(c):c=gi(t,c=mi(n)?fi:hi.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof o.getSnapshotBeforeUpdate;d||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==r||l!==c)&&vs(t,o,r,c),os=!1;var h=t.memoizedState;o.state=h,hs(t,r,o,i),l=t.memoizedState,a!==r||h!==l||pi.current||os?("function"==typeof u&&(gs(t,n,u,r),l=t.memoizedState),(a=os||ys(t,n,a,r,h,l,c))?(d||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4)):("function"==typeof o.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):("function"==typeof o.componentDidMount&&(t.flags|=4),r=!1)}else{o=t.stateNode,ls(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:qi(t.type,a),o.props=c,d=t.pendingProps,h=o.context,"object"==typeof(l=n.contextType)&&null!==l?l=ss(l):l=gi(t,l=mi(n)?fi:hi.current);var p=n.getDerivedStateFromProps;(u="function"==typeof p||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==d||h!==l)&&vs(t,o,r,l),os=!1,h=t.memoizedState,o.state=h,hs(t,r,o,i);var f=t.memoizedState;a!==d||h!==f||pi.current||os?("function"==typeof p&&(gs(t,n,p,r),f=t.memoizedState),(c=os||ys(t,n,c,r,h,f,l))?(u||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,f,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,f,l)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=f),o.props=r,o.state=f,o.context=l,r=c):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=256),r=!1)}return Go(e,t,n,r,s,i)}function Go(e,t,n,r,i,s){$o(e,t);var o=0!=(64&t.flags);if(!r&&!o)return i&&_i(t,n,!1),sa(e,t,s);r=t.stateNode,Po.current=t;var a=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=Ss(t,e.child,null,s),t.child=Ss(t,null,a,s)):Fo(e,t,a,s),t.memoizedState=r.state,i&&_i(t,n,!0),t.child}function Wo(e){var t=e.stateNode;t.pendingContext?bi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&bi(0,t.context,!1),Is(e,t.containerInfo)}var Ko,Yo,Zo,qo,Qo={dehydrated:null,retryLane:0};function Xo(e,t,n){var r,i=t.pendingProps,s=Ms.current,o=!1;return(r=0!=(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!=(2&s)),r?(o=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(s|=1),ui(Ms,1&s),null===e?(void 0!==i.fallback&&zs(t),e=i.children,s=i.fallback,o?(e=Jo(t,e,s,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Qo,e):"number"==typeof i.unstable_expectedLoadTime?(e=Jo(t,e,s,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Qo,t.lanes=33554432,e):((n=Zl({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,o?(i=ta(e,t,i.children,i.fallback,n),o=t.child,s=e.child.memoizedState,o.memoizedState=null===s?{baseLanes:n}:{baseLanes:s.baseLanes|n},o.childLanes=e.childLanes&~n,t.memoizedState=Qo,i):(n=ea(e,t,i.children,n),t.memoizedState=null,n))}function Jo(e,t,n,r){var i=e.mode,s=e.child;return t={mode:"hidden",children:t},0==(2&i)&&null!==s?(s.childLanes=0,s.pendingProps=t):s=Zl(t,i,0,null),n=Yl(n,i,r,null),s.return=e,n.return=e,s.sibling=n,e.child=s,n}function ea(e,t,n,r){var i=e.child;return e=i.sibling,n=Wl(i,{mode:"visible",children:n}),0==(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function ta(e,t,n,r,i){var s=t.mode,o=e.child;e=o.sibling;var a={mode:"hidden",children:n};return 0==(2&s)&&t.child!==o?((n=t.child).childLanes=0,n.pendingProps=a,null!==(o=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=o,o.nextEffect=null):t.firstEffect=t.lastEffect=null):n=Wl(o,a),null!==e?r=Wl(e,r):(r=Yl(r,s,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function na(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),rs(e.return,t)}function ra(e,t,n,r,i,s){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.lastEffect=s)}function ia(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Fo(e,t,r.children,n),0!=(2&(r=Ms.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&na(e,n);else if(19===e.tag)na(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ui(Ms,r),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Fs(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ra(t,!1,i,n,s,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Fs(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ra(t,!0,n,null,s,t.lastEffect);break;case"together":ra(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function sa(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Ha|=t.lanes,0!=(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Wl(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Wl(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function oa(e,t){if(!Bs)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function aa(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return mi(t.type)&&yi(),null;case 3:return Ls(),ci(pi),ci(hi),Ys(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Gs(t)?t.flags|=4:r.hydrate||(t.flags|=256)),Yo(t),null;case 5:Ps(t);var s=Ns(As.current);if(n=t.type,null!==e&&null!=t.stateNode)Zo(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(o(166));return null}if(e=Ns(Cs.current),Gs(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Qr]=t,r[Xr]=a,n){case"dialog":Or("cancel",r),Or("close",r);break;case"iframe":case"object":case"embed":Or("load",r);break;case"video":case"audio":for(e=0;e<Sr.length;e++)Or(Sr[e],r);break;case"source":Or("error",r);break;case"img":case"image":case"link":Or("error",r),Or("load",r);break;case"details":Or("toggle",r);break;case"input":ee(r,a),Or("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},Or("invalid",r);break;case"textarea":le(r,a),Or("invalid",r)}for(var c in xe(n,a),e=null,a)a.hasOwnProperty(c)&&(s=a[c],"children"===c?"string"==typeof s?r.textContent!==s&&(e=["children",s]):"number"==typeof s&&r.textContent!==""+s&&(e=["children",""+s]):l.hasOwnProperty(c)&&null!=s&&"onScroll"===c&&Or("scroll",r));switch(n){case"input":q(r),re(r,a,!0);break;case"textarea":q(r),ue(r);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(r.onclick=jr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(c=9===s.nodeType?s:s.ownerDocument,e===de.html&&(e=he(n)),e===de.html?"script"===n?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),"select"===n&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[Qr]=t,e[Xr]=r,Ko(e,t,!1,!1),t.stateNode=e,c=we(n,r),n){case"dialog":Or("cancel",e),Or("close",e),s=r;break;case"iframe":case"object":case"embed":Or("load",e),s=r;break;case"video":case"audio":for(s=0;s<Sr.length;s++)Or(Sr[s],e);s=r;break;case"source":Or("error",e),s=r;break;case"img":case"image":case"link":Or("error",e),Or("load",e),s=r;break;case"details":Or("toggle",e),s=r;break;case"input":ee(e,r),s=J(e,r),Or("invalid",e);break;case"option":s=se(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=i({},r,{value:void 0}),Or("invalid",e);break;case"textarea":le(e,r),s=ae(e,r),Or("invalid",e);break;default:s=r}xe(n,s);var u=s;for(a in u)if(u.hasOwnProperty(a)){var d=u[a];"style"===a?_e(e,d):"dangerouslySetInnerHTML"===a?null!=(d=d?d.__html:void 0)&&me(e,d):"children"===a?"string"==typeof d?("textarea"!==n||""!==d)&&ye(e,d):"number"==typeof d&&ye(e,""+d):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(l.hasOwnProperty(a)?null!=d&&"onScroll"===a&&Or("scroll",e):null!=d&&E(e,a,d,c))}switch(n){case"input":q(e),re(e,r,!1);break;case"textarea":q(e),ue(e);break;case"option":null!=r.value&&e.setAttribute("value",""+Y(r.value));break;case"select":e.multiple=!!r.multiple,null!=(a=r.value)?oe(e,!!r.multiple,a,!1):null!=r.defaultValue&&oe(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof s.onClick&&(e.onclick=jr)}$r(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)qo(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));n=Ns(As.current),Ns(Cs.current),Gs(t)?(r=t.stateNode,n=t.memoizedProps,r[Qr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Qr]=t,t.stateNode=r)}return null;case 13:return ci(Ms),r=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Gs(t):n=null!==e.memoizedState,r&&!n&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Ms.current)?0===Ua&&(Ua=3):(0!==Ua&&3!==Ua||(Ua=4),null===La||0==(134217727&Ha)&&0==(134217727&$a)||bl(La,Pa))),(r||n)&&(t.flags|=4),null);case 4:return Ls(),Yo(t),null===e&&Nr(t.stateNode.containerInfo),null;case 10:return ns(t),null;case 19:if(ci(Ms),null===(r=t.memoizedState))return null;if(a=0!=(64&t.flags),null===(c=r.rendering))if(a)oa(r,!1);else{if(0!==Ua||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(c=Fs(e))){for(t.flags|=64,oa(r,!1),null!==(a=c.updateQueue)&&(t.updateQueue=a,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(a=n).flags&=2,a.nextEffect=null,a.firstEffect=null,a.lastEffect=null,null===(c=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,e=c.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ui(Ms,1&Ms.current|2),t.child}e=e.sibling}null!==r.tail&&$i()>Wa&&(t.flags|=64,a=!0,oa(r,!1),t.lanes=33554432)}else{if(!a)if(null!==(e=Fs(c))){if(t.flags|=64,a=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),oa(r,!0),null===r.tail&&"hidden"===r.tailMode&&!c.alternate&&!Bs)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*$i()-r.renderingStartTime>Wa&&1073741824!==n&&(t.flags|=64,a=!0,oa(r,!1),t.lanes=33554432);r.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=r.last)?n.sibling=c:t.child=c,r.last=c)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=$i(),n.sibling=null,t=Ms.current,ui(Ms,a?1&t|2:1&t),n):null;case 23:case 24:return xl(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(o(156,t.tag))}function la(e){switch(e.tag){case 1:mi(e.type)&&yi();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Ls(),ci(pi),ci(hi),Ys(),0!=(64&(t=e.flags)))throw Error(o(285));return e.flags=-4097&t|64,e;case 5:return Ps(e),null;case 13:return ci(Ms),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return ci(Ms),null;case 4:return Ls(),null;case 10:return ns(e),null;case 23:case 24:return xl(),null;default:return null}}function ca(e,t){try{var n="",r=t;do{n+=W(r),r=r.return}while(r);var i=n}catch(s){i="\nError generating stack: "+s.message+"\n"+s.stack}return{value:e,source:t,stack:i}}function ua(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}Ko=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Yo=function(){},Zo=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Ns(Cs.current);var o,a=null;switch(n){case"input":s=J(e,s),r=J(e,r),a=[];break;case"option":s=se(e,s),r=se(e,r),a=[];break;case"select":s=i({},s,{value:void 0}),r=i({},r,{value:void 0}),a=[];break;case"textarea":s=ae(e,s),r=ae(e,r),a=[];break;default:"function"!=typeof s.onClick&&"function"==typeof r.onClick&&(e.onclick=jr)}for(d in xe(n,r),n=null,s)if(!r.hasOwnProperty(d)&&s.hasOwnProperty(d)&&null!=s[d])if("style"===d){var c=s[d];for(o in c)c.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(l.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in r){var u=r[d];if(c=null!=s?s[d]:void 0,r.hasOwnProperty(d)&&u!==c&&(null!=u||null!=c))if("style"===d)if(c){for(o in c)!c.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&c[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(a||(a=[]),a.push(d,n)),n=u;else"dangerouslySetInnerHTML"===d?(u=u?u.__html:void 0,c=c?c.__html:void 0,null!=u&&c!==u&&(a=a||[]).push(d,u)):"children"===d?"string"!=typeof u&&"number"!=typeof u||(a=a||[]).push(d,""+u):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(l.hasOwnProperty(d)?(null!=u&&"onScroll"===d&&Or("scroll",e),a||c===u||(a=[])):"object"==typeof u&&null!==u&&u.$$typeof===P?u.toString():(a=a||[]).push(d,u))}n&&(a=a||[]).push("style",n);var d=a;(t.updateQueue=d)&&(t.flags|=4)}},qo=function(e,t,n,r){n!==r&&(t.flags|=4)};var da="function"==typeof WeakMap?WeakMap:Map;function ha(e,t,n){(n=cs(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){qa||(qa=!0,Qa=r),ua(0,t)},n}function pa(e,t,n){(n=cs(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return ua(0,t),r(i)}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Xa?Xa=new Set([this]):Xa.add(this),ua(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var fa="function"==typeof WeakSet?WeakSet:Set;function ga(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(n){Bl(e,n)}else t.current=null}function ma(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:qi(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Wr(t.stateNode.containerInfo))}throw Error(o(163))}function ya(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;r=i.next,0!=(4&(i=i.tag))&&0!=(1&i)&&(Fl(n,e),Ml(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:qi(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&ps(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}ps(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&$r(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&_t(n)))))}throw Error(o(163))}function ba(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"==typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=null!=i&&i.hasOwnProperty("display")?i.display:null,r.style.display=Ee("display",i)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function va(e,t){if(xi&&"function"==typeof xi.onCommitFiberUnmount)try{xi.onCommitFiberUnmount(Ti,t)}catch(s){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(0!=(4&r))Fl(t,n);else{r=t;try{i()}catch(s){Bl(r,s)}}n=n.next}while(n!==e)}break;case 1:if(ga(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(s){Bl(t,s)}break;case 5:ga(t);break;case 4:Sa(e,t)}}function Ea(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function _a(e){return 5===e.tag||3===e.tag||4===e.tag}function Ta(e){e:{for(var t=e.return;null!==t;){if(_a(t))break e;t=t.return}throw Error(o(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(o(161))}16&n.flags&&(ye(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||_a(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?xa(e,n,t):wa(e,n,t)}function xa(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=jr));else if(4!==r&&null!==(e=e.child))for(xa(e,t,n),e=e.sibling;null!==e;)xa(e,t,n),e=e.sibling}function wa(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(wa(e,t,n),e=e.sibling;null!==e;)wa(e,t,n),e=e.sibling}function Sa(e,t){for(var n,r,i=t,s=!1;;){if(!s){s=i.return;e:for(;;){if(null===s)throw Error(o(160));switch(n=s.stateNode,s.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}s=s.return}s=!0}if(5===i.tag||6===i.tag){e:for(var a=e,l=i,c=l;;)if(va(a,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===l)break e;for(;null===c.sibling;){if(null===c.return||c.return===l)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}r?(a=n,l=i.stateNode,8===a.nodeType?a.parentNode.removeChild(l):a.removeChild(l)):n.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(va(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(s=!1)}i.sibling.return=i.return,i=i.sibling}}function Ra(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3==(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var i=null!==e?e.memoizedProps:r;e=t.type;var s=t.updateQueue;if(t.updateQueue=null,null!==s){for(n[Xr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),we(e,i),t=we(e,r),i=0;i<s.length;i+=2){var a=s[i],l=s[i+1];"style"===a?_e(n,l):"dangerouslySetInnerHTML"===a?me(n,l):"children"===a?ye(n,l):E(n,a,l,t)}switch(e){case"input":ne(n,r);break;case"textarea":ce(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(s=r.value)?oe(n,!!r.multiple,s,!1):e!==!!r.multiple&&(null!=r.defaultValue?oe(n,!!r.multiple,r.defaultValue,!0):oe(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(o(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,_t(n.containerInfo)));case 13:return null!==t.memoizedState&&(Ga=$i(),ba(t.child,!0)),void ka(t);case 19:return void ka(t);case 23:case 24:return void ba(t,null!==t.memoizedState)}throw Error(o(163))}function ka(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new fa),t.forEach((function(t){var r=$l.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Ca(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Oa=Math.ceil,Aa=_.ReactCurrentDispatcher,Na=_.ReactCurrentOwner,Ia=0,La=null,Da=null,Pa=0,Ma=0,Fa=li(0),Ua=0,ja=null,Ba=0,Ha=0,$a=0,za=0,Va=null,Ga=0,Wa=1/0;function Ka(){Wa=$i()+500}var Ya,Za=null,qa=!1,Qa=null,Xa=null,Ja=!1,el=null,tl=90,nl=[],rl=[],il=null,sl=0,ol=null,al=-1,ll=0,cl=0,ul=null,dl=!1;function hl(){return 0!=(48&Ia)?$i():-1!==al?al:al=$i()}function pl(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===zi()?1:2;if(0===ll&&(ll=Ba),0!==Zi.transition){0!==cl&&(cl=null!==Va?Va.pendingLanes:0),e=ll;var t=4186112&~cl;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=zi(),0!=(4&Ia)&&98===e?e=jt(12,ll):e=jt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ll),e}function fl(e,t,n){if(50<sl)throw sl=0,ol=null,Error(o(185));if(null===(e=gl(e,t)))return null;$t(e,t,n),e===La&&($a|=t,4===Ua&&bl(e,Pa));var r=zi();1===t?0!=(8&Ia)&&0==(48&Ia)?vl(e):(ml(e,n),0===Ia&&(Ka(),Ki())):(0==(4&Ia)||98!==r&&99!==r||(null===il?il=new Set([e]):il.add(e)),ml(e,n)),Va=e}function gl(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function ml(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-zt(a),c=1<<l,u=s[l];if(-1===u){if(0==(c&r)||0!=(c&i)){u=t,Mt(c);var d=Pt;s[l]=10<=d?u+250:6<=d?u+5e3:-1}}else u<=t&&(e.expiredLanes|=c);a&=~c}if(r=Ft(e,e===La?Pa:0),t=Pt,0===r)null!==n&&(n!==Mi&&Ri(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Mi&&Ri(n)}15===t?(n=vl.bind(null,e),null===Ui?(Ui=[n],ji=Si(Ni,Yi)):Ui.push(n),n=Mi):14===t?n=Wi(99,vl.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(o(358,e))}}(t),n=Wi(n,yl.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function yl(e){if(al=-1,cl=ll=0,0!=(48&Ia))throw Error(o(327));var t=e.callbackNode;if(Pl()&&e.callbackNode!==t)return null;var n=Ft(e,e===La?Pa:0);if(0===n)return null;var r=n,i=Ia;Ia|=16;var s=Rl();for(La===e&&Pa===r||(Ka(),wl(e,r));;)try{Ol();break}catch(l){Sl(e,l)}if(ts(),Aa.current=s,Ia=i,null!==Da?r=0:(La=null,Pa=0,r=Ua),0!=(Ba&$a))wl(e,0);else if(0!==r){if(2===r&&(Ia|=64,e.hydrate&&(e.hydrate=!1,Wr(e.containerInfo)),0!==(n=Ut(e))&&(r=kl(e,n))),1===r)throw t=ja,wl(e,0),bl(e,n),ml(e,$i()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(o(345));case 2:case 5:Il(e);break;case 3:if(bl(e,n),(62914560&n)===n&&10<(r=Ga+500-$i())){if(0!==Ft(e,0))break;if(((i=e.suspendedLanes)&n)!==n){hl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Vr(Il.bind(null,e),r);break}Il(e);break;case 4:if(bl(e,n),(4186112&n)===n)break;for(r=e.eventTimes,i=-1;0<n;){var a=31-zt(n);s=1<<a,(a=r[a])>i&&(i=a),n&=~s}if(n=i,10<(n=(120>(n=$i()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Oa(n/1960))-n)){e.timeoutHandle=Vr(Il.bind(null,e),n);break}Il(e);break;default:throw Error(o(329))}}return ml(e,$i()),e.callbackNode===t?yl.bind(null,e):null}function bl(e,t){for(t&=~za,t&=~$a,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-zt(t),r=1<<n;e[n]=-1,t&=~r}}function vl(e){if(0!=(48&Ia))throw Error(o(327));if(Pl(),e===La&&0!=(e.expiredLanes&Pa)){var t=Pa,n=kl(e,t);0!=(Ba&$a)&&(n=kl(e,t=Ft(e,t)))}else n=kl(e,t=Ft(e,0));if(0!==e.tag&&2===n&&(Ia|=64,e.hydrate&&(e.hydrate=!1,Wr(e.containerInfo)),0!==(t=Ut(e))&&(n=kl(e,t))),1===n)throw n=ja,wl(e,0),bl(e,t),ml(e,$i()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Il(e),ml(e,$i()),null}function El(e,t){var n=Ia;Ia|=1;try{return e(t)}finally{0===(Ia=n)&&(Ka(),Ki())}}function _l(e,t){var n=Ia;Ia&=-2,Ia|=8;try{return e(t)}finally{0===(Ia=n)&&(Ka(),Ki())}}function Tl(e,t){ui(Fa,Ma),Ma|=t,Ba|=t}function xl(){Ma=Fa.current,ci(Fa)}function wl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Gr(n)),null!==Da)for(n=Da.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&yi();break;case 3:Ls(),ci(pi),ci(hi),Ys();break;case 5:Ps(r);break;case 4:Ls();break;case 13:case 19:ci(Ms);break;case 10:ns(r);break;case 23:case 24:xl()}n=n.return}La=e,Da=Wl(e.current,null),Pa=Ma=Ba=t,Ua=0,ja=null,za=$a=Ha=0}function Sl(e,t){for(;;){var n=Da;try{if(ts(),Zs.current=No,to){for(var r=Xs.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}to=!1}if(Qs=0,eo=Js=Xs=null,no=!1,Na.current=null,null===n||null===n.return){Ua=1,ja=t,Da=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=Pa,a.flags|=2048,a.firstEffect=a.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var c=l;if(0==(2&a.mode)){var u=a.alternate;u?(a.updateQueue=u.updateQueue,a.memoizedState=u.memoizedState,a.lanes=u.lanes):(a.updateQueue=null,a.memoizedState=null)}var d=0!=(1&Ms.current),h=o;do{var p;if(p=13===h.tag){var f=h.memoizedState;if(null!==f)p=null!==f.dehydrated;else{var g=h.memoizedProps;p=void 0!==g.fallback&&(!0!==g.unstable_avoidThisFallback||!d)}}if(p){var m=h.updateQueue;if(null===m){var y=new Set;y.add(c),h.updateQueue=y}else m.add(c);if(0==(2&h.mode)){if(h.flags|=64,a.flags|=16384,a.flags&=-2981,1===a.tag)if(null===a.alternate)a.tag=17;else{var b=cs(-1,1);b.tag=2,us(a,b)}a.lanes|=1;break e}l=void 0,a=t;var v=s.pingCache;if(null===v?(v=s.pingCache=new da,l=new Set,v.set(c,l)):void 0===(l=v.get(c))&&(l=new Set,v.set(c,l)),!l.has(a)){l.add(a);var E=Hl.bind(null,s,c,a);c.then(E,E)}h.flags|=4096,h.lanes=t;break e}h=h.return}while(null!==h);l=Error((K(a.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Ua&&(Ua=2),l=ca(l,a),h=o;do{switch(h.tag){case 3:s=l,h.flags|=4096,t&=-t,h.lanes|=t,ds(h,ha(0,s,t));break e;case 1:s=l;var _=h.type,T=h.stateNode;if(0==(64&h.flags)&&("function"==typeof _.getDerivedStateFromError||null!==T&&"function"==typeof T.componentDidCatch&&(null===Xa||!Xa.has(T)))){h.flags|=4096,t&=-t,h.lanes|=t,ds(h,pa(h,s,t));break e}}h=h.return}while(null!==h)}Nl(n)}catch(x){t=x,Da===n&&null!==n&&(Da=n=n.return);continue}break}}function Rl(){var e=Aa.current;return Aa.current=No,null===e?No:e}function kl(e,t){var n=Ia;Ia|=16;var r=Rl();for(La===e&&Pa===t||wl(e,t);;)try{Cl();break}catch(i){Sl(e,i)}if(ts(),Ia=n,Aa.current=r,null!==Da)throw Error(o(261));return La=null,Pa=0,Ua}function Cl(){for(;null!==Da;)Al(Da)}function Ol(){for(;null!==Da&&!ki();)Al(Da)}function Al(e){var t=Ya(e.alternate,e,Ma);e.memoizedProps=e.pendingProps,null===t?Nl(e):Da=t,Na.current=null}function Nl(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=aa(n,t,Ma)))return void(Da=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&Ma)||0==(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=la(t)))return n.flags&=2047,void(Da=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Da=t);Da=t=e}while(null!==t);0===Ua&&(Ua=5)}function Il(e){var t=zi();return Gi(99,Ll.bind(null,e,t)),null}function Ll(e,t){do{Pl()}while(null!==el);if(0!=(48&Ia))throw Error(o(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,s=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var a=e.eventTimes,l=e.expirationTimes;0<s;){var c=31-zt(s),u=1<<c;i[c]=0,a[c]=-1,l[c]=-1,s&=~u}if(null!==il&&0==(24&r)&&il.has(e)&&il.delete(e),e===La&&(Da=La=null,Pa=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(i=Ia,Ia|=32,Na.current=null,Br=Yt,mr(a=gr())){if("selectionStart"in a)l={start:a.selectionStart,end:a.selectionEnd};else e:if(l=(l=a.ownerDocument)&&l.defaultView||window,(u=l.getSelection&&l.getSelection())&&0!==u.rangeCount){l=u.anchorNode,s=u.anchorOffset,c=u.focusNode,u=u.focusOffset;try{l.nodeType,c.nodeType}catch(R){l=null;break e}var d=0,h=-1,p=-1,f=0,g=0,m=a,y=null;t:for(;;){for(var b;m!==l||0!==s&&3!==m.nodeType||(h=d+s),m!==c||0!==u&&3!==m.nodeType||(p=d+u),3===m.nodeType&&(d+=m.nodeValue.length),null!==(b=m.firstChild);)y=m,m=b;for(;;){if(m===a)break t;if(y===l&&++f===s&&(h=d),y===c&&++g===u&&(p=d),null!==(b=m.nextSibling))break;y=(m=y).parentNode}m=b}l=-1===h||-1===p?null:{start:h,end:p}}else l=null;l=l||{start:0,end:0}}else l=null;Hr={focusedElem:a,selectionRange:l},Yt=!1,ul=null,dl=!1,Za=r;do{try{Dl()}catch(R){if(null===Za)throw Error(o(330));Bl(Za,R),Za=Za.nextEffect}}while(null!==Za);ul=null,Za=r;do{try{for(a=e;null!==Za;){var v=Za.flags;if(16&v&&ye(Za.stateNode,""),128&v){var E=Za.alternate;if(null!==E){var _=E.ref;null!==_&&("function"==typeof _?_(null):_.current=null)}}switch(1038&v){case 2:Ta(Za),Za.flags&=-3;break;case 6:Ta(Za),Za.flags&=-3,Ra(Za.alternate,Za);break;case 1024:Za.flags&=-1025;break;case 1028:Za.flags&=-1025,Ra(Za.alternate,Za);break;case 4:Ra(Za.alternate,Za);break;case 8:Sa(a,l=Za);var T=l.alternate;Ea(l),null!==T&&Ea(T)}Za=Za.nextEffect}}catch(R){if(null===Za)throw Error(o(330));Bl(Za,R),Za=Za.nextEffect}}while(null!==Za);if(_=Hr,E=gr(),v=_.focusedElem,a=_.selectionRange,E!==v&&v&&v.ownerDocument&&fr(v.ownerDocument.documentElement,v)){null!==a&&mr(v)&&(E=a.start,void 0===(_=a.end)&&(_=E),"selectionStart"in v?(v.selectionStart=E,v.selectionEnd=Math.min(_,v.value.length)):(_=(E=v.ownerDocument||document)&&E.defaultView||window).getSelection&&(_=_.getSelection(),l=v.textContent.length,T=Math.min(a.start,l),a=void 0===a.end?T:Math.min(a.end,l),!_.extend&&T>a&&(l=a,a=T,T=l),l=pr(v,T),s=pr(v,a),l&&s&&(1!==_.rangeCount||_.anchorNode!==l.node||_.anchorOffset!==l.offset||_.focusNode!==s.node||_.focusOffset!==s.offset)&&((E=E.createRange()).setStart(l.node,l.offset),_.removeAllRanges(),T>a?(_.addRange(E),_.extend(s.node,s.offset)):(E.setEnd(s.node,s.offset),_.addRange(E))))),E=[];for(_=v;_=_.parentNode;)1===_.nodeType&&E.push({element:_,left:_.scrollLeft,top:_.scrollTop});for("function"==typeof v.focus&&v.focus(),v=0;v<E.length;v++)(_=E[v]).element.scrollLeft=_.left,_.element.scrollTop=_.top}Yt=!!Br,Hr=Br=null,e.current=n,Za=r;do{try{for(v=e;null!==Za;){var x=Za.flags;if(36&x&&ya(v,Za.alternate,Za),128&x){E=void 0;var w=Za.ref;if(null!==w){var S=Za.stateNode;Za.tag,E=S,"function"==typeof w?w(E):w.current=E}}Za=Za.nextEffect}}catch(R){if(null===Za)throw Error(o(330));Bl(Za,R),Za=Za.nextEffect}}while(null!==Za);Za=null,Fi(),Ia=i}else e.current=n;if(Ja)Ja=!1,el=e,tl=t;else for(Za=r;null!==Za;)t=Za.nextEffect,Za.nextEffect=null,8&Za.flags&&((x=Za).sibling=null,x.stateNode=null),Za=t;if(0===(r=e.pendingLanes)&&(Xa=null),1===r?e===ol?sl++:(sl=0,ol=e):sl=0,n=n.stateNode,xi&&"function"==typeof xi.onCommitFiberRoot)try{xi.onCommitFiberRoot(Ti,n,void 0,64==(64&n.current.flags))}catch(R){}if(ml(e,$i()),qa)throw qa=!1,e=Qa,Qa=null,e;return 0!=(8&Ia)||Ki(),null}function Dl(){for(;null!==Za;){var e=Za.alternate;dl||null===ul||(0!=(8&Za.flags)?Je(Za,ul)&&(dl=!0):13===Za.tag&&Ca(e,Za)&&Je(Za,ul)&&(dl=!0));var t=Za.flags;0!=(256&t)&&ma(e,Za),0==(512&t)||Ja||(Ja=!0,Wi(97,(function(){return Pl(),null}))),Za=Za.nextEffect}}function Pl(){if(90!==tl){var e=97<tl?97:tl;return tl=90,Gi(e,Ul)}return!1}function Ml(e,t){nl.push(t,e),Ja||(Ja=!0,Wi(97,(function(){return Pl(),null})))}function Fl(e,t){rl.push(t,e),Ja||(Ja=!0,Wi(97,(function(){return Pl(),null})))}function Ul(){if(null===el)return!1;var e=el;if(el=null,0!=(48&Ia))throw Error(o(331));var t=Ia;Ia|=32;var n=rl;rl=[];for(var r=0;r<n.length;r+=2){var i=n[r],s=n[r+1],a=i.destroy;if(i.destroy=void 0,"function"==typeof a)try{a()}catch(c){if(null===s)throw Error(o(330));Bl(s,c)}}for(n=nl,nl=[],r=0;r<n.length;r+=2){i=n[r],s=n[r+1];try{var l=i.create;i.destroy=l()}catch(c){if(null===s)throw Error(o(330));Bl(s,c)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return Ia=t,Ki(),!0}function jl(e,t,n){us(e,t=ha(0,t=ca(n,t),1)),t=hl(),null!==(e=gl(e,1))&&($t(e,1,t),ml(e,t))}function Bl(e,t){if(3===e.tag)jl(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){jl(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Xa||!Xa.has(r))){var i=pa(n,e=ca(t,e),1);if(us(n,i),i=hl(),null!==(n=gl(n,1)))$t(n,1,i),ml(n,i);else if("function"==typeof r.componentDidCatch&&(null===Xa||!Xa.has(r)))try{r.componentDidCatch(t,e)}catch(s){}break}}n=n.return}}function Hl(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=hl(),e.pingedLanes|=e.suspendedLanes&n,La===e&&(Pa&n)===n&&(4===Ua||3===Ua&&(62914560&Pa)===Pa&&500>$i()-Ga?wl(e,0):za|=n),ml(e,t)}function $l(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===zi()?1:2:(0===ll&&(ll=Ba),0===(t=Bt(62914560&~ll))&&(t=4194304))),n=hl(),null!==(e=gl(e,t))&&($t(e,t,n),ml(e,n))}function zl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Vl(e,t,n,r){return new zl(e,t,n,r)}function Gl(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Wl(e,t){var n=e.alternate;return null===n?((n=Vl(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Kl(e,t,n,r,i,s){var a=2;if(r=e,"function"==typeof e)Gl(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case w:return Yl(n.children,i,s,t);case M:a=8,i|=16;break;case S:a=8,i|=1;break;case R:return(e=Vl(12,n,t,8|i)).elementType=R,e.type=R,e.lanes=s,e;case A:return(e=Vl(13,n,t,i)).type=A,e.elementType=A,e.lanes=s,e;case N:return(e=Vl(19,n,t,i)).elementType=N,e.lanes=s,e;case F:return Zl(n,i,s,t);case U:return(e=Vl(24,n,t,i)).elementType=U,e.lanes=s,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case k:a=10;break e;case C:a=9;break e;case O:a=11;break e;case I:a=14;break e;case L:a=16,r=null;break e;case D:a=22;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Vl(a,n,t,i)).elementType=e,t.type=r,t.lanes=s,t}function Yl(e,t,n,r){return(e=Vl(7,e,r,t)).lanes=n,e}function Zl(e,t,n,r){return(e=Vl(23,e,r,t)).elementType=F,e.lanes=n,e}function ql(e,t,n){return(e=Vl(6,e,null,t)).lanes=n,e}function Ql(e,t,n){return(t=Vl(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xl(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Ht(0),this.expirationTimes=Ht(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ht(0),this.mutableSourceEagerHydrationData=null}function Jl(e,t,n,r){var i=t.current,s=hl(),a=pl(i);e:if(n){t:{if(Ze(n=n._reactInternals)!==n||1!==n.tag)throw Error(o(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(mi(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(o(171))}if(1===n.tag){var c=n.type;if(mi(c)){n=vi(n,c,l);break e}}n=l}else n=di;return null===t.context?t.context=n:t.pendingContext=n,(t=cs(s,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),us(i,t),fl(i,a,s),a}function ec(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function tc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function nc(e,t){tc(e,t),(e=e.alternate)&&tc(e,t)}function rc(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Xl(e,t,null!=n&&!0===n.hydrate),t=Vl(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,as(t),e[Jr]=n.current,Nr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var i=(t=r[e])._getVersion;i=i(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,i]:n.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=n}function ic(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function sc(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s._internalRoot;if("function"==typeof i){var a=i;i=function(){var e=ec(o);a.call(e)}}Jl(t,o,e,i)}else{if(s=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new rc(e,0,t?{hydrate:!0}:void 0)}(n,r),o=s._internalRoot,"function"==typeof i){var l=i;i=function(){var e=ec(o);l.call(e)}}_l((function(){Jl(t,o,e,i)}))}return ec(o)}function oc(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!ic(t))throw Error(o(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:x,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}Ya=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||pi.current)Mo=!0;else{if(0==(n&r)){switch(Mo=!1,t.tag){case 3:Wo(t),Ws();break;case 5:Ds(t);break;case 1:mi(t.type)&&Ei(t);break;case 4:Is(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;ui(Qi,i._currentValue),i._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?Xo(e,t,n):(ui(Ms,1&Ms.current),null!==(t=sa(e,t,n))?t.sibling:null);ui(Ms,1&Ms.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(64&e.flags)){if(r)return ia(e,t,n);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),ui(Ms,Ms.current),r)break;return null;case 23:case 24:return t.lanes=0,Ho(e,t,n)}return sa(e,t,n)}Mo=0!=(16384&e.flags)}else Mo=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=gi(t,hi.current),is(t,n),i=so(null,t,r,e,i,n),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,mi(r)){var s=!0;Ei(t)}else s=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,as(t);var a=r.getDerivedStateFromProps;"function"==typeof a&&gs(t,r,a,e),i.updater=ms,t.stateNode=i,i._reactInternals=t,Es(t,r,e,n),t=Go(null,t,r,!0,s,n)}else t.tag=0,Fo(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(s=i._init)(i._payload),t.type=i,s=t.tag=function(e){if("function"==typeof e)return Gl(e)?1:0;if(null!=e){if((e=e.$$typeof)===O)return 11;if(e===I)return 14}return 2}(i),e=qi(i,e),s){case 0:t=zo(null,t,i,e,n);break e;case 1:t=Vo(null,t,i,e,n);break e;case 11:t=Uo(null,t,i,e,n);break e;case 14:t=jo(null,t,i,qi(i.type,e),r,n);break e}throw Error(o(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,zo(e,t,r,i=t.elementType===r?i:qi(r,i),n);case 1:return r=t.type,i=t.pendingProps,Vo(e,t,r,i=t.elementType===r?i:qi(r,i),n);case 3:if(Wo(t),r=t.updateQueue,null===e||null===r)throw Error(o(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,ls(e,t),hs(t,r,null,n),(r=t.memoizedState.element)===i)Ws(),t=sa(e,t,n);else{if((s=(i=t.stateNode).hydrate)&&(js=Kr(t.stateNode.containerInfo.firstChild),Us=t,s=Bs=!0),s){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(s=e[i])._workInProgressVersionPrimary=e[i+1],Ks.push(s);for(n=Rs(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Fo(e,t,r,n),Ws();t=t.child}return t;case 5:return Ds(t),null===e&&zs(t),r=t.type,i=t.pendingProps,s=null!==e?e.memoizedProps:null,a=i.children,zr(r,i)?a=null:null!==s&&zr(r,s)&&(t.flags|=16),$o(e,t),Fo(e,t,a,n),t.child;case 6:return null===e&&zs(t),null;case 13:return Xo(e,t,n);case 4:return Is(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Ss(t,null,r,n):Fo(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Uo(e,t,r,i=t.elementType===r?i:qi(r,i),n);case 7:return Fo(e,t,t.pendingProps,n),t.child;case 8:case 12:return Fo(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value;var l=t.type._context;if(ui(Qi,l._currentValue),l._currentValue=s,null!==a)if(l=a.value,0===(s=cr(l,s)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,s):1073741823))){if(a.children===i.children&&!pi.current){t=sa(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var c=l.dependencies;if(null!==c){a=l.child;for(var u=c.firstContext;null!==u;){if(u.context===r&&0!=(u.observedBits&s)){1===l.tag&&((u=cs(-1,n&-n)).tag=2,us(l,u)),l.lanes|=n,null!==(u=l.alternate)&&(u.lanes|=n),rs(l.return,n),c.lanes|=n;break}u=u.next}}else a=10===l.tag&&l.type===t.type?null:l.child;if(null!==a)a.return=l;else for(a=l;null!==a;){if(a===t){a=null;break}if(null!==(l=a.sibling)){l.return=a.return,a=l;break}a=a.return}l=a}Fo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(s=t.pendingProps).children,is(t,n),r=r(i=ss(i,s.unstable_observedBits)),t.flags|=1,Fo(e,t,r,n),t.child;case 14:return s=qi(i=t.type,t.pendingProps),jo(e,t,i,s=qi(i.type,s),r,n);case 15:return Bo(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qi(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,mi(r)?(e=!0,Ei(t)):e=!1,is(t,n),bs(t,r,i),Es(t,r,i,n),Go(null,t,r,!0,e,n);case 19:return ia(e,t,n);case 23:case 24:return Ho(e,t,n)}throw Error(o(156,t.tag))},rc.prototype.render=function(e){Jl(e,this._internalRoot,null,null)},rc.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Jl(null,e,null,(function(){t[Jr]=null}))},et=function(e){13===e.tag&&(fl(e,4,hl()),nc(e,4))},tt=function(e){13===e.tag&&(fl(e,67108864,hl()),nc(e,67108864))},nt=function(e){if(13===e.tag){var t=hl(),n=pl(e);fl(e,n,t),nc(e,n)}},rt=function(e,t){return t()},Re=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ii(r);if(!i)throw Error(o(90));Q(r),ne(r,i)}}}break;case"textarea":ce(e,n);break;case"select":null!=(t=n.value)&&oe(e,!!n.multiple,t,!1)}},Ie=El,Le=function(e,t,n,r,i){var s=Ia;Ia|=4;try{return Gi(98,e.bind(null,t,n,r,i))}finally{0===(Ia=s)&&(Ka(),Ki())}},De=function(){0==(49&Ia)&&(function(){if(null!==il){var e=il;il=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,ml(e,$i())}))}Ki()}(),Pl())},Pe=function(e,t){var n=Ia;Ia|=2;try{return e(t)}finally{0===(Ia=n)&&(Ka(),Ki())}};var ac={Events:[ni,ri,ii,Ae,Ne,Pl,{current:!1}]},lc={findFiberByHostInstance:ti,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},cc={bundleType:lc.bundleType,version:lc.version,rendererPackageName:lc.rendererPackageName,rendererConfig:lc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Xe(e))?null:e.stateNode},findFiberByHostInstance:lc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var uc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uc.isDisabled&&uc.supportsFiber)try{Ti=uc.inject(cc),xi=uc}catch(ge){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ac,t.createPortal=oc,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw Error(o(268,Object.keys(e)))}return e=null===(e=Xe(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Ia;if(0!=(48&n))return e(t);Ia|=1;try{if(e)return Gi(99,e.bind(null,t))}finally{Ia=n,Ki()}},t.hydrate=function(e,t,n){if(!ic(t))throw Error(o(200));return sc(null,e,t,!0,n)},t.render=function(e,t,n){if(!ic(t))throw Error(o(200));return sc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!ic(e))throw Error(o(40));return!!e._reactRootContainer&&(_l((function(){sc(null,null,e,!1,(function(){e._reactRootContainer=null,e[Jr]=null}))})),!0)},t.unstable_batchedUpdates=El,t.unstable_createPortal=function(e,t){return oc(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ic(n))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return sc(e,t,n,!1,r)},t.version="17.0.2"},73935:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(64448)},69590:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,i="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function s(e,o){if(e===o)return!0;if(e&&o&&"object"==typeof e&&"object"==typeof o){if(e.constructor!==o.constructor)return!1;var a,l,c,u;if(Array.isArray(e)){if((a=e.length)!=o.length)return!1;for(l=a;0!=l--;)if(!s(e[l],o[l]))return!1;return!0}if(n&&e instanceof Map&&o instanceof Map){if(e.size!==o.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!o.has(l.value[0]))return!1;for(u=e.entries();!(l=u.next()).done;)if(!s(l.value[1],o.get(l.value[0])))return!1;return!0}if(r&&e instanceof Set&&o instanceof Set){if(e.size!==o.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!o.has(l.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(o)){if((a=e.length)!=o.length)return!1;for(l=a;0!=l--;)if(e[l]!==o[l])return!1;return!0}if(e.constructor===RegExp)return e.source===o.source&&e.flags===o.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof o.valueOf)return e.valueOf()===o.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof o.toString)return e.toString()===o.toString();if((a=(c=Object.keys(e)).length)!==Object.keys(o).length)return!1;for(l=a;0!=l--;)if(!Object.prototype.hasOwnProperty.call(o,c[l]))return!1;if(t&&e instanceof Element)return!1;for(l=a;0!=l--;)if(("_owner"!==c[l]&&"__v"!==c[l]&&"__o"!==c[l]||!e.$$typeof)&&!s(e[c[l]],o[c[l]]))return!1;return!0}return e!=e&&o!=o}e.exports=function(e,t){try{return s(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},70405:(e,t,n)=>{"use strict";n.d(t,{B6:()=>G,ql:()=>J});var r=n(67294),i=n(45697),s=n.n(i),o=n(69590),a=n.n(o),l=n(41143),c=n.n(l),u=n(96774),d=n.n(u);function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,f(e,t)}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function g(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)t.indexOf(n=s[r])>=0||(i[n]=e[n]);return i}var m={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},y={rel:["amphtml","canonical","alternate"]},b={type:["application/ld+json"]},v={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},E=Object.keys(m).map((function(e){return m[e]})),_={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},T=Object.keys(_).reduce((function(e,t){return e[_[t]]=t,e}),{}),x=function(e,t){for(var n=e.length-1;n>=0;n-=1){var r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},w=function(e){var t=x(e,m.TITLE),n=x(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,(function(){return t}));var r=x(e,"defaultTitle");return t||r||void 0},S=function(e){return x(e,"onChangeClientState")||function(){}},R=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return h({},e,t)}),{})},k=function(e,t){return t.filter((function(e){return void 0!==e[m.BASE]})).map((function(e){return e[m.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),i=0;i<r.length;i+=1){var s=r[i].toLowerCase();if(-1!==e.indexOf(s)&&n[s])return t.concat(n)}return t}),[])},C=function(e,t,n){var r={};return n.filter((function(t){return!!Array.isArray(t[e])||(void 0!==t[e]&&console&&"function"==typeof console.warn&&console.warn("Helmet: "+e+' should be of type "Array". Instead found type "'+typeof t[e]+'"'),!1)})).map((function(t){return t[e]})).reverse().reduce((function(e,n){var i={};n.filter((function(e){for(var n,s=Object.keys(e),o=0;o<s.length;o+=1){var a=s[o],l=a.toLowerCase();-1===t.indexOf(l)||"rel"===n&&"canonical"===e[n].toLowerCase()||"rel"===l&&"stylesheet"===e[l].toLowerCase()||(n=l),-1===t.indexOf(a)||"innerHTML"!==a&&"cssText"!==a&&"itemprop"!==a||(n=a)}if(!n||!e[n])return!1;var c=e[n].toLowerCase();return r[n]||(r[n]={}),i[n]||(i[n]={}),!r[n][c]&&(i[n][c]=!0,!0)})).reverse().forEach((function(t){return e.push(t)}));for(var s=Object.keys(i),o=0;o<s.length;o+=1){var a=s[o],l=h({},r[a],i[a]);r[a]=l}return e}),[]).reverse()},O=function(e,t){if(Array.isArray(e)&&e.length)for(var n=0;n<e.length;n+=1)if(e[n][t])return!0;return!1},A=function(e){return Array.isArray(e)?e.join(""):e},N=function(e,t){return Array.isArray(e)?e.reduce((function(e,n){return function(e,t){for(var n=Object.keys(e),r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1}(n,t)?e.priority.push(n):e.default.push(n),e}),{priority:[],default:[]}):{default:e}},I=function(e,t){var n;return h({},e,((n={})[t]=void 0,n))},L=[m.NOSCRIPT,m.SCRIPT,m.STYLE],D=function(e,t){return void 0===t&&(t=!0),!1===t?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},P=function(e){return Object.keys(e).reduce((function(t,n){var r=void 0!==e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},M=function(e,t){return void 0===t&&(t={}),Object.keys(e).reduce((function(t,n){return t[_[n]||n]=e[n],t}),t)},F=function(e,t){return t.map((function(t,n){var i,s=((i={key:n})["data-rh"]=!0,i);return Object.keys(t).forEach((function(e){var n=_[e]||e;"innerHTML"===n||"cssText"===n?s.dangerouslySetInnerHTML={__html:t.innerHTML||t.cssText}:s[n]=t[e]})),r.createElement(e,s)}))},U=function(e,t,n){switch(e){case m.TITLE:return{toComponent:function(){return n=t.titleAttributes,(i={key:e=t.title})["data-rh"]=!0,s=M(n,i),[r.createElement(m.TITLE,s,e)];var e,n,i,s},toString:function(){return function(e,t,n,r){var i=P(n),s=A(t);return i?"<"+e+' data-rh="true" '+i+">"+D(s,r)+"</"+e+">":"<"+e+' data-rh="true">'+D(s,r)+"</"+e+">"}(e,t.title,t.titleAttributes,n)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return M(t)},toString:function(){return P(t)}};default:return{toComponent:function(){return F(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var i=Object.keys(r).filter((function(e){return!("innerHTML"===e||"cssText"===e)})).reduce((function(e,t){var i=void 0===r[t]?t:t+'="'+D(r[t],n)+'"';return e?e+" "+i:i}),""),s=r.innerHTML||r.cssText||"",o=-1===L.indexOf(e);return t+"<"+e+' data-rh="true" '+i+(o?"/>":">"+s+"</"+e+">")}),"")}(e,t,n)}}}},j=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,i=e.htmlAttributes,s=e.noscriptTags,o=e.styleTags,a=e.title,l=void 0===a?"":a,c=e.titleAttributes,u=e.linkTags,d=e.metaTags,h=e.scriptTags,p={toComponent:function(){},toString:function(){return""}};if(e.prioritizeSeoTags){var f=function(e){var t=e.linkTags,n=e.scriptTags,r=e.encode,i=N(e.metaTags,v),s=N(t,y),o=N(n,b);return{priorityMethods:{toComponent:function(){return[].concat(F(m.META,i.priority),F(m.LINK,s.priority),F(m.SCRIPT,o.priority))},toString:function(){return U(m.META,i.priority,r)+" "+U(m.LINK,s.priority,r)+" "+U(m.SCRIPT,o.priority,r)}},metaTags:i.default,linkTags:s.default,scriptTags:o.default}}(e);p=f.priorityMethods,u=f.linkTags,d=f.metaTags,h=f.scriptTags}return{priority:p,base:U(m.BASE,t,r),bodyAttributes:U("bodyAttributes",n,r),htmlAttributes:U("htmlAttributes",i,r),link:U(m.LINK,u,r),meta:U(m.META,d,r),noscript:U(m.NOSCRIPT,s,r),script:U(m.SCRIPT,h,r),style:U(m.STYLE,o,r),title:U(m.TITLE,{title:l,titleAttributes:c},r)}},B=[],H=function(e,t){var n=this;void 0===t&&(t="undefined"!=typeof document),this.instances=[],this.value={setHelmet:function(e){n.context.helmet=e},helmetInstances:{get:function(){return n.canUseDOM?B:n.instances},add:function(e){(n.canUseDOM?B:n.instances).push(e)},remove:function(e){var t=(n.canUseDOM?B:n.instances).indexOf(e);(n.canUseDOM?B:n.instances).splice(t,1)}}},this.context=e,this.canUseDOM=t,t||(e.helmet=j({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},$=r.createContext({}),z=s().shape({setHelmet:s().func,helmetInstances:s().shape({get:s().func,add:s().func,remove:s().func})}),V="undefined"!=typeof document,G=function(e){function t(n){var r;return(r=e.call(this,n)||this).helmetData=new H(r.props.context,t.canUseDOM),r}return p(t,e),t.prototype.render=function(){return r.createElement($.Provider,{value:this.helmetData.value},this.props.children)},t}(r.Component);G.canUseDOM=V,G.propTypes={context:s().shape({helmet:s().shape()}),children:s().node.isRequired},G.defaultProps={context:{}},G.displayName="HelmetProvider";var W=function(e,t){var n,r=document.head||document.querySelector(m.HEAD),i=r.querySelectorAll(e+"[data-rh]"),s=[].slice.call(i),o=[];return t&&t.length&&t.forEach((function(t){var r=document.createElement(e);for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&("innerHTML"===i?r.innerHTML=t.innerHTML:"cssText"===i?r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText)):r.setAttribute(i,void 0===t[i]?"":t[i]));r.setAttribute("data-rh","true"),s.some((function(e,t){return n=t,r.isEqualNode(e)}))?s.splice(n,1):o.push(r)})),s.forEach((function(e){return e.parentNode.removeChild(e)})),o.forEach((function(e){return r.appendChild(e)})),{oldTags:s,newTags:o}},K=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute("data-rh"),i=r?r.split(","):[],s=[].concat(i),o=Object.keys(t),a=0;a<o.length;a+=1){var l=o[a],c=t[l]||"";n.getAttribute(l)!==c&&n.setAttribute(l,c),-1===i.indexOf(l)&&i.push(l);var u=s.indexOf(l);-1!==u&&s.splice(u,1)}for(var d=s.length-1;d>=0;d-=1)n.removeAttribute(s[d]);i.length===s.length?n.removeAttribute("data-rh"):n.getAttribute("data-rh")!==o.join(",")&&n.setAttribute("data-rh",o.join(","))}},Y=function(e,t){var n=e.baseTag,r=e.htmlAttributes,i=e.linkTags,s=e.metaTags,o=e.noscriptTags,a=e.onChangeClientState,l=e.scriptTags,c=e.styleTags,u=e.title,d=e.titleAttributes;K(m.BODY,e.bodyAttributes),K(m.HTML,r),function(e,t){void 0!==e&&document.title!==e&&(document.title=A(e)),K(m.TITLE,t)}(u,d);var h={baseTag:W(m.BASE,n),linkTags:W(m.LINK,i),metaTags:W(m.META,s),noscriptTags:W(m.NOSCRIPT,o),scriptTags:W(m.SCRIPT,l),styleTags:W(m.STYLE,c)},p={},f={};Object.keys(h).forEach((function(e){var t=h[e],n=t.newTags,r=t.oldTags;n.length&&(p[e]=n),r.length&&(f[e]=h[e].oldTags)})),t&&t(),a(e,p,f)},Z=null,q=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).rendered=!1,t}p(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return!d()(e,this.props)},n.componentDidUpdate=function(){this.emitChange()},n.componentWillUnmount=function(){this.props.context.helmetInstances.remove(this),this.emitChange()},n.emitChange=function(){var e,t,n=this.props.context,r=n.setHelmet,i=null,s=(e=n.helmetInstances.get().map((function(e){var t=h({},e.props);return delete t.context,t})),{baseTag:k(["href"],e),bodyAttributes:R("bodyAttributes",e),defer:x(e,"defer"),encode:x(e,"encodeSpecialCharacters"),htmlAttributes:R("htmlAttributes",e),linkTags:C(m.LINK,["rel","href"],e),metaTags:C(m.META,["name","charset","http-equiv","property","itemprop"],e),noscriptTags:C(m.NOSCRIPT,["innerHTML"],e),onChangeClientState:S(e),scriptTags:C(m.SCRIPT,["src","innerHTML"],e),styleTags:C(m.STYLE,["cssText"],e),title:w(e),titleAttributes:R("titleAttributes",e),prioritizeSeoTags:O(e,"prioritizeSeoTags")});G.canUseDOM?(t=s,Z&&cancelAnimationFrame(Z),t.defer?Z=requestAnimationFrame((function(){Y(t,(function(){Z=null}))})):(Y(t),Z=null)):j&&(i=j(s)),r(i)},n.init=function(){this.rendered||(this.rendered=!0,this.props.context.helmetInstances.add(this),this.emitChange())},n.render=function(){return this.init(),null},t}(r.Component);q.propTypes={context:z.isRequired},q.displayName="HelmetDispatcher";var Q=["children"],X=["children"],J=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return!a()(I(this.props,"helmetData"),I(e,"helmetData"))},n.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case m.SCRIPT:case m.NOSCRIPT:return{innerHTML:t};case m.STYLE:return{cssText:t};default:throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")}},n.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren;return h({},r,((t={})[n.type]=[].concat(r[n.type]||[],[h({},e.newChildProps,this.mapNestedChildrenToProps(n,e.nestedChildren))]),t))},n.mapObjectTypeChildren=function(e){var t,n,r=e.child,i=e.newProps,s=e.newChildProps,o=e.nestedChildren;switch(r.type){case m.TITLE:return h({},i,((t={})[r.type]=o,t.titleAttributes=h({},s),t));case m.BODY:return h({},i,{bodyAttributes:h({},s)});case m.HTML:return h({},i,{htmlAttributes:h({},s)});default:return h({},i,((n={})[r.type]=h({},s),n))}},n.mapArrayTypeChildrenToProps=function(e,t){var n=h({},t);return Object.keys(e).forEach((function(t){var r;n=h({},n,((r={})[t]=e[t],r))})),n},n.warnOnInvalidChildren=function(e,t){return c()(E.some((function(t){return e.type===t})),"function"==typeof e.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+E.join(", ")+" are allowed. Helmet does not support rendering <"+e.type+"> elements. Refer to our API for more information."),c()(!t||"string"==typeof t||Array.isArray(t)&&!t.some((function(e){return"string"!=typeof e})),"Helmet expects a string as a child of <"+e.type+">. Did you forget to wrap your children in braces? ( <"+e.type+">{``}</"+e.type+"> ) Refer to our API for more information."),!0},n.mapChildrenToProps=function(e,t){var n=this,i={};return r.Children.forEach(e,(function(e){if(e&&e.props){var r=e.props,s=r.children,o=g(r,Q),a=Object.keys(o).reduce((function(e,t){return e[T[t]||t]=o[t],e}),{}),l=e.type;switch("symbol"==typeof l?l=l.toString():n.warnOnInvalidChildren(e,s),l){case m.FRAGMENT:t=n.mapChildrenToProps(s,t);break;case m.LINK:case m.META:case m.NOSCRIPT:case m.SCRIPT:case m.STYLE:i=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:i,newChildProps:a,nestedChildren:s});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:a,nestedChildren:s})}}})),this.mapArrayTypeChildrenToProps(i,t)},n.render=function(){var e=this.props,t=e.children,n=g(e,X),i=h({},n),s=n.helmetData;return t&&(i=this.mapChildrenToProps(t,i)),!s||s instanceof H||(s=new H(s.context,s.instances)),s?r.createElement(q,h({},i,{context:s.value,helmetData:void 0})):r.createElement($.Consumer,null,(function(e){return r.createElement(q,h({},i,{context:e}))}))},t}(r.Component);J.propTypes={base:s().object,bodyAttributes:s().object,children:s().oneOfType([s().arrayOf(s().node),s().node]),defaultTitle:s().string,defer:s().bool,encodeSpecialCharacters:s().bool,htmlAttributes:s().object,link:s().arrayOf(s().object),meta:s().arrayOf(s().object),noscript:s().arrayOf(s().object),onChangeClientState:s().func,script:s().arrayOf(s().object),style:s().arrayOf(s().object),title:s().string,titleAttributes:s().object,titleTemplate:s().string,prioritizeSeoTags:s().bool,helmetData:s().object},J.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},J.displayName="Helmet"},69921:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,v=n?Symbol.for("react.responder"):60118,E=n?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case s:case a:case o:case p:return e;default:switch(e=e&&e.$$typeof){case c:case h:case m:case g:case l:return e;default:return t}}case i:return t}}}function T(e){return _(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=h,t.Fragment=s,t.Lazy=m,t.Memo=g,t.Portal=i,t.Profiler=a,t.StrictMode=o,t.Suspense=p,t.isAsyncMode=function(e){return T(e)||_(e)===u},t.isConcurrentMode=T,t.isContextConsumer=function(e){return _(e)===c},t.isContextProvider=function(e){return _(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return _(e)===h},t.isFragment=function(e){return _(e)===s},t.isLazy=function(e){return _(e)===m},t.isMemo=function(e){return _(e)===g},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===a},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===d||e===a||e===o||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===l||e.$$typeof===c||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v||e.$$typeof===E||e.$$typeof===y)},t.typeOf=_},59864:(e,t,n)=>{"use strict";e.exports=n(69921)},68356:(e,t,n)=>{"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var a=n(67294),l=n(45697),c=[],u=[];function d(e){var t=e(),n={loading:!0,loaded:null,error:null};return n.promise=t.then((function(e){return n.loading=!1,n.loaded=e,e})).catch((function(e){throw n.loading=!1,n.error=e,e})),n}function h(e){var t={loading:!1,loaded:{},error:null},n=[];try{Object.keys(e).forEach((function(r){var i=d(e[r]);i.loading?t.loading=!0:(t.loaded[r]=i.loaded,t.error=i.error),n.push(i.promise),i.promise.then((function(e){t.loaded[r]=e})).catch((function(e){t.error=e}))}))}catch(r){t.error=r}return t.promise=Promise.all(n).then((function(e){return t.loading=!1,e})).catch((function(e){throw t.loading=!1,e})),t}function p(e,t){return a.createElement((n=e)&&n.__esModule?n.default:n,t);var n}function f(e,t){var d,h;if(!t.loading)throw new Error("react-loadable requires a `loading` component");var f=o({loader:null,loading:null,delay:200,timeout:null,render:p,webpack:null,modules:null},t),g=null;function m(){return g||(g=e(f.loader)),g.promise}return c.push(m),"function"==typeof f.webpack&&u.push((function(){if((0,f.webpack)().every((function(e){return void 0!==e&&void 0!==n.m[e]})))return m()})),h=d=function(t){function n(n){var r;return s(i(i(r=t.call(this,n)||this)),"retry",(function(){r.setState({error:null,loading:!0,timedOut:!1}),g=e(f.loader),r._loadModule()})),m(),r.state={error:g.error,pastDelay:!1,timedOut:!1,loading:g.loading,loaded:g.loaded},r}r(n,t),n.preload=function(){return m()};var o=n.prototype;return o.UNSAFE_componentWillMount=function(){this._loadModule()},o.componentDidMount=function(){this._mounted=!0},o._loadModule=function(){var e=this;if(this.context.loadable&&Array.isArray(f.modules)&&f.modules.forEach((function(t){e.context.loadable.report(t)})),g.loading){var t=function(t){e._mounted&&e.setState(t)};"number"==typeof f.delay&&(0===f.delay?this.setState({pastDelay:!0}):this._delay=setTimeout((function(){t({pastDelay:!0})}),f.delay)),"number"==typeof f.timeout&&(this._timeout=setTimeout((function(){t({timedOut:!0})}),f.timeout));var n=function(){t({error:g.error,loaded:g.loaded,loading:g.loading}),e._clearTimeouts()};g.promise.then((function(){return n(),null})).catch((function(e){return n(),null}))}},o.componentWillUnmount=function(){this._mounted=!1,this._clearTimeouts()},o._clearTimeouts=function(){clearTimeout(this._delay),clearTimeout(this._timeout)},o.render=function(){return this.state.loading||this.state.error?a.createElement(f.loading,{isLoading:this.state.loading,pastDelay:this.state.pastDelay,timedOut:this.state.timedOut,error:this.state.error,retry:this.retry}):this.state.loaded?f.render(this.state.loaded,this.props):null},n}(a.Component),s(d,"contextTypes",{loadable:l.shape({report:l.func.isRequired})}),h}function g(e){return f(d,e)}g.Map=function(e){if("function"!=typeof e.render)throw new Error("LoadableMap requires a `render(loaded, props)` function");return f(h,e)};var m=function(e){function t(){return e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.getChildContext=function(){return{loadable:{report:this.props.report}}},n.render=function(){return a.Children.only(this.props.children)},t}(a.Component);function y(e){for(var t=[];e.length;){var n=e.pop();t.push(n())}return Promise.all(t).then((function(){if(e.length)return y(e)}))}s(m,"propTypes",{report:l.func.isRequired}),s(m,"childContextTypes",{loadable:l.shape({report:l.func.isRequired}).isRequired}),g.Capture=m,g.preloadAll=function(){return new Promise((function(e,t){y(c).then(e,t)}))},g.preloadReady=function(){return new Promise((function(e,t){y(u).then(e,e)}))},e.exports=g},18790:(e,t,n)=>{"use strict";n.d(t,{H:()=>a,f:()=>o});var r=n(16550),i=n(87462),s=n(67294);function o(e,t,n){return void 0===n&&(n=[]),e.some((function(e){var i=e.path?(0,r.LX)(t,e):n.length?n[n.length-1].match:r.F0.computeRootMatch(t);return i&&(n.push({route:e,match:i}),e.routes&&o(e.routes,t,n)),i})),n}function a(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),e?s.createElement(r.rs,n,e.map((function(e,n){return s.createElement(r.AW,{key:e.key||n,path:e.path,exact:e.exact,strict:e.strict,render:function(n){return e.render?e.render((0,i.Z)({},n,{},t,{route:e})):s.createElement(e.component,(0,i.Z)({},n,t,{route:e}))}})}))):null}},73727:(e,t,n)=>{"use strict";n.d(t,{OL:()=>v,VK:()=>u,rU:()=>m});var r=n(16550),i=n(75068),s=n(67294),o=n(99318),a=n(87462),l=n(63366),c=n(38776),u=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).history=(0,o.lX)(t.props),t}return(0,i.Z)(t,e),t.prototype.render=function(){return s.createElement(r.F0,{history:this.history,children:this.props.children})},t}(s.Component);s.Component;var d=function(e,t){return"function"==typeof e?e(t):e},h=function(e,t){return"string"==typeof e?(0,o.ob)(e,null,null,t):e},p=function(e){return e},f=s.forwardRef;void 0===f&&(f=p);var g=f((function(e,t){var n=e.innerRef,r=e.navigate,i=e.onClick,o=(0,l.Z)(e,["innerRef","navigate","onClick"]),c=o.target,u=(0,a.Z)({},o,{onClick:function(e){try{i&&i(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||c&&"_self"!==c||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return u.ref=p!==f&&t||n,s.createElement("a",u)}));var m=f((function(e,t){var n=e.component,i=void 0===n?g:n,u=e.replace,m=e.to,y=e.innerRef,b=(0,l.Z)(e,["component","replace","to","innerRef"]);return s.createElement(r.s6.Consumer,null,(function(e){e||(0,c.Z)(!1);var n=e.history,r=h(d(m,e.location),e.location),l=r?n.createHref(r):"",g=(0,a.Z)({},b,{href:l,navigate:function(){var t=d(m,e.location),r=(0,o.Ep)(e.location)===(0,o.Ep)(h(t));(u||r?n.replace:n.push)(t)}});return p!==f?g.ref=t||y:g.innerRef=y,s.createElement(i,g)}))})),y=function(e){return e},b=s.forwardRef;void 0===b&&(b=y);var v=b((function(e,t){var n=e["aria-current"],i=void 0===n?"page":n,o=e.activeClassName,u=void 0===o?"active":o,p=e.activeStyle,f=e.className,g=e.exact,v=e.isActive,E=e.location,_=e.sensitive,T=e.strict,x=e.style,w=e.to,S=e.innerRef,R=(0,l.Z)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return s.createElement(r.s6.Consumer,null,(function(e){e||(0,c.Z)(!1);var n=E||e.location,o=h(d(w,n),n),l=o.pathname,k=l&&l.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),C=k?(0,r.LX)(n.pathname,{path:k,exact:g,sensitive:_,strict:T}):null,O=!!(v?v(C,n):C),A="function"==typeof f?f(O):f,N="function"==typeof x?x(O):x;O&&(A=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(A,u),N=(0,a.Z)({},N,p));var I=(0,a.Z)({"aria-current":O&&i||null,className:A,style:N,to:o},R);return y!==b?I.ref=t||S:I.innerRef=S,s.createElement(m,I)}))}))},16550:(e,t,n)=>{"use strict";n.d(t,{AW:()=>w,F0:()=>v,LX:()=>x,TH:()=>L,k6:()=>I,rs:()=>A,s6:()=>b});var r=n(75068),i=n(67294),s=n(45697),o=n.n(s),a=n(99318),l=n(38776),c=n(87462),u=n(14779),d=n.n(u),h=(n(59864),n(63366)),p=(n(8679),1073741823),f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{};var g=i.createContext||function(e,t){var n,s,a="__create-react-context-"+function(){var e="__global_unique_id__";return f[e]=(f[e]||0)+1}()+"__",l=function(e){function n(){for(var t,n,r,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return(t=e.call.apply(e,[this].concat(s))||this).emitter=(n=t.props.value,r=[],{on:function(e){r.push(e)},off:function(e){r=r.filter((function(t){return t!==e}))},get:function(){return n},set:function(e,t){n=e,r.forEach((function(e){return e(n,t)}))}}),t}(0,r.Z)(n,e);var i=n.prototype;return i.getChildContext=function(){var e;return(e={})[a]=this.emitter,e},i.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,i=e.value;((s=r)===(o=i)?0!==s||1/s==1/o:s!=s&&o!=o)?n=0:(n="function"==typeof t?t(r,i):p,0!==(n|=0)&&this.emitter.set(e.value,n))}var s,o},i.render=function(){return this.props.children},n}(i.Component);l.childContextTypes=((n={})[a]=o().object.isRequired,n);var c=function(t){function n(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).observedBits=void 0,e.state={value:e.getValue()},e.onUpdate=function(t,n){0!=((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}(0,r.Z)(n,t);var i=n.prototype;return i.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?p:t},i.componentDidMount=function(){this.context[a]&&this.context[a].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?p:e},i.componentWillUnmount=function(){this.context[a]&&this.context[a].off(this.onUpdate)},i.getValue=function(){return this.context[a]?this.context[a].get():e},i.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(i.Component);return c.contextTypes=((s={})[a]=o().object,s),{Provider:l,Consumer:c}},m=function(e){var t=g();return t.displayName=e,t},y=m("Router-History"),b=m("Router"),v=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._pendingLocation=e}))),n}(0,r.Z)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){var e=this;this._isMounted=!0,this.unlisten&&this.unlisten(),this.props.staticContext||(this.unlisten=this.props.history.listen((function(t){e._isMounted&&e.setState({location:t})}))),this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return i.createElement(b.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},i.createElement(y.Provider,{children:this.props.children||null,value:this.props.history}))},t}(i.Component);i.Component;i.Component;var E={},_=1e4,T=0;function x(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,i=n.exact,s=void 0!==i&&i,o=n.strict,a=void 0!==o&&o,l=n.sensitive,c=void 0!==l&&l;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=E[n]||(E[n]={});if(r[e])return r[e];var i=[],s={regexp:d()(e,i,t),keys:i};return T<_&&(r[e]=s,T++),s}(n,{end:s,strict:a,sensitive:c}),i=r.regexp,o=r.keys,l=i.exec(e);if(!l)return null;var u=l[0],h=l.slice(1),p=e===u;return s&&!p?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:p,params:o.reduce((function(e,t,n){return e[t.name]=h[n],e}),{})}}),null)}var w=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.Z)(t,e),t.prototype.render=function(){var e=this;return i.createElement(b.Consumer,null,(function(t){t||(0,l.Z)(!1);var n=e.props.location||t.location,r=e.props.computedMatch?e.props.computedMatch:e.props.path?x(n.pathname,e.props):t.match,s=(0,c.Z)({},t,{location:n,match:r}),o=e.props,a=o.children,u=o.component,d=o.render;return Array.isArray(a)&&function(e){return 0===i.Children.count(e)}(a)&&(a=null),i.createElement(b.Provider,{value:s},s.match?a?"function"==typeof a?a(s):a:u?i.createElement(u,s):d?d(s):null:"function"==typeof a?a(s):null)}))},t}(i.Component);function S(e){return"/"===e.charAt(0)?e:"/"+e}function R(e,t){if(!e)return t;var n=S(e);return 0!==t.pathname.indexOf(n)?t:(0,c.Z)({},t,{pathname:t.pathname.substr(n.length)})}function k(e){return"string"==typeof e?e:(0,a.Ep)(e)}function C(e){return function(){(0,l.Z)(!1)}}function O(){}i.Component;var A=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.Z)(t,e),t.prototype.render=function(){var e=this;return i.createElement(b.Consumer,null,(function(t){t||(0,l.Z)(!1);var n,r,s=e.props.location||t.location;return i.Children.forEach(e.props.children,(function(e){if(null==r&&i.isValidElement(e)){n=e;var o=e.props.path||e.props.from;r=o?x(s.pathname,(0,c.Z)({},e.props,{path:o})):t.match}})),r?i.cloneElement(n,{location:s,computedMatch:r}):null}))},t}(i.Component);var N=i.useContext;function I(){return N(y)}function L(){return N(b).location}},72408:(e,t,n)=>{"use strict";var r=n(27418),i=60103,s=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var o=60109,a=60110,l=60112;t.Suspense=60113;var c=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;i=d("react.element"),s=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),o=d("react.provider"),a=d("react.context"),l=d("react.forward_ref"),t.Suspense=d("react.suspense"),c=d("react.memo"),u=d("react.lazy")}var h="function"==typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g={};function m(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}function y(){}function b(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=m.prototype;var v=b.prototype=new y;v.constructor=b,r(v,m.prototype),v.isPureReactComponent=!0;var E={current:null},_=Object.prototype.hasOwnProperty,T={key:!0,ref:!0,__self:!0,__source:!0};function x(e,t,n){var r,s={},o=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(o=""+t.key),t)_.call(t,r)&&!T.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(1===l)s.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===s[r]&&(s[r]=l[r]);return{$$typeof:i,type:e,key:o,ref:a,props:s,_owner:E.current}}function w(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var S=/\/+/g;function R(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function k(e,t,n,r,o){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var l=!1;if(null===e)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case i:case s:l=!0}}if(l)return o=o(l=e),e=""===r?"."+R(l,0):r,Array.isArray(o)?(n="",null!=e&&(n=e.replace(S,"$&/")+"/"),k(o,t,n,"",(function(e){return e}))):null!=o&&(w(o)&&(o=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(S,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c<e.length;c++){var u=r+R(a=e[c],c);l+=k(a,t,n,u,o)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=h&&e[h]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(a=e.next()).done;)l+=k(a=a.value,t,n,u=r+R(a,c++),o);else if("object"===a)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return l}function C(e,t,n){if(null==e)return e;var r=[],i=0;return k(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function O(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var A={current:null};function N(){var e=A.current;if(null===e)throw Error(p(321));return e}var I={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:E,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:C,forEach:function(e,t,n){C(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return C(e,(function(){t++})),t},toArray:function(e){return C(e,(function(e){return e}))||[]},only:function(e){if(!w(e))throw Error(p(143));return e}},t.Component=m,t.PureComponent=b,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,t.cloneElement=function(e,t,n){if(null==e)throw Error(p(267,e));var s=r({},e.props),o=e.key,a=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,l=E.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(u in t)_.call(t,u)&&!T.hasOwnProperty(u)&&(s[u]=void 0===t[u]&&void 0!==c?c[u]:t[u])}var u=arguments.length-2;if(1===u)s.children=n;else if(1<u){c=Array(u);for(var d=0;d<u;d++)c[d]=arguments[d+2];s.children=c}return{$$typeof:i,type:e.type,key:o,ref:a,props:s,_owner:l}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:a,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=x,t.createFactory=function(e){var t=x.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=w,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:O}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return N().useCallback(e,t)},t.useContext=function(e,t){return N().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return N().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return N().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return N().useLayoutEffect(e,t)},t.useMemo=function(e,t){return N().useMemo(e,t)},t.useReducer=function(e,t,n){return N().useReducer(e,t,n)},t.useRef=function(e){return N().useRef(e)},t.useState=function(e){return N().useState(e)},t.version="17.0.2"},67294:(e,t,n)=>{"use strict";e.exports=n(72408)},60053:(e,t)=>{"use strict";var n,r,i,s;if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,u=null,d=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(n){throw setTimeout(d,0),n}};n=function(e){null!==c?setTimeout(n,0,e):(c=e,setTimeout(d,0))},r=function(e,t){u=setTimeout(e,t)},i=function(){clearTimeout(u)},t.unstable_shouldYield=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var h=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var f=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof f&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var g=!1,m=null,y=-1,b=5,v=0;t.unstable_shouldYield=function(){return t.unstable_now()>=v},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<e?Math.floor(1e3/e):5};var E=new MessageChannel,_=E.port2;E.port1.onmessage=function(){if(null!==m){var e=t.unstable_now();v=e+b;try{m(!0,e)?_.postMessage(null):(g=!1,m=null)}catch(n){throw _.postMessage(null),n}}else g=!1},n=function(e){m=e,g||(g=!0,_.postMessage(null))},r=function(e,n){y=h((function(){e(t.unstable_now())}),n)},i=function(){p(y),y=-1}}function T(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<S(i,t)))break e;e[r]=t,e[n]=i,n=r}}function x(e){return void 0===(e=e[0])?null:e}function w(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length;r<i;){var s=2*(r+1)-1,o=e[s],a=s+1,l=e[a];if(void 0!==o&&0>S(o,n))void 0!==l&&0>S(l,o)?(e[r]=l,e[a]=n,r=a):(e[r]=o,e[s]=n,r=s);else{if(!(void 0!==l&&0>S(l,n)))break e;e[r]=l,e[a]=n,r=a}}}return t}return null}function S(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var R=[],k=[],C=1,O=null,A=3,N=!1,I=!1,L=!1;function D(e){for(var t=x(k);null!==t;){if(null===t.callback)w(k);else{if(!(t.startTime<=e))break;w(k),t.sortIndex=t.expirationTime,T(R,t)}t=x(k)}}function P(e){if(L=!1,D(e),!I)if(null!==x(R))I=!0,n(M);else{var t=x(k);null!==t&&r(P,t.startTime-e)}}function M(e,n){I=!1,L&&(L=!1,i()),N=!0;var s=A;try{for(D(n),O=x(R);null!==O&&(!(O.expirationTime>n)||e&&!t.unstable_shouldYield());){var o=O.callback;if("function"==typeof o){O.callback=null,A=O.priorityLevel;var a=o(O.expirationTime<=n);n=t.unstable_now(),"function"==typeof a?O.callback=a:O===x(R)&&w(R),D(n)}else w(R);O=x(R)}if(null!==O)var l=!0;else{var c=x(k);null!==c&&r(P,c.startTime-n),l=!1}return l}finally{O=null,A=s,N=!1}}var F=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){I||N||(I=!0,n(M))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return x(R)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var n=A;A=t;try{return e()}finally{A=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=F,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=A;A=e;try{return t()}finally{A=n}},t.unstable_scheduleCallback=function(e,s,o){var a=t.unstable_now();switch("object"==typeof o&&null!==o?o="number"==typeof(o=o.delay)&&0<o?a+o:a:o=a,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return e={id:C++,callback:s,priorityLevel:e,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>a?(e.sortIndex=o,T(k,e),null===x(R)&&e===x(k)&&(L?i():L=!0,r(P,o-a))):(e.sortIndex=l,T(R,e),I||N||(I=!0,n(M))),e},t.unstable_wrapCallback=function(e){var t=A;return function(){var n=A;A=t;try{return e.apply(this,arguments)}finally{A=n}}}},63840:(e,t,n)=>{"use strict";e.exports=n(60053)},96774:e=>{e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l<s.length;l++){var c=s[l];if(!a(c))return!1;var u=e[c],d=t[c];if(!1===(i=n?n.call(r,u,d,c):void 0)||void 0===i&&u!==d)return!1}return!0}},53250:(e,t,n)=>{"use strict";var r=n(67294);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useState,o=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(r){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=s({inst:{value:n,getSnapshot:t}}),i=r[0].inst,u=r[1];return a((function(){i.value=n,i.getSnapshot=t,c(i)&&u({inst:i})}),[e,n,t]),o((function(){return c(i)&&u({inst:i}),e((function(){c(i)&&u({inst:i})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},61688:(e,t,n)=>{"use strict";e.exports=n(53250)},92529:(e,t)=>{(()=>{var e={92:()=>{}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,r),s.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{"use strict";r.r(i),r.d(i,{ATN:()=>Z,ATNDeserializer:()=>Ce,BailErrorStrategy:()=>xt,CharStream:()=>Rt,CharStreams:()=>At,CommonToken:()=>Le,CommonTokenStream:()=>Dt,DFA:()=>lt,DiagnosticErrorListener:()=>vt,ErrorListener:()=>Oe,FailedPredicateException:()=>yt,InputStream:()=>Rt,Interval:()=>v,IntervalSet:()=>E,LL1Analyzer:()=>Y,Lexer:()=>Ue,LexerATNSimulator:()=>qe,NoViableAltException:()=>tt,ParseTreeListener:()=>ht,ParseTreeVisitor:()=>pt,ParseTreeWalker:()=>ft,Parser:()=>Mt,ParserATNSimulator:()=>rt,ParserRuleContext:()=>jt,PredictionContextCache:()=>it,PredictionMode:()=>et,RecognitionException:()=>Me,RuleContext:()=>F,RuleNode:()=>I,TerminalNode:()=>L,Token:()=>e,arrayToString:()=>u,default:()=>Gt});class e{constructor(){this.source=null,this.type=null,this.channel=null,this.start=null,this.stop=null,this.tokenIndex=null,this.line=null,this.column=null,this._text=null}getTokenSource(){return this.source[0]}getInputStream(){return this.source[1]}get text(){return this._text}set text(e){this._text=e}}function t(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!(e[n]===t[n]||e[n].equals&&e[n].equals(t[n])))return!1;return!0}e.INVALID_TYPE=0,e.EPSILON=-2,e.MIN_USER_TOKEN_TYPE=1,e.EOF=-1,e.DEFAULT_CHANNEL=0,e.HIDDEN_CHANNEL=1;const n=Math.round(Math.random()*Math.pow(2,32));function s(e){if(!e)return 0;const t=typeof e,r="string"===t?e:!("object"!==t||!e.toString)&&e.toString();if(!r)return 0;let i,s;const o=3&r.length,a=r.length-o;let l=n;const c=3432918353,u=461845907;let d=0;for(;d<a;)s=255&r.charCodeAt(d)|(255&r.charCodeAt(++d))<<8|(255&r.charCodeAt(++d))<<16|(255&r.charCodeAt(++d))<<24,++d,s=(65535&s)*c+(((s>>>16)*c&65535)<<16)&4294967295,s=s<<15|s>>>17,s=(65535&s)*u+(((s>>>16)*u&65535)<<16)&4294967295,l^=s,l=l<<13|l>>>19,i=5*(65535&l)+((5*(l>>>16)&65535)<<16)&4294967295,l=27492+(65535&i)+((58964+(i>>>16)&65535)<<16);switch(s=0,o){case 3:s^=(255&r.charCodeAt(d+2))<<16;case 2:s^=(255&r.charCodeAt(d+1))<<8;case 1:s^=255&r.charCodeAt(d),s=(65535&s)*c+(((s>>>16)*c&65535)<<16)&4294967295,s=s<<15|s>>>17,s=(65535&s)*u+(((s>>>16)*u&65535)<<16)&4294967295,l^=s}return l^=r.length,l^=l>>>16,l=2246822507*(65535&l)+((2246822507*(l>>>16)&65535)<<16)&4294967295,l^=l>>>13,l=3266489909*(65535&l)+((3266489909*(l>>>16)&65535)<<16)&4294967295,l^=l>>>16,l>>>0}class o{constructor(){this.count=0,this.hash=0}update(){for(let e=0;e<arguments.length;e++){const t=arguments[e];if(null!=t)if(Array.isArray(t))this.update.apply(this,t);else{let e=0;switch(typeof t){case"undefined":case"function":continue;case"number":case"boolean":e=t;break;case"string":e=s(t);break;default:t.updateHashCode?t.updateHashCode(this):console.log("No updateHashCode for "+t.toString());continue}e*=3432918353,e=e<<15|e>>>17,e*=461845907,this.count=this.count+1;let n=this.hash^e;n=n<<13|n>>>19,n=5*n+3864292196,this.hash=n}}}finish(){let e=this.hash^4*this.count;return e^=e>>>16,e*=2246822507,e^=e>>>13,e*=3266489909,e^=e>>>16,e}static hashStuff(){const e=new o;return e.update.apply(e,arguments),e.finish()}}function a(e){return e?"string"==typeof e?s(e):e.hashCode():-1}function l(e,t){return e?e.equals(t):e===t}function c(e){return null===e?"null":e}function u(e){return Array.isArray(e)?"["+e.map(c).join(", ")+"]":"null"}const d="h-";class h{constructor(e,t){this.data={},this.hashFunction=e||a,this.equalsFunction=t||l}add(e){const t=d+this.hashFunction(e);if(t in this.data){const n=this.data[t];for(let t=0;t<n.length;t++)if(this.equalsFunction(e,n[t]))return n[t];return n.push(e),e}return this.data[t]=[e],e}has(e){return null!=this.get(e)}get(e){const t=d+this.hashFunction(e);if(t in this.data){const n=this.data[t];for(let t=0;t<n.length;t++)if(this.equalsFunction(e,n[t]))return n[t]}return null}values(){return Object.keys(this.data).filter((e=>e.startsWith(d))).flatMap((e=>this.data[e]),this)}toString(){return u(this.values())}get length(){return Object.keys(this.data).filter((e=>e.startsWith(d))).map((e=>this.data[e].length),this).reduce(((e,t)=>e+t),0)}}class p{hashCode(){const e=new o;return this.updateHashCode(e),e.finish()}evaluate(e,t){}evalPrecedence(e,t){return this}static andContext(e,t){if(null===e||e===p.NONE)return t;if(null===t||t===p.NONE)return e;const n=new f(e,t);return 1===n.opnds.length?n.opnds[0]:n}static orContext(e,t){if(null===e)return t;if(null===t)return e;if(e===p.NONE||t===p.NONE)return p.NONE;const n=new g(e,t);return 1===n.opnds.length?n.opnds[0]:n}}class f extends p{constructor(e,t){super();const n=new h;e instanceof f?e.opnds.map((function(e){n.add(e)})):n.add(e),t instanceof f?t.opnds.map((function(e){n.add(e)})):n.add(t);const r=m(n);if(r.length>0){let e=null;r.map((function(t){(null===e||t.precedence<e.precedence)&&(e=t)})),n.add(e)}this.opnds=Array.from(n.values())}equals(e){return this===e||e instanceof f&&t(this.opnds,e.opnds)}updateHashCode(e){e.update(this.opnds,"AND")}evaluate(e,t){for(let n=0;n<this.opnds.length;n++)if(!this.opnds[n].evaluate(e,t))return!1;return!0}evalPrecedence(e,t){let n=!1;const r=[];for(let s=0;s<this.opnds.length;s++){const i=this.opnds[s],o=i.evalPrecedence(e,t);if(n|=o!==i,null===o)return null;o!==p.NONE&&r.push(o)}if(!n)return this;if(0===r.length)return p.NONE;let i=null;return r.map((function(e){i=null===i?e:p.andContext(i,e)})),i}toString(){const e=this.opnds.map((e=>e.toString()));return(e.length>3?e.slice(3):e).join("&&")}}class g extends p{constructor(e,t){super();const n=new h;e instanceof g?e.opnds.map((function(e){n.add(e)})):n.add(e),t instanceof g?t.opnds.map((function(e){n.add(e)})):n.add(t);const r=m(n);if(r.length>0){const e=r.sort((function(e,t){return e.compareTo(t)})),t=e[e.length-1];n.add(t)}this.opnds=Array.from(n.values())}equals(e){return this===e||e instanceof g&&t(this.opnds,e.opnds)}updateHashCode(e){e.update(this.opnds,"OR")}evaluate(e,t){for(let n=0;n<this.opnds.length;n++)if(this.opnds[n].evaluate(e,t))return!0;return!1}evalPrecedence(e,t){let n=!1;const r=[];for(let i=0;i<this.opnds.length;i++){const s=this.opnds[i],o=s.evalPrecedence(e,t);if(n|=o!==s,o===p.NONE)return p.NONE;null!==o&&r.push(o)}return n?(0===r.length||r.map((function(e){return e})),null):this}toString(){const e=this.opnds.map((e=>e.toString()));return(e.length>3?e.slice(3):e).join("||")}}function m(e){const t=[];return e.values().map((function(e){e instanceof p.PrecedencePredicate&&t.push(e)})),t}function y(e,t){if(null===e){const e={state:null,alt:null,context:null,semanticContext:null};return t&&(e.reachesIntoOuterContext=0),e}{const n={};return n.state=e.state||null,n.alt=void 0===e.alt?null:e.alt,n.context=e.context||null,n.semanticContext=e.semanticContext||null,t&&(n.reachesIntoOuterContext=e.reachesIntoOuterContext||0,n.precedenceFilterSuppressed=e.precedenceFilterSuppressed||!1),n}}class b{constructor(e,t){this.checkContext(e,t),e=y(e),t=y(t,!0),this.state=null!==e.state?e.state:t.state,this.alt=null!==e.alt?e.alt:t.alt,this.context=null!==e.context?e.context:t.context,this.semanticContext=null!==e.semanticContext?e.semanticContext:null!==t.semanticContext?t.semanticContext:p.NONE,this.reachesIntoOuterContext=t.reachesIntoOuterContext,this.precedenceFilterSuppressed=t.precedenceFilterSuppressed}checkContext(e,t){null!==e.context&&void 0!==e.context||null!==t&&null!==t.context&&void 0!==t.context||(this.context=null)}hashCode(){const e=new o;return this.updateHashCode(e),e.finish()}updateHashCode(e){e.update(this.state.stateNumber,this.alt,this.context,this.semanticContext)}equals(e){return this===e||e instanceof b&&this.state.stateNumber===e.state.stateNumber&&this.alt===e.alt&&(null===this.context?null===e.context:this.context.equals(e.context))&&this.semanticContext.equals(e.semanticContext)&&this.precedenceFilterSuppressed===e.precedenceFilterSuppressed}hashCodeForConfigSet(){const e=new o;return e.update(this.state.stateNumber,this.alt,this.semanticContext),e.finish()}equalsForConfigSet(e){return this===e||e instanceof b&&this.state.stateNumber===e.state.stateNumber&&this.alt===e.alt&&this.semanticContext.equals(e.semanticContext)}toString(){return"("+this.state+","+this.alt+(null!==this.context?",["+this.context.toString()+"]":"")+(this.semanticContext!==p.NONE?","+this.semanticContext.toString():"")+(this.reachesIntoOuterContext>0?",up="+this.reachesIntoOuterContext:"")+")"}}class v{constructor(e,t){this.start=e,this.stop=t}clone(){return new v(this.start,this.stop)}contains(e){return e>=this.start&&e<this.stop}toString(){return this.start===this.stop-1?this.start.toString():this.start.toString()+".."+(this.stop-1).toString()}get length(){return this.stop-this.start}}v.INVALID_INTERVAL=new v(-1,-2);class E{constructor(){this.intervals=null,this.readOnly=!1}first(t){return null===this.intervals||0===this.intervals.length?e.INVALID_TYPE:this.intervals[0].start}addOne(e){this.addInterval(new v(e,e+1))}addRange(e,t){this.addInterval(new v(e,t+1))}addInterval(e){if(null===this.intervals)this.intervals=[],this.intervals.push(e.clone());else{for(let t=0;t<this.intervals.length;t++){const n=this.intervals[t];if(e.stop<n.start)return void this.intervals.splice(t,0,e);if(e.stop===n.start)return void(this.intervals[t]=new v(e.start,n.stop));if(e.start<=n.stop)return this.intervals[t]=new v(Math.min(n.start,e.start),Math.max(n.stop,e.stop)),void this.reduce(t)}this.intervals.push(e.clone())}}addSet(e){return null!==e.intervals&&e.intervals.forEach((e=>this.addInterval(e)),this),this}reduce(e){if(e<this.intervals.length-1){const t=this.intervals[e],n=this.intervals[e+1];t.stop>=n.stop?(this.intervals.splice(e+1,1),this.reduce(e)):t.stop>=n.start&&(this.intervals[e]=new v(t.start,n.stop),this.intervals.splice(e+1,1))}}complement(e,t){const n=new E;return n.addInterval(new v(e,t+1)),null!==this.intervals&&this.intervals.forEach((e=>n.removeRange(e))),n}contains(e){if(null===this.intervals)return!1;for(let t=0;t<this.intervals.length;t++)if(this.intervals[t].contains(e))return!0;return!1}removeRange(e){if(e.start===e.stop-1)this.removeOne(e.start);else if(null!==this.intervals){let t=0;for(let n=0;n<this.intervals.length;n++){const n=this.intervals[t];if(e.stop<=n.start)return;if(e.start>n.start&&e.stop<n.stop){this.intervals[t]=new v(n.start,e.start);const r=new v(e.stop,n.stop);return void this.intervals.splice(t,0,r)}e.start<=n.start&&e.stop>=n.stop?(this.intervals.splice(t,1),t-=1):e.start<n.stop?this.intervals[t]=new v(n.start,e.start):e.stop<n.stop&&(this.intervals[t]=new v(e.stop,n.stop)),t+=1}}}removeOne(e){if(null!==this.intervals)for(let t=0;t<this.intervals.length;t++){const n=this.intervals[t];if(e<n.start)return;if(e===n.start&&e===n.stop-1)return void this.intervals.splice(t,1);if(e===n.start)return void(this.intervals[t]=new v(n.start+1,n.stop));if(e===n.stop-1)return void(this.intervals[t]=new v(n.start,n.stop-1));if(e<n.stop-1){const r=new v(n.start,e);return n.start=e+1,void this.intervals.splice(t,0,r)}}}toString(e,t,n){return e=e||null,t=t||null,n=n||!1,null===this.intervals?"{}":null!==e||null!==t?this.toTokenString(e,t):n?this.toCharString():this.toIndexString()}toCharString(){const t=[];for(let n=0;n<this.intervals.length;n++){const r=this.intervals[n];r.stop===r.start+1?r.start===e.EOF?t.push("<EOF>"):t.push("'"+String.fromCharCode(r.start)+"'"):t.push("'"+String.fromCharCode(r.start)+"'..'"+String.fromCharCode(r.stop-1)+"'")}return t.length>1?"{"+t.join(", ")+"}":t[0]}toIndexString(){const t=[];for(let n=0;n<this.intervals.length;n++){const r=this.intervals[n];r.stop===r.start+1?r.start===e.EOF?t.push("<EOF>"):t.push(r.start.toString()):t.push(r.start.toString()+".."+(r.stop-1).toString())}return t.length>1?"{"+t.join(", ")+"}":t[0]}toTokenString(e,t){const n=[];for(let r=0;r<this.intervals.length;r++){const i=this.intervals[r];for(let r=i.start;r<i.stop;r++)n.push(this.elementName(e,t,r))}return n.length>1?"{"+n.join(", ")+"}":n[0]}elementName(t,n,r){return r===e.EOF?"<EOF>":r===e.EPSILON?"<EPSILON>":t[r]||n[r]}get length(){return this.intervals.map((e=>e.length)).reduce(((e,t)=>e+t))}}class _{constructor(){this.atn=null,this.stateNumber=_.INVALID_STATE_NUMBER,this.stateType=null,this.ruleIndex=0,this.epsilonOnlyTransitions=!1,this.transitions=[],this.nextTokenWithinRule=null}toString(){return this.stateNumber}equals(e){return e instanceof _&&this.stateNumber===e.stateNumber}isNonGreedyExitState(){return!1}addTransition(e,t){void 0===t&&(t=-1),0===this.transitions.length?this.epsilonOnlyTransitions=e.isEpsilon:this.epsilonOnlyTransitions!==e.isEpsilon&&(this.epsilonOnlyTransitions=!1),-1===t?this.transitions.push(e):this.transitions.splice(t,1,e)}}_.INVALID_TYPE=0,_.BASIC=1,_.RULE_START=2,_.BLOCK_START=3,_.PLUS_BLOCK_START=4,_.STAR_BLOCK_START=5,_.TOKEN_START=6,_.RULE_STOP=7,_.BLOCK_END=8,_.STAR_LOOP_BACK=9,_.STAR_LOOP_ENTRY=10,_.PLUS_LOOP_BACK=11,_.LOOP_END=12,_.serializationNames=["INVALID","BASIC","RULE_START","BLOCK_START","PLUS_BLOCK_START","STAR_BLOCK_START","TOKEN_START","RULE_STOP","BLOCK_END","STAR_LOOP_BACK","STAR_LOOP_ENTRY","PLUS_LOOP_BACK","LOOP_END"],_.INVALID_STATE_NUMBER=-1;class T extends _{constructor(){return super(),this.stateType=_.RULE_STOP,this}}class x{constructor(e){if(null==e)throw"target cannot be null.";this.target=e,this.isEpsilon=!1,this.label=null}}x.EPSILON=1,x.RANGE=2,x.RULE=3,x.PREDICATE=4,x.ATOM=5,x.ACTION=6,x.SET=7,x.NOT_SET=8,x.WILDCARD=9,x.PRECEDENCE=10,x.serializationNames=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"],x.serializationTypes={EpsilonTransition:x.EPSILON,RangeTransition:x.RANGE,RuleTransition:x.RULE,PredicateTransition:x.PREDICATE,AtomTransition:x.ATOM,ActionTransition:x.ACTION,SetTransition:x.SET,NotSetTransition:x.NOT_SET,WildcardTransition:x.WILDCARD,PrecedencePredicateTransition:x.PRECEDENCE};class w extends x{constructor(e,t,n,r){super(e),this.ruleIndex=t,this.precedence=n,this.followState=r,this.serializationType=x.RULE,this.isEpsilon=!0}matches(e,t,n){return!1}}class S extends x{constructor(t,n){super(t),this.serializationType=x.SET,null!=n?this.label=n:(this.label=new E,this.label.addOne(e.INVALID_TYPE))}matches(e,t,n){return this.label.contains(e)}toString(){return this.label.toString()}}class R extends S{constructor(e,t){super(e,t),this.serializationType=x.NOT_SET}matches(e,t,n){return e>=t&&e<=n&&!super.matches(e,t,n)}toString(){return"~"+super.toString()}}class k extends x{constructor(e){super(e),this.serializationType=x.WILDCARD}matches(e,t,n){return e>=t&&e<=n}toString(){return"."}}class C extends x{constructor(e){super(e)}}class O{}class A extends O{}class N extends A{}class I extends N{get ruleContext(){throw new Error("missing interface implementation")}}class L extends N{}class D extends L{}const P={toStringTree:function(e,t,n){t=t||null,null!==(n=n||null)&&(t=n.ruleNames);let r=P.getNodeText(e,t);r=function(e,t){return e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r")}(r);const i=e.getChildCount();if(0===i)return r;let s="("+r+" ";i>0&&(r=P.toStringTree(e.getChild(0),t),s=s.concat(r));for(let o=1;o<i;o++)r=P.toStringTree(e.getChild(o),t),s=s.concat(" "+r);return s=s.concat(")"),s},getNodeText:function(t,n,r){if(n=n||null,null!==(r=r||null)&&(n=r.ruleNames),null!==n){if(t instanceof I){const e=t.ruleContext.getAltNumber();return 0!=e?n[t.ruleIndex]+":"+e:n[t.ruleIndex]}if(t instanceof D)return t.toString();if(t instanceof L&&null!==t.symbol)return t.symbol.text}const i=t.getPayload();return i instanceof e?i.text:t.getPayload().toString()},getChildren:function(e){const t=[];for(let n=0;n<e.getChildCount();n++)t.push(e.getChild(n));return t},getAncestors:function(e){let t=[];for(e=e.getParent();null!==e;)t=[e].concat(t),e=e.getParent();return t},findAllTokenNodes:function(e,t){return P.findAllNodes(e,t,!0)},findAllRuleNodes:function(e,t){return P.findAllNodes(e,t,!1)},findAllNodes:function(e,t,n){const r=[];return P._findAllNodes(e,t,n,r),r},_findAllNodes:function(e,t,n,r){n&&e instanceof L?e.symbol.type===t&&r.push(e):!n&&e instanceof I&&e.ruleIndex===t&&r.push(e);for(let i=0;i<e.getChildCount();i++)P._findAllNodes(e.getChild(i),t,n,r)},descendants:function(e){let t=[e];for(let n=0;n<e.getChildCount();n++)t=t.concat(P.descendants(e.getChild(n)));return t}},M=P;class F extends I{constructor(e,t){super(),this.parentCtx=e||null,this.invokingState=t||-1}depth(){let e=0,t=this;for(;null!==t;)t=t.parentCtx,e+=1;return e}isEmpty(){return-1===this.invokingState}getSourceInterval(){return v.INVALID_INTERVAL}get ruleContext(){return this}getPayload(){return this}getText(){return 0===this.getChildCount()?"":this.children.map((function(e){return e.getText()})).join("")}getAltNumber(){return 0}setAltNumber(e){}getChild(e){return null}getChildCount(){return 0}accept(e){return e.visitChildren(this)}toStringTree(e,t){return M.toStringTree(this,e,t)}toString(e,t){e=e||null,t=t||null;let n=this,r="[";for(;null!==n&&n!==t;){if(null===e)n.isEmpty()||(r+=n.invokingState);else{const t=n.ruleIndex;r+=t>=0&&t<e.length?e[t]:""+t}null===n.parentCtx||null===e&&n.parentCtx.isEmpty()||(r+=" "),n=n.parentCtx}return r+="]",r}}class U{constructor(e){this.cachedHashCode=e}isEmpty(){return this===U.EMPTY}hasEmptyPath(){return this.getReturnState(this.length-1)===U.EMPTY_RETURN_STATE}hashCode(){return this.cachedHashCode}updateHashCode(e){e.update(this.cachedHashCode)}}U.EMPTY=null,U.EMPTY_RETURN_STATE=2147483647,U.globalNodeCount=1,U.id=U.globalNodeCount,U.trace_atn_sim=!1;class j extends U{constructor(e,t){const n=new o;return n.update(e,t),super(n.finish()),this.parents=e,this.returnStates=t,this}isEmpty(){return this.returnStates[0]===U.EMPTY_RETURN_STATE}getParent(e){return this.parents[e]}getReturnState(e){return this.returnStates[e]}equals(e){return this===e||e instanceof j&&this.hashCode()===e.hashCode()&&t(this.returnStates,e.returnStates)&&t(this.parents,e.parents)}toString(){if(this.isEmpty())return"[]";{let e="[";for(let t=0;t<this.returnStates.length;t++)t>0&&(e+=", "),this.returnStates[t]!==U.EMPTY_RETURN_STATE?(e+=this.returnStates[t],null!==this.parents[t]?e=e+" "+this.parents[t]:e+="null"):e+="$";return e+"]"}}get length(){return this.returnStates.length}}class B extends U{constructor(e,t){let n=0;const r=new o;null!==e?r.update(e,t):r.update(1),n=r.finish(),super(n),this.parentCtx=e,this.returnState=t}getParent(e){return this.parentCtx}getReturnState(e){return this.returnState}equals(e){return this===e||e instanceof B&&this.hashCode()===e.hashCode()&&this.returnState===e.returnState&&(null==this.parentCtx?null==e.parentCtx:this.parentCtx.equals(e.parentCtx))}toString(){const e=null===this.parentCtx?"":this.parentCtx.toString();return 0===e.length?this.returnState===U.EMPTY_RETURN_STATE?"$":""+this.returnState:this.returnState+" "+e}get length(){return 1}static create(e,t){return t===U.EMPTY_RETURN_STATE&&null===e?U.EMPTY:new B(e,t)}}class H extends B{constructor(){super(null,U.EMPTY_RETURN_STATE)}isEmpty(){return!0}getParent(e){return null}getReturnState(e){return this.returnState}equals(e){return this===e}toString(){return"$"}}U.EMPTY=new H;const $="h-";class z{constructor(e,t){this.data={},this.hashFunction=e||a,this.equalsFunction=t||l}set(e,t){const n=$+this.hashFunction(e);if(n in this.data){const r=this.data[n];for(let n=0;n<r.length;n++){const i=r[n];if(this.equalsFunction(e,i.key)){const e=i.value;return i.value=t,e}}return r.push({key:e,value:t}),t}return this.data[n]=[{key:e,value:t}],t}containsKey(e){const t=$+this.hashFunction(e);if(t in this.data){const n=this.data[t];for(let t=0;t<n.length;t++){const r=n[t];if(this.equalsFunction(e,r.key))return!0}}return!1}get(e){const t=$+this.hashFunction(e);if(t in this.data){const n=this.data[t];for(let t=0;t<n.length;t++){const r=n[t];if(this.equalsFunction(e,r.key))return r.value}}return null}entries(){return Object.keys(this.data).filter((e=>e.startsWith($))).flatMap((e=>this.data[e]),this)}getKeys(){return this.entries().map((e=>e.key))}getValues(){return this.entries().map((e=>e.value))}toString(){return"["+this.entries().map((e=>"{"+e.key+":"+e.value+"}")).join(", ")+"]"}get length(){return Object.keys(this.data).filter((e=>e.startsWith($))).map((e=>this.data[e].length),this).reduce(((e,t)=>e+t),0)}}function V(e,t){if(null==t&&(t=F.EMPTY),null===t.parentCtx||t===F.EMPTY)return U.EMPTY;const n=V(e,t.parentCtx),r=e.states[t.invokingState].transitions[0];return B.create(n,r.followState.stateNumber)}function G(e,t,n){if(e.isEmpty())return e;let r=n.get(e)||null;if(null!==r)return r;if(r=t.get(e),null!==r)return n.set(e,r),r;let i=!1,s=[];for(let a=0;a<s.length;a++){const r=G(e.getParent(a),t,n);if(i||r!==e.getParent(a)){if(!i){s=[];for(let t=0;t<e.length;t++)s[t]=e.getParent(t);i=!0}s[a]=r}}if(!i)return t.add(e),n.set(e,e),e;let o=null;return o=0===s.length?U.EMPTY:1===s.length?B.create(s[0],e.getReturnState(0)):new j(s,e.returnStates),t.add(o),n.set(o,o),n.set(e,o),o}function W(e,t,n,r){if(e===t)return e;if(e instanceof B&&t instanceof B)return function(e,t,n,r){if(null!==r){let n=r.get(e,t);if(null!==n)return n;if(n=r.get(t,e),null!==n)return n}const i=function(e,t,n){if(n){if(e===U.EMPTY)return U.EMPTY;if(t===U.EMPTY)return U.EMPTY}else{if(e===U.EMPTY&&t===U.EMPTY)return U.EMPTY;if(e===U.EMPTY){const e=[t.returnState,U.EMPTY_RETURN_STATE],n=[t.parentCtx,null];return new j(n,e)}if(t===U.EMPTY){const t=[e.returnState,U.EMPTY_RETURN_STATE],n=[e.parentCtx,null];return new j(n,t)}}return null}(e,t,n);if(null!==i)return null!==r&&r.set(e,t,i),i;if(e.returnState===t.returnState){const i=W(e.parentCtx,t.parentCtx,n,r);if(i===e.parentCtx)return e;if(i===t.parentCtx)return t;const s=B.create(i,e.returnState);return null!==r&&r.set(e,t,s),s}{let n=null;if((e===t||null!==e.parentCtx&&e.parentCtx===t.parentCtx)&&(n=e.parentCtx),null!==n){const i=[e.returnState,t.returnState];e.returnState>t.returnState&&(i[0]=t.returnState,i[1]=e.returnState);const s=new j([n,n],i);return null!==r&&r.set(e,t,s),s}const i=[e.returnState,t.returnState];let s=[e.parentCtx,t.parentCtx];e.returnState>t.returnState&&(i[0]=t.returnState,i[1]=e.returnState,s=[t.parentCtx,e.parentCtx]);const o=new j(s,i);return null!==r&&r.set(e,t,o),o}}(e,t,n,r);if(n){if(e instanceof H)return e;if(t instanceof H)return t}return e instanceof B&&(e=new j([e.getParent()],[e.returnState])),t instanceof B&&(t=new j([t.getParent()],[t.returnState])),function(e,t,n,r){if(null!==r){let n=r.get(e,t);if(null!==n)return U.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> previous"),n;if(n=r.get(t,e),null!==n)return U.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> previous"),n}let i=0,s=0,o=0,a=new Array(e.returnStates.length+t.returnStates.length).fill(0),l=new Array(e.returnStates.length+t.returnStates.length).fill(null);for(;i<e.returnStates.length&&s<t.returnStates.length;){const c=e.parents[i],u=t.parents[s];if(e.returnStates[i]===t.returnStates[s]){const t=e.returnStates[i];t===U.EMPTY_RETURN_STATE&&null===c&&null===u||null!==c&&null!==u&&c===u?(l[o]=c,a[o]=t):(l[o]=W(c,u,n,r),a[o]=t),i+=1,s+=1}else e.returnStates[i]<t.returnStates[s]?(l[o]=c,a[o]=e.returnStates[i],i+=1):(l[o]=u,a[o]=t.returnStates[s],s+=1);o+=1}if(i<e.returnStates.length)for(let u=i;u<e.returnStates.length;u++)l[o]=e.parents[u],a[o]=e.returnStates[u],o+=1;else for(let u=s;u<t.returnStates.length;u++)l[o]=t.parents[u],a[o]=t.returnStates[u],o+=1;if(o<l.length){if(1===o){const n=B.create(l[0],a[0]);return null!==r&&r.set(e,t,n),n}l=l.slice(0,o),a=a.slice(0,o)}const c=new j(l,a);return c.equals(e)?(null!==r&&r.set(e,t,e),U.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> a"),e):c.equals(t)?(null!==r&&r.set(e,t,t),U.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> b"),t):(function(e){const t=new z;for(let n=0;n<e.length;n++){const r=e[n];t.containsKey(r)||t.set(r,r)}for(let n=0;n<e.length;n++)e[n]=t.get(e[n])}(l),null!==r&&r.set(e,t,c),U.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> "+c),c)}(e,t,n,r)}class K{constructor(){this.data=[]}add(e){this.data[e]=!0}or(e){Object.keys(e.data).map((e=>this.add(e)),this)}remove(e){delete this.data[e]}has(e){return!0===this.data[e]}values(){return Object.keys(this.data)}minValue(){return Math.min.apply(null,this.values())}hashCode(){return o.hashStuff(this.values())}equals(e){return e instanceof K&&t(this.data,e.data)}toString(){return"{"+this.values().join(", ")+"}"}get length(){return this.values().length}}class Y{constructor(e){this.atn=e}getDecisionLookahead(e){if(null===e)return null;const t=e.transitions.length,n=[];for(let r=0;r<t;r++){n[r]=new E;const t=new h,i=!1;this._LOOK(e.transition(r).target,null,U.EMPTY,n[r],t,new K,i,!1),(0===n[r].length||n[r].contains(Y.HIT_PRED))&&(n[r]=null)}return n}LOOK(e,t,n){const r=new E,i=null!==(n=n||null)?V(e.atn,n):null;return this._LOOK(e,t,i,r,new h,new K,!0,!0),r}_LOOK(t,n,r,i,s,o,a,l){const c=new b({state:t,alt:0,context:r},null);if(!s.has(c)){if(s.add(c),t===n){if(null===r)return void i.addOne(e.EPSILON);if(r.isEmpty()&&l)return void i.addOne(e.EOF)}if(t instanceof T){if(null===r)return void i.addOne(e.EPSILON);if(r.isEmpty()&&l)return void i.addOne(e.EOF);if(r!==U.EMPTY){const e=o.has(t.ruleIndex);try{o.remove(t.ruleIndex);for(let e=0;e<r.length;e++){const t=this.atn.states[r.getReturnState(e)];this._LOOK(t,n,r.getParent(e),i,s,o,a,l)}}finally{e&&o.add(t.ruleIndex)}return}}for(let c=0;c<t.transitions.length;c++){const u=t.transitions[c];if(u.constructor===w){if(o.has(u.target.ruleIndex))continue;const e=B.create(r,u.followState.stateNumber);try{o.add(u.target.ruleIndex),this._LOOK(u.target,n,e,i,s,o,a,l)}finally{o.remove(u.target.ruleIndex)}}else if(u instanceof C)a?this._LOOK(u.target,n,r,i,s,o,a,l):i.addOne(Y.HIT_PRED);else if(u.isEpsilon)this._LOOK(u.target,n,r,i,s,o,a,l);else if(u.constructor===k)i.addRange(e.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType);else{let t=u.label;null!==t&&(u instanceof R&&(t=t.complement(e.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType)),i.addSet(t))}}}}}Y.HIT_PRED=e.INVALID_TYPE;class Z{constructor(e,t){this.grammarType=e,this.maxTokenType=t,this.states=[],this.decisionToState=[],this.ruleToStartState=[],this.ruleToStopState=null,this.modeNameToStartState={},this.ruleToTokenType=null,this.lexerActions=null,this.modeToStartState=[]}nextTokensInContext(e,t){return new Y(this).LOOK(e,null,t)}nextTokensNoContext(e){return null!==e.nextTokenWithinRule||(e.nextTokenWithinRule=this.nextTokensInContext(e,null),e.nextTokenWithinRule.readOnly=!0),e.nextTokenWithinRule}nextTokens(e,t){return void 0===t?this.nextTokensNoContext(e):this.nextTokensInContext(e,t)}addState(e){null!==e&&(e.atn=this,e.stateNumber=this.states.length),this.states.push(e)}removeState(e){this.states[e.stateNumber]=null}defineDecisionState(e){return this.decisionToState.push(e),e.decision=this.decisionToState.length-1,e.decision}getDecisionState(e){return 0===this.decisionToState.length?null:this.decisionToState[e]}getExpectedTokens(t,n){if(t<0||t>=this.states.length)throw"Invalid state number.";const r=this.states[t];let i=this.nextTokens(r);if(!i.contains(e.EPSILON))return i;const s=new E;for(s.addSet(i),s.removeOne(e.EPSILON);null!==n&&n.invokingState>=0&&i.contains(e.EPSILON);){const t=this.states[n.invokingState].transitions[0];i=this.nextTokens(t.followState),s.addSet(i),s.removeOne(e.EPSILON),n=n.parentCtx}return i.contains(e.EPSILON)&&s.addOne(e.EOF),s}}Z.INVALID_ALT_NUMBER=0;class q extends _{constructor(){super(),this.stateType=_.BASIC}}class Q extends _{constructor(){return super(),this.decision=-1,this.nonGreedy=!1,this}}class X extends Q{constructor(){return super(),this.endState=null,this}}class J extends _{constructor(){return super(),this.stateType=_.BLOCK_END,this.startState=null,this}}class ee extends _{constructor(){return super(),this.stateType=_.LOOP_END,this.loopBackState=null,this}}class te extends _{constructor(){return super(),this.stateType=_.RULE_START,this.stopState=null,this.isPrecedenceRule=!1,this}}class ne extends Q{constructor(){return super(),this.stateType=_.TOKEN_START,this}}class re extends Q{constructor(){return super(),this.stateType=_.PLUS_LOOP_BACK,this}}class ie extends _{constructor(){return super(),this.stateType=_.STAR_LOOP_BACK,this}}class se extends Q{constructor(){return super(),this.stateType=_.STAR_LOOP_ENTRY,this.loopBackState=null,this.isPrecedenceDecision=null,this}}class oe extends X{constructor(){return super(),this.stateType=_.PLUS_BLOCK_START,this.loopBackState=null,this}}class ae extends X{constructor(){return super(),this.stateType=_.STAR_BLOCK_START,this}}class le extends X{constructor(){return super(),this.stateType=_.BLOCK_START,this}}class ce extends x{constructor(e,t){super(e),this.label_=t,this.label=this.makeLabel(),this.serializationType=x.ATOM}makeLabel(){const e=new E;return e.addOne(this.label_),e}matches(e,t,n){return this.label_===e}toString(){return this.label_}}class ue extends x{constructor(e,t,n){super(e),this.serializationType=x.RANGE,this.start=t,this.stop=n,this.label=this.makeLabel()}makeLabel(){const e=new E;return e.addRange(this.start,this.stop),e}matches(e,t,n){return e>=this.start&&e<=this.stop}toString(){return"'"+String.fromCharCode(this.start)+"'..'"+String.fromCharCode(this.stop)+"'"}}class de extends x{constructor(e,t,n,r){super(e),this.serializationType=x.ACTION,this.ruleIndex=t,this.actionIndex=void 0===n?-1:n,this.isCtxDependent=void 0!==r&&r,this.isEpsilon=!0}matches(e,t,n){return!1}toString(){return"action_"+this.ruleIndex+":"+this.actionIndex}}class he extends x{constructor(e,t){super(e),this.serializationType=x.EPSILON,this.isEpsilon=!0,this.outermostPrecedenceReturn=t}matches(e,t,n){return!1}toString(){return"epsilon"}}class pe extends p{constructor(e,t,n){super(),this.ruleIndex=void 0===e?-1:e,this.predIndex=void 0===t?-1:t,this.isCtxDependent=void 0!==n&&n}evaluate(e,t){const n=this.isCtxDependent?t:null;return e.sempred(n,this.ruleIndex,this.predIndex)}updateHashCode(e){e.update(this.ruleIndex,this.predIndex,this.isCtxDependent)}equals(e){return this===e||e instanceof pe&&this.ruleIndex===e.ruleIndex&&this.predIndex===e.predIndex&&this.isCtxDependent===e.isCtxDependent}toString(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"}}p.NONE=new pe;class fe extends C{constructor(e,t,n,r){super(e),this.serializationType=x.PREDICATE,this.ruleIndex=t,this.predIndex=n,this.isCtxDependent=r,this.isEpsilon=!0}matches(e,t,n){return!1}getPredicate(){return new pe(this.ruleIndex,this.predIndex,this.isCtxDependent)}toString(){return"pred_"+this.ruleIndex+":"+this.predIndex}}class ge extends p{constructor(e){super(),this.precedence=void 0===e?0:e}evaluate(e,t){return e.precpred(t,this.precedence)}evalPrecedence(e,t){return e.precpred(t,this.precedence)?p.NONE:null}compareTo(e){return this.precedence-e.precedence}updateHashCode(e){e.update(this.precedence)}equals(e){return this===e||e instanceof ge&&this.precedence===e.precedence}toString(){return"{"+this.precedence+">=prec}?"}}p.PrecedencePredicate=ge;class me extends C{constructor(e,t){super(e),this.serializationType=x.PRECEDENCE,this.precedence=t,this.isEpsilon=!0}matches(e,t,n){return!1}getPredicate(){return new ge(this.precedence)}toString(){return this.precedence+" >= _p"}}class ye{constructor(e){void 0===e&&(e=null),this.readOnly=!1,this.verifyATN=null===e||e.verifyATN,this.generateRuleBypassTransitions=null!==e&&e.generateRuleBypassTransitions}}ye.defaultOptions=new ye,ye.defaultOptions.readOnly=!0;class be{constructor(e){this.actionType=e,this.isPositionDependent=!1}hashCode(){const e=new o;return this.updateHashCode(e),e.finish()}updateHashCode(e){e.update(this.actionType)}equals(e){return this===e}}class ve extends be{constructor(){super(6)}execute(e){e.skip()}toString(){return"skip"}}ve.INSTANCE=new ve;class Ee extends be{constructor(e){super(0),this.channel=e}execute(e){e._channel=this.channel}updateHashCode(e){e.update(this.actionType,this.channel)}equals(e){return this===e||e instanceof Ee&&this.channel===e.channel}toString(){return"channel("+this.channel+")"}}class _e extends be{constructor(e,t){super(1),this.ruleIndex=e,this.actionIndex=t,this.isPositionDependent=!0}execute(e){e.action(null,this.ruleIndex,this.actionIndex)}updateHashCode(e){e.update(this.actionType,this.ruleIndex,this.actionIndex)}equals(e){return this===e||e instanceof _e&&this.ruleIndex===e.ruleIndex&&this.actionIndex===e.actionIndex}}class Te extends be{constructor(){super(3)}execute(e){e.more()}toString(){return"more"}}Te.INSTANCE=new Te;class xe extends be{constructor(e){super(7),this.type=e}execute(e){e.type=this.type}updateHashCode(e){e.update(this.actionType,this.type)}equals(e){return this===e||e instanceof xe&&this.type===e.type}toString(){return"type("+this.type+")"}}class we extends be{constructor(e){super(5),this.mode=e}execute(e){e.pushMode(this.mode)}updateHashCode(e){e.update(this.actionType,this.mode)}equals(e){return this===e||e instanceof we&&this.mode===e.mode}toString(){return"pushMode("+this.mode+")"}}class Se extends be{constructor(){super(4)}execute(e){e.popMode()}toString(){return"popMode"}}Se.INSTANCE=new Se;class Re extends be{constructor(e){super(2),this.mode=e}execute(e){e.mode(this.mode)}updateHashCode(e){e.update(this.actionType,this.mode)}equals(e){return this===e||e instanceof Re&&this.mode===e.mode}toString(){return"mode("+this.mode+")"}}function ke(e,t){const n=[];return n[e-1]=t,n.map((function(e){return t}))}class Ce{constructor(e){null==e&&(e=ye.defaultOptions),this.deserializationOptions=e,this.stateFactories=null,this.actionFactories=null}deserialize(e){const t=this.reset(e);this.checkVersion(t),t&&this.skipUUID();const n=this.readATN();this.readStates(n,t),this.readRules(n,t),this.readModes(n);const r=[];return this.readSets(n,r,this.readInt.bind(this)),t&&this.readSets(n,r,this.readInt32.bind(this)),this.readEdges(n,r),this.readDecisions(n),this.readLexerActions(n,t),this.markPrecedenceDecisions(n),this.verifyATN(n),this.deserializationOptions.generateRuleBypassTransitions&&1===n.grammarType&&(this.generateRuleBypassTransitions(n),this.verifyATN(n)),n}reset(e){if(3===(e.charCodeAt?e.charCodeAt(0):e[0])){const t=function(e){const t=e.charCodeAt(0);return t>1?t-2:t+65534},n=e.split("").map(t);return n[0]=e.charCodeAt(0),this.data=n,this.pos=0,!0}return this.data=e,this.pos=0,!1}skipUUID(){let e=0;for(;e++<8;)this.readInt()}checkVersion(e){const t=this.readInt();if(!e&&4!==t)throw"Could not deserialize ATN with version "+t+" (expected 4)."}readATN(){const e=this.readInt(),t=this.readInt();return new Z(e,t)}readStates(e,t){let n,r,i;const s=[],o=[],a=this.readInt();for(let u=0;u<a;u++){const n=this.readInt();if(n===_.INVALID_TYPE){e.addState(null);continue}let r=this.readInt();t&&65535===r&&(r=-1);const i=this.stateFactory(n,r);if(n===_.LOOP_END){const e=this.readInt();s.push([i,e])}else if(i instanceof X){const e=this.readInt();o.push([i,e])}e.addState(i)}for(n=0;n<s.length;n++)r=s[n],r[0].loopBackState=e.states[r[1]];for(n=0;n<o.length;n++)r=o[n],r[0].endState=e.states[r[1]];let l=this.readInt();for(n=0;n<l;n++)i=this.readInt(),e.states[i].nonGreedy=!0;let c=this.readInt();for(n=0;n<c;n++)i=this.readInt(),e.states[i].isPrecedenceRule=!0}readRules(t,n){let r;const i=this.readInt();for(0===t.grammarType&&(t.ruleToTokenType=ke(i,0)),t.ruleToStartState=ke(i,0),r=0;r<i;r++){const i=this.readInt();if(t.ruleToStartState[r]=t.states[i],0===t.grammarType){let i=this.readInt();n&&65535===i&&(i=e.EOF),t.ruleToTokenType[r]=i}}for(t.ruleToStopState=ke(i,0),r=0;r<t.states.length;r++){const e=t.states[r];e instanceof T&&(t.ruleToStopState[e.ruleIndex]=e,t.ruleToStartState[e.ruleIndex].stopState=e)}}readModes(e){const t=this.readInt();for(let n=0;n<t;n++){let t=this.readInt();e.modeToStartState.push(e.states[t])}}readSets(e,t,n){const r=this.readInt();for(let i=0;i<r;i++){const e=new E;t.push(e);const r=this.readInt();0!==this.readInt()&&e.addOne(-1);for(let t=0;t<r;t++){const t=n(),r=n();e.addRange(t,r)}}}readEdges(e,t){let n,r,i,s,o;const a=this.readInt();for(n=0;n<a;n++){const n=this.readInt(),r=this.readInt(),i=this.readInt(),o=this.readInt(),a=this.readInt(),l=this.readInt();s=this.edgeFactory(e,i,n,r,o,a,l,t),e.states[n].addTransition(s)}for(n=0;n<e.states.length;n++)for(i=e.states[n],r=0;r<i.transitions.length;r++){const t=i.transitions[r];if(!(t instanceof w))continue;let n=-1;e.ruleToStartState[t.target.ruleIndex].isPrecedenceRule&&0===t.precedence&&(n=t.target.ruleIndex),s=new he(t.followState,n),e.ruleToStopState[t.target.ruleIndex].addTransition(s)}for(n=0;n<e.states.length;n++){if(i=e.states[n],i instanceof X){if(null===i.endState)throw"IllegalState";if(null!==i.endState.startState)throw"IllegalState";i.endState.startState=i}if(i instanceof re)for(r=0;r<i.transitions.length;r++)o=i.transitions[r].target,o instanceof oe&&(o.loopBackState=i);else if(i instanceof ie)for(r=0;r<i.transitions.length;r++)o=i.transitions[r].target,o instanceof se&&(o.loopBackState=i)}}readDecisions(e){const t=this.readInt();for(let n=0;n<t;n++){const t=this.readInt(),r=e.states[t];e.decisionToState.push(r),r.decision=n}}readLexerActions(e,t){if(0===e.grammarType){const n=this.readInt();e.lexerActions=ke(n,null);for(let r=0;r<n;r++){const n=this.readInt();let i=this.readInt();t&&65535===i&&(i=-1);let s=this.readInt();t&&65535===s&&(s=-1),e.lexerActions[r]=this.lexerActionFactory(n,i,s)}}}generateRuleBypassTransitions(e){let t;const n=e.ruleToStartState.length;for(t=0;t<n;t++)e.ruleToTokenType[t]=e.maxTokenType+t+1;for(t=0;t<n;t++)this.generateRuleBypassTransition(e,t)}generateRuleBypassTransition(e,t){let n,r;const i=new le;i.ruleIndex=t,e.addState(i);const s=new J;s.ruleIndex=t,e.addState(s),i.endState=s,e.defineDecisionState(i),s.startState=i;let o=null,a=null;if(e.ruleToStartState[t].isPrecedenceRule){for(a=null,n=0;n<e.states.length;n++)if(r=e.states[n],this.stateIsEndStateFor(r,t)){a=r,o=r.loopBackState.transitions[0];break}if(null===o)throw"Couldn't identify final state of the precedence rule prefix section."}else a=e.ruleToStopState[t];for(n=0;n<e.states.length;n++){r=e.states[n];for(let e=0;e<r.transitions.length;e++){const t=r.transitions[e];t!==o&&t.target===a&&(t.target=s)}}const l=e.ruleToStartState[t],c=l.transitions.length;for(;c>0;)i.addTransition(l.transitions[c-1]),l.transitions=l.transitions.slice(-1);e.ruleToStartState[t].addTransition(new he(i)),s.addTransition(new he(a));const u=new q;e.addState(u),u.addTransition(new ce(s,e.ruleToTokenType[t])),i.addTransition(new he(u))}stateIsEndStateFor(e,t){if(e.ruleIndex!==t)return null;if(!(e instanceof se))return null;const n=e.transitions[e.transitions.length-1].target;return n instanceof ee&&n.epsilonOnlyTransitions&&n.transitions[0].target instanceof T?e:null}markPrecedenceDecisions(e){for(let t=0;t<e.states.length;t++){const n=e.states[t];if(n instanceof se&&e.ruleToStartState[n.ruleIndex].isPrecedenceRule){const e=n.transitions[n.transitions.length-1].target;e instanceof ee&&e.epsilonOnlyTransitions&&e.transitions[0].target instanceof T&&(n.isPrecedenceDecision=!0)}}}verifyATN(e){if(this.deserializationOptions.verifyATN)for(let t=0;t<e.states.length;t++){const n=e.states[t];if(null!==n)if(this.checkCondition(n.epsilonOnlyTransitions||n.transitions.length<=1),n instanceof oe)this.checkCondition(null!==n.loopBackState);else if(n instanceof se)if(this.checkCondition(null!==n.loopBackState),this.checkCondition(2===n.transitions.length),n.transitions[0].target instanceof ae)this.checkCondition(n.transitions[1].target instanceof ee),this.checkCondition(!n.nonGreedy);else{if(!(n.transitions[0].target instanceof ee))throw"IllegalState";this.checkCondition(n.transitions[1].target instanceof ae),this.checkCondition(n.nonGreedy)}else n instanceof ie?(this.checkCondition(1===n.transitions.length),this.checkCondition(n.transitions[0].target instanceof se)):n instanceof ee?this.checkCondition(null!==n.loopBackState):n instanceof te?this.checkCondition(null!==n.stopState):n instanceof X?this.checkCondition(null!==n.endState):n instanceof J?this.checkCondition(null!==n.startState):n instanceof Q?this.checkCondition(n.transitions.length<=1||n.decision>=0):this.checkCondition(n.transitions.length<=1||n instanceof T)}}checkCondition(e,t){if(!e)throw null==t&&(t="IllegalState"),t}readInt(){return this.data[this.pos++]}readInt32(){return this.readInt()|this.readInt()<<16}edgeFactory(t,n,r,i,s,o,a,l){const c=t.states[i];switch(n){case x.EPSILON:return new he(c);case x.RANGE:return new ue(c,0!==a?e.EOF:s,o);case x.RULE:return new w(t.states[s],o,a,c);case x.PREDICATE:return new fe(c,s,o,0!==a);case x.PRECEDENCE:return new me(c,s);case x.ATOM:return new ce(c,0!==a?e.EOF:s);case x.ACTION:return new de(c,s,o,0!==a);case x.SET:return new S(c,l[s]);case x.NOT_SET:return new R(c,l[s]);case x.WILDCARD:return new k(c);default:throw"The specified transition type: "+n+" is not valid."}}stateFactory(e,t){if(null===this.stateFactories){const e=[];e[_.INVALID_TYPE]=null,e[_.BASIC]=()=>new q,e[_.RULE_START]=()=>new te,e[_.BLOCK_START]=()=>new le,e[_.PLUS_BLOCK_START]=()=>new oe,e[_.STAR_BLOCK_START]=()=>new ae,e[_.TOKEN_START]=()=>new ne,e[_.RULE_STOP]=()=>new T,e[_.BLOCK_END]=()=>new J,e[_.STAR_LOOP_BACK]=()=>new ie,e[_.STAR_LOOP_ENTRY]=()=>new se,e[_.PLUS_LOOP_BACK]=()=>new re,e[_.LOOP_END]=()=>new ee,this.stateFactories=e}if(e>this.stateFactories.length||null===this.stateFactories[e])throw"The specified state type "+e+" is not valid.";{const n=this.stateFactories[e]();if(null!==n)return n.ruleIndex=t,n}}lexerActionFactory(e,t,n){if(null===this.actionFactories){const e=[];e[0]=(e,t)=>new Ee(e),e[1]=(e,t)=>new _e(e,t),e[2]=(e,t)=>new Re(e),e[3]=(e,t)=>Te.INSTANCE,e[4]=(e,t)=>Se.INSTANCE,e[5]=(e,t)=>new we(e),e[6]=(e,t)=>ve.INSTANCE,e[7]=(e,t)=>new xe(e),this.actionFactories=e}if(e>this.actionFactories.length||null===this.actionFactories[e])throw"The specified lexer action type "+e+" is not valid.";return this.actionFactories[e](t,n)}}class Oe{syntaxError(e,t,n,r,i,s){}reportAmbiguity(e,t,n,r,i,s,o){}reportAttemptingFullContext(e,t,n,r,i,s){}reportContextSensitivity(e,t,n,r,i,s){}}class Ae extends Oe{constructor(){super()}syntaxError(e,t,n,r,i,s){console.error("line "+n+":"+r+" "+i)}}Ae.INSTANCE=new Ae;class Ne extends Oe{constructor(e){if(super(),null===e)throw"delegates";return this.delegates=e,this}syntaxError(e,t,n,r,i,s){this.delegates.map((o=>o.syntaxError(e,t,n,r,i,s)))}reportAmbiguity(e,t,n,r,i,s,o){this.delegates.map((a=>a.reportAmbiguity(e,t,n,r,i,s,o)))}reportAttemptingFullContext(e,t,n,r,i,s){this.delegates.map((o=>o.reportAttemptingFullContext(e,t,n,r,i,s)))}reportContextSensitivity(e,t,n,r,i,s){this.delegates.map((o=>o.reportContextSensitivity(e,t,n,r,i,s)))}}class Ie{constructor(){this._listeners=[Ae.INSTANCE],this._interp=null,this._stateNumber=-1}checkVersion(e){const t="4.13.1";t!==e&&console.log("ANTLR runtime and generated code versions disagree: "+t+"!="+e)}addErrorListener(e){this._listeners.push(e)}removeErrorListeners(){this._listeners=[]}getLiteralNames(){return Object.getPrototypeOf(this).constructor.literalNames||[]}getSymbolicNames(){return Object.getPrototypeOf(this).constructor.symbolicNames||[]}getTokenNames(){if(!this.tokenNames){const e=this.getLiteralNames(),t=this.getSymbolicNames(),n=e.length>t.length?e.length:t.length;this.tokenNames=[];for(let r=0;r<n;r++)this.tokenNames[r]=e[r]||t[r]||"<INVALID"}return this.tokenNames}getTokenTypeMap(){const t=this.getTokenNames();if(null===t)throw"The current recognizer does not provide a list of token names.";let n=this.tokenTypeMapCache[t];return void 0===n&&(n=t.reduce((function(e,t,n){e[t]=n})),n.EOF=e.EOF,this.tokenTypeMapCache[t]=n),n}getRuleIndexMap(){const e=this.ruleNames;if(null===e)throw"The current recognizer does not provide a list of rule names.";let t=this.ruleIndexMapCache[e];return void 0===t&&(t=e.reduce((function(e,t,n){e[t]=n})),this.ruleIndexMapCache[e]=t),t}getTokenType(t){const n=this.getTokenTypeMap()[t];return void 0!==n?n:e.INVALID_TYPE}getErrorHeader(e){return"line "+e.getOffendingToken().line+":"+e.getOffendingToken().column}getTokenErrorDisplay(t){if(null===t)return"<no token>";let n=t.text;return null===n&&(n=t.type===e.EOF?"<EOF>":"<"+t.type+">"),n=n.replace("\n","\\n").replace("\r","\\r").replace("\t","\\t"),"'"+n+"'"}getErrorListenerDispatch(){return new Ne(this._listeners)}sempred(e,t,n){return!0}precpred(e,t){return!0}get atn(){return this._interp.atn}get state(){return this._stateNumber}set state(e){this._stateNumber=e}}Ie.tokenTypeMapCache={},Ie.ruleIndexMapCache={};class Le extends e{constructor(t,n,r,i,s){super(),this.source=void 0!==t?t:Le.EMPTY_SOURCE,this.type=void 0!==n?n:null,this.channel=void 0!==r?r:e.DEFAULT_CHANNEL,this.start=void 0!==i?i:-1,this.stop=void 0!==s?s:-1,this.tokenIndex=-1,null!==this.source[0]?(this.line=t[0].line,this.column=t[0].column):this.column=-1}clone(){const e=new Le(this.source,this.type,this.channel,this.start,this.stop);return e.tokenIndex=this.tokenIndex,e.line=this.line,e.column=this.column,e.text=this.text,e}cloneWithType(t){const n=new Le(this.source,t,this.channel,this.start,this.stop);return n.tokenIndex=this.tokenIndex,n.line=this.line,n.column=this.column,t===e.EOF&&(n.text=""),n}toString(){let e=this.text;return e=null!==e?e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):"<no text>","[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+e+"',<"+this.type+">"+(this.channel>0?",channel="+this.channel:"")+","+this.line+":"+this.column+"]"}get text(){if(null!==this._text)return this._text;const e=this.getInputStream();if(null===e)return null;const t=e.size;return this.start<t&&this.stop<t?e.getText(this.start,this.stop):"<EOF>"}set text(e){this._text=e}}Le.EMPTY_SOURCE=[null,null];class De{}class Pe extends De{constructor(e){super(),this.copyText=void 0!==e&&e}create(e,t,n,r,i,s,o,a){const l=new Le(e,t,r,i,s);return l.line=o,l.column=a,null!==n?l.text=n:this.copyText&&null!==e[1]&&(l.text=e[1].getText(i,s)),l}createThin(e,t){const n=new Le(null,e);return n.text=t,n}}Pe.DEFAULT=new Pe;class Me extends Error{constructor(e){super(e.message),Error.captureStackTrace&&Error.captureStackTrace(this,Me),this.message=e.message,this.recognizer=e.recognizer,this.input=e.input,this.ctx=e.ctx,this.offendingToken=null,this.offendingState=-1,null!==this.recognizer&&(this.offendingState=this.recognizer.state)}getExpectedTokens(){return null!==this.recognizer?this.recognizer.atn.getExpectedTokens(this.offendingState,this.ctx):null}toString(){return this.message}}class Fe extends Me{constructor(e,t,n,r){super({message:"",recognizer:e,input:t,ctx:null}),this.startIndex=n,this.deadEndConfigs=r}toString(){let e="";return this.startIndex>=0&&this.startIndex<this.input.size&&(e=this.input.getText(new v(this.startIndex,this.startIndex))),"LexerNoViableAltException"+e}}class Ue extends Ie{constructor(t){super(),this._input=t,this._factory=Pe.DEFAULT,this._tokenFactorySourcePair=[this,t],this._interp=null,this._token=null,this._tokenStartCharIndex=-1,this._tokenStartLine=-1,this._tokenStartColumn=-1,this._hitEOF=!1,this._channel=e.DEFAULT_CHANNEL,this._type=e.INVALID_TYPE,this._modeStack=[],this._mode=Ue.DEFAULT_MODE,this._text=null}reset(){null!==this._input&&this._input.seek(0),this._token=null,this._type=e.INVALID_TYPE,this._channel=e.DEFAULT_CHANNEL,this._tokenStartCharIndex=-1,this._tokenStartColumn=-1,this._tokenStartLine=-1,this._text=null,this._hitEOF=!1,this._mode=Ue.DEFAULT_MODE,this._modeStack=[],this._interp.reset()}nextToken(){if(null===this._input)throw"nextToken requires a non-null input stream.";const t=this._input.mark();try{for(;;){if(this._hitEOF)return this.emitEOF(),this._token;this._token=null,this._channel=e.DEFAULT_CHANNEL,this._tokenStartCharIndex=this._input.index,this._tokenStartColumn=this._interp.column,this._tokenStartLine=this._interp.line,this._text=null;let t=!1;for(;;){this._type=e.INVALID_TYPE;let n=Ue.SKIP;try{n=this._interp.match(this._input,this._mode)}catch(e){if(!(e instanceof Me))throw console.log(e.stack),e;this.notifyListeners(e),this.recover(e)}if(this._input.LA(1)===e.EOF&&(this._hitEOF=!0),this._type===e.INVALID_TYPE&&(this._type=n),this._type===Ue.SKIP){t=!0;break}if(this._type!==Ue.MORE)break}if(!t)return null===this._token&&this.emit(),this._token}}finally{this._input.release(t)}}skip(){this._type=Ue.SKIP}more(){this._type=Ue.MORE}mode(e){this._mode=e}pushMode(e){this._interp.debug&&console.log("pushMode "+e),this._modeStack.push(this._mode),this.mode(e)}popMode(){if(0===this._modeStack.length)throw"Empty Stack";return this._interp.debug&&console.log("popMode back to "+this._modeStack.slice(0,-1)),this.mode(this._modeStack.pop()),this._mode}emitToken(e){this._token=e}emit(){const e=this._factory.create(this._tokenFactorySourcePair,this._type,this._text,this._channel,this._tokenStartCharIndex,this.getCharIndex()-1,this._tokenStartLine,this._tokenStartColumn);return this.emitToken(e),e}emitEOF(){const t=this.column,n=this.line,r=this._factory.create(this._tokenFactorySourcePair,e.EOF,null,e.DEFAULT_CHANNEL,this._input.index,this._input.index-1,n,t);return this.emitToken(r),r}getCharIndex(){return this._input.index}getAllTokens(){const t=[];let n=this.nextToken();for(;n.type!==e.EOF;)t.push(n),n=this.nextToken();return t}notifyListeners(e){const t=this._tokenStartCharIndex,n=this._input.index,r=this._input.getText(t,n),i="token recognition error at: '"+this.getErrorDisplay(r)+"'";this.getErrorListenerDispatch().syntaxError(this,null,this._tokenStartLine,this._tokenStartColumn,i,e)}getErrorDisplay(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t.join("")}getErrorDisplayForChar(t){return t.charCodeAt(0)===e.EOF?"<EOF>":"\n"===t?"\\n":"\t"===t?"\\t":"\r"===t?"\\r":t}getCharErrorDisplay(e){return"'"+this.getErrorDisplayForChar(e)+"'"}recover(t){this._input.LA(1)!==e.EOF&&(t instanceof Fe?this._interp.consume(this._input):this._input.consume())}get inputStream(){return this._input}set inputStream(e){this._input=null,this._tokenFactorySourcePair=[this,this._input],this.reset(),this._input=e,this._tokenFactorySourcePair=[this,this._input]}get sourceName(){return this._input.sourceName}get type(){return this._type}set type(e){this._type=e}get line(){return this._interp.line}set line(e){this._interp.line=e}get column(){return this._interp.column}set column(e){this._interp.column=e}get text(){return null!==this._text?this._text:this._interp.getText(this._input)}set text(e){this._text=e}}function je(e){return e.hashCodeForConfigSet()}function Be(e,t){return e===t||null!==e&&null!==t&&e.equalsForConfigSet(t)}Ue.DEFAULT_MODE=0,Ue.MORE=-2,Ue.SKIP=-3,Ue.DEFAULT_TOKEN_CHANNEL=e.DEFAULT_CHANNEL,Ue.HIDDEN=e.HIDDEN_CHANNEL,Ue.MIN_CHAR_VALUE=0,Ue.MAX_CHAR_VALUE=1114111;class He{constructor(e){this.configLookup=new h(je,Be),this.fullCtx=void 0===e||e,this.readOnly=!1,this.configs=[],this.uniqueAlt=0,this.conflictingAlts=null,this.hasSemanticContext=!1,this.dipsIntoOuterContext=!1,this.cachedHashCode=-1}add(e,t){if(void 0===t&&(t=null),this.readOnly)throw"This set is readonly";e.semanticContext!==p.NONE&&(this.hasSemanticContext=!0),e.reachesIntoOuterContext>0&&(this.dipsIntoOuterContext=!0);const n=this.configLookup.add(e);if(n===e)return this.cachedHashCode=-1,this.configs.push(e),!0;const r=!this.fullCtx,i=W(n.context,e.context,r,t);return n.reachesIntoOuterContext=Math.max(n.reachesIntoOuterContext,e.reachesIntoOuterContext),e.precedenceFilterSuppressed&&(n.precedenceFilterSuppressed=!0),n.context=i,!0}getStates(){const e=new h;for(let t=0;t<this.configs.length;t++)e.add(this.configs[t].state);return e}getPredicates(){const e=[];for(let t=0;t<this.configs.length;t++){const n=this.configs[t].semanticContext;n!==p.NONE&&e.push(n.semanticContext)}return e}optimizeConfigs(e){if(this.readOnly)throw"This set is readonly";if(0!==this.configLookup.length)for(let t=0;t<this.configs.length;t++){const n=this.configs[t];n.context=e.getCachedContext(n.context)}}addAll(e){for(let t=0;t<e.length;t++)this.add(e[t]);return!1}equals(e){return this===e||e instanceof He&&t(this.configs,e.configs)&&this.fullCtx===e.fullCtx&&this.uniqueAlt===e.uniqueAlt&&this.conflictingAlts===e.conflictingAlts&&this.hasSemanticContext===e.hasSemanticContext&&this.dipsIntoOuterContext===e.dipsIntoOuterContext}hashCode(){const e=new o;return e.update(this.configs),e.finish()}updateHashCode(e){this.readOnly?(-1===this.cachedHashCode&&(this.cachedHashCode=this.hashCode()),e.update(this.cachedHashCode)):e.update(this.hashCode())}isEmpty(){return 0===this.configs.length}contains(e){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.contains(e)}containsFast(e){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.containsFast(e)}clear(){if(this.readOnly)throw"This set is readonly";this.configs=[],this.cachedHashCode=-1,this.configLookup=new h}setReadonly(e){this.readOnly=e,e&&(this.configLookup=null)}toString(){return u(this.configs)+(this.hasSemanticContext?",hasSemanticContext="+this.hasSemanticContext:"")+(this.uniqueAlt!==Z.INVALID_ALT_NUMBER?",uniqueAlt="+this.uniqueAlt:"")+(null!==this.conflictingAlts?",conflictingAlts="+this.conflictingAlts:"")+(this.dipsIntoOuterContext?",dipsIntoOuterContext":"")}get items(){return this.configs}get length(){return this.configs.length}}class $e{constructor(e,t){return null===e&&(e=-1),null===t&&(t=new He),this.stateNumber=e,this.configs=t,this.edges=null,this.isAcceptState=!1,this.prediction=0,this.lexerActionExecutor=null,this.requiresFullContext=!1,this.predicates=null,this}getAltSet(){const e=new h;if(null!==this.configs)for(let t=0;t<this.configs.length;t++){const n=this.configs[t];e.add(n.alt)}return 0===e.length?null:e}equals(e){return this===e||e instanceof $e&&this.configs.equals(e.configs)}toString(){let e=this.stateNumber+":"+this.configs;return this.isAcceptState&&(e+="=>",null!==this.predicates?e+=this.predicates:e+=this.prediction),e}hashCode(){const e=new o;return e.update(this.configs),e.finish()}}class ze{constructor(e,t){return this.atn=e,this.sharedContextCache=t,this}getCachedContext(e){if(null===this.sharedContextCache)return e;const t=new z;return G(e,this.sharedContextCache,t)}}ze.ERROR=new $e(2147483647,new He);class Ve extends He{constructor(){super(),this.configLookup=new h}}class Ge extends b{constructor(e,t){super(e,t);const n=e.lexerActionExecutor||null;return this.lexerActionExecutor=n||(null!==t?t.lexerActionExecutor:null),this.passedThroughNonGreedyDecision=null!==t&&this.checkNonGreedyDecision(t,this.state),this.hashCodeForConfigSet=Ge.prototype.hashCode,this.equalsForConfigSet=Ge.prototype.equals,this}updateHashCode(e){e.update(this.state.stateNumber,this.alt,this.context,this.semanticContext,this.passedThroughNonGreedyDecision,this.lexerActionExecutor)}equals(e){return this===e||e instanceof Ge&&this.passedThroughNonGreedyDecision===e.passedThroughNonGreedyDecision&&(this.lexerActionExecutor?this.lexerActionExecutor.equals(e.lexerActionExecutor):!e.lexerActionExecutor)&&super.equals(e)}checkNonGreedyDecision(e,t){return e.passedThroughNonGreedyDecision||t instanceof Q&&t.nonGreedy}}class We extends be{constructor(e,t){super(t.actionType),this.offset=e,this.action=t,this.isPositionDependent=!0}execute(e){this.action.execute(e)}updateHashCode(e){e.update(this.actionType,this.offset,this.action)}equals(e){return this===e||e instanceof We&&this.offset===e.offset&&this.action===e.action}}class Ke{constructor(e){return this.lexerActions=null===e?[]:e,this.cachedHashCode=o.hashStuff(e),this}fixOffsetBeforeMatch(e){let t=null;for(let n=0;n<this.lexerActions.length;n++)!this.lexerActions[n].isPositionDependent||this.lexerActions[n]instanceof We||(null===t&&(t=this.lexerActions.concat([])),t[n]=new We(e,this.lexerActions[n]));return null===t?this:new Ke(t)}execute(e,t,n){let r=!1;const i=t.index;try{for(let s=0;s<this.lexerActions.length;s++){let o=this.lexerActions[s];if(o instanceof We){const e=o.offset;t.seek(n+e),o=o.action,r=n+e!==i}else o.isPositionDependent&&(t.seek(i),r=!1);o.execute(e)}}finally{r&&t.seek(i)}}hashCode(){return this.cachedHashCode}updateHashCode(e){e.update(this.cachedHashCode)}equals(e){if(this===e)return!0;if(e instanceof Ke){if(this.cachedHashCode!=e.cachedHashCode)return!1;if(this.lexerActions.length!=e.lexerActions.length)return!1;{const t=this.lexerActions.length;for(let n=0;n<t;++n)if(!this.lexerActions[n].equals(e.lexerActions[n]))return!1;return!0}}return!1}static append(e,t){if(null===e)return new Ke([t]);const n=e.lexerActions.concat([t]);return new Ke(n)}}function Ye(e){e.index=-1,e.line=0,e.column=-1,e.dfaState=null}class Ze{constructor(){Ye(this)}reset(){Ye(this)}}class qe extends ze{constructor(e,t,n,r){super(t,r),this.decisionToDFA=n,this.recog=e,this.startIndex=-1,this.line=1,this.column=0,this.mode=Ue.DEFAULT_MODE,this.prevAccept=new Ze}copyState(e){this.column=e.column,this.line=e.line,this.mode=e.mode,this.startIndex=e.startIndex}match(e,t){this.mode=t;const n=e.mark();try{this.startIndex=e.index,this.prevAccept.reset();const n=this.decisionToDFA[t];return null===n.s0?this.matchATN(e):this.execATN(e,n.s0)}finally{e.release(n)}}reset(){this.prevAccept.reset(),this.startIndex=-1,this.line=1,this.column=0,this.mode=Ue.DEFAULT_MODE}matchATN(e){const t=this.atn.modeToStartState[this.mode];qe.debug&&console.log("matchATN mode "+this.mode+" start: "+t);const n=this.mode,r=this.computeStartState(e,t),i=r.hasSemanticContext;r.hasSemanticContext=!1;const s=this.addDFAState(r);i||(this.decisionToDFA[this.mode].s0=s);const o=this.execATN(e,s);return qe.debug&&console.log("DFA after matchATN: "+this.decisionToDFA[n].toLexerString()),o}execATN(t,n){qe.debug&&console.log("start state closure="+n.configs),n.isAcceptState&&this.captureSimState(this.prevAccept,t,n);let r=t.LA(1),i=n;for(;;){qe.debug&&console.log("execATN loop starting closure: "+i.configs);let n=this.getExistingTargetState(i,r);if(null===n&&(n=this.computeTargetState(t,i,r)),n===ze.ERROR)break;if(r!==e.EOF&&this.consume(t),n.isAcceptState&&(this.captureSimState(this.prevAccept,t,n),r===e.EOF))break;r=t.LA(1),i=n}return this.failOrAccept(this.prevAccept,t,i.configs,r)}getExistingTargetState(e,t){if(null===e.edges||t<qe.MIN_DFA_EDGE||t>qe.MAX_DFA_EDGE)return null;let n=e.edges[t-qe.MIN_DFA_EDGE];return void 0===n&&(n=null),qe.debug&&null!==n&&console.log("reuse state "+e.stateNumber+" edge to "+n.stateNumber),n}computeTargetState(e,t,n){const r=new Ve;return this.getReachableConfigSet(e,t.configs,r,n),0===r.items.length?(r.hasSemanticContext||this.addDFAEdge(t,n,ze.ERROR),ze.ERROR):this.addDFAEdge(t,n,null,r)}failOrAccept(t,n,r,i){if(null!==this.prevAccept.dfaState){const e=t.dfaState.lexerActionExecutor;return this.accept(n,e,this.startIndex,t.index,t.line,t.column),t.dfaState.prediction}if(i===e.EOF&&n.index===this.startIndex)return e.EOF;throw new Fe(this.recog,n,this.startIndex,r)}getReachableConfigSet(t,n,r,i){let s=Z.INVALID_ALT_NUMBER;for(let o=0;o<n.items.length;o++){const a=n.items[o],l=a.alt===s;if(!l||!a.passedThroughNonGreedyDecision){qe.debug&&console.log("testing %s at %s\n",this.getTokenName(i),a.toString(this.recog,!0));for(let n=0;n<a.state.transitions.length;n++){const o=a.state.transitions[n],c=this.getReachableTarget(o,i);if(null!==c){let n=a.lexerActionExecutor;null!==n&&(n=n.fixOffsetBeforeMatch(t.index-this.startIndex));const o=i===e.EOF,u=new Ge({state:c,lexerActionExecutor:n},a);this.closure(t,u,r,l,!0,o)&&(s=a.alt)}}}}}accept(e,t,n,r,i,s){qe.debug&&console.log("ACTION %s\n",t),e.seek(r),this.line=i,this.column=s,null!==t&&null!==this.recog&&t.execute(this.recog,e,n)}getReachableTarget(e,t){return e.matches(t,0,Ue.MAX_CHAR_VALUE)?e.target:null}computeStartState(e,t){const n=U.EMPTY,r=new Ve;for(let i=0;i<t.transitions.length;i++){const s=t.transitions[i].target,o=new Ge({state:s,alt:i+1,context:n},null);this.closure(e,o,r,!1,!1,!1)}return r}closure(e,t,n,r,i,s){let o=null;if(qe.debug&&console.log("closure("+t.toString(this.recog,!0)+")"),t.state instanceof T){if(qe.debug&&(null!==this.recog?console.log("closure at %s rule stop %s\n",this.recog.ruleNames[t.state.ruleIndex],t):console.log("closure at rule stop %s\n",t)),null===t.context||t.context.hasEmptyPath()){if(null===t.context||t.context.isEmpty())return n.add(t),!0;n.add(new Ge({state:t.state,context:U.EMPTY},t)),r=!0}if(null!==t.context&&!t.context.isEmpty())for(let a=0;a<t.context.length;a++)if(t.context.getReturnState(a)!==U.EMPTY_RETURN_STATE){const l=t.context.getParent(a),c=this.atn.states[t.context.getReturnState(a)];o=new Ge({state:c,context:l},t),r=this.closure(e,o,n,r,i,s)}return r}t.state.epsilonOnlyTransitions||r&&t.passedThroughNonGreedyDecision||n.add(t);for(let a=0;a<t.state.transitions.length;a++){const l=t.state.transitions[a];o=this.getEpsilonTarget(e,t,l,n,i,s),null!==o&&(r=this.closure(e,o,n,r,i,s))}return r}getEpsilonTarget(t,n,r,i,s,o){let a=null;if(r.serializationType===x.RULE){const e=B.create(n.context,r.followState.stateNumber);a=new Ge({state:r.target,context:e},n)}else{if(r.serializationType===x.PRECEDENCE)throw"Precedence predicates are not supported in lexers.";if(r.serializationType===x.PREDICATE)qe.debug&&console.log("EVAL rule "+r.ruleIndex+":"+r.predIndex),i.hasSemanticContext=!0,this.evaluatePredicate(t,r.ruleIndex,r.predIndex,s)&&(a=new Ge({state:r.target},n));else if(r.serializationType===x.ACTION)if(null===n.context||n.context.hasEmptyPath()){const e=Ke.append(n.lexerActionExecutor,this.atn.lexerActions[r.actionIndex]);a=new Ge({state:r.target,lexerActionExecutor:e},n)}else a=new Ge({state:r.target},n);else r.serializationType===x.EPSILON?a=new Ge({state:r.target},n):r.serializationType!==x.ATOM&&r.serializationType!==x.RANGE&&r.serializationType!==x.SET||o&&r.matches(e.EOF,0,Ue.MAX_CHAR_VALUE)&&(a=new Ge({state:r.target},n))}return a}evaluatePredicate(e,t,n,r){if(null===this.recog)return!0;if(!r)return this.recog.sempred(null,t,n);const i=this.column,s=this.line,o=e.index,a=e.mark();try{return this.consume(e),this.recog.sempred(null,t,n)}finally{this.column=i,this.line=s,e.seek(o),e.release(a)}}captureSimState(e,t,n){e.index=t.index,e.line=this.line,e.column=this.column,e.dfaState=n}addDFAEdge(e,t,n,r){if(void 0===n&&(n=null),void 0===r&&(r=null),null===n&&null!==r){const e=r.hasSemanticContext;if(r.hasSemanticContext=!1,n=this.addDFAState(r),e)return n}return t<qe.MIN_DFA_EDGE||t>qe.MAX_DFA_EDGE||(qe.debug&&console.log("EDGE "+e+" -> "+n+" upon "+t),null===e.edges&&(e.edges=[]),e.edges[t-qe.MIN_DFA_EDGE]=n),n}addDFAState(e){const t=new $e(null,e);let n=null;for(let o=0;o<e.items.length;o++){const t=e.items[o];if(t.state instanceof T){n=t;break}}null!==n&&(t.isAcceptState=!0,t.lexerActionExecutor=n.lexerActionExecutor,t.prediction=this.atn.ruleToTokenType[n.state.ruleIndex]);const r=this.decisionToDFA[this.mode],i=r.states.get(t);if(null!==i)return i;const s=t;return s.stateNumber=r.states.length,e.setReadonly(!0),s.configs=e,r.states.add(s),s}getDFA(e){return this.decisionToDFA[e]}getText(e){return e.getText(this.startIndex,e.index-1)}consume(e){e.LA(1)==="\n".charCodeAt(0)?(this.line+=1,this.column=0):this.column+=1,e.consume()}getTokenName(e){return-1===e?"EOF":"'"+String.fromCharCode(e)+"'"}}qe.debug=!1,qe.dfa_debug=!1,qe.MIN_DFA_EDGE=0,qe.MAX_DFA_EDGE=127;class Qe{constructor(e,t){this.alt=t,this.pred=e}toString(){return"("+this.pred+", "+this.alt+")"}}class Xe{constructor(){this.data={}}get(e){return this.data["k-"+e]||null}set(e,t){this.data["k-"+e]=t}values(){return Object.keys(this.data).filter((e=>e.startsWith("k-"))).map((e=>this.data[e]),this)}}const Je={SLL:0,LL:1,LL_EXACT_AMBIG_DETECTION:2,hasSLLConflictTerminatingPrediction:function(e,t){if(Je.allConfigsInRuleStopStates(t))return!0;if(e===Je.SLL&&t.hasSemanticContext){const e=new He;for(let n=0;n<t.items.length;n++){let r=t.items[n];r=new b({semanticContext:p.NONE},r),e.add(r)}t=e}const n=Je.getConflictingAltSubsets(t);return Je.hasConflictingAltSet(n)&&!Je.hasStateAssociatedWithOneAlt(t)},hasConfigInRuleStopState:function(e){for(let t=0;t<e.items.length;t++)if(e.items[t].state instanceof T)return!0;return!1},allConfigsInRuleStopStates:function(e){for(let t=0;t<e.items.length;t++)if(!(e.items[t].state instanceof T))return!1;return!0},resolvesToJustOneViableAlt:function(e){return Je.getSingleViableAlt(e)},allSubsetsConflict:function(e){return!Je.hasNonConflictingAltSet(e)},hasNonConflictingAltSet:function(e){for(let t=0;t<e.length;t++)if(1===e[t].length)return!0;return!1},hasConflictingAltSet:function(e){for(let t=0;t<e.length;t++)if(e[t].length>1)return!0;return!1},allSubsetsEqual:function(e){let t=null;for(let n=0;n<e.length;n++){const r=e[n];if(null===t)t=r;else if(r!==t)return!1}return!0},getUniqueAlt:function(e){const t=Je.getAlts(e);return 1===t.length?t.minValue():Z.INVALID_ALT_NUMBER},getAlts:function(e){const t=new K;return e.map((function(e){t.or(e)})),t},getConflictingAltSubsets:function(e){const t=new z;return t.hashFunction=function(e){o.hashStuff(e.state.stateNumber,e.context)},t.equalsFunction=function(e,t){return e.state.stateNumber===t.state.stateNumber&&e.context.equals(t.context)},e.items.map((function(e){let n=t.get(e);null===n&&(n=new K,t.set(e,n)),n.add(e.alt)})),t.getValues()},getStateToAltMap:function(e){const t=new Xe;return e.items.map((function(e){let n=t.get(e.state);null===n&&(n=new K,t.set(e.state,n)),n.add(e.alt)})),t},hasStateAssociatedWithOneAlt:function(e){const t=Je.getStateToAltMap(e).values();for(let n=0;n<t.length;n++)if(1===t[n].length)return!0;return!1},getSingleViableAlt:function(e){let t=null;for(let n=0;n<e.length;n++){const r=e[n].minValue();if(null===t)t=r;else if(t!==r)return Z.INVALID_ALT_NUMBER}return t}},et=Je;class tt extends Me{constructor(e,t,n,r,i,s){s=s||e._ctx,r=r||e.getCurrentToken(),n=n||e.getCurrentToken(),t=t||e.getInputStream(),super({message:"",recognizer:e,input:t,ctx:s}),this.deadEndConfigs=i,this.startToken=n,this.offendingToken=r}}class nt{constructor(e){this.defaultMapCtor=e||z,this.cacheMap=new this.defaultMapCtor}get(e,t){const n=this.cacheMap.get(e)||null;return null===n?null:n.get(t)||null}set(e,t,n){let r=this.cacheMap.get(e)||null;null===r&&(r=new this.defaultMapCtor,this.cacheMap.set(e,r)),r.set(t,n)}}class rt extends ze{constructor(e,t,n,r){super(t,r),this.parser=e,this.decisionToDFA=n,this.predictionMode=et.LL,this._input=null,this._startIndex=0,this._outerContext=null,this._dfa=null,this.mergeCache=null,this.debug=!1,this.debug_closure=!1,this.debug_add=!1,this.trace_atn_sim=!1,this.dfa_debug=!1,this.retry_debug=!1}reset(){}adaptivePredict(e,t,n){(this.debug||this.trace_atn_sim)&&console.log("adaptivePredict decision "+t+" exec LA(1)=="+this.getLookaheadName(e)+" line "+e.LT(1).line+":"+e.LT(1).column),this._input=e,this._startIndex=e.index,this._outerContext=n;const r=this.decisionToDFA[t];this._dfa=r;const i=e.mark(),s=e.index;try{let t;if(t=r.precedenceDfa?r.getPrecedenceStartState(this.parser.getPrecedence()):r.s0,null===t){null===n&&(n=F.EMPTY),this.debug&&console.log("predictATN decision "+r.decision+" exec LA(1)=="+this.getLookaheadName(e)+", outerContext="+n.toString(this.parser.ruleNames));const i=!1;let s=this.computeStartState(r.atnStartState,F.EMPTY,i);r.precedenceDfa?(r.s0.configs=s,s=this.applyPrecedenceFilter(s),t=this.addDFAState(r,new $e(null,s)),r.setPrecedenceStartState(this.parser.getPrecedence(),t)):(t=this.addDFAState(r,new $e(null,s)),r.s0=t)}const i=this.execATN(r,t,e,s,n);return this.debug&&console.log("DFA after predictATN: "+r.toString(this.parser.literalNames,this.parser.symbolicNames)),i}finally{this._dfa=null,this.mergeCache=null,e.seek(s),e.release(i)}}execATN(t,n,r,i,s){let o;(this.debug||this.trace_atn_sim)&&console.log("execATN decision "+t.decision+", DFA state "+n+", LA(1)=="+this.getLookaheadName(r)+" line "+r.LT(1).line+":"+r.LT(1).column);let a=n;this.debug&&console.log("s0 = "+n);let l=r.LA(1);for(;;){let n=this.getExistingTargetState(a,l);if(null===n&&(n=this.computeTargetState(t,a,l)),n===ze.ERROR){const e=this.noViableAlt(r,s,a.configs,i);if(r.seek(i),o=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(a.configs,s),o!==Z.INVALID_ALT_NUMBER)return o;throw e}if(n.requiresFullContext&&this.predictionMode!==et.SLL){let e=null;if(null!==n.predicates){this.debug&&console.log("DFA state has preds in DFA sim LL failover");const t=r.index;if(t!==i&&r.seek(i),e=this.evalSemanticContext(n.predicates,s,!0),1===e.length)return this.debug&&console.log("Full LL avoided"),e.minValue();t!==i&&r.seek(t)}this.dfa_debug&&console.log("ctx sensitive state "+s+" in "+n);const a=!0,l=this.computeStartState(t.atnStartState,s,a);return this.reportAttemptingFullContext(t,e,n.configs,i,r.index),o=this.execATNWithFullContext(t,n,l,r,i,s),o}if(n.isAcceptState){if(null===n.predicates)return n.prediction;const e=r.index;r.seek(i);const o=this.evalSemanticContext(n.predicates,s,!0);if(0===o.length)throw this.noViableAlt(r,s,n.configs,i);return 1===o.length||this.reportAmbiguity(t,n,i,e,!1,o,n.configs),o.minValue()}a=n,l!==e.EOF&&(r.consume(),l=r.LA(1))}}getExistingTargetState(e,t){const n=e.edges;return null===n?null:n[t+1]||null}computeTargetState(e,t,n){const r=this.computeReachSet(t.configs,n,!1);if(null===r)return this.addDFAEdge(e,t,n,ze.ERROR),ze.ERROR;let i=new $e(null,r);const s=this.getUniqueAlt(r);if(this.debug){const e=et.getConflictingAltSubsets(r);console.log("SLL altSubSets="+u(e)+", configs="+r+", predict="+s+", allSubsetsConflict="+et.allSubsetsConflict(e)+", conflictingAlts="+this.getConflictingAlts(r))}return s!==Z.INVALID_ALT_NUMBER?(i.isAcceptState=!0,i.configs.uniqueAlt=s,i.prediction=s):et.hasSLLConflictTerminatingPrediction(this.predictionMode,r)&&(i.configs.conflictingAlts=this.getConflictingAlts(r),i.requiresFullContext=!0,i.isAcceptState=!0,i.prediction=i.configs.conflictingAlts.minValue()),i.isAcceptState&&i.configs.hasSemanticContext&&(this.predicateDFAState(i,this.atn.getDecisionState(e.decision)),null!==i.predicates&&(i.prediction=Z.INVALID_ALT_NUMBER)),i=this.addDFAEdge(e,t,n,i),i}predicateDFAState(e,t){const n=t.transitions.length,r=this.getConflictingAltsOrUniqueAlt(e.configs),i=this.getPredsForAmbigAlts(r,e.configs,n);null!==i?(e.predicates=this.getPredicatePredictions(r,i),e.prediction=Z.INVALID_ALT_NUMBER):e.prediction=r.minValue()}execATNWithFullContext(t,n,r,i,s,o){(this.debug||this.trace_atn_sim)&&console.log("execATNWithFullContext "+r);let a,l=!1,c=r;i.seek(s);let u=i.LA(1),d=-1;for(;;){if(a=this.computeReachSet(c,u,!0),null===a){const e=this.noViableAlt(i,o,c,s);i.seek(s);const t=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(c,o);if(t!==Z.INVALID_ALT_NUMBER)return t;throw e}const t=et.getConflictingAltSubsets(a);if(this.debug&&console.log("LL altSubSets="+t+", predict="+et.getUniqueAlt(t)+", resolvesToJustOneViableAlt="+et.resolvesToJustOneViableAlt(t)),a.uniqueAlt=this.getUniqueAlt(a),a.uniqueAlt!==Z.INVALID_ALT_NUMBER){d=a.uniqueAlt;break}if(this.predictionMode!==et.LL_EXACT_AMBIG_DETECTION){if(d=et.resolvesToJustOneViableAlt(t),d!==Z.INVALID_ALT_NUMBER)break}else if(et.allSubsetsConflict(t)&&et.allSubsetsEqual(t)){l=!0,d=et.getSingleViableAlt(t);break}c=a,u!==e.EOF&&(i.consume(),u=i.LA(1))}return a.uniqueAlt!==Z.INVALID_ALT_NUMBER?(this.reportContextSensitivity(t,d,a,s,i.index),d):(this.reportAmbiguity(t,n,s,i.index,l,null,a),d)}computeReachSet(t,n,r){this.debug&&console.log("in computeReachSet, starting closure: "+t),null===this.mergeCache&&(this.mergeCache=new nt);const i=new He(r);let s=null;for(let a=0;a<t.items.length;a++){const o=t.items[a];if(this.debug&&console.log("testing "+this.getTokenName(n)+" at "+o),o.state instanceof T)(r||n===e.EOF)&&(null===s&&(s=[]),s.push(o),this.debug_add&&console.log("added "+o+" to skippedStopStates"));else for(let e=0;e<o.state.transitions.length;e++){const t=o.state.transitions[e],r=this.getReachableTarget(t,n);if(null!==r){const e=new b({state:r},o);i.add(e,this.mergeCache),this.debug_add&&console.log("added "+e+" to intermediate")}}}let o=null;if(null===s&&n!==e.EOF&&(1===i.items.length||this.getUniqueAlt(i)!==Z.INVALID_ALT_NUMBER)&&(o=i),null===o){o=new He(r);const t=new h,s=n===e.EOF;for(let e=0;e<i.items.length;e++)this.closure(i.items[e],o,t,!1,r,s)}if(n===e.EOF&&(o=this.removeAllConfigsNotInRuleStopState(o,o===i)),!(null===s||r&&et.hasConfigInRuleStopState(o)))for(let e=0;e<s.length;e++)o.add(s[e],this.mergeCache);return this.trace_atn_sim&&console.log("computeReachSet "+t+" -> "+o),0===o.items.length?null:o}removeAllConfigsNotInRuleStopState(t,n){if(et.allConfigsInRuleStopStates(t))return t;const r=new He(t.fullCtx);for(let i=0;i<t.items.length;i++){const s=t.items[i];if(s.state instanceof T)r.add(s,this.mergeCache);else if(n&&s.state.epsilonOnlyTransitions&&this.atn.nextTokens(s.state).contains(e.EPSILON)){const e=this.atn.ruleToStopState[s.state.ruleIndex];r.add(new b({state:e},s),this.mergeCache)}}return r}computeStartState(e,t,n){const r=V(this.atn,t),i=new He(n);this.trace_atn_sim&&console.log("computeStartState from ATN state "+e+" initialContext="+r.toString(this.parser));for(let s=0;s<e.transitions.length;s++){const t=e.transitions[s].target,o=new b({state:t,alt:s+1,context:r},null),a=new h;this.closure(o,i,a,!0,n,!1)}return i}applyPrecedenceFilter(e){let t;const n=[],r=new He(e.fullCtx);for(let i=0;i<e.items.length;i++){if(t=e.items[i],1!==t.alt)continue;const s=t.semanticContext.evalPrecedence(this.parser,this._outerContext);null!==s&&(n[t.state.stateNumber]=t.context,s!==t.semanticContext?r.add(new b({semanticContext:s},t),this.mergeCache):r.add(t,this.mergeCache))}for(let i=0;i<e.items.length;i++)if(t=e.items[i],1!==t.alt){if(!t.precedenceFilterSuppressed){const e=n[t.state.stateNumber]||null;if(null!==e&&e.equals(t.context))continue}r.add(t,this.mergeCache)}return r}getReachableTarget(e,t){return e.matches(t,0,this.atn.maxTokenType)?e.target:null}getPredsForAmbigAlts(e,t,n){let r=[];for(let s=0;s<t.items.length;s++){const n=t.items[s];e.has(n.alt)&&(r[n.alt]=p.orContext(r[n.alt]||null,n.semanticContext))}let i=0;for(let s=1;s<n+1;s++){const e=r[s]||null;null===e?r[s]=p.NONE:e!==p.NONE&&(i+=1)}return 0===i&&(r=null),this.debug&&console.log("getPredsForAmbigAlts result "+u(r)),r}getPredicatePredictions(e,t){const n=[];let r=!1;for(let i=1;i<t.length;i++){const s=t[i];null!==e&&e.has(i)&&n.push(new Qe(s,i)),s!==p.NONE&&(r=!0)}return r?n:null}getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(e,t){const n=this.splitAccordingToSemanticValidity(e,t),r=n[0],i=n[1];let s=this.getAltThatFinishedDecisionEntryRule(r);return s!==Z.INVALID_ALT_NUMBER||i.items.length>0&&(s=this.getAltThatFinishedDecisionEntryRule(i),s!==Z.INVALID_ALT_NUMBER)?s:Z.INVALID_ALT_NUMBER}getAltThatFinishedDecisionEntryRule(e){const t=[];for(let n=0;n<e.items.length;n++){const r=e.items[n];(r.reachesIntoOuterContext>0||r.state instanceof T&&r.context.hasEmptyPath())&&t.indexOf(r.alt)<0&&t.push(r.alt)}return 0===t.length?Z.INVALID_ALT_NUMBER:Math.min.apply(null,t)}splitAccordingToSemanticValidity(e,t){const n=new He(e.fullCtx),r=new He(e.fullCtx);for(let i=0;i<e.items.length;i++){const s=e.items[i];s.semanticContext!==p.NONE?s.semanticContext.evaluate(this.parser,t)?n.add(s):r.add(s):n.add(s)}return[n,r]}evalSemanticContext(e,t,n){const r=new K;for(let i=0;i<e.length;i++){const s=e[i];if(s.pred===p.NONE){if(r.add(s.alt),!n)break;continue}const o=s.pred.evaluate(this.parser,t);if((this.debug||this.dfa_debug)&&console.log("eval pred "+s+"="+o),o&&((this.debug||this.dfa_debug)&&console.log("PREDICT "+s.alt),r.add(s.alt),!n))break}return r}closure(e,t,n,r,i,s){this.closureCheckingStopState(e,t,n,r,i,0,s)}closureCheckingStopState(e,t,n,r,i,s,o){if((this.trace_atn_sim||this.debug_closure)&&console.log("closure("+e.toString(this.parser,!0)+")"),e.state instanceof T){if(!e.context.isEmpty()){for(let a=0;a<e.context.length;a++){if(e.context.getReturnState(a)===U.EMPTY_RETURN_STATE){if(i){t.add(new b({state:e.state,context:U.EMPTY},e),this.mergeCache);continue}this.debug&&console.log("FALLING off rule "+this.getRuleName(e.state.ruleIndex)),this.closure_(e,t,n,r,i,s,o);continue}const l=this.atn.states[e.context.getReturnState(a)],c=e.context.getParent(a),u={state:l,alt:e.alt,context:c,semanticContext:e.semanticContext},d=new b(u,null);d.reachesIntoOuterContext=e.reachesIntoOuterContext,this.closureCheckingStopState(d,t,n,r,i,s-1,o)}return}if(i)return void t.add(e,this.mergeCache);this.debug&&console.log("FALLING off rule "+this.getRuleName(e.state.ruleIndex))}this.closure_(e,t,n,r,i,s,o)}closure_(e,t,n,r,i,s,o){const a=e.state;a.epsilonOnlyTransitions||t.add(e,this.mergeCache);for(let l=0;l<a.transitions.length;l++){if(0===l&&this.canDropLoopEntryEdgeInLeftRecursiveRule(e))continue;const c=a.transitions[l],u=r&&!(c instanceof de),d=this.getEpsilonTarget(e,c,u,0===s,i,o);if(null!==d){let r=s;if(e.state instanceof T){if(null!==this._dfa&&this._dfa.precedenceDfa&&c.outermostPrecedenceReturn===this._dfa.atnStartState.ruleIndex&&(d.precedenceFilterSuppressed=!0),d.reachesIntoOuterContext+=1,n.add(d)!==d)continue;t.dipsIntoOuterContext=!0,r-=1,this.debug&&console.log("dips into outer ctx: "+d)}else{if(!c.isEpsilon&&n.add(d)!==d)continue;c instanceof w&&r>=0&&(r+=1)}this.closureCheckingStopState(d,t,n,u,i,r,o)}}}canDropLoopEntryEdgeInLeftRecursiveRule(e){const t=e.state;if(t.stateType!==_.STAR_LOOP_ENTRY)return!1;if(t.stateType!==_.STAR_LOOP_ENTRY||!t.isPrecedenceDecision||e.context.isEmpty()||e.context.hasEmptyPath())return!1;const n=e.context.length;for(let s=0;s<n;s++)if(this.atn.states[e.context.getReturnState(s)].ruleIndex!==t.ruleIndex)return!1;const r=t.transitions[0].target.endState.stateNumber,i=this.atn.states[r];for(let s=0;s<n;s++){const n=e.context.getReturnState(s),r=this.atn.states[n];if(1!==r.transitions.length||!r.transitions[0].isEpsilon)return!1;const o=r.transitions[0].target;if(!(r.stateType===_.BLOCK_END&&o===t||r===i||o===i||o.stateType===_.BLOCK_END&&1===o.transitions.length&&o.transitions[0].isEpsilon&&o.transitions[0].target===t))return!1}return!0}getRuleName(e){return null!==this.parser&&e>=0?this.parser.ruleNames[e]:"<rule "+e+">"}getEpsilonTarget(t,n,r,i,s,o){switch(n.serializationType){case x.RULE:return this.ruleTransition(t,n);case x.PRECEDENCE:return this.precedenceTransition(t,n,r,i,s);case x.PREDICATE:return this.predTransition(t,n,r,i,s);case x.ACTION:return this.actionTransition(t,n);case x.EPSILON:return new b({state:n.target},t);case x.ATOM:case x.RANGE:case x.SET:return o&&n.matches(e.EOF,0,1)?new b({state:n.target},t):null;default:return null}}actionTransition(e,t){if(this.debug){const e=-1===t.actionIndex?65535:t.actionIndex;console.log("ACTION edge "+t.ruleIndex+":"+e)}return new b({state:t.target},e)}precedenceTransition(e,t,n,r,i){this.debug&&(console.log("PRED (collectPredicates="+n+") "+t.precedence+">=_p, ctx dependent=true"),null!==this.parser&&console.log("context surrounding pred is "+u(this.parser.getRuleInvocationStack())));let s=null;if(n&&r)if(i){const n=this._input.index;this._input.seek(this._startIndex);const r=t.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(n),r&&(s=new b({state:t.target},e))}else{const n=p.andContext(e.semanticContext,t.getPredicate());s=new b({state:t.target,semanticContext:n},e)}else s=new b({state:t.target},e);return this.debug&&console.log("config from pred transition="+s),s}predTransition(e,t,n,r,i){this.debug&&(console.log("PRED (collectPredicates="+n+") "+t.ruleIndex+":"+t.predIndex+", ctx dependent="+t.isCtxDependent),null!==this.parser&&console.log("context surrounding pred is "+u(this.parser.getRuleInvocationStack())));let s=null;if(n&&(t.isCtxDependent&&r||!t.isCtxDependent))if(i){const n=this._input.index;this._input.seek(this._startIndex);const r=t.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(n),r&&(s=new b({state:t.target},e))}else{const n=p.andContext(e.semanticContext,t.getPredicate());s=new b({state:t.target,semanticContext:n},e)}else s=new b({state:t.target},e);return this.debug&&console.log("config from pred transition="+s),s}ruleTransition(e,t){this.debug&&console.log("CALL rule "+this.getRuleName(t.target.ruleIndex)+", ctx="+e.context);const n=t.followState,r=B.create(e.context,n.stateNumber);return new b({state:t.target,context:r},e)}getConflictingAlts(e){const t=et.getConflictingAltSubsets(e);return et.getAlts(t)}getConflictingAltsOrUniqueAlt(e){let t=null;return e.uniqueAlt!==Z.INVALID_ALT_NUMBER?(t=new K,t.add(e.uniqueAlt)):t=e.conflictingAlts,t}getTokenName(t){if(t===e.EOF)return"EOF";if(null!==this.parser&&null!==this.parser.literalNames){if(!(t>=this.parser.literalNames.length&&t>=this.parser.symbolicNames.length))return(this.parser.literalNames[t]||this.parser.symbolicNames[t])+"<"+t+">";console.log(t+" ttype out of range: "+this.parser.literalNames),console.log(""+this.parser.getInputStream().getTokens())}return""+t}getLookaheadName(e){return this.getTokenName(e.LA(1))}dumpDeadEndConfigs(e){console.log("dead end configs: ");const t=e.getDeadEndConfigs();for(let n=0;n<t.length;n++){const e=t[n];let r="no edges";if(e.state.transitions.length>0){const t=e.state.transitions[0];t instanceof ce?r="Atom "+this.getTokenName(t.label):t instanceof S&&(r=(t instanceof R?"~":"")+"Set "+t.set)}console.error(e.toString(this.parser,!0)+":"+r)}}noViableAlt(e,t,n,r){return new tt(this.parser,e,e.get(r),e.LT(1),n,t)}getUniqueAlt(e){let t=Z.INVALID_ALT_NUMBER;for(let n=0;n<e.items.length;n++){const r=e.items[n];if(t===Z.INVALID_ALT_NUMBER)t=r.alt;else if(r.alt!==t)return Z.INVALID_ALT_NUMBER}return t}addDFAEdge(e,t,n,r){if(this.debug&&console.log("EDGE "+t+" -> "+r+" upon "+this.getTokenName(n)),null===r)return null;if(r=this.addDFAState(e,r),null===t||n<-1||n>this.atn.maxTokenType)return r;if(null===t.edges&&(t.edges=[]),t.edges[n+1]=r,this.debug){const t=null===this.parser?null:this.parser.literalNames,n=null===this.parser?null:this.parser.symbolicNames;console.log("DFA=\n"+e.toString(t,n))}return r}addDFAState(e,t){if(t===ze.ERROR)return t;const n=e.states.get(t);return null!==n?(this.trace_atn_sim&&console.log("addDFAState "+t+" exists"),n):(t.stateNumber=e.states.length,t.configs.readOnly||(t.configs.optimizeConfigs(this),t.configs.setReadonly(!0)),this.trace_atn_sim&&console.log("addDFAState new "+t),e.states.add(t),this.debug&&console.log("adding new DFA state: "+t),t)}reportAttemptingFullContext(e,t,n,r,i){if(this.debug||this.retry_debug){const t=new v(r,i+1);console.log("reportAttemptingFullContext decision="+e.decision+":"+n+", input="+this.parser.getTokenStream().getText(t))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser,e,r,i,t,n)}reportContextSensitivity(e,t,n,r,i){if(this.debug||this.retry_debug){const t=new v(r,i+1);console.log("reportContextSensitivity decision="+e.decision+":"+n+", input="+this.parser.getTokenStream().getText(t))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser,e,r,i,t,n)}reportAmbiguity(e,t,n,r,i,s,o){if(this.debug||this.retry_debug){const e=new v(n,r+1);console.log("reportAmbiguity "+s+":"+o+", input="+this.parser.getTokenStream().getText(e))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser,e,n,r,i,s,o)}}class it{constructor(){this.cache=new z}add(e){if(e===U.EMPTY)return U.EMPTY;const t=this.cache.get(e)||null;return null!==t?t:(this.cache.set(e,e),e)}get(e){return this.cache.get(e)||null}get length(){return this.cache.length}}const st={ATN:Z,ATNDeserializer:Ce,LexerATNSimulator:qe,ParserATNSimulator:rt,PredictionMode:et,PredictionContextCache:it};class ot{constructor(e,t,n){this.dfa=e,this.literalNames=t||[],this.symbolicNames=n||[]}toString(){if(null===this.dfa.s0)return null;let e="";const t=this.dfa.sortedStates();for(let n=0;n<t.length;n++){const r=t[n];if(null!==r.edges){const t=r.edges.length;for(let n=0;n<t;n++){const t=r.edges[n]||null;null!==t&&2147483647!==t.stateNumber&&(e=e.concat(this.getStateString(r)),e=e.concat("-"),e=e.concat(this.getEdgeLabel(n)),e=e.concat("->"),e=e.concat(this.getStateString(t)),e=e.concat("\n"))}}}return 0===e.length?null:e}getEdgeLabel(e){return 0===e?"EOF":null!==this.literalNames||null!==this.symbolicNames?this.literalNames[e-1]||this.symbolicNames[e-1]:String.fromCharCode(e-1)}getStateString(e){const t=(e.isAcceptState?":":"")+"s"+e.stateNumber+(e.requiresFullContext?"^":"");return e.isAcceptState?null!==e.predicates?t+"=>"+u(e.predicates):t+"=>"+e.prediction.toString():t}}class at extends ot{constructor(e){super(e,null)}getEdgeLabel(e){return"'"+String.fromCharCode(e)+"'"}}class lt{constructor(e,t){if(void 0===t&&(t=0),this.atnStartState=e,this.decision=t,this._states=new h,this.s0=null,this.precedenceDfa=!1,e instanceof se&&e.isPrecedenceDecision){this.precedenceDfa=!0;const e=new $e(null,new He);e.edges=[],e.isAcceptState=!1,e.requiresFullContext=!1,this.s0=e}}getPrecedenceStartState(e){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";return e<0||e>=this.s0.edges.length?null:this.s0.edges[e]||null}setPrecedenceStartState(e,t){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";e<0||(this.s0.edges[e]=t)}setPrecedenceDfa(e){if(this.precedenceDfa!==e){if(this._states=new h,e){const e=new $e(null,new He);e.edges=[],e.isAcceptState=!1,e.requiresFullContext=!1,this.s0=e}else this.s0=null;this.precedenceDfa=e}}sortedStates(){return this._states.values().sort((function(e,t){return e.stateNumber-t.stateNumber}))}toString(e,t){return e=e||null,t=t||null,null===this.s0?"":new ot(this,e,t).toString()}toLexerString(){return null===this.s0?"":new at(this).toString()}get states(){return this._states}}const ct={DFA:lt,DFASerializer:ot,LexerDFASerializer:at,PredPrediction:Qe},ut={PredictionContext:U},dt={Interval:v,IntervalSet:E};class ht{visitTerminal(e){}visitErrorNode(e){}enterEveryRule(e){}exitEveryRule(e){}}class pt{visit(e){return Array.isArray(e)?e.map((function(e){return e.accept(this)}),this):e.accept(this)}visitChildren(e){return e.children?this.visit(e.children):null}visitTerminal(e){}visitErrorNode(e){}}class ft{walk(e,t){if(t instanceof D||void 0!==t.isErrorNode&&t.isErrorNode())e.visitErrorNode(t);else if(t instanceof L)e.visitTerminal(t);else{this.enterRule(e,t);for(let n=0;n<t.getChildCount();n++){const r=t.getChild(n);this.walk(e,r)}this.exitRule(e,t)}}enterRule(e,t){const n=t.ruleContext;e.enterEveryRule(n),n.enterRule(e)}exitRule(e,t){const n=t.ruleContext;n.exitRule(e),e.exitEveryRule(n)}}ft.DEFAULT=new ft;const gt={Trees:M,RuleNode:I,ErrorNode:D,TerminalNode:L,ParseTreeListener:ht,ParseTreeVisitor:pt,ParseTreeWalker:ft};class mt extends Me{constructor(e){super({message:"",recognizer:e,input:e.getInputStream(),ctx:e._ctx}),this.offendingToken=e.getCurrentToken()}}class yt extends Me{constructor(e,t,n){super({message:bt(t,n||null),recognizer:e,input:e.getInputStream(),ctx:e._ctx});const r=e._interp.atn.states[e.state].transitions[0];r instanceof fe?(this.ruleIndex=r.ruleIndex,this.predicateIndex=r.predIndex):(this.ruleIndex=0,this.predicateIndex=0),this.predicate=t,this.offendingToken=e.getCurrentToken()}}function bt(e,t){return null!==t?t:"failed predicate: {"+e+"}?"}class vt extends Oe{constructor(e){super(),e=e||!0,this.exactOnly=e}reportAmbiguity(e,t,n,r,i,s,o){if(this.exactOnly&&!i)return;const a="reportAmbiguity d="+this.getDecisionDescription(e,t)+": ambigAlts="+this.getConflictingAlts(s,o)+", input='"+e.getTokenStream().getText(new v(n,r))+"'";e.notifyErrorListeners(a)}reportAttemptingFullContext(e,t,n,r,i,s){const o="reportAttemptingFullContext d="+this.getDecisionDescription(e,t)+", input='"+e.getTokenStream().getText(new v(n,r))+"'";e.notifyErrorListeners(o)}reportContextSensitivity(e,t,n,r,i,s){const o="reportContextSensitivity d="+this.getDecisionDescription(e,t)+", input='"+e.getTokenStream().getText(new v(n,r))+"'";e.notifyErrorListeners(o)}getDecisionDescription(e,t){const n=t.decision,r=t.atnStartState.ruleIndex,i=e.ruleNames;if(r<0||r>=i.length)return""+n;const s=i[r]||null;return null===s||0===s.length?""+n:`${n} (${s})`}getConflictingAlts(e,t){if(null!==e)return e;const n=new K;for(let r=0;r<t.items.length;r++)n.add(t.items[r].alt);return`{${n.values().join(", ")}}`}}class Et extends Error{constructor(){super(),Error.captureStackTrace(this,Et)}}class _t{reset(e){}recoverInline(e){}recover(e,t){}sync(e){}inErrorRecoveryMode(e){}reportError(e){}}class Tt extends _t{constructor(){super(),this.errorRecoveryMode=!1,this.lastErrorIndex=-1,this.lastErrorStates=null,this.nextTokensContext=null,this.nextTokenState=0}reset(e){this.endErrorCondition(e)}beginErrorCondition(e){this.errorRecoveryMode=!0}inErrorRecoveryMode(e){return this.errorRecoveryMode}endErrorCondition(e){this.errorRecoveryMode=!1,this.lastErrorStates=null,this.lastErrorIndex=-1}reportMatch(e){this.endErrorCondition(e)}reportError(e,t){this.inErrorRecoveryMode(e)||(this.beginErrorCondition(e),t instanceof tt?this.reportNoViableAlternative(e,t):t instanceof mt?this.reportInputMismatch(e,t):t instanceof yt?this.reportFailedPredicate(e,t):(console.log("unknown recognition error type: "+t.constructor.name),console.log(t.stack),e.notifyErrorListeners(t.getOffendingToken(),t.getMessage(),t)))}recover(e,t){this.lastErrorIndex===e.getInputStream().index&&null!==this.lastErrorStates&&this.lastErrorStates.indexOf(e.state)>=0&&e.consume(),this.lastErrorIndex=e._input.index,null===this.lastErrorStates&&(this.lastErrorStates=[]),this.lastErrorStates.push(e.state);const n=this.getErrorRecoverySet(e);this.consumeUntil(e,n)}sync(t){if(this.inErrorRecoveryMode(t))return;const n=t._interp.atn.states[t.state],r=t.getTokenStream().LA(1),i=t.atn.nextTokens(n);if(i.contains(r))return this.nextTokensContext=null,void(this.nextTokenState=_.INVALID_STATE_NUMBER);if(i.contains(e.EPSILON))null===this.nextTokensContext&&(this.nextTokensContext=t._ctx,this.nextTokensState=t._stateNumber);else switch(n.stateType){case _.BLOCK_START:case _.STAR_BLOCK_START:case _.PLUS_BLOCK_START:case _.STAR_LOOP_ENTRY:if(null!==this.singleTokenDeletion(t))return;throw new mt(t);case _.PLUS_LOOP_BACK:case _.STAR_LOOP_BACK:{this.reportUnwantedToken(t);const e=new E;e.addSet(t.getExpectedTokens());const n=e.addSet(this.getErrorRecoverySet(t));this.consumeUntil(t,n)}}}reportNoViableAlternative(t,n){const r=t.getTokenStream();let i;i=null!==r?n.startToken.type===e.EOF?"<EOF>":r.getText(new v(n.startToken.tokenIndex,n.offendingToken.tokenIndex)):"<unknown input>";const s="no viable alternative at input "+this.escapeWSAndQuote(i);t.notifyErrorListeners(s,n.offendingToken,n)}reportInputMismatch(e,t){const n="mismatched input "+this.getTokenErrorDisplay(t.offendingToken)+" expecting "+t.getExpectedTokens().toString(e.literalNames,e.symbolicNames);e.notifyErrorListeners(n,t.offendingToken,t)}reportFailedPredicate(e,t){const n="rule "+e.ruleNames[e._ctx.ruleIndex]+" "+t.message;e.notifyErrorListeners(n,t.offendingToken,t)}reportUnwantedToken(e){if(this.inErrorRecoveryMode(e))return;this.beginErrorCondition(e);const t=e.getCurrentToken(),n="extraneous input "+this.getTokenErrorDisplay(t)+" expecting "+this.getExpectedTokens(e).toString(e.literalNames,e.symbolicNames);e.notifyErrorListeners(n,t,null)}reportMissingToken(e){if(this.inErrorRecoveryMode(e))return;this.beginErrorCondition(e);const t=e.getCurrentToken(),n="missing "+this.getExpectedTokens(e).toString(e.literalNames,e.symbolicNames)+" at "+this.getTokenErrorDisplay(t);e.notifyErrorListeners(n,t,null)}recoverInline(e){const t=this.singleTokenDeletion(e);if(null!==t)return e.consume(),t;if(this.singleTokenInsertion(e))return this.getMissingSymbol(e);throw new mt(e)}singleTokenInsertion(e){const t=e.getTokenStream().LA(1),n=e._interp.atn,r=n.states[e.state].transitions[0].target;return!!n.nextTokens(r,e._ctx).contains(t)&&(this.reportMissingToken(e),!0)}singleTokenDeletion(e){const t=e.getTokenStream().LA(2);if(this.getExpectedTokens(e).contains(t)){this.reportUnwantedToken(e),e.consume();const t=e.getCurrentToken();return this.reportMatch(e),t}return null}getMissingSymbol(t){const n=t.getCurrentToken(),r=this.getExpectedTokens(t).first();let i;i=r===e.EOF?"<missing EOF>":"<missing "+t.literalNames[r]+">";let s=n;const o=t.getTokenStream().LT(-1);return s.type===e.EOF&&null!==o&&(s=o),t.getTokenFactory().create(s.source,r,i,e.DEFAULT_CHANNEL,-1,-1,s.line,s.column)}getExpectedTokens(e){return e.getExpectedTokens()}getTokenErrorDisplay(t){if(null===t)return"<no token>";let n=t.text;return null===n&&(n=t.type===e.EOF?"<EOF>":"<"+t.type+">"),this.escapeWSAndQuote(n)}escapeWSAndQuote(e){return"'"+(e=(e=(e=e.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"}getErrorRecoverySet(t){const n=t._interp.atn;let r=t._ctx;const i=new E;for(;null!==r&&r.invokingState>=0;){const e=n.states[r.invokingState].transitions[0],t=n.nextTokens(e.followState);i.addSet(t),r=r.parentCtx}return i.removeOne(e.EPSILON),i}consumeUntil(t,n){let r=t.getTokenStream().LA(1);for(;r!==e.EOF&&!n.contains(r);)t.consume(),r=t.getTokenStream().LA(1)}}class xt extends Tt{constructor(){super()}recover(e,t){let n=e._ctx;for(;null!==n;)n.exception=t,n=n.parentCtx;throw new Et(t)}recoverInline(e){this.recover(e,new mt(e))}sync(e){}}const wt={RecognitionException:Me,NoViableAltException:tt,LexerNoViableAltException:Fe,InputMismatchException:mt,FailedPredicateException:yt,DiagnosticErrorListener:vt,BailErrorStrategy:xt,DefaultErrorStrategy:Tt,ErrorListener:Oe};class St{constructor(e,t){if(this.name="<empty>",this.strdata=e,this.decodeToUnicodeCodePoints=t||!1,this._index=0,this.data=[],this.decodeToUnicodeCodePoints)for(let n=0;n<this.strdata.length;){const e=this.strdata.codePointAt(n);this.data.push(e),n+=e<=65535?1:2}else{this.data=new Array(this.strdata.length);for(let e=0;e<this.strdata.length;e++)this.data[e]=this.strdata.charCodeAt(e)}this._size=this.data.length}reset(){this._index=0}consume(){if(this._index>=this._size)throw"cannot consume EOF";this._index+=1}LA(t){if(0===t)return 0;t<0&&(t+=1);const n=this._index+t-1;return n<0||n>=this._size?e.EOF:this.data[n]}LT(e){return this.LA(e)}mark(){return-1}release(e){}seek(e){e<=this._index?this._index=e:this._index=Math.min(e,this._size)}getText(e,t){if(t>=this._size&&(t=this._size-1),e>=this._size)return"";if(this.decodeToUnicodeCodePoints){let n="";for(let r=e;r<=t;r++)n+=String.fromCodePoint(this.data[r]);return n}return this.strdata.slice(e,t+1)}toString(){return this.strdata}get index(){return this._index}get size(){return this._size}}class Rt extends St{constructor(e,t){super(e,t)}}var kt=r(92);const Ct="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node;class Ot extends Rt{static fromPath(e,t,n){if(!Ct)throw new Error("FileStream is only available when running in Node!");kt.readFile(e,t,(function(e,t){let r=null;null!==t&&(r=new St(t,!0)),n(e,r)}))}constructor(e,t,n){if(!Ct)throw new Error("FileStream is only available when running in Node!");super(kt.readFileSync(e,t||"utf-8"),n),this.fileName=e}}const At={fromString:function(e){return new St(e,!0)},fromBlob:function(e,t,n,r){const i=new window.FileReader;i.onload=function(e){const t=new St(e.target.result,!0);n(t)},i.onerror=r,i.readAsText(e,t)},fromBuffer:function(e,t){return new St(e.toString(t),!0)},fromPath:function(e,t,n){Ot.fromPath(e,t,n)},fromPathSync:function(e,t){return new Ot(e,t)}},Nt={arrayToString:u,stringToCharArray:function(e){let t=new Uint16Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}};class It{}class Lt extends It{constructor(e){super(),this.tokenSource=e,this.tokens=[],this.index=-1,this.fetchedEOF=!1}mark(){return 0}release(e){}reset(){this.seek(0)}seek(e){this.lazyInit(),this.index=this.adjustSeekIndex(e)}get size(){return this.tokens.length}get(e){return this.lazyInit(),this.tokens[e]}consume(){let t=!1;if(t=this.index>=0&&(this.fetchedEOF?this.index<this.tokens.length-1:this.index<this.tokens.length),!t&&this.LA(1)===e.EOF)throw"cannot consume EOF";this.sync(this.index+1)&&(this.index=this.adjustSeekIndex(this.index+1))}sync(e){const t=e-this.tokens.length+1;return!(t>0)||this.fetch(t)>=t}fetch(t){if(this.fetchedEOF)return 0;for(let n=0;n<t;n++){const t=this.tokenSource.nextToken();if(t.tokenIndex=this.tokens.length,this.tokens.push(t),t.type===e.EOF)return this.fetchedEOF=!0,n+1}return t}getTokens(t,n,r){if(void 0===r&&(r=null),t<0||n<0)return null;this.lazyInit();const i=[];n>=this.tokens.length&&(n=this.tokens.length-1);for(let s=t;s<n;s++){const t=this.tokens[s];if(t.type===e.EOF)break;(null===r||r.contains(t.type))&&i.push(t)}return i}LA(e){return this.LT(e).type}LB(e){return this.index-e<0?null:this.tokens[this.index-e]}LT(e){if(this.lazyInit(),0===e)return null;if(e<0)return this.LB(-e);const t=this.index+e-1;return this.sync(t),t>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[t]}adjustSeekIndex(e){return e}lazyInit(){-1===this.index&&this.setup()}setup(){this.sync(0),this.index=this.adjustSeekIndex(0)}setTokenSource(e){this.tokenSource=e,this.tokens=[],this.index=-1,this.fetchedEOF=!1}nextTokenOnChannel(t,n){if(this.sync(t),t>=this.tokens.length)return-1;let r=this.tokens[t];for(;r.channel!==this.channel;){if(r.type===e.EOF)return-1;t+=1,this.sync(t),r=this.tokens[t]}return t}previousTokenOnChannel(e,t){for(;e>=0&&this.tokens[e].channel!==t;)e-=1;return e}getHiddenTokensToRight(e,t){if(void 0===t&&(t=-1),this.lazyInit(),e<0||e>=this.tokens.length)throw e+" not in 0.."+this.tokens.length-1;const n=this.nextTokenOnChannel(e+1,Ue.DEFAULT_TOKEN_CHANNEL),r=e+1,i=-1===n?this.tokens.length-1:n;return this.filterForChannel(r,i,t)}getHiddenTokensToLeft(e,t){if(void 0===t&&(t=-1),this.lazyInit(),e<0||e>=this.tokens.length)throw e+" not in 0.."+this.tokens.length-1;const n=this.previousTokenOnChannel(e-1,Ue.DEFAULT_TOKEN_CHANNEL);if(n===e-1)return null;const r=n+1,i=e-1;return this.filterForChannel(r,i,t)}filterForChannel(e,t,n){const r=[];for(let i=e;i<t+1;i++){const e=this.tokens[i];-1===n?e.channel!==Ue.DEFAULT_TOKEN_CHANNEL&&r.push(e):e.channel===n&&r.push(e)}return 0===r.length?null:r}getSourceName(){return this.tokenSource.getSourceName()}getText(t){this.lazyInit(),this.fill(),t||(t=new v(0,this.tokens.length-1));let n=t.start;n instanceof e&&(n=n.tokenIndex);let r=t.stop;if(r instanceof e&&(r=r.tokenIndex),null===n||null===r||n<0||r<0)return"";r>=this.tokens.length&&(r=this.tokens.length-1);let i="";for(let s=n;s<r+1;s++){const t=this.tokens[s];if(t.type===e.EOF)break;i+=t.text}return i}fill(){for(this.lazyInit();1e3===this.fetch(1e3););}}Object.defineProperty(Lt,"size",{get:function(){return this.tokens.length}});class Dt extends Lt{constructor(t,n){super(t),this.channel=void 0===n?e.DEFAULT_CHANNEL:n}adjustSeekIndex(e){return this.nextTokenOnChannel(e,this.channel)}LB(e){if(0===e||this.index-e<0)return null;let t=this.index,n=1;for(;n<=e;)t=this.previousTokenOnChannel(t-1,this.channel),n+=1;return t<0?null:this.tokens[t]}LT(e){if(this.lazyInit(),0===e)return null;if(e<0)return this.LB(-e);let t=this.index,n=1;for(;n<e;)this.sync(t+1)&&(t=this.nextTokenOnChannel(t+1,this.channel)),n+=1;return this.tokens[t]}getNumberOfOnChannelTokens(){let t=0;this.fill();for(let n=0;n<this.tokens.length;n++){const r=this.tokens[n];if(r.channel===this.channel&&(t+=1),r.type===e.EOF)break}return t}}class Pt extends ht{constructor(e){super(),this.parser=e}enterEveryRule(e){console.log("enter "+this.parser.ruleNames[e.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}visitTerminal(e){console.log("consume "+e.symbol+" rule "+this.parser.ruleNames[this.parser._ctx.ruleIndex])}exitEveryRule(e){console.log("exit "+this.parser.ruleNames[e.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}}class Mt extends Ie{constructor(e){super(),this._input=null,this._errHandler=new Tt,this._precedenceStack=[],this._precedenceStack.push(0),this._ctx=null,this.buildParseTrees=!0,this._tracer=null,this._parseListeners=null,this._syntaxErrors=0,this.setInputStream(e)}reset(){null!==this._input&&this._input.seek(0),this._errHandler.reset(this),this._ctx=null,this._syntaxErrors=0,this.setTrace(!1),this._precedenceStack=[],this._precedenceStack.push(0),null!==this._interp&&this._interp.reset()}match(e){let t=this.getCurrentToken();return t.type===e?(this._errHandler.reportMatch(this),this.consume()):(t=this._errHandler.recoverInline(this),this.buildParseTrees&&-1===t.tokenIndex&&this._ctx.addErrorNode(t)),t}matchWildcard(){let e=this.getCurrentToken();return e.type>0?(this._errHandler.reportMatch(this),this.consume()):(e=this._errHandler.recoverInline(this),this.buildParseTrees&&-1===e.tokenIndex&&this._ctx.addErrorNode(e)),e}getParseListeners(){return this._parseListeners||[]}addParseListener(e){if(null===e)throw"listener";null===this._parseListeners&&(this._parseListeners=[]),this._parseListeners.push(e)}removeParseListener(e){if(null!==this._parseListeners){const t=this._parseListeners.indexOf(e);t>=0&&this._parseListeners.splice(t,1),0===this._parseListeners.length&&(this._parseListeners=null)}}removeParseListeners(){this._parseListeners=null}triggerEnterRuleEvent(){if(null!==this._parseListeners){const e=this._ctx;this._parseListeners.forEach((function(t){t.enterEveryRule(e),e.enterRule(t)}))}}triggerExitRuleEvent(){if(null!==this._parseListeners){const e=this._ctx;this._parseListeners.slice(0).reverse().forEach((function(t){e.exitRule(t),t.exitEveryRule(e)}))}}getTokenFactory(){return this._input.tokenSource._factory}setTokenFactory(e){this._input.tokenSource._factory=e}getATNWithBypassAlts(){const e=this.getSerializedATN();if(null===e)throw"The current parser does not support an ATN with bypass alternatives.";let t=this.bypassAltsAtnCache[e];if(null===t){const n=new ye;n.generateRuleBypassTransitions=!0,t=new Ce(n).deserialize(e),this.bypassAltsAtnCache[e]=t}return t}getInputStream(){return this.getTokenStream()}setInputStream(e){this.setTokenStream(e)}getTokenStream(){return this._input}setTokenStream(e){this._input=null,this.reset(),this._input=e}get syntaxErrorsCount(){return this._syntaxErrors}getCurrentToken(){return this._input.LT(1)}notifyErrorListeners(e,t,n){n=n||null,null===(t=t||null)&&(t=this.getCurrentToken()),this._syntaxErrors+=1;const r=t.line,i=t.column;this.getErrorListenerDispatch().syntaxError(this,t,r,i,e,n)}consume(){const t=this.getCurrentToken();t.type!==e.EOF&&this.getInputStream().consume();const n=null!==this._parseListeners&&this._parseListeners.length>0;if(this.buildParseTrees||n){let e;e=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(t):this._ctx.addTokenNode(t),e.invokingState=this.state,n&&this._parseListeners.forEach((function(t){e instanceof D||void 0!==e.isErrorNode&&e.isErrorNode()?t.visitErrorNode(e):e instanceof L&&t.visitTerminal(e)}))}return t}addContextToParseTree(){null!==this._ctx.parentCtx&&this._ctx.parentCtx.addChild(this._ctx)}enterRule(e,t,n){this.state=t,this._ctx=e,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}exitRule(){this._ctx.stop=this._input.LT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx}enterOuterAlt(e,t){e.setAltNumber(t),this.buildParseTrees&&this._ctx!==e&&null!==this._ctx.parentCtx&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(e)),this._ctx=e}getPrecedence(){return 0===this._precedenceStack.length?-1:this._precedenceStack[this._precedenceStack.length-1]}enterRecursionRule(e,t,n,r){this.state=t,this._precedenceStack.push(r),this._ctx=e,this._ctx.start=this._input.LT(1),this.triggerEnterRuleEvent()}pushNewRecursionContext(e,t,n){const r=this._ctx;r.parentCtx=e,r.invokingState=t,r.stop=this._input.LT(-1),this._ctx=e,this._ctx.start=r.start,this.buildParseTrees&&this._ctx.addChild(r),this.triggerEnterRuleEvent()}unrollRecursionContexts(e){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);const t=this._ctx,n=this.getParseListeners();if(null!==n&&n.length>0)for(;this._ctx!==e;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=e;t.parentCtx=e,this.buildParseTrees&&null!==e&&e.addChild(t)}getInvokingContext(e){let t=this._ctx;for(;null!==t;){if(t.ruleIndex===e)return t;t=t.parentCtx}return null}precpred(e,t){return t>=this._precedenceStack[this._precedenceStack.length-1]}inContext(e){return!1}isExpectedToken(t){const n=this._interp.atn;let r=this._ctx;const i=n.states[this.state];let s=n.nextTokens(i);if(s.contains(t))return!0;if(!s.contains(e.EPSILON))return!1;for(;null!==r&&r.invokingState>=0&&s.contains(e.EPSILON);){const e=n.states[r.invokingState].transitions[0];if(s=n.nextTokens(e.followState),s.contains(t))return!0;r=r.parentCtx}return!(!s.contains(e.EPSILON)||t!==e.EOF)}getExpectedTokens(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)}getExpectedTokensWithinCurrentRule(){const e=this._interp.atn,t=e.states[this.state];return e.nextTokens(t)}getRuleIndex(e){const t=this.getRuleIndexMap()[e];return null!==t?t:-1}getRuleInvocationStack(e){null===(e=e||null)&&(e=this._ctx);const t=[];for(;null!==e;){const n=e.ruleIndex;n<0?t.push("n/a"):t.push(this.ruleNames[n]),e=e.parentCtx}return t}getDFAStrings(){return this._interp.decisionToDFA.toString()}dumpDFA(){let e=!1;for(let t=0;t<this._interp.decisionToDFA.length;t++){const n=this._interp.decisionToDFA[t];n.states.length>0&&(e&&console.log(),this.printer.println("Decision "+n.decision+":"),this.printer.print(n.toString(this.literalNames,this.symbolicNames)),e=!0)}}getSourceName(){return this._input.sourceName}setTrace(e){e?(null!==this._tracer&&this.removeParseListener(this._tracer),this._tracer=new Pt(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)}}Mt.bypassAltsAtnCache={};class Ft extends L{constructor(e){super(),this.parentCtx=null,this.symbol=e}getChild(e){return null}getSymbol(){return this.symbol}getParent(){return this.parentCtx}getPayload(){return this.symbol}getSourceInterval(){if(null===this.symbol)return v.INVALID_INTERVAL;const e=this.symbol.tokenIndex;return new v(e,e)}getChildCount(){return 0}accept(e){return e.visitTerminal(this)}getText(){return this.symbol.text}toString(){return this.symbol.type===e.EOF?"<EOF>":this.symbol.text}}class Ut extends Ft{constructor(e){super(e)}isErrorNode(){return!0}accept(e){return e.visitErrorNode(this)}}class jt extends F{constructor(e,t){super(e,t),this.children=null,this.start=null,this.stop=null,this.exception=null}copyFrom(e){this.parentCtx=e.parentCtx,this.invokingState=e.invokingState,this.children=null,this.start=e.start,this.stop=e.stop,e.children&&(this.children=[],e.children.map((function(e){e instanceof Ut&&(this.children.push(e),e.parentCtx=this)}),this))}enterRule(e){}exitRule(e){}addChild(e){return null===this.children&&(this.children=[]),this.children.push(e),e}removeLastChild(){null!==this.children&&this.children.pop()}addTokenNode(e){const t=new Ft(e);return this.addChild(t),t.parentCtx=this,t}addErrorNode(e){const t=new Ut(e);return this.addChild(t),t.parentCtx=this,t}getChild(e,t){if(t=t||null,null===this.children||e<0||e>=this.children.length)return null;if(null===t)return this.children[e];for(let n=0;n<this.children.length;n++){const r=this.children[n];if(r instanceof t){if(0===e)return r;e-=1}}return null}getToken(e,t){if(null===this.children||t<0||t>=this.children.length)return null;for(let n=0;n<this.children.length;n++){const r=this.children[n];if(r instanceof L&&r.symbol.type===e){if(0===t)return r;t-=1}}return null}getTokens(e){if(null===this.children)return[];{const t=[];for(let n=0;n<this.children.length;n++){const r=this.children[n];r instanceof L&&r.symbol.type===e&&t.push(r)}return t}}getTypedRuleContext(e,t){return this.getChild(t,e)}getTypedRuleContexts(e){if(null===this.children)return[];{const t=[];for(let n=0;n<this.children.length;n++){const r=this.children[n];r instanceof e&&t.push(r)}return t}}getChildCount(){return null===this.children?0:this.children.length}getSourceInterval(){return null===this.start||null===this.stop?v.INVALID_INTERVAL:new v(this.start.tokenIndex,this.stop.tokenIndex)}}F.EMPTY=new jt;class Bt{static DEFAULT_PROGRAM_NAME="default";constructor(e){this.tokens=e,this.programs=new Map}getTokenStream(){return this.tokens}insertAfter(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bt.DEFAULT_PROGRAM_NAME;n="number"==typeof e?e:e.tokenIndex;let i=this.getProgram(r),s=new zt(this.tokens,n,i.length,t);i.push(s)}insertBefore(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bt.DEFAULT_PROGRAM_NAME;n="number"==typeof e?e:e.tokenIndex;const i=this.getProgram(r),s=new $t(this.tokens,n,i.length,t);i.push(s)}replaceSingle(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bt.DEFAULT_PROGRAM_NAME;this.replace(e,e,t,n)}replace(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Bt.DEFAULT_PROGRAM_NAME;if("number"!=typeof e&&(e=e.tokenIndex),"number"!=typeof t&&(t=t.tokenIndex),e>t||e<0||t<0||t>=this.tokens.size)throw new RangeError(`replace: range invalid: ${e}..${t}(size=${this.tokens.size})`);let i=this.getProgram(r),s=new Vt(this.tokens,e,t,i.length,n);i.push(s)}delete(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bt.DEFAULT_PROGRAM_NAME;void 0===t&&(t=e),this.replace(e,t,null,n)}getProgram(e){let t=this.programs.get(e);return null==t&&(t=this.initializeProgram(e)),t}initializeProgram(e){const t=[];return this.programs.set(e,t),t}getText(t){let n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bt.DEFAULT_PROGRAM_NAME;n=t instanceof v?t:new v(0,this.tokens.size-1),"string"==typeof t&&(r=t);const i=this.programs.get(r);let s=n.start,o=n.stop;if(o>this.tokens.size-1&&(o=this.tokens.size-1),s<0&&(s=0),null==i||0===i.length)return this.tokens.getText(new v(s,o));let a=[],l=this.reduceToSingleOperationPerIndex(i),c=s;for(;c<=o&&c<this.tokens.size;){let t=l.get(c);l.delete(c);let n=this.tokens.get(c);null==t?(n.type!==e.EOF&&a.push(String(n.text)),c++):c=t.execute(a)}if(o===this.tokens.size-1)for(const e of l.values())e.index>=this.tokens.size-1&&a.push(e.text.toString());return a.join("")}reduceToSingleOperationPerIndex(e){for(let n=0;n<e.length;n++){let t=e[n];if(null==t)continue;if(!(t instanceof Vt))continue;let r=t,i=this.getKindOfOps(e,$t,n);for(let n of i)n.index===r.index?(e[n.instructionIndex]=void 0,r.text=n.text.toString()+(null!=r.text?r.text.toString():"")):n.index>r.index&&n.index<=r.lastIndex&&(e[n.instructionIndex]=void 0);let s=this.getKindOfOps(e,Vt,n);for(let n of s){if(n.index>=r.index&&n.lastIndex<=r.lastIndex){e[n.instructionIndex]=void 0;continue}let t=n.lastIndex<r.index||n.index>r.lastIndex;if(null!=n.text||null!=r.text||t){if(!t)throw new Error(`replace op boundaries of ${r} overlap with previous ${n}`)}else e[n.instructionIndex]=void 0,r.index=Math.min(n.index,r.index),r.lastIndex=Math.max(n.lastIndex,r.lastIndex)}}for(let n=0;n<e.length;n++){let t=e[n];if(null==t)continue;if(!(t instanceof $t))continue;let r=t,i=this.getKindOfOps(e,$t,n);for(let n of i)n.index===r.index&&(n instanceof zt?(r.text=this.catOpText(n.text,r.text),e[n.instructionIndex]=void 0):n instanceof $t&&(r.text=this.catOpText(r.text,n.text),e[n.instructionIndex]=void 0));let s=this.getKindOfOps(e,Vt,n);for(let o of s)if(r.index!==o.index){if(r.index>=o.index&&r.index<=o.lastIndex)throw new Error(`insert op ${r} within boundaries of previous ${o}`)}else o.text=this.catOpText(r.text,o.text),e[n]=void 0}let t=new Map;for(let n of e)if(null!=n){if(null!=t.get(n.index))throw new Error("should only be one op per index");t.set(n.index,n)}return t}catOpText(e,t){let n="",r="";return null!=e&&(n=e.toString()),null!=t&&(r=t.toString()),n+r}getKindOfOps(e,t,n){return e.slice(0,n).filter((e=>e&&e instanceof t))}}class Ht{constructor(e,t,n,r){this.tokens=e,this.instructionIndex=n,this.index=t,this.text=void 0===r?"":r}toString(){let e=this.constructor.name;const t=e.indexOf("$");return e=e.substring(t+1,e.length),"<"+e+"@"+this.tokens.get(this.index)+':"'+this.text+'">'}}class $t extends Ht{constructor(e,t,n,r){super(e,t,n,r)}execute(t){return this.text&&t.push(this.text.toString()),this.tokens.get(this.index).type!==e.EOF&&t.push(String(this.tokens.get(this.index).text)),this.index+1}}class zt extends $t{constructor(e,t,n,r){super(e,t+1,n,r)}}class Vt extends Ht{constructor(e,t,n,r,i){super(e,t,r,i),this.lastIndex=n}execute(e){return this.text&&e.push(this.text.toString()),this.lastIndex+1}toString(){return null==this.text?"<DeleteOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+">":"<ReplaceOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+':"'+this.text+'">'}}const Gt={atn:st,dfa:ct,context:ut,misc:dt,tree:gt,error:wt,Token:e,CommonToken:Le,CharStreams:At,CharStream:Rt,InputStream:Rt,CommonTokenStream:Dt,Lexer:Ue,Parser:Mt,ParserRuleContext:jt,Interval:v,IntervalSet:E,LL1Analyzer:Y,Utils:Nt,TokenStreamRewriter:Bt}})();var s=t;for(var o in i)s[o]=i[o];i.__esModule&&Object.defineProperty(s,"__esModule",{value:!0})})()},36809:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={title:"OpenFGA",tagline:"Relationship-based access control made fast, scalable, and easy to use.",url:"https://openfga.dev",baseUrl:"/",trailingSlash:!1,onBrokenLinks:"throw",onBrokenMarkdownLinks:"warn",favicon:"/img/openfga-icon.svg",organizationName:"openfga",projectName:"openfga.dev",i18n:{defaultLocale:"en",locales:["en"],path:"i18n",localeConfigs:{}},deploymentBranch:"gh-pages",customFields:{resources:[{text:"Zanzibar Academy \u2192",href:"https://zanzibar.academy/",icon:"ZanzibarIcon"},{text:"Okta FGA Playground \u2192",href:"https://play.fga.dev/",icon:"ModelIcon"},{text:"Podcast - Authorization in Software \u2192",href:"https://authorizationinsoftware.auth0.com/",icon:"PodcastIcon"}],feedback:{defaultTitle:"Have Feedback?",defaultText:"Join us on the Discord community if you have any questions or suggestions.",defaultButtonText:"Join Discord",defaultLink:"https://discord.gg/8naAwJfWN6"},apiDocsBasePath:"https://raw.githubusercontent.com/openfga/api/main/docs/openapiv2/apidocs.swagger.json",description:"OpenFGA is an open source Fine-Grained Authorization solution based on Google's Zanzibar.",productName:"OpenFGA",introLink:"docs/authorization-and-openfga",productDescriptionSection:"#what-is-openfga",conceptLink:"docs/concepts",longProductName:"OpenFGA",landingPageTitle:"Fine Grained Authorization",languageMapping:{js:{importStatement:"const { OpenFgaClient } = require('@openfga/sdk');",apiName:"OpenFgaClient",setupNote:"// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.\n"},go:{importStatement:'. "github.com/openfga/go-sdk/client"',apiName:"OpenFgaClient",setupNote:"// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.\n"},dotnet:{importStatement:"using OpenFga.Sdk.Client;\nusing OpenFga.Sdk.Client.Model;\nusing OpenFga.Sdk.Model;",apiName:"OpenFgaClient",setupNote:"// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.\n"},python:{importStatement:"import os\nimport json\nimport openfga_sdk\nfrom openfga_sdk.client import OpenFgaClient",apiName:"OpenFgaClient",setupNote:"# ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.\n"}},contentSecurityPolicy:"default-src 'none';\n base-uri 'self';\n block-all-mixed-content;\n child-src www.youtube-nocookie.com;\n prefetch-src 'self';\n connect-src 'self' https://raw.githubusercontent.com https://s3.amazonaws.com https://cdn.cookielaw.org https://privacyportal.onetrust.com https://heapanalytics.com https://js.hs-scripts.com https://api.github.com https://js.hscollectedforms.net https://js.hs-analytics.net https://js.hs-banner.com https://forms.hscollectedforms.net ;\n font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com;\n form-action 'none';\n frame-src www.youtube-nocookie.com;\n img-src 'self' data: https://pbs.twimg.com https://docs.github.com https://heapanalytics.com https://forms.hsforms.com https://track.hubspot.com ;\n media-src 'self';\n object-src 'none';\n script-src 'self' 'unsafe-inline' https://cdn.cookielaw.org https://geolocation.onetrust.com https://cdn.heapanalytics.com https://js.hs-scripts.com https://api.github.com https://js.hscollectedforms.net https://js.hs-analytics.net https://js.hs-banner.com;\n style-src 'unsafe-inline' 'self' https://fonts.googleapis.com;"},themes:[["/home/runner/work/openfga.dev/openfga.dev/node_modules/@easyops-cn/docusaurus-search-local/dist/server/server/index.js",{hashed:!0,docsDir:"docs/content",docsRouteBasePath:"/"}]],plugins:["/home/runner/work/openfga.dev/openfga.dev/webpack-overrides.docusaurus-plugin.js",["@docusaurus/plugin-client-redirects",{fromExtensions:["html"],redirects:[{to:"/api/service",from:["/api"]},{to:"/docs/authorization-and-openfga",from:"/docs"}]}],["docusaurus-plugin-module-alias",{alias:{"@components":"/home/runner/work/openfga.dev/openfga.dev/src/components","@features":"/home/runner/work/openfga.dev/openfga.dev/src/features","@static":"/home/runner/work/openfga.dev/openfga.dev/static"}}]],presets:[["classic",{debug:!1,docs:{sidebarPath:"/home/runner/work/openfga.dev/openfga.dev/docs/sidebars.js",routeBasePath:"/docs",exclude:["**/README.md"],showLastUpdateAuthor:!1,editUrl:"https://github.com/openfga/openfga.dev/edit/main/"},theme:{customCss:["/home/runner/work/openfga.dev/openfga.dev/static/css/openfga.css","/home/runner/work/openfga.dev/openfga.dev/src/css/custom.css"]}}]],stylesheets:["https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap","https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"],themeConfig:{metadata:[{name:"keywords",content:"OpenFGA, open source, fine-grained-authorization, fine grained authorization, Zanzibar"},{property:"og:image",content:"https://openfga.dev/img/og-rich-embed.png"}],colorMode:{defaultMode:"dark",disableSwitch:!0,respectPrefersColorScheme:!1},navbar:{logo:{alt:"OpenFGA",src:"img/openfga_logo.svg",href:"/",target:"_self"},items:[{to:"/",label:"Home",position:"left"},{type:"docSidebar",sidebarId:"docs",position:"left",label:"Docs"},{to:"/api/service",label:"API",position:"left"},{to:"/blog",label:"Blog",position:"left"},{to:"https://github.com/openfga/openfga",position:"right",label:"GitHub",className:"header-social header-github-link","aria-label":"OpenFGA on GitHub"},{to:"https://twitter.com/OpenFGA",label:"Twitter",position:"right",className:"header-social header-twitter-link","aria-label":"OpenFGA on Twitter"},{to:"https://discord.gg/8naAwJfWN6",label:"Discord",position:"right",className:"header-social header-discord-link","aria-label":"OpenFGA on Discord"}],hideOnScroll:!1},footer:{links:[{to:"https://twitter.com/OpenFGA",className:"header-social header-twitter-link","aria-label":"OpenFGA on Twitter",label:"Twitter"},{to:"https://discord.gg/8naAwJfWN6",className:"header-social header-discord-link","aria-label":"OpenFGA on Discord",label:"Discord"},{to:"https://github.com/openfga",className:"header-social header-github-link","aria-label":"OpenFGA on GitHub",label:"GitHub"}],copyright:'<div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;" /></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>\xae. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div>',style:"light"},prism:{theme:{plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},darkTheme:{plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},additionalLanguages:["json5","csharp"],magicComments:[{className:"theme-code-block-highlighted-line",line:"highlight-next-line",block:{start:"highlight-start",end:"highlight-end"}}]},docs:{sidebar:{hideable:!0,autoCollapseCategories:!1},versionPersistence:"localStorage"},tableOfContents:{minHeadingLevel:2,maxHeadingLevel:3}},scripts:[{src:"https://js.hs-scripts.com/24392211.js",type:"text/javascript",charset:"UTF-8",id:"hs-script-loader",async:!0,defer:!0}],baseUrlIssueBanner:!0,onDuplicateRoutes:"warn",staticDirectories:["static"],headTags:[],clientModules:[],titleDelimiter:"|",noIndex:!1,markdown:{mermaid:!1}}},87462:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{Z:()=>r})},75068:(e,t,n)=>{"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,{Z:()=>i})},63366:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}n.d(t,{Z:()=>r})},38776:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=!0,i="Invariant failed";function s(e,t){if(!e){if(r)throw new Error(i);var n="function"==typeof t?t():t,s=n?"".concat(i,": ").concat(n):i;throw new Error(s)}}},57529:e=>{"use strict";e.exports={}},16887:e=>{"use strict";e.exports=JSON.parse('{"/api/service-814":{"__comp":"acf022e4","__context":{"plugin":"7bbc0b76"},"config":"5e9f5e1a"},"/blog-c0d":{"__comp":"a6aa9e1f","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","items":[{"content":"caf99389"},{"content":"03f1273c"}],"metadata":"b2b675dd"},"/blog/archive-404":{"__comp":"9e4087bc","__context":{"plugin":"e4a0c232"},"archive":"b2f554cd"},"/blog/conditional-tuples-announcement-2f7":{"__comp":"ccc49370","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","content":"a2ab5d86"},"/blog/kubecon-na-2023-a5a":{"__comp":"ccc49370","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","content":"5dfc8d6a"},"/blog/tags-75b":{"__comp":"01a85c17","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","tags":"a7023ddc"},"/blog/tags/conferences-ad4":{"__comp":"6875c492","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","items":[{"content":"03f1273c"}],"tag":"24bd3649","listMetadata":"89e713ce"},"/blog/tags/features-e37":{"__comp":"6875c492","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","items":[{"content":"caf99389"}],"tag":"69d8fa2b","listMetadata":"2ca0b854"},"/blog/tags/kubecon-243":{"__comp":"6875c492","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","items":[{"content":"03f1273c"}],"tag":"34c50772","listMetadata":"f849ae1d"},"/blog/tags/openfga-482":{"__comp":"6875c492","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","items":[{"content":"caf99389"}],"tag":"b3e13dba","listMetadata":"0be4346b"},"/search-893":{"__comp":"1a4e3797","__context":{"plugin":"3827dd5a"}},"/docs-f29":{"__comp":"1be78505","__context":{"plugin":"a36c58ef"},"versionMetadata":"935f2afb"},"/docs/authorization-and-openfga-b75":{"__comp":"17896441","content":"882ec15a"},"/docs/concepts-c63":{"__comp":"17896441","content":"bd85ffac"},"/docs/configuration-language-284":{"__comp":"17896441","content":"33b74eba"},"/docs/getting-started-45c":{"__comp":"17896441","content":"da16da38"},"/docs/getting-started/configure-model-3d5":{"__comp":"17896441","content":"7742897f"},"/docs/getting-started/create-store-d80":{"__comp":"17896441","content":"db2cdc18"},"/docs/getting-started/framework-11b":{"__comp":"17896441","content":"18eda3ee"},"/docs/getting-started/immutable-models-9a4":{"__comp":"17896441","content":"3759cf4b"},"/docs/getting-started/install-sdk-54c":{"__comp":"17896441","content":"87c4c920"},"/docs/getting-started/perform-check-64c":{"__comp":"17896441","content":"cb8ccc1a"},"/docs/getting-started/perform-list-objects-c00":{"__comp":"17896441","content":"c0e854c3"},"/docs/getting-started/running-in-production-3df":{"__comp":"17896441","content":"4c2069ba"},"/docs/getting-started/setup-openfga/docker-41b":{"__comp":"17896441","content":"e23d3c5f"},"/docs/getting-started/setup-openfga/kubernetes-577":{"__comp":"17896441","content":"1bbc0b1c"},"/docs/getting-started/setup-openfga/overview-dc6":{"__comp":"17896441","content":"116d061d"},"/docs/getting-started/setup-sdk-client-084":{"__comp":"17896441","content":"3a191a7b"},"/docs/getting-started/tuples-api-best-practices-118":{"__comp":"17896441","content":"487f279c"},"/docs/getting-started/update-tuples-98a":{"__comp":"17896441","content":"34a3e208"},"/docs/interacting-073":{"__comp":"17896441","content":"9c4cd4c4"},"/docs/interacting/managing-group-access-e78":{"__comp":"17896441","content":"4337ba13"},"/docs/interacting/managing-group-membership-970":{"__comp":"17896441","content":"b89f0a14"},"/docs/interacting/managing-relationships-between-objects-36d":{"__comp":"17896441","content":"3d83e150"},"/docs/interacting/managing-user-access-fa6":{"__comp":"17896441","content":"3aada504"},"/docs/interacting/read-tuple-changes-07b":{"__comp":"17896441","content":"028b1cc5"},"/docs/interacting/relationship-queries-e5d":{"__comp":"17896441","content":"73db2c80"},"/docs/interacting/search-with-permissions-86b":{"__comp":"17896441","content":"76c18be1"},"/docs/interacting/transactional-writes-073":{"__comp":"17896441","content":"ed2f6563"},"/docs/modeling-d15":{"__comp":"17896441","content":"4a075682"},"/docs/modeling/advanced-3c0":{"__comp":"17896441","content":"63b646c1"},"/docs/modeling/advanced/entitlements-260":{"__comp":"17896441","content":"97140aee"},"/docs/modeling/advanced/gdrive-c55":{"__comp":"17896441","content":"b2fd7883"},"/docs/modeling/advanced/github-0ad":{"__comp":"17896441","content":"4427aa46"},"/docs/modeling/advanced/iot-e2c":{"__comp":"17896441","content":"78431c72"},"/docs/modeling/advanced/slack-34d":{"__comp":"17896441","content":"f5ba7293"},"/docs/modeling/blocklists-e4f":{"__comp":"17896441","content":"87a4c587"},"/docs/modeling/building-blocks-8ce":{"__comp":"17896441","content":"5ccffc9c"},"/docs/modeling/building-blocks/concentric-relationships-1b8":{"__comp":"17896441","content":"3652cf2a"},"/docs/modeling/building-blocks/direct-relationships-d44":{"__comp":"17896441","content":"4204f988"},"/docs/modeling/building-blocks/object-to-object-relationships-eaa":{"__comp":"17896441","content":"15369573"},"/docs/modeling/building-blocks/usersets-905":{"__comp":"17896441","content":"a09a1188"},"/docs/modeling/contextual-time-based-authorization-9fb":{"__comp":"17896441","content":"e260e0bb"},"/docs/modeling/custom-roles-860":{"__comp":"17896441","content":"7284575f"},"/docs/modeling/direct-access-00b":{"__comp":"17896441","content":"30325ba4"},"/docs/modeling/getting-started-9ce":{"__comp":"17896441","content":"6786195a"},"/docs/modeling/migrating-780":{"__comp":"17896441","content":"0938166f"},"/docs/modeling/migrating/migrating-relations-d6a":{"__comp":"17896441","content":"bb879dcd"},"/docs/modeling/migrating/migrating-schema-1-1-709":{"__comp":"17896441","content":"69ced8de"},"/docs/modeling/multiple-restrictions-74b":{"__comp":"17896441","content":"4920f1c1"},"/docs/modeling/organization-context-authorization-597":{"__comp":"17896441","content":"9578a8cf"},"/docs/modeling/parent-child-34a":{"__comp":"17896441","content":"6a4b619d"},"/docs/modeling/public-access-e9a":{"__comp":"17896441","content":"78aaed86"},"/docs/modeling/roles-and-permissions-fef":{"__comp":"17896441","content":"d3d4dca1"},"/docs/modeling/user-groups-2d1":{"__comp":"17896441","content":"439d46c1"},"/-a17":{"__comp":"1df93b7f","__context":{"plugin":"7bbc0b76"},"config":"5e9f5e1a"}}')},57904:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"user","relations":{}},{"type":"team","relations":{"member":{"this":{}}},"metadata":{"relations":{"member":{"directly_related_user_types":[{"type":"user"}]}}}},{"type":"role","relations":{"assignee":{"this":{}}},"metadata":{"relations":{"assignee":{"directly_related_user_types":[{"type":"user"},{"type":"team","object":"member"},{"type":"org","object":"member"}]}}}},{"type":"org","relations":{"asset_category_creator":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"asset_commenter":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"asset_editor"}}]}},"asset_creator":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"asset_editor":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"asset_viewer":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"asset_commenter"}}]}},"member":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"owner":{"this":{}},"role_assigner":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"role_creator":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"team_assigner":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"team_creator":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}}},"metadata":{"relations":{"asset_category_creator":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"asset_commenter":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"asset_creator":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"asset_editor":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"asset_viewer":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"member":{"directly_related_user_types":[{"type":"user"}]},"owner":{"directly_related_user_types":[{"type":"user"}]},"role_assigner":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"role_creator":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"team_assigner":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"team_creator":{"directly_related_user_types":[{"type":"role","object":"assignee"}]}}}},{"type":"asset-category","relations":{"asset_creator":{"union":{"child":[{"this":{}},{"tupleToUserset":{"tupleset":{"object":"","relation":"org"},"computedUserset":{"object":"","relation":"asset_creator"}}}]}},"commenter":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"editor"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"org"},"computedUserset":{"object":"","relation":"asset_commenter"}}}]}},"editor":{"union":{"child":[{"this":{}},{"tupleToUserset":{"tupleset":{"object":"","relation":"org"},"computedUserset":{"object":"","relation":"asset_editor"}}}]}},"org":{"this":{}},"viewer":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"commenter"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"org"},"computedUserset":{"object":"","relation":"asset_viewer"}}}]}}},"metadata":{"relations":{"asset_creator":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"commenter":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"editor":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"org":{"directly_related_user_types":[{"type":"org"}]},"viewer":{"directly_related_user_types":[{"type":"role","object":"assignee"}]}}}},{"type":"asset","relations":{"category":{"this":{}},"comment":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"edit"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"category"},"computedUserset":{"object":"","relation":"commenter"}}}]}},"edit":{"union":{"child":[{"this":{}},{"tupleToUserset":{"tupleset":{"object":"","relation":"category"},"computedUserset":{"object":"","relation":"editor"}}}]}},"view":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"comment"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"category"},"computedUserset":{"object":"","relation":"viewer"}}}]}}},"metadata":{"relations":{"category":{"directly_related_user_types":[{"type":"asset-category"}]},"comment":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"edit":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"view":{"directly_related_user_types":[{"type":"role","object":"assignee"}]}}}}]}')},98633:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"user","relations":{}},{"type":"plan","relations":{"subscriber":{"this":{}},"subscriber_member":{"tupleToUserset":{"tupleset":{"object":"","relation":"subscriber"},"computedUserset":{"object":"","relation":"member"}}}},"metadata":{"relations":{"subscriber":{"directly_related_user_types":[{"type":"organization"}]},"subscriber_member":{"directly_related_user_types":[]}}}},{"type":"organization","relations":{"member":{"this":{}}},"metadata":{"relations":{"member":{"directly_related_user_types":[{"type":"user"}]}}}},{"type":"feature","relations":{"can_access":{"tupleToUserset":{"tupleset":{"object":"","relation":"associated_plan"},"computedUserset":{"object":"","relation":"subscriber_member"}}},"associated_plan":{"this":{}}},"metadata":{"relations":{"can_access":{"directly_related_user_types":[]},"associated_plan":{"directly_related_user_types":[{"type":"plan"}]}}}}]}')},98547:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"employee","relations":{"manager":{"this":{}},"can_manage":{"union":{"child":[{"computedUserset":{"relation":"manager"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"manager"},"computedUserset":{"object":"","relation":"can_manage"}}}]}}},"metadata":{"relations":{"manager":{"directly_related_user_types":[{"type":"employee"}]}}}},{"type":"report","relations":{"submitter":{"this":{}},"approver":{"tupleToUserset":{"tupleset":{"object":"","relation":"submitter"},"computedUserset":{"object":"","relation":"can_manage"}}}},"metadata":{"relations":{"submitter":{"directly_related_user_types":[{"type":"employee"}]},"approver":{"directly_related_user_types":[]}}}}]}')},94014:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"user","relations":{}},{"type":"group","relations":{"member":{"this":{}}},"metadata":{"relations":{"member":{"directly_related_user_types":[{"type":"user"}]}}}},{"type":"folder","relations":{"can_create_file":{"computedUserset":{"object":"","relation":"owner"}},"owner":{"this":{}},"parent":{"this":{}},"viewer":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"parent"},"computedUserset":{"object":"","relation":"viewer"}}}]}}},"metadata":{"relations":{"can_create_file":{"directly_related_user_types":[]},"owner":{"directly_related_user_types":[{"type":"user"}]},"parent":{"directly_related_user_types":[{"type":"folder"}]},"viewer":{"directly_related_user_types":[{"type":"user"},{"type":"user","wildcard":{}},{"type":"group","relation":"member"}]}}}},{"type":"doc","relations":{"can_change_owner":{"computedUserset":{"object":"","relation":"owner"}},"owner":{"this":{}},"parent":{"this":{}},"can_read":{"union":{"child":[{"computedUserset":{"object":"","relation":"viewer"}},{"computedUserset":{"object":"","relation":"owner"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"parent"},"computedUserset":{"object":"","relation":"viewer"}}}]}},"can_share":{"union":{"child":[{"computedUserset":{"object":"","relation":"owner"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"parent"},"computedUserset":{"object":"","relation":"owner"}}}]}},"viewer":{"this":{}},"can_write":{"union":{"child":[{"computedUserset":{"object":"","relation":"owner"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"parent"},"computedUserset":{"object":"","relation":"owner"}}}]}}},"metadata":{"relations":{"can_change_owner":{"directly_related_user_types":[]},"owner":{"directly_related_user_types":[{"type":"user"}]},"parent":{"directly_related_user_types":[{"type":"folder"}]},"can_read":{"directly_related_user_types":[]},"can_share":{"directly_related_user_types":[]},"viewer":{"directly_related_user_types":[{"type":"user"},{"type":"user","wildcard":{}},{"type":"group","relation":"member"}]},"can_write":{"directly_related_user_types":[]}}}}]}')},56918:e=>{"use strict";e.exports=JSON.parse('{"type_definitions":[{"type":"user","relations":{}},{"type":"group","relations":{"member":{"this":{}}},"metadata":{"relations":{"member":{"directly_related_user_types":[{"type":"user"}]}}}},{"type":"resource","relations":{"can_edit":{"computedUserset":{"object":"","relation":"editor"}},"can_view":{"union":{"child":[{"computedUserset":{"object":"","relation":"viewer"}},{"computedUserset":{"object":"","relation":"editor"}}]}},"editor":{"this":{}},"viewer":{"this":{}}},"metadata":{"relations":{"can_edit":{"directly_related_user_types":[]},"can_view":{"directly_related_user_types":[]},"editor":{"directly_related_user_types":[{"type":"user"},{"type":"group","relation":"member"}]},"viewer":{"directly_related_user_types":[{"type":"user"},{"type":"group","relation":"member"}]}}}}],"schema_version":"1.1"}')},84001:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"user","relations":{}},{"type":"team","relations":{"member":{"this":{}}},"metadata":{"relations":{"member":{"directly_related_user_types":[{"type":"user"},{"type":"team","relation":"member"}]}}}},{"type":"repo","relations":{"admin":{"union":{"child":[{"this":{}},{"tupleToUserset":{"tupleset":{"object":"","relation":"owner"},"computedUserset":{"object":"","relation":"repo_admin"}}}]}},"maintainer":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"admin"}}]}},"owner":{"this":{}},"reader":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"triager"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"owner"},"computedUserset":{"object":"","relation":"repo_reader"}}}]}},"triager":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"writer"}}]}},"writer":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"maintainer"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"owner"},"computedUserset":{"object":"","relation":"repo_writer"}}}]}}},"metadata":{"relations":{"admin":{"directly_related_user_types":[{"type":"user"},{"type":"team","relation":"member"}]},"maintainer":{"directly_related_user_types":[{"type":"user"},{"type":"team","relation":"member"}]},"owner":{"directly_related_user_types":[{"type":"organization"}]},"reader":{"directly_related_user_types":[{"type":"user"},{"type":"team","relation":"member"}]},"triager":{"directly_related_user_types":[{"type":"user"},{"type":"team","relation":"member"}]},"writer":{"directly_related_user_types":[{"type":"user"},{"type":"team","relation":"member"}]}}}},{"type":"organization","relations":{"member":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"owner":{"this":{}},"repo_admin":{"this":{}},"repo_reader":{"this":{}},"repo_writer":{"this":{}}},"metadata":{"relations":{"member":{"directly_related_user_types":[{"type":"user"}]},"owner":{"directly_related_user_types":[{"type":"user"}]},"repo_admin":{"directly_related_user_types":[{"type":"user"},{"type":"organization","relation":"member"}]},"repo_reader":{"directly_related_user_types":[{"type":"user"},{"type":"organization","relation":"member"}]},"repo_writer":{"directly_related_user_types":[{"type":"user"},{"type":"organization","relation":"member"}]}}}}]}')},96418:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"user","relations":{}},{"type":"device_group","relations":{"it_admin":{"this":{}},"security_guard":{"this":{}}},"metadata":{"relations":{"it_admin":{"directly_related_user_types":[{"type":"user"}]},"security_guard":{"directly_related_user_types":[{"type":"user"}]}}}},{"type":"device","relations":{"can_rename_device":{"computedUserset":{"object":"","relation":"it_admin"}},"it_admin":{"this":{}},"can_view_live_video":{"union":{"child":[{"computedUserset":{"object":"","relation":"it_admin"}},{"computedUserset":{"object":"","relation":"security_guard"}}]}},"can_view_recorded_video":{"union":{"child":[{"computedUserset":{"object":"","relation":"it_admin"}},{"computedUserset":{"object":"","relation":"security_guard"}}]}},"security_guard":{"this":{}}},"metadata":{"relations":{"can_rename_device":{"directly_related_user_types":[]},"it_admin":{"directly_related_user_types":[{"type":"user"},{"type":"device_group","relation":"it_admin"}]},"can_view_live_video":{"directly_related_user_types":[]},"can_view_recorded_video":{"directly_related_user_types":[]},"security_guard":{"directly_related_user_types":[{"type":"user"},{"type":"device_group","relation":"security_guard"}]}}}}]}')},63542:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"user","relations":{}},{"type":"workspace","relations":{"channels_admin":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"legacy_admin"}}]}},"guest":{"this":{}},"legacy_admin":{"this":{}},"member":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"legacy_admin"}},{"computedUserset":{"object":"","relation":"channels_admin"}}]}}},"metadata":{"relations":{"channels_admin":{"directly_related_user_types":[{"type":"user"}]},"guest":{"directly_related_user_types":[{"type":"user"}]},"legacy_admin":{"directly_related_user_types":[{"type":"user"}]},"member":{"directly_related_user_types":[{"type":"user"}]}}}},{"type":"channel","relations":{"commenter":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"writer"}}]}},"parent_workspace":{"this":{}},"writer":{"this":{}}},"metadata":{"relations":{"commenter":{"directly_related_user_types":[{"type":"user"}]},"parent_workspace":{"directly_related_user_types":[{"type":"workspace"}]},"writer":{"directly_related_user_types":[{"type":"user"}]}}}}]}')}},e=>{e.O(0,[532],(()=>{return t=22679,e(e.s=t);var t}));e.O()}]); \ No newline at end of file +/*! For license information please see main.18bf920b.js.LICENSE.txt */ +(self.webpackChunkopenfga_dev=self.webpackChunkopenfga_dev||[]).push([[179],{34334:(e,t,n)=>{"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}n.d(t,{Z:()=>i});const i=function(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(i&&(i+=" "),i+=t);return i}},11205:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function e(t,n){var i,s;switch(n=n||{},r.util.type(t)){case"Object":if(s=r.util.objId(t),n[s])return n[s];for(var o in i={},n[s]=i,t)t.hasOwnProperty(o)&&(i[o]=e(t[o],n));return i;case"Array":return s=r.util.objId(t),n[s]?n[s]:(i=[],n[s]=i,t.forEach((function(t,r){i[r]=e(t,n)})),i);default:return t}},getLanguage:function(t){for(;t;){var n=e.exec(t.className);if(n)return n[1].toLowerCase();t=t.parentElement}return"none"},setLanguage:function(t,n){t.className=t.className.replace(RegExp(e,"gi"),""),t.classList.add("language-"+n)},isActive:function(e,t,n){for(var r="no-"+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:n,plaintext:n,text:n,txt:n,extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var i in t)n[i]=t[i];return n},insertBefore:function(e,t,n,i){var s=(i=i||r.languages)[e],o={};for(var a in s)if(s.hasOwnProperty(a)){if(a==t)for(var l in n)n.hasOwnProperty(l)&&(o[l]=n[l]);n.hasOwnProperty(a)||(o[a]=s[a])}var c=i[e];return i[e]=o,r.languages.DFS(r.languages,(function(t,n){n===c&&t!=e&&(this[t]=o)})),o},DFS:function e(t,n,i,s){s=s||{};var o=r.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],i||a);var l=t[a],c=r.util.type(l);"Object"!==c||s[o(l)]?"Array"!==c||s[o(l)]||(s[o(l)]=!0,e(l,n,a,s)):(s[o(l)]=!0,e(l,n,null,s))}}},plugins:{},highlight:function(e,t,n){var s={code:e,grammar:t,language:n};return r.hooks.run("before-tokenize",s),s.tokens=r.tokenize(s.code,s.grammar),r.hooks.run("after-tokenize",s),i.stringify(r.util.encode(s.tokens),s.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new a;return l(i,i.head,e),o(e,i,t,i.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(i)},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var i,s=0;i=n[s++];)i(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function s(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var s=i[1].length;i.index+=s,i[0]=i[0].slice(s)}return i}function o(e,t,n,a,u,d){for(var h in n)if(n.hasOwnProperty(h)&&n[h]){var p=n[h];p=Array.isArray(p)?p:[p];for(var f=0;f<p.length;++f){if(d&&d.cause==h+","+f)return;var g=p[f],m=g.inside,y=!!g.lookbehind,b=!!g.greedy,v=g.alias;if(b&&!g.pattern.global){var E=g.pattern.toString().match(/[imsuy]*$/)[0];g.pattern=RegExp(g.pattern.source,E+"g")}for(var _=g.pattern||g,T=a.next,x=u;T!==t.tail&&!(d&&x>=d.reach);x+=T.value.length,T=T.next){var w=T.value;if(t.length>e.length)return;if(!(w instanceof i)){var S,R=1;if(b){if(!(S=s(_,x,e,y))||S.index>=e.length)break;var k=S.index,C=S.index+S[0].length,O=x;for(O+=T.value.length;k>=O;)O+=(T=T.next).value.length;if(x=O-=T.value.length,T.value instanceof i)continue;for(var A=T;A!==t.tail&&(O<C||"string"==typeof A.value);A=A.next)R++,O+=A.value.length;R--,w=e.slice(x,O),S.index-=x}else if(!(S=s(_,0,w,y)))continue;k=S.index;var N=S[0],I=w.slice(0,k),L=w.slice(k+N.length),D=x+w.length;d&&D>d.reach&&(d.reach=D);var P=T.prev;if(I&&(P=l(t,P,I),x+=I.length),c(t,P,R),T=l(t,P,new i(h,m?r.tokenize(N,m):N,v,N)),L&&l(t,T,L),R>1){var M={cause:h+","+f,reach:D};o(e,t,n,T.prev,x,M),d&&M.reach>d.reach&&(d.reach=M.reach)}}}}}}function a(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function c(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}return i.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var i="";return t.forEach((function(t){i+=e(t,n)})),i}var s={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(s.classes,o):s.classes.push(o)),r.hooks.run("wrap",s);var a="";for(var l in s.attributes)a+=" "+l+'="'+(s.attributes[l]||"").replace(/"/g,""")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'"'+a+">"+s.content+"</"+s.tag+">"},r}(),i=r;r.default=r,i.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},i.languages.markup.tag.inside["attr-value"].inside.entity=i.languages.markup.entity,i.languages.markup.doctype.inside["internal-subset"].inside=i.languages.markup,i.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(i.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:i.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:i.languages[t]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},i.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(i.languages.markup.tag,"addAttribute",{value:function(e,t){i.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:i.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.xml=i.languages.extend("markup",{}),i.languages.ssml=i.languages.xml,i.languages.atom=i.languages.xml,i.languages.rss=i.languages.xml,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],s=r.variable[1].inside,o=0;o<i.length;o++)s[i[o]]=e.languages.bash[i[o]];e.languages.shell=e.languages.bash}(i),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},i.languages.c=i.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),i.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),i.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},i.languages.c.string],char:i.languages.c.char,comment:i.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:i.languages.c}}}}),i.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete i.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(i),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(i),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},i={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:i,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:i})}(i),i.languages.javascript=i.languages.extend("clike",{"class-name":[i.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),i.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,i.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:i.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:i.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:i.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:i.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:i.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),i.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),i.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),i.languages.markup&&(i.languages.markup.tag.addInlined("script","javascript"),i.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),i.languages.js=i.languages.javascript,function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(i),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),s=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<value>>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,(function(){return r})).replace(/<<key>>/g,(function(){return"(?:"+i+"|"+s+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(s),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(i),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var i=t[n];if("code"===i.type){var s=i.content[1],o=i.content[3];if(s&&o&&"code-language"===s.type&&"code-block"===o.type&&"string"==typeof s.content){var a=s.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase());o.alias?"string"==typeof o.alias?o.alias=[o.alias,l]:o.alias.push(l):o.alias=[l]}}else e(i.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,i=t.classes.length;r<i;r++){var s=t.classes[r],c=/language-(.+)/.exec(s);if(c){n=c[1];break}}var u,d=e.languages[n];if(d)t.content=e.highlight((u=t.content,u.replace(o,"").replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n);var r=a[t];return r||e}))),d,n);else if(n&&"none"!==n&&e.plugins.autoloader){var h="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=h,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(h);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var o=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(i),i.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:i.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},i.hooks.add("after-tokenize",(function(e){if("graphql"===e.language)for(var t=e.tokens.filter((function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type})),n=0;n<t.length;){var r=t[n++];if("keyword"===r.type&&"mutation"===r.content){var i=[];if(d(["definition-mutation","punctuation"])&&"("===u(1).content){n+=2;var s=h(/^\($/,/^\)$/);if(-1===s)continue;for(;n<s;n++){var o=u(0);"variable"===o.type&&(p(o,"variable-input"),i.push(o.content))}n=s+1}if(d(["punctuation","property-query"])&&"{"===u(0).content&&(n++,p(u(0),"property-mutation"),i.length>0)){var a=h(/^\{$/,/^\}$/);if(-1===a)continue;for(var l=n;l<a;l++){var c=t[l];"variable"===c.type&&i.indexOf(c.content)>=0&&p(c,"variable-input")}}}}function u(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n<e.length;n++){var r=u(n+t);if(!r||r.type!==e[n])return!1}return!0}function h(e,r){for(var i=1,s=n;s<t.length;s++){var o=t[s],a=o.content;if("punctuation"===o.type&&"string"==typeof a)if(e.test(a))i++;else if(r.test(a)&&0===--i)return s}return-1}function p(e,t){var n=e.alias;n?Array.isArray(n)||(e.alias=n=[n]):e.alias=n=[],n.push(t)}})),i.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,i=r.inside["interpolation-punctuation"],s=r.pattern.source;function o(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function a(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function l(t,n,r){var i={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",i),i.tokens=e.tokenize(i.code,i.grammar),e.hooks.run("after-tokenize",i),i.tokens}function c(t){var n={};n["interpolation-punctuation"]=i;var s=e.tokenize(t,n);if(3===s.length){var o=[1,1];o.push.apply(o,l(s[1],e.languages.javascript,"javascript")),s.splice.apply(s,o)}return new e.Token("interpolation",s,r.alias,t)}function u(t,n,r){var i=e.tokenize(t,{interpolation:{pattern:RegExp(s),lookbehind:!0}}),o=0,u={},d=l(i.map((function(e){if("string"==typeof e)return e;for(var n,i=e.content;-1!==t.indexOf(n=a(o++,r)););return u[n]=i,n})).join(""),n,r),h=Object.keys(u);return o=0,function e(t){for(var n=0;n<t.length;n++){if(o>=h.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var i=h[o],s="string"==typeof r?r:r.content,a=s.indexOf(i);if(-1!==a){++o;var l=s.substring(0,a),d=c(u[i]),p=s.substring(a+i.length),f=[];if(l&&f.push(l),f.push(d),p){var g=[p];e(g),f.push.apply(f,g)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(f)),n+=f.length-1):r.content=f}}else{var m=r.content;Array.isArray(m)?e(m):e([m])}}}(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[o("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),o("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),o("svg",/\bsvg/.source),o("markdown",/\b(?:markdown|md)/.source),o("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),o("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function h(e){return"string"==typeof e?e:Array.isArray(e)?e.map(h).join(""):h(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,i=n.length;r<i;r++){var s=n[r];if("string"!=typeof s){var o=s.content;if(Array.isArray(o))if("template-string"===s.type){var a=o[1];if(3===o.length&&"string"!=typeof a&&"embedded-code"===a.type){var l=h(a),c=a.alias,d=Array.isArray(c)?c[0]:c,p=e.languages[d];if(!p)continue;o[1]=u(l,p,d)}}else t(o);else"string"!=typeof o&&t([o])}}}(t.tokens)}))}(i),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(i),function(e){function t(e,t){return RegExp(e.replace(/<ID>/g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var i=n[r],s=e.languages.javascript[i];"RegExp"===e.util.type(s)&&(s=e.languages.javascript[i]={pattern:s});var o=s.inside||{};s.inside=o,o["maybe-class-name"]=/^[A-Z][\s\S]*/}}(i),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function s(e,t){return e=e.replace(/<S>/g,(function(){return n})).replace(/<BRACES>/g,(function(){return r})).replace(/<SPREAD>/g,(function(){return i})),RegExp(e,t)}i=s(i).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=s(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:s(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:s(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(o).join(""):""},a=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],s=!1;if("string"!=typeof i&&("tag"===i.type&&i.content[0]&&"tag"===i.content[0].type?"</"===i.content[0].content[0].content?n.length>0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():"/>"===i.content[i.content.length-1].content||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===i.type&&"{"===i.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===i.type&&"}"===i.content?n[n.length-1].openedBraces--:s=!0),(s||"string"==typeof i)&&n.length>0&&0===n[n.length-1].openedBraces){var l=o(i);r<t.length-1&&("string"==typeof t[r+1]||"plain-text"===t[r+1].type)&&(l+=o(t[r+1]),t.splice(r+1,1)),r>0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(l=o(t[r-1])+l,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",l,null,l)}i.content&&"string"!=typeof i.content&&a(i.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||a(e.tokens)}))}(i),function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(i),i.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},i.languages.go=i.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),i.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete i.languages.go["class-name"],function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,i,s){if(n.language===r){var o=n.tokenStack=[];n.code=n.code.replace(i,(function(e){if("function"==typeof s&&!s(e))return e;for(var i,a=o.length;-1!==n.code.indexOf(i=t(r,a));)++a;return o[a]=e,i})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var i=0,s=Object.keys(n.tokenStack);!function o(a){for(var l=0;l<a.length&&!(i>=s.length);l++){var c=a[l];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=s[i],d=n.tokenStack[u],h="string"==typeof c?c:c.content,p=t(r,u),f=h.indexOf(p);if(f>-1){++i;var g=h.substring(0,f),m=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=h.substring(f+p.length),b=[];g&&b.push.apply(b,o([g])),b.push(m),y&&b.push.apply(b,o([y])),"string"==typeof c?a.splice.apply(a,[l,1].concat(b)):c.content=b}}else c.content&&o(c.content)}return a}(n.tokens)}}}})}(i),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")})),e.languages.hbs=e.languages.handlebars}(i),i.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},i.languages.webmanifest=i.languages.json,i.languages.less=i.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),i.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),i.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},i.languages.objectivec=i.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete i.languages.objectivec["class-name"],i.languages.objc=i.languages.objectivec,i.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/},i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},i.languages.python["string-interpolation"].inside.interpolation.inside.rest=i.languages.python,i.languages.py=i.languages.python,i.languages.reason=i.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),i.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete i.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(i),i.languages.scss=i.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),i.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),i.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),i.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),i.languages.scss.atrule.inside.rest=i.languages.scss,function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(i),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(i),i.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/};const s=i},87459:(e,t,n)=>{"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}n.d(t,{Z:()=>i});const i=function(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(i&&(i+=" "),i+=t);return i}},1728:(e,t,n)=>{"use strict";function r(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(i&&(i+=" "),i+=n);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}n.d(t,{Z:()=>i});const i=function(){for(var e,t,n=0,i="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(i&&(i+=" "),i+=t);return i}},80040:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_SCHEMA_VERSION=void 0;const r=n(42105);t.DEFAULT_SCHEMA_VERSION=r.SchemaVersion.OneDotOne},14533:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_SCHEMA_VERSION=t.LANGUAGE_NAME=t.enums=void 0;const r=n(94660),i=n(42105),s=n(74654);Object.defineProperty(t,"LANGUAGE_NAME",{enumerable:!0,get:function(){return s.LANGUAGE_NAME}});const o=n(80040);Object.defineProperty(t,"DEFAULT_SCHEMA_VERSION",{enumerable:!0,get:function(){return o.DEFAULT_SCHEMA_VERSION}}),t.enums={Keyword:r.Keyword,SchemaVersion:i.SchemaVersion};const a={LANGUAGE_NAME:s.LANGUAGE_NAME,DEFAULT_SCHEMA_VERSION:o.DEFAULT_SCHEMA_VERSION,enums:t.enums};t.default=a},94660:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.ReservedKeywords=t.Keyword=void 0,function(e){e.TYPE="type",e.RELATIONS="relations",e.SELF="self",e.DEFINE="define",e.AS="as",e.OR="or",e.AND="and",e.FROM="from",e.WITH="with",e.BUT_NOT="but not",e.MODEL="model",e.SCHEMA="schema",e.CONDITION="condition"}(n||(t.Keyword=n={})),function(e){e.THIS="this"}(r||(t.ReservedKeywords=r={}))},74654:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LANGUAGE_NAME=void 0,t.LANGUAGE_NAME="dsl.openfga"},42105:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SchemaVersion=void 0,function(e){e.OneDotZero="1.0",e.OneDotOne="1.1"}(n||(t.SchemaVersion=n={}))},45663:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SINGLE_INDENTATION=void 0,t.SINGLE_INDENTATION=" "},33696:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defaultDocumentationMap=void 0;const i=r(n(73247));function s(e){return i.default.literalNames[e].replace(/'/g,"")}t.defaultDocumentationMap={[s(i.default.TYPE)]:{summary:"A type or grouping of objects that have similar characteristics. For example:\n- workspace\n- repository\n- organization\n- document",link:"https://openfga.dev/docs/concepts#what-is-a-type"},[s(i.default.RELATIONS)]:{summary:"A **relation** defines the possible relationship between an [object](https://openfga.dev/docs/concepts#what-is-an-object) and a [user](https://openfga.dev/docs/concepts#what-is-a-user).",link:"https://openfga.dev/docs/concepts#what-is-a-relation"},[s(i.default.AND)]:{summary:"The intersection operator used to indicate that a relationship exists if the user is in all the sets of users.",link:"https://openfga.dev/docs/configuration-language#the-intersection-operator"},[s(i.default.OR)]:{summary:"The union operator is used to indicate that a relationship exists if the user is in any of the sets of users",link:"https://openfga.dev/docs/configuration-language#the-union-operator"},[s(i.default.BUT_NOT)]:{summary:"The exclusion operator is used to indicate that a relationship exists if the user is in the base userset, but not in the excluded userset.",link:"https://openfga.dev/docs/configuration-language#the-exclusion-operator"},[s(i.default.FROM)]:{summary:"Allows referencing relations on related objects.",link:"https://openfga.dev/docs/configuration-language#referencing-relations-on-related-objects"},[s(i.default.SCHEMA)]:{summary:"Defines the schema version to be used, with currently only support for '1.1'. Note that the 1.0 schema is deprecated.",link:"https://openfga.dev/docs/modeling/migrating/migrating-schema-1-1"}}},44096:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.validator=t.constants=t.sampleAuthorizationModels=t.graphBuilder=t.tools=t.theming=void 0;const a=o(n(14533));t.constants=a.default;const l=o(n(40478));t.validator=l.default,t.theming=s(n(35442)),t.tools=s(n(34936)),t.graphBuilder=s(n(27253));const c=o(n(78002));t.sampleAuthorizationModels=c.default},62524:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertNever=void 0,t.assertNever=function(e){throw new Error(`Assertion failed. Unexpected value: '${e}'`)}},78002:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const o={entitlements:Promise.resolve().then((()=>s(n(98633)))),expenses:Promise.resolve().then((()=>s(n(98547)))),gdrive:Promise.resolve().then((()=>s(n(94014)))),generic:Promise.resolve().then((()=>s(n(56918)))),github:Promise.resolve().then((()=>s(n(84001)))),iot:Promise.resolve().then((()=>s(n(96418)))),slack:Promise.resolve().then((()=>s(n(63542)))),customRoles:Promise.resolve().then((()=>s(n(57904))))};t.default=o},35442:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportedThemes=t.languageDefinition=t.OpenFgaDslThemeTokenType=t.OpenFgaDslThemeToken=t.SupportedTheme=void 0;const r=n(38793),i=n(82428);var s=n(82428);Object.defineProperty(t,"SupportedTheme",{enumerable:!0,get:function(){return s.SupportedTheme}}),Object.defineProperty(t,"OpenFgaDslThemeToken",{enumerable:!0,get:function(){return s.OpenFgaDslThemeToken}}),Object.defineProperty(t,"OpenFgaDslThemeTokenType",{enumerable:!0,get:function(){return s.OpenFgaDslThemeTokenType}});var o=n(24416);Object.defineProperty(t,"languageDefinition",{enumerable:!0,get:function(){return o.languageDefinition}}),t.supportedThemes={[i.SupportedTheme.OpenFgaDark]:r.openfgaDark}},38793:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openfgaDark=void 0;const r=n(82428);t.openfgaDark={name:"openfga-dark",baseTheme:"vs-dark",background:{color:"#141517"},colors:{[r.OpenFgaDslThemeTokenType.DEFAULT]:"#FFFFFF",[r.OpenFgaDslThemeTokenType.COMMENT]:"#737981",[r.OpenFgaDslThemeTokenType.KEYWORD]:"#AAAAAA",[r.OpenFgaDslThemeTokenType.TYPE]:"#79ED83",[r.OpenFgaDslThemeTokenType.RELATION]:"#20F1F5",[r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE]:"#CEEC93"},styles:{}}},82428:(e,t)=>{"use strict";var n,r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.SupportedTheme=t.OpenFgaDslThemeToken=t.OpenFgaDslThemeTokenType=void 0,function(e){e.DEFAULT="default",e.COMMENT="comment",e.KEYWORD="keyword",e.TYPE="type",e.RELATION="relation",e.DIRECTLY_ASSIGNABLE="directly-assignable"}(n||(t.OpenFgaDslThemeTokenType=n={})),function(e){e.COMMENT="comment",e.DELIMITER_BRACKET_RELATION_DEFINITION="delimiter.bracket.relation-definition",e.DELIMITER_BRACKET_TYPE_RESTRICTIONS="delimiter.bracket.type-restrictions",e.DELIMITER_BRACKET_CONDITION_EXPRESSION="delimiter.bracket.condition-expression",e.DELIMITER_COLON_TYPE_RESTRICTIONS="delimiter.colon.type-restrictions",e.DELIMITER_COMMA_TYPE_RESTRICTIONS="delimiter.comma.type-restrictions",e.DELIMITER_DEFINE_COLON="delimiter.colon.define",e.DELIMITER_HASHTAG_TYPE_RESTRICTIONS="delimiter.hashtag.type-restrictions",e.KEYWORD_AS="keyword.as",e.KEYWORD_DEFINE="keyword.define",e.KEYWORD_FROM="keyword.from",e.KEYWORD_MODEL="keyword.model",e.KEYWORD_RELATIONS="keyword.relations",e.KEYWORD_SCHEMA="keyword.schema",e.KEYWORD_SELF="keyword.self",e.KEYWORD_TYPE="keyword.type",e.KEYWORD_CONDITION="keyword.condition",e.KEYWORD_WITH="keyword.with",e.OPERATOR_AND="keyword.operator.word.intersection",e.OPERATOR_BUT_NOT="keyword.operator.word.exclusion",e.OPERATOR_OR="keyword.operator.word.union",e.VALUE_CONDITION="entity.name.function.condition",e.VALUE_RELATION_COMPUTED="computed.relation.value",e.VALUE_RELATION_NAME="entity.name.function.member.relation.name",e.VALUE_RELATION_TUPLE_TO_USERSET_COMPUTED="computed.tupletouserset.relation.value",e.VALUE_RELATION_TUPLE_TO_USERSET_TUPLESET="tupleset.tupletouserset.relation.value",e.VALUE_SCHEMA="schema.value",e.VALUE_TYPE_NAME="support.class.type.name.value",e.VALUE_TYPE_RESTRICTIONS_RELATION="variable.parameter.type-restrictions.relation.value",e.VALUE_TYPE_RESTRICTIONS_TYPE="variable.parameter.type-restrictions.type.value",e.VALUE_TYPE_RESTRICTIONS_WILDCARD="variable.parameter.type-restrictions.wildcard.value",e.CONDITION_PARAM="variable.parameter.name.condition",e.CONDITION_PARAM_TYPE="variable.parameter.type.condition"}(r||(t.OpenFgaDslThemeToken=r={})),function(e){e.OpenFgaDark="openfga-dark"}(i||(t.SupportedTheme=i={}))},72984:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getThemeTokenStyle=void 0;const r=n(82428),i={[r.OpenFgaDslThemeToken.COMMENT]:r.OpenFgaDslThemeTokenType.COMMENT,[r.OpenFgaDslThemeToken.DELIMITER_BRACKET_RELATION_DEFINITION]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.DELIMITER_BRACKET_TYPE_RESTRICTIONS]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.DELIMITER_BRACKET_CONDITION_EXPRESSION]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.DELIMITER_COLON_TYPE_RESTRICTIONS]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.DELIMITER_COMMA_TYPE_RESTRICTIONS]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.DELIMITER_DEFINE_COLON]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.DELIMITER_HASHTAG_TYPE_RESTRICTIONS]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.KEYWORD_AS]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_DEFINE]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_FROM]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_MODEL]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_RELATIONS]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_SCHEMA]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_SELF]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.KEYWORD_TYPE]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.OPERATOR_AND]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.OPERATOR_BUT_NOT]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.OPERATOR_OR]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_CONDITION]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.KEYWORD_WITH]:r.OpenFgaDslThemeTokenType.KEYWORD,[r.OpenFgaDslThemeToken.VALUE_CONDITION]:r.OpenFgaDslThemeTokenType.TYPE,[r.OpenFgaDslThemeToken.VALUE_RELATION_COMPUTED]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.VALUE_RELATION_NAME]:r.OpenFgaDslThemeTokenType.RELATION,[r.OpenFgaDslThemeToken.VALUE_RELATION_TUPLE_TO_USERSET_COMPUTED]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.VALUE_RELATION_TUPLE_TO_USERSET_TUPLESET]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.VALUE_SCHEMA]:r.OpenFgaDslThemeTokenType.DEFAULT,[r.OpenFgaDslThemeToken.VALUE_TYPE_NAME]:r.OpenFgaDslThemeTokenType.TYPE,[r.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_RELATION]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_TYPE]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_WILDCARD]:r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE,[r.OpenFgaDslThemeToken.CONDITION_PARAM]:r.OpenFgaDslThemeTokenType.RELATION,[r.OpenFgaDslThemeToken.CONDITION_PARAM_TYPE]:r.OpenFgaDslThemeTokenType.DEFAULT};t.getThemeTokenStyle=function(e,t){var n,s,o;return{foreground:(null===(n=t.rawColorOverrides)||void 0===n?void 0:n[e])||t.colors[i[e||r.OpenFgaDslThemeTokenType.DEFAULT]],fontStyle:(null===(s=t.rawStylesOverrides)||void 0===s?void 0:s[e])||(null===(o=t.styles)||void 0===o?void 0:o[i[e||r.OpenFgaDslThemeTokenType.DEFAULT]])}}},34936:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrismExtensions=t.MonacoExtensions=void 0;var r=n(70843);Object.defineProperty(t,"MonacoExtensions",{enumerable:!0,get:function(){return r.MonacoExtensions}});var i=n(96467);Object.defineProperty(t,"PrismExtensions",{enumerable:!0,get:function(){return i.PrismExtensions}})},70843:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.MonacoExtensions=void 0;const o=n(14533),a=s(n(97135)),l=n(32009),c=n(49857),u=n(94962);t.MonacoExtensions={LANGUAGE_NAME:o.LANGUAGE_NAME,registerDSL:l.registerDSL,monacoThemes:c.monacoThemes,validateDSL:u.validateDSL,languageDefinition:a,buildMonacoTheme:c.buildMonacoTheme}},97135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.language=t.getLanguageConfiguration=void 0;const r=n(94660),i=n(14533),s=n(35442);t.getLanguageConfiguration=function(e){return{comments:{lineComment:"#"},brackets:[["[","]"],["(",")"],["{","}"]],autoClosingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:"{",close:"}"}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"}],onEnterRules:[{beforeText:new RegExp("^\\s*(?:type|relations|model|define).*?:\\s*$"),action:{indentAction:e.languages.IndentAction.Indent}}],folding:{offSide:!0,markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}}},t.language={defaultToken:"",tokenPostfix:`.${i.LANGUAGE_NAME}`,keywords:[],operators:[],identifiers:new RegExp(/(?!self)(?:\w|-[a-zA-Z])*/),brackets:[{open:"[",close:"]",token:s.OpenFgaDslThemeToken.DELIMITER_BRACKET_TYPE_RESTRICTIONS},{open:"(",close:")",token:s.OpenFgaDslThemeToken.DELIMITER_BRACKET_RELATION_DEFINITION},{open:"{",close:"}",token:s.OpenFgaDslThemeToken.DELIMITER_BRACKET_CONDITION_EXPRESSION}],tokenizer:{root:[{include:"@whitespace"},[new RegExp(/^(\s*#).*/),s.OpenFgaDslThemeToken.COMMENT],[new RegExp(/(\[)(\s*)(@identifiers)(\s*)(\])/),["@brackets","@whitespace",s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_TYPE,"@whitespace","@brackets"]],[new RegExp(/(,)(\s*)(@identifiers)(\s*)(\])/),[s.OpenFgaDslThemeToken.DELIMITER_COMMA_TYPE_RESTRICTIONS,"@whitespace",s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_TYPE,"@whitespace","@brackets"]],[new RegExp(/(\[)(\s*)(@identifiers)(\s*)(,)/),["@brackets","@whitespace",s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_TYPE,"@whitespace",s.OpenFgaDslThemeToken.DELIMITER_COMMA_TYPE_RESTRICTIONS]],[new RegExp(/[{}[\]()]/),"@brackets"],[new RegExp(/(schema)(\s+)(\d\.\d)/),[s.OpenFgaDslThemeToken.KEYWORD_SCHEMA,"@whitespace",s.OpenFgaDslThemeToken.VALUE_SCHEMA]],[new RegExp(/(type)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.KEYWORD_TYPE,"@whitespace",s.OpenFgaDslThemeToken.VALUE_TYPE_NAME]],[new RegExp(/(define)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.KEYWORD_DEFINE,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_NAME]],[new RegExp(/(or)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.OPERATOR_OR,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_COMPUTED]],[new RegExp(/(and)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.OPERATOR_AND,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_COMPUTED]],[new RegExp(/(but not)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.OPERATOR_BUT_NOT,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_COMPUTED]],[new RegExp(/(\s+)(with)(\s+)/),["@whitespace",s.OpenFgaDslThemeToken.KEYWORD_WITH,"@whitespace"]],[new RegExp(/(as)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.KEYWORD_AS,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_COMPUTED]],[new RegExp(/(:)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.DELIMITER_DEFINE_COLON,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_COMPUTED]],[new RegExp(/(@identifiers)(:)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.CONDITION_PARAM,s.OpenFgaDslThemeToken.DELIMITER_DEFINE_COLON,"@whitespace",s.OpenFgaDslThemeToken.CONDITION_PARAM_TYPE]],[new RegExp(/(condition)(\s)(@identifiers)(\()/),[s.OpenFgaDslThemeToken.KEYWORD_CONDITION,"@whitespace",s.OpenFgaDslThemeToken.VALUE_CONDITION,"@brackets"]],[new RegExp(/(@identifiers)(\s+)(from)(\s+)(@identifiers)/),[s.OpenFgaDslThemeToken.VALUE_RELATION_TUPLE_TO_USERSET_COMPUTED,"@whitespace",s.OpenFgaDslThemeToken.KEYWORD_FROM,"@whitespace",s.OpenFgaDslThemeToken.VALUE_RELATION_TUPLE_TO_USERSET_TUPLESET]],[new RegExp(/(@identifiers)(#)(@identifiers)/),[s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_TYPE,s.OpenFgaDslThemeToken.DELIMITER_HASHTAG_TYPE_RESTRICTIONS,s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_RELATION]],[new RegExp(/(@identifiers)(:)(\*)/),[s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_TYPE,s.OpenFgaDslThemeToken.DELIMITER_COLON_TYPE_RESTRICTIONS,s.OpenFgaDslThemeToken.VALUE_TYPE_RESTRICTIONS_WILDCARD]],[":",s.OpenFgaDslThemeToken.DELIMITER_DEFINE_COLON],[",",s.OpenFgaDslThemeToken.DELIMITER_COMMA_TYPE_RESTRICTIONS],[r.Keyword.BUT_NOT,s.OpenFgaDslThemeToken.OPERATOR_BUT_NOT],[r.Keyword.SELF,s.OpenFgaDslThemeToken.KEYWORD_SELF],[new RegExp(/@identifiers/),{cases:{[r.Keyword.AND]:s.OpenFgaDslThemeToken.OPERATOR_AND,[r.Keyword.OR]:s.OpenFgaDslThemeToken.OPERATOR_OR,[r.Keyword.TYPE]:s.OpenFgaDslThemeToken.KEYWORD_TYPE,[r.Keyword.RELATIONS]:s.OpenFgaDslThemeToken.KEYWORD_RELATIONS,[r.Keyword.DEFINE]:s.OpenFgaDslThemeToken.KEYWORD_DEFINE,[r.Keyword.FROM]:s.OpenFgaDslThemeToken.KEYWORD_FROM,[r.Keyword.WITH]:s.OpenFgaDslThemeToken.KEYWORD_WITH,[r.Keyword.CONDITION]:s.OpenFgaDslThemeToken.KEYWORD_CONDITION,[r.Keyword.AS]:s.OpenFgaDslThemeToken.KEYWORD_AS,[r.Keyword.MODEL]:s.OpenFgaDslThemeToken.KEYWORD_MODEL,[r.Keyword.SCHEMA]:{token:s.OpenFgaDslThemeToken.KEYWORD_SCHEMA},"@default":s.OpenFgaDslThemeToken.VALUE_RELATION_TUPLE_TO_USERSET_TUPLESET}}]],whitespace:[[new RegExp(/\s+/),"white"],[new RegExp(/(^(\s+#).*$)/),s.OpenFgaDslThemeToken.COMMENT]]}}},79428:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.provideCodeActions=void 0;const r=n(40801),i=n(94660),s=n(42105),o=n(45663),a={[r.errors.ValidationError.MissingDefinition]:{[s.SchemaVersion.OneDotZero]:({model:e,marker:t,relation:n})=>{const r=e.getLineContent(t.startLineNumber);return{startColumn:0,title:`Fix: add definition for \`${n}\`.`,text:`${o.SINGLE_INDENTATION}${o.SINGLE_INDENTATION}${i.Keyword.DEFINE} ${n} ${i.Keyword.AS} ${i.Keyword.SELF}\n${r}`}},[s.SchemaVersion.OneDotOne]:({model:e,marker:t,relation:n})=>{const r=e.getLineContent(t.startLineNumber);return{startColumn:0,title:`Fix: add definition for \`${n}\`.`,text:`${o.SINGLE_INDENTATION}${o.SINGLE_INDENTATION}${i.Keyword.DEFINE} ${n}: [typeName]\n${r}`}}},[r.errors.ValidationError.SelfError]:{[s.SchemaVersion.OneDotZero]:({text:e})=>({title:`Fix: replace \`${e}\` by \`self\`.`,text:i.Keyword.SELF}),[s.SchemaVersion.OneDotOne]:({text:e})=>({title:`Fix: replace \`${e}\` with type restrictions.`,text:"[typeName]"})},[r.errors.ValidationError.DuplicatedError]:{[s.SchemaVersion.OneDotZero]:({model:e,marker:t,markerRange:n,text:r})=>({startLineNumber:n.startLineNumber-1,startColumn:e.getLineContent(t.startLineNumber-1).length+1,title:`Fix: remove duplicated \`${r}\`.`,text:""}),[s.SchemaVersion.OneDotOne]:({model:e,marker:t,markerRange:n,text:r})=>({startLineNumber:n.startLineNumber-1,startColumn:e.getLineContent(t.startLineNumber-1).length+1,title:`Fix: remove duplicated \`${r}\`.`,text:""})}};t.provideCodeActions=(e,t)=>(n,r,i)=>{const s=[];return i.markers.map((r=>{const i=n.getOffsetAt({column:r.startColumn,lineNumber:r.startLineNumber}),o=n.getOffsetAt({column:r.endColumn,lineNumber:r.endLineNumber}),l=n.getValue().substr(i,o-i),c=function({markerRange:e,model:t,marker:n,text:r,schemaVersion:i}){var s,o;const{error:l,relation:c}=n.extraInformation||{},u=null===(o=null===(s=a[l])||void 0===s?void 0:s[i])||void 0===o?void 0:o.call(s,{model:t,marker:n,markerRange:e,text:r,relation:c});if(u)return{title:null==u?void 0:u.title,diagnostics:[n],edit:{edits:[{textEdit:{range:e,text:u.text},resource:t.uri,versionId:void 0}]},kind:"quickfix"}}({markerRange:new e.Range(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn),model:n,marker:r,text:l,schemaVersion:t});c&&s.push(c)})).filter((e=>e)),{actions:s,dispose(){}}}},61702:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.provideCompletionItems=void 0;const r=n(40801),i=n(94660),s=n(45663),o=n(62524),a=n(42105);const l=(e,t={})=>(n,o)=>{let l=[];const c=n.getWordUntilPosition(o),u={startLineNumber:o.lineNumber,endLineNumber:o.lineNumber,startColumn:c.startColumn,endColumn:c.endColumn};return l=2===o.column?[{label:i.Keyword.TYPE,kind:e.languages.CompletionItemKind.Function,insertText:`${i.Keyword.TYPE} \${1:typeName}\n${s.SINGLE_INDENTATION}${i.Keyword.RELATIONS}\n${s.SINGLE_INDENTATION}${s.SINGLE_INDENTATION}${i.Keyword.DEFINE} \${2:relationName}: [\${3:typeName}]`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:"type_group",kind:e.languages.CompletionItemKind.Function,insertText:`${i.Keyword.TYPE} \${1:group}\n${s.SINGLE_INDENTATION}${i.Keyword.RELATIONS}\n${s.SINGLE_INDENTATION}${s.SINGLE_INDENTATION}${i.Keyword.DEFINE} \${2:member}: [\${3:user, group#member}]`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:i.Keyword.TYPE,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.TYPE,range:u},{label:i.Keyword.MODEL,kind:e.languages.CompletionItemKind.Function,insertText:`${i.Keyword.MODEL}\n${s.SINGLE_INDENTATION}${i.Keyword.SCHEMA} \${1:1.1}`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:i.Keyword.MODEL,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.TYPE,range:u},{label:i.Keyword.CONDITION,kind:e.languages.CompletionItemKind.Function,insertText:`${i.Keyword.CONDITION} \${1:conditionName}(\${2:parameterName}: \${3:string}) {\n \${4}\n}`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u}]:4===o.column?[{label:i.Keyword.RELATIONS,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.RELATIONS,range:u}]:o.column>6?[{label:i.Keyword.OR,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.OR,range:u},{label:i.Keyword.AND,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.AND,range:u},{label:i.Keyword.BUT_NOT,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.BUT_NOT,range:u},{label:i.Keyword.FROM,kind:e.languages.CompletionItemKind.Function,insertText:`\${1:relation1} ${i.Keyword.FROM} \${1:relation2}`,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:i.Keyword.FROM,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.FROM,range:u},{label:i.Keyword.CONDITION,kind:e.languages.CompletionItemKind.Keyword,insertText:i.Keyword.CONDITION,range:u}]:6===o.column?[{label:"define-assignable",kind:e.languages.CompletionItemKind.Function,insertText:"define ${1:relationName}: [${2:typeName}]",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:"define-from-other-relation",kind:e.languages.CompletionItemKind.Function,insertText:"define ${1:relationName}: ${2:otherRelationName}",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:"define-from-other-relation-assignable",kind:e.languages.CompletionItemKind.Function,insertText:"define ${1:relationName}: [${2:typeName}] or ${3:otherRelationName}",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:"define-from-object",kind:e.languages.CompletionItemKind.Function,insertText:"define ${1:relationName}: ${2:relationInRelatedObject} from ${3:relationInThisType}}",insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:u},{label:"define",kind:e.languages.CompletionItemKind.Keyword,insertText:"define",range:u}]:function(e,t,n,i={}){const s=[];return["entitlements","expenses","gdrive","generic","github","iot","slack","customRoles"].forEach((o=>{const l=null==i?void 0:i[o];l&&s.push({label:`sample-${o}`,kind:e.languages.CompletionItemKind.Struct,insertText:r.transformer.transformJSONToDSL(n===a.SchemaVersion.OneDotOne?l:{schema_version:a.SchemaVersion.OneDotZero,type_definitions:l.type_definitions.map((e=>({type:e.type,relations:e.relations})))}),range:t})})),s}(e,u,a.SchemaVersion.OneDotOne,t.samples),{suggestions:l}};t.provideCompletionItems=(e,t=a.SchemaVersion.OneDotZero,n={})=>(r,i)=>{switch(t){case a.SchemaVersion.OneDotOne:return l(e,n)(r,i);case a.SchemaVersion.OneDotZero:throw new Error("unsupported schema version");default:(0,o.assertNever)(t)}}},83854:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.providerHover=void 0;const r=n(33696);t.providerHover=(e,t=r.defaultDocumentationMap)=>(n,r)=>{const i=n.getWordAtPosition(r);if(!i)return;const{startColumn:s,endColumn:o,word:a}=i,l=function(e,t){const n=t[e];if(!n)return;const{link:r,summary:i}=n,s=[{value:"**Documentation**"},{value:i}];return r&&s.push({value:`[Learn more](${r})`}),s}(a,t);return l?{range:new e.Range(r.lineNumber,s,r.lineNumber,o),contents:l}:void 0}},32009:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerDSL=void 0;const r=n(14533),i=n(42105),s=n(97135),o=n(83854),a=n(61702),l=n(79428);t.registerDSL=(e,t=i.SchemaVersion.OneDotZero,n)=>{!!e.languages.getLanguages().find((e=>e.id===r.LANGUAGE_NAME))||(e.languages.register({id:r.LANGUAGE_NAME}),e.languages.setLanguageConfiguration(r.LANGUAGE_NAME,(0,s.getLanguageConfiguration)(e)),e.languages.setMonarchTokensProvider(r.LANGUAGE_NAME,s.language),e.languages.registerHoverProvider(r.LANGUAGE_NAME,{provideHover:(0,o.providerHover)(e,n.documentationMap)}),e.languages.registerCompletionItemProvider(r.LANGUAGE_NAME,{provideCompletionItems:(0,a.provideCompletionItems)(e,t)}),e.languages.registerCodeActionProvider(r.LANGUAGE_NAME,{provideCodeActions:(0,l.provideCodeActions)(e,t)}))}},49857:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildMonacoTheme=t.monacoThemes=void 0;const r=n(14533),i=n(35442),s=n(72984);function o(e){return{base:e.baseTheme||"vs",inherit:!0,colors:{"editor.background":e.background.color},rules:Object.values(i.OpenFgaDslThemeToken).map((t=>{const n=(0,s.getThemeTokenStyle)(t,e);return Object.assign({token:`${t}.${r.LANGUAGE_NAME}`},n)}))}}t.buildMonacoTheme=o;const a={};t.monacoThemes=a,Object.values(i.SupportedTheme).forEach((e=>{a[e]=o(i.supportedThemes[e])}))},94962:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateDSL=void 0;const r=n(80104),i=n(40801);t.validateDSL=function(e,t){const n=[];try{i.validator.validateDSL(t)}catch(s){for(const t of s.errors){let i;if(t instanceof r.DSLSyntaxSingleError)i="SyntaxError";else{if(!(t instanceof r.ModelValidationSingleError))throw new Error("Unhandled Exception: "+JSON.stringify(t,null,4));i="ModelValidationError"}const s={},o=t.metadata;o.errorType&&(s.error=o.errorType),["typeName","relation"].forEach((e=>{o[e]&&(s[e]=o[e])})),n.push({message:t.msg,severity:e.MarkerSeverity.Error,startColumn:t.column.start,endColumn:t.column.end,startLineNumber:t.line.start,endLineNumber:t.line.end,source:i,extraInformation:s})}}return n}},96467:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrismExtensions=void 0;const r=n(24416),i=n(14533);t.PrismExtensions={LANGUAGE_NAME:i.LANGUAGE_NAME,languageDefinition:r.languageDefinition}},24416:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.languageDefinition=void 0;const r=n(35442);t.languageDefinition={[r.OpenFgaDslThemeTokenType.COMMENT]:{pattern:/^\s*#.*/},[r.OpenFgaDslThemeTokenType.KEYWORD]:/\b(type|relations|define|and|or|but not|from|as|model|schema)\b/,[r.OpenFgaDslThemeTokenType.TYPE]:{pattern:/(\btype\s+)\w+/i,lookbehind:!0,greedy:!0},[r.OpenFgaDslThemeTokenType.RELATION]:{pattern:/(\bdefine\s+)\w+/i,lookbehind:!0,greedy:!0},[r.OpenFgaDslThemeTokenType.DIRECTLY_ASSIGNABLE]:/\[.*]|self/}},19762:(e,t)=>{"use strict";var n,r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.RelationType=t.GraphEdgeGroup=t.GraphNodeGroup=void 0,function(e){e.AssignableRelation="assignable-relation",e.NonassignableRelation="nonassignable-relation",e.Type="type",e.StoreName="store-name",e.Default="default",e.Check="check"}(n||(t.GraphNodeGroup=n={})),function(e){e.StoreToType="store-to-type",e.TypeToRelation="type-to-relation",e.RelationToRelation="relation-to-relation",e.AssignableSourceToRelation="assignable-sourcee-to-relation",e.Default="default"}(r||(t.GraphEdgeGroup=r={})),function(e){e.DirectUsers="Direct Users",e.ComputedUserset="Related From Same Object",e.TupleToUserset="Related From Related Objects"}(i||(t.RelationType=i={}))},27253:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthorizationModelGraphBuilder=t.TreeBuilder=t.GraphEdgeGroup=t.GraphNodeGroup=void 0;var r=n(19762);Object.defineProperty(t,"GraphNodeGroup",{enumerable:!0,get:function(){return r.GraphNodeGroup}}),Object.defineProperty(t,"GraphEdgeGroup",{enumerable:!0,get:function(){return r.GraphEdgeGroup}});var i=n(65349);Object.defineProperty(t,"TreeBuilder",{enumerable:!0,get:function(){return i.TreeBuilder}});var s=n(35747);Object.defineProperty(t,"AuthorizationModelGraphBuilder",{enumerable:!0,get:function(){return s.AuthorizationModelGraphBuilder}})},35747:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuthorizationModelGraphBuilder=void 0;const r=n(19762);class i{constructor(e,t){this.authorizationModel=e,this.store=t,this._graph={nodes:[],edges:[]},this.buildGraph()}static getStoreId(e){return`store|${e}`}static getTypeId(e){return`type|${e}`}static getRelationId(e,t){return`${e}.relation|${t}`}buildGraph(){var e,t,n;const s=(null===(e=this.store)||void 0===e?void 0:e.name)||(null===(t=this.store)||void 0===t?void 0:t.id)||"Store",o={nodes:[{id:i.getStoreId(s),label:s,group:r.GraphNodeGroup.StoreName}],edges:[]};null===(n=this.authorizationModel.type_definitions)||void 0===n||n.forEach((e=>{const t=this.getTypeGraph(e,o);o.nodes=o.nodes.concat(t.nodes),o.edges=o.edges.concat(t.edges)})),this._graph=o}checkIfRelationAssignable(e){var t,n,r,i;return!!(e.this||(null===(t=e.difference)||void 0===t?void 0:t.base.this)||(null===(n=e.difference)||void 0===n?void 0:n.subtract.this)||((null===(r=e.intersection)||void 0===r?void 0:r.child)||[]).some((e=>this.checkIfRelationAssignable(e)))||((null===(i=e.union)||void 0===i?void 0:i.child)||[]).some((e=>this.checkIfRelationAssignable(e))))}getAssignableSourcesForRelation(e,t){const n={types:[],relations:[],conditions:[],publicTypes:[],isAssignable:!1};if(!this.checkIfRelationAssignable(e))return n;const r=t.directly_related_user_types;return null==r||r.forEach((e=>{(e.relation||e.wildcard||e.condition)&&(e.relation?n.relations.push(i.getRelationId(e.type,e.relation)):(n.isAssignable=!0,n.types.push(i.getTypeId(e.type))))})),n}addRelationToRelationEdge(e,t,n,s){e.edges.push({from:i.getRelationId(t,n),to:i.getRelationId(t,s.relation),group:r.GraphEdgeGroup.RelationToRelation,dashes:!0})}getTypeGraph(e,t,{showAssignable:n}={}){const s=i.getTypeId(e.type),o={nodes:[{id:s,label:e.type,group:r.GraphNodeGroup.Type}],edges:[{from:t.nodes[0].id,to:s,group:r.GraphEdgeGroup.StoreToType}]},a=(null==e?void 0:e.relations)||{};return Object.keys(a).forEach((t=>{var l,c,u;const d=i.getRelationId(s,t),h=a[t]||{},p=this.getAssignableSourcesForRelation(h,(null===(c=null===(l=e.metadata)||void 0===l?void 0:l.relations)||void 0===c?void 0:c[t])||{}),f=p.isAssignable;o.nodes.push({id:d,label:t,group:f?r.GraphNodeGroup.AssignableRelation:r.GraphNodeGroup.NonassignableRelation}),n&&p.types.forEach((e=>{o.edges.push({from:i.getTypeId(e),to:d,group:r.GraphEdgeGroup.AssignableSourceToRelation})})),o.edges.push({from:s,to:d,group:r.GraphEdgeGroup.TypeToRelation}),h.computedUserset?this.addRelationToRelationEdge(o,s,t,h.computedUserset):((null===(u=h.union)||void 0===u?void 0:u.child)||[]).forEach((e=>{e.computedUserset&&this.addRelationToRelationEdge(o,s,t,e.computedUserset)}))})),o}get graph(){return this._graph}}t.AuthorizationModelGraphBuilder=i},65349:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(t){s(t)}}function a(e){try{l(r.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TreeBuilder=void 0;const i=n(19762),s=e=>{const t=e.split("#"),n="*"===t[1]||"*"===e;return{object:t[0],relation:n?void 0:t[1],isWildcard:n}};t.TreeBuilder=class{constructor(e,t,n,r){this.openFgaApi=e,this.capturedTuple=t,this.existingTree=n,this.authorizationModelId=r,this.expandedTuples={},n&&(this.currentTree=n)}addParent(e,t,n,r){this.currentTree&&(this.currentTree[e]||(this.currentTree[e]={parents:{}}),this.currentTree[e].parents[t]={inActivePath:r,type:n},t===`${this.capturedTuple.object}#${this.capturedTuple.relation}`&&(this.currentTree[this.capturedTuple.object]||(this.currentTree[this.capturedTuple.object]={parents:{},inActivePath:!0}),this.addParent(`${this.capturedTuple.object}#${this.capturedTuple.relation}`,this.capturedTuple.object,void 0,!0)))}expandTuple(e){return r(this,void 0,void 0,(function*(){return this.openFgaApi.expand({tuple_key:{relation:e.relation,object:e.object},authorization_model_id:this.authorizationModelId})}))}walkDirectUser(e,t){return r(this,void 0,void 0,(function*(){const n=s(t);this.addParent(t,e.name,i.RelationType.DirectUsers),n.relation&&(yield this.walk(n))}))}walkDirectUsers(e){var t,n;return r(this,void 0,void 0,(function*(){const i=(null===(n=null===(t=null==e?void 0:e.leaf)||void 0===t?void 0:t.users)||void 0===n?void 0:n.users)||[];yield Promise.all(i.map((t=>r(this,void 0,void 0,(function*(){return this.walkDirectUser(e,t)})))))}))}walkComputedUserSet(e,t,n){return r(this,void 0,void 0,(function*(){if(!t||2!==t.split(":").length)return;this.addParent(t,e.name,n?i.RelationType.TupleToUserset:i.RelationType.ComputedUserset);const r=s(t);yield this.walk(r)}))}walkTupleToUserset(e){var t,n;return r(this,void 0,void 0,(function*(){const r=null===(n=null===(t=e.leaf)||void 0===t?void 0:t.tupleToUserset)||void 0===n?void 0:n.tupleset;if(!r)return;const i=s(r);yield this.walk(i)}))}getNodeType(e){var t,n,r,s,o,a;return(null===(n=null===(t=null==e?void 0:e.leaf)||void 0===t?void 0:t.computed)||void 0===n?void 0:n.userset)?i.RelationType.ComputedUserset:(null===(s=null===(r=null==e?void 0:e.leaf)||void 0===r?void 0:r.tupleToUserset)||void 0===s?void 0:s.computed)?i.RelationType.TupleToUserset:(null===(a=null===(o=null==e?void 0:e.union)||void 0===o?void 0:o.nodes)||void 0===a?void 0:a.length)?void 0:i.RelationType.DirectUsers}walkNode(e){var t,n,s,o,a;return r(this,void 0,void 0,(function*(){const l=[];switch(this.getNodeType(e)){case i.RelationType.DirectUsers:l.push(this.walkDirectUsers(e));break;case i.RelationType.ComputedUserset:const c=null===(n=null===(t=e.leaf)||void 0===t?void 0:t.computed)||void 0===n?void 0:n.userset;l.push(this.walkComputedUserSet(e,c));break;case i.RelationType.TupleToUserset:l.push(this.walkTupleToUserset(e));const u=(null===(o=null===(s=e.leaf)||void 0===s?void 0:s.tupleToUserset)||void 0===o?void 0:o.computed)||[];l.push(...u.map((t=>r(this,void 0,void 0,(function*(){return this.walkComputedUserSet(e,t.userset,!0)})))));break;default:const d=(null===(a=e.union)||void 0===a?void 0:a.nodes)||[];l.push(...d.map((e=>r(this,void 0,void 0,(function*(){return this.walkNode(e)})))))}yield Promise.all(l)}))}walk(e){var t;return r(this,void 0,void 0,(function*(){const n=`${e.object}#${e.relation}`;if(!e.relation||this.expandedTuples[n])return;this.currentTree&&!this.currentTree[n]&&(this.currentTree[n]={parents:{}}),this.expandedTuples[n]=!0;const r=yield this.expandTuple(e),i=null===(t=r.tree)||void 0===t?void 0:t.root;yield this.walkNode(i)}))}deleteHangingNodes(){const{tree:e={}}=this;Object.keys(e).forEach((t=>{const{parents:n}=e[t];Object.keys(n).length||t===this.capturedTuple.object||delete e[t]}))}get tree(){return this.currentTree}buildTree(){return r(this,void 0,void 0,(function*(){this.tree||(this.currentTree={},yield this.walk(this.capturedTuple))}))}fillActivePath(e){const{tree:t={}}=this,{object:n}=this.capturedTuple,r=JSON.parse(JSON.stringify(t));let i=["*",e];const s={};for(;i.length;){const e={};i.forEach((t=>{s[t]||(s[t]=!0,r[t]&&(r[t].parents[n]&&Object.keys(r[t].parents).forEach((e=>{e!==n&&delete r[t].parents[e]})),Object.keys(r[t].parents).forEach((n=>{n!==t&&(r[t].parents[n].inActivePath=!0,e[n]=!0)}))))})),i=Object.keys(e)}return r}buildGraph(e,t){const{capturedTuple:n}=this;let{tree:r={}}=this;const s=!!e,o={nodes:[],edges:[]};let a=!1;return this.deleteHangingNodes(),e&&(r=this.fillActivePath(e)),Object.keys(r).forEach((l=>{const c=r[l],[u,d]=l.split("#");let h;Object.keys(c.parents).forEach((e=>{var s;const u=c.parents[e];if(!r[e])return void(a=!0);if(t&&!u.inActivePath)return;h=!0;const p=null===(s=u.type)||void 0===s?void 0:s.replace(/\s/gu,"");p&&(o.nodes.push({id:`${e}.${p}.${l}`,label:u.type}),o.edges.push({to:`${e}.${p}.${l}`,from:e,isActive:u.inActivePath,group:i.GraphEdgeGroup.Default})),o.edges.push({to:l,from:p?`${e}.${p}.${l}`:e,label:e===n.object?`${d} from`:"",isActive:u.inActivePath,group:i.GraphEdgeGroup.Default})}));const p=l===e||"*"===l&&s,f=l===n.object;if(f||h||!t&&!a){const t=f||p;o.nodes.push({id:l,label:"*"===u&&s?`${e} via everyone (*)`:l,isActive:t})}})),o}}},40478:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={ulidValidate:n(16106).ulidValidate};t.default=r},16106:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ulidValidate=t.ulidPattern=void 0,t.ulidPattern=/[0-9A-HJKMNP-TV-Z]{26}/;t.ulidValidate=e=>t.ulidPattern.test(e)},80104:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ConditionNameDoesntMatchError=t.UnsupportedDSLNestingError=t.ConfigurationError=t.ModelValidationError=t.ModelValidationSingleError=t.DSLSyntaxError=t.DSLSyntaxSingleError=t.BaseError=t.ValidationError=void 0,function(e){e.SchemaVersionRequired="schema-version-required",e.SchemaVersionUnsupported="schema-version-unsupported",e.ReservedTypeKeywords="reserved-type-keywords",e.ReservedRelationKeywords="reserved-relation-keywords",e.SelfError="self-error",e.InvalidName="invalid-name",e.MissingDefinition="missing-definition",e.InvalidRelationType="invalid-relation-type",e.InvalidType="invalid-type",e.RelationNoEntrypoint="relation-no-entry-point",e.TuplesetNotDirect="tupleuset-not-direct",e.DuplicatedError="duplicated-error",e.RequireSchema1_0="allowed-type-schema-10",e.AssignableRelationsMustHaveType="assignable-relation-must-have-type",e.AllowedTypesNotValidOnSchema1_0="allowed-type-not-valid-on-schema-1_0",e.InvalidSchema="invalid-schema",e.InvalidSyntax="invalid-syntax",e.TypeRestrictionCannotHaveWildcardAndRelation="type-wildcard-relation",e.ConditionNotDefined="condition-not-defined",e.ConditionNotUsed="condition-not-used"}(n||(t.ValidationError=n={}));class r extends Error{constructor(e,t){super(`${t} error at line=${e.line.start}, column=${e.column.start}: ${e.msg}`),this.properties=e,this.type=t,this.line=e.line,this.column=e.column,this.msg=e.msg}getLine(e=0){return{start:this.line.start+e,end:this.line.end+e}}getColumn(e=0){return{start:this.column.start+e,end:this.column.end+e}}toString(){return this.message}}t.BaseError=r;t.DSLSyntaxSingleError=class extends r{constructor(e,t,n){super(e,"syntax"),this.properties=e,this.metadata=t,(null==n?void 0:n.stack)&&(this.stack=n.stack),this.metadata=t}toString(){return this.message}};class i extends Error{constructor(e){super(`${e.length} error${e.length>1?"s":""} occurred:\n\t* ${e.join("\n\t* ")}\n\n`),this.errors=e,this.errors=e}toString(){return this.message}}t.DSLSyntaxError=i;t.ModelValidationSingleError=class extends r{constructor(e,t){super(e,(null==t?void 0:t.errorType)||"validation"),this.properties=e,this.metadata=t,this.metadata=t}toString(){return this.message}};class s extends Error{constructor(e){super(`${e.length} error${e.length>1?"s":""} occurred:\n\t* ${e.join("\n\t* ")}\n\n`),this.errors=e,this.errors=e}toString(){return this.message}}t.ModelValidationError=s;class o extends Error{constructor(e,t){super(e),this.message=e,this.e=t,(null==t?void 0:t.stack)&&(this.stack=t.stack)}}t.ConfigurationError=o;class a extends Error{constructor(e,t){super(`the '${t}' relation under the '${e}' type has mixed operators which are not supported by the OpenFGA DSL syntax yet`),this.typeName=e,this.relationName=t}}t.UnsupportedDSLNestingError=a;class l extends Error{constructor(e,t){super(`the '${e}' condition has a different nested condition name ('${t}')`),this.conditionName=e,this.conditionNestedName=t}}t.ConditionNameDoesntMatchError=l},7538:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(92529);class i extends r.Lexer{constructor(e){super(e),this._interp=new r.LexerATNSimulator(this,i._ATN,i.DecisionsToDFA,new r.PredictionContextCache)}get grammarFileName(){return"OpenFGALexer.g4"}get literalNames(){return i.literalNames}get symbolicNames(){return i.symbolicNames}get ruleNames(){return i.ruleNames}get serializedATN(){return i._serializedATN}get channelNames(){return i.channelNames}get modeNames(){return i.modeNames}static get _ATN(){return i.__ATN||(i.__ATN=(new r.ATNDeserializer).deserialize(i._serializedATN)),i.__ATN}}i.INDENT=1,i.MODEL=2,i.SCHEMA=3,i.SCHEMA_VERSION=4,i.TYPE=5,i.CONDITION=6,i.RELATIONS=7,i.DEFINE=8,i.WTH=9,i.HASH=10,i.COLON=11,i.WILDCARD=12,i.L_SQUARE=13,i.R_SQUARE=14,i.L_PARANTHESES=15,i.R_PARANTHESES=16,i.L_BRACES=17,i.R_BRACES=18,i.L_ANGLE_BRACKET=19,i.R_ANGLE_BRACKET=20,i.COMMA=21,i.CONDITION_PARAM_CONTAINER=22,i.CONDITION_PARAM_TYPE=23,i.CONDITION_SYMBOL=24,i.AND=25,i.OR=26,i.BUT_NOT=27,i.FROM=28,i.ALPHA_NUMERIC=29,i.NEWLINE=30,i.WS=31,i.EOF=r.Token.EOF,i.channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"],i.literalNames=[null,null,"'model'","'schema'","'1.1'","'type'","'condition'","'relations'","'define'","'with'","'#'","':'","'*'","'['","']'","'('","')'","'{'","'}'","'<'","'>'","','",null,null,null,"'and'","'or'","'but not'","'from'"],i.symbolicNames=[null,"INDENT","MODEL","SCHEMA","SCHEMA_VERSION","TYPE","CONDITION","RELATIONS","DEFINE","WTH","HASH","COLON","WILDCARD","L_SQUARE","R_SQUARE","L_PARANTHESES","R_PARANTHESES","L_BRACES","R_BRACES","L_ANGLE_BRACKET","R_ANGLE_BRACKET","COMMA","CONDITION_PARAM_CONTAINER","CONDITION_PARAM_TYPE","CONDITION_SYMBOL","AND","OR","BUT_NOT","FROM","ALPHA_NUMERIC","NEWLINE","WS"],i.modeNames=["DEFAULT_MODE"],i.ruleNames=["SINGLE_INDENT","DOUBLE_INDENT","BOL","INDENT","MODEL","SCHEMA","SCHEMA_VERSION","TYPE","CONDITION","RELATIONS","DEFINE","WTH","HASH","COLON","WILDCARD","L_SQUARE","R_SQUARE","L_PARANTHESES","R_PARANTHESES","L_BRACES","R_BRACES","L_ANGLE_BRACKET","R_ANGLE_BRACKET","COMMA","CONDITION_PARAM_CONTAINER","CONDITION_PARAM_TYPE","CONDITION_SYMBOL","AND","OR","BUT_NOT","FROM","ALPHA_NUMERIC","NEWLINE","WS"],i._serializedATN=[4,0,31,303,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,1,0,1,0,1,0,3,0,73,8,0,1,1,1,1,1,1,1,1,1,1,1,1,3,1,81,8,1,1,2,4,2,84,8,2,11,2,12,2,85,1,3,1,3,1,3,3,3,91,8,3,1,4,1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,18,1,18,1,19,1,19,1,20,1,20,1,21,1,21,1,22,1,22,1,23,1,23,1,24,1,24,1,24,1,24,1,24,1,24,1,24,3,24,178,8,24,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,25,3,25,229,8,25,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,3,26,273,8,26,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,30,1,31,4,31,296,8,31,11,31,12,31,297,1,32,1,32,1,33,1,33,0,0,34,1,0,3,0,5,0,7,1,9,2,11,3,13,4,15,5,17,6,19,7,21,8,23,9,25,10,27,11,29,12,31,13,33,14,35,15,37,16,39,17,41,18,43,19,45,20,47,21,49,22,51,23,53,24,55,25,57,26,59,27,61,28,63,29,65,30,67,31,1,0,6,2,0,10,10,12,13,3,0,33,33,45,45,63,63,2,0,37,37,47,47,5,0,45,45,48,57,65,90,95,95,97,122,2,0,10,10,13,13,2,0,9,9,32,32,336,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,1,72,1,0,0,0,3,80,1,0,0,0,5,83,1,0,0,0,7,87,1,0,0,0,9,92,1,0,0,0,11,98,1,0,0,0,13,105,1,0,0,0,15,109,1,0,0,0,17,114,1,0,0,0,19,124,1,0,0,0,21,134,1,0,0,0,23,141,1,0,0,0,25,146,1,0,0,0,27,148,1,0,0,0,29,150,1,0,0,0,31,152,1,0,0,0,33,154,1,0,0,0,35,156,1,0,0,0,37,158,1,0,0,0,39,160,1,0,0,0,41,162,1,0,0,0,43,164,1,0,0,0,45,166,1,0,0,0,47,168,1,0,0,0,49,177,1,0,0,0,51,228,1,0,0,0,53,272,1,0,0,0,55,274,1,0,0,0,57,278,1,0,0,0,59,281,1,0,0,0,61,289,1,0,0,0,63,295,1,0,0,0,65,299,1,0,0,0,67,301,1,0,0,0,69,70,5,32,0,0,70,73,5,32,0,0,71,73,5,9,0,0,72,69,1,0,0,0,72,71,1,0,0,0,73,2,1,0,0,0,74,75,5,32,0,0,75,76,5,32,0,0,76,77,5,32,0,0,77,81,5,32,0,0,78,79,5,9,0,0,79,81,5,9,0,0,80,74,1,0,0,0,80,78,1,0,0,0,81,4,1,0,0,0,82,84,7,0,0,0,83,82,1,0,0,0,84,85,1,0,0,0,85,83,1,0,0,0,85,86,1,0,0,0,86,6,1,0,0,0,87,90,3,5,2,0,88,91,3,3,1,0,89,91,3,1,0,0,90,88,1,0,0,0,90,89,1,0,0,0,91,8,1,0,0,0,92,93,5,109,0,0,93,94,5,111,0,0,94,95,5,100,0,0,95,96,5,101,0,0,96,97,5,108,0,0,97,10,1,0,0,0,98,99,5,115,0,0,99,100,5,99,0,0,100,101,5,104,0,0,101,102,5,101,0,0,102,103,5,109,0,0,103,104,5,97,0,0,104,12,1,0,0,0,105,106,5,49,0,0,106,107,5,46,0,0,107,108,5,49,0,0,108,14,1,0,0,0,109,110,5,116,0,0,110,111,5,121,0,0,111,112,5,112,0,0,112,113,5,101,0,0,113,16,1,0,0,0,114,115,5,99,0,0,115,116,5,111,0,0,116,117,5,110,0,0,117,118,5,100,0,0,118,119,5,105,0,0,119,120,5,116,0,0,120,121,5,105,0,0,121,122,5,111,0,0,122,123,5,110,0,0,123,18,1,0,0,0,124,125,5,114,0,0,125,126,5,101,0,0,126,127,5,108,0,0,127,128,5,97,0,0,128,129,5,116,0,0,129,130,5,105,0,0,130,131,5,111,0,0,131,132,5,110,0,0,132,133,5,115,0,0,133,20,1,0,0,0,134,135,5,100,0,0,135,136,5,101,0,0,136,137,5,102,0,0,137,138,5,105,0,0,138,139,5,110,0,0,139,140,5,101,0,0,140,22,1,0,0,0,141,142,5,119,0,0,142,143,5,105,0,0,143,144,5,116,0,0,144,145,5,104,0,0,145,24,1,0,0,0,146,147,5,35,0,0,147,26,1,0,0,0,148,149,5,58,0,0,149,28,1,0,0,0,150,151,5,42,0,0,151,30,1,0,0,0,152,153,5,91,0,0,153,32,1,0,0,0,154,155,5,93,0,0,155,34,1,0,0,0,156,157,5,40,0,0,157,36,1,0,0,0,158,159,5,41,0,0,159,38,1,0,0,0,160,161,5,123,0,0,161,40,1,0,0,0,162,163,5,125,0,0,163,42,1,0,0,0,164,165,5,60,0,0,165,44,1,0,0,0,166,167,5,62,0,0,167,46,1,0,0,0,168,169,5,44,0,0,169,48,1,0,0,0,170,171,5,109,0,0,171,172,5,97,0,0,172,178,5,112,0,0,173,174,5,108,0,0,174,175,5,105,0,0,175,176,5,115,0,0,176,178,5,116,0,0,177,170,1,0,0,0,177,173,1,0,0,0,178,50,1,0,0,0,179,180,5,98,0,0,180,181,5,111,0,0,181,182,5,111,0,0,182,229,5,108,0,0,183,184,5,115,0,0,184,185,5,116,0,0,185,186,5,114,0,0,186,187,5,105,0,0,187,188,5,110,0,0,188,229,5,103,0,0,189,190,5,105,0,0,190,191,5,110,0,0,191,229,5,116,0,0,192,193,5,117,0,0,193,194,5,105,0,0,194,195,5,110,0,0,195,229,5,116,0,0,196,197,5,100,0,0,197,198,5,111,0,0,198,199,5,117,0,0,199,200,5,98,0,0,200,201,5,108,0,0,201,229,5,101,0,0,202,203,5,100,0,0,203,204,5,117,0,0,204,205,5,114,0,0,205,206,5,97,0,0,206,207,5,116,0,0,207,208,5,105,0,0,208,209,5,111,0,0,209,229,5,110,0,0,210,211,5,116,0,0,211,212,5,105,0,0,212,213,5,109,0,0,213,214,5,101,0,0,214,215,5,115,0,0,215,216,5,116,0,0,216,217,5,97,0,0,217,218,5,109,0,0,218,229,5,112,0,0,219,220,5,105,0,0,220,221,5,112,0,0,221,222,5,97,0,0,222,223,5,100,0,0,223,224,5,100,0,0,224,225,5,114,0,0,225,226,5,101,0,0,226,227,5,115,0,0,227,229,5,115,0,0,228,179,1,0,0,0,228,183,1,0,0,0,228,189,1,0,0,0,228,192,1,0,0,0,228,196,1,0,0,0,228,202,1,0,0,0,228,210,1,0,0,0,228,219,1,0,0,0,229,52,1,0,0,0,230,231,5,61,0,0,231,273,5,61,0,0,232,233,5,33,0,0,233,273,5,61,0,0,234,235,5,105,0,0,235,273,5,110,0,0,236,273,5,60,0,0,237,238,5,60,0,0,238,273,5,61,0,0,239,240,5,62,0,0,240,273,5,61,0,0,241,273,5,62,0,0,242,243,5,38,0,0,243,273,5,38,0,0,244,245,5,124,0,0,245,273,5,124,0,0,246,273,3,31,15,0,247,273,3,33,16,0,248,273,3,39,19,0,249,273,3,35,17,0,250,273,3,37,18,0,251,273,5,46,0,0,252,273,3,47,23,0,253,273,7,1,0,0,254,273,3,27,13,0,255,273,5,43,0,0,256,273,3,29,14,0,257,273,7,2,0,0,258,259,5,116,0,0,259,260,5,114,0,0,260,261,5,117,0,0,261,273,5,101,0,0,262,263,5,102,0,0,263,264,5,97,0,0,264,265,5,108,0,0,265,266,5,115,0,0,266,273,5,101,0,0,267,268,5,110,0,0,268,269,5,117,0,0,269,270,5,108,0,0,270,273,5,108,0,0,271,273,5,34,0,0,272,230,1,0,0,0,272,232,1,0,0,0,272,234,1,0,0,0,272,236,1,0,0,0,272,237,1,0,0,0,272,239,1,0,0,0,272,241,1,0,0,0,272,242,1,0,0,0,272,244,1,0,0,0,272,246,1,0,0,0,272,247,1,0,0,0,272,248,1,0,0,0,272,249,1,0,0,0,272,250,1,0,0,0,272,251,1,0,0,0,272,252,1,0,0,0,272,253,1,0,0,0,272,254,1,0,0,0,272,255,1,0,0,0,272,256,1,0,0,0,272,257,1,0,0,0,272,258,1,0,0,0,272,262,1,0,0,0,272,267,1,0,0,0,272,271,1,0,0,0,273,54,1,0,0,0,274,275,5,97,0,0,275,276,5,110,0,0,276,277,5,100,0,0,277,56,1,0,0,0,278,279,5,111,0,0,279,280,5,114,0,0,280,58,1,0,0,0,281,282,5,98,0,0,282,283,5,117,0,0,283,284,5,116,0,0,284,285,5,32,0,0,285,286,5,110,0,0,286,287,5,111,0,0,287,288,5,116,0,0,288,60,1,0,0,0,289,290,5,102,0,0,290,291,5,114,0,0,291,292,5,111,0,0,292,293,5,109,0,0,293,62,1,0,0,0,294,296,7,3,0,0,295,294,1,0,0,0,296,297,1,0,0,0,297,295,1,0,0,0,297,298,1,0,0,0,298,64,1,0,0,0,299,300,7,4,0,0,300,66,1,0,0,0,301,302,7,5,0,0,302,68,1,0,0,0,9,0,72,80,85,90,177,228,272,297,0],i.DecisionsToDFA=i._ATN.decisionToState.map(((e,t)=>new r.DFA(e,t))),t.default=i},73247:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NameContext=t.SchemaVersionContext=t.NewlineContext=t.SpacingContext=t.MultiLineCommentContext=t.CommentContext=t.ConditionExpressionContext=t.ParameterTypeContext=t.ConditionNameContext=t.ParameterNameContext=t.ConditionParameterContext=t.ConditionContext=t.ConditionsContext=t.TypeNameContext=t.RelationNameContext=t.RewriteTuplesetNameContext=t.RewriteTuplesetComputedusersetNameContext=t.RewriteComputedusersetNameContext=t.RelationDefGroupingContext=t.RelationDefTypeRestrictionUsersetContext=t.RelationDefTypeRestrictionWildcardContext=t.RelationDefTypeRestrictionRelationContext=t.RelationDefTypeRestrictionTypeContext=t.RelationDefTypeRestrictionWithConditionContext=t.RelationDefTypeRestrictionContext=t.RelationDefKeywordFromContext=t.RelationDefOperatorButNotContext=t.RelationDefOperatorOrContext=t.RelationDefOperatorAndContext=t.RelationDefOperatorContext=t.RelationDefRelationOnRelatedObjectContext=t.RelationDefRelationOnSameObjectContext=t.RelationDefRewriteContext=t.RelationDefDirectAssignmentContext=t.RelationDefPartialAllButNotContext=t.RelationDefPartialAllAndContext=t.RelationDefPartialAllOrContext=t.RelationDefPartialsContext=t.RelationDefContext=t.RelationDeclarationContext=t.TypeDefContext=t.TypeDefsContext=t.ModelHeaderContext=t.IndentationContext=t.MainContext=void 0;const r=n(92529);class i extends r.Parser{get grammarFileName(){return"OpenFGAParser.g4"}get literalNames(){return i.literalNames}get symbolicNames(){return i.symbolicNames}get ruleNames(){return i.ruleNames}get serializedATN(){return i._serializedATN}createFailedPredicateException(e,t){return new r.FailedPredicateException(this,e,t)}constructor(e){super(e),this._interp=new r.ParserATNSimulator(this,i._ATN,i.DecisionsToDFA,new r.PredictionContextCache)}main(){let e,t=new s(this,this._ctx,this.state);this.enterRule(t,0,i.RULE_main);try{this.enterOuterAlt(t,1),this.state=90,this.modelHeader(),this.state=91,this.typeDefs(),this.state=92,this.conditions(),this.state=94,this._errHandler.sync(this),e=this._input.LA(1),30===e&&(this.state=93,this.newline()),this.state=96,this.match(i.EOF)}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}indentation(){let e=new o(this,this._ctx,this.state);this.enterRule(e,2,i.RULE_indentation);try{this.enterOuterAlt(e,1),this.state=98,this.match(i.INDENT)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}modelHeader(){let e,t=new a(this,this._ctx,this.state);this.enterRule(t,4,i.RULE_modelHeader);try{this.enterOuterAlt(t,1),this.state=103,this._errHandler.sync(this),e=this._input.LA(1),10!==e&&31!==e||(this.state=100,this.multiLineComment(),this.state=101,this.newline()),this.state=105,this.match(i.MODEL),this.state=107,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=106,this.spacing()),this.state=112,this._errHandler.sync(this),e=this._input.LA(1),30===e&&(this.state=109,this.newline(),this.state=110,this.multiLineComment()),this.state=114,this.indentation(),this.state=115,this.match(i.SCHEMA),this.state=116,this.spacing(),this.state=117,this.schemaVersion(),this.state=119,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=118,this.spacing())}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}typeDefs(){let e=new l(this,this._ctx,this.state);this.enterRule(e,6,i.RULE_typeDefs);try{let t;for(this.enterOuterAlt(e,1),this.state=124,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,5,this._ctx);2!==t&&t!==r.ATN.INVALID_ALT_NUMBER;)1===t&&(this.state=121,this.typeDef()),this.state=126,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,5,this._ctx)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}typeDef(){let e,t=new c(this,this._ctx,this.state);this.enterRule(t,8,i.RULE_typeDef);try{let n;if(this.enterOuterAlt(t,1),this.state=130,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,6,this._ctx))this.state=127,this.newline(),this.state=128,this.multiLineComment();if(this.state=132,this.newline(),this.state=133,this.match(i.TYPE),this.state=134,this.spacing(),this.state=135,this.typeName(),this.state=137,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=136,this.spacing()),this.state=149,this._errHandler.sync(this),e=this._input.LA(1),1===e){this.state=139,this.indentation(),this.state=140,this.match(i.RELATIONS),this.state=142,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=141,this.spacing()),this.state=145,this._errHandler.sync(this),n=1;do{if(1!==n)throw new r.NoViableAltException(this);this.state=144,this.relationDeclaration(),this.state=147,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,9,this._ctx)}while(2!==n&&n!==r.ATN.INVALID_ALT_NUMBER)}}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}relationDeclaration(){let e,t=new u(this,this._ctx,this.state);this.enterRule(t,10,i.RULE_relationDeclaration);try{this.enterOuterAlt(t,1),this.state=154,this._errHandler.sync(this),e=this._input.LA(1),30===e&&(this.state=151,this.newline(),this.state=152,this.multiLineComment()),this.state=156,this.indentation(),this.state=157,this.match(i.DEFINE),this.state=158,this.spacing(),this.state=159,this.relationName(),this.state=161,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=160,this.spacing()),this.state=163,this.match(i.COLON),this.state=165,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=164,this.spacing()),this.state=167,this.relationDef(),this.state=169,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=168,this.spacing())}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}relationDef(){let e=new d(this,this._ctx,this.state);this.enterRule(e,12,i.RULE_relationDef);try{switch(this.enterOuterAlt(e,1),this.state=173,this._errHandler.sync(this),this._input.LA(1)){case 13:this.state=171,this.relationDefDirectAssignment();break;case 29:this.state=172,this.relationDefGrouping();break;default:throw new r.NoViableAltException(this)}if(this.state=176,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,16,this._ctx))this.state=175,this.relationDefPartials()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefPartials(){let e=new h(this,this._ctx,this.state);this.enterRule(e,14,i.RULE_relationDefPartials);try{switch(this.state=181,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,17,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=178,this.relationDefPartialAllOr();break;case 2:this.enterOuterAlt(e,2),this.state=179,this.relationDefPartialAllAnd();break;case 3:this.enterOuterAlt(e,3),this.state=180,this.relationDefPartialAllButNot()}}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefPartialAllOr(){let e=new p(this,this._ctx,this.state);this.enterRule(e,16,i.RULE_relationDefPartialAllOr);try{let t;this.enterOuterAlt(e,1),this.state=188,this._errHandler.sync(this),t=1;do{if(1!==t)throw new r.NoViableAltException(this);this.state=183,this.spacing(),this.state=184,this.relationDefOperatorOr(),this.state=185,this.spacing(),this.state=186,this.relationDefGrouping(),this.state=190,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,18,this._ctx)}while(2!==t&&t!==r.ATN.INVALID_ALT_NUMBER)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefPartialAllAnd(){let e=new f(this,this._ctx,this.state);this.enterRule(e,18,i.RULE_relationDefPartialAllAnd);try{let t;this.enterOuterAlt(e,1),this.state=197,this._errHandler.sync(this),t=1;do{if(1!==t)throw new r.NoViableAltException(this);this.state=192,this.spacing(),this.state=193,this.relationDefOperatorAnd(),this.state=194,this.spacing(),this.state=195,this.relationDefGrouping(),this.state=199,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,19,this._ctx)}while(2!==t&&t!==r.ATN.INVALID_ALT_NUMBER)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefPartialAllButNot(){let e=new g(this,this._ctx,this.state);this.enterRule(e,20,i.RULE_relationDefPartialAllButNot);try{let t;this.enterOuterAlt(e,1),this.state=206,this._errHandler.sync(this),t=1;do{if(1!==t)throw new r.NoViableAltException(this);this.state=201,this.spacing(),this.state=202,this.relationDefOperatorButNot(),this.state=203,this.spacing(),this.state=204,this.relationDefGrouping(),this.state=208,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,20,this._ctx)}while(2!==t&&t!==r.ATN.INVALID_ALT_NUMBER)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefDirectAssignment(){let e,t=new m(this,this._ctx,this.state);this.enterRule(t,22,i.RULE_relationDefDirectAssignment);try{if(this.enterOuterAlt(t,1),this.state=210,this.match(i.L_SQUARE),this.state=212,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=211,this.spacing()),this.state=214,this.relationDefTypeRestriction(),this.state=216,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,22,this._ctx))this.state=215,this.spacing();for(this.state=225,this._errHandler.sync(this),e=this._input.LA(1);21===e;)this.state=218,this.match(i.COMMA),this.state=220,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=219,this.spacing()),this.state=222,this.relationDefTypeRestriction(),this.state=227,this._errHandler.sync(this),e=this._input.LA(1);this.state=229,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=228,this.spacing()),this.state=231,this.match(i.R_SQUARE)}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}relationDefRewrite(){let e=new y(this,this._ctx,this.state);this.enterRule(e,24,i.RULE_relationDefRewrite);try{switch(this.state=235,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,26,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=233,this.relationDefRelationOnSameObject();break;case 2:this.enterOuterAlt(e,2),this.state=234,this.relationDefRelationOnRelatedObject()}}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefRelationOnSameObject(){let e=new b(this,this._ctx,this.state);this.enterRule(e,26,i.RULE_relationDefRelationOnSameObject);try{this.enterOuterAlt(e,1),this.state=237,this.rewriteComputedusersetName()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefRelationOnRelatedObject(){let e=new v(this,this._ctx,this.state);this.enterRule(e,28,i.RULE_relationDefRelationOnRelatedObject);try{this.enterOuterAlt(e,1),this.state=239,this.rewriteTuplesetComputedusersetName(),this.state=240,this.spacing(),this.state=241,this.relationDefKeywordFrom(),this.state=242,this.spacing(),this.state=243,this.rewriteTuplesetName()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefOperator(){let e=new E(this,this._ctx,this.state);this.enterRule(e,30,i.RULE_relationDefOperator);try{switch(this.state=248,this._errHandler.sync(this),this._input.LA(1)){case 26:this.enterOuterAlt(e,1),this.state=245,this.relationDefOperatorOr();break;case 25:this.enterOuterAlt(e,2),this.state=246,this.relationDefOperatorAnd();break;case 27:this.enterOuterAlt(e,3),this.state=247,this.relationDefOperatorButNot();break;default:throw new r.NoViableAltException(this)}}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefOperatorAnd(){let e=new _(this,this._ctx,this.state);this.enterRule(e,32,i.RULE_relationDefOperatorAnd);try{this.enterOuterAlt(e,1),this.state=250,this.match(i.AND)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefOperatorOr(){let e=new T(this,this._ctx,this.state);this.enterRule(e,34,i.RULE_relationDefOperatorOr);try{this.enterOuterAlt(e,1),this.state=252,this.match(i.OR)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefOperatorButNot(){let e=new x(this,this._ctx,this.state);this.enterRule(e,36,i.RULE_relationDefOperatorButNot);try{this.enterOuterAlt(e,1),this.state=254,this.match(i.BUT_NOT)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefKeywordFrom(){let e=new w(this,this._ctx,this.state);this.enterRule(e,38,i.RULE_relationDefKeywordFrom);try{this.enterOuterAlt(e,1),this.state=256,this.match(i.FROM)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefTypeRestriction(){let e=new S(this,this._ctx,this.state);this.enterRule(e,40,i.RULE_relationDefTypeRestriction);try{switch(this.state=262,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,28,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=258,this.relationDefTypeRestrictionType();break;case 2:this.enterOuterAlt(e,2),this.state=259,this.relationDefTypeRestrictionWildcard();break;case 3:this.enterOuterAlt(e,3),this.state=260,this.relationDefTypeRestrictionUserset();break;case 4:this.enterOuterAlt(e,4),this.state=261,this.relationDefTypeRestrictionWithCondition()}}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefTypeRestrictionWithCondition(){let e=new R(this,this._ctx,this.state);this.enterRule(e,42,i.RULE_relationDefTypeRestrictionWithCondition);try{switch(this.enterOuterAlt(e,1),this.state=267,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,29,this._ctx)){case 1:this.state=264,this.relationDefTypeRestrictionType();break;case 2:this.state=265,this.relationDefTypeRestrictionWildcard();break;case 3:this.state=266,this.relationDefTypeRestrictionUserset()}this.state=269,this.spacing(),this.state=270,this.match(i.WTH),this.state=271,this.spacing(),this.state=272,this.conditionName()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefTypeRestrictionType(){let e=new k(this,this._ctx,this.state);this.enterRule(e,44,i.RULE_relationDefTypeRestrictionType);try{this.enterOuterAlt(e,1),this.state=274,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefTypeRestrictionRelation(){let e=new C(this,this._ctx,this.state);this.enterRule(e,46,i.RULE_relationDefTypeRestrictionRelation);try{this.enterOuterAlt(e,1),this.state=276,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefTypeRestrictionWildcard(){let e=new O(this,this._ctx,this.state);this.enterRule(e,48,i.RULE_relationDefTypeRestrictionWildcard);try{if(this.enterOuterAlt(e,1),this.state=278,this.relationDefTypeRestrictionType(),this.state=279,this.match(i.COLON),this.state=280,this.match(i.WILDCARD),this.state=282,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,30,this._ctx))this.state=281,this.spacing()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefTypeRestrictionUserset(){let e=new A(this,this._ctx,this.state);this.enterRule(e,50,i.RULE_relationDefTypeRestrictionUserset);try{this.enterOuterAlt(e,1),this.state=284,this.relationDefTypeRestrictionType(),this.state=285,this.match(i.HASH),this.state=286,this.relationDefTypeRestrictionRelation()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationDefGrouping(){let e=new N(this,this._ctx,this.state);this.enterRule(e,52,i.RULE_relationDefGrouping);try{this.enterOuterAlt(e,1),this.state=288,this.relationDefRewrite()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}rewriteComputedusersetName(){let e=new I(this,this._ctx,this.state);this.enterRule(e,54,i.RULE_rewriteComputedusersetName);try{this.enterOuterAlt(e,1),this.state=290,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}rewriteTuplesetComputedusersetName(){let e=new L(this,this._ctx,this.state);this.enterRule(e,56,i.RULE_rewriteTuplesetComputedusersetName);try{this.enterOuterAlt(e,1),this.state=292,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}rewriteTuplesetName(){let e=new D(this,this._ctx,this.state);this.enterRule(e,58,i.RULE_rewriteTuplesetName);try{this.enterOuterAlt(e,1),this.state=294,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}relationName(){let e=new P(this,this._ctx,this.state);this.enterRule(e,60,i.RULE_relationName);try{this.enterOuterAlt(e,1),this.state=296,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}typeName(){let e=new M(this,this._ctx,this.state);this.enterRule(e,62,i.RULE_typeName);try{this.enterOuterAlt(e,1),this.state=298,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}conditions(){let e=new F(this,this._ctx,this.state);this.enterRule(e,64,i.RULE_conditions);try{let t;for(this.enterOuterAlt(e,1),this.state=303,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,31,this._ctx);2!==t&&t!==r.ATN.INVALID_ALT_NUMBER;)1===t&&(this.state=300,this.condition()),this.state=305,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,31,this._ctx)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}condition(){let e,t=new U(this,this._ctx,this.state);this.enterRule(t,66,i.RULE_condition);try{if(this.enterOuterAlt(t,1),this.state=309,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,32,this._ctx))this.state=306,this.newline(),this.state=307,this.multiLineComment();for(this.state=311,this.newline(),this.state=312,this.match(i.CONDITION),this.state=313,this.spacing(),this.state=314,this.conditionName(),this.state=316,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=315,this.spacing()),this.state=318,this.match(i.L_PARANTHESES),this.state=319,this.conditionParameter(),this.state=321,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=320,this.spacing()),this.state=333,this._errHandler.sync(this),e=this._input.LA(1);21===e;)this.state=323,this.match(i.COMMA),this.state=325,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=324,this.spacing()),this.state=327,this.conditionParameter(),this.state=329,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=328,this.spacing()),this.state=335,this._errHandler.sync(this),e=this._input.LA(1);this.state=336,this.match(i.R_PARANTHESES),this.state=338,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=337,this.spacing()),this.state=340,this.match(i.L_BRACES),this.state=341,this.conditionExpression(),this.state=342,this.match(i.R_BRACES)}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}conditionParameter(){let e,t=new j(this,this._ctx,this.state);this.enterRule(t,68,i.RULE_conditionParameter);try{this.enterOuterAlt(t,1),this.state=344,this.parameterName(),this.state=346,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=345,this.spacing()),this.state=348,this.match(i.COLON),this.state=350,this._errHandler.sync(this),e=this._input.LA(1),31===e&&(this.state=349,this.spacing()),this.state=352,this.parameterType()}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}parameterName(){let e=new B(this,this._ctx,this.state);this.enterRule(e,70,i.RULE_parameterName);try{this.enterOuterAlt(e,1),this.state=354,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}conditionName(){let e=new H(this,this._ctx,this.state);this.enterRule(e,72,i.RULE_conditionName);try{this.enterOuterAlt(e,1),this.state=356,this.name()}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}parameterType(){let e=new $(this,this._ctx,this.state);this.enterRule(e,74,i.RULE_parameterType);try{switch(this.state=363,this._errHandler.sync(this),this._input.LA(1)){case 23:this.enterOuterAlt(e,1),this.state=358,this.match(i.CONDITION_PARAM_TYPE);break;case 22:this.enterOuterAlt(e,2),this.state=359,this.match(i.CONDITION_PARAM_CONTAINER),this.state=360,this.match(i.L_ANGLE_BRACKET),this.state=361,this.match(i.CONDITION_PARAM_TYPE),this.state=362,this.match(i.R_ANGLE_BRACKET);break;default:throw new r.NoViableAltException(this)}}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}conditionExpression(){let e,t=new z(this,this._ctx,this.state);this.enterRule(t,76,i.RULE_conditionExpression);try{for(this.enterOuterAlt(t,1),this.state=369,this._errHandler.sync(this),e=this._input.LA(1);0==(-32&e)&&0!=(1<<e&4294705150);){switch(this.state=367,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,42,this._ctx)){case 1:this.state=365,this.match(i.CONDITION_SYMBOL);break;case 2:this.state=366,e=this._input.LA(1),e<=0||18===e?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())}this.state=371,this._errHandler.sync(this),e=this._input.LA(1)}}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}comment(){let e,t=new V(this,this._ctx,this.state);this.enterRule(t,78,i.RULE_comment);try{let n;for(this.enterOuterAlt(t,1),this.state=375,this._errHandler.sync(this),e=this._input.LA(1);31===e;)this.state=372,this.match(i.WS),this.state=377,this._errHandler.sync(this),e=this._input.LA(1);for(this.state=378,this.match(i.HASH),this.state=382,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,45,this._ctx);2!==n&&n!==r.ATN.INVALID_ALT_NUMBER;)1===n&&(this.state=379,e=this._input.LA(1),e<=0||30===e?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())),this.state=384,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,45,this._ctx)}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}multiLineComment(){let e=new G(this,this._ctx,this.state);this.enterRule(e,80,i.RULE_multiLineComment);try{let t;for(this.enterOuterAlt(e,1),this.state=385,this.comment(),this.state=391,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,46,this._ctx);2!==t&&t!==r.ATN.INVALID_ALT_NUMBER;)1===t&&(this.state=386,this.newline(),this.state=387,this.comment()),this.state=393,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,46,this._ctx)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}spacing(){let e=new W(this,this._ctx,this.state);this.enterRule(e,82,i.RULE_spacing);try{let t;this.enterOuterAlt(e,1),this.state=395,this._errHandler.sync(this),t=1;do{if(1!==t)throw new r.NoViableAltException(this);this.state=394,this.match(i.WS),this.state=397,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,47,this._ctx)}while(2!==t&&t!==r.ATN.INVALID_ALT_NUMBER)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}newline(){let e,t=new K(this,this._ctx,this.state);this.enterRule(t,84,i.RULE_newline);try{this.enterOuterAlt(t,1),this.state=400,this._errHandler.sync(this),e=this._input.LA(1);do{this.state=399,this.match(i.NEWLINE),this.state=402,this._errHandler.sync(this),e=this._input.LA(1)}while(30===e)}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}schemaVersion(){let e=new Y(this,this._ctx,this.state);this.enterRule(e,86,i.RULE_schemaVersion);try{this.enterOuterAlt(e,1),this.state=404,this.match(i.SCHEMA_VERSION)}catch(t){if(!(t instanceof r.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}name(){let e,t=new Z(this,this._ctx,this.state);this.enterRule(t,88,i.RULE_name);try{this.enterOuterAlt(t,1),this.state=407,this._errHandler.sync(this),e=this._input.LA(1);do{this.state=406,this.match(i.ALPHA_NUMERIC),this.state=409,this._errHandler.sync(this),e=this._input.LA(1)}while(29===e)}catch(n){if(!(n instanceof r.RecognitionException))throw n;t.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n)}finally{this.exitRule()}return t}static get _ATN(){return i.__ATN||(i.__ATN=(new r.ATNDeserializer).deserialize(i._serializedATN)),i.__ATN}}i.INDENT=1,i.MODEL=2,i.SCHEMA=3,i.SCHEMA_VERSION=4,i.TYPE=5,i.CONDITION=6,i.RELATIONS=7,i.DEFINE=8,i.WTH=9,i.HASH=10,i.COLON=11,i.WILDCARD=12,i.L_SQUARE=13,i.R_SQUARE=14,i.L_PARANTHESES=15,i.R_PARANTHESES=16,i.L_BRACES=17,i.R_BRACES=18,i.L_ANGLE_BRACKET=19,i.R_ANGLE_BRACKET=20,i.COMMA=21,i.CONDITION_PARAM_CONTAINER=22,i.CONDITION_PARAM_TYPE=23,i.CONDITION_SYMBOL=24,i.AND=25,i.OR=26,i.BUT_NOT=27,i.FROM=28,i.ALPHA_NUMERIC=29,i.NEWLINE=30,i.WS=31,i.EOF=r.Token.EOF,i.RULE_main=0,i.RULE_indentation=1,i.RULE_modelHeader=2,i.RULE_typeDefs=3,i.RULE_typeDef=4,i.RULE_relationDeclaration=5,i.RULE_relationDef=6,i.RULE_relationDefPartials=7,i.RULE_relationDefPartialAllOr=8,i.RULE_relationDefPartialAllAnd=9,i.RULE_relationDefPartialAllButNot=10,i.RULE_relationDefDirectAssignment=11,i.RULE_relationDefRewrite=12,i.RULE_relationDefRelationOnSameObject=13,i.RULE_relationDefRelationOnRelatedObject=14,i.RULE_relationDefOperator=15,i.RULE_relationDefOperatorAnd=16,i.RULE_relationDefOperatorOr=17,i.RULE_relationDefOperatorButNot=18,i.RULE_relationDefKeywordFrom=19,i.RULE_relationDefTypeRestriction=20,i.RULE_relationDefTypeRestrictionWithCondition=21,i.RULE_relationDefTypeRestrictionType=22,i.RULE_relationDefTypeRestrictionRelation=23,i.RULE_relationDefTypeRestrictionWildcard=24,i.RULE_relationDefTypeRestrictionUserset=25,i.RULE_relationDefGrouping=26,i.RULE_rewriteComputedusersetName=27,i.RULE_rewriteTuplesetComputedusersetName=28,i.RULE_rewriteTuplesetName=29,i.RULE_relationName=30,i.RULE_typeName=31,i.RULE_conditions=32,i.RULE_condition=33,i.RULE_conditionParameter=34,i.RULE_parameterName=35,i.RULE_conditionName=36,i.RULE_parameterType=37,i.RULE_conditionExpression=38,i.RULE_comment=39,i.RULE_multiLineComment=40,i.RULE_spacing=41,i.RULE_newline=42,i.RULE_schemaVersion=43,i.RULE_name=44,i.literalNames=[null,null,"'model'","'schema'","'1.1'","'type'","'condition'","'relations'","'define'","'with'","'#'","':'","'*'","'['","']'","'('","')'","'{'","'}'","'<'","'>'","','",null,null,null,"'and'","'or'","'but not'","'from'"],i.symbolicNames=[null,"INDENT","MODEL","SCHEMA","SCHEMA_VERSION","TYPE","CONDITION","RELATIONS","DEFINE","WTH","HASH","COLON","WILDCARD","L_SQUARE","R_SQUARE","L_PARANTHESES","R_PARANTHESES","L_BRACES","R_BRACES","L_ANGLE_BRACKET","R_ANGLE_BRACKET","COMMA","CONDITION_PARAM_CONTAINER","CONDITION_PARAM_TYPE","CONDITION_SYMBOL","AND","OR","BUT_NOT","FROM","ALPHA_NUMERIC","NEWLINE","WS"],i.ruleNames=["main","indentation","modelHeader","typeDefs","typeDef","relationDeclaration","relationDef","relationDefPartials","relationDefPartialAllOr","relationDefPartialAllAnd","relationDefPartialAllButNot","relationDefDirectAssignment","relationDefRewrite","relationDefRelationOnSameObject","relationDefRelationOnRelatedObject","relationDefOperator","relationDefOperatorAnd","relationDefOperatorOr","relationDefOperatorButNot","relationDefKeywordFrom","relationDefTypeRestriction","relationDefTypeRestrictionWithCondition","relationDefTypeRestrictionType","relationDefTypeRestrictionRelation","relationDefTypeRestrictionWildcard","relationDefTypeRestrictionUserset","relationDefGrouping","rewriteComputedusersetName","rewriteTuplesetComputedusersetName","rewriteTuplesetName","relationName","typeName","conditions","condition","conditionParameter","parameterName","conditionName","parameterType","conditionExpression","comment","multiLineComment","spacing","newline","schemaVersion","name"],i._serializedATN=[4,1,31,412,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,1,0,1,0,1,0,1,0,3,0,95,8,0,1,0,1,0,1,1,1,1,1,2,1,2,1,2,3,2,104,8,2,1,2,1,2,3,2,108,8,2,1,2,1,2,1,2,3,2,113,8,2,1,2,1,2,1,2,1,2,1,2,3,2,120,8,2,1,3,5,3,123,8,3,10,3,12,3,126,9,3,1,4,1,4,1,4,3,4,131,8,4,1,4,1,4,1,4,1,4,1,4,3,4,138,8,4,1,4,1,4,1,4,3,4,143,8,4,1,4,4,4,146,8,4,11,4,12,4,147,3,4,150,8,4,1,5,1,5,1,5,3,5,155,8,5,1,5,1,5,1,5,1,5,1,5,3,5,162,8,5,1,5,1,5,3,5,166,8,5,1,5,1,5,3,5,170,8,5,1,6,1,6,3,6,174,8,6,1,6,3,6,177,8,6,1,7,1,7,1,7,3,7,182,8,7,1,8,1,8,1,8,1,8,1,8,4,8,189,8,8,11,8,12,8,190,1,9,1,9,1,9,1,9,1,9,4,9,198,8,9,11,9,12,9,199,1,10,1,10,1,10,1,10,1,10,4,10,207,8,10,11,10,12,10,208,1,11,1,11,3,11,213,8,11,1,11,1,11,3,11,217,8,11,1,11,1,11,3,11,221,8,11,1,11,5,11,224,8,11,10,11,12,11,227,9,11,1,11,3,11,230,8,11,1,11,1,11,1,12,1,12,3,12,236,8,12,1,13,1,13,1,14,1,14,1,14,1,14,1,14,1,14,1,15,1,15,1,15,3,15,249,8,15,1,16,1,16,1,17,1,17,1,18,1,18,1,19,1,19,1,20,1,20,1,20,1,20,3,20,263,8,20,1,21,1,21,1,21,3,21,268,8,21,1,21,1,21,1,21,1,21,1,21,1,22,1,22,1,23,1,23,1,24,1,24,1,24,1,24,3,24,283,8,24,1,25,1,25,1,25,1,25,1,26,1,26,1,27,1,27,1,28,1,28,1,29,1,29,1,30,1,30,1,31,1,31,1,32,5,32,302,8,32,10,32,12,32,305,9,32,1,33,1,33,1,33,3,33,310,8,33,1,33,1,33,1,33,1,33,1,33,3,33,317,8,33,1,33,1,33,1,33,3,33,322,8,33,1,33,1,33,3,33,326,8,33,1,33,1,33,3,33,330,8,33,5,33,332,8,33,10,33,12,33,335,9,33,1,33,1,33,3,33,339,8,33,1,33,1,33,1,33,1,33,1,34,1,34,3,34,347,8,34,1,34,1,34,3,34,351,8,34,1,34,1,34,1,35,1,35,1,36,1,36,1,37,1,37,1,37,1,37,1,37,3,37,364,8,37,1,38,1,38,5,38,368,8,38,10,38,12,38,371,9,38,1,39,5,39,374,8,39,10,39,12,39,377,9,39,1,39,1,39,5,39,381,8,39,10,39,12,39,384,9,39,1,40,1,40,1,40,1,40,5,40,390,8,40,10,40,12,40,393,9,40,1,41,4,41,396,8,41,11,41,12,41,397,1,42,4,42,401,8,42,11,42,12,42,402,1,43,1,43,1,44,4,44,408,8,44,11,44,12,44,409,1,44,0,0,45,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,0,2,1,0,18,18,1,0,30,30,421,0,90,1,0,0,0,2,98,1,0,0,0,4,103,1,0,0,0,6,124,1,0,0,0,8,130,1,0,0,0,10,154,1,0,0,0,12,173,1,0,0,0,14,181,1,0,0,0,16,188,1,0,0,0,18,197,1,0,0,0,20,206,1,0,0,0,22,210,1,0,0,0,24,235,1,0,0,0,26,237,1,0,0,0,28,239,1,0,0,0,30,248,1,0,0,0,32,250,1,0,0,0,34,252,1,0,0,0,36,254,1,0,0,0,38,256,1,0,0,0,40,262,1,0,0,0,42,267,1,0,0,0,44,274,1,0,0,0,46,276,1,0,0,0,48,278,1,0,0,0,50,284,1,0,0,0,52,288,1,0,0,0,54,290,1,0,0,0,56,292,1,0,0,0,58,294,1,0,0,0,60,296,1,0,0,0,62,298,1,0,0,0,64,303,1,0,0,0,66,309,1,0,0,0,68,344,1,0,0,0,70,354,1,0,0,0,72,356,1,0,0,0,74,363,1,0,0,0,76,369,1,0,0,0,78,375,1,0,0,0,80,385,1,0,0,0,82,395,1,0,0,0,84,400,1,0,0,0,86,404,1,0,0,0,88,407,1,0,0,0,90,91,3,4,2,0,91,92,3,6,3,0,92,94,3,64,32,0,93,95,3,84,42,0,94,93,1,0,0,0,94,95,1,0,0,0,95,96,1,0,0,0,96,97,5,0,0,1,97,1,1,0,0,0,98,99,5,1,0,0,99,3,1,0,0,0,100,101,3,80,40,0,101,102,3,84,42,0,102,104,1,0,0,0,103,100,1,0,0,0,103,104,1,0,0,0,104,105,1,0,0,0,105,107,5,2,0,0,106,108,3,82,41,0,107,106,1,0,0,0,107,108,1,0,0,0,108,112,1,0,0,0,109,110,3,84,42,0,110,111,3,80,40,0,111,113,1,0,0,0,112,109,1,0,0,0,112,113,1,0,0,0,113,114,1,0,0,0,114,115,3,2,1,0,115,116,5,3,0,0,116,117,3,82,41,0,117,119,3,86,43,0,118,120,3,82,41,0,119,118,1,0,0,0,119,120,1,0,0,0,120,5,1,0,0,0,121,123,3,8,4,0,122,121,1,0,0,0,123,126,1,0,0,0,124,122,1,0,0,0,124,125,1,0,0,0,125,7,1,0,0,0,126,124,1,0,0,0,127,128,3,84,42,0,128,129,3,80,40,0,129,131,1,0,0,0,130,127,1,0,0,0,130,131,1,0,0,0,131,132,1,0,0,0,132,133,3,84,42,0,133,134,5,5,0,0,134,135,3,82,41,0,135,137,3,62,31,0,136,138,3,82,41,0,137,136,1,0,0,0,137,138,1,0,0,0,138,149,1,0,0,0,139,140,3,2,1,0,140,142,5,7,0,0,141,143,3,82,41,0,142,141,1,0,0,0,142,143,1,0,0,0,143,145,1,0,0,0,144,146,3,10,5,0,145,144,1,0,0,0,146,147,1,0,0,0,147,145,1,0,0,0,147,148,1,0,0,0,148,150,1,0,0,0,149,139,1,0,0,0,149,150,1,0,0,0,150,9,1,0,0,0,151,152,3,84,42,0,152,153,3,80,40,0,153,155,1,0,0,0,154,151,1,0,0,0,154,155,1,0,0,0,155,156,1,0,0,0,156,157,3,2,1,0,157,158,5,8,0,0,158,159,3,82,41,0,159,161,3,60,30,0,160,162,3,82,41,0,161,160,1,0,0,0,161,162,1,0,0,0,162,163,1,0,0,0,163,165,5,11,0,0,164,166,3,82,41,0,165,164,1,0,0,0,165,166,1,0,0,0,166,167,1,0,0,0,167,169,3,12,6,0,168,170,3,82,41,0,169,168,1,0,0,0,169,170,1,0,0,0,170,11,1,0,0,0,171,174,3,22,11,0,172,174,3,52,26,0,173,171,1,0,0,0,173,172,1,0,0,0,174,176,1,0,0,0,175,177,3,14,7,0,176,175,1,0,0,0,176,177,1,0,0,0,177,13,1,0,0,0,178,182,3,16,8,0,179,182,3,18,9,0,180,182,3,20,10,0,181,178,1,0,0,0,181,179,1,0,0,0,181,180,1,0,0,0,182,15,1,0,0,0,183,184,3,82,41,0,184,185,3,34,17,0,185,186,3,82,41,0,186,187,3,52,26,0,187,189,1,0,0,0,188,183,1,0,0,0,189,190,1,0,0,0,190,188,1,0,0,0,190,191,1,0,0,0,191,17,1,0,0,0,192,193,3,82,41,0,193,194,3,32,16,0,194,195,3,82,41,0,195,196,3,52,26,0,196,198,1,0,0,0,197,192,1,0,0,0,198,199,1,0,0,0,199,197,1,0,0,0,199,200,1,0,0,0,200,19,1,0,0,0,201,202,3,82,41,0,202,203,3,36,18,0,203,204,3,82,41,0,204,205,3,52,26,0,205,207,1,0,0,0,206,201,1,0,0,0,207,208,1,0,0,0,208,206,1,0,0,0,208,209,1,0,0,0,209,21,1,0,0,0,210,212,5,13,0,0,211,213,3,82,41,0,212,211,1,0,0,0,212,213,1,0,0,0,213,214,1,0,0,0,214,216,3,40,20,0,215,217,3,82,41,0,216,215,1,0,0,0,216,217,1,0,0,0,217,225,1,0,0,0,218,220,5,21,0,0,219,221,3,82,41,0,220,219,1,0,0,0,220,221,1,0,0,0,221,222,1,0,0,0,222,224,3,40,20,0,223,218,1,0,0,0,224,227,1,0,0,0,225,223,1,0,0,0,225,226,1,0,0,0,226,229,1,0,0,0,227,225,1,0,0,0,228,230,3,82,41,0,229,228,1,0,0,0,229,230,1,0,0,0,230,231,1,0,0,0,231,232,5,14,0,0,232,23,1,0,0,0,233,236,3,26,13,0,234,236,3,28,14,0,235,233,1,0,0,0,235,234,1,0,0,0,236,25,1,0,0,0,237,238,3,54,27,0,238,27,1,0,0,0,239,240,3,56,28,0,240,241,3,82,41,0,241,242,3,38,19,0,242,243,3,82,41,0,243,244,3,58,29,0,244,29,1,0,0,0,245,249,3,34,17,0,246,249,3,32,16,0,247,249,3,36,18,0,248,245,1,0,0,0,248,246,1,0,0,0,248,247,1,0,0,0,249,31,1,0,0,0,250,251,5,25,0,0,251,33,1,0,0,0,252,253,5,26,0,0,253,35,1,0,0,0,254,255,5,27,0,0,255,37,1,0,0,0,256,257,5,28,0,0,257,39,1,0,0,0,258,263,3,44,22,0,259,263,3,48,24,0,260,263,3,50,25,0,261,263,3,42,21,0,262,258,1,0,0,0,262,259,1,0,0,0,262,260,1,0,0,0,262,261,1,0,0,0,263,41,1,0,0,0,264,268,3,44,22,0,265,268,3,48,24,0,266,268,3,50,25,0,267,264,1,0,0,0,267,265,1,0,0,0,267,266,1,0,0,0,268,269,1,0,0,0,269,270,3,82,41,0,270,271,5,9,0,0,271,272,3,82,41,0,272,273,3,72,36,0,273,43,1,0,0,0,274,275,3,88,44,0,275,45,1,0,0,0,276,277,3,88,44,0,277,47,1,0,0,0,278,279,3,44,22,0,279,280,5,11,0,0,280,282,5,12,0,0,281,283,3,82,41,0,282,281,1,0,0,0,282,283,1,0,0,0,283,49,1,0,0,0,284,285,3,44,22,0,285,286,5,10,0,0,286,287,3,46,23,0,287,51,1,0,0,0,288,289,3,24,12,0,289,53,1,0,0,0,290,291,3,88,44,0,291,55,1,0,0,0,292,293,3,88,44,0,293,57,1,0,0,0,294,295,3,88,44,0,295,59,1,0,0,0,296,297,3,88,44,0,297,61,1,0,0,0,298,299,3,88,44,0,299,63,1,0,0,0,300,302,3,66,33,0,301,300,1,0,0,0,302,305,1,0,0,0,303,301,1,0,0,0,303,304,1,0,0,0,304,65,1,0,0,0,305,303,1,0,0,0,306,307,3,84,42,0,307,308,3,80,40,0,308,310,1,0,0,0,309,306,1,0,0,0,309,310,1,0,0,0,310,311,1,0,0,0,311,312,3,84,42,0,312,313,5,6,0,0,313,314,3,82,41,0,314,316,3,72,36,0,315,317,3,82,41,0,316,315,1,0,0,0,316,317,1,0,0,0,317,318,1,0,0,0,318,319,5,15,0,0,319,321,3,68,34,0,320,322,3,82,41,0,321,320,1,0,0,0,321,322,1,0,0,0,322,333,1,0,0,0,323,325,5,21,0,0,324,326,3,82,41,0,325,324,1,0,0,0,325,326,1,0,0,0,326,327,1,0,0,0,327,329,3,68,34,0,328,330,3,82,41,0,329,328,1,0,0,0,329,330,1,0,0,0,330,332,1,0,0,0,331,323,1,0,0,0,332,335,1,0,0,0,333,331,1,0,0,0,333,334,1,0,0,0,334,336,1,0,0,0,335,333,1,0,0,0,336,338,5,16,0,0,337,339,3,82,41,0,338,337,1,0,0,0,338,339,1,0,0,0,339,340,1,0,0,0,340,341,5,17,0,0,341,342,3,76,38,0,342,343,5,18,0,0,343,67,1,0,0,0,344,346,3,70,35,0,345,347,3,82,41,0,346,345,1,0,0,0,346,347,1,0,0,0,347,348,1,0,0,0,348,350,5,11,0,0,349,351,3,82,41,0,350,349,1,0,0,0,350,351,1,0,0,0,351,352,1,0,0,0,352,353,3,74,37,0,353,69,1,0,0,0,354,355,3,88,44,0,355,71,1,0,0,0,356,357,3,88,44,0,357,73,1,0,0,0,358,364,5,23,0,0,359,360,5,22,0,0,360,361,5,19,0,0,361,362,5,23,0,0,362,364,5,20,0,0,363,358,1,0,0,0,363,359,1,0,0,0,364,75,1,0,0,0,365,368,5,24,0,0,366,368,8,0,0,0,367,365,1,0,0,0,367,366,1,0,0,0,368,371,1,0,0,0,369,367,1,0,0,0,369,370,1,0,0,0,370,77,1,0,0,0,371,369,1,0,0,0,372,374,5,31,0,0,373,372,1,0,0,0,374,377,1,0,0,0,375,373,1,0,0,0,375,376,1,0,0,0,376,378,1,0,0,0,377,375,1,0,0,0,378,382,5,10,0,0,379,381,8,1,0,0,380,379,1,0,0,0,381,384,1,0,0,0,382,380,1,0,0,0,382,383,1,0,0,0,383,79,1,0,0,0,384,382,1,0,0,0,385,391,3,78,39,0,386,387,3,84,42,0,387,388,3,78,39,0,388,390,1,0,0,0,389,386,1,0,0,0,390,393,1,0,0,0,391,389,1,0,0,0,391,392,1,0,0,0,392,81,1,0,0,0,393,391,1,0,0,0,394,396,5,31,0,0,395,394,1,0,0,0,396,397,1,0,0,0,397,395,1,0,0,0,397,398,1,0,0,0,398,83,1,0,0,0,399,401,5,30,0,0,400,399,1,0,0,0,401,402,1,0,0,0,402,400,1,0,0,0,402,403,1,0,0,0,403,85,1,0,0,0,404,405,5,4,0,0,405,87,1,0,0,0,406,408,5,29,0,0,407,406,1,0,0,0,408,409,1,0,0,0,409,407,1,0,0,0,409,410,1,0,0,0,410,89,1,0,0,0,50,94,103,107,112,119,124,130,137,142,147,149,154,161,165,169,173,176,181,190,199,208,212,216,220,225,229,235,248,262,267,282,303,309,316,321,325,329,333,338,346,350,363,367,369,375,382,391,397,402,409],i.DecisionsToDFA=i._ATN.decisionToState.map(((e,t)=>new r.DFA(e,t))),t.default=i;class s extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}modelHeader(){return this.getTypedRuleContext(a,0)}typeDefs(){return this.getTypedRuleContext(l,0)}conditions(){return this.getTypedRuleContext(F,0)}EOF(){return this.getToken(i.EOF,0)}newline(){return this.getTypedRuleContext(K,0)}get ruleIndex(){return i.RULE_main}enterRule(e){e.enterMain&&e.enterMain(this)}exitRule(e){e.exitMain&&e.exitMain(this)}}t.MainContext=s;class o extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}INDENT(){return this.getToken(i.INDENT,0)}get ruleIndex(){return i.RULE_indentation}enterRule(e){e.enterIndentation&&e.enterIndentation(this)}exitRule(e){e.exitIndentation&&e.exitIndentation(this)}}t.IndentationContext=o;class a extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}MODEL(){return this.getToken(i.MODEL,0)}indentation(){return this.getTypedRuleContext(o,0)}SCHEMA(){return this.getToken(i.SCHEMA,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}schemaVersion(){return this.getTypedRuleContext(Y,0)}multiLineComment_list(){return this.getTypedRuleContexts(G)}multiLineComment(e){return this.getTypedRuleContext(G,e)}newline_list(){return this.getTypedRuleContexts(K)}newline(e){return this.getTypedRuleContext(K,e)}get ruleIndex(){return i.RULE_modelHeader}enterRule(e){e.enterModelHeader&&e.enterModelHeader(this)}exitRule(e){e.exitModelHeader&&e.exitModelHeader(this)}}t.ModelHeaderContext=a;class l extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}typeDef_list(){return this.getTypedRuleContexts(c)}typeDef(e){return this.getTypedRuleContext(c,e)}get ruleIndex(){return i.RULE_typeDefs}enterRule(e){e.enterTypeDefs&&e.enterTypeDefs(this)}exitRule(e){e.exitTypeDefs&&e.exitTypeDefs(this)}}t.TypeDefsContext=l;class c extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}newline_list(){return this.getTypedRuleContexts(K)}newline(e){return this.getTypedRuleContext(K,e)}TYPE(){return this.getToken(i.TYPE,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}typeName(){return this.getTypedRuleContext(M,0)}multiLineComment(){return this.getTypedRuleContext(G,0)}indentation(){return this.getTypedRuleContext(o,0)}RELATIONS(){return this.getToken(i.RELATIONS,0)}relationDeclaration_list(){return this.getTypedRuleContexts(u)}relationDeclaration(e){return this.getTypedRuleContext(u,e)}get ruleIndex(){return i.RULE_typeDef}enterRule(e){e.enterTypeDef&&e.enterTypeDef(this)}exitRule(e){e.exitTypeDef&&e.exitTypeDef(this)}}t.TypeDefContext=c;class u extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}indentation(){return this.getTypedRuleContext(o,0)}DEFINE(){return this.getToken(i.DEFINE,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}relationName(){return this.getTypedRuleContext(P,0)}COLON(){return this.getToken(i.COLON,0)}relationDef(){return this.getTypedRuleContext(d,0)}newline(){return this.getTypedRuleContext(K,0)}multiLineComment(){return this.getTypedRuleContext(G,0)}get ruleIndex(){return i.RULE_relationDeclaration}enterRule(e){e.enterRelationDeclaration&&e.enterRelationDeclaration(this)}exitRule(e){e.exitRelationDeclaration&&e.exitRelationDeclaration(this)}}t.RelationDeclarationContext=u;class d extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefDirectAssignment(){return this.getTypedRuleContext(m,0)}relationDefGrouping(){return this.getTypedRuleContext(N,0)}relationDefPartials(){return this.getTypedRuleContext(h,0)}get ruleIndex(){return i.RULE_relationDef}enterRule(e){e.enterRelationDef&&e.enterRelationDef(this)}exitRule(e){e.exitRelationDef&&e.exitRelationDef(this)}}t.RelationDefContext=d;class h extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefPartialAllOr(){return this.getTypedRuleContext(p,0)}relationDefPartialAllAnd(){return this.getTypedRuleContext(f,0)}relationDefPartialAllButNot(){return this.getTypedRuleContext(g,0)}get ruleIndex(){return i.RULE_relationDefPartials}enterRule(e){e.enterRelationDefPartials&&e.enterRelationDefPartials(this)}exitRule(e){e.exitRelationDefPartials&&e.exitRelationDefPartials(this)}}t.RelationDefPartialsContext=h;class p extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}relationDefOperatorOr_list(){return this.getTypedRuleContexts(T)}relationDefOperatorOr(e){return this.getTypedRuleContext(T,e)}relationDefGrouping_list(){return this.getTypedRuleContexts(N)}relationDefGrouping(e){return this.getTypedRuleContext(N,e)}get ruleIndex(){return i.RULE_relationDefPartialAllOr}enterRule(e){e.enterRelationDefPartialAllOr&&e.enterRelationDefPartialAllOr(this)}exitRule(e){e.exitRelationDefPartialAllOr&&e.exitRelationDefPartialAllOr(this)}}t.RelationDefPartialAllOrContext=p;class f extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}relationDefOperatorAnd_list(){return this.getTypedRuleContexts(_)}relationDefOperatorAnd(e){return this.getTypedRuleContext(_,e)}relationDefGrouping_list(){return this.getTypedRuleContexts(N)}relationDefGrouping(e){return this.getTypedRuleContext(N,e)}get ruleIndex(){return i.RULE_relationDefPartialAllAnd}enterRule(e){e.enterRelationDefPartialAllAnd&&e.enterRelationDefPartialAllAnd(this)}exitRule(e){e.exitRelationDefPartialAllAnd&&e.exitRelationDefPartialAllAnd(this)}}t.RelationDefPartialAllAndContext=f;class g extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}relationDefOperatorButNot_list(){return this.getTypedRuleContexts(x)}relationDefOperatorButNot(e){return this.getTypedRuleContext(x,e)}relationDefGrouping_list(){return this.getTypedRuleContexts(N)}relationDefGrouping(e){return this.getTypedRuleContext(N,e)}get ruleIndex(){return i.RULE_relationDefPartialAllButNot}enterRule(e){e.enterRelationDefPartialAllButNot&&e.enterRelationDefPartialAllButNot(this)}exitRule(e){e.exitRelationDefPartialAllButNot&&e.exitRelationDefPartialAllButNot(this)}}t.RelationDefPartialAllButNotContext=g;class m extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}L_SQUARE(){return this.getToken(i.L_SQUARE,0)}relationDefTypeRestriction_list(){return this.getTypedRuleContexts(S)}relationDefTypeRestriction(e){return this.getTypedRuleContext(S,e)}R_SQUARE(){return this.getToken(i.R_SQUARE,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}COMMA_list(){return this.getTokens(i.COMMA)}COMMA(e){return this.getToken(i.COMMA,e)}get ruleIndex(){return i.RULE_relationDefDirectAssignment}enterRule(e){e.enterRelationDefDirectAssignment&&e.enterRelationDefDirectAssignment(this)}exitRule(e){e.exitRelationDefDirectAssignment&&e.exitRelationDefDirectAssignment(this)}}t.RelationDefDirectAssignmentContext=m;class y extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefRelationOnSameObject(){return this.getTypedRuleContext(b,0)}relationDefRelationOnRelatedObject(){return this.getTypedRuleContext(v,0)}get ruleIndex(){return i.RULE_relationDefRewrite}enterRule(e){e.enterRelationDefRewrite&&e.enterRelationDefRewrite(this)}exitRule(e){e.exitRelationDefRewrite&&e.exitRelationDefRewrite(this)}}t.RelationDefRewriteContext=y;class b extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}rewriteComputedusersetName(){return this.getTypedRuleContext(I,0)}get ruleIndex(){return i.RULE_relationDefRelationOnSameObject}enterRule(e){e.enterRelationDefRelationOnSameObject&&e.enterRelationDefRelationOnSameObject(this)}exitRule(e){e.exitRelationDefRelationOnSameObject&&e.exitRelationDefRelationOnSameObject(this)}}t.RelationDefRelationOnSameObjectContext=b;class v extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}rewriteTuplesetComputedusersetName(){return this.getTypedRuleContext(L,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}relationDefKeywordFrom(){return this.getTypedRuleContext(w,0)}rewriteTuplesetName(){return this.getTypedRuleContext(D,0)}get ruleIndex(){return i.RULE_relationDefRelationOnRelatedObject}enterRule(e){e.enterRelationDefRelationOnRelatedObject&&e.enterRelationDefRelationOnRelatedObject(this)}exitRule(e){e.exitRelationDefRelationOnRelatedObject&&e.exitRelationDefRelationOnRelatedObject(this)}}t.RelationDefRelationOnRelatedObjectContext=v;class E extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefOperatorOr(){return this.getTypedRuleContext(T,0)}relationDefOperatorAnd(){return this.getTypedRuleContext(_,0)}relationDefOperatorButNot(){return this.getTypedRuleContext(x,0)}get ruleIndex(){return i.RULE_relationDefOperator}enterRule(e){e.enterRelationDefOperator&&e.enterRelationDefOperator(this)}exitRule(e){e.exitRelationDefOperator&&e.exitRelationDefOperator(this)}}t.RelationDefOperatorContext=E;class _ extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}AND(){return this.getToken(i.AND,0)}get ruleIndex(){return i.RULE_relationDefOperatorAnd}enterRule(e){e.enterRelationDefOperatorAnd&&e.enterRelationDefOperatorAnd(this)}exitRule(e){e.exitRelationDefOperatorAnd&&e.exitRelationDefOperatorAnd(this)}}t.RelationDefOperatorAndContext=_;class T extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}OR(){return this.getToken(i.OR,0)}get ruleIndex(){return i.RULE_relationDefOperatorOr}enterRule(e){e.enterRelationDefOperatorOr&&e.enterRelationDefOperatorOr(this)}exitRule(e){e.exitRelationDefOperatorOr&&e.exitRelationDefOperatorOr(this)}}t.RelationDefOperatorOrContext=T;class x extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}BUT_NOT(){return this.getToken(i.BUT_NOT,0)}get ruleIndex(){return i.RULE_relationDefOperatorButNot}enterRule(e){e.enterRelationDefOperatorButNot&&e.enterRelationDefOperatorButNot(this)}exitRule(e){e.exitRelationDefOperatorButNot&&e.exitRelationDefOperatorButNot(this)}}t.RelationDefOperatorButNotContext=x;class w extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}FROM(){return this.getToken(i.FROM,0)}get ruleIndex(){return i.RULE_relationDefKeywordFrom}enterRule(e){e.enterRelationDefKeywordFrom&&e.enterRelationDefKeywordFrom(this)}exitRule(e){e.exitRelationDefKeywordFrom&&e.exitRelationDefKeywordFrom(this)}}t.RelationDefKeywordFromContext=w;class S extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefTypeRestrictionType(){return this.getTypedRuleContext(k,0)}relationDefTypeRestrictionWildcard(){return this.getTypedRuleContext(O,0)}relationDefTypeRestrictionUserset(){return this.getTypedRuleContext(A,0)}relationDefTypeRestrictionWithCondition(){return this.getTypedRuleContext(R,0)}get ruleIndex(){return i.RULE_relationDefTypeRestriction}enterRule(e){e.enterRelationDefTypeRestriction&&e.enterRelationDefTypeRestriction(this)}exitRule(e){e.exitRelationDefTypeRestriction&&e.exitRelationDefTypeRestriction(this)}}t.RelationDefTypeRestrictionContext=S;class R extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}WTH(){return this.getToken(i.WTH,0)}conditionName(){return this.getTypedRuleContext(H,0)}relationDefTypeRestrictionType(){return this.getTypedRuleContext(k,0)}relationDefTypeRestrictionWildcard(){return this.getTypedRuleContext(O,0)}relationDefTypeRestrictionUserset(){return this.getTypedRuleContext(A,0)}get ruleIndex(){return i.RULE_relationDefTypeRestrictionWithCondition}enterRule(e){e.enterRelationDefTypeRestrictionWithCondition&&e.enterRelationDefTypeRestrictionWithCondition(this)}exitRule(e){e.exitRelationDefTypeRestrictionWithCondition&&e.exitRelationDefTypeRestrictionWithCondition(this)}}t.RelationDefTypeRestrictionWithConditionContext=R;class k extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_relationDefTypeRestrictionType}enterRule(e){e.enterRelationDefTypeRestrictionType&&e.enterRelationDefTypeRestrictionType(this)}exitRule(e){e.exitRelationDefTypeRestrictionType&&e.exitRelationDefTypeRestrictionType(this)}}t.RelationDefTypeRestrictionTypeContext=k;class C extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_relationDefTypeRestrictionRelation}enterRule(e){e.enterRelationDefTypeRestrictionRelation&&e.enterRelationDefTypeRestrictionRelation(this)}exitRule(e){e.exitRelationDefTypeRestrictionRelation&&e.exitRelationDefTypeRestrictionRelation(this)}}t.RelationDefTypeRestrictionRelationContext=C;class O extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefTypeRestrictionType(){return this.getTypedRuleContext(k,0)}COLON(){return this.getToken(i.COLON,0)}WILDCARD(){return this.getToken(i.WILDCARD,0)}spacing(){return this.getTypedRuleContext(W,0)}get ruleIndex(){return i.RULE_relationDefTypeRestrictionWildcard}enterRule(e){e.enterRelationDefTypeRestrictionWildcard&&e.enterRelationDefTypeRestrictionWildcard(this)}exitRule(e){e.exitRelationDefTypeRestrictionWildcard&&e.exitRelationDefTypeRestrictionWildcard(this)}}t.RelationDefTypeRestrictionWildcardContext=O;class A extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefTypeRestrictionType(){return this.getTypedRuleContext(k,0)}HASH(){return this.getToken(i.HASH,0)}relationDefTypeRestrictionRelation(){return this.getTypedRuleContext(C,0)}get ruleIndex(){return i.RULE_relationDefTypeRestrictionUserset}enterRule(e){e.enterRelationDefTypeRestrictionUserset&&e.enterRelationDefTypeRestrictionUserset(this)}exitRule(e){e.exitRelationDefTypeRestrictionUserset&&e.exitRelationDefTypeRestrictionUserset(this)}}t.RelationDefTypeRestrictionUsersetContext=A;class N extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}relationDefRewrite(){return this.getTypedRuleContext(y,0)}get ruleIndex(){return i.RULE_relationDefGrouping}enterRule(e){e.enterRelationDefGrouping&&e.enterRelationDefGrouping(this)}exitRule(e){e.exitRelationDefGrouping&&e.exitRelationDefGrouping(this)}}t.RelationDefGroupingContext=N;class I extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_rewriteComputedusersetName}enterRule(e){e.enterRewriteComputedusersetName&&e.enterRewriteComputedusersetName(this)}exitRule(e){e.exitRewriteComputedusersetName&&e.exitRewriteComputedusersetName(this)}}t.RewriteComputedusersetNameContext=I;class L extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_rewriteTuplesetComputedusersetName}enterRule(e){e.enterRewriteTuplesetComputedusersetName&&e.enterRewriteTuplesetComputedusersetName(this)}exitRule(e){e.exitRewriteTuplesetComputedusersetName&&e.exitRewriteTuplesetComputedusersetName(this)}}t.RewriteTuplesetComputedusersetNameContext=L;class D extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_rewriteTuplesetName}enterRule(e){e.enterRewriteTuplesetName&&e.enterRewriteTuplesetName(this)}exitRule(e){e.exitRewriteTuplesetName&&e.exitRewriteTuplesetName(this)}}t.RewriteTuplesetNameContext=D;class P extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_relationName}enterRule(e){e.enterRelationName&&e.enterRelationName(this)}exitRule(e){e.exitRelationName&&e.exitRelationName(this)}}t.RelationNameContext=P;class M extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_typeName}enterRule(e){e.enterTypeName&&e.enterTypeName(this)}exitRule(e){e.exitTypeName&&e.exitTypeName(this)}}t.TypeNameContext=M;class F extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}condition_list(){return this.getTypedRuleContexts(U)}condition(e){return this.getTypedRuleContext(U,e)}get ruleIndex(){return i.RULE_conditions}enterRule(e){e.enterConditions&&e.enterConditions(this)}exitRule(e){e.exitConditions&&e.exitConditions(this)}}t.ConditionsContext=F;class U extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}newline_list(){return this.getTypedRuleContexts(K)}newline(e){return this.getTypedRuleContext(K,e)}CONDITION(){return this.getToken(i.CONDITION,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}conditionName(){return this.getTypedRuleContext(H,0)}L_PARANTHESES(){return this.getToken(i.L_PARANTHESES,0)}conditionParameter_list(){return this.getTypedRuleContexts(j)}conditionParameter(e){return this.getTypedRuleContext(j,e)}R_PARANTHESES(){return this.getToken(i.R_PARANTHESES,0)}L_BRACES(){return this.getToken(i.L_BRACES,0)}conditionExpression(){return this.getTypedRuleContext(z,0)}R_BRACES(){return this.getToken(i.R_BRACES,0)}multiLineComment(){return this.getTypedRuleContext(G,0)}COMMA_list(){return this.getTokens(i.COMMA)}COMMA(e){return this.getToken(i.COMMA,e)}get ruleIndex(){return i.RULE_condition}enterRule(e){e.enterCondition&&e.enterCondition(this)}exitRule(e){e.exitCondition&&e.exitCondition(this)}}t.ConditionContext=U;class j extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}parameterName(){return this.getTypedRuleContext(B,0)}COLON(){return this.getToken(i.COLON,0)}parameterType(){return this.getTypedRuleContext($,0)}spacing_list(){return this.getTypedRuleContexts(W)}spacing(e){return this.getTypedRuleContext(W,e)}get ruleIndex(){return i.RULE_conditionParameter}enterRule(e){e.enterConditionParameter&&e.enterConditionParameter(this)}exitRule(e){e.exitConditionParameter&&e.exitConditionParameter(this)}}t.ConditionParameterContext=j;class B extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_parameterName}enterRule(e){e.enterParameterName&&e.enterParameterName(this)}exitRule(e){e.exitParameterName&&e.exitParameterName(this)}}t.ParameterNameContext=B;class H extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}name(){return this.getTypedRuleContext(Z,0)}get ruleIndex(){return i.RULE_conditionName}enterRule(e){e.enterConditionName&&e.enterConditionName(this)}exitRule(e){e.exitConditionName&&e.exitConditionName(this)}}t.ConditionNameContext=H;class $ extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}CONDITION_PARAM_TYPE(){return this.getToken(i.CONDITION_PARAM_TYPE,0)}CONDITION_PARAM_CONTAINER(){return this.getToken(i.CONDITION_PARAM_CONTAINER,0)}L_ANGLE_BRACKET(){return this.getToken(i.L_ANGLE_BRACKET,0)}R_ANGLE_BRACKET(){return this.getToken(i.R_ANGLE_BRACKET,0)}get ruleIndex(){return i.RULE_parameterType}enterRule(e){e.enterParameterType&&e.enterParameterType(this)}exitRule(e){e.exitParameterType&&e.exitParameterType(this)}}t.ParameterTypeContext=$;class z extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}CONDITION_SYMBOL_list(){return this.getTokens(i.CONDITION_SYMBOL)}CONDITION_SYMBOL(e){return this.getToken(i.CONDITION_SYMBOL,e)}R_BRACES_list(){return this.getTokens(i.R_BRACES)}R_BRACES(e){return this.getToken(i.R_BRACES,e)}get ruleIndex(){return i.RULE_conditionExpression}enterRule(e){e.enterConditionExpression&&e.enterConditionExpression(this)}exitRule(e){e.exitConditionExpression&&e.exitConditionExpression(this)}}t.ConditionExpressionContext=z;class V extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}HASH(){return this.getToken(i.HASH,0)}WS_list(){return this.getTokens(i.WS)}WS(e){return this.getToken(i.WS,e)}NEWLINE_list(){return this.getTokens(i.NEWLINE)}NEWLINE(e){return this.getToken(i.NEWLINE,e)}get ruleIndex(){return i.RULE_comment}enterRule(e){e.enterComment&&e.enterComment(this)}exitRule(e){e.exitComment&&e.exitComment(this)}}t.CommentContext=V;class G extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}comment_list(){return this.getTypedRuleContexts(V)}comment(e){return this.getTypedRuleContext(V,e)}newline_list(){return this.getTypedRuleContexts(K)}newline(e){return this.getTypedRuleContext(K,e)}get ruleIndex(){return i.RULE_multiLineComment}enterRule(e){e.enterMultiLineComment&&e.enterMultiLineComment(this)}exitRule(e){e.exitMultiLineComment&&e.exitMultiLineComment(this)}}t.MultiLineCommentContext=G;class W extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}WS_list(){return this.getTokens(i.WS)}WS(e){return this.getToken(i.WS,e)}get ruleIndex(){return i.RULE_spacing}enterRule(e){e.enterSpacing&&e.enterSpacing(this)}exitRule(e){e.exitSpacing&&e.exitSpacing(this)}}t.SpacingContext=W;class K extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}NEWLINE_list(){return this.getTokens(i.NEWLINE)}NEWLINE(e){return this.getToken(i.NEWLINE,e)}get ruleIndex(){return i.RULE_newline}enterRule(e){e.enterNewline&&e.enterNewline(this)}exitRule(e){e.exitNewline&&e.exitNewline(this)}}t.NewlineContext=K;class Y extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}SCHEMA_VERSION(){return this.getToken(i.SCHEMA_VERSION,0)}get ruleIndex(){return i.RULE_schemaVersion}enterRule(e){e.enterSchemaVersion&&e.enterSchemaVersion(this)}exitRule(e){e.exitSchemaVersion&&e.exitSchemaVersion(this)}}t.SchemaVersionContext=Y;class Z extends r.ParserRuleContext{constructor(e,t,n){super(t,n),this.parser=e}ALPHA_NUMERIC_list(){return this.getTokens(i.ALPHA_NUMERIC)}ALPHA_NUMERIC(e){return this.getToken(i.ALPHA_NUMERIC,e)}get ruleIndex(){return i.RULE_name}enterRule(e){e.enterName&&e.enterName(this)}exitRule(e){e.exitName&&e.exitName(this)}}t.NameContext=Z},17752:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(92529);class i extends r.ParseTreeListener{}t.default=i},40801:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.errors=t.transformer=t.validator=void 0,t.validator=s(n(95289)),t.transformer=s(n(30620)),t.errors=s(n(80104))},37351:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.transformDSLToJSON=t.transformDSLToJSONObject=t.parseDSL=void 0;const a=s(n(92529)),l=n(92529),c=o(n(17752)),u=o(n(7538)),d=o(n(73247)),h=n(80104);var p;!function(e){e.RELATION_DEFINITION_OPERATOR_NONE="",e.RELATION_DEFINITION_OPERATOR_OR="or",e.RELATION_DEFINITION_OPERATOR_AND="and",e.RELATION_DEFINITION_OPERATOR_BUT_NOT="but not"}(p||(p={}));class f extends c.default{constructor(){super(...arguments),this.authorizationModel={},this.exitSchemaVersion=e=>{this.authorizationModel.schema_version=e.getText()},this.enterTypeDefs=e=>{this.authorizationModel.type_definitions=[]},this.exitTypeDefs=e=>{var t;(null===(t=this.authorizationModel.type_definitions)||void 0===t?void 0:t.length)||delete this.authorizationModel.type_definitions},this.enterTypeDef=e=>{e.typeName()&&(this.currentTypeDef={type:e.typeName().getText(),relations:{},metadata:{relations:{}}})},this.exitTypeDef=e=>{var t,n,r,i;(null===(t=this.currentTypeDef)||void 0===t?void 0:t.type)&&(Object.keys((null===(r=null===(n=this.currentTypeDef)||void 0===n?void 0:n.metadata)||void 0===r?void 0:r.relations)||{}).length||(this.currentTypeDef.metadata=null),null===(i=this.authorizationModel.type_definitions)||void 0===i||i.push(this.currentTypeDef),this.currentTypeDef=void 0)},this.enterRelationDeclaration=e=>{this.currentRelation={rewrites:[],typeInfo:{directly_related_user_types:[]}}},this.exitRelationDeclaration=e=>{var t,n,r,i,s,o;if(!e.relationName())return;const a=e.relationName().getText();let l;const c=null===(t=this.currentRelation)||void 0===t?void 0:t.rewrites;if(null==c?void 0:c.length){if(1===(null==c?void 0:c.length))l=c[0];else switch(null===(n=this.currentRelation)||void 0===n?void 0:n.operator){case p.RELATION_DEFINITION_OPERATOR_OR:l={union:{child:c}};break;case p.RELATION_DEFINITION_OPERATOR_AND:l={intersection:{child:c}};break;case p.RELATION_DEFINITION_OPERATOR_BUT_NOT:l={difference:{base:c[0],subtract:c[1]}}}if(l){this.currentTypeDef.relations[a]&&(null===(r=e.parser)||void 0===r||r.notifyErrorListeners(`'${a}' is already defined in '${null===(i=this.currentTypeDef)||void 0===i?void 0:i.type}'`,e.relationName().start,void 0)),this.currentTypeDef.relations[a]=l;const t=null===(o=null===(s=this.currentRelation)||void 0===s?void 0:s.typeInfo)||void 0===o?void 0:o.directly_related_user_types;this.currentTypeDef.metadata.relations[a]={directly_related_user_types:t}}this.currentRelation=void 0}},this.enterRelationDefDirectAssignment=e=>{this.currentRelation.typeInfo={directly_related_user_types:[]}},this.exitRelationDefDirectAssignment=e=>{var t,n;null===(n=null===(t=this.currentRelation)||void 0===t?void 0:t.rewrites)||void 0===n||n.push({this:{}})},this.exitRelationDefTypeRestriction=e=>{const t={},n=e.relationDefTypeRestrictionWithCondition();let r,i,s;null!=n?(r=n.relationDefTypeRestrictionType(),i=n.relationDefTypeRestrictionUserset(),s=n.relationDefTypeRestrictionWildcard(),null!=n.conditionName()&&(t.condition=n.conditionName().getText())):(r=e.relationDefTypeRestrictionType(),i=e.relationDefTypeRestrictionUserset(),s=e.relationDefTypeRestrictionWildcard()),r&&(t.type=r.getText()),i&&(t.type=i.relationDefTypeRestrictionType().getText(),t.relation=i.relationDefTypeRestrictionRelation().getText()),s&&(t.type=s.relationDefTypeRestrictionType().getText(),t.wildcard={}),this.currentRelation.typeInfo.directly_related_user_types.push(t)},this.exitRelationDefRelationOnSameObject=e=>{var t,n;const r={computedUserset:{object:"",relation:e.rewriteComputedusersetName().getText()}};null===(n=null===(t=this.currentRelation)||void 0===t?void 0:t.rewrites)||void 0===n||n.push(r)},this.exitRelationDefRelationOnRelatedObject=e=>{var t,n;const r={tupleToUserset:{computedUserset:{object:"",relation:e.rewriteTuplesetComputedusersetName().getText()},tupleset:{object:"",relation:e.rewriteTuplesetName().getText()}}};null===(n=null===(t=this.currentRelation)||void 0===t?void 0:t.rewrites)||void 0===n||n.push(r)},this.enterRelationDefPartialAllOr=e=>{this.currentRelation.operator=p.RELATION_DEFINITION_OPERATOR_OR},this.enterRelationDefPartialAllAnd=e=>{this.currentRelation.operator=p.RELATION_DEFINITION_OPERATOR_AND},this.enterRelationDefPartialAllButNot=e=>{this.currentRelation.operator=p.RELATION_DEFINITION_OPERATOR_BUT_NOT},this.enterCondition=e=>{var t;if(null===e.conditionName())return;this.authorizationModel.conditions||(this.authorizationModel.conditions={});const n=e.conditionName().getText();this.authorizationModel.conditions[n]&&(null===(t=e.parser)||void 0===t||t.notifyErrorListeners(`'${n}' is already defined in the model`,e.conditionName().start,void 0)),this.currentCondition={name:n,expression:"",parameters:{}}},this.exitConditionParameter=e=>{var t,n,r,i;if(!e.parameterName()||!e.parameterType())return;const s=e.parameterName().getText();(null===(n=null===(t=this.currentCondition)||void 0===t?void 0:t.parameters)||void 0===n?void 0:n[s])&&(null===(r=e.parser)||void 0===r||r.notifyErrorListeners(`parameter '${s}' is already defined in the condition ${null===(i=this.currentCondition)||void 0===i?void 0:i.name}`,e.parameterName().start,void 0));const o=e.parameterType().CONDITION_PARAM_CONTAINER(),a={};if(o){a.type_name=`TYPE_NAME_${o.getText().toUpperCase()}`;const t=e.parameterType().CONDITION_PARAM_TYPE()&&`TYPE_NAME_${e.parameterType().CONDITION_PARAM_TYPE().getText().toUpperCase()}`;t&&(a.generic_types=[{type_name:t}])}else a.type_name=`TYPE_NAME_${e.parameterType().getText().toUpperCase()}`;this.currentCondition.parameters[s]=a},this.exitConditionExpression=e=>{this.currentCondition.expression=e.getText()},this.exitCondition=e=>{this.currentCondition&&(this.authorizationModel.conditions[this.currentCondition.name]=this.currentCondition,this.currentCondition=void 0)}}}class g extends l.ErrorListener{constructor(){super(...arguments),this.errors=[]}syntaxError(e,t,n,r,i,s){let o,l=0;t instanceof a.Token&&(o={symbol:t.text},l=o.symbol.length),this.errors.push(new h.DSLSyntaxSingleError({line:{start:n,end:n},column:{start:r,end:r+l},msg:i},o,s))}}function m(e){const t=e.split("\n").map((e=>e.trimEnd())).join("\n"),n=new a.InputStream(t),r=new g,i=new u.default(n);i.removeErrorListeners(),i.addErrorListener(r);const s=new a.CommonTokenStream(i),o=new d.default(s);o.removeErrorListeners(),o.addErrorListener(r);const l=new f;return(new a.ParseTreeWalker).walk(l,o.main()),{listener:l,errorListener:r}}function y(e){const{listener:t,errorListener:n}=m(e);if(n.errors.length)throw new h.DSLSyntaxError(n.errors);return t.authorizationModel}t.parseDSL=m,t.transformDSLToJSONObject=y,t.transformDSLToJSON=function(e){return JSON.stringify(y(e))}},30620:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(37351),t),i(n(1035),t)},1035:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transformJSONStringToDSL=t.transformJSONToDSL=void 0;const r=n(80104);function i(e){const t=e.type,n=e.relation,r=e.wildcard,i=e.condition;return r?`${t}:*`:n?`${t}#${n}`:i?`${t} with ${i}`:t}function s(e){return`[${function(e){const t=[];for(let n=0;n<(null==e?void 0:e.length);n++)t.push(i(e[n]));return t}(e).join(", ")}]`}function o(e,t,n,i){if(null!=n.this)return s(i);if(null!=n.computedUserset)return function(e){return e.computedUserset.relation}(n);if(null!=n.tupleToUserset)return function(e){var t,n,r,i;return`${null===(n=null===(t=null==e?void 0:e.tupleToUserset)||void 0===t?void 0:t.computedUserset)||void 0===n?void 0:n.relation} from ${null===(i=null===(r=null==e?void 0:e.tupleToUserset)||void 0===r?void 0:r.tupleset)||void 0===i?void 0:i.relation}`}(n);throw new r.UnsupportedDSLNestingError(e,t)}function a(e,t,n={},r={}){let i=` define ${t}: `;const s=r.directly_related_user_types||[];return null!=n.difference?i+=function(e,t,n,r){return`${o(e,t,n.difference.base,r)} but not ${o(e,t,n.difference.subtract,r)}`}(e,t,n,s):null!=n.union?i+=function(e,t,n,r){var i;const s=[],a=null===(i=null==n?void 0:n.union)||void 0===i?void 0:i.child;for(const l of a||[])s.push(o(e,t,l,r));return s.join(" or ")}(e,t,n,s):null!=n.intersection?i+=function(e,t,n,r){var i;const s=[],a=null===(i=null==n?void 0:n.intersection)||void 0===i?void 0:i.child;for(const l of a||[])s.push(o(e,t,l,r));return s.join(" and ")}(e,t,n,s):i+=o(e,t,n,s),i}const l=(e,t)=>{if(e!=t.name)throw new r.ConditionNameDoesntMatchError(e,t.name);return`condition ${e}(${(e=>{const t=[];return Object.keys(e).sort().forEach((n=>{var r;const i=e[n];let s=i.type_name.replace("TYPE_NAME_","").toLowerCase();"list"!==s&&"map"!==s||(s=`${s}<${null===(r=i.generic_types)||void 0===r?void 0:r[0].type_name.replace("TYPE_NAME_","").toLowerCase()}>`),t.push(`${n}: ${s}`)})),t.join(", ")})(t.parameters||{})}) {${t.expression}}\n`};t.transformJSONToDSL=e=>{var t;const n=(null==e?void 0:e.schema_version)||"1.1",r=null===(t=null==e?void 0:e.type_definitions)||void 0===t?void 0:t.map((e=>(e=>{var t,n;const r=e.type;let i=`\ntype ${r}`;const s=e.relations||{},o=e.metadata;if(null===(t=Object.keys(s))||void 0===t?void 0:t.length){i+="\n relations";for(const e in s)i+=`\n${a(r,e,s[e],null===(n=null==o?void 0:o.relations)||void 0===n?void 0:n[e])}`}return i})(e))),i=(e=>{const t=e.conditions||{};if(!Object.keys(t).length)return"";let n="";return Object.keys(t).sort().forEach((e=>{const r=t[e],i=l(e,r);n+=`\n${i}`})),n})(e);return`model\n schema ${n}\n${r?`${r.join("\n")}\n`:""}${i}`};t.transformJSONStringToDSL=e=>{const n=JSON.parse(e);return(0,t.transformJSONToDSL)(n)}},18616:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exceptionCollector=t.createMaximumOneDirectRelationship=t.createSchemaVersionRequiredError=t.createInvalidSchemaVersionError=void 0;const r=n(80104),i=n(56873);t.createInvalidSchemaVersionError=e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:`invalid schema ${o}`,lines:n,lineIndex:i,metadata:{symbol:o,errorType:r.ValidationError.InvalidSchema}}))};t.createSchemaVersionRequiredError=e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:"schema version required",lines:n,lineIndex:i,metadata:{symbol:o,errorType:r.ValidationError.SchemaVersionRequired}}))};function s(e){const{message:t,lines:n,lineIndex:i,customResolver:s,metadata:o}=e,a=n[i],l=new RegExp("\\b"+o.symbol+"\\b");let c=a.search(l)+1;return"function"==typeof s&&(c=s(c,a,o.symbol)),new r.ModelValidationSingleError({line:{start:i+1,end:i+1},column:{start:c,end:c+o.symbol.length},msg:t},{symbol:null==o?void 0:o.symbol,errorType:o.errorType})}t.createMaximumOneDirectRelationship=e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:"each relationship must have at most 1 set of direct relations defined.",lines:n,lineIndex:i,metadata:{symbol:o,errorType:r.ValidationError.AssignableRelationsMustHaveType},customResolver:(e,t,n)=>t.indexOf(n.substring(1))}))};t.exceptionCollector=(e,n)=>({raiseInvalidName(t,i,o,a){((e,t,n)=>{const{errors:i,lines:o,lineIndex:a,symbol:l}=e,c=(n?`relation '${l}' of type '${n}' `:`type '${l}' `)+`does not match naming rule: '${t}'.`;i.push(s({message:c,lines:o,lineIndex:a,metadata:{symbol:l,errorType:r.ValidationError.InvalidName}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o,a)},raiseReservedTypeName(t,o){(e=>{const{errors:t,lines:n,lineIndex:o,symbol:a}=e;t.push(s({message:`a type cannot be named '${i.Keyword.SELF}' or '${i.ReservedKeywords.THIS}'.`,lines:n,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.ReservedTypeKeywords}}))})({errors:e,lines:n,lineIndex:t,symbol:o})},raiseReservedRelationName(t,o){(e=>{const{errors:t,lines:n,lineIndex:o,symbol:a}=e;t.push(s({message:`a relation cannot be named '${i.Keyword.SELF}' or '${i.ReservedKeywords.THIS}'.`,lines:n,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.ReservedRelationKeywords}}))})({errors:e,lines:n,lineIndex:t,symbol:o})},raiseTupleUsersetRequiresDirect(t,i){(e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:`\`${o}\` relation used inside from allows only direct relation.`,lines:n,lineIndex:i,customResolver:(e,t,n)=>{const r=t.indexOf("from")+4+1;return r+t.slice(r).indexOf(n)+1},metadata:{symbol:o,errorType:r.ValidationError.TuplesetNotDirect}}))})({errors:e,lines:n,lineIndex:t,symbol:i})},raiseDuplicateTypeName(t,i){(e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:`the type \`${o}\` is a duplicate.`,lines:n,lineIndex:i,metadata:{symbol:o,errorType:r.ValidationError.DuplicatedError}}))})({errors:e,lines:n,lineIndex:t,symbol:i})},raiseDuplicateTypeRestriction(t,i,o){((e,t)=>{const{errors:n,lines:i,lineIndex:o,symbol:a}=e;n.push(s({message:`the type restriction \`${a}\` is a duplicate in the relation \`${t}\`.`,lines:i,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.DuplicatedError,relation:a}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o)},raiseDuplicateType(t,i,o){((e,t)=>{const{errors:n,lines:i,lineIndex:o,symbol:a}=e;n.push(s({message:`the partial relation definition \`${a}\` is a duplicate in the relation \`${t}\`.`,lines:i,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.DuplicatedError,relation:a}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o)},raiseDuplicateRelationshipDefinition(t,s){(e=>{const{errors:t,lines:n,lineIndex:s,symbol:o}=e,a=n[s];t.push(new r.ModelValidationSingleError({msg:`duplicate definition \`${o}\`.`,line:{start:s+1,end:s+1},column:{start:a.indexOf(i.Keyword.DEFINE)+1,end:a.length+1}},{symbol:o,errorType:r.ValidationError.DuplicatedError}))})({errors:e,lines:n,lineIndex:t,symbol:s})},raiseNoEntryPoint(t,i,o){((e,t)=>{const{errors:n,lines:i,lineIndex:o,symbol:a}=e;n.push(s({message:`\`${a}\` is an impossible relation for \`${t}\` (no entrypoint).`,lines:i,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.RelationNoEntrypoint,relation:a}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o)},raiseInvalidTypeRelation(t,i,o,a){((e,t,n)=>{const{errors:i,lines:o,lineIndex:a,symbol:l}=e;i.push(s({message:`\`${n}\` is not a valid relation for \`${t}\`.`,lines:o,lineIndex:a,metadata:{symbol:l,errorType:r.ValidationError.InvalidRelationType,relation:n,typeName:t}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o,a)},raiseInvalidType(t,i,o){((e,t)=>{const{errors:n,lines:i,lineIndex:o,symbol:a}=e;n.push(s({message:`\`${t}\` is not a valid type.`,lines:i,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.InvalidType,typeName:t}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o)},raiseAssignableRelationMustHaveTypes(t,i){(e=>{const{errors:t,lines:n,lineIndex:i}=e,o=n[i],a=o.includes("[")?o.slice(o.indexOf("["),o.lastIndexOf("]")+1):"self";t.push(s({message:`assignable relation '${a}' must have types`,lines:n,lineIndex:i,customResolver:(e,t,n)=>t.indexOf(n.substring(1)),metadata:{symbol:a,errorType:r.ValidationError.AssignableRelationsMustHaveType}}))})({errors:e,lines:n,lineIndex:t,symbol:i})},raiseAssignableTypeWildcardRelation(t,i){(e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:`type restriction \`${o}\` cannot contain both wildcard and relation`,lines:n,lineIndex:i,metadata:{symbol:o,errorType:r.ValidationError.TypeRestrictionCannotHaveWildcardAndRelation}}))})({errors:e,lines:n,lineIndex:t,symbol:i})},raiseInvalidRelationError(t,i,o){((e,t)=>{const{errors:n,lines:i,lineIndex:o,symbol:a}=e;!(null==t?void 0:t.includes(a))&&n.push(s({message:`the relation \`${a}\` does not exist.`,lines:i,lineIndex:o,metadata:{symbol:a,errorType:r.ValidationError.MissingDefinition,relation:a}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o)},raiseInvalidSchemaVersion(r,i){(0,t.createInvalidSchemaVersionError)({errors:e,lines:n,lineIndex:r,symbol:i})},raiseSchemaVersionRequired(r,i){(0,t.createSchemaVersionRequiredError)({errors:e,lines:n,lineIndex:r,symbol:i})},raiseMaximumOneDirectRelationship(r,i){(0,t.createMaximumOneDirectRelationship)({errors:e,lines:n,lineIndex:r,symbol:i})},raiseInvalidConditionNameInParameter(t,i,o,a,l){((e,t,n,i)=>{const{errors:o,lines:a,lineIndex:l,symbol:c}=e;o.push(s({message:`\`${i}\` is not a defined condition in the model.`,lines:a,lineIndex:l,customResolver:(e,t,n)=>t.indexOf(n.substring(1)),metadata:{symbol:c,errorType:r.ValidationError.ConditionNotDefined,relation:n,typeName:t}}))})({errors:e,lines:n,lineIndex:t,symbol:i},o,a,l)},raiseUnusedCondition(t,i){(e=>{const{errors:t,lines:n,lineIndex:i,symbol:o}=e;t.push(s({message:`\`${o}\` condition is not used in the model.`,lines:n,lineIndex:i,metadata:{symbol:o,errorType:r.ValidationError.ConditionNotUsed,conditionName:o}}))})({errors:e,lines:n,lineIndex:t,symbol:i})}})},95289:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(98072),t)},56873:(e,t)=>{"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),t.ReservedKeywords=t.Keyword=void 0,function(e){e.SELF="self",e.DEFINE="DEFINE"}(n||(t.Keyword=n={})),function(e){e.THIS="this"}(r||(t.ReservedKeywords=r={}))},98072:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateDSL=t.validateJSON=t.defaultRelationRule=t.defaultTypeRule=void 0;const r=n(56873),i=n(30620),s=n(80104),o=n(18616);var a,l;t.defaultTypeRule="^[^:#@\\s]{1,254}$",t.defaultRelationRule="^[^:#@\\s]{1,50}$",function(e){e.Union="union",e.Intersection="intersection",e.Difference="difference"}(a||(a={})),function(e){e.Direct="direct",e.ComputedUserset="computed_userset",e.TupleToUserset="tuple_to_userset"}(l||(l={}));const c=(e,t,n)=>(n||(n=0),t.slice(n).findIndex((t=>t.trim().startsWith(`condition ${e}`)))+n),u=(e,t,n)=>(n||(n=0),t.slice(n).findIndex((t=>t.trim().startsWith(`type ${e}`)))+n),d=(e,t,n)=>(n||(n=0),t.slice(n).findIndex((t=>t.trim().replace(/ {2,}/g," ").startsWith(`define ${e}`)))+n),h=(e,t)=>t.findIndex((t=>t.trim().replace(/ {2,}/g," ").startsWith(`schema ${e}`))),p=e=>{let t=e.type;return e.wildcard?t+=":*":e.relation&&(t+=`#${e.relation}`),e.condition&&(t+=` with ${e.condition}`),t},f=e=>e.map((e=>p(e))),g=e=>{var t,n,r,i;let s,o;e.computedUserset?s=e.computedUserset.relation||void 0:(s=(null===(n=null===(t=e.tupleToUserset)||void 0===t?void 0:t.computedUserset)||void 0===n?void 0:n.relation)||void 0,o=(null===(i=null===(r=e.tupleToUserset)||void 0===r?void 0:r.tupleset)||void 0===i?void 0:i.relation)||void 0);let a=l.Direct;return s&&(a=l.ComputedUserset),o&&(a=l.TupleToUserset),{target:s,from:o,rewrite:a}},m=e=>{const[t,n]=e.split(" with "),r=t.includes(":*"),i=t.replace(":*","").split("#");return{decodedType:i[0],decodedRelation:i[1],isWildcard:r,decodedConditionName:n}},y=e=>!Object.prototype.hasOwnProperty.call(e,a.Union)&&!Object.prototype.hasOwnProperty.call(e,a.Intersection)&&!Object.prototype.hasOwnProperty.call(e,a.Difference),b=e=>{var t;let n=null===(t=e.computedUserset)||void 0===t?void 0:t.relation;const r=g(e);return r.rewrite===l.ComputedUserset?n=r.target:r.rewrite===l.TupleToUserset&&(n=`${r.target} from ${r.from}`),n};function v(e,t,n,r,i){var s;if(!r)return!1;if(r.rewrite===l.Direct)for(const o of i){const{decodedType:n,decodedRelation:r}=m(o);if(!r)return!0;if(E(e,t,n,r))return!0}if(r.from){const i=f((null===(s=e[n].metadata)||void 0===s?void 0:s.relations[r.from].directly_related_user_types)||[]);for(const n of i){const{decodedType:i}=m(n);if(E(e,t,i,r.target))return!0}}else if(E(e,t,n,r.target))return!0;return!1}function E(e,t,n,r){var i,s,o;if(!r)return!1;if(t[n]&&t[n][r])return!1;t[n]||(t[n]={}),t[n][r]=!0;const l=e[n].relations;if(!l||!l[r])return!1;const c=null===(i=e[n].metadata)||void 0===i?void 0:i.relations,u=f(c[r].directly_related_user_types||[]);if(Object.prototype.hasOwnProperty.call(l[r],a.Union)){for(const i of(null===(s=l[r].union)||void 0===s?void 0:s.child)||[])if(v(e,JSON.parse(JSON.stringify(t)),n,g(i),u))return!0;return!1}if(Object.prototype.hasOwnProperty.call(l[r],a.Intersection)){for(const i of(null===(o=l[r].intersection)||void 0===o?void 0:o.child)||[])if(!v(e,JSON.parse(JSON.stringify(t)),n,g(i),u))return!1;return!0}if(Object.prototype.hasOwnProperty.call(l[r],a.Difference))return!(!v(e,JSON.parse(JSON.stringify(t)),n,g(l[r].difference.base),u)||!v(e,JSON.parse(JSON.stringify(t)),n,g(l[r].difference.subtract),u));{const i=g(l[r]);return!!v(e,JSON.parse(JSON.stringify(t)),n,i,u)}}function _(e,t,n,r){var i;const s=new Set;null===(i=n.directly_related_user_types)||void 0===i||i.forEach((n=>{const i=p(n);if(s.has(i)){const s=u(n.type,e),o=d(r,e,s);t.raiseDuplicateTypeRestriction(o,i,r)}s.add(i)}))}function T(e,t,n,r){var i,s,o,l;const c=n.relations[r],h=new Set;null===(s=null===(i=c.union)||void 0===i?void 0:i.child)||void 0===s||s.forEach((i=>{const s=b(i);if(s&&h.has(s)){const i=u(n.type,e),o=d(r,e,i);t.raiseDuplicateType(o,s,r)}h.add(s)}));const p=new Set;if(null===(l=null===(o=c.intersection)||void 0===o?void 0:o.child)||void 0===l||l.forEach((i=>{const s=b(i);if(s&&p.has(s)){const i=u(n.type,e),o=d(r,e,i);t.raiseDuplicateType(o,s,r)}p.add(s)})),Object.prototype.hasOwnProperty.call(c,a.Difference)){const i=b(c.difference.base),s=b(c.difference.subtract);if(i&&i===s){const s=u(n.type,e),o=d(r,e,s);t.raiseDuplicateType(o,i,r)}}}function x(e,t,n,r,i,s,o={}){var a;const c=n[r].relations;if(!c||!c[i])return;const h=null===(a=n[r].metadata)||void 0===a?void 0:a.relations[i];switch(s.rewrite){case l.Direct:{const s=f((null==h?void 0:h.directly_related_user_types)||[]);if(!s.length){const n=u(r,e),s=d(i,e,n);t.raiseAssignableRelationMustHaveTypes(s,i)}for(const a of s){const{decodedType:s,decodedRelation:l,isWildcard:c,decodedConditionName:h}=m(a);if(!n[s]){const n=u(r,e),o=d(i,e,n);t.raiseInvalidType(o,`${s}`,s)}if(h&&!o[h]){const n=u(r,e),s=d(i,e,n);t.raiseInvalidConditionNameInParameter(s,`${h}`,r,i,h)}if(c&&l){const n=u(r,e),s=d(i,e,n);t.raiseAssignableTypeWildcardRelation(s,a)}else if(l&&(!n[s]||!n[s].relations[l])){const n=u(r,e),o=d(i,e,n);t.raiseInvalidTypeRelation(o,`${s}#${l}`,s,l)}}break}case l.ComputedUserset:if(s.target&&!c[s.target]){const n=u(r,e),o=d(i,e,n),a=s.target;t.raiseInvalidRelationError(o,a,Object.keys(c))}break;case l.TupleToUserset:if(s.from&&s.target)if(c[s.from]){const[o,a]=function(e,t,n){var r;const i=[],s=e[t].relations[n],o=f((null===(r=e[t].metadata)||void 0===r?void 0:r.relations[n].directly_related_user_types)||[]),a=y(s);a&&g(s).rewrite===l.Direct&&i.push(...o);return[i,a]}(n,r,s.from);if(a){const a=[];for(const l of o){const{decodedType:o,decodedRelation:c,isWildcard:h}=m(l);if(h){const n=u(r,e),s=d(i,e,n);t.raiseAssignableTypeWildcardRelation(s,l)}else if(c){const n=u(r,e),o=d(i,e,n);t.raiseTupleUsersetRequiresDirect(o,s.from)}else if(!n[o]||!n[o].relations[s.target]){const t=u(r,e),n=d(i,e,t);a.push({lineIndex:n,symbol:`${s.target} from ${s.from}`,typeName:o,relationName:s.target})}}if(a.length===o.length)for(const e of a){const{lineIndex:n,symbol:r,typeName:i,relationName:s}=e;t.raiseInvalidTypeRelation(n,r,i,s)}}else{const n=u(r,e),o=d(i,e,n);t.raiseTupleUsersetRequiresDirect(o,s.from)}}else{const n=u(r,e),o=d(i,e,n);t.raiseInvalidTypeRelation(o,`${s.target} from ${s.from}`,r,s.from)}}}function w(e,t,n,r,i,s){var o,l,c,u;const d=n[r].relations;if(!d||!d[i])return;const h=d[i];if(Object.prototype.hasOwnProperty.call(h,a.Union))for(const a of(null===(o=h.union)||void 0===o?void 0:o.child)||[])x(e,t,n,r,i,g(a),s);else if(Object.prototype.hasOwnProperty.call(h,a.Intersection))for(const a of(null===(l=h.intersection)||void 0===l?void 0:l.child)||[])x(e,t,n,r,i,g(a),s);else Object.prototype.hasOwnProperty.call(h,a.Difference)?((null===(c=h.difference)||void 0===c?void 0:c.base)&&x(e,t,n,r,i,g(h.difference.base),s),(null===(u=h.difference)||void 0===u?void 0:u.subtract)&&x(e,t,n,r,i,g(h.difference.subtract),s)):x(e,t,n,r,i,g(h),s)}function S(e,n,i={}){const a=e.split("\n"),l=[],p=(0,o.exceptionCollector)(l,a),f=i.typeValidation||t.defaultTypeRule,g=i.relationValidation||t.defaultRelationRule,m=new RegExp("[a-zA-Z]*");let y={regex:m,rule:f};try{y={regex:new RegExp(f),rule:f}}catch(x){throw new s.ConfigurationError(`Incorrect type regex specification for ${f}`,x)}let b={regex:m,rule:g};try{b={regex:new RegExp(g),rule:g}}catch(x){throw new s.ConfigurationError(`Incorrect relation regex specification for ${g}`,x)}!function(e,t,n,i,s){var o;null===(o=n.type_definitions)||void 0===o||o.forEach((n=>{const o=n.type;if(o===r.Keyword.SELF||o===r.ReservedKeywords.THIS){const n=u(o,e);t.raiseReservedTypeName(n,o)}if(!i.regex.test(o)){const n=u(o,e);t.raiseInvalidName(n,o,i.rule)}const a={[r.Keyword.SELF]:!0};for(const i in n.relations){const n=i;if(n===r.Keyword.SELF||n===r.ReservedKeywords.THIS){const r=u(o,e),i=d(n,e,r);t.raiseReservedRelationName(i,n)}else if(s.regex.test(n)){if(a[n]){const r=u(o,e),i=d(n,e,r),s=d(n,e,i+1);t.raiseDuplicateDefinition(s,n)}}else{const r=u(o,e),i=d(n,e,r);t.raiseInvalidName(i,n,s.rule,o)}a[n]=!0}}))}(a,p,n,y,b);const v=n.schema_version;switch(v||p.raiseSchemaVersionRequired(0,""),v){case"1.1":!function(e,t,n,r){var i,s,o,a;if(n.length)return;const l={},h=new Set;if(null===(i=r.type_definitions)||void 0===i||i.forEach((e=>{var t,n;const r=e.type;l[r]=e;for(const i in null===(t=e.metadata)||void 0===t?void 0:t.relations)((null===(n=e.metadata)||void 0===n?void 0:n.relations[i].directly_related_user_types)||[]).forEach((e=>{e.condition&&h.add(e.condition)}))})),null===(s=r.type_definitions)||void 0===s||s.forEach((n=>{const i=n.type;for(const s in n.relations)w(e,t,l,i,s,r.conditions)})),0===n.length){const n=new Set;null===(o=r.type_definitions)||void 0===o||o.forEach((r=>{var i,s;const o=r.type;if(n.has(o)){const n=u(o,e);t.raiseDuplicateTypeName(n,o)}n.add(r.type);for(const n in null===(i=r.metadata)||void 0===i?void 0:i.relations)_(e,t,null===(s=r.metadata)||void 0===s?void 0:s.relations[n],n),T(e,t,r,n)}))}0===n.length&&(null===(a=r.type_definitions)||void 0===a||a.forEach((n=>{const r=n.type;for(const i in n.relations)if(!E(l,{},r,i)){const n=u(r,e),s=d(i,e,n);t.raiseNoEntryPoint(s,i,r)}})));for(const u in r.conditions)if(r.conditions[u],!h.has(u)){const n=c(u,e);t.raiseUnusedCondition(n,u)}}(a,p,l,n);break;default:{const e=h(v,a);p.raiseInvalidSchemaVersion(e,v);break}}if(l.length)throw new s.ModelValidationError(l)}t.validateJSON=S,t.validateDSL=function(e,t={}){const{listener:n,errorListener:r}=(0,i.parseDSL)(e);if(r.errors.length)throw new s.DSLSyntaxError(r.errors);S(e,n.authorizationModel,t)}},723:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(67294),i=n(87462),s=n(68356),o=n.n(s),a=n(16887);const l={"01a85c17":[()=>Promise.all([n.e(532),n.e(4013)]).then(n.bind(n,91223)),"@theme/BlogTagsListPage",91223],"028b1cc5":[()=>Promise.all([n.e(532),n.e(8592),n.e(5289)]).then(n.bind(n,20936)),"@site/docs/content/interacting/read-tuple-changes.mdx",20936],"03f1273c":[()=>Promise.all([n.e(8592),n.e(9323)]).then(n.bind(n,55246)),"@site/blog/kubecon-na-2023.md?truncated=true",55246],"0938166f":[()=>Promise.all([n.e(532),n.e(8592),n.e(5721)]).then(n.bind(n,10711)),"@site/docs/content/modeling/migrating/overview.mdx",10711],"0be4346b":[()=>n.e(5222).then(n.t.bind(n,77512,19)),"~blog/default/blog-tags-openfga-87e-list.json",77512],"116d061d":[()=>Promise.all([n.e(532),n.e(8592),n.e(1176)]).then(n.bind(n,45667)),"@site/docs/content/getting-started/setup-openfga/overview.mdx",45667],15369573:[()=>Promise.all([n.e(532),n.e(8592),n.e(2052)]).then(n.bind(n,47756)),"@site/docs/content/modeling/building-blocks/object-to-object-relationships.mdx",47756],17896441:[()=>Promise.all([n.e(532),n.e(8592),n.e(7918)]).then(n.bind(n,78945)),"@theme/DocItem",78945],"18eda3ee":[()=>Promise.all([n.e(532),n.e(8592),n.e(3666)]).then(n.bind(n,1564)),"@site/docs/content/getting-started/framework.mdx",1564],"1a4e3797":[()=>Promise.all([n.e(532),n.e(7920)]).then(n.bind(n,51473)),"@theme/SearchPage",51473],"1bbc0b1c":[()=>Promise.all([n.e(532),n.e(8592),n.e(6418)]).then(n.bind(n,87004)),"@site/docs/content/getting-started/setup-openfga/kubernetes-setup.mdx",87004],"1be78505":[()=>Promise.all([n.e(532),n.e(8505),n.e(9514)]).then(n.bind(n,19963)),"@theme/DocPage",19963],"1df93b7f":[()=>Promise.all([n.e(532),n.e(8592),n.e(203),n.e(3237)]).then(n.bind(n,27116)),"@site/src/pages/index.tsx",27116],"24bd3649":[()=>n.e(6136).then(n.t.bind(n,57569,19)),"~blog/default/blog-tags-conferences-51c.json",57569],"2ca0b854":[()=>n.e(5735).then(n.t.bind(n,49314,19)),"~blog/default/blog-tags-features-685-list.json",49314],"30325ba4":[()=>Promise.all([n.e(532),n.e(8592),n.e(4374)]).then(n.bind(n,55874)),"@site/docs/content/modeling/direct-access.mdx",55874],"33b74eba":[()=>Promise.all([n.e(532),n.e(8592),n.e(1429)]).then(n.bind(n,91117)),"@site/docs/content/configuration-language.mdx",91117],"34a3e208":[()=>Promise.all([n.e(532),n.e(8592),n.e(5863)]).then(n.bind(n,79446)),"@site/docs/content/getting-started/update-tuples.mdx",79446],"34c50772":[()=>n.e(356).then(n.t.bind(n,60966,19)),"~blog/default/blog-tags-kubecon-bd1.json",60966],"3652cf2a":[()=>Promise.all([n.e(532),n.e(8592),n.e(4752)]).then(n.bind(n,2422)),"@site/docs/content/modeling/building-blocks/concentric-relationships.mdx",2422],"3759cf4b":[()=>Promise.all([n.e(532),n.e(8592),n.e(2991)]).then(n.bind(n,380)),"@site/docs/content/getting-started/immutable-models.mdx",380],"3827dd5a":[()=>n.e(2744).then(n.t.bind(n,12776,19)),"/home/runner/work/openfga.dev/openfga.dev/.docusaurus/@easyops-cn/docusaurus-search-local/default/plugin-route-context-module-100.json",12776],"3a191a7b":[()=>Promise.all([n.e(532),n.e(8592),n.e(6075)]).then(n.bind(n,50086)),"@site/docs/content/getting-started/setup-sdk-client.mdx",50086],"3aada504":[()=>Promise.all([n.e(532),n.e(8592),n.e(8705)]).then(n.bind(n,12963)),"@site/docs/content/interacting/managing-user-access.mdx",12963],"3d83e150":[()=>Promise.all([n.e(532),n.e(8592),n.e(3207)]).then(n.bind(n,30663)),"@site/docs/content/interacting/managing-relationships-between-objects.mdx",30663],"4204f988":[()=>Promise.all([n.e(532),n.e(8592),n.e(1794)]).then(n.bind(n,60855)),"@site/docs/content/modeling/building-blocks/direct-relationships.mdx",60855],"4337ba13":[()=>Promise.all([n.e(532),n.e(8592),n.e(7647)]).then(n.bind(n,34839)),"@site/docs/content/interacting/managing-group-access.mdx",34839],"439d46c1":[()=>Promise.all([n.e(532),n.e(8592),n.e(7459)]).then(n.bind(n,80348)),"@site/docs/content/modeling/user-groups.mdx",80348],"4427aa46":[()=>Promise.all([n.e(532),n.e(8592),n.e(6901)]).then(n.bind(n,30051)),"@site/docs/content/modeling/advanced/github.mdx",30051],"487f279c":[()=>Promise.all([n.e(532),n.e(8592),n.e(2623)]).then(n.bind(n,67361)),"@site/docs/content/getting-started/tuples-api-best-practices.mdx",67361],"4920f1c1":[()=>Promise.all([n.e(532),n.e(8592),n.e(9904)]).then(n.bind(n,59580)),"@site/docs/content/modeling/multiple-restrictions.mdx",59580],"4a075682":[()=>Promise.all([n.e(532),n.e(8592),n.e(8883)]).then(n.bind(n,14871)),"@site/docs/content/modeling/overview.mdx",14871],"4c2069ba":[()=>Promise.all([n.e(532),n.e(8592),n.e(5019)]).then(n.bind(n,14697)),"@site/docs/content/getting-started/production-best-practices.mdx",14697],"5ccffc9c":[()=>Promise.all([n.e(532),n.e(8592),n.e(2354)]).then(n.bind(n,5832)),"@site/docs/content/modeling/building-blocks/overview.mdx",5832],"5dfc8d6a":[()=>Promise.all([n.e(8592),n.e(1544)]).then(n.bind(n,34488)),"@site/blog/kubecon-na-2023.md",34488],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,36809)),"@generated/docusaurus.config",36809],"63b646c1":[()=>Promise.all([n.e(532),n.e(8592),n.e(2452)]).then(n.bind(n,32505)),"@site/docs/content/modeling/advanced/overview.mdx",32505],"6786195a":[()=>Promise.all([n.e(532),n.e(8592),n.e(3077)]).then(n.bind(n,19637)),"@site/docs/content/modeling/getting-started.mdx",19637],"6875c492":[()=>Promise.all([n.e(532),n.e(8592),n.e(2529),n.e(8610)]).then(n.bind(n,41714)),"@theme/BlogTagsPostsPage",41714],"69ced8de":[()=>Promise.all([n.e(532),n.e(8592),n.e(5777)]).then(n.bind(n,47996)),"@site/docs/content/modeling/migrating/migrating-schema-1-1.mdx",47996],"69d8fa2b":[()=>n.e(9909).then(n.t.bind(n,94159,19)),"~blog/default/blog-tags-features-685.json",94159],"6a4b619d":[()=>Promise.all([n.e(532),n.e(8592),n.e(7852)]).then(n.bind(n,6340)),"@site/docs/content/modeling/parent-child.mdx",6340],"7284575f":[()=>Promise.all([n.e(532),n.e(8592),n.e(6743)]).then(n.bind(n,31492)),"@site/docs/content/modeling/custom-roles.mdx",31492],"73db2c80":[()=>Promise.all([n.e(532),n.e(8592),n.e(9302)]).then(n.bind(n,31527)),"@site/docs/content/interacting/relationship-queries.mdx",31527],"76c18be1":[()=>Promise.all([n.e(532),n.e(8592),n.e(6055)]).then(n.bind(n,12278)),"@site/docs/content/interacting/search-with-permissions.mdx",12278],"7742897f":[()=>Promise.all([n.e(532),n.e(8592),n.e(9062)]).then(n.bind(n,83166)),"@site/docs/content/getting-started/configure-model.mdx",83166],"78431c72":[()=>Promise.all([n.e(532),n.e(8592),n.e(4706)]).then(n.bind(n,37995)),"@site/docs/content/modeling/advanced/iot.mdx",37995],"78aaed86":[()=>Promise.all([n.e(532),n.e(8592),n.e(569)]).then(n.bind(n,58721)),"@site/docs/content/modeling/public-access.mdx",58721],"7bbc0b76":[()=>n.e(6403).then(n.t.bind(n,15745,19)),"/home/runner/work/openfga.dev/openfga.dev/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",15745],"814f3328":[()=>n.e(2535).then(n.t.bind(n,45641,19)),"~blog/default/blog-post-list-prop-default.json",45641],"87a4c587":[()=>Promise.all([n.e(532),n.e(8592),n.e(4886)]).then(n.bind(n,87872)),"@site/docs/content/modeling/blocklists.mdx",87872],"87c4c920":[()=>Promise.all([n.e(532),n.e(8592),n.e(265)]).then(n.bind(n,51376)),"@site/docs/content/getting-started/install-sdk.mdx",51376],"882ec15a":[()=>Promise.all([n.e(532),n.e(8592),n.e(8128)]).then(n.bind(n,79460)),"@site/docs/content/authorization-and-openfga.mdx",79460],"89e713ce":[()=>n.e(7604).then(n.t.bind(n,56255,19)),"~blog/default/blog-tags-conferences-51c-list.json",56255],"935f2afb":[()=>n.e(53).then(n.t.bind(n,1109,19)),"~docs/default/version-current-metadata-prop-751.json",1109],"9578a8cf":[()=>Promise.all([n.e(532),n.e(8592),n.e(7464)]).then(n.bind(n,42401)),"@site/docs/content/modeling/organization-context-authorization.mdx",42401],"97140aee":[()=>Promise.all([n.e(532),n.e(8592),n.e(521)]).then(n.bind(n,1840)),"@site/docs/content/modeling/advanced/entitlements.mdx",1840],"9c4cd4c4":[()=>Promise.all([n.e(532),n.e(8592),n.e(1105)]).then(n.bind(n,17984)),"@site/docs/content/interacting/overview.mdx",17984],"9e4087bc":[()=>n.e(3608).then(n.bind(n,63169)),"@theme/BlogArchivePage",63169],a09a1188:[()=>Promise.all([n.e(532),n.e(8592),n.e(1217)]).then(n.bind(n,44179)),"@site/docs/content/modeling/building-blocks/usersets.mdx",44179],a2ab5d86:[()=>Promise.all([n.e(8592),n.e(6248)]).then(n.bind(n,25120)),"@site/blog/conditional-tuples-announcement.md",25120],a36c58ef:[()=>n.e(8018).then(n.t.bind(n,83769,19)),"/home/runner/work/openfga.dev/openfga.dev/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",83769],a6aa9e1f:[()=>Promise.all([n.e(532),n.e(8592),n.e(2529),n.e(3089)]).then(n.bind(n,80046)),"@theme/BlogListPage",80046],a7023ddc:[()=>n.e(1713).then(n.t.bind(n,53457,19)),"~blog/default/blog-tags-tags-4c2.json",53457],acf022e4:[()=>Promise.all([n.e(532),n.e(8592),n.e(217),n.e(2450)]).then(n.bind(n,34841)),"@site/src/pages/api/service.tsx",34841],b2b675dd:[()=>n.e(533).then(n.t.bind(n,28017,19)),"~blog/default/blog-c06.json",28017],b2f554cd:[()=>n.e(1477).then(n.t.bind(n,30010,19)),"~blog/default/blog-archive-80c.json",30010],b2fd7883:[()=>Promise.all([n.e(532),n.e(8592),n.e(8371)]).then(n.bind(n,22436)),"@site/docs/content/modeling/advanced/gdrive.mdx",22436],b3e13dba:[()=>n.e(6840).then(n.t.bind(n,3250,19)),"~blog/default/blog-tags-openfga-87e.json",3250],b89f0a14:[()=>Promise.all([n.e(532),n.e(8592),n.e(8425)]).then(n.bind(n,32185)),"@site/docs/content/interacting/managing-group-membership.mdx",32185],bb879dcd:[()=>Promise.all([n.e(532),n.e(8592),n.e(2386)]).then(n.bind(n,24233)),"@site/docs/content/modeling/migrating/migrating-relations.mdx",24233],bd85ffac:[()=>Promise.all([n.e(532),n.e(8592),n.e(6359)]).then(n.bind(n,42376)),"@site/docs/content/concepts.mdx",42376],c0e854c3:[()=>Promise.all([n.e(532),n.e(8592),n.e(5263)]).then(n.bind(n,43302)),"@site/docs/content/getting-started/perform-list-objects.mdx",43302],caf99389:[()=>Promise.all([n.e(8592),n.e(8256)]).then(n.bind(n,81665)),"@site/blog/conditional-tuples-announcement.md?truncated=true",81665],cb8ccc1a:[()=>Promise.all([n.e(532),n.e(8592),n.e(3151)]).then(n.bind(n,57108)),"@site/docs/content/getting-started/perform-check.mdx",57108],ccc49370:[()=>Promise.all([n.e(532),n.e(8592),n.e(2529),n.e(6103)]).then(n.bind(n,65203)),"@theme/BlogPostPage",65203],d3d4dca1:[()=>Promise.all([n.e(532),n.e(8592),n.e(5362)]).then(n.bind(n,99052)),"@site/docs/content/modeling/roles-and-permissions.mdx",99052],da16da38:[()=>Promise.all([n.e(532),n.e(8592),n.e(3325)]).then(n.bind(n,89535)),"@site/docs/content/getting-started/overview.mdx",89535],db2cdc18:[()=>Promise.all([n.e(532),n.e(8592),n.e(8242)]).then(n.bind(n,53346)),"@site/docs/content/getting-started/create-store.mdx",53346],e23d3c5f:[()=>Promise.all([n.e(532),n.e(8592),n.e(3416)]).then(n.bind(n,92452)),"@site/docs/content/getting-started/setup-openfga/docker-setup.mdx",92452],e260e0bb:[()=>Promise.all([n.e(532),n.e(8592),n.e(7226)]).then(n.bind(n,87029)),"@site/docs/content/modeling/contextual-time-based-authorization.mdx",87029],e4a0c232:[()=>n.e(4461).then(n.t.bind(n,24469,19)),"/home/runner/work/openfga.dev/openfga.dev/.docusaurus/docusaurus-plugin-content-blog/default/plugin-route-context-module-100.json",24469],ed2f6563:[()=>Promise.all([n.e(532),n.e(8592),n.e(7287)]).then(n.bind(n,83396)),"@site/docs/content/interacting/transactional-writes.mdx",83396],f5ba7293:[()=>Promise.all([n.e(532),n.e(8592),n.e(4464)]).then(n.bind(n,22313)),"@site/docs/content/modeling/advanced/slack.mdx",22313],f849ae1d:[()=>n.e(2547).then(n.t.bind(n,80387,19)),"~blog/default/blog-tags-kubecon-bd1-list.json",80387]};function c(e){let{error:t,retry:n,pastDelay:i}=e;return t?r.createElement("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"}},r.createElement("p",null,String(t)),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},"Retry"))):i?r.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"}},r.createElement("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb"},r.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2"},r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"8"},r.createElement("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"}))))):null}var u=n(99670),d=n(30226);function h(e,t){if("*"===e)return o()({loading:c,loader:()=>Promise.all([n.e(532),n.e(3604)]).then(n.bind(n,3604)),modules:["@theme/NotFound"],webpack:()=>[3604],render(e,t){const n=e.default;return r.createElement(d.z,{value:{plugin:{name:"native",id:"default"}}},r.createElement(n,t))}});const s=a[`${e}-${t}`],h={},p=[],f=[],g=(0,u.Z)(s);return Object.entries(g).forEach((e=>{let[t,n]=e;const r=l[n];r&&(h[t]=r[0],p.push(r[1]),f.push(r[2]))})),o().Map({loading:c,loader:h,modules:p,webpack:()=>f,render(t,n){const o=JSON.parse(JSON.stringify(s));Object.entries(t).forEach((t=>{let[n,r]=t;const i=r.default;if(!i)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof i&&"function"!=typeof i||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{i[e]=r[e]}));let s=o;const a=n.split(".");a.slice(0,-1).forEach((e=>{s=s[e]})),s[a[a.length-1]]=i}));const a=o.__comp;delete o.__comp;const l=o.__context;return delete o.__context,r.createElement(d.z,{value:l},r.createElement(a,(0,i.Z)({},o,n)))}})}const p=[{path:"/api/service",component:h("/api/service","814"),exact:!0},{path:"/blog",component:h("/blog","c0d"),exact:!0},{path:"/blog/archive",component:h("/blog/archive","404"),exact:!0},{path:"/blog/conditional-tuples-announcement",component:h("/blog/conditional-tuples-announcement","2f7"),exact:!0},{path:"/blog/kubecon-na-2023",component:h("/blog/kubecon-na-2023","a5a"),exact:!0},{path:"/blog/tags",component:h("/blog/tags","75b"),exact:!0},{path:"/blog/tags/conferences",component:h("/blog/tags/conferences","ad4"),exact:!0},{path:"/blog/tags/features",component:h("/blog/tags/features","e37"),exact:!0},{path:"/blog/tags/kubecon",component:h("/blog/tags/kubecon","243"),exact:!0},{path:"/blog/tags/openfga",component:h("/blog/tags/openfga","482"),exact:!0},{path:"/search",component:h("/search","893"),exact:!0},{path:"/docs",component:h("/docs","f29"),routes:[{path:"/docs/authorization-and-openfga",component:h("/docs/authorization-and-openfga","b75"),exact:!0,sidebar:"docs"},{path:"/docs/concepts",component:h("/docs/concepts","c63"),exact:!0,sidebar:"docs"},{path:"/docs/configuration-language",component:h("/docs/configuration-language","284"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started",component:h("/docs/getting-started","45c"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/configure-model",component:h("/docs/getting-started/configure-model","3d5"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/create-store",component:h("/docs/getting-started/create-store","d80"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/framework",component:h("/docs/getting-started/framework","11b"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/immutable-models",component:h("/docs/getting-started/immutable-models","9a4"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/install-sdk",component:h("/docs/getting-started/install-sdk","54c"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/perform-check",component:h("/docs/getting-started/perform-check","64c"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/perform-list-objects",component:h("/docs/getting-started/perform-list-objects","c00"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/running-in-production",component:h("/docs/getting-started/running-in-production","3df"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/setup-openfga/docker",component:h("/docs/getting-started/setup-openfga/docker","41b"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/setup-openfga/kubernetes",component:h("/docs/getting-started/setup-openfga/kubernetes","577"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/setup-openfga/overview",component:h("/docs/getting-started/setup-openfga/overview","dc6"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/setup-sdk-client",component:h("/docs/getting-started/setup-sdk-client","084"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/tuples-api-best-practices",component:h("/docs/getting-started/tuples-api-best-practices","118"),exact:!0,sidebar:"docs"},{path:"/docs/getting-started/update-tuples",component:h("/docs/getting-started/update-tuples","98a"),exact:!0,sidebar:"docs"},{path:"/docs/interacting",component:h("/docs/interacting","073"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/managing-group-access",component:h("/docs/interacting/managing-group-access","e78"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/managing-group-membership",component:h("/docs/interacting/managing-group-membership","970"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/managing-relationships-between-objects",component:h("/docs/interacting/managing-relationships-between-objects","36d"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/managing-user-access",component:h("/docs/interacting/managing-user-access","fa6"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/read-tuple-changes",component:h("/docs/interacting/read-tuple-changes","07b"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/relationship-queries",component:h("/docs/interacting/relationship-queries","e5d"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/search-with-permissions",component:h("/docs/interacting/search-with-permissions","86b"),exact:!0,sidebar:"docs"},{path:"/docs/interacting/transactional-writes",component:h("/docs/interacting/transactional-writes","073"),exact:!0,sidebar:"docs"},{path:"/docs/modeling",component:h("/docs/modeling","d15"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/advanced",component:h("/docs/modeling/advanced","3c0"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/advanced/entitlements",component:h("/docs/modeling/advanced/entitlements","260"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/advanced/gdrive",component:h("/docs/modeling/advanced/gdrive","c55"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/advanced/github",component:h("/docs/modeling/advanced/github","0ad"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/advanced/iot",component:h("/docs/modeling/advanced/iot","e2c"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/advanced/slack",component:h("/docs/modeling/advanced/slack","34d"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/blocklists",component:h("/docs/modeling/blocklists","e4f"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/building-blocks",component:h("/docs/modeling/building-blocks","8ce"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/building-blocks/concentric-relationships",component:h("/docs/modeling/building-blocks/concentric-relationships","1b8"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/building-blocks/direct-relationships",component:h("/docs/modeling/building-blocks/direct-relationships","d44"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/building-blocks/object-to-object-relationships",component:h("/docs/modeling/building-blocks/object-to-object-relationships","eaa"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/building-blocks/usersets",component:h("/docs/modeling/building-blocks/usersets","905"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/contextual-time-based-authorization",component:h("/docs/modeling/contextual-time-based-authorization","9fb"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/custom-roles",component:h("/docs/modeling/custom-roles","860"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/direct-access",component:h("/docs/modeling/direct-access","00b"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/getting-started",component:h("/docs/modeling/getting-started","9ce"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/migrating",component:h("/docs/modeling/migrating","780"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/migrating/migrating-relations",component:h("/docs/modeling/migrating/migrating-relations","d6a"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/migrating/migrating-schema-1-1",component:h("/docs/modeling/migrating/migrating-schema-1-1","709"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/multiple-restrictions",component:h("/docs/modeling/multiple-restrictions","74b"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/organization-context-authorization",component:h("/docs/modeling/organization-context-authorization","597"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/parent-child",component:h("/docs/modeling/parent-child","34a"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/public-access",component:h("/docs/modeling/public-access","e9a"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/roles-and-permissions",component:h("/docs/modeling/roles-and-permissions","fef"),exact:!0,sidebar:"docs"},{path:"/docs/modeling/user-groups",component:h("/docs/modeling/user-groups","2d1"),exact:!0,sidebar:"docs"}]},{path:"/",component:h("/","a17"),exact:!0},{path:"*",component:h("*")}]},98934:(e,t,n)=>{"use strict";n.d(t,{_:()=>i,t:()=>s});var r=n(67294);const i=r.createContext(!1);function s(e){let{children:t}=e;const[n,s]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{s(!0)}),[]),r.createElement(i.Provider,{value:n},t)}},22679:(e,t,n)=>{"use strict";var r=n(67294),i=n(73935),s=n(73727),o=n(70405),a=n(10412);const l=[n(32497),n(78221),n(18320),n(43576),n(52295)];var c=n(723),u=n(16550),d=n(18790),h=n(35742),p=n(52263);function f(e){let{children:t}=e;const{siteConfig:n}=(0,p.Z)(),{contentSecurityPolicy:i}=n.customFields;return r.createElement("div",{className:"CustomizedRoot"},r.createElement(h.Z,null,r.createElement("meta",{httpEquiv:"Content-Security-Policy",content:i})),t)}var g=n(87462),m=n(44996),y=n(86668),b=n(1944),v=n(94711),E=n(19727),_=n(43320),T=n(18780),x=n(90197);function w(){const{i18n:{defaultLocale:e,localeConfigs:t}}=(0,p.Z)(),n=(0,v.l)();return r.createElement(h.Z,null,Object.entries(t).map((e=>{let[t,{htmlLang:i}]=e;return r.createElement("link",{key:t,rel:"alternate",href:n.createUrl({locale:t,fullyQualified:!0}),hrefLang:i})})),r.createElement("link",{rel:"alternate",href:n.createUrl({locale:e,fullyQualified:!0}),hrefLang:"x-default"}))}function S(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,p.Z)(),i=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,p.Z)(),{pathname:r}=(0,u.TH)();return e+(0,T.applyTrailingSlash)((0,m.Z)(r),{trailingSlash:n,baseUrl:t})}(),s=t?`${n}${t}`:i;return r.createElement(h.Z,null,r.createElement("meta",{property:"og:url",content:s}),r.createElement("link",{rel:"canonical",href:s}))}function R(){const{i18n:{currentLocale:e}}=(0,p.Z)(),{metadata:t,image:n}=(0,y.L)();return r.createElement(r.Fragment,null,r.createElement(h.Z,null,r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("body",{className:E.h})),n&&r.createElement(b.d,{image:n}),r.createElement(S,null),r.createElement(w,null),r.createElement(x.Z,{tag:_.HX,locale:e}),r.createElement(h.Z,null,t.map(((e,t)=>r.createElement("meta",(0,g.Z)({key:t},e))))))}const k=new Map;function C(e){if(k.has(e.pathname))return{...e,pathname:k.get(e.pathname)};if((0,d.f)(c.Z,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return k.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return k.set(e.pathname,t),{...e,pathname:t}}var O=n(98934),A=n(58940);function N(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=l.map((t=>{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>i.forEach((e=>e?.()))}const I=function(e){let{children:t,location:n,previousLocation:i}=e;return(0,r.useLayoutEffect)((()=>{i!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,i=t.hash===n.hash,s=t.search===n.search;if(r&&i&&!s)return;const{hash:o}=t;if(o){const e=decodeURIComponent(o.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:i}),N("onRouteDidUpdate",{previousLocation:i,location:n}))}),[i,n]),t};function L(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,d.f)(c.Z,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class D extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=a.Z.canUseDOM?N("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=N("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),L(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return r.createElement(I,{previousLocation:this.previousLocation,location:t},r.createElement(u.AW,{location:t,render:()=>e}))}}const P=D,M="__docusaurus-base-url-issue-banner-container",F="__docusaurus-base-url-issue-banner",U="__docusaurus-base-url-issue-banner-suggestion-container",j="__DOCUSAURUS_INSERT_BASEURL_BANNER";function B(e){return`\nwindow['${j}'] = true;\n\ndocument.addEventListener('DOMContentLoaded', maybeInsertBanner);\n\nfunction maybeInsertBanner() {\n var shouldInsert = window['${j}'];\n shouldInsert && insertBanner();\n}\n\nfunction insertBanner() {\n var bannerContainer = document.getElementById('${M}');\n if (!bannerContainer) {\n return;\n }\n var bannerHtml = ${JSON.stringify(function(e){return`\n<div id="${F}" style="border: thick solid red; background-color: rgb(255, 230, 179); margin: 20px; padding: 20px; font-size: 20px;">\n <p style="font-weight: bold; font-size: 30px;">Your Docusaurus site did not load properly.</p>\n <p>A very common reason is a wrong site <a href="https://docusaurus.io/docs/docusaurus.config.js/#baseUrl" style="font-weight: bold;">baseUrl configuration</a>.</p>\n <p>Current configured baseUrl = <span style="font-weight: bold; color: red;">${e}</span> ${"/"===e?" (default value)":""}</p>\n <p>We suggest trying baseUrl = <span id="${U}" style="font-weight: bold; color: green;"></span></p>\n</div>\n`}(e)).replace(/</g,"\\<")};\n bannerContainer.innerHTML = bannerHtml;\n var suggestionContainer = document.getElementById('${U}');\n var actualHomePagePath = window.location.pathname;\n var suggestedBaseUrl = actualHomePagePath.substr(-1) === '/'\n ? actualHomePagePath\n : actualHomePagePath + '/';\n suggestionContainer.innerHTML = suggestedBaseUrl;\n}\n`}function H(){const{siteConfig:{baseUrl:e}}=(0,p.Z)();return(0,r.useLayoutEffect)((()=>{window[j]=!1}),[]),r.createElement(r.Fragment,null,!a.Z.canUseDOM&&r.createElement(h.Z,null,r.createElement("script",null,B(e))),r.createElement("div",{id:M}))}function $(){const{siteConfig:{baseUrl:e,baseUrlIssueBanner:t}}=(0,p.Z)(),{pathname:n}=(0,u.TH)();return t&&n===e?r.createElement(H,null):null}function z(){const{siteConfig:{favicon:e,title:t,noIndex:n},i18n:{currentLocale:i,localeConfigs:s}}=(0,p.Z)(),o=(0,m.Z)(e),{htmlLang:a,direction:l}=s[i];return r.createElement(h.Z,null,r.createElement("html",{lang:a,dir:l}),r.createElement("title",null,t),r.createElement("meta",{property:"og:title",content:t}),r.createElement("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),n&&r.createElement("meta",{name:"robots",content:"noindex, nofollow"}),e&&r.createElement("link",{rel:"icon",href:o}))}var V=n(44763),G=n(72389);function W(){const e=(0,G.Z)();return r.createElement(h.Z,null,r.createElement("html",{"data-has-hydrated":e}))}function K(){const e=(0,d.H)(c.Z),t=(0,u.TH)();return r.createElement(V.Z,null,r.createElement(A.M,null,r.createElement(O.t,null,r.createElement(f,null,r.createElement(z,null),r.createElement(R,null),r.createElement($,null),r.createElement(P,{location:C(t)},e)),r.createElement(W,null))))}var Y=n(16887);const Z=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const i=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;i?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var q=n(99670);const Q=new Set,X=new Set,J=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,ee={prefetch(e){if(!(e=>!J()&&!X.has(e)&&!Q.has(e))(e))return!1;Q.add(e);const t=(0,d.f)(c.Z,e).flatMap((e=>{return t=e.route.path,Object.entries(Y).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,q.Z)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?Z(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!J()&&!X.has(e))(e)&&(X.add(e),L(e))},te=Object.freeze(ee);if(a.Z.canUseDOM){window.docusaurus=te;const e=i.hydrate;L(window.location.pathname).then((()=>{e(r.createElement(o.B6,null,r.createElement(s.VK,null,r.createElement(K,null))),document.getElementById("__docusaurus"))}))}},58940:(e,t,n)=>{"use strict";n.d(t,{_:()=>u,M:()=>d});var r=n(67294),i=n(36809);const s=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"content/authorization-and-openfga","docs":[{"id":"content/authorization-and-openfga","path":"/docs/authorization-and-openfga","sidebar":"docs"},{"id":"content/concepts","path":"/docs/concepts","sidebar":"docs"},{"id":"content/configuration-language","path":"/docs/configuration-language","sidebar":"docs"},{"id":"content/getting-started/configure-model","path":"/docs/getting-started/configure-model","sidebar":"docs"},{"id":"content/getting-started/create-store","path":"/docs/getting-started/create-store","sidebar":"docs"},{"id":"content/getting-started/framework","path":"/docs/getting-started/framework","sidebar":"docs"},{"id":"content/getting-started/immutable-models","path":"/docs/getting-started/immutable-models","sidebar":"docs"},{"id":"content/getting-started/install-sdk","path":"/docs/getting-started/install-sdk","sidebar":"docs"},{"id":"content/getting-started/overview","path":"/docs/getting-started","sidebar":"docs"},{"id":"content/getting-started/perform-check","path":"/docs/getting-started/perform-check","sidebar":"docs"},{"id":"content/getting-started/perform-list-objects","path":"/docs/getting-started/perform-list-objects","sidebar":"docs"},{"id":"content/getting-started/production-best-practices","path":"/docs/getting-started/running-in-production","sidebar":"docs"},{"id":"content/getting-started/setup-openfga/docker-setup","path":"/docs/getting-started/setup-openfga/docker","sidebar":"docs"},{"id":"content/getting-started/setup-openfga/kubernetes-setup","path":"/docs/getting-started/setup-openfga/kubernetes","sidebar":"docs"},{"id":"content/getting-started/setup-openfga/overview","path":"/docs/getting-started/setup-openfga/overview","sidebar":"docs"},{"id":"content/getting-started/setup-sdk-client","path":"/docs/getting-started/setup-sdk-client","sidebar":"docs"},{"id":"content/getting-started/tuples-api-best-practices","path":"/docs/getting-started/tuples-api-best-practices","sidebar":"docs"},{"id":"content/getting-started/update-tuples","path":"/docs/getting-started/update-tuples","sidebar":"docs"},{"id":"content/interacting/managing-group-access","path":"/docs/interacting/managing-group-access","sidebar":"docs"},{"id":"content/interacting/managing-group-membership","path":"/docs/interacting/managing-group-membership","sidebar":"docs"},{"id":"content/interacting/managing-relationships-between-objects","path":"/docs/interacting/managing-relationships-between-objects","sidebar":"docs"},{"id":"content/interacting/managing-user-access","path":"/docs/interacting/managing-user-access","sidebar":"docs"},{"id":"content/interacting/overview","path":"/docs/interacting","sidebar":"docs"},{"id":"content/interacting/read-tuple-changes","path":"/docs/interacting/read-tuple-changes","sidebar":"docs"},{"id":"content/interacting/relationship-queries","path":"/docs/interacting/relationship-queries","sidebar":"docs"},{"id":"content/interacting/search-with-permissions","path":"/docs/interacting/search-with-permissions","sidebar":"docs"},{"id":"content/interacting/transactional-writes","path":"/docs/interacting/transactional-writes","sidebar":"docs"},{"id":"content/modeling/advanced/entitlements","path":"/docs/modeling/advanced/entitlements","sidebar":"docs"},{"id":"content/modeling/advanced/gdrive","path":"/docs/modeling/advanced/gdrive","sidebar":"docs"},{"id":"content/modeling/advanced/github","path":"/docs/modeling/advanced/github","sidebar":"docs"},{"id":"content/modeling/advanced/iot","path":"/docs/modeling/advanced/iot","sidebar":"docs"},{"id":"content/modeling/advanced/overview","path":"/docs/modeling/advanced","sidebar":"docs"},{"id":"content/modeling/advanced/slack","path":"/docs/modeling/advanced/slack","sidebar":"docs"},{"id":"content/modeling/blocklists","path":"/docs/modeling/blocklists","sidebar":"docs"},{"id":"content/modeling/building-blocks/concentric-relationships","path":"/docs/modeling/building-blocks/concentric-relationships","sidebar":"docs"},{"id":"content/modeling/building-blocks/direct-relationships","path":"/docs/modeling/building-blocks/direct-relationships","sidebar":"docs"},{"id":"content/modeling/building-blocks/object-to-object-relationships","path":"/docs/modeling/building-blocks/object-to-object-relationships","sidebar":"docs"},{"id":"content/modeling/building-blocks/overview","path":"/docs/modeling/building-blocks","sidebar":"docs"},{"id":"content/modeling/building-blocks/usersets","path":"/docs/modeling/building-blocks/usersets","sidebar":"docs"},{"id":"content/modeling/contextual-time-based-authorization","path":"/docs/modeling/contextual-time-based-authorization","sidebar":"docs"},{"id":"content/modeling/custom-roles","path":"/docs/modeling/custom-roles","sidebar":"docs"},{"id":"content/modeling/direct-access","path":"/docs/modeling/direct-access","sidebar":"docs"},{"id":"content/modeling/getting-started","path":"/docs/modeling/getting-started","sidebar":"docs"},{"id":"content/modeling/migrating/migrating-relations","path":"/docs/modeling/migrating/migrating-relations","sidebar":"docs"},{"id":"content/modeling/migrating/migrating-schema-1-1","path":"/docs/modeling/migrating/migrating-schema-1-1","sidebar":"docs"},{"id":"content/modeling/migrating/overview","path":"/docs/modeling/migrating","sidebar":"docs"},{"id":"content/modeling/multiple-restrictions","path":"/docs/modeling/multiple-restrictions","sidebar":"docs"},{"id":"content/modeling/organization-context-authorization","path":"/docs/modeling/organization-context-authorization","sidebar":"docs"},{"id":"content/modeling/overview","path":"/docs/modeling","sidebar":"docs"},{"id":"content/modeling/parent-child","path":"/docs/modeling/parent-child","sidebar":"docs"},{"id":"content/modeling/public-access","path":"/docs/modeling/public-access","sidebar":"docs"},{"id":"content/modeling/roles-and-permissions","path":"/docs/modeling/roles-and-permissions","sidebar":"docs"},{"id":"content/modeling/user-groups","path":"/docs/modeling/user-groups","sidebar":"docs"}],"draftIds":[],"sidebars":{"docs":{"link":{"path":"/docs/authorization-and-openfga","label":"What is OpenFGA"}}}}],"breadcrumbs":true}}}'),o=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var a=n(57529);const l=JSON.parse('{"docusaurusVersion":"2.4.3","siteVersion":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"2.4.3"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"2.4.3"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"2.4.3"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"2.4.3"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"2.4.3"},"webpack-overrides-docusaurus-plugin":{"type":"project"},"docusaurus-plugin-client-redirects":{"type":"package","name":"@docusaurus/plugin-client-redirects","version":"2.4.3"},"docusaurus-plugin-local-resolve":{"type":"package","name":"docusaurus-plugin-module-alias","version":"0.0.2"},"@easyops-cn/docusaurus-search-local":{"type":"package","name":"@easyops-cn/docusaurus-search-local","version":"0.36.0"}}}'),c={siteConfig:i.default,siteMetadata:l,globalData:s,i18n:o,codeTranslations:a},u=r.createContext(c);function d(e){let{children:t}=e;return r.createElement(u.Provider,{value:c},t)}},44763:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(67294),i=n(10412),s=n(35742),o=n(18780),a=n(40163);function l(e){let{error:t,tryAgain:n}=e;return r.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"}},r.createElement("h1",{style:{fontSize:"3rem"}},"This page crashed"),r.createElement("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"}},"Try again"),r.createElement(c,{error:t}))}function c(e){let{error:t}=e;const n=(0,o.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return r.createElement("p",{style:{whiteSpace:"pre-wrap"}},n)}function u(e){let{error:t,tryAgain:n}=e;return r.createElement(h,{fallback:()=>r.createElement(l,{error:t,tryAgain:n})},r.createElement(s.Z,null,r.createElement("title",null,"Page Error")),r.createElement(a.Z,null,r.createElement(l,{error:t,tryAgain:n})))}const d=e=>r.createElement(u,e);class h extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){i.Z.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??d)(e)}return e??null}}},10412:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,i={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},35742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(67294),i=n(70405);function s(e){return r.createElement(i.ql,e)}},39960:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(87462),i=n(67294),s=n(73727),o=n(18780),a=n(52263),l=n(13919),c=n(10412);const u=i.createContext({collectLink:()=>{}});var d=n(44996);function h(e,t){let{isNavLink:n,to:h,href:p,activeClassName:f,isActive:g,"data-noBrokenLinkCheck":m,autoAddBaseUrl:y=!0,...b}=e;const{siteConfig:{trailingSlash:v,baseUrl:E}}=(0,a.Z)(),{withBaseUrl:_}=(0,d.C)(),T=(0,i.useContext)(u),x=(0,i.useRef)(null);(0,i.useImperativeHandle)(t,(()=>x.current));const w=h||p;const S=(0,l.Z)(w),R=w?.replace("pathname://","");let k=void 0!==R?(C=R,y&&(e=>e.startsWith("/"))(C)?_(C):C):void 0;var C;k&&S&&(k=(0,o.applyTrailingSlash)(k,{trailingSlash:v,baseUrl:E}));const O=(0,i.useRef)(!1),A=n?s.OL:s.rU,N=c.Z.canUseIntersectionObserver,I=(0,i.useRef)(),L=()=>{O.current||null==k||(window.docusaurus.preload(k),O.current=!0)};(0,i.useEffect)((()=>(!N&&S&&null!=k&&window.docusaurus.prefetch(k),()=>{N&&I.current&&I.current.disconnect()})),[I,k,N,S]);const D=k?.startsWith("#")??!1,P=!k||!S||D;return P||m||T.collectLink(k),P?i.createElement("a",(0,r.Z)({ref:x,href:k},w&&!S&&{target:"_blank",rel:"noopener noreferrer"},b)):i.createElement(A,(0,r.Z)({},b,{onMouseEnter:L,onTouchStart:L,innerRef:e=>{x.current=e,N&&e&&S&&(I.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(I.current.unobserve(e),I.current.disconnect(),null!=k&&window.docusaurus.prefetch(k))}))})),I.current.observe(e))},to:k},n&&{isActive:g,activeClassName:f}))}const p=i.forwardRef(h)},95999:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l,I:()=>a});var r=n(67294);function i(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var s=n(57529);function o(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return s[t??n]??n??t}function a(e,t){let{message:n,id:r}=e;return i(o({message:n,id:r}),t)}function l(e){let{children:t,id:n,values:s}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal <Translate> children",t),new Error("The Docusaurus <Translate> component only accept simple string values");const a=o({message:t,id:n});return r.createElement(r.Fragment,null,i(a,s))}},29935:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});const r="default"},13919:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}n.d(t,{Z:()=>i,b:()=>r})},44996:(e,t,n)=>{"use strict";n.d(t,{C:()=>o,Z:()=>a});var r=n(67294),i=n(52263),s=n(13919);function o(){const{siteConfig:{baseUrl:e,url:t}}=(0,i.Z)(),n=(0,r.useCallback)(((n,r)=>function(e,t,n,r){let{forcePrependBaseUrl:i=!1,absolute:o=!1}=void 0===r?{}:r;if(!n||n.startsWith("#")||(0,s.b)(n))return n;if(i)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;const a=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+a:a}(t,e,n,r)),[t,e]);return{withBaseUrl:n}}function a(e,t){void 0===t&&(t={});const{withBaseUrl:n}=o();return n(e,t)}},52263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(67294),i=n(58940);function s(){return(0,r.useContext)(i._)}},72389:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(67294),i=n(98934);function s(){return(0,r.useContext)(i._)}},99670:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function i(e){const t={};return function e(n,i){Object.entries(n).forEach((n=>{let[s,o]=n;const a=i?`${i}.${s}`:s;r(o)?e(o,a):t[a]=o}))}(e),t}},30226:(e,t,n)=>{"use strict";n.d(t,{_:()=>i,z:()=>s});var r=n(67294);const i=r.createContext(null);function s(e){let{children:t,value:n}=e;const s=r.useContext(i),o=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:s,value:n})),[s,n]);return r.createElement(i.Provider,{value:o},t)}},80143:(e,t,n)=>{"use strict";n.d(t,{Iw:()=>g,gA:()=>h,_r:()=>u,Jo:()=>m,zh:()=>d,yW:()=>f,gB:()=>p});var r=n(16550),i=n(52263),s=n(29935);function o(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,i.Z)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const a=e=>e.versions.find((e=>e.isLast));function l(e,t){const n=function(e,t){const n=a(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})))}(e,t),i=n?.docs.find((e=>!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:i,alternateDocVersions:i?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(i.id):{}}}const c={},u=()=>o("docusaurus-plugin-content-docs")??c,d=e=>function(e,t,n){void 0===t&&(t=s.m),void 0===n&&(n={});const r=o(e),i=r?.[t];if(!i&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return i}("docusaurus-plugin-content-docs",e,{failfast:!0});function h(e){void 0===e&&(e={});const t=u(),{pathname:n}=(0,r.TH)();return function(e,t,n){void 0===n&&(n={});const i=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),s=i?{pluginId:i[0],pluginData:i[1]}:void 0;if(!s&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return s}(t,n,e)}function p(e){return d(e).versions}function f(e){const t=d(e);return a(t)}function g(e){const t=d(e),{pathname:n}=(0,r.TH)();return l(t,n)}function m(e){const t=d(e),{pathname:n}=(0,r.TH)();return function(e,t){const n=a(e);return{latestDocSuggestion:l(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},18320:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(74865),i=n.n(r);i().configure({showSpinner:!1});const s={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{i().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){i().done()}}},78221:(e,t,n)=>{"use strict";n.r(t);var r=n(11205),i=n(36809),s=n(44096);const{OpenFgaDslThemeTokenType:o}=s.theming,{PrismExtensions:a}=s.tools,l={...a.languageDefinition,[o.KEYWORD]:/\b(type|relations|define|and|or|but not|from|as|model|schema|condition)\b/,condition:{pattern:/(\bcondition\s+)\w+/i,lookbehind:!0,greedy:!0},"condition-params":{pattern:/\(.*\)\s*{/,inside:{"condition-param":/\b(\w+)\s*:/i,"condition-param-type":/\b(string|int|map|uint|list|timestamp|bool|duration|double|ipaddress)\b/}}};!function(e){const{themeConfig:{prism:t}}=i.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{n(7464)(`./prism-${e}`)})),e.languages[a.LANGUAGE_NAME]=l,delete globalThis.Prism}(r.Z)},39471:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(67294);const i={iconExternalLink:"iconExternalLink_nPIU"};function s(e){let{width:t=13.5,height:n=13.5}=e;return r.createElement("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:i.iconExternalLink},r.createElement("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"}))}},40163:(e,t,n)=>{"use strict";n.d(t,{Z:()=>Dt});var r=n(67294),i=n(34334),s=n(44763),o=n(1944),a=n(87462),l=n(16550),c=n(95999),u=n(85936);const d="__docusaurus_skipToContent_fallback";function h(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function p(){const e=(0,r.useRef)(null),{action:t}=(0,l.k6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&h(t)}),[]);return(0,u.S)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&h(e.current)})),{containerRef:e,onClick:n}}const f=(0,c.I)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function g(e){const t=e.children??f,{containerRef:n,onClick:i}=p();return r.createElement("div",{ref:n,role:"region","aria-label":f},r.createElement("a",(0,a.Z)({},e,{href:`#${d}`,onClick:i}),t))}var m=n(35281),y=n(19727);const b={skipToContent:"skipToContent_fXgn"};function v(){return r.createElement(g,{className:b.skipToContent})}var E=n(86668),_=n(59689);function T(e){let{width:t=21,height:n=21,color:i="currentColor",strokeWidth:s=1.2,className:o,...l}=e;return r.createElement("svg",(0,a.Z)({viewBox:"0 0 15 15",width:t,height:n},l),r.createElement("g",{stroke:i,strokeWidth:s},r.createElement("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})))}const x={closeButton:"closeButton_CVFx"};function w(e){return r.createElement("button",(0,a.Z)({type:"button","aria-label":(0,c.I)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"})},e,{className:(0,i.Z)("clean-btn close",x.closeButton,e.className)}),r.createElement(T,{width:14,height:14,strokeWidth:3.1}))}const S={content:"content_knG7"};function R(e){const{announcementBar:t}=(0,E.L)(),{content:n}=t;return r.createElement("div",(0,a.Z)({},e,{className:(0,i.Z)(S.content,e.className),dangerouslySetInnerHTML:{__html:n}}))}const k={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function C(){const{announcementBar:e}=(0,E.L)(),{isActive:t,close:n}=(0,_.nT)();if(!t)return null;const{backgroundColor:i,textColor:s,isCloseable:o}=e;return r.createElement("div",{className:k.announcementBar,style:{backgroundColor:i,color:s},role:"banner"},o&&r.createElement("div",{className:k.announcementBarPlaceholder}),r.createElement(R,{className:k.announcementBarContent}),o&&r.createElement(w,{onClick:n,className:k.announcementBarClose}))}var O=n(93163),A=n(12466);var N=n(902),I=n(13102);const L=r.createContext(null);function D(e){let{children:t}=e;const n=function(){const e=(0,O.e)(),t=(0,I.HY)(),[n,i]=(0,r.useState)(!1),s=null!==t.component,o=(0,N.D9)(s);return(0,r.useEffect)((()=>{s&&!o&&i(!0)}),[s,o]),(0,r.useEffect)((()=>{s?e.shown||i(!0):i(!1)}),[e.shown,s]),(0,r.useMemo)((()=>[n,i]),[n])}();return r.createElement(L.Provider,{value:n},t)}function P(e){if(e.component){const t=e.component;return r.createElement(t,e.props)}}function M(){const e=(0,r.useContext)(L);if(!e)throw new N.i6("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,i=(0,r.useCallback)((()=>n(!1)),[n]),s=(0,I.HY)();return(0,r.useMemo)((()=>({shown:t,hide:i,content:P(s)})),[i,s,t])}function F(e){let{header:t,primaryMenu:n,secondaryMenu:s}=e;const{shown:o}=M();return r.createElement("div",{className:"navbar-sidebar"},t,r.createElement("div",{className:(0,i.Z)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":o})},r.createElement("div",{className:"navbar-sidebar__item menu"},n),r.createElement("div",{className:"navbar-sidebar__item menu"},s)))}var U=n(92949),j=n(72389);function B(e){return r.createElement("svg",(0,a.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"}))}function H(e){return r.createElement("svg",(0,a.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"}))}const $={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function z(e){let{className:t,buttonClassName:n,value:s,onChange:o}=e;const a=(0,j.Z)(),l=(0,c.I)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===s?(0,c.I)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,c.I)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return r.createElement("div",{className:(0,i.Z)($.toggle,t)},r.createElement("button",{className:(0,i.Z)("clean-btn",$.toggleButton,!a&&$.toggleButtonDisabled,n),type:"button",onClick:()=>o("dark"===s?"light":"dark"),disabled:!a,title:l,"aria-label":l,"aria-live":"polite"},r.createElement(B,{className:(0,i.Z)($.toggleIcon,$.lightToggleIcon)}),r.createElement(H,{className:(0,i.Z)($.toggleIcon,$.darkToggleIcon)})))}const V=r.memo(z),G={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_X3D1"};function W(e){let{className:t}=e;const n=(0,E.L)().navbar.style,i=(0,E.L)().colorMode.disableSwitch,{colorMode:s,setColorMode:o}=(0,U.I)();return i?null:r.createElement(V,{className:t,buttonClassName:"dark"===n?G.darkNavbarColorModeToggle:void 0,value:s,onChange:o})}var K=n(21327);function Y(){return r.createElement(K.Z,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function Z(){const e=(0,O.e)();return r.createElement("button",{type:"button","aria-label":(0,c.I)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle()},r.createElement(T,{color:"var(--ifm-color-emphasis-600)"}))}function q(){return r.createElement("div",{className:"navbar-sidebar__brand"},r.createElement(Y,null),r.createElement(W,{className:"margin-right--md"}),r.createElement(Z,null))}var Q=n(39960),X=n(44996),J=n(13919);function ee(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}var te=n(39471);const ne="openfga_github_stars";function re(e){let{activeBasePath:t,activeBaseRegex:n,to:i,href:s,label:o,html:l,isDropdownLink:c,prependBaseUrlToHref:u,...d}=e;const h=(0,X.Z)(i),p=(0,X.Z)(t),f=(0,X.Z)(s,{forcePrependBaseUrl:!0}),g=o&&s&&!(0,J.Z)(s),[m,y]=(0,r.useState)(null);(0,r.useEffect)((()=>{m||(async()=>{const e=JSON.parse(sessionStorage.getItem(ne));try{if(e){const t=new Date(e.retrievedTime);if(t.setDate(t.getDate()+1),t.getTime()>Date.now())return void y({count:e.count,retrievedTime:Date.now()})}const t=await fetch("https://api.github.com/repos/openfga/openfga");if(!t.ok)throw new Error(`This is an HTTP error: The status is ${t.status}`);const n={count:(await t.json()).stargazers_count,retrievedTime:Date.now()};y(n),sessionStorage.setItem(ne,JSON.stringify(n))}catch(t){y(e||null)}})()}),[]);const b="GitHub"===o&&m?`GitHub | ${m.count}`:o,v=l?{dangerouslySetInnerHTML:{__html:l}}:{children:r.createElement(r.Fragment,null,b,g&&r.createElement(te.Z,c&&{width:12,height:12}))};return s?r.createElement(Q.Z,(0,a.Z)({href:u?f:s},d,v)):r.createElement(Q.Z,(0,a.Z)({to:h,isNavLink:!0},(t||n)&&{isActive:(e,t)=>n?ee(n,t.pathname):t.pathname.startsWith(p)},d,v))}function ie(e){let{className:t,isDropdownItem:n=!1,...s}=e;const o=r.createElement(re,(0,a.Z)({className:(0,i.Z)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n},s));return n?r.createElement("li",null,o):o}function se(e){let{className:t,isDropdownItem:n,...s}=e;return r.createElement("li",{className:"menu__list-item"},r.createElement(re,(0,a.Z)({className:(0,i.Z)("menu__link",t)},s)))}function oe(e){let{mobile:t=!1,position:n,...i}=e;const s=t?se:ie;return r.createElement(s,(0,a.Z)({},i,{activeClassName:i.activeClassName??(t?"menu__link--active":"navbar__link--active")}))}var ae=n(86043),le=n(48596),ce=n(52263);function ue(e,t){return e.some((e=>function(e,t){return!!(0,le.Mg)(e.to,t)||!!ee(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function de(e){let{items:t,position:n,className:s,onClick:o,...l}=e;const c=(0,r.useRef)(null),[u,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{c.current&&!c.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[c]),r.createElement("div",{ref:c,className:(0,i.Z)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":u})},r.createElement(re,(0,a.Z)({"aria-haspopup":"true","aria-expanded":u,role:"button",href:l.to?void 0:"#",className:(0,i.Z)("navbar__link",s)},l,{onClick:l.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!u))}}),l.children??l.label),r.createElement("ul",{className:"dropdown__menu"},t.map(((e,t)=>r.createElement(Ke,(0,a.Z)({isDropdownItem:!0,activeClassName:"dropdown__link--active"},e,{key:t}))))))}function he(e){let{items:t,className:n,position:s,onClick:o,...c}=e;const u=function(){const{siteConfig:{baseUrl:e}}=(0,ce.Z)(),{pathname:t}=(0,l.TH)();return t.replace(e,"/")}(),d=ue(t,u),{collapsed:h,toggleCollapsed:p,setCollapsed:f}=(0,ae.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&f(!d)}),[u,d,f]),r.createElement("li",{className:(0,i.Z)("menu__list-item",{"menu__list-item--collapsed":h})},r.createElement(re,(0,a.Z)({role:"button",className:(0,i.Z)("menu__link menu__link--sublist menu__link--sublist-caret",n)},c,{onClick:e=>{e.preventDefault(),p()}}),c.children??c.label),r.createElement(ae.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:h},t.map(((e,t)=>r.createElement(Ke,(0,a.Z)({mobile:!0,isDropdownItem:!0,onClick:o,activeClassName:"menu__link--active"},e,{key:t}))))))}function pe(e){let{mobile:t=!1,...n}=e;const i=t?he:de;return r.createElement(i,n)}var fe=n(94711);function ge(e){let{width:t=20,height:n=20,...i}=e;return r.createElement("svg",(0,a.Z)({viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0},i),r.createElement("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"}))}const me="iconLanguage_nlXk";var ye=n(61029),be=n(1728),ve=n(10412),Ee=n(60373),_e=n(80143),Te=n(90022),xe=n(98202),we=n(73926),Se=n(91073),Re=n(82539),ke=n(10726);const Ce='<svg width="20" height="20" viewBox="0 0 20 20"><path d="M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linejoin="round"></path></svg>',Oe='<svg width="20" height="20" viewBox="0 0 20 20"><path d="M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg>',Ae='<svg width="20" height="20" viewBox="0 0 20 20"><path d="M17 5H3h14zm0 5H3h14zm0 5H3h14z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linejoin="round"></path></svg>',Ne='<svg width="20" height="20" viewBox="0 0 20 20"><g stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><path d="M18 3v4c0 2-2 4-4 4H2"></path><path d="M8 17l-6-6 6-6"></path></g></svg>',Ie='<svg width="40" height="40" viewBox="0 0 20 20" fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M15.5 4.8c2 3 1.7 7-1 9.7h0l4.3 4.3-4.3-4.3a7.8 7.8 0 01-9.8 1m-2.2-2.2A7.8 7.8 0 0113.2 2.4M2 18L18 2"></path></svg>',Le='<svg viewBox="0 0 24 54"><g stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><path d="M8 6v42M20 27H8.3"></path></g></svg>',De='<svg viewBox="0 0 24 54"><g stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><path d="M8 6v21M20 27H8.3"></path></g></svg>',Pe={searchBar:"searchBar_RVTs",dropdownMenu:"dropdownMenu_qbY6",searchBarLeft:"searchBarLeft_MXDe",suggestion:"suggestion_fB_2",cursor:"cursor_eG29",hitTree:"hitTree_kk6K",hitIcon:"hitIcon_a7Zy",hitPath:"hitPath_ieM4",noResultsIcon:"noResultsIcon_EBY5",hitFooter:"hitFooter_E9YW",hitWrapper:"hitWrapper_sAK8",hitTitle:"hitTitle_vyVt",hitAction:"hitAction_NqkB",hideAction:"hideAction_vcyE",noResults:"noResults_l6Q3",searchBarContainer:"searchBarContainer_NW3z",searchBarLoadingRing:"searchBarLoadingRing_YnHq",searchClearButton:"searchClearButton_qk4g",searchIndexLoading:"searchIndexLoading_EJ1f",searchHintContainer:"searchHintContainer_Pkmr",searchHint:"searchHint_iIMx",focused:"focused_OWtg",input:"input_FOTf",hint:"hint_URu1",suggestions:"suggestions_X8XU",dataset:"dataset_QiCy",empty:"empty_eITn"};function Me(e){let{document:t,type:n,page:r,metadata:i,tokens:s,isInterOfTree:o,isLastOfTree:a}=e;const l=0===n,c=1===n,u=[];o?u.push(Le):a&&u.push(De);const d=u.map((e=>`<span class="${Pe.hitTree}">${e}</span>`)),h=`<span class="${Pe.hitIcon}">${l?Ce:c?Oe:Ae}</span>`,p=[`<span class="${Pe.hitTitle}">${(0,ke.o)(t.t,(0,Se.m)(i,"t"),s)}</span>`];if(!o&&!a&&ye.H6){const e=r?(r.b??[]).concat(r.t).concat(t.s&&t.s!==r.t?t.s:[]):t.b;p.push(`<span class="${Pe.hitPath}">${(0,we.e)(e??[])}</span>`)}else l||p.push(`<span class="${Pe.hitPath}">${(0,Re.C)(r.t||(t.u.startsWith("/docs/api-reference/")?"API Reference":""),s)}</span>`);const f=`<span class="${Pe.hitAction}">${Ne}</span>`;return[...d,h,`<span class="${Pe.hitWrapper}">`,...p,"</span>",f].join("")}function Fe(){return`<span class="${Pe.noResults}"><span class="${Pe.noResultsIcon}">${Ie}</span><span>${(0,c.I)({id:"theme.SearchBar.noResultsText",message:"No results"})}</span></span>`}var Ue=n(80311);async function je(){const e=await Promise.all([n.e(8443),n.e(5525)]).then(n.t.bind(n,68443,23)),t=e.default;return t.noConflict?t.noConflict():e.noConflict&&e.noConflict(),t}const Be="_highlight";const He=function(e){let{handleSearchBarToggle:t}=e;const{siteConfig:{baseUrl:n}}=(0,ce.Z)(),i=(0,_e.gA)();let s=n;try{const{preferredVersion:e}=(0,Ee.J)(i?.pluginId??ye.gQ);e&&!e.isLast&&(s=e.path+"/")}catch(D){if(ye.l9&&!(D instanceof N.i6))throw D}const o=(0,l.k6)(),a=(0,l.TH)(),u=(0,r.useRef)(null),d=(0,r.useRef)(new Map),h=(0,r.useRef)(!1),[p,f]=(0,r.useState)(!1),[g,m]=(0,r.useState)(!1),[y,b]=(0,r.useState)(""),v=(0,r.useRef)(null),E=(0,r.useRef)(""),[_,T]=(0,r.useState)("");(0,r.useEffect)((()=>{if(!Array.isArray(ye.Kc))return;let e="";if(a.pathname.startsWith(s)){const t=a.pathname.substring(s.length),n=ye.Kc.find((e=>t===e||t.startsWith(`${e}/`)));n&&(e=n)}E.current!==e&&(d.current.delete(e),E.current=e),T(e)}),[a.pathname,s]);const x=!!ye.hG&&Array.isArray(ye.Kc)&&""===_,w=(0,r.useCallback)((async()=>{if(x||d.current.get(_))return;d.current.set(_,"loading"),v.current?.autocomplete.destroy(),f(!0);const[{wrappedIndexes:e,zhDictionary:t},r]=await Promise.all([(0,Te.w)(s,_),je()]);if(v.current=r(u.current,{hint:!1,autoselect:!0,openOnFocus:!0,cssClasses:{root:(0,be.Z)(Pe.searchBar,{[Pe.searchBarLeft]:"left"===ye.pu}),noPrefix:!0,dropdownMenu:Pe.dropdownMenu,input:Pe.input,hint:Pe.hint,suggestions:Pe.suggestions,suggestion:Pe.suggestion,cursor:Pe.cursor,dataset:Pe.dataset,empty:Pe.empty}},[{source:(0,xe.v)(e,t,ye.qo),templates:{suggestion:Me,empty:Fe,footer:e=>{let{query:t,isEmpty:r}=e;if(r&&!_)return;const i=(e=>{let{query:t,isEmpty:r}=e;const i=document.createElement("a"),a=new URLSearchParams,l=(0,c.I)({id:"theme.SearchBar.seeAll",message:"See all results"}),u=(0,c.I)({id:"theme.SearchBar.seeAllOutsideContext",message:"See results outside {context}"},{context:_}),d=(0,c.I)({id:"theme.SearchBar.searchInContext",message:"See all results in {context}"},{context:_});let h;if(a.set("q",t),h=_&&r?u:_?d:l,Array.isArray(ye.Kc)&&!r&&a.set("ctx",_),s!==n){if(!s.startsWith(n))throw new Error(`Version url '${s}' does not start with base url '${n}', this is a bug of \`@easyops-cn/docusaurus-search-local\`, please report it.`);a.set("version",s.substring(n.length))}const p=`${n}search?${a.toString()}`;return i.href=p,i.textContent=h,i.addEventListener("click",(e=>{e.ctrlKey||e.metaKey||(e.preventDefault(),v.current?.autocomplete.close(),o.push(p))})),i})({query:t,isEmpty:r}),a=document.createElement("div");return a.className=Pe.hitFooter,a.appendChild(i),a}}}]).on("autocomplete:selected",(function(e,t){let{document:{u:n,h:r},tokens:i}=t;u.current?.blur();let s=n;if(ye.vc&&i.length>0){const e=new URLSearchParams;for(const t of i)e.append(Be,t);s+=`?${e.toString()}`}r&&(s+=r),o.push(s)})).on("autocomplete:closed",(()=>{u.current?.blur()})),d.current.set(_,"done"),f(!1),h.current){const e=u.current;e.value&&v.current?.autocomplete.open(),e.focus()}}),[x,_,s,n,o]);(0,r.useEffect)((()=>{if(!ye.vc)return;const e=ve.Z.canUseDOM?new URLSearchParams(a.search).getAll(Be):[];setTimeout((()=>{const t=document.querySelector("article");if(!t)return;const n=new ye.vc(t);n.unmark(),0!==e.length&&n.mark(e),b(e.join(" ")),v.current?.autocomplete.setVal(e.join(" "))}))}),[a.search,a.pathname]);const[S,R]=(0,r.useState)(!1),k=(0,r.useCallback)((()=>{h.current=!0,w(),R(!0),t?.(!0)}),[t,w]),C=(0,r.useCallback)((()=>{R(!1),t?.(!1)}),[t]),O=(0,r.useCallback)((()=>{w()}),[w]),A=(0,r.useCallback)((e=>{b(e.target.value),e.target.value&&m(!0)}),[]),I=!!ve.Z.canUseDOM&&/mac/i.test(navigator.userAgentData?.platform??navigator.platform);(0,r.useEffect)((()=>{if(!ye.AY)return;const e=e=>{!(I?e.metaKey:e.ctrlKey)||"k"!==e.key&&"K"!==e.key||(e.preventDefault(),u.current?.focus(),k())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[I,k]);const L=(0,r.useCallback)((()=>{const e=new URLSearchParams(a.search);e.delete(Be);const t=e.toString(),n=a.pathname+(""!=t?`?${t}`:"")+a.hash;n!=a.pathname+a.search+a.hash&&o.push(n),b(""),v.current?.autocomplete.setVal("")}),[a.pathname,a.search,a.hash,o]);return r.createElement("div",{className:(0,be.Z)("navbar__search",Pe.searchBarContainer,{[Pe.searchIndexLoading]:p&&g,[Pe.focused]:S}),hidden:x},r.createElement("input",{placeholder:(0,c.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),"aria-label":"Search",className:"navbar__search-input",onMouseEnter:O,onFocus:k,onBlur:C,onChange:A,ref:u,value:y}),r.createElement(Ue.Z,{className:Pe.searchBarLoadingRing}),ye.AY&&ye.t_&&(""!==y?r.createElement("button",{className:Pe.searchClearButton,onClick:L},"\u2715"):ve.Z.canUseDOM&&r.createElement("div",{className:Pe.searchHintContainer},r.createElement("kbd",{className:Pe.searchHint},I?"\u2318":"ctrl"),r.createElement("kbd",{className:Pe.searchHint},"K"))))},$e={searchBox:"searchBox_ZlJk"};function ze(e){let{children:t,className:n}=e;return r.createElement("div",{className:(0,i.Z)(n,$e.searchBox)},t)}var Ve=n(53438);const Ge=e=>e.docs.find((t=>t.id===e.mainDocId));const We={default:oe,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:i,...s}=e;const{i18n:{currentLocale:o,locales:u,localeConfigs:d}}=(0,ce.Z)(),h=(0,fe.l)(),{search:p,hash:f}=(0,l.TH)(),g=[...n,...u.map((e=>{const n=`${`pathname://${h.createUrl({locale:e,fullyQualified:!1})}`}${p}${f}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===o?t?"menu__link--active":"dropdown__link--active":""}})),...i],m=t?(0,c.I)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[o].label;return r.createElement(pe,(0,a.Z)({},s,{mobile:t,label:r.createElement(r.Fragment,null,r.createElement(ge,{className:me}),m),items:g}))},search:function(e){let{mobile:t,className:n}=e;return t?null:r.createElement(ze,{className:n},r.createElement(He,null))},dropdown:pe,html:function(e){let{value:t,className:n,mobile:s=!1,isDropdownItem:o=!1}=e;const a=o?"li":"div";return r.createElement(a,{className:(0,i.Z)({navbar__item:!s&&!o,"menu__list-item":s},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:i,...s}=e;const{activeDoc:o}=(0,_e.Iw)(i),l=(0,Ve.vY)(t,i);return null===l?null:r.createElement(oe,(0,a.Z)({exact:!0},s,{isActive:()=>o?.path===l.path||!!o?.sidebar&&o.sidebar===l.sidebar,label:n??l.id,to:l.path}))},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:i,...s}=e;const{activeDoc:o}=(0,_e.Iw)(i),l=(0,Ve.oz)(t,i).link;if(!l)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return r.createElement(oe,(0,a.Z)({exact:!0},s,{isActive:()=>o?.sidebar===t,label:n??l.label,to:l.path}))},docsVersion:function(e){let{label:t,to:n,docsPluginId:i,...s}=e;const o=(0,Ve.lO)(i)[0],l=t??o.label,c=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(o).path;return r.createElement(oe,(0,a.Z)({},s,{label:l,to:c}))},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:i,dropdownItemsBefore:s,dropdownItemsAfter:o,...u}=e;const{search:d,hash:h}=(0,l.TH)(),p=(0,_e.Iw)(n),f=(0,_e.gB)(n),{savePreferredVersionName:g}=(0,Ee.J)(n),m=[...s,...f.map((e=>{const t=p.alternateDocVersions[e.name]??Ge(e);return{label:e.label,to:`${t.path}${d}${h}`,isActive:()=>e===p.activeVersion,onClick:()=>g(e.name)}})),...o],y=(0,Ve.lO)(n)[0],b=t&&m.length>1?(0,c.I)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):y.label,v=t&&m.length>1?void 0:Ge(y).path;return m.length<=1?r.createElement(oe,(0,a.Z)({},u,{mobile:t,label:b,to:v,isActive:i?()=>!1:void 0})):r.createElement(pe,(0,a.Z)({},u,{mobile:t,label:b,to:v,items:m,isActive:i?()=>!1:void 0}))}};function Ke(e){let{type:t,...n}=e;const i=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),s=We[i];if(!s)throw new Error(`No NavbarItem component found for type "${t}".`);return r.createElement(s,n)}function Ye(){const e=(0,O.e)(),t=(0,E.L)().navbar.items;return r.createElement("ul",{className:"menu__list"},t.map(((t,n)=>r.createElement(Ke,(0,a.Z)({mobile:!0},t,{onClick:()=>e.toggle(),key:n})))))}function Ze(e){return r.createElement("button",(0,a.Z)({},e,{type:"button",className:"clean-btn navbar-sidebar__back"}),r.createElement(c.Z,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"},"\u2190 Back to main menu"))}function qe(){const e=0===(0,E.L)().navbar.items.length,t=M();return r.createElement(r.Fragment,null,!e&&r.createElement(Ze,{onClick:()=>t.hide()}),t.content)}function Qe(){const e=(0,O.e)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?r.createElement(F,{header:r.createElement(q,null),primaryMenu:r.createElement(Ye,null),secondaryMenu:r.createElement(qe,null)}):null}const Xe={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function Je(e){return r.createElement("div",(0,a.Z)({role:"presentation"},e,{className:(0,i.Z)("navbar-sidebar__backdrop",e.className)}))}function et(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:s}}=(0,E.L)(),o=(0,O.e)(),{navbarRef:a,isNavbarVisible:l}=function(e){const[t,n]=(0,r.useState)(e),i=(0,r.useRef)(!1),s=(0,r.useRef)(0),o=(0,r.useCallback)((e=>{null!==e&&(s.current=e.getBoundingClientRect().height)}),[]);return(0,A.RF)(((t,r)=>{let{scrollY:o}=t;if(!e)return;if(o<s.current)return void n(!0);if(i.current)return void(i.current=!1);const a=r?.scrollY,l=document.documentElement.scrollHeight-s.current,c=window.innerHeight;a&&o>=a?n(!1):o+c<l&&n(!0)})),(0,u.S)((t=>{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return i.current=!0,void n(!1);n(!0)})),{navbarRef:o,isNavbarVisible:t}}(n);return r.createElement("nav",{ref:a,"aria-label":(0,c.I)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,i.Z)("navbar","navbar--fixed-top",n&&[Xe.navbarHideable,!l&&Xe.navbarHidden],{"navbar--dark":"dark"===s,"navbar--primary":"primary"===s,"navbar-sidebar--show":o.shown})},t,r.createElement(Je,{onClick:o.toggle}),r.createElement(Qe,null))}var tt=n(18780);const nt={errorBoundaryError:"errorBoundaryError_a6uf"};function rt(e){return r.createElement("button",(0,a.Z)({type:"button"},e),r.createElement(c.Z,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error"},"Try again"))}function it(e){let{error:t}=e;const n=(0,tt.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return r.createElement("p",{className:nt.errorBoundaryError},n)}class st extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const ot="right";function at(e){let{width:t=30,height:n=30,className:i,...s}=e;return r.createElement("svg",(0,a.Z)({className:i,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true"},s),r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"}))}function lt(){const{toggle:e,shown:t}=(0,O.e)();return r.createElement("button",{onClick:e,"aria-label":(0,c.I)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button"},r.createElement(at,null))}const ct={colorModeToggle:"colorModeToggle_DEke"};function ut(e){let{items:t}=e;return r.createElement(r.Fragment,null,t.map(((e,t)=>r.createElement(st,{key:t,onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t})},r.createElement(Ke,e)))))}function dt(e){let{left:t,right:n}=e;return r.createElement("div",{className:"navbar__inner"},r.createElement("div",{className:"navbar__items"},t),r.createElement("div",{className:"navbar__items navbar__items--right"},n))}function ht(){const e=(0,O.e)(),t=(0,E.L)().navbar.items,[n,i]=function(e){function t(e){return"left"===(e.position??ot)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),s=t.find((e=>"search"===e.type));return r.createElement(dt,{left:r.createElement(r.Fragment,null,!e.disabled&&r.createElement(lt,null),r.createElement(Y,null),r.createElement(ut,{items:n})),right:r.createElement(r.Fragment,null,r.createElement(ut,{items:i}),r.createElement(W,{className:ct.colorModeToggle}),!s&&r.createElement(ze,null,r.createElement(He,null)))})}function pt(){return r.createElement(et,null,r.createElement(ht,null))}function ft(e){let{item:t}=e;const{to:n,href:i,label:s,prependBaseUrlToHref:o,...l}=t,c=(0,X.Z)(n),u=(0,X.Z)(i,{forcePrependBaseUrl:!0});return r.createElement(Q.Z,(0,a.Z)({className:"footer__link-item"},i?{href:o?u:i}:{to:c},l),s,i&&!(0,J.Z)(i)&&r.createElement(te.Z,null))}function gt(e){let{item:t}=e;return t.html?r.createElement("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement("li",{key:t.href??t.to,className:"footer__item"},r.createElement(ft,{item:t}))}function mt(e){let{column:t}=e;return r.createElement("div",{className:"col footer__col"},r.createElement("div",{className:"footer__title"},t.title),r.createElement("ul",{className:"footer__items clean-list"},t.items.map(((e,t)=>r.createElement(gt,{key:t,item:e})))))}function yt(e){let{columns:t}=e;return r.createElement("div",{className:"row footer__links"},t.map(((e,t)=>r.createElement(mt,{key:t,column:e}))))}function bt(){return r.createElement("span",{className:"footer__link-separator"},"\xb7")}function vt(e){let{item:t}=e;return t.html?r.createElement("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement(ft,{item:t})}function Et(e){let{links:t}=e;return r.createElement("div",{className:"footer__links text--center"},r.createElement("div",{className:"footer__links"},t.map(((e,n)=>r.createElement(r.Fragment,{key:n},r.createElement(vt,{item:e}),t.length!==n+1&&r.createElement(bt,null))))))}function _t(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?r.createElement(yt,{columns:t}):r.createElement(Et,{links:t})}var Tt=n(50941);const xt={footerLogoLink:"footerLogoLink_BH7S"};function wt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,X.C)(),s={light:n(t.src),dark:n(t.srcDark??t.src)};return r.createElement(Tt.Z,{className:(0,i.Z)("footer__logo",t.className),alt:t.alt,sources:s,width:t.width,height:t.height,style:t.style})}function St(e){let{logo:t}=e;return t.href?r.createElement(Q.Z,{href:t.href,className:xt.footerLogoLink,target:t.target},r.createElement(wt,{logo:t})):r.createElement(wt,{logo:t})}function Rt(e){let{copyright:t}=e;return r.createElement("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function kt(e){let{style:t,links:n,logo:s,copyright:o}=e;return r.createElement("footer",{className:(0,i.Z)("footer",{"footer--dark":"dark"===t})},r.createElement("div",{className:"container container-fluid"},n,(s||o)&&r.createElement("div",{className:"footer__bottom text--center"},s&&r.createElement("div",{className:"margin-bottom--sm"},s),o)))}function Ct(){const{footer:e}=(0,E.L)();if(!e)return null;const{copyright:t,links:n,logo:i,style:s}=e;return r.createElement(kt,{style:s,links:n&&n.length>0&&r.createElement(_t,{links:n}),logo:i&&r.createElement(St,{logo:i}),copyright:t&&r.createElement(Rt,{copyright:t})})}const Ot=r.memo(Ct),At=(0,N.Qc)([U.S,_.pl,A.OC,Ee.L5,o.VC,function(e){let{children:t}=e;return r.createElement(I.n2,null,r.createElement(O.M,null,r.createElement(D,null,t)))}]);function Nt(e){let{children:t}=e;return r.createElement(At,null,t)}function It(e){let{error:t,tryAgain:n}=e;return r.createElement("main",{className:"container margin-vert--xl"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col col--6 col--offset-3"},r.createElement("h1",{className:"hero__title"},r.createElement(c.Z,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed"},"This page crashed.")),r.createElement("div",{className:"margin-vert--lg"},r.createElement(rt,{onClick:n,className:"button button--primary shadow--lw"})),r.createElement("hr",null),r.createElement("div",{className:"margin-vert--md"},r.createElement(it,{error:t})))))}const Lt={mainWrapper:"mainWrapper_z2l0"};function Dt(e){const{children:t,noFooter:n,wrapperClassName:a,title:l,description:c}=e;return(0,y.t)(),r.createElement(Nt,null,r.createElement(o.d,{title:l,description:c}),r.createElement(v,null),r.createElement(C,null),r.createElement(pt,null),r.createElement("div",{id:d,className:(0,i.Z)(m.k.wrapper.main,Lt.mainWrapper,a)},r.createElement(s.Z,{fallback:e=>r.createElement(It,e)},t)),!n&&r.createElement(Ot,null))}},21327:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(87462),i=n(67294),s=n(39960),o=n(44996),a=n(52263),l=n(86668),c=n(50941);function u(e){let{logo:t,alt:n,imageClassName:r}=e;const s={light:(0,o.Z)(t.src),dark:(0,o.Z)(t.srcDark||t.src)},a=i.createElement(c.Z,{className:t.className,sources:s,height:t.height,width:t.width,alt:n,style:t.style});return r?i.createElement("div",{className:r},a):a}function d(e){const{siteConfig:{title:t}}=(0,a.Z)(),{navbar:{title:n,logo:c}}=(0,l.L)(),{imageClassName:d,titleClassName:h,...p}=e,f=(0,o.Z)(c?.href||"/"),g=n?"":t,m=c?.alt??g;return i.createElement(s.Z,(0,r.Z)({to:f},p,c?.target&&{target:c.target}),c&&i.createElement(u,{logo:c,alt:m,imageClassName:d}),null!=n&&i.createElement("b",{className:h},n))}},90197:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(67294),i=n(35742);function s(e){let{locale:t,version:n,tag:s}=e;const o=t;return r.createElement(i.Z,null,t&&r.createElement("meta",{name:"docusaurus_locale",content:t}),n&&r.createElement("meta",{name:"docusaurus_version",content:n}),s&&r.createElement("meta",{name:"docusaurus_tag",content:s}),o&&r.createElement("meta",{name:"docsearch:language",content:o}),n&&r.createElement("meta",{name:"docsearch:version",content:n}),s&&r.createElement("meta",{name:"docsearch:docusaurus_tag",content:s}))}},50941:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(87462),i=n(67294),s=n(34334),o=n(72389),a=n(92949);const l={themedImage:"themedImage_ToTc","themedImage--light":"themedImage--light_HNdA","themedImage--dark":"themedImage--dark_i4oU"};function c(e){const t=(0,o.Z)(),{colorMode:n}=(0,a.I)(),{sources:c,className:u,alt:d,...h}=e,p=t?"dark"===n?["dark"]:["light"]:["light","dark"];return i.createElement(i.Fragment,null,p.map((e=>i.createElement("img",(0,r.Z)({key:e,src:c[e],alt:d,className:(0,s.Z)(l.themedImage,l[`themedImage--${e}`],u)},h)))))}},86043:(e,t,n)=>{"use strict";n.d(t,{u:()=>l,z:()=>m});var r=n(87462),i=n(67294),s=n(10412),o=n(91442);const a="ease-in-out";function l(e){let{initialState:t}=e;const[n,r]=(0,i.useState)(t??!1),s=(0,i.useCallback)((()=>{r((e=>!e))}),[]);return{collapsed:n,setCollapsed:r,toggleCollapsed:s}}const c={display:"none",overflow:"hidden",height:"0px"},u={display:"block",overflow:"visible",height:"auto"};function d(e,t){const n=t?c:u;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function h(e){let{collapsibleRef:t,collapsed:n,animation:r}=e;const s=(0,i.useRef)(!1);(0,i.useEffect)((()=>{const e=t.current;function i(){const t=e.scrollHeight,n=r?.duration??function(e){if((0,o.n)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${r?.easing??a}`,height:`${t}px`}}function l(){const t=i();e.style.transition=t.transition,e.style.height=t.height}if(!s.current)return d(e,n),void(s.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(l(),requestAnimationFrame((()=>{e.style.height=c.height,e.style.overflow=c.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{l()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,r])}function p(e){if(!s.Z.canUseDOM)return e?c:u}function f(e){let{as:t="div",collapsed:n,children:r,animation:s,onCollapseTransitionEnd:o,className:a,disableSSRStyle:l}=e;const c=(0,i.useRef)(null);return h({collapsibleRef:c,collapsed:n,animation:s}),i.createElement(t,{ref:c,style:l?void 0:p(n),onTransitionEnd:e=>{"height"===e.propertyName&&(d(c.current,n),o?.(n))},className:a},r)}function g(e){let{collapsed:t,...n}=e;const[s,o]=(0,i.useState)(!t),[a,l]=(0,i.useState)(t);return(0,i.useLayoutEffect)((()=>{t||o(!0)}),[t]),(0,i.useLayoutEffect)((()=>{s&&l(t)}),[s,t]),s?i.createElement(f,(0,r.Z)({},n,{collapsed:a})):null}function m(e){let{lazy:t,...n}=e;const r=t?g:f;return i.createElement(r,n)}},59689:(e,t,n)=>{"use strict";n.d(t,{nT:()=>f,pl:()=>p});var r=n(67294),i=n(72389),s=n(50012),o=n(902),a=n(86668);const l=(0,s.WA)("docusaurus.announcement.dismiss"),c=(0,s.WA)("docusaurus.announcement.id"),u=()=>"true"===l.get(),d=e=>l.set(String(e)),h=r.createContext(null);function p(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,a.L)(),t=(0,i.Z)(),[n,s]=(0,r.useState)((()=>!!t&&u()));(0,r.useEffect)((()=>{s(u())}),[]);const o=(0,r.useCallback)((()=>{d(!0),s(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=c.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;c.set(t),r&&d(!1),!r&&u()||s(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:o})),[e,n,o])}();return r.createElement(h.Provider,{value:n},t)}function f(){const e=(0,r.useContext)(h);if(!e)throw new o.i6("AnnouncementBarProvider");return e}},92949:(e,t,n)=>{"use strict";n.d(t,{I:()=>m,S:()=>g});var r=n(67294),i=n(10412),s=n(902),o=n(50012),a=n(86668);const l=r.createContext(void 0),c="theme",u=(0,o.WA)(c),d={light:"light",dark:"dark"},h=e=>e===d.dark?d.dark:d.light,p=e=>i.Z.canUseDOM?h(document.documentElement.getAttribute("data-theme")):h(e),f=e=>{u.set(h(e))};function g(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,a.L)(),[i,s]=(0,r.useState)(p(e));(0,r.useEffect)((()=>{t&&u.del()}),[t]);const o=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:i=!0}=r;t?(s(t),i&&f(t)):(s(n?window.matchMedia("(prefers-color-scheme: dark)").matches?d.dark:d.light:e),u.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",h(i))}),[i]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==c)return;const t=u.get();null!==t&&o(h(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,o]);const l=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||l.current?l.current=window.matchMedia("print").matches:o(null)};return e.addListener(r),()=>e.removeListener(r)}),[o,t,n]),(0,r.useMemo)((()=>({colorMode:i,setColorMode:o,get isDarkTheme(){return i===d.dark},setLightTheme(){o(d.light)},setDarkTheme(){o(d.dark)}})),[i,o])}();return r.createElement(l.Provider,{value:n},t)}function m(){const e=(0,r.useContext)(l);if(null==e)throw new s.i6("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},60373:(e,t,n)=>{"use strict";n.d(t,{J:()=>b,L5:()=>m});var r=n(67294),i=n(80143),s=n(29935),o=n(86668),a=n(53438),l=n(902),c=n(50012);const u=e=>`docs-preferred-version-${e}`,d={save:(e,t,n)=>{(0,c.WA)(u(e),{persistence:t}).set(n)},read:(e,t)=>(0,c.WA)(u(e),{persistence:t}).get(),clear:(e,t)=>{(0,c.WA)(u(e),{persistence:t}).del()}},h=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const p=r.createContext(null);function f(){const e=(0,i._r)(),t=(0,o.L)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[s,a]=(0,r.useState)((()=>h(n)));(0,r.useEffect)((()=>{a(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function i(e){const t=d.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(d.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,i(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[s,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){d.save(e,t,n),a((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function g(e){let{children:t}=e;const n=f();return r.createElement(p.Provider,{value:n},t)}function m(e){let{children:t}=e;return a.cE?r.createElement(g,null,t):r.createElement(r.Fragment,null,t)}function y(){const e=(0,r.useContext)(p);if(!e)throw new l.i6("DocsPreferredVersionContextProvider");return e}function b(e){void 0===e&&(e=s.m);const t=(0,i.zh)(e),[n,o]=y(),{preferredVersionName:a}=n[e];return{preferredVersion:t.versions.find((e=>e.name===a))??null,savePreferredVersionName:(0,r.useCallback)((t=>{o.savePreferredVersion(e,t)}),[o,e])}}},1116:(e,t,n)=>{"use strict";n.d(t,{V:()=>l,b:()=>a});var r=n(67294),i=n(902);const s=Symbol("EmptyContext"),o=r.createContext(s);function a(e){let{children:t,name:n,items:i}=e;const s=(0,r.useMemo)((()=>n&&i?{name:n,items:i}:null),[n,i]);return r.createElement(o.Provider,{value:s},t)}function l(){const e=(0,r.useContext)(o);if(e===s)throw new i.i6("DocsSidebarProvider");return e}},93163:(e,t,n)=>{"use strict";n.d(t,{M:()=>d,e:()=>h});var r=n(67294),i=n(13102),s=n(87524),o=n(91980),a=n(86668),l=n(902);const c=r.createContext(void 0);function u(){const e=function(){const e=(0,i.HY)(),{items:t}=(0,a.L)().navbar;return 0===t.length&&!e.component}(),t=(0,s.i)(),n=!e&&"mobile"===t,[l,c]=(0,r.useState)(!1);(0,o.Rb)((()=>{if(l)return c(!1),!1}));const u=(0,r.useCallback)((()=>{c((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&c(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:l})),[e,n,u,l])}function d(e){let{children:t}=e;const n=u();return r.createElement(c.Provider,{value:n},t)}function h(){const e=r.useContext(c);if(void 0===e)throw new l.i6("NavbarMobileSidebarProvider");return e}},13102:(e,t,n)=>{"use strict";n.d(t,{HY:()=>a,Zo:()=>l,n2:()=>o});var r=n(67294),i=n(902);const s=r.createContext(null);function o(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return r.createElement(s.Provider,{value:n},t)}function a(){const e=(0,r.useContext)(s);if(!e)throw new i.i6("NavbarSecondaryMenuContentProvider");return e[0]}function l(e){let{component:t,props:n}=e;const o=(0,r.useContext)(s);if(!o)throw new i.i6("NavbarSecondaryMenuContentProvider");const[,a]=o,l=(0,i.Ql)(n);return(0,r.useEffect)((()=>{a({component:t,props:l})}),[a,t,l]),(0,r.useEffect)((()=>()=>a({component:null,props:null})),[a]),null}},19727:(e,t,n)=>{"use strict";n.d(t,{h:()=>i,t:()=>s});var r=n(67294);const i="navigation-with-keyboard";function s(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(i),"mousedown"===e.type&&document.body.classList.remove(i)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(i),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},87524:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var r=n(67294),i=n(10412);const s={desktop:"desktop",mobile:"mobile",ssr:"ssr"},o=996;function a(){return i.Z.canUseDOM?window.innerWidth>o?s.desktop:s.mobile:s.ssr}const l=!1;function c(){const[e,t]=(0,r.useState)((()=>l?"ssr":a()));return(0,r.useEffect)((()=>{function e(){t(a())}const n=l?window.setTimeout(e,1e3):void 0;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),clearTimeout(n)}}),[]),e}},35281:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{}}},91442:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{n:()=>r})},53438:(e,t,n)=>{"use strict";n.d(t,{Wl:()=>h,_F:()=>g,cE:()=>d,hI:()=>_,lO:()=>b,oz:()=>v,s1:()=>y,vY:()=>E});var r=n(67294),i=n(16550),s=n(18790),o=n(80143),a=n(60373),l=n(1116),c=n(67392),u=n(48596);const d=!!o._r;function h(e){if(e.href)return e.href;for(const t of e.items){if("link"===t.type)return t.href;if("category"===t.type){const e=h(t);if(e)return e}}}const p=(e,t)=>void 0!==e&&(0,u.Mg)(e,t),f=(e,t)=>e.some((e=>g(e,t)));function g(e,t){return"link"===e.type?p(e.href,t):"category"===e.type&&(p(e.href,t)||f(e.items,t))}function m(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const i=[];return function e(t){for(const s of t)if("category"===s.type&&((0,u.Mg)(s.href,n)||e(s.items))||"link"===s.type&&(0,u.Mg)(s.href,n)){return r&&"category"!==s.type||i.unshift(s),!0}return!1}(t),i}function y(){const e=(0,l.V)(),{pathname:t}=(0,i.TH)(),n=(0,o.gA)()?.pluginData.breadcrumbs;return!1!==n&&e?m({sidebarItems:e.items,pathname:t}):null}function b(e){const{activeVersion:t}=(0,o.Iw)(e),{preferredVersion:n}=(0,a.J)(e),i=(0,o.yW)(e);return(0,r.useMemo)((()=>(0,c.j)([t,n,i].filter(Boolean))),[t,n,i])}function v(e,t){const n=b(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function E(e,t){const n=b(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${(0,c.j)(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function _(e){let{route:t,versionMetadata:n}=e;const r=(0,i.TH)(),o=t.routes,a=o.find((e=>(0,i.LX)(r.pathname,e)));if(!a)return null;const l=a.sidebar,c=l?n.docsSidebars[l]:void 0;return{docElement:(0,s.H)(o),sidebarName:l,sidebarItems:c}}},91980:(e,t,n)=>{"use strict";n.d(t,{Rb:()=>a,_X:()=>l});var r=n(67294),i=n(16550),s=n(61688),o=n(902);function a(e){!function(e){const t=(0,i.k6)(),n=(0,o.zX)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}function l(e){return function(e){const t=(0,i.k6)();return(0,s.useSyncExternalStore)(t.listen,(()=>e(t)),(()=>e(t)))}((t=>null===e?null:new URLSearchParams(t.location.search).get(e)))}},67392:(e,t,n)=>{"use strict";function r(e,t){return void 0===t&&(t=(e,t)=>e===t),e.filter(((n,r)=>e.findIndex((e=>t(e,n)))!==r))}function i(e){return Array.from(new Set(e))}n.d(t,{j:()=>i,l:()=>r})},1944:(e,t,n)=>{"use strict";n.d(t,{FG:()=>h,d:()=>u,VC:()=>p});var r=n(67294),i=n(87459),s=n(35742),o=n(30226);function a(){const e=r.useContext(o._);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var l=n(44996),c=n(52263);function u(e){let{title:t,description:n,keywords:i,image:o,children:a}=e;const u=function(e){const{siteConfig:t}=(0,c.Z)(),{title:n,titleDelimiter:r}=t;return e?.trim().length?`${e.trim()} ${r} ${n}`:n}(t),{withBaseUrl:d}=(0,l.C)(),h=o?d(o,{absolute:!0}):void 0;return r.createElement(s.Z,null,t&&r.createElement("title",null,u),t&&r.createElement("meta",{property:"og:title",content:u}),n&&r.createElement("meta",{name:"description",content:n}),n&&r.createElement("meta",{property:"og:description",content:n}),i&&r.createElement("meta",{name:"keywords",content:Array.isArray(i)?i.join(","):i}),h&&r.createElement("meta",{property:"og:image",content:h}),h&&r.createElement("meta",{name:"twitter:image",content:h}),a)}const d=r.createContext(void 0);function h(e){let{className:t,children:n}=e;const o=r.useContext(d),a=(0,i.Z)(o,t);return r.createElement(d.Provider,{value:a},r.createElement(s.Z,null,r.createElement("html",{className:a})),n)}function p(e){let{children:t}=e;const n=a(),s=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const o=`plugin-id-${n.plugin.id}`;return r.createElement(h,{className:(0,i.Z)(s,o)},t)}},902:(e,t,n)=>{"use strict";n.d(t,{D9:()=>o,Qc:()=>c,Ql:()=>l,i6:()=>a,zX:()=>s});var r=n(67294);const i=n(10412).Z.canUseDOM?r.useLayoutEffect:r.useEffect;function s(e){const t=(0,r.useRef)(e);return i((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function o(e){const t=(0,r.useRef)();return i((()=>{t.current=e})),t.current}class a extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?<name>\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function l(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function c(e){return t=>{let{children:n}=t;return r.createElement(r.Fragment,null,e.reduceRight(((e,t)=>r.createElement(t,null,e)),n))}}},48596:(e,t,n)=>{"use strict";n.d(t,{Mg:()=>o,Ns:()=>a});var r=n(67294),i=n(723),s=n(52263);function o(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function a(){const{baseUrl:e}=(0,s.Z)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function i(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(i).flatMap((e=>e.routes??[])))}(n)}({routes:i.Z,baseUrl:e})),[e])}},12466:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>p,OC:()=>l,RF:()=>d,o5:()=>h});var r=n(67294),i=n(10412),s=n(72389),o=n(902);const a=r.createContext(void 0);function l(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return r.createElement(a.Provider,{value:n},t)}function c(){const e=(0,r.useContext)(a);if(null==e)throw new o.i6("ScrollControllerProvider");return e}const u=()=>i.Z.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function d(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=c(),i=(0,r.useRef)(u()),s=(0,o.zX)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=u();s(e,i.current),i.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[s,n,...t])}function h(){const e=c(),t=function(){const e=(0,r.useRef)({elem:null,top:0}),t=(0,r.useCallback)((t=>{e.current={elem:t,top:t.getBoundingClientRect().top}}),[]),n=(0,r.useCallback)((()=>{const{current:{elem:t,top:n}}=e;if(!t)return{restored:!1};const r=t.getBoundingClientRect().top-n;return r&&window.scrollBy({left:0,top:r}),e.current={elem:null,top:0},{restored:0!==r}}),[]);return(0,r.useMemo)((()=>({save:t,restore:n})),[n,t])}(),n=(0,r.useRef)(void 0),i=(0,r.useCallback)((r=>{t.save(r),e.disableScrollEvents(),n.current=()=>{const{restored:r}=t.restore();if(n.current=void 0,r){const t=()=>{e.enableScrollEvents(),window.removeEventListener("scroll",t)};window.addEventListener("scroll",t)}else e.enableScrollEvents()}}),[e,t]);return(0,r.useLayoutEffect)((()=>{queueMicrotask((()=>n.current?.()))})),{blockElementScrollPositionUntilNextRender:i}}function p(){const e=(0,r.useRef)(null),t=(0,s.Z)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const i=document.documentElement.scrollTop;(n&&i>e||!n&&i<e)&&(t=requestAnimationFrame(r),window.scrollTo(0,Math.floor(.85*(i-e))+e))}(),()=>t&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},43320:(e,t,n)=>{"use strict";n.d(t,{HX:()=>r,os:()=>i});n(52263);const r="default";function i(e,t){return`docs-${e}-${t}`}},50012:(e,t,n)=>{"use strict";n.d(t,{Nk:()=>d,WA:()=>u});var r=n(67294),i=n(61688);const s="localStorage";function o(e){let{key:t,oldValue:n,newValue:r,storage:i}=e;if(n===r)return;const s=document.createEvent("StorageEvent");s.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,i),window.dispatchEvent(s)}function a(e){if(void 0===e&&(e=s),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,l||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),l=!0),null}var t}let l=!1;const c={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function u(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(e);const n=a(t?.persistence);return null===n?c:{get:()=>{try{return n.getItem(e)}catch(t){return console.error(`Docusaurus storage error, can't get key=${e}`,t),null}},set:t=>{try{const r=n.getItem(e);n.setItem(e,t),o({key:e,oldValue:r,newValue:t,storage:n})}catch(r){console.error(`Docusaurus storage error, can't set ${e}=${t}`,r)}},del:()=>{try{const t=n.getItem(e);n.removeItem(e),o({key:e,oldValue:t,newValue:null,storage:n})}catch(t){console.error(`Docusaurus storage error, can't delete key=${e}`,t)}},listen:t=>{try{const r=r=>{r.storageArea===n&&r.key===e&&t(r)};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)}catch(r){return console.error(`Docusaurus storage error, can't listen for changes of key=${e}`,r),()=>{}}}}}function d(e,t){const n=(0,r.useRef)((()=>null===e?c:u(e,t))).current(),s=(0,r.useCallback)((e=>"undefined"==typeof window?()=>{}:n.listen(e)),[n]);return[(0,i.useSyncExternalStore)(s,(()=>"undefined"==typeof window?null:n.get()),(()=>null)),n]}},94711:(e,t,n)=>{"use strict";n.d(t,{l:()=>o});var r=n(52263),i=n(16550),s=n(18780);function o(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:o,currentLocale:a}}=(0,r.Z)(),{pathname:l}=(0,i.TH)(),c=(0,s.applyTrailingSlash)(l,{trailingSlash:n,baseUrl:e}),u=a===o?e:e.replace(`/${a}/`,"/"),d=c.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===o?`${u}`:`${u}${e}/`}(n)}${d}`}}}},85936:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var r=n(67294),i=n(16550),s=n(902);function o(e){const t=(0,i.TH)(),n=(0,s.D9)(t),o=(0,s.zX)(e);(0,r.useEffect)((()=>{n&&t!==n&&o({location:t,previousLocation:n})}),[o,t,n])}},86668:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});var r=n(52263);function i(){return(0,r.Z)().siteConfig.themeConfig}},8802:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[i]=e.split(/[#?]/),s="/"===i||i===r?i:(o=i,n?function(e){return e.endsWith("/")?e:`${e}/`}(o):function(e){return e.endsWith("/")?e.slice(0,-1):e}(o));var o;return e.replace(i,s)}},54143:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t,...e(t.cause)]:[t]}},18780:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var i=n(8802);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(i).default}});var s=n(54143);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return s.getErrorCausalChain}})},80311:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(67294),i=n(1728);const s={loadingRing:"loadingRing_RJI3","loading-ring":"loading-ring_FB5o"};function o(e){let{className:t}=e;return r.createElement("div",{className:(0,i.Z)(s.loadingRing,t)},r.createElement("div",null),r.createElement("div",null),r.createElement("div",null),r.createElement("div",null))}},90022:(e,t,n)=>{"use strict";n.d(t,{w:()=>a});var r=n(31336),i=n.n(r),s=n(61029);const o=new Map;function a(e,t){const n=`${e}${t}`;let r=o.get(n);return r||(r=async function(e,t){{const n=`${e}${s.J.replace("{dir}",t?`-${t.replace(/\//g,"-")}`:"")}`;if(new URL(n,location.origin).origin!==location.origin)throw new Error("Unexpected version url");const r=await(await fetch(n)).json(),o=r.map(((e,t)=>{let{documents:n,index:r}=e;return{type:t,documents:n,index:i().Index.load(r)}})),a=r.reduce(((e,t)=>{for(const n of t.index.invertedIndex)/\p{Unified_Ideograph}/u.test(n[0][0])&&e.add(n[0]);return e}),new Set);return{wrappedIndexes:o,zhDictionary:Array.from(a)}}return{wrappedIndexes:[],zhDictionary:[]}}(e,t),o.set(n,r)),r}},98202:(e,t,n)=>{"use strict";n.d(t,{v:()=>l});var r=n(31336),i=n.n(r);var s=n(61029);function o(e){return a(e).concat(a(e.filter((e=>{const t=e[e.length-1];return!t.trailing&&t.maybeTyping})),!0))}function a(e,t){return e.map((e=>({tokens:e.map((e=>e.value)),term:e.map((e=>({value:e.value,presence:i().Query.presence.REQUIRED,wildcard:(t?e.trailing||e.maybeTyping:e.trailing)?i().Query.wildcard.TRAILING:i().Query.wildcard.NONE})))})))}function l(e,t,n){return function(r,a){const l=function(e,t){if(1===t.length&&["ja","jp","th"].includes(t[0]))return i()[t[0]].tokenizer(e).map((e=>e.toString()));let n=/[^-\s]+/g;return t.includes("zh")&&(n=/\w+|\p{Unified_Ideograph}+/gu),e.toLowerCase().match(n)||[]}(r,s.dK);if(0===l.length)return void a([]);const c=function(e,t){const n=function(e,t){const n=[];return function e(r,i){if(0===r.length)return void n.push(i);const s=r[0];if(/\p{Unified_Ideograph}/u.test(s)){const n=function(e,t){const n=[];return function e(r,i){let s=0,o=!1;for(const a of t)if(r.substr(0,a.length)===a){const t={missed:i.missed,term:i.term.concat({value:a})};r.length>a.length?e(r.substr(a.length),t):n.push(t),o=!0}else for(let t=a.length-1;t>s;t-=1){const l=a.substr(0,t);if(r.substr(0,t)===l){s=t;const a={missed:i.missed,term:i.term.concat({value:l,trailing:!0})};r.length>t?e(r.substr(t),a):n.push(a),o=!0;break}}o||(r.length>0?e(r.substr(1),{missed:i.missed+1,term:i.term}):i.term.length>0&&n.push(i))}(e,{missed:0,term:[]}),n.sort(((e,t)=>{const n=e.missed>0?1:0,r=t.missed>0?1:0;return n!==r?n-r:e.term.length-t.term.length})).map((e=>e.term))}(s,t);for(const t of n){const n=i.concat(...t);e(r.slice(1),n)}}else{const t=i.concat({value:s});e(r.slice(1),t)}}(e,[]),n}(e,t);if(0===n.length)return[{tokens:e,term:e.map((e=>({value:e,presence:i().Query.presence.REQUIRED,wildcard:i().Query.wildcard.LEADING|i().Query.wildcard.TRAILING})))}];for(const i of n)i[i.length-1].maybeTyping=!0;const r=[];for(const o of s.dK)if("en"===o)s._k||r.unshift(i().stopWordFilter);else{const e=i()[o];e.stopWordFilter&&r.unshift(e.stopWordFilter)}let a;if(r.length>0){const e=e=>r.reduce(((e,t)=>e.filter((e=>t(e.value)))),e);a=[];const t=[];for(const r of n){const n=e(r);a.push(n),n.length<r.length&&n.length>0&&t.push(n)}n.push(...t)}else a=n.slice();const l=[];for(const i of a)if(i.length>2)for(let e=i.length-1;e>=0;e-=1)l.push(i.slice(0,e).concat(i.slice(e+1)));return o(n).concat(o(l))}(l,t),u=[];e:for(const{term:t,tokens:i}of c)for(const{documents:r,index:s,type:o}of e)if(u.push(...s.query((e=>{for(const n of t)e.term(n.value,{wildcard:n.wildcard,presence:n.presence})})).slice(0,n).filter((e=>!u.some((t=>t.document.i.toString()===e.ref)))).slice(0,n-u.length).map((t=>{const n=r.find((e=>e.i.toString()===t.ref));return{document:n,type:o,page:0!==o&&e[0].documents.find((e=>e.i===n.p)),metadata:t.matchData.metadata,tokens:i,score:t.score}}))),u.length>=n)break e;!function(e){e.forEach(((e,t)=>{e.index=t})),e.sort(((t,n)=>{let r=t.type>0&&t.page?e.findIndex((e=>e.document===t.page)):t.index,i=n.type>0&&n.page?e.findIndex((e=>e.document===n.page)):n.index;return-1===r&&(r=t.index),-1===i&&(i=n.index),r===i?0===t.type?-1:0===n.type?1:t.index-n.index:r-i}))}(u),function(e){e.forEach(((t,n)=>{n>0&&t.page&&e.some((e=>e.document===t.page))&&(n<e.length-1&&e[n+1].page===t.page?t.isInterOfTree=!0:t.isLastOfTree=!0)}))}(u),a(u)}}},73926:(e,t,n)=>{"use strict";function r(e){return e.join(" \u203a ")}n.d(t,{e:()=>r})},21690:(e,t,n)=>{"use strict";function r(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}n.d(t,{X:()=>r})},91073:(e,t,n)=>{"use strict";function r(e,t){const n=[];for(const r of Object.values(e))r[t]&&n.push(...r[t].position);return n.sort(((e,t)=>e[0]-t[0]||t[1]-e[1]))}n.d(t,{m:()=>r})},82539:(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var r=n(21690);function i(e,t,n){const s=[];for(const o of t){const n=e.toLowerCase().indexOf(o);if(n>=0){n>0&&s.push(i(e.substr(0,n),t)),s.push(`<mark>${(0,r.X)(e.substr(n,o.length))}</mark>`);const a=n+o.length;a<e.length&&s.push(i(e.substr(a),t));break}}return 0===s.length?n?`<mark>${(0,r.X)(e)}</mark>`:(0,r.X)(e):s.join("")}},10726:(e,t,n)=>{"use strict";n.d(t,{o:()=>l});var r=n(21690),i=n(82539);const s=/\w+|\p{Unified_Ideograph}/u;function o(e){const t=[];let n=0,r=e;for(;r.length>0;){const i=r.match(s);if(!i){t.push(r);break}i.index>0&&t.push(r.substring(0,i.index)),t.push(i[0]),n+=i.index+i[0].length,r=e.substring(n)}return t}var a=n(61029);function l(e,t,n,s){void 0===s&&(s=a.Hk);const{chunkIndex:l,chunks:c}=function(e,t,n){const s=[];let a=0,l=0,c=-1;for(;a<t.length;){const[u,d]=t[a];if(a+=1,!(u<l)){if(u>l){const t=o(e.substring(l,u)).map((e=>({html:(0,r.X)(e),textLength:e.length})));for(const e of t)s.push(e)}-1===c&&(c=s.length),l=u+d,s.push({html:(0,i.C)(e.substring(u,l),n,!0),textLength:d})}}if(l<e.length){const t=o(e.substring(l)).map((e=>({html:(0,r.X)(e),textLength:e.length})));for(const e of t)s.push(e)}return{chunkIndex:c,chunks:s}}(e,t,n),u=c.slice(0,l),d=c[l],h=[d.html],p=c.slice(l+1);let f=d.textLength,g=0,m=0,y=!1,b=!1;for(;f<s;)if((g<=m||0===p.length)&&u.length>0){const e=u.pop();f+e.textLength<=s?(h.unshift(e.html),g+=e.textLength,f+=e.textLength):(y=!0,u.length=0)}else{if(!(p.length>0))break;{const e=p.shift();f+e.textLength<=s?(h.push(e.html),m+=e.textLength,f+=e.textLength):(b=!0,p.length=0)}}return(y||u.length>0)&&h.unshift("\u2026"),(b||p.length>0)&&h.push("\u2026"),h.join("")}},61029:(e,t,n)=>{"use strict";n.d(t,{vc:()=>s,gQ:()=>p,H6:()=>c,hG:()=>m,l9:()=>f,dK:()=>r,_k:()=>i,pu:()=>h,AY:()=>u,t_:()=>d,Kc:()=>g,J:()=>o,Hk:()=>l,qo:()=>a,pQ:()=>y});n(31336);const r=["en"],i=!1,s=null,o="search-index{dir}.json?_=3988ea9f",a=8,l=50,c=!1,u=!0,d=!0,h="right",p=void 0,f=!0,g=null,m=!1,y=!1},99318:(e,t,n)=>{"use strict";n.d(t,{lX:()=>E,q_:()=>R,ob:()=>p,PP:()=>C,Ep:()=>h});var r=n(87462);function i(e){return"/"===e.charAt(0)}function s(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}const o=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],o=t&&t.split("/")||[],a=e&&i(e),l=t&&i(t),c=a||l;if(e&&i(e)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";if(o.length){var u=o[o.length-1];n="."===u||".."===u||""===u}else n=!1;for(var d=0,h=o.length;h>=0;h--){var p=o[h];"."===p?s(o,h):".."===p?(s(o,h),d++):d&&(s(o,h),d--)}if(!c)for(;d--;d)o.unshift("..");!c||""===o[0]||o[0]&&i(o[0])||o.unshift("");var f=o.join("/");return n&&"/"!==f.substr(-1)&&(f+="/"),f};var a=n(38776);function l(e){return"/"===e.charAt(0)?e:"/"+e}function c(e){return"/"===e.charAt(0)?e.substr(1):e}function u(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function h(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function p(e,t,n,i){var s;"string"==typeof e?(s=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var s=t.indexOf("?");return-1!==s&&(n=t.substr(s),t=t.substr(0,s)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),s.state=t):(void 0===(s=(0,r.Z)({},e)).pathname&&(s.pathname=""),s.search?"?"!==s.search.charAt(0)&&(s.search="?"+s.search):s.search="",s.hash?"#"!==s.hash.charAt(0)&&(s.hash="#"+s.hash):s.hash="",void 0!==t&&void 0===s.state&&(s.state=t));try{s.pathname=decodeURI(s.pathname)}catch(a){throw a instanceof URIError?new URIError('Pathname "'+s.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):a}return n&&(s.key=n),i?s.pathname?"/"!==s.pathname.charAt(0)&&(s.pathname=o(s.pathname,i.pathname)):s.pathname=i.pathname:s.pathname||(s.pathname="/"),s}function f(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var s="function"==typeof e?e(t,n):e;"string"==typeof s?"function"==typeof r?r(s,i):i(!0):i(!1!==s)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var g=!("undefined"==typeof window||!window.document||!window.document.createElement);function m(e,t){t(window.confirm(e))}var y="popstate",b="hashchange";function v(){try{return window.history.state||{}}catch(e){return{}}}function E(e){void 0===e&&(e={}),g||(0,a.Z)(!1);var t,n=window.history,i=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,s=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,c=o.forceRefresh,E=void 0!==c&&c,_=o.getUserConfirmation,T=void 0===_?m:_,x=o.keyLength,w=void 0===x?6:x,S=e.basename?d(l(e.basename)):"";function R(e){var t=e||{},n=t.key,r=t.state,i=window.location,s=i.pathname+i.search+i.hash;return S&&(s=u(s,S)),p(s,r,n)}function k(){return Math.random().toString(36).substr(2,w)}var C=f();function O(e){(0,r.Z)(H,e),H.length=n.length,C.notifyListeners(H.location,H.action)}function A(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||L(R(e.state))}function N(){L(R(v()))}var I=!1;function L(e){if(I)I=!1,O();else{C.confirmTransitionTo(e,"POP",T,(function(t){t?O({action:"POP",location:e}):function(e){var t=H.location,n=P.indexOf(t.key);-1===n&&(n=0);var r=P.indexOf(e.key);-1===r&&(r=0);var i=n-r;i&&(I=!0,F(i))}(e)}))}}var D=R(v()),P=[D.key];function M(e){return S+h(e)}function F(e){n.go(e)}var U=0;function j(e){1===(U+=e)&&1===e?(window.addEventListener(y,A),s&&window.addEventListener(b,N)):0===U&&(window.removeEventListener(y,A),s&&window.removeEventListener(b,N))}var B=!1;var H={length:n.length,action:"POP",location:D,createHref:M,push:function(e,t){var r="PUSH",s=p(e,t,k(),H.location);C.confirmTransitionTo(s,r,T,(function(e){if(e){var t=M(s),o=s.key,a=s.state;if(i)if(n.pushState({key:o,state:a},null,t),E)window.location.href=t;else{var l=P.indexOf(H.location.key),c=P.slice(0,l+1);c.push(s.key),P=c,O({action:r,location:s})}else window.location.href=t}}))},replace:function(e,t){var r="REPLACE",s=p(e,t,k(),H.location);C.confirmTransitionTo(s,r,T,(function(e){if(e){var t=M(s),o=s.key,a=s.state;if(i)if(n.replaceState({key:o,state:a},null,t),E)window.location.replace(t);else{var l=P.indexOf(H.location.key);-1!==l&&(P[l]=s.key),O({action:r,location:s})}else window.location.replace(t)}}))},go:F,goBack:function(){F(-1)},goForward:function(){F(1)},block:function(e){void 0===e&&(e=!1);var t=C.setPrompt(e);return B||(j(1),B=!0),function(){return B&&(B=!1,j(-1)),t()}},listen:function(e){var t=C.appendListener(e);return j(1),function(){j(-1),t()}}};return H}var _="hashchange",T={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+c(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:c,decodePath:l},slash:{encodePath:l,decodePath:l}};function x(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function w(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function S(e){window.location.replace(x(window.location.href)+"#"+e)}function R(e){void 0===e&&(e={}),g||(0,a.Z)(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),i=n.getUserConfirmation,s=void 0===i?m:i,o=n.hashType,c=void 0===o?"slash":o,y=e.basename?d(l(e.basename)):"",b=T[c],v=b.encodePath,E=b.decodePath;function R(){var e=E(w());return y&&(e=u(e,y)),p(e)}var k=f();function C(e){(0,r.Z)(B,e),B.length=t.length,k.notifyListeners(B.location,B.action)}var O=!1,A=null;function N(){var e,t,n=w(),r=v(n);if(n!==r)S(r);else{var i=R(),o=B.location;if(!O&&(t=i,(e=o).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(A===h(i))return;A=null,function(e){if(O)O=!1,C();else{var t="POP";k.confirmTransitionTo(e,t,s,(function(n){n?C({action:t,location:e}):function(e){var t=B.location,n=P.lastIndexOf(h(t));-1===n&&(n=0);var r=P.lastIndexOf(h(e));-1===r&&(r=0);var i=n-r;i&&(O=!0,M(i))}(e)}))}}(i)}}var I=w(),L=v(I);I!==L&&S(L);var D=R(),P=[h(D)];function M(e){t.go(e)}var F=0;function U(e){1===(F+=e)&&1===e?window.addEventListener(_,N):0===F&&window.removeEventListener(_,N)}var j=!1;var B={length:t.length,action:"POP",location:D,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=x(window.location.href)),n+"#"+v(y+h(e))},push:function(e,t){var n="PUSH",r=p(e,void 0,void 0,B.location);k.confirmTransitionTo(r,n,s,(function(e){if(e){var t=h(r),i=v(y+t);if(w()!==i){A=t,function(e){window.location.hash=e}(i);var s=P.lastIndexOf(h(B.location)),o=P.slice(0,s+1);o.push(t),P=o,C({action:n,location:r})}else C()}}))},replace:function(e,t){var n="REPLACE",r=p(e,void 0,void 0,B.location);k.confirmTransitionTo(r,n,s,(function(e){if(e){var t=h(r),i=v(y+t);w()!==i&&(A=t,S(i));var s=P.indexOf(h(B.location));-1!==s&&(P[s]=t),C({action:n,location:r})}}))},go:M,goBack:function(){M(-1)},goForward:function(){M(1)},block:function(e){void 0===e&&(e=!1);var t=k.setPrompt(e);return j||(U(1),j=!0),function(){return j&&(j=!1,U(-1)),t()}},listen:function(e){var t=k.appendListener(e);return U(1),function(){U(-1),t()}}};return B}function k(e,t,n){return Math.min(Math.max(e,t),n)}function C(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,i=t.initialEntries,s=void 0===i?["/"]:i,o=t.initialIndex,a=void 0===o?0:o,l=t.keyLength,c=void 0===l?6:l,u=f();function d(e){(0,r.Z)(E,e),E.length=E.entries.length,u.notifyListeners(E.location,E.action)}function g(){return Math.random().toString(36).substr(2,c)}var m=k(a,0,s.length-1),y=s.map((function(e){return p(e,void 0,"string"==typeof e?g():e.key||g())})),b=h;function v(e){var t=k(E.index+e,0,E.entries.length-1),r=E.entries[t];u.confirmTransitionTo(r,"POP",n,(function(e){e?d({action:"POP",location:r,index:t}):d()}))}var E={length:y.length,action:"POP",location:y[m],index:m,entries:y,createHref:b,push:function(e,t){var r="PUSH",i=p(e,t,g(),E.location);u.confirmTransitionTo(i,r,n,(function(e){if(e){var t=E.index+1,n=E.entries.slice(0);n.length>t?n.splice(t,n.length-t,i):n.push(i),d({action:r,location:i,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",i=p(e,t,g(),E.location);u.confirmTransitionTo(i,r,n,(function(e){e&&(E.entries[E.index]=i,d({action:r,location:i}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=E.index+e;return t>=0&&t<E.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return E}},8679:(e,t,n)=>{"use strict";var r=n(59864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return r.isMemo(e)?o:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=o;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(f){var i=p(n);i&&i!==f&&e(t,i,r)}var o=u(n);d&&(o=o.concat(d(n)));for(var a=l(t),g=l(n),m=0;m<o.length;++m){var y=o[m];if(!(s[y]||r&&r[y]||g&&g[y]||a&&a[y])){var b=h(n,y);try{c(t,y,b)}catch(v){}}}}return t}},41143:e=>{"use strict";e.exports=function(e,t,n,r,i,s,o,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,s,o,a],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},5826:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},31336:(e,t,n)=>{var r,i;!function(){var s,o,a,l,c,u,d,h,p,f,g,m,y,b,v,E,_,T,x,w,S,R,k,C,O,A,N,I,L,D,P=function(e){var t=new P.Builder;return t.pipeline.add(P.trimmer,P.stopWordFilter,P.stemmer),t.searchPipeline.add(P.stemmer),e.call(t,t),t.build()};P.version="2.3.9",P.utils={},P.utils.warn=(s=this,function(e){s.console&&console.warn&&console.warn(e)}),P.utils.asString=function(e){return null==e?"":e.toString()},P.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],s=e[i];if(Array.isArray(s))t[i]=s.slice();else{if("string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s)throw new TypeError("clone is not deep and does not support nested objects");t[i]=s}}return t},P.FieldRef=function(e,t,n){this.docRef=e,this.fieldName=t,this._stringValue=n},P.FieldRef.joiner="/",P.FieldRef.fromString=function(e){var t=e.indexOf(P.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var n=e.slice(0,t),r=e.slice(t+1);return new P.FieldRef(r,n,e)},P.FieldRef.prototype.toString=function(){return null==this._stringValue&&(this._stringValue=this.fieldName+P.FieldRef.joiner+this.docRef),this._stringValue},P.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var t=0;t<this.length;t++)this.elements[e[t]]=!0}else this.length=0},P.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},P.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},P.Set.prototype.contains=function(e){return!!this.elements[e]},P.Set.prototype.intersect=function(e){var t,n,r,i=[];if(e===P.Set.complete)return this;if(e===P.Set.empty)return e;this.length<e.length?(t=this,n=e):(t=e,n=this),r=Object.keys(t.elements);for(var s=0;s<r.length;s++){var o=r[s];o in n.elements&&i.push(o)}return new P.Set(i)},P.Set.prototype.union=function(e){return e===P.Set.complete?P.Set.complete:e===P.Set.empty?this:new P.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},P.idf=function(e,t){var n=0;for(var r in e)"_index"!=r&&(n+=Object.keys(e[r]).length);var i=(t-n+.5)/(n+.5);return Math.log(1+Math.abs(i))},P.Token=function(e,t){this.str=e||"",this.metadata=t||{}},P.Token.prototype.toString=function(){return this.str},P.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},P.Token.prototype.clone=function(e){return e=e||function(e){return e},new P.Token(e(this.str,this.metadata),this.metadata)},P.tokenizer=function(e,t){if(null==e||null==e)return[];if(Array.isArray(e))return e.map((function(e){return new P.Token(P.utils.asString(e).toLowerCase(),P.utils.clone(t))}));for(var n=e.toString().toLowerCase(),r=n.length,i=[],s=0,o=0;s<=r;s++){var a=s-o;if(n.charAt(s).match(P.tokenizer.separator)||s==r){if(a>0){var l=P.utils.clone(t)||{};l.position=[o,a],l.index=i.length,i.push(new P.Token(n.slice(o,s),l))}o=s+1}}return i},P.tokenizer.separator=/[\s\-]+/,P.Pipeline=function(){this._stack=[]},P.Pipeline.registeredFunctions=Object.create(null),P.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&P.utils.warn("Overwriting existing registered function: "+t),e.label=t,P.Pipeline.registeredFunctions[e.label]=e},P.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||P.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},P.Pipeline.load=function(e){var t=new P.Pipeline;return e.forEach((function(e){var n=P.Pipeline.registeredFunctions[e];if(!n)throw new Error("Cannot load unregistered function: "+e);t.add(n)})),t},P.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach((function(e){P.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)}),this)},P.Pipeline.prototype.after=function(e,t){P.Pipeline.warnIfFunctionNotRegistered(t);var n=this._stack.indexOf(e);if(-1==n)throw new Error("Cannot find existingFn");n+=1,this._stack.splice(n,0,t)},P.Pipeline.prototype.before=function(e,t){P.Pipeline.warnIfFunctionNotRegistered(t);var n=this._stack.indexOf(e);if(-1==n)throw new Error("Cannot find existingFn");this._stack.splice(n,0,t)},P.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},P.Pipeline.prototype.run=function(e){for(var t=this._stack.length,n=0;n<t;n++){for(var r=this._stack[n],i=[],s=0;s<e.length;s++){var o=r(e[s],s,e);if(null!=o&&""!==o)if(Array.isArray(o))for(var a=0;a<o.length;a++)i.push(o[a]);else i.push(o)}e=i}return e},P.Pipeline.prototype.runString=function(e,t){var n=new P.Token(e,t);return this.run([n]).map((function(e){return e.toString()}))},P.Pipeline.prototype.reset=function(){this._stack=[]},P.Pipeline.prototype.toJSON=function(){return this._stack.map((function(e){return P.Pipeline.warnIfFunctionNotRegistered(e),e.label}))},P.Vector=function(e){this._magnitude=0,this.elements=e||[]},P.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,n=this.elements.length/2,r=n-t,i=Math.floor(r/2),s=this.elements[2*i];r>1&&(s<e&&(t=i),s>e&&(n=i),s!=e);)r=n-t,i=t+Math.floor(r/2),s=this.elements[2*i];return s==e||s>e?2*i:s<e?2*(i+1):void 0},P.Vector.prototype.insert=function(e,t){this.upsert(e,t,(function(){throw"duplicate index"}))},P.Vector.prototype.upsert=function(e,t,n){this._magnitude=0;var r=this.positionForIndex(e);this.elements[r]==e?this.elements[r+1]=n(this.elements[r+1],t):this.elements.splice(r,0,e,t)},P.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,n=1;n<t;n+=2){var r=this.elements[n];e+=r*r}return this._magnitude=Math.sqrt(e)},P.Vector.prototype.dot=function(e){for(var t=0,n=this.elements,r=e.elements,i=n.length,s=r.length,o=0,a=0,l=0,c=0;l<i&&c<s;)(o=n[l])<(a=r[c])?l+=2:o>a?c+=2:o==a&&(t+=n[l+1]*r[c+1],l+=2,c+=2);return t},P.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},P.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,n=0;t<this.elements.length;t+=2,n++)e[n]=this.elements[t];return e},P.Vector.prototype.toJSON=function(){return this.elements},P.stemmer=(o={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},a={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},d="^("+(c="[^aeiou][^aeiouy]*")+")?"+(u=(l="[aeiouy]")+"[aeiou]*")+c+"("+u+")?$",h="^("+c+")?"+u+c+u+c,p="^("+c+")?"+l,f=new RegExp("^("+c+")?"+u+c),g=new RegExp(h),m=new RegExp(d),y=new RegExp(p),b=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,E=/^(.+?)eed$/,_=/^(.+?)(ed|ing)$/,T=/.$/,x=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),S=new RegExp("^"+c+l+"[^aeiouwxy]$"),R=/^(.+?[^aeiou])y$/,k=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,C=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,O=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,A=/^(.+?)(s|t)(ion)$/,N=/^(.+?)e$/,I=/ll$/,L=new RegExp("^"+c+l+"[^aeiouwxy]$"),D=function(e){var t,n,r,i,s,l,c;if(e.length<3)return e;if("y"==(r=e.substr(0,1))&&(e=r.toUpperCase()+e.substr(1)),s=v,(i=b).test(e)?e=e.replace(i,"$1$2"):s.test(e)&&(e=e.replace(s,"$1$2")),s=_,(i=E).test(e)){var u=i.exec(e);(i=f).test(u[1])&&(i=T,e=e.replace(i,""))}else s.test(e)&&(t=(u=s.exec(e))[1],(s=y).test(t)&&(l=w,c=S,(s=x).test(e=t)?e+="e":l.test(e)?(i=T,e=e.replace(i,"")):c.test(e)&&(e+="e")));return(i=R).test(e)&&(e=(t=(u=i.exec(e))[1])+"i"),(i=k).test(e)&&(t=(u=i.exec(e))[1],n=u[2],(i=f).test(t)&&(e=t+o[n])),(i=C).test(e)&&(t=(u=i.exec(e))[1],n=u[2],(i=f).test(t)&&(e=t+a[n])),s=A,(i=O).test(e)?(t=(u=i.exec(e))[1],(i=g).test(t)&&(e=t)):s.test(e)&&(t=(u=s.exec(e))[1]+u[2],(s=g).test(t)&&(e=t)),(i=N).test(e)&&(t=(u=i.exec(e))[1],s=m,l=L,((i=g).test(t)||s.test(t)&&!l.test(t))&&(e=t)),s=g,(i=I).test(e)&&s.test(e)&&(i=T,e=e.replace(i,"")),"y"==r&&(e=r.toLowerCase()+e.substr(1)),e},function(e){return e.update(D)}),P.Pipeline.registerFunction(P.stemmer,"stemmer"),P.generateStopWordFilter=function(e){var t=e.reduce((function(e,t){return e[t]=t,e}),{});return function(e){if(e&&t[e.toString()]!==e.toString())return e}},P.stopWordFilter=P.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),P.Pipeline.registerFunction(P.stopWordFilter,"stopWordFilter"),P.trimmer=function(e){return e.update((function(e){return e.replace(/^\W+/,"").replace(/\W+$/,"")}))},P.Pipeline.registerFunction(P.trimmer,"trimmer"),P.TokenSet=function(){this.final=!1,this.edges={},this.id=P.TokenSet._nextId,P.TokenSet._nextId+=1},P.TokenSet._nextId=1,P.TokenSet.fromArray=function(e){for(var t=new P.TokenSet.Builder,n=0,r=e.length;n<r;n++)t.insert(e[n]);return t.finish(),t.root},P.TokenSet.fromClause=function(e){return"editDistance"in e?P.TokenSet.fromFuzzyString(e.term,e.editDistance):P.TokenSet.fromString(e.term)},P.TokenSet.fromFuzzyString=function(e,t){for(var n=new P.TokenSet,r=[{node:n,editsRemaining:t,str:e}];r.length;){var i=r.pop();if(i.str.length>0){var s,o=i.str.charAt(0);o in i.node.edges?s=i.node.edges[o]:(s=new P.TokenSet,i.node.edges[o]=s),1==i.str.length&&(s.final=!0),r.push({node:s,editsRemaining:i.editsRemaining,str:i.str.slice(1)})}if(0!=i.editsRemaining){if("*"in i.node.edges)var a=i.node.edges["*"];else{a=new P.TokenSet;i.node.edges["*"]=a}if(0==i.str.length&&(a.final=!0),r.push({node:a,editsRemaining:i.editsRemaining-1,str:i.str}),i.str.length>1&&r.push({node:i.node,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)}),1==i.str.length&&(i.node.final=!0),i.str.length>=1){if("*"in i.node.edges)var l=i.node.edges["*"];else{l=new P.TokenSet;i.node.edges["*"]=l}1==i.str.length&&(l.final=!0),r.push({node:l,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)})}if(i.str.length>1){var c,u=i.str.charAt(0),d=i.str.charAt(1);d in i.node.edges?c=i.node.edges[d]:(c=new P.TokenSet,i.node.edges[d]=c),1==i.str.length&&(c.final=!0),r.push({node:c,editsRemaining:i.editsRemaining-1,str:u+i.str.slice(2)})}}}return n},P.TokenSet.fromString=function(e){for(var t=new P.TokenSet,n=t,r=0,i=e.length;r<i;r++){var s=e[r],o=r==i-1;if("*"==s)t.edges[s]=t,t.final=o;else{var a=new P.TokenSet;a.final=o,t.edges[s]=a,t=a}}return n},P.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var n=t.pop(),r=Object.keys(n.node.edges),i=r.length;n.node.final&&(n.prefix.charAt(0),e.push(n.prefix));for(var s=0;s<i;s++){var o=r[s];t.push({prefix:n.prefix.concat(o),node:n.node.edges[o]})}}return e},P.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",t=Object.keys(this.edges).sort(),n=t.length,r=0;r<n;r++){var i=t[r];e=e+i+this.edges[i].id}return e},P.TokenSet.prototype.intersect=function(e){for(var t=new P.TokenSet,n=void 0,r=[{qNode:e,output:t,node:this}];r.length;){n=r.pop();for(var i=Object.keys(n.qNode.edges),s=i.length,o=Object.keys(n.node.edges),a=o.length,l=0;l<s;l++)for(var c=i[l],u=0;u<a;u++){var d=o[u];if(d==c||"*"==c){var h=n.node.edges[d],p=n.qNode.edges[c],f=h.final&&p.final,g=void 0;d in n.output.edges?(g=n.output.edges[d]).final=g.final||f:((g=new P.TokenSet).final=f,n.output.edges[d]=g),r.push({qNode:p,output:g,node:h})}}}return t},P.TokenSet.Builder=function(){this.previousWord="",this.root=new P.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},P.TokenSet.Builder.prototype.insert=function(e){var t,n=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var r=0;r<e.length&&r<this.previousWord.length&&e[r]==this.previousWord[r];r++)n++;this.minimize(n),t=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(r=n;r<e.length;r++){var i=new P.TokenSet,s=e[r];t.edges[s]=i,this.uncheckedNodes.push({parent:t,char:s,child:i}),t=i}t.final=!0,this.previousWord=e},P.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},P.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;t>=e;t--){var n=this.uncheckedNodes[t],r=n.child.toString();r in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[r]:(n.child._str=r,this.minimizedNodes[r]=n.child),this.uncheckedNodes.pop()}},P.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},P.Index.prototype.search=function(e){return this.query((function(t){new P.QueryParser(e,t).parse()}))},P.Index.prototype.query=function(e){for(var t=new P.Query(this.fields),n=Object.create(null),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=0;a<this.fields.length;a++)r[this.fields[a]]=new P.Vector;e.call(t,t);for(a=0;a<t.clauses.length;a++){var l=t.clauses[a],c=null,u=P.Set.empty;c=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var d=0;d<c.length;d++){var h=c[d];l.term=h;var p=P.TokenSet.fromClause(l),f=this.tokenSet.intersect(p).toArray();if(0===f.length&&l.presence===P.Query.presence.REQUIRED){for(var g=0;g<l.fields.length;g++){s[N=l.fields[g]]=P.Set.empty}break}for(var m=0;m<f.length;m++){var y=f[m],b=this.invertedIndex[y],v=b._index;for(g=0;g<l.fields.length;g++){var E=b[N=l.fields[g]],_=Object.keys(E),T=y+"/"+N,x=new P.Set(_);if(l.presence==P.Query.presence.REQUIRED&&(u=u.union(x),void 0===s[N]&&(s[N]=P.Set.complete)),l.presence!=P.Query.presence.PROHIBITED){if(r[N].upsert(v,l.boost,(function(e,t){return e+t})),!i[T]){for(var w=0;w<_.length;w++){var S,R=_[w],k=new P.FieldRef(R,N),C=E[R];void 0===(S=n[k])?n[k]=new P.MatchData(y,N,C):S.add(y,N,C)}i[T]=!0}}else void 0===o[N]&&(o[N]=P.Set.empty),o[N]=o[N].union(x)}}}if(l.presence===P.Query.presence.REQUIRED)for(g=0;g<l.fields.length;g++){s[N=l.fields[g]]=s[N].intersect(u)}}var O=P.Set.complete,A=P.Set.empty;for(a=0;a<this.fields.length;a++){var N;s[N=this.fields[a]]&&(O=O.intersect(s[N])),o[N]&&(A=A.union(o[N]))}var I=Object.keys(n),L=[],D=Object.create(null);if(t.isNegated()){I=Object.keys(this.fieldVectors);for(a=0;a<I.length;a++){k=I[a];var M=P.FieldRef.fromString(k);n[k]=new P.MatchData}}for(a=0;a<I.length;a++){var F=(M=P.FieldRef.fromString(I[a])).docRef;if(O.contains(F)&&!A.contains(F)){var U,j=this.fieldVectors[M],B=r[M.fieldName].similarity(j);if(void 0!==(U=D[F]))U.score+=B,U.matchData.combine(n[M]);else{var H={ref:F,score:B,matchData:n[M]};D[F]=H,L.push(H)}}}return L.sort((function(e,t){return t.score-e.score}))},P.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map((function(e){return[e,this.invertedIndex[e]]}),this),t=Object.keys(this.fieldVectors).map((function(e){return[e,this.fieldVectors[e].toJSON()]}),this);return{version:P.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},P.Index.load=function(e){var t={},n={},r=e.fieldVectors,i=Object.create(null),s=e.invertedIndex,o=new P.TokenSet.Builder,a=P.Pipeline.load(e.pipeline);e.version!=P.version&&P.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+P.version+"' does not match serialized index '"+e.version+"'");for(var l=0;l<r.length;l++){var c=(d=r[l])[0],u=d[1];n[c]=new P.Vector(u)}for(l=0;l<s.length;l++){var d,h=(d=s[l])[0],p=d[1];o.insert(h),i[h]=p}return o.finish(),t.fields=e.fields,t.fieldVectors=n,t.invertedIndex=i,t.tokenSet=o.root,t.pipeline=a,new P.Index(t)},P.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=P.tokenizer,this.pipeline=new P.Pipeline,this.searchPipeline=new P.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},P.Builder.prototype.ref=function(e){this._ref=e},P.Builder.prototype.field=function(e,t){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=t||{}},P.Builder.prototype.b=function(e){this._b=e<0?0:e>1?1:e},P.Builder.prototype.k1=function(e){this._k1=e},P.Builder.prototype.add=function(e,t){var n=e[this._ref],r=Object.keys(this._fields);this._documents[n]=t||{},this.documentCount+=1;for(var i=0;i<r.length;i++){var s=r[i],o=this._fields[s].extractor,a=o?o(e):e[s],l=this.tokenizer(a,{fields:[s]}),c=this.pipeline.run(l),u=new P.FieldRef(n,s),d=Object.create(null);this.fieldTermFrequencies[u]=d,this.fieldLengths[u]=0,this.fieldLengths[u]+=c.length;for(var h=0;h<c.length;h++){var p=c[h];if(null==d[p]&&(d[p]=0),d[p]+=1,null==this.invertedIndex[p]){var f=Object.create(null);f._index=this.termIndex,this.termIndex+=1;for(var g=0;g<r.length;g++)f[r[g]]=Object.create(null);this.invertedIndex[p]=f}null==this.invertedIndex[p][s][n]&&(this.invertedIndex[p][s][n]=Object.create(null));for(var m=0;m<this.metadataWhitelist.length;m++){var y=this.metadataWhitelist[m],b=p.metadata[y];null==this.invertedIndex[p][s][n][y]&&(this.invertedIndex[p][s][n][y]=[]),this.invertedIndex[p][s][n][y].push(b)}}}},P.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,n={},r={},i=0;i<t;i++){var s=P.FieldRef.fromString(e[i]),o=s.fieldName;r[o]||(r[o]=0),r[o]+=1,n[o]||(n[o]=0),n[o]+=this.fieldLengths[s]}var a=Object.keys(this._fields);for(i=0;i<a.length;i++){var l=a[i];n[l]=n[l]/r[l]}this.averageFieldLength=n},P.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),n=t.length,r=Object.create(null),i=0;i<n;i++){for(var s=P.FieldRef.fromString(t[i]),o=s.fieldName,a=this.fieldLengths[s],l=new P.Vector,c=this.fieldTermFrequencies[s],u=Object.keys(c),d=u.length,h=this._fields[o].boost||1,p=this._documents[s.docRef].boost||1,f=0;f<d;f++){var g,m,y,b=u[f],v=c[b],E=this.invertedIndex[b]._index;void 0===r[b]?(g=P.idf(this.invertedIndex[b],this.documentCount),r[b]=g):g=r[b],m=g*((this._k1+1)*v)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength[o]))+v),m*=h,m*=p,y=Math.round(1e3*m)/1e3,l.insert(E,y)}e[s]=l}this.fieldVectors=e},P.Builder.prototype.createTokenSet=function(){this.tokenSet=P.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},P.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new P.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},P.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},P.MatchData=function(e,t,n){for(var r=Object.create(null),i=Object.keys(n||{}),s=0;s<i.length;s++){var o=i[s];r[o]=n[o].slice()}this.metadata=Object.create(null),void 0!==e&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=r)},P.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),n=0;n<t.length;n++){var r=t[n],i=Object.keys(e.metadata[r]);null==this.metadata[r]&&(this.metadata[r]=Object.create(null));for(var s=0;s<i.length;s++){var o=i[s],a=Object.keys(e.metadata[r][o]);null==this.metadata[r][o]&&(this.metadata[r][o]=Object.create(null));for(var l=0;l<a.length;l++){var c=a[l];null==this.metadata[r][o][c]?this.metadata[r][o][c]=e.metadata[r][o][c]:this.metadata[r][o][c]=this.metadata[r][o][c].concat(e.metadata[r][o][c])}}}},P.MatchData.prototype.add=function(e,t,n){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=n);if(t in this.metadata[e])for(var r=Object.keys(n),i=0;i<r.length;i++){var s=r[i];s in this.metadata[e][t]?this.metadata[e][t][s]=this.metadata[e][t][s].concat(n[s]):this.metadata[e][t][s]=n[s]}else this.metadata[e][t]=n},P.Query=function(e){this.clauses=[],this.allFields=e},P.Query.wildcard=new String("*"),P.Query.wildcard.NONE=0,P.Query.wildcard.LEADING=1,P.Query.wildcard.TRAILING=2,P.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},P.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=P.Query.wildcard.NONE),e.wildcard&P.Query.wildcard.LEADING&&e.term.charAt(0)!=P.Query.wildcard&&(e.term="*"+e.term),e.wildcard&P.Query.wildcard.TRAILING&&e.term.slice(-1)!=P.Query.wildcard&&(e.term=e.term+"*"),"presence"in e||(e.presence=P.Query.presence.OPTIONAL),this.clauses.push(e),this},P.Query.prototype.isNegated=function(){for(var e=0;e<this.clauses.length;e++)if(this.clauses[e].presence!=P.Query.presence.PROHIBITED)return!1;return!0},P.Query.prototype.term=function(e,t){if(Array.isArray(e))return e.forEach((function(e){this.term(e,P.utils.clone(t))}),this),this;var n=t||{};return n.term=e.toString(),this.clause(n),this},P.QueryParseError=function(e,t,n){this.name="QueryParseError",this.message=e,this.start=t,this.end=n},P.QueryParseError.prototype=new Error,P.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},P.QueryLexer.prototype.run=function(){for(var e=P.QueryLexer.lexText;e;)e=e(this)},P.QueryLexer.prototype.sliceString=function(){for(var e=[],t=this.start,n=this.pos,r=0;r<this.escapeCharPositions.length;r++)n=this.escapeCharPositions[r],e.push(this.str.slice(t,n)),t=n+1;return e.push(this.str.slice(t,this.pos)),this.escapeCharPositions.length=0,e.join("")},P.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},P.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},P.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return P.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},P.QueryLexer.prototype.width=function(){return this.pos-this.start},P.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},P.QueryLexer.prototype.backup=function(){this.pos-=1},P.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=P.QueryLexer.EOS&&this.backup()},P.QueryLexer.prototype.more=function(){return this.pos<this.length},P.QueryLexer.EOS="EOS",P.QueryLexer.FIELD="FIELD",P.QueryLexer.TERM="TERM",P.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",P.QueryLexer.BOOST="BOOST",P.QueryLexer.PRESENCE="PRESENCE",P.QueryLexer.lexField=function(e){return e.backup(),e.emit(P.QueryLexer.FIELD),e.ignore(),P.QueryLexer.lexText},P.QueryLexer.lexTerm=function(e){if(e.width()>1&&(e.backup(),e.emit(P.QueryLexer.TERM)),e.ignore(),e.more())return P.QueryLexer.lexText},P.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(P.QueryLexer.EDIT_DISTANCE),P.QueryLexer.lexText},P.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(P.QueryLexer.BOOST),P.QueryLexer.lexText},P.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(P.QueryLexer.TERM)},P.QueryLexer.termSeparator=P.tokenizer.separator,P.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==P.QueryLexer.EOS)return P.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return P.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(P.QueryLexer.TERM),P.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(P.QueryLexer.TERM),P.QueryLexer.lexBoost;if("+"==t&&1===e.width())return e.emit(P.QueryLexer.PRESENCE),P.QueryLexer.lexText;if("-"==t&&1===e.width())return e.emit(P.QueryLexer.PRESENCE),P.QueryLexer.lexText;if(t.match(P.QueryLexer.termSeparator))return P.QueryLexer.lexTerm}else e.escapeCharacter()}},P.QueryParser=function(e,t){this.lexer=new P.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},P.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=P.QueryParser.parseClause;e;)e=e(this);return this.query},P.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},P.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},P.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},P.QueryParser.parseClause=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case P.QueryLexer.PRESENCE:return P.QueryParser.parsePresence;case P.QueryLexer.FIELD:return P.QueryParser.parseField;case P.QueryLexer.TERM:return P.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(n+=" with value '"+t.str+"'"),new P.QueryParseError(n,t.start,t.end)}},P.QueryParser.parsePresence=function(e){var t=e.consumeLexeme();if(null!=t){switch(t.str){case"-":e.currentClause.presence=P.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=P.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+t.str+"'";throw new P.QueryParseError(n,t.start,t.end)}var r=e.peekLexeme();if(null==r){n="expecting term or field, found nothing";throw new P.QueryParseError(n,t.start,t.end)}switch(r.type){case P.QueryLexer.FIELD:return P.QueryParser.parseField;case P.QueryLexer.TERM:return P.QueryParser.parseTerm;default:n="expecting term or field, found '"+r.type+"'";throw new P.QueryParseError(n,r.start,r.end)}}},P.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var n=e.query.allFields.map((function(e){return"'"+e+"'"})).join(", "),r="unrecognised field '"+t.str+"', possible fields: "+n;throw new P.QueryParseError(r,t.start,t.end)}e.currentClause.fields=[t.str];var i=e.peekLexeme();if(null==i){r="expecting term, found nothing";throw new P.QueryParseError(r,t.start,t.end)}if(i.type===P.QueryLexer.TERM)return P.QueryParser.parseTerm;r="expecting term, found '"+i.type+"'";throw new P.QueryParseError(r,i.start,i.end)}},P.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(null!=n)switch(n.type){case P.QueryLexer.TERM:return e.nextClause(),P.QueryParser.parseTerm;case P.QueryLexer.FIELD:return e.nextClause(),P.QueryParser.parseField;case P.QueryLexer.EDIT_DISTANCE:return P.QueryParser.parseEditDistance;case P.QueryLexer.BOOST:return P.QueryParser.parseBoost;case P.QueryLexer.PRESENCE:return e.nextClause(),P.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+n.type+"'";throw new P.QueryParseError(r,n.start,n.end)}else e.nextClause()}},P.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var n=parseInt(t.str,10);if(isNaN(n)){var r="edit distance must be numeric";throw new P.QueryParseError(r,t.start,t.end)}e.currentClause.editDistance=n;var i=e.peekLexeme();if(null!=i)switch(i.type){case P.QueryLexer.TERM:return e.nextClause(),P.QueryParser.parseTerm;case P.QueryLexer.FIELD:return e.nextClause(),P.QueryParser.parseField;case P.QueryLexer.EDIT_DISTANCE:return P.QueryParser.parseEditDistance;case P.QueryLexer.BOOST:return P.QueryParser.parseBoost;case P.QueryLexer.PRESENCE:return e.nextClause(),P.QueryParser.parsePresence;default:r="Unexpected lexeme type '"+i.type+"'";throw new P.QueryParseError(r,i.start,i.end)}else e.nextClause()}},P.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var n=parseInt(t.str,10);if(isNaN(n)){var r="boost must be numeric";throw new P.QueryParseError(r,t.start,t.end)}e.currentClause.boost=n;var i=e.peekLexeme();if(null!=i)switch(i.type){case P.QueryLexer.TERM:return e.nextClause(),P.QueryParser.parseTerm;case P.QueryLexer.FIELD:return e.nextClause(),P.QueryParser.parseField;case P.QueryLexer.EDIT_DISTANCE:return P.QueryParser.parseEditDistance;case P.QueryLexer.BOOST:return P.QueryParser.parseBoost;case P.QueryLexer.PRESENCE:return e.nextClause(),P.QueryParser.parsePresence;default:r="Unexpected lexeme type '"+i.type+"'";throw new P.QueryParseError(r,i.start,i.end)}else e.nextClause()}},void 0===(i="function"==typeof(r=function(){return P})?r.call(t,n,t,e):r)||(e.exports=i)}()},32497:(e,t,n)=>{"use strict";n.r(t)},52295:(e,t,n)=>{"use strict";n.r(t)},43576:(e,t,n)=>{"use strict";n.r(t)},74865:function(e,t,n){var r,i;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function i(e,t,n){return e<t?t:e>n?n:e}function s(e){return 100*(-1+e)}function o(e,t,n){var i;return(i="translate3d"===r.positionUsing?{transform:"translate3d("+s(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+s(e)+"%,0)"}:{"margin-left":s(e)+"%"}).transition="all "+t+"ms "+n,i}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=i(e,r.minimum,1),n.status=1===e?null:e;var s=n.render(!t),c=s.querySelector(r.barSelector),u=r.speed,d=r.easing;return s.offsetWidth,a((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),l(c,o(e,u,d)),1===e?(l(s,{transition:"none",opacity:1}),s.offsetWidth,setTimeout((function(){l(s,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*i(Math.random()*t,.1,.95)),t=i(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var i,o=t.querySelector(r.barSelector),a=e?"-100":s(n.status||0),c=document.querySelector(r.parent);return l(o,{transition:"all 0 linear",transform:"translate3d("+a+"%,0,0)"}),r.showSpinner||(i=t.querySelector(r.spinnerSelector))&&p(i),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var a=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),l=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,i=e.length,s=t.charAt(0).toUpperCase()+t.slice(1);i--;)if((r=e[i]+s)in n)return r;return t}function i(e){return e=n(e),t[e]||(t[e]=r(e))}function s(e,t,n){t=i(t),e.style[t]=n}return function(e,t){var n,r,i=arguments;if(2==i.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&s(e,n,r);else s(e,i[1],i[2])}}();function c(e,t){return("string"==typeof e?e:h(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=h(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=h(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function h(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(i="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=i)},27418:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,i){for(var s,o,a=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var c in s=Object(arguments[l]))n.call(s,c)&&(a[c]=s[c]);if(t){o=t(s);for(var u=0;u<o.length;u++)r.call(s,o[u])&&(a[o[u]]=s[o[u]])}}return a}},14779:(e,t,n)=>{var r=n(5826);e.exports=p,e.exports.parse=s,e.exports.compile=function(e,t){return a(s(e,t),t)},e.exports.tokensToFunction=a,e.exports.tokensToRegExp=h;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function s(e,t){for(var n,r=[],s=0,o=0,a="",u=t&&t.delimiter||"/";null!=(n=i.exec(e));){var d=n[0],h=n[1],p=n.index;if(a+=e.slice(o,p),o=p+d.length,h)a+=h[1];else{var f=e[o],g=n[2],m=n[3],y=n[4],b=n[5],v=n[6],E=n[7];a&&(r.push(a),a="");var _=null!=g&&null!=f&&f!==g,T="+"===v||"*"===v,x="?"===v||"*"===v,w=n[2]||u,S=y||b;r.push({name:m||s++,prefix:g||"",delimiter:w,optional:x,repeat:T,partial:_,asterisk:!!E,pattern:S?c(S):E?".*":"[^"+l(w)+"]+?"})}}return o<e.length&&(a+=e.substr(o)),a&&r.push(a),r}function o(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function a(e,t){for(var n=new Array(e.length),i=0;i<e.length;i++)"object"==typeof e[i]&&(n[i]=new RegExp("^(?:"+e[i].pattern+")$",d(t)));return function(t,i){for(var s="",a=t||{},l=(i||{}).pretty?o:encodeURIComponent,c=0;c<e.length;c++){var u=e[c];if("string"!=typeof u){var d,h=a[u.name];if(null==h){if(u.optional){u.partial&&(s+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(r(h)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(h)+"`");if(0===h.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var p=0;p<h.length;p++){if(d=l(h[p]),!n[c].test(d))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(d)+"`");s+=(0===p?u.prefix:u.delimiter)+d}}else{if(d=u.asterisk?encodeURI(h).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):l(h),!n[c].test(d))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+d+'"');s+=u.prefix+d}}else s+=u}return s}}function l(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function c(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function u(e,t){return e.keys=t,e}function d(e){return e&&e.sensitive?"":"i"}function h(e,t,n){r(t)||(n=t||n,t=[]);for(var i=(n=n||{}).strict,s=!1!==n.end,o="",a=0;a<e.length;a++){var c=e[a];if("string"==typeof c)o+=l(c);else{var h=l(c.prefix),p="(?:"+c.pattern+")";t.push(c),c.repeat&&(p+="(?:"+h+p+")*"),o+=p=c.optional?c.partial?h+"("+p+")?":"(?:"+h+"("+p+"))?":h+"("+p+")"}}var f=l(n.delimiter||"/"),g=o.slice(-f.length)===f;return i||(o=(g?o.slice(0,-f.length):o)+"(?:"+f+"(?=$))?"),o+=s?"$":i&&g?"":"(?="+f+"|$)",u(new RegExp("^"+o,d(n)),t)}function p(e,t,n){return r(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return u(e,t)}(e,t):r(e)?function(e,t,n){for(var r=[],i=0;i<e.length;i++)r.push(p(e[i],t,n).source);return u(new RegExp("(?:"+r.join("|")+")",d(n)),t)}(e,t,n):function(e,t,n){return h(s(e,n),t,n)}(e,t,n)}},79016:()=>{!function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,(function(e,n){return"(?:"+t[+n]+")"}))}function n(e,n,r){return RegExp(t(e,n),r||"")}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,(function(){return"(?:"+e+")"}));return e.replace(/<<self>>/g,"[^\\s\\S]")}var i="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",s="class enum interface record struct",o="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",a="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var c=l(s),u=RegExp(l(i+" "+s+" "+o+" "+a)),d=l(s+" "+o+" "+a),h=l(i+" "+s+" "+a),p=r(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),f=r(/\((?:[^()]|<<self>>)*\)/.source,2),g=/@?\b[A-Za-z_]\w*\b/.source,m=t(/<<0>>(?:\s*<<1>>)?/.source,[g,p]),y=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,m]),b=/\[\s*(?:,\s*)*\]/.source,v=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[y,b]),E=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[p,f,b]),_=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[E]),T=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[_,y,b]),x={keyword:u,punctuation:/[<>()?,.:[\]]/},w=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,S=/"(?:\\.|[^\\"\r\n])*"/.source,R=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[R]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[S]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[y]),lookbehind:!0,inside:x},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[g,T]),lookbehind:!0,inside:x},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[g]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[c,m]),lookbehind:!0,inside:x},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[y]),lookbehind:!0,inside:x},{pattern:n(/(\bwhere\s+)<<0>>/.source,[g]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[v]),lookbehind:!0,inside:x},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[T,h,g]),inside:x}],keyword:u,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[g]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[g]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:x},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[T,y]),inside:x,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[T]),lookbehind:!0,inside:x,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[g,p]),inside:{function:n(/^<<0>>/.source,[g]),generic:{pattern:RegExp(p),alias:"class-name",inside:x}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[c,m,g,T,u.source,f,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[m,f]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:u,"class-name":{pattern:RegExp(T),greedy:!0,inside:x},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var k=S+"|"+w,C=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[k]),O=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[C]),2),A=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,N=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[y,O]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[A,N]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[A]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[O]),inside:e.languages.csharp},"class-name":{pattern:RegExp(y),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var I=/:[^}\r\n]+/.source,L=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[C]),2),D=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[L,I]),P=r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[k]),2),M=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[P,I]);function F(t,r){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[r,I]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[D]),lookbehind:!0,greedy:!0,inside:F(D,L)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[M]),lookbehind:!0,greedy:!0,inside:F(M,P)}],char:{pattern:RegExp(w),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism)},22444:()=>{!function(e){var t=/("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/;e.languages.json5=e.languages.extend("json",{property:[{pattern:RegExp(t.source+"(?=\\s*:)"),greedy:!0},{pattern:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/,alias:"unquoted"}],string:{pattern:t,greedy:!0},number:/[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/})}(Prism)},7464:(e,t,n)=>{var r={"./prism-csharp":79016,"./prism-json5":22444};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=s,e.exports=i,i.id=7464},92703:(e,t,n)=>{"use strict";var r=n(50414);function i(){}function s(){}s.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,s,o){if(o!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:i};return n.PropTypes=n,n}},45697:(e,t,n)=>{e.exports=n(92703)()},50414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},64448:(e,t,n)=>{"use strict";var r=n(67294),i=n(27418),s=n(63840);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(o(227));var a=new Set,l={};function c(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(l[e]=t,e=0;e<t.length;e++)a.add(t[e])}var d=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p=Object.prototype.hasOwnProperty,f={},g={};function m(e,t,n,r,i,s,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){y[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];y[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){y[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){y[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){y[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){y[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){y[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){y[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){y[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var b=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function E(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!p.call(g,e)||!p.call(f,e)&&(h.test(e)?g[e]=!0:(f[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(b,v);y[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(b,v);y[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(b,v);y[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){y[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),y.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){y[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var _=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,T=60103,x=60106,w=60107,S=60108,R=60114,k=60109,C=60110,O=60112,A=60113,N=60120,I=60115,L=60116,D=60121,P=60128,M=60129,F=60130,U=60131;if("function"==typeof Symbol&&Symbol.for){var j=Symbol.for;T=j("react.element"),x=j("react.portal"),w=j("react.fragment"),S=j("react.strict_mode"),R=j("react.profiler"),k=j("react.provider"),C=j("react.context"),O=j("react.forward_ref"),A=j("react.suspense"),N=j("react.suspense_list"),I=j("react.memo"),L=j("react.lazy"),D=j("react.block"),j("react.scope"),P=j("react.opaque.id"),M=j("react.debug_trace_mode"),F=j("react.offscreen"),U=j("react.legacy_hidden")}var B,H="function"==typeof Symbol&&Symbol.iterator;function $(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=H&&e[H]||e["@@iterator"])?e:null}function z(e){if(void 0===B)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);B=t&&t[1]||""}return"\n"+B+e}var V=!1;function G(e,t){if(!e||V)return"";V=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}catch(l){if(l&&r&&"string"==typeof l.stack){for(var i=l.stack.split("\n"),s=r.stack.split("\n"),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(1!==o||1!==a)do{if(o--,0>--a||i[o]!==s[a])return"\n"+i[o].replace(" at new "," at ")}while(1<=o&&0<=a);break}}}finally{V=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?z(e):""}function W(e){switch(e.tag){case 5:return z(e.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return e=G(e.type,!1);case 11:return e=G(e.type.render,!1);case 22:return e=G(e.type._render,!1);case 1:return e=G(e.type,!0);default:return""}}function K(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case w:return"Fragment";case x:return"Portal";case R:return"Profiler";case S:return"StrictMode";case A:return"Suspense";case N:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case C:return(e.displayName||"Context")+".Consumer";case k:return(e._context.displayName||"Context")+".Provider";case O:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case I:return K(e.type);case D:return K(e._render);case L:t=e._payload,e=e._init;try{return K(e(t))}catch(n){}}return null}function Y(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function Z(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function q(e){e._valueTracker||(e._valueTracker=function(e){var t=Z(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Z(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function X(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function J(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Y(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&E(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=Y(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ie(e,t.type,n):t.hasOwnProperty("defaultValue")&&ie(e,t.type,Y(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function re(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ie(e,t,n){"number"===t&&X(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function se(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function oe(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Y(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ae(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function le(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:Y(n)}}function ce(e,t){var n=Y(t.value),r=Y(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function ue(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var de={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function he(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?he(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var fe,ge,me=(ge=function(e,t){if(e.namespaceURI!==de.svg||"innerHTML"in e)e.innerHTML=t;else{for((fe=fe||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=fe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ge(e,t)}))}:ge);function ye(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var be={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ve=["Webkit","ms","Moz","O"];function Ee(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||be.hasOwnProperty(e)&&be[e]?(""+t).trim():t+"px"}function _e(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=Ee(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(be).forEach((function(e){ve.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),be[t]=be[e]}))}));var Te=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xe(e,t){if(t){if(Te[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(o(62))}}function we(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Se(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Re=null,ke=null,Ce=null;function Oe(e){if(e=ni(e)){if("function"!=typeof Re)throw Error(o(280));var t=e.stateNode;t&&(t=ii(t),Re(e.stateNode,e.type,t))}}function Ae(e){ke?Ce?Ce.push(e):Ce=[e]:ke=e}function Ne(){if(ke){var e=ke,t=Ce;if(Ce=ke=null,Oe(e),t)for(e=0;e<t.length;e++)Oe(t[e])}}function Ie(e,t){return e(t)}function Le(e,t,n,r,i){return e(t,n,r,i)}function De(){}var Pe=Ie,Me=!1,Fe=!1;function Ue(){null===ke&&null===Ce||(De(),Ne())}function je(e,t){var n=e.stateNode;if(null===n)return null;var r=ii(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(o(231,t,typeof n));return n}var Be=!1;if(d)try{var He={};Object.defineProperty(He,"passive",{get:function(){Be=!0}}),window.addEventListener("test",He,He),window.removeEventListener("test",He,He)}catch(ge){Be=!1}function $e(e,t,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var ze=!1,Ve=null,Ge=!1,We=null,Ke={onError:function(e){ze=!0,Ve=e}};function Ye(e,t,n,r,i,s,o,a,l){ze=!1,Ve=null,$e.apply(Ke,arguments)}function Ze(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function qe(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Qe(e){if(Ze(e)!==e)throw Error(o(188))}function Xe(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ze(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var s=i.alternate;if(null===s){if(null!==(r=i.return)){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Qe(i),e;if(s===r)return Qe(i),t;s=s.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,l=i.child;l;){if(l===n){a=!0,n=i,r=s;break}if(l===r){a=!0,r=i,n=s;break}l=l.sibling}if(!a){for(l=s.child;l;){if(l===n){a=!0,n=s,r=i;break}if(l===r){a=!0,r=s,n=i;break}l=l.sibling}if(!a)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Je(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var et,tt,nt,rt,it=!1,st=[],ot=null,at=null,lt=null,ct=new Map,ut=new Map,dt=[],ht="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pt(e,t,n,r,i){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:i,targetContainers:[r]}}function ft(e,t){switch(e){case"focusin":case"focusout":ot=null;break;case"dragenter":case"dragleave":at=null;break;case"mouseover":case"mouseout":lt=null;break;case"pointerover":case"pointerout":ct.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ut.delete(t.pointerId)}}function gt(e,t,n,r,i,s){return null===e||e.nativeEvent!==s?(e=pt(t,n,r,i,s),null!==t&&(null!==(t=ni(t))&&tt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function mt(e){var t=ti(e.target);if(null!==t){var n=Ze(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=qe(n)))return e.blockedOn=t,void rt(e.lanePriority,(function(){s.unstable_runWithPriority(e.priority,(function(){nt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function yt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ni(n))&&tt(t),e.blockedOn=n,!1;t.shift()}return!0}function bt(e,t,n){yt(e)&&n.delete(t)}function vt(){for(it=!1;0<st.length;){var e=st[0];if(null!==e.blockedOn){null!==(e=ni(e.blockedOn))&&et(e);break}for(var t=e.targetContainers;0<t.length;){var n=Xt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&st.shift()}null!==ot&&yt(ot)&&(ot=null),null!==at&&yt(at)&&(at=null),null!==lt&&yt(lt)&&(lt=null),ct.forEach(bt),ut.forEach(bt)}function Et(e,t){e.blockedOn===t&&(e.blockedOn=null,it||(it=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,vt)))}function _t(e){function t(t){return Et(t,e)}if(0<st.length){Et(st[0],e);for(var n=1;n<st.length;n++){var r=st[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==ot&&Et(ot,e),null!==at&&Et(at,e),null!==lt&&Et(lt,e),ct.forEach(t),ut.forEach(t),n=0;n<dt.length;n++)(r=dt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<dt.length&&null===(n=dt[0]).blockedOn;)mt(n),null===n.blockedOn&&dt.shift()}function Tt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var xt={animationend:Tt("Animation","AnimationEnd"),animationiteration:Tt("Animation","AnimationIteration"),animationstart:Tt("Animation","AnimationStart"),transitionend:Tt("Transition","TransitionEnd")},wt={},St={};function Rt(e){if(wt[e])return wt[e];if(!xt[e])return e;var t,n=xt[e];for(t in n)if(n.hasOwnProperty(t)&&t in St)return wt[e]=n[t];return e}d&&(St=document.createElement("div").style,"AnimationEvent"in window||(delete xt.animationend.animation,delete xt.animationiteration.animation,delete xt.animationstart.animation),"TransitionEvent"in window||delete xt.transitionend.transition);var kt=Rt("animationend"),Ct=Rt("animationiteration"),Ot=Rt("animationstart"),At=Rt("transitionend"),Nt=new Map,It=new Map,Lt=["abort","abort",kt,"animationEnd",Ct,"animationIteration",Ot,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",At,"transitionEnd","waiting","waiting"];function Dt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];i="on"+(i[0].toUpperCase()+i.slice(1)),It.set(r,t),Nt.set(r,i),c(i,[r])}}(0,s.unstable_now)();var Pt=8;function Mt(e){if(0!=(1&e))return Pt=15,1;if(0!=(2&e))return Pt=14,2;if(0!=(4&e))return Pt=13,4;var t=24&e;return 0!==t?(Pt=12,t):0!=(32&e)?(Pt=11,32):0!==(t=192&e)?(Pt=10,t):0!=(256&e)?(Pt=9,256):0!==(t=3584&e)?(Pt=8,t):0!=(4096&e)?(Pt=7,4096):0!==(t=4186112&e)?(Pt=6,t):0!==(t=62914560&e)?(Pt=5,t):67108864&e?(Pt=4,67108864):0!=(134217728&e)?(Pt=3,134217728):0!==(t=805306368&e)?(Pt=2,t):0!=(1073741824&e)?(Pt=1,1073741824):(Pt=8,e)}function Ft(e,t){var n=e.pendingLanes;if(0===n)return Pt=0;var r=0,i=0,s=e.expiredLanes,o=e.suspendedLanes,a=e.pingedLanes;if(0!==s)r=s,i=Pt=15;else if(0!==(s=134217727&n)){var l=s&~o;0!==l?(r=Mt(l),i=Pt):0!==(a&=s)&&(r=Mt(a),i=Pt)}else 0!==(s=n&~o)?(r=Mt(s),i=Pt):0!==a&&(r=Mt(a),i=Pt);if(0===r)return 0;if(r=n&((0>(r=31-zt(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0==(t&o)){if(Mt(t),i<=Pt)return t;Pt=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-zt(t)),r|=e[n],t&=~i;return r}function Ut(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function jt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=Bt(24&~t))?jt(10,t):e;case 10:return 0===(e=Bt(192&~t))?jt(8,t):e;case 8:return 0===(e=Bt(3584&~t))&&(0===(e=Bt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=Bt(805306368&~t))&&(t=268435456),t}throw Error(o(358,e))}function Bt(e){return e&-e}function Ht(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $t(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-zt(t)]=n}var zt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Vt(e)/Gt|0)|0},Vt=Math.log,Gt=Math.LN2;var Wt=s.unstable_UserBlockingPriority,Kt=s.unstable_runWithPriority,Yt=!0;function Zt(e,t,n,r){Me||De();var i=Qt,s=Me;Me=!0;try{Le(i,e,t,n,r)}finally{(Me=s)||Ue()}}function qt(e,t,n,r){Kt(Wt,Qt.bind(null,e,t,n,r))}function Qt(e,t,n,r){var i;if(Yt)if((i=0==(4&t))&&0<st.length&&-1<ht.indexOf(e))e=pt(null,e,t,n,r),st.push(e);else{var s=Xt(e,t,n,r);if(null===s)i&&ft(e,r);else{if(i){if(-1<ht.indexOf(e))return e=pt(s,e,t,n,r),void st.push(e);if(function(e,t,n,r,i){switch(t){case"focusin":return ot=gt(ot,e,t,n,r,i),!0;case"dragenter":return at=gt(at,e,t,n,r,i),!0;case"mouseover":return lt=gt(lt,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return ct.set(s,gt(ct.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,ut.set(s,gt(ut.get(s)||null,e,t,n,r,i)),!0}return!1}(s,e,t,n,r))return;ft(e,r)}Dr(e,t,r,null,n)}}}function Xt(e,t,n,r){var i=Se(r);if(null!==(i=ti(i))){var s=Ze(i);if(null===s)i=null;else{var o=s.tag;if(13===o){if(null!==(i=qe(s)))return i;i=null}else if(3===o){if(s.stateNode.hydrate)return 3===s.tag?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Dr(e,t,r,i,n),null}var Jt=null,en=null,tn=null;function nn(){if(tn)return tn;var e,t,n=en,r=n.length,i="value"in Jt?Jt.value:Jt.textContent,s=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[s-t];t++);return tn=i.slice(e,1<t?1-t:void 0)}function rn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function sn(){return!0}function on(){return!1}function an(e){function t(t,n,r,i,s){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=s,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?sn:on,this.isPropagationStopped=on,this}return i(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=sn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=sn)},persist:function(){},isPersistent:sn}),t}var ln,cn,un,dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hn=an(dn),pn=i({},dn,{view:0,detail:0}),fn=an(pn),gn=i({},pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==un&&(un&&"mousemove"===e.type?(ln=e.screenX-un.screenX,cn=e.screenY-un.screenY):cn=ln=0,un=e),ln)},movementY:function(e){return"movementY"in e?e.movementY:cn}}),mn=an(gn),yn=an(i({},gn,{dataTransfer:0})),bn=an(i({},pn,{relatedTarget:0})),vn=an(i({},dn,{animationName:0,elapsedTime:0,pseudoElement:0})),En=i({},dn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_n=an(En),Tn=an(i({},dn,{data:0})),xn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sn[e])&&!!t[e]}function kn(){return Rn}var Cn=i({},pn,{key:function(e){if(e.key){var t=xn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=rn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?wn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kn,charCode:function(e){return"keypress"===e.type?rn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?rn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),On=an(Cn),An=an(i({},gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Nn=an(i({},pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kn})),In=an(i({},dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Ln=i({},gn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Dn=an(Ln),Pn=[9,13,27,32],Mn=d&&"CompositionEvent"in window,Fn=null;d&&"documentMode"in document&&(Fn=document.documentMode);var Un=d&&"TextEvent"in window&&!Fn,jn=d&&(!Mn||Fn&&8<Fn&&11>=Fn),Bn=String.fromCharCode(32),Hn=!1;function $n(e,t){switch(e){case"keyup":return-1!==Pn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Vn=!1;var Gn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Gn[e.type]:"textarea"===t}function Kn(e,t,n,r){Ae(r),0<(t=Mr(t,"onChange")).length&&(n=new hn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yn=null,Zn=null;function qn(e){Cr(e,0)}function Qn(e){if(Q(ri(e)))return e}function Xn(e,t){if("change"===e)return t}var Jn=!1;if(d){var er;if(d){var tr="oninput"in document;if(!tr){var nr=document.createElement("div");nr.setAttribute("oninput","return;"),tr="function"==typeof nr.oninput}er=tr}else er=!1;Jn=er&&(!document.documentMode||9<document.documentMode)}function rr(){Yn&&(Yn.detachEvent("onpropertychange",ir),Zn=Yn=null)}function ir(e){if("value"===e.propertyName&&Qn(Zn)){var t=[];if(Kn(t,Zn,e,Se(e)),e=qn,Me)e(t);else{Me=!0;try{Ie(e,t)}finally{Me=!1,Ue()}}}}function sr(e,t,n){"focusin"===e?(rr(),Zn=n,(Yn=t).attachEvent("onpropertychange",ir)):"focusout"===e&&rr()}function or(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Qn(Zn)}function ar(e,t){if("click"===e)return Qn(t)}function lr(e,t){if("input"===e||"change"===e)return Qn(t)}var cr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},ur=Object.prototype.hasOwnProperty;function dr(e,t){if(cr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!ur.call(t,n[r])||!cr(e[n[r]],t[n[r]]))return!1;return!0}function hr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pr(e,t){var n,r=hr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=hr(r)}}function fr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?fr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function gr(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=X((e=t.contentWindow).document)}return t}function mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var yr=d&&"documentMode"in document&&11>=document.documentMode,br=null,vr=null,Er=null,_r=!1;function Tr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;_r||null==br||br!==X(r)||("selectionStart"in(r=br)&&mr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},Er&&dr(Er,r)||(Er=r,0<(r=Mr(vr,"onSelect")).length&&(t=new hn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=br)))}Dt("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Dt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Dt(Lt,2);for(var xr="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),wr=0;wr<xr.length;wr++)It.set(xr[wr],0);u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Rr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Sr));function kr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,s,a,l,c){if(Ye.apply(this,arguments),ze){if(!ze)throw Error(o(198));var u=Ve;ze=!1,Ve=null,Ge||(Ge=!0,We=u)}}(r,t,void 0,e),e.currentTarget=null}function Cr(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;kr(i,a,c),s=l}else for(o=0;o<r.length;o++){if(l=(a=r[o]).instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;kr(i,a,c),s=l}}}if(Ge)throw e=We,Ge=!1,We=null,e}function Or(e,t){var n=si(t),r=e+"__bubble";n.has(r)||(Lr(t,e,2,!1),n.add(r))}var Ar="_reactListening"+Math.random().toString(36).slice(2);function Nr(e){e[Ar]||(e[Ar]=!0,a.forEach((function(t){Rr.has(t)||Ir(t,!1,e,null),Ir(t,!0,e,null)})))}function Ir(e,t,n,r){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,s=n;if("selectionchange"===e&&9!==n.nodeType&&(s=n.ownerDocument),null!==r&&!t&&Rr.has(e)){if("scroll"!==e)return;i|=2,s=r}var o=si(s),a=e+"__"+(t?"capture":"bubble");o.has(a)||(t&&(i|=4),Lr(s,e,i,t),o.add(a))}function Lr(e,t,n,r){var i=It.get(t);switch(void 0===i?2:i){case 0:i=Zt;break;case 1:i=qt;break;default:i=Qt}n=i.bind(null,t,n,e),i=void 0,!Be||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Dr(e,t,n,r,i){var s=r;if(0==(1&t)&&0==(2&t)&&null!==r)e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var a=r.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var l=o.tag;if((3===l||4===l)&&((l=o.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;o=o.return}for(;null!==a;){if(null===(o=ti(a)))return;if(5===(l=o.tag)||6===l){r=s=o;continue e}a=a.parentNode}}r=r.return}!function(e,t,n){if(Fe)return e(t,n);Fe=!0;try{return Pe(e,t,n)}finally{Fe=!1,Ue()}}((function(){var r=s,i=Se(n),o=[];e:{var a=Nt.get(e);if(void 0!==a){var l=hn,c=e;switch(e){case"keypress":if(0===rn(n))break e;case"keydown":case"keyup":l=On;break;case"focusin":c="focus",l=bn;break;case"focusout":c="blur",l=bn;break;case"beforeblur":case"afterblur":l=bn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=mn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Nn;break;case kt:case Ct:case Ot:l=vn;break;case At:l=In;break;case"scroll":l=fn;break;case"wheel":l=Dn;break;case"copy":case"cut":case"paste":l=_n;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=An}var u=0!=(4&t),d=!u&&"scroll"===e,h=u?null!==a?a+"Capture":null:a;u=[];for(var p,f=r;null!==f;){var g=(p=f).stateNode;if(5===p.tag&&null!==g&&(p=g,null!==h&&(null!=(g=je(f,h))&&u.push(Pr(f,g,p)))),d)break;f=f.return}0<u.length&&(a=new l(a,c,null,n,i),o.push({event:a,listeners:u}))}}if(0==(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||0!=(16&t)||!(c=n.relatedTarget||n.fromElement)||!ti(c)&&!c[Jr])&&(l||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?ti(c):null)&&(c!==(d=Ze(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=mn,g="onMouseLeave",h="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(u=An,g="onPointerLeave",h="onPointerEnter",f="pointer"),d=null==l?a:ri(l),p=null==c?a:ri(c),(a=new u(g,f+"leave",l,n,i)).target=d,a.relatedTarget=p,g=null,ti(i)===r&&((u=new u(h,f+"enter",c,n,i)).target=p,u.relatedTarget=d,g=u),d=g,l&&c)e:{for(h=c,f=0,p=u=l;p;p=Fr(p))f++;for(p=0,g=h;g;g=Fr(g))p++;for(;0<f-p;)u=Fr(u),f--;for(;0<p-f;)h=Fr(h),p--;for(;f--;){if(u===h||null!==h&&u===h.alternate)break e;u=Fr(u),h=Fr(h)}u=null}else u=null;null!==l&&Ur(o,a,l,u,!1),null!==c&&null!==d&&Ur(o,d,c,u,!0)}if("select"===(l=(a=r?ri(r):window).nodeName&&a.nodeName.toLowerCase())||"input"===l&&"file"===a.type)var m=Xn;else if(Wn(a))if(Jn)m=lr;else{m=or;var y=sr}else(l=a.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(m=ar);switch(m&&(m=m(e,r))?Kn(o,m,n,i):(y&&y(e,a,r),"focusout"===e&&(y=a._wrapperState)&&y.controlled&&"number"===a.type&&ie(a,"number",a.value)),y=r?ri(r):window,e){case"focusin":(Wn(y)||"true"===y.contentEditable)&&(br=y,vr=r,Er=null);break;case"focusout":Er=vr=br=null;break;case"mousedown":_r=!0;break;case"contextmenu":case"mouseup":case"dragend":_r=!1,Tr(o,n,i);break;case"selectionchange":if(yr)break;case"keydown":case"keyup":Tr(o,n,i)}var b;if(Mn)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else Vn?$n(e,n)&&(v="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(v="onCompositionStart");v&&(jn&&"ko"!==n.locale&&(Vn||"onCompositionStart"!==v?"onCompositionEnd"===v&&Vn&&(b=nn()):(en="value"in(Jt=i)?Jt.value:Jt.textContent,Vn=!0)),0<(y=Mr(r,v)).length&&(v=new Tn(v,e,null,n,i),o.push({event:v,listeners:y}),b?v.data=b:null!==(b=zn(n))&&(v.data=b))),(b=Un?function(e,t){switch(e){case"compositionend":return zn(t);case"keypress":return 32!==t.which?null:(Hn=!0,Bn);case"textInput":return(e=t.data)===Bn&&Hn?null:e;default:return null}}(e,n):function(e,t){if(Vn)return"compositionend"===e||!Mn&&$n(e,t)?(e=nn(),tn=en=Jt=null,Vn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return jn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Mr(r,"onBeforeInput")).length&&(i=new Tn("onBeforeInput","beforeinput",null,n,i),o.push({event:i,listeners:r}),i.data=b))}Cr(o,t)}))}function Pr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Mr(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,s=i.stateNode;5===i.tag&&null!==s&&(i=s,null!=(s=je(e,n))&&r.unshift(Pr(e,s,i)),null!=(s=je(e,t))&&r.push(Pr(e,s,i))),e=e.return}return r}function Fr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Ur(e,t,n,r,i){for(var s=t._reactName,o=[];null!==n&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(null!==l&&l===r)break;5===a.tag&&null!==c&&(a=c,i?null!=(l=je(n,s))&&o.unshift(Pr(n,l,a)):i||null!=(l=je(n,s))&&o.push(Pr(n,l,a))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}function jr(){}var Br=null,Hr=null;function $r(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function zr(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Vr="function"==typeof setTimeout?setTimeout:void 0,Gr="function"==typeof clearTimeout?clearTimeout:void 0;function Wr(e){1===e.nodeType?e.textContent="":9===e.nodeType&&(null!=(e=e.body)&&(e.textContent=""))}function Kr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Yr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Zr=0;var qr=Math.random().toString(36).slice(2),Qr="__reactFiber$"+qr,Xr="__reactProps$"+qr,Jr="__reactContainer$"+qr,ei="__reactEvents$"+qr;function ti(e){var t=e[Qr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Jr]||n[Qr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Yr(e);null!==e;){if(n=e[Qr])return n;e=Yr(e)}return t}n=(e=n).parentNode}return null}function ni(e){return!(e=e[Qr]||e[Jr])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ri(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function ii(e){return e[Xr]||null}function si(e){var t=e[ei];return void 0===t&&(t=e[ei]=new Set),t}var oi=[],ai=-1;function li(e){return{current:e}}function ci(e){0>ai||(e.current=oi[ai],oi[ai]=null,ai--)}function ui(e,t){ai++,oi[ai]=e.current,e.current=t}var di={},hi=li(di),pi=li(!1),fi=di;function gi(e,t){var n=e.type.contextTypes;if(!n)return di;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,s={};for(i in n)s[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function mi(e){return null!=(e=e.childContextTypes)}function yi(){ci(pi),ci(hi)}function bi(e,t,n){if(hi.current!==di)throw Error(o(168));ui(hi,t),ui(pi,n)}function vi(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var s in r=r.getChildContext())if(!(s in e))throw Error(o(108,K(t)||"Unknown",s));return i({},n,r)}function Ei(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||di,fi=hi.current,ui(hi,e),ui(pi,pi.current),!0}function _i(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=vi(e,t,fi),r.__reactInternalMemoizedMergedChildContext=e,ci(pi),ci(hi),ui(hi,e)):ci(pi),ui(pi,n)}var Ti=null,xi=null,wi=s.unstable_runWithPriority,Si=s.unstable_scheduleCallback,Ri=s.unstable_cancelCallback,ki=s.unstable_shouldYield,Ci=s.unstable_requestPaint,Oi=s.unstable_now,Ai=s.unstable_getCurrentPriorityLevel,Ni=s.unstable_ImmediatePriority,Ii=s.unstable_UserBlockingPriority,Li=s.unstable_NormalPriority,Di=s.unstable_LowPriority,Pi=s.unstable_IdlePriority,Mi={},Fi=void 0!==Ci?Ci:function(){},Ui=null,ji=null,Bi=!1,Hi=Oi(),$i=1e4>Hi?Oi:function(){return Oi()-Hi};function zi(){switch(Ai()){case Ni:return 99;case Ii:return 98;case Li:return 97;case Di:return 96;case Pi:return 95;default:throw Error(o(332))}}function Vi(e){switch(e){case 99:return Ni;case 98:return Ii;case 97:return Li;case 96:return Di;case 95:return Pi;default:throw Error(o(332))}}function Gi(e,t){return e=Vi(e),wi(e,t)}function Wi(e,t,n){return e=Vi(e),Si(e,t,n)}function Ki(){if(null!==ji){var e=ji;ji=null,Ri(e)}Yi()}function Yi(){if(!Bi&&null!==Ui){Bi=!0;var e=0;try{var t=Ui;Gi(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Ui=null}catch(n){throw null!==Ui&&(Ui=Ui.slice(e+1)),Si(Ni,Ki),n}finally{Bi=!1}}}var Zi=_.ReactCurrentBatchConfig;function qi(e,t){if(e&&e.defaultProps){for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Qi=li(null),Xi=null,Ji=null,es=null;function ts(){es=Ji=Xi=null}function ns(e){var t=Qi.current;ci(Qi),e.type._context._currentValue=t}function rs(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function is(e,t){Xi=e,es=Ji=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Mo=!0),e.firstContext=null)}function ss(e,t){if(es!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(es=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Ji){if(null===Xi)throw Error(o(308));Ji=t,Xi.dependencies={lanes:0,firstContext:t,responders:null}}else Ji=Ji.next=t;return e._currentValue}var os=!1;function as(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function ls(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function cs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function us(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function ds(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function hs(e,t,n,r){var s=e.updateQueue;os=!1;var o=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(null!==l){s.shared.pending=null;var c=l,u=c.next;c.next=null,null===a?o=u:a.next=u,a=c;var d=e.alternate;if(null!==d){var h=(d=d.updateQueue).lastBaseUpdate;h!==a&&(null===h?d.firstBaseUpdate=u:h.next=u,d.lastBaseUpdate=c)}}if(null!==o){for(h=s.baseState,a=0,d=u=c=null;;){l=o.lane;var p=o.eventTime;if((r&l)===l){null!==d&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var f=e,g=o;switch(l=t,p=n,g.tag){case 1:if("function"==typeof(f=g.payload)){h=f.call(p,h,l);break e}h=f;break e;case 3:f.flags=-4097&f.flags|64;case 0:if(null==(l="function"==typeof(f=g.payload)?f.call(p,h,l):f))break e;h=i({},h,l);break e;case 2:os=!0}}null!==o.callback&&(e.flags|=32,null===(l=s.effects)?s.effects=[o]:l.push(o))}else p={eventTime:p,lane:l,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===d?(u=d=p,c=h):d=d.next=p,a|=l;if(null===(o=o.next)){if(null===(l=s.shared.pending))break;o=l.next,l.next=null,s.lastBaseUpdate=l,s.shared.pending=null}}null===d&&(c=h),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,Ha|=a,e.lanes=a,e.memoizedState=h}}function ps(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(o(191,i));i.call(r)}}}var fs=(new r.Component).refs;function gs(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:i({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ms={isMounted:function(e){return!!(e=e._reactInternals)&&Ze(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hl(),i=pl(e),s=cs(r,i);s.payload=t,null!=n&&(s.callback=n),us(e,s),fl(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hl(),i=pl(e),s=cs(r,i);s.tag=1,s.payload=t,null!=n&&(s.callback=n),us(e,s),fl(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hl(),r=pl(e),i=cs(n,r);i.tag=2,null!=t&&(i.callback=t),us(e,i),fl(e,r,n)}};function ys(e,t,n,r,i,s,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,s,o):!t.prototype||!t.prototype.isPureReactComponent||(!dr(n,r)||!dr(i,s))}function bs(e,t,n){var r=!1,i=di,s=t.contextType;return"object"==typeof s&&null!==s?s=ss(s):(i=mi(t)?fi:hi.current,s=(r=null!=(r=t.contextTypes))?gi(e,i):di),t=new t(n,s),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ms,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function vs(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ms.enqueueReplaceState(t,t.state,null)}function Es(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=fs,as(e);var s=t.contextType;"object"==typeof s&&null!==s?i.context=ss(s):(s=mi(t)?fi:hi.current,i.context=gi(e,s)),hs(e,n,i,r),i.state=e.memoizedState,"function"==typeof(s=t.getDerivedStateFromProps)&&(gs(e,t,s,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ms.enqueueReplaceState(i,i.state,null),hs(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var _s=Array.isArray;function Ts(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=r.refs;t===fs&&(t=r.refs={}),null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!=typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function xs(e,t){if("textarea"!==e.type)throw Error(o(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function ws(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Wl(e,t)).index=0,e.sibling=null,e}function s(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function a(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=ql(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function c(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=Ts(e,t,n),r.return=e,r):((r=Kl(n.type,n.key,n.props,null,e.mode,r)).ref=Ts(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Ql(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,s){return null===t||7!==t.tag?((t=Yl(n,e.mode,r,s)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=ql(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case T:return(n=Kl(t.type,t.key,t.props,null,e.mode,n)).ref=Ts(e,null,t),n.return=e,n;case x:return(t=Ql(t,e.mode,n)).return=e,t}if(_s(t)||$(t))return(t=Yl(t,e.mode,n,null)).return=e,t;xs(e,t)}return null}function p(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case T:return n.key===i?n.type===w?d(e,t,n.props.children,r,i):c(e,t,n,r):null;case x:return n.key===i?u(e,t,n,r):null}if(_s(n)||$(n))return null!==i?null:d(e,t,n,r,null);xs(e,n)}return null}function f(e,t,n,r,i){if("string"==typeof r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case T:return e=e.get(null===r.key?n:r.key)||null,r.type===w?d(t,e,r.props.children,i,r.key):c(t,e,r,i);case x:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(_s(r)||$(r))return d(t,e=e.get(n)||null,r,i,null);xs(t,r)}return null}function g(i,o,a,l){for(var c=null,u=null,d=o,g=o=0,m=null;null!==d&&g<a.length;g++){d.index>g?(m=d,d=null):m=d.sibling;var y=p(i,d,a[g],l);if(null===y){null===d&&(d=m);break}e&&d&&null===y.alternate&&t(i,d),o=s(y,o,g),null===u?c=y:u.sibling=y,u=y,d=m}if(g===a.length)return n(i,d),c;if(null===d){for(;g<a.length;g++)null!==(d=h(i,a[g],l))&&(o=s(d,o,g),null===u?c=d:u.sibling=d,u=d);return c}for(d=r(i,d);g<a.length;g++)null!==(m=f(d,i,g,a[g],l))&&(e&&null!==m.alternate&&d.delete(null===m.key?g:m.key),o=s(m,o,g),null===u?c=m:u.sibling=m,u=m);return e&&d.forEach((function(e){return t(i,e)})),c}function m(i,a,l,c){var u=$(l);if("function"!=typeof u)throw Error(o(150));if(null==(l=u.call(l)))throw Error(o(151));for(var d=u=null,g=a,m=a=0,y=null,b=l.next();null!==g&&!b.done;m++,b=l.next()){g.index>m?(y=g,g=null):y=g.sibling;var v=p(i,g,b.value,c);if(null===v){null===g&&(g=y);break}e&&g&&null===v.alternate&&t(i,g),a=s(v,a,m),null===d?u=v:d.sibling=v,d=v,g=y}if(b.done)return n(i,g),u;if(null===g){for(;!b.done;m++,b=l.next())null!==(b=h(i,b.value,c))&&(a=s(b,a,m),null===d?u=b:d.sibling=b,d=b);return u}for(g=r(i,g);!b.done;m++,b=l.next())null!==(b=f(g,i,m,b.value,c))&&(e&&null!==b.alternate&&g.delete(null===b.key?m:b.key),a=s(b,a,m),null===d?u=b:d.sibling=b,d=b);return e&&g.forEach((function(e){return t(i,e)})),u}return function(e,r,s,l){var c="object"==typeof s&&null!==s&&s.type===w&&null===s.key;c&&(s=s.props.children);var u="object"==typeof s&&null!==s;if(u)switch(s.$$typeof){case T:e:{for(u=s.key,c=r;null!==c;){if(c.key===u){if(7===c.tag){if(s.type===w){n(e,c.sibling),(r=i(c,s.props.children)).return=e,e=r;break e}}else if(c.elementType===s.type){n(e,c.sibling),(r=i(c,s.props)).ref=Ts(e,c,s),r.return=e,e=r;break e}n(e,c);break}t(e,c),c=c.sibling}s.type===w?((r=Yl(s.props.children,e.mode,l,s.key)).return=e,e=r):((l=Kl(s.type,s.key,s.props,null,e.mode,l)).ref=Ts(e,r,s),l.return=e,e=l)}return a(e);case x:e:{for(c=s.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===s.containerInfo&&r.stateNode.implementation===s.implementation){n(e,r.sibling),(r=i(r,s.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Ql(s,e.mode,l)).return=e,e=r}return a(e)}if("string"==typeof s||"number"==typeof s)return s=""+s,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,s)).return=e,e=r):(n(e,r),(r=ql(s,e.mode,l)).return=e,e=r),a(e);if(_s(s))return g(e,r,s,l);if($(s))return m(e,r,s,l);if(u&&xs(e,s),void 0===s&&!c)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(o(152,K(e.type)||"Component"))}return n(e,r)}}var Ss=ws(!0),Rs=ws(!1),ks={},Cs=li(ks),Os=li(ks),As=li(ks);function Ns(e){if(e===ks)throw Error(o(174));return e}function Is(e,t){switch(ui(As,t),ui(Os,e),ui(Cs,ks),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:pe(null,"");break;default:t=pe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ci(Cs),ui(Cs,t)}function Ls(){ci(Cs),ci(Os),ci(As)}function Ds(e){Ns(As.current);var t=Ns(Cs.current),n=pe(t,e.type);t!==n&&(ui(Os,e),ui(Cs,n))}function Ps(e){Os.current===e&&(ci(Cs),ci(Os))}var Ms=li(0);function Fs(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Us=null,js=null,Bs=!1;function Hs(e,t){var n=Vl(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function $s(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function zs(e){if(Bs){var t=js;if(t){var n=t;if(!$s(e,t)){if(!(t=Kr(n.nextSibling))||!$s(e,t))return e.flags=-1025&e.flags|2,Bs=!1,void(Us=e);Hs(Us,n)}Us=e,js=Kr(t.firstChild)}else e.flags=-1025&e.flags|2,Bs=!1,Us=e}}function Vs(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Us=e}function Gs(e){if(e!==Us)return!1;if(!Bs)return Vs(e),Bs=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!zr(t,e.memoizedProps))for(t=js;t;)Hs(e,t),t=Kr(t.nextSibling);if(Vs(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){js=Kr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}js=null}}else js=Us?Kr(e.stateNode.nextSibling):null;return!0}function Ws(){js=Us=null,Bs=!1}var Ks=[];function Ys(){for(var e=0;e<Ks.length;e++)Ks[e]._workInProgressVersionPrimary=null;Ks.length=0}var Zs=_.ReactCurrentDispatcher,qs=_.ReactCurrentBatchConfig,Qs=0,Xs=null,Js=null,eo=null,to=!1,no=!1;function ro(){throw Error(o(321))}function io(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cr(e[n],t[n]))return!1;return!0}function so(e,t,n,r,i,s){if(Qs=s,Xs=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Zs.current=null===e||null===e.memoizedState?Io:Lo,e=n(r,i),no){s=0;do{if(no=!1,!(25>s))throw Error(o(301));s+=1,eo=Js=null,t.updateQueue=null,Zs.current=Do,e=n(r,i)}while(no)}if(Zs.current=No,t=null!==Js&&null!==Js.next,Qs=0,eo=Js=Xs=null,to=!1,t)throw Error(o(300));return e}function oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===eo?Xs.memoizedState=eo=e:eo=eo.next=e,eo}function ao(){if(null===Js){var e=Xs.alternate;e=null!==e?e.memoizedState:null}else e=Js.next;var t=null===eo?Xs.memoizedState:eo.next;if(null!==t)eo=t,Js=e;else{if(null===e)throw Error(o(310));e={memoizedState:(Js=e).memoizedState,baseState:Js.baseState,baseQueue:Js.baseQueue,queue:Js.queue,next:null},null===eo?Xs.memoizedState=eo=e:eo=eo.next=e}return eo}function lo(e,t){return"function"==typeof t?t(e):t}function co(e){var t=ao(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=Js,i=r.baseQueue,s=n.pending;if(null!==s){if(null!==i){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var l=a=s=null,c=i;do{var u=c.lane;if((Qs&u)===u)null!==l&&(l=l.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===e?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===l?(a=l=d,s=r):l=l.next=d,Xs.lanes|=u,Ha|=u}c=c.next}while(null!==c&&c!==i);null===l?s=r:l.next=a,cr(r,t.memoizedState)||(Mo=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function uo(e){var t=ao(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{s=e(s,a.action),a=a.next}while(a!==i);cr(s,t.memoizedState)||(Mo=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function ho(e,t,n){var r=t._getVersion;r=r(t._source);var i=t._workInProgressVersionPrimary;if(null!==i?e=i===r:(e=e.mutableReadLanes,(e=(Qs&e)===e)&&(t._workInProgressVersionPrimary=r,Ks.push(t))),e)return n(t._source);throw Ks.push(t),Error(o(350))}function po(e,t,n,r){var i=La;if(null===i)throw Error(o(349));var s=t._getVersion,a=s(t._source),l=Zs.current,c=l.useState((function(){return ho(i,t,n)})),u=c[1],d=c[0];c=eo;var h=e.memoizedState,p=h.refs,f=p.getSnapshot,g=h.source;h=h.subscribe;var m=Xs;return e.memoizedState={refs:p,source:t,subscribe:r},l.useEffect((function(){p.getSnapshot=n,p.setSnapshot=u;var e=s(t._source);if(!cr(a,e)){e=n(t._source),cr(d,e)||(u(e),e=pl(m),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var r=i.entanglements,o=e;0<o;){var l=31-zt(o),c=1<<l;r[l]|=e,o&=~c}}}),[n,t,r]),l.useEffect((function(){return r(t._source,(function(){var e=p.getSnapshot,n=p.setSnapshot;try{n(e(t._source));var r=pl(m);i.mutableReadLanes|=r&i.pendingLanes}catch(s){n((function(){throw s}))}}))}),[t,r]),cr(f,n)&&cr(g,t)&&cr(h,r)||((e={pending:null,dispatch:null,lastRenderedReducer:lo,lastRenderedState:d}).dispatch=u=Ao.bind(null,Xs,e),c.queue=e,c.baseQueue=null,d=ho(i,t,n),c.memoizedState=c.baseState=d),d}function fo(e,t,n){return po(ao(),e,t,n)}function go(e){var t=oo();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:lo,lastRenderedState:e}).dispatch=Ao.bind(null,Xs,e),[t.memoizedState,e]}function mo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=Xs.updateQueue)?(t={lastEffect:null},Xs.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function yo(e){return e={current:e},oo().memoizedState=e}function bo(){return ao().memoizedState}function vo(e,t,n,r){var i=oo();Xs.flags|=e,i.memoizedState=mo(1|t,n,void 0,void 0===r?null:r)}function Eo(e,t,n,r){var i=ao();r=void 0===r?null:r;var s=void 0;if(null!==Js){var o=Js.memoizedState;if(s=o.destroy,null!==r&&io(r,o.deps))return void mo(t,n,s,r)}Xs.flags|=e,i.memoizedState=mo(1|t,n,s,r)}function _o(e,t){return vo(516,4,e,t)}function To(e,t){return Eo(516,4,e,t)}function xo(e,t){return Eo(4,2,e,t)}function wo(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function So(e,t,n){return n=null!=n?n.concat([e]):null,Eo(4,2,wo.bind(null,t,e),n)}function Ro(){}function ko(e,t){var n=ao();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&io(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Co(e,t){var n=ao();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&io(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Oo(e,t){var n=zi();Gi(98>n?98:n,(function(){e(!0)})),Gi(97<n?97:n,(function(){var n=qs.transition;qs.transition=1;try{e(!1),t()}finally{qs.transition=n}}))}function Ao(e,t,n){var r=hl(),i=pl(e),s={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},o=t.pending;if(null===o?s.next=s:(s.next=o.next,o.next=s),t.pending=s,o=e.alternate,e===Xs||null!==o&&o===Xs)no=to=!0;else{if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var a=t.lastRenderedState,l=o(a,n);if(s.eagerReducer=o,s.eagerState=l,cr(l,a))return}catch(c){}fl(e,i,r)}}var No={readContext:ss,useCallback:ro,useContext:ro,useEffect:ro,useImperativeHandle:ro,useLayoutEffect:ro,useMemo:ro,useReducer:ro,useRef:ro,useState:ro,useDebugValue:ro,useDeferredValue:ro,useTransition:ro,useMutableSource:ro,useOpaqueIdentifier:ro,unstable_isNewReconciler:!1},Io={readContext:ss,useCallback:function(e,t){return oo().memoizedState=[e,void 0===t?null:t],e},useContext:ss,useEffect:_o,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,vo(4,2,wo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vo(4,2,e,t)},useMemo:function(e,t){var n=oo();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=oo();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Ao.bind(null,Xs,e),[r.memoizedState,e]},useRef:yo,useState:go,useDebugValue:Ro,useDeferredValue:function(e){var t=go(e),n=t[0],r=t[1];return _o((function(){var t=qs.transition;qs.transition=1;try{r(e)}finally{qs.transition=t}}),[e]),n},useTransition:function(){var e=go(!1),t=e[0];return yo(e=Oo.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=oo();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},po(r,e,t,n)},useOpaqueIdentifier:function(){if(Bs){var e=!1,t=function(e){return{$$typeof:P,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Zr++).toString(36))),Error(o(355))})),n=go(t)[1];return 0==(2&Xs.mode)&&(Xs.flags|=516,mo(5,(function(){n("r:"+(Zr++).toString(36))}),void 0,null)),t}return go(t="r:"+(Zr++).toString(36)),t},unstable_isNewReconciler:!1},Lo={readContext:ss,useCallback:ko,useContext:ss,useEffect:To,useImperativeHandle:So,useLayoutEffect:xo,useMemo:Co,useReducer:co,useRef:bo,useState:function(){return co(lo)},useDebugValue:Ro,useDeferredValue:function(e){var t=co(lo),n=t[0],r=t[1];return To((function(){var t=qs.transition;qs.transition=1;try{r(e)}finally{qs.transition=t}}),[e]),n},useTransition:function(){var e=co(lo)[0];return[bo().current,e]},useMutableSource:fo,useOpaqueIdentifier:function(){return co(lo)[0]},unstable_isNewReconciler:!1},Do={readContext:ss,useCallback:ko,useContext:ss,useEffect:To,useImperativeHandle:So,useLayoutEffect:xo,useMemo:Co,useReducer:uo,useRef:bo,useState:function(){return uo(lo)},useDebugValue:Ro,useDeferredValue:function(e){var t=uo(lo),n=t[0],r=t[1];return To((function(){var t=qs.transition;qs.transition=1;try{r(e)}finally{qs.transition=t}}),[e]),n},useTransition:function(){var e=uo(lo)[0];return[bo().current,e]},useMutableSource:fo,useOpaqueIdentifier:function(){return uo(lo)[0]},unstable_isNewReconciler:!1},Po=_.ReactCurrentOwner,Mo=!1;function Fo(e,t,n,r){t.child=null===e?Rs(t,null,n,r):Ss(t,e.child,n,r)}function Uo(e,t,n,r,i){n=n.render;var s=t.ref;return is(t,i),r=so(e,t,n,r,s,i),null===e||Mo?(t.flags|=1,Fo(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,sa(e,t,i))}function jo(e,t,n,r,i,s){if(null===e){var o=n.type;return"function"!=typeof o||Gl(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Kl(n.type,null,r,t,t.mode,s)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Bo(e,t,o,r,i,s))}return o=e.child,0==(i&s)&&(i=o.memoizedProps,(n=null!==(n=n.compare)?n:dr)(i,r)&&e.ref===t.ref)?sa(e,t,s):(t.flags|=1,(e=Wl(o,r)).ref=t.ref,e.return=t,t.child=e)}function Bo(e,t,n,r,i,s){if(null!==e&&dr(e.memoizedProps,r)&&e.ref===t.ref){if(Mo=!1,0==(s&i))return t.lanes=e.lanes,sa(e,t,s);0!=(16384&e.flags)&&(Mo=!0)}return zo(e,t,n,r,s)}function Ho(e,t,n){var r=t.pendingProps,i=r.children,s=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},Tl(t,n);else{if(0==(1073741824&n))return e=null!==s?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},Tl(t,e),null;t.memoizedState={baseLanes:0},Tl(t,null!==s?s.baseLanes:n)}else null!==s?(r=s.baseLanes|n,t.memoizedState=null):r=n,Tl(t,r);return Fo(e,t,i,n),t.child}function $o(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function zo(e,t,n,r,i){var s=mi(n)?fi:hi.current;return s=gi(t,s),is(t,i),n=so(e,t,n,r,s,i),null===e||Mo?(t.flags|=1,Fo(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,sa(e,t,i))}function Vo(e,t,n,r,i){if(mi(n)){var s=!0;Ei(t)}else s=!1;if(is(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),bs(t,n,r),Es(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;"object"==typeof c&&null!==c?c=ss(c):c=gi(t,c=mi(n)?fi:hi.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof o.getSnapshotBeforeUpdate;d||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==r||l!==c)&&vs(t,o,r,c),os=!1;var h=t.memoizedState;o.state=h,hs(t,r,o,i),l=t.memoizedState,a!==r||h!==l||pi.current||os?("function"==typeof u&&(gs(t,n,u,r),l=t.memoizedState),(a=os||ys(t,n,a,r,h,l,c))?(d||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4)):("function"==typeof o.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):("function"==typeof o.componentDidMount&&(t.flags|=4),r=!1)}else{o=t.stateNode,ls(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:qi(t.type,a),o.props=c,d=t.pendingProps,h=o.context,"object"==typeof(l=n.contextType)&&null!==l?l=ss(l):l=gi(t,l=mi(n)?fi:hi.current);var p=n.getDerivedStateFromProps;(u="function"==typeof p||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==d||h!==l)&&vs(t,o,r,l),os=!1,h=t.memoizedState,o.state=h,hs(t,r,o,i);var f=t.memoizedState;a!==d||h!==f||pi.current||os?("function"==typeof p&&(gs(t,n,p,r),f=t.memoizedState),(c=os||ys(t,n,c,r,h,f,l))?(u||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,f,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,f,l)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=f),o.props=r,o.state=f,o.context=l,r=c):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=256),r=!1)}return Go(e,t,n,r,s,i)}function Go(e,t,n,r,i,s){$o(e,t);var o=0!=(64&t.flags);if(!r&&!o)return i&&_i(t,n,!1),sa(e,t,s);r=t.stateNode,Po.current=t;var a=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=Ss(t,e.child,null,s),t.child=Ss(t,null,a,s)):Fo(e,t,a,s),t.memoizedState=r.state,i&&_i(t,n,!0),t.child}function Wo(e){var t=e.stateNode;t.pendingContext?bi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&bi(0,t.context,!1),Is(e,t.containerInfo)}var Ko,Yo,Zo,qo,Qo={dehydrated:null,retryLane:0};function Xo(e,t,n){var r,i=t.pendingProps,s=Ms.current,o=!1;return(r=0!=(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!=(2&s)),r?(o=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(s|=1),ui(Ms,1&s),null===e?(void 0!==i.fallback&&zs(t),e=i.children,s=i.fallback,o?(e=Jo(t,e,s,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Qo,e):"number"==typeof i.unstable_expectedLoadTime?(e=Jo(t,e,s,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Qo,t.lanes=33554432,e):((n=Zl({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,o?(i=ta(e,t,i.children,i.fallback,n),o=t.child,s=e.child.memoizedState,o.memoizedState=null===s?{baseLanes:n}:{baseLanes:s.baseLanes|n},o.childLanes=e.childLanes&~n,t.memoizedState=Qo,i):(n=ea(e,t,i.children,n),t.memoizedState=null,n))}function Jo(e,t,n,r){var i=e.mode,s=e.child;return t={mode:"hidden",children:t},0==(2&i)&&null!==s?(s.childLanes=0,s.pendingProps=t):s=Zl(t,i,0,null),n=Yl(n,i,r,null),s.return=e,n.return=e,s.sibling=n,e.child=s,n}function ea(e,t,n,r){var i=e.child;return e=i.sibling,n=Wl(i,{mode:"visible",children:n}),0==(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function ta(e,t,n,r,i){var s=t.mode,o=e.child;e=o.sibling;var a={mode:"hidden",children:n};return 0==(2&s)&&t.child!==o?((n=t.child).childLanes=0,n.pendingProps=a,null!==(o=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=o,o.nextEffect=null):t.firstEffect=t.lastEffect=null):n=Wl(o,a),null!==e?r=Wl(e,r):(r=Yl(r,s,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function na(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),rs(e.return,t)}function ra(e,t,n,r,i,s){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.lastEffect=s)}function ia(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Fo(e,t,r.children,n),0!=(2&(r=Ms.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&na(e,n);else if(19===e.tag)na(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ui(Ms,r),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Fs(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ra(t,!1,i,n,s,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Fs(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ra(t,!0,n,null,s,t.lastEffect);break;case"together":ra(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function sa(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Ha|=t.lanes,0!=(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Wl(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Wl(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function oa(e,t){if(!Bs)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function aa(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return mi(t.type)&&yi(),null;case 3:return Ls(),ci(pi),ci(hi),Ys(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Gs(t)?t.flags|=4:r.hydrate||(t.flags|=256)),Yo(t),null;case 5:Ps(t);var s=Ns(As.current);if(n=t.type,null!==e&&null!=t.stateNode)Zo(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(o(166));return null}if(e=Ns(Cs.current),Gs(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Qr]=t,r[Xr]=a,n){case"dialog":Or("cancel",r),Or("close",r);break;case"iframe":case"object":case"embed":Or("load",r);break;case"video":case"audio":for(e=0;e<Sr.length;e++)Or(Sr[e],r);break;case"source":Or("error",r);break;case"img":case"image":case"link":Or("error",r),Or("load",r);break;case"details":Or("toggle",r);break;case"input":ee(r,a),Or("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},Or("invalid",r);break;case"textarea":le(r,a),Or("invalid",r)}for(var c in xe(n,a),e=null,a)a.hasOwnProperty(c)&&(s=a[c],"children"===c?"string"==typeof s?r.textContent!==s&&(e=["children",s]):"number"==typeof s&&r.textContent!==""+s&&(e=["children",""+s]):l.hasOwnProperty(c)&&null!=s&&"onScroll"===c&&Or("scroll",r));switch(n){case"input":q(r),re(r,a,!0);break;case"textarea":q(r),ue(r);break;case"select":case"option":break;default:"function"==typeof a.onClick&&(r.onclick=jr)}r=e,t.updateQueue=r,null!==r&&(t.flags|=4)}else{switch(c=9===s.nodeType?s:s.ownerDocument,e===de.html&&(e=he(n)),e===de.html?"script"===n?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),"select"===n&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[Qr]=t,e[Xr]=r,Ko(e,t,!1,!1),t.stateNode=e,c=we(n,r),n){case"dialog":Or("cancel",e),Or("close",e),s=r;break;case"iframe":case"object":case"embed":Or("load",e),s=r;break;case"video":case"audio":for(s=0;s<Sr.length;s++)Or(Sr[s],e);s=r;break;case"source":Or("error",e),s=r;break;case"img":case"image":case"link":Or("error",e),Or("load",e),s=r;break;case"details":Or("toggle",e),s=r;break;case"input":ee(e,r),s=J(e,r),Or("invalid",e);break;case"option":s=se(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=i({},r,{value:void 0}),Or("invalid",e);break;case"textarea":le(e,r),s=ae(e,r),Or("invalid",e);break;default:s=r}xe(n,s);var u=s;for(a in u)if(u.hasOwnProperty(a)){var d=u[a];"style"===a?_e(e,d):"dangerouslySetInnerHTML"===a?null!=(d=d?d.__html:void 0)&&me(e,d):"children"===a?"string"==typeof d?("textarea"!==n||""!==d)&&ye(e,d):"number"==typeof d&&ye(e,""+d):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(l.hasOwnProperty(a)?null!=d&&"onScroll"===a&&Or("scroll",e):null!=d&&E(e,a,d,c))}switch(n){case"input":q(e),re(e,r,!1);break;case"textarea":q(e),ue(e);break;case"option":null!=r.value&&e.setAttribute("value",""+Y(r.value));break;case"select":e.multiple=!!r.multiple,null!=(a=r.value)?oe(e,!!r.multiple,a,!1):null!=r.defaultValue&&oe(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof s.onClick&&(e.onclick=jr)}$r(n,r)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)qo(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(o(166));n=Ns(As.current),Ns(Cs.current),Gs(t)?(r=t.stateNode,n=t.memoizedProps,r[Qr]=t,r.nodeValue!==n&&(t.flags|=4)):((r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Qr]=t,t.stateNode=r)}return null;case 13:return ci(Ms),r=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(r=null!==r,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Gs(t):n=null!==e.memoizedState,r&&!n&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Ms.current)?0===Ua&&(Ua=3):(0!==Ua&&3!==Ua||(Ua=4),null===La||0==(134217727&Ha)&&0==(134217727&$a)||bl(La,Pa))),(r||n)&&(t.flags|=4),null);case 4:return Ls(),Yo(t),null===e&&Nr(t.stateNode.containerInfo),null;case 10:return ns(t),null;case 19:if(ci(Ms),null===(r=t.memoizedState))return null;if(a=0!=(64&t.flags),null===(c=r.rendering))if(a)oa(r,!1);else{if(0!==Ua||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(c=Fs(e))){for(t.flags|=64,oa(r,!1),null!==(a=c.updateQueue)&&(t.updateQueue=a,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=n,n=t.child;null!==n;)e=r,(a=n).flags&=2,a.nextEffect=null,a.firstEffect=null,a.lastEffect=null,null===(c=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,e=c.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ui(Ms,1&Ms.current|2),t.child}e=e.sibling}null!==r.tail&&$i()>Wa&&(t.flags|=64,a=!0,oa(r,!1),t.lanes=33554432)}else{if(!a)if(null!==(e=Fs(c))){if(t.flags|=64,a=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),oa(r,!0),null===r.tail&&"hidden"===r.tailMode&&!c.alternate&&!Bs)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*$i()-r.renderingStartTime>Wa&&1073741824!==n&&(t.flags|=64,a=!0,oa(r,!1),t.lanes=33554432);r.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=r.last)?n.sibling=c:t.child=c,r.last=c)}return null!==r.tail?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=$i(),n.sibling=null,t=Ms.current,ui(Ms,a?1&t|2:1&t),n):null;case 23:case 24:return xl(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(o(156,t.tag))}function la(e){switch(e.tag){case 1:mi(e.type)&&yi();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Ls(),ci(pi),ci(hi),Ys(),0!=(64&(t=e.flags)))throw Error(o(285));return e.flags=-4097&t|64,e;case 5:return Ps(e),null;case 13:return ci(Ms),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return ci(Ms),null;case 4:return Ls(),null;case 10:return ns(e),null;case 23:case 24:return xl(),null;default:return null}}function ca(e,t){try{var n="",r=t;do{n+=W(r),r=r.return}while(r);var i=n}catch(s){i="\nError generating stack: "+s.message+"\n"+s.stack}return{value:e,source:t,stack:i}}function ua(e,t){try{console.error(t.value)}catch(n){setTimeout((function(){throw n}))}}Ko=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Yo=function(){},Zo=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Ns(Cs.current);var o,a=null;switch(n){case"input":s=J(e,s),r=J(e,r),a=[];break;case"option":s=se(e,s),r=se(e,r),a=[];break;case"select":s=i({},s,{value:void 0}),r=i({},r,{value:void 0}),a=[];break;case"textarea":s=ae(e,s),r=ae(e,r),a=[];break;default:"function"!=typeof s.onClick&&"function"==typeof r.onClick&&(e.onclick=jr)}for(d in xe(n,r),n=null,s)if(!r.hasOwnProperty(d)&&s.hasOwnProperty(d)&&null!=s[d])if("style"===d){var c=s[d];for(o in c)c.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(l.hasOwnProperty(d)?a||(a=[]):(a=a||[]).push(d,null));for(d in r){var u=r[d];if(c=null!=s?s[d]:void 0,r.hasOwnProperty(d)&&u!==c&&(null!=u||null!=c))if("style"===d)if(c){for(o in c)!c.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&c[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(a||(a=[]),a.push(d,n)),n=u;else"dangerouslySetInnerHTML"===d?(u=u?u.__html:void 0,c=c?c.__html:void 0,null!=u&&c!==u&&(a=a||[]).push(d,u)):"children"===d?"string"!=typeof u&&"number"!=typeof u||(a=a||[]).push(d,""+u):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(l.hasOwnProperty(d)?(null!=u&&"onScroll"===d&&Or("scroll",e),a||c===u||(a=[])):"object"==typeof u&&null!==u&&u.$$typeof===P?u.toString():(a=a||[]).push(d,u))}n&&(a=a||[]).push("style",n);var d=a;(t.updateQueue=d)&&(t.flags|=4)}},qo=function(e,t,n,r){n!==r&&(t.flags|=4)};var da="function"==typeof WeakMap?WeakMap:Map;function ha(e,t,n){(n=cs(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){qa||(qa=!0,Qa=r),ua(0,t)},n}function pa(e,t,n){(n=cs(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return ua(0,t),r(i)}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Xa?Xa=new Set([this]):Xa.add(this),ua(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var fa="function"==typeof WeakSet?WeakSet:Set;function ga(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(n){Bl(e,n)}else t.current=null}function ma(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:qi(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Wr(t.stateNode.containerInfo))}throw Error(o(163))}function ya(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;r=i.next,0!=(4&(i=i.tag))&&0!=(1&i)&&(Fl(n,e),Ml(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:qi(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&ps(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}ps(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&$r(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&_t(n)))))}throw Error(o(163))}function ba(e,t){for(var n=e;;){if(5===n.tag){var r=n.stateNode;if(t)"function"==typeof(r=r.style).setProperty?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var i=n.memoizedProps.style;i=null!=i&&i.hasOwnProperty("display")?i.display:null,r.style.display=Ee("display",i)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function va(e,t){if(xi&&"function"==typeof xi.onCommitFiberUnmount)try{xi.onCommitFiberUnmount(Ti,t)}catch(s){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(0!=(4&r))Fl(t,n);else{r=t;try{i()}catch(s){Bl(r,s)}}n=n.next}while(n!==e)}break;case 1:if(ga(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(s){Bl(t,s)}break;case 5:ga(t);break;case 4:Sa(e,t)}}function Ea(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function _a(e){return 5===e.tag||3===e.tag||4===e.tag}function Ta(e){e:{for(var t=e.return;null!==t;){if(_a(t))break e;t=t.return}throw Error(o(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(o(161))}16&n.flags&&(ye(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||_a(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?xa(e,n,t):wa(e,n,t)}function xa(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=jr));else if(4!==r&&null!==(e=e.child))for(xa(e,t,n),e=e.sibling;null!==e;)xa(e,t,n),e=e.sibling}function wa(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(wa(e,t,n),e=e.sibling;null!==e;)wa(e,t,n),e=e.sibling}function Sa(e,t){for(var n,r,i=t,s=!1;;){if(!s){s=i.return;e:for(;;){if(null===s)throw Error(o(160));switch(n=s.stateNode,s.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}s=s.return}s=!0}if(5===i.tag||6===i.tag){e:for(var a=e,l=i,c=l;;)if(va(a,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===l)break e;for(;null===c.sibling;){if(null===c.return||c.return===l)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}r?(a=n,l=i.stateNode,8===a.nodeType?a.parentNode.removeChild(l):a.removeChild(l)):n.removeChild(i.stateNode)}else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(va(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(s=!1)}i.sibling.return=i.return,i=i.sibling}}function Ra(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var r=n=n.next;do{3==(3&r.tag)&&(e=r.destroy,r.destroy=void 0,void 0!==e&&e()),r=r.next}while(r!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){r=t.memoizedProps;var i=null!==e?e.memoizedProps:r;e=t.type;var s=t.updateQueue;if(t.updateQueue=null,null!==s){for(n[Xr]=r,"input"===e&&"radio"===r.type&&null!=r.name&&te(n,r),we(e,i),t=we(e,r),i=0;i<s.length;i+=2){var a=s[i],l=s[i+1];"style"===a?_e(n,l):"dangerouslySetInnerHTML"===a?me(n,l):"children"===a?ye(n,l):E(n,a,l,t)}switch(e){case"input":ne(n,r);break;case"textarea":ce(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(s=r.value)?oe(n,!!r.multiple,s,!1):e!==!!r.multiple&&(null!=r.defaultValue?oe(n,!!r.multiple,r.defaultValue,!0):oe(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(o(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,_t(n.containerInfo)));case 13:return null!==t.memoizedState&&(Ga=$i(),ba(t.child,!0)),void ka(t);case 19:return void ka(t);case 23:case 24:return void ba(t,null!==t.memoizedState)}throw Error(o(163))}function ka(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new fa),t.forEach((function(t){var r=$l.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Ca(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var Oa=Math.ceil,Aa=_.ReactCurrentDispatcher,Na=_.ReactCurrentOwner,Ia=0,La=null,Da=null,Pa=0,Ma=0,Fa=li(0),Ua=0,ja=null,Ba=0,Ha=0,$a=0,za=0,Va=null,Ga=0,Wa=1/0;function Ka(){Wa=$i()+500}var Ya,Za=null,qa=!1,Qa=null,Xa=null,Ja=!1,el=null,tl=90,nl=[],rl=[],il=null,sl=0,ol=null,al=-1,ll=0,cl=0,ul=null,dl=!1;function hl(){return 0!=(48&Ia)?$i():-1!==al?al:al=$i()}function pl(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===zi()?1:2;if(0===ll&&(ll=Ba),0!==Zi.transition){0!==cl&&(cl=null!==Va?Va.pendingLanes:0),e=ll;var t=4186112&~cl;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=zi(),0!=(4&Ia)&&98===e?e=jt(12,ll):e=jt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ll),e}function fl(e,t,n){if(50<sl)throw sl=0,ol=null,Error(o(185));if(null===(e=gl(e,t)))return null;$t(e,t,n),e===La&&($a|=t,4===Ua&&bl(e,Pa));var r=zi();1===t?0!=(8&Ia)&&0==(48&Ia)?vl(e):(ml(e,n),0===Ia&&(Ka(),Ki())):(0==(4&Ia)||98!==r&&99!==r||(null===il?il=new Set([e]):il.add(e)),ml(e,n)),Va=e}function gl(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function ml(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-zt(a),c=1<<l,u=s[l];if(-1===u){if(0==(c&r)||0!=(c&i)){u=t,Mt(c);var d=Pt;s[l]=10<=d?u+250:6<=d?u+5e3:-1}}else u<=t&&(e.expiredLanes|=c);a&=~c}if(r=Ft(e,e===La?Pa:0),t=Pt,0===r)null!==n&&(n!==Mi&&Ri(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Mi&&Ri(n)}15===t?(n=vl.bind(null,e),null===Ui?(Ui=[n],ji=Si(Ni,Yi)):Ui.push(n),n=Mi):14===t?n=Wi(99,vl.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(o(358,e))}}(t),n=Wi(n,yl.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function yl(e){if(al=-1,cl=ll=0,0!=(48&Ia))throw Error(o(327));var t=e.callbackNode;if(Pl()&&e.callbackNode!==t)return null;var n=Ft(e,e===La?Pa:0);if(0===n)return null;var r=n,i=Ia;Ia|=16;var s=Rl();for(La===e&&Pa===r||(Ka(),wl(e,r));;)try{Ol();break}catch(l){Sl(e,l)}if(ts(),Aa.current=s,Ia=i,null!==Da?r=0:(La=null,Pa=0,r=Ua),0!=(Ba&$a))wl(e,0);else if(0!==r){if(2===r&&(Ia|=64,e.hydrate&&(e.hydrate=!1,Wr(e.containerInfo)),0!==(n=Ut(e))&&(r=kl(e,n))),1===r)throw t=ja,wl(e,0),bl(e,n),ml(e,$i()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(o(345));case 2:case 5:Il(e);break;case 3:if(bl(e,n),(62914560&n)===n&&10<(r=Ga+500-$i())){if(0!==Ft(e,0))break;if(((i=e.suspendedLanes)&n)!==n){hl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Vr(Il.bind(null,e),r);break}Il(e);break;case 4:if(bl(e,n),(4186112&n)===n)break;for(r=e.eventTimes,i=-1;0<n;){var a=31-zt(n);s=1<<a,(a=r[a])>i&&(i=a),n&=~s}if(n=i,10<(n=(120>(n=$i()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Oa(n/1960))-n)){e.timeoutHandle=Vr(Il.bind(null,e),n);break}Il(e);break;default:throw Error(o(329))}}return ml(e,$i()),e.callbackNode===t?yl.bind(null,e):null}function bl(e,t){for(t&=~za,t&=~$a,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-zt(t),r=1<<n;e[n]=-1,t&=~r}}function vl(e){if(0!=(48&Ia))throw Error(o(327));if(Pl(),e===La&&0!=(e.expiredLanes&Pa)){var t=Pa,n=kl(e,t);0!=(Ba&$a)&&(n=kl(e,t=Ft(e,t)))}else n=kl(e,t=Ft(e,0));if(0!==e.tag&&2===n&&(Ia|=64,e.hydrate&&(e.hydrate=!1,Wr(e.containerInfo)),0!==(t=Ut(e))&&(n=kl(e,t))),1===n)throw n=ja,wl(e,0),bl(e,t),ml(e,$i()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Il(e),ml(e,$i()),null}function El(e,t){var n=Ia;Ia|=1;try{return e(t)}finally{0===(Ia=n)&&(Ka(),Ki())}}function _l(e,t){var n=Ia;Ia&=-2,Ia|=8;try{return e(t)}finally{0===(Ia=n)&&(Ka(),Ki())}}function Tl(e,t){ui(Fa,Ma),Ma|=t,Ba|=t}function xl(){Ma=Fa.current,ci(Fa)}function wl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Gr(n)),null!==Da)for(n=Da.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&yi();break;case 3:Ls(),ci(pi),ci(hi),Ys();break;case 5:Ps(r);break;case 4:Ls();break;case 13:case 19:ci(Ms);break;case 10:ns(r);break;case 23:case 24:xl()}n=n.return}La=e,Da=Wl(e.current,null),Pa=Ma=Ba=t,Ua=0,ja=null,za=$a=Ha=0}function Sl(e,t){for(;;){var n=Da;try{if(ts(),Zs.current=No,to){for(var r=Xs.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}to=!1}if(Qs=0,eo=Js=Xs=null,no=!1,Na.current=null,null===n||null===n.return){Ua=1,ja=t,Da=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=Pa,a.flags|=2048,a.firstEffect=a.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var c=l;if(0==(2&a.mode)){var u=a.alternate;u?(a.updateQueue=u.updateQueue,a.memoizedState=u.memoizedState,a.lanes=u.lanes):(a.updateQueue=null,a.memoizedState=null)}var d=0!=(1&Ms.current),h=o;do{var p;if(p=13===h.tag){var f=h.memoizedState;if(null!==f)p=null!==f.dehydrated;else{var g=h.memoizedProps;p=void 0!==g.fallback&&(!0!==g.unstable_avoidThisFallback||!d)}}if(p){var m=h.updateQueue;if(null===m){var y=new Set;y.add(c),h.updateQueue=y}else m.add(c);if(0==(2&h.mode)){if(h.flags|=64,a.flags|=16384,a.flags&=-2981,1===a.tag)if(null===a.alternate)a.tag=17;else{var b=cs(-1,1);b.tag=2,us(a,b)}a.lanes|=1;break e}l=void 0,a=t;var v=s.pingCache;if(null===v?(v=s.pingCache=new da,l=new Set,v.set(c,l)):void 0===(l=v.get(c))&&(l=new Set,v.set(c,l)),!l.has(a)){l.add(a);var E=Hl.bind(null,s,c,a);c.then(E,E)}h.flags|=4096,h.lanes=t;break e}h=h.return}while(null!==h);l=Error((K(a.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Ua&&(Ua=2),l=ca(l,a),h=o;do{switch(h.tag){case 3:s=l,h.flags|=4096,t&=-t,h.lanes|=t,ds(h,ha(0,s,t));break e;case 1:s=l;var _=h.type,T=h.stateNode;if(0==(64&h.flags)&&("function"==typeof _.getDerivedStateFromError||null!==T&&"function"==typeof T.componentDidCatch&&(null===Xa||!Xa.has(T)))){h.flags|=4096,t&=-t,h.lanes|=t,ds(h,pa(h,s,t));break e}}h=h.return}while(null!==h)}Nl(n)}catch(x){t=x,Da===n&&null!==n&&(Da=n=n.return);continue}break}}function Rl(){var e=Aa.current;return Aa.current=No,null===e?No:e}function kl(e,t){var n=Ia;Ia|=16;var r=Rl();for(La===e&&Pa===t||wl(e,t);;)try{Cl();break}catch(i){Sl(e,i)}if(ts(),Ia=n,Aa.current=r,null!==Da)throw Error(o(261));return La=null,Pa=0,Ua}function Cl(){for(;null!==Da;)Al(Da)}function Ol(){for(;null!==Da&&!ki();)Al(Da)}function Al(e){var t=Ya(e.alternate,e,Ma);e.memoizedProps=e.pendingProps,null===t?Nl(e):Da=t,Na.current=null}function Nl(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=aa(n,t,Ma)))return void(Da=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&Ma)||0==(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=la(t)))return n.flags&=2047,void(Da=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Da=t);Da=t=e}while(null!==t);0===Ua&&(Ua=5)}function Il(e){var t=zi();return Gi(99,Ll.bind(null,e,t)),null}function Ll(e,t){do{Pl()}while(null!==el);if(0!=(48&Ia))throw Error(o(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,s=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var a=e.eventTimes,l=e.expirationTimes;0<s;){var c=31-zt(s),u=1<<c;i[c]=0,a[c]=-1,l[c]=-1,s&=~u}if(null!==il&&0==(24&r)&&il.has(e)&&il.delete(e),e===La&&(Da=La=null,Pa=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){if(i=Ia,Ia|=32,Na.current=null,Br=Yt,mr(a=gr())){if("selectionStart"in a)l={start:a.selectionStart,end:a.selectionEnd};else e:if(l=(l=a.ownerDocument)&&l.defaultView||window,(u=l.getSelection&&l.getSelection())&&0!==u.rangeCount){l=u.anchorNode,s=u.anchorOffset,c=u.focusNode,u=u.focusOffset;try{l.nodeType,c.nodeType}catch(R){l=null;break e}var d=0,h=-1,p=-1,f=0,g=0,m=a,y=null;t:for(;;){for(var b;m!==l||0!==s&&3!==m.nodeType||(h=d+s),m!==c||0!==u&&3!==m.nodeType||(p=d+u),3===m.nodeType&&(d+=m.nodeValue.length),null!==(b=m.firstChild);)y=m,m=b;for(;;){if(m===a)break t;if(y===l&&++f===s&&(h=d),y===c&&++g===u&&(p=d),null!==(b=m.nextSibling))break;y=(m=y).parentNode}m=b}l=-1===h||-1===p?null:{start:h,end:p}}else l=null;l=l||{start:0,end:0}}else l=null;Hr={focusedElem:a,selectionRange:l},Yt=!1,ul=null,dl=!1,Za=r;do{try{Dl()}catch(R){if(null===Za)throw Error(o(330));Bl(Za,R),Za=Za.nextEffect}}while(null!==Za);ul=null,Za=r;do{try{for(a=e;null!==Za;){var v=Za.flags;if(16&v&&ye(Za.stateNode,""),128&v){var E=Za.alternate;if(null!==E){var _=E.ref;null!==_&&("function"==typeof _?_(null):_.current=null)}}switch(1038&v){case 2:Ta(Za),Za.flags&=-3;break;case 6:Ta(Za),Za.flags&=-3,Ra(Za.alternate,Za);break;case 1024:Za.flags&=-1025;break;case 1028:Za.flags&=-1025,Ra(Za.alternate,Za);break;case 4:Ra(Za.alternate,Za);break;case 8:Sa(a,l=Za);var T=l.alternate;Ea(l),null!==T&&Ea(T)}Za=Za.nextEffect}}catch(R){if(null===Za)throw Error(o(330));Bl(Za,R),Za=Za.nextEffect}}while(null!==Za);if(_=Hr,E=gr(),v=_.focusedElem,a=_.selectionRange,E!==v&&v&&v.ownerDocument&&fr(v.ownerDocument.documentElement,v)){null!==a&&mr(v)&&(E=a.start,void 0===(_=a.end)&&(_=E),"selectionStart"in v?(v.selectionStart=E,v.selectionEnd=Math.min(_,v.value.length)):(_=(E=v.ownerDocument||document)&&E.defaultView||window).getSelection&&(_=_.getSelection(),l=v.textContent.length,T=Math.min(a.start,l),a=void 0===a.end?T:Math.min(a.end,l),!_.extend&&T>a&&(l=a,a=T,T=l),l=pr(v,T),s=pr(v,a),l&&s&&(1!==_.rangeCount||_.anchorNode!==l.node||_.anchorOffset!==l.offset||_.focusNode!==s.node||_.focusOffset!==s.offset)&&((E=E.createRange()).setStart(l.node,l.offset),_.removeAllRanges(),T>a?(_.addRange(E),_.extend(s.node,s.offset)):(E.setEnd(s.node,s.offset),_.addRange(E))))),E=[];for(_=v;_=_.parentNode;)1===_.nodeType&&E.push({element:_,left:_.scrollLeft,top:_.scrollTop});for("function"==typeof v.focus&&v.focus(),v=0;v<E.length;v++)(_=E[v]).element.scrollLeft=_.left,_.element.scrollTop=_.top}Yt=!!Br,Hr=Br=null,e.current=n,Za=r;do{try{for(v=e;null!==Za;){var x=Za.flags;if(36&x&&ya(v,Za.alternate,Za),128&x){E=void 0;var w=Za.ref;if(null!==w){var S=Za.stateNode;Za.tag,E=S,"function"==typeof w?w(E):w.current=E}}Za=Za.nextEffect}}catch(R){if(null===Za)throw Error(o(330));Bl(Za,R),Za=Za.nextEffect}}while(null!==Za);Za=null,Fi(),Ia=i}else e.current=n;if(Ja)Ja=!1,el=e,tl=t;else for(Za=r;null!==Za;)t=Za.nextEffect,Za.nextEffect=null,8&Za.flags&&((x=Za).sibling=null,x.stateNode=null),Za=t;if(0===(r=e.pendingLanes)&&(Xa=null),1===r?e===ol?sl++:(sl=0,ol=e):sl=0,n=n.stateNode,xi&&"function"==typeof xi.onCommitFiberRoot)try{xi.onCommitFiberRoot(Ti,n,void 0,64==(64&n.current.flags))}catch(R){}if(ml(e,$i()),qa)throw qa=!1,e=Qa,Qa=null,e;return 0!=(8&Ia)||Ki(),null}function Dl(){for(;null!==Za;){var e=Za.alternate;dl||null===ul||(0!=(8&Za.flags)?Je(Za,ul)&&(dl=!0):13===Za.tag&&Ca(e,Za)&&Je(Za,ul)&&(dl=!0));var t=Za.flags;0!=(256&t)&&ma(e,Za),0==(512&t)||Ja||(Ja=!0,Wi(97,(function(){return Pl(),null}))),Za=Za.nextEffect}}function Pl(){if(90!==tl){var e=97<tl?97:tl;return tl=90,Gi(e,Ul)}return!1}function Ml(e,t){nl.push(t,e),Ja||(Ja=!0,Wi(97,(function(){return Pl(),null})))}function Fl(e,t){rl.push(t,e),Ja||(Ja=!0,Wi(97,(function(){return Pl(),null})))}function Ul(){if(null===el)return!1;var e=el;if(el=null,0!=(48&Ia))throw Error(o(331));var t=Ia;Ia|=32;var n=rl;rl=[];for(var r=0;r<n.length;r+=2){var i=n[r],s=n[r+1],a=i.destroy;if(i.destroy=void 0,"function"==typeof a)try{a()}catch(c){if(null===s)throw Error(o(330));Bl(s,c)}}for(n=nl,nl=[],r=0;r<n.length;r+=2){i=n[r],s=n[r+1];try{var l=i.create;i.destroy=l()}catch(c){if(null===s)throw Error(o(330));Bl(s,c)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return Ia=t,Ki(),!0}function jl(e,t,n){us(e,t=ha(0,t=ca(n,t),1)),t=hl(),null!==(e=gl(e,1))&&($t(e,1,t),ml(e,t))}function Bl(e,t){if(3===e.tag)jl(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){jl(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Xa||!Xa.has(r))){var i=pa(n,e=ca(t,e),1);if(us(n,i),i=hl(),null!==(n=gl(n,1)))$t(n,1,i),ml(n,i);else if("function"==typeof r.componentDidCatch&&(null===Xa||!Xa.has(r)))try{r.componentDidCatch(t,e)}catch(s){}break}}n=n.return}}function Hl(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=hl(),e.pingedLanes|=e.suspendedLanes&n,La===e&&(Pa&n)===n&&(4===Ua||3===Ua&&(62914560&Pa)===Pa&&500>$i()-Ga?wl(e,0):za|=n),ml(e,t)}function $l(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===zi()?1:2:(0===ll&&(ll=Ba),0===(t=Bt(62914560&~ll))&&(t=4194304))),n=hl(),null!==(e=gl(e,t))&&($t(e,t,n),ml(e,n))}function zl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Vl(e,t,n,r){return new zl(e,t,n,r)}function Gl(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Wl(e,t){var n=e.alternate;return null===n?((n=Vl(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Kl(e,t,n,r,i,s){var a=2;if(r=e,"function"==typeof e)Gl(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case w:return Yl(n.children,i,s,t);case M:a=8,i|=16;break;case S:a=8,i|=1;break;case R:return(e=Vl(12,n,t,8|i)).elementType=R,e.type=R,e.lanes=s,e;case A:return(e=Vl(13,n,t,i)).type=A,e.elementType=A,e.lanes=s,e;case N:return(e=Vl(19,n,t,i)).elementType=N,e.lanes=s,e;case F:return Zl(n,i,s,t);case U:return(e=Vl(24,n,t,i)).elementType=U,e.lanes=s,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case k:a=10;break e;case C:a=9;break e;case O:a=11;break e;case I:a=14;break e;case L:a=16,r=null;break e;case D:a=22;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Vl(a,n,t,i)).elementType=e,t.type=r,t.lanes=s,t}function Yl(e,t,n,r){return(e=Vl(7,e,r,t)).lanes=n,e}function Zl(e,t,n,r){return(e=Vl(23,e,r,t)).elementType=F,e.lanes=n,e}function ql(e,t,n){return(e=Vl(6,e,null,t)).lanes=n,e}function Ql(e,t,n){return(t=Vl(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xl(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Ht(0),this.expirationTimes=Ht(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ht(0),this.mutableSourceEagerHydrationData=null}function Jl(e,t,n,r){var i=t.current,s=hl(),a=pl(i);e:if(n){t:{if(Ze(n=n._reactInternals)!==n||1!==n.tag)throw Error(o(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(mi(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(o(171))}if(1===n.tag){var c=n.type;if(mi(c)){n=vi(n,c,l);break e}}n=l}else n=di;return null===t.context?t.context=n:t.pendingContext=n,(t=cs(s,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),us(i,t),fl(i,a,s),a}function ec(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function tc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function nc(e,t){tc(e,t),(e=e.alternate)&&tc(e,t)}function rc(e,t,n){var r=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Xl(e,t,null!=n&&!0===n.hydrate),t=Vl(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,as(t),e[Jr]=n.current,Nr(8===e.nodeType?e.parentNode:e),r)for(e=0;e<r.length;e++){var i=(t=r[e])._getVersion;i=i(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,i]:n.mutableSourceEagerHydrationData.push(t,i)}this._internalRoot=n}function ic(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function sc(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s._internalRoot;if("function"==typeof i){var a=i;i=function(){var e=ec(o);a.call(e)}}Jl(t,o,e,i)}else{if(s=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new rc(e,0,t?{hydrate:!0}:void 0)}(n,r),o=s._internalRoot,"function"==typeof i){var l=i;i=function(){var e=ec(o);l.call(e)}}_l((function(){Jl(t,o,e,i)}))}return ec(o)}function oc(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!ic(t))throw Error(o(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:x,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}Ya=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||pi.current)Mo=!0;else{if(0==(n&r)){switch(Mo=!1,t.tag){case 3:Wo(t),Ws();break;case 5:Ds(t);break;case 1:mi(t.type)&&Ei(t);break;case 4:Is(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var i=t.type._context;ui(Qi,i._currentValue),i._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?Xo(e,t,n):(ui(Ms,1&Ms.current),null!==(t=sa(e,t,n))?t.sibling:null);ui(Ms,1&Ms.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(64&e.flags)){if(r)return ia(e,t,n);t.flags|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),ui(Ms,Ms.current),r)break;return null;case 23:case 24:return t.lanes=0,Ho(e,t,n)}return sa(e,t,n)}Mo=0!=(16384&e.flags)}else Mo=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=gi(t,hi.current),is(t,n),i=so(null,t,r,e,i,n),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,mi(r)){var s=!0;Ei(t)}else s=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,as(t);var a=r.getDerivedStateFromProps;"function"==typeof a&&gs(t,r,a,e),i.updater=ms,t.stateNode=i,i._reactInternals=t,Es(t,r,e,n),t=Go(null,t,r,!0,s,n)}else t.tag=0,Fo(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(s=i._init)(i._payload),t.type=i,s=t.tag=function(e){if("function"==typeof e)return Gl(e)?1:0;if(null!=e){if((e=e.$$typeof)===O)return 11;if(e===I)return 14}return 2}(i),e=qi(i,e),s){case 0:t=zo(null,t,i,e,n);break e;case 1:t=Vo(null,t,i,e,n);break e;case 11:t=Uo(null,t,i,e,n);break e;case 14:t=jo(null,t,i,qi(i.type,e),r,n);break e}throw Error(o(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,zo(e,t,r,i=t.elementType===r?i:qi(r,i),n);case 1:return r=t.type,i=t.pendingProps,Vo(e,t,r,i=t.elementType===r?i:qi(r,i),n);case 3:if(Wo(t),r=t.updateQueue,null===e||null===r)throw Error(o(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,ls(e,t),hs(t,r,null,n),(r=t.memoizedState.element)===i)Ws(),t=sa(e,t,n);else{if((s=(i=t.stateNode).hydrate)&&(js=Kr(t.stateNode.containerInfo.firstChild),Us=t,s=Bs=!0),s){if(null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)(s=e[i])._workInProgressVersionPrimary=e[i+1],Ks.push(s);for(n=Rs(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Fo(e,t,r,n),Ws();t=t.child}return t;case 5:return Ds(t),null===e&&zs(t),r=t.type,i=t.pendingProps,s=null!==e?e.memoizedProps:null,a=i.children,zr(r,i)?a=null:null!==s&&zr(r,s)&&(t.flags|=16),$o(e,t),Fo(e,t,a,n),t.child;case 6:return null===e&&zs(t),null;case 13:return Xo(e,t,n);case 4:return Is(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Ss(t,null,r,n):Fo(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Uo(e,t,r,i=t.elementType===r?i:qi(r,i),n);case 7:return Fo(e,t,t.pendingProps,n),t.child;case 8:case 12:return Fo(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value;var l=t.type._context;if(ui(Qi,l._currentValue),l._currentValue=s,null!==a)if(l=a.value,0===(s=cr(l,s)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,s):1073741823))){if(a.children===i.children&&!pi.current){t=sa(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var c=l.dependencies;if(null!==c){a=l.child;for(var u=c.firstContext;null!==u;){if(u.context===r&&0!=(u.observedBits&s)){1===l.tag&&((u=cs(-1,n&-n)).tag=2,us(l,u)),l.lanes|=n,null!==(u=l.alternate)&&(u.lanes|=n),rs(l.return,n),c.lanes|=n;break}u=u.next}}else a=10===l.tag&&l.type===t.type?null:l.child;if(null!==a)a.return=l;else for(a=l;null!==a;){if(a===t){a=null;break}if(null!==(l=a.sibling)){l.return=a.return,a=l;break}a=a.return}l=a}Fo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(s=t.pendingProps).children,is(t,n),r=r(i=ss(i,s.unstable_observedBits)),t.flags|=1,Fo(e,t,r,n),t.child;case 14:return s=qi(i=t.type,t.pendingProps),jo(e,t,i,s=qi(i.type,s),r,n);case 15:return Bo(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:qi(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,mi(r)?(e=!0,Ei(t)):e=!1,is(t,n),bs(t,r,i),Es(t,r,i,n),Go(null,t,r,!0,e,n);case 19:return ia(e,t,n);case 23:case 24:return Ho(e,t,n)}throw Error(o(156,t.tag))},rc.prototype.render=function(e){Jl(e,this._internalRoot,null,null)},rc.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Jl(null,e,null,(function(){t[Jr]=null}))},et=function(e){13===e.tag&&(fl(e,4,hl()),nc(e,4))},tt=function(e){13===e.tag&&(fl(e,67108864,hl()),nc(e,67108864))},nt=function(e){if(13===e.tag){var t=hl(),n=pl(e);fl(e,n,t),nc(e,n)}},rt=function(e,t){return t()},Re=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ii(r);if(!i)throw Error(o(90));Q(r),ne(r,i)}}}break;case"textarea":ce(e,n);break;case"select":null!=(t=n.value)&&oe(e,!!n.multiple,t,!1)}},Ie=El,Le=function(e,t,n,r,i){var s=Ia;Ia|=4;try{return Gi(98,e.bind(null,t,n,r,i))}finally{0===(Ia=s)&&(Ka(),Ki())}},De=function(){0==(49&Ia)&&(function(){if(null!==il){var e=il;il=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,ml(e,$i())}))}Ki()}(),Pl())},Pe=function(e,t){var n=Ia;Ia|=2;try{return e(t)}finally{0===(Ia=n)&&(Ka(),Ki())}};var ac={Events:[ni,ri,ii,Ae,Ne,Pl,{current:!1}]},lc={findFiberByHostInstance:ti,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},cc={bundleType:lc.bundleType,version:lc.version,rendererPackageName:lc.rendererPackageName,rendererConfig:lc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Xe(e))?null:e.stateNode},findFiberByHostInstance:lc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var uc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uc.isDisabled&&uc.supportsFiber)try{Ti=uc.inject(cc),xi=uc}catch(ge){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ac,t.createPortal=oc,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw Error(o(268,Object.keys(e)))}return e=null===(e=Xe(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Ia;if(0!=(48&n))return e(t);Ia|=1;try{if(e)return Gi(99,e.bind(null,t))}finally{Ia=n,Ki()}},t.hydrate=function(e,t,n){if(!ic(t))throw Error(o(200));return sc(null,e,t,!0,n)},t.render=function(e,t,n){if(!ic(t))throw Error(o(200));return sc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!ic(e))throw Error(o(40));return!!e._reactRootContainer&&(_l((function(){sc(null,null,e,!1,(function(){e._reactRootContainer=null,e[Jr]=null}))})),!0)},t.unstable_batchedUpdates=El,t.unstable_createPortal=function(e,t){return oc(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ic(n))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return sc(e,t,n,!1,r)},t.version="17.0.2"},73935:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(64448)},69590:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,i="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function s(e,o){if(e===o)return!0;if(e&&o&&"object"==typeof e&&"object"==typeof o){if(e.constructor!==o.constructor)return!1;var a,l,c,u;if(Array.isArray(e)){if((a=e.length)!=o.length)return!1;for(l=a;0!=l--;)if(!s(e[l],o[l]))return!1;return!0}if(n&&e instanceof Map&&o instanceof Map){if(e.size!==o.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!o.has(l.value[0]))return!1;for(u=e.entries();!(l=u.next()).done;)if(!s(l.value[1],o.get(l.value[0])))return!1;return!0}if(r&&e instanceof Set&&o instanceof Set){if(e.size!==o.size)return!1;for(u=e.entries();!(l=u.next()).done;)if(!o.has(l.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(o)){if((a=e.length)!=o.length)return!1;for(l=a;0!=l--;)if(e[l]!==o[l])return!1;return!0}if(e.constructor===RegExp)return e.source===o.source&&e.flags===o.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof o.valueOf)return e.valueOf()===o.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof o.toString)return e.toString()===o.toString();if((a=(c=Object.keys(e)).length)!==Object.keys(o).length)return!1;for(l=a;0!=l--;)if(!Object.prototype.hasOwnProperty.call(o,c[l]))return!1;if(t&&e instanceof Element)return!1;for(l=a;0!=l--;)if(("_owner"!==c[l]&&"__v"!==c[l]&&"__o"!==c[l]||!e.$$typeof)&&!s(e[c[l]],o[c[l]]))return!1;return!0}return e!=e&&o!=o}e.exports=function(e,t){try{return s(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},70405:(e,t,n)=>{"use strict";n.d(t,{B6:()=>G,ql:()=>J});var r=n(67294),i=n(45697),s=n.n(i),o=n(69590),a=n.n(o),l=n(41143),c=n.n(l),u=n(96774),d=n.n(u);function h(){return h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(this,arguments)}function p(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,f(e,t)}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function g(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)t.indexOf(n=s[r])>=0||(i[n]=e[n]);return i}var m={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},y={rel:["amphtml","canonical","alternate"]},b={type:["application/ld+json"]},v={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},E=Object.keys(m).map((function(e){return m[e]})),_={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},T=Object.keys(_).reduce((function(e,t){return e[_[t]]=t,e}),{}),x=function(e,t){for(var n=e.length-1;n>=0;n-=1){var r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},w=function(e){var t=x(e,m.TITLE),n=x(e,"titleTemplate");if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,(function(){return t}));var r=x(e,"defaultTitle");return t||r||void 0},S=function(e){return x(e,"onChangeClientState")||function(){}},R=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return h({},e,t)}),{})},k=function(e,t){return t.filter((function(e){return void 0!==e[m.BASE]})).map((function(e){return e[m.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),i=0;i<r.length;i+=1){var s=r[i].toLowerCase();if(-1!==e.indexOf(s)&&n[s])return t.concat(n)}return t}),[])},C=function(e,t,n){var r={};return n.filter((function(t){return!!Array.isArray(t[e])||(void 0!==t[e]&&console&&"function"==typeof console.warn&&console.warn("Helmet: "+e+' should be of type "Array". Instead found type "'+typeof t[e]+'"'),!1)})).map((function(t){return t[e]})).reverse().reduce((function(e,n){var i={};n.filter((function(e){for(var n,s=Object.keys(e),o=0;o<s.length;o+=1){var a=s[o],l=a.toLowerCase();-1===t.indexOf(l)||"rel"===n&&"canonical"===e[n].toLowerCase()||"rel"===l&&"stylesheet"===e[l].toLowerCase()||(n=l),-1===t.indexOf(a)||"innerHTML"!==a&&"cssText"!==a&&"itemprop"!==a||(n=a)}if(!n||!e[n])return!1;var c=e[n].toLowerCase();return r[n]||(r[n]={}),i[n]||(i[n]={}),!r[n][c]&&(i[n][c]=!0,!0)})).reverse().forEach((function(t){return e.push(t)}));for(var s=Object.keys(i),o=0;o<s.length;o+=1){var a=s[o],l=h({},r[a],i[a]);r[a]=l}return e}),[]).reverse()},O=function(e,t){if(Array.isArray(e)&&e.length)for(var n=0;n<e.length;n+=1)if(e[n][t])return!0;return!1},A=function(e){return Array.isArray(e)?e.join(""):e},N=function(e,t){return Array.isArray(e)?e.reduce((function(e,n){return function(e,t){for(var n=Object.keys(e),r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1}(n,t)?e.priority.push(n):e.default.push(n),e}),{priority:[],default:[]}):{default:e}},I=function(e,t){var n;return h({},e,((n={})[t]=void 0,n))},L=[m.NOSCRIPT,m.SCRIPT,m.STYLE],D=function(e,t){return void 0===t&&(t=!0),!1===t?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},P=function(e){return Object.keys(e).reduce((function(t,n){var r=void 0!==e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},M=function(e,t){return void 0===t&&(t={}),Object.keys(e).reduce((function(t,n){return t[_[n]||n]=e[n],t}),t)},F=function(e,t){return t.map((function(t,n){var i,s=((i={key:n})["data-rh"]=!0,i);return Object.keys(t).forEach((function(e){var n=_[e]||e;"innerHTML"===n||"cssText"===n?s.dangerouslySetInnerHTML={__html:t.innerHTML||t.cssText}:s[n]=t[e]})),r.createElement(e,s)}))},U=function(e,t,n){switch(e){case m.TITLE:return{toComponent:function(){return n=t.titleAttributes,(i={key:e=t.title})["data-rh"]=!0,s=M(n,i),[r.createElement(m.TITLE,s,e)];var e,n,i,s},toString:function(){return function(e,t,n,r){var i=P(n),s=A(t);return i?"<"+e+' data-rh="true" '+i+">"+D(s,r)+"</"+e+">":"<"+e+' data-rh="true">'+D(s,r)+"</"+e+">"}(e,t.title,t.titleAttributes,n)}};case"bodyAttributes":case"htmlAttributes":return{toComponent:function(){return M(t)},toString:function(){return P(t)}};default:return{toComponent:function(){return F(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var i=Object.keys(r).filter((function(e){return!("innerHTML"===e||"cssText"===e)})).reduce((function(e,t){var i=void 0===r[t]?t:t+'="'+D(r[t],n)+'"';return e?e+" "+i:i}),""),s=r.innerHTML||r.cssText||"",o=-1===L.indexOf(e);return t+"<"+e+' data-rh="true" '+i+(o?"/>":">"+s+"</"+e+">")}),"")}(e,t,n)}}}},j=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,i=e.htmlAttributes,s=e.noscriptTags,o=e.styleTags,a=e.title,l=void 0===a?"":a,c=e.titleAttributes,u=e.linkTags,d=e.metaTags,h=e.scriptTags,p={toComponent:function(){},toString:function(){return""}};if(e.prioritizeSeoTags){var f=function(e){var t=e.linkTags,n=e.scriptTags,r=e.encode,i=N(e.metaTags,v),s=N(t,y),o=N(n,b);return{priorityMethods:{toComponent:function(){return[].concat(F(m.META,i.priority),F(m.LINK,s.priority),F(m.SCRIPT,o.priority))},toString:function(){return U(m.META,i.priority,r)+" "+U(m.LINK,s.priority,r)+" "+U(m.SCRIPT,o.priority,r)}},metaTags:i.default,linkTags:s.default,scriptTags:o.default}}(e);p=f.priorityMethods,u=f.linkTags,d=f.metaTags,h=f.scriptTags}return{priority:p,base:U(m.BASE,t,r),bodyAttributes:U("bodyAttributes",n,r),htmlAttributes:U("htmlAttributes",i,r),link:U(m.LINK,u,r),meta:U(m.META,d,r),noscript:U(m.NOSCRIPT,s,r),script:U(m.SCRIPT,h,r),style:U(m.STYLE,o,r),title:U(m.TITLE,{title:l,titleAttributes:c},r)}},B=[],H=function(e,t){var n=this;void 0===t&&(t="undefined"!=typeof document),this.instances=[],this.value={setHelmet:function(e){n.context.helmet=e},helmetInstances:{get:function(){return n.canUseDOM?B:n.instances},add:function(e){(n.canUseDOM?B:n.instances).push(e)},remove:function(e){var t=(n.canUseDOM?B:n.instances).indexOf(e);(n.canUseDOM?B:n.instances).splice(t,1)}}},this.context=e,this.canUseDOM=t,t||(e.helmet=j({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))},$=r.createContext({}),z=s().shape({setHelmet:s().func,helmetInstances:s().shape({get:s().func,add:s().func,remove:s().func})}),V="undefined"!=typeof document,G=function(e){function t(n){var r;return(r=e.call(this,n)||this).helmetData=new H(r.props.context,t.canUseDOM),r}return p(t,e),t.prototype.render=function(){return r.createElement($.Provider,{value:this.helmetData.value},this.props.children)},t}(r.Component);G.canUseDOM=V,G.propTypes={context:s().shape({helmet:s().shape()}),children:s().node.isRequired},G.defaultProps={context:{}},G.displayName="HelmetProvider";var W=function(e,t){var n,r=document.head||document.querySelector(m.HEAD),i=r.querySelectorAll(e+"[data-rh]"),s=[].slice.call(i),o=[];return t&&t.length&&t.forEach((function(t){var r=document.createElement(e);for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&("innerHTML"===i?r.innerHTML=t.innerHTML:"cssText"===i?r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText)):r.setAttribute(i,void 0===t[i]?"":t[i]));r.setAttribute("data-rh","true"),s.some((function(e,t){return n=t,r.isEqualNode(e)}))?s.splice(n,1):o.push(r)})),s.forEach((function(e){return e.parentNode.removeChild(e)})),o.forEach((function(e){return r.appendChild(e)})),{oldTags:s,newTags:o}},K=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute("data-rh"),i=r?r.split(","):[],s=[].concat(i),o=Object.keys(t),a=0;a<o.length;a+=1){var l=o[a],c=t[l]||"";n.getAttribute(l)!==c&&n.setAttribute(l,c),-1===i.indexOf(l)&&i.push(l);var u=s.indexOf(l);-1!==u&&s.splice(u,1)}for(var d=s.length-1;d>=0;d-=1)n.removeAttribute(s[d]);i.length===s.length?n.removeAttribute("data-rh"):n.getAttribute("data-rh")!==o.join(",")&&n.setAttribute("data-rh",o.join(","))}},Y=function(e,t){var n=e.baseTag,r=e.htmlAttributes,i=e.linkTags,s=e.metaTags,o=e.noscriptTags,a=e.onChangeClientState,l=e.scriptTags,c=e.styleTags,u=e.title,d=e.titleAttributes;K(m.BODY,e.bodyAttributes),K(m.HTML,r),function(e,t){void 0!==e&&document.title!==e&&(document.title=A(e)),K(m.TITLE,t)}(u,d);var h={baseTag:W(m.BASE,n),linkTags:W(m.LINK,i),metaTags:W(m.META,s),noscriptTags:W(m.NOSCRIPT,o),scriptTags:W(m.SCRIPT,l),styleTags:W(m.STYLE,c)},p={},f={};Object.keys(h).forEach((function(e){var t=h[e],n=t.newTags,r=t.oldTags;n.length&&(p[e]=n),r.length&&(f[e]=h[e].oldTags)})),t&&t(),a(e,p,f)},Z=null,q=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).rendered=!1,t}p(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return!d()(e,this.props)},n.componentDidUpdate=function(){this.emitChange()},n.componentWillUnmount=function(){this.props.context.helmetInstances.remove(this),this.emitChange()},n.emitChange=function(){var e,t,n=this.props.context,r=n.setHelmet,i=null,s=(e=n.helmetInstances.get().map((function(e){var t=h({},e.props);return delete t.context,t})),{baseTag:k(["href"],e),bodyAttributes:R("bodyAttributes",e),defer:x(e,"defer"),encode:x(e,"encodeSpecialCharacters"),htmlAttributes:R("htmlAttributes",e),linkTags:C(m.LINK,["rel","href"],e),metaTags:C(m.META,["name","charset","http-equiv","property","itemprop"],e),noscriptTags:C(m.NOSCRIPT,["innerHTML"],e),onChangeClientState:S(e),scriptTags:C(m.SCRIPT,["src","innerHTML"],e),styleTags:C(m.STYLE,["cssText"],e),title:w(e),titleAttributes:R("titleAttributes",e),prioritizeSeoTags:O(e,"prioritizeSeoTags")});G.canUseDOM?(t=s,Z&&cancelAnimationFrame(Z),t.defer?Z=requestAnimationFrame((function(){Y(t,(function(){Z=null}))})):(Y(t),Z=null)):j&&(i=j(s)),r(i)},n.init=function(){this.rendered||(this.rendered=!0,this.props.context.helmetInstances.add(this),this.emitChange())},n.render=function(){return this.init(),null},t}(r.Component);q.propTypes={context:z.isRequired},q.displayName="HelmetDispatcher";var Q=["children"],X=["children"],J=function(e){function t(){return e.apply(this,arguments)||this}p(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return!a()(I(this.props,"helmetData"),I(e,"helmetData"))},n.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case m.SCRIPT:case m.NOSCRIPT:return{innerHTML:t};case m.STYLE:return{cssText:t};default:throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")}},n.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren;return h({},r,((t={})[n.type]=[].concat(r[n.type]||[],[h({},e.newChildProps,this.mapNestedChildrenToProps(n,e.nestedChildren))]),t))},n.mapObjectTypeChildren=function(e){var t,n,r=e.child,i=e.newProps,s=e.newChildProps,o=e.nestedChildren;switch(r.type){case m.TITLE:return h({},i,((t={})[r.type]=o,t.titleAttributes=h({},s),t));case m.BODY:return h({},i,{bodyAttributes:h({},s)});case m.HTML:return h({},i,{htmlAttributes:h({},s)});default:return h({},i,((n={})[r.type]=h({},s),n))}},n.mapArrayTypeChildrenToProps=function(e,t){var n=h({},t);return Object.keys(e).forEach((function(t){var r;n=h({},n,((r={})[t]=e[t],r))})),n},n.warnOnInvalidChildren=function(e,t){return c()(E.some((function(t){return e.type===t})),"function"==typeof e.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":"Only elements types "+E.join(", ")+" are allowed. Helmet does not support rendering <"+e.type+"> elements. Refer to our API for more information."),c()(!t||"string"==typeof t||Array.isArray(t)&&!t.some((function(e){return"string"!=typeof e})),"Helmet expects a string as a child of <"+e.type+">. Did you forget to wrap your children in braces? ( <"+e.type+">{``}</"+e.type+"> ) Refer to our API for more information."),!0},n.mapChildrenToProps=function(e,t){var n=this,i={};return r.Children.forEach(e,(function(e){if(e&&e.props){var r=e.props,s=r.children,o=g(r,Q),a=Object.keys(o).reduce((function(e,t){return e[T[t]||t]=o[t],e}),{}),l=e.type;switch("symbol"==typeof l?l=l.toString():n.warnOnInvalidChildren(e,s),l){case m.FRAGMENT:t=n.mapChildrenToProps(s,t);break;case m.LINK:case m.META:case m.NOSCRIPT:case m.SCRIPT:case m.STYLE:i=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:i,newChildProps:a,nestedChildren:s});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:a,nestedChildren:s})}}})),this.mapArrayTypeChildrenToProps(i,t)},n.render=function(){var e=this.props,t=e.children,n=g(e,X),i=h({},n),s=n.helmetData;return t&&(i=this.mapChildrenToProps(t,i)),!s||s instanceof H||(s=new H(s.context,s.instances)),s?r.createElement(q,h({},i,{context:s.value,helmetData:void 0})):r.createElement($.Consumer,null,(function(e){return r.createElement(q,h({},i,{context:e}))}))},t}(r.Component);J.propTypes={base:s().object,bodyAttributes:s().object,children:s().oneOfType([s().arrayOf(s().node),s().node]),defaultTitle:s().string,defer:s().bool,encodeSpecialCharacters:s().bool,htmlAttributes:s().object,link:s().arrayOf(s().object),meta:s().arrayOf(s().object),noscript:s().arrayOf(s().object),onChangeClientState:s().func,script:s().arrayOf(s().object),style:s().arrayOf(s().object),title:s().string,titleAttributes:s().object,titleTemplate:s().string,prioritizeSeoTags:s().bool,helmetData:s().object},J.defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1},J.displayName="Helmet"},69921:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,f=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,v=n?Symbol.for("react.responder"):60118,E=n?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case s:case a:case o:case p:return e;default:switch(e=e&&e.$$typeof){case c:case h:case m:case g:case l:return e;default:return t}}case i:return t}}}function T(e){return _(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=h,t.Fragment=s,t.Lazy=m,t.Memo=g,t.Portal=i,t.Profiler=a,t.StrictMode=o,t.Suspense=p,t.isAsyncMode=function(e){return T(e)||_(e)===u},t.isConcurrentMode=T,t.isContextConsumer=function(e){return _(e)===c},t.isContextProvider=function(e){return _(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return _(e)===h},t.isFragment=function(e){return _(e)===s},t.isLazy=function(e){return _(e)===m},t.isMemo=function(e){return _(e)===g},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===a},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===p},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===d||e===a||e===o||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===l||e.$$typeof===c||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v||e.$$typeof===E||e.$$typeof===y)},t.typeOf=_},59864:(e,t,n)=>{"use strict";e.exports=n(69921)},68356:(e,t,n)=>{"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var a=n(67294),l=n(45697),c=[],u=[];function d(e){var t=e(),n={loading:!0,loaded:null,error:null};return n.promise=t.then((function(e){return n.loading=!1,n.loaded=e,e})).catch((function(e){throw n.loading=!1,n.error=e,e})),n}function h(e){var t={loading:!1,loaded:{},error:null},n=[];try{Object.keys(e).forEach((function(r){var i=d(e[r]);i.loading?t.loading=!0:(t.loaded[r]=i.loaded,t.error=i.error),n.push(i.promise),i.promise.then((function(e){t.loaded[r]=e})).catch((function(e){t.error=e}))}))}catch(r){t.error=r}return t.promise=Promise.all(n).then((function(e){return t.loading=!1,e})).catch((function(e){throw t.loading=!1,e})),t}function p(e,t){return a.createElement((n=e)&&n.__esModule?n.default:n,t);var n}function f(e,t){var d,h;if(!t.loading)throw new Error("react-loadable requires a `loading` component");var f=o({loader:null,loading:null,delay:200,timeout:null,render:p,webpack:null,modules:null},t),g=null;function m(){return g||(g=e(f.loader)),g.promise}return c.push(m),"function"==typeof f.webpack&&u.push((function(){if((0,f.webpack)().every((function(e){return void 0!==e&&void 0!==n.m[e]})))return m()})),h=d=function(t){function n(n){var r;return s(i(i(r=t.call(this,n)||this)),"retry",(function(){r.setState({error:null,loading:!0,timedOut:!1}),g=e(f.loader),r._loadModule()})),m(),r.state={error:g.error,pastDelay:!1,timedOut:!1,loading:g.loading,loaded:g.loaded},r}r(n,t),n.preload=function(){return m()};var o=n.prototype;return o.UNSAFE_componentWillMount=function(){this._loadModule()},o.componentDidMount=function(){this._mounted=!0},o._loadModule=function(){var e=this;if(this.context.loadable&&Array.isArray(f.modules)&&f.modules.forEach((function(t){e.context.loadable.report(t)})),g.loading){var t=function(t){e._mounted&&e.setState(t)};"number"==typeof f.delay&&(0===f.delay?this.setState({pastDelay:!0}):this._delay=setTimeout((function(){t({pastDelay:!0})}),f.delay)),"number"==typeof f.timeout&&(this._timeout=setTimeout((function(){t({timedOut:!0})}),f.timeout));var n=function(){t({error:g.error,loaded:g.loaded,loading:g.loading}),e._clearTimeouts()};g.promise.then((function(){return n(),null})).catch((function(e){return n(),null}))}},o.componentWillUnmount=function(){this._mounted=!1,this._clearTimeouts()},o._clearTimeouts=function(){clearTimeout(this._delay),clearTimeout(this._timeout)},o.render=function(){return this.state.loading||this.state.error?a.createElement(f.loading,{isLoading:this.state.loading,pastDelay:this.state.pastDelay,timedOut:this.state.timedOut,error:this.state.error,retry:this.retry}):this.state.loaded?f.render(this.state.loaded,this.props):null},n}(a.Component),s(d,"contextTypes",{loadable:l.shape({report:l.func.isRequired})}),h}function g(e){return f(d,e)}g.Map=function(e){if("function"!=typeof e.render)throw new Error("LoadableMap requires a `render(loaded, props)` function");return f(h,e)};var m=function(e){function t(){return e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.getChildContext=function(){return{loadable:{report:this.props.report}}},n.render=function(){return a.Children.only(this.props.children)},t}(a.Component);function y(e){for(var t=[];e.length;){var n=e.pop();t.push(n())}return Promise.all(t).then((function(){if(e.length)return y(e)}))}s(m,"propTypes",{report:l.func.isRequired}),s(m,"childContextTypes",{loadable:l.shape({report:l.func.isRequired}).isRequired}),g.Capture=m,g.preloadAll=function(){return new Promise((function(e,t){y(c).then(e,t)}))},g.preloadReady=function(){return new Promise((function(e,t){y(u).then(e,e)}))},e.exports=g},18790:(e,t,n)=>{"use strict";n.d(t,{H:()=>a,f:()=>o});var r=n(16550),i=n(87462),s=n(67294);function o(e,t,n){return void 0===n&&(n=[]),e.some((function(e){var i=e.path?(0,r.LX)(t,e):n.length?n[n.length-1].match:r.F0.computeRootMatch(t);return i&&(n.push({route:e,match:i}),e.routes&&o(e.routes,t,n)),i})),n}function a(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),e?s.createElement(r.rs,n,e.map((function(e,n){return s.createElement(r.AW,{key:e.key||n,path:e.path,exact:e.exact,strict:e.strict,render:function(n){return e.render?e.render((0,i.Z)({},n,{},t,{route:e})):s.createElement(e.component,(0,i.Z)({},n,t,{route:e}))}})}))):null}},73727:(e,t,n)=>{"use strict";n.d(t,{OL:()=>v,VK:()=>u,rU:()=>m});var r=n(16550),i=n(75068),s=n(67294),o=n(99318),a=n(87462),l=n(63366),c=n(38776),u=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).history=(0,o.lX)(t.props),t}return(0,i.Z)(t,e),t.prototype.render=function(){return s.createElement(r.F0,{history:this.history,children:this.props.children})},t}(s.Component);s.Component;var d=function(e,t){return"function"==typeof e?e(t):e},h=function(e,t){return"string"==typeof e?(0,o.ob)(e,null,null,t):e},p=function(e){return e},f=s.forwardRef;void 0===f&&(f=p);var g=f((function(e,t){var n=e.innerRef,r=e.navigate,i=e.onClick,o=(0,l.Z)(e,["innerRef","navigate","onClick"]),c=o.target,u=(0,a.Z)({},o,{onClick:function(e){try{i&&i(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||c&&"_self"!==c||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return u.ref=p!==f&&t||n,s.createElement("a",u)}));var m=f((function(e,t){var n=e.component,i=void 0===n?g:n,u=e.replace,m=e.to,y=e.innerRef,b=(0,l.Z)(e,["component","replace","to","innerRef"]);return s.createElement(r.s6.Consumer,null,(function(e){e||(0,c.Z)(!1);var n=e.history,r=h(d(m,e.location),e.location),l=r?n.createHref(r):"",g=(0,a.Z)({},b,{href:l,navigate:function(){var t=d(m,e.location),r=(0,o.Ep)(e.location)===(0,o.Ep)(h(t));(u||r?n.replace:n.push)(t)}});return p!==f?g.ref=t||y:g.innerRef=y,s.createElement(i,g)}))})),y=function(e){return e},b=s.forwardRef;void 0===b&&(b=y);var v=b((function(e,t){var n=e["aria-current"],i=void 0===n?"page":n,o=e.activeClassName,u=void 0===o?"active":o,p=e.activeStyle,f=e.className,g=e.exact,v=e.isActive,E=e.location,_=e.sensitive,T=e.strict,x=e.style,w=e.to,S=e.innerRef,R=(0,l.Z)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return s.createElement(r.s6.Consumer,null,(function(e){e||(0,c.Z)(!1);var n=E||e.location,o=h(d(w,n),n),l=o.pathname,k=l&&l.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),C=k?(0,r.LX)(n.pathname,{path:k,exact:g,sensitive:_,strict:T}):null,O=!!(v?v(C,n):C),A="function"==typeof f?f(O):f,N="function"==typeof x?x(O):x;O&&(A=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(A,u),N=(0,a.Z)({},N,p));var I=(0,a.Z)({"aria-current":O&&i||null,className:A,style:N,to:o},R);return y!==b?I.ref=t||S:I.innerRef=S,s.createElement(m,I)}))}))},16550:(e,t,n)=>{"use strict";n.d(t,{AW:()=>w,F0:()=>v,LX:()=>x,TH:()=>L,k6:()=>I,rs:()=>A,s6:()=>b});var r=n(75068),i=n(67294),s=n(45697),o=n.n(s),a=n(99318),l=n(38776),c=n(87462),u=n(14779),d=n.n(u),h=(n(59864),n(63366)),p=(n(8679),1073741823),f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:{};var g=i.createContext||function(e,t){var n,s,a="__create-react-context-"+function(){var e="__global_unique_id__";return f[e]=(f[e]||0)+1}()+"__",l=function(e){function n(){for(var t,n,r,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return(t=e.call.apply(e,[this].concat(s))||this).emitter=(n=t.props.value,r=[],{on:function(e){r.push(e)},off:function(e){r=r.filter((function(t){return t!==e}))},get:function(){return n},set:function(e,t){n=e,r.forEach((function(e){return e(n,t)}))}}),t}(0,r.Z)(n,e);var i=n.prototype;return i.getChildContext=function(){var e;return(e={})[a]=this.emitter,e},i.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,i=e.value;((s=r)===(o=i)?0!==s||1/s==1/o:s!=s&&o!=o)?n=0:(n="function"==typeof t?t(r,i):p,0!==(n|=0)&&this.emitter.set(e.value,n))}var s,o},i.render=function(){return this.props.children},n}(i.Component);l.childContextTypes=((n={})[a]=o().object.isRequired,n);var c=function(t){function n(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).observedBits=void 0,e.state={value:e.getValue()},e.onUpdate=function(t,n){0!=((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}(0,r.Z)(n,t);var i=n.prototype;return i.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?p:t},i.componentDidMount=function(){this.context[a]&&this.context[a].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?p:e},i.componentWillUnmount=function(){this.context[a]&&this.context[a].off(this.onUpdate)},i.getValue=function(){return this.context[a]?this.context[a].get():e},i.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(i.Component);return c.contextTypes=((s={})[a]=o().object,s),{Provider:l,Consumer:c}},m=function(e){var t=g();return t.displayName=e,t},y=m("Router-History"),b=m("Router"),v=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._pendingLocation=e}))),n}(0,r.Z)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){var e=this;this._isMounted=!0,this.unlisten&&this.unlisten(),this.props.staticContext||(this.unlisten=this.props.history.listen((function(t){e._isMounted&&e.setState({location:t})}))),this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return i.createElement(b.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},i.createElement(y.Provider,{children:this.props.children||null,value:this.props.history}))},t}(i.Component);i.Component;i.Component;var E={},_=1e4,T=0;function x(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,i=n.exact,s=void 0!==i&&i,o=n.strict,a=void 0!==o&&o,l=n.sensitive,c=void 0!==l&&l;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=E[n]||(E[n]={});if(r[e])return r[e];var i=[],s={regexp:d()(e,i,t),keys:i};return T<_&&(r[e]=s,T++),s}(n,{end:s,strict:a,sensitive:c}),i=r.regexp,o=r.keys,l=i.exec(e);if(!l)return null;var u=l[0],h=l.slice(1),p=e===u;return s&&!p?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:p,params:o.reduce((function(e,t,n){return e[t.name]=h[n],e}),{})}}),null)}var w=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.Z)(t,e),t.prototype.render=function(){var e=this;return i.createElement(b.Consumer,null,(function(t){t||(0,l.Z)(!1);var n=e.props.location||t.location,r=e.props.computedMatch?e.props.computedMatch:e.props.path?x(n.pathname,e.props):t.match,s=(0,c.Z)({},t,{location:n,match:r}),o=e.props,a=o.children,u=o.component,d=o.render;return Array.isArray(a)&&function(e){return 0===i.Children.count(e)}(a)&&(a=null),i.createElement(b.Provider,{value:s},s.match?a?"function"==typeof a?a(s):a:u?i.createElement(u,s):d?d(s):null:"function"==typeof a?a(s):null)}))},t}(i.Component);function S(e){return"/"===e.charAt(0)?e:"/"+e}function R(e,t){if(!e)return t;var n=S(e);return 0!==t.pathname.indexOf(n)?t:(0,c.Z)({},t,{pathname:t.pathname.substr(n.length)})}function k(e){return"string"==typeof e?e:(0,a.Ep)(e)}function C(e){return function(){(0,l.Z)(!1)}}function O(){}i.Component;var A=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.Z)(t,e),t.prototype.render=function(){var e=this;return i.createElement(b.Consumer,null,(function(t){t||(0,l.Z)(!1);var n,r,s=e.props.location||t.location;return i.Children.forEach(e.props.children,(function(e){if(null==r&&i.isValidElement(e)){n=e;var o=e.props.path||e.props.from;r=o?x(s.pathname,(0,c.Z)({},e.props,{path:o})):t.match}})),r?i.cloneElement(n,{location:s,computedMatch:r}):null}))},t}(i.Component);var N=i.useContext;function I(){return N(y)}function L(){return N(b).location}},72408:(e,t,n)=>{"use strict";var r=n(27418),i=60103,s=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var o=60109,a=60110,l=60112;t.Suspense=60113;var c=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var d=Symbol.for;i=d("react.element"),s=d("react.portal"),t.Fragment=d("react.fragment"),t.StrictMode=d("react.strict_mode"),t.Profiler=d("react.profiler"),o=d("react.provider"),a=d("react.context"),l=d("react.forward_ref"),t.Suspense=d("react.suspense"),c=d("react.memo"),u=d("react.lazy")}var h="function"==typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g={};function m(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}function y(){}function b(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||f}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(p(85));this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=m.prototype;var v=b.prototype=new y;v.constructor=b,r(v,m.prototype),v.isPureReactComponent=!0;var E={current:null},_=Object.prototype.hasOwnProperty,T={key:!0,ref:!0,__self:!0,__source:!0};function x(e,t,n){var r,s={},o=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(o=""+t.key),t)_.call(t,r)&&!T.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(1===l)s.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===s[r]&&(s[r]=l[r]);return{$$typeof:i,type:e,key:o,ref:a,props:s,_owner:E.current}}function w(e){return"object"==typeof e&&null!==e&&e.$$typeof===i}var S=/\/+/g;function R(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function k(e,t,n,r,o){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var l=!1;if(null===e)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case i:case s:l=!0}}if(l)return o=o(l=e),e=""===r?"."+R(l,0):r,Array.isArray(o)?(n="",null!=e&&(n=e.replace(S,"$&/")+"/"),k(o,t,n,"",(function(e){return e}))):null!=o&&(w(o)&&(o=function(e,t){return{$$typeof:i,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(S,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=""===r?".":r+":",Array.isArray(e))for(var c=0;c<e.length;c++){var u=r+R(a=e[c],c);l+=k(a,t,n,u,o)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=h&&e[h]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(a=e.next()).done;)l+=k(a=a.value,t,n,u=r+R(a,c++),o);else if("object"===a)throw t=""+e,Error(p(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return l}function C(e,t,n){if(null==e)return e;var r=[],i=0;return k(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function O(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var A={current:null};function N(){var e=A.current;if(null===e)throw Error(p(321));return e}var I={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:E,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:C,forEach:function(e,t,n){C(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return C(e,(function(){t++})),t},toArray:function(e){return C(e,(function(e){return e}))||[]},only:function(e){if(!w(e))throw Error(p(143));return e}},t.Component=m,t.PureComponent=b,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,t.cloneElement=function(e,t,n){if(null==e)throw Error(p(267,e));var s=r({},e.props),o=e.key,a=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,l=E.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(u in t)_.call(t,u)&&!T.hasOwnProperty(u)&&(s[u]=void 0===t[u]&&void 0!==c?c[u]:t[u])}var u=arguments.length-2;if(1===u)s.children=n;else if(1<u){c=Array(u);for(var d=0;d<u;d++)c[d]=arguments[d+2];s.children=c}return{$$typeof:i,type:e.type,key:o,ref:a,props:s,_owner:l}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:a,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=x,t.createFactory=function(e){var t=x.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=w,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:O}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return N().useCallback(e,t)},t.useContext=function(e,t){return N().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return N().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return N().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return N().useLayoutEffect(e,t)},t.useMemo=function(e,t){return N().useMemo(e,t)},t.useReducer=function(e,t,n){return N().useReducer(e,t,n)},t.useRef=function(e){return N().useRef(e)},t.useState=function(e){return N().useState(e)},t.version="17.0.2"},67294:(e,t,n)=>{"use strict";e.exports=n(72408)},60053:(e,t)=>{"use strict";var n,r,i,s;if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,u=null,d=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(n){throw setTimeout(d,0),n}};n=function(e){null!==c?setTimeout(n,0,e):(c=e,setTimeout(d,0))},r=function(e,t){u=setTimeout(e,t)},i=function(){clearTimeout(u)},t.unstable_shouldYield=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var h=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var f=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof f&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var g=!1,m=null,y=-1,b=5,v=0;t.unstable_shouldYield=function(){return t.unstable_now()>=v},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<e?Math.floor(1e3/e):5};var E=new MessageChannel,_=E.port2;E.port1.onmessage=function(){if(null!==m){var e=t.unstable_now();v=e+b;try{m(!0,e)?_.postMessage(null):(g=!1,m=null)}catch(n){throw _.postMessage(null),n}}else g=!1},n=function(e){m=e,g||(g=!0,_.postMessage(null))},r=function(e,n){y=h((function(){e(t.unstable_now())}),n)},i=function(){p(y),y=-1}}function T(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<S(i,t)))break e;e[r]=t,e[n]=i,n=r}}function x(e){return void 0===(e=e[0])?null:e}function w(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length;r<i;){var s=2*(r+1)-1,o=e[s],a=s+1,l=e[a];if(void 0!==o&&0>S(o,n))void 0!==l&&0>S(l,o)?(e[r]=l,e[a]=n,r=a):(e[r]=o,e[s]=n,r=s);else{if(!(void 0!==l&&0>S(l,n)))break e;e[r]=l,e[a]=n,r=a}}}return t}return null}function S(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var R=[],k=[],C=1,O=null,A=3,N=!1,I=!1,L=!1;function D(e){for(var t=x(k);null!==t;){if(null===t.callback)w(k);else{if(!(t.startTime<=e))break;w(k),t.sortIndex=t.expirationTime,T(R,t)}t=x(k)}}function P(e){if(L=!1,D(e),!I)if(null!==x(R))I=!0,n(M);else{var t=x(k);null!==t&&r(P,t.startTime-e)}}function M(e,n){I=!1,L&&(L=!1,i()),N=!0;var s=A;try{for(D(n),O=x(R);null!==O&&(!(O.expirationTime>n)||e&&!t.unstable_shouldYield());){var o=O.callback;if("function"==typeof o){O.callback=null,A=O.priorityLevel;var a=o(O.expirationTime<=n);n=t.unstable_now(),"function"==typeof a?O.callback=a:O===x(R)&&w(R),D(n)}else w(R);O=x(R)}if(null!==O)var l=!0;else{var c=x(k);null!==c&&r(P,c.startTime-n),l=!1}return l}finally{O=null,A=s,N=!1}}var F=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){I||N||(I=!0,n(M))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return x(R)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var n=A;A=t;try{return e()}finally{A=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=F,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=A;A=e;try{return t()}finally{A=n}},t.unstable_scheduleCallback=function(e,s,o){var a=t.unstable_now();switch("object"==typeof o&&null!==o?o="number"==typeof(o=o.delay)&&0<o?a+o:a:o=a,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return e={id:C++,callback:s,priorityLevel:e,startTime:o,expirationTime:l=o+l,sortIndex:-1},o>a?(e.sortIndex=o,T(k,e),null===x(R)&&e===x(k)&&(L?i():L=!0,r(P,o-a))):(e.sortIndex=l,T(R,e),I||N||(I=!0,n(M))),e},t.unstable_wrapCallback=function(e){var t=A;return function(){var n=A;A=t;try{return e.apply(this,arguments)}finally{A=n}}}},63840:(e,t,n)=>{"use strict";e.exports=n(60053)},96774:e=>{e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l<s.length;l++){var c=s[l];if(!a(c))return!1;var u=e[c],d=t[c];if(!1===(i=n?n.call(r,u,d,c):void 0)||void 0===i&&u!==d)return!1}return!0}},53250:(e,t,n)=>{"use strict";var r=n(67294);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useState,o=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(r){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=s({inst:{value:n,getSnapshot:t}}),i=r[0].inst,u=r[1];return a((function(){i.value=n,i.getSnapshot=t,c(i)&&u({inst:i})}),[e,n,t]),o((function(){return c(i)&&u({inst:i}),e((function(){c(i)&&u({inst:i})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},61688:(e,t,n)=>{"use strict";e.exports=n(53250)},92529:(e,t)=>{(()=>{var e={92:()=>{}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,r),s.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{"use strict";r.r(i),r.d(i,{ATN:()=>Z,ATNDeserializer:()=>Ce,BailErrorStrategy:()=>xt,CharStream:()=>Rt,CharStreams:()=>At,CommonToken:()=>Le,CommonTokenStream:()=>Dt,DFA:()=>lt,DiagnosticErrorListener:()=>vt,ErrorListener:()=>Oe,FailedPredicateException:()=>yt,InputStream:()=>Rt,Interval:()=>v,IntervalSet:()=>E,LL1Analyzer:()=>Y,Lexer:()=>Ue,LexerATNSimulator:()=>qe,NoViableAltException:()=>tt,ParseTreeListener:()=>ht,ParseTreeVisitor:()=>pt,ParseTreeWalker:()=>ft,Parser:()=>Mt,ParserATNSimulator:()=>rt,ParserRuleContext:()=>jt,PredictionContextCache:()=>it,PredictionMode:()=>et,RecognitionException:()=>Me,RuleContext:()=>F,RuleNode:()=>I,TerminalNode:()=>L,Token:()=>e,arrayToString:()=>u,default:()=>Gt});class e{constructor(){this.source=null,this.type=null,this.channel=null,this.start=null,this.stop=null,this.tokenIndex=null,this.line=null,this.column=null,this._text=null}getTokenSource(){return this.source[0]}getInputStream(){return this.source[1]}get text(){return this._text}set text(e){this._text=e}}function t(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!(e[n]===t[n]||e[n].equals&&e[n].equals(t[n])))return!1;return!0}e.INVALID_TYPE=0,e.EPSILON=-2,e.MIN_USER_TOKEN_TYPE=1,e.EOF=-1,e.DEFAULT_CHANNEL=0,e.HIDDEN_CHANNEL=1;const n=Math.round(Math.random()*Math.pow(2,32));function s(e){if(!e)return 0;const t=typeof e,r="string"===t?e:!("object"!==t||!e.toString)&&e.toString();if(!r)return 0;let i,s;const o=3&r.length,a=r.length-o;let l=n;const c=3432918353,u=461845907;let d=0;for(;d<a;)s=255&r.charCodeAt(d)|(255&r.charCodeAt(++d))<<8|(255&r.charCodeAt(++d))<<16|(255&r.charCodeAt(++d))<<24,++d,s=(65535&s)*c+(((s>>>16)*c&65535)<<16)&4294967295,s=s<<15|s>>>17,s=(65535&s)*u+(((s>>>16)*u&65535)<<16)&4294967295,l^=s,l=l<<13|l>>>19,i=5*(65535&l)+((5*(l>>>16)&65535)<<16)&4294967295,l=27492+(65535&i)+((58964+(i>>>16)&65535)<<16);switch(s=0,o){case 3:s^=(255&r.charCodeAt(d+2))<<16;case 2:s^=(255&r.charCodeAt(d+1))<<8;case 1:s^=255&r.charCodeAt(d),s=(65535&s)*c+(((s>>>16)*c&65535)<<16)&4294967295,s=s<<15|s>>>17,s=(65535&s)*u+(((s>>>16)*u&65535)<<16)&4294967295,l^=s}return l^=r.length,l^=l>>>16,l=2246822507*(65535&l)+((2246822507*(l>>>16)&65535)<<16)&4294967295,l^=l>>>13,l=3266489909*(65535&l)+((3266489909*(l>>>16)&65535)<<16)&4294967295,l^=l>>>16,l>>>0}class o{constructor(){this.count=0,this.hash=0}update(){for(let e=0;e<arguments.length;e++){const t=arguments[e];if(null!=t)if(Array.isArray(t))this.update.apply(this,t);else{let e=0;switch(typeof t){case"undefined":case"function":continue;case"number":case"boolean":e=t;break;case"string":e=s(t);break;default:t.updateHashCode?t.updateHashCode(this):console.log("No updateHashCode for "+t.toString());continue}e*=3432918353,e=e<<15|e>>>17,e*=461845907,this.count=this.count+1;let n=this.hash^e;n=n<<13|n>>>19,n=5*n+3864292196,this.hash=n}}}finish(){let e=this.hash^4*this.count;return e^=e>>>16,e*=2246822507,e^=e>>>13,e*=3266489909,e^=e>>>16,e}static hashStuff(){const e=new o;return e.update.apply(e,arguments),e.finish()}}function a(e){return e?"string"==typeof e?s(e):e.hashCode():-1}function l(e,t){return e?e.equals(t):e===t}function c(e){return null===e?"null":e}function u(e){return Array.isArray(e)?"["+e.map(c).join(", ")+"]":"null"}const d="h-";class h{constructor(e,t){this.data={},this.hashFunction=e||a,this.equalsFunction=t||l}add(e){const t=d+this.hashFunction(e);if(t in this.data){const n=this.data[t];for(let t=0;t<n.length;t++)if(this.equalsFunction(e,n[t]))return n[t];return n.push(e),e}return this.data[t]=[e],e}has(e){return null!=this.get(e)}get(e){const t=d+this.hashFunction(e);if(t in this.data){const n=this.data[t];for(let t=0;t<n.length;t++)if(this.equalsFunction(e,n[t]))return n[t]}return null}values(){return Object.keys(this.data).filter((e=>e.startsWith(d))).flatMap((e=>this.data[e]),this)}toString(){return u(this.values())}get length(){return Object.keys(this.data).filter((e=>e.startsWith(d))).map((e=>this.data[e].length),this).reduce(((e,t)=>e+t),0)}}class p{hashCode(){const e=new o;return this.updateHashCode(e),e.finish()}evaluate(e,t){}evalPrecedence(e,t){return this}static andContext(e,t){if(null===e||e===p.NONE)return t;if(null===t||t===p.NONE)return e;const n=new f(e,t);return 1===n.opnds.length?n.opnds[0]:n}static orContext(e,t){if(null===e)return t;if(null===t)return e;if(e===p.NONE||t===p.NONE)return p.NONE;const n=new g(e,t);return 1===n.opnds.length?n.opnds[0]:n}}class f extends p{constructor(e,t){super();const n=new h;e instanceof f?e.opnds.map((function(e){n.add(e)})):n.add(e),t instanceof f?t.opnds.map((function(e){n.add(e)})):n.add(t);const r=m(n);if(r.length>0){let e=null;r.map((function(t){(null===e||t.precedence<e.precedence)&&(e=t)})),n.add(e)}this.opnds=Array.from(n.values())}equals(e){return this===e||e instanceof f&&t(this.opnds,e.opnds)}updateHashCode(e){e.update(this.opnds,"AND")}evaluate(e,t){for(let n=0;n<this.opnds.length;n++)if(!this.opnds[n].evaluate(e,t))return!1;return!0}evalPrecedence(e,t){let n=!1;const r=[];for(let s=0;s<this.opnds.length;s++){const i=this.opnds[s],o=i.evalPrecedence(e,t);if(n|=o!==i,null===o)return null;o!==p.NONE&&r.push(o)}if(!n)return this;if(0===r.length)return p.NONE;let i=null;return r.map((function(e){i=null===i?e:p.andContext(i,e)})),i}toString(){const e=this.opnds.map((e=>e.toString()));return(e.length>3?e.slice(3):e).join("&&")}}class g extends p{constructor(e,t){super();const n=new h;e instanceof g?e.opnds.map((function(e){n.add(e)})):n.add(e),t instanceof g?t.opnds.map((function(e){n.add(e)})):n.add(t);const r=m(n);if(r.length>0){const e=r.sort((function(e,t){return e.compareTo(t)})),t=e[e.length-1];n.add(t)}this.opnds=Array.from(n.values())}equals(e){return this===e||e instanceof g&&t(this.opnds,e.opnds)}updateHashCode(e){e.update(this.opnds,"OR")}evaluate(e,t){for(let n=0;n<this.opnds.length;n++)if(this.opnds[n].evaluate(e,t))return!0;return!1}evalPrecedence(e,t){let n=!1;const r=[];for(let i=0;i<this.opnds.length;i++){const s=this.opnds[i],o=s.evalPrecedence(e,t);if(n|=o!==s,o===p.NONE)return p.NONE;null!==o&&r.push(o)}return n?(0===r.length||r.map((function(e){return e})),null):this}toString(){const e=this.opnds.map((e=>e.toString()));return(e.length>3?e.slice(3):e).join("||")}}function m(e){const t=[];return e.values().map((function(e){e instanceof p.PrecedencePredicate&&t.push(e)})),t}function y(e,t){if(null===e){const e={state:null,alt:null,context:null,semanticContext:null};return t&&(e.reachesIntoOuterContext=0),e}{const n={};return n.state=e.state||null,n.alt=void 0===e.alt?null:e.alt,n.context=e.context||null,n.semanticContext=e.semanticContext||null,t&&(n.reachesIntoOuterContext=e.reachesIntoOuterContext||0,n.precedenceFilterSuppressed=e.precedenceFilterSuppressed||!1),n}}class b{constructor(e,t){this.checkContext(e,t),e=y(e),t=y(t,!0),this.state=null!==e.state?e.state:t.state,this.alt=null!==e.alt?e.alt:t.alt,this.context=null!==e.context?e.context:t.context,this.semanticContext=null!==e.semanticContext?e.semanticContext:null!==t.semanticContext?t.semanticContext:p.NONE,this.reachesIntoOuterContext=t.reachesIntoOuterContext,this.precedenceFilterSuppressed=t.precedenceFilterSuppressed}checkContext(e,t){null!==e.context&&void 0!==e.context||null!==t&&null!==t.context&&void 0!==t.context||(this.context=null)}hashCode(){const e=new o;return this.updateHashCode(e),e.finish()}updateHashCode(e){e.update(this.state.stateNumber,this.alt,this.context,this.semanticContext)}equals(e){return this===e||e instanceof b&&this.state.stateNumber===e.state.stateNumber&&this.alt===e.alt&&(null===this.context?null===e.context:this.context.equals(e.context))&&this.semanticContext.equals(e.semanticContext)&&this.precedenceFilterSuppressed===e.precedenceFilterSuppressed}hashCodeForConfigSet(){const e=new o;return e.update(this.state.stateNumber,this.alt,this.semanticContext),e.finish()}equalsForConfigSet(e){return this===e||e instanceof b&&this.state.stateNumber===e.state.stateNumber&&this.alt===e.alt&&this.semanticContext.equals(e.semanticContext)}toString(){return"("+this.state+","+this.alt+(null!==this.context?",["+this.context.toString()+"]":"")+(this.semanticContext!==p.NONE?","+this.semanticContext.toString():"")+(this.reachesIntoOuterContext>0?",up="+this.reachesIntoOuterContext:"")+")"}}class v{constructor(e,t){this.start=e,this.stop=t}clone(){return new v(this.start,this.stop)}contains(e){return e>=this.start&&e<this.stop}toString(){return this.start===this.stop-1?this.start.toString():this.start.toString()+".."+(this.stop-1).toString()}get length(){return this.stop-this.start}}v.INVALID_INTERVAL=new v(-1,-2);class E{constructor(){this.intervals=null,this.readOnly=!1}first(t){return null===this.intervals||0===this.intervals.length?e.INVALID_TYPE:this.intervals[0].start}addOne(e){this.addInterval(new v(e,e+1))}addRange(e,t){this.addInterval(new v(e,t+1))}addInterval(e){if(null===this.intervals)this.intervals=[],this.intervals.push(e.clone());else{for(let t=0;t<this.intervals.length;t++){const n=this.intervals[t];if(e.stop<n.start)return void this.intervals.splice(t,0,e);if(e.stop===n.start)return void(this.intervals[t]=new v(e.start,n.stop));if(e.start<=n.stop)return this.intervals[t]=new v(Math.min(n.start,e.start),Math.max(n.stop,e.stop)),void this.reduce(t)}this.intervals.push(e.clone())}}addSet(e){return null!==e.intervals&&e.intervals.forEach((e=>this.addInterval(e)),this),this}reduce(e){if(e<this.intervals.length-1){const t=this.intervals[e],n=this.intervals[e+1];t.stop>=n.stop?(this.intervals.splice(e+1,1),this.reduce(e)):t.stop>=n.start&&(this.intervals[e]=new v(t.start,n.stop),this.intervals.splice(e+1,1))}}complement(e,t){const n=new E;return n.addInterval(new v(e,t+1)),null!==this.intervals&&this.intervals.forEach((e=>n.removeRange(e))),n}contains(e){if(null===this.intervals)return!1;for(let t=0;t<this.intervals.length;t++)if(this.intervals[t].contains(e))return!0;return!1}removeRange(e){if(e.start===e.stop-1)this.removeOne(e.start);else if(null!==this.intervals){let t=0;for(let n=0;n<this.intervals.length;n++){const n=this.intervals[t];if(e.stop<=n.start)return;if(e.start>n.start&&e.stop<n.stop){this.intervals[t]=new v(n.start,e.start);const r=new v(e.stop,n.stop);return void this.intervals.splice(t,0,r)}e.start<=n.start&&e.stop>=n.stop?(this.intervals.splice(t,1),t-=1):e.start<n.stop?this.intervals[t]=new v(n.start,e.start):e.stop<n.stop&&(this.intervals[t]=new v(e.stop,n.stop)),t+=1}}}removeOne(e){if(null!==this.intervals)for(let t=0;t<this.intervals.length;t++){const n=this.intervals[t];if(e<n.start)return;if(e===n.start&&e===n.stop-1)return void this.intervals.splice(t,1);if(e===n.start)return void(this.intervals[t]=new v(n.start+1,n.stop));if(e===n.stop-1)return void(this.intervals[t]=new v(n.start,n.stop-1));if(e<n.stop-1){const r=new v(n.start,e);return n.start=e+1,void this.intervals.splice(t,0,r)}}}toString(e,t,n){return e=e||null,t=t||null,n=n||!1,null===this.intervals?"{}":null!==e||null!==t?this.toTokenString(e,t):n?this.toCharString():this.toIndexString()}toCharString(){const t=[];for(let n=0;n<this.intervals.length;n++){const r=this.intervals[n];r.stop===r.start+1?r.start===e.EOF?t.push("<EOF>"):t.push("'"+String.fromCharCode(r.start)+"'"):t.push("'"+String.fromCharCode(r.start)+"'..'"+String.fromCharCode(r.stop-1)+"'")}return t.length>1?"{"+t.join(", ")+"}":t[0]}toIndexString(){const t=[];for(let n=0;n<this.intervals.length;n++){const r=this.intervals[n];r.stop===r.start+1?r.start===e.EOF?t.push("<EOF>"):t.push(r.start.toString()):t.push(r.start.toString()+".."+(r.stop-1).toString())}return t.length>1?"{"+t.join(", ")+"}":t[0]}toTokenString(e,t){const n=[];for(let r=0;r<this.intervals.length;r++){const i=this.intervals[r];for(let r=i.start;r<i.stop;r++)n.push(this.elementName(e,t,r))}return n.length>1?"{"+n.join(", ")+"}":n[0]}elementName(t,n,r){return r===e.EOF?"<EOF>":r===e.EPSILON?"<EPSILON>":t[r]||n[r]}get length(){return this.intervals.map((e=>e.length)).reduce(((e,t)=>e+t))}}class _{constructor(){this.atn=null,this.stateNumber=_.INVALID_STATE_NUMBER,this.stateType=null,this.ruleIndex=0,this.epsilonOnlyTransitions=!1,this.transitions=[],this.nextTokenWithinRule=null}toString(){return this.stateNumber}equals(e){return e instanceof _&&this.stateNumber===e.stateNumber}isNonGreedyExitState(){return!1}addTransition(e,t){void 0===t&&(t=-1),0===this.transitions.length?this.epsilonOnlyTransitions=e.isEpsilon:this.epsilonOnlyTransitions!==e.isEpsilon&&(this.epsilonOnlyTransitions=!1),-1===t?this.transitions.push(e):this.transitions.splice(t,1,e)}}_.INVALID_TYPE=0,_.BASIC=1,_.RULE_START=2,_.BLOCK_START=3,_.PLUS_BLOCK_START=4,_.STAR_BLOCK_START=5,_.TOKEN_START=6,_.RULE_STOP=7,_.BLOCK_END=8,_.STAR_LOOP_BACK=9,_.STAR_LOOP_ENTRY=10,_.PLUS_LOOP_BACK=11,_.LOOP_END=12,_.serializationNames=["INVALID","BASIC","RULE_START","BLOCK_START","PLUS_BLOCK_START","STAR_BLOCK_START","TOKEN_START","RULE_STOP","BLOCK_END","STAR_LOOP_BACK","STAR_LOOP_ENTRY","PLUS_LOOP_BACK","LOOP_END"],_.INVALID_STATE_NUMBER=-1;class T extends _{constructor(){return super(),this.stateType=_.RULE_STOP,this}}class x{constructor(e){if(null==e)throw"target cannot be null.";this.target=e,this.isEpsilon=!1,this.label=null}}x.EPSILON=1,x.RANGE=2,x.RULE=3,x.PREDICATE=4,x.ATOM=5,x.ACTION=6,x.SET=7,x.NOT_SET=8,x.WILDCARD=9,x.PRECEDENCE=10,x.serializationNames=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"],x.serializationTypes={EpsilonTransition:x.EPSILON,RangeTransition:x.RANGE,RuleTransition:x.RULE,PredicateTransition:x.PREDICATE,AtomTransition:x.ATOM,ActionTransition:x.ACTION,SetTransition:x.SET,NotSetTransition:x.NOT_SET,WildcardTransition:x.WILDCARD,PrecedencePredicateTransition:x.PRECEDENCE};class w extends x{constructor(e,t,n,r){super(e),this.ruleIndex=t,this.precedence=n,this.followState=r,this.serializationType=x.RULE,this.isEpsilon=!0}matches(e,t,n){return!1}}class S extends x{constructor(t,n){super(t),this.serializationType=x.SET,null!=n?this.label=n:(this.label=new E,this.label.addOne(e.INVALID_TYPE))}matches(e,t,n){return this.label.contains(e)}toString(){return this.label.toString()}}class R extends S{constructor(e,t){super(e,t),this.serializationType=x.NOT_SET}matches(e,t,n){return e>=t&&e<=n&&!super.matches(e,t,n)}toString(){return"~"+super.toString()}}class k extends x{constructor(e){super(e),this.serializationType=x.WILDCARD}matches(e,t,n){return e>=t&&e<=n}toString(){return"."}}class C extends x{constructor(e){super(e)}}class O{}class A extends O{}class N extends A{}class I extends N{get ruleContext(){throw new Error("missing interface implementation")}}class L extends N{}class D extends L{}const P={toStringTree:function(e,t,n){t=t||null,null!==(n=n||null)&&(t=n.ruleNames);let r=P.getNodeText(e,t);r=function(e,t){return e.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r")}(r);const i=e.getChildCount();if(0===i)return r;let s="("+r+" ";i>0&&(r=P.toStringTree(e.getChild(0),t),s=s.concat(r));for(let o=1;o<i;o++)r=P.toStringTree(e.getChild(o),t),s=s.concat(" "+r);return s=s.concat(")"),s},getNodeText:function(t,n,r){if(n=n||null,null!==(r=r||null)&&(n=r.ruleNames),null!==n){if(t instanceof I){const e=t.ruleContext.getAltNumber();return 0!=e?n[t.ruleIndex]+":"+e:n[t.ruleIndex]}if(t instanceof D)return t.toString();if(t instanceof L&&null!==t.symbol)return t.symbol.text}const i=t.getPayload();return i instanceof e?i.text:t.getPayload().toString()},getChildren:function(e){const t=[];for(let n=0;n<e.getChildCount();n++)t.push(e.getChild(n));return t},getAncestors:function(e){let t=[];for(e=e.getParent();null!==e;)t=[e].concat(t),e=e.getParent();return t},findAllTokenNodes:function(e,t){return P.findAllNodes(e,t,!0)},findAllRuleNodes:function(e,t){return P.findAllNodes(e,t,!1)},findAllNodes:function(e,t,n){const r=[];return P._findAllNodes(e,t,n,r),r},_findAllNodes:function(e,t,n,r){n&&e instanceof L?e.symbol.type===t&&r.push(e):!n&&e instanceof I&&e.ruleIndex===t&&r.push(e);for(let i=0;i<e.getChildCount();i++)P._findAllNodes(e.getChild(i),t,n,r)},descendants:function(e){let t=[e];for(let n=0;n<e.getChildCount();n++)t=t.concat(P.descendants(e.getChild(n)));return t}},M=P;class F extends I{constructor(e,t){super(),this.parentCtx=e||null,this.invokingState=t||-1}depth(){let e=0,t=this;for(;null!==t;)t=t.parentCtx,e+=1;return e}isEmpty(){return-1===this.invokingState}getSourceInterval(){return v.INVALID_INTERVAL}get ruleContext(){return this}getPayload(){return this}getText(){return 0===this.getChildCount()?"":this.children.map((function(e){return e.getText()})).join("")}getAltNumber(){return 0}setAltNumber(e){}getChild(e){return null}getChildCount(){return 0}accept(e){return e.visitChildren(this)}toStringTree(e,t){return M.toStringTree(this,e,t)}toString(e,t){e=e||null,t=t||null;let n=this,r="[";for(;null!==n&&n!==t;){if(null===e)n.isEmpty()||(r+=n.invokingState);else{const t=n.ruleIndex;r+=t>=0&&t<e.length?e[t]:""+t}null===n.parentCtx||null===e&&n.parentCtx.isEmpty()||(r+=" "),n=n.parentCtx}return r+="]",r}}class U{constructor(e){this.cachedHashCode=e}isEmpty(){return this===U.EMPTY}hasEmptyPath(){return this.getReturnState(this.length-1)===U.EMPTY_RETURN_STATE}hashCode(){return this.cachedHashCode}updateHashCode(e){e.update(this.cachedHashCode)}}U.EMPTY=null,U.EMPTY_RETURN_STATE=2147483647,U.globalNodeCount=1,U.id=U.globalNodeCount,U.trace_atn_sim=!1;class j extends U{constructor(e,t){const n=new o;return n.update(e,t),super(n.finish()),this.parents=e,this.returnStates=t,this}isEmpty(){return this.returnStates[0]===U.EMPTY_RETURN_STATE}getParent(e){return this.parents[e]}getReturnState(e){return this.returnStates[e]}equals(e){return this===e||e instanceof j&&this.hashCode()===e.hashCode()&&t(this.returnStates,e.returnStates)&&t(this.parents,e.parents)}toString(){if(this.isEmpty())return"[]";{let e="[";for(let t=0;t<this.returnStates.length;t++)t>0&&(e+=", "),this.returnStates[t]!==U.EMPTY_RETURN_STATE?(e+=this.returnStates[t],null!==this.parents[t]?e=e+" "+this.parents[t]:e+="null"):e+="$";return e+"]"}}get length(){return this.returnStates.length}}class B extends U{constructor(e,t){let n=0;const r=new o;null!==e?r.update(e,t):r.update(1),n=r.finish(),super(n),this.parentCtx=e,this.returnState=t}getParent(e){return this.parentCtx}getReturnState(e){return this.returnState}equals(e){return this===e||e instanceof B&&this.hashCode()===e.hashCode()&&this.returnState===e.returnState&&(null==this.parentCtx?null==e.parentCtx:this.parentCtx.equals(e.parentCtx))}toString(){const e=null===this.parentCtx?"":this.parentCtx.toString();return 0===e.length?this.returnState===U.EMPTY_RETURN_STATE?"$":""+this.returnState:this.returnState+" "+e}get length(){return 1}static create(e,t){return t===U.EMPTY_RETURN_STATE&&null===e?U.EMPTY:new B(e,t)}}class H extends B{constructor(){super(null,U.EMPTY_RETURN_STATE)}isEmpty(){return!0}getParent(e){return null}getReturnState(e){return this.returnState}equals(e){return this===e}toString(){return"$"}}U.EMPTY=new H;const $="h-";class z{constructor(e,t){this.data={},this.hashFunction=e||a,this.equalsFunction=t||l}set(e,t){const n=$+this.hashFunction(e);if(n in this.data){const r=this.data[n];for(let n=0;n<r.length;n++){const i=r[n];if(this.equalsFunction(e,i.key)){const e=i.value;return i.value=t,e}}return r.push({key:e,value:t}),t}return this.data[n]=[{key:e,value:t}],t}containsKey(e){const t=$+this.hashFunction(e);if(t in this.data){const n=this.data[t];for(let t=0;t<n.length;t++){const r=n[t];if(this.equalsFunction(e,r.key))return!0}}return!1}get(e){const t=$+this.hashFunction(e);if(t in this.data){const n=this.data[t];for(let t=0;t<n.length;t++){const r=n[t];if(this.equalsFunction(e,r.key))return r.value}}return null}entries(){return Object.keys(this.data).filter((e=>e.startsWith($))).flatMap((e=>this.data[e]),this)}getKeys(){return this.entries().map((e=>e.key))}getValues(){return this.entries().map((e=>e.value))}toString(){return"["+this.entries().map((e=>"{"+e.key+":"+e.value+"}")).join(", ")+"]"}get length(){return Object.keys(this.data).filter((e=>e.startsWith($))).map((e=>this.data[e].length),this).reduce(((e,t)=>e+t),0)}}function V(e,t){if(null==t&&(t=F.EMPTY),null===t.parentCtx||t===F.EMPTY)return U.EMPTY;const n=V(e,t.parentCtx),r=e.states[t.invokingState].transitions[0];return B.create(n,r.followState.stateNumber)}function G(e,t,n){if(e.isEmpty())return e;let r=n.get(e)||null;if(null!==r)return r;if(r=t.get(e),null!==r)return n.set(e,r),r;let i=!1,s=[];for(let a=0;a<s.length;a++){const r=G(e.getParent(a),t,n);if(i||r!==e.getParent(a)){if(!i){s=[];for(let t=0;t<e.length;t++)s[t]=e.getParent(t);i=!0}s[a]=r}}if(!i)return t.add(e),n.set(e,e),e;let o=null;return o=0===s.length?U.EMPTY:1===s.length?B.create(s[0],e.getReturnState(0)):new j(s,e.returnStates),t.add(o),n.set(o,o),n.set(e,o),o}function W(e,t,n,r){if(e===t)return e;if(e instanceof B&&t instanceof B)return function(e,t,n,r){if(null!==r){let n=r.get(e,t);if(null!==n)return n;if(n=r.get(t,e),null!==n)return n}const i=function(e,t,n){if(n){if(e===U.EMPTY)return U.EMPTY;if(t===U.EMPTY)return U.EMPTY}else{if(e===U.EMPTY&&t===U.EMPTY)return U.EMPTY;if(e===U.EMPTY){const e=[t.returnState,U.EMPTY_RETURN_STATE],n=[t.parentCtx,null];return new j(n,e)}if(t===U.EMPTY){const t=[e.returnState,U.EMPTY_RETURN_STATE],n=[e.parentCtx,null];return new j(n,t)}}return null}(e,t,n);if(null!==i)return null!==r&&r.set(e,t,i),i;if(e.returnState===t.returnState){const i=W(e.parentCtx,t.parentCtx,n,r);if(i===e.parentCtx)return e;if(i===t.parentCtx)return t;const s=B.create(i,e.returnState);return null!==r&&r.set(e,t,s),s}{let n=null;if((e===t||null!==e.parentCtx&&e.parentCtx===t.parentCtx)&&(n=e.parentCtx),null!==n){const i=[e.returnState,t.returnState];e.returnState>t.returnState&&(i[0]=t.returnState,i[1]=e.returnState);const s=new j([n,n],i);return null!==r&&r.set(e,t,s),s}const i=[e.returnState,t.returnState];let s=[e.parentCtx,t.parentCtx];e.returnState>t.returnState&&(i[0]=t.returnState,i[1]=e.returnState,s=[t.parentCtx,e.parentCtx]);const o=new j(s,i);return null!==r&&r.set(e,t,o),o}}(e,t,n,r);if(n){if(e instanceof H)return e;if(t instanceof H)return t}return e instanceof B&&(e=new j([e.getParent()],[e.returnState])),t instanceof B&&(t=new j([t.getParent()],[t.returnState])),function(e,t,n,r){if(null!==r){let n=r.get(e,t);if(null!==n)return U.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> previous"),n;if(n=r.get(t,e),null!==n)return U.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> previous"),n}let i=0,s=0,o=0,a=new Array(e.returnStates.length+t.returnStates.length).fill(0),l=new Array(e.returnStates.length+t.returnStates.length).fill(null);for(;i<e.returnStates.length&&s<t.returnStates.length;){const c=e.parents[i],u=t.parents[s];if(e.returnStates[i]===t.returnStates[s]){const t=e.returnStates[i];t===U.EMPTY_RETURN_STATE&&null===c&&null===u||null!==c&&null!==u&&c===u?(l[o]=c,a[o]=t):(l[o]=W(c,u,n,r),a[o]=t),i+=1,s+=1}else e.returnStates[i]<t.returnStates[s]?(l[o]=c,a[o]=e.returnStates[i],i+=1):(l[o]=u,a[o]=t.returnStates[s],s+=1);o+=1}if(i<e.returnStates.length)for(let u=i;u<e.returnStates.length;u++)l[o]=e.parents[u],a[o]=e.returnStates[u],o+=1;else for(let u=s;u<t.returnStates.length;u++)l[o]=t.parents[u],a[o]=t.returnStates[u],o+=1;if(o<l.length){if(1===o){const n=B.create(l[0],a[0]);return null!==r&&r.set(e,t,n),n}l=l.slice(0,o),a=a.slice(0,o)}const c=new j(l,a);return c.equals(e)?(null!==r&&r.set(e,t,e),U.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> a"),e):c.equals(t)?(null!==r&&r.set(e,t,t),U.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> b"),t):(function(e){const t=new z;for(let n=0;n<e.length;n++){const r=e[n];t.containsKey(r)||t.set(r,r)}for(let n=0;n<e.length;n++)e[n]=t.get(e[n])}(l),null!==r&&r.set(e,t,c),U.trace_atn_sim&&console.log("mergeArrays a="+e+",b="+t+" -> "+c),c)}(e,t,n,r)}class K{constructor(){this.data=[]}add(e){this.data[e]=!0}or(e){Object.keys(e.data).map((e=>this.add(e)),this)}remove(e){delete this.data[e]}has(e){return!0===this.data[e]}values(){return Object.keys(this.data)}minValue(){return Math.min.apply(null,this.values())}hashCode(){return o.hashStuff(this.values())}equals(e){return e instanceof K&&t(this.data,e.data)}toString(){return"{"+this.values().join(", ")+"}"}get length(){return this.values().length}}class Y{constructor(e){this.atn=e}getDecisionLookahead(e){if(null===e)return null;const t=e.transitions.length,n=[];for(let r=0;r<t;r++){n[r]=new E;const t=new h,i=!1;this._LOOK(e.transition(r).target,null,U.EMPTY,n[r],t,new K,i,!1),(0===n[r].length||n[r].contains(Y.HIT_PRED))&&(n[r]=null)}return n}LOOK(e,t,n){const r=new E,i=null!==(n=n||null)?V(e.atn,n):null;return this._LOOK(e,t,i,r,new h,new K,!0,!0),r}_LOOK(t,n,r,i,s,o,a,l){const c=new b({state:t,alt:0,context:r},null);if(!s.has(c)){if(s.add(c),t===n){if(null===r)return void i.addOne(e.EPSILON);if(r.isEmpty()&&l)return void i.addOne(e.EOF)}if(t instanceof T){if(null===r)return void i.addOne(e.EPSILON);if(r.isEmpty()&&l)return void i.addOne(e.EOF);if(r!==U.EMPTY){const e=o.has(t.ruleIndex);try{o.remove(t.ruleIndex);for(let e=0;e<r.length;e++){const t=this.atn.states[r.getReturnState(e)];this._LOOK(t,n,r.getParent(e),i,s,o,a,l)}}finally{e&&o.add(t.ruleIndex)}return}}for(let c=0;c<t.transitions.length;c++){const u=t.transitions[c];if(u.constructor===w){if(o.has(u.target.ruleIndex))continue;const e=B.create(r,u.followState.stateNumber);try{o.add(u.target.ruleIndex),this._LOOK(u.target,n,e,i,s,o,a,l)}finally{o.remove(u.target.ruleIndex)}}else if(u instanceof C)a?this._LOOK(u.target,n,r,i,s,o,a,l):i.addOne(Y.HIT_PRED);else if(u.isEpsilon)this._LOOK(u.target,n,r,i,s,o,a,l);else if(u.constructor===k)i.addRange(e.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType);else{let t=u.label;null!==t&&(u instanceof R&&(t=t.complement(e.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType)),i.addSet(t))}}}}}Y.HIT_PRED=e.INVALID_TYPE;class Z{constructor(e,t){this.grammarType=e,this.maxTokenType=t,this.states=[],this.decisionToState=[],this.ruleToStartState=[],this.ruleToStopState=null,this.modeNameToStartState={},this.ruleToTokenType=null,this.lexerActions=null,this.modeToStartState=[]}nextTokensInContext(e,t){return new Y(this).LOOK(e,null,t)}nextTokensNoContext(e){return null!==e.nextTokenWithinRule||(e.nextTokenWithinRule=this.nextTokensInContext(e,null),e.nextTokenWithinRule.readOnly=!0),e.nextTokenWithinRule}nextTokens(e,t){return void 0===t?this.nextTokensNoContext(e):this.nextTokensInContext(e,t)}addState(e){null!==e&&(e.atn=this,e.stateNumber=this.states.length),this.states.push(e)}removeState(e){this.states[e.stateNumber]=null}defineDecisionState(e){return this.decisionToState.push(e),e.decision=this.decisionToState.length-1,e.decision}getDecisionState(e){return 0===this.decisionToState.length?null:this.decisionToState[e]}getExpectedTokens(t,n){if(t<0||t>=this.states.length)throw"Invalid state number.";const r=this.states[t];let i=this.nextTokens(r);if(!i.contains(e.EPSILON))return i;const s=new E;for(s.addSet(i),s.removeOne(e.EPSILON);null!==n&&n.invokingState>=0&&i.contains(e.EPSILON);){const t=this.states[n.invokingState].transitions[0];i=this.nextTokens(t.followState),s.addSet(i),s.removeOne(e.EPSILON),n=n.parentCtx}return i.contains(e.EPSILON)&&s.addOne(e.EOF),s}}Z.INVALID_ALT_NUMBER=0;class q extends _{constructor(){super(),this.stateType=_.BASIC}}class Q extends _{constructor(){return super(),this.decision=-1,this.nonGreedy=!1,this}}class X extends Q{constructor(){return super(),this.endState=null,this}}class J extends _{constructor(){return super(),this.stateType=_.BLOCK_END,this.startState=null,this}}class ee extends _{constructor(){return super(),this.stateType=_.LOOP_END,this.loopBackState=null,this}}class te extends _{constructor(){return super(),this.stateType=_.RULE_START,this.stopState=null,this.isPrecedenceRule=!1,this}}class ne extends Q{constructor(){return super(),this.stateType=_.TOKEN_START,this}}class re extends Q{constructor(){return super(),this.stateType=_.PLUS_LOOP_BACK,this}}class ie extends _{constructor(){return super(),this.stateType=_.STAR_LOOP_BACK,this}}class se extends Q{constructor(){return super(),this.stateType=_.STAR_LOOP_ENTRY,this.loopBackState=null,this.isPrecedenceDecision=null,this}}class oe extends X{constructor(){return super(),this.stateType=_.PLUS_BLOCK_START,this.loopBackState=null,this}}class ae extends X{constructor(){return super(),this.stateType=_.STAR_BLOCK_START,this}}class le extends X{constructor(){return super(),this.stateType=_.BLOCK_START,this}}class ce extends x{constructor(e,t){super(e),this.label_=t,this.label=this.makeLabel(),this.serializationType=x.ATOM}makeLabel(){const e=new E;return e.addOne(this.label_),e}matches(e,t,n){return this.label_===e}toString(){return this.label_}}class ue extends x{constructor(e,t,n){super(e),this.serializationType=x.RANGE,this.start=t,this.stop=n,this.label=this.makeLabel()}makeLabel(){const e=new E;return e.addRange(this.start,this.stop),e}matches(e,t,n){return e>=this.start&&e<=this.stop}toString(){return"'"+String.fromCharCode(this.start)+"'..'"+String.fromCharCode(this.stop)+"'"}}class de extends x{constructor(e,t,n,r){super(e),this.serializationType=x.ACTION,this.ruleIndex=t,this.actionIndex=void 0===n?-1:n,this.isCtxDependent=void 0!==r&&r,this.isEpsilon=!0}matches(e,t,n){return!1}toString(){return"action_"+this.ruleIndex+":"+this.actionIndex}}class he extends x{constructor(e,t){super(e),this.serializationType=x.EPSILON,this.isEpsilon=!0,this.outermostPrecedenceReturn=t}matches(e,t,n){return!1}toString(){return"epsilon"}}class pe extends p{constructor(e,t,n){super(),this.ruleIndex=void 0===e?-1:e,this.predIndex=void 0===t?-1:t,this.isCtxDependent=void 0!==n&&n}evaluate(e,t){const n=this.isCtxDependent?t:null;return e.sempred(n,this.ruleIndex,this.predIndex)}updateHashCode(e){e.update(this.ruleIndex,this.predIndex,this.isCtxDependent)}equals(e){return this===e||e instanceof pe&&this.ruleIndex===e.ruleIndex&&this.predIndex===e.predIndex&&this.isCtxDependent===e.isCtxDependent}toString(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"}}p.NONE=new pe;class fe extends C{constructor(e,t,n,r){super(e),this.serializationType=x.PREDICATE,this.ruleIndex=t,this.predIndex=n,this.isCtxDependent=r,this.isEpsilon=!0}matches(e,t,n){return!1}getPredicate(){return new pe(this.ruleIndex,this.predIndex,this.isCtxDependent)}toString(){return"pred_"+this.ruleIndex+":"+this.predIndex}}class ge extends p{constructor(e){super(),this.precedence=void 0===e?0:e}evaluate(e,t){return e.precpred(t,this.precedence)}evalPrecedence(e,t){return e.precpred(t,this.precedence)?p.NONE:null}compareTo(e){return this.precedence-e.precedence}updateHashCode(e){e.update(this.precedence)}equals(e){return this===e||e instanceof ge&&this.precedence===e.precedence}toString(){return"{"+this.precedence+">=prec}?"}}p.PrecedencePredicate=ge;class me extends C{constructor(e,t){super(e),this.serializationType=x.PRECEDENCE,this.precedence=t,this.isEpsilon=!0}matches(e,t,n){return!1}getPredicate(){return new ge(this.precedence)}toString(){return this.precedence+" >= _p"}}class ye{constructor(e){void 0===e&&(e=null),this.readOnly=!1,this.verifyATN=null===e||e.verifyATN,this.generateRuleBypassTransitions=null!==e&&e.generateRuleBypassTransitions}}ye.defaultOptions=new ye,ye.defaultOptions.readOnly=!0;class be{constructor(e){this.actionType=e,this.isPositionDependent=!1}hashCode(){const e=new o;return this.updateHashCode(e),e.finish()}updateHashCode(e){e.update(this.actionType)}equals(e){return this===e}}class ve extends be{constructor(){super(6)}execute(e){e.skip()}toString(){return"skip"}}ve.INSTANCE=new ve;class Ee extends be{constructor(e){super(0),this.channel=e}execute(e){e._channel=this.channel}updateHashCode(e){e.update(this.actionType,this.channel)}equals(e){return this===e||e instanceof Ee&&this.channel===e.channel}toString(){return"channel("+this.channel+")"}}class _e extends be{constructor(e,t){super(1),this.ruleIndex=e,this.actionIndex=t,this.isPositionDependent=!0}execute(e){e.action(null,this.ruleIndex,this.actionIndex)}updateHashCode(e){e.update(this.actionType,this.ruleIndex,this.actionIndex)}equals(e){return this===e||e instanceof _e&&this.ruleIndex===e.ruleIndex&&this.actionIndex===e.actionIndex}}class Te extends be{constructor(){super(3)}execute(e){e.more()}toString(){return"more"}}Te.INSTANCE=new Te;class xe extends be{constructor(e){super(7),this.type=e}execute(e){e.type=this.type}updateHashCode(e){e.update(this.actionType,this.type)}equals(e){return this===e||e instanceof xe&&this.type===e.type}toString(){return"type("+this.type+")"}}class we extends be{constructor(e){super(5),this.mode=e}execute(e){e.pushMode(this.mode)}updateHashCode(e){e.update(this.actionType,this.mode)}equals(e){return this===e||e instanceof we&&this.mode===e.mode}toString(){return"pushMode("+this.mode+")"}}class Se extends be{constructor(){super(4)}execute(e){e.popMode()}toString(){return"popMode"}}Se.INSTANCE=new Se;class Re extends be{constructor(e){super(2),this.mode=e}execute(e){e.mode(this.mode)}updateHashCode(e){e.update(this.actionType,this.mode)}equals(e){return this===e||e instanceof Re&&this.mode===e.mode}toString(){return"mode("+this.mode+")"}}function ke(e,t){const n=[];return n[e-1]=t,n.map((function(e){return t}))}class Ce{constructor(e){null==e&&(e=ye.defaultOptions),this.deserializationOptions=e,this.stateFactories=null,this.actionFactories=null}deserialize(e){const t=this.reset(e);this.checkVersion(t),t&&this.skipUUID();const n=this.readATN();this.readStates(n,t),this.readRules(n,t),this.readModes(n);const r=[];return this.readSets(n,r,this.readInt.bind(this)),t&&this.readSets(n,r,this.readInt32.bind(this)),this.readEdges(n,r),this.readDecisions(n),this.readLexerActions(n,t),this.markPrecedenceDecisions(n),this.verifyATN(n),this.deserializationOptions.generateRuleBypassTransitions&&1===n.grammarType&&(this.generateRuleBypassTransitions(n),this.verifyATN(n)),n}reset(e){if(3===(e.charCodeAt?e.charCodeAt(0):e[0])){const t=function(e){const t=e.charCodeAt(0);return t>1?t-2:t+65534},n=e.split("").map(t);return n[0]=e.charCodeAt(0),this.data=n,this.pos=0,!0}return this.data=e,this.pos=0,!1}skipUUID(){let e=0;for(;e++<8;)this.readInt()}checkVersion(e){const t=this.readInt();if(!e&&4!==t)throw"Could not deserialize ATN with version "+t+" (expected 4)."}readATN(){const e=this.readInt(),t=this.readInt();return new Z(e,t)}readStates(e,t){let n,r,i;const s=[],o=[],a=this.readInt();for(let u=0;u<a;u++){const n=this.readInt();if(n===_.INVALID_TYPE){e.addState(null);continue}let r=this.readInt();t&&65535===r&&(r=-1);const i=this.stateFactory(n,r);if(n===_.LOOP_END){const e=this.readInt();s.push([i,e])}else if(i instanceof X){const e=this.readInt();o.push([i,e])}e.addState(i)}for(n=0;n<s.length;n++)r=s[n],r[0].loopBackState=e.states[r[1]];for(n=0;n<o.length;n++)r=o[n],r[0].endState=e.states[r[1]];let l=this.readInt();for(n=0;n<l;n++)i=this.readInt(),e.states[i].nonGreedy=!0;let c=this.readInt();for(n=0;n<c;n++)i=this.readInt(),e.states[i].isPrecedenceRule=!0}readRules(t,n){let r;const i=this.readInt();for(0===t.grammarType&&(t.ruleToTokenType=ke(i,0)),t.ruleToStartState=ke(i,0),r=0;r<i;r++){const i=this.readInt();if(t.ruleToStartState[r]=t.states[i],0===t.grammarType){let i=this.readInt();n&&65535===i&&(i=e.EOF),t.ruleToTokenType[r]=i}}for(t.ruleToStopState=ke(i,0),r=0;r<t.states.length;r++){const e=t.states[r];e instanceof T&&(t.ruleToStopState[e.ruleIndex]=e,t.ruleToStartState[e.ruleIndex].stopState=e)}}readModes(e){const t=this.readInt();for(let n=0;n<t;n++){let t=this.readInt();e.modeToStartState.push(e.states[t])}}readSets(e,t,n){const r=this.readInt();for(let i=0;i<r;i++){const e=new E;t.push(e);const r=this.readInt();0!==this.readInt()&&e.addOne(-1);for(let t=0;t<r;t++){const t=n(),r=n();e.addRange(t,r)}}}readEdges(e,t){let n,r,i,s,o;const a=this.readInt();for(n=0;n<a;n++){const n=this.readInt(),r=this.readInt(),i=this.readInt(),o=this.readInt(),a=this.readInt(),l=this.readInt();s=this.edgeFactory(e,i,n,r,o,a,l,t),e.states[n].addTransition(s)}for(n=0;n<e.states.length;n++)for(i=e.states[n],r=0;r<i.transitions.length;r++){const t=i.transitions[r];if(!(t instanceof w))continue;let n=-1;e.ruleToStartState[t.target.ruleIndex].isPrecedenceRule&&0===t.precedence&&(n=t.target.ruleIndex),s=new he(t.followState,n),e.ruleToStopState[t.target.ruleIndex].addTransition(s)}for(n=0;n<e.states.length;n++){if(i=e.states[n],i instanceof X){if(null===i.endState)throw"IllegalState";if(null!==i.endState.startState)throw"IllegalState";i.endState.startState=i}if(i instanceof re)for(r=0;r<i.transitions.length;r++)o=i.transitions[r].target,o instanceof oe&&(o.loopBackState=i);else if(i instanceof ie)for(r=0;r<i.transitions.length;r++)o=i.transitions[r].target,o instanceof se&&(o.loopBackState=i)}}readDecisions(e){const t=this.readInt();for(let n=0;n<t;n++){const t=this.readInt(),r=e.states[t];e.decisionToState.push(r),r.decision=n}}readLexerActions(e,t){if(0===e.grammarType){const n=this.readInt();e.lexerActions=ke(n,null);for(let r=0;r<n;r++){const n=this.readInt();let i=this.readInt();t&&65535===i&&(i=-1);let s=this.readInt();t&&65535===s&&(s=-1),e.lexerActions[r]=this.lexerActionFactory(n,i,s)}}}generateRuleBypassTransitions(e){let t;const n=e.ruleToStartState.length;for(t=0;t<n;t++)e.ruleToTokenType[t]=e.maxTokenType+t+1;for(t=0;t<n;t++)this.generateRuleBypassTransition(e,t)}generateRuleBypassTransition(e,t){let n,r;const i=new le;i.ruleIndex=t,e.addState(i);const s=new J;s.ruleIndex=t,e.addState(s),i.endState=s,e.defineDecisionState(i),s.startState=i;let o=null,a=null;if(e.ruleToStartState[t].isPrecedenceRule){for(a=null,n=0;n<e.states.length;n++)if(r=e.states[n],this.stateIsEndStateFor(r,t)){a=r,o=r.loopBackState.transitions[0];break}if(null===o)throw"Couldn't identify final state of the precedence rule prefix section."}else a=e.ruleToStopState[t];for(n=0;n<e.states.length;n++){r=e.states[n];for(let e=0;e<r.transitions.length;e++){const t=r.transitions[e];t!==o&&t.target===a&&(t.target=s)}}const l=e.ruleToStartState[t],c=l.transitions.length;for(;c>0;)i.addTransition(l.transitions[c-1]),l.transitions=l.transitions.slice(-1);e.ruleToStartState[t].addTransition(new he(i)),s.addTransition(new he(a));const u=new q;e.addState(u),u.addTransition(new ce(s,e.ruleToTokenType[t])),i.addTransition(new he(u))}stateIsEndStateFor(e,t){if(e.ruleIndex!==t)return null;if(!(e instanceof se))return null;const n=e.transitions[e.transitions.length-1].target;return n instanceof ee&&n.epsilonOnlyTransitions&&n.transitions[0].target instanceof T?e:null}markPrecedenceDecisions(e){for(let t=0;t<e.states.length;t++){const n=e.states[t];if(n instanceof se&&e.ruleToStartState[n.ruleIndex].isPrecedenceRule){const e=n.transitions[n.transitions.length-1].target;e instanceof ee&&e.epsilonOnlyTransitions&&e.transitions[0].target instanceof T&&(n.isPrecedenceDecision=!0)}}}verifyATN(e){if(this.deserializationOptions.verifyATN)for(let t=0;t<e.states.length;t++){const n=e.states[t];if(null!==n)if(this.checkCondition(n.epsilonOnlyTransitions||n.transitions.length<=1),n instanceof oe)this.checkCondition(null!==n.loopBackState);else if(n instanceof se)if(this.checkCondition(null!==n.loopBackState),this.checkCondition(2===n.transitions.length),n.transitions[0].target instanceof ae)this.checkCondition(n.transitions[1].target instanceof ee),this.checkCondition(!n.nonGreedy);else{if(!(n.transitions[0].target instanceof ee))throw"IllegalState";this.checkCondition(n.transitions[1].target instanceof ae),this.checkCondition(n.nonGreedy)}else n instanceof ie?(this.checkCondition(1===n.transitions.length),this.checkCondition(n.transitions[0].target instanceof se)):n instanceof ee?this.checkCondition(null!==n.loopBackState):n instanceof te?this.checkCondition(null!==n.stopState):n instanceof X?this.checkCondition(null!==n.endState):n instanceof J?this.checkCondition(null!==n.startState):n instanceof Q?this.checkCondition(n.transitions.length<=1||n.decision>=0):this.checkCondition(n.transitions.length<=1||n instanceof T)}}checkCondition(e,t){if(!e)throw null==t&&(t="IllegalState"),t}readInt(){return this.data[this.pos++]}readInt32(){return this.readInt()|this.readInt()<<16}edgeFactory(t,n,r,i,s,o,a,l){const c=t.states[i];switch(n){case x.EPSILON:return new he(c);case x.RANGE:return new ue(c,0!==a?e.EOF:s,o);case x.RULE:return new w(t.states[s],o,a,c);case x.PREDICATE:return new fe(c,s,o,0!==a);case x.PRECEDENCE:return new me(c,s);case x.ATOM:return new ce(c,0!==a?e.EOF:s);case x.ACTION:return new de(c,s,o,0!==a);case x.SET:return new S(c,l[s]);case x.NOT_SET:return new R(c,l[s]);case x.WILDCARD:return new k(c);default:throw"The specified transition type: "+n+" is not valid."}}stateFactory(e,t){if(null===this.stateFactories){const e=[];e[_.INVALID_TYPE]=null,e[_.BASIC]=()=>new q,e[_.RULE_START]=()=>new te,e[_.BLOCK_START]=()=>new le,e[_.PLUS_BLOCK_START]=()=>new oe,e[_.STAR_BLOCK_START]=()=>new ae,e[_.TOKEN_START]=()=>new ne,e[_.RULE_STOP]=()=>new T,e[_.BLOCK_END]=()=>new J,e[_.STAR_LOOP_BACK]=()=>new ie,e[_.STAR_LOOP_ENTRY]=()=>new se,e[_.PLUS_LOOP_BACK]=()=>new re,e[_.LOOP_END]=()=>new ee,this.stateFactories=e}if(e>this.stateFactories.length||null===this.stateFactories[e])throw"The specified state type "+e+" is not valid.";{const n=this.stateFactories[e]();if(null!==n)return n.ruleIndex=t,n}}lexerActionFactory(e,t,n){if(null===this.actionFactories){const e=[];e[0]=(e,t)=>new Ee(e),e[1]=(e,t)=>new _e(e,t),e[2]=(e,t)=>new Re(e),e[3]=(e,t)=>Te.INSTANCE,e[4]=(e,t)=>Se.INSTANCE,e[5]=(e,t)=>new we(e),e[6]=(e,t)=>ve.INSTANCE,e[7]=(e,t)=>new xe(e),this.actionFactories=e}if(e>this.actionFactories.length||null===this.actionFactories[e])throw"The specified lexer action type "+e+" is not valid.";return this.actionFactories[e](t,n)}}class Oe{syntaxError(e,t,n,r,i,s){}reportAmbiguity(e,t,n,r,i,s,o){}reportAttemptingFullContext(e,t,n,r,i,s){}reportContextSensitivity(e,t,n,r,i,s){}}class Ae extends Oe{constructor(){super()}syntaxError(e,t,n,r,i,s){console.error("line "+n+":"+r+" "+i)}}Ae.INSTANCE=new Ae;class Ne extends Oe{constructor(e){if(super(),null===e)throw"delegates";return this.delegates=e,this}syntaxError(e,t,n,r,i,s){this.delegates.map((o=>o.syntaxError(e,t,n,r,i,s)))}reportAmbiguity(e,t,n,r,i,s,o){this.delegates.map((a=>a.reportAmbiguity(e,t,n,r,i,s,o)))}reportAttemptingFullContext(e,t,n,r,i,s){this.delegates.map((o=>o.reportAttemptingFullContext(e,t,n,r,i,s)))}reportContextSensitivity(e,t,n,r,i,s){this.delegates.map((o=>o.reportContextSensitivity(e,t,n,r,i,s)))}}class Ie{constructor(){this._listeners=[Ae.INSTANCE],this._interp=null,this._stateNumber=-1}checkVersion(e){const t="4.13.1";t!==e&&console.log("ANTLR runtime and generated code versions disagree: "+t+"!="+e)}addErrorListener(e){this._listeners.push(e)}removeErrorListeners(){this._listeners=[]}getLiteralNames(){return Object.getPrototypeOf(this).constructor.literalNames||[]}getSymbolicNames(){return Object.getPrototypeOf(this).constructor.symbolicNames||[]}getTokenNames(){if(!this.tokenNames){const e=this.getLiteralNames(),t=this.getSymbolicNames(),n=e.length>t.length?e.length:t.length;this.tokenNames=[];for(let r=0;r<n;r++)this.tokenNames[r]=e[r]||t[r]||"<INVALID"}return this.tokenNames}getTokenTypeMap(){const t=this.getTokenNames();if(null===t)throw"The current recognizer does not provide a list of token names.";let n=this.tokenTypeMapCache[t];return void 0===n&&(n=t.reduce((function(e,t,n){e[t]=n})),n.EOF=e.EOF,this.tokenTypeMapCache[t]=n),n}getRuleIndexMap(){const e=this.ruleNames;if(null===e)throw"The current recognizer does not provide a list of rule names.";let t=this.ruleIndexMapCache[e];return void 0===t&&(t=e.reduce((function(e,t,n){e[t]=n})),this.ruleIndexMapCache[e]=t),t}getTokenType(t){const n=this.getTokenTypeMap()[t];return void 0!==n?n:e.INVALID_TYPE}getErrorHeader(e){return"line "+e.getOffendingToken().line+":"+e.getOffendingToken().column}getTokenErrorDisplay(t){if(null===t)return"<no token>";let n=t.text;return null===n&&(n=t.type===e.EOF?"<EOF>":"<"+t.type+">"),n=n.replace("\n","\\n").replace("\r","\\r").replace("\t","\\t"),"'"+n+"'"}getErrorListenerDispatch(){return new Ne(this._listeners)}sempred(e,t,n){return!0}precpred(e,t){return!0}get atn(){return this._interp.atn}get state(){return this._stateNumber}set state(e){this._stateNumber=e}}Ie.tokenTypeMapCache={},Ie.ruleIndexMapCache={};class Le extends e{constructor(t,n,r,i,s){super(),this.source=void 0!==t?t:Le.EMPTY_SOURCE,this.type=void 0!==n?n:null,this.channel=void 0!==r?r:e.DEFAULT_CHANNEL,this.start=void 0!==i?i:-1,this.stop=void 0!==s?s:-1,this.tokenIndex=-1,null!==this.source[0]?(this.line=t[0].line,this.column=t[0].column):this.column=-1}clone(){const e=new Le(this.source,this.type,this.channel,this.start,this.stop);return e.tokenIndex=this.tokenIndex,e.line=this.line,e.column=this.column,e.text=this.text,e}cloneWithType(t){const n=new Le(this.source,t,this.channel,this.start,this.stop);return n.tokenIndex=this.tokenIndex,n.line=this.line,n.column=this.column,t===e.EOF&&(n.text=""),n}toString(){let e=this.text;return e=null!==e?e.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):"<no text>","[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+e+"',<"+this.type+">"+(this.channel>0?",channel="+this.channel:"")+","+this.line+":"+this.column+"]"}get text(){if(null!==this._text)return this._text;const e=this.getInputStream();if(null===e)return null;const t=e.size;return this.start<t&&this.stop<t?e.getText(this.start,this.stop):"<EOF>"}set text(e){this._text=e}}Le.EMPTY_SOURCE=[null,null];class De{}class Pe extends De{constructor(e){super(),this.copyText=void 0!==e&&e}create(e,t,n,r,i,s,o,a){const l=new Le(e,t,r,i,s);return l.line=o,l.column=a,null!==n?l.text=n:this.copyText&&null!==e[1]&&(l.text=e[1].getText(i,s)),l}createThin(e,t){const n=new Le(null,e);return n.text=t,n}}Pe.DEFAULT=new Pe;class Me extends Error{constructor(e){super(e.message),Error.captureStackTrace&&Error.captureStackTrace(this,Me),this.message=e.message,this.recognizer=e.recognizer,this.input=e.input,this.ctx=e.ctx,this.offendingToken=null,this.offendingState=-1,null!==this.recognizer&&(this.offendingState=this.recognizer.state)}getExpectedTokens(){return null!==this.recognizer?this.recognizer.atn.getExpectedTokens(this.offendingState,this.ctx):null}toString(){return this.message}}class Fe extends Me{constructor(e,t,n,r){super({message:"",recognizer:e,input:t,ctx:null}),this.startIndex=n,this.deadEndConfigs=r}toString(){let e="";return this.startIndex>=0&&this.startIndex<this.input.size&&(e=this.input.getText(new v(this.startIndex,this.startIndex))),"LexerNoViableAltException"+e}}class Ue extends Ie{constructor(t){super(),this._input=t,this._factory=Pe.DEFAULT,this._tokenFactorySourcePair=[this,t],this._interp=null,this._token=null,this._tokenStartCharIndex=-1,this._tokenStartLine=-1,this._tokenStartColumn=-1,this._hitEOF=!1,this._channel=e.DEFAULT_CHANNEL,this._type=e.INVALID_TYPE,this._modeStack=[],this._mode=Ue.DEFAULT_MODE,this._text=null}reset(){null!==this._input&&this._input.seek(0),this._token=null,this._type=e.INVALID_TYPE,this._channel=e.DEFAULT_CHANNEL,this._tokenStartCharIndex=-1,this._tokenStartColumn=-1,this._tokenStartLine=-1,this._text=null,this._hitEOF=!1,this._mode=Ue.DEFAULT_MODE,this._modeStack=[],this._interp.reset()}nextToken(){if(null===this._input)throw"nextToken requires a non-null input stream.";const t=this._input.mark();try{for(;;){if(this._hitEOF)return this.emitEOF(),this._token;this._token=null,this._channel=e.DEFAULT_CHANNEL,this._tokenStartCharIndex=this._input.index,this._tokenStartColumn=this._interp.column,this._tokenStartLine=this._interp.line,this._text=null;let t=!1;for(;;){this._type=e.INVALID_TYPE;let n=Ue.SKIP;try{n=this._interp.match(this._input,this._mode)}catch(e){if(!(e instanceof Me))throw console.log(e.stack),e;this.notifyListeners(e),this.recover(e)}if(this._input.LA(1)===e.EOF&&(this._hitEOF=!0),this._type===e.INVALID_TYPE&&(this._type=n),this._type===Ue.SKIP){t=!0;break}if(this._type!==Ue.MORE)break}if(!t)return null===this._token&&this.emit(),this._token}}finally{this._input.release(t)}}skip(){this._type=Ue.SKIP}more(){this._type=Ue.MORE}mode(e){this._mode=e}pushMode(e){this._interp.debug&&console.log("pushMode "+e),this._modeStack.push(this._mode),this.mode(e)}popMode(){if(0===this._modeStack.length)throw"Empty Stack";return this._interp.debug&&console.log("popMode back to "+this._modeStack.slice(0,-1)),this.mode(this._modeStack.pop()),this._mode}emitToken(e){this._token=e}emit(){const e=this._factory.create(this._tokenFactorySourcePair,this._type,this._text,this._channel,this._tokenStartCharIndex,this.getCharIndex()-1,this._tokenStartLine,this._tokenStartColumn);return this.emitToken(e),e}emitEOF(){const t=this.column,n=this.line,r=this._factory.create(this._tokenFactorySourcePair,e.EOF,null,e.DEFAULT_CHANNEL,this._input.index,this._input.index-1,n,t);return this.emitToken(r),r}getCharIndex(){return this._input.index}getAllTokens(){const t=[];let n=this.nextToken();for(;n.type!==e.EOF;)t.push(n),n=this.nextToken();return t}notifyListeners(e){const t=this._tokenStartCharIndex,n=this._input.index,r=this._input.getText(t,n),i="token recognition error at: '"+this.getErrorDisplay(r)+"'";this.getErrorListenerDispatch().syntaxError(this,null,this._tokenStartLine,this._tokenStartColumn,i,e)}getErrorDisplay(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t.join("")}getErrorDisplayForChar(t){return t.charCodeAt(0)===e.EOF?"<EOF>":"\n"===t?"\\n":"\t"===t?"\\t":"\r"===t?"\\r":t}getCharErrorDisplay(e){return"'"+this.getErrorDisplayForChar(e)+"'"}recover(t){this._input.LA(1)!==e.EOF&&(t instanceof Fe?this._interp.consume(this._input):this._input.consume())}get inputStream(){return this._input}set inputStream(e){this._input=null,this._tokenFactorySourcePair=[this,this._input],this.reset(),this._input=e,this._tokenFactorySourcePair=[this,this._input]}get sourceName(){return this._input.sourceName}get type(){return this._type}set type(e){this._type=e}get line(){return this._interp.line}set line(e){this._interp.line=e}get column(){return this._interp.column}set column(e){this._interp.column=e}get text(){return null!==this._text?this._text:this._interp.getText(this._input)}set text(e){this._text=e}}function je(e){return e.hashCodeForConfigSet()}function Be(e,t){return e===t||null!==e&&null!==t&&e.equalsForConfigSet(t)}Ue.DEFAULT_MODE=0,Ue.MORE=-2,Ue.SKIP=-3,Ue.DEFAULT_TOKEN_CHANNEL=e.DEFAULT_CHANNEL,Ue.HIDDEN=e.HIDDEN_CHANNEL,Ue.MIN_CHAR_VALUE=0,Ue.MAX_CHAR_VALUE=1114111;class He{constructor(e){this.configLookup=new h(je,Be),this.fullCtx=void 0===e||e,this.readOnly=!1,this.configs=[],this.uniqueAlt=0,this.conflictingAlts=null,this.hasSemanticContext=!1,this.dipsIntoOuterContext=!1,this.cachedHashCode=-1}add(e,t){if(void 0===t&&(t=null),this.readOnly)throw"This set is readonly";e.semanticContext!==p.NONE&&(this.hasSemanticContext=!0),e.reachesIntoOuterContext>0&&(this.dipsIntoOuterContext=!0);const n=this.configLookup.add(e);if(n===e)return this.cachedHashCode=-1,this.configs.push(e),!0;const r=!this.fullCtx,i=W(n.context,e.context,r,t);return n.reachesIntoOuterContext=Math.max(n.reachesIntoOuterContext,e.reachesIntoOuterContext),e.precedenceFilterSuppressed&&(n.precedenceFilterSuppressed=!0),n.context=i,!0}getStates(){const e=new h;for(let t=0;t<this.configs.length;t++)e.add(this.configs[t].state);return e}getPredicates(){const e=[];for(let t=0;t<this.configs.length;t++){const n=this.configs[t].semanticContext;n!==p.NONE&&e.push(n.semanticContext)}return e}optimizeConfigs(e){if(this.readOnly)throw"This set is readonly";if(0!==this.configLookup.length)for(let t=0;t<this.configs.length;t++){const n=this.configs[t];n.context=e.getCachedContext(n.context)}}addAll(e){for(let t=0;t<e.length;t++)this.add(e[t]);return!1}equals(e){return this===e||e instanceof He&&t(this.configs,e.configs)&&this.fullCtx===e.fullCtx&&this.uniqueAlt===e.uniqueAlt&&this.conflictingAlts===e.conflictingAlts&&this.hasSemanticContext===e.hasSemanticContext&&this.dipsIntoOuterContext===e.dipsIntoOuterContext}hashCode(){const e=new o;return e.update(this.configs),e.finish()}updateHashCode(e){this.readOnly?(-1===this.cachedHashCode&&(this.cachedHashCode=this.hashCode()),e.update(this.cachedHashCode)):e.update(this.hashCode())}isEmpty(){return 0===this.configs.length}contains(e){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.contains(e)}containsFast(e){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.containsFast(e)}clear(){if(this.readOnly)throw"This set is readonly";this.configs=[],this.cachedHashCode=-1,this.configLookup=new h}setReadonly(e){this.readOnly=e,e&&(this.configLookup=null)}toString(){return u(this.configs)+(this.hasSemanticContext?",hasSemanticContext="+this.hasSemanticContext:"")+(this.uniqueAlt!==Z.INVALID_ALT_NUMBER?",uniqueAlt="+this.uniqueAlt:"")+(null!==this.conflictingAlts?",conflictingAlts="+this.conflictingAlts:"")+(this.dipsIntoOuterContext?",dipsIntoOuterContext":"")}get items(){return this.configs}get length(){return this.configs.length}}class $e{constructor(e,t){return null===e&&(e=-1),null===t&&(t=new He),this.stateNumber=e,this.configs=t,this.edges=null,this.isAcceptState=!1,this.prediction=0,this.lexerActionExecutor=null,this.requiresFullContext=!1,this.predicates=null,this}getAltSet(){const e=new h;if(null!==this.configs)for(let t=0;t<this.configs.length;t++){const n=this.configs[t];e.add(n.alt)}return 0===e.length?null:e}equals(e){return this===e||e instanceof $e&&this.configs.equals(e.configs)}toString(){let e=this.stateNumber+":"+this.configs;return this.isAcceptState&&(e+="=>",null!==this.predicates?e+=this.predicates:e+=this.prediction),e}hashCode(){const e=new o;return e.update(this.configs),e.finish()}}class ze{constructor(e,t){return this.atn=e,this.sharedContextCache=t,this}getCachedContext(e){if(null===this.sharedContextCache)return e;const t=new z;return G(e,this.sharedContextCache,t)}}ze.ERROR=new $e(2147483647,new He);class Ve extends He{constructor(){super(),this.configLookup=new h}}class Ge extends b{constructor(e,t){super(e,t);const n=e.lexerActionExecutor||null;return this.lexerActionExecutor=n||(null!==t?t.lexerActionExecutor:null),this.passedThroughNonGreedyDecision=null!==t&&this.checkNonGreedyDecision(t,this.state),this.hashCodeForConfigSet=Ge.prototype.hashCode,this.equalsForConfigSet=Ge.prototype.equals,this}updateHashCode(e){e.update(this.state.stateNumber,this.alt,this.context,this.semanticContext,this.passedThroughNonGreedyDecision,this.lexerActionExecutor)}equals(e){return this===e||e instanceof Ge&&this.passedThroughNonGreedyDecision===e.passedThroughNonGreedyDecision&&(this.lexerActionExecutor?this.lexerActionExecutor.equals(e.lexerActionExecutor):!e.lexerActionExecutor)&&super.equals(e)}checkNonGreedyDecision(e,t){return e.passedThroughNonGreedyDecision||t instanceof Q&&t.nonGreedy}}class We extends be{constructor(e,t){super(t.actionType),this.offset=e,this.action=t,this.isPositionDependent=!0}execute(e){this.action.execute(e)}updateHashCode(e){e.update(this.actionType,this.offset,this.action)}equals(e){return this===e||e instanceof We&&this.offset===e.offset&&this.action===e.action}}class Ke{constructor(e){return this.lexerActions=null===e?[]:e,this.cachedHashCode=o.hashStuff(e),this}fixOffsetBeforeMatch(e){let t=null;for(let n=0;n<this.lexerActions.length;n++)!this.lexerActions[n].isPositionDependent||this.lexerActions[n]instanceof We||(null===t&&(t=this.lexerActions.concat([])),t[n]=new We(e,this.lexerActions[n]));return null===t?this:new Ke(t)}execute(e,t,n){let r=!1;const i=t.index;try{for(let s=0;s<this.lexerActions.length;s++){let o=this.lexerActions[s];if(o instanceof We){const e=o.offset;t.seek(n+e),o=o.action,r=n+e!==i}else o.isPositionDependent&&(t.seek(i),r=!1);o.execute(e)}}finally{r&&t.seek(i)}}hashCode(){return this.cachedHashCode}updateHashCode(e){e.update(this.cachedHashCode)}equals(e){if(this===e)return!0;if(e instanceof Ke){if(this.cachedHashCode!=e.cachedHashCode)return!1;if(this.lexerActions.length!=e.lexerActions.length)return!1;{const t=this.lexerActions.length;for(let n=0;n<t;++n)if(!this.lexerActions[n].equals(e.lexerActions[n]))return!1;return!0}}return!1}static append(e,t){if(null===e)return new Ke([t]);const n=e.lexerActions.concat([t]);return new Ke(n)}}function Ye(e){e.index=-1,e.line=0,e.column=-1,e.dfaState=null}class Ze{constructor(){Ye(this)}reset(){Ye(this)}}class qe extends ze{constructor(e,t,n,r){super(t,r),this.decisionToDFA=n,this.recog=e,this.startIndex=-1,this.line=1,this.column=0,this.mode=Ue.DEFAULT_MODE,this.prevAccept=new Ze}copyState(e){this.column=e.column,this.line=e.line,this.mode=e.mode,this.startIndex=e.startIndex}match(e,t){this.mode=t;const n=e.mark();try{this.startIndex=e.index,this.prevAccept.reset();const n=this.decisionToDFA[t];return null===n.s0?this.matchATN(e):this.execATN(e,n.s0)}finally{e.release(n)}}reset(){this.prevAccept.reset(),this.startIndex=-1,this.line=1,this.column=0,this.mode=Ue.DEFAULT_MODE}matchATN(e){const t=this.atn.modeToStartState[this.mode];qe.debug&&console.log("matchATN mode "+this.mode+" start: "+t);const n=this.mode,r=this.computeStartState(e,t),i=r.hasSemanticContext;r.hasSemanticContext=!1;const s=this.addDFAState(r);i||(this.decisionToDFA[this.mode].s0=s);const o=this.execATN(e,s);return qe.debug&&console.log("DFA after matchATN: "+this.decisionToDFA[n].toLexerString()),o}execATN(t,n){qe.debug&&console.log("start state closure="+n.configs),n.isAcceptState&&this.captureSimState(this.prevAccept,t,n);let r=t.LA(1),i=n;for(;;){qe.debug&&console.log("execATN loop starting closure: "+i.configs);let n=this.getExistingTargetState(i,r);if(null===n&&(n=this.computeTargetState(t,i,r)),n===ze.ERROR)break;if(r!==e.EOF&&this.consume(t),n.isAcceptState&&(this.captureSimState(this.prevAccept,t,n),r===e.EOF))break;r=t.LA(1),i=n}return this.failOrAccept(this.prevAccept,t,i.configs,r)}getExistingTargetState(e,t){if(null===e.edges||t<qe.MIN_DFA_EDGE||t>qe.MAX_DFA_EDGE)return null;let n=e.edges[t-qe.MIN_DFA_EDGE];return void 0===n&&(n=null),qe.debug&&null!==n&&console.log("reuse state "+e.stateNumber+" edge to "+n.stateNumber),n}computeTargetState(e,t,n){const r=new Ve;return this.getReachableConfigSet(e,t.configs,r,n),0===r.items.length?(r.hasSemanticContext||this.addDFAEdge(t,n,ze.ERROR),ze.ERROR):this.addDFAEdge(t,n,null,r)}failOrAccept(t,n,r,i){if(null!==this.prevAccept.dfaState){const e=t.dfaState.lexerActionExecutor;return this.accept(n,e,this.startIndex,t.index,t.line,t.column),t.dfaState.prediction}if(i===e.EOF&&n.index===this.startIndex)return e.EOF;throw new Fe(this.recog,n,this.startIndex,r)}getReachableConfigSet(t,n,r,i){let s=Z.INVALID_ALT_NUMBER;for(let o=0;o<n.items.length;o++){const a=n.items[o],l=a.alt===s;if(!l||!a.passedThroughNonGreedyDecision){qe.debug&&console.log("testing %s at %s\n",this.getTokenName(i),a.toString(this.recog,!0));for(let n=0;n<a.state.transitions.length;n++){const o=a.state.transitions[n],c=this.getReachableTarget(o,i);if(null!==c){let n=a.lexerActionExecutor;null!==n&&(n=n.fixOffsetBeforeMatch(t.index-this.startIndex));const o=i===e.EOF,u=new Ge({state:c,lexerActionExecutor:n},a);this.closure(t,u,r,l,!0,o)&&(s=a.alt)}}}}}accept(e,t,n,r,i,s){qe.debug&&console.log("ACTION %s\n",t),e.seek(r),this.line=i,this.column=s,null!==t&&null!==this.recog&&t.execute(this.recog,e,n)}getReachableTarget(e,t){return e.matches(t,0,Ue.MAX_CHAR_VALUE)?e.target:null}computeStartState(e,t){const n=U.EMPTY,r=new Ve;for(let i=0;i<t.transitions.length;i++){const s=t.transitions[i].target,o=new Ge({state:s,alt:i+1,context:n},null);this.closure(e,o,r,!1,!1,!1)}return r}closure(e,t,n,r,i,s){let o=null;if(qe.debug&&console.log("closure("+t.toString(this.recog,!0)+")"),t.state instanceof T){if(qe.debug&&(null!==this.recog?console.log("closure at %s rule stop %s\n",this.recog.ruleNames[t.state.ruleIndex],t):console.log("closure at rule stop %s\n",t)),null===t.context||t.context.hasEmptyPath()){if(null===t.context||t.context.isEmpty())return n.add(t),!0;n.add(new Ge({state:t.state,context:U.EMPTY},t)),r=!0}if(null!==t.context&&!t.context.isEmpty())for(let a=0;a<t.context.length;a++)if(t.context.getReturnState(a)!==U.EMPTY_RETURN_STATE){const l=t.context.getParent(a),c=this.atn.states[t.context.getReturnState(a)];o=new Ge({state:c,context:l},t),r=this.closure(e,o,n,r,i,s)}return r}t.state.epsilonOnlyTransitions||r&&t.passedThroughNonGreedyDecision||n.add(t);for(let a=0;a<t.state.transitions.length;a++){const l=t.state.transitions[a];o=this.getEpsilonTarget(e,t,l,n,i,s),null!==o&&(r=this.closure(e,o,n,r,i,s))}return r}getEpsilonTarget(t,n,r,i,s,o){let a=null;if(r.serializationType===x.RULE){const e=B.create(n.context,r.followState.stateNumber);a=new Ge({state:r.target,context:e},n)}else{if(r.serializationType===x.PRECEDENCE)throw"Precedence predicates are not supported in lexers.";if(r.serializationType===x.PREDICATE)qe.debug&&console.log("EVAL rule "+r.ruleIndex+":"+r.predIndex),i.hasSemanticContext=!0,this.evaluatePredicate(t,r.ruleIndex,r.predIndex,s)&&(a=new Ge({state:r.target},n));else if(r.serializationType===x.ACTION)if(null===n.context||n.context.hasEmptyPath()){const e=Ke.append(n.lexerActionExecutor,this.atn.lexerActions[r.actionIndex]);a=new Ge({state:r.target,lexerActionExecutor:e},n)}else a=new Ge({state:r.target},n);else r.serializationType===x.EPSILON?a=new Ge({state:r.target},n):r.serializationType!==x.ATOM&&r.serializationType!==x.RANGE&&r.serializationType!==x.SET||o&&r.matches(e.EOF,0,Ue.MAX_CHAR_VALUE)&&(a=new Ge({state:r.target},n))}return a}evaluatePredicate(e,t,n,r){if(null===this.recog)return!0;if(!r)return this.recog.sempred(null,t,n);const i=this.column,s=this.line,o=e.index,a=e.mark();try{return this.consume(e),this.recog.sempred(null,t,n)}finally{this.column=i,this.line=s,e.seek(o),e.release(a)}}captureSimState(e,t,n){e.index=t.index,e.line=this.line,e.column=this.column,e.dfaState=n}addDFAEdge(e,t,n,r){if(void 0===n&&(n=null),void 0===r&&(r=null),null===n&&null!==r){const e=r.hasSemanticContext;if(r.hasSemanticContext=!1,n=this.addDFAState(r),e)return n}return t<qe.MIN_DFA_EDGE||t>qe.MAX_DFA_EDGE||(qe.debug&&console.log("EDGE "+e+" -> "+n+" upon "+t),null===e.edges&&(e.edges=[]),e.edges[t-qe.MIN_DFA_EDGE]=n),n}addDFAState(e){const t=new $e(null,e);let n=null;for(let o=0;o<e.items.length;o++){const t=e.items[o];if(t.state instanceof T){n=t;break}}null!==n&&(t.isAcceptState=!0,t.lexerActionExecutor=n.lexerActionExecutor,t.prediction=this.atn.ruleToTokenType[n.state.ruleIndex]);const r=this.decisionToDFA[this.mode],i=r.states.get(t);if(null!==i)return i;const s=t;return s.stateNumber=r.states.length,e.setReadonly(!0),s.configs=e,r.states.add(s),s}getDFA(e){return this.decisionToDFA[e]}getText(e){return e.getText(this.startIndex,e.index-1)}consume(e){e.LA(1)==="\n".charCodeAt(0)?(this.line+=1,this.column=0):this.column+=1,e.consume()}getTokenName(e){return-1===e?"EOF":"'"+String.fromCharCode(e)+"'"}}qe.debug=!1,qe.dfa_debug=!1,qe.MIN_DFA_EDGE=0,qe.MAX_DFA_EDGE=127;class Qe{constructor(e,t){this.alt=t,this.pred=e}toString(){return"("+this.pred+", "+this.alt+")"}}class Xe{constructor(){this.data={}}get(e){return this.data["k-"+e]||null}set(e,t){this.data["k-"+e]=t}values(){return Object.keys(this.data).filter((e=>e.startsWith("k-"))).map((e=>this.data[e]),this)}}const Je={SLL:0,LL:1,LL_EXACT_AMBIG_DETECTION:2,hasSLLConflictTerminatingPrediction:function(e,t){if(Je.allConfigsInRuleStopStates(t))return!0;if(e===Je.SLL&&t.hasSemanticContext){const e=new He;for(let n=0;n<t.items.length;n++){let r=t.items[n];r=new b({semanticContext:p.NONE},r),e.add(r)}t=e}const n=Je.getConflictingAltSubsets(t);return Je.hasConflictingAltSet(n)&&!Je.hasStateAssociatedWithOneAlt(t)},hasConfigInRuleStopState:function(e){for(let t=0;t<e.items.length;t++)if(e.items[t].state instanceof T)return!0;return!1},allConfigsInRuleStopStates:function(e){for(let t=0;t<e.items.length;t++)if(!(e.items[t].state instanceof T))return!1;return!0},resolvesToJustOneViableAlt:function(e){return Je.getSingleViableAlt(e)},allSubsetsConflict:function(e){return!Je.hasNonConflictingAltSet(e)},hasNonConflictingAltSet:function(e){for(let t=0;t<e.length;t++)if(1===e[t].length)return!0;return!1},hasConflictingAltSet:function(e){for(let t=0;t<e.length;t++)if(e[t].length>1)return!0;return!1},allSubsetsEqual:function(e){let t=null;for(let n=0;n<e.length;n++){const r=e[n];if(null===t)t=r;else if(r!==t)return!1}return!0},getUniqueAlt:function(e){const t=Je.getAlts(e);return 1===t.length?t.minValue():Z.INVALID_ALT_NUMBER},getAlts:function(e){const t=new K;return e.map((function(e){t.or(e)})),t},getConflictingAltSubsets:function(e){const t=new z;return t.hashFunction=function(e){o.hashStuff(e.state.stateNumber,e.context)},t.equalsFunction=function(e,t){return e.state.stateNumber===t.state.stateNumber&&e.context.equals(t.context)},e.items.map((function(e){let n=t.get(e);null===n&&(n=new K,t.set(e,n)),n.add(e.alt)})),t.getValues()},getStateToAltMap:function(e){const t=new Xe;return e.items.map((function(e){let n=t.get(e.state);null===n&&(n=new K,t.set(e.state,n)),n.add(e.alt)})),t},hasStateAssociatedWithOneAlt:function(e){const t=Je.getStateToAltMap(e).values();for(let n=0;n<t.length;n++)if(1===t[n].length)return!0;return!1},getSingleViableAlt:function(e){let t=null;for(let n=0;n<e.length;n++){const r=e[n].minValue();if(null===t)t=r;else if(t!==r)return Z.INVALID_ALT_NUMBER}return t}},et=Je;class tt extends Me{constructor(e,t,n,r,i,s){s=s||e._ctx,r=r||e.getCurrentToken(),n=n||e.getCurrentToken(),t=t||e.getInputStream(),super({message:"",recognizer:e,input:t,ctx:s}),this.deadEndConfigs=i,this.startToken=n,this.offendingToken=r}}class nt{constructor(e){this.defaultMapCtor=e||z,this.cacheMap=new this.defaultMapCtor}get(e,t){const n=this.cacheMap.get(e)||null;return null===n?null:n.get(t)||null}set(e,t,n){let r=this.cacheMap.get(e)||null;null===r&&(r=new this.defaultMapCtor,this.cacheMap.set(e,r)),r.set(t,n)}}class rt extends ze{constructor(e,t,n,r){super(t,r),this.parser=e,this.decisionToDFA=n,this.predictionMode=et.LL,this._input=null,this._startIndex=0,this._outerContext=null,this._dfa=null,this.mergeCache=null,this.debug=!1,this.debug_closure=!1,this.debug_add=!1,this.trace_atn_sim=!1,this.dfa_debug=!1,this.retry_debug=!1}reset(){}adaptivePredict(e,t,n){(this.debug||this.trace_atn_sim)&&console.log("adaptivePredict decision "+t+" exec LA(1)=="+this.getLookaheadName(e)+" line "+e.LT(1).line+":"+e.LT(1).column),this._input=e,this._startIndex=e.index,this._outerContext=n;const r=this.decisionToDFA[t];this._dfa=r;const i=e.mark(),s=e.index;try{let t;if(t=r.precedenceDfa?r.getPrecedenceStartState(this.parser.getPrecedence()):r.s0,null===t){null===n&&(n=F.EMPTY),this.debug&&console.log("predictATN decision "+r.decision+" exec LA(1)=="+this.getLookaheadName(e)+", outerContext="+n.toString(this.parser.ruleNames));const i=!1;let s=this.computeStartState(r.atnStartState,F.EMPTY,i);r.precedenceDfa?(r.s0.configs=s,s=this.applyPrecedenceFilter(s),t=this.addDFAState(r,new $e(null,s)),r.setPrecedenceStartState(this.parser.getPrecedence(),t)):(t=this.addDFAState(r,new $e(null,s)),r.s0=t)}const i=this.execATN(r,t,e,s,n);return this.debug&&console.log("DFA after predictATN: "+r.toString(this.parser.literalNames,this.parser.symbolicNames)),i}finally{this._dfa=null,this.mergeCache=null,e.seek(s),e.release(i)}}execATN(t,n,r,i,s){let o;(this.debug||this.trace_atn_sim)&&console.log("execATN decision "+t.decision+", DFA state "+n+", LA(1)=="+this.getLookaheadName(r)+" line "+r.LT(1).line+":"+r.LT(1).column);let a=n;this.debug&&console.log("s0 = "+n);let l=r.LA(1);for(;;){let n=this.getExistingTargetState(a,l);if(null===n&&(n=this.computeTargetState(t,a,l)),n===ze.ERROR){const e=this.noViableAlt(r,s,a.configs,i);if(r.seek(i),o=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(a.configs,s),o!==Z.INVALID_ALT_NUMBER)return o;throw e}if(n.requiresFullContext&&this.predictionMode!==et.SLL){let e=null;if(null!==n.predicates){this.debug&&console.log("DFA state has preds in DFA sim LL failover");const t=r.index;if(t!==i&&r.seek(i),e=this.evalSemanticContext(n.predicates,s,!0),1===e.length)return this.debug&&console.log("Full LL avoided"),e.minValue();t!==i&&r.seek(t)}this.dfa_debug&&console.log("ctx sensitive state "+s+" in "+n);const a=!0,l=this.computeStartState(t.atnStartState,s,a);return this.reportAttemptingFullContext(t,e,n.configs,i,r.index),o=this.execATNWithFullContext(t,n,l,r,i,s),o}if(n.isAcceptState){if(null===n.predicates)return n.prediction;const e=r.index;r.seek(i);const o=this.evalSemanticContext(n.predicates,s,!0);if(0===o.length)throw this.noViableAlt(r,s,n.configs,i);return 1===o.length||this.reportAmbiguity(t,n,i,e,!1,o,n.configs),o.minValue()}a=n,l!==e.EOF&&(r.consume(),l=r.LA(1))}}getExistingTargetState(e,t){const n=e.edges;return null===n?null:n[t+1]||null}computeTargetState(e,t,n){const r=this.computeReachSet(t.configs,n,!1);if(null===r)return this.addDFAEdge(e,t,n,ze.ERROR),ze.ERROR;let i=new $e(null,r);const s=this.getUniqueAlt(r);if(this.debug){const e=et.getConflictingAltSubsets(r);console.log("SLL altSubSets="+u(e)+", configs="+r+", predict="+s+", allSubsetsConflict="+et.allSubsetsConflict(e)+", conflictingAlts="+this.getConflictingAlts(r))}return s!==Z.INVALID_ALT_NUMBER?(i.isAcceptState=!0,i.configs.uniqueAlt=s,i.prediction=s):et.hasSLLConflictTerminatingPrediction(this.predictionMode,r)&&(i.configs.conflictingAlts=this.getConflictingAlts(r),i.requiresFullContext=!0,i.isAcceptState=!0,i.prediction=i.configs.conflictingAlts.minValue()),i.isAcceptState&&i.configs.hasSemanticContext&&(this.predicateDFAState(i,this.atn.getDecisionState(e.decision)),null!==i.predicates&&(i.prediction=Z.INVALID_ALT_NUMBER)),i=this.addDFAEdge(e,t,n,i),i}predicateDFAState(e,t){const n=t.transitions.length,r=this.getConflictingAltsOrUniqueAlt(e.configs),i=this.getPredsForAmbigAlts(r,e.configs,n);null!==i?(e.predicates=this.getPredicatePredictions(r,i),e.prediction=Z.INVALID_ALT_NUMBER):e.prediction=r.minValue()}execATNWithFullContext(t,n,r,i,s,o){(this.debug||this.trace_atn_sim)&&console.log("execATNWithFullContext "+r);let a,l=!1,c=r;i.seek(s);let u=i.LA(1),d=-1;for(;;){if(a=this.computeReachSet(c,u,!0),null===a){const e=this.noViableAlt(i,o,c,s);i.seek(s);const t=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(c,o);if(t!==Z.INVALID_ALT_NUMBER)return t;throw e}const t=et.getConflictingAltSubsets(a);if(this.debug&&console.log("LL altSubSets="+t+", predict="+et.getUniqueAlt(t)+", resolvesToJustOneViableAlt="+et.resolvesToJustOneViableAlt(t)),a.uniqueAlt=this.getUniqueAlt(a),a.uniqueAlt!==Z.INVALID_ALT_NUMBER){d=a.uniqueAlt;break}if(this.predictionMode!==et.LL_EXACT_AMBIG_DETECTION){if(d=et.resolvesToJustOneViableAlt(t),d!==Z.INVALID_ALT_NUMBER)break}else if(et.allSubsetsConflict(t)&&et.allSubsetsEqual(t)){l=!0,d=et.getSingleViableAlt(t);break}c=a,u!==e.EOF&&(i.consume(),u=i.LA(1))}return a.uniqueAlt!==Z.INVALID_ALT_NUMBER?(this.reportContextSensitivity(t,d,a,s,i.index),d):(this.reportAmbiguity(t,n,s,i.index,l,null,a),d)}computeReachSet(t,n,r){this.debug&&console.log("in computeReachSet, starting closure: "+t),null===this.mergeCache&&(this.mergeCache=new nt);const i=new He(r);let s=null;for(let a=0;a<t.items.length;a++){const o=t.items[a];if(this.debug&&console.log("testing "+this.getTokenName(n)+" at "+o),o.state instanceof T)(r||n===e.EOF)&&(null===s&&(s=[]),s.push(o),this.debug_add&&console.log("added "+o+" to skippedStopStates"));else for(let e=0;e<o.state.transitions.length;e++){const t=o.state.transitions[e],r=this.getReachableTarget(t,n);if(null!==r){const e=new b({state:r},o);i.add(e,this.mergeCache),this.debug_add&&console.log("added "+e+" to intermediate")}}}let o=null;if(null===s&&n!==e.EOF&&(1===i.items.length||this.getUniqueAlt(i)!==Z.INVALID_ALT_NUMBER)&&(o=i),null===o){o=new He(r);const t=new h,s=n===e.EOF;for(let e=0;e<i.items.length;e++)this.closure(i.items[e],o,t,!1,r,s)}if(n===e.EOF&&(o=this.removeAllConfigsNotInRuleStopState(o,o===i)),!(null===s||r&&et.hasConfigInRuleStopState(o)))for(let e=0;e<s.length;e++)o.add(s[e],this.mergeCache);return this.trace_atn_sim&&console.log("computeReachSet "+t+" -> "+o),0===o.items.length?null:o}removeAllConfigsNotInRuleStopState(t,n){if(et.allConfigsInRuleStopStates(t))return t;const r=new He(t.fullCtx);for(let i=0;i<t.items.length;i++){const s=t.items[i];if(s.state instanceof T)r.add(s,this.mergeCache);else if(n&&s.state.epsilonOnlyTransitions&&this.atn.nextTokens(s.state).contains(e.EPSILON)){const e=this.atn.ruleToStopState[s.state.ruleIndex];r.add(new b({state:e},s),this.mergeCache)}}return r}computeStartState(e,t,n){const r=V(this.atn,t),i=new He(n);this.trace_atn_sim&&console.log("computeStartState from ATN state "+e+" initialContext="+r.toString(this.parser));for(let s=0;s<e.transitions.length;s++){const t=e.transitions[s].target,o=new b({state:t,alt:s+1,context:r},null),a=new h;this.closure(o,i,a,!0,n,!1)}return i}applyPrecedenceFilter(e){let t;const n=[],r=new He(e.fullCtx);for(let i=0;i<e.items.length;i++){if(t=e.items[i],1!==t.alt)continue;const s=t.semanticContext.evalPrecedence(this.parser,this._outerContext);null!==s&&(n[t.state.stateNumber]=t.context,s!==t.semanticContext?r.add(new b({semanticContext:s},t),this.mergeCache):r.add(t,this.mergeCache))}for(let i=0;i<e.items.length;i++)if(t=e.items[i],1!==t.alt){if(!t.precedenceFilterSuppressed){const e=n[t.state.stateNumber]||null;if(null!==e&&e.equals(t.context))continue}r.add(t,this.mergeCache)}return r}getReachableTarget(e,t){return e.matches(t,0,this.atn.maxTokenType)?e.target:null}getPredsForAmbigAlts(e,t,n){let r=[];for(let s=0;s<t.items.length;s++){const n=t.items[s];e.has(n.alt)&&(r[n.alt]=p.orContext(r[n.alt]||null,n.semanticContext))}let i=0;for(let s=1;s<n+1;s++){const e=r[s]||null;null===e?r[s]=p.NONE:e!==p.NONE&&(i+=1)}return 0===i&&(r=null),this.debug&&console.log("getPredsForAmbigAlts result "+u(r)),r}getPredicatePredictions(e,t){const n=[];let r=!1;for(let i=1;i<t.length;i++){const s=t[i];null!==e&&e.has(i)&&n.push(new Qe(s,i)),s!==p.NONE&&(r=!0)}return r?n:null}getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(e,t){const n=this.splitAccordingToSemanticValidity(e,t),r=n[0],i=n[1];let s=this.getAltThatFinishedDecisionEntryRule(r);return s!==Z.INVALID_ALT_NUMBER||i.items.length>0&&(s=this.getAltThatFinishedDecisionEntryRule(i),s!==Z.INVALID_ALT_NUMBER)?s:Z.INVALID_ALT_NUMBER}getAltThatFinishedDecisionEntryRule(e){const t=[];for(let n=0;n<e.items.length;n++){const r=e.items[n];(r.reachesIntoOuterContext>0||r.state instanceof T&&r.context.hasEmptyPath())&&t.indexOf(r.alt)<0&&t.push(r.alt)}return 0===t.length?Z.INVALID_ALT_NUMBER:Math.min.apply(null,t)}splitAccordingToSemanticValidity(e,t){const n=new He(e.fullCtx),r=new He(e.fullCtx);for(let i=0;i<e.items.length;i++){const s=e.items[i];s.semanticContext!==p.NONE?s.semanticContext.evaluate(this.parser,t)?n.add(s):r.add(s):n.add(s)}return[n,r]}evalSemanticContext(e,t,n){const r=new K;for(let i=0;i<e.length;i++){const s=e[i];if(s.pred===p.NONE){if(r.add(s.alt),!n)break;continue}const o=s.pred.evaluate(this.parser,t);if((this.debug||this.dfa_debug)&&console.log("eval pred "+s+"="+o),o&&((this.debug||this.dfa_debug)&&console.log("PREDICT "+s.alt),r.add(s.alt),!n))break}return r}closure(e,t,n,r,i,s){this.closureCheckingStopState(e,t,n,r,i,0,s)}closureCheckingStopState(e,t,n,r,i,s,o){if((this.trace_atn_sim||this.debug_closure)&&console.log("closure("+e.toString(this.parser,!0)+")"),e.state instanceof T){if(!e.context.isEmpty()){for(let a=0;a<e.context.length;a++){if(e.context.getReturnState(a)===U.EMPTY_RETURN_STATE){if(i){t.add(new b({state:e.state,context:U.EMPTY},e),this.mergeCache);continue}this.debug&&console.log("FALLING off rule "+this.getRuleName(e.state.ruleIndex)),this.closure_(e,t,n,r,i,s,o);continue}const l=this.atn.states[e.context.getReturnState(a)],c=e.context.getParent(a),u={state:l,alt:e.alt,context:c,semanticContext:e.semanticContext},d=new b(u,null);d.reachesIntoOuterContext=e.reachesIntoOuterContext,this.closureCheckingStopState(d,t,n,r,i,s-1,o)}return}if(i)return void t.add(e,this.mergeCache);this.debug&&console.log("FALLING off rule "+this.getRuleName(e.state.ruleIndex))}this.closure_(e,t,n,r,i,s,o)}closure_(e,t,n,r,i,s,o){const a=e.state;a.epsilonOnlyTransitions||t.add(e,this.mergeCache);for(let l=0;l<a.transitions.length;l++){if(0===l&&this.canDropLoopEntryEdgeInLeftRecursiveRule(e))continue;const c=a.transitions[l],u=r&&!(c instanceof de),d=this.getEpsilonTarget(e,c,u,0===s,i,o);if(null!==d){let r=s;if(e.state instanceof T){if(null!==this._dfa&&this._dfa.precedenceDfa&&c.outermostPrecedenceReturn===this._dfa.atnStartState.ruleIndex&&(d.precedenceFilterSuppressed=!0),d.reachesIntoOuterContext+=1,n.add(d)!==d)continue;t.dipsIntoOuterContext=!0,r-=1,this.debug&&console.log("dips into outer ctx: "+d)}else{if(!c.isEpsilon&&n.add(d)!==d)continue;c instanceof w&&r>=0&&(r+=1)}this.closureCheckingStopState(d,t,n,u,i,r,o)}}}canDropLoopEntryEdgeInLeftRecursiveRule(e){const t=e.state;if(t.stateType!==_.STAR_LOOP_ENTRY)return!1;if(t.stateType!==_.STAR_LOOP_ENTRY||!t.isPrecedenceDecision||e.context.isEmpty()||e.context.hasEmptyPath())return!1;const n=e.context.length;for(let s=0;s<n;s++)if(this.atn.states[e.context.getReturnState(s)].ruleIndex!==t.ruleIndex)return!1;const r=t.transitions[0].target.endState.stateNumber,i=this.atn.states[r];for(let s=0;s<n;s++){const n=e.context.getReturnState(s),r=this.atn.states[n];if(1!==r.transitions.length||!r.transitions[0].isEpsilon)return!1;const o=r.transitions[0].target;if(!(r.stateType===_.BLOCK_END&&o===t||r===i||o===i||o.stateType===_.BLOCK_END&&1===o.transitions.length&&o.transitions[0].isEpsilon&&o.transitions[0].target===t))return!1}return!0}getRuleName(e){return null!==this.parser&&e>=0?this.parser.ruleNames[e]:"<rule "+e+">"}getEpsilonTarget(t,n,r,i,s,o){switch(n.serializationType){case x.RULE:return this.ruleTransition(t,n);case x.PRECEDENCE:return this.precedenceTransition(t,n,r,i,s);case x.PREDICATE:return this.predTransition(t,n,r,i,s);case x.ACTION:return this.actionTransition(t,n);case x.EPSILON:return new b({state:n.target},t);case x.ATOM:case x.RANGE:case x.SET:return o&&n.matches(e.EOF,0,1)?new b({state:n.target},t):null;default:return null}}actionTransition(e,t){if(this.debug){const e=-1===t.actionIndex?65535:t.actionIndex;console.log("ACTION edge "+t.ruleIndex+":"+e)}return new b({state:t.target},e)}precedenceTransition(e,t,n,r,i){this.debug&&(console.log("PRED (collectPredicates="+n+") "+t.precedence+">=_p, ctx dependent=true"),null!==this.parser&&console.log("context surrounding pred is "+u(this.parser.getRuleInvocationStack())));let s=null;if(n&&r)if(i){const n=this._input.index;this._input.seek(this._startIndex);const r=t.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(n),r&&(s=new b({state:t.target},e))}else{const n=p.andContext(e.semanticContext,t.getPredicate());s=new b({state:t.target,semanticContext:n},e)}else s=new b({state:t.target},e);return this.debug&&console.log("config from pred transition="+s),s}predTransition(e,t,n,r,i){this.debug&&(console.log("PRED (collectPredicates="+n+") "+t.ruleIndex+":"+t.predIndex+", ctx dependent="+t.isCtxDependent),null!==this.parser&&console.log("context surrounding pred is "+u(this.parser.getRuleInvocationStack())));let s=null;if(n&&(t.isCtxDependent&&r||!t.isCtxDependent))if(i){const n=this._input.index;this._input.seek(this._startIndex);const r=t.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(n),r&&(s=new b({state:t.target},e))}else{const n=p.andContext(e.semanticContext,t.getPredicate());s=new b({state:t.target,semanticContext:n},e)}else s=new b({state:t.target},e);return this.debug&&console.log("config from pred transition="+s),s}ruleTransition(e,t){this.debug&&console.log("CALL rule "+this.getRuleName(t.target.ruleIndex)+", ctx="+e.context);const n=t.followState,r=B.create(e.context,n.stateNumber);return new b({state:t.target,context:r},e)}getConflictingAlts(e){const t=et.getConflictingAltSubsets(e);return et.getAlts(t)}getConflictingAltsOrUniqueAlt(e){let t=null;return e.uniqueAlt!==Z.INVALID_ALT_NUMBER?(t=new K,t.add(e.uniqueAlt)):t=e.conflictingAlts,t}getTokenName(t){if(t===e.EOF)return"EOF";if(null!==this.parser&&null!==this.parser.literalNames){if(!(t>=this.parser.literalNames.length&&t>=this.parser.symbolicNames.length))return(this.parser.literalNames[t]||this.parser.symbolicNames[t])+"<"+t+">";console.log(t+" ttype out of range: "+this.parser.literalNames),console.log(""+this.parser.getInputStream().getTokens())}return""+t}getLookaheadName(e){return this.getTokenName(e.LA(1))}dumpDeadEndConfigs(e){console.log("dead end configs: ");const t=e.getDeadEndConfigs();for(let n=0;n<t.length;n++){const e=t[n];let r="no edges";if(e.state.transitions.length>0){const t=e.state.transitions[0];t instanceof ce?r="Atom "+this.getTokenName(t.label):t instanceof S&&(r=(t instanceof R?"~":"")+"Set "+t.set)}console.error(e.toString(this.parser,!0)+":"+r)}}noViableAlt(e,t,n,r){return new tt(this.parser,e,e.get(r),e.LT(1),n,t)}getUniqueAlt(e){let t=Z.INVALID_ALT_NUMBER;for(let n=0;n<e.items.length;n++){const r=e.items[n];if(t===Z.INVALID_ALT_NUMBER)t=r.alt;else if(r.alt!==t)return Z.INVALID_ALT_NUMBER}return t}addDFAEdge(e,t,n,r){if(this.debug&&console.log("EDGE "+t+" -> "+r+" upon "+this.getTokenName(n)),null===r)return null;if(r=this.addDFAState(e,r),null===t||n<-1||n>this.atn.maxTokenType)return r;if(null===t.edges&&(t.edges=[]),t.edges[n+1]=r,this.debug){const t=null===this.parser?null:this.parser.literalNames,n=null===this.parser?null:this.parser.symbolicNames;console.log("DFA=\n"+e.toString(t,n))}return r}addDFAState(e,t){if(t===ze.ERROR)return t;const n=e.states.get(t);return null!==n?(this.trace_atn_sim&&console.log("addDFAState "+t+" exists"),n):(t.stateNumber=e.states.length,t.configs.readOnly||(t.configs.optimizeConfigs(this),t.configs.setReadonly(!0)),this.trace_atn_sim&&console.log("addDFAState new "+t),e.states.add(t),this.debug&&console.log("adding new DFA state: "+t),t)}reportAttemptingFullContext(e,t,n,r,i){if(this.debug||this.retry_debug){const t=new v(r,i+1);console.log("reportAttemptingFullContext decision="+e.decision+":"+n+", input="+this.parser.getTokenStream().getText(t))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser,e,r,i,t,n)}reportContextSensitivity(e,t,n,r,i){if(this.debug||this.retry_debug){const t=new v(r,i+1);console.log("reportContextSensitivity decision="+e.decision+":"+n+", input="+this.parser.getTokenStream().getText(t))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser,e,r,i,t,n)}reportAmbiguity(e,t,n,r,i,s,o){if(this.debug||this.retry_debug){const e=new v(n,r+1);console.log("reportAmbiguity "+s+":"+o+", input="+this.parser.getTokenStream().getText(e))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser,e,n,r,i,s,o)}}class it{constructor(){this.cache=new z}add(e){if(e===U.EMPTY)return U.EMPTY;const t=this.cache.get(e)||null;return null!==t?t:(this.cache.set(e,e),e)}get(e){return this.cache.get(e)||null}get length(){return this.cache.length}}const st={ATN:Z,ATNDeserializer:Ce,LexerATNSimulator:qe,ParserATNSimulator:rt,PredictionMode:et,PredictionContextCache:it};class ot{constructor(e,t,n){this.dfa=e,this.literalNames=t||[],this.symbolicNames=n||[]}toString(){if(null===this.dfa.s0)return null;let e="";const t=this.dfa.sortedStates();for(let n=0;n<t.length;n++){const r=t[n];if(null!==r.edges){const t=r.edges.length;for(let n=0;n<t;n++){const t=r.edges[n]||null;null!==t&&2147483647!==t.stateNumber&&(e=e.concat(this.getStateString(r)),e=e.concat("-"),e=e.concat(this.getEdgeLabel(n)),e=e.concat("->"),e=e.concat(this.getStateString(t)),e=e.concat("\n"))}}}return 0===e.length?null:e}getEdgeLabel(e){return 0===e?"EOF":null!==this.literalNames||null!==this.symbolicNames?this.literalNames[e-1]||this.symbolicNames[e-1]:String.fromCharCode(e-1)}getStateString(e){const t=(e.isAcceptState?":":"")+"s"+e.stateNumber+(e.requiresFullContext?"^":"");return e.isAcceptState?null!==e.predicates?t+"=>"+u(e.predicates):t+"=>"+e.prediction.toString():t}}class at extends ot{constructor(e){super(e,null)}getEdgeLabel(e){return"'"+String.fromCharCode(e)+"'"}}class lt{constructor(e,t){if(void 0===t&&(t=0),this.atnStartState=e,this.decision=t,this._states=new h,this.s0=null,this.precedenceDfa=!1,e instanceof se&&e.isPrecedenceDecision){this.precedenceDfa=!0;const e=new $e(null,new He);e.edges=[],e.isAcceptState=!1,e.requiresFullContext=!1,this.s0=e}}getPrecedenceStartState(e){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";return e<0||e>=this.s0.edges.length?null:this.s0.edges[e]||null}setPrecedenceStartState(e,t){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";e<0||(this.s0.edges[e]=t)}setPrecedenceDfa(e){if(this.precedenceDfa!==e){if(this._states=new h,e){const e=new $e(null,new He);e.edges=[],e.isAcceptState=!1,e.requiresFullContext=!1,this.s0=e}else this.s0=null;this.precedenceDfa=e}}sortedStates(){return this._states.values().sort((function(e,t){return e.stateNumber-t.stateNumber}))}toString(e,t){return e=e||null,t=t||null,null===this.s0?"":new ot(this,e,t).toString()}toLexerString(){return null===this.s0?"":new at(this).toString()}get states(){return this._states}}const ct={DFA:lt,DFASerializer:ot,LexerDFASerializer:at,PredPrediction:Qe},ut={PredictionContext:U},dt={Interval:v,IntervalSet:E};class ht{visitTerminal(e){}visitErrorNode(e){}enterEveryRule(e){}exitEveryRule(e){}}class pt{visit(e){return Array.isArray(e)?e.map((function(e){return e.accept(this)}),this):e.accept(this)}visitChildren(e){return e.children?this.visit(e.children):null}visitTerminal(e){}visitErrorNode(e){}}class ft{walk(e,t){if(t instanceof D||void 0!==t.isErrorNode&&t.isErrorNode())e.visitErrorNode(t);else if(t instanceof L)e.visitTerminal(t);else{this.enterRule(e,t);for(let n=0;n<t.getChildCount();n++){const r=t.getChild(n);this.walk(e,r)}this.exitRule(e,t)}}enterRule(e,t){const n=t.ruleContext;e.enterEveryRule(n),n.enterRule(e)}exitRule(e,t){const n=t.ruleContext;n.exitRule(e),e.exitEveryRule(n)}}ft.DEFAULT=new ft;const gt={Trees:M,RuleNode:I,ErrorNode:D,TerminalNode:L,ParseTreeListener:ht,ParseTreeVisitor:pt,ParseTreeWalker:ft};class mt extends Me{constructor(e){super({message:"",recognizer:e,input:e.getInputStream(),ctx:e._ctx}),this.offendingToken=e.getCurrentToken()}}class yt extends Me{constructor(e,t,n){super({message:bt(t,n||null),recognizer:e,input:e.getInputStream(),ctx:e._ctx});const r=e._interp.atn.states[e.state].transitions[0];r instanceof fe?(this.ruleIndex=r.ruleIndex,this.predicateIndex=r.predIndex):(this.ruleIndex=0,this.predicateIndex=0),this.predicate=t,this.offendingToken=e.getCurrentToken()}}function bt(e,t){return null!==t?t:"failed predicate: {"+e+"}?"}class vt extends Oe{constructor(e){super(),e=e||!0,this.exactOnly=e}reportAmbiguity(e,t,n,r,i,s,o){if(this.exactOnly&&!i)return;const a="reportAmbiguity d="+this.getDecisionDescription(e,t)+": ambigAlts="+this.getConflictingAlts(s,o)+", input='"+e.getTokenStream().getText(new v(n,r))+"'";e.notifyErrorListeners(a)}reportAttemptingFullContext(e,t,n,r,i,s){const o="reportAttemptingFullContext d="+this.getDecisionDescription(e,t)+", input='"+e.getTokenStream().getText(new v(n,r))+"'";e.notifyErrorListeners(o)}reportContextSensitivity(e,t,n,r,i,s){const o="reportContextSensitivity d="+this.getDecisionDescription(e,t)+", input='"+e.getTokenStream().getText(new v(n,r))+"'";e.notifyErrorListeners(o)}getDecisionDescription(e,t){const n=t.decision,r=t.atnStartState.ruleIndex,i=e.ruleNames;if(r<0||r>=i.length)return""+n;const s=i[r]||null;return null===s||0===s.length?""+n:`${n} (${s})`}getConflictingAlts(e,t){if(null!==e)return e;const n=new K;for(let r=0;r<t.items.length;r++)n.add(t.items[r].alt);return`{${n.values().join(", ")}}`}}class Et extends Error{constructor(){super(),Error.captureStackTrace(this,Et)}}class _t{reset(e){}recoverInline(e){}recover(e,t){}sync(e){}inErrorRecoveryMode(e){}reportError(e){}}class Tt extends _t{constructor(){super(),this.errorRecoveryMode=!1,this.lastErrorIndex=-1,this.lastErrorStates=null,this.nextTokensContext=null,this.nextTokenState=0}reset(e){this.endErrorCondition(e)}beginErrorCondition(e){this.errorRecoveryMode=!0}inErrorRecoveryMode(e){return this.errorRecoveryMode}endErrorCondition(e){this.errorRecoveryMode=!1,this.lastErrorStates=null,this.lastErrorIndex=-1}reportMatch(e){this.endErrorCondition(e)}reportError(e,t){this.inErrorRecoveryMode(e)||(this.beginErrorCondition(e),t instanceof tt?this.reportNoViableAlternative(e,t):t instanceof mt?this.reportInputMismatch(e,t):t instanceof yt?this.reportFailedPredicate(e,t):(console.log("unknown recognition error type: "+t.constructor.name),console.log(t.stack),e.notifyErrorListeners(t.getOffendingToken(),t.getMessage(),t)))}recover(e,t){this.lastErrorIndex===e.getInputStream().index&&null!==this.lastErrorStates&&this.lastErrorStates.indexOf(e.state)>=0&&e.consume(),this.lastErrorIndex=e._input.index,null===this.lastErrorStates&&(this.lastErrorStates=[]),this.lastErrorStates.push(e.state);const n=this.getErrorRecoverySet(e);this.consumeUntil(e,n)}sync(t){if(this.inErrorRecoveryMode(t))return;const n=t._interp.atn.states[t.state],r=t.getTokenStream().LA(1),i=t.atn.nextTokens(n);if(i.contains(r))return this.nextTokensContext=null,void(this.nextTokenState=_.INVALID_STATE_NUMBER);if(i.contains(e.EPSILON))null===this.nextTokensContext&&(this.nextTokensContext=t._ctx,this.nextTokensState=t._stateNumber);else switch(n.stateType){case _.BLOCK_START:case _.STAR_BLOCK_START:case _.PLUS_BLOCK_START:case _.STAR_LOOP_ENTRY:if(null!==this.singleTokenDeletion(t))return;throw new mt(t);case _.PLUS_LOOP_BACK:case _.STAR_LOOP_BACK:{this.reportUnwantedToken(t);const e=new E;e.addSet(t.getExpectedTokens());const n=e.addSet(this.getErrorRecoverySet(t));this.consumeUntil(t,n)}}}reportNoViableAlternative(t,n){const r=t.getTokenStream();let i;i=null!==r?n.startToken.type===e.EOF?"<EOF>":r.getText(new v(n.startToken.tokenIndex,n.offendingToken.tokenIndex)):"<unknown input>";const s="no viable alternative at input "+this.escapeWSAndQuote(i);t.notifyErrorListeners(s,n.offendingToken,n)}reportInputMismatch(e,t){const n="mismatched input "+this.getTokenErrorDisplay(t.offendingToken)+" expecting "+t.getExpectedTokens().toString(e.literalNames,e.symbolicNames);e.notifyErrorListeners(n,t.offendingToken,t)}reportFailedPredicate(e,t){const n="rule "+e.ruleNames[e._ctx.ruleIndex]+" "+t.message;e.notifyErrorListeners(n,t.offendingToken,t)}reportUnwantedToken(e){if(this.inErrorRecoveryMode(e))return;this.beginErrorCondition(e);const t=e.getCurrentToken(),n="extraneous input "+this.getTokenErrorDisplay(t)+" expecting "+this.getExpectedTokens(e).toString(e.literalNames,e.symbolicNames);e.notifyErrorListeners(n,t,null)}reportMissingToken(e){if(this.inErrorRecoveryMode(e))return;this.beginErrorCondition(e);const t=e.getCurrentToken(),n="missing "+this.getExpectedTokens(e).toString(e.literalNames,e.symbolicNames)+" at "+this.getTokenErrorDisplay(t);e.notifyErrorListeners(n,t,null)}recoverInline(e){const t=this.singleTokenDeletion(e);if(null!==t)return e.consume(),t;if(this.singleTokenInsertion(e))return this.getMissingSymbol(e);throw new mt(e)}singleTokenInsertion(e){const t=e.getTokenStream().LA(1),n=e._interp.atn,r=n.states[e.state].transitions[0].target;return!!n.nextTokens(r,e._ctx).contains(t)&&(this.reportMissingToken(e),!0)}singleTokenDeletion(e){const t=e.getTokenStream().LA(2);if(this.getExpectedTokens(e).contains(t)){this.reportUnwantedToken(e),e.consume();const t=e.getCurrentToken();return this.reportMatch(e),t}return null}getMissingSymbol(t){const n=t.getCurrentToken(),r=this.getExpectedTokens(t).first();let i;i=r===e.EOF?"<missing EOF>":"<missing "+t.literalNames[r]+">";let s=n;const o=t.getTokenStream().LT(-1);return s.type===e.EOF&&null!==o&&(s=o),t.getTokenFactory().create(s.source,r,i,e.DEFAULT_CHANNEL,-1,-1,s.line,s.column)}getExpectedTokens(e){return e.getExpectedTokens()}getTokenErrorDisplay(t){if(null===t)return"<no token>";let n=t.text;return null===n&&(n=t.type===e.EOF?"<EOF>":"<"+t.type+">"),this.escapeWSAndQuote(n)}escapeWSAndQuote(e){return"'"+(e=(e=(e=e.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"}getErrorRecoverySet(t){const n=t._interp.atn;let r=t._ctx;const i=new E;for(;null!==r&&r.invokingState>=0;){const e=n.states[r.invokingState].transitions[0],t=n.nextTokens(e.followState);i.addSet(t),r=r.parentCtx}return i.removeOne(e.EPSILON),i}consumeUntil(t,n){let r=t.getTokenStream().LA(1);for(;r!==e.EOF&&!n.contains(r);)t.consume(),r=t.getTokenStream().LA(1)}}class xt extends Tt{constructor(){super()}recover(e,t){let n=e._ctx;for(;null!==n;)n.exception=t,n=n.parentCtx;throw new Et(t)}recoverInline(e){this.recover(e,new mt(e))}sync(e){}}const wt={RecognitionException:Me,NoViableAltException:tt,LexerNoViableAltException:Fe,InputMismatchException:mt,FailedPredicateException:yt,DiagnosticErrorListener:vt,BailErrorStrategy:xt,DefaultErrorStrategy:Tt,ErrorListener:Oe};class St{constructor(e,t){if(this.name="<empty>",this.strdata=e,this.decodeToUnicodeCodePoints=t||!1,this._index=0,this.data=[],this.decodeToUnicodeCodePoints)for(let n=0;n<this.strdata.length;){const e=this.strdata.codePointAt(n);this.data.push(e),n+=e<=65535?1:2}else{this.data=new Array(this.strdata.length);for(let e=0;e<this.strdata.length;e++)this.data[e]=this.strdata.charCodeAt(e)}this._size=this.data.length}reset(){this._index=0}consume(){if(this._index>=this._size)throw"cannot consume EOF";this._index+=1}LA(t){if(0===t)return 0;t<0&&(t+=1);const n=this._index+t-1;return n<0||n>=this._size?e.EOF:this.data[n]}LT(e){return this.LA(e)}mark(){return-1}release(e){}seek(e){e<=this._index?this._index=e:this._index=Math.min(e,this._size)}getText(e,t){if(t>=this._size&&(t=this._size-1),e>=this._size)return"";if(this.decodeToUnicodeCodePoints){let n="";for(let r=e;r<=t;r++)n+=String.fromCodePoint(this.data[r]);return n}return this.strdata.slice(e,t+1)}toString(){return this.strdata}get index(){return this._index}get size(){return this._size}}class Rt extends St{constructor(e,t){super(e,t)}}var kt=r(92);const Ct="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node;class Ot extends Rt{static fromPath(e,t,n){if(!Ct)throw new Error("FileStream is only available when running in Node!");kt.readFile(e,t,(function(e,t){let r=null;null!==t&&(r=new St(t,!0)),n(e,r)}))}constructor(e,t,n){if(!Ct)throw new Error("FileStream is only available when running in Node!");super(kt.readFileSync(e,t||"utf-8"),n),this.fileName=e}}const At={fromString:function(e){return new St(e,!0)},fromBlob:function(e,t,n,r){const i=new window.FileReader;i.onload=function(e){const t=new St(e.target.result,!0);n(t)},i.onerror=r,i.readAsText(e,t)},fromBuffer:function(e,t){return new St(e.toString(t),!0)},fromPath:function(e,t,n){Ot.fromPath(e,t,n)},fromPathSync:function(e,t){return new Ot(e,t)}},Nt={arrayToString:u,stringToCharArray:function(e){let t=new Uint16Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}};class It{}class Lt extends It{constructor(e){super(),this.tokenSource=e,this.tokens=[],this.index=-1,this.fetchedEOF=!1}mark(){return 0}release(e){}reset(){this.seek(0)}seek(e){this.lazyInit(),this.index=this.adjustSeekIndex(e)}get size(){return this.tokens.length}get(e){return this.lazyInit(),this.tokens[e]}consume(){let t=!1;if(t=this.index>=0&&(this.fetchedEOF?this.index<this.tokens.length-1:this.index<this.tokens.length),!t&&this.LA(1)===e.EOF)throw"cannot consume EOF";this.sync(this.index+1)&&(this.index=this.adjustSeekIndex(this.index+1))}sync(e){const t=e-this.tokens.length+1;return!(t>0)||this.fetch(t)>=t}fetch(t){if(this.fetchedEOF)return 0;for(let n=0;n<t;n++){const t=this.tokenSource.nextToken();if(t.tokenIndex=this.tokens.length,this.tokens.push(t),t.type===e.EOF)return this.fetchedEOF=!0,n+1}return t}getTokens(t,n,r){if(void 0===r&&(r=null),t<0||n<0)return null;this.lazyInit();const i=[];n>=this.tokens.length&&(n=this.tokens.length-1);for(let s=t;s<n;s++){const t=this.tokens[s];if(t.type===e.EOF)break;(null===r||r.contains(t.type))&&i.push(t)}return i}LA(e){return this.LT(e).type}LB(e){return this.index-e<0?null:this.tokens[this.index-e]}LT(e){if(this.lazyInit(),0===e)return null;if(e<0)return this.LB(-e);const t=this.index+e-1;return this.sync(t),t>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[t]}adjustSeekIndex(e){return e}lazyInit(){-1===this.index&&this.setup()}setup(){this.sync(0),this.index=this.adjustSeekIndex(0)}setTokenSource(e){this.tokenSource=e,this.tokens=[],this.index=-1,this.fetchedEOF=!1}nextTokenOnChannel(t,n){if(this.sync(t),t>=this.tokens.length)return-1;let r=this.tokens[t];for(;r.channel!==this.channel;){if(r.type===e.EOF)return-1;t+=1,this.sync(t),r=this.tokens[t]}return t}previousTokenOnChannel(e,t){for(;e>=0&&this.tokens[e].channel!==t;)e-=1;return e}getHiddenTokensToRight(e,t){if(void 0===t&&(t=-1),this.lazyInit(),e<0||e>=this.tokens.length)throw e+" not in 0.."+this.tokens.length-1;const n=this.nextTokenOnChannel(e+1,Ue.DEFAULT_TOKEN_CHANNEL),r=e+1,i=-1===n?this.tokens.length-1:n;return this.filterForChannel(r,i,t)}getHiddenTokensToLeft(e,t){if(void 0===t&&(t=-1),this.lazyInit(),e<0||e>=this.tokens.length)throw e+" not in 0.."+this.tokens.length-1;const n=this.previousTokenOnChannel(e-1,Ue.DEFAULT_TOKEN_CHANNEL);if(n===e-1)return null;const r=n+1,i=e-1;return this.filterForChannel(r,i,t)}filterForChannel(e,t,n){const r=[];for(let i=e;i<t+1;i++){const e=this.tokens[i];-1===n?e.channel!==Ue.DEFAULT_TOKEN_CHANNEL&&r.push(e):e.channel===n&&r.push(e)}return 0===r.length?null:r}getSourceName(){return this.tokenSource.getSourceName()}getText(t){this.lazyInit(),this.fill(),t||(t=new v(0,this.tokens.length-1));let n=t.start;n instanceof e&&(n=n.tokenIndex);let r=t.stop;if(r instanceof e&&(r=r.tokenIndex),null===n||null===r||n<0||r<0)return"";r>=this.tokens.length&&(r=this.tokens.length-1);let i="";for(let s=n;s<r+1;s++){const t=this.tokens[s];if(t.type===e.EOF)break;i+=t.text}return i}fill(){for(this.lazyInit();1e3===this.fetch(1e3););}}Object.defineProperty(Lt,"size",{get:function(){return this.tokens.length}});class Dt extends Lt{constructor(t,n){super(t),this.channel=void 0===n?e.DEFAULT_CHANNEL:n}adjustSeekIndex(e){return this.nextTokenOnChannel(e,this.channel)}LB(e){if(0===e||this.index-e<0)return null;let t=this.index,n=1;for(;n<=e;)t=this.previousTokenOnChannel(t-1,this.channel),n+=1;return t<0?null:this.tokens[t]}LT(e){if(this.lazyInit(),0===e)return null;if(e<0)return this.LB(-e);let t=this.index,n=1;for(;n<e;)this.sync(t+1)&&(t=this.nextTokenOnChannel(t+1,this.channel)),n+=1;return this.tokens[t]}getNumberOfOnChannelTokens(){let t=0;this.fill();for(let n=0;n<this.tokens.length;n++){const r=this.tokens[n];if(r.channel===this.channel&&(t+=1),r.type===e.EOF)break}return t}}class Pt extends ht{constructor(e){super(),this.parser=e}enterEveryRule(e){console.log("enter "+this.parser.ruleNames[e.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}visitTerminal(e){console.log("consume "+e.symbol+" rule "+this.parser.ruleNames[this.parser._ctx.ruleIndex])}exitEveryRule(e){console.log("exit "+this.parser.ruleNames[e.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}}class Mt extends Ie{constructor(e){super(),this._input=null,this._errHandler=new Tt,this._precedenceStack=[],this._precedenceStack.push(0),this._ctx=null,this.buildParseTrees=!0,this._tracer=null,this._parseListeners=null,this._syntaxErrors=0,this.setInputStream(e)}reset(){null!==this._input&&this._input.seek(0),this._errHandler.reset(this),this._ctx=null,this._syntaxErrors=0,this.setTrace(!1),this._precedenceStack=[],this._precedenceStack.push(0),null!==this._interp&&this._interp.reset()}match(e){let t=this.getCurrentToken();return t.type===e?(this._errHandler.reportMatch(this),this.consume()):(t=this._errHandler.recoverInline(this),this.buildParseTrees&&-1===t.tokenIndex&&this._ctx.addErrorNode(t)),t}matchWildcard(){let e=this.getCurrentToken();return e.type>0?(this._errHandler.reportMatch(this),this.consume()):(e=this._errHandler.recoverInline(this),this.buildParseTrees&&-1===e.tokenIndex&&this._ctx.addErrorNode(e)),e}getParseListeners(){return this._parseListeners||[]}addParseListener(e){if(null===e)throw"listener";null===this._parseListeners&&(this._parseListeners=[]),this._parseListeners.push(e)}removeParseListener(e){if(null!==this._parseListeners){const t=this._parseListeners.indexOf(e);t>=0&&this._parseListeners.splice(t,1),0===this._parseListeners.length&&(this._parseListeners=null)}}removeParseListeners(){this._parseListeners=null}triggerEnterRuleEvent(){if(null!==this._parseListeners){const e=this._ctx;this._parseListeners.forEach((function(t){t.enterEveryRule(e),e.enterRule(t)}))}}triggerExitRuleEvent(){if(null!==this._parseListeners){const e=this._ctx;this._parseListeners.slice(0).reverse().forEach((function(t){e.exitRule(t),t.exitEveryRule(e)}))}}getTokenFactory(){return this._input.tokenSource._factory}setTokenFactory(e){this._input.tokenSource._factory=e}getATNWithBypassAlts(){const e=this.getSerializedATN();if(null===e)throw"The current parser does not support an ATN with bypass alternatives.";let t=this.bypassAltsAtnCache[e];if(null===t){const n=new ye;n.generateRuleBypassTransitions=!0,t=new Ce(n).deserialize(e),this.bypassAltsAtnCache[e]=t}return t}getInputStream(){return this.getTokenStream()}setInputStream(e){this.setTokenStream(e)}getTokenStream(){return this._input}setTokenStream(e){this._input=null,this.reset(),this._input=e}get syntaxErrorsCount(){return this._syntaxErrors}getCurrentToken(){return this._input.LT(1)}notifyErrorListeners(e,t,n){n=n||null,null===(t=t||null)&&(t=this.getCurrentToken()),this._syntaxErrors+=1;const r=t.line,i=t.column;this.getErrorListenerDispatch().syntaxError(this,t,r,i,e,n)}consume(){const t=this.getCurrentToken();t.type!==e.EOF&&this.getInputStream().consume();const n=null!==this._parseListeners&&this._parseListeners.length>0;if(this.buildParseTrees||n){let e;e=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(t):this._ctx.addTokenNode(t),e.invokingState=this.state,n&&this._parseListeners.forEach((function(t){e instanceof D||void 0!==e.isErrorNode&&e.isErrorNode()?t.visitErrorNode(e):e instanceof L&&t.visitTerminal(e)}))}return t}addContextToParseTree(){null!==this._ctx.parentCtx&&this._ctx.parentCtx.addChild(this._ctx)}enterRule(e,t,n){this.state=t,this._ctx=e,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}exitRule(){this._ctx.stop=this._input.LT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx}enterOuterAlt(e,t){e.setAltNumber(t),this.buildParseTrees&&this._ctx!==e&&null!==this._ctx.parentCtx&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(e)),this._ctx=e}getPrecedence(){return 0===this._precedenceStack.length?-1:this._precedenceStack[this._precedenceStack.length-1]}enterRecursionRule(e,t,n,r){this.state=t,this._precedenceStack.push(r),this._ctx=e,this._ctx.start=this._input.LT(1),this.triggerEnterRuleEvent()}pushNewRecursionContext(e,t,n){const r=this._ctx;r.parentCtx=e,r.invokingState=t,r.stop=this._input.LT(-1),this._ctx=e,this._ctx.start=r.start,this.buildParseTrees&&this._ctx.addChild(r),this.triggerEnterRuleEvent()}unrollRecursionContexts(e){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);const t=this._ctx,n=this.getParseListeners();if(null!==n&&n.length>0)for(;this._ctx!==e;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=e;t.parentCtx=e,this.buildParseTrees&&null!==e&&e.addChild(t)}getInvokingContext(e){let t=this._ctx;for(;null!==t;){if(t.ruleIndex===e)return t;t=t.parentCtx}return null}precpred(e,t){return t>=this._precedenceStack[this._precedenceStack.length-1]}inContext(e){return!1}isExpectedToken(t){const n=this._interp.atn;let r=this._ctx;const i=n.states[this.state];let s=n.nextTokens(i);if(s.contains(t))return!0;if(!s.contains(e.EPSILON))return!1;for(;null!==r&&r.invokingState>=0&&s.contains(e.EPSILON);){const e=n.states[r.invokingState].transitions[0];if(s=n.nextTokens(e.followState),s.contains(t))return!0;r=r.parentCtx}return!(!s.contains(e.EPSILON)||t!==e.EOF)}getExpectedTokens(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)}getExpectedTokensWithinCurrentRule(){const e=this._interp.atn,t=e.states[this.state];return e.nextTokens(t)}getRuleIndex(e){const t=this.getRuleIndexMap()[e];return null!==t?t:-1}getRuleInvocationStack(e){null===(e=e||null)&&(e=this._ctx);const t=[];for(;null!==e;){const n=e.ruleIndex;n<0?t.push("n/a"):t.push(this.ruleNames[n]),e=e.parentCtx}return t}getDFAStrings(){return this._interp.decisionToDFA.toString()}dumpDFA(){let e=!1;for(let t=0;t<this._interp.decisionToDFA.length;t++){const n=this._interp.decisionToDFA[t];n.states.length>0&&(e&&console.log(),this.printer.println("Decision "+n.decision+":"),this.printer.print(n.toString(this.literalNames,this.symbolicNames)),e=!0)}}getSourceName(){return this._input.sourceName}setTrace(e){e?(null!==this._tracer&&this.removeParseListener(this._tracer),this._tracer=new Pt(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)}}Mt.bypassAltsAtnCache={};class Ft extends L{constructor(e){super(),this.parentCtx=null,this.symbol=e}getChild(e){return null}getSymbol(){return this.symbol}getParent(){return this.parentCtx}getPayload(){return this.symbol}getSourceInterval(){if(null===this.symbol)return v.INVALID_INTERVAL;const e=this.symbol.tokenIndex;return new v(e,e)}getChildCount(){return 0}accept(e){return e.visitTerminal(this)}getText(){return this.symbol.text}toString(){return this.symbol.type===e.EOF?"<EOF>":this.symbol.text}}class Ut extends Ft{constructor(e){super(e)}isErrorNode(){return!0}accept(e){return e.visitErrorNode(this)}}class jt extends F{constructor(e,t){super(e,t),this.children=null,this.start=null,this.stop=null,this.exception=null}copyFrom(e){this.parentCtx=e.parentCtx,this.invokingState=e.invokingState,this.children=null,this.start=e.start,this.stop=e.stop,e.children&&(this.children=[],e.children.map((function(e){e instanceof Ut&&(this.children.push(e),e.parentCtx=this)}),this))}enterRule(e){}exitRule(e){}addChild(e){return null===this.children&&(this.children=[]),this.children.push(e),e}removeLastChild(){null!==this.children&&this.children.pop()}addTokenNode(e){const t=new Ft(e);return this.addChild(t),t.parentCtx=this,t}addErrorNode(e){const t=new Ut(e);return this.addChild(t),t.parentCtx=this,t}getChild(e,t){if(t=t||null,null===this.children||e<0||e>=this.children.length)return null;if(null===t)return this.children[e];for(let n=0;n<this.children.length;n++){const r=this.children[n];if(r instanceof t){if(0===e)return r;e-=1}}return null}getToken(e,t){if(null===this.children||t<0||t>=this.children.length)return null;for(let n=0;n<this.children.length;n++){const r=this.children[n];if(r instanceof L&&r.symbol.type===e){if(0===t)return r;t-=1}}return null}getTokens(e){if(null===this.children)return[];{const t=[];for(let n=0;n<this.children.length;n++){const r=this.children[n];r instanceof L&&r.symbol.type===e&&t.push(r)}return t}}getTypedRuleContext(e,t){return this.getChild(t,e)}getTypedRuleContexts(e){if(null===this.children)return[];{const t=[];for(let n=0;n<this.children.length;n++){const r=this.children[n];r instanceof e&&t.push(r)}return t}}getChildCount(){return null===this.children?0:this.children.length}getSourceInterval(){return null===this.start||null===this.stop?v.INVALID_INTERVAL:new v(this.start.tokenIndex,this.stop.tokenIndex)}}F.EMPTY=new jt;class Bt{static DEFAULT_PROGRAM_NAME="default";constructor(e){this.tokens=e,this.programs=new Map}getTokenStream(){return this.tokens}insertAfter(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bt.DEFAULT_PROGRAM_NAME;n="number"==typeof e?e:e.tokenIndex;let i=this.getProgram(r),s=new zt(this.tokens,n,i.length,t);i.push(s)}insertBefore(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bt.DEFAULT_PROGRAM_NAME;n="number"==typeof e?e:e.tokenIndex;const i=this.getProgram(r),s=new $t(this.tokens,n,i.length,t);i.push(s)}replaceSingle(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bt.DEFAULT_PROGRAM_NAME;this.replace(e,e,t,n)}replace(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Bt.DEFAULT_PROGRAM_NAME;if("number"!=typeof e&&(e=e.tokenIndex),"number"!=typeof t&&(t=t.tokenIndex),e>t||e<0||t<0||t>=this.tokens.size)throw new RangeError(`replace: range invalid: ${e}..${t}(size=${this.tokens.size})`);let i=this.getProgram(r),s=new Vt(this.tokens,e,t,i.length,n);i.push(s)}delete(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bt.DEFAULT_PROGRAM_NAME;void 0===t&&(t=e),this.replace(e,t,null,n)}getProgram(e){let t=this.programs.get(e);return null==t&&(t=this.initializeProgram(e)),t}initializeProgram(e){const t=[];return this.programs.set(e,t),t}getText(t){let n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bt.DEFAULT_PROGRAM_NAME;n=t instanceof v?t:new v(0,this.tokens.size-1),"string"==typeof t&&(r=t);const i=this.programs.get(r);let s=n.start,o=n.stop;if(o>this.tokens.size-1&&(o=this.tokens.size-1),s<0&&(s=0),null==i||0===i.length)return this.tokens.getText(new v(s,o));let a=[],l=this.reduceToSingleOperationPerIndex(i),c=s;for(;c<=o&&c<this.tokens.size;){let t=l.get(c);l.delete(c);let n=this.tokens.get(c);null==t?(n.type!==e.EOF&&a.push(String(n.text)),c++):c=t.execute(a)}if(o===this.tokens.size-1)for(const e of l.values())e.index>=this.tokens.size-1&&a.push(e.text.toString());return a.join("")}reduceToSingleOperationPerIndex(e){for(let n=0;n<e.length;n++){let t=e[n];if(null==t)continue;if(!(t instanceof Vt))continue;let r=t,i=this.getKindOfOps(e,$t,n);for(let n of i)n.index===r.index?(e[n.instructionIndex]=void 0,r.text=n.text.toString()+(null!=r.text?r.text.toString():"")):n.index>r.index&&n.index<=r.lastIndex&&(e[n.instructionIndex]=void 0);let s=this.getKindOfOps(e,Vt,n);for(let n of s){if(n.index>=r.index&&n.lastIndex<=r.lastIndex){e[n.instructionIndex]=void 0;continue}let t=n.lastIndex<r.index||n.index>r.lastIndex;if(null!=n.text||null!=r.text||t){if(!t)throw new Error(`replace op boundaries of ${r} overlap with previous ${n}`)}else e[n.instructionIndex]=void 0,r.index=Math.min(n.index,r.index),r.lastIndex=Math.max(n.lastIndex,r.lastIndex)}}for(let n=0;n<e.length;n++){let t=e[n];if(null==t)continue;if(!(t instanceof $t))continue;let r=t,i=this.getKindOfOps(e,$t,n);for(let n of i)n.index===r.index&&(n instanceof zt?(r.text=this.catOpText(n.text,r.text),e[n.instructionIndex]=void 0):n instanceof $t&&(r.text=this.catOpText(r.text,n.text),e[n.instructionIndex]=void 0));let s=this.getKindOfOps(e,Vt,n);for(let o of s)if(r.index!==o.index){if(r.index>=o.index&&r.index<=o.lastIndex)throw new Error(`insert op ${r} within boundaries of previous ${o}`)}else o.text=this.catOpText(r.text,o.text),e[n]=void 0}let t=new Map;for(let n of e)if(null!=n){if(null!=t.get(n.index))throw new Error("should only be one op per index");t.set(n.index,n)}return t}catOpText(e,t){let n="",r="";return null!=e&&(n=e.toString()),null!=t&&(r=t.toString()),n+r}getKindOfOps(e,t,n){return e.slice(0,n).filter((e=>e&&e instanceof t))}}class Ht{constructor(e,t,n,r){this.tokens=e,this.instructionIndex=n,this.index=t,this.text=void 0===r?"":r}toString(){let e=this.constructor.name;const t=e.indexOf("$");return e=e.substring(t+1,e.length),"<"+e+"@"+this.tokens.get(this.index)+':"'+this.text+'">'}}class $t extends Ht{constructor(e,t,n,r){super(e,t,n,r)}execute(t){return this.text&&t.push(this.text.toString()),this.tokens.get(this.index).type!==e.EOF&&t.push(String(this.tokens.get(this.index).text)),this.index+1}}class zt extends $t{constructor(e,t,n,r){super(e,t+1,n,r)}}class Vt extends Ht{constructor(e,t,n,r,i){super(e,t,r,i),this.lastIndex=n}execute(e){return this.text&&e.push(this.text.toString()),this.lastIndex+1}toString(){return null==this.text?"<DeleteOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+">":"<ReplaceOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+':"'+this.text+'">'}}const Gt={atn:st,dfa:ct,context:ut,misc:dt,tree:gt,error:wt,Token:e,CommonToken:Le,CharStreams:At,CharStream:Rt,InputStream:Rt,CommonTokenStream:Dt,Lexer:Ue,Parser:Mt,ParserRuleContext:jt,Interval:v,IntervalSet:E,LL1Analyzer:Y,Utils:Nt,TokenStreamRewriter:Bt}})();var s=t;for(var o in i)s[o]=i[o];i.__esModule&&Object.defineProperty(s,"__esModule",{value:!0})})()},36809:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={title:"OpenFGA",tagline:"Relationship-based access control made fast, scalable, and easy to use.",url:"https://openfga.dev",baseUrl:"/",trailingSlash:!1,onBrokenLinks:"throw",onBrokenMarkdownLinks:"warn",favicon:"/img/openfga-icon.svg",organizationName:"openfga",projectName:"openfga.dev",i18n:{defaultLocale:"en",locales:["en"],path:"i18n",localeConfigs:{}},deploymentBranch:"gh-pages",customFields:{resources:[{text:"Zanzibar Academy \u2192",href:"https://zanzibar.academy/",icon:"ZanzibarIcon"},{text:"Okta FGA Playground \u2192",href:"https://play.fga.dev/",icon:"ModelIcon"},{text:"Podcast - Authorization in Software \u2192",href:"https://authorizationinsoftware.auth0.com/",icon:"PodcastIcon"}],feedback:{defaultTitle:"Have Feedback?",defaultText:"Join us on the Discord community if you have any questions or suggestions.",defaultButtonText:"Join Discord",defaultLink:"https://discord.gg/8naAwJfWN6"},apiDocsBasePath:"https://raw.githubusercontent.com/openfga/api/main/docs/openapiv2/apidocs.swagger.json",description:"OpenFGA is an open source Fine-Grained Authorization solution based on Google's Zanzibar.",productName:"OpenFGA",introLink:"docs/authorization-and-openfga",productDescriptionSection:"#what-is-openfga",conceptLink:"docs/concepts",longProductName:"OpenFGA",landingPageTitle:"Fine Grained Authorization",languageMapping:{js:{importStatement:"const { OpenFgaClient } = require('@openfga/sdk');",apiName:"OpenFgaClient",setupNote:"// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.\n"},go:{importStatement:'. "github.com/openfga/go-sdk/client"',apiName:"OpenFgaClient",setupNote:"// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.\n"},dotnet:{importStatement:"using OpenFga.Sdk.Client;\nusing OpenFga.Sdk.Client.Model;\nusing OpenFga.Sdk.Model;",apiName:"OpenFgaClient",setupNote:"// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.\n"},python:{importStatement:"import os\nimport json\nimport openfga_sdk\nfrom openfga_sdk.client import OpenFgaClient",apiName:"OpenFgaClient",setupNote:"# ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.\n"}},contentSecurityPolicy:"default-src 'none';\n base-uri 'self';\n block-all-mixed-content;\n child-src www.youtube-nocookie.com;\n prefetch-src 'self';\n connect-src 'self' https://raw.githubusercontent.com https://s3.amazonaws.com https://cdn.cookielaw.org https://privacyportal.onetrust.com https://heapanalytics.com https://js.hs-scripts.com https://api.github.com https://js.hscollectedforms.net https://js.hs-analytics.net https://js.hs-banner.com https://forms.hscollectedforms.net ;\n font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com;\n form-action 'none';\n frame-src www.youtube-nocookie.com;\n img-src 'self' data: https://pbs.twimg.com https://docs.github.com https://heapanalytics.com https://forms.hsforms.com https://track.hubspot.com ;\n media-src 'self';\n object-src 'none';\n script-src 'self' 'unsafe-inline' https://cdn.cookielaw.org https://geolocation.onetrust.com https://cdn.heapanalytics.com https://js.hs-scripts.com https://api.github.com https://js.hscollectedforms.net https://js.hs-analytics.net https://js.hs-banner.com;\n style-src 'unsafe-inline' 'self' https://fonts.googleapis.com;"},themes:[["/home/runner/work/openfga.dev/openfga.dev/node_modules/@easyops-cn/docusaurus-search-local/dist/server/server/index.js",{hashed:!0,docsDir:"docs/content",docsRouteBasePath:"/"}]],plugins:["/home/runner/work/openfga.dev/openfga.dev/webpack-overrides.docusaurus-plugin.js",["@docusaurus/plugin-client-redirects",{fromExtensions:["html"],redirects:[{to:"/api/service",from:["/api"]},{to:"/docs/authorization-and-openfga",from:"/docs"}]}],["docusaurus-plugin-module-alias",{alias:{"@components":"/home/runner/work/openfga.dev/openfga.dev/src/components","@features":"/home/runner/work/openfga.dev/openfga.dev/src/features","@static":"/home/runner/work/openfga.dev/openfga.dev/static"}}]],presets:[["classic",{debug:!1,docs:{sidebarPath:"/home/runner/work/openfga.dev/openfga.dev/docs/sidebars.js",routeBasePath:"/docs",exclude:["**/README.md"],showLastUpdateAuthor:!1,editUrl:"https://github.com/openfga/openfga.dev/edit/main/"},theme:{customCss:["/home/runner/work/openfga.dev/openfga.dev/static/css/openfga.css","/home/runner/work/openfga.dev/openfga.dev/src/css/custom.css"]}}]],stylesheets:["https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap","https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"],themeConfig:{metadata:[{name:"keywords",content:"OpenFGA, open source, fine-grained-authorization, fine grained authorization, Zanzibar"},{property:"og:image",content:"https://openfga.dev/img/og-rich-embed.png"}],colorMode:{defaultMode:"dark",disableSwitch:!0,respectPrefersColorScheme:!1},navbar:{logo:{alt:"OpenFGA",src:"img/openfga_logo.svg",href:"/",target:"_self"},items:[{to:"/",label:"Home",position:"left"},{type:"docSidebar",sidebarId:"docs",position:"left",label:"Docs"},{to:"/api/service",label:"API",position:"left"},{to:"/blog",label:"Blog",position:"left"},{to:"https://github.com/openfga/openfga",position:"right",label:"GitHub",className:"header-social header-github-link","aria-label":"OpenFGA on GitHub"},{to:"https://twitter.com/OpenFGA",label:"Twitter",position:"right",className:"header-social header-twitter-link","aria-label":"OpenFGA on Twitter"},{to:"https://discord.gg/8naAwJfWN6",label:"Discord",position:"right",className:"header-social header-discord-link","aria-label":"OpenFGA on Discord"}],hideOnScroll:!1},footer:{links:[{to:"https://twitter.com/OpenFGA",className:"header-social header-twitter-link","aria-label":"OpenFGA on Twitter",label:"Twitter"},{to:"https://discord.gg/8naAwJfWN6",className:"header-social header-discord-link","aria-label":"OpenFGA on Discord",label:"Discord"},{to:"https://github.com/openfga",className:"header-social header-github-link","aria-label":"OpenFGA on GitHub",label:"GitHub"}],copyright:'<div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;" /></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>\xae. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div>',style:"light"},prism:{theme:{plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},darkTheme:{plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},additionalLanguages:["json5","csharp"],magicComments:[{className:"theme-code-block-highlighted-line",line:"highlight-next-line",block:{start:"highlight-start",end:"highlight-end"}}]},docs:{sidebar:{hideable:!0,autoCollapseCategories:!1},versionPersistence:"localStorage"},tableOfContents:{minHeadingLevel:2,maxHeadingLevel:3}},scripts:[{src:"https://js.hs-scripts.com/24392211.js",type:"text/javascript",charset:"UTF-8",id:"hs-script-loader",async:!0,defer:!0}],baseUrlIssueBanner:!0,onDuplicateRoutes:"warn",staticDirectories:["static"],headTags:[],clientModules:[],titleDelimiter:"|",noIndex:!1,markdown:{mermaid:!1}}},87462:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{Z:()=>r})},75068:(e,t,n)=>{"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,{Z:()=>i})},63366:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}n.d(t,{Z:()=>r})},38776:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=!0,i="Invariant failed";function s(e,t){if(!e){if(r)throw new Error(i);var n="function"==typeof t?t():t,s=n?"".concat(i,": ").concat(n):i;throw new Error(s)}}},57529:e=>{"use strict";e.exports={}},16887:e=>{"use strict";e.exports=JSON.parse('{"/api/service-814":{"__comp":"acf022e4","__context":{"plugin":"7bbc0b76"},"config":"5e9f5e1a"},"/blog-c0d":{"__comp":"a6aa9e1f","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","items":[{"content":"caf99389"},{"content":"03f1273c"}],"metadata":"b2b675dd"},"/blog/archive-404":{"__comp":"9e4087bc","__context":{"plugin":"e4a0c232"},"archive":"b2f554cd"},"/blog/conditional-tuples-announcement-2f7":{"__comp":"ccc49370","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","content":"a2ab5d86"},"/blog/kubecon-na-2023-a5a":{"__comp":"ccc49370","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","content":"5dfc8d6a"},"/blog/tags-75b":{"__comp":"01a85c17","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","tags":"a7023ddc"},"/blog/tags/conferences-ad4":{"__comp":"6875c492","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","items":[{"content":"03f1273c"}],"tag":"24bd3649","listMetadata":"89e713ce"},"/blog/tags/features-e37":{"__comp":"6875c492","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","items":[{"content":"caf99389"}],"tag":"69d8fa2b","listMetadata":"2ca0b854"},"/blog/tags/kubecon-243":{"__comp":"6875c492","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","items":[{"content":"03f1273c"}],"tag":"34c50772","listMetadata":"f849ae1d"},"/blog/tags/openfga-482":{"__comp":"6875c492","__context":{"plugin":"e4a0c232"},"sidebar":"814f3328","items":[{"content":"caf99389"}],"tag":"b3e13dba","listMetadata":"0be4346b"},"/search-893":{"__comp":"1a4e3797","__context":{"plugin":"3827dd5a"}},"/docs-f29":{"__comp":"1be78505","__context":{"plugin":"a36c58ef"},"versionMetadata":"935f2afb"},"/docs/authorization-and-openfga-b75":{"__comp":"17896441","content":"882ec15a"},"/docs/concepts-c63":{"__comp":"17896441","content":"bd85ffac"},"/docs/configuration-language-284":{"__comp":"17896441","content":"33b74eba"},"/docs/getting-started-45c":{"__comp":"17896441","content":"da16da38"},"/docs/getting-started/configure-model-3d5":{"__comp":"17896441","content":"7742897f"},"/docs/getting-started/create-store-d80":{"__comp":"17896441","content":"db2cdc18"},"/docs/getting-started/framework-11b":{"__comp":"17896441","content":"18eda3ee"},"/docs/getting-started/immutable-models-9a4":{"__comp":"17896441","content":"3759cf4b"},"/docs/getting-started/install-sdk-54c":{"__comp":"17896441","content":"87c4c920"},"/docs/getting-started/perform-check-64c":{"__comp":"17896441","content":"cb8ccc1a"},"/docs/getting-started/perform-list-objects-c00":{"__comp":"17896441","content":"c0e854c3"},"/docs/getting-started/running-in-production-3df":{"__comp":"17896441","content":"4c2069ba"},"/docs/getting-started/setup-openfga/docker-41b":{"__comp":"17896441","content":"e23d3c5f"},"/docs/getting-started/setup-openfga/kubernetes-577":{"__comp":"17896441","content":"1bbc0b1c"},"/docs/getting-started/setup-openfga/overview-dc6":{"__comp":"17896441","content":"116d061d"},"/docs/getting-started/setup-sdk-client-084":{"__comp":"17896441","content":"3a191a7b"},"/docs/getting-started/tuples-api-best-practices-118":{"__comp":"17896441","content":"487f279c"},"/docs/getting-started/update-tuples-98a":{"__comp":"17896441","content":"34a3e208"},"/docs/interacting-073":{"__comp":"17896441","content":"9c4cd4c4"},"/docs/interacting/managing-group-access-e78":{"__comp":"17896441","content":"4337ba13"},"/docs/interacting/managing-group-membership-970":{"__comp":"17896441","content":"b89f0a14"},"/docs/interacting/managing-relationships-between-objects-36d":{"__comp":"17896441","content":"3d83e150"},"/docs/interacting/managing-user-access-fa6":{"__comp":"17896441","content":"3aada504"},"/docs/interacting/read-tuple-changes-07b":{"__comp":"17896441","content":"028b1cc5"},"/docs/interacting/relationship-queries-e5d":{"__comp":"17896441","content":"73db2c80"},"/docs/interacting/search-with-permissions-86b":{"__comp":"17896441","content":"76c18be1"},"/docs/interacting/transactional-writes-073":{"__comp":"17896441","content":"ed2f6563"},"/docs/modeling-d15":{"__comp":"17896441","content":"4a075682"},"/docs/modeling/advanced-3c0":{"__comp":"17896441","content":"63b646c1"},"/docs/modeling/advanced/entitlements-260":{"__comp":"17896441","content":"97140aee"},"/docs/modeling/advanced/gdrive-c55":{"__comp":"17896441","content":"b2fd7883"},"/docs/modeling/advanced/github-0ad":{"__comp":"17896441","content":"4427aa46"},"/docs/modeling/advanced/iot-e2c":{"__comp":"17896441","content":"78431c72"},"/docs/modeling/advanced/slack-34d":{"__comp":"17896441","content":"f5ba7293"},"/docs/modeling/blocklists-e4f":{"__comp":"17896441","content":"87a4c587"},"/docs/modeling/building-blocks-8ce":{"__comp":"17896441","content":"5ccffc9c"},"/docs/modeling/building-blocks/concentric-relationships-1b8":{"__comp":"17896441","content":"3652cf2a"},"/docs/modeling/building-blocks/direct-relationships-d44":{"__comp":"17896441","content":"4204f988"},"/docs/modeling/building-blocks/object-to-object-relationships-eaa":{"__comp":"17896441","content":"15369573"},"/docs/modeling/building-blocks/usersets-905":{"__comp":"17896441","content":"a09a1188"},"/docs/modeling/contextual-time-based-authorization-9fb":{"__comp":"17896441","content":"e260e0bb"},"/docs/modeling/custom-roles-860":{"__comp":"17896441","content":"7284575f"},"/docs/modeling/direct-access-00b":{"__comp":"17896441","content":"30325ba4"},"/docs/modeling/getting-started-9ce":{"__comp":"17896441","content":"6786195a"},"/docs/modeling/migrating-780":{"__comp":"17896441","content":"0938166f"},"/docs/modeling/migrating/migrating-relations-d6a":{"__comp":"17896441","content":"bb879dcd"},"/docs/modeling/migrating/migrating-schema-1-1-709":{"__comp":"17896441","content":"69ced8de"},"/docs/modeling/multiple-restrictions-74b":{"__comp":"17896441","content":"4920f1c1"},"/docs/modeling/organization-context-authorization-597":{"__comp":"17896441","content":"9578a8cf"},"/docs/modeling/parent-child-34a":{"__comp":"17896441","content":"6a4b619d"},"/docs/modeling/public-access-e9a":{"__comp":"17896441","content":"78aaed86"},"/docs/modeling/roles-and-permissions-fef":{"__comp":"17896441","content":"d3d4dca1"},"/docs/modeling/user-groups-2d1":{"__comp":"17896441","content":"439d46c1"},"/-a17":{"__comp":"1df93b7f","__context":{"plugin":"7bbc0b76"},"config":"5e9f5e1a"}}')},57904:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"user","relations":{}},{"type":"team","relations":{"member":{"this":{}}},"metadata":{"relations":{"member":{"directly_related_user_types":[{"type":"user"}]}}}},{"type":"role","relations":{"assignee":{"this":{}}},"metadata":{"relations":{"assignee":{"directly_related_user_types":[{"type":"user"},{"type":"team","object":"member"},{"type":"org","object":"member"}]}}}},{"type":"org","relations":{"asset_category_creator":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"asset_commenter":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"asset_editor"}}]}},"asset_creator":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"asset_editor":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"asset_viewer":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"asset_commenter"}}]}},"member":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"owner":{"this":{}},"role_assigner":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"role_creator":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"team_assigner":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"team_creator":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}}},"metadata":{"relations":{"asset_category_creator":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"asset_commenter":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"asset_creator":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"asset_editor":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"asset_viewer":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"member":{"directly_related_user_types":[{"type":"user"}]},"owner":{"directly_related_user_types":[{"type":"user"}]},"role_assigner":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"role_creator":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"team_assigner":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"team_creator":{"directly_related_user_types":[{"type":"role","object":"assignee"}]}}}},{"type":"asset-category","relations":{"asset_creator":{"union":{"child":[{"this":{}},{"tupleToUserset":{"tupleset":{"object":"","relation":"org"},"computedUserset":{"object":"","relation":"asset_creator"}}}]}},"commenter":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"editor"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"org"},"computedUserset":{"object":"","relation":"asset_commenter"}}}]}},"editor":{"union":{"child":[{"this":{}},{"tupleToUserset":{"tupleset":{"object":"","relation":"org"},"computedUserset":{"object":"","relation":"asset_editor"}}}]}},"org":{"this":{}},"viewer":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"commenter"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"org"},"computedUserset":{"object":"","relation":"asset_viewer"}}}]}}},"metadata":{"relations":{"asset_creator":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"commenter":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"editor":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"org":{"directly_related_user_types":[{"type":"org"}]},"viewer":{"directly_related_user_types":[{"type":"role","object":"assignee"}]}}}},{"type":"asset","relations":{"category":{"this":{}},"comment":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"edit"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"category"},"computedUserset":{"object":"","relation":"commenter"}}}]}},"edit":{"union":{"child":[{"this":{}},{"tupleToUserset":{"tupleset":{"object":"","relation":"category"},"computedUserset":{"object":"","relation":"editor"}}}]}},"view":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"comment"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"category"},"computedUserset":{"object":"","relation":"viewer"}}}]}}},"metadata":{"relations":{"category":{"directly_related_user_types":[{"type":"asset-category"}]},"comment":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"edit":{"directly_related_user_types":[{"type":"role","object":"assignee"}]},"view":{"directly_related_user_types":[{"type":"role","object":"assignee"}]}}}}]}')},98633:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"user","relations":{}},{"type":"plan","relations":{"subscriber":{"this":{}},"subscriber_member":{"tupleToUserset":{"tupleset":{"object":"","relation":"subscriber"},"computedUserset":{"object":"","relation":"member"}}}},"metadata":{"relations":{"subscriber":{"directly_related_user_types":[{"type":"organization"}]},"subscriber_member":{"directly_related_user_types":[]}}}},{"type":"organization","relations":{"member":{"this":{}}},"metadata":{"relations":{"member":{"directly_related_user_types":[{"type":"user"}]}}}},{"type":"feature","relations":{"can_access":{"tupleToUserset":{"tupleset":{"object":"","relation":"associated_plan"},"computedUserset":{"object":"","relation":"subscriber_member"}}},"associated_plan":{"this":{}}},"metadata":{"relations":{"can_access":{"directly_related_user_types":[]},"associated_plan":{"directly_related_user_types":[{"type":"plan"}]}}}}]}')},98547:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"employee","relations":{"manager":{"this":{}},"can_manage":{"union":{"child":[{"computedUserset":{"relation":"manager"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"manager"},"computedUserset":{"object":"","relation":"can_manage"}}}]}}},"metadata":{"relations":{"manager":{"directly_related_user_types":[{"type":"employee"}]}}}},{"type":"report","relations":{"submitter":{"this":{}},"approver":{"tupleToUserset":{"tupleset":{"object":"","relation":"submitter"},"computedUserset":{"object":"","relation":"can_manage"}}}},"metadata":{"relations":{"submitter":{"directly_related_user_types":[{"type":"employee"}]},"approver":{"directly_related_user_types":[]}}}}]}')},94014:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"user","relations":{}},{"type":"group","relations":{"member":{"this":{}}},"metadata":{"relations":{"member":{"directly_related_user_types":[{"type":"user"}]}}}},{"type":"folder","relations":{"can_create_file":{"computedUserset":{"object":"","relation":"owner"}},"owner":{"this":{}},"parent":{"this":{}},"viewer":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"parent"},"computedUserset":{"object":"","relation":"viewer"}}}]}}},"metadata":{"relations":{"can_create_file":{"directly_related_user_types":[]},"owner":{"directly_related_user_types":[{"type":"user"}]},"parent":{"directly_related_user_types":[{"type":"folder"}]},"viewer":{"directly_related_user_types":[{"type":"user"},{"type":"user","wildcard":{}},{"type":"group","relation":"member"}]}}}},{"type":"doc","relations":{"can_change_owner":{"computedUserset":{"object":"","relation":"owner"}},"owner":{"this":{}},"parent":{"this":{}},"can_read":{"union":{"child":[{"computedUserset":{"object":"","relation":"viewer"}},{"computedUserset":{"object":"","relation":"owner"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"parent"},"computedUserset":{"object":"","relation":"viewer"}}}]}},"can_share":{"union":{"child":[{"computedUserset":{"object":"","relation":"owner"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"parent"},"computedUserset":{"object":"","relation":"owner"}}}]}},"viewer":{"this":{}},"can_write":{"union":{"child":[{"computedUserset":{"object":"","relation":"owner"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"parent"},"computedUserset":{"object":"","relation":"owner"}}}]}}},"metadata":{"relations":{"can_change_owner":{"directly_related_user_types":[]},"owner":{"directly_related_user_types":[{"type":"user"}]},"parent":{"directly_related_user_types":[{"type":"folder"}]},"can_read":{"directly_related_user_types":[]},"can_share":{"directly_related_user_types":[]},"viewer":{"directly_related_user_types":[{"type":"user"},{"type":"user","wildcard":{}},{"type":"group","relation":"member"}]},"can_write":{"directly_related_user_types":[]}}}}]}')},56918:e=>{"use strict";e.exports=JSON.parse('{"type_definitions":[{"type":"user","relations":{}},{"type":"group","relations":{"member":{"this":{}}},"metadata":{"relations":{"member":{"directly_related_user_types":[{"type":"user"}]}}}},{"type":"resource","relations":{"can_edit":{"computedUserset":{"object":"","relation":"editor"}},"can_view":{"union":{"child":[{"computedUserset":{"object":"","relation":"viewer"}},{"computedUserset":{"object":"","relation":"editor"}}]}},"editor":{"this":{}},"viewer":{"this":{}}},"metadata":{"relations":{"can_edit":{"directly_related_user_types":[]},"can_view":{"directly_related_user_types":[]},"editor":{"directly_related_user_types":[{"type":"user"},{"type":"group","relation":"member"}]},"viewer":{"directly_related_user_types":[{"type":"user"},{"type":"group","relation":"member"}]}}}}],"schema_version":"1.1"}')},84001:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"user","relations":{}},{"type":"team","relations":{"member":{"this":{}}},"metadata":{"relations":{"member":{"directly_related_user_types":[{"type":"user"},{"type":"team","relation":"member"}]}}}},{"type":"repo","relations":{"admin":{"union":{"child":[{"this":{}},{"tupleToUserset":{"tupleset":{"object":"","relation":"owner"},"computedUserset":{"object":"","relation":"repo_admin"}}}]}},"maintainer":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"admin"}}]}},"owner":{"this":{}},"reader":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"triager"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"owner"},"computedUserset":{"object":"","relation":"repo_reader"}}}]}},"triager":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"writer"}}]}},"writer":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"maintainer"}},{"tupleToUserset":{"tupleset":{"object":"","relation":"owner"},"computedUserset":{"object":"","relation":"repo_writer"}}}]}}},"metadata":{"relations":{"admin":{"directly_related_user_types":[{"type":"user"},{"type":"team","relation":"member"}]},"maintainer":{"directly_related_user_types":[{"type":"user"},{"type":"team","relation":"member"}]},"owner":{"directly_related_user_types":[{"type":"organization"}]},"reader":{"directly_related_user_types":[{"type":"user"},{"type":"team","relation":"member"}]},"triager":{"directly_related_user_types":[{"type":"user"},{"type":"team","relation":"member"}]},"writer":{"directly_related_user_types":[{"type":"user"},{"type":"team","relation":"member"}]}}}},{"type":"organization","relations":{"member":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"owner"}}]}},"owner":{"this":{}},"repo_admin":{"this":{}},"repo_reader":{"this":{}},"repo_writer":{"this":{}}},"metadata":{"relations":{"member":{"directly_related_user_types":[{"type":"user"}]},"owner":{"directly_related_user_types":[{"type":"user"}]},"repo_admin":{"directly_related_user_types":[{"type":"user"},{"type":"organization","relation":"member"}]},"repo_reader":{"directly_related_user_types":[{"type":"user"},{"type":"organization","relation":"member"}]},"repo_writer":{"directly_related_user_types":[{"type":"user"},{"type":"organization","relation":"member"}]}}}}]}')},96418:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"user","relations":{}},{"type":"device_group","relations":{"it_admin":{"this":{}},"security_guard":{"this":{}}},"metadata":{"relations":{"it_admin":{"directly_related_user_types":[{"type":"user"}]},"security_guard":{"directly_related_user_types":[{"type":"user"}]}}}},{"type":"device","relations":{"can_rename_device":{"computedUserset":{"object":"","relation":"it_admin"}},"it_admin":{"this":{}},"can_view_live_video":{"union":{"child":[{"computedUserset":{"object":"","relation":"it_admin"}},{"computedUserset":{"object":"","relation":"security_guard"}}]}},"can_view_recorded_video":{"union":{"child":[{"computedUserset":{"object":"","relation":"it_admin"}},{"computedUserset":{"object":"","relation":"security_guard"}}]}},"security_guard":{"this":{}}},"metadata":{"relations":{"can_rename_device":{"directly_related_user_types":[]},"it_admin":{"directly_related_user_types":[{"type":"user"},{"type":"device_group","relation":"it_admin"}]},"can_view_live_video":{"directly_related_user_types":[]},"can_view_recorded_video":{"directly_related_user_types":[]},"security_guard":{"directly_related_user_types":[{"type":"user"},{"type":"device_group","relation":"security_guard"}]}}}}]}')},63542:e=>{"use strict";e.exports=JSON.parse('{"schema_version":"1.1","type_definitions":[{"type":"user","relations":{}},{"type":"workspace","relations":{"channels_admin":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"legacy_admin"}}]}},"guest":{"this":{}},"legacy_admin":{"this":{}},"member":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"legacy_admin"}},{"computedUserset":{"object":"","relation":"channels_admin"}}]}}},"metadata":{"relations":{"channels_admin":{"directly_related_user_types":[{"type":"user"}]},"guest":{"directly_related_user_types":[{"type":"user"}]},"legacy_admin":{"directly_related_user_types":[{"type":"user"}]},"member":{"directly_related_user_types":[{"type":"user"}]}}}},{"type":"channel","relations":{"commenter":{"union":{"child":[{"this":{}},{"computedUserset":{"object":"","relation":"writer"}}]}},"parent_workspace":{"this":{}},"writer":{"this":{}}},"metadata":{"relations":{"commenter":{"directly_related_user_types":[{"type":"user"}]},"parent_workspace":{"directly_related_user_types":[{"type":"workspace"}]},"writer":{"directly_related_user_types":[{"type":"user"}]}}}}]}')}},e=>{e.O(0,[532],(()=>{return t=22679,e(e.s=t);var t}));e.O()}]); \ No newline at end of file diff --git a/assets/js/main.2aa7aeed.js.LICENSE.txt b/assets/js/main.18bf920b.js.LICENSE.txt similarity index 100% rename from assets/js/main.2aa7aeed.js.LICENSE.txt rename to assets/js/main.18bf920b.js.LICENSE.txt diff --git a/assets/js/runtime~main.402a86f8.js b/assets/js/runtime~main.685ea9a0.js similarity index 96% rename from assets/js/runtime~main.402a86f8.js rename to assets/js/runtime~main.685ea9a0.js index 28df74532..f6a2b48ae 100644 --- a/assets/js/runtime~main.402a86f8.js +++ b/assets/js/runtime~main.685ea9a0.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,c,d,f,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var c=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=b,e=[],r.O=(a,c,d,f)=>{if(!c){var b=1/0;for(i=0;i<e.length;i++){c=e[i][0],d=e[i][1],f=e[i][2];for(var t=!0,o=0;o<c.length;o++)(!1&f||b>=f)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(t=!1,f<b&&(b=f));if(t){e.splice(i--,1);var n=d();void 0!==n&&(a=n)}}return a}f=f||0;for(var i=e.length;i>0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[c,d,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var f=Object.create(null);r.r(f);var b={};a=a||[null,c({}),c([]),c(c)];for(var t=2&d&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(f,b),f},r.d=(e,a)=>{for(var c in a)r.o(a,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,c)=>(r.f[c](e,a),a)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",265:"87c4c920",356:"34c50772",521:"97140aee",533:"b2b675dd",569:"78aaed86",1105:"9c4cd4c4",1176:"116d061d",1217:"a09a1188",1429:"33b74eba",1477:"b2f554cd",1544:"5dfc8d6a",1713:"a7023ddc",1794:"4204f988",2052:"15369573",2354:"5ccffc9c",2386:"bb879dcd",2450:"acf022e4",2452:"63b646c1",2535:"814f3328",2547:"f849ae1d",2623:"487f279c",2744:"3827dd5a",2991:"3759cf4b",3077:"6786195a",3089:"a6aa9e1f",3151:"cb8ccc1a",3207:"3d83e150",3237:"1df93b7f",3325:"da16da38",3416:"e23d3c5f",3608:"9e4087bc",3666:"18eda3ee",4013:"01a85c17",4374:"30325ba4",4461:"e4a0c232",4464:"f5ba7293",4706:"78431c72",4752:"3652cf2a",4886:"87a4c587",5019:"4c2069ba",5222:"0be4346b",5263:"c0e854c3",5289:"028b1cc5",5362:"d3d4dca1",5721:"0938166f",5735:"2ca0b854",5777:"69ced8de",5863:"34a3e208",6055:"76c18be1",6075:"3a191a7b",6103:"ccc49370",6136:"24bd3649",6248:"a2ab5d86",6359:"bd85ffac",6403:"7bbc0b76",6418:"1bbc0b1c",6743:"7284575f",6840:"b3e13dba",6901:"4427aa46",7226:"e260e0bb",7287:"ed2f6563",7459:"439d46c1",7464:"9578a8cf",7604:"89e713ce",7647:"4337ba13",7852:"6a4b619d",7918:"17896441",7920:"1a4e3797",8018:"a36c58ef",8128:"882ec15a",8242:"db2cdc18",8256:"caf99389",8371:"b2fd7883",8425:"b89f0a14",8592:"common",8610:"6875c492",8705:"3aada504",8883:"4a075682",9062:"7742897f",9302:"73db2c80",9323:"03f1273c",9514:"1be78505",9904:"4920f1c1",9909:"69d8fa2b"}[e]||e)+"."+{53:"fb4d4bbc",203:"764da4c1",217:"2fb30133",265:"6ff18a0b",356:"31119c12",521:"320f26c4",533:"24681390",569:"ca22812f",1105:"217ebb12",1176:"7726afe9",1217:"40fcc810",1429:"4edc25ec",1477:"9507e783",1544:"dcb87d56",1713:"69c70cc4",1794:"998fda59",2052:"ab1ddd50",2354:"b9063989",2386:"70e7f012",2450:"60e2d05b",2452:"8e295e6a",2529:"e2867aaa",2535:"e6269947",2547:"5ef19b88",2623:"a8e61df8",2744:"0dcd4caf",2991:"192b1611",3077:"70e2ef86",3089:"e4ab698b",3151:"3e83eba1",3207:"c0e8cd7e",3237:"98993636",3325:"c561e143",3416:"a21e804f",3604:"d7ad6b0c",3608:"8eef739d",3666:"a6e238e1",4013:"fdd80d3a",4374:"513bba7c",4461:"f2d9c338",4464:"7538e70c",4706:"9225c6ad",4752:"4d9fceed",4886:"b2fa91af",5019:"817d2843",5222:"f55e0460",5263:"654b153f",5289:"2dde548f",5362:"4047bd96",5525:"7c7e6e95",5721:"90a4d4f0",5735:"2427df0f",5777:"e99bfbed",5863:"e31a0fae",6055:"afcc7789",6075:"96ae0267",6103:"e3c141c5",6136:"345b731c",6248:"111ef215",6359:"72a66616",6403:"eff6cef3",6418:"40e1421d",6743:"83495ce7",6840:"2cb3a4c1",6901:"8752ce33",7226:"bb838f9b",7287:"882ea4c7",7459:"2ac45267",7464:"849744b2",7604:"7b9d3694",7647:"c0195fed",7852:"c657293b",7918:"029152f7",7920:"7a48dd23",8018:"27097d61",8128:"38e0a8b2",8242:"bdaff905",8256:"4c052c64",8371:"5bd500b7",8425:"cd9c736a",8443:"8491f7a7",8505:"bf9ec29d",8592:"4ce83303",8610:"247aaecb",8705:"9f67fcee",8883:"8ff7b4b1",9062:"0c13b825",9302:"bb59474f",9323:"8da590ec",9514:"d1453973",9904:"392d8b43",9909:"9e73fbc5"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),d={},f="openfga.dev:",r.l=(e,a,c,b)=>{if(d[e])d[e].push(a);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i<n.length;i++){var l=n[i];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==f+c){t=l;break}}t||(o=!0,(t=document.createElement("script")).charset="utf-8",t.timeout=120,r.nc&&t.setAttribute("nonce",r.nc),t.setAttribute("data-webpack",f+c),t.src=e),d[e]=[a];var u=(a,c)=>{t.onerror=t.onload=null,clearTimeout(s);var f=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(c))),a)return a(c)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=u.bind(null,t.onerror),t.onload=u.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="/",r.gca=function(e){return e={15369573:"2052",17896441:"7918","935f2afb":"53","87c4c920":"265","34c50772":"356","97140aee":"521",b2b675dd:"533","78aaed86":"569","9c4cd4c4":"1105","116d061d":"1176",a09a1188:"1217","33b74eba":"1429",b2f554cd:"1477","5dfc8d6a":"1544",a7023ddc:"1713","4204f988":"1794","5ccffc9c":"2354",bb879dcd:"2386",acf022e4:"2450","63b646c1":"2452","814f3328":"2535",f849ae1d:"2547","487f279c":"2623","3827dd5a":"2744","3759cf4b":"2991","6786195a":"3077",a6aa9e1f:"3089",cb8ccc1a:"3151","3d83e150":"3207","1df93b7f":"3237",da16da38:"3325",e23d3c5f:"3416","9e4087bc":"3608","18eda3ee":"3666","01a85c17":"4013","30325ba4":"4374",e4a0c232:"4461",f5ba7293:"4464","78431c72":"4706","3652cf2a":"4752","87a4c587":"4886","4c2069ba":"5019","0be4346b":"5222",c0e854c3:"5263","028b1cc5":"5289",d3d4dca1:"5362","0938166f":"5721","2ca0b854":"5735","69ced8de":"5777","34a3e208":"5863","76c18be1":"6055","3a191a7b":"6075",ccc49370:"6103","24bd3649":"6136",a2ab5d86:"6248",bd85ffac:"6359","7bbc0b76":"6403","1bbc0b1c":"6418","7284575f":"6743",b3e13dba:"6840","4427aa46":"6901",e260e0bb:"7226",ed2f6563:"7287","439d46c1":"7459","9578a8cf":"7464","89e713ce":"7604","4337ba13":"7647","6a4b619d":"7852","1a4e3797":"7920",a36c58ef:"8018","882ec15a":"8128",db2cdc18:"8242",caf99389:"8256",b2fd7883:"8371",b89f0a14:"8425",common:"8592","6875c492":"8610","3aada504":"8705","4a075682":"8883","7742897f":"9062","73db2c80":"9302","03f1273c":"9323","1be78505":"9514","4920f1c1":"9904","69d8fa2b":"9909"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,c)=>{var d=r.o(e,a)?e[a]:void 0;if(0!==d)if(d)c.push(d[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var f=new Promise(((c,f)=>d=e[a]=[c,f]));c.push(d[2]=f);var b=r.p+r.u(a),t=new Error;r.l(b,(c=>{if(r.o(e,a)&&(0!==(d=e[a])&&(e[a]=void 0),d)){var f=c&&("load"===c.type?"missing":c.type),b=c&&c.target&&c.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+b+")",t.name="ChunkLoadError",t.type=f,t.request=b,d[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,c)=>{var d,f,b=c[0],t=c[1],o=c[2],n=0;if(b.some((a=>0!==e[a]))){for(d in t)r.o(t,d)&&(r.m[d]=t[d]);if(o)var i=o(r)}for(a&&a(c);n<b.length;n++)f=b[n],r.o(e,f)&&e[f]&&e[f][0](),e[f]=0;return r.O(i)},c=self.webpackChunkopenfga_dev=self.webpackChunkopenfga_dev||[];c.forEach(a.bind(null,0)),c.push=a.bind(null,c.push.bind(c))})()})(); \ No newline at end of file +(()=>{"use strict";var e,a,c,d,f,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var c=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=b,e=[],r.O=(a,c,d,f)=>{if(!c){var b=1/0;for(i=0;i<e.length;i++){c=e[i][0],d=e[i][1],f=e[i][2];for(var t=!0,o=0;o<c.length;o++)(!1&f||b>=f)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(t=!1,f<b&&(b=f));if(t){e.splice(i--,1);var n=d();void 0!==n&&(a=n)}}return a}f=f||0;for(var i=e.length;i>0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[c,d,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var f=Object.create(null);r.r(f);var b={};a=a||[null,c({}),c([]),c(c)];for(var t=2&d&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(f,b),f},r.d=(e,a)=>{for(var c in a)r.o(a,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,c)=>(r.f[c](e,a),a)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",265:"87c4c920",356:"34c50772",521:"97140aee",533:"b2b675dd",569:"78aaed86",1105:"9c4cd4c4",1176:"116d061d",1217:"a09a1188",1429:"33b74eba",1477:"b2f554cd",1544:"5dfc8d6a",1713:"a7023ddc",1794:"4204f988",2052:"15369573",2354:"5ccffc9c",2386:"bb879dcd",2450:"acf022e4",2452:"63b646c1",2535:"814f3328",2547:"f849ae1d",2623:"487f279c",2744:"3827dd5a",2991:"3759cf4b",3077:"6786195a",3089:"a6aa9e1f",3151:"cb8ccc1a",3207:"3d83e150",3237:"1df93b7f",3325:"da16da38",3416:"e23d3c5f",3608:"9e4087bc",3666:"18eda3ee",4013:"01a85c17",4374:"30325ba4",4461:"e4a0c232",4464:"f5ba7293",4706:"78431c72",4752:"3652cf2a",4886:"87a4c587",5019:"4c2069ba",5222:"0be4346b",5263:"c0e854c3",5289:"028b1cc5",5362:"d3d4dca1",5721:"0938166f",5735:"2ca0b854",5777:"69ced8de",5863:"34a3e208",6055:"76c18be1",6075:"3a191a7b",6103:"ccc49370",6136:"24bd3649",6248:"a2ab5d86",6359:"bd85ffac",6403:"7bbc0b76",6418:"1bbc0b1c",6743:"7284575f",6840:"b3e13dba",6901:"4427aa46",7226:"e260e0bb",7287:"ed2f6563",7459:"439d46c1",7464:"9578a8cf",7604:"89e713ce",7647:"4337ba13",7852:"6a4b619d",7918:"17896441",7920:"1a4e3797",8018:"a36c58ef",8128:"882ec15a",8242:"db2cdc18",8256:"caf99389",8371:"b2fd7883",8425:"b89f0a14",8592:"common",8610:"6875c492",8705:"3aada504",8883:"4a075682",9062:"7742897f",9302:"73db2c80",9323:"03f1273c",9514:"1be78505",9904:"4920f1c1",9909:"69d8fa2b"}[e]||e)+"."+{53:"fb4d4bbc",203:"764da4c1",217:"2fb30133",265:"6ff18a0b",356:"31119c12",521:"92fade11",533:"24681390",569:"ca22812f",1105:"217ebb12",1176:"7726afe9",1217:"40fcc810",1429:"4edc25ec",1477:"9507e783",1544:"dcb87d56",1713:"69c70cc4",1794:"998fda59",2052:"ab1ddd50",2354:"b9063989",2386:"70e7f012",2450:"60e2d05b",2452:"8e295e6a",2529:"e2867aaa",2535:"e6269947",2547:"5ef19b88",2623:"a8e61df8",2744:"0dcd4caf",2991:"192b1611",3077:"443111d6",3089:"e4ab698b",3151:"3e83eba1",3207:"c0e8cd7e",3237:"98993636",3325:"c561e143",3416:"a21e804f",3604:"d7ad6b0c",3608:"8eef739d",3666:"a6e238e1",4013:"fdd80d3a",4374:"513bba7c",4461:"f2d9c338",4464:"7538e70c",4706:"9225c6ad",4752:"4d9fceed",4886:"b2fa91af",5019:"817d2843",5222:"f55e0460",5263:"654b153f",5289:"2dde548f",5362:"4047bd96",5525:"7c7e6e95",5721:"90a4d4f0",5735:"2427df0f",5777:"e99bfbed",5863:"e31a0fae",6055:"afcc7789",6075:"96ae0267",6103:"e3c141c5",6136:"345b731c",6248:"111ef215",6359:"72a66616",6403:"eff6cef3",6418:"40e1421d",6743:"83495ce7",6840:"2cb3a4c1",6901:"8752ce33",7226:"bb838f9b",7287:"882ea4c7",7459:"2ac45267",7464:"849744b2",7604:"7b9d3694",7647:"c0195fed",7852:"c657293b",7918:"029152f7",7920:"7a48dd23",8018:"27097d61",8128:"38e0a8b2",8242:"bdaff905",8256:"4c052c64",8371:"19911445",8425:"cd9c736a",8443:"8491f7a7",8505:"bf9ec29d",8592:"faa7560d",8610:"247aaecb",8705:"9f67fcee",8883:"8ff7b4b1",9062:"0c13b825",9302:"bb59474f",9323:"8da590ec",9514:"d1453973",9904:"392d8b43",9909:"9e73fbc5"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),d={},f="openfga.dev:",r.l=(e,a,c,b)=>{if(d[e])d[e].push(a);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i<n.length;i++){var l=n[i];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==f+c){t=l;break}}t||(o=!0,(t=document.createElement("script")).charset="utf-8",t.timeout=120,r.nc&&t.setAttribute("nonce",r.nc),t.setAttribute("data-webpack",f+c),t.src=e),d[e]=[a];var u=(a,c)=>{t.onerror=t.onload=null,clearTimeout(s);var f=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(c))),a)return a(c)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=u.bind(null,t.onerror),t.onload=u.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="/",r.gca=function(e){return e={15369573:"2052",17896441:"7918","935f2afb":"53","87c4c920":"265","34c50772":"356","97140aee":"521",b2b675dd:"533","78aaed86":"569","9c4cd4c4":"1105","116d061d":"1176",a09a1188:"1217","33b74eba":"1429",b2f554cd:"1477","5dfc8d6a":"1544",a7023ddc:"1713","4204f988":"1794","5ccffc9c":"2354",bb879dcd:"2386",acf022e4:"2450","63b646c1":"2452","814f3328":"2535",f849ae1d:"2547","487f279c":"2623","3827dd5a":"2744","3759cf4b":"2991","6786195a":"3077",a6aa9e1f:"3089",cb8ccc1a:"3151","3d83e150":"3207","1df93b7f":"3237",da16da38:"3325",e23d3c5f:"3416","9e4087bc":"3608","18eda3ee":"3666","01a85c17":"4013","30325ba4":"4374",e4a0c232:"4461",f5ba7293:"4464","78431c72":"4706","3652cf2a":"4752","87a4c587":"4886","4c2069ba":"5019","0be4346b":"5222",c0e854c3:"5263","028b1cc5":"5289",d3d4dca1:"5362","0938166f":"5721","2ca0b854":"5735","69ced8de":"5777","34a3e208":"5863","76c18be1":"6055","3a191a7b":"6075",ccc49370:"6103","24bd3649":"6136",a2ab5d86:"6248",bd85ffac:"6359","7bbc0b76":"6403","1bbc0b1c":"6418","7284575f":"6743",b3e13dba:"6840","4427aa46":"6901",e260e0bb:"7226",ed2f6563:"7287","439d46c1":"7459","9578a8cf":"7464","89e713ce":"7604","4337ba13":"7647","6a4b619d":"7852","1a4e3797":"7920",a36c58ef:"8018","882ec15a":"8128",db2cdc18:"8242",caf99389:"8256",b2fd7883:"8371",b89f0a14:"8425",common:"8592","6875c492":"8610","3aada504":"8705","4a075682":"8883","7742897f":"9062","73db2c80":"9302","03f1273c":"9323","1be78505":"9514","4920f1c1":"9904","69d8fa2b":"9909"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,c)=>{var d=r.o(e,a)?e[a]:void 0;if(0!==d)if(d)c.push(d[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var f=new Promise(((c,f)=>d=e[a]=[c,f]));c.push(d[2]=f);var b=r.p+r.u(a),t=new Error;r.l(b,(c=>{if(r.o(e,a)&&(0!==(d=e[a])&&(e[a]=void 0),d)){var f=c&&("load"===c.type?"missing":c.type),b=c&&c.target&&c.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+b+")",t.name="ChunkLoadError",t.type=f,t.request=b,d[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,c)=>{var d,f,b=c[0],t=c[1],o=c[2],n=0;if(b.some((a=>0!==e[a]))){for(d in t)r.o(t,d)&&(r.m[d]=t[d]);if(o)var i=o(r)}for(a&&a(c);n<b.length;n++)f=b[n],r.o(e,f)&&e[f]&&e[f][0](),e[f]=0;return r.O(i)},c=self.webpackChunkopenfga_dev=self.webpackChunkopenfga_dev||[];c.forEach(a.bind(null,0)),c.push=a.bind(null,c.push.bind(c))})()})(); \ No newline at end of file diff --git a/blog.html b/blog.html index 70842bd0d..bfb57a763 100644 --- a/blog.html +++ b/blog.html @@ -15,15 +15,15 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a class="navbar__item navbar__link" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="container margin-vert--lg"><div class="row"><aside class="col col--3"><nav class="sidebar_re4s thin-scrollbar" aria-label="Blog recent posts navigation"><div class="sidebarItemTitle_pO2u margin-bottom--md">Recent posts</div><ul class="sidebarItemList_Yudw clean-list"><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/conditional-tuples-announcement">Conditional Relationship Tuples for OpenFGA</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/kubecon-na-2023">Join the OpenFGA team at KubeCon NA 2023</a></li></ul></nav></aside><main class="col col--7" itemscope="" itemtype="http://schema.org/Blog"><article class="margin-bottom--xl" itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting"><meta itemprop="description" content="Conditional Relationship Tuples for OpenFGA"><link itemprop="image" href="https://openfga.dev/img/openfga_logo.svg"><header><h2 class="title_f1Hy" itemprop="headline"><a itemprop="url" href="/blog/conditional-tuples-announcement">Conditional Relationship Tuples for OpenFGA</a></h2><div class="container_mt6G margin-vert--md"><time datetime="2023-11-06T00:00:00.000Z" itemprop="datePublished">November 6, 2023</time> · <!-- -->5 min read</div><div class="margin-top--md margin-bottom--sm row"><div class="col col--6 authorCol_Hf19"><div class="avatar margin-bottom--sm"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" class="avatar__photo-link"><img class="avatar__photo" src="/img/blog/authors/andres.jpg" alt="Andres Aguiar" itemprop="image"></a><div class="avatar__intro" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><div class="avatar__name"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" itemprop="url"><span itemprop="name">Andres Aguiar</span></a></div><small class="avatar__subtitle" itemprop="description">Product Manager</small></div></div></div></div></header><div class="markdown" itemprop="articleBody"><p>Relationship Tuples are the facts that the OpenFGA evaluates to determine whether a user is permitted to access a resource.</p><p>The way tuples are considered when making authorization decisions in OpenFGA is guided by an authorization model, which employs concepts from Relationship-Based Access Control (ReBAC) to establish authorization policies. For instance, you might declare that users are allowed to view a document if they have permission to view its parent folder.</p><p>Although ReBAC offers a highly flexible method for structuring permissions, it encounters difficulties with defining permissions based on attributes that are not easily represented as relationships. Attributes such as “parent folder,” “department,” “region,” and “country” can be conceptualized as relationships between two entities. However, attributes like “IP address,” “time of day,” “team size limit,” or “maximum amount for a bank transfer” cannot be easily handled.</p><p>In our ongoing efforts to expand OpenFGA’s capacity for articulating a broader range of authorization policies, we are introducing <strong>Conditional Relationship Tuples</strong>. These allow for the specification of conditions under which a particular tuple is relevant when evaluating an authorization query.</p><p>Consider the following example, where we utilize Conditional Tuples to grant access for a user over a specified time duration. We stipulate that a user may be granted either unconditional access or access constrained to a certain time period:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, user with non_expired_grant]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">condition</span><span class="token plain"> </span><span class="token condition">non_expired_grant</span><span class="token condition-params">(</span><span class="token condition-params condition-param">current_time:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">timestamp</span><span class="token condition-params">, </span><span class="token condition-params condition-param">grant_time:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">timestamp</span><span class="token condition-params">, </span><span class="token condition-params condition-param">grant_duration:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">duration</span><span class="token condition-params">) {</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> current_time < grant_time + grant_duration</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If we write the following tuples:</p><table><thead><tr><th>user</th><th>relation</th><th>object</th><th>condition</th></tr></thead><tbody><tr><td>user:bob</td><td>viewer</td><td>document:1</td><td></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>name</code> : <code>non_expired_grant</code>, <code>context</code> : { <code>grant_time</code> : <code>2023-01-01T00:00:00Z</code>, <code>grant_duration</code> : <code>1h</code> }</td></tr></tbody></table><p>You'll get the following results for the <a href="https://openfga.dev/api/service#/Relationship%20Queries/Check" target="_blank" rel="noopener noreferrer">Check</a> operations below:</p><table><thead><tr><th>user</th><th>relation</th><th>object</th><th>context</th><th>result</th></tr></thead><tbody><tr><td>user:bob</td><td>viewer</td><td>document:1</td><td></td><td><code>allowed</code> : <code>true</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>current_time</code> : <code>2023-01-01T00:10:00Z</code></td><td><code>allowed</code> : <code>true</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>current_time</code> : <code>2023-01-01T02:00:00Z</code></td><td><code>allowed</code> : <code>false</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td></td><td><code>error</code> : "failed to evaluate relationship condition 'non_expired_grant': context is missing parameters '<!-- -->[current_time]<!-- -->'</td></tr></tbody></table><p>You'll get the following results for the <a href="https://openfga.dev/api/service#/Relationship%20Queries/ListObjects" target="_blank" rel="noopener noreferrer">ListObjects</a> operations below:</p><table><thead><tr><th>user</th><th>relation</th><th>object</th><th>context</th><th>result</th></tr></thead><tbody><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>current_time</code> : <code>2023-01-01T00:10:00Z</code></td><td><code>objects</code>: <code>[ "document:1"]</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td></td><td><code>error</code>: "failed to evaluate relationship condition 'non_expired_grant': tuple 'document:1#viewer@user:anne' is missing context parameters '<!-- -->[current_time]<!-- -->'</td></tr></tbody></table><p>Note that:</p><ul><li><code>user:bob</code> will always get <code>allowed:true</code> as we has assigned as as viewer unconditionally.</li><li><code>user:anne</code> will get <code>allowed:true</code> if the <code>current_time</code> is before the <code>grant_time</code> + <code>grant_duration</code> and <code>allowed:false</code> otherwise.</li><li>If you don't provide the <code>current_time</code> in the context, the Check and ListObjects operations will fail.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-cases">Use Cases<a href="#use-cases" class="hash-link" aria-label="Direct link to Use Cases" title="Direct link to Use Cases">​</a></h2><p>The <a href="https://github.com/openfga/sample-stores" target="_blank" rel="noopener noreferrer">OpenFGA Sample Stores repository</a> has several examples that take advantage of this new feature:</p><ul><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/temporal-access" target="_blank" rel="noopener noreferrer">Granting access during a specific period of time (the use case explained above)</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/ip-based-access" target="_blank" rel="noopener noreferrer">Allow access based on the user’s IP Address</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/groups-resource-attributes" target="_blank" rel="noopener noreferrer">Granting access based on group membership and resource attributes</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/advanced-entitlements" target="_blank" rel="noopener noreferrer">Allow access to specific features based on usage</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/banking" target="_blank" rel="noopener noreferrer">Determine if a user can make a bank transfer based .on the transaction amount</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/condition-data-types" target="_blank" rel="noopener noreferrer">Data types and operations supported in conditions</a>.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-use-it">How to use it?<a href="#how-to-use-it" class="hash-link" aria-label="Direct link to How to use it?" title="Direct link to How to use it?">​</a></h2><p>Conditional Relationship Tuples are included in OpenFGA 1.4.0-rc1 version. You can run it by pulling it from docker:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> pull openfga/openfga:v1.4.0-rc1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run -p </span><span class="token number">8080</span><span class="token plain">:8080 -p </span><span class="token number">8081</span><span class="token plain">:8081 -p </span><span class="token number">3000</span><span class="token plain">:3000 openfga/openfga:v1.4.0-rc1 run`</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>OpenFGA has a rich ecosystem of developer tools. The following have been updated to support Conditional Relationship Tuples:</p><ul><li><p><a href="https://marketplace.visualstudio.com/items?itemName=openfga.openfga-vscode" target="_blank" rel="noopener noreferrer">Visual Studio Code integration</a> which provides syntax highlighting and model validations for conditions.</p></li><li><p>Beta versions of the <a href="https://www.npmjs.com/package/@openfga/sdk/v/0.3.0-beta.1" target="_blank" rel="noopener noreferrer">Javascript SDK</a> and the <a href="https://github.com/openfga/go-sdk/releases/tag/v0.3.0-beta.1" target="_blank" rel="noopener noreferrer">Go SDK</a>, which allows using the additional parameters.</p></li><li><p>The <a href="https://github.com/openfga/cli" target="_blank" rel="noopener noreferrer">OpenFGA CLI</a> allows validating models and runing tests that use conditional tuples. You can use it to test the new features by pointing to a <code>“.fga.yaml”</code> file that <a href="https://github.com/openfga/cli#run-tests-on-an-authorization-model" target="_blank" rel="noopener noreferrer">defines the tests you want to run</a>, without having to deploy OpenFGA.</p></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-next">What’s Next?<a href="#whats-next" class="hash-link" aria-label="Direct link to What’s Next?" title="Direct link to What’s Next?">​</a></h2><p>We’ll address some limitations of the current implementation:</p><ul><li>The <a href="https://openfga.dev/api/service#/Relationship%20Queries/Expand" target="_blank" rel="noopener noreferrer">Expand API</a> does not consider conditions.</li><li>The Visual Studio Code integration is not validating the expressions in conditions. </li><li>The Playground does not let you add context for tuples and assertions. You should use the VS Code Extension + the FGA CLI to test your models for now.</li></ul><p>We'll also improve ListObjects scenarios when it's called with missing context. For example, consider the following model that enables access only to documents with a specific status:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_access</span><span class="token plain">: </span><span class="token directly-assignable">[user with docs_in_draft_status]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">condition</span><span class="token plain"> </span><span class="token condition">docs_in_draft_status</span><span class="token condition-params">(</span><span class="token condition-params condition-param">status:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">string</span><span class="token condition-params">) {</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> status == "draft"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If you want to list all the documents a user can view, you'll need to know the status of all of those documents. Given you don't know the documents the user has access too, you can't send the status of those as a parameter to ListObjects.</p><p>Our goal is to return a structure that you can use to filter documents on your side, similar to: <code>(document.id = ‘1’ and document.status = ‘draft’) or (document.id = ‘2’ and.status = draft)</code> <br> This won’t scale to a large number of documents, but would be useful in some scenarios.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="reach-out">Reach out!<a href="#reach-out" class="hash-link" aria-label="Direct link to Reach out!" title="Direct link to Reach out!">​</a></h2><p>We want to learn how you use this feature and how we can improve it! </p><p>Please reach out to us in <a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer">Discord</a> or <a href="https://github.com/orgs/openfga/discussions" target="_blank" rel="noopener noreferrer">Github</a> with any questions or feedback.</p></div><footer class="row docusaurus-mt-lg"><div class="col"><b>Tags:</b><ul class="tags_jXut padding--none margin-left--sm"><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/openfga">openfga</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/features">features</a></li></ul></div></footer></article><article class="margin-bottom--xl" itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting"><meta itemprop="description" content="OpenFGA at KubeCon"><link itemprop="image" href="https://openfga.dev/img/openfga_logo.svg"><header><h2 class="title_f1Hy" itemprop="headline"><a itemprop="url" href="/blog/kubecon-na-2023">Join the OpenFGA team at KubeCon NA 2023</a></h2><div class="container_mt6G margin-vert--md"><time datetime="2023-10-12T00:00:00.000Z" itemprop="datePublished">October 12, 2023</time> · <!-- -->One min read</div><div class="margin-top--md margin-bottom--sm row"><div class="col col--6 authorCol_Hf19"><div class="avatar margin-bottom--sm"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" class="avatar__photo-link"><img class="avatar__photo" src="/img/blog/authors/andres.jpg" alt="Andres Aguiar" itemprop="image"></a><div class="avatar__intro" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><div class="avatar__name"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" itemprop="url"><span itemprop="name">Andres Aguiar</span></a></div><small class="avatar__subtitle" itemprop="description">Product Manager</small></div></div></div></div></header><div class="markdown" itemprop="articleBody"><p>As you'd expect, the OpenFGA team will be at KubeCon NA 2023 in Chicago, IL!</p><p>We'll have a packed agenda for the week:</p><ul><li><p><a href="https://www.linkedin.com/in/jonathan-whitaker-5a8b2484/" target="_blank" rel="noopener noreferrer">Jonathan Whitaker</a> and <a href="https://www.linkedin.com/in/luxas/" target="_blank" rel="noopener noreferrer">Lucas Käldström</a> will be presenting in <a href="https://cloud-native.rejekts.io/" target="_blank" rel="noopener noreferrer">Could_Native Rejects</a> on how to use OpenFGA to manage and extend authorization in Kubernetes. Learn more <a href="https://cfp.cloud-native.rejekts.io/cloud-native-rejekts-na-chicago-2023/speaker/XB7EUR/" target="_blank" rel="noopener noreferrer">here</a>.</p></li><li><p><a href="https://www.linkedin.com/in/miparnisari/" target="_blank" rel="noopener noreferrer">Maria Ines Parnisari</a> and <a href="https://www.linkedin.com/in/aaguiar/" target="_blank" rel="noopener noreferrer">Andres Aguiar</a> will be presenting in <a href="https://events.linuxfoundation.org/kubecon-cloudnativecon-north-america/co-located-events/appdevelopercon/" target="_blank" rel="noopener noreferrer">AppDeveloperCon</a> about modernizing authorization for cloud native applications using OpenFGA. Learn more <a href="https://colocatedeventsna2023.sched.com/event/1Rj2j/modernizing-authorization-for-cloud-native-applications-using-openfga-andres-aguiar-maria-ines-parnisari-okta" target="_blank" rel="noopener noreferrer">here</a>.</p></li><li><p>We'll host a Project Meeting on Monday 9.30 AM in the Hudson room at the <a href="https://maps.app.goo.gl/77FwgGdpsWK5jWHd6" target="_blank" rel="noopener noreferrer">Hilton Garden Inn</a>. We'll share how the product is being used, demo the latests features like our new CLI, the VS Code Extension, Conditional Relationships, the Java SDK... and more! </p></li><li><p>We'll be in the CNCF Project Pavilion during the afternoons.</p></li><li><p>We'll host our <a href="https://github.com/openfga/community/blob/main/community-meetings.md" target="_blank" rel="noopener noreferrer">OpenFGA community meeting</a> directly from KubeCon on Thursday 9th at 3PM UTC (8AM PST/11AM EST).</p></li></ul><p>If you want to meet with the team outside of these events, please pick any spot that works for you in our <a href="https://calendar.app.google/GonEwLboKvPkG8pL6" target="_blank" rel="noopener noreferrer">calendar</a>.</p><p>See you in Chicago!</p></div><footer class="row docusaurus-mt-lg"><div class="col"><b>Tags:</b><ul class="tags_jXut padding--none margin-left--sm"><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/conferences">conferences</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/kubecon">kubecon</a></li></ul></div></footer></article><nav class="pagination-nav" aria-label="Blog list page navigation"></nav></main></div></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/blog/archive.html b/blog/archive.html index c8688a964..2232579dd 100644 --- a/blog/archive.html +++ b/blog/archive.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a class="navbar__item navbar__link" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><header class="hero hero--primary"><div class="container"><h1 class="hero__title">Archive</h1><p class="hero__subtitle">Archive</p></div></header><main><section class="margin-vert--lg"><div class="container"><div class="row"><div class="col col--4 margin-vert--lg"><h3>2023</h3><ul><li><a href="/blog/conditional-tuples-announcement">November 6, 2023<!-- --> - <!-- -->Conditional Relationship Tuples for OpenFGA</a></li><li><a href="/blog/kubecon-na-2023">October 12, 2023<!-- --> - <!-- -->Join the OpenFGA team at KubeCon NA 2023</a></li></ul></div></div></div></section></main></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/blog/conditional-tuples-announcement.html b/blog/conditional-tuples-announcement.html index b7c56b658..d4b808afd 100644 --- a/blog/conditional-tuples-announcement.html +++ b/blog/conditional-tuples-announcement.html @@ -15,15 +15,15 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a class="navbar__item navbar__link" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="container margin-vert--lg"><div class="row"><aside class="col col--3"><nav class="sidebar_re4s thin-scrollbar" aria-label="Blog recent posts navigation"><div class="sidebarItemTitle_pO2u margin-bottom--md">Recent posts</div><ul class="sidebarItemList_Yudw clean-list"><li class="sidebarItem__DBe"><a aria-current="page" class="sidebarItemLink_mo7H sidebarItemLinkActive_I1ZP" href="/blog/conditional-tuples-announcement">Conditional Relationship Tuples for OpenFGA</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/kubecon-na-2023">Join the OpenFGA team at KubeCon NA 2023</a></li></ul></nav></aside><main class="col col--7" itemscope="" itemtype="http://schema.org/Blog"><article itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting"><meta itemprop="description" content="Conditional Relationship Tuples for OpenFGA"><link itemprop="image" href="https://openfga.dev/img/openfga_logo.svg"><header><h1 class="title_f1Hy" itemprop="headline">Conditional Relationship Tuples for OpenFGA</h1><div class="container_mt6G margin-vert--md"><time datetime="2023-11-06T00:00:00.000Z" itemprop="datePublished">November 6, 2023</time> · <!-- -->5 min read</div><div class="margin-top--md margin-bottom--sm row"><div class="col col--6 authorCol_Hf19"><div class="avatar margin-bottom--sm"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" class="avatar__photo-link"><img class="avatar__photo" src="/img/blog/authors/andres.jpg" alt="Andres Aguiar" itemprop="image"></a><div class="avatar__intro" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><div class="avatar__name"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" itemprop="url"><span itemprop="name">Andres Aguiar</span></a></div><small class="avatar__subtitle" itemprop="description">Product Manager</small></div></div></div></div></header><div id="__blog-post-container" class="markdown" itemprop="articleBody"><p>Relationship Tuples are the facts that the OpenFGA evaluates to determine whether a user is permitted to access a resource.</p><p>The way tuples are considered when making authorization decisions in OpenFGA is guided by an authorization model, which employs concepts from Relationship-Based Access Control (ReBAC) to establish authorization policies. For instance, you might declare that users are allowed to view a document if they have permission to view its parent folder.</p><p>Although ReBAC offers a highly flexible method for structuring permissions, it encounters difficulties with defining permissions based on attributes that are not easily represented as relationships. Attributes such as “parent folder,” “department,” “region,” and “country” can be conceptualized as relationships between two entities. However, attributes like “IP address,” “time of day,” “team size limit,” or “maximum amount for a bank transfer” cannot be easily handled.</p><p>In our ongoing efforts to expand OpenFGA’s capacity for articulating a broader range of authorization policies, we are introducing <strong>Conditional Relationship Tuples</strong>. These allow for the specification of conditions under which a particular tuple is relevant when evaluating an authorization query.</p><p>Consider the following example, where we utilize Conditional Tuples to grant access for a user over a specified time duration. We stipulate that a user may be granted either unconditional access or access constrained to a certain time period:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, user with non_expired_grant]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">condition</span><span class="token plain"> </span><span class="token condition">non_expired_grant</span><span class="token condition-params">(</span><span class="token condition-params condition-param">current_time:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">timestamp</span><span class="token condition-params">, </span><span class="token condition-params condition-param">grant_time:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">timestamp</span><span class="token condition-params">, </span><span class="token condition-params condition-param">grant_duration:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">duration</span><span class="token condition-params">) {</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> current_time < grant_time + grant_duration</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If we write the following tuples:</p><table><thead><tr><th>user</th><th>relation</th><th>object</th><th>condition</th></tr></thead><tbody><tr><td>user:bob</td><td>viewer</td><td>document:1</td><td></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>name</code> : <code>non_expired_grant</code>, <code>context</code> : { <code>grant_time</code> : <code>2023-01-01T00:00:00Z</code>, <code>grant_duration</code> : <code>1h</code> }</td></tr></tbody></table><p>You'll get the following results for the <a href="https://openfga.dev/api/service#/Relationship%20Queries/Check" target="_blank" rel="noopener noreferrer">Check</a> operations below:</p><table><thead><tr><th>user</th><th>relation</th><th>object</th><th>context</th><th>result</th></tr></thead><tbody><tr><td>user:bob</td><td>viewer</td><td>document:1</td><td></td><td><code>allowed</code> : <code>true</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>current_time</code> : <code>2023-01-01T00:10:00Z</code></td><td><code>allowed</code> : <code>true</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>current_time</code> : <code>2023-01-01T02:00:00Z</code></td><td><code>allowed</code> : <code>false</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td></td><td><code>error</code> : "failed to evaluate relationship condition 'non_expired_grant': context is missing parameters '<!-- -->[current_time]<!-- -->'</td></tr></tbody></table><p>You'll get the following results for the <a href="https://openfga.dev/api/service#/Relationship%20Queries/ListObjects" target="_blank" rel="noopener noreferrer">ListObjects</a> operations below:</p><table><thead><tr><th>user</th><th>relation</th><th>object</th><th>context</th><th>result</th></tr></thead><tbody><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>current_time</code> : <code>2023-01-01T00:10:00Z</code></td><td><code>objects</code>: <code>[ "document:1"]</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td></td><td><code>error</code>: "failed to evaluate relationship condition 'non_expired_grant': tuple 'document:1#viewer@user:anne' is missing context parameters '<!-- -->[current_time]<!-- -->'</td></tr></tbody></table><p>Note that:</p><ul><li><code>user:bob</code> will always get <code>allowed:true</code> as we has assigned as as viewer unconditionally.</li><li><code>user:anne</code> will get <code>allowed:true</code> if the <code>current_time</code> is before the <code>grant_time</code> + <code>grant_duration</code> and <code>allowed:false</code> otherwise.</li><li>If you don't provide the <code>current_time</code> in the context, the Check and ListObjects operations will fail.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-cases">Use Cases<a href="#use-cases" class="hash-link" aria-label="Direct link to Use Cases" title="Direct link to Use Cases">​</a></h2><p>The <a href="https://github.com/openfga/sample-stores" target="_blank" rel="noopener noreferrer">OpenFGA Sample Stores repository</a> has several examples that take advantage of this new feature:</p><ul><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/temporal-access" target="_blank" rel="noopener noreferrer">Granting access during a specific period of time (the use case explained above)</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/ip-based-access" target="_blank" rel="noopener noreferrer">Allow access based on the user’s IP Address</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/groups-resource-attributes" target="_blank" rel="noopener noreferrer">Granting access based on group membership and resource attributes</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/advanced-entitlements" target="_blank" rel="noopener noreferrer">Allow access to specific features based on usage</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/banking" target="_blank" rel="noopener noreferrer">Determine if a user can make a bank transfer based .on the transaction amount</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/condition-data-types" target="_blank" rel="noopener noreferrer">Data types and operations supported in conditions</a>.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-use-it">How to use it?<a href="#how-to-use-it" class="hash-link" aria-label="Direct link to How to use it?" title="Direct link to How to use it?">​</a></h2><p>Conditional Relationship Tuples are included in OpenFGA 1.4.0-rc1 version. You can run it by pulling it from docker:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> pull openfga/openfga:v1.4.0-rc1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run -p </span><span class="token number">8080</span><span class="token plain">:8080 -p </span><span class="token number">8081</span><span class="token plain">:8081 -p </span><span class="token number">3000</span><span class="token plain">:3000 openfga/openfga:v1.4.0-rc1 run`</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>OpenFGA has a rich ecosystem of developer tools. The following have been updated to support Conditional Relationship Tuples:</p><ul><li><p><a href="https://marketplace.visualstudio.com/items?itemName=openfga.openfga-vscode" target="_blank" rel="noopener noreferrer">Visual Studio Code integration</a> which provides syntax highlighting and model validations for conditions.</p></li><li><p>Beta versions of the <a href="https://www.npmjs.com/package/@openfga/sdk/v/0.3.0-beta.1" target="_blank" rel="noopener noreferrer">Javascript SDK</a> and the <a href="https://github.com/openfga/go-sdk/releases/tag/v0.3.0-beta.1" target="_blank" rel="noopener noreferrer">Go SDK</a>, which allows using the additional parameters.</p></li><li><p>The <a href="https://github.com/openfga/cli" target="_blank" rel="noopener noreferrer">OpenFGA CLI</a> allows validating models and runing tests that use conditional tuples. You can use it to test the new features by pointing to a <code>“.fga.yaml”</code> file that <a href="https://github.com/openfga/cli#run-tests-on-an-authorization-model" target="_blank" rel="noopener noreferrer">defines the tests you want to run</a>, without having to deploy OpenFGA.</p></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-next">What’s Next?<a href="#whats-next" class="hash-link" aria-label="Direct link to What’s Next?" title="Direct link to What’s Next?">​</a></h2><p>We’ll address some limitations of the current implementation:</p><ul><li>The <a href="https://openfga.dev/api/service#/Relationship%20Queries/Expand" target="_blank" rel="noopener noreferrer">Expand API</a> does not consider conditions.</li><li>The Visual Studio Code integration is not validating the expressions in conditions. </li><li>The Playground does not let you add context for tuples and assertions. You should use the VS Code Extension + the FGA CLI to test your models for now.</li></ul><p>We'll also improve ListObjects scenarios when it's called with missing context. For example, consider the following model that enables access only to documents with a specific status:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_access</span><span class="token plain">: </span><span class="token directly-assignable">[user with docs_in_draft_status]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">condition</span><span class="token plain"> </span><span class="token condition">docs_in_draft_status</span><span class="token condition-params">(</span><span class="token condition-params condition-param">status:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">string</span><span class="token condition-params">) {</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> status == "draft"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If you want to list all the documents a user can view, you'll need to know the status of all of those documents. Given you don't know the documents the user has access too, you can't send the status of those as a parameter to ListObjects.</p><p>Our goal is to return a structure that you can use to filter documents on your side, similar to: <code>(document.id = ‘1’ and document.status = ‘draft’) or (document.id = ‘2’ and.status = draft)</code> <br> This won’t scale to a large number of documents, but would be useful in some scenarios.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="reach-out">Reach out!<a href="#reach-out" class="hash-link" aria-label="Direct link to Reach out!" title="Direct link to Reach out!">​</a></h2><p>We want to learn how you use this feature and how we can improve it! </p><p>Please reach out to us in <a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer">Discord</a> or <a href="https://github.com/orgs/openfga/discussions" target="_blank" rel="noopener noreferrer">Github</a> with any questions or feedback.</p></div><footer class="row docusaurus-mt-lg blogPostFooterDetailsFull_mRVl"><div class="col"><b>Tags:</b><ul class="tags_jXut padding--none margin-left--sm"><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/openfga">openfga</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/features">features</a></li></ul></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Blog post page navigation"><a class="pagination-nav__link pagination-nav__link--next" href="/blog/kubecon-na-2023"><div class="pagination-nav__sublabel">Older Post</div><div class="pagination-nav__label">Join the OpenFGA team at KubeCon NA 2023</div></a></nav></main><div class="col col--2"><div class="tableOfContents_bqdL thin-scrollbar"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#use-cases" class="table-of-contents__link toc-highlight">Use Cases</a></li><li><a href="#how-to-use-it" class="table-of-contents__link toc-highlight">How to use it?</a></li><li><a href="#whats-next" class="table-of-contents__link toc-highlight">What’s Next?</a></li><li><a href="#reach-out" class="table-of-contents__link toc-highlight">Reach out!</a></li></ul></div></div></div></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/blog/kubecon-na-2023.html b/blog/kubecon-na-2023.html index c15650e17..78d66def6 100644 --- a/blog/kubecon-na-2023.html +++ b/blog/kubecon-na-2023.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a class="navbar__item navbar__link" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="container margin-vert--lg"><div class="row"><aside class="col col--3"><nav class="sidebar_re4s thin-scrollbar" aria-label="Blog recent posts navigation"><div class="sidebarItemTitle_pO2u margin-bottom--md">Recent posts</div><ul class="sidebarItemList_Yudw clean-list"><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/conditional-tuples-announcement">Conditional Relationship Tuples for OpenFGA</a></li><li class="sidebarItem__DBe"><a aria-current="page" class="sidebarItemLink_mo7H sidebarItemLinkActive_I1ZP" href="/blog/kubecon-na-2023">Join the OpenFGA team at KubeCon NA 2023</a></li></ul></nav></aside><main class="col col--7" itemscope="" itemtype="http://schema.org/Blog"><article itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting"><meta itemprop="description" content="OpenFGA at KubeCon"><link itemprop="image" href="https://openfga.dev/img/openfga_logo.svg"><header><h1 class="title_f1Hy" itemprop="headline">Join the OpenFGA team at KubeCon NA 2023</h1><div class="container_mt6G margin-vert--md"><time datetime="2023-10-12T00:00:00.000Z" itemprop="datePublished">October 12, 2023</time> · <!-- -->One min read</div><div class="margin-top--md margin-bottom--sm row"><div class="col col--6 authorCol_Hf19"><div class="avatar margin-bottom--sm"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" class="avatar__photo-link"><img class="avatar__photo" src="/img/blog/authors/andres.jpg" alt="Andres Aguiar" itemprop="image"></a><div class="avatar__intro" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><div class="avatar__name"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" itemprop="url"><span itemprop="name">Andres Aguiar</span></a></div><small class="avatar__subtitle" itemprop="description">Product Manager</small></div></div></div></div></header><div id="__blog-post-container" class="markdown" itemprop="articleBody"><p>As you'd expect, the OpenFGA team will be at KubeCon NA 2023 in Chicago, IL!</p><p>We'll have a packed agenda for the week:</p><ul><li><p><a href="https://www.linkedin.com/in/jonathan-whitaker-5a8b2484/" target="_blank" rel="noopener noreferrer">Jonathan Whitaker</a> and <a href="https://www.linkedin.com/in/luxas/" target="_blank" rel="noopener noreferrer">Lucas Käldström</a> will be presenting in <a href="https://cloud-native.rejekts.io/" target="_blank" rel="noopener noreferrer">Could_Native Rejects</a> on how to use OpenFGA to manage and extend authorization in Kubernetes. Learn more <a href="https://cfp.cloud-native.rejekts.io/cloud-native-rejekts-na-chicago-2023/speaker/XB7EUR/" target="_blank" rel="noopener noreferrer">here</a>.</p></li><li><p><a href="https://www.linkedin.com/in/miparnisari/" target="_blank" rel="noopener noreferrer">Maria Ines Parnisari</a> and <a href="https://www.linkedin.com/in/aaguiar/" target="_blank" rel="noopener noreferrer">Andres Aguiar</a> will be presenting in <a href="https://events.linuxfoundation.org/kubecon-cloudnativecon-north-america/co-located-events/appdevelopercon/" target="_blank" rel="noopener noreferrer">AppDeveloperCon</a> about modernizing authorization for cloud native applications using OpenFGA. Learn more <a href="https://colocatedeventsna2023.sched.com/event/1Rj2j/modernizing-authorization-for-cloud-native-applications-using-openfga-andres-aguiar-maria-ines-parnisari-okta" target="_blank" rel="noopener noreferrer">here</a>.</p></li><li><p>We'll host a Project Meeting on Monday 9.30 AM in the Hudson room at the <a href="https://maps.app.goo.gl/77FwgGdpsWK5jWHd6" target="_blank" rel="noopener noreferrer">Hilton Garden Inn</a>. We'll share how the product is being used, demo the latests features like our new CLI, the VS Code Extension, Conditional Relationships, the Java SDK... and more! </p></li><li><p>We'll be in the CNCF Project Pavilion during the afternoons.</p></li><li><p>We'll host our <a href="https://github.com/openfga/community/blob/main/community-meetings.md" target="_blank" rel="noopener noreferrer">OpenFGA community meeting</a> directly from KubeCon on Thursday 9th at 3PM UTC (8AM PST/11AM EST).</p></li></ul><p>If you want to meet with the team outside of these events, please pick any spot that works for you in our <a href="https://calendar.app.google/GonEwLboKvPkG8pL6" target="_blank" rel="noopener noreferrer">calendar</a>.</p><p>See you in Chicago!</p></div><footer class="row docusaurus-mt-lg blogPostFooterDetailsFull_mRVl"><div class="col"><b>Tags:</b><ul class="tags_jXut padding--none margin-left--sm"><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/conferences">conferences</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/kubecon">kubecon</a></li></ul></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Blog post page navigation"><a class="pagination-nav__link pagination-nav__link--prev" href="/blog/conditional-tuples-announcement"><div class="pagination-nav__sublabel">Newer Post</div><div class="pagination-nav__label">Conditional Relationship Tuples for OpenFGA</div></a></nav></main></div></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/blog/tags.html b/blog/tags.html index 8c8b395ab..ec7f5a30f 100644 --- a/blog/tags.html +++ b/blog/tags.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a class="navbar__item navbar__link" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="container margin-vert--lg"><div class="row"><aside class="col col--3"><nav class="sidebar_re4s thin-scrollbar" aria-label="Blog recent posts navigation"><div class="sidebarItemTitle_pO2u margin-bottom--md">Recent posts</div><ul class="sidebarItemList_Yudw clean-list"><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/conditional-tuples-announcement">Conditional Relationship Tuples for OpenFGA</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/kubecon-na-2023">Join the OpenFGA team at KubeCon NA 2023</a></li></ul></nav></aside><main class="col col--7" itemscope="" itemtype="http://schema.org/Blog"><h1>Tags</h1><section class="margin-vert--lg"><article><h2>C</h2><ul class="padding--none"><li class="tag_Nnez"><a class="tag_zVej tagWithCount_h2kH" href="/blog/tags/conferences">conferences<span>1</span></a></li></ul><hr></article><article><h2>F</h2><ul class="padding--none"><li class="tag_Nnez"><a class="tag_zVej tagWithCount_h2kH" href="/blog/tags/features">features<span>1</span></a></li></ul><hr></article><article><h2>K</h2><ul class="padding--none"><li class="tag_Nnez"><a class="tag_zVej tagWithCount_h2kH" href="/blog/tags/kubecon">kubecon<span>1</span></a></li></ul><hr></article><article><h2>O</h2><ul class="padding--none"><li class="tag_Nnez"><a class="tag_zVej tagWithCount_h2kH" href="/blog/tags/openfga">openfga<span>1</span></a></li></ul><hr></article></section></main></div></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/blog/tags/conferences.html b/blog/tags/conferences.html index 89839c174..2470e0251 100644 --- a/blog/tags/conferences.html +++ b/blog/tags/conferences.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a class="navbar__item navbar__link" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="container margin-vert--lg"><div class="row"><aside class="col col--3"><nav class="sidebar_re4s thin-scrollbar" aria-label="Blog recent posts navigation"><div class="sidebarItemTitle_pO2u margin-bottom--md">Recent posts</div><ul class="sidebarItemList_Yudw clean-list"><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/conditional-tuples-announcement">Conditional Relationship Tuples for OpenFGA</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/kubecon-na-2023">Join the OpenFGA team at KubeCon NA 2023</a></li></ul></nav></aside><main class="col col--7" itemscope="" itemtype="http://schema.org/Blog"><header class="margin-bottom--xl"><h1>One post tagged with "conferences"</h1><a href="/blog/tags">View All Tags</a></header><article class="margin-bottom--xl" itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting"><meta itemprop="description" content="OpenFGA at KubeCon"><link itemprop="image" href="https://openfga.dev/img/openfga_logo.svg"><header><h2 class="title_f1Hy" itemprop="headline"><a itemprop="url" href="/blog/kubecon-na-2023">Join the OpenFGA team at KubeCon NA 2023</a></h2><div class="container_mt6G margin-vert--md"><time datetime="2023-10-12T00:00:00.000Z" itemprop="datePublished">October 12, 2023</time> · <!-- -->One min read</div><div class="margin-top--md margin-bottom--sm row"><div class="col col--6 authorCol_Hf19"><div class="avatar margin-bottom--sm"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" class="avatar__photo-link"><img class="avatar__photo" src="/img/blog/authors/andres.jpg" alt="Andres Aguiar" itemprop="image"></a><div class="avatar__intro" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><div class="avatar__name"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" itemprop="url"><span itemprop="name">Andres Aguiar</span></a></div><small class="avatar__subtitle" itemprop="description">Product Manager</small></div></div></div></div></header><div class="markdown" itemprop="articleBody"><p>As you'd expect, the OpenFGA team will be at KubeCon NA 2023 in Chicago, IL!</p><p>We'll have a packed agenda for the week:</p><ul><li><p><a href="https://www.linkedin.com/in/jonathan-whitaker-5a8b2484/" target="_blank" rel="noopener noreferrer">Jonathan Whitaker</a> and <a href="https://www.linkedin.com/in/luxas/" target="_blank" rel="noopener noreferrer">Lucas Käldström</a> will be presenting in <a href="https://cloud-native.rejekts.io/" target="_blank" rel="noopener noreferrer">Could_Native Rejects</a> on how to use OpenFGA to manage and extend authorization in Kubernetes. Learn more <a href="https://cfp.cloud-native.rejekts.io/cloud-native-rejekts-na-chicago-2023/speaker/XB7EUR/" target="_blank" rel="noopener noreferrer">here</a>.</p></li><li><p><a href="https://www.linkedin.com/in/miparnisari/" target="_blank" rel="noopener noreferrer">Maria Ines Parnisari</a> and <a href="https://www.linkedin.com/in/aaguiar/" target="_blank" rel="noopener noreferrer">Andres Aguiar</a> will be presenting in <a href="https://events.linuxfoundation.org/kubecon-cloudnativecon-north-america/co-located-events/appdevelopercon/" target="_blank" rel="noopener noreferrer">AppDeveloperCon</a> about modernizing authorization for cloud native applications using OpenFGA. Learn more <a href="https://colocatedeventsna2023.sched.com/event/1Rj2j/modernizing-authorization-for-cloud-native-applications-using-openfga-andres-aguiar-maria-ines-parnisari-okta" target="_blank" rel="noopener noreferrer">here</a>.</p></li><li><p>We'll host a Project Meeting on Monday 9.30 AM in the Hudson room at the <a href="https://maps.app.goo.gl/77FwgGdpsWK5jWHd6" target="_blank" rel="noopener noreferrer">Hilton Garden Inn</a>. We'll share how the product is being used, demo the latests features like our new CLI, the VS Code Extension, Conditional Relationships, the Java SDK... and more! </p></li><li><p>We'll be in the CNCF Project Pavilion during the afternoons.</p></li><li><p>We'll host our <a href="https://github.com/openfga/community/blob/main/community-meetings.md" target="_blank" rel="noopener noreferrer">OpenFGA community meeting</a> directly from KubeCon on Thursday 9th at 3PM UTC (8AM PST/11AM EST).</p></li></ul><p>If you want to meet with the team outside of these events, please pick any spot that works for you in our <a href="https://calendar.app.google/GonEwLboKvPkG8pL6" target="_blank" rel="noopener noreferrer">calendar</a>.</p><p>See you in Chicago!</p></div><footer class="row docusaurus-mt-lg"><div class="col"><b>Tags:</b><ul class="tags_jXut padding--none margin-left--sm"><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/conferences">conferences</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/kubecon">kubecon</a></li></ul></div></footer></article><nav class="pagination-nav" aria-label="Blog list page navigation"></nav></main></div></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/blog/tags/features.html b/blog/tags/features.html index 8937f6459..b2d62d8d3 100644 --- a/blog/tags/features.html +++ b/blog/tags/features.html @@ -15,15 +15,15 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a class="navbar__item navbar__link" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="container margin-vert--lg"><div class="row"><aside class="col col--3"><nav class="sidebar_re4s thin-scrollbar" aria-label="Blog recent posts navigation"><div class="sidebarItemTitle_pO2u margin-bottom--md">Recent posts</div><ul class="sidebarItemList_Yudw clean-list"><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/conditional-tuples-announcement">Conditional Relationship Tuples for OpenFGA</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/kubecon-na-2023">Join the OpenFGA team at KubeCon NA 2023</a></li></ul></nav></aside><main class="col col--7" itemscope="" itemtype="http://schema.org/Blog"><header class="margin-bottom--xl"><h1>One post tagged with "features"</h1><a href="/blog/tags">View All Tags</a></header><article class="margin-bottom--xl" itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting"><meta itemprop="description" content="Conditional Relationship Tuples for OpenFGA"><link itemprop="image" href="https://openfga.dev/img/openfga_logo.svg"><header><h2 class="title_f1Hy" itemprop="headline"><a itemprop="url" href="/blog/conditional-tuples-announcement">Conditional Relationship Tuples for OpenFGA</a></h2><div class="container_mt6G margin-vert--md"><time datetime="2023-11-06T00:00:00.000Z" itemprop="datePublished">November 6, 2023</time> · <!-- -->5 min read</div><div class="margin-top--md margin-bottom--sm row"><div class="col col--6 authorCol_Hf19"><div class="avatar margin-bottom--sm"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" class="avatar__photo-link"><img class="avatar__photo" src="/img/blog/authors/andres.jpg" alt="Andres Aguiar" itemprop="image"></a><div class="avatar__intro" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><div class="avatar__name"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" itemprop="url"><span itemprop="name">Andres Aguiar</span></a></div><small class="avatar__subtitle" itemprop="description">Product Manager</small></div></div></div></div></header><div class="markdown" itemprop="articleBody"><p>Relationship Tuples are the facts that the OpenFGA evaluates to determine whether a user is permitted to access a resource.</p><p>The way tuples are considered when making authorization decisions in OpenFGA is guided by an authorization model, which employs concepts from Relationship-Based Access Control (ReBAC) to establish authorization policies. For instance, you might declare that users are allowed to view a document if they have permission to view its parent folder.</p><p>Although ReBAC offers a highly flexible method for structuring permissions, it encounters difficulties with defining permissions based on attributes that are not easily represented as relationships. Attributes such as “parent folder,” “department,” “region,” and “country” can be conceptualized as relationships between two entities. However, attributes like “IP address,” “time of day,” “team size limit,” or “maximum amount for a bank transfer” cannot be easily handled.</p><p>In our ongoing efforts to expand OpenFGA’s capacity for articulating a broader range of authorization policies, we are introducing <strong>Conditional Relationship Tuples</strong>. These allow for the specification of conditions under which a particular tuple is relevant when evaluating an authorization query.</p><p>Consider the following example, where we utilize Conditional Tuples to grant access for a user over a specified time duration. We stipulate that a user may be granted either unconditional access or access constrained to a certain time period:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, user with non_expired_grant]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">condition</span><span class="token plain"> </span><span class="token condition">non_expired_grant</span><span class="token condition-params">(</span><span class="token condition-params condition-param">current_time:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">timestamp</span><span class="token condition-params">, </span><span class="token condition-params condition-param">grant_time:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">timestamp</span><span class="token condition-params">, </span><span class="token condition-params condition-param">grant_duration:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">duration</span><span class="token condition-params">) {</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> current_time < grant_time + grant_duration</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If we write the following tuples:</p><table><thead><tr><th>user</th><th>relation</th><th>object</th><th>condition</th></tr></thead><tbody><tr><td>user:bob</td><td>viewer</td><td>document:1</td><td></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>name</code> : <code>non_expired_grant</code>, <code>context</code> : { <code>grant_time</code> : <code>2023-01-01T00:00:00Z</code>, <code>grant_duration</code> : <code>1h</code> }</td></tr></tbody></table><p>You'll get the following results for the <a href="https://openfga.dev/api/service#/Relationship%20Queries/Check" target="_blank" rel="noopener noreferrer">Check</a> operations below:</p><table><thead><tr><th>user</th><th>relation</th><th>object</th><th>context</th><th>result</th></tr></thead><tbody><tr><td>user:bob</td><td>viewer</td><td>document:1</td><td></td><td><code>allowed</code> : <code>true</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>current_time</code> : <code>2023-01-01T00:10:00Z</code></td><td><code>allowed</code> : <code>true</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>current_time</code> : <code>2023-01-01T02:00:00Z</code></td><td><code>allowed</code> : <code>false</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td></td><td><code>error</code> : "failed to evaluate relationship condition 'non_expired_grant': context is missing parameters '<!-- -->[current_time]<!-- -->'</td></tr></tbody></table><p>You'll get the following results for the <a href="https://openfga.dev/api/service#/Relationship%20Queries/ListObjects" target="_blank" rel="noopener noreferrer">ListObjects</a> operations below:</p><table><thead><tr><th>user</th><th>relation</th><th>object</th><th>context</th><th>result</th></tr></thead><tbody><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>current_time</code> : <code>2023-01-01T00:10:00Z</code></td><td><code>objects</code>: <code>[ "document:1"]</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td></td><td><code>error</code>: "failed to evaluate relationship condition 'non_expired_grant': tuple 'document:1#viewer@user:anne' is missing context parameters '<!-- -->[current_time]<!-- -->'</td></tr></tbody></table><p>Note that:</p><ul><li><code>user:bob</code> will always get <code>allowed:true</code> as we has assigned as as viewer unconditionally.</li><li><code>user:anne</code> will get <code>allowed:true</code> if the <code>current_time</code> is before the <code>grant_time</code> + <code>grant_duration</code> and <code>allowed:false</code> otherwise.</li><li>If you don't provide the <code>current_time</code> in the context, the Check and ListObjects operations will fail.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-cases">Use Cases<a href="#use-cases" class="hash-link" aria-label="Direct link to Use Cases" title="Direct link to Use Cases">​</a></h2><p>The <a href="https://github.com/openfga/sample-stores" target="_blank" rel="noopener noreferrer">OpenFGA Sample Stores repository</a> has several examples that take advantage of this new feature:</p><ul><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/temporal-access" target="_blank" rel="noopener noreferrer">Granting access during a specific period of time (the use case explained above)</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/ip-based-access" target="_blank" rel="noopener noreferrer">Allow access based on the user’s IP Address</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/groups-resource-attributes" target="_blank" rel="noopener noreferrer">Granting access based on group membership and resource attributes</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/advanced-entitlements" target="_blank" rel="noopener noreferrer">Allow access to specific features based on usage</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/banking" target="_blank" rel="noopener noreferrer">Determine if a user can make a bank transfer based .on the transaction amount</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/condition-data-types" target="_blank" rel="noopener noreferrer">Data types and operations supported in conditions</a>.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-use-it">How to use it?<a href="#how-to-use-it" class="hash-link" aria-label="Direct link to How to use it?" title="Direct link to How to use it?">​</a></h2><p>Conditional Relationship Tuples are included in OpenFGA 1.4.0-rc1 version. You can run it by pulling it from docker:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> pull openfga/openfga:v1.4.0-rc1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run -p </span><span class="token number">8080</span><span class="token plain">:8080 -p </span><span class="token number">8081</span><span class="token plain">:8081 -p </span><span class="token number">3000</span><span class="token plain">:3000 openfga/openfga:v1.4.0-rc1 run`</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>OpenFGA has a rich ecosystem of developer tools. The following have been updated to support Conditional Relationship Tuples:</p><ul><li><p><a href="https://marketplace.visualstudio.com/items?itemName=openfga.openfga-vscode" target="_blank" rel="noopener noreferrer">Visual Studio Code integration</a> which provides syntax highlighting and model validations for conditions.</p></li><li><p>Beta versions of the <a href="https://www.npmjs.com/package/@openfga/sdk/v/0.3.0-beta.1" target="_blank" rel="noopener noreferrer">Javascript SDK</a> and the <a href="https://github.com/openfga/go-sdk/releases/tag/v0.3.0-beta.1" target="_blank" rel="noopener noreferrer">Go SDK</a>, which allows using the additional parameters.</p></li><li><p>The <a href="https://github.com/openfga/cli" target="_blank" rel="noopener noreferrer">OpenFGA CLI</a> allows validating models and runing tests that use conditional tuples. You can use it to test the new features by pointing to a <code>“.fga.yaml”</code> file that <a href="https://github.com/openfga/cli#run-tests-on-an-authorization-model" target="_blank" rel="noopener noreferrer">defines the tests you want to run</a>, without having to deploy OpenFGA.</p></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-next">What’s Next?<a href="#whats-next" class="hash-link" aria-label="Direct link to What’s Next?" title="Direct link to What’s Next?">​</a></h2><p>We’ll address some limitations of the current implementation:</p><ul><li>The <a href="https://openfga.dev/api/service#/Relationship%20Queries/Expand" target="_blank" rel="noopener noreferrer">Expand API</a> does not consider conditions.</li><li>The Visual Studio Code integration is not validating the expressions in conditions. </li><li>The Playground does not let you add context for tuples and assertions. You should use the VS Code Extension + the FGA CLI to test your models for now.</li></ul><p>We'll also improve ListObjects scenarios when it's called with missing context. For example, consider the following model that enables access only to documents with a specific status:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_access</span><span class="token plain">: </span><span class="token directly-assignable">[user with docs_in_draft_status]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">condition</span><span class="token plain"> </span><span class="token condition">docs_in_draft_status</span><span class="token condition-params">(</span><span class="token condition-params condition-param">status:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">string</span><span class="token condition-params">) {</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> status == "draft"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If you want to list all the documents a user can view, you'll need to know the status of all of those documents. Given you don't know the documents the user has access too, you can't send the status of those as a parameter to ListObjects.</p><p>Our goal is to return a structure that you can use to filter documents on your side, similar to: <code>(document.id = ‘1’ and document.status = ‘draft’) or (document.id = ‘2’ and.status = draft)</code> <br> This won’t scale to a large number of documents, but would be useful in some scenarios.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="reach-out">Reach out!<a href="#reach-out" class="hash-link" aria-label="Direct link to Reach out!" title="Direct link to Reach out!">​</a></h2><p>We want to learn how you use this feature and how we can improve it! </p><p>Please reach out to us in <a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer">Discord</a> or <a href="https://github.com/orgs/openfga/discussions" target="_blank" rel="noopener noreferrer">Github</a> with any questions or feedback.</p></div><footer class="row docusaurus-mt-lg"><div class="col"><b>Tags:</b><ul class="tags_jXut padding--none margin-left--sm"><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/openfga">openfga</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/features">features</a></li></ul></div></footer></article><nav class="pagination-nav" aria-label="Blog list page navigation"></nav></main></div></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/blog/tags/kubecon.html b/blog/tags/kubecon.html index ed9c46fde..5c959557c 100644 --- a/blog/tags/kubecon.html +++ b/blog/tags/kubecon.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a class="navbar__item navbar__link" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="container margin-vert--lg"><div class="row"><aside class="col col--3"><nav class="sidebar_re4s thin-scrollbar" aria-label="Blog recent posts navigation"><div class="sidebarItemTitle_pO2u margin-bottom--md">Recent posts</div><ul class="sidebarItemList_Yudw clean-list"><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/conditional-tuples-announcement">Conditional Relationship Tuples for OpenFGA</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/kubecon-na-2023">Join the OpenFGA team at KubeCon NA 2023</a></li></ul></nav></aside><main class="col col--7" itemscope="" itemtype="http://schema.org/Blog"><header class="margin-bottom--xl"><h1>One post tagged with "kubecon"</h1><a href="/blog/tags">View All Tags</a></header><article class="margin-bottom--xl" itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting"><meta itemprop="description" content="OpenFGA at KubeCon"><link itemprop="image" href="https://openfga.dev/img/openfga_logo.svg"><header><h2 class="title_f1Hy" itemprop="headline"><a itemprop="url" href="/blog/kubecon-na-2023">Join the OpenFGA team at KubeCon NA 2023</a></h2><div class="container_mt6G margin-vert--md"><time datetime="2023-10-12T00:00:00.000Z" itemprop="datePublished">October 12, 2023</time> · <!-- -->One min read</div><div class="margin-top--md margin-bottom--sm row"><div class="col col--6 authorCol_Hf19"><div class="avatar margin-bottom--sm"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" class="avatar__photo-link"><img class="avatar__photo" src="/img/blog/authors/andres.jpg" alt="Andres Aguiar" itemprop="image"></a><div class="avatar__intro" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><div class="avatar__name"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" itemprop="url"><span itemprop="name">Andres Aguiar</span></a></div><small class="avatar__subtitle" itemprop="description">Product Manager</small></div></div></div></div></header><div class="markdown" itemprop="articleBody"><p>As you'd expect, the OpenFGA team will be at KubeCon NA 2023 in Chicago, IL!</p><p>We'll have a packed agenda for the week:</p><ul><li><p><a href="https://www.linkedin.com/in/jonathan-whitaker-5a8b2484/" target="_blank" rel="noopener noreferrer">Jonathan Whitaker</a> and <a href="https://www.linkedin.com/in/luxas/" target="_blank" rel="noopener noreferrer">Lucas Käldström</a> will be presenting in <a href="https://cloud-native.rejekts.io/" target="_blank" rel="noopener noreferrer">Could_Native Rejects</a> on how to use OpenFGA to manage and extend authorization in Kubernetes. Learn more <a href="https://cfp.cloud-native.rejekts.io/cloud-native-rejekts-na-chicago-2023/speaker/XB7EUR/" target="_blank" rel="noopener noreferrer">here</a>.</p></li><li><p><a href="https://www.linkedin.com/in/miparnisari/" target="_blank" rel="noopener noreferrer">Maria Ines Parnisari</a> and <a href="https://www.linkedin.com/in/aaguiar/" target="_blank" rel="noopener noreferrer">Andres Aguiar</a> will be presenting in <a href="https://events.linuxfoundation.org/kubecon-cloudnativecon-north-america/co-located-events/appdevelopercon/" target="_blank" rel="noopener noreferrer">AppDeveloperCon</a> about modernizing authorization for cloud native applications using OpenFGA. Learn more <a href="https://colocatedeventsna2023.sched.com/event/1Rj2j/modernizing-authorization-for-cloud-native-applications-using-openfga-andres-aguiar-maria-ines-parnisari-okta" target="_blank" rel="noopener noreferrer">here</a>.</p></li><li><p>We'll host a Project Meeting on Monday 9.30 AM in the Hudson room at the <a href="https://maps.app.goo.gl/77FwgGdpsWK5jWHd6" target="_blank" rel="noopener noreferrer">Hilton Garden Inn</a>. We'll share how the product is being used, demo the latests features like our new CLI, the VS Code Extension, Conditional Relationships, the Java SDK... and more! </p></li><li><p>We'll be in the CNCF Project Pavilion during the afternoons.</p></li><li><p>We'll host our <a href="https://github.com/openfga/community/blob/main/community-meetings.md" target="_blank" rel="noopener noreferrer">OpenFGA community meeting</a> directly from KubeCon on Thursday 9th at 3PM UTC (8AM PST/11AM EST).</p></li></ul><p>If you want to meet with the team outside of these events, please pick any spot that works for you in our <a href="https://calendar.app.google/GonEwLboKvPkG8pL6" target="_blank" rel="noopener noreferrer">calendar</a>.</p><p>See you in Chicago!</p></div><footer class="row docusaurus-mt-lg"><div class="col"><b>Tags:</b><ul class="tags_jXut padding--none margin-left--sm"><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/conferences">conferences</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/kubecon">kubecon</a></li></ul></div></footer></article><nav class="pagination-nav" aria-label="Blog list page navigation"></nav></main></div></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/blog/tags/openfga.html b/blog/tags/openfga.html index 589d61427..48925d010 100644 --- a/blog/tags/openfga.html +++ b/blog/tags/openfga.html @@ -15,15 +15,15 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a class="navbar__item navbar__link" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="container margin-vert--lg"><div class="row"><aside class="col col--3"><nav class="sidebar_re4s thin-scrollbar" aria-label="Blog recent posts navigation"><div class="sidebarItemTitle_pO2u margin-bottom--md">Recent posts</div><ul class="sidebarItemList_Yudw clean-list"><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/conditional-tuples-announcement">Conditional Relationship Tuples for OpenFGA</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/blog/kubecon-na-2023">Join the OpenFGA team at KubeCon NA 2023</a></li></ul></nav></aside><main class="col col--7" itemscope="" itemtype="http://schema.org/Blog"><header class="margin-bottom--xl"><h1>One post tagged with "openfga"</h1><a href="/blog/tags">View All Tags</a></header><article class="margin-bottom--xl" itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting"><meta itemprop="description" content="Conditional Relationship Tuples for OpenFGA"><link itemprop="image" href="https://openfga.dev/img/openfga_logo.svg"><header><h2 class="title_f1Hy" itemprop="headline"><a itemprop="url" href="/blog/conditional-tuples-announcement">Conditional Relationship Tuples for OpenFGA</a></h2><div class="container_mt6G margin-vert--md"><time datetime="2023-11-06T00:00:00.000Z" itemprop="datePublished">November 6, 2023</time> · <!-- -->5 min read</div><div class="margin-top--md margin-bottom--sm row"><div class="col col--6 authorCol_Hf19"><div class="avatar margin-bottom--sm"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" class="avatar__photo-link"><img class="avatar__photo" src="/img/blog/authors/andres.jpg" alt="Andres Aguiar" itemprop="image"></a><div class="avatar__intro" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><div class="avatar__name"><a href="https://github.com/aaguiarz" target="_blank" rel="noopener noreferrer" itemprop="url"><span itemprop="name">Andres Aguiar</span></a></div><small class="avatar__subtitle" itemprop="description">Product Manager</small></div></div></div></div></header><div class="markdown" itemprop="articleBody"><p>Relationship Tuples are the facts that the OpenFGA evaluates to determine whether a user is permitted to access a resource.</p><p>The way tuples are considered when making authorization decisions in OpenFGA is guided by an authorization model, which employs concepts from Relationship-Based Access Control (ReBAC) to establish authorization policies. For instance, you might declare that users are allowed to view a document if they have permission to view its parent folder.</p><p>Although ReBAC offers a highly flexible method for structuring permissions, it encounters difficulties with defining permissions based on attributes that are not easily represented as relationships. Attributes such as “parent folder,” “department,” “region,” and “country” can be conceptualized as relationships between two entities. However, attributes like “IP address,” “time of day,” “team size limit,” or “maximum amount for a bank transfer” cannot be easily handled.</p><p>In our ongoing efforts to expand OpenFGA’s capacity for articulating a broader range of authorization policies, we are introducing <strong>Conditional Relationship Tuples</strong>. These allow for the specification of conditions under which a particular tuple is relevant when evaluating an authorization query.</p><p>Consider the following example, where we utilize Conditional Tuples to grant access for a user over a specified time duration. We stipulate that a user may be granted either unconditional access or access constrained to a certain time period:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, user with non_expired_grant]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">condition</span><span class="token plain"> </span><span class="token condition">non_expired_grant</span><span class="token condition-params">(</span><span class="token condition-params condition-param">current_time:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">timestamp</span><span class="token condition-params">, </span><span class="token condition-params condition-param">grant_time:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">timestamp</span><span class="token condition-params">, </span><span class="token condition-params condition-param">grant_duration:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">duration</span><span class="token condition-params">) {</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> current_time < grant_time + grant_duration</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If we write the following tuples:</p><table><thead><tr><th>user</th><th>relation</th><th>object</th><th>condition</th></tr></thead><tbody><tr><td>user:bob</td><td>viewer</td><td>document:1</td><td></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>name</code> : <code>non_expired_grant</code>, <code>context</code> : { <code>grant_time</code> : <code>2023-01-01T00:00:00Z</code>, <code>grant_duration</code> : <code>1h</code> }</td></tr></tbody></table><p>You'll get the following results for the <a href="https://openfga.dev/api/service#/Relationship%20Queries/Check" target="_blank" rel="noopener noreferrer">Check</a> operations below:</p><table><thead><tr><th>user</th><th>relation</th><th>object</th><th>context</th><th>result</th></tr></thead><tbody><tr><td>user:bob</td><td>viewer</td><td>document:1</td><td></td><td><code>allowed</code> : <code>true</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>current_time</code> : <code>2023-01-01T00:10:00Z</code></td><td><code>allowed</code> : <code>true</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>current_time</code> : <code>2023-01-01T02:00:00Z</code></td><td><code>allowed</code> : <code>false</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td></td><td><code>error</code> : "failed to evaluate relationship condition 'non_expired_grant': context is missing parameters '<!-- -->[current_time]<!-- -->'</td></tr></tbody></table><p>You'll get the following results for the <a href="https://openfga.dev/api/service#/Relationship%20Queries/ListObjects" target="_blank" rel="noopener noreferrer">ListObjects</a> operations below:</p><table><thead><tr><th>user</th><th>relation</th><th>object</th><th>context</th><th>result</th></tr></thead><tbody><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td><code>current_time</code> : <code>2023-01-01T00:10:00Z</code></td><td><code>objects</code>: <code>[ "document:1"]</code></td></tr><tr><td>user:anne</td><td>viewer</td><td>document:1</td><td></td><td><code>error</code>: "failed to evaluate relationship condition 'non_expired_grant': tuple 'document:1#viewer@user:anne' is missing context parameters '<!-- -->[current_time]<!-- -->'</td></tr></tbody></table><p>Note that:</p><ul><li><code>user:bob</code> will always get <code>allowed:true</code> as we has assigned as as viewer unconditionally.</li><li><code>user:anne</code> will get <code>allowed:true</code> if the <code>current_time</code> is before the <code>grant_time</code> + <code>grant_duration</code> and <code>allowed:false</code> otherwise.</li><li>If you don't provide the <code>current_time</code> in the context, the Check and ListObjects operations will fail.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-cases">Use Cases<a href="#use-cases" class="hash-link" aria-label="Direct link to Use Cases" title="Direct link to Use Cases">​</a></h2><p>The <a href="https://github.com/openfga/sample-stores" target="_blank" rel="noopener noreferrer">OpenFGA Sample Stores repository</a> has several examples that take advantage of this new feature:</p><ul><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/temporal-access" target="_blank" rel="noopener noreferrer">Granting access during a specific period of time (the use case explained above)</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/ip-based-access" target="_blank" rel="noopener noreferrer">Allow access based on the user’s IP Address</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/groups-resource-attributes" target="_blank" rel="noopener noreferrer">Granting access based on group membership and resource attributes</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/advanced-entitlements" target="_blank" rel="noopener noreferrer">Allow access to specific features based on usage</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/banking" target="_blank" rel="noopener noreferrer">Determine if a user can make a bank transfer based .on the transaction amount</a>.</li><li><a href="https://github.com/openfga/sample-stores/tree/main/stores/condition-data-types" target="_blank" rel="noopener noreferrer">Data types and operations supported in conditions</a>.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-use-it">How to use it?<a href="#how-to-use-it" class="hash-link" aria-label="Direct link to How to use it?" title="Direct link to How to use it?">​</a></h2><p>Conditional Relationship Tuples are included in OpenFGA 1.4.0-rc1 version. You can run it by pulling it from docker:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> pull openfga/openfga:v1.4.0-rc1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run -p </span><span class="token number">8080</span><span class="token plain">:8080 -p </span><span class="token number">8081</span><span class="token plain">:8081 -p </span><span class="token number">3000</span><span class="token plain">:3000 openfga/openfga:v1.4.0-rc1 run`</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>OpenFGA has a rich ecosystem of developer tools. The following have been updated to support Conditional Relationship Tuples:</p><ul><li><p><a href="https://marketplace.visualstudio.com/items?itemName=openfga.openfga-vscode" target="_blank" rel="noopener noreferrer">Visual Studio Code integration</a> which provides syntax highlighting and model validations for conditions.</p></li><li><p>Beta versions of the <a href="https://www.npmjs.com/package/@openfga/sdk/v/0.3.0-beta.1" target="_blank" rel="noopener noreferrer">Javascript SDK</a> and the <a href="https://github.com/openfga/go-sdk/releases/tag/v0.3.0-beta.1" target="_blank" rel="noopener noreferrer">Go SDK</a>, which allows using the additional parameters.</p></li><li><p>The <a href="https://github.com/openfga/cli" target="_blank" rel="noopener noreferrer">OpenFGA CLI</a> allows validating models and runing tests that use conditional tuples. You can use it to test the new features by pointing to a <code>“.fga.yaml”</code> file that <a href="https://github.com/openfga/cli#run-tests-on-an-authorization-model" target="_blank" rel="noopener noreferrer">defines the tests you want to run</a>, without having to deploy OpenFGA.</p></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="whats-next">What’s Next?<a href="#whats-next" class="hash-link" aria-label="Direct link to What’s Next?" title="Direct link to What’s Next?">​</a></h2><p>We’ll address some limitations of the current implementation:</p><ul><li>The <a href="https://openfga.dev/api/service#/Relationship%20Queries/Expand" target="_blank" rel="noopener noreferrer">Expand API</a> does not consider conditions.</li><li>The Visual Studio Code integration is not validating the expressions in conditions. </li><li>The Playground does not let you add context for tuples and assertions. You should use the VS Code Extension + the FGA CLI to test your models for now.</li></ul><p>We'll also improve ListObjects scenarios when it's called with missing context. For example, consider the following model that enables access only to documents with a specific status:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_access</span><span class="token plain">: </span><span class="token directly-assignable">[user with docs_in_draft_status]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">condition</span><span class="token plain"> </span><span class="token condition">docs_in_draft_status</span><span class="token condition-params">(</span><span class="token condition-params condition-param">status:</span><span class="token condition-params"> </span><span class="token condition-params condition-param-type">string</span><span class="token condition-params">) {</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> status == "draft"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If you want to list all the documents a user can view, you'll need to know the status of all of those documents. Given you don't know the documents the user has access too, you can't send the status of those as a parameter to ListObjects.</p><p>Our goal is to return a structure that you can use to filter documents on your side, similar to: <code>(document.id = ‘1’ and document.status = ‘draft’) or (document.id = ‘2’ and.status = draft)</code> <br> This won’t scale to a large number of documents, but would be useful in some scenarios.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="reach-out">Reach out!<a href="#reach-out" class="hash-link" aria-label="Direct link to Reach out!" title="Direct link to Reach out!">​</a></h2><p>We want to learn how you use this feature and how we can improve it! </p><p>Please reach out to us in <a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer">Discord</a> or <a href="https://github.com/orgs/openfga/discussions" target="_blank" rel="noopener noreferrer">Github</a> with any questions or feedback.</p></div><footer class="row docusaurus-mt-lg"><div class="col"><b>Tags:</b><ul class="tags_jXut padding--none margin-left--sm"><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/openfga">openfga</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/blog/tags/features">features</a></li></ul></div></footer></article><nav class="pagination-nav" aria-label="Blog list page navigation"></nav></main></div></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/authorization-and-openfga.html b/docs/authorization-and-openfga.html index f0d4233ff..46028ac19 100644 --- a/docs/authorization-and-openfga.html +++ b/docs/authorization-and-openfga.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">What is OpenFGA</span><meta itemprop="position" content="1"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Introduction to Authorization and <!-- -->OpenFGA</h1><p>This section explains <a href="#authentication-vs-authorization">authorization</a>, <a href="#what-is-fine-grained-authorization-fga">fine-grained authorization</a>, <a href="#what-are-role-based-access-control-rbac-and-attribute-based-access-control-abac">RBAC</a>, <a href="#what-are-role-based-access-control-rbac-and-attribute-based-access-control-abac">ABAC</a>, <a href="#what-is-relationship-based-access-control-rebac">ReBAC</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-openfga">What Is OpenFGA?<a href="#what-is-openfga" class="hash-link" aria-label="Direct link to What Is OpenFGA?" title="Direct link to What Is OpenFGA?">​</a></h2><p><strong>OpenFGA</strong> is an open source solution to <a href="#what-is-fine-grained-authorization-fga">Fine-Grained Authorization</a> that applies the concept of <a href="#what-is-relationship-based-access-control-rebac">ReBAC</a>. It was created by the <a href="https://docs.fga.dev/" target="_blank" rel="noopener noreferrer">Okta FGA</a> team and was inspired by <a href="#what-is-zanzibar">Zanzibar</a>. It was designed for reliability and low latency at a high scale. It offers an HTTP API and has SDKs for programming languages including <a href="https://www.npmjs.com/package/@openfga/sdk" target="_blank" rel="noopener noreferrer">Node.js/JavaScript</a>, <a href="https://github.com/openfga/go-sdk" target="_blank" rel="noopener noreferrer">GoLang</a>, <a href="https://www.nuget.org/packages/OpenFga.Sdk" target="_blank" rel="noopener noreferrer">.NET</a> and <a href="https://pypi.org/project/openfga-sdk" target="_blank" rel="noopener noreferrer">Python</a>. More SDKs and integrations such as Rego are planned for the future.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="authentication-vs-authorization">Authentication vs Authorization<a href="#authentication-vs-authorization" class="hash-link" aria-label="Direct link to Authentication vs Authorization" title="Direct link to Authentication vs Authorization">​</a></h2><p><a href="https://auth0.com/intro-to-iam/what-is-authentication/" target="_blank" rel="noopener noreferrer"><strong>Authentication</strong></a> (or AuthN) is a process that ensures a user's identity. <a href="https://en.wikipedia.org/wiki/Authorization" target="_blank" rel="noopener noreferrer"><strong>Authorization</strong></a> (or AuthZ) means determining if a user can perform a certain action on a particular resource.</p><p>For example, when logging in to Twitter, the process in which Twitter verifies the user's username and password are correct is Authentication. The process of checking if that user can view or reply to a certain Tweet is Authorization.</p><p><a href="https://www.okta.com/identity-101/authentication-vs-authorization/" target="_blank" rel="noopener noreferrer">Read more about AuthN vs AuthZ</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-fine-grained-authorization-fga">What Is Fine-Grained Authorization (FGA)?<a href="#what-is-fine-grained-authorization-fga" class="hash-link" aria-label="Direct link to What Is Fine-Grained Authorization (FGA)?" title="Direct link to What Is Fine-Grained Authorization (FGA)?">​</a></h2><p><strong>Fine-Grained Authorization</strong> is being able to grant individual users access to specific objects or resources in a system. FGA at scale means being able to do so in a system that can have millions of objects, users and relations, and has a high change rate - objects are regularly added and access permissions are constantly being updated. A good example of this is Google Drive, where access can be granted either to documents, or folders; it can be granted to users individually or as a group. Access regularly changes as new documents are created and shared with specific users, whether inside the same company or outside.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-are-role-based-access-control-rbac-and-attribute-based-access-control-abac">What Are Role-Based Access Control (RBAC) And Attribute-Based Access Control (ABAC)?<a href="#what-are-role-based-access-control-rbac-and-attribute-based-access-control-abac" class="hash-link" aria-label="Direct link to What Are Role-Based Access Control (RBAC) And Attribute-Based Access Control (ABAC)?" title="Direct link to What Are Role-Based Access Control (RBAC) And Attribute-Based Access Control (ABAC)?">​</a></h2><p>In <a href="https://en.wikipedia.org/wiki/Role-based_access_control" target="_blank" rel="noopener noreferrer"><strong>Role-Based Access Control</strong></a>, permissions are assigned to users based on their role in a system (e.g. a user would need an <code>editor</code> role to edit posts).</p><p>In <a href="https://en.wikipedia.org/wiki/Attribute-based_access_control" target="_blank" rel="noopener noreferrer"><strong>Attribute-Based Access Control</strong></a>, instead of permissions being granted based on roles, they are granted based on a set of attributes on a user or resource (e.g. if a user has both <code>marketing</code> and <code>manager</code> attributes they can publish and delete posts that have a <code>marketing</code> attribute, but not others).</p><p>If you are interested you can read more about <a href="https://auth0.com/docs/manage-users/access-control/rbac" target="_blank" rel="noopener noreferrer">RBAC</a> and <a href="https://www.okta.com/blog/2020/09/attribute-based-access-control-abac/" target="_blank" rel="noopener noreferrer">ABAC</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-relationship-based-access-control-rebac">What Is Relationship Based Access Control (ReBAC)?<a href="#what-is-relationship-based-access-control-rebac" class="hash-link" aria-label="Direct link to What Is Relationship Based Access Control (ReBAC)?" title="Direct link to What Is Relationship Based Access Control (ReBAC)?">​</a></h2><p><strong>ReBAC</strong> allows expressing rules based on relations that users have with objects and that objects have with other objects. For example, a user can view a document if they can view its parent folder.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-zanzibar">What Is Zanzibar?<a href="#what-is-zanzibar" class="hash-link" aria-label="Direct link to What Is Zanzibar?" title="Direct link to What Is Zanzibar?">​</a></h2><p><strong><a href="https://research.google/pubs/pub48190/" target="_blank" rel="noopener noreferrer">Zanzibar</a></strong> is "Google's Consistent, Global Authorization System" for "determining whether online users are authorized to access digital objects" across their products (Google Drive, YouTube, Google Photos, etc..). It uses (object, relation, user) tuples to store relation data and traverses those relations to check if there is a relation between a user and an object.</p><p>Learn more about Zanzibar at the <a href="https://zanzibar.academy" target="_blank" rel="noopener noreferrer">Zanzibar Academy</a>.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/authorization-and-openfga.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--next" href="/docs/concepts"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Concepts</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#what-is-openfga" class="table-of-contents__link toc-highlight">What Is OpenFGA?</a></li><li><a href="#authentication-vs-authorization" class="table-of-contents__link toc-highlight">Authentication vs Authorization</a></li><li><a href="#what-is-fine-grained-authorization-fga" class="table-of-contents__link toc-highlight">What Is Fine-Grained Authorization (FGA)?</a></li><li><a href="#what-are-role-based-access-control-rbac-and-attribute-based-access-control-abac" class="table-of-contents__link toc-highlight">What Are Role-Based Access Control (RBAC) And Attribute-Based Access Control (ABAC)?</a></li><li><a href="#what-is-relationship-based-access-control-rebac" class="table-of-contents__link toc-highlight">What Is Relationship Based Access Control (ReBAC)?</a></li><li><a href="#what-is-zanzibar" class="table-of-contents__link toc-highlight">What Is Zanzibar?</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/concepts.html b/docs/concepts.html index 636296202..182ee5488 100644 --- a/docs/concepts.html +++ b/docs/concepts.html @@ -15,8 +15,8 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> @@ -24,7 +24,7 @@ Relationship tuple writes with user type that is not allowed for the <code>viewer</code> relation on objects of type <code>document</code>, for example <code>workspace:auth0</code> or <code>folder:planning#editor</code> will be rejected, so writing <code>{"user": "folder:product","relation":"viewer","object":"document:roadmap"}</code> will fail. This will affect only relations that are <a href="#what-are-direct-and-implied-relationships">directly related</a> and have <a href="/docs/configuration-language#the-direct-relationship-type-restrictions">the direct relationship type restrictions</a> in their relation definition.</p></div></div></details><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-a-relationship-tuple">What Is A Relationship Tuple?<a href="#what-is-a-relationship-tuple" class="hash-link" aria-label="Direct link to What Is A Relationship Tuple?" title="Direct link to What Is A Relationship Tuple?">​</a></h2><p>A <strong>relationship tuple</strong> is a tuple consisting of a user, relation and object stored in <!-- -->OpenFGA<!-- -->.</p></summary><div><div class="collapsibleContent_i85q"><p>A <strong>relationship tuple</strong> consists of a:</p><ul><li><strong><a href="#what-is-a-user">user</a></strong>, e.g. <code>user:anne</code>, <code>user:3f7768e0-4fa7-4e93-8417-4da68ce1846c</code>, <code>workspace:auth0</code> or <code>folder:planning#editor</code></li><li><strong><a href="#what-is-a-relation">relation</a></strong>, e.g. <code>editor</code>, <code>member</code> or <code>parent_workspace</code></li><li><strong><a href="#what-is-an-object">object</a></strong>, e.g <code>repo:auth0/express_jwt</code>, <code>domain:auth0.com</code> or <code>channel:marketing</code></li></ul><p>An <a href="#what-is-an-authorization-model">authorization model</a>, together with <em>relationship tuples</em>, allow the determination of whether a <a href="#what-is-a-relationship">relationship</a> exists between a <a href="#what-is-a-user">user</a> and an <a href="#what-is-an-object">object</a>.</p><p>Throughout the documentation, you will encounter relationship tuples represented as:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>For more information, please see <a href="/docs/modeling/direct-access">Direct Access</a>.</p></div></div></details><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-a-relationship">What Is A Relationship?<a href="#what-is-a-relationship" class="hash-link" aria-label="Direct link to What Is A Relationship?" title="Direct link to What Is A Relationship?">​</a></h2><p>A <strong>relationship</strong> is the realization of a relation between a user and an object.</p></summary><div><div class="collapsibleContent_i85q"><p>An <a href="#what-is-an-authorization-model">authorization model</a>, together with <a href="#what-is-a-relationship-tuple">relationship tuples</a>, allow the determination of whether a <em>relationship</em> exists between a user and an object. Relationships may be classified as <a href="#what-are-direct-and-implied-relationships"><em>direct</em></a> or <a href="#what-are-direct-and-implied-relationships"><em>implied</em></a>.</p></div></div></details><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-are-direct-and-implied-relationships">What Are Direct And Implied Relationships?<a href="#what-are-direct-and-implied-relationships" class="hash-link" aria-label="Direct link to What Are Direct And Implied Relationships?" title="Direct link to What Are Direct And Implied Relationships?">​</a></h2><p>A <strong>direct relationship</strong> R between user X and object Y means the relationship tuple (user=X, relation=R, object=Y) exists, and the <!-- -->OpenFGA<!-- --> authorization model for that relation allows this direct relationship (by use of <a href="/docs/configuration-language#the-direct-relationship-type-restrictions">direct relationship type restrictions</a>).</p><p>An <strong>implied (or computed) relationship</strong> R exists between user X and object Y if user X is related to an object Z that is in a direct or implied relationship with object Y, and the <!-- -->OpenFGA<!-- --> authorization model allows it.</p></summary><div><div class="collapsibleContent_i85q"><ul><li><p><code>user:anne</code> has a <strong>direct relationship</strong> with <code>document:new-roadmap</code> as <code>viewer</code> if the <a href="#what-is-a-type-definition">type definition</a> allows it (allows <a href="/docs/configuration-language#the-direct-relationship-type-restrictions"><code>direct relationship type restrictions</code></a>), and one of the following <a href="#what-is-a-relationship-tuple">relationship tuples</a> exist:</p><ul><li><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne of type user is directly related to the document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Everyone (`*`) of type user is directly related to the document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The userset is directly related to this document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// AND Anne of type user is a member of a userset (e.g. team:product#member)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ul></li><li><p><code>user:anne</code> has an <strong>implied relationship</strong> with <code>document:new-roadmap</code> as <code>viewer</code> if the type definition allows it, and the presence of relationship tuples satisfying the relationship exist.</p><p>For example, assuming the following type definition:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>And assuming the following relationship tuple exists in the system:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>In this case, the <a href="#what-is-a-relationship">relationship</a> between <code>user:anne</code> and <code>document:new-roadmap</code> as a <code>viewer</code> is implied from the direct <code>editor</code> relationship <code>user:anne</code> has with that same document. Thus, the following request to <a href="#what-is-a-check-request">check</a> whether a viewer relationship exists between <code>user:anne</code> and <code>document:new-roadmap</code> will return <code>true</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:new-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne viewer document:new-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"viewer","object":"document:new-roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:new-roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></li></ul></div></div></details><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-a-check-request">What Is A Check Request?<a href="#what-is-a-check-request" class="hash-link" aria-label="Direct link to What Is A Check Request?" title="Direct link to What Is A Check Request?">​</a></h2><p>A <strong>check request</strong> is a call to the <!-- -->OpenFGA<!-- --> check endpoint that returns whether the user has a certain relationship with an object.</p></summary><div><div class="collapsibleContent_i85q"><p>This can be done using the <code>check</code> methods in the <!-- -->OpenFGA<!-- --> SDKs (<a href="https://www.npmjs.com/package/@openfga/sdk" target="_blank" rel="noopener noreferrer">JavaScript SDK</a>/<a href="https://github.com/openfga/go-sdk" target="_blank" rel="noopener noreferrer">Go SDK</a>/<a href="https://www.nuget.org/packages/OpenFga.Sdk" target="_blank" rel="noopener noreferrer">.NET SDK</a>), by manually calling the <a href="/api/service#Relationship%20Queries/Check">check endpoint</a> using curl, or in your code.</p><p>The check endpoint responds with <code>{ "allowed": true }</code> if a relationship exists, and with <code>{ "allowed": false }</code> if the relationship does not.</p><p>For example, the following will check whether <code>anne</code> of type user has a <code>viewer</code> relation to <code>document:new-roadmap</code>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:new-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne viewer document:new-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"viewer","object":"document:new-roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:new-roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>For more information, please see the <a href="/docs/interacting/relationship-queries">Relationship Queries page</a> and the official <a href="/api/service#Relationship%20Queries/Check">Check API Reference</a>.</p></div></div></details><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-a-list-objects-request">What Is A List Objects Request?<a href="#what-is-a-list-objects-request" class="hash-link" aria-label="Direct link to What Is A List Objects Request?" title="Direct link to What Is A List Objects Request?">​</a></h2><p>A <strong>list objects request</strong> is a call to the <!-- -->OpenFGA<!-- --> list objects endpoint that returns all the objects of a given type that a user has a specified relationship with.</p></summary><div><div class="collapsibleContent_i85q"><p>This can be done using the <code>listobjects</code> methods in the <!-- -->OpenFGA<!-- --> SDKs (<a href="https://www.npmjs.com/package/@openfga/sdk" target="_blank" rel="noopener noreferrer">JavaScript SDK</a>/<a href="https://github.com/openfga/go-sdk" target="_blank" rel="noopener noreferrer">Go SDK</a>/<a href="https://www.nuget.org/packages/OpenFga.Sdk" target="_blank" rel="noopener noreferrer">.NET SDK</a>), by manually calling the <a href="/api/service#Relationship%20Queries/ListObjects">list objects endpoint</a> using curl, or in your code.</p><p>The list objects endpoint responds with a list of objects for a given type that the user has the specified relationship with.</p><p>For example, the following will return all the objects with document type for which <code>anne</code> of type user has a <code>viewer</code> relation with:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">listObjects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">type</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.objects = ["document:otherdoc", "document:planning"]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientListObjectsOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientListObjectsRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Type</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ListObjects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "objects": ["document:otherdoc", "document:planning"] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Type </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ListObjects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Objects = ["document:otherdoc", "document:planning"]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientListObjectsRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">type</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">list_objects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.objects = ["document:otherdoc", "document:planning"]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query list-objects --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne viewer document</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"objects": ["document:otherdoc", "document:planning"]}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/list-objects </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{ "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw",</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> "type": "document",</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> "relation": "viewer",</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> "user":"user:anne"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"objects": ["document:otherdoc", "document:planning"]}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">listObjects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // list the objects that the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token plain">, // and that are of </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">type</span><span class="token plain"> </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain">, // </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">for</span><span class="token plain"> this particular authorization model </span><span class="token function" style="color:rgb(80, 250, 123)">id</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token string" style="color:rgb(255, 121, 198)">"document:otherdoc"</span><span class="token plain">, </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>For more information, please see the <a href="/docs/interacting/relationship-queries">Relationship Queries page</a> and the official <a href="/api/service#Relationship%20Queries/ListObjects">Check API Reference</a>.</p></div></div></details><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-are-contextual-tuples">What Are Contextual Tuples?<a href="#what-are-contextual-tuples" class="hash-link" aria-label="Direct link to What Are Contextual Tuples?" title="Direct link to What Are Contextual Tuples?">​</a></h2><p>Contextual tuples are tuples that can be added to a check request, and only exist within the context of that particular request.</p></summary><div><div class="collapsibleContent_i85q"><p>Similar to <a href="#what-is-a-relationship-tuple">relationship tuples</a>, contextual tuples are composed of a user, relation and object.</p><p>Unlike relationship tuples, they are not written to the store. However, if contextual tuples are sent alongside a check request, in the context of this particular check request, they are treated if they had been written in the store.</p><p>For more information, please see <a href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a>, <a href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a> and <a href="/api/service#Relationship%20Queries/Check">Check API Request Documentation</a>.</p></div></div></details><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-type-bound-public-access">What Is Type Bound Public Access?<a href="#what-is-type-bound-public-access" class="hash-link" aria-label="Direct link to What Is Type Bound Public Access?" title="Direct link to What Is Type Bound Public Access?">​</a></h2><p>In <!-- -->OpenFGA<!-- -->, type bound public access (represented by <code><type>:*</code>) is a special <!-- -->OpenFGA<!-- --> syntax meaning <strong>every object of that type</strong> when used as a <em>user</em> within a <em>relationship tuple</em>. For example, <code>user:*</code> represents every object of type <code>user</code> (including those not currently present in the system).</p></summary><div><div class="collapsibleContent_i85q"><p>For example, in a case where you would like to indicate a certain document <code>document:new-roadmap</code> is publicly writable (i.e. has everyone of type user as an editor), you can add the following <a href="#what-is-a-relationship-tuple">relationship tuple</a>:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Note that you cannot use <code><type>:*</code> in the <code>relation</code> or <code>object</code> properties. In addition, you cannot use <code><type>:*</code> as part of a userset in the tuple's user field. For more information, please see <a href="/docs/modeling/public-access">Modeling Public Access</a> and <a href="/docs/modeling/advanced/gdrive">Advanced Modeling: Modeling Google Drive</a>.</p></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how object-to-object relationships can be used.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA Concepts</span><p class="documentation-card-box-description_u7_j">Learn about the OpenFGA Concepts</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/configuration-language">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Direct access</span><p class="documentation-card-box-description_u7_j">Get started with modeling your permission system in OpenFGA</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/direct-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/concepts.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/authorization-and-openfga"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Authorization and OpenFGA</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/configuration-language"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Configuration Language</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#what-is-a-type" class="table-of-contents__link toc-highlight">What Is A Type?</a></li><li><a href="#what-is-a-type-definition" class="table-of-contents__link toc-highlight">What Is A Type Definition?</a></li><li><a href="#what-is-an-authorization-model" class="table-of-contents__link toc-highlight">What Is An Authorization Model?</a></li><li><a href="#what-is-a-store" class="table-of-contents__link toc-highlight">What Is A Store?</a></li><li><a href="#what-is-an-object" class="table-of-contents__link toc-highlight">What Is An Object?</a></li><li><a href="#what-is-a-user" class="table-of-contents__link toc-highlight">What Is A User?</a></li><li><a href="#what-is-a-relation" class="table-of-contents__link toc-highlight">What Is A Relation?</a></li><li><a href="#what-is-a-relation-definition" class="table-of-contents__link toc-highlight">What Is A Relation Definition?</a></li><li><a href="#what-is-a-directly-related-user-type" class="table-of-contents__link toc-highlight">What Is A Directly Related User Type?</a></li><li><a href="#what-is-a-relationship-tuple" class="table-of-contents__link toc-highlight">What Is A Relationship Tuple?</a></li><li><a href="#what-is-a-relationship" class="table-of-contents__link toc-highlight">What Is A Relationship?</a></li><li><a href="#what-are-direct-and-implied-relationships" class="table-of-contents__link toc-highlight">What Are Direct And Implied Relationships?</a></li><li><a href="#what-is-a-check-request" class="table-of-contents__link toc-highlight">What Is A Check Request?</a></li><li><a href="#what-is-a-list-objects-request" class="table-of-contents__link toc-highlight">What Is A List Objects Request?</a></li><li><a href="#what-are-contextual-tuples" class="table-of-contents__link toc-highlight">What Are Contextual Tuples?</a></li><li><a href="#what-is-type-bound-public-access" class="table-of-contents__link toc-highlight">What Is Type Bound Public Access?</a></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/configuration-language.html b/docs/configuration-language.html index c3ab5bd81..73ef2de3f 100644 --- a/docs/configuration-language.html +++ b/docs/configuration-language.html @@ -15,14 +15,14 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Configuration Language</span><meta itemprop="position" content="1"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Configuration Language</h1><p>The <!-- -->OpenFGA<!-- -->'s Configuration Language is used to build a representation of a system's <em><a href="/docs/concepts#what-is-an-authorization-model">authorization model</a></em>. It informs <a href="/api/service">OpenFGA's API</a> on what the <a href="/docs/concepts#what-is-a-type">object types</a> in the system are and how they could relate to one another. It describes the <a href="/docs/concepts#what-is-a-relation">relations</a> possible on an object of a certain type and lists the conditions under which one is related to that object.</p><p>The <strong>DSL</strong> and the <strong>JSON</strong> syntax are two presentations of that configuration language. The JSON syntax is accepted by the API and closely matches the API described in the <a href="https://research.google/pubs/pub48190/" target="_blank" rel="noopener noreferrer">Zanzibar paper</a>. The DSL is syntactic sugar on top of the JSON syntax and compiles down to it before being sent to <!-- -->OpenFGA<!-- -->'s API. The DSL is meant to make modeling easier and more intuitive.</p><p>You'll encounter the JSON syntax when calling the API directly or through the <a href="/docs/getting-started">SDKs</a>, and the DSL when interacting with <!-- -->OpenFGA<!-- --> through the <a href="https://play.fga.dev/" target="_blank" rel="noopener noreferrer">Playground</a>. Throughout the documentation you can switch between the two presentations.</p><p>To understand this guide better, you should be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and <a href="/docs/modeling/getting-started">How to get started on modeling</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-does-the-configuration-language-look-like">What Does The Configuration Language Look Like?<a href="#what-does-the-configuration-language-look-like" class="hash-link" aria-label="Direct link to What Does The Configuration Language Look Like?" title="Direct link to What Does The Configuration Language Look Like?">​</a></h2><p>Below is a sample authorization model. In the next sections we'll go over the building blocks that make the <!-- -->OpenFGA<!-- --> configuration language.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">domain</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_share</span><span class="token plain">: writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent_folder</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent_folder</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent_folder</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent_folder</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_share</span><span class="token plain">: writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent_folder</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent_folder</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent_folder</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent_folder</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_share"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent_folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent_folder"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent_folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent_folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent_folder"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_share"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent_folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent_folder"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent_folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent_folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent_folder"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>The <em>authorization model</em> describes four <em><a href="/docs/concepts#what-is-a-type">types</a></em> of objects: <code>user</code>, <code>domain</code>, <code>folder</code> and <code>document</code>.</p><p>The <code>domain</code> <em><a href="/docs/concepts#what-is-a-type-definition">type definition</a></em> has a single <em><a href="/docs/concepts#what-is-a-relation">relation</a></em> called <code>member</code> that only allows <a href="/docs/concepts#what-are-direct-and-implied-relationships">direct relationships</a>.</p><p>The <code>folder</code> and <code>document</code> <em>type definitions</em> each have five <em>relations</em>: <code>parent_folder</code>, <code>owner</code>, <code>writer</code>, <code>viewer</code> and <code>can_share</code>.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="the-direct-relationship-type-restrictions">The Direct Relationship Type Restrictions<a href="#the-direct-relationship-type-restrictions" class="hash-link" aria-label="Direct link to The Direct Relationship Type Restrictions" title="Direct link to The Direct Relationship Type Restrictions">​</a></h3><p><code>[<string, <string>, ...]</code>, when used at the beginning of a <a href="/docs/concepts#what-is-a-relation-definition">relation definition</a> allows <a href="/docs/concepts#what-are-direct-and-implied-relationships">direct relationships</a> from the objects of these specified types. The strings can be of three formats:</p><ul><li><code><type></code>: indicating that tuples relating objects of those types as users can be written (e.g. <code>group:marketing</code> can be related if <code>group</code> is in the type restrictions)</li><li><code><type:*></code>: indicating that a tuple relating all objects of that type can be written (e.g. <code>user:*</code> can be added if <code>user:*</code> is in the type restrictions)</li><li><code><type>#<relation></code>: indicating that tuples with sets of users that are related to an object of that type by that particular relation (e.g. <code>group:marketing#member</code> can be added if <code>group#member</code> is in the type restrictions)</li></ul><p>If the direct relationship type restrictions are missing, then no tuple can be written relating other objects as this particular relation with objects of this type (direct relationships are disallowed).</p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p><code>[<type1>, <type2>, ...]</code> in the <!-- -->OpenFGA<!-- --> DSL translates to <code>this</code> in the <!-- -->OpenFGA<!-- --> API syntax.</p></div></div><p>For example, let's take a closer look at the <code>team</code> type.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user, user:*, team#member]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>This <code>team</code> <em><a href="/docs/concepts#what-is-a-type-definition">type definition</a></em> defines all the <em><a href="/docs/concepts#what-is-a-relation">relations</a></em> that <em><a href="/docs/concepts#what-is-a-user">users</a></em> can have with an <em><a href="/docs/concepts#what-is-an-object">object</a></em> of <em>type</em> <code>team</code>. In this case the <em>relation</em> is: <code>member</code>.</p><p>Due to the direct relationship type restrictions (<code>[user, team#member]</code>) being used, a user in the system can have a <strong><a href="/docs/concepts#what-are-direct-and-implied-relationships">direct relationship</a></strong> with the <code>team</code> type as a <code>member</code> for objects of </p><ul><li>type <code>user</code></li><li>the <code>user</code> <a href="/docs/concepts#what-is-type-bound-public-access">type bound public access</a> (<code>user:*</code>)</li><li><a href="/docs/modeling/building-blocks/usersets">usersets</a> that have a <code>team</code> type and a <code>member</code> relation (e.g. <code>team:product#member</code>)</li></ul><p>In the type definition snippet above, <code>anne</code> is a <code>member</code> of <code>team:product</code> if <em>any one of</em> the following relationship tuple sets exist:</p><ul><li><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is directly related to the product team as a member</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Everyone (`*`) is directly related to the product team as a member</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Members of the contoso team are members of the product team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is a member of the contoso team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ul><p>For more examples, take look at <a href="/docs/modeling/building-blocks/direct-relationships">Modeling Building Blocks: Direct Relationships</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="referencing-other-relations-on-the-same-object">Referencing Other Relations On The Same Object<a href="#referencing-other-relations-on-the-same-object" class="hash-link" aria-label="Direct link to Referencing Other Relations On The Same Object" title="Direct link to Referencing Other Relations On The Same Object">​</a></h3><p>You can also reference other relations on the same object. Let us look at a simplified <code>document</code> <em>type definition</em>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_rename</span><span class="token plain">: editor</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_rename"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The above <code>document</code> <em><a href="/docs/concepts#what-is-a-type-definition">type definition</a></em> defines all the <em><a href="/docs/concepts#what-is-a-relation">relations</a></em> that <em><a href="/docs/concepts#what-is-a-user">users</a></em> can have with an <em><a href="/docs/concepts#what-is-an-object">object</a></em> of <em>type</em> <code>document</code>. In this case the <em>relations</em> are: <code>editor</code>, <code>viewer</code> and <code>can_rename</code>.</p><p>The <code>viewer</code> and <code>can_rename</code> <em>relation definitions</em> are both referencing <code>editor</code>, which is another relation on the same type.</p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Notice how <code>can_rename</code> does not reference the <a href="#the-direct-relationship-type-restrictions"><em>direct relationship type restrictions</em></a>, indicating that a direct relationship is not possible (as in a user cannot be directly assigned this relation, it has to be inherited through an assignment of the <code>editor</code> relation). The <code>viewer</code> relation on the other hand allows both <em>direct and indirect relationships</em> using the <a href="#the-union-operator">Union Operator</a>.</p></div></div><p>In the <em>type definition</em> snippet above, <code>anne</code> is a <code>viewer</code> of <code>document:new-roadmap</code> if any one of the following relationship tuple sets exists:</p><ul><li><p><em>anne</em> is an <em>editor</em> of <em>document:new-roadmap</em></p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is an editor of the new-roadmap document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><p><em>anne</em> is a <em>viewer</em> of <em>document:new-roadmap</em></p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is a viewer of the new-roadmap document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ul><p><code>anne</code> has a <code>can_rename</code> relationship with <code>document:new-roadmap</code> only if <code>anne</code> has an <code>editor</code> relationship with the document:</p><ul><li><em>anne</em> is an <em>editor</em> of <em>document:new-roadmap</em><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is an editor of thew new-roadmap document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ul><p>For more examples, take a look at <a href="/docs/modeling/building-blocks/concentric-relationships">Modeling Building Blocks: Concentric Relationships</a>, <a href="/docs/modeling/roles-and-permissions">Modeling: Roles and Permissions</a> and <a href="/docs/modeling/advanced/gdrive">Advanced Modeling: Google Drive</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="referencing-relations-on-related-objects">Referencing Relations On Related Objects<a href="#referencing-relations-on-related-objects" class="hash-link" aria-label="Direct link to Referencing Relations On Related Objects" title="Direct link to Referencing Relations On Related Objects">​</a></h3><p>Another form of <em><a href="/docs/concepts#what-are-direct-and-implied-relationships">indirect relationships</a></em> is made possible by referencing relations on other objects.</p><p>The syntax is <code>X from Y</code>. It requires that:</p><ul><li>the other object is related to the current object as <code>Y</code></li><li>the <em>user</em> is related to another object as <code>X</code></li></ul><p>Take a look at the <em>authorization model</em> below.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, folder#viewer]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent_folder</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent_folder</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent_folder"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent_folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent_folder"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The snippet below taken from the authorization model above is stating that viewers of a document are all users directly assigned the viewer relation and all users who can view the document's parent folder.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent_folder</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent_folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>In the <em>authorization model</em> above, <code>user:anne</code> is a <code>viewer</code> of <code>document:new-roadmap</code> if any one of the following relationship tuple sets exists:</p><ul><li>Anne is a viewer of the parent folder of the new-roadmap document<div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// planning folder is the parent folder of the new-roadmap document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent_folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// anne is a viewer of the planning folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li>Anne is a viewer of the new-roadmap document (direct relationship)<div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// anne is a viewer of the new-roadmap document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ul><p>This particular use of referencing relations on related objects is defining a transitive implied relationship. If <strong>user A</strong> is related to a certain <strong>object B</strong> as a <strong>viewer</strong>, and <strong>object B</strong> is related to <strong>object C</strong> as <strong>parent</strong>, then <strong>user A</strong> is related to <strong>object C</strong> as <strong>viewer</strong>.</p><p>This can be used to indicate that <strong>viewers</strong> of a <strong>folders</strong> are <strong>viewers</strong> of all <strong>documents</strong> in that <strong>folder</strong>.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p>Note that <!-- -->OpenFGA<!-- --> does not allow the referenced relation (the word after <code>from</code>, also called the tupleset) to be referencing another relation or allow non-concrete types (type bound public access (<code><object_type>:*</code>) or usersets (<code><object_type>#<relation></code>)) in its type restrictions and will throw a validation error when attempting to call <code>WriteAuthorizationModel</code>.</p><p>Note: In the <a href="/docs/modeling/migrating/migrating-schema-1-1">deprecated 1.0 schema version</a>, the validation error will be thrown at the time of evaluation (<code>Check</code>, etc..).</p></div></div><p>For more examples, take look at <a href="/docs/modeling/parent-child">Modeling: Parent-Child Objects</a>, <a href="/docs/modeling/advanced/gdrive">Advanced Modeling: Google Drive</a>, <a href="/docs/modeling/advanced/github">Advanced Modeling: GitHub</a>, and <a href="/docs/modeling/advanced/entitlements">Advanced Modeling: Entitlements</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="the-union-operator">The Union Operator<a href="#the-union-operator" class="hash-link" aria-label="Direct link to The Union Operator" title="Direct link to The Union Operator">​</a></h3><p>The <em>union operator</em> (<code>or</code> in the DSL, <code>union</code> in the JSON syntax) is used to indicate that a <a href="/docs/concepts#what-is-a-relationship">relationship</a> exists if the <a href="/docs/concepts#what-is-a-user">user</a> is in <strong>any of the sets of users</strong> (<code>union</code>).</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>In the <a href="/docs/concepts#what-is-a-type-definition">type definition</a> snippet above, <code>user:anne</code> is a <code>viewer</code> of <code>document:new-roadmap</code> if <em>any of</em> the following conditions are satisfied:</p><ul><li>there exists a <a href="/docs/concepts#what-are-direct-and-implied-relationships">direct relationship</a> with <em>anne</em> as <em>editor</em> of <em>document:new-roadmap</em><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li><li><em>anne</em> is a <em>viewer</em> of <em>document:new-roadmap</em><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ul><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>The above <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a> indicates that a user is related as a viewer if they are in <strong>any of</strong>:</p><ul><li>the userset of all users related to the object as "viewer"; indicating that a user can be assigned a direct <code>viewer</code> relation</li><li>the userset of all users related to the object as "editor"; indicating that a user who is an editor is also implicitly a viewer</li></ul><p>So if <strong>anne</strong> is in at least one of those usersets (is either an <strong>editor</strong> or a <strong>viewer</strong>), the <a href="/docs/concepts#what-is-a-check-request">check</a> on <code>{"user": "user:anne", "relation": "viewer", "object": "document:new-roadmap"}</code> will return <code>{"allowed": true}</code>.</p></div></div><p>For more examples, take a look at <a href="/docs/modeling/building-blocks/concentric-relationships">Modeling Building Blocks: Concentric Relationships</a>, <a href="/docs/modeling/roles-and-permissions">Modeling Roles and Permissions</a> and <a href="/docs/modeling/advanced/iot#03-updating-our-authorization-model-to-facilitate-future-changes">Advanced Modeling: Modeling for IoT</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="the-intersection-operator">The Intersection Operator<a href="#the-intersection-operator" class="hash-link" aria-label="Direct link to The Intersection Operator" title="Direct link to The Intersection Operator">​</a></h3><p>The <em>intersection operator</em> (<code>and</code> in the DSL, <code>intersection</code> in the JSON syntax) is used to indicate that a <a href="/docs/concepts#what-is-a-relationship">relationship</a> exists if the <a href="/docs/concepts#what-is-a-user">user</a> is in <strong>all the sets of users</strong> (<code>intersection</code>)</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: authorized_user </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">and</span><span class="token plain"> editor</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"intersection"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorized_user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>In the <a href="/docs/concepts#what-is-a-type-definition">type definition</a> snippet above, <code>user:anne</code> is a <code>viewer</code> of <code>document:new-roadmap</code> if <strong>all of</strong> the following conditions are satisfied:</p><ul><li><em>anne</em> is an <em>editor</em> of <em>document:new-roadmap</em><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>AND</li><li><em>anne</em> is an <em>authorized_user</em> of <em>document:new-roadmap</em>:<div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorized_user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ul><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>The above <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a> indicates that a user is related as a viewer if they are in <strong>all of</strong>:</p><ul><li>the userset of all users related to the object as "authorized_user"</li><li>the userset of all users related to the object as "editor"</li></ul><p>So <strong>anne</strong> has to be in the intersection of the usersets (<strong>anne</strong> has to be both an <strong>editor</strong> AND an <strong>authorized_user</strong>), in order for the <a href="/docs/concepts#what-is-a-check-request">check</a> on <code>{"user": "user:anne", "relation": "viewer", "object": "document:new-roadmap"}</code> to return <code>{"allowed": true}</code>.</p><p><em>anne</em> is <strong>not</strong> a <em>viewer</em> for <em>document:new-roadmap</em> if either of the following is true:</p><ul><li><em>anne</em> is not an <em>editor</em> to <em>document:new-roadmap</em>: <strong>no relationship tuple of</strong> <code>{"user": "user:anne", "relation": "editor", "object": "document:new-roadmap"}</code></li><li><em>anne</em> is not an <em>authorized_user</em> on the <em>document:new-roadmap</em>: <strong>no relationship tuple of</strong> <code>{"user": "user:anne", "relation": "authorized_user", "object": "document:new-roadmap"}</code></li></ul></div></div><p>For more examples, take look at <a href="/docs/modeling/multiple-restrictions">Modeling with Multiple Restrictions</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="the-exclusion-operator">The Exclusion Operator<a href="#the-exclusion-operator" class="hash-link" aria-label="Direct link to The Exclusion Operator" title="Direct link to The Exclusion Operator">​</a></h3><p>The <em>exclusion operator</em> (<code>but not</code> in the DSL, <code>difference</code> in the JSON syntax) is used to indicate that a <a href="/docs/concepts#what-is-a-relationship">relationship</a> exists if the <a href="/docs/concepts#what-is-a-user">user</a> is <strong>in the base userset, but not in the excluded userset</strong>. This is helpful in modeling exclusion or block lists.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">but not</span><span class="token plain"> blocked</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"difference"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"base"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subtract"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"blocked"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>In the <em>type definition</em> snippet above, <code>user:anne</code> is a <code>viewer</code> of <code>document:new-roadmap</code> if:</p><ul><li><p><em>anne</em> is assigned a direct relationship as <em>viewer</em> to <em>document:new-roadmap</em></p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>AND</li><li><p><em>anne</em> is not <em>blocked</em> to <em>document:new-roadmap</em>. That is, the following relation tuple <strong>does not exists</strong></p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"blocked"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:new-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ul><p>For more information, see <a href="/docs/modeling/blocklists">Modeling: Blocklists</a>.</p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>The above <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a> indicates that a user is related as a viewer if they are in:</p><ul><li>the userset of all users related to the object as "viewer"</li></ul><p>but not in:</p><ul><li>the userset of all users related to the object as "blocked"</li></ul><p>So <strong>anne</strong> has to be both a <strong>viewer</strong> AND NOT <strong>blocked</strong>, in order for the <a href="/docs/concepts#what-is-a-check-request">check</a> on <code>{"user": "user:anne", "relation": "viewer", "object": "document:new-roadmap"}</code> to return <code>{"allowed": true}</code>.</p><p><em>anne</em> is <strong>not</strong> a <em>viewer</em> for <em>document:new-roadmap</em> if either of the following is true:</p><ul><li><em>anne</em> is <strong>not</strong> assigned direct relationship as <em>viewer</em> to <em>document:new-roadmap</em>: <strong>no relationship tuple of</strong> <code>{"user": "user:anne", "relation": "viewer", "object": "document:new-roadmap"}</code></li><li><em>anne</em> is <em>blocked</em> on the <em>document:new-roadmap</em> <code>{"user": "user:anne", "relation": "blocked", "object": "document:new-roadmap"}</code></li></ul></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="equivalent-zanzibar-concepts">Equivalent Zanzibar Concepts<a href="#equivalent-zanzibar-concepts" class="hash-link" aria-label="Direct link to Equivalent Zanzibar Concepts" title="Direct link to Equivalent Zanzibar Concepts">​</a></h2><p>The JSON syntax accepted by the <!-- -->OpenFGA<!-- --> API closely mirrors the syntax represented in the Zanzibar paper, with a bit of flattening and converting keys from <code>snake_case</code> to <code>camelCase</code>.</p><table><thead><tr><th align="left">Zanzibar</th><th align="left">OpenFGA<!-- --> JSON</th><th align="left">OpenFGA<!-- --> DSL</th></tr></thead><tbody><tr><td align="left"><code>this</code></td><td align="left"><code>this</code></td><td align="left"><a href="#the-direct-relationship-type-restrictions"><code>[<type1>,<type2>]</code></a></td></tr><tr><td align="left"><code>union</code></td><td align="left"><code>union</code></td><td align="left"><code>or</code></td></tr><tr><td align="left"><code>intersection</code></td><td align="left"><code>intersection</code></td><td align="left"><code>and</code></td></tr><tr><td align="left"><code>exclusion</code></td><td align="left"><code>difference</code></td><td align="left"><code>but not</code></td></tr><tr><td align="left"><code>tuple_to_userset</code></td><td align="left"><code>tupleToUserset</code></td><td align="left"><code>x from y</code></td></tr></tbody></table><p>In the <a href="https://research.google/pubs/pub48190/" target="_blank" rel="noopener noreferrer">Zanzibar paper</a>, there's this example:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">name: "doc"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">relation { name: "owner" }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">relation {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> name: "editor"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> userset_rewrite {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> union {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> child { _this {} }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> child { computed_userset { relation: "owner" } }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}}}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">relation {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> name: "viewer"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> userset_rewrite {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> union {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> child { _this {} }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> child { computed_userset { relation: "editor" } }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> child { tuple_to_userset {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> tupleset { relation: "parent" }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> computed_userset {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object: $TUPLE_USERSET_OBJECT # parent folder</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation: "viewer" }}}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">}}}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>In the <!-- -->OpenFGA<!-- --> DSL, it would become:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">doc</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>And in the <!-- -->OpenFGA<!-- --> JSON, it would become:</p><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>We believe this syntax is easier to read/write.</p><p>So the following:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">doc</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Can be read as:</p><ul><li>The users with a viewer relationship to a certain doc are any of:<ul><li>the set of users who are <a href="/docs/concepts#what-are-direct-and-implied-relationships">directly related</a> with this doc as <code>viewer</code></li><li>the set of users who are related to this doc as <code>editor</code></li><li>the set of users who are related to any object OBJ_1 as <code>viewer</code>, where object OBJ_1 is any object related to this doc as <code>parent</code> (e.g. viewers of this doc's parent folder, where the parent folder is OBJ_1)</li></ul></li></ul><p>Learn more about Zanzibar at the <a href="https://zanzibar.academy" target="_blank" rel="noopener noreferrer">Zanzibar Academy</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to use the configuration language in modeling authorization.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA Concepts</span><p class="documentation-card-box-description_u7_j">Learn about the OpenFGA Concepts.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/concepts">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling: Getting Started</span><p class="documentation-card-box-description_u7_j">Learn about how to get started with modeling your permission system in OpenFGA.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/getting-started">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Direct Access</span><p class="documentation-card-box-description_u7_j">Learn about modeling user access to an object.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/direct-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/configuration-language.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/concepts"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Concepts</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Getting Started</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#what-does-the-configuration-language-look-like" class="table-of-contents__link toc-highlight">What Does The Configuration Language Look Like?</a><ul><li><a href="#the-direct-relationship-type-restrictions" class="table-of-contents__link toc-highlight">The Direct Relationship Type Restrictions</a></li><li><a href="#referencing-other-relations-on-the-same-object" class="table-of-contents__link toc-highlight">Referencing Other Relations On The Same Object</a></li><li><a href="#referencing-relations-on-related-objects" class="table-of-contents__link toc-highlight">Referencing Relations On Related Objects</a></li><li><a href="#the-union-operator" class="table-of-contents__link toc-highlight">The Union Operator</a></li><li><a href="#the-intersection-operator" class="table-of-contents__link toc-highlight">The Intersection Operator</a></li><li><a href="#the-exclusion-operator" class="table-of-contents__link toc-highlight">The Exclusion Operator</a></li></ul></li><li><a href="#equivalent-zanzibar-concepts" class="table-of-contents__link toc-highlight">Equivalent Zanzibar Concepts</a></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started.html b/docs/getting-started.html index 9c8858a66..e85ac092f 100644 --- a/docs/getting-started.html +++ b/docs/getting-started.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible menu__list-item-collapsible--active"><a class="menu__link menu__link--sublist menu__link--active" aria-current="page" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Getting Started</span><meta itemprop="position" content="1"></li></ul></nav><div class="theme-doc-markdown markdown"><header><h1>Getting Started</h1></header><p>The following will provide a step by step guide on how to get started with <!-- -->OpenFGA<!-- -->.</p><div style="margin-top:2rem;margin-bottom:2rem"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div style="margin-top:0.75rem"><p class="documentation-card-box-description_u7_j">This section is useful if you understand the basic concepts of OpenFGA, and want to learn how to get started.</p></div><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div><h1>Content</h1><div style="margin-top:2rem;margin-bottom:2rem"><div style="margin-top:2rem" class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Setup OpenFGA</span><p class="documentation-card-box-description_u7_j">How to setup an OpenFGA server.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/setup-openfga/overview">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Install SDK Client</span><p class="documentation-card-box-description_u7_j">Install the SDK for the language of your choice.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/install-sdk">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Create a Store</span><p class="documentation-card-box-description_u7_j">Creating an OpenFGA entity that owns an authorization model and relationship tuples.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/create-store">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Setup SDK Client for Store</span><p class="documentation-card-box-description_u7_j">Configure the SDK client for your store.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/setup-sdk-client">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Configure Authorization Model</span><p class="documentation-card-box-description_u7_j">Programmatically configure authorization model for an OpenFGA store.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/configure-model">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Update Relationship Tuples</span><p class="documentation-card-box-description_u7_j">Programmatically write authorization data to an OpenFGA store.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/update-tuples">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Perform a Check</span><p class="documentation-card-box-description_u7_j">Programmatically perform an authorization check against an OpenFGA store.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/perform-check">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Perform a List Objects Request</span><p class="documentation-card-box-description_u7_j">Programmatically perform a list objects request against an OpenFGA store.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/perform-list-objects">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Integrate Within a Framework</span><p class="documentation-card-box-description_u7_j">Integrate authorization checks with a framework.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/framework">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Immutable Authorization Models</span><p class="documentation-card-box-description_u7_j">Learn how to take advantage of the immutable properties of Authorization Models in OpenFGA.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/immutable-models">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Production Best Practices</span><p class="documentation-card-box-description_u7_j">Best Practices of Running OpenFGA in Production Environment.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/running-in-production">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Implementation Best Practices</span><p class="documentation-card-box-description_u7_j">Best Practices of Managing Tuples and Invoking OpenFGA APIs.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/tuples-api-best-practices">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/overview.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/configuration-language"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Configuration Language</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/setup-openfga/overview"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Setup OpenFGA</div></a></nav></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/configure-model.html b/docs/getting-started/configure-model.html index 5dd535a14..be9fb91ae 100644 --- a/docs/getting-started/configure-model.html +++ b/docs/getting-started/configure-model.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Configure Authorization Model</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Configure Authorization Model for a Store</h1><p>This article explains how to configure an <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a> for a <a href="/docs/concepts#what-is-a-store">store</a> in an OpenFGA server.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>, <a href="/docs/getting-started/create-store">created the store</a> and <a href="/docs/getting-started/setup-sdk-client">setup the SDK client</a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>, <a href="/docs/getting-started/create-store">created the store</a> and <a href="/docs/getting-started/setup-sdk-client">setup the SDK client</a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>, <a href="/docs/getting-started/create-store">created the store</a> and <a href="/docs/getting-started/setup-sdk-client">setup the SDK client</a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>, <a href="/docs/getting-started/create-store">created the store</a> and <a href="/docs/getting-started/setup-sdk-client">setup the SDK client</a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the CLI</a>, <a href="/docs/getting-started/create-store">created the store</a> and <a href="/docs/getting-started/setup-sdk-client">setup your environment variables</a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_SERVER_URL</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/create-store">created the store</a> and have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>Assume that you want to configure your store with the following model.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">reader</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>To configure authorization model, we can invoke the <a href="/api/service#Authorization%20Models/WriteAuthorizationModel">write authorization models API</a>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> id </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">writeAuthorizationModel</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string-property property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// id = "1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> writeAuthorizationModelRequestString </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"{\"schema_version\":\"1.1\",\"type_definitions\":[{\"type\":\"user\"},{\"type\":\"document\",\"relations\":{\"reader\":{\"this\":{}},\"writer\":{\"this\":{}},\"owner\":{\"this\":{}}},\"metadata\":{\"relations\":{\"reader\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"writer\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"owner\":{\"directly_related_user_types\":[{\"type\":\"user\"}]}}}}]}"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body WriteAuthorizationModelRequest</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> json</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Unmarshal</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token function" style="color:rgb(80, 250, 123)">byte</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">writeAuthorizationModelRequestString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token operator">&</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> t</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Errorf</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"%v"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> response</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">WriteAuthorizationModel</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// data.AuthorizationModelId = "1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> modelJson </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"{\"schema_version\":\"1.1\",\"type_definitions\":[{\"type\":\"user\"},{\"type\":\"document\",\"relations\":{\"reader\":{\"this\":{}},\"writer\":{\"this\":{}},\"owner\":{\"this\":{}}},\"metadata\":{\"relations\":{\"reader\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"writer\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"owner\":{\"directly_related_user_types\":[{\"type\":\"user\"}]}}}}]}"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> JsonSerializer</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token generic-method function" style="color:rgb(80, 250, 123)">Deserialize</span><span class="token generic-method generic class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token generic-method generic class-name">OpenFga</span><span class="token generic-method generic class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token generic-method generic class-name">Sdk</span><span class="token generic-method generic class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token generic-method generic class-name">Model</span><span class="token generic-method generic class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token generic-method generic class-name">WriteAuthorizationModelRequest</span><span class="token generic-method generic class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">modelJson</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">WriteAuthorizationModel</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// response.AuthorizationModelId = "1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># from openfga_sdk.models.write_authorization_model_request import WriteAuthorizationModelRequest</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">write_authorization_model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> body_string </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"{\"schema_version\":\"1.1\",\"type_definitions\":[{\"type\":\"user\"},{\"type\":\"document\",\"relations\":{\"reader\":{\"this\":{}},\"writer\":{\"this\":{}},\"owner\":{\"this\":{}}},\"metadata\":{\"relations\":{\"reader\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"writer\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"owner\":{\"directly_related_user_types\":[{\"type\":\"user\"}]}}}}]}"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client_instance</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write_authorization_model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">json</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">loads</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># response.authorization_model_id = "1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga model </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"schema_version"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"type_definitions"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"type"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"type"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"relations"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"this"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"this"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"this"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"metadata"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"relations"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"directly_related_user_types"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"type"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"directly_related_user_types"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"type"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"directly_related_user_types"</span><span class="token plain">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"type"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/authorization-models </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"schema_version":"1.1","type_definitions":[{"type":"user"},{"type":"document","relations":{"reader":{"this":{}},"writer":{"this":{}},"owner":{"this":{}}},"metadata":{"relations":{"reader":{"directly_related_user_types":[{"type":"user"}]},"writer":{"directly_related_user_types":[{"type":"user"}]},"owner":{"directly_related_user_types":[{"type":"user"}]}}}}]}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The API will then return the authorization model ID.</p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Note</div><div class="admonitionContent_S0QG"><p>The OpenFGA API only accepts an authorization model in the API<!-- -->'<!-- -->s JSON syntax.</p><p>To convert between the API Syntax and the friendly DSL, you can use the <a href="https://github.com/openfga/cli/" target="_blank" rel="noopener noreferrer">FGA CLI</a>.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Take a look at the following sections for more information on how to configure authorization model in your store.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Getting Started with Modeling</span><p class="documentation-card-box-description_u7_j">Read how to get started with modeling.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/getting-started">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling: Direct Relationships</span><p class="documentation-card-box-description_u7_j">Read the basics of modeling authorization and granting access to users.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/direct-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/configure-model.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/setup-sdk-client"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Setup SDK Client for Store</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/update-tuples"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Update Relationship Tuples</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/create-store.html b/docs/getting-started/create-store.html index 16f82a634..caa792d29 100644 --- a/docs/getting-started/create-store.html +++ b/docs/getting-started/create-store.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Create a Store</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Create a Store</h1><p>A <a href="/docs/concepts#what-is-a-store">store</a> is a OpenFGA entity that contains your authorization data. You will need to create a store in OpenFGA before adding an <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a> and <a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuples</a> to it.</p><p>This article explains how to setup an OpenFGA store.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// OR import { OpenFgaClient } from '@openfga/sdk';</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> openFga </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.openfga.example instead of https://api.openfga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">id</span><span class="token operator">:</span><span class="token plain"> storeId </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> openFga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">createStore</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">name</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"FGA Demo Store"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> openfga </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> resp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">CreateStore</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">ClientCreateStoreRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain">Name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"FGA Demo"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">ExampleApp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">MyProgram</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> store </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">CreateStore</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCreateStoreRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain">Name </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"FGA Demo"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Name </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"FGA Demo Store"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">create_store_request </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> CreateStoreRequest</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> CreateStoreRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> name </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"FGA Demo Store"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">create_store</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">def</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">create_store</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Create a store</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> CreateStoreRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> name </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"FGA Demo"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client_instance</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">create_store</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">except</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ApiException </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> e</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">print</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"Exception when calling OpenFgaClient->create_store: %s\n"</span><span class="token plain"> </span><span class="token operator">%</span><span class="token plain"> e</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga store create --name </span><span class="token string" style="color:rgb(255, 121, 198)">"FGA Demo Store"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># To create the store and directly put the Store ID into an env variable:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># export FGA_STORE_ID=$(fga store create --name "FGA Demo Store" | jq -r .id)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_HOST</span><span class="token plain">/stores </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"name": "FGA Demo Store"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/create-store.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/install-sdk"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Install SDK Client</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/setup-sdk-client"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Setup SDK Client for Store</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/framework.html b/docs/getting-started/framework.html index b4f3953d9..e3725b482 100644 --- a/docs/getting-started/framework.html +++ b/docs/getting-started/framework.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Integrate Within a Framework</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Integrate Within a Framework</h1><p>This section will illustrate how to integrate <!-- -->OpenFGA<!-- --> within a framework, such as <a href="https://www.fastify.io/" target="_blank" rel="noopener noreferrer">Fastify</a> or <a href="https://docs.gofiber.io/" target="_blank" rel="noopener noreferrer">Fiber</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the OpenFGA SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples">updated the <em>relationship tuples</em></a>.</li><li>You know how to <a href="/docs/getting-started/perform-check">perform a Check</a>.</li><li>You have loaded <code>FGA_API_HOST</code> and <code>FGA_STORE_ID</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the OpenFGA SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples">updated the <em>relationship tuples</em></a>.</li><li>You know how to <a href="/docs/getting-started/perform-check">perform a Check</a>.</li><li>You have loaded <code>FGA_API_HOST</code> and <code>FGA_STORE_ID</code> as environment variables.</li></ol></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>Assume that you want to have a web service for <code>document</code>s using one of the frameworks mentioned above. The service will authenticate users via <a href="https://auth0.com/docs/secure/tokens/json-web-tokens" target="_blank" rel="noopener noreferrer">JWT tokens</a>, which contain the user ID.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Note</div><div class="admonitionContent_S0QG"><p>The reader should set up their own <code>login</code> method based on their OpenID connect provider's documentation.</p></div></div><p>Assume that you want to provide a route <code>GET /read/{document}</code> to return documents depending on whether the authenticated user has access to it.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-install-and-setup-framework">01. Install And Setup Framework<a href="#01-install-and-setup-framework" class="hash-link" aria-label="Direct link to 01. Install And Setup Framework" title="Direct link to 01. Install And Setup Framework">​</a></h3><p>The first step is to install the framework.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p>For the context of this example, we will use the <a href="https://www.fastify.io/" target="_blank" rel="noopener noreferrer">Fastify framework</a>. For that we need to install the following packages:</p><ul><li>the <a href="https://github.com/fastify/fastify" target="_blank" rel="noopener noreferrer"><code>fastify</code></a> package that provides the framework itself</li><li>the <a href="https://github.com/fastify/fastify-plugin" target="_blank" rel="noopener noreferrer"><code>fastify-plugin</code></a> package that allows integrating plugins with Fastify</li><li>the <a href="https://github.com/fastify/fastify-jwt" target="_blank" rel="noopener noreferrer"><code>fastify-jwt</code></a> package for processing JWT tokens</li></ul><p>Using <a href="https://www.npmjs.com" target="_blank" rel="noopener noreferrer">npm</a>:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">install</span><span class="token plain"> fastify fastify-plugin fastify-jwt</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Using <a href="https://yarnpkg.com" target="_blank" rel="noopener noreferrer">yarn</a>:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> fastify fastify-plugin fastify-jwt</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Next, we setup the web service with the <code>GET /read/{document}</code> route in file <code>app.js</code>.</p><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// Require the framework and instantiate it</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fastify </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'fastify'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">logger</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Declare the route</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'/read/:document'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">request</span><span class="token parameter punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token parameter"> reply</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=></span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">read</span><span class="token operator">:</span><span class="token plain"> request</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">params</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">document</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run the server</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">start</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=></span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">listen</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token number">3000</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">catch</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">log</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">error</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">exit</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token number">1</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token function" style="color:rgb(80, 250, 123)">start</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>For the context of this example, we will use the <a href="https://docs.gofiber.io/" target="_blank" rel="noopener noreferrer">Fiber framework</a>. For that we need to install the following Go packages:</p><ul><li>the <a href="https://docs.gofiber.io/" target="_blank" rel="noopener noreferrer"><code>gofiber/fiber</code></a> package that provides the Fiber framework itself</li><li>the <a href="https://github.com/gofiber/jwt" target="_blank" rel="noopener noreferrer"><code>gofiber/jwt</code></a> middleware authentication layer for JWT</li><li>the <a href="https://github.com/golang-jwt/jwt" target="_blank" rel="noopener noreferrer"><code>golang-jwt</code></a> package that provides Go support for JWT</li></ul><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">go get -u github.com/gofiber/fiber/v2 github.com/gofiber/jwt/v3 github.com/golang-jwt/jwt/v4</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Next, we setup the web service with the <code>GET /read/{document}</code> route.</p><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">package</span><span class="token plain"> main</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/gofiber/fiber/v2"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app </span><span class="token operator">:=</span><span class="token plain"> fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">New</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"/read/:document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Listen</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">":3000"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">c </span><span class="token operator">*</span><span class="token plain">fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Ctx</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">error</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">SendString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Params</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-authenticate-and-get-user-id">02. Authenticate And Get User ID<a href="#02-authenticate-and-get-user-id" class="hash-link" aria-label="Direct link to 02. Authenticate And Get User ID" title="Direct link to 02. Authenticate And Get User ID">​</a></h3><p>Before we can call <!-- -->OpenFGA<!-- --> to protect the <code>/read/{document}</code> route, we need to validate the user's JWT.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p>The <code>fastify-jwt</code> package allows validation of JWT tokens, as well as providing access to the user's identity.</p><p>In <code>jwt-authenticate.js</code>:</p><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fp </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'fastify-plugin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">module</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">exports</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">fp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">function</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">fastify</span><span class="token parameter punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token parameter"> opts</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">register</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'fastify-jwt'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">secret</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">private</span><span class="token operator">:</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">readFileSync</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token template-string template-punctuation string" style="color:rgb(255, 121, 198)">`</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(248, 248, 242)">${</span><span class="token template-string interpolation">path</span><span class="token template-string interpolation punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token template-string interpolation method function property-access" style="color:rgb(80, 250, 123)">join</span><span class="token template-string interpolation punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token template-string interpolation">__dirname</span><span class="token template-string interpolation punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token template-string interpolation"> </span><span class="token template-string interpolation string" style="color:rgb(255, 121, 198)">'certs'</span><span class="token template-string interpolation punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token template-string string" style="color:rgb(255, 121, 198)">/private.key</span><span class="token template-string template-punctuation string" style="color:rgb(255, 121, 198)">`</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'utf8'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token operator">:</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">readFileSync</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token template-string template-punctuation string" style="color:rgb(255, 121, 198)">`</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(248, 248, 242)">${</span><span class="token template-string interpolation">path</span><span class="token template-string interpolation punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token template-string interpolation method function property-access" style="color:rgb(80, 250, 123)">join</span><span class="token template-string interpolation punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token template-string interpolation">__dirname</span><span class="token template-string interpolation punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token template-string interpolation"> </span><span class="token template-string interpolation string" style="color:rgb(255, 121, 198)">'certs'</span><span class="token template-string interpolation punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token template-string string" style="color:rgb(255, 121, 198)">/public.key</span><span class="token template-string template-punctuation string" style="color:rgb(255, 121, 198)">`</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'utf8'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">sign</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">algorithm</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'RS256'</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">decorate</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'authenticate'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">function</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">request</span><span class="token parameter punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token parameter"> reply</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> request</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">jwtVerify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">catch</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> reply</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">send</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Then, use the <code>preValidation</code> hook of a route to protect it and access the user information inside the JWT:</p><p>In <code>route-read.js</code>:</p><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">module</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method-variable function-variable method function property-access" style="color:rgb(80, 250, 123)">exports</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">function</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">fastify</span><span class="token parameter punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token parameter"> opts</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'/read/:document'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">preValidation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain">fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">authenticate</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">function</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">request</span><span class="token parameter punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token parameter"> reply</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the user's id is in request.user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">read</span><span class="token operator">:</span><span class="token plain"> request</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">params</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">document</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Finally, update <code>app.js</code> to register the newly added hooks.</p><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fastify </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'fastify'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">logger</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> jwtAuthenticate </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'./jwt-authenticate'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> routeread </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'./route-read'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">register</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">jwtAuthenticate</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">register</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">routeread</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run the server!</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">start</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=></span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">listen</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token number">3000</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">catch</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">log</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">error</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">exit</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token number">1</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token function" style="color:rgb(80, 250, 123)">start</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>We will now setup middleware to authenticate the incoming JWTs.</p><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">package</span><span class="token plain"> main</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"crypto/rand"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"crypto/rsa"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"log"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/gofiber/fiber/v2"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> jwtware </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/gofiber/jwt/v3"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/golang-jwt/jwt/v4"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Do not do this in production.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// In production, you would have the private key and public key pair generated</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// in advance. NEVER add a private key to any GitHub repo.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> privateKey </span><span class="token operator">*</span><span class="token plain">rsa</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">PrivateKey</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app </span><span class="token operator">:=</span><span class="token plain"> fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">New</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Just as a demo, generate a new private/public key pair on each run.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> rng </span><span class="token operator">:=</span><span class="token plain"> rand</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Reader</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> err </span><span class="token builtin" style="color:rgb(189, 147, 249)">error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> privateKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">=</span><span class="token plain"> rsa</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GenerateKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">rng</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token number">2048</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> log</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Fatalf</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"rsa.GenerateKey: %v"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// JWT Middleware</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Use</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">jwtware</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">New</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">jwtware</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> SigningMethod</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"RS256"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> SigningKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> privateKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Public</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"/read/:document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Listen</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">":3000"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">c </span><span class="token operator">*</span><span class="token plain">fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Ctx</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">error</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">:=</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Locals</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">*</span><span class="token plain">jwt</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Token</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> claims </span><span class="token operator">:=</span><span class="token plain"> user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Claims</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">jwt</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">MapClaims</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> name </span><span class="token operator">:=</span><span class="token plain"> claims</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token string" style="color:rgb(255, 121, 198)">"name"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token builtin" style="color:rgb(189, 147, 249)">string</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">SendString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">name </span><span class="token operator">+</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">" read "</span><span class="token plain"> </span><span class="token operator">+</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Params</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-integrate-the--check-api-into-the-service">03. Integrate The <!-- -->OpenFGA<!-- --> Check API Into The Service<a href="#03-integrate-the--check-api-into-the-service" class="hash-link" aria-label="Direct link to 03-integrate-the--check-api-into-the-service" title="Direct link to 03-integrate-the--check-api-into-the-service">​</a></h3><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p>First, we will create a decorator <code>preauthorize</code> to parse the incoming HTTP method as well as name of the document, and set the appropriate <code>relation</code> and <code>object</code> that we will call Check on.</p><p>In <code>preauthorize.js</code>:</p><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fp </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'fastify-plugin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">module</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">exports</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">fp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">function</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">fastify</span><span class="token parameter punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token parameter"> opts</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">decorate</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'preauthorize'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">function</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">request</span><span class="token parameter punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token parameter"> reply</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">switch</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">request</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">method</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'GET'</span><span class="token operator">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> request</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">relation</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">break</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'POST'</span><span class="token operator">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> request</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">relation</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">break</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'DELETE'</span><span class="token operator">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword module" style="color:rgb(189, 147, 249);font-style:italic">default</span><span class="token operator">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> request</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">relation</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">break</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> request</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">object</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token template-string template-punctuation string" style="color:rgb(255, 121, 198)">`</span><span class="token template-string string" style="color:rgb(255, 121, 198)">document:</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(248, 248, 242)">${</span><span class="token template-string interpolation">request</span><span class="token template-string interpolation punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token template-string interpolation property-access">params</span><span class="token template-string interpolation punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token template-string interpolation property-access">document</span><span class="token template-string interpolation interpolation-punctuation punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token template-string template-punctuation string" style="color:rgb(255, 121, 198)">`</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">catch</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> reply</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">send</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Next, we will create a decorator called <code>authorize</code>. This decorator will invoke the <a href="/docs/getting-started/perform-check">Check API</a> to see if the user has a relationship with the specified document.</p><p>In <code>authorize.js</code>:</p><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fp </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'fastify-plugin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// OR import { OpenFgaClient } from '@openfga/sdk';</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">module</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">exports</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">fp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">function</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">fastify</span><span class="token parameter punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token parameter"> opts</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">decorate</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'authorize'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">function</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">request</span><span class="token parameter punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token parameter"> reply</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// configure the openfga api client</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> request</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> request</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> request</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">!</span><span class="token plain">allowed</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> reply</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">code</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token number">401</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">send</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token template-string template-punctuation string" style="color:rgb(255, 121, 198)">`</span><span class="token template-string string" style="color:rgb(255, 121, 198)">Not authenticated</span><span class="token template-string template-punctuation string" style="color:rgb(255, 121, 198)">`</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">catch</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> reply</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">send</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>We can now update the <code>GET /read/{document}</code> route to check for user permissions.</p><p>In <code>route-read.js</code>:</p><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">module</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method-variable function-variable method function property-access" style="color:rgb(80, 250, 123)">exports</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">function</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">fastify</span><span class="token parameter punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token parameter"> opts</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'/read/:document'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">preValidation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain">fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">authenticate</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">preauthorize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">authorize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">function</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token parameter">request</span><span class="token parameter punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token parameter"> reply</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the user's id is in request.user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">read</span><span class="token operator">:</span><span class="token plain"> request</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">params</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">document</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Finally, we will register the new hooks in <code>app.js</code>:</p><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fastify </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'fastify'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">logger</span><span class="token operator">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> jwtAuthenticate </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'./jwt-authenticate'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> preauthorize </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'./preauthorize'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> authorize </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'./authorize'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> routeread </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'./route-read'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">register</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">jwtAuthenticate</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">register</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">preauthorize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">register</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">authorize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">register</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">routeread</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(80, 250, 123)">start</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token arrow operator">=></span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">try</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">listen</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token number">3000</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">catch</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fastify</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">log</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">error</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">exit</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token number">1</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token function" style="color:rgb(80, 250, 123)">start</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>We will create two middlewares:</p><ul><li><code>preauthorize</code> will parse the user's JWT and prepare variables needed to call Check API.</li><li><code>checkAuthorization</code> will call the <a href="/docs/getting-started/perform-check"><code>Check API</code></a> to see if the user has a relationship with the specified document.</li></ul><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">package</span><span class="token plain"> main</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"context"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"crypto/rand"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"crypto/rsa"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"log"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/gofiber/fiber/v2"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> jwtware </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/gofiber/jwt/v3"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/golang-jwt/jwt/v4"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> openfga </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Do not do this in production.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// In production, you would have the private key and public key pair generated</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// in advance. NEVER add a private key to any GitHub repo.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> privateKey </span><span class="token operator">*</span><span class="token plain">rsa</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">PrivateKey</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app </span><span class="token operator">:=</span><span class="token plain"> fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">New</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Just as a demo, generate a new private/public key pair on each run.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> rng </span><span class="token operator">:=</span><span class="token plain"> rand</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Reader</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> err </span><span class="token builtin" style="color:rgb(189, 147, 249)">error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> privateKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">=</span><span class="token plain"> rsa</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GenerateKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">rng</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token number">2048</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> log</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Fatalf</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"rsa.GenerateKey: %v"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// JWT Middleware</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Use</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">jwtware</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">New</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">jwtware</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> SigningMethod</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"RS256"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> SigningKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> privateKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Public</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Use</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"/read/:document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> preauthorize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Use</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">checkAuthorization</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"/read/:document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> app</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Listen</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">":3000"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">c </span><span class="token operator">*</span><span class="token plain">fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Ctx</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">error</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">:=</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Locals</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">*</span><span class="token plain">jwt</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Token</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> claims </span><span class="token operator">:=</span><span class="token plain"> user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Claims</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">jwt</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">MapClaims</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> name </span><span class="token operator">:=</span><span class="token plain"> claims</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token string" style="color:rgb(255, 121, 198)">"name"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token builtin" style="color:rgb(189, 147, 249)">string</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">SendString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">name </span><span class="token operator">+</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">" read "</span><span class="token plain"> </span><span class="token operator">+</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Params</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">preauthorize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">c </span><span class="token operator">*</span><span class="token plain">fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Ctx</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">error</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// get the user name from JWT</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">:=</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Locals</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">*</span><span class="token plain">jwt</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Token</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> claims </span><span class="token operator">:=</span><span class="token plain"> user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Claims</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">jwt</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">MapClaims</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> name </span><span class="token operator">:=</span><span class="token plain"> claims</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token string" style="color:rgb(255, 121, 198)">"name"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token builtin" style="color:rgb(189, 147, 249)">string</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Locals</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"username"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// parse the HTTP method</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">switch</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Method</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"GET"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Locals</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"POST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Locals</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"DELETE"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Locals</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">default</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Locals</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// get the object name and prepend with type name "document:"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Locals</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token plain"> </span><span class="token operator">+</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Params</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Next</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Middleware to check whether user is authorized to access document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">checkAuthorization</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">c </span><span class="token operator">*</span><span class="token plain">fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Ctx</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">error</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">NewError</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">StatusServiceUnavailable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"Unable to build OpenFGA client"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Locals</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"username"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token builtin" style="color:rgb(189, 147, 249)">string</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Locals</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token builtin" style="color:rgb(189, 147, 249)">string</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Locals</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token builtin" style="color:rgb(189, 147, 249)">string</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">OpenFga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">NewError</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">StatusServiceUnavailable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"Unable to check for authorization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> </span><span class="token operator">!</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">*</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Allowed</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">NewError</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">fiber</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">StatusUnauthorized</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"Unauthorized to access document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Go to the next middleware</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">return</span><span class="token plain"> c</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Next</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Take a look at the following sections for examples that you can try when integrating with SDK.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Entitlements</span><p class="documentation-card-box-description_u7_j">Modeling Entitlements for a System in OpenFGA.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/entitlements">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">IoT</span><p class="documentation-card-box-description_u7_j">Modeling Fine Grained Authorization for an IoT Security Camera System with OpenFGA.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/iot">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Slack</span><p class="documentation-card-box-description_u7_j">Modeling Authorization for Slack with OpenFGA.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/slack">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/framework.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/perform-list-objects"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Perform a List Objects call</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/immutable-models"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Immutable Authorization Models</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-install-and-setup-framework" class="table-of-contents__link toc-highlight">01. Install And Setup Framework</a></li><li><a href="#02-authenticate-and-get-user-id" class="table-of-contents__link toc-highlight">02. Authenticate And Get User ID</a></li><li><a href="#03-integrate-the--check-api-into-the-service" class="table-of-contents__link toc-highlight">03. Integrate The <productname format="{ProductNameFormat.ShortForm}/"> Check API Into The Service</productname></a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/immutable-models.html b/docs/getting-started/immutable-models.html index 52351516d..9bc8537bc 100644 --- a/docs/getting-started/immutable-models.html +++ b/docs/getting-started/immutable-models.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Immutable Authorization Models</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Immutable Authorization Models</h1><p>Authorization Models in <!-- -->OpenFGA<!-- --> are immutable, they are created once and then can no longer be deleted or modified. Each time you write an authorization model, a new version is created.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="viewing-all-the-authorization-models">Viewing All the Authorization Models<a href="#viewing-all-the-authorization-models" class="hash-link" aria-label="Direct link to Viewing All the Authorization Models" title="Direct link to Viewing All the Authorization Models">​</a></h3><p>You can list all the authorization models for a store using the <a href="/api/service#/Authorization%20Models/ReadAuthorizationModels">ReadAuthorizationModels</a> API. This endpoint returns the results sorted in reverse chronological order, as in the first model in the list is the latest model. By default, only the last 50 models are returned, but you can paginate across by passing in the appropriate <code>continuation_token</code>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-target-a-particular-model">How to Target a Particular Model<a href="#how-to-target-a-particular-model" class="hash-link" aria-label="Direct link to How to Target a Particular Model" title="Direct link to How to Target a Particular Model">​</a></h3><p>Some endpoints relating to tuples (<a href="/api/service#/Relationship%20Queries/Check">Check</a>, <a href="/api/service#/Relationship%20Queries/ListObjects">ListObjects</a>, <a href="/api/service#/Relationship%20Queries/Expand">Expand</a>, <a href="/api/service#/Relationship%20Tuples/Write">Write</a>) accept an <code>authorization_model_id</code>, which we strongly recommend passing, especially in production.</p><p>In practice, you would pin the authorization model ID alongside the store ID in your configuration management system. Your services would read this value and use it in their requests to FGA. This helps you ensure that your services are using the same consistent ID across all your applications, and that rollouts can be seemless.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="benefits-of-passing-in-an-authorization-model-id">Benefits of Passing in an Authorization Model ID<a href="#benefits-of-passing-in-an-authorization-model-id" class="hash-link" aria-label="Direct link to Benefits of Passing in an Authorization Model ID" title="Direct link to Benefits of Passing in an Authorization Model ID">​</a></h3><p>Targeting a specific model ID would ensure that you don't accidentally break your authorization checks in production because a mistake was made when updating the authorization model. It would also slightly improve the latency on your check requests.</p><p>If that field is passed, evaluation and validation will happen for that particular authorization model ID. If this field is not passed, <!-- -->OpenFGA<!-- --> will use the last created Authorization Model for that store.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="potential-use-cases">Potential Use-cases<a href="#potential-use-cases" class="hash-link" aria-label="Direct link to Potential Use-cases" title="Direct link to Potential Use-cases">​</a></h3><p>Being able to target multiple versions of the authorization model enables you to progressively roll out model changes, which is something you should consider doing if the changes are significant. You could:</p><ul><li><p>Do shadow checks where you would perform checks against both your existing model and the new upcoming model you are hoping to replace it with.This will help you detect and resolve any accidental discrepancies you may be introducing, and ensure that your new model is at least as good as your old one.</p></li><li><p>When you are confident with your model, you could implement gradual rollouts that would allow you to monitor and check if any users are having access issues before you go ahead and increase the rollout to 100% of your user base.</p></li></ul><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Getting an Authorization Model's Creation Date</div><div class="admonitionContent_S0QG"><p>The Authorization Model ID is a <a href="https://github.com/ulid/spec" target="_blank" rel="noopener noreferrer">ULID</a> which includes the date created. You can extract the creation date using a library for your particular language.</p><p>For example, in JavaScript you can do the following:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword module" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> ulid </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'ulid'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> time </span><span class="token operator">=</span><span class="token plain"> ulid</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">decodeTime</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">id</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Learn more about modeling and production usage in OpenFGA.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Configuration Language</span><p class="documentation-card-box-description_u7_j">Learn about the OpenFGA Configuration Language.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/configuration-language">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Getting Started with Modeling</span><p class="documentation-card-box-description_u7_j">Read how to get started with modeling.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/getting-started">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Data and API Best Practices</span><p class="documentation-card-box-description_u7_j">Learn the best practices for managing data and invoking APIs in production environment</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/tuples-api-best-practices">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/immutable-models.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/framework"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Integrate Within a Framework</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/running-in-production"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Production Best Practices</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#viewing-all-the-authorization-models" class="table-of-contents__link toc-highlight">Viewing All the Authorization Models</a></li><li><a href="#how-to-target-a-particular-model" class="table-of-contents__link toc-highlight">How to Target a Particular Model</a></li><li><a href="#benefits-of-passing-in-an-authorization-model-id" class="table-of-contents__link toc-highlight">Benefits of Passing in an Authorization Model ID</a></li><li><a href="#potential-use-cases" class="table-of-contents__link toc-highlight">Potential Use-cases</a></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/install-sdk.html b/docs/getting-started/install-sdk.html index cca1adbf1..8fe595dda 100644 --- a/docs/getting-started/install-sdk.html +++ b/docs/getting-started/install-sdk.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Install SDK Client</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Install SDK Client</h1><p>To get started, install the <!-- -->OpenFGA<!-- --> SDK packages.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p>You can find the Node.js package on npm at: <a href="https://www.npmjs.com/package/@openfga/sdk" target="_blank" rel="noopener noreferrer">@openfga/sdk</a>.</p><p>Using <a href="https://www.npmjs.com/" target="_blank" rel="noopener noreferrer">npm</a>:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">npm</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">install</span><span class="token plain"> @openfga/sdk</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Using <a href="https://yarnpkg.com" target="_blank" rel="noopener noreferrer">yarn</a>:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">yarn</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> @openfga/sdk</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>You can find the Go package on GitHub at: <a href="https://github.com/openfga/go-sdk" target="_blank" rel="noopener noreferrer">@openfga/go-sdk</a>.</p><p>To install:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">go get -u github.com/openfga/go-sdk</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>In your code, import the module and use it:</p><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> openfga </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">NewConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.openfga.example instead of https://api.openfga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>You can then run</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">go mod tidy</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>to update <code>go.mod</code> and <code>go.sum</code> if you are using them.</p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The <!-- -->OpenFGA<!-- --> .NET SDK is available on <a href="https://www.nuget.org/packages/OpenFga.Sdk" target="_blank" rel="noopener noreferrer">NuGet</a>.</p><p>You can install it using:</p><ul><li>The <a href="https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-dotnet-cli" target="_blank" rel="noopener noreferrer">dotnet CLI</a>:</li></ul><div class="language-powershell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-powershell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">dotnet add package OpenFGA.Sdk</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><ul><li>The <a href="https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-powershell" target="_blank" rel="noopener noreferrer">Package Manager Console</a> inside Visual Studio:</li></ul><div class="language-powershell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-powershell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Install-Package OpenFGA.Sdk</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><ul><li><a href="https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio" target="_blank" rel="noopener noreferrer">Visual Studio</a>, <a href="https://docs.microsoft.com/en-us/visualstudio/mac/nuget-walkthrough" target="_blank" rel="noopener noreferrer">Visual Studio for Mac</a> and <a href="https://www.jetbrains.com/help/rider/Using_NuGet.html" target="_blank" rel="noopener noreferrer">IntelliJ Rider</a>: Search for and install <code>OpenFGA.Sdk</code> in each of their respective package manager UIs.</li></ul></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The <!-- -->OpenFGA<!-- --> Python SDK is available on <a href="https://pypi.org/project/openfga-sdk" target="_blank" rel="noopener noreferrer">PyPI</a>.</p><p>To install:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">pip3 install openfga_sdk</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>In your code, import the module and use it:</p><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The <!-- -->OpenFGA<!-- --> CLI is available on <a href="https://github.com/openfga/cli" target="_blank" rel="noopener noreferrer">GitHub</a>.</p><p>To install:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="brew">Brew<a href="#brew" class="hash-link" aria-label="Direct link to Brew" title="Direct link to Brew">​</a></h3><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">brew </span><span class="token function" style="color:rgb(80, 250, 123)">install</span><span class="token plain"> openfga/tap/fga</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="linux-deb-rpm-and-apk-packages">Linux (deb, rpm and apk) packages<a href="#linux-deb-rpm-and-apk-packages" class="hash-link" aria-label="Direct link to Linux (deb, rpm and apk) packages" title="Direct link to Linux (deb, rpm and apk) packages">​</a></h3><p>Download the .deb, .rpm or .apk packages from the <a href="https://github.com/openfga/cli/releases" target="_blank" rel="noopener noreferrer">releases page</a>.</p><p>Debian:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">sudo</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">apt</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">install</span><span class="token plain"> ./fga_</span><span class="token operator"><</span><span class="token plain">version</span><span class="token operator">></span><span class="token plain">_linux_</span><span class="token operator"><</span><span class="token plain">arch</span><span class="token operator">></span><span class="token plain">.deb</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Fedora:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">sudo</span><span class="token plain"> dnf </span><span class="token function" style="color:rgb(80, 250, 123)">install</span><span class="token plain"> ./fga_</span><span class="token operator"><</span><span class="token plain">version</span><span class="token operator">></span><span class="token plain">_linux_</span><span class="token operator"><</span><span class="token plain">arch</span><span class="token operator">></span><span class="token plain">.rpm</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Alpine Linux:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">sudo</span><span class="token plain"> apk </span><span class="token function" style="color:rgb(80, 250, 123)">add</span><span class="token plain"> --allow-untrusted ./fga_</span><span class="token operator"><</span><span class="token plain">version</span><span class="token operator">></span><span class="token plain">_linux_</span><span class="token operator"><</span><span class="token plain">arch</span><span class="token operator">></span><span class="token plain">.apk</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="docker">Docker<a href="#docker" class="hash-link" aria-label="Direct link to Docker" title="Direct link to Docker">​</a></h3><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> pull openfga/cli</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run -it openfga/cli</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="go">Go<a href="#go" class="hash-link" aria-label="Direct link to Go" title="Direct link to Go">​</a></h3><blockquote><p>note that the command will be named <code>cli</code></p></blockquote><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">go </span><span class="token function" style="color:rgb(80, 250, 123)">install</span><span class="token plain"> github.com/openfga/cli@latest</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="manually">Manually<a href="#manually" class="hash-link" aria-label="Direct link to Manually" title="Direct link to Manually">​</a></h3><p>Download the pre-compiled binaries from the <a href="https://github.com/openfga/cli/releases" target="_blank" rel="noopener noreferrer">releases page</a>.</p></div></div></div><div section="what-is-a-check-request" linkname="check API"></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Get OpenFGA's SDKs to add authorization to your API.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA Node.js SDK</span><p class="documentation-card-box-description_u7_j">Install our Node.js & JavaScript SDK to get started.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a href="https://www.npmjs.com/package/@openfga/sdk" target="_blank" rel="noopener noreferrer" class="documentation-card-box-link_yEiX">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA Go SDK</span><p class="documentation-card-box-description_u7_j">Use our Go SDK to easily connect your Go application to the OpenFGA API</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a href="https://github.com/openfga/go-sdk" target="_blank" rel="noopener noreferrer" class="documentation-card-box-link_yEiX">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA .NET SDK</span><p class="documentation-card-box-description_u7_j">Connect your .NET service with OpenFGA using our .NET SDK</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a href="https://github.com/openfga/dotnet-sdk" target="_blank" rel="noopener noreferrer" class="documentation-card-box-link_yEiX">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA Python SDK</span><p class="documentation-card-box-description_u7_j">Connect your Python service with OpenFGA using our Python SDK</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a href="https://github.com/openfga/python-sdk" target="_blank" rel="noopener noreferrer" class="documentation-card-box-link_yEiX">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/install-sdk.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/setup-openfga/kubernetes"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Kubernetes Setup Guide</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/create-store"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Create a Store</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#brew" class="table-of-contents__link toc-highlight">Brew</a></li><li><a href="#linux-deb-rpm-and-apk-packages" class="table-of-contents__link toc-highlight">Linux (deb, rpm and apk) packages</a></li><li><a href="#docker" class="table-of-contents__link toc-highlight">Docker</a></li><li><a href="#go" class="table-of-contents__link toc-highlight">Go</a></li><li><a href="#manually" class="table-of-contents__link toc-highlight">Manually</a></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/perform-check.html b/docs/getting-started/perform-check.html index 43027bc10..7bbb99c96 100644 --- a/docs/getting-started/perform-check.html +++ b/docs/getting-started/perform-check.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Perform a Check</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Perform a Check</h1><p>This section will illustrate how to perform a <a href="/docs/concepts#what-is-a-check-request">check</a> request to determine whether a <a href="/docs/concepts#what-is-a-user">user</a> has a certain <a href="/docs/concepts#what-is-a-relationship">relationship</a> with an <a href="/docs/concepts#what-is-an-object">object</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples">updated the <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples">updated the <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples">updated the <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples">updated the <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_SERVER_URL</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples">updated the <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>Assume that you want to check whether user <code>anne</code> has relationship <code>reader</code> with object <code>document:Z</code></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-configure-the--api-client">01. Configure the <!-- -->OpenFGA<!-- --> API Client<a href="#01-configure-the--api-client" class="hash-link" aria-label="Direct link to 01-configure-the--api-client" title="Direct link to 01-configure-the--api-client">​</a></h3><p>Before calling the check API, you will need to configure the API client.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>To obtain the <a href="https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-client-credentials-flow" target="_blank" rel="noopener noreferrer">access token</a>:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-calling-check-api">02. Calling Check API<a href="#02-calling-check-api" class="hash-link" aria-label="Direct link to 02. Calling Check API" title="Direct link to 02. Calling Check API">​</a></h3><p>To check whether user <code>user:anne</code> has relationship <code>reader</code> with object <code>document:Z</code></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:Z'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:Z"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:Z"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:Z"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:Z</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"reader","object":"document:Z"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The result's <code>allowed</code> field will return <code>true</code> if the relationship exists and <code>false</code> if the relationship does not exist.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Take a look at the following section for more on how to perform authorization checks in your system</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA Check API</span><p class="documentation-card-box-description_u7_j">Read the Check API documentation and see how it works.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/api/service#Relationship%20Queries/Check">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/perform-check.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/update-tuples"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Update Relationship Tuples</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/perform-list-objects"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Perform a List Objects call</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-configure-the--api-client" class="table-of-contents__link toc-highlight">01. Configure the <productname format="{ProductNameFormat.ShortForm}/"> API Client</productname></a></li><li><a href="#02-calling-check-api" class="table-of-contents__link toc-highlight">02. Calling Check API</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/perform-list-objects.html b/docs/getting-started/perform-list-objects.html index f8e4a9b0a..52d4d7a8c 100644 --- a/docs/getting-started/perform-list-objects.html +++ b/docs/getting-started/perform-list-objects.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Perform a List Objects Request</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Perform a List Objects call</h1><p>This section will illustrate how to perform a <a href="/docs/concepts#what-is-a-list-objects-request">list objects</a> request to determine all the <a href="/docs/concepts#what-is-an-object">objects</a> of a given <a href="/docs/concepts#what-is-a-type">type</a> a <a href="/docs/concepts#what-is-a-user">user</a> has a specified <a href="/docs/concepts#what-is-a-relationship">relationship</a> with.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples">updated the <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples">updated the <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples">updated the <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples">updated the <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_SERVER_URL</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples">updated the <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>Assume that you want to list all objects of type document that user <code>anne</code> has <code>reader</code> relationship with:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-configure-the--api-client">01. Configure the <!-- -->OpenFGA<!-- --> API Client<a href="#01-configure-the--api-client" class="hash-link" aria-label="Direct link to 01-configure-the--api-client" title="Direct link to 01-configure-the--api-client">​</a></h3><p>Before calling the check API, you will need to configure the API client.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>To obtain the <a href="https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-client-credentials-flow" target="_blank" rel="noopener noreferrer">access token</a>:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-calling-list-objects-api">02. Calling List Objects API<a href="#02-calling-list-objects-api" class="hash-link" aria-label="Direct link to 02. Calling List Objects API" title="Direct link to 02. Calling List Objects API">​</a></h3><p>To return all documents that user <code>user:anne</code> has relationship <code>reader</code> with:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">listObjects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">type</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.objects = ["document:otherdoc", "document:planning"]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientListObjectsOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientListObjectsRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Type</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ListObjects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "objects": ["document:otherdoc", "document:planning"] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Type </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ListObjects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Objects = ["document:otherdoc", "document:planning"]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientListObjectsRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">type</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">list_objects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.objects = ["document:otherdoc", "document:planning"]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query list-objects --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"objects": ["document:otherdoc", "document:planning"]}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/list-objects </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{ "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw",</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> "type": "document",</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> "relation": "reader",</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> "user":"user:anne"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"objects": ["document:otherdoc", "document:planning"]}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The result <code>document:otherdoc</code> and <code>document:planning</code> are the document objects that <code>user:anne</code> has <code>reader</code> relationship with.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Take a look at the following section for more on how to perform authorization checks in your system</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA List Objects API</span><p class="documentation-card-box-description_u7_j">Read the List Objects API documentation and see how it works.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/api/service#Relationship%20Queries/ListObjects">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/perform-list-objects.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/perform-check"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Perform a Check</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/framework"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Integrate Within a Framework</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-configure-the--api-client" class="table-of-contents__link toc-highlight">01. Configure the <productname format="{ProductNameFormat.ShortForm}/"> API Client</productname></a></li><li><a href="#02-calling-list-objects-api" class="table-of-contents__link toc-highlight">02. Calling List Objects API</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/running-in-production.html b/docs/getting-started/running-in-production.html index e3851192b..3991632bf 100644 --- a/docs/getting-started/running-in-production.html +++ b/docs/getting-started/running-in-production.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Production Best Practices</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Running OpenFGA in Production</h1><p>The following list outlines some guidelines and best practices for running OpenFGA in a production environment:</p><ul><li><a href="/docs/getting-started/setup-openfga/docker#configuring-authentication">Configure Authentication</a></li><li>Enable HTTP TLS or gRPC TLS or both</li><li>Set the log.format to "json"</li><li>Set the log.level to "info"</li><li><a href="/docs/getting-started/setup-openfga/docker#playground">Disable the Playground</a>.</li><li><a href="#concurrency-limits">Set Concurrency Limits</a></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="database-recommendations">Database Recommendations<a href="#database-recommendations" class="hash-link" aria-label="Direct link to Database Recommendations" title="Direct link to Database Recommendations">​</a></h2><p>To ensure good performance for OpenFGA, it is recommended that the <a href="/docs/getting-started/setup-openfga/docker#configuring-data-storage">database</a> be:</p><ul><li>Used exclusively for OpenFGA and not shared with other applications. This allows scaling the database independently and avoiding contention with your database.</li><li>Bootstrapped and managed with the <code>openfga migrate</code> command. This will ensure the appropriate database indexes are created.</li></ul><p>It's strongly recommended to fine-tune your server database connection settings to avoid having to re-establish database connections frequently. Establishing database connections is slow and will negatively impact performance, and so here are some guidelines for managing database connection settings:</p><ul><li><p>The server setting <code>OPENFGA_DATASTORE_MAX_OPEN_CONNS</code> should be set to be equal to your database's max connections. For example, in Postgres, you can see this value via running the SQL query <code>SHOW max_connections;</code>. If you are running multiple instances of the OpenFGA server, you should divide this setting equally among the instances. For example, if your database's <code>max_connections</code> is 100, and you have 2 OpenFGA instances, <code>OPENFGA_DATASTORE_MAX_OPEN_CONNS</code> should be set to 50 for each instance.</p></li><li><p>The <code>OPENFGA_DATASTORE_MAX_IDLE_CONNS</code> should be set to a value no greater than the maximum open connections (see the bullet point above), but it should be set sufficiently high enough to avoid having to recreate connections on each request.</p><p>If, when monitoring your database stats, you see a lot of database connections being closed and subsequently reopened, then you should consider increasing the maximum number of idle connections.</p></li><li><p>If idle connections are getting reaped frequently, then consider increasing the <code>OPENFGA_DATASTORE_CONN_MAX_IDLE_TIME</code> to a large value. When in doubt, prioritize keeping connections around for longer rather than shorter, because doing so will drastically improve performance.</p></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="concurrency-limits">Concurrency Limits<a href="#concurrency-limits" class="hash-link" aria-label="Direct link to Concurrency Limits" title="Direct link to Concurrency Limits">​</a></h2><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>Before modifying concurrency limits please make sure you've followed the guidance for <a href="/docs/getting-started/#database-recommendations">Database Recommendations</a></p></div></div><p>OpenFGA queries such as Check and ListObjects can be quite database and CPU intensive in some cases. If you notice that a single request is consuming a lot of CPU or creating a high degree of database contention, then you may consider setting some concurrency limits to protect other requests from being negatively impacted by overly aggressive queries. </p><p>The following table enumerates the server's concurrency specific settings:</p><table><thead><tr><th>flag</th><th>env</th><th>config</th></tr></thead><tbody><tr><td>--max-concurrent-reads-for-list-objects</td><td>OPENFGA_MAX_CONCURRENT_READS_FOR_LIST_OBJECTS</td><td>maxConcurrentReadsForListObjects</td></tr><tr><td>--max-concurrent-reads-for-check</td><td>OPENFGA_MAX_CONCURRENT_READS_FOR_CHECK</td><td>maxConcurrentReadsForCheck</td></tr><tr><td>--resolve-node-limit</td><td>OPENFGA_RESOLVE_NODE_LIMIT</td><td>resolveNodeLimit</td></tr><tr><td>--resolve-node-breadth-limit</td><td>OPENFGA_RESOLVE_NODE_BREADTH_LIMIT</td><td>resolveNodeBreadthLimit</td></tr></tbody></table><p>Determining the right values for these settings will be based on a variety of factors including, but not limited to, the database specific deployment topology, the FGA model(s) involved, and the relationship tuples in the system. However, here are some high-level guidelines:</p><ul><li><p>If a single ListObjects query is negatively impacting other query endpoints by increasing their latency or their error rate, then consider setting a lower value for <code>OPENFGA_MAX_CONCURRENT_READS_FOR_LIST_OBJECTS</code>.</p></li><li><p>If a single Check query is negatively impacting other query endpoints by increasing their latency or their error rate, then consider setting a lower value for <code>OPENFGA_MAX_CONCURRENT_READS_FOR_CHECK</code>.</p></li></ul><p>If you still see high request latencies despite the guidance above, then you may additionally consider setting stricter limits on the query resolution behavior by limiting the resolution depth and resolution breadth. These can be controlled with the <code>OPENFGA_RESOLVE_NODE_LIMIT</code> and <code>OPENFGA_RESOLVE_NODE_BREADTH_LIMIT</code> settings, respectively. Consider these guidelines:</p><ul><li><p><code>OPENFGA_RESOLVE_NODE_LIMIT</code> limits the resolution depth of a single query, and thus it sets an upper bound on how deep a relationship hierarchy may be. A high value will allow a single query to involve more hierarchical resolution and therefore more database queries, while a low value will reduce the number of hierarchical resolutions that will be allowed and thus reduce the number of database queries.</p></li><li><p><code>OPENFGA_RESOLVE_NODE_BREADTH_LIMIT</code> limits the resolution breadth. It sets an upper bound on the number of in-flight resolutions that can be taking place on one or more <a href="/docs/concepts#what-is-a-user">usersets</a>. A high value will allow a single query to involve more concurrent evaluations to take place and therefore more database queries and server processes, while a low value will reduce the overall number of concurrent resolutions that will be allowed and thus reduce the number of database queries and server processes.</p></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to run OpenFGA in production environment.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Data and API Best Practices</span><p class="documentation-card-box-description_u7_j">Learn the best practices for managing data and invoking APIs in production environment</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/tuples-api-best-practices">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Migrating Relations</span><p class="documentation-card-box-description_u7_j">Learn how to migrate relations in a production environment</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/migrating/migrating-relations">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Migrating Schema 1.1</span><p class="documentation-card-box-description_u7_j">Learn how to migrate to model schema 1.1</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/migrating/migrating-schema-1-1">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/production-best-practices.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/immutable-models"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Immutable Authorization Models</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/tuples-api-best-practices"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Managing Tuples and Invoking API Best Practices</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#database-recommendations" class="table-of-contents__link toc-highlight">Database Recommendations</a></li><li><a href="#concurrency-limits" class="table-of-contents__link toc-highlight">Concurrency Limits</a></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/setup-openfga/docker.html b/docs/getting-started/setup-openfga/docker.html index 0dccb807a..7ed0656d3 100644 --- a/docs/getting-started/setup-openfga/docker.html +++ b/docs/getting-started/setup-openfga/docker.html @@ -15,8 +15,8 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> @@ -24,7 +24,7 @@ Each variable must be prefixed with <code>OPENFGA_</code> and followed by your option in uppercase (e.g <code>--grpc-tls-key</code> becomes <code>OPENFGA_GRPC_TLS_KEY</code>).</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="configuring-data-storage">Configuring Data Storage<a href="#configuring-data-storage" class="hash-link" aria-label="Direct link to Configuring Data Storage" title="Direct link to Configuring Data Storage">​</a></h3><p>OpenFGA supports multiple storage engine options, including:</p><ul><li><code>memory</code> - The memory storage engine is the default, but it is not persistent (data is lost between server restarts).</li><li><code>postgres</code> - The Postgres storage engine requires a Postgres instance that the OpenFGA server can reach.</li><li><code>mysql</code> - The MySQL storage engine requires a MySQL instance that the OpenFGA server can reach, and that the connection URI specifies the query <code>parseTime=true</code>.</li></ul><h4 class="anchor anchorWithStickyNavbar_LWe7" id="postgres">Postgres<a href="#postgres" class="hash-link" aria-label="Direct link to Postgres" title="Direct link to Postgres">​</a></h4><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Docker</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Docker Compose</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p>Let's assume you want to run OpenFGA and Postgres in containers. The first thing we should do is create a new network as this will make communication between containers a bit simpler:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> network create openfga</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Start Postgres in the network you created above:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run -d --name postgres --network</span><span class="token operator">=</span><span class="token plain">openfga -e </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">POSTGRES_USER</span><span class="token operator">=</span><span class="token plain">postgres -e </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">POSTGRES_PASSWORD</span><span class="token operator">=</span><span class="token plain">password postgres:14</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>You should now have Postgres running in a container in the <code>openfga</code> network. However, it will not have the tables required for running OpenFGA. You can use the <code>migrate</code> command to create the tables. Using the OpenFGA container, this will look like:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run --rm --network</span><span class="token operator">=</span><span class="token plain">openfga openfga/openfga migrate </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --datastore-engine postgres </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --datastore-uri </span><span class="token string" style="color:rgb(255, 121, 198)">"postgres://postgres:password@postgres:5432/postgres?sslmode=disable"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Finally, start OpenFGA:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run --name openfga --network</span><span class="token operator">=</span><span class="token plain">openfga -p </span><span class="token number">3000</span><span class="token plain">:3000 -p </span><span class="token number">8080</span><span class="token plain">:8080 -p </span><span class="token number">8081</span><span class="token plain">:8081 openfga/openfga run </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --datastore-engine postgres </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --datastore-uri </span><span class="token string" style="color:rgb(255, 121, 198)">'postgres://postgres:password@postgres:5432/postgres?sslmode=disable'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>Copy the below code block into a local file named: <code>docker-compose.yaml</code></p><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token key atrule">version</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'3.8'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token key atrule">networks</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token key atrule">services</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">postgres</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">image</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> postgres</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token number">14</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">container_name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> postgres</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">networks</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> openfga</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">ports</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"5432:5432"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> POSTGRES_USER=postgres</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> POSTGRES_PASSWORD=password</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">healthcheck</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">test</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"CMD-SHELL"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"pg_isready -U postgres"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">interval</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> 5s</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">timeout</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> 5s</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">retries</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token number">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">migrate</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">depends_on</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">postgres</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">condition</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> service_healthy</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">image</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga/openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">latest</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">container_name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> migrate</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">command</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> migrate</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> OPENFGA_DATASTORE_ENGINE=postgres</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> OPENFGA_DATASTORE_URI=postgres</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">//postgres</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">password@postgres</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">5432/postgres</span><span class="token punctuation" style="color:rgb(248, 248, 242)">?</span><span class="token plain">sslmode=disable</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">networks</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> openfga</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">depends_on</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">migrate</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">condition</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> service_completed_successfully</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">image</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga/openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">latest</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">container_name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> OPENFGA_DATASTORE_ENGINE=postgres</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> OPENFGA_DATASTORE_URI=postgres</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">//postgres</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">password@postgres</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">5432/postgres</span><span class="token punctuation" style="color:rgb(248, 248, 242)">?</span><span class="token plain">sslmode=disable</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> OPENFGA_LOG_FORMAT=json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">command</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> run</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">networks</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> openfga</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">ports</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Needed for the http server</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"8080:8080"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Needed for the grpc server (if used)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"8081:8081"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Needed for the playground (Do not enable in prod!)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"3000:3000"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>In a terminal, navigate to that directory and run:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker-compose</span><span class="token plain"> up</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>This will start the Postgres database, run <code>openfga migrate</code> to configure the database and finally start the OpenFGA server.</p><p>Now you can try to <a href="/docs/getting-started/create-store">Create a Store</a>.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="mysql">MySQL<a href="#mysql" class="hash-link" aria-label="Direct link to MySQL" title="Direct link to MySQL">​</a></h4><p>Setting up MySQL and OpenFGA is very similar to setting up Postgres and OpenFGA.</p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Note that the MySQL datastore has stricter limits for the max length of some fields for tuples compared to other datastore engines, in particular:</p><ul><li>object type is at most 128 characters (down from 256)</li><li>object id is at most 128 characters (down from 256)</li><li>user is at most 256 characters (down from 512)</li></ul></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Docker</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Docker Compose</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6">We first make a network:<div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> network create openfga</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Then, start MySQL in the network you created above:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run -d --name mysql --network</span><span class="token operator">=</span><span class="token plain">openfga -e </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">MYSQL_ROOT_PASSWORD</span><span class="token operator">=</span><span class="token plain">secret -e </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">MYSQL_DATABASE</span><span class="token operator">=</span><span class="token plain">openfga mysql:8</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>You should now have MySQL running in a container in the <code>openfga</code> network. But we still have to migrate all the tables to be able to run OpenFGA. You can use the <code>migrate</code> command to create the tables. Using the OpenFGA container, this will look like:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run --rm --network</span><span class="token operator">=</span><span class="token plain">openfga openfga/openfga migrate </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --datastore-engine mysql </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --datastore-uri </span><span class="token string" style="color:rgb(255, 121, 198)">'root:secret@tcp(mysql:3306)/openfga?parseTime=true'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Finally, start OpenFGA:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run --name openfga --network</span><span class="token operator">=</span><span class="token plain">openfga -p </span><span class="token number">3000</span><span class="token plain">:3000 -p </span><span class="token number">8080</span><span class="token plain">:8080 -p </span><span class="token number">8081</span><span class="token plain">:8081 openfga/openfga run </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --datastore-engine mysql </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --datastore-uri </span><span class="token string" style="color:rgb(255, 121, 198)">'root:secret@tcp(mysql:3306)/openfga?parseTime=true'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>Copy the below code block into a local file named: <code>docker-compose.yaml</code></p><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token key atrule">version</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'3.8'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token key atrule">networks</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token key atrule">services</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">mysql</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">image</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> mysql</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token number">8</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">container_name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> mysql</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">networks</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> openfga</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">ports</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"3306:3306"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> MYSQL_ROOT_PASSWORD=secret</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> MYSQL_DATABASE=openfga</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">healthcheck</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">test</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token string" style="color:rgb(255, 121, 198)">"CMD"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'mysqladmin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'ping'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'-h'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'localhost'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'-u'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'root'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'-p$$MYSQL_ROOT_PASSWORD'</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">timeout</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> 20s</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">retries</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token number">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">migrate</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">depends_on</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">mysql</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">condition</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> service_healthy</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">image</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga/openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">latest</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">container_name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> migrate</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">command</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> migrate</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> OPENFGA_DATASTORE_ENGINE=mysql</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> OPENFGA_DATASTORE_URI=root</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">secret@tcp(mysql</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">3306)/openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">?</span><span class="token plain">parseTime=true</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">networks</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> openfga</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">depends_on</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">migrate</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">condition</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> service_completed_successfully</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">image</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga/openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">latest</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">container_name</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> OPENFGA_DATASTORE_ENGINE=mysql</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> OPENFGA_DATASTORE_URI=root</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">secret@tcp(mysql</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain">3306)/openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">?</span><span class="token plain">parseTime=true</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> OPENFGA_LOG_FORMAT=json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">command</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> run</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">networks</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> openfga</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">ports</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Needed for the http server</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"8080:8080"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Needed for the grpc server (if used)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"8081:8081"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Needed for the playground (Do not enable in prod!)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"3000:3000"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>In a terminal, navigate to that directory and run:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker-compose</span><span class="token plain"> up</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>This will start the MySQL database, run <code>openfga migrate</code> to configure the database and finally start the OpenFGA server.</p><p>Now you can try to <a href="/docs/getting-started/create-store">Create a Store</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="configuring-authentication">Configuring Authentication<a href="#configuring-authentication" class="hash-link" aria-label="Direct link to Configuring Authentication" title="Direct link to Configuring Authentication">​</a></h3><p>You can configure authentication in your OpenFGA server in three ways: no authentication (the default), pre-shared key authentication or via OIDC.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="pre-shared-key-authentication">Pre-shared Key Authentication<a href="#pre-shared-key-authentication" class="hash-link" aria-label="Direct link to Pre-shared Key Authentication" title="Direct link to Pre-shared Key Authentication">​</a></h4><p>If using <strong>Pre-shared key authentication</strong>, you will configure OpenFGA with a secret key and your application calling OpenFGA will have to set an <code>Authorization: Bearer <YOUR-KEY-HERE></code> header. You can configure multiple keys.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="admonitionContent_S0QG"><p>If you are going to use this setup in production, you should enable HTTP TLS in your OpenFGA server. You will need to configure the TLS certificate and key.</p></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Configuration File</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Environment Variables</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Docker</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p>Update the config.yaml file to </p><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token key atrule">authn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">method</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> preshared</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">preshared</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">keys</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token string" style="color:rgb(255, 121, 198)">"key1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"key2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token key atrule">http</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">tls</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">enabled</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">cert</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> /Users/myuser/key/server.crt</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">key</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> /Users/myuser/key/server.key</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Configure the authentication method to preshared: <code>export OPENFGA_AUTHN_METHOD=preshared</code>.</li><li>Configure the authentication keys: <code>export OPENFGA_AUTHN_PRESHARED_KEYS="key1,key2"</code></li><li>Enable the HTTP TLS configuration: <code>export OPENFGA_HTTP_TLS_ENABLED=true</code></li><li>Configure the HTTP TLS certificate location: <code>export OPENFGA_HTTP_TLS_CERT=/Users/myuser/key/server.crt</code></li><li>Configure the HTTP TLS key location: <code>export OPENFGA_HTTP_TLS_KEY=/Users/myuser/key/server.key</code></li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>To configure with pre-shared authentication and enabling TLS in http server with Docker.</p><ol><li>Copy the certificate and key files to your Docker container.</li><li>Run with the following command:</li></ol><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run --name openfga --network</span><span class="token operator">=</span><span class="token plain">openfga -p </span><span class="token number">3000</span><span class="token plain">:3000 -p </span><span class="token number">8080</span><span class="token plain">:8080 -p </span><span class="token number">8081</span><span class="token plain">:8081 openfga/openfga run </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --authn-method</span><span class="token operator">=</span><span class="token plain">preshared </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --authn-preshared-keys</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"key1,key2"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --http-tls-enabled</span><span class="token operator">=</span><span class="token plain">true </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --http-tls-cert</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"/Users/myuser/key/server.crt"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --http-tls-key</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"/Users/myuser/key/server.key"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="oidc">OIDC<a href="#oidc" class="hash-link" aria-label="Direct link to OIDC" title="Direct link to OIDC">​</a></h4><p>To configure with OIDC authentication, you will first need to obtain the OIDC issuer and audience from your provider.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="admonitionContent_S0QG"><p>If you are going to use this setup in production, you should enable HTTP TLS in your OpenFGA server. You will need to configure the TLS certificate and key.</p></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Configuration File</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Environment Variables</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Docker</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p>Update the config.yaml file to </p><div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token key atrule">authn</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">method</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> oidc</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">oidc</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">issuer</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"oidc-issuer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">audience</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"oidc-audience"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token key atrule">http</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">tls</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">enabled</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token boolean important">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">cert</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> /Users/myuser/key/server.crt</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">key</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> /Users/myuser/key/server.key</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Configure the authentication method to preshared: <code>export OPENFGA_AUTHN_METHOD=oidc</code>.</li><li>Configure the authentication keys: <code>export OPENFGA_AUTHN_OIDC_ISSUER=oidc-issuer</code></li><li>Configure the authentication keys: <code>export OPENFGA_AUTHN_OIDC_audience=oidc-audience</code></li><li>Enable the HTTP TLS configuration: <code>export OPENFGA_HTTP_TLS_ENABLED=true</code></li><li>Configure the HTTP TLS certificate location: <code>export OPENFGA_HTTP_TLS_CERT=/Users/myuser/key/server.crt</code></li><li>Configure the HTTP TLS key location: <code>export OPENFGA_HTTP_TLS_KEY=/Users/myuser/key/server.key</code></li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>To configure with pre-shared authentication and enabling TLS in http server with Docker.</p><ol><li>Copy the certificate and key files to your docker container.</li><li>Run the following command</li></ol><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">docker</span><span class="token plain"> run --name openfga --network</span><span class="token operator">=</span><span class="token plain">openfga -p </span><span class="token number">3000</span><span class="token plain">:3000 -p </span><span class="token number">8080</span><span class="token plain">:8080 -p </span><span class="token number">8081</span><span class="token plain">:8081 openfga/openfga run </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --authn-method</span><span class="token operator">=</span><span class="token plain">oidc </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --authn-oidc-issuer</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"oidc-issuer"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --authn-oidc-audience</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"oidc-audience"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --http-tls-enabled</span><span class="token operator">=</span><span class="token plain">true </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --http-tls-cert</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"/Users/myuser/key/server.crt"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> --http-tls-key</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"/Users/myuser/key/server.key"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="playground">Playground<a href="#playground" class="hash-link" aria-label="Direct link to Playground" title="Direct link to Playground">​</a></h3><p>The Playground facilitates rapid development by allowing you to visualize and model your application's authorization model(s) and manage relationship tuples with a locally running OpenFGA instance.</p><p>The Playground is enabled on port 3000 by default and accessible at http://localhost:3000/playground (if using Docker, make sure port 3000 is exposed to your local network). To disable the Playground, see <a href="#configuring-the-server">Configuring the Server</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="profiler-pprof">Profiler (pprof)<a href="#profiler-pprof" class="hash-link" aria-label="Direct link to Profiler (pprof)" title="Direct link to Profiler (pprof)">​</a></h3><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="admonitionContent_S0QG"><p>Continuous profiling can be used in production deployments, but we recommend disabling it unless it is needed to troubleshoot specific performance or memory problems.</p></div></div><p>Profiling through <a href="https://github.com/google/pprof/blob/main/doc/README.md" target="_blank" rel="noopener noreferrer"><code>pprof</code></a> can be enabled on the OpenFGA server by providing the <code>--profiler-enabled</code> flag. For example, in Docker:</p><div class="language-sh codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-sh codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker run -p 8080:8080 -p 8081:8081 -p 3000:3000 -p 3001:3001 openfga/openfga run --profiler-enabled</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If you need to serve the profiler on a different port than the default <code>3001</code>, you can do so by specifying the <code>--profiler-addr</code> flag. For example:</p><div class="language-sh codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-sh codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker run -p 8080:8080 -p 8081:8081 -p 3000:3000 -p 3002:3002 openfga/openfga run --profiler-enabled --profiler-addr :3002</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="health-check">Health Check<a href="#health-check" class="hash-link" aria-label="Direct link to Health Check" title="Direct link to Health Check">​</a></h2><p>OpenFGA is configured with an HTTP health check endpoint <code>/healthz</code> and a gRPC health check <code>grpc.health.v1.Health/Check</code>, which is wired to datastore testing. Possible response values are</p><ul><li>UNKNOWN</li><li>SERVING</li><li>NOT_SERVING</li><li>SERVICE_UNKNOWN</li></ul><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">cURL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">gRPC</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X GET </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_HOST</span><span class="token plain">/healthz</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># {"status":"SERVING"}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># See https://github.com/fullstorydev/grpcurl#installation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">grpcurl -plaintext </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_HOST</span><span class="token plain"> grpc.health.v1.Health/Check</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># {"status":"SERVING"}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="experimental-features">Experimental Features<a href="#experimental-features" class="hash-link" aria-label="Direct link to Experimental Features" title="Direct link to Experimental Features">​</a></h2><p>Various releases of OpenFGA may have experimental features that can be enabled by providing the <code>--experimentals</code> flag or the <code>experimentals</code> config.</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker run -p 8080:8080 -p 8081:8081 openfga/openfga run --experimentals="feature1, feature2"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>or if you're using environment variables,</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker run -p 8080:8080 -p 8081:8081 openfga/openfga -e OPENFGA_EXPERIMENTALS="feature1, feature2" run</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>The following table enumerates the experimental flags, a description of what they do, and the versions of OpenFGA the flag is supported in:</p><table><thead><tr><th>Name</th><th>Description</th><th>OpenFGA Version</th><th>Status</th></tr></thead><tbody><tr><td>otel-metrics</td><td>Enables support for exposing OpenFGA metrics through OpenTelemetry</td><td><code>0.3.2 <= v < v0.3.5</code></td><td>became default in <code>v0.3.5</code></td></tr><tr><td>list-objects</td><td>Enables ListObjects API</td><td><code>0.2.0 <= v < v0.3.3</code></td><td>became default in <code>v0.3.3</code></td></tr><tr><td>check-query-cache</td><td>Enables caching of check subproblem result</td><td><code>1.3.1 <= v </code></td><td>currently experimental</td></tr></tbody></table><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="admonitionContent_S0QG"><p>Experimental features are not guaranteed to be stable and may lead to server instabilities. It is not recommended to enable experimental features for anything other than experimentation.</p><p>Experimental feature flags are also not considered part of API compatibility and are subject to change, so please refer to each OpenFGA specific release for a list of the experimental feature flags that can be enabled for that release.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="telemetry">Telemetry<a href="#telemetry" class="hash-link" aria-label="Direct link to Telemetry" title="Direct link to Telemetry">​</a></h2><p>OpenFGA telemetry data is collected by default starting on version <code>v0.3.5</code>. The telemetry information that is captured includes Metrics, Traces, and Logs.</p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>Please refer to the <a href="https://github.com/openfga/openfga/blob/main/docker-compose.yaml" target="_blank" rel="noopener noreferrer">docker-compose.yaml</a> file as an example of how to collect Metrics and Tracing in OpenFGA in a Docker environment using the <a href="https://opentelemetry.io/docs/concepts/data-collection/" target="_blank" rel="noopener noreferrer">OpenTelemetry Collector</a>. This should serve as a good example that you can adjust for your specific deployment scenario.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="metrics">Metrics<a href="#metrics" class="hash-link" aria-label="Direct link to Metrics" title="Direct link to Metrics">​</a></h3><p>OpenFGA metrics are collected with the <a href="https://prometheus.io/docs/concepts/data_model/" target="_blank" rel="noopener noreferrer">Prometheus data format</a> and exposed on address <code>0.0.0.0:2112/metrics</code>.</p><p>Metrics are exposed by default, but you can disable this with <code>--metrics-enabled=false</code> (or <code>OPENFGA_METRICS_ENABLED=false</code> environment variable).</p><p>To set an alternative address, you can provide the <code>--metrics-addr</code> flag (<code>OPENFGA_METRICS_ADDR</code> environment variable). For example:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">openfga run --metrics-addr</span><span class="token operator">=</span><span class="token number">0.0</span><span class="token plain">.0.0:2114</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>To see the request latency per endpoint of your OpenFGA deployment, you can provide the <code>--metrics-enable-rpc-histograms</code> flag (<code>OPENFGA_METRICS_ENABLE_RPC_HISTOGRAMS</code> environment variable).</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="tracing">Tracing<a href="#tracing" class="hash-link" aria-label="Direct link to Tracing" title="Direct link to Tracing">​</a></h3><p>OpenFGA traces can be collected with the <a href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md" target="_blank" rel="noopener noreferrer">OTLP data format</a>.</p><p>Tracing is disabled by default, but you can enable this with the <code>--trace-enabled=true</code> (<code>OPENFGA_TRACE_ENABLED=true</code> environment variable). Traces will be exported by default to address <code>0.0.0.0:4317</code>. You can change this address with the <code>--trace-otlp-endpoint</code> flag (<code>OPENFGA_TRACE_OTLP_ENDPOINT</code> environment variable).</p><p>To increase or decrease the trace sampling ratio, you can provide the <code>--trace-sample-ratio</code> flag (<code>OPENFGA_TRACE_SAMPLE_RATIO</code> env variable).</p><p>Tracing by default uses a insecure connection. You can enable TLS by using <code>--trace-otlp-tls-enabled=true</code> flag or the environment variable <code>OPENFGA_TRACE_OTLP_TLS_ENABLED</code>.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="admonitionContent_S0QG"><p>It is not recommended to sample all traces (e.g. <code>--trace-sample-ratio=1</code>). You will need to adjust your sampling ratio based on the amount of traffic your deployment receives. Higher traffic will require less sampling and lower traffic can tolerate higher sampling ratios.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="logging">Logging<a href="#logging" class="hash-link" aria-label="Direct link to Logging" title="Direct link to Logging">​</a></h3><p>OpenFGA generates structured logs by default, and it can be configured with the following flags:</p><ul><li><code>--log-format</code>: sets the log format. Today we support <code>text</code> and <code>json</code> format.</li><li><code>--log-level</code>: sets the minimum log level (defaults to <code>info</code>). It can be set to <code>none</code> to turn off logging.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to use OpenFGA.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Production Best Practices</span><p class="documentation-card-box-description_u7_j">Learn the best practices of running OpenFGA in a production environment</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/running-in-production">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/setup-openfga/docker-setup.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/setup-openfga/overview"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Setup OpenFGA</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/setup-openfga/kubernetes"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Kubernetes Setup Guide</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a></li><li><a href="#configuring-the-server" class="table-of-contents__link toc-highlight">Configuring The Server</a><ul><li><a href="#configuring-data-storage" class="table-of-contents__link toc-highlight">Configuring Data Storage</a></li><li><a href="#configuring-authentication" class="table-of-contents__link toc-highlight">Configuring Authentication</a></li><li><a href="#playground" class="table-of-contents__link toc-highlight">Playground</a></li><li><a href="#profiler-pprof" class="table-of-contents__link toc-highlight">Profiler (pprof)</a></li></ul></li><li><a href="#health-check" class="table-of-contents__link toc-highlight">Health Check</a></li><li><a href="#experimental-features" class="table-of-contents__link toc-highlight">Experimental Features</a></li><li><a href="#telemetry" class="table-of-contents__link toc-highlight">Telemetry</a><ul><li><a href="#metrics" class="table-of-contents__link toc-highlight">Metrics</a></li><li><a href="#tracing" class="table-of-contents__link toc-highlight">Tracing</a></li><li><a href="#logging" class="table-of-contents__link toc-highlight">Logging</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/setup-openfga/kubernetes.html b/docs/getting-started/setup-openfga/kubernetes.html index 18309c4a5..6788c2bfe 100644 --- a/docs/getting-started/setup-openfga/kubernetes.html +++ b/docs/getting-started/setup-openfga/kubernetes.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-openfga/docker">🐳 Docker</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/setup-openfga/kubernetes">☸️ Kubernetes</a></li></ul></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started/setup-openfga/overview"><span itemprop="name">Setup OpenFGA</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">☸️ Kubernetes</span><meta itemprop="position" content="3"></li></ul></nav><div class="theme-doc-markdown markdown"><h1>☸️ Setup OpenFGA with Kubernetes</h1><p>To deploy OpenFGA into a Kubernetes environment you can use the official <a href="https://artifacthub.io/packages/helm/openfga/openfga" target="_blank" rel="noopener noreferrer">OpenFGA Helm chart</a>. Please refer to the official documentation on Artifact Hub for the Helm chart for more instructions.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/setup-openfga/kubernetes-setup.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/setup-openfga/docker"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Docker Setup Guide</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/install-sdk"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Install SDK Client</div></a></nav></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/setup-openfga/overview.html b/docs/getting-started/setup-openfga/overview.html index 77232840e..f142430fa 100644 --- a/docs/getting-started/setup-openfga/overview.html +++ b/docs/getting-started/setup-openfga/overview.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible menu__list-item-collapsible--active"><a class="menu__link menu__link--sublist menu__link--active" aria-current="page" aria-expanded="true" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-openfga/docker">🐳 Docker</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-openfga/kubernetes">☸️ Kubernetes</a></li></ul></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Setup OpenFGA</span><meta itemprop="position" content="2"></li></ul></nav><div class="theme-doc-markdown markdown"><h1>Setup OpenFGA</h1><p>Follow the guides below to setup an OpenFGA server.</p><div style="margin-top:2rem;margin-bottom:2rem"><div style="margin-top:2rem" class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Docker Setup Guide</span><p class="documentation-card-box-description_u7_j">How to setup an OpenFGA server with Docker.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/setup-openfga/docker">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Kubernetes Setup Guide</span><p class="documentation-card-box-description_u7_j">How to setup an OpenFGA server with Kubernetes.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/setup-openfga/kubernetes">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/setup-openfga/overview.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Getting Started</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/setup-openfga/docker"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Docker Setup Guide</div></a></nav></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/setup-sdk-client.html b/docs/getting-started/setup-sdk-client.html index d970d974e..eb9690846 100644 --- a/docs/getting-started/setup-sdk-client.html +++ b/docs/getting-started/setup-sdk-client.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Setup SDK Client for Store</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Setup SDK Client for Store</h1><p>This article explains how to build an OpenFGA client by using the SDKs.</p><p>The first step is to ensure that you have created a store by following <a href="/docs/getting-started/create-store">these steps</a>.</p><p>Next, depending on the authentication scheme you want to use, there are different ways to build the client.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="using-no-authentication">Using No Authentication<a href="#using-no-authentication" class="hash-link" aria-label="Direct link to Using No Authentication" title="Direct link to Using No Authentication">​</a></h2><p>This is a simple setup but it is not recommended for production use.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// OR import { OpenFgaClient } from '@openfga/sdk';</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> openFga </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> openfga </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">ExampleApp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">MyProgram</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">//</span><span class="token plain"> call requests</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">//</span><span class="token plain"> close when done</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_SERVER_URL</span><span class="token operator">=</span><span class="token plain">https://api.fga.example </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional. Defaults to http://localhost:8080</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_STORE_ID</span><span class="token operator">=</span><span class="token plain">YOUR_STORE_ID </span><span class="token comment" style="color:rgb(98, 114, 164)"># required for all calls except \`store create\`, \`store list\` and \`model validate\`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_MODEL_ID</span><span class="token operator">=</span><span class="token plain">YOUR_MODEL_ID </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, can be overridden per request, latest is used if this is empty</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="using-shared-key-authentication">Using Shared Key Authentication<a href="#using-shared-key-authentication" class="hash-link" aria-label="Direct link to Using Shared Key Authentication" title="Direct link to Using Shared Key Authentication">​</a></h2><p>If you want to use shared key authentication, you need to generate a random string that will work as secret and set that key when building your OpenFGA server. Then, when building the client, set it as environment variable <code>FGA_API_TOKEN</code>.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="admonitionContent_S0QG"><p>If you are going to use this setup in production, you should enable TLS in your OpenFGA server. Please see the <a href="/docs/getting-started/running-in-production">Production Checklist</a>.</p></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">CredentialsMethod</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// OR import { CredentialsMethod, OpenFgaClient } from '@openfga/sdk';</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> openFga </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">credentials</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">method</span><span class="token operator">:</span><span class="token plain"> </span><span class="token maybe-class-name">CredentialsMethod</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access maybe-class-name">ApiToken</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">config</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">token</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">$</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_TOKEN</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> openfga </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/credentials"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token plain">credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Method</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">CredentialsMethodApiToken</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token plain">credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiToken</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"OPENFGA_API_TOKEN"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// will be passed as the "Authorization: Bearer ${ApiToken}" request header</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">ExampleApp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">MyProgram</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Credentials </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">Credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Method </span><span class="token operator">=</span><span class="token plain"> CredentialsMethod</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ApiToken</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Config </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">CredentialsConfig</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiToken </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_TOKEN"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">credentials </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> Credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> CredentialConfiguration</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">credentials </span><span class="token operator">=</span><span class="token plain"> Credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">method</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">'api_token'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> configuration</span><span class="token operator">=</span><span class="token plain">CredentialConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">api_token</span><span class="token operator">=</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">FGA_API_TOKEN</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> credentials </span><span class="token operator">=</span><span class="token plain"> credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">//</span><span class="token plain"> call requests</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">//</span><span class="token plain"> close when done</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_SERVER_URL</span><span class="token operator">=</span><span class="token plain">https://api.fga.example </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional. Defaults to http://localhost:8080</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_STORE_ID</span><span class="token operator">=</span><span class="token plain">YOUR_STORE_ID </span><span class="token comment" style="color:rgb(98, 114, 164)"># required for all calls except \`store create\`, \`store list\` and \`model validate\`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_MODEL_ID</span><span class="token operator">=</span><span class="token plain">YOUR_MODEL_ID </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, can be overridden per request, latest is used if this is empty</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_API_TOKEN</span><span class="token operator">=</span><span class="token plain">YOUR_API_TOKEN</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="using-client-credentials-flow">Using Client Credentials Flow<a href="#using-client-credentials-flow" class="hash-link" aria-label="Direct link to Using Client Credentials Flow" title="Direct link to Using Client Credentials Flow">​</a></h2><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Note</div><div class="admonitionContent_S0QG"><p>The OpenFGA server does not support the client credentials flow, however if you or your OpenFGA provider have implemented a client credentials wrapper on top, follow the instructions here to have the OpenFGA client handle the token exchange for you.</p></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">CredentialsMethod</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// OR import { CredentialsMethod, OpenFgaClient } from '@openfga/sdk';</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> openFga </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">credentials</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">method</span><span class="token operator">:</span><span class="token plain"> </span><span class="token maybe-class-name">CredentialsMethod</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access maybe-class-name">ClientCredentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">config</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiTokenIssuer</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_TOKEN_ISSUER</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiAudience</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_AUDIENCE</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">clientId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_CLIENT_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">clientSecret</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_CLIENT_SECRET</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> openfga </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/credentials"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token plain">credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Method</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">CredentialsMethodClientCredentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token plain">credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Config</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientCredentialsClientId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_CLIENT_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientCredentialsClientSecret</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_CLIENT_SECRET"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientCredentialsApiAudience</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_AUDIENCE"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientCredentialsApiTokenIssuer</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_TOKEN_ISSUER"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">ExampleApp</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">MyProgram</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Credentials </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">Credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Method </span><span class="token operator">=</span><span class="token plain"> CredentialsMethod</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientCredentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Config </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">CredentialsConfig</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiTokenIssuer </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_TOKEN_ISSUER"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiAudience </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_AUDIENCE"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_CLIENT_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientSecret </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_CLIENT_SECRET"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">credentials </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> Credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> CredentialConfiguration</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">credentials </span><span class="token operator">=</span><span class="token plain"> Credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> method</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">'client_credentials'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> configuration</span><span class="token operator">=</span><span class="token plain">CredentialConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_issuer</span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_TOKEN_ISSUER'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_audience</span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_AUDIENCE'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> client_id</span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_CLIENT_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> client_secret</span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_CLIENT_SECRET'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">Configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional. Can be "http" or "https". Defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for \`CreateStore\` and \`ListStores\`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> credentials </span><span class="token operator">=</span><span class="token plain"> credentials</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">//</span><span class="token plain"> call requests</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token operator">//</span><span class="token plain"> close when done</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_SERVER_URL</span><span class="token operator">=</span><span class="token plain">https://api.fga.example </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional. Defaults to http://localhost:8080</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_STORE_ID</span><span class="token operator">=</span><span class="token plain">YOUR_STORE_ID </span><span class="token comment" style="color:rgb(98, 114, 164)"># required for all calls except \`store create\`, \`store list\` and \`model validate\`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_MODEL_ID</span><span class="token operator">=</span><span class="token plain">YOUR_MODEL_ID </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, can be overridden per request, latest is used if this is empty</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_API_TOKEN_ISSUER</span><span class="token operator">=</span><span class="token plain">YOUR_API_TOKEN_ISSUER</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_API_AUDIENCE</span><span class="token operator">=</span><span class="token plain">YOUR_API_AUDIENCE</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_CLIENT_ID</span><span class="token operator">=</span><span class="token plain">YOUR_CLIENT_ID</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">FGA_CLIENT_SECRET</span><span class="token operator">=</span><span class="token plain">YOUR_CLIENT_SECRET</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/setup-sdk-client.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/create-store"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Create a Store</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/configure-model"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Configure Authorization Model</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#using-no-authentication" class="table-of-contents__link toc-highlight">Using No Authentication</a></li><li><a href="#using-shared-key-authentication" class="table-of-contents__link toc-highlight">Using Shared Key Authentication</a></li><li><a href="#using-client-credentials-flow" class="table-of-contents__link toc-highlight">Using Client Credentials Flow</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/tuples-api-best-practices.html b/docs/getting-started/tuples-api-best-practices.html index f41b27edf..e8c0f6954 100644 --- a/docs/getting-started/tuples-api-best-practices.html +++ b/docs/getting-started/tuples-api-best-practices.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Implementation Best Practices</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Best Practices of Managing Tuples and Invoking APIs</h1><p>The following list outlines some guidelines and best practices for using <!-- -->OpenFGA<!-- -->:</p><ul><li>Do not store Personal Identifiable Information in tuples</li><li>Always specify authorization model ID whenever possible</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="do-not-store-personal-identifiable-information-in-tuples">Do Not Store Personal Identifiable Information in Tuples<a href="#do-not-store-personal-identifiable-information-in-tuples" class="hash-link" aria-label="Direct link to Do Not Store Personal Identifiable Information in Tuples" title="Direct link to Do Not Store Personal Identifiable Information in Tuples">​</a></h2><p>You can use any string for user and object identifiers, however you should not input or assign identifiers that include Personal Data or any other sensitive data, such as data that may be restricted under regulatory requirements.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Note</div><div class="admonitionContent_S0QG"><p>The documentation and samples uses first names and simple ids to illustrate easy-to-follow examples.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="always-specify-authorization-model-id-whenever-possible">Always Specify Authorization Model ID Whenever Possible<a href="#always-specify-authorization-model-id-whenever-possible" class="hash-link" aria-label="Direct link to Always Specify Authorization Model ID Whenever Possible" title="Direct link to Always Specify Authorization Model ID Whenever Possible">​</a></h2><p>It is strongly recommended that authorization model ID be specified in your Relationship Queries (such as <a href="/docs/getting-started/perform-check">Check</a> and <a href="/docs/interacting/relationship-queries#listobjects">ListObjects</a>) and Relationship Commands (such as <a href="/docs/getting-started/update-tuples">Write</a>).</p><p>Specifying authorization model ID in API calls have the following advantages:</p><ol><li>Better performance as <!-- -->OpenFGA<!-- --> will not need to perform a database query to get the latest authorization model ID.</li><li>Allows consistent behavior in your production system until until you are ready to switch to the new model.</li></ol><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on recommendation for managing relations and model in production environment.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Migrating Relations</span><p class="documentation-card-box-description_u7_j">Learn how to migrate relations in a production environment</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/migrating/migrating-relations">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Migrating Schema 1.1</span><p class="documentation-card-box-description_u7_j">Learn how to migrate to model schema 1.1</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/migrating/migrating-schema-1-1">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/tuples-api-best-practices.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/running-in-production"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Production Best Practices</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Modeling Guides</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#do-not-store-personal-identifiable-information-in-tuples" class="table-of-contents__link toc-highlight">Do Not Store Personal Identifiable Information in Tuples</a></li><li><a href="#always-specify-authorization-model-id-whenever-possible" class="table-of-contents__link toc-highlight">Always Specify Authorization Model ID Whenever Possible</a></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/getting-started/update-tuples.html b/docs/getting-started/update-tuples.html index 4d1817887..996c8e435 100644 --- a/docs/getting-started/update-tuples.html +++ b/docs/getting-started/update-tuples.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/getting-started"><span itemprop="name">Getting Started</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Update Relationship Tuples</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Update Relationship Tuples</h1><p>This section will illustrate how to update <em><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuples</a></em>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_SERVER_URL</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/configure-model">configured the <em>authorization model</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>Assume that you want to add user <code>user:anne</code> to have relationship <code>reader</code> with object <code>document:Z</code></p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:Z'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-configure-the--api-client">01. Configure The <!-- -->OpenFGA<!-- --> API Client<a href="#01-configure-the--api-client" class="hash-link" aria-label="Direct link to 01-configure-the--api-client" title="Direct link to 01-configure-the--api-client">​</a></h3><p>Before calling the write API, you will need to configure the API client.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>To obtain the <a href="https://auth0.com/docs/authorization/flows/call-your-api-using-the-client-credentials-flow" target="_blank" rel="noopener noreferrer">access token</a>:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-calling-write-api-to-add-new-relationship-tuples">02. Calling Write API To Add New Relationship Tuples<a href="#02-calling-write-api-to-add-new-relationship-tuples" class="hash-link" aria-label="Direct link to 02. Calling Write API To Add New Relationship Tuples" title="Direct link to 02. Calling Write API To Add New Relationship Tuples">​</a></h3><p>To add the relationship tuples, we can invoke the write API.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:Z'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:Z"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:Z"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:Z"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:Z</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"reader","object":"document:Z"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-calling-write-api-to-delete-relationship-tuples">03. Calling Write API To Delete Relationship Tuples<a href="#03-calling-write-api-to-delete-relationship-tuples" class="hash-link" aria-label="Direct link to 03. Calling Write API To Delete Relationship Tuples" title="Direct link to 03. Calling Write API To Delete Relationship Tuples">​</a></h3><p>To delete relationship tuples, we can invoke the write API.</p><p>Assume that you want to delete user <code>user:anne</code>'s <code>reader</code> relationship with object <code>document:Z</code></p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:Z'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">deletes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:Z'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:Z"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:Z"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> deletes</span><span class="token operator">==</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:Z"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple delete --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> user:anne reader document:Z</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"deletes": { "tuple_keys" : [{"user":"user:anne","relation":"reader","object":"document:Z"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to write your authorization data</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Managing User Access</span><p class="documentation-card-box-description_u7_j">Learn about how to give a user access to a particular object.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/managing-user-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Managing Group Access</span><p class="documentation-card-box-description_u7_j">Learn about how to give a group of users access to a particular object.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/managing-group-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Transactional Writes</span><p class="documentation-card-box-description_u7_j">Learn about how to update multiple relations within the same API call.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/transactional-writes">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/getting-started/update-tuples.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/configure-model"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Configure Authorization Model</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/getting-started/perform-check"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Perform a Check</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-configure-the--api-client" class="table-of-contents__link toc-highlight">01. Configure The <productname format="{ProductNameFormat.ShortForm}/"> API Client</productname></a></li><li><a href="#02-calling-write-api-to-add-new-relationship-tuples" class="table-of-contents__link toc-highlight">02. Calling Write API To Add New Relationship Tuples</a></li><li><a href="#03-calling-write-api-to-delete-relationship-tuples" class="table-of-contents__link toc-highlight">03. Calling Write API To Delete Relationship Tuples</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/interacting.html b/docs/interacting.html index 11afb97aa..e2d23908f 100644 --- a/docs/interacting.html +++ b/docs/interacting.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible menu__list-item-collapsible--active"><a class="menu__link menu__link--sublist menu__link--active" aria-current="page" aria-expanded="true" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-user-access">Manage User Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-access">Manage Group Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-membership">Manage Group Membership</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-relationships-between-objects">Manage Relationships Between Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/transactional-writes">Transactional Writes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/relationship-queries">Relationship Queries</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/read-tuple-changes">Get Tuple Changes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/search-with-permissions">Search with Permissions</a></li></ul></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Interacting with the API</span><meta itemprop="position" content="1"></li></ul></nav><div class="theme-doc-markdown markdown"><header><h1>Interacting with the API</h1></header><p>This section helps you integrate <!-- -->OpenFGA<!-- --> with your system. To do this, you will learn how to programmatically write authorization related data to <!-- -->OpenFGA<!-- -->.</p><div style="margin-top:2rem;margin-bottom:2rem"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div style="margin-top:0.75rem"><p class="documentation-card-box-description_u7_j">This section is useful if you have defined an authorization model and want to understand how to write authorization data to OpenFGA to represent the state of your system.</p></div><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div><h1>Content</h1><div style="margin-top:2rem;margin-bottom:2rem"><div style="margin-top:2rem" class="column-layout-2_O2db"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Manage User Access</span><p class="documentation-card-box-description_u7_j">Write relationship tuples to manage a user's access to an object.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/managing-user-access">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Manage Group Access</span><p class="documentation-card-box-description_u7_j">Write relationship tuples to manage access to an object for all members of a group.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/managing-group-access">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Manage Group Membership</span><p class="documentation-card-box-description_u7_j">Write relationship tuples to manage the users that are members of a group.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/managing-group-membership">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Manage Relationships Between Object</span><p class="documentation-card-box-description_u7_j">Write relationship tuples to manage how two objects are related. E.g. parent folder and child document.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/managing-relationships-between-objects">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Transactional Writes</span><p class="documentation-card-box-description_u7_j">Write multiple relationship tuples in a single request, so all writes either succeed or fail.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/transactional-writes">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Relationship Queries</span><p class="documentation-card-box-description_u7_j">An overview of how to use the Check, Read, Expand, and ListObject APIs.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/relationship-queries">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Search with Permissions</span><p class="documentation-card-box-description_u7_j">Implementing search with OpenFGA.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/search-with-permissions">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/interacting/overview.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/migrating/migrating-schema-1-1"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Migrating Models To Schema 1.1</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/interacting/managing-user-access"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Managing User Access</div></a></nav></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/interacting/managing-group-access.html b/docs/interacting/managing-group-access.html index 5b25206b7..0a71213c9 100644 --- a/docs/interacting/managing-group-access.html +++ b/docs/interacting/managing-group-access.html @@ -15,14 +15,14 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-user-access">Manage User Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/interacting/managing-group-access">Manage Group Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-membership">Manage Group Membership</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-relationships-between-objects">Manage Relationships Between Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/transactional-writes">Transactional Writes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/relationship-queries">Relationship Queries</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/read-tuple-changes">Get Tuple Changes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/search-with-permissions">Search with Permissions</a></li></ul></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/interacting"><span itemprop="name">Interacting with the API</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Manage Group Access</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Managing Group Access</h1><p>In this guide you will learn how to grant a group of users access to a particular object.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>Adding a relationship tuple specifying that a group has a relation to an object is helpful in cases where you want to encompass a set of users with the same relation to an object. For example:</p><ul><li>Grant a group of <code>engineers</code> <code>viewer</code> access to <code>roadmap.doc</code></li><li>Create a <code>block_list</code> of <code>members</code> who can't access a <code>document</code></li><li>Sharing a <code>document</code> with a <code>team</code></li><li>Granting <code>viewer</code> access to a <code>photo</code> to <code>followers</code> only</li><li>Making a <code>file</code> viewable for all <code>users</code> within an <code>organization</code></li><li>Restricting access from or to <code>users</code> in a certain <code>locale</code></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>Assume that you have the following <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>.<br> You have two <a href="/docs/concepts#what-is-a-type">types</a>:</p><ul><li><code>company</code> that can have a <code>employee</code> relation</li><li><code>document</code> that can have a <code>reader</code> relation.</li></ul></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">company</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">employee</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">reader</span><span class="token plain">: </span><span class="token directly-assignable">[company#employee]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"company"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"employee"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"employee"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"company"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"employee"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-user-groups">Modeling User Groups<a href="#modeling-user-groups" class="hash-link" aria-label="Direct link to Modeling User Groups" title="Direct link to Modeling User Groups">​</a></h3><p>You need to know how to add users to groups and grant groups access to an object. <a href="/docs/modeling/user-groups">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-adding-company-to-the-document">01. Adding Company To The Document<a href="#01-adding-company-to-the-document" class="hash-link" aria-label="Direct link to 01. Adding Company To The Document" title="Direct link to 01. Adding Company To The Document">​</a></h3><p>If we want to have every <code>employee</code> of a type <code>company</code> have a <code>reader</code> relationship with a particular object of type <code>document</code> (in this case <code>document:planning</code>), we need to add a tuple like so:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Every employee in the company can read document:planning</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"company:xyz#employee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-adding-employee-to-the-company">02. Adding Employee To The Company<a href="#02-adding-employee-to-the-company" class="hash-link" aria-label="Direct link to 02. Adding Employee To The Company" title="Direct link to 02. Adding Employee To The Company">​</a></h3><p>If we also write a tuple that says that Anne is a <code>employee</code> of <code>company:xyz</code>, like so:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'employee'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'company:xyz'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"employee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"company:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"employee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"company:xyz"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"employee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"company:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"employee","object":"company:xyz"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne employee company:xyz</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"employee"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"company:xyz"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-checking-an-individual-members-access-to-an-object">03. Checking An Individual Member's Access To An Object<a href="#03-checking-an-individual-members-access-to-an-object" class="hash-link" aria-label="Direct link to 03. Checking An Individual Member's Access To An Object" title="Direct link to 03. Checking An Individual Member's Access To An Object">​</a></h3><p>Then a call to the Check API to see whether Anne can read <code>document:planning</code> will return true:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"reader","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The same check for a different user Becky, however, will return false, because Becky does not have an <code>employee</code> relationship with <code>company:xyz</code>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:becky'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky reader document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:becky","relation":"reader","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:becky</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to model group.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling User Groups</span><p class="documentation-card-box-description_u7_j">Learn about how to model users and groups.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/user-groups">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Managing Group Membership</span><p class="documentation-card-box-description_u7_j">Learn about managing group membership.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/managing-group-membership">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/interacting/managing-group-access.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/interacting/managing-user-access"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Managing User Access</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/interacting/managing-group-membership"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Managing Group Membership</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#modeling-user-groups" class="table-of-contents__link toc-highlight">Modeling User Groups</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-adding-company-to-the-document" class="table-of-contents__link toc-highlight">01. Adding Company To The Document</a></li><li><a href="#02-adding-employee-to-the-company" class="table-of-contents__link toc-highlight">02. Adding Employee To The Company</a></li><li><a href="#03-checking-an-individual-members-access-to-an-object" class="table-of-contents__link toc-highlight">03. Checking An Individual Member's Access To An Object</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/interacting/managing-group-membership.html b/docs/interacting/managing-group-membership.html index 19a8cbd23..36538e6e8 100644 --- a/docs/interacting/managing-group-membership.html +++ b/docs/interacting/managing-group-membership.html @@ -15,14 +15,14 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-user-access">Manage User Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-access">Manage Group Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/interacting/managing-group-membership">Manage Group Membership</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-relationships-between-objects">Manage Relationships Between Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/transactional-writes">Transactional Writes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/relationship-queries">Relationship Queries</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/read-tuple-changes">Get Tuple Changes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/search-with-permissions">Search with Permissions</a></li></ul></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/interacting"><span itemprop="name">Interacting with the API</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Manage Group Membership</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Managing Group Membership</h1><p>In this guide you will learn how to update a user's membership to a group by adding and removing them from it.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>Suppose:</p><ul><li>An employee is hired at a company and thus gains access to all of the company's resources.</li><li>An employee quits and thus loses access to all of the company's resources.</li><li>A user joins a GitHub organization and gains access to the organizations private repositories.</li><li>A student graduates from school and loses access to the school's facilities.</li></ul><p>These are cases where using group membership can be helpful as you do not need to iterate over all of the group's resources to add or revoke access to particular objects. You can add a relationship tuple indicating that a user belongs to a group, or delete a tuple to indicate that a user is no longer part of the group.</p></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>Assume that you have the following <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>.<br> You have two <a href="/docs/concepts#what-is-a-type">types</a>:</p><ul><li><code>org</code> that can have a <code>member</code> relation</li><li><code>document</code> that can have a <code>reader</code> relation.</li></ul></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">org</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">reader</span><span class="token plain">: </span><span class="token directly-assignable">[org#member]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Let us also assume that we have an <code>org</code> called "contoso" and a <code>document</code> called <code>planning</code>, and every <code>member</code> of that <code>org</code> can read the document. That is represented by having the following <em><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuple</a></em> in the store:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Members of the contoso org can read the planning document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org:contoso#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>With the above authorization model and relationship tuples, <!-- -->OpenFGA<!-- --> will respond with <code>{"allowed":false}</code> when <em><a href="/docs/concepts#what-is-a-check-request">check</a></em> is called to see if Anne can read <code>document:planning</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw anne reader document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"anne","relation":"reader","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Now let's make Anne a <code>member</code> of <code>org:contoso</code> by adding another tuple:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is a member of the contoso org</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'org:contoso'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is a member of the contoso org</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"org:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is a member of the contoso org</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org:contoso"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne is a member of the contoso org</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"org:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"member","object":"org:contoso"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member org:contoso</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne is a member of the contoso org</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"org:contoso"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The <!-- -->OpenFGA<!-- --> service will now correctly respond with <code>{"allowed":true}</code> when check is called to see if Anne can read <code>document:planning</code>, but it will still respond with <code>{"allowed":false}</code> if we ask the same question for another user called Becky, who is not a member of the group <code>org:contoso</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"reader","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:becky'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky reader document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:becky","relation":"reader","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:becky</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-user-groups">Modeling User Groups<a href="#modeling-user-groups" class="hash-link" aria-label="Direct link to Modeling User Groups" title="Direct link to Modeling User Groups">​</a></h3><p>You need to know how to add users to groups and grant groups access to an object. <a href="/docs/modeling/user-groups">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="managing-group-access">Managing Group Access<a href="#managing-group-access" class="hash-link" aria-label="Direct link to Managing Group Access" title="Direct link to Managing Group Access">​</a></h3><p>You need to know how to manage group access to an object. <a href="/docs/interacting/managing-group-access">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-revoking-group-membership">01. Revoking Group Membership<a href="#01-revoking-group-membership" class="hash-link" aria-label="Direct link to 01. Revoking Group Membership" title="Direct link to 01. Revoking Group Membership">​</a></h3><p>Imagine that every member of <code>org:contoso</code> has a <code>reader</code> relationship to 1000 documents. Now imagine that <code>anne</code> is no longer a member of <code>org:contoso</code>, so we want to revoke her access to all those documents, including <code>document:planning</code>. To accomplish this, we can simply <strong>delete</strong> the tuple in <!-- -->OpenFGA<!-- --> that specifies that Anne is a <code>member</code> of <code>org:contoso</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">deletes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'org:contoso'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"org:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org:contoso"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> deletes</span><span class="token operator">==</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"org:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"deletes": { "tuple_keys" : [{"user":"user:anne","relation":"member","object":"org:contoso"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple delete --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> user:anne member org:contoso</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">delete</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"org:contoso"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-validating-revoked-member-no-longer-has-access">02. Validating revoked member no longer has access<a href="#02-validating-revoked-member-no-longer-has-access" class="hash-link" aria-label="Direct link to 02. Validating revoked member no longer has access" title="Direct link to 02. Validating revoked member no longer has access">​</a></h3><p>Once the above relationship tuple is deleted, we can check if Anne can read <code>document:planning</code>. <!-- -->OpenFGA<!-- --> will return <code>{ "allowed": false }</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"reader","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to model group.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling User Groups</span><p class="documentation-card-box-description_u7_j">Learn about how to model users and groups.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/user-groups">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Managing Group Access</span><p class="documentation-card-box-description_u7_j">Learn about managing group access.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/managing-group-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/interacting/managing-group-membership.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/interacting/managing-group-access"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Managing Group Access</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/interacting/managing-relationships-between-objects"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Managing Relationships Between Objects</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#modeling-user-groups" class="table-of-contents__link toc-highlight">Modeling User Groups</a></li><li><a href="#managing-group-access" class="table-of-contents__link toc-highlight">Managing Group Access</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-revoking-group-membership" class="table-of-contents__link toc-highlight">01. Revoking Group Membership</a></li><li><a href="#02-validating-revoked-member-no-longer-has-access" class="table-of-contents__link toc-highlight">02. Validating revoked member no longer has access</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/interacting/managing-relationships-between-objects.html b/docs/interacting/managing-relationships-between-objects.html index 026aa6850..bb84e86a0 100644 --- a/docs/interacting/managing-relationships-between-objects.html +++ b/docs/interacting/managing-relationships-between-objects.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-user-access">Manage User Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-access">Manage Group Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-membership">Manage Group Membership</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/interacting/managing-relationships-between-objects">Manage Relationships Between Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/transactional-writes">Transactional Writes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/relationship-queries">Relationship Queries</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/read-tuple-changes">Get Tuple Changes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/search-with-permissions">Search with Permissions</a></li></ul></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/interacting"><span itemprop="name">Interacting with the API</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Manage Relationships Between Objects</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Managing Relationships Between Objects</h1><p>In this guide you will learn how to grant a user access to a particular object through a relationship with another object.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>Giving user access through a relationship with another object is helpful because it allows scaling as the number of object grows. For example:</p><ul><li>organization that owns many repos</li><li>team that administers many documents</li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before you start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before you start" title="Direct link to Before you start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>Assume that you have the following <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a><br></p><ul><li>a <code>repo</code> type that can have a <code>admin</code> relation</li></ul></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">repo</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="direct-access">Direct Access<a href="#direct-access" class="hash-link" aria-label="Direct link to Direct Access" title="Direct link to Direct Access">​</a></h3><p>You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. <a href="/docs/modeling/direct-access">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>For the current model, a <a href="/docs/concepts#what-is-a-user">user</a> can be related as an <code>admin</code> to an <a href="/docs/concepts#what-is-an-object">object</a> of <a href="/docs/concepts#what-is-a-type">type</a> <code>repo</code>. If we wanted to have Anne be related to two repos, <code>repo:1</code> and <code>repo:2</code>, we would have to add two <a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuples</a>, like so:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo:2'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:2"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"admin","object":"repo:1"},{"user":"user:anne","relation":"admin","object":"repo:2"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne admin repo:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne admin repo:2</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:2"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>In general, every time we wanted to add a new <code>admin</code> relationship to a <code>repo</code> we'd have to add a new tuple. This doesn't scale as the list of <code>repo</code>s and users grows.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-modify-authorization-model">01. Modify Authorization Model<a href="#01-modify-authorization-model" class="hash-link" aria-label="Direct link to 01. Modify Authorization Model" title="Direct link to 01. Modify Authorization Model">​</a></h3><p>Another way of modeling this is to have an authorization model as follows:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">repo</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> repo_admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[org]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">org</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">repo_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"repo_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"repo_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>In this model, we have:</p><ul><li>added a new type <code>org</code> with one relation <code>repo_admin</code>.</li><li>added a new relation <code>owner</code> for type <code>repo</code>.</li><li>re-defined the relation <code>admin</code> for <code>repo</code>. A user can be defined as an <code>admin</code> directly, as we have seen above, or through the <code>repo_admin from owner</code> clause. How this works, for example, is that if <code>user</code> is related as <code>repo_admin</code> to <code>org:xyz</code>, and <code>org:xyz</code> is related as <code>owner</code> to <code>repo:1</code>, then <code>user</code> is an <code>admin</code> of <code>repo:1</code>.</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-adding-relationship-tuples-where-user-is-another-object">02. Adding Relationship Tuples Where User Is Another Object<a href="#02-adding-relationship-tuples-where-user-is-another-object" class="hash-link" aria-label="Direct link to 02. Adding Relationship Tuples Where User Is Another Object" title="Direct link to 02. Adding Relationship Tuples Where User Is Another Object">​</a></h3><p>With this model, we can add tuples representing that an <code>org</code> is the <code>owner</code> of a <code>repo</code>. By adding following relationship tuples, we are indicating that the xyz organization is the owner of repositories with IDs <code>1</code> and <code>2</code>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'org:xyz'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'org:xyz'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo:2'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:2"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"org:xyz","relation":"owner","object":"repo:1"},{"user":"org:xyz","relation":"owner","object":"repo:2"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw org:xyz owner repo:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw org:xyz owner repo:2</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:2"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-adding-relationship-tuples-to-the-other-object">03. Adding Relationship Tuples To The Other Object<a href="#03-adding-relationship-tuples-to-the-other-object" class="hash-link" aria-label="Direct link to 03. Adding Relationship Tuples To The Other Object" title="Direct link to 03. Adding Relationship Tuples To The Other Object">​</a></h3><p>Now, imagine we have a new user Becky. If we wanted to have Becky be the <code>admin</code> of all <code>repo</code>s without having to add one tuple per <code>repo</code>, all we need to do is add one tuple that says that Becky is related as <code>repo_admin</code> to <code>org:xyz</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:becky'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'org:xyz'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"repo_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:becky","relation":"repo_admin","object":"org:xyz"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky repo_admin org:xyz</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"repo_admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="04-validating-user-access">04. Validating User Access<a href="#04-validating-user-access" class="hash-link" aria-label="Direct link to 04. Validating User Access" title="Direct link to 04. Validating User Access">​</a></h3><p>We can now verify that Becky an <code>admin</code> of all the <code>repo</code>s owned by <code>org:xyz</code>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:becky'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky admin repo:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:becky","relation":"admin","object":"repo:1"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:becky</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">admin</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">repo:1</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:becky'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo:2'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky admin repo:2</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:becky","relation":"admin","object":"repo:2"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:becky</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">admin</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:2"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">repo:2</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="05-revoking-access">05. Revoking Access<a href="#05-revoking-access" class="hash-link" aria-label="Direct link to 05. Revoking Access" title="Direct link to 05. Revoking Access">​</a></h3><p>Suppose now that we want to prevent users from being an <code>admin</code> of <code>repo:1</code> via <code>org:xyz</code>. We can delete one tuple:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">deletes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'org:xyz'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> deletes</span><span class="token operator">==</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"deletes": { "tuple_keys" : [{"user":"org:xyz","relation":"owner","object":"repo:1"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple delete --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> org:xyz owner repo:1</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">delete</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>With this change, we may now verify that Becky is no longer an <code>admin</code> of <code>repo:1</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:becky'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky admin repo:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:becky","relation":"admin","object":"repo:1"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:becky</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">admin</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:1"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">repo:1</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to model relationships between objects.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Parent-Child Objects</span><p class="documentation-card-box-description_u7_j">Learn about how to cascade relationships from parent object to child object.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/parent-child">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Object to Object Relationships</span><p class="documentation-card-box-description_u7_j">Learn about modeling patterns on objects that are not specifically tied to a user.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/building-blocks/object-to-object-relationships">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling GitHub</span><p class="documentation-card-box-description_u7_j">An example of object to object relationships.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/github">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/interacting/managing-relationships-between-objects.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/interacting/managing-group-membership"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Managing Group Membership</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/interacting/transactional-writes"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Transactional Writes</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before you start</a><ul><li><a href="#direct-access" class="table-of-contents__link toc-highlight">Direct Access</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-modify-authorization-model" class="table-of-contents__link toc-highlight">01. Modify Authorization Model</a></li><li><a href="#02-adding-relationship-tuples-where-user-is-another-object" class="table-of-contents__link toc-highlight">02. Adding Relationship Tuples Where User Is Another Object</a></li><li><a href="#03-adding-relationship-tuples-to-the-other-object" class="table-of-contents__link toc-highlight">03. Adding Relationship Tuples To The Other Object</a></li><li><a href="#04-validating-user-access" class="table-of-contents__link toc-highlight">04. Validating User Access</a></li><li><a href="#05-revoking-access" class="table-of-contents__link toc-highlight">05. Revoking Access</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/interacting/managing-user-access.html b/docs/interacting/managing-user-access.html index 3ffc40470..e4972aa1e 100644 --- a/docs/interacting/managing-user-access.html +++ b/docs/interacting/managing-user-access.html @@ -15,14 +15,14 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/interacting/managing-user-access">Manage User Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-access">Manage Group Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-membership">Manage Group Membership</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-relationships-between-objects">Manage Relationships Between Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/transactional-writes">Transactional Writes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/relationship-queries">Relationship Queries</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/read-tuple-changes">Get Tuple Changes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/search-with-permissions">Search with Permissions</a></li></ul></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/interacting"><span itemprop="name">Interacting with the API</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Manage User Access</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Managing User Access</h1><p>In this guide you will learn how to grant a <a href="/docs/concepts#what-is-a-user">user</a> access to a particular <a href="/docs/concepts#what-is-an-object">object</a>.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>Granting access with a <em><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuple</a></em> is a core part of <!-- -->OpenFGA<!-- -->. Without any relationship tuples, any <em><a href="/docs/concepts#what-is-a-check-request">check</a></em> will fail. You should use:</p><ul><li><em>authorization model</em> to represent what <strong>relation</strong>s are possible between the users and objects in your system</li><li><em>relationship tuples</em> to represent the facts about the relationships between users and objects in your system.</li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>Assume that you have the following <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>.<br> You have a <a href="/docs/concepts#what-is-a-type">type</a> called <code>tweet</code> that can have a <code>reader</code>.</p></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">tweet</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">reader</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="direct-access">Direct Access<a href="#direct-access" class="hash-link" aria-label="Direct link to Direct Access" title="Direct link to Direct Access">​</a></h3><p>You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. <a href="/docs/modeling/direct-access">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-adding-direct-relationship">01. Adding Direct Relationship<a href="#01-adding-direct-relationship" class="hash-link" aria-label="Direct link to 01. Adding Direct Relationship" title="Direct link to 01. Adding Direct Relationship">​</a></h3><p>For our application, we will give user Anne the <code>reader</code> relationship to a particular <code>tweet</code>. To do so we add a tuple as follows:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne can read tweet:1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>With the above, we have added a <a href="/docs/modeling/building-blocks/direct-relationships"><strong>direct</strong> relationship</a> between Anne and <code>tweet:1</code>. When we call the Check API to see if Anne has a <code>reader</code> relationship, <!-- -->OpenFGA<!-- --> will say yes.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'tweet:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader tweet:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"reader","object":"tweet:1"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">tweet:1</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-removing-direct-relationship">02. Removing Direct Relationship<a href="#02-removing-direct-relationship" class="hash-link" aria-label="Direct link to 02. Removing Direct Relationship" title="Direct link to 02. Removing Direct Relationship">​</a></h3><p>Now let's change this so that Anne no longer has a <code>reader</code> relationship to <code>tweet:1</code> by deleting the tuple:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">deletes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'tweet:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> deletes</span><span class="token operator">==</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"deletes": { "tuple_keys" : [{"user":"user:anne","relation":"reader","object":"tweet:1"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple delete --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> user:anne reader tweet:1</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">delete</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>With this, we have removed the <a href="/docs/modeling/building-blocks/direct-relationships">direct relationship</a> between Anne and <code>tweet:1</code>. And because our type definition for <code>reader</code> does not include any other relations, a call to the Check API will now return a negative response.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'tweet:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader tweet:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"reader","object":"tweet:1"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">tweet:1</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to manage user access.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Direct Access</span><p class="documentation-card-box-description_u7_j">Learn about how to model granting user access to an object.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/direct-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Public Access</span><p class="documentation-card-box-description_u7_j">Learn about how to model granting public access.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/public-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">How to update relationship tuples</span><p class="documentation-card-box-description_u7_j">Learn about how to update relationship tuples in SDK.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/update-tuples">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/interacting/managing-user-access.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/interacting"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Interacting with the API</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/interacting/managing-group-access"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Managing Group Access</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#direct-access" class="table-of-contents__link toc-highlight">Direct Access</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-adding-direct-relationship" class="table-of-contents__link toc-highlight">01. Adding Direct Relationship</a></li><li><a href="#02-removing-direct-relationship" class="table-of-contents__link toc-highlight">02. Removing Direct Relationship</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/interacting/read-tuple-changes.html b/docs/interacting/read-tuple-changes.html index a96346ed8..4c238372e 100644 --- a/docs/interacting/read-tuple-changes.html +++ b/docs/interacting/read-tuple-changes.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-user-access">Manage User Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-access">Manage Group Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-membership">Manage Group Membership</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-relationships-between-objects">Manage Relationships Between Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/transactional-writes">Transactional Writes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/relationship-queries">Relationship Queries</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/interacting/read-tuple-changes">Get Tuple Changes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/search-with-permissions">Search with Permissions</a></li></ul></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/interacting"><span itemprop="name">Interacting with the API</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Get Tuple Changes</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>How to get tuple changes</h1><p>This section illustrates how to call the Read Changes API to get the list of relationship tuple changes that happened in your store, in the exact order that they happened. The API response includes tuples that have been added or removed in your store. It does not include other changes, like updates to your authorization model and adding new assertions.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before you start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before you start" title="Direct link to Before you start">​</a></h2><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/modeling">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples#02-calling-write-api-to-add-new-relationship-tuples">added some <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/modeling">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples#02-calling-write-api-to-add-new-relationship-tuples">added some <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/modeling">configured the <em>authorization model</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/getting-started/install-sdk">installed the SDK</a>.</li><li>You have <a href="/docs/modeling">configured the <em>authorization model</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><ol><li>Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN.</li><li>You have <a href="/docs/modeling">configured the <em>authorization model</em></a> and <a href="/docs/getting-started/update-tuples#02-calling-write-api-to-add-new-relationship-tuples">added some <em>relationship tuples</em></a>.</li><li>You have loaded <code>FGA_STORE_ID</code> and <code>FGA_API_HOST</code> as environment variables.</li></ol></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>To get a chronologically ordered list of tuples that have been written or deleted in your store, you can do so by calling the Read Changes API.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-configure-the--api-client">01. Configure The <!-- -->OpenFGA<!-- --> API Client<a href="#01-configure-the--api-client" class="hash-link" aria-label="Direct link to 01-configure-the--api-client" title="Direct link to 01-configure-the--api-client">​</a></h3><p>First you will need to configure the API client.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>To obtain the <a href="https://auth0.com/docs/authorization/flows/call-your-api-using-the-client-credentials-flow" target="_blank" rel="noopener noreferrer">access token</a>:</p><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-get-changes-for-all-object-types">02. Get Changes For All Object Types<a href="#02-get-changes-for-all-object-types" class="hash-link" aria-label="Direct link to 02. Get Changes For All Object Types" title="Direct link to 02. Get Changes For All Object Types">​</a></h3><p>To get a paginated list of changes that happened in your store:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> type </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> continuationToken </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> pageSize </span><span class="token operator">=</span><span class="token plain"> </span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">readChanges</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> type </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> pageSize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> continuationToken </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientReadChangesOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> PageSize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrInt32</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientReadChangesRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ReadChanges</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadChangesRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadChangesOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> PageSize </span><span class="token operator">=</span><span class="token plain"> </span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ReadChanges</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientReadChangesRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> new ClientReadChangesOptions </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> page_size</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_changes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple changes --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/changes </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"page_size": 25}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The result will contain an array of up to 25 tuples, with the operation (<code>write</code> or <code>delete</code>), and the timestamp in which that operation took place. The result will also contain a continuation token. Save the continuation token in persistent storage between calls so that it is not lost and you do not have to restart from scratch on system restart or on error.</p><p>You can then use this token to get the next set of changes:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> type </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> continuationToken </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ=="</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> pageSize </span><span class="token operator">=</span><span class="token plain"> </span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">readChanges</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> type </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> pageSize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> continuationToken </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientReadChangesOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> PageSize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrInt32</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContinuationToken</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ=="</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientReadChangesRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ReadChanges</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadChangesRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadChangesOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> PageSize </span><span class="token operator">=</span><span class="token plain"> </span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContinuationToken </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ=="</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ReadChanges</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientReadChangesRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> new ClientReadChangesOptions </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> page_size</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> continuation_token</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ=="</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_changes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple changes --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/changes </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"continuation_token": "eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==", "page_size": 25}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Once there are no more changes to retrieve, the API will return the same token as the one you sent. Save the token in persistent storage to use at a later time.</p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><ul><li>The default page size is 50. The maximum page size allowed is 100.</li><li>The API response will not return all the changes immediately. There will be a delay of one minute between the time that you add or delete a tuple and the time that you see it in the Read Changes API response.</li><li>The API response does not expand the tuples. If you wrote a tuple that includes a userset, like <code>{"user": "group:abc#member", "relation": "owner": "doc:budget"}</code>, the Read Changes API will return that exact tuple.</li></ul></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-get-changes-for-a-specific-object-type">03. Get Changes For A Specific Object Type<a href="#03-get-changes-for-a-specific-object-type" class="hash-link" aria-label="Direct link to 03. Get Changes For A Specific Object Type" title="Direct link to 03. Get Changes For A Specific Object Type">​</a></h3><p>Imagine you have the following authorization model:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">group</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[group#member, user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">doc</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[group#member, user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>It is possible to get a list of changes that happened in your store that relate only to one specific object type, like <code>folder</code>, by issuing a call like this:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> type </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> continuationToken </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> pageSize </span><span class="token operator">=</span><span class="token plain"> </span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">readChanges</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> type </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> pageSize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> continuationToken </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientReadChangesOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> PageSize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrInt32</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientReadChangesRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Type</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ReadChanges</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadChangesRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> Type </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadChangesOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> PageSize </span><span class="token operator">=</span><span class="token plain"> </span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ReadChanges</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientReadChangesRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> new ClientReadChangesOptions </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> page_size</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_changes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple changes --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --type folder</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/changes </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"type": folder", "page_size": 25}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The response will include a continuation token. In subsequent calls, you have to include the token and the <code>type</code>. (If you send this continuation token without the <code>type</code> parameter set, you will get an error).</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> type </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> continuationToken </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ=="</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> pageSize </span><span class="token operator">=</span><span class="token plain"> </span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">readChanges</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> type </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> pageSize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> continuationToken </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientReadChangesOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> PageSize</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrInt32</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContinuationToken</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ=="</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientReadChangesRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Type</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ReadChanges</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadChangesRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> Type </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadChangesOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> PageSize </span><span class="token operator">=</span><span class="token plain"> </span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContinuationToken </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ=="</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ReadChanges</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientReadChangesRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> new ClientReadChangesOptions </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> page_size</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token number">25</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> continuation_token</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ=="</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_changes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple changes --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --type folder</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/changes </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"type": folder", "continuation_token": "eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==", "page_size": 25}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/interacting/read-tuple-changes.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/interacting/relationship-queries"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Relationship Queries: Check, Read, Expand, and ListObjects</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/interacting/search-with-permissions"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Search With Permissions</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before you start</a></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-configure-the--api-client" class="table-of-contents__link toc-highlight">01. Configure The <productname format="{ProductNameFormat.ShortForm}/"> API Client</productname></a></li><li><a href="#02-get-changes-for-all-object-types" class="table-of-contents__link toc-highlight">02. Get Changes For All Object Types</a></li><li><a href="#03-get-changes-for-a-specific-object-type" class="table-of-contents__link toc-highlight">03. Get Changes For A Specific Object Type</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/interacting/relationship-queries.html b/docs/interacting/relationship-queries.html index 2877c260d..28b1417f6 100644 --- a/docs/interacting/relationship-queries.html +++ b/docs/interacting/relationship-queries.html @@ -15,8 +15,8 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> @@ -25,7 +25,7 @@ and <code>writer</code>. All writers are readers. <code>bob</code> has a <code>writer</code> relationship with <code>document:planning</code>.</p></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">reader</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Bob has writer relationship with planning document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="direct-access">Direct Access<a href="#direct-access" class="hash-link" aria-label="Direct link to Direct Access" title="Direct link to Direct Access">​</a></h3><p>You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. <a href="/docs/modeling/direct-access">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="check">Check<a href="#check" class="hash-link" aria-label="Direct link to Check" title="Direct link to Check">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-it-for">What Is It For?<a href="#what-is-it-for" class="hash-link" aria-label="Direct link to What Is It For?" title="Direct link to What Is It For?">​</a></h3><p>The <a href="/api/service#Relationship%20Queries/Check">Check API</a> is an API endpoint that returns whether the user has a certain relationship with an object. <!-- -->OpenFGA<!-- --> will resolve all prerequisite relationships to establish whether a relationship exists.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="when-to-use">When To Use?<a href="#when-to-use" class="hash-link" aria-label="Direct link to When To Use?" title="Direct link to When To Use?">​</a></h3><p>Check can be called if you need to establish whether a particular user has a specific relationship with a particular object.</p><p>For example, you can call check to determine whether <code>bob</code> has a <code>reader</code> relationship with <code>document:planning</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob reader document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:bob","relation":"reader","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bob</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The <!-- -->OpenFGA<!-- --> API will return <code>true</code> because there is an implied relationship as</p><ul><li>every <code>writer</code> is also a <code>reader</code></li><li><code>bob</code> is a <code>writer</code> for <code>document:planning</code></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="caveats-and-when-not-to-use-it">Caveats And When Not To Use It<a href="#caveats-and-when-not-to-use-it" class="hash-link" aria-label="Direct link to Caveats And When Not To Use It" title="Direct link to Caveats And When Not To Use It">​</a></h3><p>Check is designed to answer the question "Does user:X have relationship Y with object:Z?". It is <em>not</em> designed to answer the following questions:</p><ul><li>"Who has relationship Y with object:Z?"</li><li>"What are the objects that userX has relationship Y with?"</li><li>"Why does user:X have relationship Y with object:Z?"</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="read">Read<a href="#read" class="hash-link" aria-label="Direct link to Read" title="Direct link to Read">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-it-for-1">What Is It For?<a href="#what-is-it-for-1" class="hash-link" aria-label="Direct link to What Is It For?" title="Direct link to What Is It For?">​</a></h3><p>The <a href="/api/service#Relationship%20Tuples/Read">Read API</a> is an API endpoint that returns the relationship tuples that are stored in the system that satisfy a query.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="when-to-use-1">When To Use?<a href="#when-to-use-1" class="hash-link" aria-label="Direct link to When To Use?" title="Direct link to When To Use?">​</a></h3><p>Read can be called if you need to get all the stored relationship tuples that relate:</p><ol><li><a href="#1-a-particular-user-to-any-objects-of-a-specific-type-with-a-particular-relation">a particular user to any objects of a specific type with a particular relation</a></li><li><a href="#2-a-particular-user-to-any-objects-of-a-specific-type-with-any-relation">a particular user to any objects of a specific type with any relation</a></li><li><a href="#3-a-particular-object-to-any-user-with-a-particular-relation">a particular object to any user with a particular relation</a></li></ol><h4 class="anchor anchorWithStickyNavbar_LWe7" id="1-a-particular-user-to-any-objects-of-a-specific-type-with-a-particular-relation">1. A Particular User To Any Objects Of A Specific Type With A Particular Relation<a href="#1-a-particular-user-to-any-objects-of-a-specific-type-with-a-particular-relation" class="hash-link" aria-label="Direct link to 1. A Particular User To Any Objects Of A Specific Type With A Particular Relation" title="Direct link to 1. A Particular User To Any Objects Of A Specific Type With A Particular Relation">​</a></h4><p>For example, to query all the stored relationship tuples <code>bob</code> has a <code>writer</code> relationship with, one can ask</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Execute a read</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> tuples </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">'document:'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// tuples = [{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientReadOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientReadRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "tuples": [{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "tuples": [{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> TupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response = ReadResponse({"tuples":[{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}]})</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">read</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --user user:bob --relation writer --object document:</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/read </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"tuple_key":{"user":"user:bob","relation":"writer","object":"document:"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: "tuples": {[{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}]}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">read</span><span class="token plain"> all stored tuples</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, // where user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bob</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> has </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$(</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">opts.relation ? </span><span class="token variable string" style="color:rgb(255, 121, 198);font-style:italic">''</span><span class="token variable builtin class-name" style="color:rgb(189, 147, 249);font-style:italic">:</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic"> </span><span class="token variable string" style="color:rgb(255, 121, 198);font-style:italic">'any '</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic"> </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">)</span><span class="token plain">relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">, // </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">writer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token plain">, // with the </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">type</span><span class="token plain"> </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: tuples:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"key"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">, </span><span class="token string" style="color:rgb(255, 121, 198)">"timestamp"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"2021-10-06T15:32:11.128Z"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="2-a-particular-user-to-any-objects-of-a-specific-type-with-any-relation">2. A Particular User To Any Objects Of A Specific Type With Any Relation<a href="#2-a-particular-user-to-any-objects-of-a-specific-type-with-any-relation" class="hash-link" aria-label="Direct link to 2. A Particular User To Any Objects Of A Specific Type With Any Relation" title="Direct link to 2. A Particular User To Any Objects Of A Specific Type With Any Relation">​</a></h4><p>For example, to query all the stored relationship tuples in which <code>bob</code> is related to objects of type <code>document</code> as any relation, one can issue the following call:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Execute a read</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> tuples </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">'document:'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// tuples = [{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientReadOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientReadRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "tuples": [{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "tuples": [{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> TupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response = ReadResponse({"tuples":[{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}]})</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">read</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --user user:bob --object document:</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/read </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"tuple_key":{"user":"user:bob","object":"document:"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: "tuples": {[{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}]}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">read</span><span class="token plain"> all stored tuples</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, // where user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bob</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> has </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$(</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">opts.relation ? </span><span class="token variable string" style="color:rgb(255, 121, 198);font-style:italic">''</span><span class="token variable builtin class-name" style="color:rgb(189, 147, 249);font-style:italic">:</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic"> </span><span class="token variable string" style="color:rgb(255, 121, 198);font-style:italic">'any '</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic"> </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">)</span><span class="token plain">relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token plain">, // with the </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">type</span><span class="token plain"> </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: tuples:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"key"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">, </span><span class="token string" style="color:rgb(255, 121, 198)">"timestamp"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"2021-10-06T15:32:11.128Z"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="3-a-particular-object-to-any-user-with-a-particular-relation">3. A Particular Object To Any User With A Particular Relation<a href="#3-a-particular-object-to-any-user-with-a-particular-relation" class="hash-link" aria-label="Direct link to 3. A Particular Object To Any User With A Particular Relation" title="Direct link to 3. A Particular Object To Any User With A Particular Relation">​</a></h4><p>For example, to query all the stored relationship tuples in which any user is related to <code>document:planning</code> as a <code>writer</code>, one can issue the following call:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Execute a read</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> tuples </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// tuples = [{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientReadOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientReadRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "tuples": [{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "tuples": [{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> TupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response = ReadResponse({"tuples":[{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}]})</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">read</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --relation writer --object document:planning</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/read </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"tuple_key":{"relation":"writer","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: "tuples": {[{"key": {"user":"user:bob","relation":"writer","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}]}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">read</span><span class="token plain"> all stored tuples</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">for</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">users</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">who</span><span class="token plain"> have relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">, // </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">writer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: tuples:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"key"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">, </span><span class="token string" style="color:rgb(255, 121, 198)">"timestamp"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"2021-10-06T15:32:11.128Z"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="caveats-and-when-not-to-use-it-1">Caveats And When Not To Use It<a href="#caveats-and-when-not-to-use-it-1" class="hash-link" aria-label="Direct link to Caveats And When Not To Use It" title="Direct link to Caveats And When Not To Use It">​</a></h3><p>The Read API will only return all the stored relationships that match the query specification. It does not expand or traverse the graph by taking the authorization model into account.</p><p>For example, if you specify that <code>writers</code> are <code>viewers</code> in the authorization model, the Read API will ignore that and it will return tuples where a user is a <code>viewer</code> if and only if the <code>(user_id, "viewer", object_type:object_id)</code> relationship tuple exists in the system.</p><p>In the following case, although all <code>writers</code> have reader <code>relationships</code> for document objects and <code>bob</code> is a <code>writer</code> for <code>document:planning</code>, if you query for all objects that <code>bob</code> has <code>reader</code> relationships, it will not return <code>document:planning</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Execute a read</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> tuples </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">'document:'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// tuples = []</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientReadOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientReadRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "tuples": [] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "tuples": [] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> TupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response = ReadResponse({"tuples":[]})</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">read</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --user user:bob --relation reader --object document:</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/read </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"tuple_key":{"user":"user:bob","relation":"reader","object":"document:"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: "tuples": {[]}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">read</span><span class="token plain"> all stored tuples</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, // where user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bob</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> has </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$(</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">opts.relation ? </span><span class="token variable string" style="color:rgb(255, 121, 198);font-style:italic">''</span><span class="token variable builtin class-name" style="color:rgb(189, 147, 249);font-style:italic">:</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic"> </span><span class="token variable string" style="color:rgb(255, 121, 198);font-style:italic">'any '</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic"> </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">)</span><span class="token plain">relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:"</span><span class="token plain">, // with the </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">type</span><span class="token plain"> </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: tuples:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Although bob is a writer to document:planning and every writer is also a reader, the Read API will return an empty list because there are no stored relationship tuples that relate bob to document:planning as reader.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="expand">Expand<a href="#expand" class="hash-link" aria-label="Direct link to Expand" title="Direct link to Expand">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-it-for-2">What Is It For?<a href="#what-is-it-for-2" class="hash-link" aria-label="Direct link to What Is It For?" title="Direct link to What Is It For?">​</a></h3><p>The <a href="/api/service#/Relationship%20Queries/Expand">Expand API</a> returns all users (including users and usersets) that have a specific relationship with an object. The response is represented as a tree of users or usersets. To build the full graph of access, you would need to recursively call expand on the leaves returned from the previous expand call.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="when-to-use-2">When To Use?<a href="#when-to-use-2" class="hash-link" aria-label="Direct link to When To Use?" title="Direct link to When To Use?">​</a></h3><p>Expand is used for debugging and to understand why a user has a particular relationship with a specific object.</p><p>For example, to understand why <code>bob</code> can have a <code>reader</code> relationship with <code>document:planning</code>, one could first call</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> tree </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">expand</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// expand all who has 'reader' relation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// with the object 'document:planning'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// tree = ...</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientExpandOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientExpandRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// expand all who has "reader" relation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// with the object "document:planning"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Expand</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { tree: ...}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientExpandRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// expand all who has "reader" relation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// with the object "document:planning"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Expand</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response = { tree: ... }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientExpandRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">expand</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response = ExpandResponse({"tree":...})</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query </span><span class="token function" style="color:rgb(80, 250, 123)">expand</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw reader document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"tree": ...}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/expand </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"tuple_key":{"relation":"reader","object":"document:planning"}, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"tree": ...}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">expand</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // </span><span class="token function" style="color:rgb(80, 250, 123)">expand</span><span class="token plain"> all </span><span class="token function" style="color:rgb(80, 250, 123)">who</span><span class="token plain"> has </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain">tree:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">..</span><span class="token plain">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The result of this call will be like</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tree"</span><span class="token operator">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"root"</span><span class="token operator">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning#reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"leaf"</span><span class="token operator">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computed"</span><span class="token operator">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"userset"</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning#writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>The returned tree will contain <code>writer</code>, for which we will call</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> tree </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">expand</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// expand all who has 'writer' relation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// with the object 'document:planning'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// tree = ...</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientExpandOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientExpandRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// expand all who has "writer" relation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// with the object "document:planning"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Expand</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { tree: ...}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientExpandRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// expand all who has "writer" relation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// with the object "document:planning"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Expand</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response = { tree: ... }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientExpandRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">expand</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response = ExpandResponse({"tree":...})</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query </span><span class="token function" style="color:rgb(80, 250, 123)">expand</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw writer document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"tree": ...}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/expand </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"tuple_key":{"relation":"writer","object":"document:planning"}, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"tree": ...}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">expand</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">, // </span><span class="token function" style="color:rgb(80, 250, 123)">expand</span><span class="token plain"> all </span><span class="token function" style="color:rgb(80, 250, 123)">who</span><span class="token plain"> has </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">writer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain">tree:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">..</span><span class="token plain">.</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The result of this call will be like</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tree"</span><span class="token operator">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"root"</span><span class="token operator">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning#writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"leaf"</span><span class="token operator">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"users"</span><span class="token operator">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"users"</span><span class="token operator">:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>From there, we will learn that</p><ul><li>those related to <code>document:planning</code> as <code>reader</code> are all those who are related to that document as <code>writer</code></li><li><code>bob</code> is related to <code>document:planning</code> as <code>writer</code></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="listobjects">ListObjects<a href="#listobjects" class="hash-link" aria-label="Direct link to ListObjects" title="Direct link to ListObjects">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-it-for-3">What Is It For?<a href="#what-is-it-for-3" class="hash-link" aria-label="Direct link to What Is It For?" title="Direct link to What Is It For?">​</a></h3><p>The <a href="/api/service#/Relationship%20Queries/ListObjects">ListObjects API</a> is an API endpoint that returns the list of all the objects of a particular type that a specific user has a specific relationship with.</p><p>It provides a solution to the <a href="/docs/interacting/search-with-permissions#option-3-build-a-list-of-ids-then-search">Search with Permissions (Option 3)</a> use case for access-aware filtering on small object collections.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="when-to-use-3">When To Use?<a href="#when-to-use-3" class="hash-link" aria-label="Direct link to When To Use?" title="Direct link to When To Use?">​</a></h3><p>Use the ListObjects API to get what objects a user can see based on the relationships they have. See <a href="/docs/interacting/search-with-permissions">Search with Permissions</a> for more guidance.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">listObjects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">type</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">contextual_tuples</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">tuple_keys</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:otherdoc"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.objects = ["document:otherdoc", "document:planning"]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientListObjectsOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientListObjectsRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Type</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContextualTuples</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:otherdoc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ListObjects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "objects": ["document:otherdoc", "document:planning"] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Type </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContextualTuples </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">_object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:otherdoc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">ListObjects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Objects = ["document:otherdoc", "document:planning"]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientListObjectsRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">type</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> contextual_tuples</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:otherdoc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">list_objects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.objects = ["document:otherdoc", "document:planning"]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query list-objects --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob reader document --contextual_tuples </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob reader document:otherdoc"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"objects": ["document:otherdoc", "document:planning"]}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/list-objects </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{ "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw",</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> "type": "document",</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> "relation": "reader",</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> "user":"user:bob",</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> "contextual_tuples": {</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> "tuple_keys": [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> {"object": "document:otherdoc", "relation": "reader", "user": "user:bob"}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> ]</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token string" style="color:rgb(255, 121, 198)"> }'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"objects": ["document:otherdoc", "document:planning"]}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">listObjects</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, // list the objects that the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bob</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token plain">, // and that are of </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">type</span><span class="token plain"> </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain">, // </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">for</span><span class="token plain"> this particular authorization model </span><span class="token function" style="color:rgb(80, 250, 123)">id</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> contextual_tuples </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"> // Assuming the following is </span><span class="token boolean">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain">user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:otherdoc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token string" style="color:rgb(255, 121, 198)">"document:otherdoc"</span><span class="token plain">, </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>There's two variations of the List Objects API.</p><ul><li>The <a href="/api/service#Relationship%20Queries/ListObjects">standard version</a>, which waits until all results are ready and sends them in one response.</li><li>The <a href="/api/service#Relationship%20Queries/StreamedListObjects">streaming version</a>, which should be used if you want the individual results as soon as they become available.</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="caveats">Caveats<a href="#caveats" class="hash-link" aria-label="Direct link to Caveats" title="Direct link to Caveats">​</a></h3><p>ListObjects will return the results found within the time allotted (<code>listObjectsDeadline</code>, default: <code>3s</code>) up to the maximum number of results configured (<code>listObjectsMaxResults</code>, default: <code>1000</code>). See <a href="/docs/getting-started/setup-openfga/docker#configuring-the-server">Configuring the Server</a>) for more on how to change the default configuration.</p><ul><li>If you set <code>listObjectsDeadline</code> to <code>1s</code>, the server will spend at most 1 second finding results.</li><li>If you set <code>listObjectsMaxResults</code> to <code>10</code>, the server will return, at most, 10 objects.</li></ul><p>If the number of objects of that type is high, you should set a high value for <code>listObjectsDeadline</code>. If the number of objects of that type the user could have access to is high, you should set a high value for <code>listObjectsMaxResults</code>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="summary">Summary<a href="#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary">​</a></h2><table><thead><tr><th></th><th>Check</th><th>Read</th><th>Expand</th><th>ListObjects</th></tr></thead><tbody><tr><td>Purpose</td><td>Check if user has particular relationship with certain object</td><td>Return all stored relationship tuples that match query</td><td>Expand the specific relationship on a particular object</td><td>List all objects of a particular type that a user has a specific relationship with</td></tr><tr><td>When to use</td><td>Validate if user X can perform Y on object Z</td><td>List stored relationships in system</td><td>Understand why user X can perform Y on object Z</td><td>Filter the objects a user has access to</td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check out this additional content for more information on how to query relationships.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Check API Reference</span><p class="documentation-card-box-description_u7_j">Official reference guide for the Check API</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/api/service#Relationship%20Queries/Check">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Read API Reference</span><p class="documentation-card-box-description_u7_j">Official reference guide for the Read API</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/api/service#Relationship%20Tuples/Read">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Expand API Reference</span><p class="documentation-card-box-description_u7_j">Official reference guide for the Expand API</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/api/service#Relationship%20Queries/Expand">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">ListObjects API Reference</span><p class="documentation-card-box-description_u7_j">Official reference guide for the ListObjects API</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/api/service#Relationship%20Queries/ListObjects">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/interacting/relationship-queries.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/interacting/transactional-writes"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Transactional Writes</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/interacting/read-tuple-changes"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">How to get tuple changes</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#direct-access" class="table-of-contents__link toc-highlight">Direct Access</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#check" class="table-of-contents__link toc-highlight">Check</a><ul><li><a href="#what-is-it-for" class="table-of-contents__link toc-highlight">What Is It For?</a></li><li><a href="#when-to-use" class="table-of-contents__link toc-highlight">When To Use?</a></li><li><a href="#caveats-and-when-not-to-use-it" class="table-of-contents__link toc-highlight">Caveats And When Not To Use It</a></li></ul></li><li><a href="#read" class="table-of-contents__link toc-highlight">Read</a><ul><li><a href="#what-is-it-for-1" class="table-of-contents__link toc-highlight">What Is It For?</a></li><li><a href="#when-to-use-1" class="table-of-contents__link toc-highlight">When To Use?</a></li><li><a href="#caveats-and-when-not-to-use-it-1" class="table-of-contents__link toc-highlight">Caveats And When Not To Use It</a></li></ul></li><li><a href="#expand" class="table-of-contents__link toc-highlight">Expand</a><ul><li><a href="#what-is-it-for-2" class="table-of-contents__link toc-highlight">What Is It For?</a></li><li><a href="#when-to-use-2" class="table-of-contents__link toc-highlight">When To Use?</a></li></ul></li><li><a href="#listobjects" class="table-of-contents__link toc-highlight">ListObjects</a><ul><li><a href="#what-is-it-for-3" class="table-of-contents__link toc-highlight">What Is It For?</a></li><li><a href="#when-to-use-3" class="table-of-contents__link toc-highlight">When To Use?</a></li><li><a href="#caveats" class="table-of-contents__link toc-highlight">Caveats</a></li></ul></li><li><a href="#summary" class="table-of-contents__link toc-highlight">Summary</a></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/interacting/search-with-permissions.html b/docs/interacting/search-with-permissions.html index e1aeb1a28..4202ffdce 100644 --- a/docs/interacting/search-with-permissions.html +++ b/docs/interacting/search-with-permissions.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-user-access">Manage User Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-access">Manage Group Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-membership">Manage Group Membership</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-relationships-between-objects">Manage Relationships Between Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/transactional-writes">Transactional Writes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/relationship-queries">Relationship Queries</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/read-tuple-changes">Get Tuple Changes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/interacting/search-with-permissions">Search with Permissions</a></li></ul></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/interacting"><span itemprop="name">Interacting with the API</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Search with Permissions</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Search With Permissions</h1><p>Once you implement fine-grained authorization to protect your resources, search becomes a more complex problem, because the user's access to each resource now has to be validated before the resource can be shown.</p><p>The search problem can then be summarized as:</p><blockquote><p>"Given a particular search filter and a sort order, what objects can the user access"?</p></blockquote><p>The <!-- -->OpenFGA<!-- --> service does not store object metadata (names of files, creation dates, time of last update, etc), which means completing any search request by filtering and sorting according to certain criteria will require data from your database.</p><p>The services responsible for performing these actions are:</p><ul><li>Filter: Your database</li><li>Sort: Your database</li><li>Authorize: <!-- -->OpenFGA</li></ul><p>To return the set of results that match the user's search query, you will need to get the intersection of the results from the services above.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="possible-options">Possible Options<a href="#possible-options" class="hash-link" aria-label="Direct link to Possible Options" title="Direct link to Possible Options">​</a></h2><p>There are three possible ways to do this:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="option-1-search-then-check">Option 1: Search, Then Check<a href="#option-1-search-then-check" class="hash-link" aria-label="Direct link to Option 1: Search, Then Check" title="Direct link to Option 1: Search, Then Check">​</a></h3><p>Pre-filter, then call <!-- -->OpenFGA<!-- --> Check endpoint.</p><ol><li>Filter and sort on your database.</li><li>Call <a href="/docs/interacting/relationship-queries#check"><code>/check</code></a> in parallel on each object returned from your database.</li><li>Filter out objects the user does not have access to.</li><li>Return the filtered result to the user.</li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="option-2-build-a-local-index-from-changes-endpoint-search-then-check">Option 2: Build A Local Index From Changes Endpoint, Search, Then Check<a href="#option-2-build-a-local-index-from-changes-endpoint-search-then-check" class="hash-link" aria-label="Direct link to Option 2: Build A Local Index From Changes Endpoint, Search, Then Check" title="Direct link to Option 2: Build A Local Index From Changes Endpoint, Search, Then Check">​</a></h3><p>Consume the <code>GET /changes</code> endpoint to create a local index you can use to do an intersection on the two sets of results.</p><ol><li>Call the <a href="/api/service#Relationship%20Tuples/ReadChanges">OpenFGA changes API</a>.</li><li>For the particular authorization model version(s) you are using in production, flatten/expand the changes (e.g. <code>user:anne, writer, doc:planning</code> becomes two tuples: <code>user:anne, writer, doc:planning</code> and <code>user:anne, reader, doc:planning</code>).</li><li>Build the intersection between the objects in your database and the flattened/expanded state you created.</li><li>You can then call <code>/check</code> on each resource in the resulting set before returning the response to filter out any resource with permissions revoked but whose authorization data has not made it into your index yet.</li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="option-3-build-a-list-of-ids-then-search">Option 3: Build A List Of IDs, Then Search<a href="#option-3-build-a-list-of-ids-then-search" class="hash-link" aria-label="Direct link to Option 3: Build A List Of IDs, Then Search" title="Direct link to Option 3: Build A List Of IDs, Then Search">​</a></h3><p>Call the <code>GET /list-objects</code> API to get a list of object IDs the user has access to, then run the filter restricting by the object IDs returned.</p><ol><li>Call the <a href="/api/service#Relationship%20Queries/ListObjects">OpenFGA List Objects API</a>. to get the list of all resources a user can access.</li><li>Pass in the set of object IDs to the database query to limit the search.</li><li>Return the filtered result to the user.</li></ol><h2 class="anchor anchorWithStickyNavbar_LWe7" id="choosing-the-best-option">Choosing The Best Option<a href="#choosing-the-best-option" class="hash-link" aria-label="Direct link to Choosing The Best Option" title="Direct link to Choosing The Best Option">​</a></h2><p>Which option to choose among the three listed above depends on the following criteria:</p><ol><li>Number of objects that your database can return from a search query</li><li>Number of objects of a certain type the user could have access to</li><li>Percentage of objects in a type the user could have access to</li></ol><p>Consider the following scenarios:</p><p><strong>A.</strong> The <em>number of objects a search query could return from the database</em> is <em>low</em>.</p><p><strong><a href="#option-1-search-then-check">Search then Check</a></strong> is the recommended solution.</p><p>Use-case: Situations where the search query can be optimized to return a small number of results.</p><p><strong>B.</strong> The <em>number of objects of a certain type the user could have access to</em> is <em>low</em>, and the <em>percentage of objects in a namespace a user could have access to</em> is <em>high</em>.</p><p><strong><a href="#option-1-search-then-check">Search then Check</a></strong> is recommended to get the final list of results.</p><p>Note that this use case, because the user has access to a low number of objects which are still a high percentage of the total objects in the system, that means that the total number of objects in the system is low.</p><p><strong>C.</strong> The <em>number of objects of a certain type the user could have access to</em> is <em>low</em> (~ 100), and the <em>percentage of the total objects that the user can have access to</em> is also <em>low</em>.</p><p>In this case, an API to return the list of all objects a user can access would make sense. You can query this API to get a list of object IDs and then pass these IDs to your filter function to limit the search to them.</p><p>As this number increases, this solution becomes impractical, because you would need to paginate over multiple pages to get the entire list before being able to search and sort. A partial list from the API is not enough, because you won't be able to sort using it.</p><p>So while <strong><a href="#option-3-build-a-list-of-ids-then-search">List of IDs then Search</a></strong> would be useful for this in some situations, we would recommend <strong><a href="#option-2-build-a-local-index-from-changes-endpoint-search-then-check">Local Index from Changes Endpoint, Search then Check</a></strong> for the cases when the number of objects is high enough. Until <!-- -->OpenFGA<!-- --> implements an endpoint to return a list of object IDs, local index is recommended for all situations.</p><p><strong>D.</strong> The <em>number of objects of a certain type the user could have access to</em> is <em>high</em>, and the <em>percentage of the total objects that the user can have access to</em> is <em>low</em>.</p><p>The recommended option for this case is to use <strong><a href="#option-2-build-a-local-index-from-changes-endpoint-search-then-check">Local Index from Changes Endpoint, Search then Check</a></strong>.</p><ul><li><p><em>List of IDs then Search</em> would not work because you would have to get and paginate across thousands or tens of thousands (or in some cases more) of results from <!-- -->OpenFGA<!-- -->, only after you have retrieved the entire set can you start searching within your database for matching results. This would mean that your user could be waiting for a long time before they can start seeing results.</p></li><li><p><em>Search then Check</em> would also not be ideal, as you will be retrieving and checking against a lot of items and discarding most of them.</p></li></ul><p>Use case: Searching in Google Drive, where the list of documents and folders that a user has access to can be very high, but it still is a small percentage of the entire set of documents in Google Drive.</p><p><strong>E.</strong> The <em>number of objects of a certain type the user could have access to</em> is <em>high</em>, and the <em>percentage of the total objects that the user can have access to</em> is also <em>high</em>.</p><p>In this case a <strong><a href="#option-2-build-a-local-index-from-changes-endpoint-search-then-check">Local Index from Changes Endpoint, Search then Check</a></strong> would be useful. If you do not want to maintain a local index, and if the user can access a high percentage of the total, meaning that the user is more likely than not to have access to the results returned by the search query, then <strong><a href="#option-1-search-then-check">Search then Check</a></strong> would work just as well.</p><p>Use-case: Searching on Twitter. Most Twitter users have their profiles set to public, so the user is more likely to have access to the tweets when performing a search. So searching first then running checks against the set of returned results would be appropriate.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="summary">Summary<a href="#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary">​</a></h2><table><thead><tr><th>Scenario</th><th>Use Case</th><th># of objects returned from database query</th><th># of objects user can access in a type</th><th>% of objects user can access in a type</th><th>Preferred Option</th></tr></thead><tbody><tr><td>A</td><td>Search criteria enough to narrow down results</td><td>Low</td><td>-</td><td>-</td><td><a href="#option-1-search-then-check">1</a></td></tr><tr><td>B</td><td>Few objects the user has access to, but still a high % of total objects</td><td>Low</td><td>Low</td><td>High</td><td><a href="#option-1-search-then-check">1</a></td></tr><tr><td>C</td><td>Cannot narrow down search results, very high probability search returns objects user cannot access, total number of objects user can access is low enough to fit in a response</td><td>High</td><td>Low</td><td>Low</td><td><a href="#option-3-build-a-list-of-ids-then-search">3</a> or <a href="#option-2-build-a-local-index-from-changes-endpoint-search-then-check">2</a></td></tr><tr><td>D</td><td>Google Drive: User has access to a lot of documents, but low percentage from total</td><td>High</td><td>High</td><td>Low</td><td><a href="#option-2-build-a-local-index-from-changes-endpoint-search-then-check">2</a></td></tr><tr><td>E</td><td>Twitter Search: Most profiles are public, and the user can access them</td><td>High</td><td>High</td><td>High</td><td><a href="#option-1-search-then-check">1</a> or <a href="#option-2-build-a-local-index-from-changes-endpoint-search-then-check">2</a></td></tr></tbody></table></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/interacting/search-with-permissions.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/interacting/read-tuple-changes"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">How to get tuple changes</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#possible-options" class="table-of-contents__link toc-highlight">Possible Options</a><ul><li><a href="#option-1-search-then-check" class="table-of-contents__link toc-highlight">Option 1: Search, Then Check</a></li><li><a href="#option-2-build-a-local-index-from-changes-endpoint-search-then-check" class="table-of-contents__link toc-highlight">Option 2: Build A Local Index From Changes Endpoint, Search, Then Check</a></li><li><a href="#option-3-build-a-list-of-ids-then-search" class="table-of-contents__link toc-highlight">Option 3: Build A List Of IDs, Then Search</a></li></ul></li><li><a href="#choosing-the-best-option" class="table-of-contents__link toc-highlight">Choosing The Best Option</a></li><li><a href="#summary" class="table-of-contents__link toc-highlight">Summary</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/interacting/transactional-writes.html b/docs/interacting/transactional-writes.html index 1026c45ee..64d2bba2c 100644 --- a/docs/interacting/transactional-writes.html +++ b/docs/interacting/transactional-writes.html @@ -15,15 +15,15 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-user-access">Manage User Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-access">Manage Group Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-group-membership">Manage Group Membership</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/managing-relationships-between-objects">Manage Relationships Between Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/interacting/transactional-writes">Transactional Writes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/relationship-queries">Relationship Queries</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/read-tuple-changes">Get Tuple Changes</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/interacting/search-with-permissions">Search with Permissions</a></li></ul></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/interacting"><span itemprop="name">Interacting with the API</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Transactional Writes</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Transactional Writes</h1><p>In this guide you will learn how to update multiple <a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuples</a> in a single transaction.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>Updating multiple relationship tuples is useful to keep system state consistent.</p></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>Assume that you have the following <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>.<br> You have a <a href="/docs/concepts#what-is-a-type">type</a> called <code>tweet</code> that can have a <code>reader</code>. You have another type called <code>user</code> that can have a <code>follower</code> and <code>followed_by</code> relationship.</p></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">tweet</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, user:*, user#follower]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">follower</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">followed_by</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"wildcard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"follower"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"follower"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"followed_by"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"follower"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"followed_by"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="direct-access">Direct Access<a href="#direct-access" class="hash-link" aria-label="Direct link to Direct Access" title="Direct link to Direct Access">​</a></h3><p>You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. <a href="/docs/modeling/direct-access">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-public-access">Modeling Public Access<a href="#modeling-public-access" class="hash-link" aria-label="Direct link to Modeling Public Access" title="Direct link to Modeling Public Access">​</a></h3><p>You need to know how to grant public access to an object. <a href="/docs/modeling/public-access">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-adding-and-removing-relationship-tuples-in-the-same-transaction">01. Adding And Removing Relationship Tuples In The Same Transaction<a href="#01-adding-and-removing-relationship-tuples-in-the-same-transaction" class="hash-link" aria-label="Direct link to 01. Adding And Removing Relationship Tuples In The Same Transaction" title="Direct link to 01. Adding And Removing Relationship Tuples In The Same Transaction">​</a></h3><p>When you need to add or delete tuples in your store, you can do so by calling the Write API. For example, if you want to make <code>tweet:1</code> public by making everyone a <code>viewer</code>, you write one tuple:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:*'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'tweet:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:*","relation":"viewer","object":"tweet:1"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:* viewer tweet:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>And if you want to convert this <code>tweet</code> to private, you would need to delete that tuple:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">deletes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:*'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'tweet:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> deletes</span><span class="token operator">==</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"deletes": { "tuple_keys" : [{"user":"user:*","relation":"viewer","object":"tweet:1"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple delete --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> user:* viewer tweet:1</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">delete</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>By removing the tuple, we made the tweet visible to no-one, which may not be what we want.</p><p>The Write API allows you to send up to 10 unique tuples in the request. (This limit applies to the sum of both writes and deletes in that request). This means we can submit one API call that converts the <code>tweet</code> from public to visible to only the <code>user</code>'s followers.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne's followers can view tweet:1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne#follower'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'tweet:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">deletes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// tweet:1 is no longer viewable by everyone (*)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:*'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'tweet:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne's followers can view tweet:1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne#follower"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> Deletes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// tweet:1 is no longer viewable by everyone (*)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne's followers can view tweet:1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne#follower"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// tweet:1 is no longer viewable by everyone (*)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne's followers can view tweet:1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne#follower"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> deletes</span><span class="token operator">==</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># tweet:1 is no longer viewable by everyone (*)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne#follower","relation":"viewer","object":"tweet:1"}] },"deletes": { "tuple_keys" : [{"user":"user:*","relation":"viewer","object":"tweet:1"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne's followers can view tweet:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne#follower"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">delete</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // tweet:1 is no longer viewable by everyone </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">*</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"tweet:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-adding-multiple-related-relationship-tuples-in-the-same-transaction">02. Adding Multiple Related Relationship Tuples In The Same Transaction<a href="#02-adding-multiple-related-relationship-tuples-in-the-same-transaction" class="hash-link" aria-label="Direct link to 02. Adding Multiple Related Relationship Tuples In The Same Transaction" title="Direct link to 02. Adding Multiple Related Relationship Tuples In The Same Transaction">​</a></h3><p>Having the ability to send multiple tuples per request is also useful when you want to maintain consistency. For example, if <code>anne</code> starts following <code>becky</code>, we want to be able to save the following two tuples, or neither of them:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is a follower of Becky</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"follower"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Becky is followed by Anne</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"followed_by"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>We have a type called user in this case because users can be related to each other, so the users now are a type in the system</p></div></div><p>The <!-- -->OpenFGA<!-- --> service will attempt to perform all the changes sent in a single Write API call in one transaction. If it can't (for example, if any of the requested changes fails), it will reject all of the changes.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to update tuples.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Update relationship tuples in SDK</span><p class="documentation-card-box-description_u7_j">Learn about how to update relationship tuples in SDK.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/update-tuples">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA API</span><p class="documentation-card-box-description_u7_j">Details on the write API in the OpenFGA reference guide.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/api/service#Relationship%20Tuples/Write">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/interacting/transactional-writes.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/interacting/managing-relationships-between-objects"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Managing Relationships Between Objects</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/interacting/relationship-queries"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Relationship Queries: Check, Read, Expand, and ListObjects</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#direct-access" class="table-of-contents__link toc-highlight">Direct Access</a></li><li><a href="#modeling-public-access" class="table-of-contents__link toc-highlight">Modeling Public Access</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-adding-and-removing-relationship-tuples-in-the-same-transaction" class="table-of-contents__link toc-highlight">01. Adding And Removing Relationship Tuples In The Same Transaction</a></li><li><a href="#02-adding-multiple-related-relationship-tuples-in-the-same-transaction" class="table-of-contents__link toc-highlight">02. Adding Multiple Related Relationship Tuples In The Same Transaction</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling.html b/docs/modeling.html index 05d0a42a1..62e102480 100644 --- a/docs/modeling.html +++ b/docs/modeling.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible menu__list-item-collapsible--active"><a class="menu__link menu__link--sublist menu__link--active" aria-current="page" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Modeling Guides</span><meta itemprop="position" content="1"></li></ul></nav><div class="theme-doc-markdown markdown"><header><h1>Modeling Guides</h1></header><p>This section has guides, concepts and examples that help you define an authorization model.</p><div style="margin-top:2rem;margin-bottom:2rem"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div style="margin-top:0.75rem"><p class="documentation-card-box-description_u7_j">The content in this section is useful:</p><ul style="margin-top:2rem"><li>If you are starting with OpenFGA and want to learn how to represent your organization's/system's authorization needs.</li><li>If you are working on iterating on an authorization model you previously defined.</li></ul></div><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div><h1>Content</h1><div style="margin-top:2rem;margin-bottom:2rem"><div style="margin-top:2rem" class="column-layout-2_O2db"><div class="documentation-card-box-gradient_ZcEA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Getting Started</span><p class="documentation-card-box-description_u7_j">How to create an authorization model for your system starting from the requirements.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/getting-started">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div><div style="margin-top:2rem" class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Direct Access</span><p class="documentation-card-box-description_u7_j">Learn the basics of modeling authorization and granting access to users.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/direct-access">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">User Groups</span><p class="documentation-card-box-description_u7_j">Learn to model user group membership, and to grant access to all members of a group.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/user-groups">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Roles and Permissions</span><p class="documentation-card-box-description_u7_j">Learn to model roles for users at the object level and model permissions for those roles.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/roles-and-permissions">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Parent-Child objects</span><p class="documentation-card-box-description_u7_j">Learn to model access based on parent-child relationships, e.g.: folders and documents.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/parent-child">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Block Lists</span><p class="documentation-card-box-description_u7_j">Learn to model denying access if users are part of list of blocked users.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/blocklists">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Public Access</span><p class="documentation-card-box-description_u7_j">Learn to model giving everyone specific access to an object, e.g.: everyone can read.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/public-access">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Multiple Restrictions</span><p class="documentation-card-box-description_u7_j">Learn to model requiring multiple privileges before granting access.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/multiple-restrictions">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Custom Roles</span><p class="documentation-card-box-description_u7_j">Learn to model custom roles that are created by users.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/custom-roles">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Contextual and Time-Based Authorization</span><p class="documentation-card-box-description_u7_j">Learn to model and authorize when IP Address, time, and other dynamic and contextual restrictions are involved.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/contextual-time-based-authorization">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Authorization Through Organization Context</span><p class="documentation-card-box-description_u7_j">Learn to model and authorize when a user belongs to multiple organizations.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/organization-context-authorization">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div><div style="margin-top:2rem;border:1px solid #DADFE8"></div><div style="margin-top:2rem" class="column-layout-2_O2db"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Building Blocks</span><p class="documentation-card-box-description_u7_j">Learn the underlying concepts/building blocks that can be used to build any model.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/building-blocks">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Advanced Use-Cases</span><p class="documentation-card-box-description_u7_j">Explore advanced use cases and patterns for authorization modeling with OpenFGA.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Migrating</span><p class="documentation-card-box-description_u7_j">Learn to migrate relations and models in a production environment.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/migrating">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/overview.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started/tuples-api-best-practices"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Managing Tuples and Invoking API Best Practices</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/getting-started"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Get Started with Modeling</div></a></nav></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/advanced.html b/docs/modeling/advanced.html index 0a8bf2331..de4d482a3 100644 --- a/docs/modeling/advanced.html +++ b/docs/modeling/advanced.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible menu__list-item-collapsible--active"><a class="menu__link menu__link--sublist menu__link--active" aria-current="page" aria-expanded="true" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/gdrive">Google Drive</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/github">GitHub</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/slack">Slack</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/iot">IoT</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/entitlements">Entitlements</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Advanced Use-Cases</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Advanced Use-Cases</h1></header><p>This section will present advanced use cases and patterns for authorization modeling with <!-- -->OpenFGA<!-- -->.</p><div style="margin-top:2rem;margin-bottom:2rem"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div style="margin-top:0.75rem"><p class="documentation-card-box-description_u7_j">The content in this section is useful if you would like to follow an end-to-end tutorial on how to build an authorization model for a common use-case or pattern.</p></div><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-cases">Use-cases<a href="#use-cases" class="hash-link" aria-label="Direct link to Use-cases" title="Direct link to Use-cases">​</a></h2><div style="margin-top:2rem;margin-bottom:2rem"><div style="margin-top:2rem" class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Google Drive</span><p class="documentation-card-box-description_u7_j">How to create an authorization model for your system starting from the requirements.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/gdrive">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">GitHub</span><p class="documentation-card-box-description_u7_j">How to create an authorization model for your system starting from the requirements.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/github">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">IoT</span><p class="documentation-card-box-description_u7_j">How to create an authorization model for your system starting from the requirements.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/iot">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Slack</span><p class="documentation-card-box-description_u7_j">How to create an authorization model for your system starting from the requirements.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/slack">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="patterns">Patterns<a href="#patterns" class="hash-link" aria-label="Direct link to Patterns" title="Direct link to Patterns">​</a></h2><div style="margin-top:2rem;margin-bottom:2rem"><div style="margin-top:2rem" class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Entitlements</span><p class="documentation-card-box-description_u7_j">How to create an authorization model for your system starting from the requirements.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/entitlements">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/advanced/overview.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/building-blocks/usersets"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Usersets</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/advanced/gdrive"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Google Drive</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#use-cases" class="table-of-contents__link toc-highlight">Use-cases</a></li><li><a href="#patterns" class="table-of-contents__link toc-highlight">Patterns</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/advanced/entitlements.html b/docs/modeling/advanced/entitlements.html index 9ef22b0ea..d1cf35feb 100644 --- a/docs/modeling/advanced/entitlements.html +++ b/docs/modeling/advanced/entitlements.html @@ -15,19 +15,19 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/gdrive">Google Drive</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/github">GitHub</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/slack">Slack</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/iot">IoT</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/advanced/entitlements">Entitlements</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling/advanced"><span itemprop="name">Advanced Use-Cases</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Entitlements</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Modeling Entitlements for a System with <!-- -->OpenFGA</h1><p>This tutorial explains how to model entitlements for a platform like GitHub using <!-- -->OpenFGA<!-- -->.</p><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">What you will learn</span><div class="documentation-card-box-children_i280"><ul><li>How to model an entitlement use case in <a href="/docs/authorization-and-openfga#what-is-openfga">OpenFGA</a></li><li>How to start with a given set of requirements and scenarios and iterate on the <!-- -->OpenFGA<!-- --> model until those requirements are met</li></ul></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <!-- -->OpenFGA<!-- --> concepts and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><p>It would be helpful to have an understanding of some concepts of <!-- -->OpenFGA<!-- --> before you start.</p></summary><div><div class="collapsibleContent_i85q"><h4 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-object-to-object-relationships">Modeling Object-to-Object Relationships<a href="#modeling-object-to-object-relationships" class="hash-link" aria-label="Direct link to Modeling Object-to-Object Relationships" title="Direct link to Modeling Object-to-Object Relationships">​</a></h4><p>You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. <a href="/docs/modeling/building-blocks/object-to-object-relationships">Learn more →</a></p><p>Used here to indicate that members of an org are subscriber members of the plan the org is subscriber to, and subscriber members of a plan get access to all the plan's features.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="direct-relationships">Direct Relationships<a href="#direct-relationships" class="hash-link" aria-label="Direct link to Direct Relationships" title="Direct link to Direct Relationships">​</a></h4><p>You need to know how to disallow granting direct relation to an object and requiring the user to have a relation with another object that would imply a relation with the first one. <a href="/docs/modeling/building-blocks/direct-relationships">Learn more →</a></p><p>Used here to indicate that "access" to a feature cannot be directly granted to a user, but is implied through the users organization subscribing to a plan that offers that feature.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="concepts--configuration-language">Concepts & Configuration Language<a href="#concepts--configuration-language" class="hash-link" aria-label="Direct link to Concepts & Configuration Language" title="Direct link to Concepts & Configuration Language">​</a></h4><ul><li>Some <a href="/docs/concepts">OpenFGA Concepts</a></li><li><a href="/docs/configuration-language">Configuration Language</a></li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-you-will-be-modeling">What You Will Be Modeling<a href="#what-you-will-be-modeling" class="hash-link" aria-label="Direct link to What You Will Be Modeling" title="Direct link to What You Will Be Modeling">​</a></h2><p>In many product offerings, the features are behind multiple tiers. In this tutorial, you will build an authorization model for a subset of <a href="https://github.com/pricing" target="_blank" rel="noopener noreferrer">GitHub's entitlements</a> (detailed below) using <!-- -->OpenFGA<!-- -->. You will use some scenarios to validate the model.</p><p><img loading="lazy" alt="GitHub Pricing Plan" src="/assets/images/entitlements-image-pricing-github-2276507856dd07b091bcecc2376dde05.svg" width="1200" height="763" class="img_ev3q"></p><p>At their core, entitlements is just asking: does a user X have access to feature Y? In GitHub's case for example, they have a concept called "Draft Pull Requests". Once the user loads the Pull Request page, the frontend needs to know whether it can show the "Draft Pull Request" option, as in it needs to know: "Does the current user have access to feature Draft Pull Request?".</p><p><img loading="lazy" alt="GitHub PR Page with Draft Pull Request" src="/assets/images/entitlements-image-github-draft-pr-2ee031c09e3924b41681861e56aab2e7.svg" width="1796" height="756" class="img_ev3q"> <img loading="lazy" alt="GitHub PR Page without Draft Pull Request" src="/assets/images/entitlements-image-github-no-draft-pr-785626465cfe1b8183918ee6bd3aefb1.svg" width="1796" height="756" class="img_ev3q"></p><blockquote><p>Note: For brevity, this tutorial will not model all of GitHub entitlements. Instead, it will focus on modeling for the scenarios outlined below</p></blockquote><h3 class="anchor anchorWithStickyNavbar_LWe7" id="requirements">Requirements<a href="#requirements" class="hash-link" aria-label="Direct link to Requirements" title="Direct link to Requirements">​</a></h3><p>You will model an entitlement system similar to GitHub's, focusing on a few scenarios.</p><p>GitHub has 3 plans: "Free", "Team" and "Enterprise", with each of them offering several features. The higher-priced plans include all the features of the lower priced plans. You will be focusing on a subset of the features offered.</p><p>A summary of GitHub's entitlement system:</p><ul><li>Free<ul><li>Issues</li></ul></li><li>Team<ul><li><em>Everything from the free plan</em></li><li>Draft Pull Requests</li></ul></li><li>Enterprise<ul><li><em>Everything from the team plan</em></li><li>SAML Single Sign-On</li></ul></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="defined-scenarios">Defined Scenarios<a href="#defined-scenarios" class="hash-link" aria-label="Direct link to Defined Scenarios" title="Direct link to Defined Scenarios">​</a></h3><p>Use the following scenarios to be able to validate whether the model of the requirements is correct.</p><ul><li><p>Take these three organizations</p><ul><li>Alpha Beta Gamma (<code>alpha</code>), a <strong>subscriber</strong> on the <strong>free</strong> plan</li><li>Bayer Water Supplies (<code>bayer</code>), a <strong>subscriber</strong> on the <strong>team</strong> plan</li><li>Cups and Dishes (<code>cups</code>), a <strong>subscriber</strong> on the <strong>enterprise</strong> plan</li></ul></li><li><p>Take these three users</p><ul><li><strong>Anne</strong>, <strong>member</strong> of <strong>Alpha Beta Gamma</strong></li><li><strong>Beth</strong>, <strong>member</strong> of <strong>Bayer Water Supplies</strong></li><li><strong>Charles</strong>, <strong>member</strong> of <strong>Cups and Dishes</strong></li></ul></li></ul><p><img loading="lazy" alt="Image showing requirements" src="/assets/images/entitlements-requirements-fdd4048edc4d4b3b78785f4c0671e0b1.svg" width="940" height="750" class="img_ev3q"></p><p>By the end of this tutorial, you should be able to query <!-- -->OpenFGA<!-- --> with queries like:</p><ul><li><strong>Anne</strong> has access to <strong>Issues</strong> (expecting <code>yes</code>)</li><li><strong>Anne</strong> has access to <strong>Draft Pull Requests</strong> (expecting<code> no</code>)</li><li><strong>Anne</strong> has access to <strong>Single Sign-on</strong> (expecting<code> no</code>)</li><li><strong>Beth</strong> has access to <strong>Issues</strong> (expecting <code>yes</code>)</li><li><strong>Beth</strong> has access to <strong>Draft Pull Requests</strong> (expecting <code>yes</code>)</li><li><strong>Beth</strong> has access to <strong>Single Sign-on</strong> (expecting<code> no</code>)</li><li><strong>Charles</strong> has access to <strong>Issues</strong> (expecting <code>yes</code>)</li><li><strong>Charles</strong> has access to <strong>Draft Pull Requests</strong> (expecting <code>yes</code>)</li><li><strong>Charles</strong> has access to <strong>Single Sign-on</strong> (expecting <code>yes</code>)</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-entitlements-for-github">Modeling Entitlements For GitHub<a href="#modeling-entitlements-for-github" class="hash-link" aria-label="Direct link to Modeling Entitlements For GitHub" title="Direct link to Modeling Entitlements For GitHub">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-building-the-initial-authorization-model-and-relationship-tuples">01. Building The Initial Authorization Model And Relationship Tuples<a href="#01-building-the-initial-authorization-model-and-relationship-tuples" class="hash-link" aria-label="Direct link to 01. Building The Initial Authorization Model And Relationship Tuples" title="Direct link to 01. Building The Initial Authorization Model And Relationship Tuples">​</a></h3><p>In this tutorial you are going to take a different approach to previous tutorials. You will start with a simple<a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>, add <a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuples</a> to represent some sample scenarios, and iterate until those scenarios return the results you expect.</p><p>In the scenarios outlined above, you have <code>organizations</code>, <code>plans</code> and <code>features</code>.</p><p>Similar to the example above, start with a basic listing of the types and their relations:</p><ul><li>A <code>feature</code> has a <code>plan</code> associated to it, we'll call the relation between them <code>associated_plan</code></li><li>A <code>plan</code> has an organization as a <code>subscriber</code> to it</li><li>An <code>organization</code> has users as <code>members</code></li></ul><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-populating-the-relationship-tuples">02. Populating The Relationship Tuples<a href="#02-populating-the-relationship-tuples" class="hash-link" aria-label="Direct link to 02. Populating The Relationship Tuples" title="Direct link to 02. Populating The Relationship Tuples">​</a></h3><p>Now you can add the relationship tuples to represent these relationships mentioned in the <a href="#requirements">requirements</a> and <a href="#defined-scenarios">scenarios</a> sections:</p><p>The relations between the features and plans are as follows:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the free plan is the associated plan of the issues feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:free'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'associated_plan'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the team plan is the associated plan of the issues feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:team'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'associated_plan'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the team plan is the associated plan of the draft pull requests feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:team'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'associated_plan'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:draft_prs'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the enterprise plan is the associated plan of the issues feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:enterprise'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'associated_plan'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the enterprise plan is the associated plan of the draft pull requests feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:enterprise'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'associated_plan'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:draft_prs'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the enterprise plan is the associated plan of the SAML Single Sign-on feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:enterprise'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'associated_plan'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:sso'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the free plan is the associated plan of the issues feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the team plan is the associated plan of the issues feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the team plan is the associated plan of the draft pull requests feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:draft_prs"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the enterprise plan is the associated plan of the issues feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the enterprise plan is the associated plan of the draft pull requests feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:draft_prs"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the enterprise plan is the associated plan of the SAML Single Sign-on feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:sso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the free plan is the associated plan of the issues feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the team plan is the associated plan of the issues feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the team plan is the associated plan of the draft pull requests feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:draft_prs"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the enterprise plan is the associated plan of the issues feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the enterprise plan is the associated plan of the draft pull requests feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:draft_prs"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the enterprise plan is the associated plan of the SAML Single Sign-on feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:sso"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># the free plan is the associated plan of the issues feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># the team plan is the associated plan of the issues feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># the team plan is the associated plan of the draft pull requests feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:draft_prs"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># the enterprise plan is the associated plan of the issues feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># the enterprise plan is the associated plan of the draft pull requests feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:draft_prs"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># the enterprise plan is the associated plan of the SAML Single Sign-on feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:sso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"plan:free","relation":"associated_plan","object":"feature:issues"},{"user":"plan:team","relation":"associated_plan","object":"feature:issues"},{"user":"plan:team","relation":"associated_plan","object":"feature:draft_prs"},{"user":"plan:enterprise","relation":"associated_plan","object":"feature:issues"},{"user":"plan:enterprise","relation":"associated_plan","object":"feature:draft_prs"},{"user":"plan:enterprise","relation":"associated_plan","object":"feature:sso"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:free associated_plan feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:team associated_plan feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:team associated_plan feature:draft_prs</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:enterprise associated_plan feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:enterprise associated_plan feature:draft_prs</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:enterprise associated_plan feature:sso</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // the </span><span class="token function" style="color:rgb(80, 250, 123)">free</span><span class="token plain"> plan is the associated plan of the issues feature</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // the team plan is the associated plan of the issues feature</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // the team plan is the associated plan of the draft pull requests feature</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:draft_prs"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // the enterprise plan is the associated plan of the issues feature</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // the enterprise plan is the associated plan of the draft pull requests feature</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:draft_prs"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // the enterprise plan is the associated plan of the SAML Single Sign-on feature</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:sso"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The relations between the plans and the organizations are as follows:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the Alpha Beta Gamma organization is a subscriber of the free plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:alpha'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'subscriber'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:free'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the Bayer Water Supplies organization is a subscriber of the team plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:bayer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'subscriber'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:team'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the Cups and Dishes organization is a subscriber of the enterprise plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:cups'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'subscriber'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:enterprise'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the Alpha Beta Gamma organization is a subscriber of the free plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the Bayer Water Supplies organization is a subscriber of the team plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the Cups and Dishes organization is a subscriber of the enterprise plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:cups"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the Alpha Beta Gamma organization is a subscriber of the free plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the Bayer Water Supplies organization is a subscriber of the team plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the Cups and Dishes organization is a subscriber of the enterprise plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:cups"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># the Alpha Beta Gamma organization is a subscriber of the free plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># the Bayer Water Supplies organization is a subscriber of the team plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># the Cups and Dishes organization is a subscriber of the enterprise plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:cups"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"organization:alpha","relation":"subscriber","object":"plan:free"},{"user":"organization:bayer","relation":"subscriber","object":"plan:team"},{"user":"organization:cups","relation":"subscriber","object":"plan:enterprise"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:alpha subscriber plan:free</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:bayer subscriber plan:team</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:cups subscriber plan:enterprise</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // the Alpha Beta Gamma organization is a subscriber of the </span><span class="token function" style="color:rgb(80, 250, 123)">free</span><span class="token plain"> plan</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // the Bayer Water Supplies organization is a subscriber of the team plan</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // the Cups and Dishes organization is a subscriber of the enterprise plan</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:cups"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:enterprise"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The relations between the organizations and the users are as follows:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// anne is a member of the Alpha Beta Gamma organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:alpha'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// beth is a member of the Bayer Water Supplies</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:bayer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// charles is a member of the Cups and Dishes organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:charles'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:cups'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// anne is a member of the Alpha Beta Gamma organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// beth is a member of the Bayer Water Supplies</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// charles is a member of the Cups and Dishes organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:cups"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// anne is a member of the Alpha Beta Gamma organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// beth is a member of the Bayer Water Supplies</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// charles is a member of the Cups and Dishes organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:cups"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># anne is a member of the Alpha Beta Gamma organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># beth is a member of the Bayer Water Supplies</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># charles is a member of the Cups and Dishes organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:cups"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"member","object":"organization:alpha"},{"user":"user:beth","relation":"member","object":"organization:bayer"},{"user":"user:charles","relation":"member","object":"organization:cups"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member organization:alpha</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth member organization:bayer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles member organization:cups</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // anne is a member of the Alpha Beta Gamma organization</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // beth is a member of the Bayer Water Supplies</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // charles is a member of the Cups and Dishes organization</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:cups"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>So far you have given <!-- -->OpenFGA<!-- --> a representation of the current state of your system's relationships. You will keep iterating and updating the authorization model until the results of the queries match what you expect.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p>In production, it is highly recommended to use unique, immutable identifiers. Names are used in this article to make it easier to read and follow. -For example, the relationship tuple indicating that <em>anne is a member of organization:alpha</em> could be written as:</p><ul><li>user: user:2b4840f2-7c9c-42c8-9329-911002051524</li><li>relation: member</li><li>object: project:52e529c6-c571-4d5c-b78a-bc574cf98b54</li></ul></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="verification">Verification<a href="#verification" class="hash-link" aria-label="Direct link to Verification" title="Direct link to Verification">​</a></h4><p>Now that you have some data, you can start using it to ask is ${USER} related to ${OBJECT} as ${RELATION}?</p><p>First, you will <a href="/docs/concepts#what-is-a-check-request">check</a> if <code>anne</code> is a member of <code>organization:alpha</code>. This is one of the relationship tuples you previously added, you will make sure <!-- -->OpenFGA<!-- --> can detect a relation in this case.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:alpha'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member organization:alpha</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"member","object":"organization:alpha"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">member</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">organization:alpha</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Querying for relationship tuples that you fed into <!-- -->OpenFGA<!-- --> earlier should work, try a few before proceeding to make sure everything is working well.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:bayer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member organization:bayer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"member","object":"organization:bayer"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">member</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">organization:bayer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:bayer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'subscriber'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:team'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:bayer subscriber plan:team</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"organization:bayer","relation":"subscriber","object":"plan:team"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">organization:bayer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">subscriber</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">plan:team</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:free'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'associated_plan'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:free associated_plan feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"plan:free","relation":"associated_plan","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">plan:free</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">associated_plan</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-updating-the-authorization-model">03. Updating The Authorization Model<a href="#03-updating-the-authorization-model" class="hash-link" aria-label="Direct link to 03. Updating The Authorization Model" title="Direct link to 03. Updating The Authorization Model">​</a></h3><p>You are working towards <!-- -->OpenFGA<!-- --> returning the correct answer when you query whether <code>anne</code> has <code>access</code> to <code>feature:issues</code>. It won't work yet, but you will keep updating your configuration to reach that goal.</p><p>To start, try to run that query on <code>is anne related to feature:issues as access?</code></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: undefined }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":undefined}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"access","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":undefined}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The <!-- -->OpenFGA<!-- --> service is returning that the query tuple is invalid. That is because you are asking for relation as <code>access</code>, but that relation is not in the configuration of the <code>feature</code> type!</p><p>Add it now. Like so:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p><code>access</code> <a href="/docs/concepts#what-is-a-relation">relation</a> was added to the configuration of the <code>feature</code> <a href="/docs/concepts#what-is-a-type">type</a>.</p></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>In this tutorial, you will find the phrases <a href="/docs/concepts#what-are-direct-and-implied-relationships">direct relationship and implied relationship</a>.</p><p>A <em>direct relationship</em> R between user X and object Y means the relationship tuple (user=X, relation=R, object=Y) exists, and the <!-- -->OpenFGA<!-- --> authorization model for that relation allows this direct relationship (by use of <a href="/docs/configuration-language#the-direct-relationship-type-restrictions">direct relationship type restrictions</a>).</p><p>An <em>implied relationship</em> R exists between user X and object Y if user X is related to an object Z that is in direct or implied relationship with object Y, and the <!-- -->OpenFGA<!-- --> authorization model allows it.</p></div></div><p>The resulting updated configuration would be:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="adding-modeling-pattern-of-parent-child-objects">Adding Modeling Pattern Of Parent-Child Objects<a href="#adding-modeling-pattern-of-parent-child-objects" class="hash-link" aria-label="Direct link to Adding Modeling Pattern Of Parent-Child Objects" title="Direct link to Adding Modeling Pattern Of Parent-Child Objects">​</a></h4><p>Now we can ask the following query: <code>is anne related to feature:issues as access?</code> again.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"access","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>So far so good. <!-- -->OpenFGA<!-- --> understood your query, but said that no <a href="/docs/concepts#what-is-a-relation">relation</a> exists. That is because according to the configuration provided so far, there is no <code>access</code> relation between <code>anne</code> and <code>feature:issues</code>.</p><p>We can also try to query <code>is organization:alpha related to feature:issues as access?</code> and we see that there is no relationship.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:alpha'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:alpha access feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"organization:alpha","relation":"access","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">organization:alpha</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>If you have already completed some of the other tutorials you might have encountered the modeling pattern of <a href="/docs/modeling/parent-child">parent-child objects</a> which is modeled as such:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">object</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: all_objects_viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"all_objects_viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>With this, when asked to check a user's <code>viewer</code> relationship with the object, <!-- -->OpenFGA<!-- --> will:</p><ol><li>Read all relationship tuples of users related to this particular object as relation <code>parent</code></li><li>For each relationship tuple, return all <em>usersets</em> that have <code>all_objects_viewer</code> relation to the objects in those relationship tuples</li><li>If the user is in any of those <em>usersets</em>, return yes, as the user is a <code>viewer</code> on this object. +For example, the relationship tuple indicating that <em>anne is a member of organization:alpha</em> could be written as:</p><ul><li>user: user:2b4840f2-7c9c-42c8-9329-911002051524</li><li>relation: member</li><li>object: project:52e529c6-c571-4d5c-b78a-bc574cf98b54</li></ul></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="verification">Verification<a href="#verification" class="hash-link" aria-label="Direct link to Verification" title="Direct link to Verification">​</a></h4><p>Now that you have some data, you can start using it to ask is ${USER} related to ${OBJECT} as ${RELATION}?</p><p>First, you will <a href="/docs/concepts#what-is-a-check-request">check</a> if <code>anne</code> is a member of <code>organization:alpha</code>. This is one of the relationship tuples you previously added, you will make sure <!-- -->OpenFGA<!-- --> can detect a relation in this case.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:alpha'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member organization:alpha</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"member","object":"organization:alpha"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">member</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">organization:alpha</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Querying for relationship tuples that you fed into <!-- -->OpenFGA<!-- --> earlier should work, try a few before proceeding to make sure everything is working well.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:bayer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member organization:bayer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"member","object":"organization:bayer"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">member</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">organization:bayer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:bayer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'subscriber'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:team'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:bayer subscriber plan:team</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"organization:bayer","relation":"subscriber","object":"plan:team"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:bayer"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">organization:bayer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">subscriber</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:team"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">plan:team</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:free'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'associated_plan'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:free associated_plan feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"plan:free","relation":"associated_plan","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:free"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">plan:free</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">associated_plan</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-updating-the-authorization-model">03. Updating The Authorization Model<a href="#03-updating-the-authorization-model" class="hash-link" aria-label="Direct link to 03. Updating The Authorization Model" title="Direct link to 03. Updating The Authorization Model">​</a></h3><p>You are working towards <!-- -->OpenFGA<!-- --> returning the correct answer when you query whether <code>anne</code> has <code>access</code> to <code>feature:issues</code>. It won't work yet, but you will keep updating your configuration to reach that goal.</p><p>To start, try to run that query on <code>is anne related to feature:issues as access?</code></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: undefined }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":undefined}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"access","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":undefined}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The <!-- -->OpenFGA<!-- --> service is returning that the query tuple is invalid. That is because you are asking for relation as <code>access</code>, but that relation is not in the configuration of the <code>feature</code> type!</p><p>Add it now. Like so:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p><code>access</code> <a href="/docs/concepts#what-is-a-relation">relation</a> was added to the configuration of the <code>feature</code> <a href="/docs/concepts#what-is-a-type">type</a>.</p></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>In this tutorial, you will find the phrases <a href="/docs/concepts#what-are-direct-and-implied-relationships">direct relationship and implied relationship</a>.</p><p>A <em>direct relationship</em> R between user X and object Y means the relationship tuple (user=X, relation=R, object=Y) exists, and the <!-- -->OpenFGA<!-- --> authorization model for that relation allows this direct relationship (by use of <a href="/docs/configuration-language#the-direct-relationship-type-restrictions">direct relationship type restrictions</a>).</p><p>An <em>implied relationship</em> R exists between user X and object Y if user X is related to an object Z that is in direct or implied relationship with object Y, and the <!-- -->OpenFGA<!-- --> authorization model allows it.</p></div></div><p>The resulting updated configuration would be:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="adding-modeling-pattern-of-parent-child-objects">Adding Modeling Pattern Of Parent-Child Objects<a href="#adding-modeling-pattern-of-parent-child-objects" class="hash-link" aria-label="Direct link to Adding Modeling Pattern Of Parent-Child Objects" title="Direct link to Adding Modeling Pattern Of Parent-Child Objects">​</a></h4><p>Now we can ask the following query: <code>is anne related to feature:issues as access?</code> again.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"access","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>So far so good. <!-- -->OpenFGA<!-- --> understood your query, but said that no <a href="/docs/concepts#what-is-a-relation">relation</a> exists. That is because according to the configuration provided so far, there is no <code>access</code> relation between <code>anne</code> and <code>feature:issues</code>.</p><p>We can also try to query <code>is organization:alpha related to feature:issues as access?</code> and we see that there is no relationship.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:alpha'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:alpha access feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"organization:alpha","relation":"access","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">organization:alpha</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>If you have already completed some of the other tutorials you might have encountered the modeling pattern of <a href="/docs/modeling/parent-child">parent-child objects</a> which is modeled as such:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">resource</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: all_objects_viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"resource"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"all_objects_viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>With this, when asked to check a user's <code>viewer</code> relationship with the object, <!-- -->OpenFGA<!-- --> will:</p><ol><li>Read all relationship tuples of users related to this particular object as relation <code>parent</code></li><li>For each relationship tuple, return all <em>usersets</em> that have <code>all_objects_viewer</code> relation to the objects in those relationship tuples</li><li>If the user is in any of those <em>usersets</em>, return yes, as the user is a <code>viewer</code> on this object. In other words, users related as <code>all_objects_viewer</code> to any of this object's <code>parents</code> are related as <code>viewer</code> to this object.</li></ol></div></div><p>If you want to give all subscribers on a plan access to a feature, you can do it like so:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> subscriber </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> associated_plan</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Users related to <code>feature</code> as <code>access</code> are the union of (any of):</p><ul><li>the set of users with a direct <code>access</code> relation</li><li>the set of users related to the <code>associated_plan</code> as <code>subscriber</code> (the feature's associated plans' subscribers)</li></ul><p>So everyone who has direct access, as well as the subscribers of the associated plan</p></div></div><p>That would mean that in order for an object to have an <code>access</code> relation to a feature y, there needs to be either:</p><ul><li>a <a href="/docs/concepts#what-are-direct-and-implied-relationships">direct relationship</a> via a relationship tuple: e.g. <code>{ "user": "user:x", "relation": "access", "object": "feature:y" }</code></li><li>a subscriber relationship with another object related to x associated_plan: e.g. <code>{ "user": "user:x", "relation": "subscriber", "object": "plan:z" } { "user": "plan:z", "relation": "associated_plan", "object": "feature:y" }</code></li></ul><p>That brings you close. That will allow you to grant organizations access to the feature (as organizations have a subscriber relation with the plan).</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="adding-subscriber-relationship-with-another-object-related-to-x-associated_plan">Adding Subscriber Relationship With Another Object Related To x associated_plan<a href="#adding-subscriber-relationship-with-another-object-related-to-x-associated_plan" class="hash-link" aria-label="Direct link to Adding Subscriber Relationship With Another Object Related To x associated_plan" title="Direct link to Adding Subscriber Relationship With Another Object Related To x associated_plan">​</a></h4><p>One way forward would be to add a direct <code>access</code> relation between a user and a feature e.g. <code>{ "user": "anne", "relation": "access", "object": "feature:y" }</code> whenever the organization anne is subscribed to a plan, or the organization anne is in subscribes to a new plan. -But there are several downsides to this:</p><ul><li>Your application layer now needs to worry about computing this relationship. Instead of letting <!-- -->OpenFGA<!-- --> figure this all out, the app layer needs to do the checks whenever a user is being added or removed</li><li>If an organization changes its subscription, your application layer has to loop through all the users and update their <code>access</code> relationships to features accordingly</li></ul><p>Later in this tutorial, you will remove the possibility of having a direct <code>access</code> relation completely, but for now you will make sure the changes to the store you have made so far are working.</p><p>Replace all the existing code you had previously with the updated authorization model from the below snippet.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> subscriber </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> associated_plan</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Now we can ask following query: <code>is organization:alpha related to feature:issues as access?</code> again.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:alpha'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:alpha access feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"organization:alpha","relation":"access","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">organization:alpha</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>You will notice that <!-- -->OpenFGA<!-- --> now did find a relation, as <code>organization:alpha</code> is a <code>subscriber</code> to <code>plan:free</code> which has an <code>associated_plan</code> relation to <code>feature:issues</code>. From that and the authorization model you updated above, <!-- -->OpenFGA<!-- --> deduced that <code>organization:alpha</code> has an implied <code>access</code> relation to <code>feature:issues</code>.</p><p>That is good, but you want to be able to ask <code>is anne related to feature:issues as access?</code>, not <code>is organization:alpha related to feature:issues as access?</code>. As in, you want the subscriber members to have access to the feature, not the subscriber itself.</p><p>In order to do that, you will add a relation on the plan, that indicates that all members of an organization subscribed to it, have a <code>subscriber_member</code> relation to the plan. And you can modify the change you did above to give implied access to the <code>subscriber_member</code> instead of the subscriber. Like so:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> subscriber_member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> associated_plan</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber_member</span><span class="token plain">: member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> subscriber</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber_member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Notice that <code>subscriber</code> has been updated to <code>subscriber_member</code> in the <code>access</code> relation of the <code>feature</code> type.</p><p>Under the <code>plan</code> type, in order for someone to have a <code>subscriber_member</code> relation to the plan, they have to be related as a <code>member</code> to the object related as a <code>subscriber</code> to the plan (as in they have to be a member of on of the plan's subscribers).</p></div></div><p>Now ask the following query: <code>is anne related to feature:issues as access?</code></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"access","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="disallow-direct-relationship">Disallow Direct Relationship<a href="#disallow-direct-relationship" class="hash-link" aria-label="Direct link to Disallow Direct Relationship" title="Direct link to Disallow Direct Relationship">​</a></h4><p>So far, with just a <!-- -->OpenFGA<!-- --> authorization model, and the initial relationship tuples indicating the relations you know, you configured <!-- -->OpenFGA<!-- --> to give you the correct response.</p><p>Earlier on, the idea of not allowing a direct <code>access</code> relation between a user and a <code>feature</code> was discussed, e.g. adding a relationship tuple like <code>{ "user": "user:anne", "relation": "access", "object": "feature:y" }</code>. You will remove it now.</p><p>To disallow a direct relationship, you need to remove the direct relationship type restriction. The following snippet:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> subscriber_member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> associated_plan</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>becomes</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: subscriber_member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> associated_plan</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>With this change, even if your app layer added the following relationship tuple:</p><ul><li><code>{ "user": "user:anne", "relation": "access", "object": feature:issues }</code></li></ul><p>a subsequent check for <code>is anne related to feature:issues as access?</code> would return no relation. The only way for a relation to exist is if the following three relationship tuples do:</p><ul><li><code>{ "user": "user:anne", "relation": "member", "object": "organization:z" }</code></li><li><code>{ "user": "organization:z", "relation": "subscriber", "object": "plan:y" }</code></li><li><code>{ "user": "plan:y", "relation": "associated_plan", "object": "feature:issues" }</code></li></ul><h4 class="anchor anchorWithStickyNavbar_LWe7" id="verification-1">Verification<a href="#verification-1" class="hash-link" aria-label="Direct link to Verification" title="Direct link to Verification">​</a></h4><p>Ensure that your authorization model matches the one below</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: subscriber_member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> associated_plan</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber_member</span><span class="token plain">: member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> subscriber</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber_member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>You will now verify that the configuration is correct by running checks for all the scenarios mentioned at the beginning of the tutorial:</p><ul><li><strong>Anne</strong> has access to <strong>Issues</strong> (expecting <code>yes</code>)</li><li><strong>Anne</strong> has access to <strong>Draft Pull Requests</strong> (expecting<code> no</code>)</li><li><strong>Anne</strong> has access to <strong>Single Sign-on</strong> (expecting<code> no</code>)</li><li><strong>Beth</strong> has access to <strong>Issues</strong> (expecting <code>yes</code>)</li><li><strong>Beth</strong> has access to <strong>Draft Pull Requests</strong> (expecting <code>yes</code>)</li><li><strong>Beth</strong> has access to <strong>Single Sign-on</strong> (expecting<code> no</code>)</li><li><strong>Charles</strong> has access to <strong>Issues</strong> (expecting <code>yes</code>)</li><li><strong>Charles</strong> has access to <strong>Draft Pull Requests</strong> (expecting <code>yes</code>)</li><li><strong>Charles</strong> has access to <strong>Single Sign-on</strong> (expecting <code>yes</code>)</li></ul><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"access","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Try to verify for the other user, object and relation combinations as listed below.</p><table><thead><tr><th>User</th><th>Object</th><th>Relation</th><th>Query</th><th>Relation?</th></tr></thead><tbody><tr><td><code>anne</code></td><td><code>feature:issues</code></td><td><code>access</code></td><td><code>is anne related to feature:issues as access?</code></td><td>Yes</td></tr><tr><td><code>anne</code></td><td><code>feature:draft_prs</code></td><td><code>access</code></td><td><code>is anne related to feature:draft_prs as access?</code></td><td>No</td></tr><tr><td><code>anne</code></td><td><code>feature:sso</code></td><td><code>access</code></td><td><code>is anne related to feature:sso as access?</code></td><td>No</td></tr><tr><td><code>beth</code></td><td><code>feature:issues</code></td><td><code>access</code></td><td><code>is beth related to feature:issues as access?</code></td><td>Yes</td></tr><tr><td><code>beth</code></td><td><code>feature:draft_prs</code></td><td><code>access</code></td><td><code>is beth related to feature:draft_prs as access?</code></td><td>Yes</td></tr><tr><td><code>beth</code></td><td><code>feature:sso</code></td><td><code>access</code></td><td><code>is beth related to feature:sso as access?</code></td><td>No</td></tr><tr><td><code>charles</code></td><td><code>feature:issues</code></td><td><code>access</code></td><td><code>is charles related to feature:issues as access?</code></td><td>Yes</td></tr><tr><td><code>charles</code></td><td><code>feature:draft_prs</code></td><td><code>access</code></td><td><code>is charles related to feature:draft_prs as access?</code></td><td>Yes</td></tr><tr><td><code>charles</code></td><td><code>feature:sso</code></td><td><code>access</code></td><td><code>is charles related to feature:sso as access?</code></td><td>Yes</td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_LWe7" id="summary">Summary<a href="#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary">​</a></h2><p>In this tutorial, you learned:</p><ul><li>to model entitlements for a system in <!-- -->OpenFGA</li><li>how to start with a set of requirements and scenarios and iterate on the <!-- -->OpenFGA<!-- --> authorization model until the checks match the expected scenarios</li><li>how to model <a href="/docs/modeling/parent-child"><strong>parent-child relationships</strong></a> to indicate that a user having a relationship with a certain object implies having a relationship with another object in <!-- -->OpenFGA</li><li>how to use <a href="/docs/configuration-language#the-union-operator"><strong>the union operator</strong></a> condition to indicate multiple possible paths for a relationship between two objects to be computed</li><li>using <a href="/docs/configuration-language#the-direct-relationship-type-restrictions"><strong>direct relationship type restrictions</strong></a> in a <!-- -->OpenFGA<!-- --> authorization model, and how to block direct relationships by removing it</li></ul><p>Upcoming tutorials will dive deeper into <!-- -->OpenFGA<!-- -->, introducing concepts that will improve on the model you built today, and tackling different permission systems, with other relations and requirements that need to be met.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/advanced/entitlements.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/advanced/iot"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">IoT</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/migrating"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Migrating</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#what-you-will-be-modeling" class="table-of-contents__link toc-highlight">What You Will Be Modeling</a><ul><li><a href="#requirements" class="table-of-contents__link toc-highlight">Requirements</a></li><li><a href="#defined-scenarios" class="table-of-contents__link toc-highlight">Defined Scenarios</a></li></ul></li><li><a href="#modeling-entitlements-for-github" class="table-of-contents__link toc-highlight">Modeling Entitlements For GitHub</a><ul><li><a href="#01-building-the-initial-authorization-model-and-relationship-tuples" class="table-of-contents__link toc-highlight">01. Building The Initial Authorization Model And Relationship Tuples</a></li><li><a href="#02-populating-the-relationship-tuples" class="table-of-contents__link toc-highlight">02. Populating The Relationship Tuples</a></li><li><a href="#03-updating-the-authorization-model" class="table-of-contents__link toc-highlight">03. Updating The Authorization Model</a></li></ul></li><li><a href="#summary" class="table-of-contents__link toc-highlight">Summary</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +But there are several downsides to this:</p><ul><li>Your application layer now needs to worry about computing this relationship. Instead of letting <!-- -->OpenFGA<!-- --> figure this all out, the app layer needs to do the checks whenever a user is being added or removed</li><li>If an organization changes its subscription, your application layer has to loop through all the users and update their <code>access</code> relationships to features accordingly</li></ul><p>Later in this tutorial, you will remove the possibility of having a direct <code>access</code> relation completely, but for now you will make sure the changes to the store you have made so far are working.</p><p>Replace all the existing code you had previously with the updated authorization model from the below snippet.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> subscriber </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> associated_plan</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Now we can ask following query: <code>is organization:alpha related to feature:issues as access?</code> again.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:alpha'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:alpha access feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"organization:alpha","relation":"access","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:alpha"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">organization:alpha</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>You will notice that <!-- -->OpenFGA<!-- --> now did find a relation, as <code>organization:alpha</code> is a <code>subscriber</code> to <code>plan:free</code> which has an <code>associated_plan</code> relation to <code>feature:issues</code>. From that and the authorization model you updated above, <!-- -->OpenFGA<!-- --> deduced that <code>organization:alpha</code> has an implied <code>access</code> relation to <code>feature:issues</code>.</p><p>That is good, but you want to be able to ask <code>is anne related to feature:issues as access?</code>, not <code>is organization:alpha related to feature:issues as access?</code>. As in, you want the subscriber members to have access to the feature, not the subscriber itself.</p><p>In order to do that, you will add a relation on the plan, that indicates that all members of an organization subscribed to it, have a <code>subscriber_member</code> relation to the plan. And you can modify the change you did above to give implied access to the <code>subscriber_member</code> instead of the subscriber. Like so:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> subscriber_member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> associated_plan</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber_member</span><span class="token plain">: member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> subscriber</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber_member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Notice that <code>subscriber</code> has been updated to <code>subscriber_member</code> in the <code>access</code> relation of the <code>feature</code> type.</p><p>Under the <code>plan</code> type, in order for someone to have a <code>subscriber_member</code> relation to the plan, they have to be related as a <code>member</code> to the object related as a <code>subscriber</code> to the plan (as in they have to be a member of on of the plan's subscribers).</p></div></div><p>Now ask the following query: <code>is anne related to feature:issues as access?</code></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"access","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="disallow-direct-relationship">Disallow Direct Relationship<a href="#disallow-direct-relationship" class="hash-link" aria-label="Direct link to Disallow Direct Relationship" title="Direct link to Disallow Direct Relationship">​</a></h4><p>So far, with just a <!-- -->OpenFGA<!-- --> authorization model, and the initial relationship tuples indicating the relations you know, you configured <!-- -->OpenFGA<!-- --> to give you the correct response.</p><p>Earlier on, the idea of not allowing a direct <code>access</code> relation between a user and a <code>feature</code> was discussed, e.g. adding a relationship tuple like <code>{ "user": "user:anne", "relation": "access", "object": "feature:y" }</code>. You will remove it now.</p><p>To disallow a direct relationship, you need to remove the direct relationship type restriction. The following snippet:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> subscriber_member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> associated_plan</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>becomes</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: subscriber_member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> associated_plan</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>With this change, even if your app layer added the following relationship tuple:</p><ul><li><code>{ "user": "user:anne", "relation": "access", "object": feature:issues }</code></li></ul><p>a subsequent check for <code>is anne related to feature:issues as access?</code> would return no relation. The only way for a relation to exist is if the following three relationship tuples do:</p><ul><li><code>{ "user": "user:anne", "relation": "member", "object": "organization:z" }</code></li><li><code>{ "user": "organization:z", "relation": "subscriber", "object": "plan:y" }</code></li><li><code>{ "user": "plan:y", "relation": "associated_plan", "object": "feature:issues" }</code></li></ul><h4 class="anchor anchorWithStickyNavbar_LWe7" id="verification-1">Verification<a href="#verification-1" class="hash-link" aria-label="Direct link to Verification" title="Direct link to Verification">​</a></h4><p>Ensure that your authorization model matches the one below</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: subscriber_member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> associated_plan</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber_member</span><span class="token plain">: member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> subscriber</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber_member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>You will now verify that the configuration is correct by running checks for all the scenarios mentioned at the beginning of the tutorial:</p><ul><li><strong>Anne</strong> has access to <strong>Issues</strong> (expecting <code>yes</code>)</li><li><strong>Anne</strong> has access to <strong>Draft Pull Requests</strong> (expecting<code> no</code>)</li><li><strong>Anne</strong> has access to <strong>Single Sign-on</strong> (expecting<code> no</code>)</li><li><strong>Beth</strong> has access to <strong>Issues</strong> (expecting <code>yes</code>)</li><li><strong>Beth</strong> has access to <strong>Draft Pull Requests</strong> (expecting <code>yes</code>)</li><li><strong>Beth</strong> has access to <strong>Single Sign-on</strong> (expecting<code> no</code>)</li><li><strong>Charles</strong> has access to <strong>Issues</strong> (expecting <code>yes</code>)</li><li><strong>Charles</strong> has access to <strong>Draft Pull Requests</strong> (expecting <code>yes</code>)</li><li><strong>Charles</strong> has access to <strong>Single Sign-on</strong> (expecting <code>yes</code>)</li></ul><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:issues'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"access","object":"feature:issues"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:issues"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:issues</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Try to verify for the other user, object and relation combinations as listed below.</p><table><thead><tr><th>User</th><th>Object</th><th>Relation</th><th>Query</th><th>Relation?</th></tr></thead><tbody><tr><td><code>anne</code></td><td><code>feature:issues</code></td><td><code>access</code></td><td><code>is anne related to feature:issues as access?</code></td><td>Yes</td></tr><tr><td><code>anne</code></td><td><code>feature:draft_prs</code></td><td><code>access</code></td><td><code>is anne related to feature:draft_prs as access?</code></td><td>No</td></tr><tr><td><code>anne</code></td><td><code>feature:sso</code></td><td><code>access</code></td><td><code>is anne related to feature:sso as access?</code></td><td>No</td></tr><tr><td><code>beth</code></td><td><code>feature:issues</code></td><td><code>access</code></td><td><code>is beth related to feature:issues as access?</code></td><td>Yes</td></tr><tr><td><code>beth</code></td><td><code>feature:draft_prs</code></td><td><code>access</code></td><td><code>is beth related to feature:draft_prs as access?</code></td><td>Yes</td></tr><tr><td><code>beth</code></td><td><code>feature:sso</code></td><td><code>access</code></td><td><code>is beth related to feature:sso as access?</code></td><td>No</td></tr><tr><td><code>charles</code></td><td><code>feature:issues</code></td><td><code>access</code></td><td><code>is charles related to feature:issues as access?</code></td><td>Yes</td></tr><tr><td><code>charles</code></td><td><code>feature:draft_prs</code></td><td><code>access</code></td><td><code>is charles related to feature:draft_prs as access?</code></td><td>Yes</td></tr><tr><td><code>charles</code></td><td><code>feature:sso</code></td><td><code>access</code></td><td><code>is charles related to feature:sso as access?</code></td><td>Yes</td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_LWe7" id="summary">Summary<a href="#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary">​</a></h2><p>In this tutorial, you learned:</p><ul><li>to model entitlements for a system in <!-- -->OpenFGA</li><li>how to start with a set of requirements and scenarios and iterate on the <!-- -->OpenFGA<!-- --> authorization model until the checks match the expected scenarios</li><li>how to model <a href="/docs/modeling/parent-child"><strong>parent-child relationships</strong></a> to indicate that a user having a relationship with a certain object implies having a relationship with another object in <!-- -->OpenFGA</li><li>how to use <a href="/docs/configuration-language#the-union-operator"><strong>the union operator</strong></a> condition to indicate multiple possible paths for a relationship between two objects to be computed</li><li>using <a href="/docs/configuration-language#the-direct-relationship-type-restrictions"><strong>direct relationship type restrictions</strong></a> in a <!-- -->OpenFGA<!-- --> authorization model, and how to block direct relationships by removing it</li></ul><p>Upcoming tutorials will dive deeper into <!-- -->OpenFGA<!-- -->, introducing concepts that will improve on the model you built today, and tackling different permission systems, with other relations and requirements that need to be met.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/advanced/entitlements.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/advanced/iot"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">IoT</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/migrating"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Migrating</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#what-you-will-be-modeling" class="table-of-contents__link toc-highlight">What You Will Be Modeling</a><ul><li><a href="#requirements" class="table-of-contents__link toc-highlight">Requirements</a></li><li><a href="#defined-scenarios" class="table-of-contents__link toc-highlight">Defined Scenarios</a></li></ul></li><li><a href="#modeling-entitlements-for-github" class="table-of-contents__link toc-highlight">Modeling Entitlements For GitHub</a><ul><li><a href="#01-building-the-initial-authorization-model-and-relationship-tuples" class="table-of-contents__link toc-highlight">01. Building The Initial Authorization Model And Relationship Tuples</a></li><li><a href="#02-populating-the-relationship-tuples" class="table-of-contents__link toc-highlight">02. Populating The Relationship Tuples</a></li><li><a href="#03-updating-the-authorization-model" class="table-of-contents__link toc-highlight">03. Updating The Authorization Model</a></li></ul></li><li><a href="#summary" class="table-of-contents__link toc-highlight">Summary</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/advanced/gdrive.html b/docs/modeling/advanced/gdrive.html index fb8fedaa5..2330c8b48 100644 --- a/docs/modeling/advanced/gdrive.html +++ b/docs/modeling/advanced/gdrive.html @@ -15,8 +15,8 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> @@ -26,8 +26,8 @@ Used here to indicate that a user can be a viewer on a document, or can have the viewer relationship implied through commenter.</li><li>Using the <strong><a href="/docs/concepts#what-is-type-bound-public-access">type bound public access</a></strong> in a <a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuple's</a> user field to indicate that everyone has a certain relation with an object. See <a href="/docs/modeling/public-access">Modeling Public Access</a> for more.<br> Used here to <a href="#04-sharing-files-and-folders-publicly">share documents publicly</a>.</li><li>Model <a href="/docs/modeling/parent-child"><strong>parent-child objects</strong></a> to indicate that a user having a relationship with a certain object implies having a relationship with another object in <!-- -->OpenFGA<!-- -->.<br> Used here is to indicate that a writer on a folder is a writer on all documents inside that folder.</li></ul></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <!-- -->OpenFGA<!-- --> concepts and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><p>It would be helpful to have an understanding of some concepts of <!-- -->OpenFGA<!-- --> before you start.</p></summary><div><div class="collapsibleContent_i85q"><h4 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-concentric-relationships">Modeling Concentric Relationships<a href="#modeling-concentric-relationships" class="hash-link" aria-label="Direct link to Modeling Concentric Relationships" title="Direct link to Modeling Concentric Relationships">​</a></h4><p>You need to know how to update the authorization model to allow having nested relations such as all writers are readers. <a href="/docs/modeling/building-blocks/concentric-relationships">Learn more →</a></p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-object-to-object-relationships">Modeling Object-to-Object Relationships<a href="#modeling-object-to-object-relationships" class="hash-link" aria-label="Direct link to Modeling Object-to-Object Relationships" title="Direct link to Modeling Object-to-Object Relationships">​</a></h4><p>You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. <a href="/docs/modeling/building-blocks/object-to-object-relationships">Learn more →</a></p><p>Used here to indicate that users who have access to view a folder have access to view all documents inside it.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-public-access">Modeling Public Access<a href="#modeling-public-access" class="hash-link" aria-label="Direct link to Modeling Public Access" title="Direct link to Modeling Public Access">​</a></h4><p>You need to know how to add a relationship tuple to indicate that a resource is publicly available. <a href="/docs/modeling/public-access">Learn more →</a></p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="concepts--configuration-language">Concepts & Configuration Language<a href="#concepts--configuration-language" class="hash-link" aria-label="Direct link to Concepts & Configuration Language" title="Direct link to Concepts & Configuration Language">​</a></h4><ul><li>The <a href="/docs/concepts">OpenFGA Concepts</a></li><li><a href="/docs/configuration-language">Configuration Language</a></li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-you-will-be-modeling">What You Will Be Modeling<a href="#what-you-will-be-modeling" class="hash-link" aria-label="Direct link to What You Will Be Modeling" title="Direct link to What You Will Be Modeling">​</a></h2><p>Google Drive is a system to store, share, and collaborate on files and folders. <a href="https://www.google.com/drive/" target="_blank" rel="noopener noreferrer">Source</a></p><p>In this tutorial, you will build a subset of the Google Drive permission model (detailed below) in <!-- -->OpenFGA<!-- -->, using some scenarios to validate the model.</p><blockquote><p>Note: For brevity, this tutorial will not model all of Google Drive's permissions. Instead, it will focus on modeling for the scenarios outlined below</p></blockquote><h3 class="anchor anchorWithStickyNavbar_LWe7" id="requirements">Requirements<a href="#requirements" class="hash-link" aria-label="Direct link to Requirements" title="Direct link to Requirements">​</a></h3><p>Google Drive's permission model is represented in <a href="https://developers.google.com/drive/api/v3/ref-roles" target="_blank" rel="noopener noreferrer">their documentation</a>.</p><p>In this tutorial, you will be focusing on a subset of these permissions.</p><p>Requirements:</p><ul><li>Users can be owners, editors, commenters and viewers of documents</li><li>Documents can be shared with all users in a domain</li><li>Folders can contain documents and users with a certain permission on a folder have that same permission to a document in that folder</li><li>Documents and folders can be shared publicly</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="defined-scenarios">Defined Scenarios<a href="#defined-scenarios" class="hash-link" aria-label="Direct link to Defined Scenarios" title="Direct link to Defined Scenarios">​</a></h3><p>There will be the following users:</p><ul><li>Anne, who is in the xyz domain</li><li>Beth, who is in the xyz domain</li><li>Charles, who is in the xyz domain</li><li>Diane, who is NOT in the xyz domain</li><li>Erik, who is NOT in the xyz domain</li></ul><p>There will be:</p><ul><li>a 2021-budget document, owned by Anne, shared for commenting with Beth and viewable by all members of the xyz domain.</li><li>a 2021-planning folder, viewable by Diane and contains the 2021-budget document</li><li>a 2021-public-roadmap document, owned by Anne, available for members xyz domain to comment on and is publicly viewable</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-google-drives-permissions">Modeling Google Drive's Permissions<a href="#modeling-google-drives-permissions" class="hash-link" aria-label="Direct link to Modeling Google Drive's Permissions" title="Direct link to Modeling Google Drive's Permissions">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-individual-permissions">01. Individual Permissions<a href="#01-individual-permissions" class="hash-link" aria-label="Direct link to 01. Individual Permissions" title="Direct link to 01. Individual Permissions">​</a></h3><p>To keep thing simple and focus on <!-- -->OpenFGA<!-- --> features rather than Google Drive complexity we will model only four <a href="https://developers.google.com/drive/api/v3/ref-roles" target="_blank" rel="noopener noreferrer">roles</a> (Viewer, Commenter, Writer, Owner).</p><p>At the end of this section we want to have the following permissions represented:</p><p><img loading="lazy" alt="Image showing permissions" src="/assets/images/gdrive-gdrive1-22dac26c1f55a55daeb65acff88ee193.svg" width="940" height="357" class="img_ev3q"></p><p>To represent permissions in <!-- -->OpenFGA<!-- --> we use <a href="/docs/concepts#what-is-a-relation">relations</a>. For document permissions we need to create the following <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">commenter</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The <!-- -->OpenFGA<!-- --> service determines if a <a href="/docs/concepts#what-is-a-user">user</a> has access to an <a href="/docs/concepts#what-is-an-object">object</a> by <a href="/docs/concepts#what-is-a-check-request">checking</a> if the user has a relation to that object. Let us examine one of those relations in detail:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>The snippet above indicates that objects of type document have users related to them as "viewer" if those users belong to the userset of all users related to the document as "viewer".</p><p>This means that a user can be <a href="/docs/concepts#what-are-direct-and-implied-relationships">directly related</a> as a viewer to an object of type "document"</p></div></div><p>If we want to say <code>beth</code> is a commenter of <strong>document:2021-budget</strong> we create this relationship tuple:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'commenter'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:beth","relation":"commenter","object":"document:2021-budget"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth commenter document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We can now ask <!-- -->OpenFGA<!-- --> "is <code>beth</code> a commenter of repository <strong>document:2021-budget</strong>?"</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'commenter'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth commenter document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:beth","relation":"commenter","object":"document:2021-budget"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:beth</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">commenter</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-budget</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We could also say that <code>anne</code> is an owner of the same document:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"owner","object":"document:2021-budget"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>And <a href="/docs/concepts#what-is-a-check-request">ask</a> some questions to <!-- -->OpenFGA<!-- -->:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"owner","object":"document:2021-budget"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">owner</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-budget</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne writer document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"writer","object":"document:2021-budget"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">writer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-budget</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The first reply makes sense but the second one does not. Intuitively, if <code>anne</code> was an <strong>owner</strong>, she was also be a <strong>writer</strong>. In fact, Google Drive explains this in <a href="https://developers.google.com/drive/api/v3/ref-roles" target="_blank" rel="noopener noreferrer">their documentation</a></p><p><img loading="lazy" alt="Image showing roles" src="/assets/images/gdrive-roles-ac60dede6567bd76e873d1a81d642532.svg" width="677" height="789" class="img_ev3q"></p><p>To make <!-- -->OpenFGA<!-- --> aware of this "concentric" permission model we need to update our definitions:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">commenter</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Let's examine one of those relations in detail:</p><p>objects of type document have users related to them as "viewer": if they belong to any of (the union of) the following:</p><ul><li>the userset of all users related to the document as "viewer"</li><li>the userset of all users related to the document as "commenter"</li></ul></div></div><p>With this update our model now supports nested definitions and now:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"owner","object":"document:2021-budget"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">owner</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-budget</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne writer document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"writer","object":"document:2021-budget"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">writer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-budget</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-organization-permissions">02. Organization Permissions<a href="#02-organization-permissions" class="hash-link" aria-label="Direct link to 02. Organization Permissions" title="Direct link to 02. Organization Permissions">​</a></h3><p>Google Drive allows you to share a file with everyone in your organization as a viewer, commenter or writer/editor.</p><p><img loading="lazy" src="/assets/images/gdrive-org-fe69008225e62f28ff2280708e875f09.svg" width="1302" height="724" class="img_ev3q"></p><p>At the end of this section we want to end up with the following permissions represented:</p><p><img loading="lazy" alt="Image showing permissions" src="/assets/images/gdrive-gdrive2-abe697d20cfce6658d6a09aed7af8d97.svg" width="940" height="542" class="img_ev3q"></p><p>To add support for domains and members all we need to do is add this object to the <a href="/docs/authorization-and-openfga#what-is-openfga">OpenFGA</a> <a href="/docs/concepts#what-is-a-type-definition">authorization model</a>. In addition, update the model to allow domain member to be assigned to document:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">commenter</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">domain</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Objects of type "domain" have users related to them as "member" if they belong to the userset of all users related to the domain as "member".</p><p>In other words, users can be direct members of a domain.</p></div></div><p>Let's now create a domain, add members to it and make all members <strong>viewers</strong> of <strong>document:2021-budget</strong>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// make anne, beth, charles a member of the xyz domain</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'domain:xyz'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'domain:xyz'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:charles'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'domain:xyz'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// make members of xyz domain viewers of document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'domain:xyz#member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// make anne, beth, charles a member of the xyz domain</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// make members of xyz domain viewers of document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// make anne, beth, charles a member of the xyz domain</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// make members of xyz domain viewers of document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># make anne, beth, charles a member of the xyz domain</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># make members of xyz domain viewers of document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"member","object":"domain:xyz"},{"user":"user:beth","relation":"member","object":"domain:xyz"},{"user":"user:charles","relation":"member","object":"domain:xyz"},{"user":"domain:xyz#member","relation":"viewer","object":"document:2021-budget"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member domain:xyz</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth member domain:xyz</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles member domain:xyz</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw domain:xyz</span><span class="token comment" style="color:rgb(98, 114, 164)">#member viewer document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // </span><span class="token function" style="color:rgb(80, 250, 123)">make</span><span class="token plain"> anne, beth, charles a member of the xyz domain</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // </span><span class="token function" style="color:rgb(80, 250, 123)">make</span><span class="token plain"> members of xyz domain viewers of document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz#member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The last relationship tuple introduces a new <strong>OpenFGA</strong> concept. A <strong><a href="/docs/concepts#what-is-a-user">userset</a></strong>. When the value of a user is formatted like this <strong>objectType:objectId#relation</strong>, <!-- -->OpenFGA<!-- --> will automatically expand the userset into all its individual user identifiers:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:charles'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles viewer document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:charles","relation":"viewer","object":"document:2021-budget"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:charles</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-budget</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-folder-permission-propagation">03. Folder Permission Propagation<a href="#03-folder-permission-propagation" class="hash-link" aria-label="Direct link to 03. Folder Permission Propagation" title="Direct link to 03. Folder Permission Propagation">​</a></h3><p><a href="https://developers.google.com/drive/api/v3/manage-sharing#permission_propagation" target="_blank" rel="noopener noreferrer">Permission propagation</a> happens between folders and files: if you are a viewer in a folder, you can view its documents. This applies even when you are not explicitly a viewer in a document. -<img loading="lazy" src="https://pbs.twimg.com/media/Eme_FlYW4AEAYfi?format=jpg&name=large" alt="Image" class="img_ev3q"></p><p>At the end of this section we want to end up with the following permissions represented. Note that a folder is an object in the <strong>document</strong> type, as we do not need a separate type:</p><p><img loading="lazy" alt="Image showing permissions" src="/assets/images/gdrive-gdrive3-e82c9d5308de7d3b5e7b74b59d87044f.svg" width="940" height="578" class="img_ev3q"></p><p>We need to add the notion that a <strong>document</strong> can be the <strong>parent</strong> of another <strong>document</strong>. We know how to do that:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[document]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">commenter</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Notice the newly added "parent" relation in the configuration above.</p></div></div><p>We can indicate this relation by adding the following relationship tuples</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Diane is a viewer of document:2021-planning</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:diane'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// document:2021-planning is a parent of document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'parent'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Diane is a viewer of document:2021-planning</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// document:2021-planning is a parent of document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Diane is a viewer of document:2021-planning</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// document:2021-planning is a parent of document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Diane is a viewer of document:2021-planning</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># document:2021-planning is a parent of document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:diane","relation":"viewer","object":"document:2021-planning"},{"user":"document:2021-planning","relation":"parent","object":"document:2021-budget"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane viewer document:2021-planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw document:2021-planning parent document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Diane is a viewer of document:2021-planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // document:2021-planning is a parent of document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>What we still lack is the ability to propagate permissions from parent to children. We want to say that a user is a viewer of a document if either:</p><ul><li>[done]<!-- --> they have a viewer relationship (directly or through domain membership)</li><li>[pending]<!-- --> they have a viewer relationship with the parent document</li></ul><p>We need a way to consider the parent viewers, not just direct viewers of the document when getting a check for:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:diane'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: undefined }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane viewer document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":undefined}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:diane","relation":"viewer","object":"document:2021-budget"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":undefined}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:diane</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-budget</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>More details on this technique can be found in the section <a href="/docs/modeling/parent-child">Modeling Parent-Child Objects</a>.</p><p>We express it like this:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>The users with a viewer relationship to a certain object of type "document" are any of:</p><ul><li>the "viewers": the set of users who are <a href="/docs/concepts#what-are-direct-and-implied-relationships">directly related</a> to the document as a "viewer"</li><li>the "commenters": the set of users who are related to the object as "commenter"</li><li>the "viewers of the parents": from the objects who are related to the doc as parent, return the sets of users who are related to those objects as "viewer"</li></ul><p>What the added section is doing is:</p><ol><li>read all relationship tuples related to document:2021-budget as parent which returns:</li></ol><p><code>[{ "object": "document:2021-budget", "relation": "parent", "user": "document:2021-planning" }]</code></p><ol start="2"><li>for each relationship tuple read, return all usersets that match the following, returning tuples of shape:</li></ol><p><code>{ "object": "document:2021-planning", "viewer", "user": ??? }</code></p><p>including: <code>{ "object": "document:2021-planning", "viewer", "user": "user:diane" }</code></p></div></div><p>The updated authorization model looks like this:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">commenter</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[document]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">domain</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="04-sharing-files-and-folders-publicly">04. Sharing Files And Folders Publicly<a href="#04-sharing-files-and-folders-publicly" class="hash-link" aria-label="Direct link to 04. Sharing Files And Folders Publicly" title="Direct link to 04. Sharing Files And Folders Publicly">​</a></h3><p>Google Drive has a feature which allows <a href="https://support.google.com/a/users/answer/9308873?hl=en" target="_blank" rel="noopener noreferrer">sharing a file or folder publicly</a>, and specifying the permissions a public user might have (writer/commenter/viewer).</p><p>Assume that <code>Anne</code> has created a new document: <code>2021-public-roadmap</code>, has shared it with commenter permissions to the <code>xyz.com</code>, and has shared it as view only with the public at large.</p><p><img loading="lazy" alt="Image showing requirements" src="/assets/images/gdrive-gdrive4-9b75eafa345dde22742988b225671a69.svg" width="940" height="649" class="img_ev3q"></p><p>Here's where another <!-- -->OpenFGA<!-- --> feature, <a href="/docs/concepts#what-is-type-bound-public-access">type bound public access</a> (as in everyone), would come in handy.</p><p>First, we will need to update our model to allow for public access with type <code>user</code> for viewer relation.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">commenter</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, user:*, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[document]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">domain</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"wildcard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>To mark Anne as the owner, the domain members as commenters and the public as viewers, we need to add the following relationship tuples:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is the owner of document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Members of the domain:xyz can comment on document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'domain:xyz#member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'commenter'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Everyone with type `user` can view document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:*'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is the owner of document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Members of the domain:xyz can comment on document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Everyone with type `user` can view document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is the owner of document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Members of the domain:xyz can comment on document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Everyone with type `user` can view document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne is the owner of document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Members of the domain:xyz can comment on document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Everyone with type `user` can view document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"owner","object":"document:2021-public-roadmap"},{"user":"domain:xyz#member","relation":"commenter","object":"document:2021-public-roadmap"},{"user":"user:*","relation":"viewer","object":"document:2021-public-roadmap"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw domain:xyz</span><span class="token comment" style="color:rgb(98, 114, 164)">#member commenter document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:* viewer document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne is the owner of document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Members of the domain:xyz can comment on document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz#member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Everyone with </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">type</span><span class="token plain"> </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> can view document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Anne is an owner of the document</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"owner","object":"document:2021-public-roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">owner</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-public-roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Beth is a member of the xyz.com domain, and so can comment but cannot write</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth writer document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:beth","relation":"writer","object":"document:2021-public-roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:beth</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">writer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-public-roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'commenter'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth commenter document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:beth","relation":"commenter","object":"document:2021-public-roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:beth</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">commenter</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-public-roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Erik is NOT a member of the xyz.com domain, and so can only view the document</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:erik'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik writer document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:erik","relation":"writer","object":"document:2021-public-roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:erik</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">writer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-public-roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:erik'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik viewer document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:erik","relation":"viewer","object":"document:2021-public-roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:erik</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-public-roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Take a look at the following sections for more information.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Search with permissions</span><p class="documentation-card-box-description_u7_j">Give your users search results with objects that they have access to</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/search-with-permissions">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/advanced/gdrive.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/advanced"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Advanced Use-Cases</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/advanced/github"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">GitHub</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#what-you-will-be-modeling" class="table-of-contents__link toc-highlight">What You Will Be Modeling</a><ul><li><a href="#requirements" class="table-of-contents__link toc-highlight">Requirements</a></li><li><a href="#defined-scenarios" class="table-of-contents__link toc-highlight">Defined Scenarios</a></li></ul></li><li><a href="#modeling-google-drives-permissions" class="table-of-contents__link toc-highlight">Modeling Google Drive's Permissions</a><ul><li><a href="#01-individual-permissions" class="table-of-contents__link toc-highlight">01. Individual Permissions</a></li><li><a href="#02-organization-permissions" class="table-of-contents__link toc-highlight">02. Organization Permissions</a></li><li><a href="#03-folder-permission-propagation" class="table-of-contents__link toc-highlight">03. Folder Permission Propagation</a></li><li><a href="#04-sharing-files-and-folders-publicly" class="table-of-contents__link toc-highlight">04. Sharing Files And Folders Publicly</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<img loading="lazy" src="https://pbs.twimg.com/media/Eme_FlYW4AEAYfi?format=jpg&name=large" alt="Image" class="img_ev3q"></p><p>At the end of this section we want to end up with the following permissions represented. Note that a folder is an object in the <strong>document</strong> type, as we do not need a separate type:</p><p><img loading="lazy" alt="Image showing permissions" src="/assets/images/gdrive-gdrive3-e82c9d5308de7d3b5e7b74b59d87044f.svg" width="940" height="578" class="img_ev3q"></p><p>We need to add the notion that a <strong>document</strong> can be the <strong>parent</strong> of another <strong>document</strong>. We know how to do that:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[document]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">commenter</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Notice the newly added "parent" relation in the configuration above.</p></div></div><p>We can indicate this relation by adding the following relationship tuples</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Diane is a viewer of document:2021-planning</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:diane'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// document:2021-planning is a parent of document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'parent'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Diane is a viewer of document:2021-planning</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// document:2021-planning is a parent of document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Diane is a viewer of document:2021-planning</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// document:2021-planning is a parent of document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Diane is a viewer of document:2021-planning</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># document:2021-planning is a parent of document:2021-budget</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:diane","relation":"viewer","object":"document:2021-planning"},{"user":"document:2021-planning","relation":"parent","object":"document:2021-budget"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane viewer document:2021-planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw document:2021-planning parent document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Diane is a viewer of document:2021-planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // document:2021-planning is a parent of document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-planning"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>What we still lack is the ability to propagate permissions from parent to children. We want to say that a user is a viewer of a document if either:</p><ul><li>[done]<!-- --> they have a viewer relationship (directly or through domain membership)</li><li>[pending]<!-- --> they have a viewer relationship with the parent document</li></ul><p>We need a way to consider the parent viewers, not just direct viewers of the document when getting a check for:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:diane'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: undefined }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane viewer document:2021-budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":undefined}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:diane","relation":"viewer","object":"document:2021-budget"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":undefined}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:diane</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-budget"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-budget</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>More details on this technique can be found in the section <a href="/docs/modeling/parent-child">Modeling Parent-Child Objects</a>.</p><p>We express it like this:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>The users with a viewer relationship to a certain object of type "document" are any of:</p><ul><li>the "viewers": the set of users who are <a href="/docs/concepts#what-are-direct-and-implied-relationships">directly related</a> to the document as a "viewer"</li><li>the "commenters": the set of users who are related to the object as "commenter"</li><li>the "viewers of the parents": from the objects who are related to the doc as parent, return the sets of users who are related to those objects as "viewer"</li></ul><p>What the added section is doing is:</p><ol><li>read all relationship tuples related to document:2021-budget as parent which returns:</li></ol><p><code>[{ "object": "document:2021-budget", "relation": "parent", "user": "document:2021-planning" }]</code></p><ol start="2"><li>for each relationship tuple read, return all usersets that match the following, returning tuples of shape:</li></ol><p><code>{ "object": "document:2021-planning", "viewer", "user": ??? }</code></p><p>including: <code>{ "object": "document:2021-planning", "viewer", "user": "user:diane" }</code></p></div></div><p>The updated authorization model looks like this:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">commenter</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[document]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">domain</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="04-sharing-files-and-folders-publicly">04. Sharing Files And Folders Publicly<a href="#04-sharing-files-and-folders-publicly" class="hash-link" aria-label="Direct link to 04. Sharing Files And Folders Publicly" title="Direct link to 04. Sharing Files And Folders Publicly">​</a></h3><p>Google Drive has a feature which allows <a href="https://support.google.com/a/users/answer/9308873?hl=en" target="_blank" rel="noopener noreferrer">sharing a file or folder publicly</a>, and specifying the permissions a public user might have (writer/commenter/viewer).</p><p>Assume that <code>Anne</code> has created a new document: <code>2021-public-roadmap</code>, has shared it with commenter permissions to the <code>xyz.com</code>, and has shared it as view only with the public at large.</p><p><img loading="lazy" alt="Image showing requirements" src="/assets/images/gdrive-gdrive4-9b75eafa345dde22742988b225671a69.svg" width="940" height="649" class="img_ev3q"></p><p>Here's where another <!-- -->OpenFGA<!-- --> feature, <a href="/docs/concepts#what-is-type-bound-public-access">type bound public access</a> (as in everyone), would come in handy.</p><p>First, we will need to update our model to allow for public access with type <code>user</code> for viewer relation.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">commenter</span><span class="token plain">: </span><span class="token directly-assignable">[user, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, user:*, domain#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> commenter </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[document]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">domain</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"commenter"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"wildcard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>To mark Anne as the owner, the domain members as commenters and the public as viewers, we need to add the following relationship tuples:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is the owner of document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Members of the domain:xyz can comment on document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'domain:xyz#member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'commenter'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Everyone with type `user` can view document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:*'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is the owner of document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Members of the domain:xyz can comment on document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Everyone with type `user` can view document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is the owner of document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Members of the domain:xyz can comment on document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Everyone with type `user` can view document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne is the owner of document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Members of the domain:xyz can comment on document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Everyone with type `user` can view document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"owner","object":"document:2021-public-roadmap"},{"user":"domain:xyz#member","relation":"commenter","object":"document:2021-public-roadmap"},{"user":"user:*","relation":"viewer","object":"document:2021-public-roadmap"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw domain:xyz</span><span class="token comment" style="color:rgb(98, 114, 164)">#member commenter document:2021-public-roadmap</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:* viewer document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne is the owner of document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Members of the domain:xyz can comment on document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"domain:xyz#member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Everyone with </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">type</span><span class="token plain"> </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> can view document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Anne is an owner of the document</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"owner","object":"document:2021-public-roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">owner</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-public-roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Beth is a member of the xyz.com domain, and so can comment but cannot write</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth writer document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:beth","relation":"writer","object":"document:2021-public-roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:beth</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">writer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-public-roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'commenter'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth commenter document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:beth","relation":"commenter","object":"document:2021-public-roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:beth</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"commenter"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">commenter</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-public-roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Erik is NOT a member of the xyz.com domain, and so can only view the document</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:erik'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik writer document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:erik","relation":"writer","object":"document:2021-public-roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:erik</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">writer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-public-roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:erik'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:2021-public-roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik viewer document:2021-public-roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:erik","relation":"viewer","object":"document:2021-public-roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:erik</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:2021-public-roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:2021-public-roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Take a look at the following sections for more information.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Search with permissions</span><p class="documentation-card-box-description_u7_j">Give your users search results with objects that they have access to</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/search-with-permissions">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/advanced/gdrive.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/advanced"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Advanced Use-Cases</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/advanced/github"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">GitHub</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#what-you-will-be-modeling" class="table-of-contents__link toc-highlight">What You Will Be Modeling</a><ul><li><a href="#requirements" class="table-of-contents__link toc-highlight">Requirements</a></li><li><a href="#defined-scenarios" class="table-of-contents__link toc-highlight">Defined Scenarios</a></li></ul></li><li><a href="#modeling-google-drives-permissions" class="table-of-contents__link toc-highlight">Modeling Google Drive's Permissions</a><ul><li><a href="#01-individual-permissions" class="table-of-contents__link toc-highlight">01. Individual Permissions</a></li><li><a href="#02-organization-permissions" class="table-of-contents__link toc-highlight">02. Organization Permissions</a></li><li><a href="#03-folder-permission-propagation" class="table-of-contents__link toc-highlight">03. Folder Permission Propagation</a></li><li><a href="#04-sharing-files-and-folders-publicly" class="table-of-contents__link toc-highlight">04. Sharing Files And Folders Publicly</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/advanced/github.html b/docs/modeling/advanced/github.html index f3cbb116f..4b809fe18 100644 --- a/docs/modeling/advanced/github.html +++ b/docs/modeling/advanced/github.html @@ -15,8 +15,8 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> @@ -29,7 +29,7 @@ Let's say we have a <strong>protocols</strong> team that is part of the <strong>engineering</strong>. The simplest way to achieve the aforementioned requirement is just adding this <a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuple</a>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'team:contoso/protocols#member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'team:contoso/engineering'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso/protocols#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso/engineering"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso/protocols#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso/engineering"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso/protocols#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso/engineering"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"team:contoso/protocols#member","relation":"member","object":"team:contoso/engineering"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw team:contoso/protocols</span><span class="token comment" style="color:rgb(98, 114, 164)">#member member team:contoso/engineering</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso/protocols#member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso/engineering"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>which says that members of protocols are members of engineering.</p><blockquote><p><strong>Note:</strong> this is enough and valid for our current requirements, and for other read cases allows determining members of the direct team vs sub teams as the latter come from <strong>team:contoso/protocols#member</strong>. If the #member relation should not be followed for use cases a different approach could be taken.</p></blockquote><p>We can now add a member to the protocols team and check that they are admins of the tooling repository.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// make diane a member of the contoso/protocols team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:diane'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'team:contoso/protocols'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// make diane a member of the contoso/protocols team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso/protocols"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// make diane a member of the contoso/protocols team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso/protocols"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># make diane a member of the contoso/protocols team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso/protocols"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:diane","relation":"member","object":"team:contoso/protocols"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane member team:contoso/protocols</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // </span><span class="token function" style="color:rgb(80, 250, 123)">make</span><span class="token plain"> diane a member of the contoso/protocols team</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso/protocols"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:diane'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo:contoso/tooling'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:contoso/tooling"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:contoso/tooling"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:contoso/tooling"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane admin repo:contoso/tooling</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:diane","relation":"admin","object":"repo:contoso/tooling"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:diane"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:diane</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">admin</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:contoso/tooling"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">repo:contoso/tooling</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>At the end of this section ended with the following permissions represented:</p><p><img loading="lazy" alt="Image showing permissions" src="/assets/images/github-03-7afa9c606e43a97e744eda1e1f201b02.svg" width="940" height="925" class="img_ev3q"></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="04-base-permissions-for-org-members">04. Base Permissions For Org Members<a href="#04-base-permissions-for-org-members" class="hash-link" aria-label="Direct link to 04. Base Permissions For Org Members" title="Direct link to 04. Base Permissions For Org Members">​</a></h3><p>In GitHub, <a href="https://docs.github.com/en/free-pro-team@latest/github/setting-up-and-managing-organizations-and-teams/setting-base-permissions-for-an-organization" target="_blank" rel="noopener noreferrer">"you can set base permissions that apply to all members of an organization when accessing any of the organization's repositories"</a>. For our purposes this means that if:</p><ul><li>User <code>erik</code> is a member of an organization <code>contoso</code></li><li><em>and</em> <code>contoso</code> has a repository <code>tooling</code></li><li><em>and</em> <code>contoso</code> has configured base permission to be "write"</li></ul><p>then <code>erik</code> has write permissions to tooling.</p><p>Let us model that!</p><p>At the end of this section we want to end up with the following permissions represented:</p><p><img loading="lazy" src="/assets/images/github-04-6a9b8175f0c09f9ce3b843911c620693.svg" width="1205" height="925" class="img_ev3q"></p><p>We need to introduce the notion of organization as a type, user organization membership and repository ownership as a relation. - It is worth calling that before this addition we were able to represent almost the entire GitHub repo permissions without adding the notion of organization to <!-- -->OpenFGA<!-- -->. Identifiers for users, repositories and teams were all that was necessary. Let us add support for organizations and membership. Hopefully this feels familiar by now:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>And support for repositories having owners:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">repo</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">reader</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> triager</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">triager</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> maintainer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">maintainer</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> admin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">admin</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"triager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"triager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"maintainer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"maintainer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"triager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"maintainer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Note the added "owner" relation, indicating that organizations can own repositories.</p></div></div><p>We can now make Erik a member of contoso and make contoso own <strong>contoso/tooling</strong>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:erik'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:contoso'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:contoso'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo:contoso/tooling'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:contoso/tooling"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:contoso/tooling"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:contoso/tooling"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:erik","relation":"member","object":"organization:contoso"},{"user":"organization:contoso","relation":"owner","object":"repo:contoso/tooling"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik member organization:contoso</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:contoso owner repo:contoso/tooling</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:contoso/tooling"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>What we still lack is the ability to create "default permissions" for the organization and have those be considered when determining if a user has a particular relation to a repository. Let's start with the simplest case <strong>admin</strong>. We want to say that a user is a admin of a repo if either:</p><ul><li>[done]<!-- --> they have a repo admin relation (directly or through team membership)</li><li>[pending]<!-- --> their organization is configured with <strong>repo_admin</strong> as the base permission</li></ul><p>We need a way to consider the organization members, not just direct relations to the repo when getting a check for:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:erik'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo:contoso/tooling'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:contoso/tooling"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: undefined }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:contoso/tooling"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo:contoso/tooling"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik admin repo:contoso/tooling</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":undefined}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:erik","relation":"admin","object":"repo:contoso/tooling"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":undefined}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:erik"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:erik</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">admin</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo:contoso/tooling"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">repo:contoso/tooling</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>More details on this technique can be found in the section <a href="/docs/modeling/parent-child">Modeling Parent-Child Objects</a>.</p><p>We express it like this:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">repo</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">admin</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member, organization#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> repo_admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> owner</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>The users with an admin relationship to a certain object of type "repo" are any of:</p><ul><li>the "admins": the set of users who are <a href="/docs/concepts#what-are-direct-and-implied-relationships">directly related</a> to the repo as an "admin"</li><li>the "repository admins of the org that owns the repo": from the objects who are related to the doc as owner, return the sets of users who are related to those objects as "repo_admin"</li></ul><p>What the added section is doing is:</p><ol><li>read all relationship tuples related to repo:contoso/tooling as owner which returns:</li></ol><p><code>[{ "object": "repo:contoso/tooling", "relation": "owner", "user": "organization:contoso" }]</code></p><ol start="2"><li>for each relationship tuple read, return all usersets that match the following, returning tuples of shape:</li></ol><p><code>{ "object": "organization:contoso", "relation": "repo_admin", "user": ??? }</code></p></div></div><p>What should the <strong>users</strong> in those relationship tuples with <strong>???</strong> be?</p><ul><li>Well:<ul><li>If the base permission for org contoso is repo_admin then it should be <strong>organization:contoso#member</strong>.</li><li>If the base permission for org contoso is NOT repo_admin, then it should be empty (no relationship tuple).</li></ul></li><li>Whenever the value of this dropdown changes: <img loading="lazy" alt="Selecting new permission level from base permissions drop-down" src="/assets/images/github-org-base-permissions-drop-down-2952b06603835375e74da4bf2f8278f4.png" width="2514" height="1916" class="img_ev3q"><ul><li>Delete the previous relationship tuple and create a new one:<div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:contoso#member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'repo_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:contoso'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"repo_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"repo_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"organization:contoso#member","relation":"repo_admin","object":"organization:contoso"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:contoso</span><span class="token comment" style="color:rgb(98, 114, 164)">#member repo_admin organization:contoso</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso#member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"repo_admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:contoso"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></li></ul></li></ul><p>The updated authorization model looks like this:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">repo</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">admin</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member, organization#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">maintainer</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member, organization#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> admin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member, organization#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> maintainer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">triager</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member, organization#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">reader</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member, organization#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> triager </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> reader </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">repo_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member, organization#member]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"repo"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"maintainer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"maintainer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"triager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"triager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"triager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"maintainer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"repo_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"repo_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="summary">Summary<a href="#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary">​</a></h2><p>GitHub has a number of other permissions. You have <a href="https://docs.github.com/en/free-pro-team@latest/github/setting-up-and-managing-organizations-and-teams/permission-levels-for-an-organization" target="_blank" rel="noopener noreferrer">organization billing managers, users that can manage specific apps, etc</a>. We might explore those in the future, but hopefully this blog post has shown you how you could represent those cases using <!-- -->OpenFGA<!-- -->.</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/advanced/github.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/advanced/gdrive"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Google Drive</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/advanced/slack"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Slack</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#what-you-will-be-modeling" class="table-of-contents__link toc-highlight">What You Will Be Modeling</a><ul><li><a href="#requirements" class="table-of-contents__link toc-highlight">Requirements</a></li><li><a href="#defined-scenarios" class="table-of-contents__link toc-highlight">Defined Scenarios</a></li></ul></li><li><a href="#modeling-githubs-permissions" class="table-of-contents__link toc-highlight">Modeling GitHub's Permissions</a><ul><li><a href="#01-permissions-for-individuals-in-an-org" class="table-of-contents__link toc-highlight">01. Permissions For Individuals In An Org</a></li><li><a href="#02-permissions-for-teams-in-an-org" class="table-of-contents__link toc-highlight">02. Permissions For Teams In An Org</a></li><li><a href="#03-permissions-for-child-teams-in-an-org" class="table-of-contents__link toc-highlight">03. Permissions For Child Teams In An Org</a></li><li><a href="#04-base-permissions-for-org-members" class="table-of-contents__link toc-highlight">04. Base Permissions For Org Members</a></li></ul></li><li><a href="#summary" class="table-of-contents__link toc-highlight">Summary</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/advanced/iot.html b/docs/modeling/advanced/iot.html index 5261e5ea7..7ffc753d5 100644 --- a/docs/modeling/advanced/iot.html +++ b/docs/modeling/advanced/iot.html @@ -15,15 +15,15 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/gdrive">Google Drive</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/github">GitHub</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/slack">Slack</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/advanced/iot">IoT</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/advanced/entitlements">Entitlements</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling/advanced"><span itemprop="name">Advanced Use-Cases</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">IoT</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Modeling Authorization for an IoT Security System with <!-- -->OpenFGA</h1><p>This tutorial explains how to model permissions for an IoT system using <!-- -->OpenFGA<!-- -->.</p><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">What you will learn</span><div class="documentation-card-box-children_i280"><ul><li>How to model a permission system using <a href="/docs/authorization-and-openfga#what-is-openfga">OpenFGA</a></li><li>How to see <!-- -->OpenFGA<!-- --> Authorization in action by modeling an IoT Security Camera System</li></ul></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <!-- -->OpenFGA<!-- --> concepts and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><p>It would be helpful to have an understanding of some concepts of <!-- -->OpenFGA<!-- --> before you start.</p></summary><div><div class="collapsibleContent_i85q"><h4 class="anchor anchorWithStickyNavbar_LWe7" id="direct-access">Direct Access<a href="#direct-access" class="hash-link" aria-label="Direct link to Direct Access" title="Direct link to Direct Access">​</a></h4><p>You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. <a href="/docs/modeling/direct-access">Learn more →</a></p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-concentric-relationships">Modeling Concentric Relationships<a href="#modeling-concentric-relationships" class="hash-link" aria-label="Direct link to Modeling Concentric Relationships" title="Direct link to Modeling Concentric Relationships">​</a></h4><p>You need to know how to update the authorization model to allow having nested relations such as all writers are readers. <a href="/docs/modeling/building-blocks/concentric-relationships">Learn more →</a> Used here to indicate that both IT Admins and Security Guards can view live video.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="direct-relationships">Direct Relationships<a href="#direct-relationships" class="hash-link" aria-label="Direct link to Direct Relationships" title="Direct link to Direct Relationships">​</a></h4><p>You need to know how to disallow granting direct relation to an object and requiring the user to have a relation with another object that would imply a relation with the first one. <a href="/docs/modeling/building-blocks/direct-relationships">Learn more →</a> Used here to indicate that "Rename Device" is a permission that cannot be assigned directly, but can only be granted through the "IT Admin" role.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="user-groups">User Groups<a href="#user-groups" class="hash-link" aria-label="Direct link to User Groups" title="Direct link to User Groups">​</a></h4><p>You need to know how to add users to groups and create relationships between groups of users and an object. <a href="/docs/modeling/building-blocks/direct-relationships">Learn more →</a></p><p>Used here to indicate that security guards on a certain group are security guards on a device in that group.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="concepts--configuration-language">Concepts & Configuration Language<a href="#concepts--configuration-language" class="hash-link" aria-label="Direct link to Concepts & Configuration Language" title="Direct link to Concepts & Configuration Language">​</a></h4><ul><li>Some <a href="/docs/concepts">OpenFGA Concepts</a></li><li><a href="/docs/configuration-language">Configuration Language</a></li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-you-will-be-modeling">What You Will Be Modeling<a href="#what-you-will-be-modeling" class="hash-link" aria-label="Direct link to What You Will Be Modeling" title="Direct link to What You Will Be Modeling">​</a></h2><p>In this tutorial, you will build an authorization model for a sample IoT Security Camera System (detailed below) using <!-- -->OpenFGA<!-- -->. You will use some scenarios to validate the model.</p><p>The goal by the end of this post is to ask <!-- -->OpenFGA<!-- -->: Does person X have permission to perform action Y on device Z? In response, you want to either get a confirmation that person X can indeed do that, or a rejection that they cannot.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="requirements">Requirements<a href="#requirements" class="hash-link" aria-label="Direct link to Requirements" title="Direct link to Requirements">​</a></h3><p>These are the requirements:</p><ul><li><strong>Security guards</strong> have access to <strong>view live and recorded video</strong> from <strong>Devices</strong>.</li><li><strong>IT Admins</strong> can <strong>view live and recorded videos</strong>, as well as <strong>rename</strong> <strong>Devices</strong>.</li><li>To make access management easier, <strong>Devices</strong> can be grouped into <strong>Device Groups</strong>. <strong>Security guards</strong> with access to the <strong>Device Group</strong> are <strong>Security Guards</strong> with access to each <strong>Device</strong> in the group. Similarly for <strong>IT Admins</strong>.</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="defined-scenarios">Defined Scenarios<a href="#defined-scenarios" class="hash-link" aria-label="Direct link to Defined Scenarios" title="Direct link to Defined Scenarios">​</a></h3><p>Use the following scenarios to be able to validate whether the model of the requirements is correct.</p><p>There will be the following users:</p><ul><li>Anne</li><li>Beth</li><li>Charles</li><li>Dianne</li></ul><p>These users have the following roles and permissions:</p><ul><li>Anne is a Security Guard with access to only Device 1</li><li>Beth is an IT Admin with access to only Device 1</li><li>Charles is a Security Guard with access to Device 1 and everything in Device Group 1 (which is Device 2 and Device 3)</li><li>Dianne is an IT Admin with access to Device 1 and everything in Device Group 1</li></ul><p><img loading="lazy" alt="Image showing requirements" src="/assets/images/iot-01-01e62d5f3e91ef20a4f763fb2079c1fa.svg" width="1205" height="461" class="img_ev3q"></p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p>In production, it is highly recommended to use unique, immutable identifiers. Names are used in this article to make it easier to read and follow.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-device-authorization">Modeling Device Authorization<a href="#modeling-device-authorization" class="hash-link" aria-label="Direct link to Modeling Device Authorization" title="Direct link to Modeling Device Authorization">​</a></h2><p>The <!-- -->OpenFGA<!-- --> service is based on <a href="https://zanzibar.academy" target="_blank" rel="noopener noreferrer">Zanzibar</a>, a Relationship Based Access Control system. This means it relies on <a href="/docs/concepts#what-is-an-object">object</a> and <a href="/docs/concepts#what-is-a-user">user</a> <a href="/docs/concepts#what-is-a-relation">relations</a> to perform authorization <a href="/docs/concepts#what-is-a-check-request">checks</a>.</p><p>Starting with devices, you will learn how to express the requirements in terms of relations you can feed into <!-- -->OpenFGA<!-- -->.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-writing-the-initial-model-for-a-device">01. Writing The Initial Model For A Device<a href="#01-writing-the-initial-model-for-a-device" class="hash-link" aria-label="Direct link to 01. Writing The Initial Model For A Device" title="Direct link to 01. Writing The Initial Model For A Device">​</a></h3><p>The requirements stated:</p><ul><li><strong>Security guards</strong> have access to <strong>view live and recorded video</strong> from <strong>Devices</strong>.</li><li><strong>IT Admins</strong> can <strong>view live and recorded videos</strong>, as well as <strong>rename</strong> <strong>Devices</strong>.</li></ul><p>The goal is to ask <!-- -->OpenFGA<!-- --> whether person X has permission to perform action Y on device Z. To start, you will set aside the Security Guard and IT Admin designations and focus on the actions a user can take.</p><p>The actions users can take on a device are: <em>view live videos</em>, <em>view recorded videos</em>, and <em>rename devices</em>. Mapping them to relations, they become: <em>live_video_viewer</em>, <em>recorded_video_viewer</em>, <em>device_renamer</em>.</p><p>In <!-- -->OpenFGA<!-- -->, the <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a> for the device would be:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">device</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">live_video_viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">recorded_video_viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">device_renamer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"live_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"recorded_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"device_renamer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"live_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"recorded_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"device_renamer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-inserting-some-relationship-tuples">02. Inserting Some Relationship Tuples<a href="#02-inserting-some-relationship-tuples" class="hash-link" aria-label="Direct link to 02. Inserting Some Relationship Tuples" title="Direct link to 02. Inserting Some Relationship Tuples">​</a></h3><p>The requirements are:</p><ul><li><strong>Anne</strong> is a <strong>Security Guard</strong> with access to only <strong>Device 1</strong></li><li><strong>Beth</strong> is an <strong>IT Admin</strong> with access to only <strong>Device 1</strong></li><li><strong>Security Guards</strong> can <strong>view live and recorded video</strong></li><li><strong>IT Admins</strong> can <strong>view live and recorded video</strong> and <strong>rename</strong> devices</li></ul><p>Before we tackle the problem of users access to device based on their role, we will try to grant user access based on their view relationship directly.</p><p>We will first focus on Anne and Beth's relationship with Device 1.</p><p>To add Anne as live_video_viewer of device:1:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'live_video_viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"live_video_viewer","object":"device:1"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne live_video_viewer device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>To add Anne as recorded_video_viewer of device:1</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'recorded_video_viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"recorded_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"recorded_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"recorded_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"recorded_video_viewer","object":"device:1"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne recorded_video_viewer device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"recorded_video_viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Likewise, we will add Beth's relationship with device:1.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'live_video_viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'recorded_video_viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device_renamer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"recorded_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device_renamer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"recorded_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_renamer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"recorded_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device_renamer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:beth","relation":"live_video_viewer","object":"device:1"},{"user":"user:beth","relation":"recorded_video_viewer","object":"device:1"},{"user":"user:beth","relation":"device_renamer","object":"device:1"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth live_video_viewer device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth recorded_video_viewer device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth device_renamer device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"recorded_video_viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device_renamer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="verification">Verification<a href="#verification" class="hash-link" aria-label="Direct link to Verification" title="Direct link to Verification">​</a></h4><p>Now that you have some relationship tuples added, you can start using it to <a href="/docs/concepts#what-is-a-check-request">ask</a> some questions, e.g., whether a person has access to rename a device.</p><p>First, you will find out if <code>anne</code> has permission to <code>view the live video</code> on <code>device:1</code>, then you will see if <code>anne</code> can <code>rename</code> <code>device:1</code>.</p><p>Anne has <code>live_video_viewer</code> relationship with device:1.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'live_video_viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne live_video_viewer device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"live_video_viewer","object":"device:1"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">live_video_viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">device:1</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>On the other hand, Anne does not have <code>device_renamer</code> relationship with device:1.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device_renamer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_renamer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_renamer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device_renamer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne device_renamer device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"device_renamer","object":"device:1"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_renamer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">device_renamer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">device:1</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Now, check the other relationships fore Anne and Beth.</p><table><thead><tr><th>User</th><th>Object</th><th>Relation</th><th>Query</th><th>Relation?</th></tr></thead><tbody><tr><td><code>anne</code></td><td><code>device:1</code></td><td><code>live_video_viewer</code></td><td><code>is anne related to device:1 as live_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>beth</code></td><td><code>device:1</code></td><td><code>live_video_viewer</code></td><td><code>is beth related to device:1 as live_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>anne</code></td><td><code>device:1</code></td><td><code>recorded_video_viewer</code></td><td><code>is anne related to device:1 as recorded_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>beth</code></td><td><code>device:1</code></td><td><code>recorded_video_viewer</code></td><td><code>is beth related to device:1 as recorded_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>anne</code></td><td><code>device:1</code></td><td><code>device_renamer</code></td><td><code>is anne related to device:1 as device_renamer?</code></td><td>No</td></tr><tr><td><code>beth</code></td><td><code>device:1</code></td><td><code>device_renamer</code></td><td><code>is beth related to device:1 as device_renamer?</code></td><td>Yes</td></tr></tbody></table><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-updating-our-authorization-model-to-facilitate-future-changes">03. Updating Our Authorization Model To Facilitate Future Changes<a href="#03-updating-our-authorization-model-to-facilitate-future-changes" class="hash-link" aria-label="Direct link to 03. Updating Our Authorization Model To Facilitate Future Changes" title="Direct link to 03. Updating Our Authorization Model To Facilitate Future Changes">​</a></h3><p>Notice how you had to add the Anne and Beth as <a href="/docs/concepts#what-are-direct-and-implied-relationships">direct relations</a> to all the actions they can take on Device 1 instead of just stating that they are related as Security Guard or IT Admin, and having the other permissions implied? In practice this might have some disadvantages: if your authorization model changes, (e.g so that Security Guards can no longer view previously recorded videos), you would need to change relationship tuples in the system instead of just changing the configuration.</p><p>We can address this by using <a href="/docs/modeling/building-blocks/concentric-relationships"><strong>concentric relation models</strong></a>. It allows you to express that sets of users who have a relation X to the object also have relation Y. For example, anyone that is related to the device as a <code>security_guard</code> is also related as a <code>live_video_viewer</code> and <code>recorded_video_viewer</code>, and anyone who is related to the device as an <code>it_admin</code> is also related as a <code>live_video_viewer</code>, a <code>recorded_video_viewer</code>, and a <code>device_renamer</code>.</p><p>At the end you want to make sure that <a href="/docs/concepts#what-is-a-check-request">checking</a> if Anne, Beth, Charles, or Dianne have permission to view the live video or rename the device, will get you the correct answers back.</p><p>The resulting authorization model is:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">device</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">it_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">security_guard</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">live_video_viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> it_admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> security_guard</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">recorded_video_viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> it_admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> security_guard</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">device_renamer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> it_admin</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"it_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"security_guard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"live_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"recorded_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"device_renamer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"it_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"security_guard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"live_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"recorded_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"device_renamer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The requirements are:</p><ul><li><strong>Anne</strong> and <strong>Charles</strong> are <strong>Security Guards</strong> with access <strong>Device 1</strong></li><li><strong>Beth</strong> and <strong>Dianne</strong> are <strong>IT Admins</strong> with access <strong>Device 1</strong></li><li><strong>Security Guards</strong> can <strong>view live and recorded video</strong></li><li><strong>IT Admins</strong> can <strong>view live and recorded video</strong> and <strong>rename</strong> devices</li></ul><p>Instead of adding different relationship tuples with direct relations to the actions they can take, as you did in the previous section, you will only add the relation to their role: <code>it_admin</code> or <code>security_guard</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'security_guard'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'it_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:charles'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'security_guard'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:dianne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'it_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:dianne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:dianne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:dianne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"security_guard","object":"device:1"},{"user":"user:beth","relation":"it_admin","object":"device:1"},{"user":"user:charles","relation":"security_guard","object":"device:1"},{"user":"user:dianne","relation":"it_admin","object":"device:1"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne security_guard device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth it_admin device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles security_guard device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:dianne it_admin device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:dianne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="verification-1">Verification<a href="#verification-1" class="hash-link" aria-label="Direct link to Verification" title="Direct link to Verification">​</a></h4><p>We can now verify whether charles is related to device:1 as live_video_viewer.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:charles'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'live_video_viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles live_video_viewer device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:charles","relation":"live_video_viewer","object":"device:1"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:charles</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">live_video_viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">device:1</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Check the other relationships for anne, beth, charles and dianne.</p><table><thead><tr><th>User</th><th>Object</th><th>Relation</th><th>Query</th><th>Relation?</th></tr></thead><tbody><tr><td><code>anne</code></td><td><code>device:1</code></td><td><code>live_video_viewer</code></td><td><code>is anne related to device:1 as live_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>beth</code></td><td><code>device:1</code></td><td><code>live_video_viewer</code></td><td><code>is beth related to device:1 as live_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>anne</code></td><td><code>device:1</code></td><td><code>recorded_video_viewer</code></td><td><code>is anne related to device:1 as recorded_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>beth</code></td><td><code>device:1</code></td><td><code>recorded_video_viewer</code></td><td><code>is beth related to device:1 as recorded_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>anne</code></td><td><code>device:1</code></td><td><code>device_renamer</code></td><td><code>is anne related to device:1 as device_renamer?</code></td><td>No</td></tr><tr><td><code>beth</code></td><td><code>device:1</code></td><td><code>device_renamer</code></td><td><code>is beth related to device:1 as device_renamer?</code></td><td>Yes</td></tr><tr><td><code>charles</code></td><td><code>device:1</code></td><td><code>live_video_viewer</code></td><td><code>is charles related to device:1 as live_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>dianne</code></td><td><code>device:1</code></td><td><code>live_video_viewer</code></td><td><code>is dianne related to device:1 as live_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>charles</code></td><td><code>device:1</code></td><td><code>recorded_video_viewer</code></td><td><code>is charles related to device:1 as recorded_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>dianne</code></td><td><code>device:1</code></td><td><code>recorded_video_viewer</code></td><td><code>is dianne related to device:1 as recorded_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>charles</code></td><td><code>device:1</code></td><td><code>device_renamer</code></td><td><code>is charles related to device:1 as device_renamer?</code></td><td>No</td></tr><tr><td><code>dianne</code></td><td><code>device:1</code></td><td><code>device_renamer</code></td><td><code>is dianne related to device:1 as device_renamer?</code></td><td>Yes</td></tr></tbody></table><h3 class="anchor anchorWithStickyNavbar_LWe7" id="04-modeling-device-groups">04. Modeling Device Groups<a href="#04-modeling-device-groups" class="hash-link" aria-label="Direct link to 04. Modeling Device Groups" title="Direct link to 04. Modeling Device Groups">​</a></h3><p>Now that you are done with devices. Let us tackle device groups.</p><p>The requirements regarding device groups were:</p><ul><li><strong>Devices</strong> can be grouped into <strong>Device Groups</strong></li><li><strong>Security guards</strong> with access to the <strong>Device Group</strong> are <strong>Security Guards</strong> with access to the <strong>Devices</strong> within the <strong>Device Group</strong>. Similarly for <strong>IT Admins</strong></li></ul><p>The <a href="/docs/concepts#what-is-a-type-definition">type definition</a> for the device group:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">device_group</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">it_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">security_guard</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"it_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"security_guard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"it_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"security_guard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>With this change, the full <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a> becomes:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">device</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">it_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user, device_group#it_admin]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">security_guard</span><span class="token plain">: </span><span class="token directly-assignable">[user, device_group#security_guard]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">live_video_viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> it_admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> security_guard</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">recorded_video_viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> it_admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> security_guard</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">device_renamer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> it_admin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">device_group</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">it_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">security_guard</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"it_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"security_guard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"live_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"recorded_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"device_renamer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"it_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"security_guard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"live_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"recorded_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"device_renamer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"it_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"security_guard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"it_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"security_guard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="updating-relationship-tuples-on-roles">Updating Relationship Tuples On Roles<a href="#updating-relationship-tuples-on-roles" class="hash-link" aria-label="Direct link to Updating Relationship Tuples On Roles" title="Direct link to Updating Relationship Tuples On Roles">​</a></h4><p>Remember that <strong>Charles</strong> is a <strong>Security Guard</strong>, and <strong>Dianne</strong> an <strong>IT Admin</strong> on <strong>Group 1</strong>, enter the <a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuples</a> below to reflect that.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:charles'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'security_guard'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device_group:group1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:dianne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'it_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device_group:group1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:dianne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:dianne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:dianne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:charles","relation":"security_guard","object":"device_group:group1"},{"user":"user:dianne","relation":"it_admin","object":"device_group:group1"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles security_guard device_group:group1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:dianne it_admin device_group:group1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:dianne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>You still need to give all the security guards of group1 a <code>security_guard</code> relation to devices 2 and 3, and similarly for IT Admins. Add the following relationship tuples to do that.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device_group:group1#security_guard'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'security_guard'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:2'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device_group:group1#security_guard'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'security_guard'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:3'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device_group:group1#it_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'it_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:2'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device_group:group1#it_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'it_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:3'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:3"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:3"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:2"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:3"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:2"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:3"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:3"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:3"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"device_group:group1#security_guard","relation":"security_guard","object":"device:2"},{"user":"device_group:group1#security_guard","relation":"security_guard","object":"device:3"},{"user":"device_group:group1#it_admin","relation":"it_admin","object":"device:2"},{"user":"device_group:group1#it_admin","relation":"it_admin","object":"device:3"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw device_group:group1</span><span class="token comment" style="color:rgb(98, 114, 164)">#security_guard security_guard device:2</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw device_group:group1</span><span class="token comment" style="color:rgb(98, 114, 164)">#security_guard security_guard device:3</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw device_group:group1</span><span class="token comment" style="color:rgb(98, 114, 164)">#it_admin it_admin device:2</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw device_group:group1</span><span class="token comment" style="color:rgb(98, 114, 164)">#it_admin it_admin device:3</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#security_guard"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:2"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#security_guard"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:3"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#it_admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:2"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device_group:group1#it_admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:3"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="verification-2">Verification<a href="#verification-2" class="hash-link" aria-label="Direct link to Verification" title="Direct link to Verification">​</a></h4><p>Now that you have finalized the model and added the relationship tuples, you can start asking some queries. Try asking the same queries you did earlier but on device 2 instead of device 1.</p><p>We can ask <code>is dianne related to device:2 as live_video_viewer?</code></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'dianne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'live_video_viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:2'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"dianne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"dianne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"dianne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:2"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw dianne live_video_viewer device:2</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"dianne","relation":"live_video_viewer","object":"device:2"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"dianne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">dianne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">live_video_viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:2"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">device:2</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Type any of the following queries in the <strong>TUPLE QUERIES</strong> section and press <strong>ENTER</strong> on your keyboard to see the results.</p><table><thead><tr><th>User</th><th>Object</th><th>Relation</th><th>Query</th><th>Relation?</th></tr></thead><tbody><tr><td><code>anne</code></td><td><code>device:2</code></td><td><code>live_video_viewer</code></td><td><code>is anne related to device:2 as live_video_viewer?</code></td><td>No</td></tr><tr><td><code>beth</code></td><td><code>device:2</code></td><td><code>live_video_viewer</code></td><td><code>is beth related to device:2 as live_video_viewer?</code></td><td>No</td></tr><tr><td><code>anne</code></td><td><code>device:2</code></td><td><code>recorded_video_viewer</code></td><td><code>is anne related to device:2 as recorded_video_viewer?</code></td><td>No</td></tr><tr><td><code>beth</code></td><td><code>device:2</code></td><td><code>recorded_video_viewer</code></td><td><code>is beth related to device:2 as recorded_video_viewer?</code></td><td>No</td></tr><tr><td><code>anne</code></td><td><code>device:2</code></td><td><code>device_renamer</code></td><td><code>is anne related to device:2 as device_renamer?</code></td><td>No</td></tr><tr><td><code>beth</code></td><td><code>device:2</code></td><td><code>device_renamer</code></td><td><code>is beth related to device:2 as device_renamer?</code></td><td>No</td></tr><tr><td><code>charles</code></td><td><code>device:2</code></td><td><code>live_video_viewer</code></td><td><code>is charles related to device:2 as live_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>dianne</code></td><td><code>device:2</code></td><td><code>live_video_viewer</code></td><td><code>is dianne related to device:2 as live_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>charles</code></td><td><code>device:2</code></td><td><code>recorded_video_viewer</code></td><td><code>is charles related to device:2 as recorded_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>dianne</code></td><td><code>device:2</code></td><td><code>recorded_video_viewer</code></td><td><code>is dianne related to device:2 as recorded_video_viewer?</code></td><td>Yes</td></tr><tr><td><code>charles</code></td><td><code>device:2</code></td><td><code>device_renamer</code></td><td><code>is charles related to device:2 as device_renamer?</code></td><td>No</td></tr><tr><td><code>dianne</code></td><td><code>device:2</code></td><td><code>device_renamer</code></td><td><code>is dianne related to device:2 as device_renamer?</code></td><td>Yes</td></tr></tbody></table><h3 class="anchor anchorWithStickyNavbar_LWe7" id="05-disallow-direct-relationships-to-users">05. Disallow Direct Relationships To Users<a href="#05-disallow-direct-relationships-to-users" class="hash-link" aria-label="Direct link to 05. Disallow Direct Relationships To Users" title="Direct link to 05. Disallow Direct Relationships To Users">​</a></h3><p>Notice that despite following <strong><a href="/docs/modeling/advanced/iot#03-updating-our-authorization-model-to-facilitate-future-changes">Step 03</a></strong>, anne and beth still have direct relations to all the actions they can take on device:1.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="updating-the-authorization-model">Updating The Authorization Model<a href="#updating-the-authorization-model" class="hash-link" aria-label="Direct link to Updating The Authorization Model" title="Direct link to Updating The Authorization Model">​</a></h4><p><code>anne</code> is a <code>live_video_viewer</code> by both her position as <code>security_guard</code> as well as her <em><a href="/docs/concepts#what-are-direct-and-implied-relationships">direct relationship</a></em> assignment. This is undesirable. Imagine <code>anne</code> left her position of <code>security_guard</code> and she will still have <code>live_video_viewer</code> access to <code>device:1</code>.</p><p>To remedy this, remove <code>[user]</code> from <code>live_video_viewer</code>, <code>recorded_video_viewer</code> and <code>device_renamer</code>. This denies direct relations to <code>live_video_viewer</code>, <code>recorded_video_viewer</code> and <code>device_renamer</code> from having an effect. To do this:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">device</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">it_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user, device_group#it_admin]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">security_guard</span><span class="token plain">: </span><span class="token directly-assignable">[user, device_group#security_guard]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">live_video_viewer</span><span class="token plain">: it_admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> security_guard</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">recorded_video_viewer</span><span class="token plain">: it_admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> security_guard</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">device_renamer</span><span class="token plain">: it_admin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">device_group</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">it_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">security_guard</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"it_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"security_guard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"live_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"recorded_video_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"device_renamer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"it_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"it_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"security_guard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"security_guard"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"it_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"security_guard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"it_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"security_guard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Notice that any reference to the <a href="/docs/configuration-language#the-direct-relationship-type-restrictions"><strong>direct relationship type restrictions</strong></a> has been removed. That indicates that a user cannot have a <a href="/docs/concepts#what-are-direct-and-implied-relationships">direct relationship</a> with an object in this type.</p><p>With this change, <code>anne</code> can no longer have a <code>live_video_viewer</code> permission for <code>device:1</code> except through having a <code>security_guard</code> or <code>it_admin</code> role first, and when she loses access to that role, she will automatically lose access to the <code>live_video_viewer</code> permission.</p></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="verification-3">Verification<a href="#verification-3" class="hash-link" aria-label="Direct link to Verification" title="Direct link to Verification">​</a></h4><p>Now that direct relationship is denied, we should see that <code>anne</code> has <code>live_video_viewer</code> relation to <code>device:1</code> solely based on her position as <code>security_guard</code> to <code>device:1</code>. Let's find out.</p><p>To test this, we can add a new user <code>emily</code>. Emily is <strong>not</strong> a <code>security_guard</code> nor an <code>it_admin</code>. However, we attempt to access via direct relations by adding the following <a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuples</a>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:emily'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'live_video_viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:emily'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'recorded_video_viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:emily'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device_renamer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"recorded_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device_renamer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"recorded_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device_renamer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"recorded_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device_renamer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:emily","relation":"live_video_viewer","object":"device:1"},{"user":"user:emily","relation":"recorded_video_viewer","object":"device:1"},{"user":"user:emily","relation":"device_renamer","object":"device:1"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily live_video_viewer device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily recorded_video_viewer device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily device_renamer device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"recorded_video_viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device_renamer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Now try to query <code>is emily related to device:1 as live_video_viewer?</code>. The returned result should be <code>emily is not related to device:1 as live_video_viewer</code>. This confirms that direct relations have no effect on the <code>live_video_viewer</code> relations, and that is because the <a href="/docs/configuration-language#the-direct-relationship-type-restrictions"><strong>direct relationship type restriction</strong></a> was removed from the relation configuration.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:emily'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'live_video_viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'device:1'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily live_video_viewer device:1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:emily","relation":"live_video_viewer","object":"device:1"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:emily</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"live_video_viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">live_video_viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"device:1"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">device:1</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Query on the other relationships and you will see:</p><table><thead><tr><th>User</th><th>Object</th><th>Relation</th><th>Query</th><th>Relation?</th></tr></thead><tbody><tr><td><code>emily</code></td><td><code>device:1</code></td><td><code>recorded_video_viewer</code></td><td><code>is emily related to device:1 as recorded_video_viewer?</code></td><td>No</td></tr><tr><td><code>emily</code></td><td><code>device:1</code></td><td><code>device_renamer</code></td><td><code>is emily related to device:1 as device_renamer?</code></td><td>No</td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_LWe7" id="summary">Summary<a href="#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary">​</a></h2><p>In this post, you were introduced to <a href="/docs/authorization-and-openfga#what-is-fine-grained-authorization-fga">fine grain authentication</a> and <!-- -->OpenFGA<!-- -->.</p><p>Upcoming posts will dive deeper into <!-- -->OpenFGA<!-- -->, introducing concepts that will improve on the model you built today, and tackling more complex permission systems, with more relations and requirements that need to be met.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="exercises-for-you">Exercises For You<a href="#exercises-for-you" class="hash-link" aria-label="Direct link to Exercises For You" title="Direct link to Exercises For You">​</a></h3><ul><li>Try adding a second group tied to devices 4 and 5. Add only Charles and Dianne to this group, then try to run queries that would validate your model.</li><li>Management has decided that Security Guards can only access live videos, and instituted a new position called Security Officer who can view both live and recorded videos. Can you update the authorization model to reflect that?</li></ul></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/advanced/iot.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/advanced/slack"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Slack</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/advanced/entitlements"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Entitlements</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#what-you-will-be-modeling" class="table-of-contents__link toc-highlight">What You Will Be Modeling</a><ul><li><a href="#requirements" class="table-of-contents__link toc-highlight">Requirements</a></li><li><a href="#defined-scenarios" class="table-of-contents__link toc-highlight">Defined Scenarios</a></li></ul></li><li><a href="#modeling-device-authorization" class="table-of-contents__link toc-highlight">Modeling Device Authorization</a><ul><li><a href="#01-writing-the-initial-model-for-a-device" class="table-of-contents__link toc-highlight">01. Writing The Initial Model For A Device</a></li><li><a href="#02-inserting-some-relationship-tuples" class="table-of-contents__link toc-highlight">02. Inserting Some Relationship Tuples</a></li><li><a href="#03-updating-our-authorization-model-to-facilitate-future-changes" class="table-of-contents__link toc-highlight">03. Updating Our Authorization Model To Facilitate Future Changes</a></li><li><a href="#04-modeling-device-groups" class="table-of-contents__link toc-highlight">04. Modeling Device Groups</a></li><li><a href="#05-disallow-direct-relationships-to-users" class="table-of-contents__link toc-highlight">05. Disallow Direct Relationships To Users</a></li></ul></li><li><a href="#summary" class="table-of-contents__link toc-highlight">Summary</a><ul><li><a href="#exercises-for-you" class="table-of-contents__link toc-highlight">Exercises For You</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/advanced/slack.html b/docs/modeling/advanced/slack.html index 3d258cac8..aac3bfcfb 100644 --- a/docs/modeling/advanced/slack.html +++ b/docs/modeling/advanced/slack.html @@ -15,8 +15,8 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> @@ -25,7 +25,7 @@ See <a href="/docs/modeling/user-groups">Modeling User Groups</a> for more.</li><li>How to Model <strong>concentric relationship</strong> to have a certain <a href="/docs/concepts#what-is-a-relation">relation</a> on an object imply another relation on the same object.<br> Used here to indicate that legacy admins have all the permissions of the more granular channels admin.<br> See <a href="/docs/modeling/building-blocks/concentric-relationships">Modeling Concentric Relationships</a> for more.</li><li>How to use <a href="/docs/configuration-language#the-union-operator"><strong>the union operator</strong></a> condition to indicate that a user might have a certain relation with an object if they match any of the criteria indicated.</li></ul></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <!-- -->OpenFGA<!-- --> concepts and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><p>It would be helpful to have an understanding of some concepts of <!-- -->OpenFGA<!-- --> before you start.</p></summary><div><div class="collapsibleContent_i85q"><h4 class="anchor anchorWithStickyNavbar_LWe7" id="direct-access">Direct Access<a href="#direct-access" class="hash-link" aria-label="Direct link to Direct Access" title="Direct link to Direct Access">​</a></h4><p>You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. <a href="/docs/modeling/direct-access">Learn more →</a></p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-concentric-relationships">Modeling Concentric Relationships<a href="#modeling-concentric-relationships" class="hash-link" aria-label="Direct link to Modeling Concentric Relationships" title="Direct link to Modeling Concentric Relationships">​</a></h4><p>You need to know how to update the authorization model to allow having nested relations such as all writers are readers. <a href="/docs/modeling/building-blocks/concentric-relationships">Learn more →</a></p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="concepts--configuration-language">Concepts & Configuration Language<a href="#concepts--configuration-language" class="hash-link" aria-label="Direct link to Concepts & Configuration Language" title="Direct link to Concepts & Configuration Language">​</a></h4><ul><li>Some <a href="/docs/concepts">OpenFGA Concepts</a></li><li><a href="/docs/configuration-language">Configuration Language</a></li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-you-will-be-modeling">What you will be modeling<a href="#what-you-will-be-modeling" class="hash-link" aria-label="Direct link to What you will be modeling" title="Direct link to What you will be modeling">​</a></h2><p>Slack is a messaging app for businesses that connects people to the information they need. By bringing people together to work as one unified team, Slack transforms the way organizations communicate. (Source: <a href="https://slack.com/intl/en-ca/help/articles/115004071768-What-is-Slack-" target="_blank" rel="noopener noreferrer">What is Slack?</a>)</p><p>In this tutorial, you will build a subset of the Slack permission model (detailed below) in <!-- -->OpenFGA<!-- -->, using some scenarios to validate the model.</p><blockquote><p>As reference, you can refer to Slack's publicly available docs:</p><ul><li><a href="https://slack.engineering/role-management-at-slack/" target="_blank" rel="noopener noreferrer">Role Management at Slack</a></li><li><a href="https://slack.com/intl/en-ca/help/articles/360018112273-Types-of-roles-in-Slack" target="_blank" rel="noopener noreferrer">Types of Roles in Slack</a></li><li><a href="https://slack.com/intl/en-ca/help/articles/201314026-Permissions-by-role-in-Slack" target="_blank" rel="noopener noreferrer">Permissions by Role in Slack</a></li><li><a href="https://slack.com/intl/en-ca/help/articles/115005225987-Manage-a-workspace-on-Enterprise-Grid" target="_blank" rel="noopener noreferrer">Manage a Workspace on Enterprise Grid</a></li><li><a href="https://slack.com/intl/en-ca/help/articles/360004635551-Manage-channel-posting-permissions-" target="_blank" rel="noopener noreferrer">Manage channel posting permissions</a></li></ul></blockquote><blockquote><p>Note: For brevity, this tutorial will not model all of Slack's permissions. Instead, it will focus on modeling the scenarios outlined below.</p></blockquote><h3 class="anchor anchorWithStickyNavbar_LWe7" id="requirements">Requirements<a href="#requirements" class="hash-link" aria-label="Direct link to Requirements" title="Direct link to Requirements">​</a></h3><p>This tutorial will focus on the following sections (this is a partial list of Slack's roles):</p><p>Workspace Roles:</p><ul><li><strong>Guest</strong>: This type of user is limited in their ability to use Slack, and is only permitted to see one or multiple delegated channels.</li><li><strong>Member</strong>: This is the base type of user that does not have any particular administrative abilities, but has basic access to the organization's Slack workspaces. When an administrative change needs to be made, these users need the support of admins and owners to make the changes.</li><li><strong>Legacy Admin</strong>: This type of user is the basic administrator of any organization, and can make a wide variety of administrative changes across Slack, such as renaming channels, archiving channels, setting up preferences and policies, inviting new users, and installing applications. Users with this role perform the majority of administrative tasks across a team.</li></ul><p>System Roles:</p><ul><li><strong>Channels Admin</strong>: This type of user has the permission to archive channels, rename channels, create private channels, and convert public channels into private channels.</li></ul><p>Channel Settings:</p><ul><li><strong>Visibility</strong>:<ul><li><strong>Public</strong>: Visible to all members and open to join</li><li><strong>Private</strong>: Visible to admins and invited members</li></ul></li><li><a href="https://slack.com/intl/en-ca/help/articles/360004635551-Manage-channel-posting-permissions-" target="_blank" rel="noopener noreferrer"><strong>Posting Permissions</strong></a>:<ul><li><strong>Open</strong>: Anyone can post</li><li><strong>Limited</strong>: Only allowed members can post</li></ul></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="defined-scenarios">Defined Scenarios<a href="#defined-scenarios" class="hash-link" aria-label="Direct link to Defined Scenarios" title="Direct link to Defined Scenarios">​</a></h3><p>Use the following scenarios to be able to validate whether the model of the requirements is correct.</p><p>There will be the following users:</p><ul><li>Amy</li><li>Bob</li><li>Catherine</li><li>David</li><li>Emily</li></ul><p>These users will interact in the following scenarios:</p><ul><li>You will assume there is a Slack workspace called Sandcastle</li><li>Amy is a legacy admin of the Sandcastle workspace</li><li>Bob is a member of the Sandcastle workspace with a channels admin role (Read more about system roles at Slack <a href="https://slack.engineering/role-management-at-slack/" target="_blank" rel="noopener noreferrer">here</a>)</li><li>Catherine and Emily are normal members of the Sandcastle workspace, they can view all public channels, as well as channels they have been invited to</li><li>David is a guest user with only view and write access to #proj-marketing-campaign, one of the public channels in the Sandcastle workspace</li><li>Bob and Emily are in a private channel #marketing-internal in the Sandcastle workspace which only they can view and post to</li><li>All members of the Sandcastle workspace can view the general channel, but only Amy and Emily can post to it</li></ul><p><img loading="lazy" alt="Image showing requirements" src="/assets/images/slack-01-b6e717f5e865abef206372fda13e528e.svg" width="1205" height="461" class="img_ev3q"></p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p>In production, it is highly recommended to use unique, immutable identifiers. Names are used in this article to make it easier to read and follow.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-workspaces--channels">Modeling Workspaces & Channels<a href="#modeling-workspaces--channels" class="hash-link" aria-label="Direct link to Modeling Workspaces & Channels" title="Direct link to Modeling Workspaces & Channels">​</a></h2><p>The goal by the end of this post is to ask <!-- -->OpenFGA<!-- -->: Does person X have permission to perform action Y on channel Z? In response, you want to either get a confirmation that person X can indeed do that, or a rejection that they cannot. E.g. does David have access to view #general?</p><p>The <!-- -->OpenFGA<!-- --> is based on <a href="https://zanzibar.academy" target="_blank" rel="noopener noreferrer">Zanzibar</a>, a Relation Based Access Control system. This means it relies on <a href="/docs/concepts#what-is-an-object">objects</a> and <a href="/docs/concepts#what-is-a-user">user</a> <a href="/docs/concepts#what-is-a-relation">relations</a> to perform authorization <a href="/docs/concepts#what-is-a-check-request">checks</a>.</p><p>Setting aside the permissions, you will start with the roles and learn how to express the requirements in terms of relations you can feed into <!-- -->OpenFGA<!-- -->.</p><p>The requirements stated:</p><ul><li><strong>Amy</strong> is a <strong>legacy admin</strong> of the <strong>Sandcastle workspace</strong></li><li><strong>Bob</strong> is a <strong>channels admin</strong> of the <strong>Sandcastle workspace</strong></li><li><strong>Catherine</strong> and <strong>Emily</strong> are a normal <strong>members</strong> of the <strong>Sandcastle workspace</strong></li><li><strong>David</strong> is a <strong>guest</strong> user</li></ul><p>Here is how you would express than in <!-- -->OpenFGA<!-- -->'s <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>: You have a <a href="/docs/concepts#what-is-a-type">type</a> called "workspace", and users can be related to it as a legacy_admin, channels_admin, member and guest</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">legacy_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">channels_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">guest</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"legacy_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"channels_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"guest"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"legacy_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"channels_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"guest"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p><strong>Objects</strong> of type <code>workspace</code> have users related to them as:</p><ul><li>Legacy Admin (<code>legacy_admin</code>)</li><li>Channels Admin (<code>channels_admin</code>)</li><li>Member (<code>member</code>)</li><li>Guest (<code>guest</code>)</li></ul><p><a href="/docs/configuration-language#the-direct-relationship-type-restrictions">Direct relationship type restrictions</a> indicate that a user can have a <a href="/docs/concepts#what-are-direct-and-implied-relationships">direct relationship</a> with an object of the type the relation specifies.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-individual-permissions">01. Individual Permissions<a href="#01-individual-permissions" class="hash-link" aria-label="Direct link to 01. Individual Permissions" title="Direct link to 01. Individual Permissions">​</a></h3><p>To keep things simple and focus on <!-- -->OpenFGA<!-- --> rather than Slack complexity, we will model only four roles (legacy_admin, channels_admin, member, guest).</p><p>At the end of this section we want to have the following permissions represented</p><table><thead><tr><th>User</th><th>Relation</th><th>Object</th></tr></thead><tbody><tr><td>amy</td><td>legacy_admin</td><td>workspace:sandcastle</td></tr><tr><td>bob</td><td>channels_admin</td><td>workspace:sandcastle</td></tr><tr><td>catherine</td><td>member</td><td>workspace:sandcastle</td></tr><tr><td>david</td><td>guest</td><td>workspace:sandcastle</td></tr><tr><td>emily</td><td>member</td><td>workspace:sandcastle</td></tr></tbody></table><p>To represent permissions in <!-- -->OpenFGA<!-- --> we use <a href="/docs/concepts#what-is-a-relation">relations</a>. For workspace permissions we need to create the following <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">legacy_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">channels_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">guest</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"legacy_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"channels_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"guest"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"legacy_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"channels_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"guest"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The <!-- -->OpenFGA<!-- --> service determines if a <a href="/docs/concepts#what-is-a-user">user</a> has access to an <a href="/docs/concepts#what-is-an-object">object</a> by <a href="/docs/concepts#what-is-a-check-request">checking</a> if the user has a relation to that object. Let us examine one of those relations in detail:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>The snippet above indicates that objects of type workspace have users related to them as "member" if those users belong to the userset of all users related to the workspace as "member".</p><p>This means that a user can be <a href="/docs/concepts#what-are-direct-and-implied-relationships">directly related</a> as a member to an object of type "workspace"</p></div></div><p>If we want to say <code>amy</code> is a <code>legacy_admin</code> of <code>workspace:sandcastle</code> we create this relationship tuple</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Amy is a Legacy Admin in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:amy'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'legacy_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Amy is a Legacy Admin in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Amy is a Legacy Admin in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Amy is a Legacy Admin in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:amy","relation":"legacy_admin","object":"workspace:sandcastle"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy legacy_admin workspace:sandcastle</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Amy is a Legacy Admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">in</span><span class="token plain"> the Sandcastle workspace</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We can now ask <!-- -->OpenFGA<!-- --> "is <code>amy</code> a legacy_admin of <strong>workspace:sandcastle</strong>?"</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:amy'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'legacy_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy legacy_admin workspace:sandcastle</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:amy","relation":"legacy_admin","object":"workspace:sandcastle"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:amy</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">legacy_admin</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">workspace:sandcastle</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We can also say that <code>catherine</code> is a <code>member</code> of <code>workspace:sandcastle</code>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Catherine is a Member in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:catherine'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Catherine is a Member in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:catherine"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Catherine is a Member in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:catherine"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Catherine is a Member in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:catherine"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:catherine","relation":"member","object":"workspace:sandcastle"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:catherine member workspace:sandcastle</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Catherine is a Member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">in</span><span class="token plain"> the Sandcastle workspace</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:catherine"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>And verify by <a href="/docs/concepts#what-is-a-check-request">asking</a> <!-- -->OpenFGA</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:catherine'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:catherine"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:catherine"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:catherine"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:catherine member workspace:sandcastle</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:catherine","relation":"member","object":"workspace:sandcastle"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:catherine"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:catherine</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">member</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">workspace:sandcastle</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Catherine, on the other hand, is not a legacy_admin of workspace:sandcastle.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:catherine'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'legacy_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:catherine"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:catherine"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:catherine"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:catherine legacy_admin workspace:sandcastle</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:catherine","relation":"legacy_admin","object":"workspace:sandcastle"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:catherine"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:catherine</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">legacy_admin</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">workspace:sandcastle</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Repeat this process for the other relationships</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Bob is a Channels Admin in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channels_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// David is a guest in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:david'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'guest'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Emily is a Member in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:emily'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property unquoted">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Bob is a Channels Admin in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channels_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// David is a guest in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:david'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'guest'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Emily is a Member in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:emily'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Bob is a Channels Admin in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"channels_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// David is a guest in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"guest"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Emily is a Member in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Bob is a Channels Admin in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channels_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// David is a guest in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"guest"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Emily is a Member in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Bob is a Channels Admin in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channels_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># David is a guest in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"guest"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Emily is a Member in the Sandcastle workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:bob","relation":"channels_admin","object":"workspace:sandcastle"},{"user":"user:david","relation":"guest","object":"workspace:sandcastle"},{"user":"user:emily","relation":"member","object":"workspace:sandcastle"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob channels_admin workspace:sandcastle</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:david guest workspace:sandcastle</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily member workspace:sandcastle</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Bob is a Channels Admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">in</span><span class="token plain"> the Sandcastle workspace</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"channels_admin"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // David is a guest </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">in</span><span class="token plain"> the Sandcastle workspace</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"guest"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Emily is a Member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">in</span><span class="token plain"> the Sandcastle workspace</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="verification">Verification<a href="#verification" class="hash-link" aria-label="Direct link to Verification" title="Direct link to Verification">​</a></h4><p>To verify, we can issue <a href="/docs/concepts#what-is-a-check-request">check request</a> to verify it is working as expected.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:amy'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'legacy_admin'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy legacy_admin workspace:sandcastle</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:amy","relation":"legacy_admin","object":"workspace:sandcastle"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:amy</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">legacy_admin</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">workspace:sandcastle</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Let's try to verify the followings:</p><table><thead><tr><th>User</th><th>Object</th><th>Relation</th><th>Query</th><th>Relation?</th></tr></thead><tbody><tr><td><code>amy</code></td><td><code>workspace:sandcastle</code></td><td><code>legacy_admin</code></td><td><code>is amy related to workspace:sandcastle as legacy_admin?</code></td><td>Yes</td></tr><tr><td><code>david</code></td><td><code>workspace:sandcastle</code></td><td><code>legacy_admin</code></td><td><code>is david related to workspace:sandcastle as legacy_admin?</code></td><td>No</td></tr><tr><td><code>amy</code></td><td><code>workspace:sandcastle</code></td><td><code>guest</code></td><td><code>is amy related to workspace:sandcastle as guest?</code></td><td>No</td></tr><tr><td><code>david</code></td><td><code>workspace:sandcastle</code></td><td><code>guest</code></td><td><code>is david related to workspace:sandcastle as guest?</code></td><td>Yes</td></tr><tr><td><code>amy</code></td><td><code>workspace:sandcastle</code></td><td><code>member</code></td><td><code>is amy related to workspace:sandcastle as member?</code></td><td>No</td></tr><tr><td><code>david</code></td><td><code>workspace:sandcastle</code></td><td><code>member</code></td><td><code>is david related to workspace:sandcastle as member?</code></td><td>No</td></tr></tbody></table><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-updating-the-workspace-authorization-model-with-implied-relations">02. Updating The <code>workspace</code> Authorization Model With Implied Relations<a href="#02-updating-the-workspace-authorization-model-with-implied-relations" class="hash-link" aria-label="Direct link to 02-updating-the-workspace-authorization-model-with-implied-relations" title="Direct link to 02-updating-the-workspace-authorization-model-with-implied-relations">​</a></h3><p>Some of the queries that you ran earlier, while returning the correct response, do not match reality. One of which is:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:amy'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy member workspace:sandcastle</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:amy","relation":"member","object":"workspace:sandcastle"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:amy</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">member</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">workspace:sandcastle</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>As you saw before, running this query will return <code>amy is not a member of workspace:sandcastle</code>, which is correct based on the data you have given <!-- -->OpenFGA<!-- --> so far. But in reality, Amy, who is a <code>legacy_admin</code> already has an <a href="/docs/concepts#what-are-direct-and-implied-relationships">implied</a> <code>channels_admin</code> and <code>member</code> relations. In fact anyone (other than a guest) is a <code>member</code> of the workspace.</p><p>To change this behavior, we will update our system with a <a href="/docs/modeling/building-blocks/concentric-relationships"><strong>concentric relationship</strong></a> model.</p><p>With the following updated <a href="/docs/concepts#what-is-a-type-definition">authorization model</a>, you are informing <!-- -->OpenFGA<!-- --> that any user who is related to a workspace as <code>legacy_admin</code>, is also related as a <code>channels_admin</code> and a <code>member</code> .</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">legacy_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">channels_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> legacy_admin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> channels_admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> legacy_admin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">guest</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"legacy_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"channels_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channels_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"guest"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"legacy_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"channels_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"guest"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We can then verify <code>amy</code> is a <code>member</code> of <code>workspace:sandcastle</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:amy'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy member workspace:sandcastle</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:amy","relation":"member","object":"workspace:sandcastle"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:amy</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">member</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">workspace:sandcastle</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We can check for other users and relationships.</p><table><thead><tr><th>User</th><th>Object</th><th>Relation</th><th>Query</th><th>Relation?</th></tr></thead><tbody><tr><td><code>amy</code></td><td><code>workspace:sandcastle</code></td><td><code>legacy_admin</code></td><td><code>is amy related to workspace:sandcastle as legacy_admin?</code></td><td>Yes</td></tr><tr><td><code>david</code></td><td><code>workspace:sandcastle</code></td><td><code>legacy_admin</code></td><td><code>is david related to workspace:sandcastle as legacy_admin?</code></td><td>No</td></tr><tr><td><code>amy</code></td><td><code>workspace:sandcastle</code></td><td><code>guest</code></td><td><code>is amy related to workspace:sandcastle as guest?</code></td><td>No</td></tr><tr><td><code>david</code></td><td><code>workspace:sandcastle</code></td><td><code>guest</code></td><td><code>is david related to workspace:sandcastle as guest?</code></td><td>Yes</td></tr><tr><td><code>amy</code></td><td><code>workspace:sandcastle</code></td><td><code>member</code></td><td><code>is amy related to workspace:sandcastle as member?</code></td><td>Yes</td></tr><tr><td><code>david</code></td><td><code>workspace:sandcastle</code></td><td><code>member</code></td><td><code>is david related to workspace:sandcastle as member?</code></td><td>No</td></tr></tbody></table><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-updating-the-authorization-model-to-include-channels">03. Updating The Authorization Model To Include Channels<a href="#03-updating-the-authorization-model-to-include-channels" class="hash-link" aria-label="Direct link to 03. Updating The Authorization Model To Include Channels" title="Direct link to 03. Updating The Authorization Model To Include Channels">​</a></h3><p>So far, you have modeled the users' <a href="/docs/concepts#what-is-a-relation">relations</a> to the workspace itself. In this task you will expand the model to include the relations concerning the channels.</p><p>By the end of it, you will run some queries to check whether a user can view or write to a certain channel. Queries such as:</p><ul><li><code>is david related to channel:general as viewer?</code> (expected answer: No relation, as David is a guest user with only a relation to #proj-marketing-campaign)</li><li><code>is david related to channel:proj_marketing_campaign as viewer?</code> (expected answer: There is a relation, as there is a relation between David and #proj-marketing-campaign as a writer)</li><li><code>is bob related to channel:general as viewer?</code> (expected answer: There is a relation, as Bob is a member of the Sandcastle workspace, and all members of the workspace have a viewer relation to #general)</li></ul><p>The requirements are:</p><ul><li><strong>Amy</strong>, <strong>Bob</strong>, <strong>Catherine</strong> and <strong>Emily</strong>, are normal members of the Sandcastle workspace, they can <strong>view</strong> all <strong>public channels</strong>, in this case: #general and #proj-marketing-campaign</li><li><strong>David</strong>, a guest user, has only <strong>view</strong> and <strong>write</strong> access to the <strong>#proj-marketing-campaign channel</strong></li><li><strong>Bob</strong> and <strong>Emily</strong> are the only ones with either <strong>view</strong> or <strong>write</strong> access to the <strong>#marketing-internal channel</strong></li><li><strong>Amy</strong> and <strong>Emily</strong> are the only ones with <strong>write</strong> access to the <strong>#general channel</strong></li></ul><p>The possible relations to channels are:</p><ul><li>Workspace includes the channel, consider the relation that of a <strong>parent workspace</strong></li><li>A user can be a <strong>viewer</strong> and/or <strong>writer</strong> on a channel</li></ul><p>The authorization model already has a section describing the workspace, what remains is describing the channel. That can be done by adding the following section to the configuration above:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">channel</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent_workspace</span><span class="token plain">: </span><span class="token directly-assignable">[workspace]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent_workspace"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent_workspace"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channels_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"guest"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channels_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"guest"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>The configuration snippet above describes a channel that can have the following relations:</p><ul><li>workspaces related to it as <code>parent_workspace</code></li><li>users related to it as <code>writer</code></li><li>users related to it as <code>viewer</code></li></ul></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="implied-relation">Implied Relation<a href="#implied-relation" class="hash-link" aria-label="Direct link to Implied Relation" title="Direct link to Implied Relation">​</a></h4><p>There is an <a href="/docs/concepts#what-are-direct-and-implied-relationships">implied relation</a> that anyone who can write to a channel can also read from it, so the authorization model can be modified to be:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">channel</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent_workspace</span><span class="token plain">: </span><span class="token directly-assignable">[workspace]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent_workspace"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent_workspace"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channels_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"guest"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channels_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"guest"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Note that the channel type definition has been updated to indicate that viewer is the union of:</p><ul><li>the set of users with a <a href="/docs/concepts#what-are-direct-and-implied-relationships">direct</a> viewer relation to this object</li><li>the set of users with writer relations to this object</li></ul></div></div><p>As a result, the authorization model is:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">workspace</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">legacy_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">channels_admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> legacy_admin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> channels_admin </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> legacy_admin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">guest</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">channel</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent_workspace</span><span class="token plain">: </span><span class="token directly-assignable">[workspace]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"legacy_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"channels_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channels_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"guest"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"legacy_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"channels_admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"guest"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent_workspace"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent_workspace"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channels_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"guest"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"legacy_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channels_admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"guest"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="updating-relationship-tuples">Updating Relationship Tuples<a href="#updating-relationship-tuples" class="hash-link" aria-label="Direct link to Updating Relationship Tuples" title="Direct link to Updating Relationship Tuples">​</a></h4><p>What remains is to add the <a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuples</a> to indicate the relation between the users, workspace and the channels.</p><p>The Sandcastle workspace is a parent workspace of the #general, #marketing-internal and #proj-marketing-campaign channels.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'parent_workspace'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channel:general'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'parent_workspace'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channel:marketing_internal'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'parent_workspace'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channel:proj_marketing_campaign'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"parent_workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"parent_workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:marketing_internal"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"parent_workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent_workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent_workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:marketing_internal"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent_workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"parent_workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"parent_workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:marketing_internal"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"parent_workspace"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"workspace:sandcastle","relation":"parent_workspace","object":"channel:general"},{"user":"workspace:sandcastle","relation":"parent_workspace","object":"channel:marketing_internal"},{"user":"workspace:sandcastle","relation":"parent_workspace","object":"channel:proj_marketing_campaign"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle parent_workspace channel:general</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle parent_workspace channel:marketing_internal</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle parent_workspace channel:proj_marketing_campaign</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"parent_workspace"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"parent_workspace"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:marketing_internal"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"parent_workspace"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="general-channel"><code>#general</code> Channel<a href="#general-channel" class="hash-link" aria-label="Direct link to general-channel" title="Direct link to general-channel">​</a></h5><p>The <code>#general</code> channel is a public channel visible to all the members of the workspace. In <!-- -->OpenFGA<!-- -->, you represent this relation in the form of the following relationship tuple:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle#member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channel:general'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"workspace:sandcastle#member","relation":"viewer","object":"channel:general"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle</span><span class="token comment" style="color:rgb(98, 114, 164)">#member viewer channel:general</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // The </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">set</span><span class="token plain"> of </span><span class="token function" style="color:rgb(80, 250, 123)">users</span><span class="token plain"> related to </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">workspace:sandcastle</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> as member are also related to </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">channel:general</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> as </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle#member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>This indicates The set of users related to <code>workspace:sandcastle</code> as member are also related to <code>channel:general</code> as <code>viewer</code></p></div></div><p>And to indicate that Amy and Emily can write to it:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:amy'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channel:general'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:emily'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channel:general'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:amy","relation":"writer","object":"channel:general"},{"user":"user:emily","relation":"writer","object":"channel:general"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy writer channel:general</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily writer channel:general</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:amy"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="marketing-internal-channel"><code>#marketing-internal</code> Channel<a href="#marketing-internal-channel" class="hash-link" aria-label="Direct link to marketing-internal-channel" title="Direct link to marketing-internal-channel">​</a></h5><p>The <code>#marketing-internal</code> is visible to only Bob and Emily. They can view and write in it.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channel:marketing_internal'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:emily'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channel:marketing_internal'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:marketing_internal"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:marketing_internal"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:marketing_internal"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:marketing_internal"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:marketing_internal"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:marketing_internal"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:bob","relation":"writer","object":"channel:marketing_internal"},{"user":"user:emily","relation":"writer","object":"channel:marketing_internal"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob writer channel:marketing_internal</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily writer channel:marketing_internal</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:marketing_internal"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:marketing_internal"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="proj-marketing-campaign-channel"><code>#proj-marketing-campaign</code> Channel<a href="#proj-marketing-campaign-channel" class="hash-link" aria-label="Direct link to proj-marketing-campaign-channel" title="Direct link to proj-marketing-campaign-channel">​</a></h5><p>The <code>#proj-marketing-campaign</code> is public to all members of the Sandcastle workspace. They can view and write in it.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'workspace:sandcastle#member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channel:proj_marketing_campaign'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"workspace:sandcastle#member","relation":"writer","object":"channel:proj_marketing_campaign"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle</span><span class="token comment" style="color:rgb(98, 114, 164)">#member writer channel:proj_marketing_campaign</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"workspace:sandcastle#member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>David is a guest user who can also view and write to #proj-marketing-campaign</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:david'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channel:proj_marketing_campaign'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:david","relation":"writer","object":"channel:proj_marketing_campaign"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:david writer channel:proj_marketing_campaign</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="verification-1">Verification<a href="#verification-1" class="hash-link" aria-label="Direct link to Verification" title="Direct link to Verification">​</a></h4><p>Now that you have added the necessary relationship tuples, you will check to make sure that your configuration is valid.</p><p>First, we want to ensure david is not related to channel:general as viewer.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:david'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channel:general'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:david viewer channel:general</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:david","relation":"viewer","object":"channel:general"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:david</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:general"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">channel:general</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>David should be related to channel:proj_marketing_campaign as viewer.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:david'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'channel:proj_marketing_campaign'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:david viewer channel:proj_marketing_campaign</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:david","relation":"viewer","object":"channel:proj_marketing_campaign"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:david"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:david</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"channel:proj_marketing_campaign"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">channel:proj_marketing_campaign</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Repeat this for the following relations</p><table><thead><tr><th>User</th><th>Object</th><th>Relation</th><th>Query</th><th>Relation?</th></tr></thead><tbody><tr><td><code>amy</code></td><td><code>workspace:sandcastle</code></td><td><code>legacy_admin</code></td><td><code>is amy related to workspace:sandcastle as legacy_admin?</code></td><td>Yes</td></tr><tr><td><code>amy</code></td><td><code>workspace:sandcastle</code></td><td><code>member</code></td><td><code>is amy related to workspace:sandcastle as member?</code></td><td>Yes</td></tr><tr><td><code>amy</code></td><td><code>workspace:sandcastle</code></td><td><code>channels_admin</code></td><td><code>is amy related to workspace:sandcastle as channels_admin?</code></td><td>Yes</td></tr><tr><td><code>amy</code></td><td><code>channel:general</code></td><td><code>writer</code></td><td><code>is amy related to channel:general as writer?</code></td><td>Yes</td></tr><tr><td><code>amy</code></td><td><code>channel:general</code></td><td><code>viewer</code></td><td><code>is amy related to channel:general as viewer?</code></td><td>Yes</td></tr><tr><td><code>amy</code></td><td><code>channel:marketing_internal</code></td><td><code>writer</code></td><td><code>is amy related to channel:marketing_internal as writer?</code></td><td>No</td></tr><tr><td><code>amy</code></td><td><code>channel:marketing_internal</code></td><td><code>viewer</code></td><td><code>is amy related to channel:marketing_internal as viewer?</code></td><td>No</td></tr><tr><td><code>emily</code></td><td><code>channel:marketing_internal</code></td><td><code>writer</code></td><td><code>is emily related to channel:marketing_internal as writer?</code></td><td>Yes</td></tr><tr><td><code>emily</code></td><td><code>channel:marketing_internal</code></td><td><code>viewer</code></td><td><code>is emily related to channel:marketing_internal as viewer?</code></td><td>Yes</td></tr><tr><td><code>david</code></td><td><code>workspace:sandcastle</code></td><td><code>guest</code></td><td><code>is david related to workspace:sandcastle as guest?</code></td><td>Yes</td></tr><tr><td><code>david</code></td><td><code>workspace:sandcastle</code></td><td><code>member</code></td><td><code>is david related to workspace:sandcastle as member?</code></td><td>No</td></tr><tr><td><code>david</code></td><td><code>channel:general</code></td><td><code>viewer</code></td><td><code>is david related to channel:general as viewer?</code></td><td>No</td></tr><tr><td><code>david</code></td><td><code>channel:marketing_internal</code></td><td><code>viewer</code></td><td><code>is david related to channel:marketing_internal as viewer?</code></td><td>No</td></tr><tr><td><code>david</code></td><td><code>channel:proj_marketing_campaign</code></td><td><code>viewer</code></td><td><code>is david related to channel:proj_marketing_campaign as viewer?</code></td><td>Yes</td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_LWe7" id="summary">Summary<a href="#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary">​</a></h2><ul><li>Have a basic understanding of <a href="/docs/authorization-and-openfga#authentication-vs-authorization">authorization</a> and <a href="/docs/concepts">OpenFGA Concepts</a>.</li><li>Understand how to model authorization for a communication platform like Slack using <a href="/docs/authorization-and-openfga#what-is-openfga">OpenFGA</a>.</li></ul><p>In this tutorial, you:</p><ul><li>were introduced to <a href="/docs/authorization-and-openfga#what-is-fine-grained-authorization-fga">fine grain authentication</a> and <a href="/docs/authorization-and-openfga#what-is-openfga">OpenFGA</a>.</li><li>learned how to build and test an <!-- -->OpenFGA<!-- --> authorization model for a communication platforms like Slack.</li></ul><p>Upcoming tutorials will dive deeper into <!-- -->OpenFGA<!-- -->, introducing concepts that will improve on the model you built today, and tackling different permission systems, with other relations and requirements that need to be met.</p><p>If you are interested in learning more about Authorization and Role Management at Slack, check out the Okta Fine Grained Authorization (FGA) team's chat with the Slack engineering team.</p><figure class="video_container"><iframe style="margin-top:36px;border-radius:8px" width="100%" height="500" src="https://www.youtube-nocookie.com/embed/-iVBsagaK5Y" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe></figure><h3 class="anchor anchorWithStickyNavbar_LWe7" id="exercises-for-you">Exercises For You<a href="#exercises-for-you" class="hash-link" aria-label="Direct link to Exercises For You" title="Direct link to Exercises For You">​</a></h3><ul><li>Try adding more relationship tuples to represent other users and channels being added. Then run queries to make sure that the authorization model remains valid.</li><li>Update the configuration to model more Slack permissions (workspace owners, Slack orgs), then add the relationship tuples necessary and run some queries to validate your configuration.</li></ul></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/advanced/slack.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/advanced/github"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">GitHub</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/advanced/iot"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">IoT</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#what-you-will-be-modeling" class="table-of-contents__link toc-highlight">What you will be modeling</a><ul><li><a href="#requirements" class="table-of-contents__link toc-highlight">Requirements</a></li><li><a href="#defined-scenarios" class="table-of-contents__link toc-highlight">Defined Scenarios</a></li></ul></li><li><a href="#modeling-workspaces--channels" class="table-of-contents__link toc-highlight">Modeling Workspaces & Channels</a><ul><li><a href="#01-individual-permissions" class="table-of-contents__link toc-highlight">01. Individual Permissions</a></li><li><a href="#02-updating-the-workspace-authorization-model-with-implied-relations" class="table-of-contents__link toc-highlight">02. Updating The <code>workspace</code> Authorization Model With Implied Relations</a></li><li><a href="#03-updating-the-authorization-model-to-include-channels" class="table-of-contents__link toc-highlight">03. Updating The Authorization Model To Include Channels</a></li></ul></li><li><a href="#summary" class="table-of-contents__link toc-highlight">Summary</a><ul><li><a href="#exercises-for-you" class="table-of-contents__link toc-highlight">Exercises For You</a></li></ul></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/blocklists.html b/docs/modeling/blocklists.html index 3b75f6c0a..3c8b1838a 100644 --- a/docs/modeling/blocklists.html +++ b/docs/modeling/blocklists.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Blocklists</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Blocklists</h1><p>In this guide you'll see how to model preventing users from accessing objects using <a href="/docs/authorization-and-openfga#what-is-openfga">OpenFGA</a>. For example, <code>blocking</code> users from accessing a <code>document</code>, even if it has been already shared with them.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>Exclusion is useful while building applications. You may need to support access patterns like granting access to some users, but excluding specific people or groups, similar to how users can block others from following them on social media, or prevent them from sharing documents on Google Drive.</p><p>This is useful when:</p><ul><li>Implementing the "blocking" feature, such as the profile blocking commonly present on social media platforms (e.g. Instagram and Twitter).</li><li>Reduce a user's access if they are part of a particular group (e.g. restricting access to members who are also guests, or restricting access to users in a certain locality).</li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>Before you start this guide, make sure you're familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things listed below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>You will start with the <em><a href="/docs/concepts#what-is-an-authorization-model">authorization model</a></em> below, it represents a <code>document</code> <em><a href="/docs/concepts#what-is-a-type">type</a></em> that can have users <strong><a href="/docs/concepts#what-is-a-relation">related</a></strong> as <code>editor</code>, and <code>team</code> type that can have users related as <code>member</code>.</p><p>Let us also assume that we have a <code>document</code> called "planning", shared for editing within the product <code>team</code> (comprised of becky and carl).</p></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The current state of the system is represented by the following relationship tuples being in the system already:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Members of the product team can edit the planning document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Becky is a member of the product team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Carl is a member of the product team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-user-groups">Modeling User Groups<a href="#modeling-user-groups" class="hash-link" aria-label="Direct link to Modeling User Groups" title="Direct link to Modeling User Groups">​</a></h3><p>You need to know how to add users to groups and grant groups access to resources. <a href="/docs/modeling/user-groups">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li><li><a href="/docs/configuration-language#the-exclusion-operator">Exclusion Operator</a>: the exclusion operator can be used to exclude certain usersets from being related to an object</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>With the above authorization model and relationship tuples, <!-- -->OpenFGA<!-- --> will correctly respond with <code>{"allowed":true}</code> when <a href="/docs/concepts#what-is-a-check-request">check</a> is called to see if Carl and Becky can edit this <code>document</code>.</p><p>We can verify that by issuing two check requests:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:becky'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky editor document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:becky","relation":"editor","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:becky</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">editor</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:carl'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl editor document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:carl","relation":"editor","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:carl</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">editor</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We want to share a document with the product team and also have the ability to deny certain users access, even if they have the document shared with them already. We can verify this by blocking Carl (who we have seen already has edit access) from editing the document.</p><p>In order to do that, we need to:</p><ol><li><a href="#01-modify-our-model-so-users-can-be-blocked-from-accessing-a-document">Modify our model to allow indicating that users can be blocked from accessing a document</a></li><li><a href="#02-modify-our-model-so-users-who-are-blocked-can-no-longer-edit-the-document">Modify our model to indicate that users who are blocked can no longer edit the document</a></li><li><a href="#03-verify-our-solution-works">Verify that our solution works</a>:</li></ol><p>a. <a href="#a-indicate-that-carl-is-blocked-from-the-planning-document">Indicate that Carl is blocked from the planning document</a></p><p>b. <a href="#b-carl-now-blocked-can-no-longer-edit-the-document">Carl (now blocked) can no longer edit the document</a></p><p>c. <a href="#c-becky-still-has-edit-access">Becky still has edit access</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-modify-our-model-so-users-can-be-blocked-from-accessing-a-document">01. Modify Our Model So Users Can Be Blocked From Accessing A Document<a href="#01-modify-our-model-so-users-can-be-blocked-from-accessing-a-document" class="hash-link" aria-label="Direct link to 01. Modify Our Model So Users Can Be Blocked From Accessing A Document" title="Direct link to 01. Modify Our Model So Users Can Be Blocked From Accessing A Document">​</a></h3><p>To allow users to be "blocked" from accessing a <code>document</code>, we first need to allow this relation. We'll update our store model to add a <code>blocked</code> <a href="/docs/concepts#what-is-a-relation">relation</a> to the <code>document</code> type.</p><p>The authorization model becomes this:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">blocked</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"blocked"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"blocked"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Now we can add relationship tuples indicating that a certain user is <code>blocked</code> from editing a <code>document</code>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-modify-our-model-so-users-who-are-blocked-can-no-longer-edit-the-document">02. Modify Our Model So Users Who Are Blocked Can No Longer Edit The Document<a href="#02-modify-our-model-so-users-who-are-blocked-can-no-longer-edit-the-document" class="hash-link" aria-label="Direct link to 02. Modify Our Model So Users Who Are Blocked Can No Longer Edit The Document" title="Direct link to 02. Modify Our Model So Users Who Are Blocked Can No Longer Edit The Document">​</a></h3><p>Now that we can mark users as <code>blocked</code> from editing documents, we need to support denying the <code>editor</code> relationship when a user is <code>blocked</code>. We do that by modifying the relation definition of <code>editor</code>, and making use of the <a href="/docs/configuration-language#the-exclusion-operator"><strong>the exclusion operator</strong></a> to exclude the set of <code>blocked</code> users, as we can see here:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">blocked</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">but not</span><span class="token plain"> blocked</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"blocked"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"difference"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"base"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subtract"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"blocked"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"blocked"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-verify-our-solution-works">03. Verify Our Solution Works<a href="#03-verify-our-solution-works" class="hash-link" aria-label="Direct link to 03. Verify Our Solution Works" title="Direct link to 03. Verify Our Solution Works">​</a></h3><p>To check if our new model works, we'll add a relationship tuple with Carl as <code>blocked</code> from <code>document:planning</code> and then verify that Carl no longer has <code>editor</code> access to that document.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="a-indicate-that-carl-is-blocked-from-the-planning-document">a. Indicate That Carl Is Blocked From The Planning Document<a href="#a-indicate-that-carl-is-blocked-from-the-planning-document" class="hash-link" aria-label="Direct link to a. Indicate That Carl Is Blocked From The Planning Document" title="Direct link to a. Indicate That Carl Is Blocked From The Planning Document">​</a></h4><p>With our modified authorization model, we can indicate that Carl is blocked by adding this <em><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuple</a></em>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Carl is blocked from editing the planning document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:carl'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'blocked'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Carl is blocked from editing the planning document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"blocked"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Carl is blocked from editing the planning document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"blocked"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Carl is blocked from editing the planning document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"blocked"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:carl","relation":"blocked","object":"document:planning"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl blocked document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Carl is blocked from editing the planning document</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"blocked"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="b-carl-now-blocked-can-no-longer-edit-the-document">b. Carl (now blocked) Can No Longer Edit The Document<a href="#b-carl-now-blocked-can-no-longer-edit-the-document" class="hash-link" aria-label="Direct link to b. Carl (now blocked) Can No Longer Edit The Document" title="Direct link to b. Carl (now blocked) Can No Longer Edit The Document">​</a></h4><p>We have modified the authorization model and added relationship tuples to indicate that Carl is <code>blocked</code>. Now let's make sure our solution works as expected.</p><p>To check if Carl still has access to the document, we can issue a check request with Carl as the user.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:carl'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl editor document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:carl","relation":"editor","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:carl</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">editor</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The response is <code>false</code>, so our solution is working as expected.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="c-becky-still-has-edit-access">c. Becky Still Has Edit Access<a href="#c-becky-still-has-edit-access" class="hash-link" aria-label="Direct link to c. Becky Still Has Edit Access" title="Direct link to c. Becky Still Has Edit Access">​</a></h4><p>To check if Becky still has access to the document, we'll issue another check request with Becky as the user.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:becky'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky editor document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:becky","relation":"editor","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:becky</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">editor</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The response is <code>true</code>, indicating our model change did not inadvertently deny access for users who have access but are not blocked.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p><strong>Note:</strong> When creating tuples for <!-- -->OpenFGA<!-- --> make sure to use unique ids for each object and user within your application domain. We are using first names and human-readable identifiers to make this task easier to read.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to model with OpenFGA.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling: Getting Started</span><p class="documentation-card-box-description_u7_j">Learn about how to get started with modeling.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/getting-started">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Configuration Language</span><p class="documentation-card-box-description_u7_j">Learn about OpenFGA Configuration Language.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/configuration-language">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Public Access</span><p class="documentation-card-box-description_u7_j">Learn about model public access.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/public-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/blocklists.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/parent-child"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Parent-Child Objects</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/public-access"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Public Access</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#modeling-user-groups" class="table-of-contents__link toc-highlight">Modeling User Groups</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}"> Concepts</a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-modify-our-model-so-users-can-be-blocked-from-accessing-a-document" class="table-of-contents__link toc-highlight">01. Modify Our Model So Users Can Be Blocked From Accessing A Document</a></li><li><a href="#02-modify-our-model-so-users-who-are-blocked-can-no-longer-edit-the-document" class="table-of-contents__link toc-highlight">02. Modify Our Model So Users Who Are Blocked Can No Longer Edit The Document</a></li><li><a href="#03-verify-our-solution-works" class="table-of-contents__link toc-highlight">03. Verify Our Solution Works</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/building-blocks.html b/docs/modeling/building-blocks.html index de7e42756..2ea6547f9 100644 --- a/docs/modeling/building-blocks.html +++ b/docs/modeling/building-blocks.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible menu__list-item-collapsible--active"><a class="menu__link menu__link--sublist menu__link--active" aria-current="page" aria-expanded="true" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/direct-relationships">Direct Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/concentric-relationships">Concentric Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/object-to-object-relationships">Object to Object Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/usersets">Usersets</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Building Blocks</span><meta itemprop="position" content="2"></li></ul></nav><div class="theme-doc-markdown markdown"><header><h1>Building Blocks</h1></header><p>This section has guides that on the building blocks of authorization model.</p><div style="margin-top:2rem;margin-bottom:2rem"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div style="margin-top:0.75rem"><p class="documentation-card-box-description_u7_j">The content in this section is useful:</p><ul style="margin-top:2rem"><li>If you are starting with OpenFGA and want to learn the building blocks that can be used to build any model.</li></ul></div><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div><h1>Content</h1><div style="margin-top:2rem;margin-bottom:2rem"><div style="margin-top:2rem" class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Direct Relationships</span><p class="documentation-card-box-description_u7_j">Learn to model relationships that may or may not be assigned directly to individual users.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/building-blocks/direct-relationships">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Concentric Relationships</span><p class="documentation-card-box-description_u7_j">Learn to model nested relationships in your application.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/building-blocks/concentric-relationships">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Object to Object Relationships</span><p class="documentation-card-box-description_u7_j">Learn to model your application with objects that are not specifically tied to a user.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/building-blocks/object-to-object-relationships">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Usersets</span><p class="documentation-card-box-description_u7_j">Learn to model your application by assigning relationships to groups of users.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/building-blocks/usersets">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/building-blocks/overview.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/organization-context-authorization"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Authorization Through Organization Context</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/building-blocks/direct-relationships"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Direct Relationships</div></a></nav></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/building-blocks/concentric-relationships.html b/docs/modeling/building-blocks/concentric-relationships.html index 4b5d7470c..c45fbe7da 100644 --- a/docs/modeling/building-blocks/concentric-relationships.html +++ b/docs/modeling/building-blocks/concentric-relationships.html @@ -15,14 +15,14 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/direct-relationships">Direct Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/building-blocks/concentric-relationships">Concentric Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/object-to-object-relationships">Object to Object Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/usersets">Usersets</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling/building-blocks"><span itemprop="name">Building Blocks</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Concentric Relationships</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Concentric Relationships</h1><p>In this short guide, you'll learn how to represent a concentric <a href="/docs/concepts#what-is-a-relationship">relationships</a>.</p><p>For example, if you want to have all editors of a document also be viewers of said document.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>Concentric relations make the most sense when your domain logic has nested relations, where one having relation implies having another relation.</p><p>For example:</p><ul><li>all <code>editors</code> are <code>viewers</code></li><li>all <code>managers</code> are <code>members</code></li><li>all <code>device_managers</code> are <code>device_renamers</code></li></ul><p>This allows you to only create a single <em>relationship tuple</em> rather than creating n <em>relationship tuples</em> for each relation.</p></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>To better understand this guide, you should be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things listed below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>You will start with the <em><a href="/docs/concepts#what-is-an-authorization-model">authorization model</a></em> below, it represents a <code>document</code> <em><a href="/docs/concepts#what-is-a-type">type</a></em> that can have users <strong><a href="/docs/concepts#what-is-a-relation">related</a></strong> as <code>editor</code> and <code>viewer</code>.</p><p>Let us also assume that we have a <code>document</code> called "meeting_notes.doc" and bob is assigned as editor to this document.</p></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The current state of the system is represented by the following relationship tuples being in the system already:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-user-groups">Modeling User Groups<a href="#modeling-user-groups" class="hash-link" aria-label="Direct link to Modeling User Groups" title="Direct link to Modeling User Groups">​</a></h3><p>You need to know how to add users to groups and grant groups access to resources. <a href="/docs/modeling/user-groups">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>With the current type definition, there isn't a way to indicate that all <code>editors</code> of a certain <code>document</code> are also automatically <code>viewers</code> of that document. So for a certain user, in order to indicate that they can both <code>edit</code> and <code>view</code> a certain <code>document</code>, two <em><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuples</a></em> need to be created (one for <code>editor</code>, and another for <code>viewer</code>).</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-modify-our-model-to-imply-editor-as-viewer">01. Modify Our Model To Imply Editor As Viewer<a href="#01-modify-our-model-to-imply-editor-as-viewer" class="hash-link" aria-label="Direct link to 01. Modify Our Model To Imply Editor As Viewer" title="Direct link to 01. Modify Our Model To Imply Editor As Viewer">​</a></h3><p>Instead of creating two <em>relationship tuples</em>, we can leverage concentric relationships by defining editors are viewers.</p><p>Our authorization model becomes the following:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p><code>viewer</code> of a <code>document</code> are any of:</p><ol><li>users that are directly assigned as <code>viewer</code></li><li>users that have <code>editor</code> of the document</li></ol></div></div><p>With this authorization model change, having an <code>editor</code> relationship with a certain document implies having a <code>viewer</code> relationship with that same document.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-check-that-editors-are-viewers">02. Check That Editors Are Viewers<a href="#02-check-that-editors-are-viewers" class="hash-link" aria-label="Direct link to 02. Check That Editors Are Viewers" title="Direct link to 02. Check That Editors Are Viewers">​</a></h3><p>Since we had a <em>relationship tuple</em> that indicates that <strong>bob</strong> is an <code>editor</code> of <strong>document:meeting_notes.doc</strong>, this means <strong>bob</strong> is now implicitly a <code>viewer</code> of <strong>document:meeting_notes.doc</strong>. If we now check: <strong>is bob a viewer of document:meeting_notes.doc?</strong> we would get the following:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:meeting_notes.doc'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob viewer document:meeting_notes.doc</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:bob","relation":"viewer","object":"document:meeting_notes.doc"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bob</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:meeting_notes.doc</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Note</div><div class="admonitionContent_S0QG"><p>When creating relationship tuples for <!-- -->OpenFGA<!-- --> make sure to use unique ids for each object and user within your application domain. We're using first names and simple ids to just illustrate an easy-to-follow example.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how concentric relationships can be used.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Google Drive</span><p class="documentation-card-box-description_u7_j">See how to indicate that editors are commenters and viewers in Google Drive.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/gdrive#01-individual-permissions">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling GitHub</span><p class="documentation-card-box-description_u7_j">See how to indicate that repository admins are writers and readers in GitHub.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/github#01-permissions-for-individuals-in-an-org">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/building-blocks/concentric-relationships.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/building-blocks/direct-relationships"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Direct Relationships</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/building-blocks/object-to-object-relationships"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Object to Object Relationships</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#modeling-user-groups" class="table-of-contents__link toc-highlight">Modeling User Groups</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-modify-our-model-to-imply-editor-as-viewer" class="table-of-contents__link toc-highlight">01. Modify Our Model To Imply Editor As Viewer</a></li><li><a href="#02-check-that-editors-are-viewers" class="table-of-contents__link toc-highlight">02. Check That Editors Are Viewers</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/building-blocks/direct-relationships.html b/docs/modeling/building-blocks/direct-relationships.html index 5b3f2fdcc..dc0058f46 100644 --- a/docs/modeling/building-blocks/direct-relationships.html +++ b/docs/modeling/building-blocks/direct-relationships.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/building-blocks/direct-relationships">Direct Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/concentric-relationships">Concentric Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/object-to-object-relationships">Object to Object Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/usersets">Usersets</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling/building-blocks"><span itemprop="name">Building Blocks</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Direct Relationships</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Direct Relationships</h1><p>In this guide you'll learn how to model relationships that may or may not be assigned directly to individual users.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>Disabling <em>direct relationships</em> for a certain relation on an objects are useful especially in cases where you are trying to model some permissions that are not usually granted individually to a user.</p><p>This is useful when:</p><ul><li>For security reason, not permitting permissions assigned directly to individuals without associating roles</li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>To better understand this guide, you should be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things listed below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>You will need to know the following:</p><ul><li>Direct Access</li><li>OpenFGA<!-- --> Concepts</li></ul></summary><div><div class="collapsibleContent_i85q"><h3 class="anchor anchorWithStickyNavbar_LWe7" id="direct-access">Direct Access<a href="#direct-access" class="hash-link" aria-label="Direct link to Direct Access" title="Direct link to Direct Access">​</a></h3><p>You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. <a href="/docs/modeling/direct-access">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li><li><a href="/docs/configuration-language#the-direct-relationship-type-restrictions">Direct Relationship Type Restrictions</a>: used in the context of the relation definition can be used to allow direct relationships to the objects of this type</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-are-direct-relationships">What Are Direct Relationships?<a href="#what-are-direct-relationships" class="hash-link" aria-label="Direct link to What Are Direct Relationships?" title="Direct link to What Are Direct Relationships?">​</a></h2><p>Direct relationships are relationships where a user has a relationship to an <a href="/docs/concepts#what-is-an-object">object</a> that is not dependent on any other relationship they have with that object.</p><p>When checking for a relationship, a direct relationship exists if a <em><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuple</a></em> is present in the system with the exact same object and relation that were in the query and where the user is one of:</p><ul><li>the same user ID as that in the query</li><li>type bound public access (<code><type>:*</code>)</li><li>a set of users that contains the user ID present in the query</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="enable-or-disable-direct-relationships">Enable Or Disable Direct Relationships<a href="#enable-or-disable-direct-relationships" class="hash-link" aria-label="Direct link to Enable Or Disable Direct Relationships" title="Direct link to Enable Or Disable Direct Relationships">​</a></h2><p>Direct relationships can be enabled for a specific relation on an <em><a href="/docs/concepts#what-is-a-type">object type</a></em> by adding <a href="/docs/configuration-language#the-direct-relationship-type-restrictions">direct relationship type restrictions</a> from that <a href="/docs/concepts#what-is-a-relation-definition">relation's definition</a>. Likewise, they can be disabled by removing the direct relationship type restrictions.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, user:*, team#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"wildcard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>The <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a> describes two <a href="/docs/concepts#what-is-a-type">object types</a>: <code>document</code> and <code>team</code>.</p><p>The <code>document</code> <a href="/docs/concepts#what-is-a-type-definition">type definition</a> has two <a href="/docs/concepts#what-is-a-relation">relations</a>, <code>editor</code> and <code>viewer</code>. Both relations allow a direct relationship; <code>viewer</code> also allows an <a href="/docs/concepts#what-are-direct-and-implied-relationships">indirect relationship</a> through <code>editor</code>.</p><p>In the <code>team</code> type definition, there is a single <code>member</code> relation that only allows direct relationships.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-it-affects-your-system">How It Affects Your System<a href="#how-it-affects-your-system" class="hash-link" aria-label="Direct link to How It Affects Your System" title="Direct link to How It Affects Your System">​</a></h2><p>To illustrate the effect enabling or disabling direct relationships on a specific relation has, we'll investigate several situations.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="1-with-direct-relationships-enabled">1. With Direct Relationships Enabled<a href="#1-with-direct-relationships-enabled" class="hash-link" aria-label="Direct link to 1. With Direct Relationships Enabled" title="Direct link to 1. With Direct Relationships Enabled">​</a></h3><p>Let us start with the authorization model we had above:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, user:*, team#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"wildcard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Now choose the type of relation to see how it affects your system:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Direct User</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Type Bound Public Access</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Userset</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Indirect Relationship</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p>Assume you have a tuple that states that Anne is a <code>viewer</code> of <code>document:planning</code></p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Now if we do a <a href="/docs/concepts#what-is-a-check-request">check request</a> to see if Anne can view the planning document, we will get a response of <code>{"allowed": true}</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne viewer document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"viewer","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>This is because:</p><ul><li>There is a relationship tuple specifying that Anne has a <code>viewer</code> relationship with <code>document:planning</code>.</li><li>Direct relationships are allowed in the <code>viewer</code> relation definition in the <code>document</code> type definition.</li></ul></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>Assume you have a <a href="/docs/concepts#what-is-type-bound-public-access">type bound public access</a> tuple where everyone of type <code>user</code> is a <code>viewer</code> of <code>document:planning</code> (In other words, the document is public)</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Now if we do a check request to see if Beth can view the planning document, we will get a response of <code>{"allowed": true}</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth viewer document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:beth","relation":"viewer","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:beth</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>This is because:</p><ul><li>There is a relationship tuple specifying that everyone of type <code>user</code> has a <code>viewer</code> relationship with <code>document:planning</code>.</li><li>Direct relationships are allowed in the <code>viewer</code> relation definition in the <code>document</code> type definition.</li></ul><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Note: Even though the relationship tuple stored in the system does not specify the user (<code>beth</code>), this is still considered a direct relationship.</p></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p><a href="/docs/modeling/building-blocks/usersets"><em>Usersets</em></a> are the third way direct relationships apply, we will see how in this section.</p><p>Assume you have two relationship tuples:</p><ul><li>Charlie is a member of the product team.</li><li>Members of the product team are viewers of the planning document.</li></ul><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charlie"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Note that these two relationship tuples are specifying that:</p><ul><li><code>user:charlie</code> is a <code>member</code> of <code>team:product</code>.</li><li>any <code>member</code> of <code>team:product</code> is a <code>viewer</code> of <code>document:planning</code>.<ul><li>Note that this second relationship tuple is specifying that the <strong>members</strong> of the team have viewer access, and not the team object itself.</li></ul></li></ul></div></div><p>Now if we do a <em>check request</em> to see if charlie can view the planning document, we will get a response of <code>{"allowed": true}</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:charlie'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charlie"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charlie"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charlie"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charlie viewer document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:charlie","relation":"viewer","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charlie"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:charlie</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>This is because:</p><ul><li>Charlie is a member of the product team.</li><li>There is a relationship tuple specifying that all members of the product team have a <code>viewer</code> relationship with <code>document:planning</code>.</li><li>Direct relationships are allowed in the <code>viewer</code> relation definition in the <code>document</code> type definition.</li></ul><p>Note that this is still considered a direct relationship no matter how many resolutions occur on the usersets until the user is found.</p><p>For example, if our relationship tuples were the following relationship tuples:</p><ul><li>Dany is a member of the product leads team.</li><li>Members of the product leads team are members of the product team.</li><li>Members of the product team are members of the contoso team.</li><li>Members of the contoso team are viewers of the planning document.</li></ul><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:dany"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product-leads"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product-leads#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:contoso#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>A subsequent <em>check request</em> to see if Dany can view the planning document will still return a response of <code>{"allowed": true}</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:dany'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:dany"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:dany"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:dany"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:dany viewer document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:dany","relation":"viewer","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:dany"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:dany</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Note: Even though the relationship tuple stored in the system does not specify the user (<code>charlie</code> or <code>dany</code>), this is still considered a direct relationship.</p></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>Here we will cover one example of an <a href="/docs/concepts#what-are-direct-and-implied-relationships">indirect relationship</a> in order to see how they differ from direct relationships.</p><p>With the same authorization model we have above, assume there is a relationship tuple that specifies that Emily is an <code>editor</code> of <code>document:planning</code>.</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>A subsequent <em>check request</em> to see if emily can view the planning document will still return a response of <code>{"allowed": true}</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:emily'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily viewer document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:emily","relation":"viewer","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:emily"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:emily</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>This is because:</p><ul><li>Emily is an <code>editor</code> of the planning document.</li><li>The authorization model specified that anyone who is an <code>editor</code> on a <code>document</code> is also a <code>viewer</code> on that document.</li></ul><p>In this case, there is <strong>NO</strong> direct viewer relationship between Emily and the planning document. The only viewer relationship that exists is implied because Emily is an editor and the authorization model specified that any document's <code>editor</code> is that document's viewer.</p></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="2-with-direct-relationships-disabled">2. With Direct Relationships Disabled<a href="#2-with-direct-relationships-disabled" class="hash-link" aria-label="Direct link to 2. With Direct Relationships Disabled" title="Direct link to 2. With Direct Relationships Disabled">​</a></h3><p>In this section, we will investigate the effect of disabling <em>direct relationships</em> on the document's <code>viewer</code> relation.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user, team#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Notice that in this updated authorization model, the direct relationship keyword has been removed from the document's <code>viewer</code> relation definition.</p></div></div><p>Now choose the type of relation to see how it affects your system:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Direct User</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Everyone</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Userset</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Indirect Relationship</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p>Assume you have a tuple that states that Fred is a <code>viewer</code> of <code>document:planning</code></p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:fred"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Now if we do a check request to see if Fred can view the planning document, we will get a response of <code>{"allowed": false}</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:fred'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:fred"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:fred"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:fred"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:fred viewer document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:fred","relation":"viewer","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:fred"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:fred</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>This is because:</p><ul><li>Even though there is a relationship tuple specifying that Fred has a <code>viewer</code> relationship with <code>document:planning</code>.</li><li>Direct relationships are <strong>NOT</strong> allowed in the <code>viewer</code> relation definition in the <code>document</code> type definition.</li></ul></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>You will see the same behaviour with a relationship tuple specifying everyone of type <code>user</code> as the user.</p><p>Assume you have a tuple that states that everyone of type <code>user</code> is a <code>viewer</code> of <code>document:planning</code>.</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Now if we do a check request to see if Gabriel can view the planning document, we will get a response of <code>{"allowed": false}</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:gabriel'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:gabriel"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:gabriel"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:gabriel"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:gabriel viewer document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:gabriel","relation":"viewer","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:gabriel"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:gabriel</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>This is because:</p><ul><li>Even though there is a relationship tuple specifying that everyone has a <code>viewer</code> relationship with <code>document:planning</code>.</li><li>Direct relationships are <strong>NOT</strong> allowed in the <code>viewer</code> relation definition in the <code>document</code> type definition.</li></ul></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>The same logic applies to usersets.</p><p>Assume you have two relationship tuples:</p><ul><li>Henry is a member of the product team.</li><li>Members of the product team are viewers of the planning document.</li></ul><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:henry"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:product#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Now if we do a check request to see if Henry can view the planning document, we will get a response of <code>{"allowed": false}</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:henry'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:henry"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:henry"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:henry"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:henry viewer document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:henry","relation":"viewer","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:henry"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:henry</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>This is because although:</p><ul><li>Henry is a member of the product team.</li><li>There is a relationship tuple specifying that all members of the product team have a <code>viewer</code> relationship with <code>document:planning</code>.</li></ul><p>Direct relationships are <strong>NOT</strong> allowed in the <code>viewer</code> relation definition in the <code>document</code> type definition.</p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p>Indirect relationships are not affected by disabling a direct relationship on a certain relation.</p><p>Assume there is a relationship tuple that specifies that Ingred is an <code>editor</code> of <code>document:planning</code>.</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:ingred"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>A subsequent check request to see if Ingred can view the planning document will still return a response of <code>{"allowed": true}</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:ingred'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:ingred"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:ingred"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:ingred"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:ingred viewer document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:ingred","relation":"viewer","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:ingred"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:ingred</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more one how direct relationships can be used. Also, take a look at the access relation in the feature type in Modeling Entitlements for another use-case.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Roles and Permissions</span><p class="documentation-card-box-description_u7_j">Learn how to remove the direct relationship to indicate nonassignable permissions.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/roles-and-permissions">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling for IoT</span><p class="documentation-card-box-description_u7_j">See how Roles and Permissions can be used in an IoT use-case.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/iot">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Entitlements</span><p class="documentation-card-box-description_u7_j">Take a look at the access relation in the feature type for an example of removing the direct relationship</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/entitlements">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/building-blocks/direct-relationships.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/building-blocks"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Building Blocks</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/building-blocks/concentric-relationships"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Concentric Relationships</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#direct-access" class="table-of-contents__link toc-highlight">Direct Access</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#what-are-direct-relationships" class="table-of-contents__link toc-highlight">What Are Direct Relationships?</a></li><li><a href="#enable-or-disable-direct-relationships" class="table-of-contents__link toc-highlight">Enable Or Disable Direct Relationships</a></li><li><a href="#how-it-affects-your-system" class="table-of-contents__link toc-highlight">How It Affects Your System</a><ul><li><a href="#1-with-direct-relationships-enabled" class="table-of-contents__link toc-highlight">1. With Direct Relationships Enabled</a></li><li><a href="#2-with-direct-relationships-disabled" class="table-of-contents__link toc-highlight">2. With Direct Relationships Disabled</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/building-blocks/object-to-object-relationships.html b/docs/modeling/building-blocks/object-to-object-relationships.html index 9688cc564..8dd7c26f5 100644 --- a/docs/modeling/building-blocks/object-to-object-relationships.html +++ b/docs/modeling/building-blocks/object-to-object-relationships.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/direct-relationships">Direct Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/concentric-relationships">Concentric Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/building-blocks/object-to-object-relationships">Object to Object Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/usersets">Usersets</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling/building-blocks"><span itemprop="name">Building Blocks</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Object to Object Relationships</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Object to Object Relationships</h1><p>In this guide you'll learn how to model your application with <a href="/docs/concepts#what-is-an-object">objects</a> that are not specifically tied to a user. For example, a <code>folder</code> is a <code>parent</code> of a <code>document</code>.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>This design pattern is helpful in the case where there are relationships between different objects. With <!-- -->OpenFGA<!-- -->, so long as both objects are in a type defined in the <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>, relationship tuples can be added to indicate a relationship between them.</p><p>For example:</p><ul><li><code>communities</code> can contain <code>channels</code></li><li><code>channels</code> can contain <code>posts</code></li><li><code>channels</code> can contain <code>threads</code></li><li><code>threads</code> can contain <code>posts</code></li><li><code>bookshelf</code> can have <code>books</code></li><li><code>trips</code> can have <code>bookings</code></li><li><code>account</code> can contain <code>transactions</code></li><li><code>buildings</code> can have <code>doors</code></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>To better follow this guide, make sure you're familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things listed below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>You will start with the <em><a href="/docs/concepts#what-is-an-authorization-model">authorization model</a></em> below, it represents a <code>document</code> <em><a href="/docs/concepts#what-is-a-type">type</a></em> that can have users <strong><a href="/docs/concepts#what-is-a-relation">related</a></strong> as <code>editor</code>, and <code>folder</code> type that can have users related as <code>viewer</code>.</p></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-user-groups">Modeling User Groups<a href="#modeling-user-groups" class="hash-link" aria-label="Direct link to Modeling User Groups" title="Direct link to Modeling User Groups">​</a></h3><p>You need to know how to add users to groups and grant groups access to resources. <a href="/docs/modeling/user-groups">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-create-parent-relations-in-document">01. Create Parent Relations In Document<a href="#01-create-parent-relations-in-document" class="hash-link" aria-label="Direct link to 01. Create Parent Relations In Document" title="Direct link to 01. Create Parent Relations In Document">​</a></h3><p>To represent that a <code>folder</code> can be a <code>parent</code> of a <code>document</code>, we first need to modify our <code>document</code> <a href="/docs/concepts#what-is-a-type-definition">type definition</a> to allow a <code>parent</code> <a href="/docs/concepts#what-is-a-relation">relation</a>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-add-parent-relationship-tuples">02. Add Parent Relationship Tuples<a href="#02-add-parent-relationship-tuples" class="hash-link" aria-label="Direct link to 02. Add Parent Relationship Tuples" title="Direct link to 02. Add Parent Relationship Tuples">​</a></h3><p>Once the type definition is updated, we can now create the <a href="/docs/concepts#what-is-a-relationship">relationship</a> between a <code>folder</code> as a <code>parent</code> of a <code>document</code>. To do this, we will create a new <strong><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuple</a></strong> that describes: <strong>folder:budgets</strong> is a <code>parent</code> of <strong>document:may_budget.doc</strong>. In <!-- -->OpenFGA<!-- -->, <a href="/docs/concepts#what-is-a-user">users</a> in the relationship tuples can not only be IDs, but also other objects in the form of <code>type:object_id</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The user in this case is another object where the type is `folder` and the object_id is `budgets`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'folder:budgets'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'parent'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:may_budget.doc'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The user in this case is another object where the type is `folder` and the object_id is `budgets`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:budgets"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:may_budget.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The user in this case is another object where the type is `folder` and the object_id is `budgets`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:budgets"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:may_budget.doc"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># The user in this case is another object where the type is `folder` and the object_id is `budgets`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:budgets"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:may_budget.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"folder:budgets","relation":"parent","object":"document:may_budget.doc"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw folder:budgets parent document:may_budget.doc</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // The user </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">in</span><span class="token plain"> this </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">case</span><span class="token plain"> is another object where the </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">type</span><span class="token plain"> is </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">folder</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> and the object_id is </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">budgets</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:budgets"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:may_budget.doc"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-check-that-parent-folders-have-permissions">03. Check That Parent Folders Have Permissions<a href="#03-check-that-parent-folders-have-permissions" class="hash-link" aria-label="Direct link to 03. Check That Parent Folders Have Permissions" title="Direct link to 03. Check That Parent Folders Have Permissions">​</a></h3><p>Once that relationship tuple is added to <!-- -->OpenFGA<!-- -->, we can <a href="/docs/concepts#what-is-a-check-request">check</a> if the relationship is valid by asking the following: <strong>"is folder:budgets a parent of document:may_budget.doc?"</strong></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'folder:budgets'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'parent'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:may_budget.doc'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:budgets"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:may_budget.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:budgets"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:may_budget.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:budgets"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:may_budget.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw folder:budgets parent document:may_budget.doc</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"folder:budgets","relation":"parent","object":"document:may_budget.doc"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:budgets"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">folder:budgets</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">parent</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:may_budget.doc"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:may_budget.doc</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>It is important to note that the current authorization model does not imply inheritance of permissions. Even though <strong>folder:budgets</strong> is a <code>parent</code> of <strong>document:may_budget.doc</strong>, <strong>it does not inherit the <code>editor</code> relation from <code>parent</code> to <code>document</code>.</strong> Meaning <code>editors</code> on <strong>folder:budgets</strong> are not <code>editors</code> on <strong>document:may_budget.doc</strong>. Further configuration changes are needed to indicate that and will be tackled in a later guide.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p><strong>Note:</strong> When creating relationship tuples for <!-- -->OpenFGA<!-- --> make sure to use unique ids for each object and user within your application domain. We are using first names and simple ids to just illustrate an easy-to-follow example.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="advanced-object-to-object-relationships">Advanced Object to Object Relationships<a href="#advanced-object-to-object-relationships" class="hash-link" aria-label="Direct link to Advanced Object to Object Relationships" title="Direct link to Advanced Object to Object Relationships">​</a></h2><p>Object to object can be used for more advanced use case, such as <a href="/docs/modeling/advanced/entitlements">entitlements</a>. An example use case is to allow subscribers to be entitled to different plans.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-create-authorization-model-with-object-to-object-relationships">01. Create Authorization Model With Object To Object Relationships<a href="#01-create-authorization-model-with-object-to-object-relationships" class="hash-link" aria-label="Direct link to 01. Create Authorization Model With Object To Object Relationships" title="Direct link to 01. Create Authorization Model With Object To Object Relationships">​</a></h3><p>To do this, the authorization model will have two <a href="/docs/concepts#what-is-a-type">types</a> - feature and plan.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">associated_plan</span><span class="token plain">: </span><span class="token directly-assignable">[plan]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">access</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> subscriber_member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> associated_plan</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">plan</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">subscriber_member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"associated_plan"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"access"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber_member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"subscriber_member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Type <code>feature</code> has two relations, associated_plan and access. Relation <code>associated_plan</code> allows associating plans with features while <code>access</code> defines who can access the feature. In our case, the access can be achieved either from</p><ul><li><a href="/docs/concepts#what-are-direct-and-implied-relationships">direct relationship</a> via [direct relationship type restrictions](/docs/configuration-language#the-direct-relationship-type-restrictions). or `this`</li><li>object to object relationship where a user can access because it is a subscriber_member of a particular plan AND that plan is associated with the feature.</li></ul><p>Here, we define <code>plan</code> as the user of object <code>feature</code> with relationship <code>associated_plan</code> rather than defining <code>feature</code> as the user of object <code>plan</code> with relationship <code>feature</code>. The reason we choose the former is that we want to describe our system in the following <a href="/docs/modeling/getting-started#write-it-in-plain-language">plain language</a>:</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-children-mono_WQfY"><ul><li>A user can access a feature in a plan if they are a subscriber member of a plan that is the associated plan of a feature.</li></ul></div></div></div><p>This will give us a flow of user->organization->plan->feature and allows us to answer the question of whether user can access a feature rather than whether user is subscriber of a plan.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-adding-relationship-tuples">02. Adding Relationship Tuples<a href="#02-adding-relationship-tuples" class="hash-link" aria-label="Direct link to 02. Adding Relationship Tuples" title="Direct link to 02. Adding Relationship Tuples">​</a></h3><p>To realize the relationship, we will need to add the following relationship tuples.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// make anne as subscriber_member for plan:advanced</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'subscriber_member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:advanced'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The advanced plan is associated with the data preview feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:advanced'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'associated_plan'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:data_preview'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// make anne as subscriber_member for plan:advanced</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The advanced plan is associated with the data preview feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// make anne as subscriber_member for plan:advanced</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The advanced plan is associated with the data preview feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># make anne as subscriber_member for plan:advanced</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># The advanced plan is associated with the data preview feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"subscriber_member","object":"plan:advanced"},{"user":"plan:advanced","relation":"associated_plan","object":"feature:data_preview"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne subscriber_member plan:advanced</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:advanced associated_plan feature:data_preview</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // </span><span class="token function" style="color:rgb(80, 250, 123)">make</span><span class="token plain"> anne as subscriber_member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">for</span><span class="token plain"> plan:advanced</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // The advanced plan is associated with the data preview feature</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-check-to-see-if-access-is-allowed-without-direct-relationship">03. Check To See If Access Is Allowed Without Direct Relationship<a href="#03-check-to-see-if-access-is-allowed-without-direct-relationship" class="hash-link" aria-label="Direct link to 03. Check To See If Access Is Allowed Without Direct Relationship" title="Direct link to 03. Check To See If Access Is Allowed Without Direct Relationship">​</a></h3><p>To validate that the authorization model and relationship tuples are correct, we can ask the question:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:data_preview'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:data_preview</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"access","object":"feature:data_preview"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:data_preview</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We see that <code>anne</code> is allowed to <code>access</code> <code>feature:data_preview</code> without requiring direct relationship.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="04-disassociating-plan-from-feature">04. Disassociating Plan From Feature<a href="#04-disassociating-plan-from-feature" class="hash-link" aria-label="Direct link to 04. Disassociating Plan From Feature" title="Direct link to 04. Disassociating Plan From Feature">​</a></h3><p>At any point in time, <code>plan:advanced</code> may be disassociated from <code>feature:data_preview</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">deletes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Remove advanced plan from data preview feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:advanced'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'associated_plan'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:data_preview'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Remove advanced plan from data preview feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Remove advanced plan from data preview feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> deletes</span><span class="token operator">==</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Remove advanced plan from data preview feature</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"deletes": { "tuple_keys" : [{"user":"plan:advanced","relation":"associated_plan","object":"feature:data_preview"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple delete --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> plan:advanced associated_plan feature:data_preview</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">delete</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Remove advanced plan from data preview feature</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"associated_plan"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>When this is the case, <code>anne</code> will no longer have <code>access</code> to <code>feature:data_preview</code> even though she is still a <code>subscriber_member</code> of <code>plan:advanced</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'access'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'feature:data_preview'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:data_preview</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"access","object":"feature:data_preview"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"access"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">access</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"feature:data_preview"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">feature:data_preview</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'subscriber_member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'plan:advanced'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne subscriber_member plan:advanced</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"subscriber_member","object":"plan:advanced"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"subscriber_member"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">subscriber_member</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"plan:advanced"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">plan:advanced</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how object-to-object relationships can be used.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Advanced Modeling Patterns: Entitlements</span><p class="documentation-card-box-description_u7_j">Learn how to model entitlement access patterns.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/entitlements">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Parent-Child Relationships</span><p class="documentation-card-box-description_u7_j">Learn how to model parent and child relationships.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/parent-child">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling User Groups</span><p class="documentation-card-box-description_u7_j">Learn how to model user groups.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/user-groups">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/building-blocks/object-to-object-relationships.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/building-blocks/concentric-relationships"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Concentric Relationships</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/building-blocks/usersets"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Usersets</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#modeling-user-groups" class="table-of-contents__link toc-highlight">Modeling User Groups</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-create-parent-relations-in-document" class="table-of-contents__link toc-highlight">01. Create Parent Relations In Document</a></li><li><a href="#02-add-parent-relationship-tuples" class="table-of-contents__link toc-highlight">02. Add Parent Relationship Tuples</a></li><li><a href="#03-check-that-parent-folders-have-permissions" class="table-of-contents__link toc-highlight">03. Check That Parent Folders Have Permissions</a></li></ul></li><li><a href="#advanced-object-to-object-relationships" class="table-of-contents__link toc-highlight">Advanced Object to Object Relationships</a><ul><li><a href="#01-create-authorization-model-with-object-to-object-relationships" class="table-of-contents__link toc-highlight">01. Create Authorization Model With Object To Object Relationships</a></li><li><a href="#02-adding-relationship-tuples" class="table-of-contents__link toc-highlight">02. Adding Relationship Tuples</a></li><li><a href="#03-check-to-see-if-access-is-allowed-without-direct-relationship" class="table-of-contents__link toc-highlight">03. Check To See If Access Is Allowed Without Direct Relationship</a></li><li><a href="#04-disassociating-plan-from-feature" class="table-of-contents__link toc-highlight">04. Disassociating Plan From Feature</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/building-blocks/usersets.html b/docs/modeling/building-blocks/usersets.html index 2d1fb2797..d21e58538 100644 --- a/docs/modeling/building-blocks/usersets.html +++ b/docs/modeling/building-blocks/usersets.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/direct-relationships">Direct Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/concentric-relationships">Concentric Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/building-blocks/object-to-object-relationships">Object to Object Relationships</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/building-blocks/usersets">Usersets</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling/building-blocks"><span itemprop="name">Building Blocks</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Usersets</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Usersets</h1><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-a-userset">What Is A Userset?<a href="#what-is-a-userset" class="hash-link" aria-label="Direct link to What Is A Userset?" title="Direct link to What Is A Userset?">​</a></h2><p>A userset represents a set or collection of <a href="/docs/concepts#what-is-a-user">users</a>.</p><p>Usersets can be used to indicate that a group of users in the system have a certain <a href="/docs/concepts#what-is-a-relation">relation</a> with an <a href="/docs/concepts#what-is-an-object">object</a>. This can be used to assign permissions to groups of users rather than specific ones, allowing us to represent the permissions in our system using less tuples and granting us flexibility in granting or denying access in bulk.</p><p>In <!-- -->OpenFGA<!-- -->, usersets are represented via this notation: <code>object#relation</code>, where <a href="/docs/concepts#what-is-an-object">object</a> is made up of a <a href="/docs/concepts#what-is-a-type">type</a> and an object identifier. For example:</p><ul><li><code>company:xyz#employee</code> represents all users that are related to <code>company:xyz</code> as <code>employee</code></li><li><code>tweet:12345#viewer</code> represents all users that are related to <code>tweet:12345</code> as <code>viewer</code></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-do-check-requests-work-with-usersets">How Do Check Requests Work With Usersets?<a href="#how-do-check-requests-work-with-usersets" class="hash-link" aria-label="Direct link to How Do Check Requests Work With Usersets?" title="Direct link to How Do Check Requests Work With Usersets?">​</a></h2><p>Imagine the following authorization model:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">org</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">reader</span><span class="token plain">: </span><span class="token directly-assignable">[user, org#member]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Now let us assume that the store has the following tuples:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Userset "Members of the xyz org" can read the budget document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is part of the userset "Members of the xyz org"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org:xyz"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If we call the <a href="/docs/concepts#what-is-a-check-request">check API</a> to see if user <code>anne</code> has a <code>reader</code> relationship with <code>document:budget</code>, <!-- -->OpenFGA<!-- --> will check whether <code>anne</code> is part of the userset that does have a <code>reader</code> relationship. Because she is part of that userset, the request will return true:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'reader'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:budget'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:budget"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:budget</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"reader","object":"document:budget"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"reader"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">reader</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:budget"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:budget</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-do-expand-requests-work-with-usersets">How Do Expand Requests Work With Usersets?<a href="#how-do-expand-requests-work-with-usersets" class="hash-link" aria-label="Direct link to How Do Expand Requests Work With Usersets?" title="Direct link to How Do Expand Requests Work With Usersets?">​</a></h2><p>Imagine the following authorization model:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user, org#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">reader</span><span class="token plain">: </span><span class="token directly-assignable">[user, org#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> writer</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"reader"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>If we wanted to see which users and usersets have a <code>reader</code> relationship with <code>document:budget</code>, we can call the <a href="/api/service#Relationship%20Queries/Expand">Expand API</a>. The response will contain a userset tree where the leaf nodes are specific user IDs and usersets. For example:</p><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tree"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"root"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:budget#reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"nodes"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:budget#reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"leaf"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"users"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"users"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:budget#reader"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"leaf"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computed"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"userset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:budget#writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>As you can see from the response above, with usersets we can express <a href="/docs/configuration-language#the-union-operator">unions</a> of user groups. We can also express <a href="/docs/configuration-language#the-intersection-operator">intersections</a> and <a href="/docs/configuration-language#the-exclusion-operator">exclusions</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="internals">Internals<a href="#internals" class="hash-link" aria-label="Direct link to Internals" title="Direct link to Internals">​</a></h2><p>Using the type definitions in the authorization model, some of the situations we can represent are:</p><ul><li>that a user is <strong>not</strong> in a set of users having a certain relation to an object, even if a relationship tuple exists in the system. See <a href="/docs/modeling/building-blocks/direct-relationships#2-with-direct-relationships-disabled">Disabling Direct Relationships</a></li><li>that a user has a certain relationship with an object if they are in the <a href="/docs/configuration-language#the-union-operator">union</a>, <a href="/docs/configuration-language#the-intersection-operator">intersection</a> or <a href="/docs/configuration-language#the-exclusion-operator">exclusion</a> of usersets.</li><li>that a user being in a set of users having a certain relation to an object can result in them having another relation to the object. See <a href="/docs/modeling/building-blocks/concentric-relationships">Concentric Relationships</a></li><li>that the user being in a set of users having a certain relation to an object and that object is in a set of users having a certain relation to another object, can imply that the original user has a certain relationship to the final object. See <a href="/docs/modeling/building-blocks/object-to-object-relationships">Object-to-Object Relationships</a></li></ul><p>When executing the Check API of the form <code>check(user, relation, object)</code>, <!-- -->OpenFGA<!-- --> will perform the following steps:</p><ol><li>In the authorization model, look up <code>type</code> and its <code>relation</code>. Start building a tree where the root node will be the definition of that <code>relation</code>, which can be a union, exclusion, or intersection of usersets, or it can be direct users.</li><li>Expand all the usersets involved into new nodes in the tree. This means recursively finding all the users that are members of the usersets. If there are direct relationships with users, create leaf nodes.</li><li>Check whether <code>user</code> is a leaf node in the tree. If the API finds one match, it will return immediately and will not expand the remaining nodes.</li></ol><p><img loading="lazy" alt="Image showing the path &lt;ProductName format={ProductNameFormat.ShortForm}/&gt; traverses to find if a user is in the userset related to an object" src="/assets/images/usersets-check-tree-68f05e3f382b35ea6be97c5115223351.png" width="1411" height="1027" class="img_ev3q"></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>See the following sections for more information:</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Managing Group Membership</span><p class="documentation-card-box-description_u7_j">How to add users to a userset</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/managing-group-membership">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Managing Group Access</span><p class="documentation-card-box-description_u7_j">How to add permissions to a userset</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/managing-group-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/building-blocks/usersets.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/building-blocks/object-to-object-relationships"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Object to Object Relationships</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/advanced"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Advanced Use-Cases</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#what-is-a-userset" class="table-of-contents__link toc-highlight">What Is A Userset?</a></li><li><a href="#how-do-check-requests-work-with-usersets" class="table-of-contents__link toc-highlight">How Do Check Requests Work With Usersets?</a></li><li><a href="#how-do-expand-requests-work-with-usersets" class="table-of-contents__link toc-highlight">How Do Expand Requests Work With Usersets?</a></li><li><a href="#internals" class="table-of-contents__link toc-highlight">Internals</a></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/contextual-time-based-authorization.html b/docs/modeling/contextual-time-based-authorization.html index 5c7234afb..0f140289f 100644 --- a/docs/modeling/contextual-time-based-authorization.html +++ b/docs/modeling/contextual-time-based-authorization.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Contextual and Time-Based Authorization</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Contextual and Time-Based Authorization</h1><p>This section explores some methods available to you to tackle some use-cases where the expected authorization check may depend on certain dynamic or contextual data (such as time, location, ip address, weather) that have not been written to the <!-- -->OpenFGA<!-- --> store.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div>Contextual Tuples should be used when modeling cases where a user's access to an object depends on the context of their request. For example:<ul><li>An employee’s ability to access a document when they are connected to the company VPN or the api call is originating from an internal IP address.</li><li>A support engineer is only able to access a user's account during office hours.</li><li>If a user belongs to multiple organizations, they are only able to access a resource if they set a specific organization in their current context.</li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>To follow this guide, you should be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system.</li><li>A <a href="/docs/concepts#what-is-a-check-request">Check Request</a>: is a call to the <!-- -->OpenFGA<!-- --> check endpoint that returns whether the user has a certain relationship with an object.</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li><li>A <a href="/docs/concepts#what-are-contextual-tuples">Contextual Tuple</a>: a tuple that can be added to a Check request, and only exists within the context of that particular request.</li></ul><p>You also need to be familiar with:</p><ul><li><strong>Modeling Object-to-Object Relationships</strong>: You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. <a href="/docs/modeling/building-blocks/object-to-object-relationships">Learn more →</a></li><li><strong>Modeling Multiple Restrictions</strong>: You need to know how to model requiring multiple authorizations before allowing users to perform certain actions. <a href="/docs/modeling/multiple-restrictions">Learn more →</a></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="scenario">Scenario<a href="#scenario" class="hash-link" aria-label="Direct link to Scenario" title="Direct link to Scenario">​</a></h3><p>For the scope of this guide, we are going to consider the following scenario.</p><p>Consider you are building the authorization model for WeBank Inc.</p><p>In order for an Account Manager at WeBank Inc. to be able to access a customer's account and its transactions, they would need to be:</p><ul><li>An account manager at the same branch as the customer's account</li><li>Connected via the branch's internal network or through the branch's VPN</li><li>Connected during this particular branch's office hours</li></ul><p>We will start with the following Authorization Model</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account_manager</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">account</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">branch</span><span class="token plain">: </span><span class="token directly-assignable">[branch]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account_manager</span><span class="token plain">: account_manager </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">customer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: customer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> account_manager</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: viewer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">transaction</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account</span><span class="token plain">: </span><span class="token directly-assignable">[account]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> account</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"branch"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"customer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"customer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_view"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"branch"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"customer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_view"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>We are considering the case that:<ul><li>Anne is the Account Manager at the West-Side branch</li><li>Caroline is the customer for checking account number 526</li><li>The West-Side branch is the branch that the checking account number 526 has been created at</li><li>Checking account number 526 has a transaction, we'll call it transaction A</li><li>The West-Side branch’s office hours is from 8am-3pm UTC</li></ul></summary><div><div class="collapsibleContent_i85q"><p>The above state translates to the following relationship tuples:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is the Account Manager at the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'account_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Caroline is the customer for checking account number 526</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:caroline'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'customer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'account:checking-526'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The West-Side branch is the branch that the Checking account number 526 has been created at</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'account:checking-526'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Checking account number 526 is the account for transaction A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'account:checking-526'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'account'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'transaction:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is the Account Manager at the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Caroline is the customer for checking account number 526</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:caroline"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"customer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The West-Side branch is the branch that the Checking account number 526 has been created at</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Checking account number 526 is the account for transaction A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is the Account Manager at the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Caroline is the customer for checking account number 526</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:caroline"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"customer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The West-Side branch is the branch that the Checking account number 526 has been created at</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Checking account number 526 is the account for transaction A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne is the Account Manager at the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Caroline is the customer for checking account number 526</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:caroline"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"customer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># The West-Side branch is the branch that the Checking account number 526 has been created at</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Checking account number 526 is the account for transaction A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"account_manager","object":"branch:west-side"},{"user":"user:caroline","relation":"customer","object":"account:checking-526"},{"user":"branch:west-side","relation":"branch","object":"account:checking-526"},{"user":"account:checking-526","relation":"account","object":"transaction:A"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne account_manager branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:caroline customer account:checking-526</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw branch:west-side branch account:checking-526</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw account:checking-526 account transaction:A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne is the Account Manager at the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Caroline is the customer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">for</span><span class="token plain"> checking account number </span><span class="token number">526</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:caroline"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"customer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // The West-Side branch is the branch that the Checking account number </span><span class="token number">526</span><span class="token plain"> has been created at</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Checking account number </span><span class="token number">526</span><span class="token plain"> is the account </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">for</span><span class="token plain"> transaction A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></div></div></details><h3 class="anchor anchorWithStickyNavbar_LWe7" id="requirements">Requirements<a href="#requirements" class="hash-link" aria-label="Direct link to Requirements" title="Direct link to Requirements">​</a></h3><p>By the end of this guide we would like to validate that:</p><ul><li>If Anne is at the branch, and it is 12pm UTC, Anne should be able to view transaction A</li><li>If Anne is connecting remotely at 12pm UTC but is not connected to the VPN, Anne should not be able to view transaction A</li><li>If Anne is connecting remotely and is connected to the VPN<ul><li>at 12pm UTC, should be able to view transaction A</li><li>at 6pm UTC, should not be able to view transaction A</li></ul></li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>In order to solve for the requirements above, we will break the problem down to three steps:</p><ol><li><a href="#understand-relationships-without-contextual-data">Understand relationships without contextual tuples</a>. We will want to ensure that</li></ol><ul><li>the customer can view a transaction tied to their account</li><li>the account manager can view a transaction whose account is at the same branch</li></ul><ol start="2"><li>Extend the Authorization Model to <a href="#take-time-and-ip-address-into-consideration">take time and ip address into consideration</a></li><li><a href="#use-contextual-tuples-for-context-related-checks">Use contextual tuples for context related checks</a>.</li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="understand-relationships-without-contextual-data">Understand Relationships Without Contextual Data<a href="#understand-relationships-without-contextual-data" class="hash-link" aria-label="Direct link to Understand Relationships Without Contextual Data" title="Direct link to Understand Relationships Without Contextual Data">​</a></h3><p>With the Authorization Model and relationship tuples shown above, <!-- -->OpenFGA<!-- --> has all the information needed to</p><ul><li>Ensure that the customer can view a transaction tied to their account</li><li>Ensure that the account manager can view a transaction whose account is at the same branch</li></ul><p>We can verify that using the following checks</p><p>Anne can view transaction:A because she is an account manager of an account that is at the same branch.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'transaction:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view transaction:A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_view","object":"transaction:A"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">transaction:A</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Caroline can view transaction:A because she is a customer and the transaction is tied to her account.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:caroline'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'transaction:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:caroline"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:caroline"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:caroline"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:caroline can_view transaction:A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:caroline","relation":"can_view","object":"transaction:A"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:caroline"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:caroline</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">transaction:A</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Additionally, we will check that Mary, an account manager at a different branch <em>cannot</em> view transaction A.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Mary is an account manager at the East-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:mary'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'account_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:east-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Mary is an account manager at the East-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:mary"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:east-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Mary is an account manager at the East-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:mary"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:east-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Mary is an account manager at the East-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:mary"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:east-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:mary","relation":"account_manager","object":"branch:east-side"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:mary account_manager branch:east-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Mary is an account manager at the East-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:mary"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:east-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:mary'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'transaction:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:mary"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:mary"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:mary"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:mary can_view transaction:A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:mary","relation":"can_view","object":"transaction:A"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:mary"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:mary</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">transaction:A</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Note that so far, we have not prevented Anne from viewing the transaction outside office hours, let's see if we can do better.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="take-time-and-ip-address-into-consideration">Take Time And IP Address Into Consideration<a href="#take-time-and-ip-address-into-consideration" class="hash-link" aria-label="Direct link to Take Time And IP Address Into Consideration" title="Direct link to Take Time And IP Address Into Consideration">​</a></h3><h5 class="anchor anchorWithStickyNavbar_LWe7" id="extend-the-authorization-model">Extend The Authorization Model<a href="#extend-the-authorization-model" class="hash-link" aria-label="Direct link to Extend The Authorization Model" title="Direct link to Extend The Authorization Model">​</a></h5><p>In order to add time and ip address to our authorization model, we will add appropriate types for them. We will have a "timeslot" and an "ip-address-range" as types, and each can have users related to it as a user.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">timeslot</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">user</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">ip</span><span class="token plain">-address-range</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">user</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We'll also need to introduce some new relations, and modify some others.</p><ol><li>On the "branch" type:</li></ol><ul><li>Add "approved_timeslot" relation to mark than a certain timeslot is approved to view transactions for accounts in this branch</li><li>Add "approved_ip_address_range" relation to mark than an ip address range is approved to view transactions for accounts in this branch</li><li>Add "approved_context" relation to combine the two authorizations above (<code>user from approved_timeslot and user from approved_ip_address_range</code>), and indicate that the user is in an approved context</li></ul><p>The branch type definition then becomes:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account_manager</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">approved_ip_address_range</span><span class="token plain">: </span><span class="token directly-assignable">[ip-address-range]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">approved_timeslot</span><span class="token plain">: </span><span class="token directly-assignable">[timeslot]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">approved_context</span><span class="token plain">: user </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> approved_timeslot </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">and</span><span class="token plain"> user </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> approved_ip_address_range</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_ip_address_range"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_timeslot"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_context"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"intersection"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_ip_address_range"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_ip_address_range"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_timeslot"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><ol start="2"><li>On the "account" type:</li></ol><ul><li>Add "account_manager_viewer" relation to combine the "account_manager" relationship and the new "approved_context" relation from the branch</li><li>Update the "viewer" relation definition to <code>customer or account_manager_viewer</code> where "customer" can view without being subjected to contextual authorization, while "account_manager_viewer" needs to be within the branch allowed context to view</li></ul><p>The account type definition then becomes:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">account</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">branch</span><span class="token plain">: </span><span class="token directly-assignable">[branch]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account_manager</span><span class="token plain">: account_manager </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">customer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account_manager_viewer</span><span class="token plain">: account_manager </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">and</span><span class="token plain"> approved_context </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: customer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> account_manager_viewer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: viewer</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"branch"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"customer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"intersection"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_context"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"customer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager_viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_view"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"branch"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"customer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>On the "transaction" type:</p><ul><li>Nothing will need to be done, as it will inherit the updated "viewer" relation definition from "account"</li></ul></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="add-the-required-tuples-to-mark-that-anne-is-in-an-approved-context">Add The Required Tuples To Mark That Anne Is In An Approved Context<a href="#add-the-required-tuples-to-mark-that-anne-is-in-an-approved-context" class="hash-link" aria-label="Direct link to Add The Required Tuples To Mark That Anne Is In An Approved Context" title="Direct link to Add The Required Tuples To Mark That Anne Is In An Approved Context">​</a></h5><p>Now that we have updated our authorization model to take time and ip address into consideration, you will notice that Anne has lost access because nothing indicates that Anne is connecting from an approved ip address and time. You can verify that by issuing the following check:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'transaction:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw anne can_view transaction:A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"anne","relation":"can_view","object":"transaction:A"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">transaction:A</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We need to add relationship tuples to mark some approved timeslots and ip address ranges:</p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><ul><li>Here we added the time slots in increments of 1 hour periods, but this is not a requirement.</li><li>We did not add all the office hours to keep this guide shorter.</li></ul></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 11am to 12pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'timeslot:11_12'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'approved_timeslot'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 12pm to 1pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'timeslot:12_13'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'approved_timeslot'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'ip-address-range:10.0.0.0/16'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'approved_ip_address_range'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 11am to 12pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:11_12"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 12pm to 1pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_ip_address_range"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 11am to 12pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:11_12"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 12pm to 1pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_ip_address_range"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># 11am to 12pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:11_12"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># 12pm to 1pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_ip_address_range"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"timeslot:11_12","relation":"approved_timeslot","object":"branch:west-side"},{"user":"timeslot:12_13","relation":"approved_timeslot","object":"branch:west-side"},{"user":"ip-address-range:10.0.0.0/16","relation":"approved_ip_address_range","object":"branch:west-side"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:11_12 approved_timeslot branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:12_13 approved_timeslot branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw ip-address-range:10.0.0.0/16 approved_ip_address_range branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // 11am to 12pm is within the office hours of the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:11_12"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // 12pm to 1pm is within the office hours of the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // The office VPN w/ the </span><span class="token number">10.0</span><span class="token plain">.0.0/16 address range is approved </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">for</span><span class="token plain"> the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_ip_address_range"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Now that we have added the allowed timeslots and ip address ranges we need to add the following relationship tuples to give Anne access.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is connecting from within the 10.0.0.0/16 ip address range</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'ip-address-range:10.0.0.0/16'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is connecting between 12pm and 1pm</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'timeslot:12_13'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is connecting from within the 10.0.0.0/16 ip address range</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is connecting between 12pm and 1pm</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is connecting from within the 10.0.0.0/16 ip address range</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is connecting between 12pm and 1pm</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne is connecting from within the 10.0.0.0/16 ip address range</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne is connecting between 12pm and 1pm</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"user","object":"ip-address-range:10.0.0.0/16"},{"user":"user:anne","relation":"user","object":"timeslot:12_13"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne user ip-address-range:10.0.0.0/16</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne user timeslot:12_13</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne is connecting from within the </span><span class="token number">10.0</span><span class="token plain">.0.0/16 </span><span class="token function" style="color:rgb(80, 250, 123)">ip</span><span class="token plain"> address range</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne is connecting between 12pm and 1pm</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>If we have the above two tuples in the system, when checking whether Anne can view transaction A we should get a response stating that Anne can view it.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'transaction:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view transaction:A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_view","object":"transaction:A"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">transaction:A</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="use-contextual-tuples-for-context-related-checks">Use Contextual Tuples For Context Related Checks<a href="#use-contextual-tuples-for-context-related-checks" class="hash-link" aria-label="Direct link to Use Contextual Tuples For Context Related Checks" title="Direct link to Use Contextual Tuples For Context Related Checks">​</a></h3><p>Now that we know we can authorize based on present state, we have a different problem to solve. We are storing the tuples in the state in order for <!-- -->OpenFGA<!-- --> to evaluate them, which means that:</p><ul><li>For the case of the IP Address, we are not able to truly authorize based on the context of the request. E.g. if Anne was trying to connect from the phone and from the PC at the same time, and only the PC was connected to the VPN, how would <!-- -->OpenFGA<!-- --> know to deny one and allow the other if the data is stored in the state?</li><li>On every check call we have to first write the correct tuples, then call the Check api, then clean up those tuples. This causes a substantial increase in latency as well as incorrect answers for requests happening in parallel (they could write/delete each other's tuples).</li></ul><p>How do we solve this? How do we tie the above two tuples to the context of the request instead of the system state?</p><p>First, we will need to undo adding the stored relationship tuples where Anne is connecting from within the 10.0.0.0/16 ip address range and Anne connecting between 12pm and 1pm</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">deletes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'ip-address-range:10.0.0.0/16'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Remove stored tuples where Anne is connecting between 12pm and 1pm</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'timeslot:12_13'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Remove stored tuples where Anne is connecting between 12pm and 1pm</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Remove stored tuples where Anne is connecting between 12pm and 1pm</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> deletes</span><span class="token operator">==</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Remove stored tuples where Anne is connecting between 12pm and 1pm</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"deletes": { "tuple_keys" : [{"user":"user:anne","relation":"user","object":"ip-address-range:10.0.0.0/16"},{"user":"user:anne","relation":"user","object":"timeslot:12_13"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple delete --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> user:anne user ip-address-range:10.0.0.0/16</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple delete --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> user:anne user timeslot:12_13</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">delete</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Remove stored tuples where Anne is connecting from within the </span><span class="token number">10.0</span><span class="token plain">.0.0/16 </span><span class="token function" style="color:rgb(80, 250, 123)">ip</span><span class="token plain"> address range</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Remove stored tuples where Anne is connecting between 12pm and 1pm</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>For Check calls, <!-- -->OpenFGA<!-- --> has a concept called "<a href="/docs/concepts#what-are-contextual-tuples">Contextual Tuples</a>". Contextual Tuples are tuples that do <strong>not</strong> exist in the system state and are not written beforehand to <!-- -->OpenFGA<!-- -->. They are tuples that are sent alongside the Check request and will be treated as <em>if</em> they already exist in the state for the context of that particular Check call.</p><p>When Anne is connecting from an allowed ip address range and timeslot, <!-- -->OpenFGA<!-- --> will return <code>{"allowed":true}</code>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'transaction:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">contextual_tuples</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContextualTuples</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContextualTuples </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">_object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">_object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> contextual_tuples</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view transaction:A --contextual_tuples </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne user ip-address-range:10.0.0.0/16"</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne user timeslot:12_13"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_view","object":"transaction:A"},"contextual_tuples":{"tuple_keys":[{"user":"user:anne","relation":"user","object":"ip-address-range:10.0.0.0/16"},{"user":"user:anne","relation":"user","object":"timeslot:12_13"}]}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">transaction:A</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> contextual_tuples </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"> // Assuming the following is </span><span class="token boolean">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain">user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain">, object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain">user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain">, object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>When Anne is connecting from a denied ip address range or timeslot, <!-- -->OpenFGA<!-- --> will return <code>{"allowed":false}</code>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'transaction:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">contextual_tuples</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:18_19"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContextualTuples</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:18_19"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContextualTuples </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">_object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">_object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:18_19"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> contextual_tuples</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:18_19"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view transaction:A --contextual_tuples </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne user ip-address-range:10.0.0.0/16"</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne user timeslot:18_19"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_view","object":"transaction:A"},"contextual_tuples":{"tuple_keys":[{"user":"user:anne","relation":"user","object":"ip-address-range:10.0.0.0/16"},{"user":"user:anne","relation":"user","object":"timeslot:18_19"}]}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">transaction:A</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> contextual_tuples </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"> // Assuming the following is </span><span class="token boolean">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain">user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain">, object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain">user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain">, object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:18_19"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="summary">Summary<a href="#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary">​</a></h2><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Final version of the Authorization Model and Relationship tuples</summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account_manager</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">approved_ip_address_range</span><span class="token plain">: </span><span class="token directly-assignable">[ip-address-range]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">approved_timeslot</span><span class="token plain">: </span><span class="token directly-assignable">[timeslot]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">approved_context</span><span class="token plain">: user </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> approved_timeslot </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">and</span><span class="token plain"> user </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> approved_ip_address_range</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">account</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">branch</span><span class="token plain">: </span><span class="token directly-assignable">[branch]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account_manager</span><span class="token plain">: account_manager </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">customer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account_manager_viewer</span><span class="token plain">: account_manager </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">and</span><span class="token plain"> approved_context </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: customer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> account_manager_viewer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: viewer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">transaction</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account</span><span class="token plain">: </span><span class="token directly-assignable">[account]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> account</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">timeslot</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">user</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">ip</span><span class="token plain">-address-range</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">user</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_ip_address_range"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_timeslot"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_context"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"intersection"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_ip_address_range"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_ip_address_range"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_timeslot"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"branch"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"customer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"intersection"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_context"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"customer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager_viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_view"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"branch"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"customer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_view"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is the Account Manager at the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'account_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Caroline is the customer for checking account number 526</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:caroline'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'customer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'account:checking-526'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The West-Side branch is the branch that the Checking account number 526 has been created at</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'account:checking-526'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Checking account number 526 is the account for transaction A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'account:checking-526'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'account'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'transaction:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 8am to 9am is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'timeslot:8_9'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'approved_timeslot'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 9am to 10am is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'timeslot:9_10'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'approved_timeslot'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 10am to 11am is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'timeslot:10_11'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'approved_timeslot'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 11am to 12pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'timeslot:11_12'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'approved_timeslot'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 12pm to 1pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'timeslot:12_13'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'approved_timeslot'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 1pm to 2pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'timeslot:13_14'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'approved_timeslot'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 2pm to 3pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'timeslot:14_15'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'approved_timeslot'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'ip-address-range:10.0.0.0/16'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'approved_ip_address_range'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'branch:west-side'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is the Account Manager at the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Caroline is the customer for checking account number 526</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:caroline"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"customer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The West-Side branch is the branch that the Checking account number 526 has been created at</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Checking account number 526 is the account for transaction A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 8am to 9am is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:8_9"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 9am to 10am is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:9_10"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 10am to 11am is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:10_11"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 11am to 12pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:11_12"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 12pm to 1pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 1pm to 2pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:13_14"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 2pm to 3pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:14_15"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_ip_address_range"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is the Account Manager at the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Caroline is the customer for checking account number 526</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:caroline"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"customer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The West-Side branch is the branch that the Checking account number 526 has been created at</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Checking account number 526 is the account for transaction A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 8am to 9am is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:8_9"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 9am to 10am is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:9_10"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 10am to 11am is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:10_11"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 11am to 12pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:11_12"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 12pm to 1pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 1pm to 2pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:13_14"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// 2pm to 3pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:14_15"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_ip_address_range"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne is the Account Manager at the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Caroline is the customer for checking account number 526</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:caroline"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"customer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># The West-Side branch is the branch that the Checking account number 526 has been created at</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Checking account number 526 is the account for transaction A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># 8am to 9am is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:8_9"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># 9am to 10am is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:9_10"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># 10am to 11am is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:10_11"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># 11am to 12pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:11_12"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># 12pm to 1pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># 1pm to 2pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:13_14"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># 2pm to 3pm is within the office hours of the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:14_15"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_ip_address_range"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"account_manager","object":"branch:west-side"},{"user":"user:caroline","relation":"customer","object":"account:checking-526"},{"user":"branch:west-side","relation":"branch","object":"account:checking-526"},{"user":"account:checking-526","relation":"account","object":"transaction:A"},{"user":"timeslot:8_9","relation":"approved_timeslot","object":"branch:west-side"},{"user":"timeslot:9_10","relation":"approved_timeslot","object":"branch:west-side"},{"user":"timeslot:10_11","relation":"approved_timeslot","object":"branch:west-side"},{"user":"timeslot:11_12","relation":"approved_timeslot","object":"branch:west-side"},{"user":"timeslot:12_13","relation":"approved_timeslot","object":"branch:west-side"},{"user":"timeslot:13_14","relation":"approved_timeslot","object":"branch:west-side"},{"user":"timeslot:14_15","relation":"approved_timeslot","object":"branch:west-side"},{"user":"ip-address-range:10.0.0.0/16","relation":"approved_ip_address_range","object":"branch:west-side"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne account_manager branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:caroline customer account:checking-526</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw branch:west-side branch account:checking-526</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw account:checking-526 account transaction:A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:8_9 approved_timeslot branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:9_10 approved_timeslot branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:10_11 approved_timeslot branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:11_12 approved_timeslot branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:12_13 approved_timeslot branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:13_14 approved_timeslot branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:14_15 approved_timeslot branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw ip-address-range:10.0.0.0/16 approved_ip_address_range branch:west-side</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne is the Account Manager at the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Caroline is the customer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">for</span><span class="token plain"> checking account number </span><span class="token number">526</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:caroline"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"customer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // The West-Side branch is the branch that the Checking account number </span><span class="token number">526</span><span class="token plain"> has been created at</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Checking account number </span><span class="token number">526</span><span class="token plain"> is the account </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">for</span><span class="token plain"> transaction A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"account:checking-526"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"transaction:A"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // 8am to 9am is within the office hours of the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:8_9"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // 9am to 10am is within the office hours of the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:9_10"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // 10am to 11am is within the office hours of the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:10_11"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // 11am to 12pm is within the office hours of the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:11_12"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // 12pm to 1pm is within the office hours of the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:12_13"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // 1pm to 2pm is within the office hours of the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:13_14"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // 2pm to 3pm is within the office hours of the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot:14_15"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // The office VPN w/ the </span><span class="token number">10.0</span><span class="token plain">.0.0/16 address range is approved </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">for</span><span class="token plain"> the West-Side branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range:10.0.0.0/16"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"approved_ip_address_range"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"branch:west-side"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></div></div></details><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="admonitionContent_S0QG"><p>Contextual tuples:</p><ul><li>Are not persisted in the store.</li><li>Are only supported on the <a href="/api/service#Relationship%20Queries/Check">Check API endpoint</a> and <a href="/api/service#Relationship%20Queries/ListObjects">ListObjects API endpoint</a>. They are not supported on read, expand and other endpoints.- If you are using the <a href="/api/service#Relationship%20Tuples/ReadChanges">ReadChanges API endpoint</a> to build a permission aware search index, note that it will not be trivial to take contextual tuples into account.</li><li>If you are using the <a href="/api/service#Relationship%20Tuples/ReadChanges">Read Changes API endpoint</a> to build a permission aware search index, note that it will not be trivial to take contextual tuples into account.</li></ul></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="taking-it-a-step-further-banks-as-a-service-authorization">Taking It A Step Further: Banks As A Service Authorization<a href="#taking-it-a-step-further-banks-as-a-service-authorization" class="hash-link" aria-label="Direct link to Taking It A Step Further: Banks As A Service Authorization" title="Direct link to Taking It A Step Further: Banks As A Service Authorization">​</a></h3><p>In order to keep this guide concise, we assumed you were modeling for a single bank. What if you were offering a multi-tenant service where each bank is a single tenant?</p><p>In that case, we can extend the model like so:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">bank</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">admin</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">branch</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">bank</span><span class="token plain">: </span><span class="token directly-assignable">[bank]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account_manager</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">approved_ip_address_range</span><span class="token plain">: </span><span class="token directly-assignable">[ip-address-range]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">approved_timeslot</span><span class="token plain">: </span><span class="token directly-assignable">[timeslot]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">approved_context</span><span class="token plain">: user </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> approved_timeslot </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">and</span><span class="token plain"> user </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> approved_ip_address_range</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">account</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">branch</span><span class="token plain">: </span><span class="token directly-assignable">[branch]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account_manager</span><span class="token plain">: account_manager </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">customer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account_manager_viewer</span><span class="token plain">: account_manager </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">and</span><span class="token plain"> approved_context </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> branch</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: customer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> account_manager_viewer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: viewer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">transaction</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">account</span><span class="token plain">: </span><span class="token directly-assignable">[account]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> account</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">timeslot</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">user</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">ip</span><span class="token plain">-address-range</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">user</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"bank"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"admin"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"bank"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_ip_address_range"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_timeslot"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_context"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"intersection"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_timeslot"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_ip_address_range"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"bank"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"bank"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_ip_address_range"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"approved_timeslot"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"branch"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"customer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account_manager_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"intersection"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"approved_context"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"customer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account_manager_viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_view"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"branch"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"branch"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"customer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"transaction"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_view"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"account"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"account"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"timeslot"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"ip-address-range"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how user groups can be used.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Object to Object Relationships</span><p class="documentation-card-box-description_u7_j">Learn how objects can relate to one another and how that can affect user's access.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/building-blocks/object-to-object-relationships">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling with Multiple Restrictions</span><p class="documentation-card-box-description_u7_j">Learn how to model requiring multiple relationships before users are authorized to perform certain actions.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/multiple-restrictions">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA API</span><p class="documentation-card-box-description_u7_j">Details on the Check API in the OpenFGA reference guide.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/api/service#Relationship%20Queries/Check">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/contextual-time-based-authorization.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/custom-roles"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Custom Roles</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/organization-context-authorization"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Authorization Through Organization Context</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li><li><a href="#scenario" class="table-of-contents__link toc-highlight">Scenario</a></li><li><a href="#requirements" class="table-of-contents__link toc-highlight">Requirements</a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#understand-relationships-without-contextual-data" class="table-of-contents__link toc-highlight">Understand Relationships Without Contextual Data</a></li><li><a href="#take-time-and-ip-address-into-consideration" class="table-of-contents__link toc-highlight">Take Time And IP Address Into Consideration</a></li><li><a href="#use-contextual-tuples-for-context-related-checks" class="table-of-contents__link toc-highlight">Use Contextual Tuples For Context Related Checks</a></li></ul></li><li><a href="#summary" class="table-of-contents__link toc-highlight">Summary</a><ul><li><a href="#taking-it-a-step-further-banks-as-a-service-authorization" class="table-of-contents__link toc-highlight">Taking It A Step Further: Banks As A Service Authorization</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/custom-roles.html b/docs/modeling/custom-roles.html index b6b4cb2a7..887f9f479 100644 --- a/docs/modeling/custom-roles.html +++ b/docs/modeling/custom-roles.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Custom Roles</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Custom Roles</h1><p>In this guide you'll learn how to model custom roles in your system using <a href="/docs/authorization-and-openfga#what-is-openfga">OpenFGA</a>.</p><p>For example, a Business-to-Business (B2B) application could allow customers to create their own custom roles on the application to grant their users.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>In many cases, roles would fit in well as relations on an object type, as seen in <a href="/docs/modeling/roles-and-permissions">Modeling Roles and Permissions</a>. In some cases, however, they may not be enough.</p><p>Custom roles are useful when:</p><ul><li>Users of the application are able to create arbitrary sets of roles with different permissions that govern the users' access to objects.</li><li>It is not known beforehand (at the time of Authorization Model creation) what the application roles are.</li><li>The team responsible for building the authorization model is different from the teams responsible for defining roles and access to the application.</li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before you start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before you start" title="Direct link to Before you start">​</a></h2><p>Before you start this guide, make sure you're familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things listed below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><h3 class="anchor anchorWithStickyNavbar_LWe7" id="initial-model">Initial Model<a href="#initial-model" class="hash-link" aria-label="Direct link to Initial Model" title="Direct link to Initial Model">​</a></h3><p>To start, let's say there is an application with a <a href="/docs/concepts#what-is-a-type">type</a> called <code>asset-category</code>. Users can have view and/or edit access to assets in that category. Any user who can edit can also view.</p></summary><div><div class="collapsibleContent_i85q"><p>We'll start with the following authorization model showing a system with an <code>asset-category</code> type. This type allows users to have view and edit access to it.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">asset</span><span class="token plain">-category</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><hr><p>In addition, you'll need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-roles-and-permissions">Modeling Roles and Permissions<a href="#modeling-roles-and-permissions" class="hash-link" aria-label="Direct link to Modeling Roles and Permissions" title="Direct link to Modeling Roles and Permissions">​</a></h3><p>You need to know how to add users to groups and grant groups access to resources. <a href="/docs/modeling/user-groups">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-object-to-object-relationships">Modeling Object-to-Object Relationships<a href="#modeling-object-to-object-relationships" class="hash-link" aria-label="Direct link to Modeling Object-to-Object Relationships" title="Direct link to Modeling Object-to-Object Relationships">​</a></h3><p>You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. <a href="/docs/modeling/building-blocks/object-to-object-relationships">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="concepts--configuration-language">Concepts & Configuration Language<a href="#concepts--configuration-language" class="hash-link" aria-label="Direct link to Concepts & Configuration Language" title="Direct link to Concepts & Configuration Language">​</a></h3><ul><li><a href="/docs/concepts">OpenFGA Concepts</a></li><li><a href="/docs/configuration-language">Configuration Language</a></li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>Starting with the authorization model mentioned above, we want to enable users to create their own custom roles, and tie permissions to those roles to our two users and to the permissions on the logo asset category.</p><p>For this guide, we'll model a scenario where a certain organization using our app has created an <code>asset-category</code> called "logos", and another called "text content".</p><p>The company administrator would like to create:</p><ul><li>a <strong>media-manager</strong> role that allows users to <strong>edit</strong> assets in the <strong>logos asset category</strong></li><li>a <strong>media-viewer</strong> role that allows users to <strong>view</strong> all assets in the <strong>logos asset category</strong></li><li>a <strong>blog-editor</strong> role that allows users to <strong>edit</strong> all assets in the <strong>text content asset category</strong></li><li>a <strong>blog-viewer</strong> role that allows users to <strong>view</strong> all assets in the <strong>text content asset category</strong></li></ul><p>Imagine these are what the permissions the roles in one organization using our service are like:</p><p><img loading="lazy" alt="Image showing custom roles and permissions" src="/assets/images/custom-roles-roles-and-permissions-ca8254c87a37e52fea450bdeb634b39c.svg" width="1213" height="253" class="img_ev3q"></p><p>Finally, the administrator wants to assign <strong>Anne</strong> the <strong>media-manager</strong> role and <strong>Beth</strong> the <strong>media-viewer</strong> role.</p><p>At the end, we'll verify our model by ensuring the following access <a href="/docs/concepts#what-is-a-check-request">check</a> requests return the expected result.</p><p><img loading="lazy" alt="Image showing expected results" src="/assets/images/custom-roles-expectations-f015ffb4203247a03815859fb0844f95.svg" width="1213" height="448" class="img_ev3q"></p><p>In order to do this, we need to:</p><ol class="list-numbered-leading-zeros"><li>Update the Authorization Model to add a Role Type</li><li>Use Relationship Tuples to tie the Users to the Roles</li><li>Use Relationship Tuples to associate Permissions with the Roles</li><li>Verify that the Authorization Model works</li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-update-the-authorization-model-to-add-a-role-type">01. Update The Authorization Model To Add A Role Type<a href="#01-update-the-authorization-model-to-add-a-role-type" class="hash-link" aria-label="Direct link to 01. Update The Authorization Model To Add A Role Type" title="Direct link to 01. Update The Authorization Model To Add A Role Type">​</a></h3><p>Because our roles are going to be dynamic and might change frequently, we represent them in a new type instead of as relations on that same type. We'll create new type called <code>role</code>, where users can be related as assignee to it.</p><p>The authorization model becomes this:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">asset</span><span class="token plain">-category</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, role#assignee]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user, role#assignee]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">role</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">assignee</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"role"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"role"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"role"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"assignee"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"assignee"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>With this change we can add relationship tuples indicating that a certain user is <code>assigned</code> a certain <code>role</code>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02use-relationship-tuples-to-tie-the-users-to-the-roles">02.Use Relationship Tuples To Tie The Users To The Roles<a href="#02use-relationship-tuples-to-tie-the-users-to-the-roles" class="hash-link" aria-label="Direct link to 02.Use Relationship Tuples To Tie The Users To The Roles" title="Direct link to 02.Use Relationship Tuples To Tie The Users To The Roles">​</a></h3><p>Once we've added the <code>role</code> type, we can assign roles to Anne and Beth. Anne is assigned the "media-manager" role and Beth is assigned the "media-viewer" role. We can do that by adding relationship tuples as follows:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is assigned the media-manager role</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'assignee'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'role:media-manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Beth is assigned the media-viewer role</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'assignee'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'role:media-viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is assigned the media-manager role</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Beth is assigned the media-viewer role</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is assigned the media-manager role</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-manager"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Beth is assigned the media-viewer role</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-viewer"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne is assigned the media-manager role</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Beth is assigned the media-viewer role</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"assignee","object":"role:media-manager"},{"user":"user:beth","relation":"assignee","object":"role:media-viewer"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne assignee role:media-manager</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth assignee role:media-viewer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne is assigned the media-manager role</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Beth is assigned the media-viewer role</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We can verify they are members of said roles by issuing the following check requests:</p><p><img loading="lazy" alt="Image showing expected membership checks" src="/assets/images/custom-roles-membership-checks-057e971c8b2def87ea3c405352a0f100.svg" width="1213" height="253" class="img_ev3q"></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'assignee'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'role:media-manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne assignee role:media-manager</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"assignee","object":"role:media-manager"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"assignee"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">assignee</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-manager"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">role:media-manager</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-use-relationship-tuples-to-associate-permissions-with-the-roles">03. Use Relationship Tuples To Associate Permissions With The Roles<a href="#03-use-relationship-tuples-to-associate-permissions-with-the-roles" class="hash-link" aria-label="Direct link to 03. Use Relationship Tuples To Associate Permissions With The Roles" title="Direct link to 03. Use Relationship Tuples To Associate Permissions With The Roles">​</a></h3><p>With our users and roles set up, we still need to tie members of a certain role to it's corresponding permission(s).</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Users assigned the media-manager role can edit in the Logos assets category</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'role:media-manager#assignee'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'asset-category:logos'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Users assigned the media-viewer role can view from the Logos assets category</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'role:media-viewer#assignee'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'asset-category:logos'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Users assigned the media-manager role can edit in the Logos assets category</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-manager#assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category:logos"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Users assigned the media-viewer role can view from the Logos assets category</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-viewer#assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category:logos"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Users assigned the media-manager role can edit in the Logos assets category</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-manager#assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category:logos"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Users assigned the media-viewer role can view from the Logos assets category</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-viewer#assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category:logos"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Users assigned the media-manager role can edit in the Logos assets category</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-manager#assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category:logos"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Users assigned the media-viewer role can view from the Logos assets category</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-viewer#assignee"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category:logos"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"role:media-manager#assignee","relation":"editor","object":"asset-category:logos"},{"user":"role:media-viewer#assignee","relation":"viewer","object":"asset-category:logos"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw role:media-manager</span><span class="token comment" style="color:rgb(98, 114, 164)">#assignee editor asset-category:logos</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw role:media-viewer</span><span class="token comment" style="color:rgb(98, 114, 164)">#assignee viewer asset-category:logos</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Users assigned the media-manager role can edit </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">in</span><span class="token plain"> the Logos assets category</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-manager#assignee"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category:logos"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Users assigned the media-viewer role can view from the Logos assets category</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"role:media-viewer#assignee"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category:logos"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="04-verify-that-the-authorization-model-works">04. Verify That The Authorization Model Works<a href="#04-verify-that-the-authorization-model-works" class="hash-link" aria-label="Direct link to 04. Verify That The Authorization Model Works" title="Direct link to 04. Verify That The Authorization Model Works">​</a></h3><p>To ensure our model works, it needs to match our expectations:</p><p><img loading="lazy" alt="Image showing expected results" src="/assets/images/custom-roles-expectations-f015ffb4203247a03815859fb0844f95.svg" width="1213" height="448" class="img_ev3q"></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'asset-category:logos'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category:logos"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category:logos"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category:logos"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne editor asset-category:logos</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"editor","object":"asset-category:logos"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">editor</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"asset-category:logos"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">asset-category:logos</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The checks come back as we expect, so our model is working correctly.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to model with OpenFGA.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Roles and Permissions</span><p class="documentation-card-box-description_u7_j">Learn how to remove the direct relationship to indicate nonassignable permissions.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/roles-and-permissions">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Concepts: Object to Object Relationships</span><p class="documentation-card-box-description_u7_j">Learn about how to model object to object relationships in OpenFGA.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/building-blocks/object-to-object-relationships">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/custom-roles.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/multiple-restrictions"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Multiple Restrictions</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/contextual-time-based-authorization"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Contextual and Time-Based Authorization</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before you start</a><ul><li><a href="#initial-model" class="table-of-contents__link toc-highlight">Initial Model</a></li><li><a href="#modeling-roles-and-permissions" class="table-of-contents__link toc-highlight">Modeling Roles and Permissions</a></li><li><a href="#modeling-object-to-object-relationships" class="table-of-contents__link toc-highlight">Modeling Object-to-Object Relationships</a></li><li><a href="#concepts--configuration-language" class="table-of-contents__link toc-highlight">Concepts & Configuration Language</a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-update-the-authorization-model-to-add-a-role-type" class="table-of-contents__link toc-highlight">01. Update The Authorization Model To Add A Role Type</a></li><li><a href="#02use-relationship-tuples-to-tie-the-users-to-the-roles" class="table-of-contents__link toc-highlight">02.Use Relationship Tuples To Tie The Users To The Roles</a></li><li><a href="#03-use-relationship-tuples-to-associate-permissions-with-the-roles" class="table-of-contents__link toc-highlight">03. Use Relationship Tuples To Associate Permissions With The Roles</a></li><li><a href="#04-verify-that-the-authorization-model-works" class="table-of-contents__link toc-highlight">04. Verify That The Authorization Model Works</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/direct-access.html b/docs/modeling/direct-access.html index e48c4738e..1658b43ec 100644 --- a/docs/modeling/direct-access.html +++ b/docs/modeling/direct-access.html @@ -15,15 +15,15 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Direct Access</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Direct Access</h1><p>In this guide you will learn how to grant a <a href="/docs/concepts#what-is-a-user">user</a> access to an <a href="/docs/concepts#what-is-an-object">object</a> (such as a certain document) in <a href="/docs/authorization-and-openfga#what-is-openfga">OpenFGA</a>.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>Granting access with <em><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuple</a></em> is a core part of <!-- -->OpenFGA<!-- -->. Without them, any <em><a href="/docs/concepts#what-is-a-check-request">checks</a></em> will fail. You should use:</p><ul><li><em>authorization model</em> to represent what <strong>relation</strong>s are possible between the users and objects in the system</li><li><em>relationship tuples</em> to represent the facts about the relationships between users and objects in your system.</li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before you start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before you start" title="Direct link to Before you start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>Assume that you have the following <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>.<br> You have a <a href="/docs/concepts#what-is-a-type">type</a> called <code>document</code> that can have a <code>viewer</code> and/or an <code>editor</code>.</p></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>For our applications to understand that <strong>user x</strong> has access to <strong>document y</strong>, we need to provide <!-- -->OpenFGA<!-- --> that information through <em><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuples</a></em>. Each <em>relationship tuple</em> has three basic parameters, a <strong><a href="/docs/concepts#what-is-a-user">user</a></strong>, a <strong><a href="/docs/concepts#what-is-a-relation">relation</a></strong> and an <strong><a href="/docs/concepts#what-is-an-object">object</a></strong>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-create-a-relationship-tuple">01. Create A Relationship Tuple<a href="#01-create-a-relationship-tuple" class="hash-link" aria-label="Direct link to 01. Create A Relationship Tuple" title="Direct link to 01. Create A Relationship Tuple">​</a></h3><p>Let us add a <em><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuple</a></em> to indicate that <strong>bob</strong> who is an <code>editor</code> of <strong>document:meeting_notes.doc</strong>. This is represented by adding the following:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:meeting_notes.doc'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:bob","relation":"editor","object":"document:meeting_notes.doc"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob editor document:meeting_notes.doc</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-check-that-the-relationship-exists">02. Check That The Relationship Exists<a href="#02-check-that-the-relationship-exists" class="hash-link" aria-label="Direct link to 02. Check That The Relationship Exists" title="Direct link to 02. Check That The Relationship Exists">​</a></h3><p>Once that <em>relationship tuple</em> is added to <!-- -->OpenFGA<!-- -->, we can <em><a href="/docs/concepts#what-is-a-check-request">check</a></em> if the relationship is valid by asking the following: <strong>"is bob an editor of document:meeting_notes.doc?"</strong></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:meeting_notes.doc'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob editor document:meeting_notes.doc</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:bob","relation":"editor","object":"document:meeting_notes.doc"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bob</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">editor</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:meeting_notes.doc</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>If we were to <em>check</em> the following: <strong>"is bob a viewer of document:meeting_notes.doc?"</strong> it would return <strong>false</strong> since that <em>relationship tuple</em> does not exist within <!-- -->OpenFGA<!-- --> yet.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:meeting_notes.doc'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob viewer document:meeting_notes.doc</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:bob","relation":"viewer","object":"document:meeting_notes.doc"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bob</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:meeting_notes.doc</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p><strong>Note:</strong> When creating relationship tuples for <!-- -->OpenFGA<!-- --> make sure to use unique ids for each object and user within your application domain. We're using first names and simple ids to just illustrate an easy-to-follow example.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to model with OpenFGA.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA Concepts</span><p class="documentation-card-box-description_u7_j">Learn about the OpenFGA Concepts.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/concepts">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling: Getting Started</span><p class="documentation-card-box-description_u7_j">Learn about how to get started with modeling.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/getting-started">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Configuration Language</span><p class="documentation-card-box-description_u7_j">Learn about OpenFGA Configuration Language.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/configuration-language">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/direct-access.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/getting-started"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Get Started with Modeling</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/user-groups"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">User Groups</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before you start</a><ul><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-create-a-relationship-tuple" class="table-of-contents__link toc-highlight">01. Create A Relationship Tuple</a></li><li><a href="#02-check-that-the-relationship-exists" class="table-of-contents__link toc-highlight">02. Check That The Relationship Exists</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/getting-started.html b/docs/modeling/getting-started.html index 3e6c82f78..12130a087 100644 --- a/docs/modeling/getting-started.html +++ b/docs/modeling/getting-started.html @@ -15,16 +15,16 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Get Started with Modeling</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Get Started with Modeling</h1><p>Creating a <a href="/docs/authorization-and-openfga#what-is-relationship-based-access-control-rebac">Relationship Based Access Control (ReBAC)</a> authorization model might feel odd at first. Most of us tend to think about authorization models in terms of roles and permissions. After all, most software works like that. Your existing systems are likely built on a model using roles and permissions.</p><p>This guide outlines a process for defining your <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a> with <a href="/docs/authorization-and-openfga#what-is-openfga">OpenFGA</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="introduction-to-modeling">Introduction To Modeling<a href="#introduction-to-modeling" class="hash-link" aria-label="Direct link to Introduction To Modeling" title="Direct link to Introduction To Modeling">​</a></h2><p>To define a ReBAC model in <!-- -->OpenFGA<!-- --> we recommend:</p><ul><li>If you have an existing system: forget about how your system works today and start thinking about how you want it to work in the future.</li><li>Thinking about authorization starting from the resources, or objects as <!-- -->OpenFGA<!-- --> calls them.</li></ul><p>If that sounds hard, don't worry! We'll guide you through it.</p>OpenFGA<!-- --> is built to quickly and reliably make <a href="/docs/concepts#what-is-a-check-request">authorization checks</a>. This means providing an answer to a question: "Can user U perform action A on object O?"<p>ReBAC systems determine access from a <a href="/docs/concepts#what-is-a-user">user's</a> <a href="/docs/concepts#what-is-a-relation">relation</a> to an <a href="/docs/concepts#what-is-an-object">object</a>. Authorization decisions are then yes or no answers to the question: "Does user U have relation R with object O?".</p><div style="margin-top:2rem;margin-bottom:2rem" class="column-layout-2_O2db"><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">General Authorization Check</span><p>"Can user <b>U</b> <u>perform an action</u> <b>A</b> on object <b>O</b>?"</p><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA (ReBAC) Authorization Check</span><p>"Does user <b>U</b> <u>have relation</u> <b>R</b> with object <b>O</b>?"</p><div class="documentation-card-box-children_i280"></div></div></div></div><p>In the previous example, a relation R should be defined that implies permission to action A. For example:</p><div style="margin-top:2rem;margin-bottom:2rem" class="column-layout-2_O2db"><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">General Authorization Check</span><p>"Can user <b>Jane</b> <u>perform action</u> <b>view</b> on object <b>project sandcastle</b>?"</p><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA (ReBAC) Authorization Check</span><p>"Can user <b>Jane</b> <u>have relation</u> <b>view</b> with object <b>project sandcastle</b>?"</p><div class="documentation-card-box-children_i280"></div></div></div></div><p>We'll provide more detailed examples throughout this article.</p><p>When you are modeling, you need to answer a more general question:</p><div style="margin-top:2rem;margin-bottom:2rem"><div class="documentation-card-box_SNqO documentation-card-box-fitcontent_koVg undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-left__zex"><div class="documentation-card-box-icon-large_nsCS"><svg width="106" height="106" viewBox="0 0 106 106" fill="none" xmlns="http://www.w3.org/2000/svg"><rect y="0.026" width="105.948" height="105.948" rx="20.252" fill="#BEC4CE"></rect><path d="M64.013 73.904c-7.832 0-14.18-6.349-14.18-14.18 0-7.832 6.348-14.18 14.18-14.18s14.18 6.348 14.18 14.18c0 7.831-6.348 14.18-14.18 14.18Z" fill="#2D2D37"></path><path d="M31.194 12.758h44.687c7.813 0 14.145 6.347 14.145 14.177v.006c0 7.83-6.332 14.177-14.145 14.177H31.194c-7.812 0-14.145-6.347-14.145-14.177v-.006c0-7.83 6.333-14.177 14.145-14.177Z" fill="url(#a)"></path><path d="M45.408 26.903v52.166c0 7.812-6.347 14.145-14.178 14.145h-.005c-7.83 0-14.178-6.333-14.178-14.145V26.903c0-7.812 6.348-14.145 14.178-14.145h.005c7.83 0 14.178 6.333 14.178 14.145Z" fill="url(#b)"></path><path d="M31.228 93.243c-7.832 0-14.18-6.35-14.18-14.181 0-7.832 6.348-14.18 14.18-14.18 7.831 0 14.18 6.348 14.18 14.18s-6.349 14.18-14.18 14.18Z" fill="#fff"></path><path d="M64.03 73.938c7.832 0 14.18-6.35 14.18-14.18 0-7.833-6.348-14.181-14.18-14.181s-14.18 6.349-14.18 14.18c0 7.832 6.348 14.18 14.18 14.18Z" fill="#000"></path><defs><linearGradient id="a" x1="90.016" y1="26.938" x2="17.04" y2="26.938" gradientUnits="userSpaceOnUse"><stop stop-color="#635DFF"></stop><stop offset="1" stop-color="#3885FF"></stop></linearGradient><linearGradient id="b" x1="31.228" y1="93.217" x2="31.228" y2="12.762" gradientUnits="userSpaceOnUse"><stop stop-color="#FF4F40"></stop><stop offset="1" stop-color="#F4D"></stop></linearGradient></defs></svg></div><span class="documentation-card-box-icon-title_zmVE">Why could user U perform an action A on an object O?</span></div><div class="documentation-card-box-children_i280"></div></div></div></div><p>If you can answer that question for all types of objects in your system, then you can codify that into an authorization model.</p><p>Let's get started!</p><hr><h2 class="anchor anchorWithStickyNavbar_LWe7" id="a-process-for-defining-authorization-models">A Process For Defining Authorization Models<a href="#a-process-for-defining-authorization-models" class="hash-link" aria-label="Direct link to A Process For Defining Authorization Models" title="Direct link to A Process For Defining Authorization Models">​</a></h2><p>Defining an authorization model requires codifying an answer to the question "why could user U perform an action A on an object O?" for all use cases or actions in your system. This is an iterative process. For the purpose of this guide, we'll go through one iteration of this process using a simplified Google Drive like system as an example.</p><p>Steps for defining your authorization model:</p><ol><li><a href="#01-pick-the-most-important-feature">Pick the most important feature</a></li><li><a href="#02-list-the-object-types">List the object types</a></li><li><a href="#03-list-relations-for-those-types">List relations for those types</a></li><li><a href="#04-define-relations">Define relations</a></li><li><a href="#05-test-the-model">Test the model</a></li><li><a href="#06-iterate">Iterate</a></li></ol><p><img loading="lazy" alt="The starting point" src="/assets/images/getting-started-diagram-01-55e7a873e7fdd4aa810922af9606ad0c.svg" width="911" height="188" class="img_ev3q"></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-pick-the-most-important-feature">01. Pick The Most Important Feature<a href="#01-pick-the-most-important-feature" class="hash-link" aria-label="Direct link to 01. Pick The Most Important Feature" title="Direct link to 01. Pick The Most Important Feature">​</a></h3><p><img loading="lazy" alt="Pick the most important feature" src="/assets/images/getting-started-diagram-02-46c38ef0a05b5eac7e8a85c3ca02e20f.svg" width="911" height="188" class="img_ev3q"></p><p>A feature, in the context of this document, is an action or related set of actions your users can perform in your system. We'll introduce an example feature later in this section.</p><p>Start with the most important feature. It doesn't have to be the most complex one, but it should be the most important one. You're probably more familiar with the authorization requirements for this feature than other less important use cases.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Important</div><div class="admonitionContent_S0QG"><ul><li>Requirement clarity is fundamental when defining an authorization model.</li><li>The scope of the feature is not important at this point. You can always iterate later.</li></ul></div></div><h4 class="anchor anchorWithStickyNavbar_LWe7" id="write-it-in-plain-language">Write It In Plain Language<a href="#write-it-in-plain-language" class="hash-link" aria-label="Direct link to Write It In Plain Language" title="Direct link to Write It In Plain Language">​</a></h4><p>Once you've picked a feature, describe its authorization related scope using simple language. Avoid using the word "roles", as this ties you to an RBAC way of thinking.</p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Roles don't "disappear" in ReBAC systems like <!-- -->OpenFGA<!-- -->. Your users might <a href="/docs/modeling/roles-and-permissions">have roles on a given object, rather than the entire system</a>. But starting from the term "role" might lead you down the wrong path. Instead it is better to discover roles while you are modeling.</p></div></div><p>Your feature description should include the <a href="/docs/concepts#what-is-an-object">objects</a>, <a href="/docs/concepts#what-is-a-user">users</a> and <a href="/docs/concepts#what-is-a-user">groups of users</a> participating in the system. Sentences should look like this:</p><div style="margin-bottom:2rem"><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title-center_Hqm8">A user {user} can perform action {action} to/on/in {object types} ... IF {conditions}</span><div class="documentation-card-box-children_i280"></div></div></div></div>Let's look at an example of a simplified Google Drive like system. We'll focus on the feature allowing users to create, read, update, delete, and share documents with other users.<br><br><p>This feature can be described with these sentences:</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-children-mono_WQfY"><ul><li>A user can create a document in a drive if they are the owner of the drive.</li><li>A user can create a folder in a drive if they are the owner of the drive.</li><li>A user can create a document in a folder if they are the owner of the folder. The folder is the parent of the document.</li><li>A user can create a folder in a folder if they are the owner of the folder. The existing folder is the parent of the new folder.</li></ul><hr><ul><li>A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document.</li></ul><hr><ul><li>A user can share a folder with another user or an organization as a viewer if they are an owner of the folder.</li></ul><hr><ul><li>A user can view a document if they are an owner, viewer or editor of the document or if they are a viewer or owner of the folder/drive that is the parent of the document.</li></ul><hr><ul><li>A user can edit a document if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document.</li></ul><hr><ul><li>A user can change the owner of a document if they are an owner of the document.</li></ul><hr><ul><li>A user can change the owner of a folder if they are an owner of the folder.</li></ul><hr><ul><li><p>A user can be a member of an organization.</p><span style="color:gray">How a user is added as a member to an organization is beyond the scope of the feature we picked to write down.</span></li></ul><hr><ul><li>A user can view a folder if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder.</li></ul></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-list-the-object-types">02. List The Object Types<a href="#02-list-the-object-types" class="hash-link" aria-label="Direct link to 02. List The Object Types" title="Direct link to 02. List The Object Types">​</a></h3><p><img loading="lazy" alt="List the object types" src="/assets/images/getting-started-diagram-03-3734cdad8827d03f6a76db672f13be46.svg" width="911" height="188" class="img_ev3q"></p><p>Next make a list of the <a href="/docs/concepts#what-is-a-type">types</a> of objects in your system. You might be able to identify the objects in your system from your existing domain/database model.</p><p>Find all the objects in the previous step using this template:</p><div style="margin-bottom:2rem"><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title-center_Hqm8">A user {user} can perform action {action} to/on/in {object type} ... IF {conditions}</span><div class="documentation-card-box-children_i280"></div></div></div></div><p>These are all the object types from the previous step (in order of appearance) based on that template:</p><div style="margin-top:2rem;margin-bottom:2rem" class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO documentation-card-box-fitcontent_koVg undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-left__zex"><div class="documentation-card-box-icon_ZcC1"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><path d="M24.977 13.087V26a1.996 1.996 0 0 1-1.996 1.996h-9.985A1.996 1.996 0 0 1 11 26V10.01c0-1.103.894-1.997 1.996-1.997h6.993l4.988 5.074Z" fill="#C4C4C4"></path><path d="M24.985 13.055H21.61a1.65 1.65 0 0 1-1.65-1.65V8l5.026 5.055Z" fill="#65676E"></path><path d="M20.993 17h-5.986c-.555 0-1.007.447-1.007 1 0 .552.45 1 1.007 1h5.986c.555 0 1.007-.447 1.007-1 0-.553-.45-1-1.007-1ZM19.05 20h-4.1c-.524 0-.95.447-.95 1 0 .552.425 1 .95 1h4.1c.524 0 .95-.447.95-1 0-.553-.426-1-.95-1Z" fill="#9B9D9F"></path></svg></div><p class="documentation-card-box-icon-label_ctwe">Document</p></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO documentation-card-box-fitcontent_koVg undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-left__zex"><div class="documentation-card-box-icon_ZcC1"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><path d="M25.999 26.013H15.985V10H26a2 2 0 0 1 2 2.001v12.011a2 2 0 0 1-2 2.001Z" fill="#C4C4C4"></path><path d="M10.001 26.013h5.995V10h-5.995A2 2 0 0 0 8 12.001v12.011a2 2 0 0 0 2.001 2.001Z" fill="#65676E"></path><path d="M10.575 13.076a.572.572 0 1 0 0-1.144.572.572 0 0 0 0 1.144Z" fill="#C4C4C4"></path><path d="M12.548 16.008h-2.05a.493.493 0 1 1 0-.986h2.05a.493.493 0 1 1 0 .986ZM12.548 20.016h-2.05a.493.493 0 1 1 0-.986h2.05a.493.493 0 1 1 0 .986ZM13.545 18.011h-3.047a.493.493 0 1 1 0-.986h3.047a.493.493 0 1 1 0 .986Z" fill="#9B9D9F"></path><path d="M11.496 24.015h-.998a.493.493 0 1 1 0-.987h.998a.493.493 0 1 1 0 .987Z" fill="#C4C4C4"></path></svg></div><p class="documentation-card-box-icon-label_ctwe">Folder</p></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO documentation-card-box-fitcontent_koVg undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-left__zex"><div class="documentation-card-box-icon_ZcC1"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><path d="M8.5 11.4c0-1.05.85-1.9 1.9-1.9h8.867c1.049 0 1.9.85 1.9 1.9v14.989H10.4a1.9 1.9 0 0 1-1.9-1.9V11.4Z" fill="#C4C4C4"></path><path d="M21.167 13.722H25.6c1.05 0 1.9.85 1.9 1.9v8.867a1.9 1.9 0 0 1-1.9 1.9h-4.433V13.722Z" fill="#65676E"></path><rect x="11.667" y="12.667" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="11.667" y="16.889" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="11.667" y="21.111" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="15.889" y="12.667" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="15.889" y="16.889" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="23.278" y="16.889" width="2.111" height="2.111" rx="1" fill="#C4C4C4"></rect><rect x="23.278" y="21.111" width="2.111" height="2.111" rx="1" fill="#C4C4C4"></rect><rect x="15.889" y="21.111" width="2.111" height="2.111" rx="1" fill="#65676E"></rect></svg></div><p class="documentation-card-box-icon-label_ctwe">Organization</p></div><div class="documentation-card-box-children_i280"></div></div></div></div><p>Let's highlight all object types in <span class="blue-highlight-text">blue</span>:</p><div style="margin-top:2rem;margin-bottom:2rem"><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-children-mono_WQfY"><ul><li>A user can create a <span class="blue-highlight-text">document</span> in a drive if they are the owner of the drive.</li><li>A user can create a <span class="blue-highlight-text">folder</span> in a drive if they are the owner of the drive.</li><li>A user can create a <span class="blue-highlight-text">document</span> in a folder if they are the owner of the folder.</li><li>A user can create a <span class="blue-highlight-text">folder</span> in a folder if they are the owner of the folder.</li></ul><hr><ul><li>A user can share a <span class="blue-highlight-text">document</span> with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document.</li></ul><hr><ul><li>A user can share a <span class="blue-highlight-text">folder</span> with another user or an organization as a viewer if they are an owner of the folder.</li></ul><hr><ul><li>A user can view a <span class="blue-highlight-text">document</span> if they are an owner, viewer or editor of the document or if they are a viewer, owner of the folder/drive that is the parent of the document.</li></ul><hr><ul><li>A user can edit a <span class="blue-highlight-text">document</span> if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document.</li></ul><hr><ul><li>A user can change the owner of a <span class="blue-highlight-text">document</span> if they are an owner of the document.</li></ul><hr><ul><li>A user can change the owner of a <span class="blue-highlight-text">folder</span> if they are an owner of the folder.</li></ul><hr><ul><li><p>A user can be a member of an <span class="blue-highlight-text">organization</span>.</p><span style="color:gray">How a user is added as a member to an organization is beyond the scope of the feature we picked to write down.</span></li></ul><hr><ul><li>A user can view a <span class="blue-highlight-text">folder</span> if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder.</li></ul></div></div></div></div><p>However, the list of object types is not finished. To complete the list of object types you must also add all the second nouns that appear in conditions as part of expressions of this format: <strong>"{first noun} of a/the {second noun}"</strong>.</p><div style="margin-bottom:2rem"><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title-center_Hqm8">... IF {first noun} of a/the {second noun}</span><div class="documentation-card-box-children_i280"></div></div></div></div><p>Let's highlight those expressions in <span class="green-highlight-text">green</span>:</p><div style="margin-top:2rem;margin-bottom:2rem"><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-children-mono_WQfY"><ul><li>A user can create a document in a drive if they are the <span class="green-highlight-text">owner of the drive</span>.</li><li>A user can create a folder in a drive if they are the <span class="green-highlight-text">owner of the drive</span>.</li><li>A user can create a document in a folder if they are the <span class="green-highlight-text">owner of the folder</span>. The folder is the <span class="green-highlight-text">parent of the document</span>.</li><li>A user can create a folder in a folder if they are the <span class="green-highlight-text">owner of the folder</span>. The existing folder is the <span class="green-highlight-text">parent of the new folder</span> .</li></ul><hr><ul><li>A user can share a document with another user or an organization as either editor or viewer if they are an <span class="green-highlight-text">owner or editor of a document</span> or if they are an <span class="green-highlight-text">owner of the folder/drive</span> that is the <span class="green-highlight-text">parent of the document</span>.</li></ul><hr><ul><li>A user can share a folder with another user or an organization as a viewer if they are an <span class="green-highlight-text">owner of the folder</span>.</li></ul><hr><ul><li>A user can view a document if they are an <span class="green-highlight-text">owner, viewer or editor of the document</span> or if they are a <span class="green-highlight-text">viewer or owner of the folder/drive</span> that is the <span class="green-highlight-text">parent of the document</span>.</li></ul><hr><ul><li>A user can edit a document if they are an <span class="green-highlight-text">owner or editor of the document</span> or if they are an <span class="green-highlight-text">owner of the folder/drive</span> that is the <span class="green-highlight-text">parent of the document</span>.</li></ul><hr><ul><li>A user can change the owner of a document if they are an <span class="green-highlight-text">owner of the document</span>.</li></ul><hr><ul><li>A user can change the owner of a folder if they are an <span class="green-highlight-text">owner of the folder</span>.</li></ul><hr><ul><li><p>A user can be a member of an organization.</p><span style="color:gray">How a user is added as a member to an organization is beyond the scope of the feature we picked to write down.</span></li></ul><hr><ul><li>A user can view a folder if they are the <span class="green-highlight-text">owner of the folder</span>, or a <span class="green-highlight-text">viewer or owner of either the parent folder of the folder, or the parent drive of the folder</span>.</li></ul></div></div></div></div><p>The only second noun we didn't have in our object type list is "Drive", so we'll add it to the list. We will also need to add "User" to the list as it establishes the type of user who can establish relations.</p><div style="margin-top:2rem;margin-bottom:2rem" class="column-layout-5_K6O8"><div class="documentation-card-box_SNqO documentation-card-box-fitcontent_koVg undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-left__zex"><div class="documentation-card-box-icon_ZcC1"></div><p class="documentation-card-box-icon-label_ctwe">User</p></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO documentation-card-box-fitcontent_koVg undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-left__zex"><div class="documentation-card-box-icon_ZcC1"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><path d="M24.977 13.087V26a1.996 1.996 0 0 1-1.996 1.996h-9.985A1.996 1.996 0 0 1 11 26V10.01c0-1.103.894-1.997 1.996-1.997h6.993l4.988 5.074Z" fill="#C4C4C4"></path><path d="M24.985 13.055H21.61a1.65 1.65 0 0 1-1.65-1.65V8l5.026 5.055Z" fill="#65676E"></path><path d="M20.993 17h-5.986c-.555 0-1.007.447-1.007 1 0 .552.45 1 1.007 1h5.986c.555 0 1.007-.447 1.007-1 0-.553-.45-1-1.007-1ZM19.05 20h-4.1c-.524 0-.95.447-.95 1 0 .552.425 1 .95 1h4.1c.524 0 .95-.447.95-1 0-.553-.426-1-.95-1Z" fill="#9B9D9F"></path></svg></div><p class="documentation-card-box-icon-label_ctwe">Document</p></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO documentation-card-box-fitcontent_koVg undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-left__zex"><div class="documentation-card-box-icon_ZcC1"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><path d="M25.999 26.013H15.985V10H26a2 2 0 0 1 2 2.001v12.011a2 2 0 0 1-2 2.001Z" fill="#C4C4C4"></path><path d="M10.001 26.013h5.995V10h-5.995A2 2 0 0 0 8 12.001v12.011a2 2 0 0 0 2.001 2.001Z" fill="#65676E"></path><path d="M10.575 13.076a.572.572 0 1 0 0-1.144.572.572 0 0 0 0 1.144Z" fill="#C4C4C4"></path><path d="M12.548 16.008h-2.05a.493.493 0 1 1 0-.986h2.05a.493.493 0 1 1 0 .986ZM12.548 20.016h-2.05a.493.493 0 1 1 0-.986h2.05a.493.493 0 1 1 0 .986ZM13.545 18.011h-3.047a.493.493 0 1 1 0-.986h3.047a.493.493 0 1 1 0 .986Z" fill="#9B9D9F"></path><path d="M11.496 24.015h-.998a.493.493 0 1 1 0-.987h.998a.493.493 0 1 1 0 .987Z" fill="#C4C4C4"></path></svg></div><p class="documentation-card-box-icon-label_ctwe">Folder</p></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO documentation-card-box-fitcontent_koVg undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-left__zex"><div class="documentation-card-box-icon_ZcC1"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><path d="M8.5 11.4c0-1.05.85-1.9 1.9-1.9h8.867c1.049 0 1.9.85 1.9 1.9v14.989H10.4a1.9 1.9 0 0 1-1.9-1.9V11.4Z" fill="#C4C4C4"></path><path d="M21.167 13.722H25.6c1.05 0 1.9.85 1.9 1.9v8.867a1.9 1.9 0 0 1-1.9 1.9h-4.433V13.722Z" fill="#65676E"></path><rect x="11.667" y="12.667" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="11.667" y="16.889" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="11.667" y="21.111" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="15.889" y="12.667" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="15.889" y="16.889" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="23.278" y="16.889" width="2.111" height="2.111" rx="1" fill="#C4C4C4"></rect><rect x="23.278" y="21.111" width="2.111" height="2.111" rx="1" fill="#C4C4C4"></rect><rect x="15.889" y="21.111" width="2.111" height="2.111" rx="1" fill="#65676E"></rect></svg></div><p class="documentation-card-box-icon-label_ctwe">Organization</p></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO documentation-card-box-fitcontent_koVg undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-left__zex"><div class="documentation-card-box-icon_ZcC1"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><mask id="a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="20" height="19"><path fill="#C4C4C4" d="M8 8.8h20v18.095H8z"></path></mask><g mask="url(#a)"><path d="m18 14.729-3.333-5.714L8 20.443l3.81 5.714L18 14.73Z" fill="#9B9D9F"></path><path d="M21.333 20.443H28L21.758 9.014h-7.091l6.666 11.43Z" fill="#C4C4C4"></path><path d="m14.854 20.443-3.044 5.714 12.992.089L28 20.443H14.854Z" fill="#65676E"></path></g></svg></div><p class="documentation-card-box-icon-label_ctwe">Drive</p></div><div class="documentation-card-box-children_i280"></div></div></div></div><p>Now that we have a list of object types we can start defining them using the <a href="../configuration-language">OpenFGA Configuration Language</a>:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">drive</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Caution</div><div class="admonitionContent_S0QG"><p>You're now in the process of building a version you can use. The model above is not yet a valid authorization model accepted by <!-- -->OpenFGA<!-- -->.</p></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Important</div><div class="admonitionContent_S0QG"><p>In a few cases other users can be part of determining whether an action can be performed on an action or not. Social media is an example of this "a user can comment on a picture if they are a friend of the user that published it".</p><p>In those cases <a href="/docs/modeling/building-blocks/object-to-object-relationships"><strong>User</strong> should also be an object type</a>. Following the last recommendation, we would discover the User type because it is a second noun in an expression: "friend of the user".</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-list-relations-for-those-types">03. List Relations For Those Types<a href="#03-list-relations-for-those-types" class="hash-link" aria-label="Direct link to 03. List Relations For Those Types" title="Direct link to 03. List Relations For Those Types">​</a></h3><p><img loading="lazy" alt="List relations for those types" src="/assets/images/getting-started-diagram-04-e8b2110197173b6308a3f797e76aa471.svg" width="911" height="188" class="img_ev3q"></p><p>Each of the previously defined types has a set of relations. <a href="/docs/concepts#what-is-a-relation">Relations</a> are an important component in your model. After all, <!-- -->OpenFGA<!-- --> is a <a href="/docs/authorization-and-openfga#what-is-relationship-based-access-control-rebac">Relationship Based Access Control (ReBAC)</a> system.</p><p>To identify relations for a type we in the write-up we can perform an exercise similar to the one we did in <a href="#02-list-the-object-types">list the type of objects in your system</a>.</p><p>Relations for a type {type} will be all of these:</p><ul><li>any noun that is the {noun} of a "{noun} of a/an/the {type}" expression. <strong>These are typically the Foreign Keys in a database.</strong> We'll highlight these in <span class="green-highlight-text">green</span>.</li><li>any verb or action that is the {action} of a "can {action} (in) a/an {type}" expression. <strong>These are typically the permissions for a type.</strong> We'll highlight these in <span class="yellow-highlight-text">yellow</span>.</li></ul><div style="margin-top:2rem;margin-bottom:2rem"><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-children-mono_WQfY"><ul><li>A user <span class="yellow-highlight-text">can create a document in a drive</span> if they are the <span class="green-highlight-text">owner of the drive</span>.</li><li>A user <span class="yellow-highlight-text">can create a folder in a drive</span> if they are the <span class="green-highlight-text">owner of the drive</span>.</li><li>A user <span class="yellow-highlight-text">can create a document in a folder</span> if they are the <span class="green-highlight-text">owner of the folder</span>. The folder is the <span class="green-highlight-text">parent of the document</span>.</li><li>A user <span class="yellow-highlight-text">can create a folder in a folder</span> if they are the <span class="green-highlight-text">owner of the folder</span>. The existing folder is the <span class="green-highlight-text">parent of the new folder</span>.</li></ul><hr><ul><li>A user <span class="yellow-highlight-text">can share a document with another user or an organization</span> as either editor or viewer if they are an <span class="green-highlight-text">owner or editor of a document</span> or if they are an <span class="green-highlight-text">owner of the folder/drive</span> that is the <span class="green-highlight-text">parent of the document</span>.</li></ul><hr><ul><li>A user <span class="yellow-highlight-text">can share a folder with another user or an organization</span> as a viewer if they are an <span class="green-highlight-text">owner of the folder</span>.</li></ul><hr><ul><li>A user <span class="yellow-highlight-text">can view a document</span> if they are an <span class="green-highlight-text">owner, viewer or editor of the document</span> or if they are a <span class="green-highlight-text">viewer or owner of the folder/drive</span> that is the <span class="green-highlight-text">parent of the document</span>.</li></ul><hr><ul><li>A user <span class="yellow-highlight-text">can edit a document</span> if they are an <span class="green-highlight-text">owner or editor of the document</span> or if they are an <span class="green-highlight-text">owner of the folder/drive</span> that is the <span class="green-highlight-text">parent of the document</span>.</li></ul><hr><ul><li>A user <span class="yellow-highlight-text">can change the owner of a document</span> if they are an <span class="green-highlight-text">owner of the document</span>.</li></ul><hr><ul><li>A user <span class="yellow-highlight-text">can change the owner of a folder</span> if they are an <span class="green-highlight-text">owner of the folder</span>.</li></ul><hr><ul><li><p>A user <span class="yellow-highlight-text">can be a member of an organization</span>.</p><span style="color:gray">How a user is added as a member to an organization is beyond the scope of the feature we picked to write down.</span></li></ul><hr><ul><li>A user <span class="yellow-highlight-text">can view a folder</span> if they are the <span class="green-highlight-text">owner of the folder</span>, or a <span class="green-highlight-text">viewer or owner of either the parent folder of the folder, or the parent drive of the folder</span>.</li></ul></div></div></div></div><p>The resulting list is:</p><div style="margin-top:2rem;margin-bottom:2rem" class="column-layout-4-equal-width_WOGz"><div class="documentation-card-box_SNqO false undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-center_zUxy"><div class="documentation-card-box-icon_ZcC1"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><path d="M24.977 13.087V26a1.996 1.996 0 0 1-1.996 1.996h-9.985A1.996 1.996 0 0 1 11 26V10.01c0-1.103.894-1.997 1.996-1.997h6.993l4.988 5.074Z" fill="#C4C4C4"></path><path d="M24.985 13.055H21.61a1.65 1.65 0 0 1-1.65-1.65V8l5.026 5.055Z" fill="#65676E"></path><path d="M20.993 17h-5.986c-.555 0-1.007.447-1.007 1 0 .552.45 1 1.007 1h5.986c.555 0 1.007-.447 1.007-1 0-.553-.45-1-1.007-1ZM19.05 20h-4.1c-.524 0-.95.447-.95 1 0 .552.425 1 .95 1h4.1c.524 0 .95-.447.95-1 0-.553-.426-1-.95-1Z" fill="#9B9D9F"></path></svg></div><p class="documentation-card-box-icon-label_ctwe">Document</p></div><div class="documentation-card-box-children-small_Bayp"><ul><li>parent</li><li>can_share</li><li>owner</li><li>editor</li><li>can_write</li><li>can_view</li><li>viewer</li><li>can_change_owner</li></ul></div></div></div><div class="documentation-card-box_SNqO false undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-center_zUxy"><div class="documentation-card-box-icon_ZcC1"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><path d="M25.999 26.013H15.985V10H26a2 2 0 0 1 2 2.001v12.011a2 2 0 0 1-2 2.001Z" fill="#C4C4C4"></path><path d="M10.001 26.013h5.995V10h-5.995A2 2 0 0 0 8 12.001v12.011a2 2 0 0 0 2.001 2.001Z" fill="#65676E"></path><path d="M10.575 13.076a.572.572 0 1 0 0-1.144.572.572 0 0 0 0 1.144Z" fill="#C4C4C4"></path><path d="M12.548 16.008h-2.05a.493.493 0 1 1 0-.986h2.05a.493.493 0 1 1 0 .986ZM12.548 20.016h-2.05a.493.493 0 1 1 0-.986h2.05a.493.493 0 1 1 0 .986ZM13.545 18.011h-3.047a.493.493 0 1 1 0-.986h3.047a.493.493 0 1 1 0 .986Z" fill="#9B9D9F"></path><path d="M11.496 24.015h-.998a.493.493 0 1 1 0-.987h.998a.493.493 0 1 1 0 .987Z" fill="#C4C4C4"></path></svg></div><p class="documentation-card-box-icon-label_ctwe">Folder</p></div><div class="documentation-card-box-children-small_Bayp"><ul><li>can_create_document</li><li>owner</li><li>can_create_folder</li><li>can_view</li><li>viewer</li><li>parent</li></ul></div></div></div><div class="documentation-card-box_SNqO false undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-center_zUxy"><div class="documentation-card-box-icon_ZcC1"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><path d="M8.5 11.4c0-1.05.85-1.9 1.9-1.9h8.867c1.049 0 1.9.85 1.9 1.9v14.989H10.4a1.9 1.9 0 0 1-1.9-1.9V11.4Z" fill="#C4C4C4"></path><path d="M21.167 13.722H25.6c1.05 0 1.9.85 1.9 1.9v8.867a1.9 1.9 0 0 1-1.9 1.9h-4.433V13.722Z" fill="#65676E"></path><rect x="11.667" y="12.667" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="11.667" y="16.889" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="11.667" y="21.111" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="15.889" y="12.667" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="15.889" y="16.889" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="23.278" y="16.889" width="2.111" height="2.111" rx="1" fill="#C4C4C4"></rect><rect x="23.278" y="21.111" width="2.111" height="2.111" rx="1" fill="#C4C4C4"></rect><rect x="15.889" y="21.111" width="2.111" height="2.111" rx="1" fill="#65676E"></rect></svg></div><p class="documentation-card-box-icon-label_ctwe">Organization</p></div><div class="documentation-card-box-children-small_Bayp"><ul><li>member</li></ul></div></div></div><div class="documentation-card-box_SNqO false undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-center_zUxy"><div class="documentation-card-box-icon_ZcC1"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><mask id="a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="20" height="19"><path fill="#C4C4C4" d="M8 8.8h20v18.095H8z"></path></mask><g mask="url(#a)"><path d="m18 14.729-3.333-5.714L8 20.443l3.81 5.714L18 14.73Z" fill="#9B9D9F"></path><path d="M21.333 20.443H28L21.758 9.014h-7.091l6.666 11.43Z" fill="#C4C4C4"></path><path d="m14.854 20.443-3.044 5.714 12.992.089L28 20.443H14.854Z" fill="#65676E"></path></g></svg></div><p class="documentation-card-box-icon-label_ctwe">Drive</p></div><div class="documentation-card-box-children-small_Bayp"><ul><li>can_create_document</li><li>owner</li><li>can_create_folder</li></ul></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>In <!-- -->OpenFGA<!-- -->, relations can only have alphanumeric characters, underscores and hyphens. We recommend using underscore (<!-- -->_<!-- -->) to separate words and removing prepositions. E.g.: "can create a document" can become "can_create_document" or "create_document" if you are into brevity.</p></div></div><p>Using the <a href="../configuration-language">OpenFGA Configuration Language</a> we can enumerate the relations for each type:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_share</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_write</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_change_owner</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_create_folder</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_create_document</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">drive</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_create_document</span><span class="token plain">:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_create_folder</span><span class="token plain">:</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Caution</div><div class="admonitionContent_S0QG"><p>You're now in the process of building a version you can use. The model above is not yet a valid authorization model accepted by <!-- -->OpenFGA<!-- -->.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="04-define-relations">04. Define Relations<a href="#04-define-relations" class="hash-link" aria-label="Direct link to 04. Define Relations" title="Direct link to 04. Define Relations">​</a></h3><p><img loading="lazy" alt="Define relations" src="/assets/images/getting-started-diagram-05-ffffd65d9b3eb843353c35f2f663a0c5.svg" width="911" height="188" class="img_ev3q"></p><p>We will use the <a href="../configuration-language">OpenFGA Configuration Language</a> to create a <a href="/docs/concepts#what-is-a-relation">relation definition</a> for each of the relations we identified. At this stage we will encode the answers to the question we asked at the beginning of the document:.</p><div style="margin-bottom:2rem"><div class="documentation-card-box_SNqO documentation-card-box-fitcontent_koVg undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-left__zex"><div class="documentation-card-box-icon-large_nsCS"><svg width="106" height="106" viewBox="0 0 106 106" fill="none" xmlns="http://www.w3.org/2000/svg"><rect y="0.026" width="105.948" height="105.948" rx="20.252" fill="#BEC4CE"></rect><path d="M64.013 73.904c-7.832 0-14.18-6.349-14.18-14.18 0-7.832 6.348-14.18 14.18-14.18s14.18 6.348 14.18 14.18c0 7.831-6.348 14.18-14.18 14.18Z" fill="#2D2D37"></path><path d="M31.194 12.758h44.687c7.813 0 14.145 6.347 14.145 14.177v.006c0 7.83-6.332 14.177-14.145 14.177H31.194c-7.812 0-14.145-6.347-14.145-14.177v-.006c0-7.83 6.333-14.177 14.145-14.177Z" fill="url(#a)"></path><path d="M45.408 26.903v52.166c0 7.812-6.347 14.145-14.178 14.145h-.005c-7.83 0-14.178-6.333-14.178-14.145V26.903c0-7.812 6.348-14.145 14.178-14.145h.005c7.83 0 14.178 6.333 14.178 14.145Z" fill="url(#b)"></path><path d="M31.228 93.243c-7.832 0-14.18-6.35-14.18-14.181 0-7.832 6.348-14.18 14.18-14.18 7.831 0 14.18 6.348 14.18 14.18s-6.349 14.18-14.18 14.18Z" fill="#fff"></path><path d="M64.03 73.938c7.832 0 14.18-6.35 14.18-14.18 0-7.833-6.348-14.181-14.18-14.181s-14.18 6.349-14.18 14.18c0 7.832 6.348 14.18 14.18 14.18Z" fill="#000"></path><defs><linearGradient id="a" x1="90.016" y1="26.938" x2="17.04" y2="26.938" gradientUnits="userSpaceOnUse"><stop stop-color="#635DFF"></stop><stop offset="1" stop-color="#3885FF"></stop></linearGradient><linearGradient id="b" x1="31.228" y1="93.217" x2="31.228" y2="12.762" gradientUnits="userSpaceOnUse"><stop stop-color="#FF4F40"></stop><stop offset="1" stop-color="#F4D"></stop></linearGradient></defs></svg></div><span class="documentation-card-box-icon-title_zmVE">Why could a user U, perform an action A on an object O?</span></div><div class="documentation-card-box-children_i280"></div></div></div></div><p>We are going to go over each type and each of its relations and create a definition for it.</p><div style="display:inline-block"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><path d="M8.5 11.4c0-1.05.85-1.9 1.9-1.9h8.867c1.049 0 1.9.85 1.9 1.9v14.989H10.4a1.9 1.9 0 0 1-1.9-1.9V11.4Z" fill="#C4C4C4"></path><path d="M21.167 13.722H25.6c1.05 0 1.9.85 1.9 1.9v8.867a1.9 1.9 0 0 1-1.9 1.9h-4.433V13.722Z" fill="#65676E"></path><rect x="11.667" y="12.667" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="11.667" y="16.889" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="11.667" y="21.111" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="15.889" y="12.667" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="15.889" y="16.889" width="2.111" height="2.111" rx="1" fill="#65676E"></rect><rect x="23.278" y="16.889" width="2.111" height="2.111" rx="1" fill="#C4C4C4"></rect><rect x="23.278" y="21.111" width="2.111" height="2.111" rx="1" fill="#C4C4C4"></rect><rect x="15.889" y="21.111" width="2.111" height="2.111" rx="1" fill="#65676E"></rect></svg><div style="float:right;margin-left:16px"><h4 class="anchor anchorWithStickyNavbar_LWe7" id="type-organization">Type: Organization<a href="#type-organization" class="hash-link" aria-label="Direct link to Type: Organization" title="Direct link to Type: Organization">​</a></h4></div></div><p>We recommend starting from objects that represent groups/containers of users. For features in most systems these are easy to define and help reason about the other types. Examples of type names for these are "team", "group", "organization", etc.</p><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-member">Relation: Member<a href="#relation-member" class="hash-link" aria-label="Direct link to Relation: Member" title="Direct link to Relation: Member">​</a></h5><p>The member relation is used to tell <!-- -->OpenFGA<!-- --> about the members of an organization.</p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Important</div><div class="admonitionContent_S0QG"><p>Relation names in <!-- -->OpenFGA<!-- --> are arbitrary strings. There are no reserved relation names. You can use "member" or "part_of" or anything else to refer to a user that is part of a team/organization.</p></div></div><p>Remember <em>"How a user is added as a member to an organization is beyond the scope of this feature."</em> For the purposes of this model the relation definition should be:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Why? This relation definition states:</p><ul><li><p>That organizations have members</p></li><li><p>That the members of an organization with id {id} are all users described by tuples of the form:</p><p><code>{ user: {user-id}, relation: "member", object: "organization:{id}" }</code></p></li></ul><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Important</div><div class="admonitionContent_S0QG"><p>Relation definitions of the form “define {relation}: <!-- -->[user, organization#member]<!-- -->" are fairly common. They are used to express that relationships "to the object with that relation" (e.g. "users" of type user or "member of organization") can be assigned by your system and that only the users that have that relation are those with a <a href="/docs/modeling/building-blocks/direct-relationships">direct relationship</a>.</p></div></div><p>You can read more about group membership and types in <a href="/docs/modeling/user-groups">Modeling User Groups</a>.</p><p>For the direct relationships, we need to figure out the object types that makes sense for the relationship tuples' user. In our organization example, it makes sense for member relations to have user of type</p><ul><li>user</li><li>organization#member (i.e., other organization's member)</li></ul><p>However, it will not make sense for organization member's user to be of type document, folder or drive.</p><p>We will specify this logic as part of directly <a href="/docs/concepts#what-is-a-directly-related-user-type">directly related user type</a>.</p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>Side note</div><div class="admonitionContent_S0QG"><p>This also automatically supports nested organizational membership if you want such a feature in your system. You could use relationship tuples like the following one to express that "members of organization A are members of organization B":</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">{ user: "organization:A#member", relation: "member", object: "organization:B"}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If you want to learn more, you can read further about this in <a href="/docs/modeling/user-groups">Modeling User Groups</a> and <a href="/docs/interacting/managing-relationships-between-objects">Managing Relationships Between Objects</a>.</p></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="complete-type-definition">Complete Type Definition<a href="#complete-type-definition" class="hash-link" aria-label="Direct link to Complete Type Definition" title="Direct link to Complete Type Definition">​</a></h5><p>The complete <a href="/docs/concepts#what-is-a-type-definition">type definition</a> for the <strong>organization</strong> type is:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div style="display:inline-block"><svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="36" height="36" rx="6.42" fill="#EFF0F2"></rect><path d="M24.977 13.087V26a1.996 1.996 0 0 1-1.996 1.996h-9.985A1.996 1.996 0 0 1 11 26V10.01c0-1.103.894-1.997 1.996-1.997h6.993l4.988 5.074Z" fill="#C4C4C4"></path><path d="M24.985 13.055H21.61a1.65 1.65 0 0 1-1.65-1.65V8l5.026 5.055Z" fill="#65676E"></path><path d="M20.993 17h-5.986c-.555 0-1.007.447-1.007 1 0 .552.45 1 1.007 1h5.986c.555 0 1.007-.447 1.007-1 0-.553-.45-1-1.007-1ZM19.05 20h-4.1c-.524 0-.95.447-.95 1 0 .552.425 1 .95 1h4.1c.524 0 .95-.447.95-1 0-.553-.426-1-.95-1Z" fill="#9B9D9F"></path></svg><div style="float:right;margin-left:16px"><h4 class="anchor anchorWithStickyNavbar_LWe7" id="type-document">Type: Document<a href="#type-document" class="hash-link" aria-label="Direct link to Type: Document" title="Direct link to Type: Document">​</a></h4></div></div><p>After defining your "group" like types, continue with the most important type for the feature: the one that allows the main use case. In this case "document", since the main use case for users is to create, write, read and collaborate on documents.</p><p>Defining relations for the main type lets you to focus on your core use case, and will likely make other type definitions easier.</p><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-owner">Relation: Owner<a href="#relation-owner" class="hash-link" aria-label="Direct link to Relation: Owner" title="Direct link to Relation: Owner">​</a></h5><p>The owner relation is used to tell <!-- -->OpenFGA<!-- --> which users are owners of the document.</p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Important</div><div class="admonitionContent_S0QG"><p>In the current version, there is no way to state that there is only one owner in the authorization model. The application must limit this <a href="/docs/concepts#what-is-a-user">set of users</a> to just one owner if that is a requirement.</p></div></div><p>When a document is created, a relationship tuple will be stored in <!-- -->OpenFGA<!-- --> representing this relationship between owner and document. This is an example of a <a href="/docs/modeling/direct-access">user to object relationship</a>.</p><p>The relation definition then should be:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Why? This <a href="/docs/concepts#what-is-a-relation">relation definition</a> states that:</p><ul><li>each document can have one or more owners</li><li>owners of a document are assignable by creating a tuple of the format <code>{ user: "{user_id}", relation: "owner", object: "document:{id}" }</code> for individual users</li></ul><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-editor">Relation: Editor<a href="#relation-editor" class="hash-link" aria-label="Direct link to Relation: Editor" title="Direct link to Relation: Editor">​</a></h5><p>The editor relation is used to tell <!-- -->OpenFGA<!-- --> which users are editors of the document.</p><p>When a user shares a document with another user or set of users as editor, a relationship tuple will be stored in <!-- -->OpenFGA<!-- --> representing this relationship between editor and document. This is an example of a <a href="/docs/modeling/direct-access">users to object relationship</a>.</p><p>The relation definition then should be:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Why? This relation definition states that:</p><ul><li>each document can have editors</li><li>the editor(s) of a document are assignable by creating a tuple with shape -<code>{ user: "{user_id}", relation: "editor", object: "document:{id}" }</code> for individual users</li></ul><p>This also supports making all members in an organization editors of the document, through a <a href="/docs/modeling/user-groups">group to object relationship</a>. A relationship tuple like the following one states that the members of organization A are editors of document 0001.</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:0001"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>You can learn more about this in <a href="/docs/modeling/user-groups">Modeling User Groups</a>.</p><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-viewer">Relation: Viewer<a href="#relation-viewer" class="hash-link" aria-label="Direct link to Relation: Viewer" title="Direct link to Relation: Viewer">​</a></h5><p>The viewer relation is similar to the document's <a href="#relation-editor">editor relation</a>. It will be defined like this:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-parent">Relation: Parent<a href="#relation-parent" class="hash-link" aria-label="Direct link to Relation: Parent" title="Direct link to Relation: Parent">​</a></h5><p>The parent relation is used to tell <!-- -->OpenFGA<!-- --> which folder or drive is the parent of the document.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Important</div><div class="admonitionContent_S0QG"><p>Relation names in <!-- -->OpenFGA<!-- --> are arbitrary strings. There are no reserved relation names. You can use "parent", "container" or "ancestor" to refer to a "parent folder".</p></div></div><p>This relation is different from the others we have seen so far, as it is a relation between two objects (a <strong>folder</strong> and or <strong>drive</strong> that is the parent of the <strong>document</strong>). This is known as an <a href="/docs/modeling/building-blocks/object-to-object-relationships">object to object relationship</a>, of which <a href="/docs/modeling/parent-child">parent-child is a particular case</a>.</p><p>When a document is created a relationship tuple will be stored in <!-- -->OpenFGA<!-- --> to represent this relationship between parent and document. The relation definition then should be:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder, drive]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Why? This relation definition states that:</p><ul><li>documents may have a parent</li><li>the parent(s) of a document with id {id} is either a folder or a drive, described by one of these relationship tuples:<ul><li><code>{ user: "folder:{id}", relation: "parent", object: "document:{id}" }</code></li><li><code>{ user: "drive:{id}", relation: "parent", object: "document:{id}" }</code></li></ul></li></ul><p>We can use <a href="/docs/configuration-language#the-direct-relationship-type-restrictions">direct type restriction</a> to ensure a document's parent can only be an object of type either drive or folder.</p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>Side note</div><div class="admonitionContent_S0QG"><p>You might have noticed that the "user" in the tuple is an object. This is a special syntax <!-- -->OpenFGA<!-- --> accepts in the "user" parameter to write <a href="/docs/modeling/building-blocks/object-to-object-relationships">object to object relationships</a>. You can read more about writing data to manage object to object relationships in <a href="/docs/interacting/managing-relationships-between-objects">Managing Relationships Between Objects</a>.</p></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-can_share">Relation: can_share<a href="#relation-can_share" class="hash-link" aria-label="Direct link to Relation: can_share" title="Direct link to Relation: can_share">​</a></h5><p>We need to express the following in the <a href="/docs/concepts#what-is-a-relation">relation definition</a>:</p><p><em>A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder that is the parent of the document.</em></p><p>We can achieve that with the following definition using <a href="../configuration-language">OpenFGA Configuration Language</a>:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>There are a few key things here:</p><ul><li><strong>We don't use a <a href="/docs/configuration-language#the-direct-relationship-type-restrictions">direct relationship type restriction</a> as part of the definition.</strong> can_share is a common example of representing a permission that is defined in terms of other relations but is not directly assignable by the system.</li><li>The relation definition contains a <a href="/docs/configuration-language#the-union-operator">union operator</a> separating a list of relations that the user must have with the object in order to "be able to share the document". It is any of:<ul><li>Being an owner of the document</li><li>Being an editor of the document</li><li>Being an owner of the parent of the document. Whether the parent is a drive or a folder is not important, as they both have an owner relation.</li></ul></li></ul><p>You can read more about the aforementioned items in <a href="/docs/modeling/roles-and-permissions">Modeling Roles and Permissions</a>.</p><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-can_view">Relation: can_view<a href="#relation-can_view" class="hash-link" aria-label="Direct link to Relation: can_view" title="Direct link to Relation: can_view">​</a></h5><p>We need to express the following in the <a href="/docs/concepts#what-is-a-relation">relation definition</a>:</p><p><em>A user can view a document if they are an owner, viewer or editor of a document or if they are a viewer, owner of the folder/drive that is the parent of the document.</em></p><p>Similar to the <a href="#relation-can_share">can_share relation</a>, we can achieve that with the following definition using <a href="../configuration-language">OpenFGA Configuration Language</a>:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-can_write">Relation: can_write<a href="#relation-can_write" class="hash-link" aria-label="Direct link to Relation: can_write" title="Direct link to Relation: can_write">​</a></h5><p>We need to express the following in the <a href="/docs/concepts#what-is-a-relation">relation definition</a>:</p><p><em>A user can write a document if they are an owner or editor of a document or if they are an owner or editor of the folder/drive that is the parent of the document.</em></p><p>Similar to the <a href="#relation-can_share">can_share relation</a>, we can achieve that with the following definition using <a href="../configuration-language">OpenFGA Configuration Language</a>:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-can_change_owner">Relation: can_change_owner<a href="#relation-can_change_owner" class="hash-link" aria-label="Direct link to Relation: can_change_owner" title="Direct link to Relation: can_change_owner">​</a></h5><p>We need to express the following in the <a href="/docs/concepts#what-is-a-relation">relation definition</a>:</p><p><em>A user can change the owner of a document if they are an owner of the document.</em></p><p>Similar to the <a href="#relation-can_share">can_share relation</a>, we can achieve that with the following definition using <a href="../configuration-language">OpenFGA Configuration Language</a>:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">undefined</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="complete-type-definition-1">Complete Type Definition<a href="#complete-type-definition-1" class="hash-link" aria-label="Direct link to Complete Type Definition" title="Direct link to Complete Type Definition">​</a></h5><p>The complete <a href="/docs/concepts#what-is-a-type-definition">type definition</a> for the document type is:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_share</span><span class="token plain">: owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_write</span><span class="token plain">: editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_change_owner</span><span class="token plain">: owner</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Combining the type definitions for document and organization, we have</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_share</span><span class="token plain">: owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_write</span><span class="token plain">: editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_change_owner</span><span class="token plain">: owner</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>The <!-- -->OpenFGA<!-- --> authorization model API and SDK only accepts JSON in its input. To convert from DSL to JSON, you may use the <a href="https://github.com/openfga/cli" target="_blank" rel="noopener noreferrer">FGA CLI</a> to run <code>fga model transform</code>.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="05-test-the-model">05. Test The Model<a href="#05-test-the-model" class="hash-link" aria-label="Direct link to 05. Test The Model" title="Direct link to 05. Test The Model">​</a></h3><p><img loading="lazy" alt="Test the model" src="/assets/images/getting-started-diagram-06-8eb4b8f4a925670b0ff05fa86c4b890e.svg" width="911" height="188" class="img_ev3q"></p><p>Once you have defined your group like types and the most important type for your feature you want to ensure everything is working as expected. This means testing the model.</p><p>How? Remember from the introduction that <strong>OpenFGA<!-- -->'s</strong> main job is to answer the question:</p><div style="margin-top:2rem;margin-bottom:2rem"><div class="documentation-card-box_SNqO documentation-card-box-fitcontent_koVg undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-left__zex"><div class="documentation-card-box-icon-large_nsCS"><svg width="106" height="106" viewBox="0 0 106 106" fill="none" xmlns="http://www.w3.org/2000/svg"><rect y="0.026" width="105.948" height="105.948" rx="20.252" fill="#BEC4CE"></rect><path d="M64.013 73.904c-7.832 0-14.18-6.349-14.18-14.18 0-7.832 6.348-14.18 14.18-14.18s14.18 6.348 14.18 14.18c0 7.831-6.348 14.18-14.18 14.18Z" fill="#2D2D37"></path><path d="M31.194 12.758h44.687c7.813 0 14.145 6.347 14.145 14.177v.006c0 7.83-6.332 14.177-14.145 14.177H31.194c-7.812 0-14.145-6.347-14.145-14.177v-.006c0-7.83 6.333-14.177 14.145-14.177Z" fill="url(#a)"></path><path d="M45.408 26.903v52.166c0 7.812-6.347 14.145-14.178 14.145h-.005c-7.83 0-14.178-6.333-14.178-14.145V26.903c0-7.812 6.348-14.145 14.178-14.145h.005c7.83 0 14.178 6.333 14.178 14.145Z" fill="url(#b)"></path><path d="M31.228 93.243c-7.832 0-14.18-6.35-14.18-14.181 0-7.832 6.348-14.18 14.18-14.18 7.831 0 14.18 6.348 14.18 14.18s-6.349 14.18-14.18 14.18Z" fill="#fff"></path><path d="M64.03 73.938c7.832 0 14.18-6.35 14.18-14.18 0-7.833-6.348-14.181-14.18-14.181s-14.18 6.349-14.18 14.18c0 7.832 6.348 14.18 14.18 14.18Z" fill="#000"></path><defs><linearGradient id="a" x1="90.016" y1="26.938" x2="17.04" y2="26.938" gradientUnits="userSpaceOnUse"><stop stop-color="#635DFF"></stop><stop offset="1" stop-color="#3885FF"></stop></linearGradient><linearGradient id="b" x1="31.228" y1="93.217" x2="31.228" y2="12.762" gradientUnits="userSpaceOnUse"><stop stop-color="#FF4F40"></stop><stop offset="1" stop-color="#F4D"></stop></linearGradient></defs></svg></div><span class="documentation-card-box-icon-title_zmVE">Can user U, perform an action A on an object O?</span></div><div class="documentation-card-box-children_i280"></div></div></div></div><p>The <!-- -->OpenFGA<!-- --> service does that by checking if a user has a particular relationship to an object, based on your authorization model and relationship tuples.</p><div style="margin-top:2rem;margin-bottom:2rem" class="column-layout-2_O2db"><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">General Authorization Check</span><p>"Can user <b>U</b> <u>perform action</u> <b>A</b> on object <b>O</b>?"</p><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA (ReBAC) Authorization Check</span><p>"Can user <b>U</b> <u>have relation</u> <b>R</b> with object <b>O</b>?"</p><div class="documentation-card-box-children_i280"></div></div></div></div><p>What we want is to ensure that given our current authorization model and some sample relationship tuples, we get the expected results for those questions.</p><p>So we'll write some relationship tuples and assertions. An <!-- -->OpenFGA<!-- --> assertion takes one of these forms:</p><ol><li>user U <strong>has</strong> relation R with object O</li><li>user U <strong>does not have</strong> relation R with object O</li></ol><p>Much like automated tests and assertions work for programming languages, you can use assertions to prevent regressions while you change your tuples and authorization model. Essentially, assertions help you ensure things work like you expect them to work as you iterate.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="write-relationship-tuples">Write Relationship Tuples<a href="#write-relationship-tuples" class="hash-link" aria-label="Direct link to Write Relationship Tuples" title="Direct link to Write Relationship Tuples">​</a></h4><p>The relationship tuples should represent real examples from your system with fake data.</p><p>At this point you haven't defined the drive or folder types, so you can only test things based on users or organization members' relationships to documents. Let's imagine an example setup and write the relationship tuples for it:</p><table><thead><tr><th>System Action</th><th>Relationship Tuple</th></tr></thead><tbody><tr><td>Anne is a member of the contoso organization</td><td><code>{ user:"user:anne", relation: "member", object: "organization:contoso"}</code></td></tr><tr><td>Beth is a member of fabrikam organization</td><td><code>{ user:"user:beth", relation: "member", object: "organization:fabrikam"}</code></td></tr><tr><td>Anne creates document:1, becomes its owner.</td><td><code>{ user:"user:anne", relation: "owner", object: "document:1"}</code></td></tr><tr><td>Anne shares document:1 with all members of the fabrikam organization as editor.</td><td><code>{ user:"organization:fabrikam#member", relation: "editor", object: "document:1"}</code></td></tr><tr><td>Beth creates document:2 and becomes its owner.</td><td><code>{ user:"user:beth", relation: "owner", object: "document:2"}</code></td></tr><tr><td>Beth shares document:2 with all members of the contoso organization as viewer</td><td><code>{ user:"organization:contoso#member", relation: "viewer", object: "document:2"}</code></td></tr></tbody></table><p>Follow these steps to create relationship tuples.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="create-assertions">Create Assertions<a href="#create-assertions" class="hash-link" aria-label="Direct link to Create Assertions" title="Direct link to Create Assertions">​</a></h4><p>According to our <a href="#write-it-in-plain-language">written down model</a> and the <a href="#write-relationship-tuples">relationship tuples</a> from the previous step, these assertions should be specified:</p><p>Because anne is the owner of document:1:</p><ul><li>user <strong>anne</strong> has relation <strong>can_share</strong> with document:1</li><li>user <strong>anne</strong> has relation <strong>can_write</strong> with document:1</li><li>user <strong>anne</strong> has relation <strong>can_view</strong> with document:1</li><li>user <strong>anne</strong> has relation <strong>can_change_owner</strong> with document:1</li></ul><p>Because beth is a member of organization:fabrikam and members of organization:fabrikam are writer of document:1:</p><ul><li>user <strong>beth</strong> does not have relation <strong>can_share</strong> with document:1</li><li>user <strong>beth</strong> has relation <strong>can_write</strong> with document:1</li><li>user <strong>beth</strong> has relation <strong>can_view</strong> with document:1</li><li>user <strong>beth</strong> does not have relation <strong>can_change_owner</strong> with document:1</li></ul><p>Because beth is the owner of document:2:</p><ul><li>user <strong>beth</strong> has relation <strong>can_share</strong> with document:2</li><li>user <strong>beth</strong> has relation <strong>can_write</strong> with document:2</li><li>user <strong>beth</strong> has relation <strong>can_view</strong> with document:2</li><li>user <strong>beth</strong> has relation <strong>can_change_owner</strong> with document:2</li></ul><p>Because anne is a member of organization:contoso and members of organization:contoso are viewer of document:2:</p><ul><li>user <strong>anne</strong> does not have relation <strong>can_share</strong> with document:2</li><li>user <strong>anne</strong> does not have relation <strong>can_write</strong> with document:2</li><li>user <strong>anne</strong> has relation <strong>can_view</strong> with document:2</li><li>user <strong>anne</strong> does not have relation <strong>can_change_owner</strong> with document:2</li></ul><p>Follow these steps to create assertions.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="run-assertions">Run Assertions<a href="#run-assertions" class="hash-link" aria-label="Direct link to Run Assertions" title="Direct link to Run Assertions">​</a></h4><p>Run the assertions. They should all pass. If they don't you can use the query view to understand what is causing them to fail, and then update your authorization model and relation tuples accordingly.</p><p>Once all the assertions are working, you should continue the iterative process of working on your model.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="06-iterate">06. Iterate<a href="#06-iterate" class="hash-link" aria-label="Direct link to 06. Iterate" title="Direct link to 06. Iterate">​</a></h3><p><img loading="lazy" alt="Iterate" src="/assets/images/getting-started-diagram-07-110858004c2892e28df4c404a50abce2.svg" width="911" height="208" class="img_ev3q"></p><p>We'll leave the exercise of defining the drive and folder relations, then adding relationship tuples and assertions to you. Once you are finished, check out the complete example to see how you did.</p><p>When defining the authorization model for your own system, you would continue iterating on the <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a> with the <a href="#01-pick-the-most-important-feature">next feature</a> and so on.</p><p>If you have any questions about this model or others, or would like some help creating your model, drop by our <a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer">Discord</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to model with OpenFGA.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA Concepts</span><p class="documentation-card-box-description_u7_j">Learn about the OpenFGA Concepts.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/concepts">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Configuration Language</span><p class="documentation-card-box-description_u7_j">Learn about OpenFGA Configuration Language.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/configuration-language">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Direct Access</span><p class="documentation-card-box-description_u7_j">Learn about modeling user access to an object.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/direct-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/getting-started.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Modeling Guides</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/direct-access"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Direct Access</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#introduction-to-modeling" class="table-of-contents__link toc-highlight">Introduction To Modeling</a></li><li><a href="#a-process-for-defining-authorization-models" class="table-of-contents__link toc-highlight">A Process For Defining Authorization Models</a><ul><li><a href="#01-pick-the-most-important-feature" class="table-of-contents__link toc-highlight">01. Pick The Most Important Feature</a></li><li><a href="#02-list-the-object-types" class="table-of-contents__link toc-highlight">02. List The Object Types</a></li><li><a href="#03-list-relations-for-those-types" class="table-of-contents__link toc-highlight">03. List Relations For Those Types</a></li><li><a href="#04-define-relations" class="table-of-contents__link toc-highlight">04. Define Relations</a></li><li><a href="#05-test-the-model" class="table-of-contents__link toc-highlight">05. Test The Model</a></li><li><a href="#06-iterate" class="table-of-contents__link toc-highlight">06. Iterate</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<code>{ user: "{user_id}", relation: "editor", object: "document:{id}" }</code> for individual users</li></ul><p>This also supports making all members in an organization editors of the document, through a <a href="/docs/modeling/user-groups">group to object relationship</a>. A relationship tuple like the following one states that the members of organization A are editors of document 0001.</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:0001"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>You can learn more about this in <a href="/docs/modeling/user-groups">Modeling User Groups</a>.</p><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-viewer">Relation: Viewer<a href="#relation-viewer" class="hash-link" aria-label="Direct link to Relation: Viewer" title="Direct link to Relation: Viewer">​</a></h5><p>The viewer relation is similar to the document's <a href="#relation-editor">editor relation</a>. It will be defined like this:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-parent">Relation: Parent<a href="#relation-parent" class="hash-link" aria-label="Direct link to Relation: Parent" title="Direct link to Relation: Parent">​</a></h5><p>The parent relation is used to tell <!-- -->OpenFGA<!-- --> which folder or drive is the parent of the document.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Important</div><div class="admonitionContent_S0QG"><p>Relation names in <!-- -->OpenFGA<!-- --> are arbitrary strings. There are no reserved relation names. You can use "parent", "container" or "ancestor" to refer to a "parent folder".</p></div></div><p>This relation is different from the others we have seen so far, as it is a relation between two objects (a <strong>folder</strong> and or <strong>drive</strong> that is the parent of the <strong>document</strong>). This is known as an <a href="/docs/modeling/building-blocks/object-to-object-relationships">object to object relationship</a>, of which <a href="/docs/modeling/parent-child">parent-child is a particular case</a>.</p><p>When a document is created a relationship tuple will be stored in <!-- -->OpenFGA<!-- --> to represent this relationship between parent and document. The relation definition then should be:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder, drive]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Why? This relation definition states that:</p><ul><li>documents may have a parent</li><li>the parent(s) of a document with id {id} is either a folder or a drive, described by one of these relationship tuples:<ul><li><code>{ user: "folder:{id}", relation: "parent", object: "document:{id}" }</code></li><li><code>{ user: "drive:{id}", relation: "parent", object: "document:{id}" }</code></li></ul></li></ul><p>We can use <a href="/docs/configuration-language#the-direct-relationship-type-restrictions">direct type restriction</a> to ensure a document's parent can only be an object of type either drive or folder.</p><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>Side note</div><div class="admonitionContent_S0QG"><p>You might have noticed that the "user" in the tuple is an object. This is a special syntax <!-- -->OpenFGA<!-- --> accepts in the "user" parameter to write <a href="/docs/modeling/building-blocks/object-to-object-relationships">object to object relationships</a>. You can read more about writing data to manage object to object relationships in <a href="/docs/interacting/managing-relationships-between-objects">Managing Relationships Between Objects</a>.</p></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-can_share">Relation: can_share<a href="#relation-can_share" class="hash-link" aria-label="Direct link to Relation: can_share" title="Direct link to Relation: can_share">​</a></h5><p>We need to express the following in the <a href="/docs/concepts#what-is-a-relation">relation definition</a>:</p><p><em>A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder that is the parent of the document.</em></p><p>We can achieve that with the following definition using <a href="../configuration-language">OpenFGA Configuration Language</a>:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_share</span><span class="token plain">: owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>There are a few key things here:</p><ul><li><strong>We don't use a <a href="/docs/configuration-language#the-direct-relationship-type-restrictions">direct relationship type restriction</a> as part of the definition.</strong> can_share is a common example of representing a permission that is defined in terms of other relations but is not directly assignable by the system.</li><li>The relation definition contains a <a href="/docs/configuration-language#the-union-operator">union operator</a> separating a list of relations that the user must have with the object in order to "be able to share the document". It is any of:<ul><li>Being an owner of the document</li><li>Being an editor of the document</li><li>Being an owner of the parent of the document. Whether the parent is a drive or a folder is not important, as they both have an owner relation.</li></ul></li></ul><p>You can read more about the aforementioned items in <a href="/docs/modeling/roles-and-permissions">Modeling Roles and Permissions</a>.</p><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-can_view">Relation: can_view<a href="#relation-can_view" class="hash-link" aria-label="Direct link to Relation: can_view" title="Direct link to Relation: can_view">​</a></h5><p>We need to express the following in the <a href="/docs/concepts#what-is-a-relation">relation definition</a>:</p><p><em>A user can view a document if they are an owner, viewer or editor of a document or if they are a viewer, owner of the folder/drive that is the parent of the document.</em></p><p>Similar to the <a href="#relation-can_share">can_share relation</a>, we can achieve that with the following definition using <a href="../configuration-language">OpenFGA Configuration Language</a>:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-can_write">Relation: can_write<a href="#relation-can_write" class="hash-link" aria-label="Direct link to Relation: can_write" title="Direct link to Relation: can_write">​</a></h5><p>We need to express the following in the <a href="/docs/concepts#what-is-a-relation">relation definition</a>:</p><p><em>A user can write a document if they are an owner or editor of a document or if they are an owner or editor of the folder/drive that is the parent of the document.</em></p><p>Similar to the <a href="#relation-can_share">can_share relation</a>, we can achieve that with the following definition using <a href="../configuration-language">OpenFGA Configuration Language</a>:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_write</span><span class="token plain">: editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="relation-can_change_owner">Relation: can_change_owner<a href="#relation-can_change_owner" class="hash-link" aria-label="Direct link to Relation: can_change_owner" title="Direct link to Relation: can_change_owner">​</a></h5><p>We need to express the following in the <a href="/docs/concepts#what-is-a-relation">relation definition</a>:</p><p><em>A user can change the owner of a document if they are an owner of the document.</em></p><p>Similar to the <a href="#relation-can_share">can_share relation</a>, we can achieve that with the following definition using <a href="../configuration-language">OpenFGA Configuration Language</a>:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_change_owner</span><span class="token plain">: owner</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h5 class="anchor anchorWithStickyNavbar_LWe7" id="complete-type-definition-1">Complete Type Definition<a href="#complete-type-definition-1" class="hash-link" aria-label="Direct link to Complete Type Definition" title="Direct link to Complete Type Definition">​</a></h5><p>The complete <a href="/docs/concepts#what-is-a-type-definition">type definition</a> for the document type is:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_share</span><span class="token plain">: owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_write</span><span class="token plain">: editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_change_owner</span><span class="token plain">: owner</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Combining the type definitions for document and organization, we have</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, organization#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_share</span><span class="token plain">: owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_write</span><span class="token plain">: editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_change_owner</span><span class="token plain">: owner</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-note alert alert--secondary admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_S0QG"><p>The <!-- -->OpenFGA<!-- --> authorization model API and SDK only accepts JSON in its input. To convert from DSL to JSON, you may use the <a href="https://github.com/openfga/cli" target="_blank" rel="noopener noreferrer">FGA CLI</a> to run <code>fga model transform</code>.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="05-test-the-model">05. Test The Model<a href="#05-test-the-model" class="hash-link" aria-label="Direct link to 05. Test The Model" title="Direct link to 05. Test The Model">​</a></h3><p><img loading="lazy" alt="Test the model" src="/assets/images/getting-started-diagram-06-8eb4b8f4a925670b0ff05fa86c4b890e.svg" width="911" height="188" class="img_ev3q"></p><p>Once you have defined your group like types and the most important type for your feature you want to ensure everything is working as expected. This means testing the model.</p><p>How? Remember from the introduction that <strong>OpenFGA<!-- -->'s</strong> main job is to answer the question:</p><div style="margin-top:2rem;margin-bottom:2rem"><div class="documentation-card-box_SNqO documentation-card-box-fitcontent_koVg undefined"><div class="documentation-card-box-content_Z5TD"><div class="documentation-card-box-alignment-left__zex"><div class="documentation-card-box-icon-large_nsCS"><svg width="106" height="106" viewBox="0 0 106 106" fill="none" xmlns="http://www.w3.org/2000/svg"><rect y="0.026" width="105.948" height="105.948" rx="20.252" fill="#BEC4CE"></rect><path d="M64.013 73.904c-7.832 0-14.18-6.349-14.18-14.18 0-7.832 6.348-14.18 14.18-14.18s14.18 6.348 14.18 14.18c0 7.831-6.348 14.18-14.18 14.18Z" fill="#2D2D37"></path><path d="M31.194 12.758h44.687c7.813 0 14.145 6.347 14.145 14.177v.006c0 7.83-6.332 14.177-14.145 14.177H31.194c-7.812 0-14.145-6.347-14.145-14.177v-.006c0-7.83 6.333-14.177 14.145-14.177Z" fill="url(#a)"></path><path d="M45.408 26.903v52.166c0 7.812-6.347 14.145-14.178 14.145h-.005c-7.83 0-14.178-6.333-14.178-14.145V26.903c0-7.812 6.348-14.145 14.178-14.145h.005c7.83 0 14.178 6.333 14.178 14.145Z" fill="url(#b)"></path><path d="M31.228 93.243c-7.832 0-14.18-6.35-14.18-14.181 0-7.832 6.348-14.18 14.18-14.18 7.831 0 14.18 6.348 14.18 14.18s-6.349 14.18-14.18 14.18Z" fill="#fff"></path><path d="M64.03 73.938c7.832 0 14.18-6.35 14.18-14.18 0-7.833-6.348-14.181-14.18-14.181s-14.18 6.349-14.18 14.18c0 7.832 6.348 14.18 14.18 14.18Z" fill="#000"></path><defs><linearGradient id="a" x1="90.016" y1="26.938" x2="17.04" y2="26.938" gradientUnits="userSpaceOnUse"><stop stop-color="#635DFF"></stop><stop offset="1" stop-color="#3885FF"></stop></linearGradient><linearGradient id="b" x1="31.228" y1="93.217" x2="31.228" y2="12.762" gradientUnits="userSpaceOnUse"><stop stop-color="#FF4F40"></stop><stop offset="1" stop-color="#F4D"></stop></linearGradient></defs></svg></div><span class="documentation-card-box-icon-title_zmVE">Can user U, perform an action A on an object O?</span></div><div class="documentation-card-box-children_i280"></div></div></div></div><p>The <!-- -->OpenFGA<!-- --> service does that by checking if a user has a particular relationship to an object, based on your authorization model and relationship tuples.</p><div style="margin-top:2rem;margin-bottom:2rem" class="column-layout-2_O2db"><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">General Authorization Check</span><p>"Can user <b>U</b> <u>perform action</u> <b>A</b> on object <b>O</b>?"</p><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA (ReBAC) Authorization Check</span><p>"Can user <b>U</b> <u>have relation</u> <b>R</b> with object <b>O</b>?"</p><div class="documentation-card-box-children_i280"></div></div></div></div><p>What we want is to ensure that given our current authorization model and some sample relationship tuples, we get the expected results for those questions.</p><p>So we'll write some relationship tuples and assertions. An <!-- -->OpenFGA<!-- --> assertion takes one of these forms:</p><ol><li>user U <strong>has</strong> relation R with object O</li><li>user U <strong>does not have</strong> relation R with object O</li></ol><p>Much like automated tests and assertions work for programming languages, you can use assertions to prevent regressions while you change your tuples and authorization model. Essentially, assertions help you ensure things work like you expect them to work as you iterate.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="write-relationship-tuples">Write Relationship Tuples<a href="#write-relationship-tuples" class="hash-link" aria-label="Direct link to Write Relationship Tuples" title="Direct link to Write Relationship Tuples">​</a></h4><p>The relationship tuples should represent real examples from your system with fake data.</p><p>At this point you haven't defined the drive or folder types, so you can only test things based on users or organization members' relationships to documents. Let's imagine an example setup and write the relationship tuples for it:</p><table><thead><tr><th>System Action</th><th>Relationship Tuple</th></tr></thead><tbody><tr><td>Anne is a member of the contoso organization</td><td><code>{ user:"user:anne", relation: "member", object: "organization:contoso"}</code></td></tr><tr><td>Beth is a member of fabrikam organization</td><td><code>{ user:"user:beth", relation: "member", object: "organization:fabrikam"}</code></td></tr><tr><td>Anne creates document:1, becomes its owner.</td><td><code>{ user:"user:anne", relation: "owner", object: "document:1"}</code></td></tr><tr><td>Anne shares document:1 with all members of the fabrikam organization as editor.</td><td><code>{ user:"organization:fabrikam#member", relation: "editor", object: "document:1"}</code></td></tr><tr><td>Beth creates document:2 and becomes its owner.</td><td><code>{ user:"user:beth", relation: "owner", object: "document:2"}</code></td></tr><tr><td>Beth shares document:2 with all members of the contoso organization as viewer</td><td><code>{ user:"organization:contoso#member", relation: "viewer", object: "document:2"}</code></td></tr></tbody></table><p>Follow these steps to create relationship tuples.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="create-assertions">Create Assertions<a href="#create-assertions" class="hash-link" aria-label="Direct link to Create Assertions" title="Direct link to Create Assertions">​</a></h4><p>According to our <a href="#write-it-in-plain-language">written down model</a> and the <a href="#write-relationship-tuples">relationship tuples</a> from the previous step, these assertions should be specified:</p><p>Because anne is the owner of document:1:</p><ul><li>user <strong>anne</strong> has relation <strong>can_share</strong> with document:1</li><li>user <strong>anne</strong> has relation <strong>can_write</strong> with document:1</li><li>user <strong>anne</strong> has relation <strong>can_view</strong> with document:1</li><li>user <strong>anne</strong> has relation <strong>can_change_owner</strong> with document:1</li></ul><p>Because beth is a member of organization:fabrikam and members of organization:fabrikam are writer of document:1:</p><ul><li>user <strong>beth</strong> does not have relation <strong>can_share</strong> with document:1</li><li>user <strong>beth</strong> has relation <strong>can_write</strong> with document:1</li><li>user <strong>beth</strong> has relation <strong>can_view</strong> with document:1</li><li>user <strong>beth</strong> does not have relation <strong>can_change_owner</strong> with document:1</li></ul><p>Because beth is the owner of document:2:</p><ul><li>user <strong>beth</strong> has relation <strong>can_share</strong> with document:2</li><li>user <strong>beth</strong> has relation <strong>can_write</strong> with document:2</li><li>user <strong>beth</strong> has relation <strong>can_view</strong> with document:2</li><li>user <strong>beth</strong> has relation <strong>can_change_owner</strong> with document:2</li></ul><p>Because anne is a member of organization:contoso and members of organization:contoso are viewer of document:2:</p><ul><li>user <strong>anne</strong> does not have relation <strong>can_share</strong> with document:2</li><li>user <strong>anne</strong> does not have relation <strong>can_write</strong> with document:2</li><li>user <strong>anne</strong> has relation <strong>can_view</strong> with document:2</li><li>user <strong>anne</strong> does not have relation <strong>can_change_owner</strong> with document:2</li></ul><p>Follow these steps to create assertions.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="run-assertions">Run Assertions<a href="#run-assertions" class="hash-link" aria-label="Direct link to Run Assertions" title="Direct link to Run Assertions">​</a></h4><p>Run the assertions. They should all pass. If they don't you can use the query view to understand what is causing them to fail, and then update your authorization model and relation tuples accordingly.</p><p>Once all the assertions are working, you should continue the iterative process of working on your model.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="06-iterate">06. Iterate<a href="#06-iterate" class="hash-link" aria-label="Direct link to 06. Iterate" title="Direct link to 06. Iterate">​</a></h3><p><img loading="lazy" alt="Iterate" src="/assets/images/getting-started-diagram-07-110858004c2892e28df4c404a50abce2.svg" width="911" height="208" class="img_ev3q"></p><p>We'll leave the exercise of defining the drive and folder relations, then adding relationship tuples and assertions to you. Once you are finished, check out the complete example to see how you did.</p><p>When defining the authorization model for your own system, you would continue iterating on the <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a> with the <a href="#01-pick-the-most-important-feature">next feature</a> and so on.</p><p>If you have any questions about this model or others, or would like some help creating your model, drop by our <a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer">Discord</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to model with OpenFGA.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA Concepts</span><p class="documentation-card-box-description_u7_j">Learn about the OpenFGA Concepts.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/concepts">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Configuration Language</span><p class="documentation-card-box-description_u7_j">Learn about OpenFGA Configuration Language.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/configuration-language">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Direct Access</span><p class="documentation-card-box-description_u7_j">Learn about modeling user access to an object.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/direct-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/getting-started.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Modeling Guides</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/direct-access"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Direct Access</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#introduction-to-modeling" class="table-of-contents__link toc-highlight">Introduction To Modeling</a></li><li><a href="#a-process-for-defining-authorization-models" class="table-of-contents__link toc-highlight">A Process For Defining Authorization Models</a><ul><li><a href="#01-pick-the-most-important-feature" class="table-of-contents__link toc-highlight">01. Pick The Most Important Feature</a></li><li><a href="#02-list-the-object-types" class="table-of-contents__link toc-highlight">02. List The Object Types</a></li><li><a href="#03-list-relations-for-those-types" class="table-of-contents__link toc-highlight">03. List Relations For Those Types</a></li><li><a href="#04-define-relations" class="table-of-contents__link toc-highlight">04. Define Relations</a></li><li><a href="#05-test-the-model" class="table-of-contents__link toc-highlight">05. Test The Model</a></li><li><a href="#06-iterate" class="table-of-contents__link toc-highlight">06. Iterate</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/migrating.html b/docs/modeling/migrating.html index 57434548d..e77297f41 100644 --- a/docs/modeling/migrating.html +++ b/docs/modeling/migrating.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible menu__list-item-collapsible--active"><a class="menu__link menu__link--sublist menu__link--active" aria-current="page" aria-expanded="true" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/migrating/migrating-relations">Migrating Relations</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/migrating/migrating-schema-1-1">Migrating to Schema 1.1</a></li></ul></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Migrations</span><meta itemprop="position" content="2"></li></ul></nav><div class="theme-doc-markdown markdown"><header><h1>Migrating</h1></header><p>This section has guides that focus on migrating models and relations.</p><div style="margin-top:2rem;margin-bottom:2rem"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div style="margin-top:0.75rem"><p class="documentation-card-box-description_u7_j">The content in this section is useful:</p><ul style="margin-top:2rem"><li>If you want to introduce changes to your existing authorization model or upgrade it to the new schema version.</li></ul></div><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div><h1>Content</h1><div style="margin-top:2rem;margin-bottom:2rem"><div style="margin-top:2rem" class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Migrating Relations</span><p class="documentation-card-box-description_u7_j">Learn to migrate relations in a production environment.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/migrating/migrating-relations">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Migrating To Schema 1.1</span><p class="documentation-card-box-description_u7_j">Learn to migrate models to schema 1.1.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/migrating/migrating-schema-1-1">Click to navigate</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/migrating/overview.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/advanced/entitlements"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Entitlements</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/migrating/migrating-relations"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Migrating Relations</div></a></nav></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/migrating/migrating-relations.html b/docs/modeling/migrating/migrating-relations.html index 2a9962302..d37f42ee4 100644 --- a/docs/modeling/migrating/migrating-relations.html +++ b/docs/modeling/migrating/migrating-relations.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/migrating/migrating-relations">Migrating Relations</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/migrating/migrating-schema-1-1">Migrating to Schema 1.1</a></li></ul></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling/migrating"><span itemprop="name">Migrations</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Migrating Relations</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Migrating Relations</h1><p>In the lifecycle of software development, you will need to make updates or changes to the <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>. In this guide, you will learn best practices for changing your existing authorization model. With these recommendations, you will minimize downtime and ensure your relationship models stay up to date.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>This guide assumes you are familiar with the following OpenFGA concepts:</p><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li><li><a href="/docs/configuration-language#the-intersection-operator">Intersection Operator</a>: the intersection operator can be used to indicate a relationship exists if the user is in all the sets of users</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>The document below is an example of a relational authorization model. In this model, you can assign users to the <code>editor</code> relation. The <code>editor</code> relation has write privileges that regular users do not.</p><p>In this scenario, you will migrate the following model:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_edit</span><span class="token plain">: editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_edit"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>There are existing <a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuples</a> associated with editor relation.</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>This is the authorization model that you will want to migrate to:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_write</span><span class="token plain">: writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_write"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><hr><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-create-a-backwards-compatible-model">01. Create A Backwards Compatible Model<a href="#01-create-a-backwards-compatible-model" class="hash-link" aria-label="Direct link to 01. Create A Backwards Compatible Model" title="Direct link to 01. Create A Backwards Compatible Model">​</a></h3><p>To avoid service disruption, you will create a backwards compatible model. The backwards compatible model ensures the existing relationship tuple will still work.</p><p>In the example below, <code>user:Anne</code> still has write privileges to the <code>document:roadmap</code> resource.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_write</span><span class="token plain">: writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_edit</span><span class="token plain">: writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_write"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_edit"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Test the <code>can_edit</code> definition. It should produce a value of <code>true</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_write'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_write document:roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_write","object":"document:roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_write</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_edit'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_edit"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_edit"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_edit"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_edit document:roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_edit","object":"document:roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_edit"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_edit</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-create-a-new-relationship-tuple">02. Create a New Relationship Tuple<a href="#02-create-a-new-relationship-tuple" class="hash-link" aria-label="Direct link to 02. Create a New Relationship Tuple" title="Direct link to 02. Create a New Relationship Tuple">​</a></h3><p>Now that you have a backwards compatible model, you can create new relationship tuples with a new relation.</p><p>In this example, you will add Bethany to the <code>writer</code> relationship.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Bethany assigned writer instead of editor</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bethany'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Bethany assigned writer instead of editor</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bethany"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Bethany assigned writer instead of editor</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bethany"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Bethany assigned writer instead of editor</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bethany"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:bethany","relation":"writer","object":"document:roadmap"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bethany writer document:roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Bethany assigned writer instead of editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bethany"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Run a check in the API for Bethany to ensure correct access.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bethany'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_write'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bethany"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bethany"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bethany"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bethany can_write document:roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:bethany","relation":"can_write","object":"document:roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bethany"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bethany</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_write</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-migrate-the-existing-relationship-tuples">03. Migrate The Existing Relationship Tuples<a href="#03-migrate-the-existing-relationship-tuples" class="hash-link" aria-label="Direct link to 03. Migrate The Existing Relationship Tuples" title="Direct link to 03. Migrate The Existing Relationship Tuples">​</a></h3><p>Next, migrate the existing relationship tuples. The new relation makes this definition obsolete.</p><p>Use the <code>read</code> API to lookup all relationship tuples.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Execute a read</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> tuples </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// tuples = [{"key": {"user":"user:anne","relation":"editor","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"},{"key": {"user":"user:charles","relation":"editor","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientReadOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientReadRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "tuples": [{"key": {"user":"user:anne","relation":"editor","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"},{"key": {"user":"user:charles","relation":"editor","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientReadRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { "tuples": [{"key": {"user":"user:anne","relation":"editor","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"},{"key": {"user":"user:charles","relation":"editor","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}] }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> TupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response = ReadResponse({"tuples":[{"key": {"user":"user:anne","relation":"editor","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"},{"key": {"user":"user:charles","relation":"editor","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}]})</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">read</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/read </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> '</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: "tuples": {[{"key": {"user":"user:anne","relation":"editor","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"},{"key": {"user":"user:charles","relation":"editor","object":"document:planning"}, "timestamp": "2021-10-06T15:32:11.128Z"}]}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">read</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">read</span><span class="token plain"> all stored tuples</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: tuples:</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"key"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">, </span><span class="token string" style="color:rgb(255, 121, 198)">"timestamp"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"2021-10-06T15:32:11.128Z"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"key"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">,</span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">, </span><span class="token string" style="color:rgb(255, 121, 198)">"timestamp"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"2021-10-06T15:32:11.128Z"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Then filter out the tuples that do not match the object type or relation (in this case, <code>document</code> and <code>editor</code> respectively), and update the new tuples with the <code>write</code> relationship.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:charles'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'writer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"writer","object":"document:roadmap"},{"user":"user:charles","relation":"writer","object":"document:roadmap"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne writer document:roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles writer document:roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Finally, remove the old relationship tuples.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">deletes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:charles'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> deletes</span><span class="token operator">==</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"deletes": { "tuple_keys" : [{"user":"user:anne","relation":"editor","object":"document:roadmap"},{"user":"user:charles","relation":"editor","object":"document:roadmap"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple delete --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> user:anne editor document:roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple delete --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> user:charles editor document:roadmap</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">delete</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:charles"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Perform a <code>write</code> operation before a <code>delete</code> operation to ensure Anne still has access.</p></div></div><p>Confirm the tuples are correct by running a check on the user.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_write'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_write document:roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_write","object":"document:roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_write</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The old relationship tuple no longer exists.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:roadmap'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne editor document:roadmap</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"editor","object":"document:roadmap"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">editor</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:roadmap"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:roadmap</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="04-remove-obsolete-relationship-from-the-model">04. Remove Obsolete Relationship From The Model<a href="#04-remove-obsolete-relationship-from-the-model" class="hash-link" aria-label="Direct link to 04. Remove Obsolete Relationship From The Model" title="Direct link to 04. Remove Obsolete Relationship From The Model">​</a></h3><p>After you remove the previous relationship tuples, update your authorization model to remove the obsolete relation.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_write</span><span class="token plain">: writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_write"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Now, the <code>write</code> API will only accept the new relation name.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Review the following sections for more information on managing relationship tuples.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Transactional Writes</span><p class="documentation-card-box-description_u7_j">Learn how to perform transactional write</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/transactional-writes">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Relationship Queries</span><p class="documentation-card-box-description_u7_j">Understand the differences between check, read, expand and list objects.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/relationship-queries">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Production Best Practices</span><p class="documentation-card-box-description_u7_j">Learn the best practices of running OpenFGA in a production environment</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/running-in-production">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/migrating/migrating-relations.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/migrating"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Migrating</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/migrating/migrating-schema-1-1"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Migrating Models To Schema 1.1</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-create-a-backwards-compatible-model" class="table-of-contents__link toc-highlight">01. Create A Backwards Compatible Model</a></li><li><a href="#02-create-a-new-relationship-tuple" class="table-of-contents__link toc-highlight">02. Create a New Relationship Tuple</a></li><li><a href="#03-migrate-the-existing-relationship-tuples" class="table-of-contents__link toc-highlight">03. Migrate The Existing Relationship Tuples</a></li><li><a href="#04-remove-obsolete-relationship-from-the-model" class="table-of-contents__link toc-highlight">04. Remove Obsolete Relationship From The Model</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/migrating/migrating-schema-1-1.html b/docs/modeling/migrating/migrating-schema-1-1.html index c3c829c01..bf0ddde63 100644 --- a/docs/modeling/migrating/migrating-schema-1-1.html +++ b/docs/modeling/migrating/migrating-schema-1-1.html @@ -15,15 +15,15 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/migrating/migrating-relations">Migrating Relations</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/migrating/migrating-schema-1-1">Migrating to Schema 1.1</a></li></ul></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling/migrating"><span itemprop="name">Migrations</span></a><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Migrating to Schema 1.1</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Migrating Models To Schema 1.1</h1><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>The model schema v1.0 has been deprecated. Migrate to schema v1.1 in order to be able to write tuples and run queries on your store.</p></div></div><p>A new DSL schema version has been introduced with several changes that we believe will make models easier to read and write, enable better tuple and model validations, and provide more options for optimizing the performance of different <!-- -->OpenFGA<!-- --> APIs.<br><br></p><p>In short, we will be:</p><ol><li><a href="#-model-schema-versions">Adding model schema version field</a></li><li><a href="#type-restrictions--removing-as-self">Adding type restrictions and removing need to specify <code>as self</code></a></li><li><a href="#disallowing-string-literals-in-user_ids">Disallowing string literals in user_ids</a></li><li><a href="#enforcing-type-restrictions">Enforcing type restrictions</a></li><li><a href="#public-access">Requiring you to specify for which relations you can write tuples with public access</a></li><li><a href="#query-evaluation-behavior-with-type-restrictions">Changes in query evaluation behavior with type restrictions</a></li></ol><p>To facilitate migration to the new DSL schema, you will need to update tuples that are no longer valid. In particular, all tuples whose <code>user</code> field involves a wildcard character (<code>*</code> or <code>user:*</code>) defined with model schema 1.0 <u><strong>MUST</strong></u> be deleted and re-added back.</p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Before starting to migrate to the new model schema, it is recommended that you obtain your current <a href="/api/service#/Authorization%20Models/ReadAuthorizationModels">authorization model ID</a> and ensure that all your <a href="/docs/concepts#what-is-a-check-request">check</a>, <a href="/docs/getting-started/update-tuples">write</a>, <a href="/docs/interacting/relationship-queries#expand">expand</a> and <a href="/docs/interacting/relationship-queries#listobjects">list object</a> are performed against that model id. This allows consistent behavior in your production system until you are ready to switch to the new model.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="-model-schema-versions">OpenFGA<!-- --> Model Schema Versions<a href="#-model-schema-versions" class="hash-link" aria-label="Direct link to -model-schema-versions" title="Direct link to -model-schema-versions">​</a></h2><p>Since the changes in the DSL are significant, we have decided to add a schema version to the DSL. The previous version of the DSL’s schema was <code>1.0</code>, and the new schema version will be <code>1.1</code>. To use the new syntax please add the following to the top of the model:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">model</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> schema 1.1</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG">OpenFGA<!-- --> will eventually stop supporting schema version 1.0. Notifications will be posted in GitHub, Discord and Twitter before this change occurs.</div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="type-restrictions--removing-as-self">Type Restrictions & Removing <code>as self</code><a href="#type-restrictions--removing-as-self" class="hash-link" aria-label="Direct link to type-restrictions--removing-as-self" title="Direct link to type-restrictions--removing-as-self">​</a></h2><p>We’ll use the following version 1.0 model and tuples to illustrate the changes we’ll need to make:</p><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.0</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">group</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> </span><span class="token directly-assignable">self</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> </span><span class="token directly-assignable">self</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> </span><span class="token directly-assignable">self</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> </span><span class="token directly-assignable">self</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> </span><span class="token directly-assignable">self</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_read</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Bob is a member of the Sales group</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group:sales"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The "pricing" document is in "sales" folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:sales"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:pricing"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Members of the "sales" team can view the "sales" folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group:sales#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:sales"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// John can view the "pricing" document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:john"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:pricing"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Those tuples match the intent of how the model was designed, but without type restrictions we can also write tuples that would not. For example, we can say that a document is a member of the sales group:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// The "pricing" document is a member of the "sales" group</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:pricing"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group:sales"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>To be able to better validate tuples and make the model more readable, version 1.1 requires you to specify types for all the relations that were previously assignable (e.g. relations defined <code>as self</code> in any way), and it removes the <code>as self</code> keyword.</p><p>The model above needs to be rewritten as:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">group</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_read</span><span class="token plain">: viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"mode"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_read"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_read"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>After making these changes, <!-- -->OpenFGA<!-- --> will start validating the tuples more strictly, for example, you won’t be able to assign a <code>document</code> as a member of a <code>group</code>. If your application is writing invalid tuples, you’ll start getting errors when invoking the <a href="/api/service#/Relationship%20Tuples/Write"><code>Write</code> API</a>.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="disallowing-string-literals-in-user_ids">Disallowing String Literals in user_ids<a href="#disallowing-string-literals-in-user_ids" class="hash-link" aria-label="Direct link to Disallowing String Literals in user_ids" title="Direct link to Disallowing String Literals in user_ids">​</a></h2><p>With version 1.0 models, you could write a tuple where the user id did not specify a type, for example:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// "bob" is a member of the "sales" group</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group:sales"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>However, with version 1.1 you always need to specify an object, so “bob’” is no longer a valid identifier. If you don’t have a type in your model that defines relations for users, you can add a ‘user’ type with no relations to your model, for example:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>You can then use that type when writing tuples:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// "user:bob" is a member of the "sales" group</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group:sales"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="enforcing-type-restrictions">Enforcing Type Restrictions<a href="#enforcing-type-restrictions" class="hash-link" aria-label="Direct link to Enforcing Type Restrictions" title="Direct link to Enforcing Type Restrictions">​</a></h2><p>With the model above, the following tuples will be valid according to the type definitions:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group:sales"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:sales"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:pricing"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:john"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:pricing"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>However, the one below will not be valid, as we can’t assign <code>group:sales#member</code> to the viewer relationship of a folder.</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group:sales#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:sales"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>You might think that given <code>group:sales#member</code> are actually users, you should still be able to assign it. <!-- -->OpenFGA<!-- --> calls expressions like <code>group:sales#member</code> <a href="/docs/concepts#what-is-a-user">"usersets"</a>, and with our model we can only assign users.</p><p>The issue is that there are a lot of other usersets that you don't want to be assigned as viewers of a folder. For example, you would not want to add <code>document:pricing#viewer</code> as viewers of the folder as conceptually it does not make sense to say “every viewer of this document should be a viewer of this folder”.</p><p>To allow these tuples to be written, you need to specify <code>group#member</code> as a valid type for the folder’s viewer relationship. You would want to do the same with the document’s viewer relationship if you want to define that the members of a group can be viewers of a document:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">group</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, group#member]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, group#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_read</span><span class="token plain">: viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_read"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_read"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>You can identify which usersets you need to add by looking at tuples in your store that have the following structure:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Members of the "sales" group are viewers of the "sales" folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"group:sales#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:sales"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If you find a tuple like that, you’ll need to add <code>group#member</code> in the list of types allowed in the <code>viewer</code> relation of the <code>folder</code> type.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="public-access">Public Access<a href="#public-access" class="hash-link" aria-label="Direct link to Public Access" title="Direct link to Public Access">​</a></h2><p>When using version 1.0, you can indicate public access to specific objects by specifying a wildcard user in a relationship to any object, e.g.:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// All users are viewers of the "pricing" document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:pricing"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>When you write the tuple above, all users are granted the “viewer” relationship for the “pricing" document. You can write those kinds of tuples for any relation that is <a href="/docs/concepts#what-are-direct-and-implied-relationships">directly assignable</a> in the model.</p><p>In version 1.1 we want to be more explicit about the tuples you can write, so you’ll need to declare in the DSL which relations allow wildcards and for which object types. If we want to let any object of type “user” to be a viewer of a specific document, we’ll need to explicitly define it.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user, user:*]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"wildcard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>You’ll need to specify <code>user:*</code> as the user value in the tuple to enable this:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// All objects of type "user" are viewers of the "pricing" document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:pricing"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Being explicit about the wildcard type restrictions also lets you model scenarios like “all employees can see this document, but not all external users”, “all user accounts can access this document, but not service/machine-to-machine accounts”.</p><p>This change implies that you’ll need to change your code to write tuples with this new syntax, and that you’ll need to migrate existing tuples to use the new format.</p><p>You might have 3 kinds of tuples in your model that use <code>*</code>, with different migration strategies:</p><ol><li>Tuples that have user = <code>*</code></li></ol><p>You would need to retrieve those tuples and write them using the proper type (e.g. <code>user:*</code>). To retrieve them, you’ll need to use the <a href="/api/service#/Relationship%20Tuples/Read">Read endpoint</a>, filter on your side the tuples that have <code>user = “*”</code>, and call the Write API for each one, with the proper type, e.g:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// All objects of type "user" are viewers of the "pricing" document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:pricing"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><ol start="2"><li>Tuples that have user = <code>employee:*</code>, where <code>employee</code> is NOT a type that is defined in the new iteration of your model.</li></ol><p>If you have tuples with this format, they will be considered invalid because they don’t have a corresponding type in the model. If you need such a type defined, you’ll need to add it to the model, and the scenario will be similar to the one described below.</p><ol start="3"><li>Tuples that have user = <code>user:*</code>, which would mean the user with user_id = <code>*</code>, where <code>user</code> is type that is defined in the new iteration of your model.</li></ol><p>In this case, the meaning of the tuple will change. If you were intending to specify a user with user id = <code>*</code>, you will need to encode it in a different way instead of using <code>*</code>. If you intended to specify public access to the object (e.g. "every user has this relationship with this object"), 1.0 models will not interpret the <code>user:*</code> value as a wildcard but 1.1 models will.</p><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="admonitionContent_S0QG"><p>If you have any wildcard tuples (i.e., <code>*</code> or <code>user:*</code>) that were created with model schema 1.0, you <strong><em>must</em></strong> delete and re-add these tuples with the appropriate type. This allows <!-- -->OpenFGA<!-- --> to interpret these tuples appropriately with the model schema 1.1 semantics. Failure to delete and re-add may cause <!-- -->OpenFGA<!-- --> to interpret these tuples incorrectly.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="query-evaluation-behavior-with-type-restrictions">Query Evaluation Behavior with Type Restrictions<a href="#query-evaluation-behavior-with-type-restrictions" class="hash-link" aria-label="Direct link to Query Evaluation Behavior with Type Restrictions" title="Direct link to Query Evaluation Behavior with Type Restrictions">​</a></h2><p>It is possible to introduce new models and have existing tuples (from prior models) with incompatibilities with the new model. Some cases where this can happen include:</p><ul><li>If you rename/delete a type.</li><li>If you rename/delete a relation.</li><li>If you remove a type restriction from the list of type restrictions for a relation, including changes for public access.</li><li>If <!-- -->OpenFGA<!-- --> introduces a change that makes a tuple invalid.</li></ul><p>In these cases, <!-- -->OpenFGA<!-- --> will not consider those invalid tuples when evaluating queries (<a href="/api/service#/Relationship%20Queries/Check">Check</a>, <a href="/api/service#/Relationship%20Queries/Expand">Expand</a>, <a href="/api/service#/Relationship%20Queries/ListObjects">List-objects</a>, etc). However, after any of the changes above happen, you should delete those tuples as having a large number of invalid tuples will negatively affect performance.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="improved-schema-validation">Improved Schema Validation<a href="#improved-schema-validation" class="hash-link" aria-label="Direct link to Improved Schema Validation" title="Direct link to Improved Schema Validation">​</a></h2><p>Type restrictions allow <!-- -->OpenFGA<!-- --> to validate the schema better at the time of writing the schema instead of at the time of query evaluation.</p><p>In <!-- -->OpenFGA<!-- -->, when <a href="/docs/configuration-language#referencing-relations-on-related-objects">referencing relations on related objects</a> the relation tying the related objects (the word after <code>from</code>, also called the tupleset) cannot be evaluated - that means it cannot be referencing another relation, or allow non-concrete types (type bound public access (<code><object_type>:*</code>) or usersets (<code><object_type>#<relation></code>)) in its type restrictions.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>In schema 1.0, because type restrictions were not available, the validation error would occur at the time of evaluation (e.g. a <code>Check</code> call), while in schema 1.1, the error will be thrown when writing the model (during the <code>WriteAuthorizationModel</code> request).</p></summary><div><div class="collapsibleContent_i85q">In the case below, the write request will fail in the new schema 1.1 version, but would have succeeded in schema version 1.0:<div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder,folder#parent]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p> /></p><p> In schema 1.0, the <code>WriteAuthorizationModel</code> would have succeeded, but when attempting to write a tuple such as the one below, you would have received an error:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'folder:product#parent'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'parent'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'folder:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:product#parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:product#parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:planning"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:product#parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"folder:product#parent","relation":"parent","object":"folder:planning"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw folder:product</span><span class="token comment" style="color:rgb(98, 114, 164)">#parent parent folder:planning</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:product#parent"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:planning"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="deprecation-timeline">Deprecation Timeline<a href="#deprecation-timeline" class="hash-link" aria-label="Direct link to Deprecation Timeline" title="Direct link to Deprecation Timeline">​</a></h2><p>1- <strong>February 13th 2023</strong>: Deprecation Notice</p><ul><li><a href="https://github.com/orgs/openfga/discussions/111" target="_blank" rel="noopener noreferrer">This</a> deprecation notice is posted.</li></ul><p>2- <strong>March 15th 2023</strong>: Disallow writing and evaluating new 1.0 models with OpenFGA version <code>0.4.0</code></p><ul><li>The API will no longer accept writing new 1.0 models (affects <a href="/api/service#/Authorization%20Models/WriteAuthorizationModel"><code>WriteAuthorizationModel</code></a>) unless the <code>OPENFGA_ALLOW_WRITING_1_0_MODELS</code> flag is used to override the setting. Note: reading those earlier models and their assertions will keep working.</li><li>Evaluation requests (<a href="/api/service#/Relationship%20Queries/Check"><code>Check</code></a>, <a href="/api/service#/Relationship%20Queries/Expand"><code>Expand</code></a>, <a href="/api/service#/Relationship%20Queries/List%20Objects"><code>ListObjects</code></a>), <a href="/api/service#/Assertions/WriteAssertions"><code>WriteAssertions</code></a> and <a href="/api/service#Relationship%20Tuples/Write"><code>Write</code></a> against 1.0 models will, by default, no longer be accepted unless the <code>OPENFGA_ALLOW_EVALUATING_1_0_MODELS</code> flag is used to override the setting.</li><li><a href="/api/service#/Authorization%20Models/ReadAuthorizationModel"><code>ReadAuthorizationModel</code></a>, <a href="/api/service#/Authorization%20Models/ReadAuthorizationModels"><code>ReadAuthorizationModels</code></a> and <a href="/api/service#/Assertions/ReadAssertions"><code>ReadAssertions</code></a> will continue to serve results for 1.0 and 1.1 models.</li></ul><p>3- <strong>March 31st 2023</strong>: Default model version in Syntax Transformer, Playground and Docs switch to <code>1.1</code></p><ul><li>The model schema version will be required in all new authorization models, and new authorization models without the version will be rejected.<div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></li></ul><p>4- <strong>May 15th 2023</strong>: Code Removed with OpenFGA version <code>0.5.0</code></p><ul><li><code>OPENFGA_ALLOW_WRITING_1_0_MODELS</code> and <code>OPENFGA_ALLOW_EVALUATING_1_0_MODELS</code> flags removed</li><li>The code relating to branching and evaluating <code>1.0</code> models will be removed except for <a href="/api/service#/Authorization%20Models/ReadAuthorizationModel"><code>ReadAuthorizationModel</code></a>, <a href="/api/service#/Authorization%20Models/ReadAuthorizationModels"><code>ReadAuthorizationModels</code></a> and <a href="/api/service#/Assertions/ReadAssertions"><code>ReadAssertions</code></a>.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Review the following sections for more information on migrating tuples.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Migrating Relations</span><p class="documentation-card-box-description_u7_j">Learn how to migrate relations</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/migrating/migrating-relations">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Production Best Practices</span><p class="documentation-card-box-description_u7_j">Learn the best practices of running OpenFGA in a production environment</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/getting-started/running-in-production">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/migrating/migrating-schema-1-1.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/migrating/migrating-relations"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Migrating Relations</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/interacting"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Interacting with the API</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#-model-schema-versions" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Model Schema Versions</productname></a></li><li><a href="#type-restrictions--removing-as-self" class="table-of-contents__link toc-highlight">Type Restrictions & Removing <code>as self</code></a></li><li><a href="#disallowing-string-literals-in-user_ids" class="table-of-contents__link toc-highlight">Disallowing String Literals in user_ids</a></li><li><a href="#enforcing-type-restrictions" class="table-of-contents__link toc-highlight">Enforcing Type Restrictions</a></li><li><a href="#public-access" class="table-of-contents__link toc-highlight">Public Access</a></li><li><a href="#query-evaluation-behavior-with-type-restrictions" class="table-of-contents__link toc-highlight">Query Evaluation Behavior with Type Restrictions</a></li><li><a href="#improved-schema-validation" class="table-of-contents__link toc-highlight">Improved Schema Validation</a></li><li><a href="#deprecation-timeline" class="table-of-contents__link toc-highlight">Deprecation Timeline</a></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/multiple-restrictions.html b/docs/modeling/multiple-restrictions.html index 5d64778c8..15459742b 100644 --- a/docs/modeling/multiple-restrictions.html +++ b/docs/modeling/multiple-restrictions.html @@ -15,8 +15,8 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> @@ -25,7 +25,7 @@ it represents a <code>document</code> <em><a href="/docs/concepts#what-is-a-type">type</a></em> that can have users <strong><a href="/docs/concepts#what-is-a-relation">related</a></strong> as <code>writer</code> and <code>organizations</code> related as <code>owner</code>. Document's <code>can_write</code> relation is based on whether user is a writer to the document. The <code>organization</code> type can have users related as <code>member</code>.</p><p>Let us also assume that we have:</p><ul><li>A <code>document</code> called "planning" owned by the ABC <code>organization</code>.</li><li>Becky is a member of the ABC <code>organization</code>.</li><li>Carl is a member of the XYZ <code>organization</code>.</li><li>Becky and Carl both have <code>writer</code> access to the "planning" <code>document</code>.</li></ul></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_write</span><span class="token plain">: writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_write"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The current state of the system is represented by the following relationship tuples being in the system already:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// organization ABC is the owner of planning document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:ABC"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Becky is a writer to the planning document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Carl is a writer to the planning document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Becky is a member of the organization ABC</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:ABC"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Carl is a member of the organization XYZ</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:XYZ"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Note that we assign the organization, not the organization's members, as owner to the planning document.</p></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-parent-child-objects">Modeling Parent-Child Objects<a href="#modeling-parent-child-objects" class="hash-link" aria-label="Direct link to Modeling Parent-Child Objects" title="Direct link to Modeling Parent-Child Objects">​</a></h3><p>You need to know how to model access based on parent-child relationships, e.g.: folders and documents. <a href="/docs/modeling/parent-child">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="modeling-roles-and-permissions">Modeling Roles And Permissions<a href="#modeling-roles-and-permissions" class="hash-link" aria-label="Direct link to Modeling Roles And Permissions" title="Direct link to Modeling Roles And Permissions">​</a></h3><p>You need to know how to model roles for users at the object level and model permissions for those roles. <a href="/docs/modeling/roles-and-permissions">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li><li><a href="/docs/configuration-language#the-intersection-operator">Intersection Operator</a>: the intersection operator can be used to indicate a relationship exists if the user is in all the sets of users</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>With the above authorization model and relationship tuples, <!-- -->OpenFGA<!-- --> will correctly respond with <code>{"allowed":true}</code> when <em><a href="/docs/concepts#what-is-a-check-request">check</a></em>is called to see if Carl and Becky can write this <code>document</code>.</p><p>We can verify that by issuing two check requests:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:becky'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_write'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky can_write document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:becky","relation":"can_write","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:becky</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_write</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:carl'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_write'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl can_write document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:carl","relation":"can_write","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:carl</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_write"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_write</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>What we would like to do is offer a way so that a document can be written by Becky and Carl, but only writers who are also members of the organization that owns the document can remove it.</p><p>To do this, we need to:</p><ol><li><a href="#01-add-can_delete-relation-to-only-allow-writers-that-are-members-of-the-ownership-organization">Add can_delete relation to only allow writers that are members of the ownership organization</a></li><li><a href="#02-verify-that-our-solutions-work">Verify that our solutions work</a></li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-add-can_delete-relation-to-only-allow-writers-that-are-members-of-the-ownership-organization">01. Add can_delete Relation To Only Allow Writers That Are Members Of The Ownership Organization<a href="#01-add-can_delete-relation-to-only-allow-writers-that-are-members-of-the-ownership-organization" class="hash-link" aria-label="Direct link to 01. Add can_delete Relation To Only Allow Writers That Are Members Of The Ownership Organization" title="Direct link to 01. Add can_delete Relation To Only Allow Writers That Are Members Of The Ownership Organization">​</a></h3><p>The first step is to add the relation definition for <code>can_delete</code> so that it requires users to be both <code>writer</code> and <code>member</code> of the owner. This is accomplished via the keyword <a href="/docs/configuration-language#the-intersection-operator"><code>and</code></a>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">writer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_write</span><span class="token plain">: writer</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_delete</span><span class="token plain">: writer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">and</span><span class="token plain"> member </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_write"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_delete"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"intersection"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"writer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"writer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-verify-that-our-solutions-work">02. Verify That Our Solutions Work<a href="#02-verify-that-our-solutions-work" class="hash-link" aria-label="Direct link to 02. Verify That Our Solutions Work" title="Direct link to 02. Verify That Our Solutions Work">​</a></h3><p>To verify that our solutions work, we need to check that Becky can delete the planning document because she is a writer AND she is a member of organization:ABC that owns the planning document.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:becky'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_delete'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky can_delete document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:becky","relation":"can_delete","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:becky"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:becky</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_delete</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>However, Carl cannot delete the planning document because although he is a writer, Carl is not a member of organization:ABC that owns the planning document.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:carl'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_delete'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:planning'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl can_delete document:planning</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:carl","relation":"can_delete","object":"document:planning"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:carl</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_delete</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:planning"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:planning</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to model privileged access.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling: User Groups</span><p class="documentation-card-box-description_u7_j">Learn about how to add group members.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/user-groups">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling: Blocklists</span><p class="documentation-card-box-description_u7_j">Learn about how to set block lists.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/blocklists">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling: Public Access</span><p class="documentation-card-box-description_u7_j">Learn about model public access.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/public-access">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/multiple-restrictions.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/public-access"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Public Access</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/custom-roles"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Custom Roles</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#modeling-parent-child-objects" class="table-of-contents__link toc-highlight">Modeling Parent-Child Objects</a></li><li><a href="#modeling-roles-and-permissions" class="table-of-contents__link toc-highlight">Modeling Roles And Permissions</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}"> Concepts</a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-add-can_delete-relation-to-only-allow-writers-that-are-members-of-the-ownership-organization" class="table-of-contents__link toc-highlight">01. Add can_delete Relation To Only Allow Writers That Are Members Of The Ownership Organization</a></li><li><a href="#02-verify-that-our-solutions-work" class="table-of-contents__link toc-highlight">02. Verify That Our Solutions Work</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/organization-context-authorization.html b/docs/modeling/organization-context-authorization.html index ddd991a9a..cd934418d 100644 --- a/docs/modeling/organization-context-authorization.html +++ b/docs/modeling/organization-context-authorization.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Authorization Through Organization Context</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Authorization Through Organization Context</h1><p>This section tackles cases where a user may have access to a particular resource through their presence in a particular organization, and they should have that access only when logged in within the context of that organization.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div>Contextual Tuples should be used when modeling cases where a user's access to an object depends on the context of their request. For example:<ul><li>An employee’s ability to access a document when they are connected to the organization VPN or the api call is originating from an internal IP address.</li><li>A support engineer is only able to access a user's account during office hours.</li><li>If a user belongs to multiple organizations, they are only able to access a resource if they set a specific organization in their current context.</li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>To follow this guide, you should be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>A <a href="/docs/concepts#what-is-a-check-request">Check Request</a>: is a call to the <!-- -->OpenFGA<!-- --> check endpoint that returns whether the user has a certain relationship with an object.</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li><li>A <a href="/docs/concepts#what-are-contextual-tuples">Contextual Tuple</a>: a tuple that can be added to a check request, and only exist within the context of that particular request.</li></ul><p>You also need to be familiar with:</p><ul><li><strong>Modeling Object-to-Object Relationships</strong>: You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. <a href="/docs/modeling/building-blocks/object-to-object-relationships">Learn more →</a></li><li><strong>Modeling Multiple Restrictions</strong>: You need to know how to model requiring multiple authorizations before allowing users to perform certain actions. <a href="/docs/modeling/multiple-restrictions">Learn more →</a></li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="scenario">Scenario<a href="#scenario" class="hash-link" aria-label="Direct link to Scenario" title="Direct link to Scenario">​</a></h3><p>For the scope of this guide, we are going to consider the following scenario.</p><p>Consider you are building the authorization model for a multi-tenant project management system.</p><p>In this particular system:</p><ul><li>projects are owned and managed by companies</li><li>users can be members of multiple companies</li><li>project access is governed by the user's role in the organization that manages the project</li></ul><p>In order for a user to access a project:</p><ul><li>The project needs to be managed by an organization the user is a member of</li><li>A project is owned by a single organization</li><li>A project can be shared with partner companies (that are able to view, edit but not perform admin actions, such as deletion, on the project)</li><li>The user should have a role that grants access to the project</li><li>The user should be logged in within the context of that organization</li></ul><p>We will start with the following authorization model:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">project_manager</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">project_editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">project</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">partner</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">manager</span><span class="token plain">: project_manager </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: project_editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> project_editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> partner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> manager</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_delete</span><span class="token plain">: manager</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_edit</span><span class="token plain">: editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: editor</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"project_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"project_editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"project_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"project_editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"partner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"partner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_delete"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_edit"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_view"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"partner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>We are considering the case that:</p><ul><li>Anne has a project manager role at organizations A, B and C</li><li>Beth has a project manager role at organization B</li><li>Carl has a project manager role at organization C</li><li>Project X is owned by organization A</li><li>Project X is shared with organization B</li></ul></summary><div><div class="collapsibleContent_i85q"><p>The above state translates to the following relationship tuples:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:B'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:C'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Beth has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:B'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Carl has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:carl'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:C'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Organization A owns Project X</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Project X is shared with Organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:B'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'partner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Beth has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Carl has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Organization A owns Project X</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Project X is shared with Organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"partner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Beth has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Carl has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Organization A owns Project X</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Project X is shared with Organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"partner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne has a `project manager` role at organization A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Beth has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Carl has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Organization A owns Project X</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Project X is shared with Organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"partner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"project_manager","object":"organization:A"},{"user":"user:anne","relation":"project_manager","object":"organization:B"},{"user":"user:anne","relation":"project_manager","object":"organization:C"},{"user":"user:anne","relation":"project_manager","object":"organization:B"},{"user":"user:carl","relation":"project_manager","object":"organization:C"},{"user":"organization:A","relation":"owner","object":"project:X"},{"user":"organization:B","relation":"partner","object":"project:X"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:B</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:C</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:B</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl project_manager organization:C</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:A owner project:X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:B partner project:X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne has a </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project manager</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> role at organization A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne has a </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project manager</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> role at organization B</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne has a </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project manager</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> role at organization C</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Beth has a </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project manager</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> role at organization B</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Carl has a </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project manager</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> role at organization C</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Organization A owns Project X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Project X is shared with Organization B</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"partner"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></div></div></details><h3 class="anchor anchorWithStickyNavbar_LWe7" id="requirements">Requirements<a href="#requirements" class="hash-link" aria-label="Direct link to Requirements" title="Direct link to Requirements">​</a></h3><ul><li>When logging in within the context of organization A, Anne should be able to view and delete project X.</li><li>When logging in within the context of organization B, Anne should be able to view, but not delete, project X.</li><li>When logging in within the context of organization C, Anne should not be able to view nor delete project X.</li><li>When logging in within the context of organization B, Beth should be able to view, but not delete, project X.</li><li>Carl should not be able to view nor delete project X.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>In order to solve for the requirements above, we will break the problem down into three steps:</p><ol><li><a href="#understand-relationships-without-contextual-data">Understand relationships without contextual tuples</a>. For example, we need to ensure that Anne can view and delete "Project X".</li><li><a href="#take-organization-context-into-consideration">Take organization context into consideration</a>. This includes <a href="#extend-the-authorization-model">extending the authorization model</a> and a temporary step of <a href="#add-the-required-tuples-to-mark-that-anne-is-in-an-approved-context">adding the required tuples to mark that Anne is in an approved context</a>.</li><li><a href="#use-contextual-tuples-for-context-related-checks">Use contextual tuples for context related checks</a>.</li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="understand-relationships-without-contextual-data">Understand Relationships Without Contextual Data<a href="#understand-relationships-without-contextual-data" class="hash-link" aria-label="Direct link to Understand Relationships Without Contextual Data" title="Direct link to Understand Relationships Without Contextual Data">​</a></h3><p>With the authorization model and relationship tuples shown above, <!-- -->OpenFGA<!-- --> has all the information needed to ensure that Anne can view and delete "Project X".</p><p>We can verify that using the following checks:</p><ul><li>Anne can view Project X<div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_view","object":"project:X"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project:X</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></li><li>Anne can delete Project X<div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_delete'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_delete project:X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_delete","object":"project:X"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_delete</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project:X</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></li></ul><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>More checks</summary><div><div class="collapsibleContent_i85q">* Beth can view Project X<div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth can_view project:X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:beth","relation":"can_view","object":"project:X"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:beth</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project:X</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div>* Beth cannot delete Project X<div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_delete'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth can_delete project:X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:beth","relation":"can_delete","object":"project:X"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:beth</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_delete</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project:X</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div>* Carl cannot view Project X<div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:carl'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl can_view project:X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:carl","relation":"can_view","object":"project:X"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:carl</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project:X</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div>* Carl cannot delete Project X<div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:carl'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_delete'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl can_delete project:X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:carl","relation":"can_delete","object":"project:X"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:carl</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_delete"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_delete</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project:X</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></div></div></details><p>Note that so far, we have not prevented Anne from viewing "Project X" even if Anne is viewing it from the context of Organization C.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="take-organization-context-into-consideration">Take Organization Context Into Consideration<a href="#take-organization-context-into-consideration" class="hash-link" aria-label="Direct link to Take Organization Context Into Consideration" title="Direct link to Take Organization Context Into Consideration">​</a></h3><h5 class="anchor anchorWithStickyNavbar_LWe7" id="extend-the-authorization-model">Extend The Authorization Model<a href="#extend-the-authorization-model" class="hash-link" aria-label="Direct link to Extend The Authorization Model" title="Direct link to Extend The Authorization Model">​</a></h5><p>In order to add a restriction based on the current organization context, we will make use of <!-- -->OpenFGA<!-- --> configuration language's support for <a href="/docs/configuration-language#the-intersection-operator">intersection</a> to specify that a user has to both have access <em>and</em> be in the correct context in order to be authorized.</p><p>We can do that by introducing some new relations and updating existing relation definitions:</p><ol><li>On the "organization" type</li></ol><ul><li>Add "user_in_context" relation to mark that a user's access is being evaluated within that particular context</li><li>Update the "project_manager" relation to require that the user be in the correct context (by adding <code>and user_in_context</code> to the relation definition)</li><li>Considering that <!-- -->OpenFGA<!-- --> does not yet support multiple logical operations within the same definition, we will split "project_editor" into two:<ul><li>"base_project_editor" editor which will contain the original relation definition (<code>[user] or project_manager</code>)</li><li>"project_editor" which will require that a user has both the "base_project_editor" and the "user_in_context" relations</li></ul></li></ul><p>The "organization" type definition then becomes:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">project_manager</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">and</span><span class="token plain"> user_in_context</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">base_project_editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> project_manager</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">project_editor</span><span class="token plain">: base_project_editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">and</span><span class="token plain"> user_in_context</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">user_in_context</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"project_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"intersection"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"base_project_editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"project_editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"intersection"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"base_project_editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user_in_context"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"project_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"base_project_editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user_in_context"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><ol start="2"><li>On the "project" type</li></ol><ul><li>Nothing will need to be done, as it will inherit the updated "project_manager" and "project_editor" relation definitions from "organization"</li></ul><h5 class="anchor anchorWithStickyNavbar_LWe7" id="add-the-required-tuples-to-mark-that-anne-is-in-an-approved-context">Add The Required Tuples To Mark That Anne Is In An Approved Context<a href="#add-the-required-tuples-to-mark-that-anne-is-in-an-approved-context" class="hash-link" aria-label="Direct link to Add The Required Tuples To Mark That Anne Is In An Approved Context" title="Direct link to Add The Required Tuples To Mark That Anne Is In An Approved Context">​</a></h5><p>Now that we have updated our authorization model to take the current user's organization context into consideration, you will notice that Anne has lost access because nothing indicates that Anne is authorizing from the context of an organization. You can verify that by issuing the following check:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_view","object":"project:X"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project:X</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>In order for Anne to be authorized, a tuple indicating Anne's current organization context will need to be present:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is authorizing from the context of organization:A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user_in_context'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is authorizing from the context of organization:A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne is authorizing from the context of organization:A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne is authorizing from the context of organization:A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"user_in_context","object":"organization:A"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne user_in_context organization:A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne is authorizing from the context of organization:A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We can verify this by running a check request</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_view","object":"project:X"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project:X</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="use-contextual-tuples-for-context-related-checks">Use Contextual Tuples For Context Related Checks<a href="#use-contextual-tuples-for-context-related-checks" class="hash-link" aria-label="Direct link to Use Contextual Tuples For Context Related Checks" title="Direct link to Use Contextual Tuples For Context Related Checks">​</a></h3><p>Now that we know we can authorize based on present state, we have a different problem to solve. We are storing the tuples in the state in order for <!-- -->OpenFGA<!-- --> to evaluate them, which fails in certain use-cases where Anne can be connected to two different contexts in different browser windows at the same time, as each has a different context at the same time, so if they are written to the state, which will <!-- -->OpenFGA<!-- --> use to compute Anne's access to the project?</p><p>For Check calls, <!-- -->OpenFGA<!-- --> has a concept called "<a href="/docs/concepts#what-are-contextual-tuples">Contextual Tuples</a>". Contextual Tuples are tuples that do <strong>not</strong> exist in the system state and are not written beforehand to <!-- -->OpenFGA<!-- -->. They are tuples that are sent alongside the Check request and will be treated as <em>if</em> they already exist in the state for the context of that particular Check call. That means that Anne can be using two different sessions, each within a different organization context, and <!-- -->OpenFGA<!-- --> will correctly respond to each one with the correct authorization decision.</p><p>First, we will undo the <a href="#add-the-required-tuples-to-mark-that-anne-is-in-an-approved-context">temporary step</a> and remove the stored tuples for which Anne has a <code>user_in_context</code> relation with <code>organization:A</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">deletes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Delete stored tuples where Anne is authorizing from the context of organization:A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user_in_context'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Delete stored tuples where Anne is authorizing from the context of organization:A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Deletes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Delete stored tuples where Anne is authorizing from the context of organization:A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> deletes</span><span class="token operator">==</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Delete stored tuples where Anne is authorizing from the context of organization:A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"deletes": { "tuple_keys" : [{"user":"user:anne","relation":"user_in_context","object":"organization:A"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple delete --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> user:anne user_in_context organization:A</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">delete</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Delete stored tuples where Anne is authorizing from the context of organization:A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Next, when Anne is connecting from the context of organization A, <!-- -->OpenFGA<!-- --> will return <code>{"allowed":true}</code>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">contextual_tuples</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContextualTuples</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContextualTuples </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">_object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> contextual_tuples</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X --contextual_tuples </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne user_in_context organization:A"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_view","object":"project:X"},"contextual_tuples":{"tuple_keys":[{"user":"user:anne","relation":"user_in_context","object":"organization:A"}]}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project:X</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> contextual_tuples </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"> // Assuming the following is </span><span class="token boolean">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain">user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token plain">, object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>When Anne is connecting from the context of organization C, <!-- -->OpenFGA<!-- --> will return <code>{"allowed":false}</code>:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'can_view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">contextual_tuples</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContextualTuples</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ContextualTuples </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">user</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token named-parameter punctuation" style="color:rgb(248, 248, 242)">_object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> contextual_tuples</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X --contextual_tuples </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne user_in_context organization:C"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:anne","relation":"can_view","object":"project:X"},"contextual_tuples":{"tuple_keys":[{"user":"user:anne","relation":"user_in_context","object":"organization:C"}]}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:anne</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"can_view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">can_view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project:X</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> contextual_tuples </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"> // Assuming the following is </span><span class="token boolean">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain">user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">, relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token plain">, object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Using this, you can check that the following requirements are satisfied:</p><table><thead><tr><th>User</th><th>Organization Context</th><th>Action</th><th>Allowed</th></tr></thead><tbody><tr><td>Anne</td><td>Organization A</td><td>View</td><td>Yes</td></tr><tr><td>Anne</td><td>Organization B</td><td>View</td><td>Yes</td></tr><tr><td>Anne</td><td>Organization C</td><td>View</td><td>Yes</td></tr><tr><td>Anne</td><td>Organization A</td><td>Delete</td><td>Yes</td></tr><tr><td>Anne</td><td>Organization B</td><td>Delete</td><td>No</td></tr><tr><td>Anne</td><td>Organization C</td><td>Delete</td><td>No</td></tr><tr><td>Beth</td><td>Organization B</td><td>View</td><td>Yes</td></tr><tr><td>Beth</td><td>Organization B</td><td>Delete</td><td>No</td></tr><tr><td>Carl</td><td>Organization C</td><td>View</td><td>No</td></tr><tr><td>Carl</td><td>Organization C</td><td>Delete</td><td>No</td></tr></tbody></table><h2 class="anchor anchorWithStickyNavbar_LWe7" id="summary">Summary<a href="#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary">​</a></h2><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Final version of the Authorization Model and Relationship tuples</summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">organization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">project_manager</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">and</span><span class="token plain"> user_in_context</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">base_project_editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> project_manager</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">project_editor</span><span class="token plain">: base_project_editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">and</span><span class="token plain"> user_in_context</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">user_in_context</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">project</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">partner</span><span class="token plain">: </span><span class="token directly-assignable">[organization]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">manager</span><span class="token plain">: project_manager </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: manager </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> project_editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> owner </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> project_editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> partner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_delete</span><span class="token plain">: manager</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_edit</span><span class="token plain">: editor</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">can_view</span><span class="token plain">: editor</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"project_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"intersection"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"base_project_editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"project_editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"intersection"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"base_project_editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user_in_context"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user_in_context"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"project_manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"base_project_editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user_in_context"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"partner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"manager"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"partner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_delete"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"manager"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_edit"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"can_view"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">""</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"partner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:B'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:anne'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:C'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Beth has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:beth'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:B'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Carl has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:carl'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project_manager'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:C'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Organization A owns Project X</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:A'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Project X is shared with Organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'organization:B'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'partner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'project:X'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Beth has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Carl has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Organization A owns Project X</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Project X is shared with Organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"partner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Anne has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Beth has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Carl has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Organization A owns Project X</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Project X is shared with Organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"partner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne has a `project manager` role at organization A</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Anne has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Beth has a `project manager` role at organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Carl has a `project manager` role at organization C</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Organization A owns Project X</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Project X is shared with Organization B</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"partner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:anne","relation":"project_manager","object":"organization:A"},{"user":"user:anne","relation":"project_manager","object":"organization:B"},{"user":"user:anne","relation":"project_manager","object":"organization:C"},{"user":"user:beth","relation":"project_manager","object":"organization:B"},{"user":"user:carl","relation":"project_manager","object":"organization:C"},{"user":"organization:A","relation":"owner","object":"project:X"},{"user":"organization:B","relation":"partner","object":"project:X"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:B</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:C</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth project_manager organization:B</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl project_manager organization:C</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:A owner project:X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:B partner project:X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne has a </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project manager</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> role at organization A</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne has a </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project manager</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> role at organization B</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Anne has a </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project manager</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> role at organization C</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:anne"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Beth has a </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project manager</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> role at organization B</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:beth"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Carl has a </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">project manager</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> role at organization C</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:carl"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project_manager"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:C"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Organization A owns Project X</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:A"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Project X is shared with Organization B</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"organization:B"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"partner"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"project:X"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div></div></div></details><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="admonitionContent_S0QG"><p>Contextual tuples:</p><ul><li>Are not persisted in the store.</li><li>Are only supported on the <a href="/api/service#Relationship%20Queries/Check">Check API endpoint</a> and <a href="/api/service#Relationship%20Queries/ListObjects">ListObjects API endpoint</a>. They are not supported on read, expand and other endpoints.</li><li>If you are using the <a href="/api/service#Relationship%20Tuples/ReadChanges">Read Changes API endpoint</a> to build a permission aware search index, note that it will not be trivial to take contextual tuples into account.</li></ul></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how user groups can be used.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling with Multiple Restrictions</span><p class="documentation-card-box-description_u7_j">Learn how to model requiring multiple relationships before users are authorized to perform certain actions.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/multiple-restrictions">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Contextual and Time-Based Authorization</span><p class="documentation-card-box-description_u7_j">Learn how to authorize access that depends on dynamic or contextual criteria.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/contextual-time-based-authorization">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">OpenFGA Check API</span><p class="documentation-card-box-description_u7_j">Details on the Check API in the OpenFGA reference guide.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/api/service#Relationship%20Queries/Check">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/organization-context-authorization.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/contextual-time-based-authorization"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Contextual and Time-Based Authorization</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/building-blocks"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Building Blocks</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li><li><a href="#scenario" class="table-of-contents__link toc-highlight">Scenario</a></li><li><a href="#requirements" class="table-of-contents__link toc-highlight">Requirements</a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#understand-relationships-without-contextual-data" class="table-of-contents__link toc-highlight">Understand Relationships Without Contextual Data</a></li><li><a href="#take-organization-context-into-consideration" class="table-of-contents__link toc-highlight">Take Organization Context Into Consideration</a></li><li><a href="#use-contextual-tuples-for-context-related-checks" class="table-of-contents__link toc-highlight">Use Contextual Tuples For Context Related Checks</a></li></ul></li><li><a href="#summary" class="table-of-contents__link toc-highlight">Summary</a></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/parent-child.html b/docs/modeling/parent-child.html index aa322757f..75ee4ba75 100644 --- a/docs/modeling/parent-child.html +++ b/docs/modeling/parent-child.html @@ -15,14 +15,14 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Parent-Child Objects</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Parent-Child Objects</h1><p>In this guide you will learn how to indicate <a href="/docs/concepts#what-is-a-relationship">relationships</a> between <a href="/docs/concepts#what-is-an-object">objects</a>, and how users' relationships to one object can affect their relationship with another. For example: how a <code>editor</code> of a <code>folder</code> can be an <code>editor</code> of all <code>documents</code> the <code>folder</code> is a <code>parent</code> of.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>Object-to-Object relationships, combined with a configured authorization model can be used to indicate that a user's relation with one object can influence their relationship with another object. This can also be used in some cases to remove the need to modify relations between objects using <a href="/docs/modeling/user-groups#03-assign-the-team-members-a-relation-to-an-object">user groups</a>.</p><p>Object-to-object relationships can be used:</p><ul><li>To indicate that <code>managers</code> of an <code>employee</code> have access to <code>approve</code> requests the <code>employee</code> has made</li><li>To indicate that users who have a repository admin role (<code>repo_admin</code>) in an organization automatically have <code>admin</code> access to all repositories in that organization</li><li>To indicate that users who are <code>subscribed</code> to a <code>plan</code>, get access to all the <code>features</code> in that <code>plan</code></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>Assume that you have the following <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>.<br> You have two types:</p><ul><li><code>folder</code> that users can be related to as an <code>editor</code></li><li><code>document</code> that <em>users</em> can be related to as an <code>editor</code></li></ul></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="direct-access">Direct Access<a href="#direct-access" class="hash-link" aria-label="Direct link to Direct Access" title="Direct link to Direct Access">​</a></h3><p>You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. <a href="/docs/modeling/direct-access">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li><li><a href="/docs/configuration-language#the-union-operator">Union Operator</a>: the union operator can be used to indicate that the user has multiple ways of being related to an object</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>We would like to model folders that contain documents and that a user having editor access to the folder, has editor access to all documents in that folder.</p><p>For <code>editors</code> of a <code>folder</code> to be <code>editors</code> of a containing <code>document</code>, we need to:</p><ol><li>Update the authorization model to allow a <code>parent</code> relationship between <code>folder</code> and <code>document</code></li><li>Update the <code>editor</code> relation in the <code>document</code> type definition to support <em>cascading</em> from <code>folder</code></li></ol><p>and then to indicate and verify that <strong>bob</strong> is an <code>editor</code> of <strong>document:meeting_notes.doc</strong> because <strong>bob</strong> is an <code>editor</code> of <strong>folder:notes</strong>, we then need to:</p><ol start="3"><li>Create a new <em>relationship tuple</em> to indicate that <strong>bob</strong> is a <code>editor</code> of <strong>folder:notes</strong></li><li>Create a new <em>relationship tuple</em> to indicate that <strong>folder:notes</strong> is a <code>parent</code> of <strong>document:meeting_notes.doc</strong></li><li>Check to see if <strong>bob</strong> is an <code>editor</code> of <strong>document:meeting_notes.doc</strong></li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-update-the-authorization-model-to-allow-a-parent-relationship-between-folder-and-document">01. Update The Authorization Model To Allow A Parent Relationship Between Folder And Document<a href="#01-update-the-authorization-model-to-allow-a-parent-relationship-between-folder-and-document" class="hash-link" aria-label="Direct link to 01. Update The Authorization Model To Allow A Parent Relationship Between Folder And Document" title="Direct link to 01. Update The Authorization Model To Allow A Parent Relationship Between Folder And Document">​</a></h3><p>To allow a <code>parent</code> relation between a <code>folder</code> and a <code>document</code>, we need to update the authorization model to be the following (this is to allow creating relationship tuples that can indicate a relationship between <code>folder</code> and <code>document</code>. Refer to <a href="/docs/modeling/building-blocks/object-to-object-relationships">Modeling Concepts: Object to Object Relationships</a> to understand why):</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Notice that the <code>document</code> type now has a <code>parent</code> relation, indicating that other objects can be <code>parent</code>s of <code>document</code>s</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-update-the-editor-relation-in-the-document-type-definition-to-support-cascading-from-folder">02. Update The Editor Relation In The Document Type Definition To Support Cascading From Folder<a href="#02-update-the-editor-relation-in-the-document-type-definition-to-support-cascading-from-folder" class="hash-link" aria-label="Direct link to 02. Update The Editor Relation In The Document Type Definition To Support Cascading From Folder" title="Direct link to 02. Update The Editor Relation In The Document Type Definition To Support Cascading From Folder">​</a></h3><p>To allow <em>cascading</em> relations between <code>folder</code> and <code>document</code>, we can update our authorization model as the following:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">folder</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">parent</span><span class="token plain">: </span><span class="token directly-assignable">[folder]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> editor </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> parent</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleToUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"tupleset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"parent"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p><code>editor</code> of a <code>document</code> are any of:</p><ol><li>users that are directly assigned as editors</li><li>users that are related to any <code>parent</code> of this document as <code>editor</code> (editors of the parent)</li></ol></div></div><p>So with this change, anyone related to a <code>folder</code> that is a <code>parent</code> of a <code>document</code> as an <code>editor</code> is also an <code>editor</code> of said <code>document</code>.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-create-a-new-relationship-tuple-to-indicate-that-bob-is-an-editor-of-foldernotes">03. Create A New Relationship Tuple To Indicate That bob Is An Editor Of folder:notes<a href="#03-create-a-new-relationship-tuple-to-indicate-that-bob-is-an-editor-of-foldernotes" class="hash-link" aria-label="Direct link to 03. Create A New Relationship Tuple To Indicate That bob Is An Editor Of folder:notes" title="Direct link to 03. Create A New Relationship Tuple To Indicate That bob Is An Editor Of folder:notes">​</a></h3><p>To leverage our <em>cascading</em> relation, we need to create a relationship tuple that states: <strong>bob</strong> is an <code>editor</code> of <strong>folder:notes</strong></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'folder:notes'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:notes"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:notes"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:notes"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:bob","relation":"editor","object":"folder:notes"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob editor folder:notes</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:notes"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p><strong>Note:</strong> Make sure to use unique ids for each object and user within your application domain when creating relationship tuples for <!-- -->OpenFGA<!-- -->. We are using first names and simple ids to illustrate an easy-to-follow example.</p></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="04-create-a-new-relationship-tuple-to-indicate-that-foldernotes-is-a-parent-of-documentmeeting_notesdoc">04. Create A New Relationship Tuple To Indicate That folder:notes Is A Parent Of document:meeting_notes.doc<a href="#04-create-a-new-relationship-tuple-to-indicate-that-foldernotes-is-a-parent-of-documentmeeting_notesdoc" class="hash-link" aria-label="Direct link to 04. Create A New Relationship Tuple To Indicate That folder:notes Is A Parent Of document:meeting_notes.doc" title="Direct link to 04. Create A New Relationship Tuple To Indicate That folder:notes Is A Parent Of document:meeting_notes.doc">​</a></h3><p>Now that <strong>bob</strong> is an <code>editor</code> of <strong>folder:notes</strong>, we need to indicate that <strong>folder:notes</strong> is a <code>parent</code> of <code>document</code>:<strong>meeting_notes.doc</strong></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the notes folder is a parent of the meeting notes document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'folder:notes'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'parent'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:meeting_notes.doc'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the notes folder is a parent of the meeting notes document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:notes"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// the notes folder is a parent of the meeting notes document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"folder:notes"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># the notes folder is a parent of the meeting notes document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:notes"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"folder:notes","relation":"parent","object":"document:meeting_notes.doc"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw folder:notes parent document:meeting_notes.doc</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // the notes folder is a parent of the meeting notes document</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"folder:notes"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"parent"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="05-check-to-see-if-bob-is-an-editor-of-documentmeeting_notesdoc">05. Check To See If bob Is An Editor Of document:meeting_notes.doc<a href="#05-check-to-see-if-bob-is-an-editor-of-documentmeeting_notesdoc" class="hash-link" aria-label="Direct link to 05. Check To See If bob Is An Editor Of document:meeting_notes.doc" title="Direct link to 05. Check To See If bob Is An Editor Of document:meeting_notes.doc">​</a></h3><p>Now that we have done the changes to the authorization model and the addition of the two new <em>relationship tuples</em>, we can verify if our configuration is correct by running the following check: <strong>is bob an editor of document:meeting_notes.doc</strong>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:meeting_notes.doc'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob editor document:meeting_notes.doc</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:bob","relation":"editor","object":"document:meeting_notes.doc"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bob</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">editor</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:meeting_notes.doc</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><blockquote><p>Note: There are no other relationship tuples within the store that dictate any direct relation between <strong>bob</strong> and <strong>document:meeting_notes.doc</strong>. The check succeeds because of the <em>cascading</em> relation applied.</p></blockquote><p>The chain of resolution becomes:</p><ul><li><strong>bob</strong> is an <code>editor</code> of <strong>folder:notes</strong></li><li><strong>folder:notes</strong> is a <code>parent</code> of <strong>document:meeting_notes.doc</strong></li><li><code>editors</code> of any <code>parent</code> <code>folder</code> of <strong>document:meeting_notes.doc</strong> are also <code>editors</code> of the <code>document</code></li><li>Therefore, <strong>bob</strong> is an <code>editor</code> of <strong>document:meeting_notes.doc</strong></li></ul><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p>Note that when searching tuples that are related to the object (the word after <code>from</code>, also called the tupleset), <!-- -->OpenFGA<!-- --> will not do any evaluation and will only consider concrete objects (of the form <code><object_type>:<object_id></code>) that were directly assigned, and will throw an error if it encounters any rewrites, or a <code>*</code>, a type bound public access (<code><object_type>:*</code>) or a userset (<code><object_type>:<object_id>#<relation></code>).</p><p>See <a href="/docs/configuration-language#referencing-relations-on-related-objects">Referencing Relations on Related Objects</a> for more.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to model for parent and child objects.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Concepts: Object to Object Relationships</span><p class="documentation-card-box-description_u7_j">Learn about how to model object to object relationships in OpenFGA.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/building-blocks/object-to-object-relationships">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Google Drive</span><p class="documentation-card-box-description_u7_j">See how to make folders parents of documents, and to make editors on the parent folders editors on documents inside them..</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/gdrive#01-individual-permissions">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling GitHub</span><p class="documentation-card-box-description_u7_j">See how to grant users access to all repositories owned by an organization.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/github#01-permissions-for-individuals-in-an-org">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/parent-child.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/roles-and-permissions"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Roles and Permissions</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/blocklists"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Blocklists</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#direct-access" class="table-of-contents__link toc-highlight">Direct Access</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-update-the-authorization-model-to-allow-a-parent-relationship-between-folder-and-document" class="table-of-contents__link toc-highlight">01. Update The Authorization Model To Allow A Parent Relationship Between Folder And Document</a></li><li><a href="#02-update-the-editor-relation-in-the-document-type-definition-to-support-cascading-from-folder" class="table-of-contents__link toc-highlight">02. Update The Editor Relation In The Document Type Definition To Support Cascading From Folder</a></li><li><a href="#03-create-a-new-relationship-tuple-to-indicate-that-bob-is-an-editor-of-foldernotes" class="table-of-contents__link toc-highlight">03. Create A New Relationship Tuple To Indicate That bob Is An Editor Of folder:notes</a></li><li><a href="#04-create-a-new-relationship-tuple-to-indicate-that-foldernotes-is-a-parent-of-documentmeeting_notesdoc" class="table-of-contents__link toc-highlight">04. Create A New Relationship Tuple To Indicate That folder:notes Is A Parent Of document:meeting_notes.doc</a></li><li><a href="#05-check-to-see-if-bob-is-an-editor-of-documentmeeting_notesdoc" class="table-of-contents__link toc-highlight">05. Check To See If bob Is An Editor Of document:meeting_notes.doc</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/public-access.html b/docs/modeling/public-access.html index 81b0fa2f5..382e018de 100644 --- a/docs/modeling/public-access.html +++ b/docs/modeling/public-access.html @@ -15,14 +15,14 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Public Access</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Public Access</h1><p>In this guide you will learn how to grant public access to an <a href="/docs/concepts#what-is-an-object">object</a>, such as a certain document, using <a href="/docs/concepts#what-is-type-bound-public-access">type bound public access</a>.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>Public access allows your application to grant every user in the system access to an object. You would add a relationship tuple with type-bound public access when:</p><ul><li>sharing a <code>document</code> publicly to indicate that everyone can <code>view</code> it</li><li>a public <code>poll</code> is created to indicate that anyone can <code>vote</code> on it</li><li>a blog <code>post</code> is published and anyone should be able to <code>read</code> it</li><li>a <code>video</code> is made public for anyone to <code>watch</code></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before You Start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before You Start" title="Direct link to Before You Start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>Assume that you have the following <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>.<br> You have a <a href="/docs/concepts#what-is-a-type">type</a> called <code>document</code> that can have a <code>view</code> relation.</p></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">view</span><span class="token plain">: </span><span class="token directly-assignable">[user, user:*]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"view"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"view"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"wildcard"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="direct-access">Direct Access<a href="#direct-access" class="hash-link" aria-label="Direct link to Direct Access" title="Direct link to Direct Access">​</a></h3><p>You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. <a href="/docs/modeling/direct-access">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li><li>A <a href="/docs/concepts#what-is-type-bound-public-access">Type Bound Public Access</a>: is a special <!-- -->OpenFGA<!-- --> concept (represented by <code><type>:*</code>) can be used in relationship tuples to represent every object of that type</li></ul></div></div></details><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p>Make sure to use unique ids for each object and user within your application domain when creating relationship tuples for <!-- -->OpenFGA<!-- -->. We are using first names and simple ids to just illustrate an easy-to-follow example.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>In previous guides, we have shown how to indicate that objects are related to users or objects. In some cases, you might want to indicate that everyone is related to an object (for example when sharing a document publicly).</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-create-a-relationship-tuple">01. Create A Relationship Tuple<a href="#01-create-a-relationship-tuple" class="hash-link" aria-label="Direct link to 01. Create A Relationship Tuple" title="Direct link to 01. Create A Relationship Tuple">​</a></h3><p>To do this we need to create a relationship tuple using the <a href="/docs/concepts#what-is-type-bound-public-access">type bound public access</a>. The type bound public access syntax is used to indicate that all users of a particular type have a relation to a specific object.</p><p>Let us create a relationship tuple that states: <strong>any user can view document:company-psa.doc</strong></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// user:* denotes every object of type user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:*'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:company-psa.doc'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// user:* denotes every object of type user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:company-psa.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// user:* denotes every object of type user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:company-psa.doc"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># user:* denotes every object of type user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:company-psa.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:*","relation":"view","object":"document:company-psa.doc"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:* view document:company-psa.doc</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // user:* denotes every object of </span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">type</span><span class="token plain"> user</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:*"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"view"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:company-psa.doc"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Wildcard syntax usage</div><div class="admonitionContent_S0QG"><p>Please note that type-bound public access is not a wildcard or a regex expression.</p><p><strong>You cannot use the <code><type>:*</code> syntax in the tuple's object field.</strong></p><p>The following syntax is invalid:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// It is invalid to use this syntax in the object field. The below relationship tuple is invalid and does not mean that Bob can view all documents.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:*"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Wildcard syntax usage</div><div class="admonitionContent_S0QG"><p><strong>You cannot use <code><type>:*</code> as part of a userset in the tuple's user field.</strong></p><p>The following syntax is invalid:</p><div class="language-json5 codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json5 codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// It is invalid to use this syntax as part of a userset. The below relationship tuple is invalid and does not mean that members of any org can view the company-psa document.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"user"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"org:*#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"object"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:company-psa.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-check-that-the-relationship-exists">02. Check That The Relationship Exists<a href="#02-check-that-the-relationship-exists" class="hash-link" aria-label="Direct link to 02. Check That The Relationship Exists" title="Direct link to 02. Check That The Relationship Exists">​</a></h3><p>Once the above <em>relationship tuple</em> is added, we can <a href="/docs/concepts#what-is-a-check-request">check</a> if <strong>bob</strong> cab <code>view</code> <code>document</code>:<strong>company-psa.doc</strong>. <!-- -->OpenFGA<!-- --> will return <code>{ "allowed": true }</code> even though no relationship tuple linking <strong>bob</strong> to the document was added. That is because the relationship tuple with <code>user:*</code> as the user made it so every object of type user (such as <code>user:bob</code>) can <code>view</code> the document, making it public.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'view'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:company-psa.doc'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:company-psa.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:company-psa.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"view"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:company-psa.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob view document:company-psa.doc</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:bob","relation":"view","object":"document:company-psa.doc"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bob</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"view"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">view</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:company-psa.doc"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:company-psa.doc</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to model with OpenFGA.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling: Getting Started</span><p class="documentation-card-box-description_u7_j">Learn about how to get started with modeling.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/getting-started">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Configuration Language</span><p class="documentation-card-box-description_u7_j">Learn about OpenFGA Configuration Language.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/configuration-language">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Blocklists</span><p class="documentation-card-box-description_u7_j">Learn about model block lists.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/blocklists">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/public-access.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/blocklists"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Blocklists</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/multiple-restrictions"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Multiple Restrictions</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before You Start</a><ul><li><a href="#direct-access" class="table-of-contents__link toc-highlight">Direct Access</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-create-a-relationship-tuple" class="table-of-contents__link toc-highlight">01. Create A Relationship Tuple</a></li><li><a href="#02-check-that-the-relationship-exists" class="table-of-contents__link toc-highlight">02. Check That The Relationship Exists</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/roles-and-permissions.html b/docs/modeling/roles-and-permissions.html index 288856e05..dd58a9f11 100644 --- a/docs/modeling/roles-and-permissions.html +++ b/docs/modeling/roles-and-permissions.html @@ -15,14 +15,14 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Roles and Permissions</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>Roles and Permissions</h1><p>In this guide you will learn how to model roles and permissions model within <a href="/docs/authorization-and-openfga#what-is-openfga">OpenFGA</a> using the <em><a href="/docs/concepts#what-is-an-authorization-model">authorization model</a></em> and <em><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuple</a></em>.</p><ul><li><strong>Roles</strong> are assigned to <a href="/docs/concepts#what-is-a-user">users</a> or a group of users, where any user can have more than one role (<code>editor</code>, <code>owner</code>, etc..).</li><li><strong>Permissions</strong> are what allows users to access certain <a href="/docs/concepts#what-is-an-object">objects</a> based on their specific roles (<code>device_renamer</code>, <code>channel_archiver</code>, etc..).</li></ul><p>For example, the role <code>viewer</code> of a <code>trip</code> can have <strong>permissions to view bookings</strong> or the role <code>owners</code> can have <strong>permissions to add/view bookings to a trip.</strong></p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>When trying to create a role and permissions model within <!-- -->OpenFGA<!-- -->.:</p><ul><li>Create roles by creating relations that can be directly assigned to users</li><li>Assign permissions by creating relations that users get through other relations</li></ul><p>For example:</p><ul><li>Grant someone an <code>admin</code> role that can <code>edit</code> and <code>read</code> a <code>document</code></li><li>Grant someone a <code>security_guard</code> role that can <code>live_video_viewer</code> on a <code>device</code></li><li>Grant someone a <code>viewer</code> role that can <code>view_products</code> on a <code>shop</code></li></ul><p>There are advantages to implementing roles and permissions within <!-- -->OpenFGA<!-- -->, such as:</p><ul><li>Breaking down existing roles to have more fine grained permissions. This allows your application to check whether a <em>user</em> has access to a certain object without having to explicitly check that specific <em>users</em> role.</li><li>Introduce new roles/permissions or consolidate roles without affecting your application behavior. For example: if in your app all the checks are for the fine permissions <code>check('bob', 'booking_adder', 'trip:Europe')</code> instead of <code>check('bob', 'owner', 'trip:Europe')</code>, and then you later decide <code>owners</code> can no longer add bookings to a <code>trip</code>, you can remove the relation within the <code>trip</code> type with no code changes in your application, and all the permissions will automatically honor the change.</li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before you start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before you start" title="Direct link to Before you start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>Assume that you have the following <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>.<br> You have a <a href="/docs/concepts#what-is-a-type">type</a> called <code>trip</code> that <em>users</em> can be related to as <code>viewer</code> and/or an <code>owner</code>.</p></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">trip</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="direct-access">Direct Access<a href="#direct-access" class="hash-link" aria-label="Direct link to Direct Access" title="Direct link to Direct Access">​</a></h3><p>You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. <a href="/docs/modeling/direct-access">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in Auth <!-- -->OpenFGA</li><li>A <a href="/docs/concepts#what-is-a-relationship">Relationship</a>: <!-- -->OpenFGA<!-- --> will be called to check if there is a relationship between a user and an object, indicating that the access is allowed</li><li><a href="/docs/configuration-language#the-direct-relationship-type-restrictions">Direct Relationship Type Restrictions</a>: can be used to indicate direct relationships between users and objects</li><li>A <a href="/docs/concepts#what-is-a-check-request">Check API Request</a> the Check API Request is used to check for relationships between users and objects</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>To illustrate modeling Roles and Permissions in <!-- -->OpenFGA<!-- -->, we will use a trip booking system where you can have <code>owners</code> and/or <code>viewers</code> that can have more granular permissions such as adding bookings to a trip or viewing bookings on it.</p><p>In order to represent this, we need to:</p><ol><li>Understand how roles are related to direct relations for our trip booking system</li><li>Adding implied relations to existing authorization model to define permissions for bookings</li><li><a href="/docs/concepts#what-is-a-check-request">Checking</a> user roles and their permissions based on *relationship tuples* for direct and implied relations</li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-understand-how-roles-work-within-our-trip-booking-system">01. Understand How Roles Work Within Our Trip Booking System<a href="#01-understand-how-roles-work-within-our-trip-booking-system" class="hash-link" aria-label="Direct link to 01. Understand How Roles Work Within Our Trip Booking System" title="Direct link to 01. Understand How Roles Work Within Our Trip Booking System">​</a></h3><p>Relating roles within <!-- -->OpenFGA<!-- --> can be best described as the following: <strong>Roles are relations that can be directly assigned to users.</strong> Looking at our authorization model, our roles would then be <code>owner</code> and <code>viewer</code>. Meaning that a specific <em>user</em> can be an <code>owner</code> and/or a <code>viewer</code>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">trip</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-adding-permissions-for-bookings">02. Adding Permissions For Bookings<a href="#02-adding-permissions-for-bookings" class="hash-link" aria-label="Direct link to 02. Adding Permissions For Bookings" title="Direct link to 02. Adding Permissions For Bookings">​</a></h3><p>Permissions within <!-- -->OpenFGA<!-- --> can be best described as the following: <strong>Permissions are relations that users get only through other relations.</strong> To represent permissions, we avoid adding a <a href="/docs/configuration-language#the-direct-relationship-type-restrictions"><strong>direct relationship type restriction</strong></a> to the relation in the authorization model. Instead, we define the relation from other relations to indicate that it is a permission granted to and implied from a different relation.</p><p>To add permissions related to bookings, we can add new relations to the <code>trip</code> <em>object</em> type denoting the various actions a user can take on <code>trips</code> (view, edit, delete, rename, etc...)</p><p>To allow <code>viewers</code> of a <code>trip</code> to have <strong>permissions to view bookings</strong> and <code>owners</code> to have <strong>permissions to add/view bookings,</strong> we would modify the type as the following:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">trip</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">owner</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">viewer</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">booking_adder</span><span class="token plain">: owner</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">booking_viewer</span><span class="token plain">: viewer </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">or</span><span class="token plain"> owner</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"booking_adder"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"booking_viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"union"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"child"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"computedUserset"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"owner"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"viewer"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><blockquote><p>Note: notice how both <code>booking_viewer</code> and <code>booking_adder</code> don't have <a href="/docs/configuration-language#the-direct-relationship-type-restrictions">direct relationship type restrictions</a>. This is to ensure that the relation can only be assigned through the <strong>role</strong> and not directly.</p></blockquote><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-checking-user-roles-and-their-permissions">03. Checking User Roles And Their Permissions<a href="#03-checking-user-roles-and-their-permissions" class="hash-link" aria-label="Direct link to 03. Checking User Roles And Their Permissions" title="Direct link to 03. Checking User Roles And Their Permissions">​</a></h3><p>Now that our type definitions reflects the roles and permissions on how bookings can be viewed/added. Let's create <em><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuples</a></em> to assign roles to <em>users</em> and then <em><a href="/docs/concepts#what-is-a-check-request">check</a></em> if <em>users</em> have the proper permissions.</p><p>Let us create two relationship tuples:</p><ol><li>that gives <strong>bob</strong> the role of <code>viewer</code> on <code>trip</code>: <strong>Europe</strong>.</li><li>that gives <strong>alice</strong> the role of <code>owner</code> on <code>trip</code>: <strong>Europe</strong>.</li></ol><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Add bob as viewer on trip:Europe</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'trip:Europe'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Add alice as owner on trip:Europe</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:alice'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'owner'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'trip:Europe'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Add bob as viewer on trip:Europe</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Add alice as owner on trip:Europe</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Add bob as viewer on trip:Europe</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Add alice as owner on trip:Europe</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Add bob as viewer on trip:Europe</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Add alice as owner on trip:Europe</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:bob","relation":"viewer","object":"trip:Europe"},{"user":"user:alice","relation":"owner","object":"trip:Europe"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob viewer trip:Europe</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice owner trip:Europe</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Add bob as viewer on trip:Europe</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"viewer"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Add alice as owner on trip:Europe</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"owner"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>Now we can check: <strong>is bob allowed to view bookings on trip Europe?</strong></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'booking_viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'trip:Europe'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"booking_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"booking_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"booking_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob booking_viewer trip:Europe</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:bob","relation":"booking_viewer","object":"trip:Europe"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bob</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"booking_viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">booking_viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">trip:Europe</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p><strong>bob</strong> is a <code>booking_viewer</code> because of the following chain of resolution:</p><ol><li><strong>bob</strong> is a <code>viewer</code> on <code>trip</code>: <strong>Europe</strong></li><li>Any user related to the <em>object</em> <code>trip:</code><strong>Europe</strong> as <code>viewer</code> is also related as a <code>booking_viewer</code> (i.e <code>usersRelatedToObjectAs: viewer</code>)</li><li>Therefore, all <code>viewers</code> on a given <code>trip</code> are <code>booking_viewers</code></li></ol><p>To confirm that <strong>bob is not allowed to add bookings on trip Europe</strong>, we can do the following check:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:bob'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'booking_adder'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'trip:Europe'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"booking_adder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: false }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"booking_adder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"booking_adder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob booking_adder trip:Europe</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:bob","relation":"booking_adder","object":"trip:Europe"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":false}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:bob"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:bob</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"booking_adder"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">booking_adder</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">trip:Europe</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>We can also check: <strong>is alice allowed to view and add bookings on trip Europe?</strong></p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:alice'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'booking_viewer'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'trip:Europe'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"booking_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"booking_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"booking_viewer"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice booking_viewer trip:Europe</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:alice","relation":"booking_viewer","object":"trip:Europe"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:alice</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"booking_viewer"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">booking_viewer</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">trip:Europe</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:alice'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'booking_adder'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'trip:Europe'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"booking_adder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"booking_adder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"booking_adder"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice booking_adder trip:Europe</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:alice","relation":"booking_adder","object":"trip:Europe"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:alice</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"booking_adder"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">booking_adder</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"trip:Europe"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">trip:Europe</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p><strong>alice</strong> is a <code>booking_viewer</code> and <code>booking_adder</code> because of the following chain of resolution:</p><ol><li><strong>alice</strong> is a <code>owner</code> on <code>trip</code>: <strong>Europe</strong></li><li>Any user related to the <em>object</em> <code>trip:</code><strong>Europe</strong> as <code>owner</code> is also related as a <code>booking_viewer</code></li><li>Any user related to the <em>object</em> <code>trip:</code><strong>Europe</strong> as <code>owner</code> is also related as a <code>booking_adder</code></li><li>Therefore, all <code>owners</code> on a given <code>trip</code> are <code>booking_viewers</code> and <code>booking_adders</code> on that trip</li></ol><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p><strong>Note:</strong> Make sure to use unique ids for each object and user within your application domain when creating relationship tuples for <!-- -->OpenFGA<!-- -->. We are using first names and simple ids to just illustrate an easy-to-follow example.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how to model for roles and permissions.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Concepts: Concentric Relationships</span><p class="documentation-card-box-description_u7_j">Learn about how to represent a concentric relationships in OpenFGA.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/building-blocks/concentric-relationships">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Google Drive</span><p class="documentation-card-box-description_u7_j">See how to indicate that editors are commenters and viewers in Google Drive.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/gdrive#01-individual-permissions">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling GitHub</span><p class="documentation-card-box-description_u7_j">See how to indicate that repository admins are writers and readers in GitHub.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/github#01-permissions-for-individuals-in-an-org">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/roles-and-permissions.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/user-groups"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">User Groups</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/parent-child"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Parent-Child Objects</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before you start</a><ul><li><a href="#direct-access" class="table-of-contents__link toc-highlight">Direct Access</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-understand-how-roles-work-within-our-trip-booking-system" class="table-of-contents__link toc-highlight">01. Understand How Roles Work Within Our Trip Booking System</a></li><li><a href="#02-adding-permissions-for-bookings" class="table-of-contents__link toc-highlight">02. Adding Permissions For Bookings</a></li><li><a href="#03-checking-user-roles-and-their-permissions" class="table-of-contents__link toc-highlight">03. Checking User Roles And Their Permissions</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/docs/modeling/user-groups.html b/docs/modeling/user-groups.html index f2f3ed82e..703a78882 100644 --- a/docs/modeling/user-groups.html +++ b/docs/modeling/user-groups.html @@ -15,14 +15,14 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0 docsWrapper_BCFX"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docPage__5DB"><aside class="theme-doc-sidebar-container docSidebarContainer_b6E3"><div class="sidebarViewport_Xe31"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/authorization-and-openfga">What is OpenFGA</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/concepts">Concepts</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/configuration-language">Configuration Language</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="true" href="/docs/getting-started">Getting Started</a><button aria-label="Toggle the collapsible sidebar category 'Getting Started'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/getting-started/setup-openfga/overview">Setup OpenFGA</a><button aria-label="Toggle the collapsible sidebar category 'Setup OpenFGA'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/install-sdk">Install SDK Client</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/create-store">Create a Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/setup-sdk-client">Setup SDK Client for Store</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/configure-model">Configure Authorization Model</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/update-tuples">Update Relationship Tuples</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-check">Perform a Check</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/perform-list-objects">Perform a List Objects Request</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/framework">Integrate Within a Framework</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/immutable-models">Immutable Authorization Models</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/running-in-production">Production Best Practices</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/getting-started/tuples-api-best-practices">Implementation Best Practices</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" aria-expanded="true" href="/docs/modeling">Modeling Guides</a><button aria-label="Toggle the collapsible sidebar category 'Modeling Guides'" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/getting-started">Get Started with Modeling</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/direct-access">Direct Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/modeling/user-groups">User Groups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/roles-and-permissions">Roles and Permissions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/parent-child">Parent-Child Objects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/blocklists">Blocklists</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/public-access">Public Access</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/multiple-restrictions">Multiple Restrictions</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/custom-roles">Custom Roles</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/contextual-time-based-authorization">Contextual and Time-Based Authorization</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/modeling/organization-context-authorization">Authorization Through Organization Context</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/building-blocks">Building Blocks</a><button aria-label="Toggle the collapsible sidebar category 'Building Blocks'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/advanced">Advanced Use-Cases</a><button aria-label="Toggle the collapsible sidebar category 'Advanced Use-Cases'" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" tabindex="0" href="/docs/modeling/migrating">Migrations</a><button aria-label="Toggle the collapsible sidebar category 'Migrations'" type="button" class="clean-btn menu__caret"></button></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" aria-expanded="false" href="/docs/interacting">Interacting with the API</a><button aria-label="Toggle the collapsible sidebar category 'Interacting with the API'" type="button" class="clean-btn menu__caret"></button></div></li></ul></nav><button type="button" title="Collapse sidebar" aria-label="Collapse sidebar" class="button button--secondary button--outline collapseSidebarButton_PEFL"><svg width="20" height="20" aria-hidden="true" class="collapseSidebarButtonIcon_kv0_"><g fill="#7a7a7a"><path d="M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"></path><path d="M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"></path></g></svg></button></div></div></aside><main class="docMainContainer_gTbr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/modeling"><span itemprop="name">Modeling Guides</span></a><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">User Groups</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><h1>User Groups</h1><p>In this guide you will learn how to add users to groups and grant groups access to an <a href="/docs/concepts#what-is-an-object">object</a> using <a href="/docs/authorization-and-openfga#what-is-openfga">OpenFGA</a>.</p><div class="documentation-card-box-filled_F0BA undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">When to use</span><div><p>Adding a relationship tuple specifying that a group has a relation to an object is helpful in cases where you want to encompass a set of users with the same relation to an object. For example:</p><ul><li>Grant a group of <code>engineers</code> <code>viewer</code> access to <code>roadmap.doc</code></li><li>Create a <code>block_list</code> of <code>members</code> who can't access a <code>document</code></li><li>Sharing a <code>document</code> with a <code>team</code></li><li>Granting <code>viewer</code> access to a <code>photo</code> to <code>followers</code> only</li><li>Making a <code>file</code> viewable for all <code>users</code> within an <code>organization</code></li><li>Restricting access from or to <code>users</code> in a certain <code>locale</code></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="before-you-start">Before you start<a href="#before-you-start" class="hash-link" aria-label="Direct link to Before you start" title="Direct link to Before you start">​</a></h2><p>In order to understand this guide correctly you must be familiar with some <a href="/docs/concepts">OpenFGA Concepts</a> and know how to develop the things that we will list below.</p><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary><p>Assume that you have the following <a href="/docs/concepts#what-is-an-authorization-model">authorization model</a>.<br> You have an <em><a href="/docs/concepts#what-is-an-object">object</a></em> called <code>document</code> that <em>users</em> can be related to as an <code>editor</code>.</p></summary><div><div class="collapsibleContent_i85q"><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><hr><p>In addition, you will need to know the following:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="direct-access">Direct Access<a href="#direct-access" class="hash-link" aria-label="Direct link to Direct Access" title="Direct link to Direct Access">​</a></h3><p>You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. <a href="/docs/modeling/direct-access">Learn more →</a></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="-concepts">OpenFGA<!-- --> Concepts<a href="#-concepts" class="hash-link" aria-label="Direct link to -concepts" title="Direct link to -concepts">​</a></h3><ul><li>A <a href="/docs/concepts#what-is-a-type">Type</a>: a class of objects that have similar characteristics</li><li>A <a href="/docs/concepts#what-is-a-user">User</a>: an entity in the system that can be related to an object</li><li>A <a href="/docs/concepts#what-is-a-relation">Relation</a>: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system</li><li>An <a href="/docs/concepts#what-is-an-object">Object</a>: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model</li><li>A <a href="/docs/concepts#what-is-a-relationship-tuple">Relationship Tuple</a>: a grouping consisting of a user, a relation and an object stored in <!-- -->OpenFGA</li></ul></div></div></details><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step">Step By Step<a href="#step-by-step" class="hash-link" aria-label="Direct link to Step By Step" title="Direct link to Step By Step">​</a></h2><p>As we develop our application, we might encounter use cases where a group of users have a certain role or permission on an object. For example, <code>members</code> of a certain <code>team</code> might have an <code>editor</code> relation to a certain <code>document</code>.</p><p>In order to represent this in <!-- -->OpenFGA<!-- -->, we need:</p><ol><li>Introduce the concept of a <code>team</code> to the authorization model</li><li>Add <em>users</em> as <code>members</code> to the <code>team</code></li><li>Assign the <code>team</code> members a relation to an <em>object</em></li><li>Checking an individual member's access to the <em>object</em></li></ol><h3 class="anchor anchorWithStickyNavbar_LWe7" id="01-introduce-the-concept-of-a-team-to-the-authorization-model">01. Introduce The Concept Of A Team To The Authorization Model<a href="#01-introduce-the-concept-of-a-team-to-the-authorization-model" class="hash-link" aria-label="Direct link to 01. Introduce The Concept Of A Team To The Authorization Model" title="Direct link to 01. Introduce The Concept Of A Team To The Authorization Model">​</a></h3><p>We need to define the <em><a href="/docs/concepts#what-is-an-object">object</a></em> <code>team</code> in our authorization model. In our use case, a <code>team</code> can have <code>member</code>s, so we make the following changes to our authorization model:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">DSL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">JSON</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-dsl.openfga codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dsl.openfga codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">model</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">schema</span><span class="token plain"> 1.1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">user</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">document</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">editor</span><span class="token plain">: </span><span class="token directly-assignable">[team#member]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">type</span><span class="token plain"> </span><span class="token type">team</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">relations</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">define</span><span class="token plain"> </span><span class="token relation">member</span><span class="token plain">: </span><span class="token directly-assignable">[user]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"schema_version"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1.1"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type_definitions"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"editor"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relation"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"this"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"metadata"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"relations"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"member"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"directly_related_user_types"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token property">"type"</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="02-add-users-as-members-to-the-team">02. Add Users As Members To The Team<a href="#02-add-users-as-members-to-the-team" class="hash-link" aria-label="Direct link to 02. Add Users As Members To The Team" title="Direct link to 02. Add Users As Members To The Team">​</a></h3><p>We can now assign <em><a href="/docs/concepts#what-is-a-user">users</a></em> as <code>member</code>s of <code>team</code>s. Let's create a new <em><a href="/docs/concepts#what-is-a-relationship-tuple">relationship tuple</a></em> that states <strong>alice is a member of team:writers</strong>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:alice'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'team:writers'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"team:writers"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:writers"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"team:writers"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"user:alice","relation":"member","object":"team:writers"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice member team:writers</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"team:writers"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="03-assign-the-team-members-a-relation-to-an-object">03. Assign The Team Members A Relation To An Object<a href="#03-assign-the-team-members-a-relation-to-an-object" class="hash-link" aria-label="Direct link to 03. Assign The Team Members A Relation To An Object" title="Direct link to 03. Assign The Team Members A Relation To An Object">​</a></h3><p>To represent groups we use the <code>type:object_id#relation</code> format, which represents the set of users related to the <code>type:object_id</code> as a certain relation. For example, <code>team:writers#members</code> is used to represent the set of users related to the <strong>team:writers</strong> <em>object</em> as <code>member</code>s.</p><p>In order to assign <code>member</code>s of a <code>team</code> a relation to a <code>document</code>, we can create the following <em>relationship tuple</em> that states that <strong>members of team:writers are editors of document:meeting_notes.doc</strong>.</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">writes</span><span class="token operator">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Set of users related to 'team:writers' as 'member'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'team:writers#member'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:meeting_notes.doc'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"> </span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientWriteOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token operator">&</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">ClientTupleKey</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Set of users related to 'team:writers' as 'member'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"team:writers#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">requestBody</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientListObjectsOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Writes </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">List</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)"><</span><span class="token constructor-invocation class-name">ClientTupleKey</span><span class="token constructor-invocation class-name punctuation" style="color:rgb(248, 248, 242)">></span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Set of users related to 'team:writers' as 'member'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"team:writers#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> ClientWriteRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> writes</span><span class="token operator">=</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ClientTuple</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Set of users related to 'team:writers' as 'member'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"team:writers#member"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/write </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"writes": { "tuple_keys" : [{"user":"team:writers#member","relation":"editor","object":"document:meeting_notes.doc"}] }, "authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw"}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga tuple </span><span class="token function" style="color:rgb(80, 250, 123)">write</span><span class="token plain"> --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">${FGA_STORE_ID}</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw team:writers</span><span class="token comment" style="color:rgb(98, 114, 164)">#member editor document:meeting_notes.doc</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">write</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // Set of </span><span class="token function" style="color:rgb(80, 250, 123)">users</span><span class="token plain"> related to </span><span class="token string" style="color:rgb(255, 121, 198)">'team:writers'</span><span class="token plain"> as </span><span class="token string" style="color:rgb(255, 121, 198)">'member'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"team:writers#member"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"relation"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"object"</span><span class="token builtin class-name" style="color:rgb(189, 147, 249)">:</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">]</span><span class="token plain">, </span><span class="token assign-left variable" style="color:rgb(189, 147, 249);font-style:italic">authorization_model_id</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="04-checking-an-individual-members-access-to-an-object">04. Checking An Individual Member's Access To An Object<a href="#04-checking-an-individual-members-access-to-an-object" class="hash-link" aria-label="Direct link to 04. Checking An Individual Member's Access To An Object" title="Direct link to 04. Checking An Individual Member's Access To An Object">​</a></h3><p>Now that we have:</p><ul><li>a relationship tuple indicating that <strong>alice</strong> is an <code>member</code> of <strong>team:writers</strong></li><li>a relationship tuple indicating that <strong>members of team:writers are editors of document:meeting_notes.doc</strong></li></ul><p>This means that if we <!-- -->*<a href="/docs/concepts#what-is-a-check-request">check</a><strong>*<!-- -->is alice an editor of document:meeting_notes.doc</strong>? We would get the following:</p><div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">Node.js</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Go</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">.NET</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Python</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">CLI</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">curl</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">Pseudocode</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> </span><span class="token maybe-class-name">OpenFgaClient</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">require</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'@openfga/sdk'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiScheme</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_SCHEME</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">apiHost</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_API_HOST</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">storeId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_STORE_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorizationModelId</span><span class="token operator">:</span><span class="token plain"> process</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token property-access">env</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token constant" style="color:rgb(189, 147, 249)">FGA_MODEL_ID</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// Run a check</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"> allowed </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token method function property-access" style="color:rgb(80, 250, 123)">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">user</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'user:alice'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">relation</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'editor'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">object</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'document:meeting_notes.doc'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token literal-property property">authorization_model_id</span><span class="token operator">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'1uHxCSuTP0VKPYSnkq1pbb1jeZw'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"github.com/openfga/go-sdk/client"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"os"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">func</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">NewSdkClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token operator">&</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Getenv</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> err </span><span class="token operator">!=</span><span class="token plain"> </span><span class="token boolean">nil</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// .. Handle error</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-go codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-go codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">:=</span><span class="token plain"> ClientCheckOptions</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> openfga</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">PtrString</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">:=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">data</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> err </span><span class="token operator">:=</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Background</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Execute</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// data = { allowed: true }</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)">// ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// import the SDK</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Client</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token namespace">OpenFga</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Sdk</span><span class="token namespace punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token namespace">Model</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">using</span><span class="token plain"> </span><span class="token class-name">Environment</span><span class="token plain"> </span><span class="token operator">=</span><span class="token plain"> </span><span class="token class-name">System</span><span class="token class-name punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token class-name">Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">namespace</span><span class="token plain"> </span><span class="token namespace">Example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">class</span><span class="token plain"> </span><span class="token class-name">Example</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">public</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">static</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token return-type class-name">Task</span><span class="token plain"> </span><span class="token function" style="color:rgb(80, 250, 123)">Main</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Initialize the SDK with no auth - see "How to setup SDK client" for more options</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> configuration </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiScheme </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_SCHEME"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ApiHost </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_API_HOST"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> StoreId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_STORE_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> Environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">GetEnvironmentVariable</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">"FGA_MODEL_ID"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)">// Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> fgaClient </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-dotnet codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotnet codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckOptions</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> AuthorizationModelId </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> body </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">new</span><span class="token plain"> </span><span class="token constructor-invocation class-name">ClientCheckRequest</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> User </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> Object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token class-name keyword" style="color:rgb(189, 147, 249);font-style:italic">var</span><span class="token plain"> response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token function" style="color:rgb(80, 250, 123)">Check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)">// response.Allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Initialize the SDK</summary><div><div class="collapsibleContent_i85q"><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token comment" style="color:rgb(98, 114, 164)"># ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional.</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> os</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> json</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> openfga_sdk</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">from</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">client </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">import</span><span class="token plain"> OpenFgaClient</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">configuration </span><span class="token operator">=</span><span class="token plain"> openfga_sdk</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">ClientConfiguration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_scheme </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_SCHEME'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Either "http" or "https", defaults to "https"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_host </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_API_HOST'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> store_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_STORE_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_model_id </span><span class="token operator">=</span><span class="token plain"> os</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">environ</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">get</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token string" style="color:rgb(255, 121, 198)">'FGA_MODEL_ID'</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Optional, can be overridden per request</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Enter a context with an instance of the OpenFgaClient</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">async</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">with</span><span class="token plain"> OpenFgaClient</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">configuration</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">as</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> api_response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">read_authorization_models</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">close</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-python codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-python codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">options </span><span class="token operator">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"authorization_model_id"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">body </span><span class="token operator">=</span><span class="token plain"> ClientCheckRequest</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token builtin" style="color:rgb(189, 147, 249)">object</span><span class="token operator">=</span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">response </span><span class="token operator">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">await</span><span class="token plain"> fga_client</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">body</span><span class="token punctuation" style="color:rgb(248, 248, 242)">,</span><span class="token plain"> options</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># response.allowed = true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">fga query check --store-id</span><span class="token operator">=</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain"> --model-id</span><span class="token operator">=</span><span class="token plain">1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice editor document:meeting_notes.doc</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)</summary><div><div class="collapsibleContent_i85q"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">Set FGA_SERVER_URL according to the </span><span class="token function" style="color:rgb(80, 250, 123)">service</span><span class="token plain"> you are using </span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain">e.g. https://api.fga.example</span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token function" style="color:rgb(80, 250, 123)">curl</span><span class="token plain"> -X POST </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_SERVER_URL</span><span class="token plain">/stores/</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_STORE_ID</span><span class="token plain">/check </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"Authorization: Bearer </span><span class="token string variable" style="color:rgb(189, 147, 249);font-style:italic">$FGA_API_TOKEN</span><span class="token string" style="color:rgb(255, 121, 198)">"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Not needed if service does not require authorization</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -H </span><span class="token string" style="color:rgb(255, 121, 198)">"content-type: application/json"</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -d </span><span class="token string" style="color:rgb(255, 121, 198)">'{"authorization_model_id": "1uHxCSuTP0VKPYSnkq1pbb1jeZw", "tuple_key":{"user":"user:alice","relation":"editor","object":"document:meeting_notes.doc"}}'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token comment" style="color:rgb(98, 114, 164)"># Response: {"allowed":true}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">check</span><span class="token punctuation" style="color:rgb(248, 248, 242)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> user </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"user:alice"</span><span class="token plain">, // check </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">if</span><span class="token plain"> the user </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">user:alice</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> relation </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"editor"</span><span class="token plain">, // has an </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">editor</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"> relation</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> object </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"document:meeting_notes.doc"</span><span class="token plain">, // with the object </span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">document:meeting_notes.doc</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> authorization_id </span><span class="token operator">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1uHxCSuTP0VKPYSnkq1pbb1jeZw"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token punctuation" style="color:rgb(248, 248, 242)">)</span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">Reply: </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div><p>The chain of resolution becomes:</p><ul><li><strong>alice</strong> is <code>member</code> of <strong>team:writers</strong></li><li><code>member</code>s of <strong>team:writers</strong> are <code>editor</code>s of <strong>document:meeting_notes</strong></li><li>therefore, <strong>alice</strong> is <code>editor</code> of <strong>document:meeting_notes</strong></li></ul><div class="theme-admonition theme-admonition-caution alert alert--warning admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>caution</div><div class="admonitionContent_S0QG"><p><strong>Note:</strong> When creating relationship tuples for <!-- -->OpenFGA<!-- --> make sure to use unique ids for each object and user within your application domain. We're using first names and simple ids to just illustrate an easy-to-follow example.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="related-sections">Related Sections<a href="#related-sections" class="hash-link" aria-label="Direct link to Related Sections" title="Direct link to Related Sections">​</a></h2><div><div class="documentation-related-section-description_Un_N"><span>Check the following sections for more on how user groups can be used.</span></div><div class="column-layout-3_YXBy"><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Managing Group Membership</span><p class="documentation-card-box-description_u7_j">Learn how to add and remove users from groups</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/interacting/managing-group-membership">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling Google Drive</span><p class="documentation-card-box-description_u7_j">See how User Groups can be used to share documents within a domain in the Google Drive use-case.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/gdrive#02-organization-permissions">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div><div class="documentation-card-box_SNqO undefined undefined"><div class="documentation-card-box-content_Z5TD"><span class="documentation-card-box-title_sKX3">Modeling GitHub</span><p class="documentation-card-box-description_u7_j">Granting teams permissions to a repo in the GitHub use-case.</p><div class="documentation-card-box-links_XUmL documentation-card-box-links-none_sQ2X"><ul><li><a class="documentation-card-box-link_yEiX" href="/docs/modeling/advanced/github#02-permissions-for-teams-in-an-org">More</a></li></ul></div><div class="documentation-card-box-children_i280"></div></div></div></div></div></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/openfga/openfga.dev/edit/main/docs/content/modeling/user-groups.mdx" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_vwxv"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/modeling/direct-access"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Direct Access</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/modeling/roles-and-permissions"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Roles and Permissions</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#before-you-start" class="table-of-contents__link toc-highlight">Before you start</a><ul><li><a href="#direct-access" class="table-of-contents__link toc-highlight">Direct Access</a></li><li><a href="#-concepts" class="table-of-contents__link toc-highlight"><productname format="{ProductNameFormat.ShortForm}/"> Concepts</productname></a></li></ul></li><li><a href="#step-by-step" class="table-of-contents__link toc-highlight">Step By Step</a><ul><li><a href="#01-introduce-the-concept-of-a-team-to-the-authorization-model" class="table-of-contents__link toc-highlight">01. Introduce The Concept Of A Team To The Authorization Model</a></li><li><a href="#02-add-users-as-members-to-the-team" class="table-of-contents__link toc-highlight">02. Add Users As Members To The Team</a></li><li><a href="#03-assign-the-team-members-a-relation-to-an-object" class="table-of-contents__link toc-highlight">03. Assign The Team Members A Relation To An Object</a></li><li><a href="#04-checking-an-individual-members-access-to-an-object" class="table-of-contents__link toc-highlight">04. Checking An Individual Member's Access To An Object</a></li></ul></li><li><a href="#related-sections" class="table-of-contents__link toc-highlight">Related Sections</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__links text--center"><div class="footer__links"><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><span class="footer__link-separator">·</span><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><span class="footer__link-separator">·</span><a href="https://github.com/openfga" target="_blank" rel="noopener noreferrer" class="header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a></div></div><div class="footer__bottom text--center"><div class="footer__copyright"><div><a href="https://www.linuxfoundation.org/trademark-usage"><img src="/img/cncf-icon-white.svg" alt="CNCF" style="vertical-align:middle; margin-right:8px;"></a> © 2023 <a href="https://www.linuxfoundation.org/" target="_blank">The Linux Foundation</a>®. All rights reserved. <span class="display-on-desktop">For a list of trademarks of The Linux Foundation, see our <a href="https://www.linuxfoundation.org/trademark-usage" class="light-text" target="blank">Trademark Usage page</a>.</span></div></div></div></div></footer></div></div> -<script src="/assets/js/runtime~main.402a86f8.js"></script> -<script src="/assets/js/main.2aa7aeed.js"></script> +<script src="/assets/js/runtime~main.685ea9a0.js"></script> +<script src="/assets/js/main.18bf920b.js"></script> </body> </html> \ No newline at end of file diff --git a/index.html b/index.html index 508d8b793..11cc7f023 100644 --- a/index.html +++ b/index.html @@ -15,13 +15,13 @@ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"> <script src="https://js.hs-scripts.com/24392211.js" charset="UTF-8" id="hs-script-loader" async defer="defer"></script><link rel="stylesheet" href="/assets/css/styles.3982e0b2.css"> -<link rel="preload" href="/assets/js/runtime~main.402a86f8.js" as="script"> -<link rel="preload" href="/assets/js/main.2aa7aeed.js" as="script"> +<link rel="preload" href="/assets/js/runtime~main.685ea9a0.js" as="script"> +<link rel="preload" href="/assets/js/main.18bf920b.js" as="script"> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus"> <div class="CustomizedRoot"><div id="__docusaurus-base-url-issue-banner-container"></div><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" target="_self" href="/"><div class="navbar__logo"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--light_HNdA"><img src="/img/openfga_logo.svg" alt="OpenFGA" class="themedImage_ToTc themedImage--dark_i4oU"></div></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/">Home</a><a class="navbar__item navbar__link" href="/docs/authorization-and-openfga">Docs</a><a class="navbar__item navbar__link" href="/api/service">API</a><a class="navbar__item navbar__link" href="/blog">Blog</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-github-link" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-twitter-link" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-social header-discord-link" aria-label="OpenFGA on Discord">Discord</a><div class="searchBox_ZlJk"><div class="navbar__search searchBarContainer_NW3z"><input placeholder="Search" aria-label="Search" class="navbar__search-input"><div class="loadingRing_RJI3 searchBarLoadingRing_YnHq"><div></div><div></div><div></div><div></div></div></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><header><div class="container__no-padding"><div class="grid_OmBo"><div></div><div></div></div><div class="social-media-banner_EIek"><a href="https://github.com/openfga/openfga" target="_blank" rel="noopener noreferrer" class="social-media-banner-item_bn21 social-media-banner-github_kjwB" aria-label="OpenFGA on GitHub">GitHub</a><a href="https://twitter.com/OpenFGA" target="_blank" rel="noopener noreferrer" class="social-media-banner-item_bn21 social-media-banner-twitter_Se7d" aria-label="OpenFGA on Twitter">Twitter</a><a href="https://discord.gg/8naAwJfWN6" target="_blank" rel="noopener noreferrer" class="social-media-banner-item_bn21 social-media-banner-discord_KKCg" aria-label="OpenFGA on Discord">Discord</a></div><div class="container_Xn_q"><div class="content_mBeF"><h1 class="heading_OPPZ"><svg width="413" height="89" viewBox="0 0 472 101" fill="none" xmlns="http://www.w3.org/2000/svg"><title id="title" lang="en">OpenFGA LogoRelationship-based access control made fast, scalable, and easy to use.

OpenFGA is an open-source authorization solution that allows developers to build granular access control using an easy-to-read modeling language and friendly APIs.

Quick Start

Trying OpenFGA is as easy as...

Run the following snippet in a terminal in an environment with Docker installed:

docker pull openfga/openfga && \
docker run -p 8080:8080 -p 8081:8081 \
-p 3000:3000 openfga/openfga run

OpenFGA will be running at localhost:8080 on your machine. Learn about other options and next steps in the project README.md or Getting Started guides.

Learn how to use sample authorization models and create your own with the project’s extensive documentation.

Features

Model any authorization system

OpenFGA takes the best ideas from Google's Zanzibar paper for Relationship-Based Access Control, and also solves problems for Role-based Access Control and Attribute-Based Access Control use cases. The modeling language is powerful enough for engineers, but friendly enough for other stakeholders on your team as well.

Works with your code

SDKs for the most popular languages have already been written, making it easy to integrate and grow alongside your applications. OpenFGA also makes it trivial to contribute new SDKs to support your project's language.

Blazing fast

OpenFGA is designed to answer authorization check calls in milliseconds, which lets it scale with projects of any size. It works just as well for small startups and hobby programmers building single applications as it does for enterprise companies building platforms on a global scale.

Built in the open

Transparency and peer review are important for building secure, stable, and sustainable software. OpenFGA's RFC process and governance model invite anyone to become a contributor, and collaboratively develop the public roadmap. Come create the next standard for authorization with us!

CNCF Sandbox Project

We are a Cloud Native Computing Foundation sandbox project.

Get Involved

Join OpenFGA's active Discord community, check out existing RFCs to understand where the project is headed, start a discussion about your authorization needs or questions, and learn more about how to take part by reading our CONTRIBUTING.md.

Learn how to get involved →

Since you're here, you might be interested in some ReBAC resources:

- - + + \ No newline at end of file diff --git a/search-index.json b/search-index.json index 35c28ad9f..a633f7987 100644 --- a/search-index.json +++ b/search-index.json @@ -1 +1 @@ -[{"documents":[{"i":1,"t":"","u":"/blog/archive","b":["Home"]},{"i":2,"t":"Conditional Relationship Tuples for OpenFGA","u":"/blog/conditional-tuples-announcement","b":["Home"]},{"i":12,"t":"Introduction to Authorization and OpenFGA","u":"/docs/authorization-and-openfga","b":["Home"]},{"i":26,"t":"Join the OpenFGA team at KubeCon NA 2023","u":"/blog/kubecon-na-2023","b":["Home"]},{"i":28,"t":"Getting Started","u":"/docs/getting-started","b":["Home","Getting Started"]},{"i":32,"t":"Configure Authorization Model for a Store","u":"/docs/getting-started/configure-model","b":["Home","Getting Started"]},{"i":40,"t":"Create a Store","u":"/docs/getting-started/create-store","b":["Home","Getting Started"]},{"i":44,"t":"Configuration Language","u":"/docs/configuration-language","b":["Home"]},{"i":64,"t":"Immutable Authorization Models","u":"/docs/getting-started/immutable-models","b":["Home","Getting Started"]},{"i":76,"t":"Install SDK Client","u":"/docs/getting-started/install-sdk","b":["Home","Getting Started"]},{"i":90,"t":"Perform a Check","u":"/docs/getting-started/perform-check","b":["Home","Getting Started"]},{"i":102,"t":"Integrate Within a Framework","u":"/docs/getting-started/framework","b":["Home","Getting Started"]},{"i":116,"t":"Perform a List Objects call","u":"/docs/getting-started/perform-list-objects","b":["Home","Getting Started"]},{"i":128,"t":"Running OpenFGA in Production","u":"/docs/getting-started/running-in-production","b":["Home","Getting Started"]},{"i":136,"t":"☸️ Setup OpenFGA with Kubernetes","u":"/docs/getting-started/setup-openfga/kubernetes","b":["Home","Getting Started","Setup OpenFGA"]},{"i":138,"t":"🐳 Setup OpenFGA with Docker","u":"/docs/getting-started/setup-openfga/docker","b":["Home","Getting Started","Setup OpenFGA"]},{"i":166,"t":"Setup OpenFGA","u":"/docs/getting-started/setup-openfga/overview","b":["Home","Getting Started","Setup OpenFGA"]},{"i":168,"t":"Concepts","u":"/docs/concepts","b":["Home"]},{"i":204,"t":"Best Practices of Managing Tuples and Invoking APIs","u":"/docs/getting-started/tuples-api-best-practices","b":["Home","Getting Started"]},{"i":212,"t":"Setup SDK Client for Store","u":"/docs/getting-started/setup-sdk-client","b":["Home","Getting Started"]},{"i":220,"t":"Interacting with the API","u":"/docs/interacting","b":["Home","Interacting with the API"]},{"i":224,"t":"Managing Group Access","u":"/docs/interacting/managing-group-access","b":["Home","Interacting with the API"]},{"i":241,"t":"Update Relationship Tuples","u":"/docs/getting-started/update-tuples","b":["Home","Getting Started"]},{"i":255,"t":"Managing User Access","u":"/docs/interacting/managing-user-access","b":["Home","Interacting with the API"]},{"i":270,"t":"Managing Group Membership","u":"/docs/interacting/managing-group-membership","b":["Home","Interacting with the API"]},{"i":287,"t":"How to get tuple changes","u":"/docs/interacting/read-tuple-changes","b":["Home","Interacting with the API"]},{"i":299,"t":"Search With Permissions","u":"/docs/interacting/search-with-permissions","b":["Home","Interacting with the API"]},{"i":313,"t":"Modeling Guides","u":"/docs/modeling","b":["Home","Modeling Guides"]},{"i":317,"t":"Transactional Writes","u":"/docs/interacting/transactional-writes","b":["Home","Interacting with the API"]},{"i":334,"t":"Advanced Use-Cases","u":"/docs/modeling/advanced","b":["Home","Modeling Guides","Advanced Use-Cases"]},{"i":340,"t":"Building Blocks","u":"/docs/modeling/building-blocks","b":["Home","Modeling Guides","Building Blocks"]},{"i":344,"t":"Blocklists","u":"/docs/modeling/blocklists","b":["Home","Modeling Guides"]},{"i":362,"t":"Concentric Relationships","u":"/docs/modeling/building-blocks/concentric-relationships","b":["Home","Modeling Guides","Building Blocks"]},{"i":378,"t":"Usersets","u":"/docs/modeling/building-blocks/usersets","b":["Home","Modeling Guides","Building Blocks"]},{"i":389,"t":"Custom Roles","u":"/docs/modeling/custom-roles","b":["Home","Modeling Guides"]},{"i":413,"t":"Get Started with Modeling","u":"/docs/modeling/getting-started","b":["Home","Modeling Guides"]},{"i":433,"t":"Migrating","u":"/docs/modeling/migrating","b":["Home","Modeling Guides","Migrations"]},{"i":437,"t":"Direct Access","u":"/docs/modeling/direct-access","b":["Home","Modeling Guides"]},{"i":451,"t":"Migrating Models To Schema 1.1","u":"/docs/modeling/migrating/migrating-schema-1-1","b":["Home","Modeling Guides","Migrations"]},{"i":471,"t":"Multiple Restrictions","u":"/docs/modeling/multiple-restrictions","b":["Home","Modeling Guides"]},{"i":489,"t":"Parent-Child Objects","u":"/docs/modeling/parent-child","b":["Home","Modeling Guides"]},{"i":511,"t":"Public Access","u":"/docs/modeling/public-access","b":["Home","Modeling Guides"]},{"i":527,"t":"User Groups","u":"/docs/modeling/user-groups","b":["Home","Modeling Guides"]},{"i":547,"t":"Managing Relationships Between Objects","u":"/docs/interacting/managing-relationships-between-objects","b":["Home","Interacting with the API"]},{"i":569,"t":"Relationship Queries: Check, Read, Expand, and ListObjects","u":"/docs/interacting/relationship-queries","b":["Home","Interacting with the API"]},{"i":607,"t":"Object to Object Relationships","u":"/docs/modeling/building-blocks/object-to-object-relationships","b":["Home","Modeling Guides","Building Blocks"]},{"i":634,"t":"Direct Relationships","u":"/docs/modeling/building-blocks/direct-relationships","b":["Home","Modeling Guides","Building Blocks"]},{"i":654,"t":"Authorization Through Organization Context","u":"/docs/modeling/organization-context-authorization","b":["Home","Modeling Guides"]},{"i":676,"t":"Roles and Permissions","u":"/docs/modeling/roles-and-permissions","b":["Home","Modeling Guides"]},{"i":694,"t":"Migrating Relations","u":"/docs/modeling/migrating/migrating-relations","b":["Home","Modeling Guides","Migrations"]},{"i":710,"t":"Modeling Entitlements for a System with OpenFGA","u":"/docs/modeling/advanced/entitlements","b":["Home","Modeling Guides","Advanced Use-Cases"]},{"i":731,"t":"Modeling GitHub permissions with OpenFGA","u":"/docs/modeling/advanced/github","b":["Home","Modeling Guides","Advanced Use-Cases"]},{"i":754,"t":"Contextual and Time-Based Authorization","u":"/docs/modeling/contextual-time-based-authorization","b":["Home","Modeling Guides"]},{"i":778,"t":"Modeling Authorization for an IoT Security System with OpenFGA","u":"/docs/modeling/advanced/iot","b":["Home","Modeling Guides","Advanced Use-Cases"]},{"i":806,"t":"Modeling Authorization for Slack with OpenFGA","u":"/docs/modeling/advanced/slack","b":["Home","Modeling Guides","Advanced Use-Cases"]},{"i":830,"t":"Modeling Google Drive permissions with OpenFGA","u":"/docs/modeling/advanced/gdrive","b":["Home","Modeling Guides","Advanced Use-Cases"]}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/1",[]],["t/2",[0,3.155,1,1.759,2,2.202,3,1.316]],["t/12",[3,1.499,4,3.593,5,2.003]],["t/26",[3,1.058,6,2.536,7,2.536,8,2.536,9,2.536,10,2.536]],["t/28",[11,4.172,12,3.586]],["t/32",[5,1.759,13,2.712,14,1.467,15,2.42]],["t/40",[15,3.2,16,4.172]],["t/44",[13,3.586,17,4.172]],["t/64",[5,2.003,14,1.671,18,3.593]],["t/76",[19,3.593,20,3.088,21,3.088]],["t/90",[22,3.586,23,3.586]],["t/102",[24,3.593,25,3.593,26,3.593]],["t/116",[22,2.712,27,3.155,28,2.202,29,3.155]],["t/128",[3,1.499,30,3.593,31,3.593]],["t/136",[3,1.316,32,2.712,33,2.202,34,3.155]],["t/138",[3,1.316,32,2.712,33,2.202,35,3.155]],["t/166",[3,1.74,33,2.912]],["t/168",[36,4.973]],["t/204",[2,1.77,37,2.536,38,2.536,39,1.63,40,2.536,41,2.18]],["t/212",[15,2.42,20,2.712,21,2.712,33,2.202]],["t/220",[41,3.586,42,4.172]],["t/224",[39,2.309,43,2.756,44,2.508]],["t/241",[1,2.003,2,2.508,45,3.593]],["t/255",[39,2.309,44,2.508,46,3.088]],["t/270",[39,2.309,43,2.756,47,3.593]],["t/287",[2,2.912,48,4.172]],["t/299",[49,4.172,50,2.912]],["t/313",[14,1.94,51,4.172]],["t/317",[52,4.172,53,4.172]],["t/334",[54,3.593,55,3.593,56,3.593]],["t/340",[57,4.172,58,4.172]],["t/344",[59,4.973]],["t/362",[1,2.326,60,4.172]],["t/378",[61,4.973]],["t/389",[62,4.172,63,3.586]],["t/413",[12,3.586,14,1.94]],["t/433",[64,3.815]],["t/437",[44,2.912,65,3.586]],["t/451",[14,1.467,64,2.42,66,3.155,67,3.155]],["t/471",[68,4.172,69,4.172]],["t/489",[28,2.508,70,3.593,71,3.593]],["t/511",[44,2.912,72,4.172]],["t/527",[43,3.2,46,3.586]],["t/547",[1,1.759,28,2.202,39,2.028,73,3.155]],["t/569",[1,1.414,23,2.18,74,2.536,75,2.536,76,2.536,77,2.536]],["t/607",[1,2.003,28,3.461]],["t/634",[1,2.326,65,3.586]],["t/654",[5,1.759,78,3.155,79,3.155,80,3.155]],["t/676",[50,2.912,63,3.586]],["t/694",[64,3.2,81,4.172]],["t/710",[3,1.316,14,1.467,82,3.155,83,2.712]],["t/731",[3,1.316,14,1.467,50,2.202,84,3.155]],["t/754",[5,1.759,85,3.155,86,3.155,87,3.155]],["t/778",[3,1.058,5,1.414,14,1.18,83,2.18,88,2.536,89,2.536]],["t/806",[3,1.316,5,1.759,14,1.467,90,3.155]],["t/830",[3,1.173,14,1.308,50,1.963,91,2.812,92,2.812]]],"invertedIndex":[["",{"_index":32,"t":{"136":{"position":[[0,2]]},"138":{"position":[[0,2]]}}}],["1.1",{"_index":67,"t":{"451":{"position":[[27,3]]}}}],["2023",{"_index":10,"t":{"26":{"position":[[36,4]]}}}],["access",{"_index":44,"t":{"224":{"position":[[15,6]]},"255":{"position":[[14,6]]},"437":{"position":[[7,6]]},"511":{"position":[[7,6]]}}}],["advanc",{"_index":54,"t":{"334":{"position":[[0,8]]}}}],["api",{"_index":41,"t":{"204":{"position":[[47,4]]},"220":{"position":[[21,3]]}}}],["author",{"_index":5,"t":{"12":{"position":[[16,13]]},"32":{"position":[[10,13]]},"64":{"position":[[10,13]]},"654":{"position":[[0,13]]},"754":{"position":[[26,13]]},"778":{"position":[[9,13]]},"806":{"position":[[9,13]]}}}],["base",{"_index":87,"t":{"754":{"position":[[20,5]]}}}],["best",{"_index":37,"t":{"204":{"position":[[0,4]]}}}],["between",{"_index":73,"t":{"547":{"position":[[23,7]]}}}],["block",{"_index":58,"t":{"340":{"position":[[9,6]]}}}],["blocklist",{"_index":59,"t":{"344":{"position":[[0,10]]}}}],["build",{"_index":57,"t":{"340":{"position":[[0,8]]}}}],["call",{"_index":29,"t":{"116":{"position":[[23,4]]}}}],["case",{"_index":56,"t":{"334":{"position":[[13,5]]}}}],["chang",{"_index":48,"t":{"287":{"position":[[17,7]]}}}],["check",{"_index":23,"t":{"90":{"position":[[10,5]]},"569":{"position":[[22,6]]}}}],["child",{"_index":71,"t":{"489":{"position":[[7,5]]}}}],["client",{"_index":21,"t":{"76":{"position":[[12,6]]},"212":{"position":[[10,6]]}}}],["concentr",{"_index":60,"t":{"362":{"position":[[0,10]]}}}],["concept",{"_index":36,"t":{"168":{"position":[[0,8]]}}}],["condit",{"_index":0,"t":{"2":{"position":[[0,11]]}}}],["configur",{"_index":13,"t":{"32":{"position":[[0,9]]},"44":{"position":[[0,13]]}}}],["context",{"_index":80,"t":{"654":{"position":[[35,7]]}}}],["contextu",{"_index":85,"t":{"754":{"position":[[0,10]]}}}],["creat",{"_index":16,"t":{"40":{"position":[[0,6]]}}}],["custom",{"_index":62,"t":{"389":{"position":[[0,6]]}}}],["direct",{"_index":65,"t":{"437":{"position":[[0,6]]},"634":{"position":[[0,6]]}}}],["docker",{"_index":35,"t":{"138":{"position":[[22,6]]}}}],["drive",{"_index":92,"t":{"830":{"position":[[16,5]]}}}],["entitl",{"_index":82,"t":{"710":{"position":[[9,12]]}}}],["expand",{"_index":76,"t":{"569":{"position":[[35,7]]}}}],["framework",{"_index":26,"t":{"102":{"position":[[19,9]]}}}],["get",{"_index":11,"t":{"28":{"position":[[0,7]]}}}],["github",{"_index":84,"t":{"731":{"position":[[9,6]]}}}],["googl",{"_index":91,"t":{"830":{"position":[[9,6]]}}}],["group",{"_index":43,"t":{"224":{"position":[[9,5]]},"270":{"position":[[9,5]]},"527":{"position":[[5,6]]}}}],["guid",{"_index":51,"t":{"313":{"position":[[9,6]]}}}],["immut",{"_index":18,"t":{"64":{"position":[[0,9]]}}}],["instal",{"_index":19,"t":{"76":{"position":[[0,7]]}}}],["integr",{"_index":24,"t":{"102":{"position":[[0,9]]}}}],["interact",{"_index":42,"t":{"220":{"position":[[0,11]]}}}],["introduct",{"_index":4,"t":{"12":{"position":[[0,12]]}}}],["invok",{"_index":40,"t":{"204":{"position":[[38,8]]}}}],["iot",{"_index":88,"t":{"778":{"position":[[30,3]]}}}],["join",{"_index":6,"t":{"26":{"position":[[0,4]]}}}],["kubecon",{"_index":8,"t":{"26":{"position":[[25,7]]}}}],["kubernet",{"_index":34,"t":{"136":{"position":[[22,10]]}}}],["languag",{"_index":17,"t":{"44":{"position":[[14,8]]}}}],["list",{"_index":27,"t":{"116":{"position":[[10,4]]}}}],["listobject",{"_index":77,"t":{"569":{"position":[[47,11]]}}}],["manag",{"_index":39,"t":{"204":{"position":[[18,8]]},"224":{"position":[[0,8]]},"255":{"position":[[0,8]]},"270":{"position":[[0,8]]},"547":{"position":[[0,8]]}}}],["membership",{"_index":47,"t":{"270":{"position":[[15,10]]}}}],["migrat",{"_index":64,"t":{"433":{"position":[[0,9]]},"451":{"position":[[0,9]]},"694":{"position":[[0,9]]}}}],["model",{"_index":14,"t":{"32":{"position":[[24,5]]},"64":{"position":[[24,6]]},"313":{"position":[[0,8]]},"413":{"position":[[17,8]]},"451":{"position":[[10,6]]},"710":{"position":[[0,8]]},"731":{"position":[[0,8]]},"778":{"position":[[0,8]]},"806":{"position":[[0,8]]},"830":{"position":[[0,8]]}}}],["multipl",{"_index":68,"t":{"471":{"position":[[0,8]]}}}],["na",{"_index":9,"t":{"26":{"position":[[33,2]]}}}],["object",{"_index":28,"t":{"116":{"position":[[15,7]]},"489":{"position":[[13,7]]},"547":{"position":[[31,7]]},"607":{"position":[[0,6],[10,6]]}}}],["openfga",{"_index":3,"t":{"2":{"position":[[36,7]]},"12":{"position":[[34,7]]},"26":{"position":[[9,7]]},"128":{"position":[[8,7]]},"136":{"position":[[9,7]]},"138":{"position":[[9,7]]},"166":{"position":[[6,7]]},"710":{"position":[[40,7]]},"731":{"position":[[33,7]]},"778":{"position":[[55,7]]},"806":{"position":[[38,7]]},"830":{"position":[[39,7]]}}}],["organ",{"_index":79,"t":{"654":{"position":[[22,12]]}}}],["parent",{"_index":70,"t":{"489":{"position":[[0,6]]}}}],["perform",{"_index":22,"t":{"90":{"position":[[0,7]]},"116":{"position":[[0,7]]}}}],["permiss",{"_index":50,"t":{"299":{"position":[[12,11]]},"676":{"position":[[10,11]]},"731":{"position":[[16,11]]},"830":{"position":[[22,11]]}}}],["practic",{"_index":38,"t":{"204":{"position":[[5,9]]}}}],["product",{"_index":31,"t":{"128":{"position":[[19,10]]}}}],["public",{"_index":72,"t":{"511":{"position":[[0,6]]}}}],["queri",{"_index":74,"t":{"569":{"position":[[13,8]]}}}],["read",{"_index":75,"t":{"569":{"position":[[29,5]]}}}],["relat",{"_index":81,"t":{"694":{"position":[[10,9]]}}}],["relationship",{"_index":1,"t":{"2":{"position":[[12,12]]},"241":{"position":[[7,12]]},"362":{"position":[[11,13]]},"547":{"position":[[9,13]]},"569":{"position":[[0,12]]},"607":{"position":[[17,13]]},"634":{"position":[[7,13]]}}}],["restrict",{"_index":69,"t":{"471":{"position":[[9,12]]}}}],["role",{"_index":63,"t":{"389":{"position":[[7,5]]},"676":{"position":[[0,5]]}}}],["run",{"_index":30,"t":{"128":{"position":[[0,7]]}}}],["schema",{"_index":66,"t":{"451":{"position":[[20,6]]}}}],["sdk",{"_index":20,"t":{"76":{"position":[[8,3]]},"212":{"position":[[6,3]]}}}],["search",{"_index":49,"t":{"299":{"position":[[0,6]]}}}],["secur",{"_index":89,"t":{"778":{"position":[[34,8]]}}}],["setup",{"_index":33,"t":{"136":{"position":[[3,5]]},"138":{"position":[[3,5]]},"166":{"position":[[0,5]]},"212":{"position":[[0,5]]}}}],["slack",{"_index":90,"t":{"806":{"position":[[27,5]]}}}],["start",{"_index":12,"t":{"28":{"position":[[8,7]]},"413":{"position":[[4,7]]}}}],["store",{"_index":15,"t":{"32":{"position":[[36,5]]},"40":{"position":[[9,5]]},"212":{"position":[[21,5]]}}}],["system",{"_index":83,"t":{"710":{"position":[[28,6]]},"778":{"position":[[43,6]]}}}],["team",{"_index":7,"t":{"26":{"position":[[17,4]]}}}],["through",{"_index":78,"t":{"654":{"position":[[14,7]]}}}],["time",{"_index":86,"t":{"754":{"position":[[15,4]]}}}],["transact",{"_index":52,"t":{"317":{"position":[[0,13]]}}}],["tupl",{"_index":2,"t":{"2":{"position":[[25,6]]},"204":{"position":[[27,6]]},"241":{"position":[[20,6]]},"287":{"position":[[11,5]]}}}],["updat",{"_index":45,"t":{"241":{"position":[[0,6]]}}}],["us",{"_index":55,"t":{"334":{"position":[[9,3]]}}}],["user",{"_index":46,"t":{"255":{"position":[[9,4]]},"527":{"position":[[0,4]]}}}],["userset",{"_index":61,"t":{"378":{"position":[[0,8]]}}}],["within",{"_index":25,"t":{"102":{"position":[[10,6]]}}}],["write",{"_index":53,"t":{"317":{"position":[[14,6]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":4,"t":"Use Cases","u":"/blog/conditional-tuples-announcement","h":"#use-cases","p":2},{"i":6,"t":"How to use it?","u":"/blog/conditional-tuples-announcement","h":"#how-to-use-it","p":2},{"i":8,"t":"What’s Next?","u":"/blog/conditional-tuples-announcement","h":"#whats-next","p":2},{"i":10,"t":"Reach out!","u":"/blog/conditional-tuples-announcement","h":"#reach-out","p":2},{"i":14,"t":"What Is OpenFGA?","u":"/docs/authorization-and-openfga","h":"#what-is-openfga","p":12},{"i":16,"t":"Authentication vs Authorization","u":"/docs/authorization-and-openfga","h":"#authentication-vs-authorization","p":12},{"i":18,"t":"What Is Fine-Grained Authorization (FGA)?","u":"/docs/authorization-and-openfga","h":"#what-is-fine-grained-authorization-fga","p":12},{"i":20,"t":"What Are Role-Based Access Control (RBAC) And Attribute-Based Access Control (ABAC)?","u":"/docs/authorization-and-openfga","h":"#what-are-role-based-access-control-rbac-and-attribute-based-access-control-abac","p":12},{"i":22,"t":"What Is Relationship Based Access Control (ReBAC)?","u":"/docs/authorization-and-openfga","h":"#what-is-relationship-based-access-control-rebac","p":12},{"i":24,"t":"What Is Zanzibar?","u":"/docs/authorization-and-openfga","h":"#what-is-zanzibar","p":12},{"i":30,"t":"Content","u":"/docs/getting-started","h":"","p":28},{"i":34,"t":"Before You Start","u":"/docs/getting-started/configure-model","h":"#before-you-start","p":32},{"i":36,"t":"Step By Step","u":"/docs/getting-started/configure-model","h":"#step-by-step","p":32},{"i":38,"t":"Related Sections","u":"/docs/getting-started/configure-model","h":"#related-sections","p":32},{"i":42,"t":"Step By Step","u":"/docs/getting-started/create-store","h":"#step-by-step","p":40},{"i":46,"t":"What Does The Configuration Language Look Like?","u":"/docs/configuration-language","h":"#what-does-the-configuration-language-look-like","p":44},{"i":48,"t":"The Direct Relationship Type Restrictions","u":"/docs/configuration-language","h":"#the-direct-relationship-type-restrictions","p":44},{"i":50,"t":"Referencing Other Relations On The Same Object","u":"/docs/configuration-language","h":"#referencing-other-relations-on-the-same-object","p":44},{"i":52,"t":"Referencing Relations On Related Objects","u":"/docs/configuration-language","h":"#referencing-relations-on-related-objects","p":44},{"i":54,"t":"The Union Operator","u":"/docs/configuration-language","h":"#the-union-operator","p":44},{"i":56,"t":"The Intersection Operator","u":"/docs/configuration-language","h":"#the-intersection-operator","p":44},{"i":58,"t":"The Exclusion Operator","u":"/docs/configuration-language","h":"#the-exclusion-operator","p":44},{"i":60,"t":"Equivalent Zanzibar Concepts","u":"/docs/configuration-language","h":"#equivalent-zanzibar-concepts","p":44},{"i":62,"t":"Related Sections","u":"/docs/configuration-language","h":"#related-sections","p":44},{"i":66,"t":"Viewing All the Authorization Models","u":"/docs/getting-started/immutable-models","h":"#viewing-all-the-authorization-models","p":64},{"i":68,"t":"How to Target a Particular Model","u":"/docs/getting-started/immutable-models","h":"#how-to-target-a-particular-model","p":64},{"i":70,"t":"Benefits of Passing in an Authorization Model ID","u":"/docs/getting-started/immutable-models","h":"#benefits-of-passing-in-an-authorization-model-id","p":64},{"i":72,"t":"Potential Use-cases","u":"/docs/getting-started/immutable-models","h":"#potential-use-cases","p":64},{"i":74,"t":"Related Sections","u":"/docs/getting-started/immutable-models","h":"#related-sections","p":64},{"i":78,"t":"Brew","u":"/docs/getting-started/install-sdk","h":"#brew","p":76},{"i":80,"t":"Linux (deb, rpm and apk) packages","u":"/docs/getting-started/install-sdk","h":"#linux-deb-rpm-and-apk-packages","p":76},{"i":82,"t":"Docker","u":"/docs/getting-started/install-sdk","h":"#docker","p":76},{"i":84,"t":"Go","u":"/docs/getting-started/install-sdk","h":"#go","p":76},{"i":86,"t":"Manually","u":"/docs/getting-started/install-sdk","h":"#manually","p":76},{"i":88,"t":"Related Sections","u":"/docs/getting-started/install-sdk","h":"#related-sections","p":76},{"i":92,"t":"Before You Start","u":"/docs/getting-started/perform-check","h":"#before-you-start","p":90},{"i":94,"t":"Step By Step","u":"/docs/getting-started/perform-check","h":"#step-by-step","p":90},{"i":96,"t":"01. Configure the OpenFGA API Client","u":"/docs/getting-started/perform-check","h":"#01-configure-the--api-client","p":90},{"i":98,"t":"02. Calling Check API","u":"/docs/getting-started/perform-check","h":"#02-calling-check-api","p":90},{"i":100,"t":"Related Sections","u":"/docs/getting-started/perform-check","h":"#related-sections","p":90},{"i":104,"t":"Before You Start","u":"/docs/getting-started/framework","h":"#before-you-start","p":102},{"i":106,"t":"Step By Step","u":"/docs/getting-started/framework","h":"#step-by-step","p":102},{"i":108,"t":"01. Install And Setup Framework","u":"/docs/getting-started/framework","h":"#01-install-and-setup-framework","p":102},{"i":110,"t":"02. Authenticate And Get User ID","u":"/docs/getting-started/framework","h":"#02-authenticate-and-get-user-id","p":102},{"i":112,"t":"03. Integrate The OpenFGA Check API Into The Service","u":"/docs/getting-started/framework","h":"#03-integrate-the--check-api-into-the-service","p":102},{"i":114,"t":"Related Sections","u":"/docs/getting-started/framework","h":"#related-sections","p":102},{"i":118,"t":"Before You Start","u":"/docs/getting-started/perform-list-objects","h":"#before-you-start","p":116},{"i":120,"t":"Step By Step","u":"/docs/getting-started/perform-list-objects","h":"#step-by-step","p":116},{"i":122,"t":"01. Configure the OpenFGA API Client","u":"/docs/getting-started/perform-list-objects","h":"#01-configure-the--api-client","p":116},{"i":124,"t":"02. Calling List Objects API","u":"/docs/getting-started/perform-list-objects","h":"#02-calling-list-objects-api","p":116},{"i":126,"t":"Related Sections","u":"/docs/getting-started/perform-list-objects","h":"#related-sections","p":116},{"i":130,"t":"Database Recommendations","u":"/docs/getting-started/running-in-production","h":"#database-recommendations","p":128},{"i":132,"t":"Concurrency Limits","u":"/docs/getting-started/running-in-production","h":"#concurrency-limits","p":128},{"i":134,"t":"Related Sections","u":"/docs/getting-started/running-in-production","h":"#related-sections","p":128},{"i":140,"t":"Step By Step","u":"/docs/getting-started/setup-openfga/docker","h":"#step-by-step","p":138},{"i":142,"t":"Configuring The Server","u":"/docs/getting-started/setup-openfga/docker","h":"#configuring-the-server","p":138},{"i":144,"t":"Configuring Data Storage","u":"/docs/getting-started/setup-openfga/docker","h":"#configuring-data-storage","p":138},{"i":146,"t":"Configuring Authentication","u":"/docs/getting-started/setup-openfga/docker","h":"#configuring-authentication","p":138},{"i":148,"t":"Playground","u":"/docs/getting-started/setup-openfga/docker","h":"#playground","p":138},{"i":150,"t":"Profiler (pprof)","u":"/docs/getting-started/setup-openfga/docker","h":"#profiler-pprof","p":138},{"i":152,"t":"Health Check","u":"/docs/getting-started/setup-openfga/docker","h":"#health-check","p":138},{"i":154,"t":"Experimental Features","u":"/docs/getting-started/setup-openfga/docker","h":"#experimental-features","p":138},{"i":156,"t":"Telemetry","u":"/docs/getting-started/setup-openfga/docker","h":"#telemetry","p":138},{"i":158,"t":"Metrics","u":"/docs/getting-started/setup-openfga/docker","h":"#metrics","p":138},{"i":160,"t":"Tracing","u":"/docs/getting-started/setup-openfga/docker","h":"#tracing","p":138},{"i":162,"t":"Logging","u":"/docs/getting-started/setup-openfga/docker","h":"#logging","p":138},{"i":164,"t":"Related Sections","u":"/docs/getting-started/setup-openfga/docker","h":"#related-sections","p":138},{"i":170,"t":"What Is A Type?","u":"/docs/concepts","h":"#what-is-a-type","p":168},{"i":172,"t":"What Is A Type Definition?","u":"/docs/concepts","h":"#what-is-a-type-definition","p":168},{"i":174,"t":"What Is An Authorization Model?","u":"/docs/concepts","h":"#what-is-an-authorization-model","p":168},{"i":176,"t":"What Is A Store?","u":"/docs/concepts","h":"#what-is-a-store","p":168},{"i":178,"t":"What Is An Object?","u":"/docs/concepts","h":"#what-is-an-object","p":168},{"i":180,"t":"What Is A User?","u":"/docs/concepts","h":"#what-is-a-user","p":168},{"i":182,"t":"What Is A Relation?","u":"/docs/concepts","h":"#what-is-a-relation","p":168},{"i":184,"t":"What Is A Relation Definition?","u":"/docs/concepts","h":"#what-is-a-relation-definition","p":168},{"i":186,"t":"What Is A Directly Related User Type?","u":"/docs/concepts","h":"#what-is-a-directly-related-user-type","p":168},{"i":188,"t":"What Is A Relationship Tuple?","u":"/docs/concepts","h":"#what-is-a-relationship-tuple","p":168},{"i":190,"t":"What Is A Relationship?","u":"/docs/concepts","h":"#what-is-a-relationship","p":168},{"i":192,"t":"What Are Direct And Implied Relationships?","u":"/docs/concepts","h":"#what-are-direct-and-implied-relationships","p":168},{"i":194,"t":"What Is A Check Request?","u":"/docs/concepts","h":"#what-is-a-check-request","p":168},{"i":196,"t":"What Is A List Objects Request?","u":"/docs/concepts","h":"#what-is-a-list-objects-request","p":168},{"i":198,"t":"What Are Contextual Tuples?","u":"/docs/concepts","h":"#what-are-contextual-tuples","p":168},{"i":200,"t":"What Is Type Bound Public Access?","u":"/docs/concepts","h":"#what-is-type-bound-public-access","p":168},{"i":202,"t":"Related Sections","u":"/docs/concepts","h":"#related-sections","p":168},{"i":206,"t":"Do Not Store Personal Identifiable Information in Tuples","u":"/docs/getting-started/tuples-api-best-practices","h":"#do-not-store-personal-identifiable-information-in-tuples","p":204},{"i":208,"t":"Always Specify Authorization Model ID Whenever Possible","u":"/docs/getting-started/tuples-api-best-practices","h":"#always-specify-authorization-model-id-whenever-possible","p":204},{"i":210,"t":"Related Sections","u":"/docs/getting-started/tuples-api-best-practices","h":"#related-sections","p":204},{"i":214,"t":"Using No Authentication","u":"/docs/getting-started/setup-sdk-client","h":"#using-no-authentication","p":212},{"i":216,"t":"Using Shared Key Authentication","u":"/docs/getting-started/setup-sdk-client","h":"#using-shared-key-authentication","p":212},{"i":218,"t":"Using Client Credentials Flow","u":"/docs/getting-started/setup-sdk-client","h":"#using-client-credentials-flow","p":212},{"i":222,"t":"Content","u":"/docs/interacting","h":"","p":220},{"i":226,"t":"Before You Start","u":"/docs/interacting/managing-group-access","h":"#before-you-start","p":224},{"i":228,"t":"Modeling User Groups","u":"/docs/interacting/managing-group-access","h":"#modeling-user-groups","p":224},{"i":230,"t":"OpenFGA Concepts","u":"/docs/interacting/managing-group-access","h":"#-concepts","p":224},{"i":232,"t":"Step By Step","u":"/docs/interacting/managing-group-access","h":"#step-by-step","p":224},{"i":233,"t":"01. Adding Company To The Document","u":"/docs/interacting/managing-group-access","h":"#01-adding-company-to-the-document","p":224},{"i":235,"t":"02. Adding Employee To The Company","u":"/docs/interacting/managing-group-access","h":"#02-adding-employee-to-the-company","p":224},{"i":237,"t":"03. Checking An Individual Member's Access To An Object","u":"/docs/interacting/managing-group-access","h":"#03-checking-an-individual-members-access-to-an-object","p":224},{"i":239,"t":"Related Sections","u":"/docs/interacting/managing-group-access","h":"#related-sections","p":224},{"i":243,"t":"Before You Start","u":"/docs/getting-started/update-tuples","h":"#before-you-start","p":241},{"i":245,"t":"Step By Step","u":"/docs/getting-started/update-tuples","h":"#step-by-step","p":241},{"i":247,"t":"01. Configure The OpenFGA API Client","u":"/docs/getting-started/update-tuples","h":"#01-configure-the--api-client","p":241},{"i":249,"t":"02. Calling Write API To Add New Relationship Tuples","u":"/docs/getting-started/update-tuples","h":"#02-calling-write-api-to-add-new-relationship-tuples","p":241},{"i":251,"t":"03. Calling Write API To Delete Relationship Tuples","u":"/docs/getting-started/update-tuples","h":"#03-calling-write-api-to-delete-relationship-tuples","p":241},{"i":253,"t":"Related Sections","u":"/docs/getting-started/update-tuples","h":"#related-sections","p":241},{"i":257,"t":"Before You Start","u":"/docs/interacting/managing-user-access","h":"#before-you-start","p":255},{"i":259,"t":"Direct Access","u":"/docs/interacting/managing-user-access","h":"#direct-access","p":255},{"i":261,"t":"OpenFGA Concepts","u":"/docs/interacting/managing-user-access","h":"#-concepts","p":255},{"i":263,"t":"Step By Step","u":"/docs/interacting/managing-user-access","h":"#step-by-step","p":255},{"i":264,"t":"01. Adding Direct Relationship","u":"/docs/interacting/managing-user-access","h":"#01-adding-direct-relationship","p":255},{"i":266,"t":"02. Removing Direct Relationship","u":"/docs/interacting/managing-user-access","h":"#02-removing-direct-relationship","p":255},{"i":268,"t":"Related Sections","u":"/docs/interacting/managing-user-access","h":"#related-sections","p":255},{"i":272,"t":"Before You Start","u":"/docs/interacting/managing-group-membership","h":"#before-you-start","p":270},{"i":274,"t":"Modeling User Groups","u":"/docs/interacting/managing-group-membership","h":"#modeling-user-groups","p":270},{"i":276,"t":"Managing Group Access","u":"/docs/interacting/managing-group-membership","h":"#managing-group-access","p":270},{"i":278,"t":"OpenFGA Concepts","u":"/docs/interacting/managing-group-membership","h":"#-concepts","p":270},{"i":280,"t":"Step By Step","u":"/docs/interacting/managing-group-membership","h":"#step-by-step","p":270},{"i":281,"t":"01. Revoking Group Membership","u":"/docs/interacting/managing-group-membership","h":"#01-revoking-group-membership","p":270},{"i":283,"t":"02. Validating revoked member no longer has access","u":"/docs/interacting/managing-group-membership","h":"#02-validating-revoked-member-no-longer-has-access","p":270},{"i":285,"t":"Related Sections","u":"/docs/interacting/managing-group-membership","h":"#related-sections","p":270},{"i":289,"t":"Before you start","u":"/docs/interacting/read-tuple-changes","h":"#before-you-start","p":287},{"i":291,"t":"Step By Step","u":"/docs/interacting/read-tuple-changes","h":"#step-by-step","p":287},{"i":293,"t":"01. Configure The OpenFGA API Client","u":"/docs/interacting/read-tuple-changes","h":"#01-configure-the--api-client","p":287},{"i":295,"t":"02. Get Changes For All Object Types","u":"/docs/interacting/read-tuple-changes","h":"#02-get-changes-for-all-object-types","p":287},{"i":297,"t":"03. Get Changes For A Specific Object Type","u":"/docs/interacting/read-tuple-changes","h":"#03-get-changes-for-a-specific-object-type","p":287},{"i":301,"t":"Possible Options","u":"/docs/interacting/search-with-permissions","h":"#possible-options","p":299},{"i":303,"t":"Option 1: Search, Then Check","u":"/docs/interacting/search-with-permissions","h":"#option-1-search-then-check","p":299},{"i":305,"t":"Option 2: Build A Local Index From Changes Endpoint, Search, Then Check","u":"/docs/interacting/search-with-permissions","h":"#option-2-build-a-local-index-from-changes-endpoint-search-then-check","p":299},{"i":307,"t":"Option 3: Build A List Of IDs, Then Search","u":"/docs/interacting/search-with-permissions","h":"#option-3-build-a-list-of-ids-then-search","p":299},{"i":309,"t":"Choosing The Best Option","u":"/docs/interacting/search-with-permissions","h":"#choosing-the-best-option","p":299},{"i":311,"t":"Summary","u":"/docs/interacting/search-with-permissions","h":"#summary","p":299},{"i":315,"t":"Content","u":"/docs/modeling","h":"","p":313},{"i":319,"t":"Before You Start","u":"/docs/interacting/transactional-writes","h":"#before-you-start","p":317},{"i":321,"t":"Direct Access","u":"/docs/interacting/transactional-writes","h":"#direct-access","p":317},{"i":323,"t":"Modeling Public Access","u":"/docs/interacting/transactional-writes","h":"#modeling-public-access","p":317},{"i":325,"t":"OpenFGA Concepts","u":"/docs/interacting/transactional-writes","h":"#-concepts","p":317},{"i":327,"t":"Step By Step","u":"/docs/interacting/transactional-writes","h":"#step-by-step","p":317},{"i":328,"t":"01. Adding And Removing Relationship Tuples In The Same Transaction","u":"/docs/interacting/transactional-writes","h":"#01-adding-and-removing-relationship-tuples-in-the-same-transaction","p":317},{"i":330,"t":"02. Adding Multiple Related Relationship Tuples In The Same Transaction","u":"/docs/interacting/transactional-writes","h":"#02-adding-multiple-related-relationship-tuples-in-the-same-transaction","p":317},{"i":332,"t":"Related Sections","u":"/docs/interacting/transactional-writes","h":"#related-sections","p":317},{"i":336,"t":"Use-cases","u":"/docs/modeling/advanced","h":"#use-cases","p":334},{"i":338,"t":"Patterns","u":"/docs/modeling/advanced","h":"#patterns","p":334},{"i":342,"t":"Content","u":"/docs/modeling/building-blocks","h":"","p":340},{"i":346,"t":"Before You Start","u":"/docs/modeling/blocklists","h":"#before-you-start","p":344},{"i":348,"t":"Modeling User Groups","u":"/docs/modeling/blocklists","h":"#modeling-user-groups","p":344},{"i":350,"t":"OpenFGA Concepts","u":"/docs/modeling/blocklists","h":"#-concepts","p":344},{"i":352,"t":"Step By Step","u":"/docs/modeling/blocklists","h":"#step-by-step","p":344},{"i":354,"t":"01. Modify Our Model So Users Can Be Blocked From Accessing A Document","u":"/docs/modeling/blocklists","h":"#01-modify-our-model-so-users-can-be-blocked-from-accessing-a-document","p":344},{"i":356,"t":"02. Modify Our Model So Users Who Are Blocked Can No Longer Edit The Document","u":"/docs/modeling/blocklists","h":"#02-modify-our-model-so-users-who-are-blocked-can-no-longer-edit-the-document","p":344},{"i":358,"t":"03. Verify Our Solution Works","u":"/docs/modeling/blocklists","h":"#03-verify-our-solution-works","p":344},{"i":360,"t":"Related Sections","u":"/docs/modeling/blocklists","h":"#related-sections","p":344},{"i":364,"t":"Before You Start","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#before-you-start","p":362},{"i":366,"t":"Modeling User Groups","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#modeling-user-groups","p":362},{"i":368,"t":"OpenFGA Concepts","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#-concepts","p":362},{"i":370,"t":"Step By Step","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#step-by-step","p":362},{"i":372,"t":"01. Modify Our Model To Imply Editor As Viewer","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#01-modify-our-model-to-imply-editor-as-viewer","p":362},{"i":374,"t":"02. Check That Editors Are Viewers","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#02-check-that-editors-are-viewers","p":362},{"i":376,"t":"Related Sections","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#related-sections","p":362},{"i":379,"t":"What Is A Userset?","u":"/docs/modeling/building-blocks/usersets","h":"#what-is-a-userset","p":378},{"i":381,"t":"How Do Check Requests Work With Usersets?","u":"/docs/modeling/building-blocks/usersets","h":"#how-do-check-requests-work-with-usersets","p":378},{"i":383,"t":"How Do Expand Requests Work With Usersets?","u":"/docs/modeling/building-blocks/usersets","h":"#how-do-expand-requests-work-with-usersets","p":378},{"i":385,"t":"Internals","u":"/docs/modeling/building-blocks/usersets","h":"#internals","p":378},{"i":387,"t":"Related Sections","u":"/docs/modeling/building-blocks/usersets","h":"#related-sections","p":378},{"i":391,"t":"Before you start","u":"/docs/modeling/custom-roles","h":"#before-you-start","p":389},{"i":393,"t":"Initial Model","u":"/docs/modeling/custom-roles","h":"#initial-model","p":389},{"i":395,"t":"Modeling Roles and Permissions","u":"/docs/modeling/custom-roles","h":"#modeling-roles-and-permissions","p":389},{"i":397,"t":"Modeling Object-to-Object Relationships","u":"/docs/modeling/custom-roles","h":"#modeling-object-to-object-relationships","p":389},{"i":399,"t":"Concepts & Configuration Language","u":"/docs/modeling/custom-roles","h":"#concepts--configuration-language","p":389},{"i":401,"t":"Step By Step","u":"/docs/modeling/custom-roles","h":"#step-by-step","p":389},{"i":403,"t":"01. Update The Authorization Model To Add A Role Type","u":"/docs/modeling/custom-roles","h":"#01-update-the-authorization-model-to-add-a-role-type","p":389},{"i":405,"t":"02.Use Relationship Tuples To Tie The Users To The Roles","u":"/docs/modeling/custom-roles","h":"#02use-relationship-tuples-to-tie-the-users-to-the-roles","p":389},{"i":407,"t":"03. Use Relationship Tuples To Associate Permissions With The Roles","u":"/docs/modeling/custom-roles","h":"#03-use-relationship-tuples-to-associate-permissions-with-the-roles","p":389},{"i":409,"t":"04. Verify That The Authorization Model Works","u":"/docs/modeling/custom-roles","h":"#04-verify-that-the-authorization-model-works","p":389},{"i":411,"t":"Related Sections","u":"/docs/modeling/custom-roles","h":"#related-sections","p":389},{"i":415,"t":"Introduction To Modeling","u":"/docs/modeling/getting-started","h":"#introduction-to-modeling","p":413},{"i":417,"t":"A Process For Defining Authorization Models","u":"/docs/modeling/getting-started","h":"#a-process-for-defining-authorization-models","p":413},{"i":419,"t":"01. Pick The Most Important Feature","u":"/docs/modeling/getting-started","h":"#01-pick-the-most-important-feature","p":413},{"i":421,"t":"02. List The Object Types","u":"/docs/modeling/getting-started","h":"#02-list-the-object-types","p":413},{"i":423,"t":"03. List Relations For Those Types","u":"/docs/modeling/getting-started","h":"#03-list-relations-for-those-types","p":413},{"i":425,"t":"04. Define Relations","u":"/docs/modeling/getting-started","h":"#04-define-relations","p":413},{"i":427,"t":"05. Test The Model","u":"/docs/modeling/getting-started","h":"#05-test-the-model","p":413},{"i":429,"t":"06. Iterate","u":"/docs/modeling/getting-started","h":"#06-iterate","p":413},{"i":431,"t":"Related Sections","u":"/docs/modeling/getting-started","h":"#related-sections","p":413},{"i":435,"t":"Content","u":"/docs/modeling/migrating","h":"","p":433},{"i":439,"t":"Before you start","u":"/docs/modeling/direct-access","h":"#before-you-start","p":437},{"i":441,"t":"OpenFGA Concepts","u":"/docs/modeling/direct-access","h":"#-concepts","p":437},{"i":443,"t":"Step By Step","u":"/docs/modeling/direct-access","h":"#step-by-step","p":437},{"i":445,"t":"01. Create A Relationship Tuple","u":"/docs/modeling/direct-access","h":"#01-create-a-relationship-tuple","p":437},{"i":447,"t":"02. Check That The Relationship Exists","u":"/docs/modeling/direct-access","h":"#02-check-that-the-relationship-exists","p":437},{"i":449,"t":"Related Sections","u":"/docs/modeling/direct-access","h":"#related-sections","p":437},{"i":453,"t":"OpenFGA Model Schema Versions","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#-model-schema-versions","p":451},{"i":455,"t":"Type Restrictions & Removing as self","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#type-restrictions--removing-as-self","p":451},{"i":457,"t":"Disallowing String Literals in user_ids","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#disallowing-string-literals-in-user_ids","p":451},{"i":459,"t":"Enforcing Type Restrictions","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#enforcing-type-restrictions","p":451},{"i":461,"t":"Public Access","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#public-access","p":451},{"i":463,"t":"Query Evaluation Behavior with Type Restrictions","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#query-evaluation-behavior-with-type-restrictions","p":451},{"i":465,"t":"Improved Schema Validation","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#improved-schema-validation","p":451},{"i":467,"t":"Deprecation Timeline","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#deprecation-timeline","p":451},{"i":469,"t":"Related Sections","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#related-sections","p":451},{"i":473,"t":"Before You Start","u":"/docs/modeling/multiple-restrictions","h":"#before-you-start","p":471},{"i":475,"t":"Modeling Parent-Child Objects","u":"/docs/modeling/multiple-restrictions","h":"#modeling-parent-child-objects","p":471},{"i":477,"t":"Modeling Roles And Permissions","u":"/docs/modeling/multiple-restrictions","h":"#modeling-roles-and-permissions","p":471},{"i":479,"t":"OpenFGA Concepts","u":"/docs/modeling/multiple-restrictions","h":"#-concepts","p":471},{"i":481,"t":"Step By Step","u":"/docs/modeling/multiple-restrictions","h":"#step-by-step","p":471},{"i":483,"t":"01. Add can_delete Relation To Only Allow Writers That Are Members Of The Ownership Organization","u":"/docs/modeling/multiple-restrictions","h":"#01-add-can_delete-relation-to-only-allow-writers-that-are-members-of-the-ownership-organization","p":471},{"i":485,"t":"02. Verify That Our Solutions Work","u":"/docs/modeling/multiple-restrictions","h":"#02-verify-that-our-solutions-work","p":471},{"i":487,"t":"Related Sections","u":"/docs/modeling/multiple-restrictions","h":"#related-sections","p":471},{"i":491,"t":"Before You Start","u":"/docs/modeling/parent-child","h":"#before-you-start","p":489},{"i":493,"t":"Direct Access","u":"/docs/modeling/parent-child","h":"#direct-access","p":489},{"i":495,"t":"OpenFGA Concepts","u":"/docs/modeling/parent-child","h":"#-concepts","p":489},{"i":497,"t":"Step By Step","u":"/docs/modeling/parent-child","h":"#step-by-step","p":489},{"i":499,"t":"01. Update The Authorization Model To Allow A Parent Relationship Between Folder And Document","u":"/docs/modeling/parent-child","h":"#01-update-the-authorization-model-to-allow-a-parent-relationship-between-folder-and-document","p":489},{"i":501,"t":"02. Update The Editor Relation In The Document Type Definition To Support Cascading From Folder","u":"/docs/modeling/parent-child","h":"#02-update-the-editor-relation-in-the-document-type-definition-to-support-cascading-from-folder","p":489},{"i":503,"t":"03. Create A New Relationship Tuple To Indicate That bob Is An Editor Of folder:notes","u":"/docs/modeling/parent-child","h":"#03-create-a-new-relationship-tuple-to-indicate-that-bob-is-an-editor-of-foldernotes","p":489},{"i":505,"t":"04. Create A New Relationship Tuple To Indicate That folder:notes Is A Parent Of document:meeting_notes.doc","u":"/docs/modeling/parent-child","h":"#04-create-a-new-relationship-tuple-to-indicate-that-foldernotes-is-a-parent-of-documentmeeting_notesdoc","p":489},{"i":507,"t":"05. Check To See If bob Is An Editor Of document:meeting_notes.doc","u":"/docs/modeling/parent-child","h":"#05-check-to-see-if-bob-is-an-editor-of-documentmeeting_notesdoc","p":489},{"i":509,"t":"Related Sections","u":"/docs/modeling/parent-child","h":"#related-sections","p":489},{"i":513,"t":"Before You Start","u":"/docs/modeling/public-access","h":"#before-you-start","p":511},{"i":515,"t":"Direct Access","u":"/docs/modeling/public-access","h":"#direct-access","p":511},{"i":517,"t":"OpenFGA Concepts","u":"/docs/modeling/public-access","h":"#-concepts","p":511},{"i":519,"t":"Step By Step","u":"/docs/modeling/public-access","h":"#step-by-step","p":511},{"i":521,"t":"01. Create A Relationship Tuple","u":"/docs/modeling/public-access","h":"#01-create-a-relationship-tuple","p":511},{"i":523,"t":"02. Check That The Relationship Exists","u":"/docs/modeling/public-access","h":"#02-check-that-the-relationship-exists","p":511},{"i":525,"t":"Related Sections","u":"/docs/modeling/public-access","h":"#related-sections","p":511},{"i":529,"t":"Before you start","u":"/docs/modeling/user-groups","h":"#before-you-start","p":527},{"i":531,"t":"Direct Access","u":"/docs/modeling/user-groups","h":"#direct-access","p":527},{"i":533,"t":"OpenFGA Concepts","u":"/docs/modeling/user-groups","h":"#-concepts","p":527},{"i":535,"t":"Step By Step","u":"/docs/modeling/user-groups","h":"#step-by-step","p":527},{"i":537,"t":"01. Introduce The Concept Of A Team To The Authorization Model","u":"/docs/modeling/user-groups","h":"#01-introduce-the-concept-of-a-team-to-the-authorization-model","p":527},{"i":539,"t":"02. Add Users As Members To The Team","u":"/docs/modeling/user-groups","h":"#02-add-users-as-members-to-the-team","p":527},{"i":541,"t":"03. Assign The Team Members A Relation To An Object","u":"/docs/modeling/user-groups","h":"#03-assign-the-team-members-a-relation-to-an-object","p":527},{"i":543,"t":"04. Checking An Individual Member's Access To An Object","u":"/docs/modeling/user-groups","h":"#04-checking-an-individual-members-access-to-an-object","p":527},{"i":545,"t":"Related Sections","u":"/docs/modeling/user-groups","h":"#related-sections","p":527},{"i":549,"t":"Before you start","u":"/docs/interacting/managing-relationships-between-objects","h":"#before-you-start","p":547},{"i":551,"t":"Direct Access","u":"/docs/interacting/managing-relationships-between-objects","h":"#direct-access","p":547},{"i":553,"t":"OpenFGA Concepts","u":"/docs/interacting/managing-relationships-between-objects","h":"#-concepts","p":547},{"i":555,"t":"Step By Step","u":"/docs/interacting/managing-relationships-between-objects","h":"#step-by-step","p":547},{"i":557,"t":"01. Modify Authorization Model","u":"/docs/interacting/managing-relationships-between-objects","h":"#01-modify-authorization-model","p":547},{"i":559,"t":"02. Adding Relationship Tuples Where User Is Another Object","u":"/docs/interacting/managing-relationships-between-objects","h":"#02-adding-relationship-tuples-where-user-is-another-object","p":547},{"i":561,"t":"03. Adding Relationship Tuples To The Other Object","u":"/docs/interacting/managing-relationships-between-objects","h":"#03-adding-relationship-tuples-to-the-other-object","p":547},{"i":563,"t":"04. Validating User Access","u":"/docs/interacting/managing-relationships-between-objects","h":"#04-validating-user-access","p":547},{"i":565,"t":"05. Revoking Access","u":"/docs/interacting/managing-relationships-between-objects","h":"#05-revoking-access","p":547},{"i":567,"t":"Related Sections","u":"/docs/interacting/managing-relationships-between-objects","h":"#related-sections","p":547},{"i":571,"t":"Before You Start","u":"/docs/interacting/relationship-queries","h":"#before-you-start","p":569},{"i":573,"t":"Direct Access","u":"/docs/interacting/relationship-queries","h":"#direct-access","p":569},{"i":575,"t":"OpenFGA Concepts","u":"/docs/interacting/relationship-queries","h":"#-concepts","p":569},{"i":577,"t":"Check","u":"/docs/interacting/relationship-queries","h":"#check","p":569},{"i":578,"t":"What Is It For?","u":"/docs/interacting/relationship-queries","h":"#what-is-it-for","p":569},{"i":580,"t":"When To Use?","u":"/docs/interacting/relationship-queries","h":"#when-to-use","p":569},{"i":582,"t":"Caveats And When Not To Use It","u":"/docs/interacting/relationship-queries","h":"#caveats-and-when-not-to-use-it","p":569},{"i":584,"t":"Read","u":"/docs/interacting/relationship-queries","h":"#read","p":569},{"i":585,"t":"What Is It For?","u":"/docs/interacting/relationship-queries","h":"#what-is-it-for-1","p":569},{"i":587,"t":"When To Use?","u":"/docs/interacting/relationship-queries","h":"#when-to-use-1","p":569},{"i":589,"t":"Caveats And When Not To Use It","u":"/docs/interacting/relationship-queries","h":"#caveats-and-when-not-to-use-it-1","p":569},{"i":591,"t":"Expand","u":"/docs/interacting/relationship-queries","h":"#expand","p":569},{"i":592,"t":"What Is It For?","u":"/docs/interacting/relationship-queries","h":"#what-is-it-for-2","p":569},{"i":594,"t":"When To Use?","u":"/docs/interacting/relationship-queries","h":"#when-to-use-2","p":569},{"i":596,"t":"ListObjects","u":"/docs/interacting/relationship-queries","h":"#listobjects","p":569},{"i":597,"t":"What Is It For?","u":"/docs/interacting/relationship-queries","h":"#what-is-it-for-3","p":569},{"i":599,"t":"When To Use?","u":"/docs/interacting/relationship-queries","h":"#when-to-use-3","p":569},{"i":601,"t":"Caveats","u":"/docs/interacting/relationship-queries","h":"#caveats","p":569},{"i":603,"t":"Summary","u":"/docs/interacting/relationship-queries","h":"#summary","p":569},{"i":605,"t":"Related Sections","u":"/docs/interacting/relationship-queries","h":"#related-sections","p":569},{"i":609,"t":"Before You Start","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#before-you-start","p":607},{"i":611,"t":"Modeling User Groups","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#modeling-user-groups","p":607},{"i":613,"t":"OpenFGA Concepts","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#-concepts","p":607},{"i":615,"t":"Step By Step","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#step-by-step","p":607},{"i":616,"t":"01. Create Parent Relations In Document","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#01-create-parent-relations-in-document","p":607},{"i":618,"t":"02. Add Parent Relationship Tuples","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#02-add-parent-relationship-tuples","p":607},{"i":620,"t":"03. Check That Parent Folders Have Permissions","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#03-check-that-parent-folders-have-permissions","p":607},{"i":622,"t":"Advanced Object to Object Relationships","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#advanced-object-to-object-relationships","p":607},{"i":624,"t":"01. Create Authorization Model With Object To Object Relationships","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#01-create-authorization-model-with-object-to-object-relationships","p":607},{"i":626,"t":"02. Adding Relationship Tuples","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#02-adding-relationship-tuples","p":607},{"i":628,"t":"03. Check To See If Access Is Allowed Without Direct Relationship","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#03-check-to-see-if-access-is-allowed-without-direct-relationship","p":607},{"i":630,"t":"04. Disassociating Plan From Feature","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#04-disassociating-plan-from-feature","p":607},{"i":632,"t":"Related Sections","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#related-sections","p":607},{"i":636,"t":"Before You Start","u":"/docs/modeling/building-blocks/direct-relationships","h":"#before-you-start","p":634},{"i":638,"t":"Direct Access","u":"/docs/modeling/building-blocks/direct-relationships","h":"#direct-access","p":634},{"i":640,"t":"OpenFGA Concepts","u":"/docs/modeling/building-blocks/direct-relationships","h":"#-concepts","p":634},{"i":642,"t":"What Are Direct Relationships?","u":"/docs/modeling/building-blocks/direct-relationships","h":"#what-are-direct-relationships","p":634},{"i":644,"t":"Enable Or Disable Direct Relationships","u":"/docs/modeling/building-blocks/direct-relationships","h":"#enable-or-disable-direct-relationships","p":634},{"i":646,"t":"How It Affects Your System","u":"/docs/modeling/building-blocks/direct-relationships","h":"#how-it-affects-your-system","p":634},{"i":648,"t":"1. With Direct Relationships Enabled","u":"/docs/modeling/building-blocks/direct-relationships","h":"#1-with-direct-relationships-enabled","p":634},{"i":650,"t":"2. With Direct Relationships Disabled","u":"/docs/modeling/building-blocks/direct-relationships","h":"#2-with-direct-relationships-disabled","p":634},{"i":652,"t":"Related Sections","u":"/docs/modeling/building-blocks/direct-relationships","h":"#related-sections","p":634},{"i":656,"t":"Before You Start","u":"/docs/modeling/organization-context-authorization","h":"#before-you-start","p":654},{"i":658,"t":"OpenFGA Concepts","u":"/docs/modeling/organization-context-authorization","h":"#-concepts","p":654},{"i":660,"t":"Scenario","u":"/docs/modeling/organization-context-authorization","h":"#scenario","p":654},{"i":662,"t":"Requirements","u":"/docs/modeling/organization-context-authorization","h":"#requirements","p":654},{"i":664,"t":"Step By Step","u":"/docs/modeling/organization-context-authorization","h":"#step-by-step","p":654},{"i":666,"t":"Understand Relationships Without Contextual Data","u":"/docs/modeling/organization-context-authorization","h":"#understand-relationships-without-contextual-data","p":654},{"i":668,"t":"Take Organization Context Into Consideration","u":"/docs/modeling/organization-context-authorization","h":"#take-organization-context-into-consideration","p":654},{"i":670,"t":"Use Contextual Tuples For Context Related Checks","u":"/docs/modeling/organization-context-authorization","h":"#use-contextual-tuples-for-context-related-checks","p":654},{"i":672,"t":"Summary","u":"/docs/modeling/organization-context-authorization","h":"#summary","p":654},{"i":674,"t":"Related Sections","u":"/docs/modeling/organization-context-authorization","h":"#related-sections","p":654},{"i":678,"t":"Before you start","u":"/docs/modeling/roles-and-permissions","h":"#before-you-start","p":676},{"i":680,"t":"Direct Access","u":"/docs/modeling/roles-and-permissions","h":"#direct-access","p":676},{"i":682,"t":"OpenFGA Concepts","u":"/docs/modeling/roles-and-permissions","h":"#-concepts","p":676},{"i":684,"t":"Step By Step","u":"/docs/modeling/roles-and-permissions","h":"#step-by-step","p":676},{"i":686,"t":"01. Understand How Roles Work Within Our Trip Booking System","u":"/docs/modeling/roles-and-permissions","h":"#01-understand-how-roles-work-within-our-trip-booking-system","p":676},{"i":688,"t":"02. Adding Permissions For Bookings","u":"/docs/modeling/roles-and-permissions","h":"#02-adding-permissions-for-bookings","p":676},{"i":690,"t":"03. Checking User Roles And Their Permissions","u":"/docs/modeling/roles-and-permissions","h":"#03-checking-user-roles-and-their-permissions","p":676},{"i":692,"t":"Related Sections","u":"/docs/modeling/roles-and-permissions","h":"#related-sections","p":676},{"i":696,"t":"Before You Start","u":"/docs/modeling/migrating/migrating-relations","h":"#before-you-start","p":694},{"i":698,"t":"Step By Step","u":"/docs/modeling/migrating/migrating-relations","h":"#step-by-step","p":694},{"i":700,"t":"01. Create A Backwards Compatible Model","u":"/docs/modeling/migrating/migrating-relations","h":"#01-create-a-backwards-compatible-model","p":694},{"i":702,"t":"02. Create a New Relationship Tuple","u":"/docs/modeling/migrating/migrating-relations","h":"#02-create-a-new-relationship-tuple","p":694},{"i":704,"t":"03. Migrate The Existing Relationship Tuples","u":"/docs/modeling/migrating/migrating-relations","h":"#03-migrate-the-existing-relationship-tuples","p":694},{"i":706,"t":"04. Remove Obsolete Relationship From The Model","u":"/docs/modeling/migrating/migrating-relations","h":"#04-remove-obsolete-relationship-from-the-model","p":694},{"i":708,"t":"Related Sections","u":"/docs/modeling/migrating/migrating-relations","h":"#related-sections","p":694},{"i":712,"t":"Before You Start","u":"/docs/modeling/advanced/entitlements","h":"#before-you-start","p":710},{"i":714,"t":"OpenFGA Concepts","u":"/docs/modeling/advanced/entitlements","h":"#-concepts","p":710},{"i":716,"t":"What You Will Be Modeling","u":"/docs/modeling/advanced/entitlements","h":"#what-you-will-be-modeling","p":710},{"i":718,"t":"Requirements","u":"/docs/modeling/advanced/entitlements","h":"#requirements","p":710},{"i":720,"t":"Defined Scenarios","u":"/docs/modeling/advanced/entitlements","h":"#defined-scenarios","p":710},{"i":722,"t":"Modeling Entitlements For GitHub","u":"/docs/modeling/advanced/entitlements","h":"#modeling-entitlements-for-github","p":710},{"i":723,"t":"01. Building The Initial Authorization Model And Relationship Tuples","u":"/docs/modeling/advanced/entitlements","h":"#01-building-the-initial-authorization-model-and-relationship-tuples","p":710},{"i":725,"t":"02. Populating The Relationship Tuples","u":"/docs/modeling/advanced/entitlements","h":"#02-populating-the-relationship-tuples","p":710},{"i":727,"t":"03. Updating The Authorization Model","u":"/docs/modeling/advanced/entitlements","h":"#03-updating-the-authorization-model","p":710},{"i":729,"t":"Summary","u":"/docs/modeling/advanced/entitlements","h":"#summary","p":710},{"i":733,"t":"Before You Start","u":"/docs/modeling/advanced/github","h":"#before-you-start","p":731},{"i":735,"t":"OpenFGA Concepts","u":"/docs/modeling/advanced/github","h":"#-concepts","p":731},{"i":737,"t":"What You Will Be Modeling","u":"/docs/modeling/advanced/github","h":"#what-you-will-be-modeling","p":731},{"i":739,"t":"Requirements","u":"/docs/modeling/advanced/github","h":"#requirements","p":731},{"i":741,"t":"Defined Scenarios","u":"/docs/modeling/advanced/github","h":"#defined-scenarios","p":731},{"i":743,"t":"Modeling GitHub's Permissions","u":"/docs/modeling/advanced/github","h":"#modeling-githubs-permissions","p":731},{"i":744,"t":"01. Permissions For Individuals In An Org","u":"/docs/modeling/advanced/github","h":"#01-permissions-for-individuals-in-an-org","p":731},{"i":746,"t":"02. Permissions For Teams In An Org","u":"/docs/modeling/advanced/github","h":"#02-permissions-for-teams-in-an-org","p":731},{"i":748,"t":"03. Permissions For Child Teams In An Org","u":"/docs/modeling/advanced/github","h":"#03-permissions-for-child-teams-in-an-org","p":731},{"i":750,"t":"04. Base Permissions For Org Members","u":"/docs/modeling/advanced/github","h":"#04-base-permissions-for-org-members","p":731},{"i":752,"t":"Summary","u":"/docs/modeling/advanced/github","h":"#summary","p":731},{"i":756,"t":"Before You Start","u":"/docs/modeling/contextual-time-based-authorization","h":"#before-you-start","p":754},{"i":758,"t":"OpenFGA Concepts","u":"/docs/modeling/contextual-time-based-authorization","h":"#-concepts","p":754},{"i":760,"t":"Scenario","u":"/docs/modeling/contextual-time-based-authorization","h":"#scenario","p":754},{"i":762,"t":"Requirements","u":"/docs/modeling/contextual-time-based-authorization","h":"#requirements","p":754},{"i":764,"t":"Step By Step","u":"/docs/modeling/contextual-time-based-authorization","h":"#step-by-step","p":754},{"i":766,"t":"Understand Relationships Without Contextual Data","u":"/docs/modeling/contextual-time-based-authorization","h":"#understand-relationships-without-contextual-data","p":754},{"i":768,"t":"Take Time And IP Address Into Consideration","u":"/docs/modeling/contextual-time-based-authorization","h":"#take-time-and-ip-address-into-consideration","p":754},{"i":770,"t":"Use Contextual Tuples For Context Related Checks","u":"/docs/modeling/contextual-time-based-authorization","h":"#use-contextual-tuples-for-context-related-checks","p":754},{"i":772,"t":"Summary","u":"/docs/modeling/contextual-time-based-authorization","h":"#summary","p":754},{"i":774,"t":"Taking It A Step Further: Banks As A Service Authorization","u":"/docs/modeling/contextual-time-based-authorization","h":"#taking-it-a-step-further-banks-as-a-service-authorization","p":754},{"i":776,"t":"Related Sections","u":"/docs/modeling/contextual-time-based-authorization","h":"#related-sections","p":754},{"i":780,"t":"Before You Start","u":"/docs/modeling/advanced/iot","h":"#before-you-start","p":778},{"i":782,"t":"OpenFGA Concepts","u":"/docs/modeling/advanced/iot","h":"#-concepts","p":778},{"i":784,"t":"What You Will Be Modeling","u":"/docs/modeling/advanced/iot","h":"#what-you-will-be-modeling","p":778},{"i":786,"t":"Requirements","u":"/docs/modeling/advanced/iot","h":"#requirements","p":778},{"i":788,"t":"Defined Scenarios","u":"/docs/modeling/advanced/iot","h":"#defined-scenarios","p":778},{"i":790,"t":"Modeling Device Authorization","u":"/docs/modeling/advanced/iot","h":"#modeling-device-authorization","p":778},{"i":792,"t":"01. Writing The Initial Model For A Device","u":"/docs/modeling/advanced/iot","h":"#01-writing-the-initial-model-for-a-device","p":778},{"i":794,"t":"02. Inserting Some Relationship Tuples","u":"/docs/modeling/advanced/iot","h":"#02-inserting-some-relationship-tuples","p":778},{"i":796,"t":"03. Updating Our Authorization Model To Facilitate Future Changes","u":"/docs/modeling/advanced/iot","h":"#03-updating-our-authorization-model-to-facilitate-future-changes","p":778},{"i":798,"t":"04. Modeling Device Groups","u":"/docs/modeling/advanced/iot","h":"#04-modeling-device-groups","p":778},{"i":800,"t":"05. Disallow Direct Relationships To Users","u":"/docs/modeling/advanced/iot","h":"#05-disallow-direct-relationships-to-users","p":778},{"i":802,"t":"Summary","u":"/docs/modeling/advanced/iot","h":"#summary","p":778},{"i":804,"t":"Exercises For You","u":"/docs/modeling/advanced/iot","h":"#exercises-for-you","p":778},{"i":808,"t":"Before You Start","u":"/docs/modeling/advanced/slack","h":"#before-you-start","p":806},{"i":810,"t":"OpenFGA Concepts","u":"/docs/modeling/advanced/slack","h":"#-concepts","p":806},{"i":812,"t":"What you will be modeling","u":"/docs/modeling/advanced/slack","h":"#what-you-will-be-modeling","p":806},{"i":814,"t":"Requirements","u":"/docs/modeling/advanced/slack","h":"#requirements","p":806},{"i":816,"t":"Defined Scenarios","u":"/docs/modeling/advanced/slack","h":"#defined-scenarios","p":806},{"i":818,"t":"Modeling Workspaces & Channels","u":"/docs/modeling/advanced/slack","h":"#modeling-workspaces--channels","p":806},{"i":820,"t":"01. Individual Permissions","u":"/docs/modeling/advanced/slack","h":"#01-individual-permissions","p":806},{"i":822,"t":"02. Updating The workspace Authorization Model With Implied Relations","u":"/docs/modeling/advanced/slack","h":"#02-updating-the-workspace-authorization-model-with-implied-relations","p":806},{"i":824,"t":"03. Updating The Authorization Model To Include Channels","u":"/docs/modeling/advanced/slack","h":"#03-updating-the-authorization-model-to-include-channels","p":806},{"i":826,"t":"Summary","u":"/docs/modeling/advanced/slack","h":"#summary","p":806},{"i":828,"t":"Exercises For You","u":"/docs/modeling/advanced/slack","h":"#exercises-for-you","p":806},{"i":832,"t":"Before You Start","u":"/docs/modeling/advanced/gdrive","h":"#before-you-start","p":830},{"i":834,"t":"OpenFGA Concepts","u":"/docs/modeling/advanced/gdrive","h":"#-concepts","p":830},{"i":836,"t":"What You Will Be Modeling","u":"/docs/modeling/advanced/gdrive","h":"#what-you-will-be-modeling","p":830},{"i":838,"t":"Requirements","u":"/docs/modeling/advanced/gdrive","h":"#requirements","p":830},{"i":840,"t":"Defined Scenarios","u":"/docs/modeling/advanced/gdrive","h":"#defined-scenarios","p":830},{"i":842,"t":"Modeling Google Drive's Permissions","u":"/docs/modeling/advanced/gdrive","h":"#modeling-google-drives-permissions","p":830},{"i":843,"t":"01. Individual Permissions","u":"/docs/modeling/advanced/gdrive","h":"#01-individual-permissions","p":830},{"i":845,"t":"02. Organization Permissions","u":"/docs/modeling/advanced/gdrive","h":"#02-organization-permissions","p":830},{"i":847,"t":"03. Folder Permission Propagation","u":"/docs/modeling/advanced/gdrive","h":"#03-folder-permission-propagation","p":830},{"i":849,"t":"04. Sharing Files And Folders Publicly","u":"/docs/modeling/advanced/gdrive","h":"#04-sharing-files-and-folders-publicly","p":830},{"i":851,"t":"Related Sections","u":"/docs/modeling/advanced/gdrive","h":"#related-sections","p":830}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/4",[0,3.609,1,5.395]],["t/6",[0,4.294]],["t/8",[2,6.372,3,6.372]],["t/10",[4,6.372,5,6.372]],["t/14",[6,3.451]],["t/16",[7,4.204,8,5.495,9,2.896]],["t/18",[9,2.546,10,4.831,11,4.831,12,4.831]],["t/20",[13,1.921,14,3.854,15,2.322,16,4.131,17,2.799,18,2.799,19,2.799]],["t/22",[14,3.649,15,2.199,16,3.911,20,1.722,21,4.309]],["t/24",[22,6.881]],["t/30",[23,5.8]],["t/34",[24,2.863,25,2.863]],["t/36",[26,3.964]],["t/38",[27,2.297,28,2.694]],["t/42",[26,3.964]],["t/46",[29,3.661,30,4.987,31,5.495]],["t/48",[20,1.93,32,2.59,33,2.849,34,3.871]],["t/50",[27,1.741,35,4.384,36,4.09,37,2.684]],["t/52",[27,2.493,35,4.384,37,2.684]],["t/54",[38,6.372,39,5.395]],["t/56",[39,5.395,40,6.372]],["t/58",[39,5.395,41,6.372]],["t/60",[22,4.987,42,5.495,43,2.641]],["t/62",[27,2.297,28,2.694]],["t/66",[9,2.896,44,5.495,45,2.041]],["t/68",[45,2.041,46,5.495,47,5.495]],["t/70",[9,2.271,45,1.6,48,4.309,49,4.309,50,3.453]],["t/72",[0,3.112,1,4.653,51,5.495]],["t/74",[27,2.297,28,2.694]],["t/78",[52,7.581]],["t/80",[53,4.309,54,4.309,55,4.309,56,4.309,57,4.309]],["t/82",[58,7.581]],["t/84",[59,7.581]],["t/86",[60,7.581]],["t/88",[27,2.297,28,2.694]],["t/92",[24,2.863,25,2.863]],["t/94",[26,3.964]],["t/96",[6,1.962,29,2.871,61,2.015,62,2.871,63,3.297]],["t/98",[62,3.218,64,2.289,65,3.871,66,2.59]],["t/100",[27,2.297,28,2.694]],["t/104",[24,2.863,25,2.863]],["t/106",[26,3.964]],["t/108",[61,2.258,67,4.831,68,4.831,69,4.831]],["t/110",[7,3.695,50,3.871,64,2.289,70,2.736]],["t/112",[6,1.771,62,2.591,66,2.085,71,2.085,72,3.89,73,3.53]],["t/114",[27,2.297,28,2.694]],["t/118",[24,2.863,25,2.863]],["t/120",[26,3.964]],["t/122",[6,1.962,29,2.871,61,2.015,62,2.871,63,3.297]],["t/124",[37,2.395,62,2.871,64,2.042,65,3.453,74,3.297]],["t/126",[27,2.297,28,2.694]],["t/130",[75,6.372,76,6.372]],["t/132",[77,6.372,78,6.372]],["t/134",[27,2.297,28,2.694]],["t/140",[26,3.964]],["t/142",[29,4.245,79,6.372]],["t/144",[29,3.661,80,4.653,81,5.495]],["t/146",[7,4.875,29,4.245]],["t/148",[82,7.581]],["t/150",[83,6.372,84,6.372]],["t/152",[66,3.416,85,6.372]],["t/154",[86,6.372,87,5.395]],["t/156",[88,7.581]],["t/158",[89,7.581]],["t/160",[90,7.581]],["t/162",[91,7.581]],["t/164",[27,2.297,28,2.694]],["t/170",[33,4.471]],["t/172",[33,3.757,92,5.395]],["t/174",[9,3.358,45,2.366]],["t/176",[93,6.881]],["t/178",[37,4.213]],["t/180",[70,4.294]],["t/182",[27,2.733]],["t/184",[27,2.297,92,5.395]],["t/186",[27,1.741,33,2.849,70,2.736,94,4.831]],["t/188",[20,2.546,95,3.153]],["t/190",[20,3.029]],["t/192",[20,2.195,32,2.946,96,4.653]],["t/194",[66,3.416,97,5.106]],["t/196",[37,3.054,74,4.204,97,4.403]],["t/198",[95,3.153,98,4.875]],["t/200",[15,2.465,33,2.849,99,4.831,100,4.09]],["t/202",[27,2.297,28,2.694]],["t/206",[93,3.911,95,2.132,101,4.309,102,4.309,103,4.309]],["t/208",[9,1.868,45,1.316,50,2.84,104,3.544,105,3.544,106,3.544,107,3.217]],["t/210",[27,2.297,28,2.694]],["t/214",[0,3.609,7,4.875]],["t/216",[0,2.736,7,3.695,108,4.384,109,4.831]],["t/218",[0,2.736,63,3.695,110,4.831,111,4.831]],["t/222",[23,5.8]],["t/226",[24,2.863,25,2.863]],["t/228",[45,2.041,70,3.112,112,3.771]],["t/230",[6,2.901,43,3.063]],["t/232",[26,3.964]],["t/233",[61,2.258,113,3.218,114,4.384,115,3.55]],["t/235",[64,2.289,113,3.218,114,4.384,116,4.831]],["t/237",[15,1.985,37,2.161,66,2.085,71,2.085,117,2.976,118,3.53]],["t/239",[27,2.297,28,2.694]],["t/243",[24,2.863,25,2.863]],["t/245",[26,3.964]],["t/247",[6,1.962,29,2.871,61,2.015,62,2.871,63,3.297]],["t/249",[20,1.301,62,2.169,64,1.543,65,2.609,95,1.611,119,2.757,120,2.491,121,2.609]],["t/251",[20,1.416,62,2.361,65,2.84,71,1.9,95,1.754,119,3.001,122,3.544]],["t/253",[27,2.297,28,2.694]],["t/257",[24,2.863,25,2.863]],["t/259",[15,3.251,32,3.416]],["t/261",[6,2.901,43,3.063]],["t/263",[26,3.964]],["t/264",[20,1.93,32,2.59,61,2.258,113,3.218]],["t/266",[20,1.93,32,2.59,64,2.289,123,3.871]],["t/268",[27,2.297,28,2.694]],["t/272",[24,2.863,25,2.863]],["t/274",[45,2.041,70,3.112,112,3.771]],["t/276",[15,2.804,112,3.771,124,5.495]],["t/278",[6,2.901,43,3.063]],["t/280",[26,3.964]],["t/281",[61,2.258,112,3.315,125,4.09,126,4.831]],["t/283",[15,1.985,64,1.844,125,3.294,127,3.294,128,2.976,129,3.53]],["t/285",[27,2.297,28,2.694]],["t/289",[24,2.863,25,2.863]],["t/291",[26,3.964]],["t/293",[6,1.962,29,2.871,61,2.015,62,2.871,63,3.297]],["t/295",[33,2.849,37,2.684,64,2.289,130,3.871]],["t/297",[33,2.541,37,2.395,71,2.31,130,3.453,131,4.309]],["t/301",[107,5.783,132,4.875]],["t/303",[66,2.59,132,3.695,133,4.384,134,4.09]],["t/305",[66,1.614,130,2.412,132,2.303,134,2.549,135,2.732,136,2.549,137,3.01,138,3.01,139,3.01]],["t/307",[50,3.117,74,2.976,132,2.976,134,3.294,136,3.294,140,3.89]],["t/309",[132,4.204,141,5.495,142,5.495]],["t/311",[143,5.203]],["t/315",[23,5.8]],["t/319",[24,2.863,25,2.863]],["t/321",[15,3.251,32,3.416]],["t/323",[15,2.804,45,2.041,100,4.653]],["t/325",[6,2.901,43,3.063]],["t/327",[26,3.964]],["t/328",[20,1.416,36,3.001,61,1.657,95,1.754,113,2.361,123,2.84,144,3.217]],["t/330",[20,1.301,27,1.174,36,2.757,64,1.543,95,1.611,113,2.169,144,2.955,145,3.256]],["t/332",[27,2.297,28,2.694]],["t/336",[0,3.609,1,5.395]],["t/338",[146,7.581]],["t/342",[23,5.8]],["t/346",[24,2.863,25,2.863]],["t/348",[45,2.041,70,3.112,112,3.771]],["t/350",[6,2.901,43,3.063]],["t/352",[26,3.964]],["t/354",[15,1.809,45,1.316,61,1.657,70,2.007,115,2.605,147,2.84,148,3.217]],["t/356",[45,1.209,64,1.543,70,1.844,115,2.392,129,2.955,147,2.609,148,2.955,149,3.256]],["t/358",[71,2.59,150,4.09,151,4.384,152,3.55]],["t/360",[27,2.297,28,2.694]],["t/364",[24,2.863,25,2.863]],["t/366",[45,2.041,70,3.112,112,3.771]],["t/368",[6,2.901,43,3.063]],["t/370",[26,3.964]],["t/372",[45,1.444,61,1.818,96,3.294,147,3.117,153,2.976,154,3.53]],["t/374",[64,2.289,66,2.59,153,3.695,154,4.384]],["t/376",[27,2.297,28,2.694]],["t/379",[155,6.42]],["t/381",[66,2.59,97,3.871,152,3.55,155,4.09]],["t/383",[97,3.871,152,3.55,155,4.09,156,4.384]],["t/385",[157,7.581]],["t/387",[27,2.297,28,2.694]],["t/391",[24,2.863,25,2.863]],["t/393",[45,2.366,158,5.395]],["t/395",[13,3.771,45,2.041,159,3.112]],["t/397",[20,1.93,37,3.843,45,1.794]],["t/399",[29,3.218,30,4.384,43,2.322,160,4.09]],["t/401",[26,3.964]],["t/403",[9,1.868,13,2.433,33,2.09,45,1.316,61,1.657,120,2.712,161,2.513]],["t/405",[13,2.669,20,1.554,70,2.203,95,1.925,162,3.89,163,3.89]],["t/407",[0,2.007,13,2.433,20,1.416,71,1.9,95,1.754,159,2.007,164,3.544]],["t/409",[9,2.271,45,1.6,150,3.649,152,3.167,165,2.793]],["t/411",[27,2.297,28,2.694]],["t/415",[45,2.366,166,6.372]],["t/417",[9,2.546,45,1.794,167,4.831,168,3.425]],["t/419",[61,2.258,87,4.09,169,4.831,170,4.831]],["t/421",[33,2.849,37,2.684,64,2.289,74,3.695]],["t/423",[27,1.553,33,2.541,71,2.31,74,3.297,171,4.309]],["t/425",[27,1.981,165,3.561,168,3.896]],["t/427",[45,2.041,172,4.403,173,5.495]],["t/429",[174,6.372,175,6.372]],["t/431",[27,2.297,28,2.694]],["t/435",[23,5.8]],["t/439",[24,2.863,25,2.863]],["t/441",[6,2.901,43,3.063]],["t/443",[26,3.964]],["t/445",[20,1.93,61,2.258,95,2.39,176,3.315]],["t/447",[20,1.93,64,2.289,66,2.59,177,4.09]],["t/449",[27,2.297,28,2.694]],["t/453",[6,2.199,45,1.794,178,4.384,179,4.831]],["t/455",[33,2.541,34,3.453,123,3.453,160,3.649,180,4.309]],["t/457",[181,4.384,182,4.831,183,4.831,184,4.831]],["t/459",[33,3.241,34,4.403,185,5.495]],["t/461",[15,3.251,100,5.395]],["t/463",[33,2.541,34,3.453,186,4.309,187,4.309,188,4.309]],["t/465",[127,4.653,178,4.987,189,5.495]],["t/467",[190,6.372,191,6.372]],["t/469",[27,2.297,28,2.694]],["t/473",[24,2.863,25,2.863]],["t/475",[37,2.684,45,1.794,192,3.55,193,4.384]],["t/477",[13,3.771,45,2.041,159,3.112]],["t/479",[6,2.901,43,3.063]],["t/481",[26,3.964]],["t/483",[27,1.085,61,1.407,120,2.303,128,2.303,194,3.01,195,2.549,196,3.01,197,3.01,198,2.549]],["t/485",[64,2.289,150,4.09,151,4.384,152,3.55]],["t/487",[27,2.297,28,2.694]],["t/491",[24,2.863,25,2.863]],["t/493",[15,3.251,32,3.416]],["t/495",[6,2.901,43,3.063]],["t/497",[26,3.964]],["t/499",[9,1.475,20,1.118,45,1.039,61,1.309,115,2.057,161,1.984,192,2.057,195,2.37,199,2.799,200,2.141]],["t/501",[27,1.009,33,1.651,64,1.327,92,2.37,115,2.057,153,2.141,161,1.984,200,2.141,201,2.799,202,2.799]],["t/503",[20,1.203,71,1.614,95,1.49,121,2.412,153,2.303,176,2.066,203,2.732,204,2.732,205,2.732]],["t/505",[20,1.203,95,1.49,121,2.412,165,1.951,176,2.066,192,2.212,203,2.732,205,2.732,206,2.732]],["t/507",[66,2.085,153,2.976,172,3.117,204,3.53,206,3.53,207,3.53]],["t/509",[27,2.297,28,2.694]],["t/513",[24,2.863,25,2.863]],["t/515",[15,3.251,32,3.416]],["t/517",[6,2.901,43,3.063]],["t/519",[26,3.964]],["t/521",[20,1.93,61,2.258,95,2.39,176,3.315]],["t/523",[20,1.93,64,2.289,66,2.59,177,4.09]],["t/525",[27,2.297,28,2.694]],["t/529",[24,2.863,25,2.863]],["t/531",[15,3.251,32,3.416]],["t/533",[6,2.901,43,3.063]],["t/535",[26,3.964]],["t/537",[9,2.05,43,1.87,45,1.444,61,1.818,208,3.89,209,2.976]],["t/539",[64,2.042,70,2.441,120,3.297,128,3.297,209,3.297]],["t/541",[27,1.402,37,2.161,71,2.085,128,2.976,209,2.976,210,3.89]],["t/543",[15,1.985,37,2.161,66,2.085,117,2.976,118,3.53,165,2.521]],["t/545",[27,2.297,28,2.694]],["t/549",[24,2.863,25,2.863]],["t/551",[15,3.251,32,3.416]],["t/553",[6,2.901,43,3.063]],["t/555",[26,3.964]],["t/557",[9,2.546,45,1.794,61,2.258,147,3.871]],["t/559",[20,1.416,37,1.97,64,1.68,70,2.007,95,1.754,113,2.361,211,3.544]],["t/561",[20,1.722,37,2.395,71,2.31,95,2.132,113,2.871]],["t/563",[15,2.465,70,2.736,127,4.09,165,3.131]],["t/565",[15,2.804,125,4.653,172,4.403]],["t/567",[27,2.297,28,2.694]],["t/571",[24,2.863,25,2.863]],["t/573",[15,3.251,32,3.416]],["t/575",[6,2.901,43,3.063]],["t/577",[66,4.065]],["t/578",[]],["t/580",[0,4.294]],["t/582",[0,3.609,212,5.395]],["t/584",[213,7.581]],["t/585",[]],["t/587",[0,4.294]],["t/589",[0,3.609,212,5.395]],["t/591",[156,6.881]],["t/592",[]],["t/594",[0,4.294]],["t/596",[214,7.581]],["t/597",[]],["t/599",[0,4.294]],["t/601",[212,6.42]],["t/603",[143,5.203]],["t/605",[27,2.297,28,2.694]],["t/609",[24,2.863,25,2.863]],["t/611",[45,2.041,70,3.112,112,3.771]],["t/613",[6,2.901,43,3.063]],["t/615",[26,3.964]],["t/616",[27,1.553,61,2.015,115,3.167,176,2.957,192,3.167]],["t/618",[20,1.722,64,2.042,95,2.132,120,3.297,192,3.167]],["t/620",[66,2.31,71,2.31,159,2.441,192,3.167,200,3.297]],["t/622",[20,1.93,37,3.843,215,4.831]],["t/624",[9,1.868,20,1.416,37,3.05,45,1.316,61,1.657,176,2.433]],["t/626",[20,1.93,64,2.289,95,2.39,113,3.218]],["t/628",[15,1.661,20,1.301,32,1.745,66,1.745,71,1.745,195,2.757,207,2.955,216,2.757]],["t/630",[87,4.09,165,3.131,217,4.831,218,4.831]],["t/632",[27,2.297,28,2.694]],["t/636",[24,2.863,25,2.863]],["t/638",[15,3.251,32,3.416]],["t/640",[6,2.901,43,3.063]],["t/642",[20,2.546,32,3.416]],["t/644",[20,1.93,32,2.59,219,4.384,220,4.384]],["t/646",[221,6.372,222,5.783]],["t/648",[20,1.93,32,2.59,133,4.384,219,4.384]],["t/650",[20,1.93,32,2.59,135,4.384,220,4.384]],["t/652",[27,2.297,28,2.694]],["t/656",[24,2.863,25,2.863]],["t/658",[6,2.901,43,3.063]],["t/660",[223,5.375]],["t/662",[224,5.375]],["t/664",[26,3.964]],["t/666",[20,1.722,80,3.649,98,3.297,216,3.649,225,3.649]],["t/668",[198,4.09,226,4.09,227,4.09,228,4.384]],["t/670",[0,2.203,27,1.402,66,2.085,95,1.925,98,2.976,227,3.294]],["t/672",[143,5.203]],["t/674",[27,2.297,28,2.694]],["t/678",[24,2.863,25,2.863]],["t/680",[15,3.251,32,3.416]],["t/682",[6,2.901,43,3.063]],["t/684",[26,3.964]],["t/686",[13,2.234,61,1.522,152,2.392,222,2.955,225,2.757,229,3.256,230,3.256,231,2.955]],["t/688",[64,2.289,113,3.218,159,2.736,231,4.384]],["t/690",[13,2.957,66,2.31,70,2.441,71,2.31,159,2.441]],["t/692",[27,2.297,28,2.694]],["t/696",[24,2.863,25,2.863]],["t/698",[26,3.964]],["t/700",[45,1.6,61,2.015,176,2.957,232,4.309,233,4.309]],["t/702",[20,1.722,64,2.042,95,2.132,121,3.453,176,2.957]],["t/704",[20,1.722,71,2.31,95,2.132,177,3.649,234,4.309]],["t/706",[20,1.722,45,1.6,123,3.453,165,2.793,235,4.309]],["t/708",[27,2.297,28,2.694]],["t/712",[24,2.863,25,2.863]],["t/714",[6,2.901,43,3.063]],["t/716",[45,2.815]],["t/718",[224,5.375]],["t/720",[168,4.517,223,4.517]],["t/722",[45,2.041,236,5.495,237,5.495]],["t/723",[9,1.868,20,1.416,45,1.316,61,1.657,95,1.754,136,3.001,158,3.001]],["t/725",[20,1.93,64,2.289,95,2.39,238,4.831]],["t/727",[9,2.546,45,1.794,71,2.59,161,3.425]],["t/729",[143,5.203]],["t/733",[24,2.863,25,2.863]],["t/735",[6,2.901,43,3.063]],["t/737",[45,2.815]],["t/739",[224,5.375]],["t/741",[168,4.517,223,4.517]],["t/743",[45,2.041,159,3.112,239,5.495]],["t/744",[61,2.258,117,3.695,159,2.736,240,3.871]],["t/746",[64,2.289,159,2.736,209,3.695,240,3.871]],["t/748",[71,2.31,159,2.441,193,3.911,209,3.297,240,3.453]],["t/750",[14,3.649,128,3.297,159,2.441,165,2.793,240,3.453]],["t/752",[143,5.203]],["t/756",[24,2.863,25,2.863]],["t/758",[6,2.901,43,3.063]],["t/760",[223,5.375]],["t/762",[224,5.375]],["t/764",[26,3.964]],["t/766",[20,1.722,80,3.649,98,3.297,216,3.649,225,3.649]],["t/768",[226,3.649,228,3.911,241,4.309,242,4.309,243,4.309]],["t/770",[0,2.203,27,1.402,66,2.085,95,1.925,98,2.976,227,3.294]],["t/772",[143,5.203]],["t/774",[9,2.05,26,1.844,73,3.53,226,3.294,244,3.89,245,3.89]],["t/776",[27,2.297,28,2.694]],["t/780",[24,2.863,25,2.863]],["t/782",[6,2.901,43,3.063]],["t/784",[45,2.815]],["t/786",[224,5.375]],["t/788",[168,4.517,223,4.517]],["t/790",[9,2.896,45,2.041,246,4.653]],["t/792",[45,1.6,61,2.015,119,3.649,158,3.649,246,3.649]],["t/794",[20,1.93,64,2.289,95,2.39,247,4.831]],["t/796",[9,1.868,45,1.316,71,1.9,130,2.84,161,2.513,248,3.544,249,3.544]],["t/798",[45,1.794,112,3.315,165,3.131,246,4.09]],["t/800",[20,1.722,32,2.31,70,2.441,172,3.453,181,3.911]],["t/802",[143,5.203]],["t/804",[250,6.881]],["t/808",[24,2.863,25,2.863]],["t/810",[6,2.901,43,3.063]],["t/812",[45,2.815]],["t/814",[224,5.375]],["t/816",[168,4.517,223,4.517]],["t/818",[45,1.794,160,4.09,251,4.384,252,4.384]],["t/820",[61,2.569,117,4.204,159,3.112]],["t/822",[9,1.868,27,1.278,45,1.316,64,1.68,96,3.001,161,2.513,251,3.217]],["t/824",[9,2.05,45,1.444,71,2.085,161,2.757,252,3.53,253,3.89]],["t/826",[143,5.203]],["t/828",[250,6.881]],["t/832",[24,2.863,25,2.863]],["t/834",[6,2.901,43,3.063]],["t/836",[45,2.815]],["t/838",[224,5.375]],["t/840",[168,4.517,223,4.517]],["t/842",[45,1.794,159,2.736,254,4.831,255,4.831]],["t/843",[61,2.569,117,4.204,159,3.112]],["t/845",[64,2.604,159,3.112,198,4.653]],["t/847",[71,2.59,159,2.736,200,3.695,256,4.831]],["t/849",[108,3.911,165,2.793,200,3.297,257,4.309,258,4.309]],["t/851",[27,2.297,28,2.694]]],"invertedIndex":[["",{"_index":160,"t":{"399":{"position":[[9,1]]},"455":{"position":[[18,1]]},"818":{"position":[[20,1]]}}}],["01",{"_index":61,"t":{"96":{"position":[[0,3]]},"108":{"position":[[0,3]]},"122":{"position":[[0,3]]},"233":{"position":[[0,3]]},"247":{"position":[[0,3]]},"264":{"position":[[0,3]]},"281":{"position":[[0,3]]},"293":{"position":[[0,3]]},"328":{"position":[[0,3]]},"354":{"position":[[0,3]]},"372":{"position":[[0,3]]},"403":{"position":[[0,3]]},"419":{"position":[[0,3]]},"445":{"position":[[0,3]]},"483":{"position":[[0,3]]},"499":{"position":[[0,3]]},"521":{"position":[[0,3]]},"537":{"position":[[0,3]]},"557":{"position":[[0,3]]},"616":{"position":[[0,3]]},"624":{"position":[[0,3]]},"686":{"position":[[0,3]]},"700":{"position":[[0,3]]},"723":{"position":[[0,3]]},"744":{"position":[[0,3]]},"792":{"position":[[0,3]]},"820":{"position":[[0,3]]},"843":{"position":[[0,3]]}}}],["02",{"_index":64,"t":{"98":{"position":[[0,3]]},"110":{"position":[[0,3]]},"124":{"position":[[0,3]]},"235":{"position":[[0,3]]},"249":{"position":[[0,3]]},"266":{"position":[[0,3]]},"283":{"position":[[0,3]]},"295":{"position":[[0,3]]},"330":{"position":[[0,3]]},"356":{"position":[[0,3]]},"374":{"position":[[0,3]]},"421":{"position":[[0,3]]},"447":{"position":[[0,3]]},"485":{"position":[[0,3]]},"501":{"position":[[0,3]]},"523":{"position":[[0,3]]},"539":{"position":[[0,3]]},"559":{"position":[[0,3]]},"618":{"position":[[0,3]]},"626":{"position":[[0,3]]},"688":{"position":[[0,3]]},"702":{"position":[[0,3]]},"725":{"position":[[0,3]]},"746":{"position":[[0,3]]},"794":{"position":[[0,3]]},"822":{"position":[[0,3]]},"845":{"position":[[0,3]]}}}],["02.use",{"_index":162,"t":{"405":{"position":[[0,6]]}}}],["03",{"_index":71,"t":{"112":{"position":[[0,3]]},"237":{"position":[[0,3]]},"251":{"position":[[0,3]]},"297":{"position":[[0,3]]},"358":{"position":[[0,3]]},"407":{"position":[[0,3]]},"423":{"position":[[0,3]]},"503":{"position":[[0,3]]},"541":{"position":[[0,3]]},"561":{"position":[[0,3]]},"620":{"position":[[0,3]]},"628":{"position":[[0,3]]},"690":{"position":[[0,3]]},"704":{"position":[[0,3]]},"727":{"position":[[0,3]]},"748":{"position":[[0,3]]},"796":{"position":[[0,3]]},"824":{"position":[[0,3]]},"847":{"position":[[0,3]]}}}],["04",{"_index":165,"t":{"409":{"position":[[0,3]]},"425":{"position":[[0,3]]},"505":{"position":[[0,3]]},"543":{"position":[[0,3]]},"563":{"position":[[0,3]]},"630":{"position":[[0,3]]},"706":{"position":[[0,3]]},"750":{"position":[[0,3]]},"798":{"position":[[0,3]]},"849":{"position":[[0,3]]}}}],["05",{"_index":172,"t":{"427":{"position":[[0,3]]},"507":{"position":[[0,3]]},"565":{"position":[[0,3]]},"800":{"position":[[0,3]]}}}],["06",{"_index":174,"t":{"429":{"position":[[0,3]]}}}],["1",{"_index":133,"t":{"303":{"position":[[7,2]]},"648":{"position":[[0,2]]}}}],["2",{"_index":135,"t":{"305":{"position":[[7,2]]},"650":{"position":[[0,2]]}}}],["3",{"_index":140,"t":{"307":{"position":[[7,2]]}}}],["abac",{"_index":19,"t":{"20":{"position":[[77,7]]}}}],["access",{"_index":15,"t":{"20":{"position":[[20,6],[62,6]]},"22":{"position":[[27,6]]},"200":{"position":[[26,7]]},"237":{"position":[[36,6]]},"259":{"position":[[7,6]]},"276":{"position":[[15,6]]},"283":{"position":[[44,6]]},"321":{"position":[[7,6]]},"323":{"position":[[16,6]]},"354":{"position":[[50,9]]},"461":{"position":[[7,6]]},"493":{"position":[[7,6]]},"515":{"position":[[7,6]]},"531":{"position":[[7,6]]},"543":{"position":[[36,6]]},"551":{"position":[[7,6]]},"563":{"position":[[20,6]]},"565":{"position":[[13,6]]},"573":{"position":[[7,6]]},"628":{"position":[[20,6]]},"638":{"position":[[7,6]]},"680":{"position":[[7,6]]}}}],["ad",{"_index":113,"t":{"233":{"position":[[4,6]]},"235":{"position":[[4,6]]},"264":{"position":[[4,6]]},"328":{"position":[[4,6]]},"330":{"position":[[4,6]]},"559":{"position":[[4,6]]},"561":{"position":[[4,6]]},"626":{"position":[[4,6]]},"688":{"position":[[4,6]]}}}],["add",{"_index":120,"t":{"249":{"position":[[25,3]]},"403":{"position":[[38,3]]},"483":{"position":[[4,3]]},"539":{"position":[[4,3]]},"618":{"position":[[4,3]]}}}],["address",{"_index":243,"t":{"768":{"position":[[17,7]]}}}],["advanc",{"_index":215,"t":{"622":{"position":[[0,8]]}}}],["affect",{"_index":221,"t":{"646":{"position":[[7,7]]}}}],["allow",{"_index":195,"t":{"483":{"position":[[36,5]]},"499":{"position":[[38,5]]},"628":{"position":[[30,7]]}}}],["alway",{"_index":104,"t":{"208":{"position":[[0,6]]}}}],["anoth",{"_index":211,"t":{"559":{"position":[[45,7]]}}}],["api",{"_index":62,"t":{"96":{"position":[[26,3]]},"98":{"position":[[18,3]]},"112":{"position":[[32,3]]},"122":{"position":[[26,3]]},"124":{"position":[[25,3]]},"247":{"position":[[26,3]]},"249":{"position":[[18,3]]},"251":{"position":[[18,3]]},"293":{"position":[[26,3]]}}}],["apk",{"_index":56,"t":{"80":{"position":[[20,4]]}}}],["assign",{"_index":210,"t":{"541":{"position":[[4,6]]}}}],["associ",{"_index":164,"t":{"407":{"position":[[31,9]]}}}],["attribut",{"_index":18,"t":{"20":{"position":[[46,9]]}}}],["authent",{"_index":7,"t":{"16":{"position":[[0,14]]},"110":{"position":[[4,12]]},"146":{"position":[[12,14]]},"214":{"position":[[9,14]]},"216":{"position":[[17,14]]}}}],["author",{"_index":9,"t":{"16":{"position":[[18,13]]},"18":{"position":[[21,13]]},"66":{"position":[[16,13]]},"70":{"position":[[26,13]]},"174":{"position":[[11,13]]},"208":{"position":[[15,13]]},"403":{"position":[[15,13]]},"409":{"position":[[20,13]]},"417":{"position":[[23,13]]},"499":{"position":[[15,13]]},"537":{"position":[[43,13]]},"557":{"position":[[11,13]]},"624":{"position":[[11,13]]},"723":{"position":[[25,13]]},"727":{"position":[[17,13]]},"774":{"position":[[45,13]]},"790":{"position":[[16,13]]},"796":{"position":[[17,13]]},"822":{"position":[[27,13]]},"824":{"position":[[17,13]]}}}],["backward",{"_index":232,"t":{"700":{"position":[[13,9]]}}}],["bank",{"_index":245,"t":{"774":{"position":[[26,5]]}}}],["base",{"_index":14,"t":{"20":{"position":[[14,5],[56,5]]},"22":{"position":[[21,5]]},"750":{"position":[[4,4]]}}}],["befor",{"_index":24,"t":{"34":{"position":[[0,6]]},"92":{"position":[[0,6]]},"104":{"position":[[0,6]]},"118":{"position":[[0,6]]},"226":{"position":[[0,6]]},"243":{"position":[[0,6]]},"257":{"position":[[0,6]]},"272":{"position":[[0,6]]},"289":{"position":[[0,6]]},"319":{"position":[[0,6]]},"346":{"position":[[0,6]]},"364":{"position":[[0,6]]},"391":{"position":[[0,6]]},"439":{"position":[[0,6]]},"473":{"position":[[0,6]]},"491":{"position":[[0,6]]},"513":{"position":[[0,6]]},"529":{"position":[[0,6]]},"549":{"position":[[0,6]]},"571":{"position":[[0,6]]},"609":{"position":[[0,6]]},"636":{"position":[[0,6]]},"656":{"position":[[0,6]]},"678":{"position":[[0,6]]},"696":{"position":[[0,6]]},"712":{"position":[[0,6]]},"733":{"position":[[0,6]]},"756":{"position":[[0,6]]},"780":{"position":[[0,6]]},"808":{"position":[[0,6]]},"832":{"position":[[0,6]]}}}],["behavior",{"_index":188,"t":{"463":{"position":[[17,8]]}}}],["benefit",{"_index":48,"t":{"70":{"position":[[0,8]]}}}],["best",{"_index":142,"t":{"309":{"position":[[13,4]]}}}],["between",{"_index":199,"t":{"499":{"position":[[66,7]]}}}],["block",{"_index":148,"t":{"354":{"position":[[37,7]]},"356":{"position":[[38,7]]}}}],["bob",{"_index":204,"t":{"503":{"position":[[53,3]]},"507":{"position":[[20,3]]}}}],["book",{"_index":231,"t":{"686":{"position":[[46,7]]},"688":{"position":[[27,8]]}}}],["bound",{"_index":99,"t":{"200":{"position":[[13,5]]}}}],["brew",{"_index":52,"t":{"78":{"position":[[0,4]]}}}],["build",{"_index":136,"t":{"305":{"position":[[10,5]]},"307":{"position":[[10,5]]},"723":{"position":[[4,8]]}}}],["call",{"_index":65,"t":{"98":{"position":[[4,7]]},"124":{"position":[[4,7]]},"249":{"position":[[4,7]]},"251":{"position":[[4,7]]}}}],["can_delet",{"_index":194,"t":{"483":{"position":[[8,10]]}}}],["cascad",{"_index":202,"t":{"501":{"position":[[74,9]]}}}],["case",{"_index":1,"t":{"4":{"position":[[4,5]]},"72":{"position":[[14,5]]},"336":{"position":[[4,5]]}}}],["caveat",{"_index":212,"t":{"582":{"position":[[0,7]]},"589":{"position":[[0,7]]},"601":{"position":[[0,7]]}}}],["chang",{"_index":130,"t":{"295":{"position":[[8,7]]},"297":{"position":[[8,7]]},"305":{"position":[[35,7]]},"796":{"position":[[58,7]]}}}],["channel",{"_index":252,"t":{"818":{"position":[[22,8]]},"824":{"position":[[48,8]]}}}],["check",{"_index":66,"t":{"98":{"position":[[12,5]]},"112":{"position":[[26,5]]},"152":{"position":[[7,5]]},"194":{"position":[[10,5]]},"237":{"position":[[4,8]]},"303":{"position":[[23,5]]},"305":{"position":[[66,5]]},"374":{"position":[[4,5]]},"381":{"position":[[7,5]]},"447":{"position":[[4,5]]},"507":{"position":[[4,5]]},"523":{"position":[[4,5]]},"543":{"position":[[4,8]]},"577":{"position":[[0,5]]},"620":{"position":[[4,5]]},"628":{"position":[[4,5]]},"670":{"position":[[42,6]]},"690":{"position":[[4,8]]},"770":{"position":[[42,6]]}}}],["child",{"_index":193,"t":{"475":{"position":[[16,5]]},"748":{"position":[[20,5]]}}}],["choos",{"_index":141,"t":{"309":{"position":[[0,8]]}}}],["client",{"_index":63,"t":{"96":{"position":[[30,6]]},"122":{"position":[[30,6]]},"218":{"position":[[6,6]]},"247":{"position":[[30,6]]},"293":{"position":[[30,6]]}}}],["compani",{"_index":114,"t":{"233":{"position":[[11,7]]},"235":{"position":[[27,7]]}}}],["compat",{"_index":233,"t":{"700":{"position":[[23,10]]}}}],["concept",{"_index":43,"t":{"60":{"position":[[20,8]]},"230":{"position":[[8,8]]},"261":{"position":[[8,8]]},"278":{"position":[[8,8]]},"325":{"position":[[8,8]]},"350":{"position":[[8,8]]},"368":{"position":[[8,8]]},"399":{"position":[[0,8]]},"441":{"position":[[8,8]]},"479":{"position":[[8,8]]},"495":{"position":[[8,8]]},"517":{"position":[[8,8]]},"533":{"position":[[8,8]]},"537":{"position":[[18,7]]},"553":{"position":[[8,8]]},"575":{"position":[[8,8]]},"613":{"position":[[8,8]]},"640":{"position":[[8,8]]},"658":{"position":[[8,8]]},"682":{"position":[[8,8]]},"714":{"position":[[8,8]]},"735":{"position":[[8,8]]},"758":{"position":[[8,8]]},"782":{"position":[[8,8]]},"810":{"position":[[8,8]]},"834":{"position":[[8,8]]}}}],["concurr",{"_index":77,"t":{"132":{"position":[[0,11]]}}}],["configur",{"_index":29,"t":{"46":{"position":[[14,13]]},"96":{"position":[[4,9]]},"122":{"position":[[4,9]]},"142":{"position":[[0,11]]},"144":{"position":[[0,11]]},"146":{"position":[[0,11]]},"247":{"position":[[4,9]]},"293":{"position":[[4,9]]},"399":{"position":[[11,13]]}}}],["consider",{"_index":228,"t":{"668":{"position":[[31,13]]},"768":{"position":[[30,13]]}}}],["content",{"_index":23,"t":{"30":{"position":[[0,7]]},"222":{"position":[[0,7]]},"315":{"position":[[0,7]]},"342":{"position":[[0,7]]},"435":{"position":[[0,7]]}}}],["context",{"_index":227,"t":{"668":{"position":[[18,7]]},"670":{"position":[[26,7]]},"770":{"position":[[26,7]]}}}],["contextu",{"_index":98,"t":{"198":{"position":[[9,10]]},"666":{"position":[[33,10]]},"670":{"position":[[4,10]]},"766":{"position":[[33,10]]},"770":{"position":[[4,10]]}}}],["control",{"_index":16,"t":{"20":{"position":[[27,7],[69,7]]},"22":{"position":[[34,7]]}}}],["creat",{"_index":176,"t":{"445":{"position":[[4,6]]},"503":{"position":[[4,6]]},"505":{"position":[[4,6]]},"521":{"position":[[4,6]]},"616":{"position":[[4,6]]},"624":{"position":[[4,6]]},"700":{"position":[[4,6]]},"702":{"position":[[4,6]]}}}],["credenti",{"_index":110,"t":{"218":{"position":[[13,11]]}}}],["data",{"_index":80,"t":{"144":{"position":[[12,4]]},"666":{"position":[[44,4]]},"766":{"position":[[44,4]]}}}],["databas",{"_index":75,"t":{"130":{"position":[[0,8]]}}}],["deb",{"_index":54,"t":{"80":{"position":[[6,5]]}}}],["defin",{"_index":168,"t":{"417":{"position":[[14,8]]},"425":{"position":[[4,6]]},"720":{"position":[[0,7]]},"741":{"position":[[0,7]]},"788":{"position":[[0,7]]},"816":{"position":[[0,7]]},"840":{"position":[[0,7]]}}}],["definit",{"_index":92,"t":{"172":{"position":[[15,11]]},"184":{"position":[[19,11]]},"501":{"position":[[52,10]]}}}],["delet",{"_index":122,"t":{"251":{"position":[[25,6]]}}}],["deprec",{"_index":190,"t":{"467":{"position":[[0,11]]}}}],["devic",{"_index":246,"t":{"790":{"position":[[9,6]]},"792":{"position":[[36,6]]},"798":{"position":[[13,6]]}}}],["direct",{"_index":32,"t":{"48":{"position":[[4,6]]},"192":{"position":[[9,6]]},"259":{"position":[[0,6]]},"264":{"position":[[11,6]]},"266":{"position":[[13,6]]},"321":{"position":[[0,6]]},"493":{"position":[[0,6]]},"515":{"position":[[0,6]]},"531":{"position":[[0,6]]},"551":{"position":[[0,6]]},"573":{"position":[[0,6]]},"628":{"position":[[46,6]]},"638":{"position":[[0,6]]},"642":{"position":[[9,6]]},"644":{"position":[[18,6]]},"648":{"position":[[8,6]]},"650":{"position":[[8,6]]},"680":{"position":[[0,6]]},"800":{"position":[[13,6]]}}}],["directli",{"_index":94,"t":{"186":{"position":[[10,8]]}}}],["disabl",{"_index":220,"t":{"644":{"position":[[10,7]]},"650":{"position":[[29,8]]}}}],["disallow",{"_index":181,"t":{"457":{"position":[[0,11]]},"800":{"position":[[4,8]]}}}],["disassoci",{"_index":217,"t":{"630":{"position":[[4,14]]}}}],["docker",{"_index":58,"t":{"82":{"position":[[0,6]]}}}],["document",{"_index":115,"t":{"233":{"position":[[26,8]]},"354":{"position":[[62,8]]},"356":{"position":[[69,8]]},"499":{"position":[[85,8]]},"501":{"position":[[38,8]]},"616":{"position":[[31,8]]}}}],["document:meeting_notes.doc",{"_index":206,"t":{"505":{"position":[[81,26]]},"507":{"position":[[40,26]]}}}],["drive'",{"_index":255,"t":{"842":{"position":[[16,7]]}}}],["edit",{"_index":149,"t":{"356":{"position":[[60,4]]}}}],["editor",{"_index":153,"t":{"372":{"position":[[30,6]]},"374":{"position":[[15,7]]},"501":{"position":[[15,6]]},"503":{"position":[[63,6]]},"507":{"position":[[30,6]]}}}],["employe",{"_index":116,"t":{"235":{"position":[[11,8]]}}}],["enabl",{"_index":219,"t":{"644":{"position":[[0,6]]},"648":{"position":[[29,7]]}}}],["endpoint",{"_index":139,"t":{"305":{"position":[[43,9]]}}}],["enforc",{"_index":185,"t":{"459":{"position":[[0,9]]}}}],["entitl",{"_index":236,"t":{"722":{"position":[[9,12]]}}}],["equival",{"_index":42,"t":{"60":{"position":[[0,10]]}}}],["evalu",{"_index":187,"t":{"463":{"position":[[6,10]]}}}],["exclus",{"_index":41,"t":{"58":{"position":[[4,9]]}}}],["exercis",{"_index":250,"t":{"804":{"position":[[0,9]]},"828":{"position":[[0,9]]}}}],["exist",{"_index":177,"t":{"447":{"position":[[32,6]]},"523":{"position":[[32,6]]},"704":{"position":[[16,8]]}}}],["expand",{"_index":156,"t":{"383":{"position":[[7,6]]},"591":{"position":[[0,6]]}}}],["experiment",{"_index":86,"t":{"154":{"position":[[0,12]]}}}],["facilit",{"_index":248,"t":{"796":{"position":[[40,10]]}}}],["featur",{"_index":87,"t":{"154":{"position":[[13,8]]},"419":{"position":[[28,7]]},"630":{"position":[[29,7]]}}}],["fga",{"_index":12,"t":{"18":{"position":[[35,6]]}}}],["file",{"_index":257,"t":{"849":{"position":[[12,5]]}}}],["fine",{"_index":10,"t":{"18":{"position":[[8,4]]}}}],["flow",{"_index":111,"t":{"218":{"position":[[25,4]]}}}],["folder",{"_index":200,"t":{"499":{"position":[[74,6]]},"501":{"position":[[89,6]]},"620":{"position":[[22,7]]},"847":{"position":[[4,6]]},"849":{"position":[[22,7]]}}}],["folder:not",{"_index":205,"t":{"503":{"position":[[73,12]]},"505":{"position":[[53,12]]}}}],["framework",{"_index":69,"t":{"108":{"position":[[22,9]]}}}],["further",{"_index":244,"t":{"774":{"position":[[17,8]]}}}],["futur",{"_index":249,"t":{"796":{"position":[[51,6]]}}}],["github",{"_index":237,"t":{"722":{"position":[[26,6]]}}}],["github'",{"_index":239,"t":{"743":{"position":[[9,8]]}}}],["go",{"_index":59,"t":{"84":{"position":[[0,2]]}}}],["googl",{"_index":254,"t":{"842":{"position":[[9,6]]}}}],["grain",{"_index":11,"t":{"18":{"position":[[13,7]]}}}],["group",{"_index":112,"t":{"228":{"position":[[14,6]]},"274":{"position":[[14,6]]},"276":{"position":[[9,5]]},"281":{"position":[[13,5]]},"348":{"position":[[14,6]]},"366":{"position":[[14,6]]},"611":{"position":[[14,6]]},"798":{"position":[[20,6]]}}}],["health",{"_index":85,"t":{"152":{"position":[[0,6]]}}}],["id",{"_index":50,"t":{"70":{"position":[[46,2]]},"110":{"position":[[30,2]]},"208":{"position":[[35,2]]},"307":{"position":[[26,4]]}}}],["identifi",{"_index":102,"t":{"206":{"position":[[22,12]]}}}],["impli",{"_index":96,"t":{"192":{"position":[[20,7]]},"372":{"position":[[24,5]]},"822":{"position":[[52,7]]}}}],["import",{"_index":170,"t":{"419":{"position":[[18,9]]}}}],["improv",{"_index":189,"t":{"465":{"position":[[0,8]]}}}],["includ",{"_index":253,"t":{"824":{"position":[[40,7]]}}}],["index",{"_index":138,"t":{"305":{"position":[[24,5]]}}}],["indic",{"_index":203,"t":{"503":{"position":[[39,8]]},"505":{"position":[[39,8]]}}}],["individu",{"_index":117,"t":{"237":{"position":[[16,10]]},"543":{"position":[[16,10]]},"744":{"position":[[20,11]]},"820":{"position":[[4,10]]},"843":{"position":[[4,10]]}}}],["inform",{"_index":103,"t":{"206":{"position":[[35,11]]}}}],["initi",{"_index":158,"t":{"393":{"position":[[0,7]]},"723":{"position":[[17,7]]},"792":{"position":[[16,7]]}}}],["insert",{"_index":247,"t":{"794":{"position":[[4,9]]}}}],["instal",{"_index":67,"t":{"108":{"position":[[4,7]]}}}],["integr",{"_index":72,"t":{"112":{"position":[[4,9]]}}}],["intern",{"_index":157,"t":{"385":{"position":[[0,9]]}}}],["intersect",{"_index":40,"t":{"56":{"position":[[4,12]]}}}],["introduc",{"_index":208,"t":{"537":{"position":[[4,9]]}}}],["introduct",{"_index":166,"t":{"415":{"position":[[0,12]]}}}],["ip",{"_index":242,"t":{"768":{"position":[[14,2]]}}}],["iter",{"_index":175,"t":{"429":{"position":[[4,7]]}}}],["key",{"_index":109,"t":{"216":{"position":[[13,3]]}}}],["languag",{"_index":30,"t":{"46":{"position":[[28,8]]},"399":{"position":[[25,8]]}}}],["limit",{"_index":78,"t":{"132":{"position":[[12,6]]}}}],["linux",{"_index":53,"t":{"80":{"position":[[0,5]]}}}],["list",{"_index":74,"t":{"124":{"position":[[12,4]]},"196":{"position":[[10,4]]},"307":{"position":[[18,4]]},"421":{"position":[[4,4]]},"423":{"position":[[4,4]]}}}],["listobject",{"_index":214,"t":{"596":{"position":[[0,11]]}}}],["liter",{"_index":183,"t":{"457":{"position":[[19,8]]}}}],["local",{"_index":137,"t":{"305":{"position":[[18,5]]}}}],["log",{"_index":91,"t":{"162":{"position":[[0,7]]}}}],["longer",{"_index":129,"t":{"283":{"position":[[33,6]]},"356":{"position":[[53,6]]}}}],["look",{"_index":31,"t":{"46":{"position":[[37,4]]}}}],["manag",{"_index":124,"t":{"276":{"position":[[0,8]]}}}],["manual",{"_index":60,"t":{"86":{"position":[[0,8]]}}}],["member",{"_index":128,"t":{"283":{"position":[[23,6]]},"483":{"position":[[59,7]]},"539":{"position":[[17,7]]},"541":{"position":[[20,7]]},"750":{"position":[[29,7]]}}}],["member'",{"_index":118,"t":{"237":{"position":[[27,8]]},"543":{"position":[[27,8]]}}}],["membership",{"_index":126,"t":{"281":{"position":[[19,10]]}}}],["metric",{"_index":89,"t":{"158":{"position":[[0,7]]}}}],["migrat",{"_index":234,"t":{"704":{"position":[[4,7]]}}}],["model",{"_index":45,"t":{"66":{"position":[[30,6]]},"68":{"position":[[27,5]]},"70":{"position":[[40,5]]},"174":{"position":[[25,6]]},"208":{"position":[[29,5]]},"228":{"position":[[0,8]]},"274":{"position":[[0,8]]},"323":{"position":[[0,8]]},"348":{"position":[[0,8]]},"354":{"position":[[15,5]]},"356":{"position":[[15,5]]},"366":{"position":[[0,8]]},"372":{"position":[[15,5]]},"393":{"position":[[8,5]]},"395":{"position":[[0,8]]},"397":{"position":[[0,8]]},"403":{"position":[[29,5]]},"409":{"position":[[34,5]]},"415":{"position":[[16,8]]},"417":{"position":[[37,6]]},"427":{"position":[[13,5]]},"453":{"position":[[8,5]]},"475":{"position":[[0,8]]},"477":{"position":[[0,8]]},"499":{"position":[[29,5]]},"537":{"position":[[57,5]]},"557":{"position":[[25,5]]},"611":{"position":[[0,8]]},"624":{"position":[[25,5]]},"700":{"position":[[34,5]]},"706":{"position":[[42,5]]},"716":{"position":[[17,8]]},"722":{"position":[[0,8]]},"723":{"position":[[39,5]]},"727":{"position":[[31,5]]},"737":{"position":[[17,8]]},"743":{"position":[[0,8]]},"784":{"position":[[17,8]]},"790":{"position":[[0,8]]},"792":{"position":[[24,5]]},"796":{"position":[[31,5]]},"798":{"position":[[4,8]]},"812":{"position":[[17,8]]},"818":{"position":[[0,8]]},"822":{"position":[[41,5]]},"824":{"position":[[31,5]]},"836":{"position":[[17,8]]},"842":{"position":[[0,8]]}}}],["modifi",{"_index":147,"t":{"354":{"position":[[4,6]]},"356":{"position":[[4,6]]},"372":{"position":[[4,6]]},"557":{"position":[[4,6]]}}}],["multipl",{"_index":145,"t":{"330":{"position":[[11,8]]}}}],["new",{"_index":121,"t":{"249":{"position":[[29,3]]},"503":{"position":[[13,3]]},"505":{"position":[[13,3]]},"702":{"position":[[13,3]]}}}],["next",{"_index":3,"t":{"8":{"position":[[7,5]]}}}],["object",{"_index":37,"t":{"50":{"position":[[40,6]]},"52":{"position":[[33,7]]},"124":{"position":[[17,7]]},"178":{"position":[[11,7]]},"196":{"position":[[15,7]]},"237":{"position":[[49,6]]},"295":{"position":[[24,6]]},"297":{"position":[[31,6]]},"397":{"position":[[9,6],[19,6]]},"421":{"position":[[13,6]]},"475":{"position":[[22,7]]},"541":{"position":[[45,6]]},"543":{"position":[[49,6]]},"559":{"position":[[53,6]]},"561":{"position":[[44,6]]},"622":{"position":[[9,6],[19,6]]},"624":{"position":[[36,6],[46,6]]}}}],["obsolet",{"_index":235,"t":{"706":{"position":[[11,8]]}}}],["openfga",{"_index":6,"t":{"14":{"position":[[8,8]]},"96":{"position":[[18,7]]},"112":{"position":[[18,7]]},"122":{"position":[[18,7]]},"230":{"position":[[0,7]]},"247":{"position":[[18,7]]},"261":{"position":[[0,7]]},"278":{"position":[[0,7]]},"293":{"position":[[18,7]]},"325":{"position":[[0,7]]},"350":{"position":[[0,7]]},"368":{"position":[[0,7]]},"441":{"position":[[0,7]]},"453":{"position":[[0,7]]},"479":{"position":[[0,7]]},"495":{"position":[[0,7]]},"517":{"position":[[0,7]]},"533":{"position":[[0,7]]},"553":{"position":[[0,7]]},"575":{"position":[[0,7]]},"613":{"position":[[0,7]]},"640":{"position":[[0,7]]},"658":{"position":[[0,7]]},"682":{"position":[[0,7]]},"714":{"position":[[0,7]]},"735":{"position":[[0,7]]},"758":{"position":[[0,7]]},"782":{"position":[[0,7]]},"810":{"position":[[0,7]]},"834":{"position":[[0,7]]}}}],["oper",{"_index":39,"t":{"54":{"position":[[10,8]]},"56":{"position":[[17,8]]},"58":{"position":[[14,8]]}}}],["option",{"_index":132,"t":{"301":{"position":[[9,7]]},"303":{"position":[[0,6]]},"305":{"position":[[0,6]]},"307":{"position":[[0,6]]},"309":{"position":[[18,6]]}}}],["org",{"_index":240,"t":{"744":{"position":[[38,3]]},"746":{"position":[[32,3]]},"748":{"position":[[38,3]]},"750":{"position":[[25,3]]}}}],["organ",{"_index":198,"t":{"483":{"position":[[84,12]]},"668":{"position":[[5,12]]},"845":{"position":[[4,12]]}}}],["out",{"_index":5,"t":{"10":{"position":[[6,4]]}}}],["ownership",{"_index":197,"t":{"483":{"position":[[74,9]]}}}],["packag",{"_index":57,"t":{"80":{"position":[[25,8]]}}}],["parent",{"_index":192,"t":{"475":{"position":[[9,6]]},"499":{"position":[[46,6]]},"505":{"position":[[71,6]]},"616":{"position":[[11,6]]},"618":{"position":[[8,6]]},"620":{"position":[[15,6]]}}}],["particular",{"_index":47,"t":{"68":{"position":[[16,10]]}}}],["pass",{"_index":49,"t":{"70":{"position":[[12,7]]}}}],["pattern",{"_index":146,"t":{"338":{"position":[[0,8]]}}}],["permiss",{"_index":159,"t":{"395":{"position":[[19,11]]},"407":{"position":[[41,11]]},"477":{"position":[[19,11]]},"620":{"position":[[35,11]]},"688":{"position":[[11,11]]},"690":{"position":[[34,11]]},"743":{"position":[[18,11]]},"744":{"position":[[4,11]]},"746":{"position":[[4,11]]},"748":{"position":[[4,11]]},"750":{"position":[[9,11]]},"820":{"position":[[15,11]]},"842":{"position":[[24,11]]},"843":{"position":[[15,11]]},"845":{"position":[[17,11]]},"847":{"position":[[11,10]]}}}],["person",{"_index":101,"t":{"206":{"position":[[13,8]]}}}],["pick",{"_index":169,"t":{"419":{"position":[[4,4]]}}}],["plan",{"_index":218,"t":{"630":{"position":[[19,4]]}}}],["playground",{"_index":82,"t":{"148":{"position":[[0,10]]}}}],["popul",{"_index":238,"t":{"725":{"position":[[4,10]]}}}],["possibl",{"_index":107,"t":{"208":{"position":[[47,8]]},"301":{"position":[[0,8]]}}}],["potenti",{"_index":51,"t":{"72":{"position":[[0,9]]}}}],["pprof",{"_index":84,"t":{"150":{"position":[[9,7]]}}}],["process",{"_index":167,"t":{"417":{"position":[[2,7]]}}}],["profil",{"_index":83,"t":{"150":{"position":[[0,8]]}}}],["propag",{"_index":256,"t":{"847":{"position":[[22,11]]}}}],["public",{"_index":100,"t":{"200":{"position":[[19,6]]},"323":{"position":[[9,6]]},"461":{"position":[[0,6]]}}}],["publicli",{"_index":258,"t":{"849":{"position":[[30,8]]}}}],["queri",{"_index":186,"t":{"463":{"position":[[0,5]]}}}],["rbac",{"_index":17,"t":{"20":{"position":[[35,6]]}}}],["reach",{"_index":4,"t":{"10":{"position":[[0,5]]}}}],["read",{"_index":213,"t":{"584":{"position":[[0,4]]}}}],["rebac",{"_index":21,"t":{"22":{"position":[[42,8]]}}}],["recommend",{"_index":76,"t":{"130":{"position":[[9,15]]}}}],["referenc",{"_index":35,"t":{"50":{"position":[[0,11]]},"52":{"position":[[0,11]]}}}],["relat",{"_index":27,"t":{"38":{"position":[[0,7]]},"50":{"position":[[18,9]]},"52":{"position":[[12,9],[25,7]]},"62":{"position":[[0,7]]},"74":{"position":[[0,7]]},"88":{"position":[[0,7]]},"100":{"position":[[0,7]]},"114":{"position":[[0,7]]},"126":{"position":[[0,7]]},"134":{"position":[[0,7]]},"164":{"position":[[0,7]]},"182":{"position":[[10,9]]},"184":{"position":[[10,8]]},"186":{"position":[[19,7]]},"202":{"position":[[0,7]]},"210":{"position":[[0,7]]},"239":{"position":[[0,7]]},"253":{"position":[[0,7]]},"268":{"position":[[0,7]]},"285":{"position":[[0,7]]},"330":{"position":[[20,7]]},"332":{"position":[[0,7]]},"360":{"position":[[0,7]]},"376":{"position":[[0,7]]},"387":{"position":[[0,7]]},"411":{"position":[[0,7]]},"423":{"position":[[9,9]]},"425":{"position":[[11,9]]},"431":{"position":[[0,7]]},"449":{"position":[[0,7]]},"469":{"position":[[0,7]]},"483":{"position":[[19,8]]},"487":{"position":[[0,7]]},"501":{"position":[[22,8]]},"509":{"position":[[0,7]]},"525":{"position":[[0,7]]},"541":{"position":[[30,8]]},"545":{"position":[[0,7]]},"567":{"position":[[0,7]]},"605":{"position":[[0,7]]},"616":{"position":[[18,9]]},"632":{"position":[[0,7]]},"652":{"position":[[0,7]]},"670":{"position":[[34,7]]},"674":{"position":[[0,7]]},"692":{"position":[[0,7]]},"708":{"position":[[0,7]]},"770":{"position":[[34,7]]},"776":{"position":[[0,7]]},"822":{"position":[[60,9]]},"851":{"position":[[0,7]]}}}],["relationship",{"_index":20,"t":{"22":{"position":[[8,12]]},"48":{"position":[[11,12]]},"188":{"position":[[10,12]]},"190":{"position":[[10,13]]},"192":{"position":[[28,14]]},"249":{"position":[[33,12]]},"251":{"position":[[32,12]]},"264":{"position":[[18,12]]},"266":{"position":[[20,12]]},"328":{"position":[[24,12]]},"330":{"position":[[28,12]]},"397":{"position":[[26,13]]},"405":{"position":[[7,12]]},"407":{"position":[[8,12]]},"445":{"position":[[13,12]]},"447":{"position":[[19,12]]},"499":{"position":[[53,12]]},"503":{"position":[[17,12]]},"505":{"position":[[17,12]]},"521":{"position":[[13,12]]},"523":{"position":[[19,12]]},"559":{"position":[[11,12]]},"561":{"position":[[11,12]]},"618":{"position":[[15,12]]},"622":{"position":[[26,13]]},"624":{"position":[[53,13]]},"626":{"position":[[11,12]]},"628":{"position":[[53,12]]},"642":{"position":[[16,14]]},"644":{"position":[[25,13]]},"648":{"position":[[15,13]]},"650":{"position":[[15,13]]},"666":{"position":[[11,13]]},"702":{"position":[[17,12]]},"704":{"position":[[25,12]]},"706":{"position":[[20,12]]},"723":{"position":[[49,12]]},"725":{"position":[[19,12]]},"766":{"position":[[11,13]]},"794":{"position":[[19,12]]},"800":{"position":[[20,13]]}}}],["remov",{"_index":123,"t":{"266":{"position":[[4,8]]},"328":{"position":[[15,8]]},"455":{"position":[[20,8]]},"706":{"position":[[4,6]]}}}],["request",{"_index":97,"t":{"194":{"position":[[16,8]]},"196":{"position":[[23,8]]},"381":{"position":[[13,8]]},"383":{"position":[[14,8]]}}}],["requir",{"_index":224,"t":{"662":{"position":[[0,12]]},"718":{"position":[[0,12]]},"739":{"position":[[0,12]]},"762":{"position":[[0,12]]},"786":{"position":[[0,12]]},"814":{"position":[[0,12]]},"838":{"position":[[0,12]]}}}],["restrict",{"_index":34,"t":{"48":{"position":[[29,12]]},"455":{"position":[[5,12]]},"459":{"position":[[15,12]]},"463":{"position":[[36,12]]}}}],["revok",{"_index":125,"t":{"281":{"position":[[4,8]]},"283":{"position":[[15,7]]},"565":{"position":[[4,8]]}}}],["role",{"_index":13,"t":{"20":{"position":[[9,4]]},"395":{"position":[[9,5]]},"403":{"position":[[44,4]]},"405":{"position":[[51,5]]},"407":{"position":[[62,5]]},"477":{"position":[[9,5]]},"686":{"position":[[19,5]]},"690":{"position":[[18,5]]}}}],["rpm",{"_index":55,"t":{"80":{"position":[[12,3]]}}}],["same",{"_index":36,"t":{"50":{"position":[[35,4]]},"328":{"position":[[51,4]]},"330":{"position":[[55,4]]}}}],["scenario",{"_index":223,"t":{"660":{"position":[[0,8]]},"720":{"position":[[8,9]]},"741":{"position":[[8,9]]},"760":{"position":[[0,8]]},"788":{"position":[[8,9]]},"816":{"position":[[8,9]]},"840":{"position":[[8,9]]}}}],["schema",{"_index":178,"t":{"453":{"position":[[14,6]]},"465":{"position":[[9,6]]}}}],["search",{"_index":134,"t":{"303":{"position":[[10,7]]},"305":{"position":[[53,7]]},"307":{"position":[[36,6]]}}}],["section",{"_index":28,"t":{"38":{"position":[[8,8]]},"62":{"position":[[8,8]]},"74":{"position":[[8,8]]},"88":{"position":[[8,8]]},"100":{"position":[[8,8]]},"114":{"position":[[8,8]]},"126":{"position":[[8,8]]},"134":{"position":[[8,8]]},"164":{"position":[[8,8]]},"202":{"position":[[8,8]]},"210":{"position":[[8,8]]},"239":{"position":[[8,8]]},"253":{"position":[[8,8]]},"268":{"position":[[8,8]]},"285":{"position":[[8,8]]},"332":{"position":[[8,8]]},"360":{"position":[[8,8]]},"376":{"position":[[8,8]]},"387":{"position":[[8,8]]},"411":{"position":[[8,8]]},"431":{"position":[[8,8]]},"449":{"position":[[8,8]]},"469":{"position":[[8,8]]},"487":{"position":[[8,8]]},"509":{"position":[[8,8]]},"525":{"position":[[8,8]]},"545":{"position":[[8,8]]},"567":{"position":[[8,8]]},"605":{"position":[[8,8]]},"632":{"position":[[8,8]]},"652":{"position":[[8,8]]},"674":{"position":[[8,8]]},"692":{"position":[[8,8]]},"708":{"position":[[8,8]]},"776":{"position":[[8,8]]},"851":{"position":[[8,8]]}}}],["see",{"_index":207,"t":{"507":{"position":[[13,3]]},"628":{"position":[[13,3]]}}}],["self",{"_index":180,"t":{"455":{"position":[[32,4]]}}}],["server",{"_index":79,"t":{"142":{"position":[[16,6]]}}}],["servic",{"_index":73,"t":{"112":{"position":[[45,7]]},"774":{"position":[[37,7]]}}}],["setup",{"_index":68,"t":{"108":{"position":[[16,5]]}}}],["share",{"_index":108,"t":{"216":{"position":[[6,6]]},"849":{"position":[[4,7]]}}}],["solut",{"_index":151,"t":{"358":{"position":[[15,8]]},"485":{"position":[[20,9]]}}}],["specif",{"_index":131,"t":{"297":{"position":[[22,8]]}}}],["specifi",{"_index":105,"t":{"208":{"position":[[7,7]]}}}],["start",{"_index":25,"t":{"34":{"position":[[11,5]]},"92":{"position":[[11,5]]},"104":{"position":[[11,5]]},"118":{"position":[[11,5]]},"226":{"position":[[11,5]]},"243":{"position":[[11,5]]},"257":{"position":[[11,5]]},"272":{"position":[[11,5]]},"289":{"position":[[11,5]]},"319":{"position":[[11,5]]},"346":{"position":[[11,5]]},"364":{"position":[[11,5]]},"391":{"position":[[11,5]]},"439":{"position":[[11,5]]},"473":{"position":[[11,5]]},"491":{"position":[[11,5]]},"513":{"position":[[11,5]]},"529":{"position":[[11,5]]},"549":{"position":[[11,5]]},"571":{"position":[[11,5]]},"609":{"position":[[11,5]]},"636":{"position":[[11,5]]},"656":{"position":[[11,5]]},"678":{"position":[[11,5]]},"696":{"position":[[11,5]]},"712":{"position":[[11,5]]},"733":{"position":[[11,5]]},"756":{"position":[[11,5]]},"780":{"position":[[11,5]]},"808":{"position":[[11,5]]},"832":{"position":[[11,5]]}}}],["step",{"_index":26,"t":{"36":{"position":[[0,4],[8,4]]},"42":{"position":[[0,4],[8,4]]},"94":{"position":[[0,4],[8,4]]},"106":{"position":[[0,4],[8,4]]},"120":{"position":[[0,4],[8,4]]},"140":{"position":[[0,4],[8,4]]},"232":{"position":[[0,4],[8,4]]},"245":{"position":[[0,4],[8,4]]},"263":{"position":[[0,4],[8,4]]},"280":{"position":[[0,4],[8,4]]},"291":{"position":[[0,4],[8,4]]},"327":{"position":[[0,4],[8,4]]},"352":{"position":[[0,4],[8,4]]},"370":{"position":[[0,4],[8,4]]},"401":{"position":[[0,4],[8,4]]},"443":{"position":[[0,4],[8,4]]},"481":{"position":[[0,4],[8,4]]},"497":{"position":[[0,4],[8,4]]},"519":{"position":[[0,4],[8,4]]},"535":{"position":[[0,4],[8,4]]},"555":{"position":[[0,4],[8,4]]},"615":{"position":[[0,4],[8,4]]},"664":{"position":[[0,4],[8,4]]},"684":{"position":[[0,4],[8,4]]},"698":{"position":[[0,4],[8,4]]},"764":{"position":[[0,4],[8,4]]},"774":{"position":[[12,4]]}}}],["storag",{"_index":81,"t":{"144":{"position":[[17,7]]}}}],["store",{"_index":93,"t":{"176":{"position":[[10,6]]},"206":{"position":[[7,5]]}}}],["string",{"_index":182,"t":{"457":{"position":[[12,6]]}}}],["summari",{"_index":143,"t":{"311":{"position":[[0,7]]},"603":{"position":[[0,7]]},"672":{"position":[[0,7]]},"729":{"position":[[0,7]]},"752":{"position":[[0,7]]},"772":{"position":[[0,7]]},"802":{"position":[[0,7]]},"826":{"position":[[0,7]]}}}],["support",{"_index":201,"t":{"501":{"position":[[66,7]]}}}],["system",{"_index":222,"t":{"646":{"position":[[20,6]]},"686":{"position":[[54,6]]}}}],["take",{"_index":226,"t":{"668":{"position":[[0,4]]},"768":{"position":[[0,4]]},"774":{"position":[[0,6]]}}}],["target",{"_index":46,"t":{"68":{"position":[[7,6]]}}}],["team",{"_index":209,"t":{"537":{"position":[[31,4]]},"539":{"position":[[32,4]]},"541":{"position":[[15,4]]},"746":{"position":[[20,5]]},"748":{"position":[[26,5]]}}}],["telemetri",{"_index":88,"t":{"156":{"position":[[0,9]]}}}],["test",{"_index":173,"t":{"427":{"position":[[4,4]]}}}],["those",{"_index":171,"t":{"423":{"position":[[23,5]]}}}],["tie",{"_index":163,"t":{"405":{"position":[[30,3]]}}}],["time",{"_index":241,"t":{"768":{"position":[[5,4]]}}}],["timelin",{"_index":191,"t":{"467":{"position":[[12,8]]}}}],["trace",{"_index":90,"t":{"160":{"position":[[0,7]]}}}],["transact",{"_index":144,"t":{"328":{"position":[[56,11]]},"330":{"position":[[60,11]]}}}],["trip",{"_index":230,"t":{"686":{"position":[[41,4]]}}}],["tupl",{"_index":95,"t":{"188":{"position":[[23,6]]},"198":{"position":[[20,7]]},"206":{"position":[[50,6]]},"249":{"position":[[46,6]]},"251":{"position":[[45,6]]},"328":{"position":[[37,6]]},"330":{"position":[[41,6]]},"405":{"position":[[20,6]]},"407":{"position":[[21,6]]},"445":{"position":[[26,5]]},"503":{"position":[[30,5]]},"505":{"position":[[30,5]]},"521":{"position":[[26,5]]},"559":{"position":[[24,6]]},"561":{"position":[[24,6]]},"618":{"position":[[28,6]]},"626":{"position":[[24,6]]},"670":{"position":[[15,6]]},"702":{"position":[[30,5]]},"704":{"position":[[38,6]]},"723":{"position":[[62,6]]},"725":{"position":[[32,6]]},"770":{"position":[[15,6]]},"794":{"position":[[32,6]]}}}],["type",{"_index":33,"t":{"48":{"position":[[24,4]]},"170":{"position":[[10,5]]},"172":{"position":[[10,4]]},"186":{"position":[[32,5]]},"200":{"position":[[8,4]]},"295":{"position":[[31,5]]},"297":{"position":[[38,4]]},"403":{"position":[[49,4]]},"421":{"position":[[20,5]]},"423":{"position":[[29,5]]},"455":{"position":[[0,4]]},"459":{"position":[[10,4]]},"463":{"position":[[31,4]]},"501":{"position":[[47,4]]}}}],["understand",{"_index":225,"t":{"666":{"position":[[0,10]]},"686":{"position":[[4,10]]},"766":{"position":[[0,10]]}}}],["union",{"_index":38,"t":{"54":{"position":[[4,5]]}}}],["updat",{"_index":161,"t":{"403":{"position":[[4,6]]},"499":{"position":[[4,6]]},"501":{"position":[[4,6]]},"727":{"position":[[4,8]]},"796":{"position":[[4,8]]},"822":{"position":[[4,8]]},"824":{"position":[[4,8]]}}}],["us",{"_index":0,"t":{"4":{"position":[[0,3]]},"6":{"position":[[7,3]]},"72":{"position":[[10,3]]},"214":{"position":[[0,5]]},"216":{"position":[[0,5]]},"218":{"position":[[0,5]]},"336":{"position":[[0,3]]},"407":{"position":[[4,3]]},"580":{"position":[[8,4]]},"582":{"position":[[24,3]]},"587":{"position":[[8,4]]},"589":{"position":[[24,3]]},"594":{"position":[[8,4]]},"599":{"position":[[8,4]]},"670":{"position":[[0,3]]},"770":{"position":[[0,3]]}}}],["user",{"_index":70,"t":{"110":{"position":[[25,4]]},"180":{"position":[[10,5]]},"186":{"position":[[27,4]]},"228":{"position":[[9,4]]},"274":{"position":[[9,4]]},"348":{"position":[[9,4]]},"354":{"position":[[24,5]]},"356":{"position":[[24,5]]},"366":{"position":[[9,4]]},"405":{"position":[[38,5]]},"539":{"position":[[8,5]]},"559":{"position":[[37,4]]},"563":{"position":[[15,4]]},"611":{"position":[[9,4]]},"690":{"position":[[13,4]]},"800":{"position":[[37,5]]}}}],["user_id",{"_index":184,"t":{"457":{"position":[[31,8]]}}}],["userset",{"_index":155,"t":{"379":{"position":[[10,8]]},"381":{"position":[[32,9]]},"383":{"position":[[33,9]]}}}],["valid",{"_index":127,"t":{"283":{"position":[[4,10]]},"465":{"position":[[16,10]]},"563":{"position":[[4,10]]}}}],["verifi",{"_index":150,"t":{"358":{"position":[[4,6]]},"409":{"position":[[4,6]]},"485":{"position":[[4,6]]}}}],["version",{"_index":179,"t":{"453":{"position":[[21,8]]}}}],["view",{"_index":44,"t":{"66":{"position":[[0,7]]}}}],["viewer",{"_index":154,"t":{"372":{"position":[[40,6]]},"374":{"position":[[27,7]]}}}],["vs",{"_index":8,"t":{"16":{"position":[[15,2]]}}}],["what’",{"_index":2,"t":{"8":{"position":[[0,6]]}}}],["whenev",{"_index":106,"t":{"208":{"position":[[38,8]]}}}],["within",{"_index":229,"t":{"686":{"position":[[30,6]]}}}],["without",{"_index":216,"t":{"628":{"position":[[38,7]]},"666":{"position":[[25,7]]},"766":{"position":[[25,7]]}}}],["work",{"_index":152,"t":{"358":{"position":[[24,5]]},"381":{"position":[[22,4]]},"383":{"position":[[23,4]]},"409":{"position":[[40,5]]},"485":{"position":[[30,4]]},"686":{"position":[[25,4]]}}}],["workspac",{"_index":251,"t":{"818":{"position":[[9,10]]},"822":{"position":[[17,9]]}}}],["write",{"_index":119,"t":{"249":{"position":[[12,5]]},"251":{"position":[[12,5]]},"792":{"position":[[4,7]]}}}],["writer",{"_index":196,"t":{"483":{"position":[[42,7]]}}}],["zanzibar",{"_index":22,"t":{"24":{"position":[[8,9]]},"60":{"position":[[11,8]]}}}]],"pipeline":["stemmer"]}},{"documents":[{"i":3,"t":"Relationship Tuples are the facts that the OpenFGA evaluates to determine whether a user is permitted to access a resource. The way tuples are considered when making authorization decisions in OpenFGA is guided by an authorization model, which employs concepts from Relationship-Based Access Control (ReBAC) to establish authorization policies. For instance, you might declare that users are allowed to view a document if they have permission to view its parent folder. Although ReBAC offers a highly flexible method for structuring permissions, it encounters difficulties with defining permissions based on attributes that are not easily represented as relationships. Attributes such as “parent folder,” “department,” “region,” and “country” can be conceptualized as relationships between two entities. However, attributes like “IP address,” “time of day,” “team size limit,” or “maximum amount for a bank transfer” cannot be easily handled. In our ongoing efforts to expand OpenFGA’s capacity for articulating a broader range of authorization policies, we are introducing Conditional Relationship Tuples. These allow for the specification of conditions under which a particular tuple is relevant when evaluating an authorization query. Consider the following example, where we utilize Conditional Tuples to grant access for a user over a specified time duration. We stipulate that a user may be granted either unconditional access or access constrained to a certain time period: model schema 1.1 type user type document relations define viewer: [user, user with non_expired_grant] condition non_expired_grant(current_time: timestamp, grant_time: timestamp, grant_duration: duration) { current_time < grant_time + grant_duration } If we write the following tuples: user relation object condition user:bob viewer document:1 user:anne viewer document:1 name : non_expired_grant, context : { grant_time : 2023-01-01T00:00:00Z, grant_duration : 1h } You'll get the following results for the Check operations below: user relation object context result user:bob viewer document:1 allowed : true user:anne viewer document:1 current_time : 2023-01-01T00:10:00Z allowed : true user:anne viewer document:1 current_time : 2023-01-01T02:00:00Z allowed : false user:anne viewer document:1 error : \"failed to evaluate relationship condition 'non_expired_grant': context is missing parameters '[current_time]' You'll get the following results for the ListObjects operations below: user relation object context result user:anne viewer document:1 current_time : 2023-01-01T00:10:00Z objects: [ \"document:1\"] user:anne viewer document:1 error: \"failed to evaluate relationship condition 'non_expired_grant': tuple 'document:1#viewer@user:anne' is missing context parameters '[current_time]' Note that: user:bob will always get allowed:true as we has assigned as as viewer unconditionally. user:anne will get allowed:true if the current_time is before the grant_time + grant_duration and allowed:false otherwise. If you don't provide the current_time in the context, the Check and ListObjects operations will fail.","s":"Conditional Relationship Tuples for OpenFGA","u":"/blog/conditional-tuples-announcement","h":"","p":2},{"i":5,"t":"The OpenFGA Sample Stores repository has several examples that take advantage of this new feature: Granting access during a specific period of time (the use case explained above). Allow access based on the user’s IP Address. Granting access based on group membership and resource attributes. Allow access to specific features based on usage. Determine if a user can make a bank transfer based .on the transaction amount. Data types and operations supported in conditions.","s":"Use Cases","u":"/blog/conditional-tuples-announcement","h":"#use-cases","p":2},{"i":7,"t":"Conditional Relationship Tuples are included in OpenFGA 1.4.0-rc1 version. You can run it by pulling it from docker: docker pull openfga/openfga:v1.4.0-rc1 docker run -p 8080:8080 -p 8081:8081 -p 3000:3000 openfga/openfga:v1.4.0-rc1 run` OpenFGA has a rich ecosystem of developer tools. The following have been updated to support Conditional Relationship Tuples: Visual Studio Code integration which provides syntax highlighting and model validations for conditions. Beta versions of the Javascript SDK and the Go SDK, which allows using the additional parameters. The OpenFGA CLI allows validating models and runing tests that use conditional tuples. You can use it to test the new features by pointing to a “.fga.yaml” file that defines the tests you want to run, without having to deploy OpenFGA.","s":"How to use it?","u":"/blog/conditional-tuples-announcement","h":"#how-to-use-it","p":2},{"i":9,"t":"We’ll address some limitations of the current implementation: The Expand API does not consider conditions. The Visual Studio Code integration is not validating the expressions in conditions. The Playground does not let you add context for tuples and assertions. You should use the VS Code Extension + the FGA CLI to test your models for now. We'll also improve ListObjects scenarios when it's called with missing context. For example, consider the following model that enables access only to documents with a specific status: model schema 1.1 type user type document relations define can_access: [user with docs_in_draft_status] condition docs_in_draft_status(status: string) { status == \"draft\" } If you want to list all the documents a user can view, you'll need to know the status of all of those documents. Given you don't know the documents the user has access too, you can't send the status of those as a parameter to ListObjects. Our goal is to return a structure that you can use to filter documents on your side, similar to: (document.id = ‘1’ and document.status = ‘draft’) or (document.id = ‘2’ and.status = draft) This won’t scale to a large number of documents, but would be useful in some scenarios.","s":"What’s Next?","u":"/blog/conditional-tuples-announcement","h":"#whats-next","p":2},{"i":11,"t":"We want to learn how you use this feature and how we can improve it! Please reach out to us in Discord or Github with any questions or feedback.","s":"Reach out!","u":"/blog/conditional-tuples-announcement","h":"#reach-out","p":2},{"i":13,"t":"This section explains authorization, fine-grained authorization, RBAC, ABAC, ReBAC.","s":"Introduction to Authorization and OpenFGA","u":"/docs/authorization-and-openfga","h":"","p":12},{"i":15,"t":"OpenFGA is an open source solution to Fine-Grained Authorization that applies the concept of ReBAC. It was created by the Okta FGA team and was inspired by Zanzibar. It was designed for reliability and low latency at a high scale. It offers an HTTP API and has SDKs for programming languages including Node.js/JavaScript, GoLang, .NET and Python. More SDKs and integrations such as Rego are planned for the future.","s":"What Is OpenFGA?","u":"/docs/authorization-and-openfga","h":"#what-is-openfga","p":12},{"i":17,"t":"Authentication (or AuthN) is a process that ensures a user's identity. Authorization (or AuthZ) means determining if a user can perform a certain action on a particular resource. For example, when logging in to Twitter, the process in which Twitter verifies the user's username and password are correct is Authentication. The process of checking if that user can view or reply to a certain Tweet is Authorization. Read more about AuthN vs AuthZ.","s":"Authentication vs Authorization","u":"/docs/authorization-and-openfga","h":"#authentication-vs-authorization","p":12},{"i":19,"t":"Fine-Grained Authorization is being able to grant individual users access to specific objects or resources in a system. FGA at scale means being able to do so in a system that can have millions of objects, users and relations, and has a high change rate - objects are regularly added and access permissions are constantly being updated. A good example of this is Google Drive, where access can be granted either to documents, or folders; it can be granted to users individually or as a group. Access regularly changes as new documents are created and shared with specific users, whether inside the same company or outside.","s":"What Is Fine-Grained Authorization (FGA)?","u":"/docs/authorization-and-openfga","h":"#what-is-fine-grained-authorization-fga","p":12},{"i":21,"t":"In Role-Based Access Control, permissions are assigned to users based on their role in a system (e.g. a user would need an editor role to edit posts). In Attribute-Based Access Control, instead of permissions being granted based on roles, they are granted based on a set of attributes on a user or resource (e.g. if a user has both marketing and manager attributes they can publish and delete posts that have a marketing attribute, but not others). If you are interested you can read more about RBAC and ABAC.","s":"What Are Role-Based Access Control (RBAC) And Attribute-Based Access Control (ABAC)?","u":"/docs/authorization-and-openfga","h":"#what-are-role-based-access-control-rbac-and-attribute-based-access-control-abac","p":12},{"i":23,"t":"ReBAC allows expressing rules based on relations that users have with objects and that objects have with other objects. For example, a user can view a document if they can view its parent folder.","s":"What Is Relationship Based Access Control (ReBAC)?","u":"/docs/authorization-and-openfga","h":"#what-is-relationship-based-access-control-rebac","p":12},{"i":25,"t":"Zanzibar is \"Google's Consistent, Global Authorization System\" for \"determining whether online users are authorized to access digital objects\" across their products (Google Drive, YouTube, Google Photos, etc..). It uses (object, relation, user) tuples to store relation data and traverses those relations to check if there is a relation between a user and an object. Learn more about Zanzibar at the Zanzibar Academy.","s":"What Is Zanzibar?","u":"/docs/authorization-and-openfga","h":"#what-is-zanzibar","p":12},{"i":27,"t":"As you'd expect, the OpenFGA team will be at KubeCon NA 2023 in Chicago, IL! We'll have a packed agenda for the week: Jonathan Whitaker and Lucas Käldström will be presenting in Could_Native Rejects on how to use OpenFGA to manage and extend authorization in Kubernetes. Learn more here. Maria Ines Parnisari and Andres Aguiar will be presenting in AppDeveloperCon about modernizing authorization for cloud native applications using OpenFGA. Learn more here. We'll host a Project Meeting on Monday 9.30 AM in the Hudson room at the Hilton Garden Inn. We'll share how the product is being used, demo the latests features like our new CLI, the VS Code Extension, Conditional Relationships, the Java SDK... and more! We'll be in the CNCF Project Pavilion during the afternoons. We'll host our OpenFGA community meeting directly from KubeCon on Thursday 9th at 3PM UTC (8AM PST/11AM EST). If you want to meet with the team outside of these events, please pick any spot that works for you in our calendar. See you in Chicago!","s":"Join the OpenFGA team at KubeCon NA 2023","u":"/blog/kubecon-na-2023","h":"","p":26},{"i":29,"t":"The following will provide a step by step guide on how to get started with OpenFGA. When to use This section is useful if you understand the basic concepts of OpenFGA, and want to learn how to get started.","s":"Getting Started","u":"/docs/getting-started","h":"","p":28},{"i":31,"t":"Setup OpenFGA How to setup an OpenFGA server. Click to navigate Install SDK Client Install the SDK for the language of your choice. Click to navigate Create a Store Creating an OpenFGA entity that owns an authorization model and relationship tuples. Click to navigate Setup SDK Client for Store Configure the SDK client for your store. Click to navigate Configure Authorization Model Programmatically configure authorization model for an OpenFGA store. Click to navigate Update Relationship Tuples Programmatically write authorization data to an OpenFGA store. Click to navigate Perform a Check Programmatically perform an authorization check against an OpenFGA store. Click to navigate Perform a List Objects Request Programmatically perform a list objects request against an OpenFGA store. Click to navigate Integrate Within a Framework Integrate authorization checks with a framework. Click to navigate Immutable Authorization Models Learn how to take advantage of the immutable properties of Authorization Models in OpenFGA. Click to navigate Production Best Practices Best Practices of Running OpenFGA in Production Environment. Click to navigate Implementation Best Practices Best Practices of Managing Tuples and Invoking OpenFGA APIs. Click to navigate","s":"Content","u":"/docs/getting-started","h":"","p":28},{"i":33,"t":"This article explains how to configure an authorization model for a store in an OpenFGA server.","s":"Configure Authorization Model for a Store","u":"/docs/getting-started/configure-model","h":"","p":32},{"i":35,"t":"Node.js Go .NET Python CLI curl Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK, created the store and setup the SDK client. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK, created the store and setup the SDK client. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK, created the store and setup the SDK client. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK, created the store and setup the SDK client. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the CLI, created the store and setup your environment variables. You have loaded FGA_STORE_ID and FGA_SERVER_URL as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have created the store and have loaded FGA_STORE_ID and FGA_API_HOST as environment variables.","s":"Before You Start","u":"/docs/getting-started/configure-model","h":"#before-you-start","p":32},{"i":37,"t":"Assume that you want to configure your store with the following model. DSL JSON model schema 1.1 type user type document relations define reader: [user] define writer: [user] define owner: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"reader\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } To configure authorization model, we can invoke the write authorization models API. Node.js Go .NET Python CLI curl Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); const { authorization_model_id: id } = await fgaClient.writeAuthorizationModel({ \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"reader\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }); // id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } var writeAuthorizationModelRequestString = \"{\\\"schema_version\\\":\\\"1.1\\\",\\\"type_definitions\\\":[{\\\"type\\\":\\\"user\\\"},{\\\"type\\\":\\\"document\\\",\\\"relations\\\":{\\\"reader\\\":{\\\"this\\\":{}},\\\"writer\\\":{\\\"this\\\":{}},\\\"owner\\\":{\\\"this\\\":{}}},\\\"metadata\\\":{\\\"relations\\\":{\\\"reader\\\":{\\\"directly_related_user_types\\\":[{\\\"type\\\":\\\"user\\\"}]},\\\"writer\\\":{\\\"directly_related_user_types\\\":[{\\\"type\\\":\\\"user\\\"}]},\\\"owner\\\":{\\\"directly_related_user_types\\\":[{\\\"type\\\":\\\"user\\\"}]}}}}]}\" var body WriteAuthorizationModelRequest if err := json.Unmarshal([]byte(writeAuthorizationModelRequestString), &body); err != nil { t.Errorf(\"%v\", err) // .. Handle error return } data, response, err := fgaClient.OpenFgaClient.WriteAuthorizationModel(context.Background()).Body(body).Execute() if err != nil { // .. Handle error } // data.AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var modelJson = \"{\\\"schema_version\\\":\\\"1.1\\\",\\\"type_definitions\\\":[{\\\"type\\\":\\\"user\\\"},{\\\"type\\\":\\\"document\\\",\\\"relations\\\":{\\\"reader\\\":{\\\"this\\\":{}},\\\"writer\\\":{\\\"this\\\":{}},\\\"owner\\\":{\\\"this\\\":{}}},\\\"metadata\\\":{\\\"relations\\\":{\\\"reader\\\":{\\\"directly_related_user_types\\\":[{\\\"type\\\":\\\"user\\\"}]},\\\"writer\\\":{\\\"directly_related_user_types\\\":[{\\\"type\\\":\\\"user\\\"}]},\\\"owner\\\":{\\\"directly_related_user_types\\\":[{\\\"type\\\":\\\"user\\\"}]}}}}]}\"; var body = JsonSerializer.Deserialize(modelJson); var response = await fgaClient.WriteAuthorizationModel(body); // response.AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() # from openfga_sdk.models.write_authorization_model_request import WriteAuthorizationModelRequest async def write_authorization_model(): body_string = \"{\\\"schema_version\\\":\\\"1.1\\\",\\\"type_definitions\\\":[{\\\"type\\\":\\\"user\\\"},{\\\"type\\\":\\\"document\\\",\\\"relations\\\":{\\\"reader\\\":{\\\"this\\\":{}},\\\"writer\\\":{\\\"this\\\":{}},\\\"owner\\\":{\\\"this\\\":{}}},\\\"metadata\\\":{\\\"relations\\\":{\\\"reader\\\":{\\\"directly_related_user_types\\\":[{\\\"type\\\":\\\"user\\\"}]},\\\"writer\\\":{\\\"directly_related_user_types\\\":[{\\\"type\\\":\\\"user\\\"}]},\\\"owner\\\":{\\\"directly_related_user_types\\\":[{\\\"type\\\":\\\"user\\\"}]}}}}]}\" response = await fga_client_instance.write_authorization_model(json.loads(body)) # response.authorization_model_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga model write --store-id=${FGA_STORE_ID} {\"schema_version\":\"1.1\",\"type_definitions\":[{\"type\":\"user\"},{\"type\":\"document\",\"relations\":{\"reader\":{\"this\":{}},\"writer\":{\"this\":{}},\"owner\":{\"this\":{}}},\"metadata\":{\"relations\":{\"reader\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"writer\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"owner\":{\"directly_related_user_types\":[{\"type\":\"user\"}]}}}}]} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/authorization-models \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"schema_version\":\"1.1\",\"type_definitions\":[{\"type\":\"user\"},{\"type\":\"document\",\"relations\":{\"reader\":{\"this\":{}},\"writer\":{\"this\":{}},\"owner\":{\"this\":{}}},\"metadata\":{\"relations\":{\"reader\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"writer\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"owner\":{\"directly_related_user_types\":[{\"type\":\"user\"}]}}}}]}' The API will then return the authorization model ID. Note The OpenFGA API only accepts an authorization model in the API's JSON syntax. To convert between the API Syntax and the friendly DSL, you can use the FGA CLI.","s":"Step By Step","u":"/docs/getting-started/configure-model","h":"#step-by-step","p":32},{"i":39,"t":"Take a look at the following sections for more information on how to configure authorization model in your store. Getting Started with Modeling Read how to get started with modeling. More Modeling: Direct Relationships Read the basics of modeling authorization and granting access to users. More","s":"Related Sections","u":"/docs/getting-started/configure-model","h":"#related-sections","p":32},{"i":41,"t":"A store is a OpenFGA entity that contains your authorization data. You will need to create a store in OpenFGA before adding an authorization model and relationship tuples to it. This article explains how to setup an OpenFGA store.","s":"Create a Store","u":"/docs/getting-started/create-store","h":"","p":40},{"i":43,"t":"Node.js Go .NET Python CLI curl const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk'; const openFga = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // optional, defaults to \"https\" apiHost: process.env.FGA_API_HOST // required, define without the scheme (e.g. api.openfga.example instead of https://api.openfga.example) }); const { id: storeId } = await openFga.createStore({ name: \"FGA Demo Store\", }); import ( openfga \"github.com/openfga/go-sdk\" . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // optional, can be overridden per request }) if err != nil { // .. Handle error } resp, err := fgaClient.CreateStore(context.Background()).Body(ClientCreateStoreRequest{Name: \"FGA Demo\"}).Execute() if err != nil { // .. Handle error } } using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace ExampleApp; class MyProgram { static async Task Main() { var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); var store = await fgaClient.CreateStore(new ClientCreateStoreRequest(){Name = \"FGA Demo\"}) { Name = \"FGA Demo Store\" }); } } import os import openfga_sdk from openfga_sdk.client import OpenFgaClient from openfga_sdk.models.create_store_request import CreateStoreRequest configuration = openfga_sdk.Configuration( scheme = os.environ.get('FGA_API_SCHEME'), api_host = os.environ.get('FGA_API_HOST'), ) async with OpenFgaClient(configuration) as fga_client: body = CreateStoreRequest( name = \"FGA Demo Store\", ) response = await fga_client.create_store(body) async def create_store(): try: # Create a store body = CreateStoreRequest( name = \"FGA Demo\", ) api_response = await fga_client_instance.create_store(body) except openfga_sdk.ApiException as e: print(\"Exception when calling OpenFgaClient->create_store: %s\\n\" % e) fga store create --name \"FGA Demo Store\" # To create the store and directly put the Store ID into an env variable: # export FGA_STORE_ID=$(fga store create --name \"FGA Demo Store\" | jq -r .id) curl -X POST $FGA_API_HOST/stores \\ -H \"content-type: application/json\" \\ -d '{\"name\": \"FGA Demo Store\"}'","s":"Step By Step","u":"/docs/getting-started/create-store","h":"#step-by-step","p":40},{"i":45,"t":"The OpenFGA's Configuration Language is used to build a representation of a system's authorization model. It informs OpenFGA's API on what the object types in the system are and how they could relate to one another. It describes the relations possible on an object of a certain type and lists the conditions under which one is related to that object. The DSL and the JSON syntax are two presentations of that configuration language. The JSON syntax is accepted by the API and closely matches the API described in the Zanzibar paper. The DSL is syntactic sugar on top of the JSON syntax and compiles down to it before being sent to OpenFGA's API. The DSL is meant to make modeling easier and more intuitive. You'll encounter the JSON syntax when calling the API directly or through the SDKs, and the DSL when interacting with OpenFGA through the Playground. Throughout the documentation you can switch between the two presentations. To understand this guide better, you should be familiar with some OpenFGA Concepts and How to get started on modeling.","s":"Configuration Language","u":"/docs/configuration-language","h":"","p":44},{"i":47,"t":"Below is a sample authorization model. In the next sections we'll go over the building blocks that make the OpenFGA configuration language. DSL JSON model schema 1.1 type user type domain relations define member: [user] type folder relations define can_share: writer define owner: [user, domain#member] or owner from parent_folder define parent_folder: [folder] define viewer: [user, domain#member] or writer or viewer from parent_folder define writer: [user, domain#member] or owner or writer from parent_folder type document relations define can_share: writer define owner: [user, domain#member] or owner from parent_folder define parent_folder: [folder] define viewer: [user, domain#member] or writer or viewer from parent_folder define writer: [user, domain#member] or owner or writer from parent_folder { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"folder\", \"relations\": { \"can_share\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, \"owner\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"owner\" } } } ] } }, \"parent_folder\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"owner\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"parent_folder\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"can_share\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, \"owner\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"owner\" } } } ] } }, \"parent_folder\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"owner\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"parent_folder\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } } ] } info The authorization model describes four types of objects: user, domain, folder and document. The domain type definition has a single relation called member that only allows direct relationships. The folder and document type definitions each have five relations: parent_folder, owner, writer, viewer and can_share.","s":"What Does The Configuration Language Look Like?","u":"/docs/configuration-language","h":"#what-does-the-configuration-language-look-like","p":44},{"i":49,"t":"[, ...], when used at the beginning of a relation definition allows direct relationships from the objects of these specified types. The strings can be of three formats: : indicating that tuples relating objects of those types as users can be written (e.g. group:marketing can be related if group is in the type restrictions) : indicating that a tuple relating all objects of that type can be written (e.g. user:* can be added if user:* is in the type restrictions) #: indicating that tuples with sets of users that are related to an object of that type by that particular relation (e.g. group:marketing#member can be added if group#member is in the type restrictions) If the direct relationship type restrictions are missing, then no tuple can be written relating other objects as this particular relation with objects of this type (direct relationships are disallowed). info [, , ...] in the OpenFGA DSL translates to this in the OpenFGA API syntax. For example, let's take a closer look at the team type. DSL JSON type team relations define member: [user, user:*, team#member] { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user:*\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } } This team type definition defines all the relations that users can have with an object of type team. In this case the relation is: member. Due to the direct relationship type restrictions ([user, team#member]) being used, a user in the system can have a direct relationship with the team type as a member for objects of type user the user type bound public access (user:*) usersets that have a team type and a member relation (e.g. team:product#member) In the type definition snippet above, anne is a member of team:product if any one of the following relationship tuple sets exist: [ // Anne is directly related to the product team as a member { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"team:product\", }, ] [ // Everyone (`*`) is directly related to the product team as a member { \"user\": \"user:*\", \"relation\": \"member\", \"object\": \"team:product\", }, ] [ // Members of the contoso team are members of the product team { \"user\": \"team:contoso#member\", \"relation\": \"member\", \"object\": \"team:product\", }, // Anne is a member of the contoso team { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"team:contoso\", }, ] For more examples, take look at Modeling Building Blocks: Direct Relationships.","s":"The Direct Relationship Type Restrictions","u":"/docs/configuration-language","h":"#the-direct-relationship-type-restrictions","p":44},{"i":51,"t":"You can also reference other relations on the same object. Let us look at a simplified document type definition. DSL JSON type document relations define editor: [user] define viewer: [user] or editor define can_rename: editor { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"can_rename\": { \"computedUserset\": { \"relation\": \"editor\" } } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } The above document type definition defines all the relations that users can have with an object of type document. In this case the relations are: editor, viewer and can_rename. The viewer and can_rename relation definitions are both referencing editor, which is another relation on the same type. info Notice how can_rename does not reference the direct relationship type restrictions, indicating that a direct relationship is not possible (as in a user cannot be directly assigned this relation, it has to be inherited through an assignment of the editor relation). The viewer relation on the other hand allows both direct and indirect relationships using the Union Operator. In the type definition snippet above, anne is a viewer of document:new-roadmap if any one of the following relationship tuple sets exists: anne is an editor of document:new-roadmap [ // Anne is an editor of the new-roadmap document { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] anne is a viewer of document:new-roadmap [ // Anne is a viewer of the new-roadmap document { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, ] anne has a can_rename relationship with document:new-roadmap only if anne has an editor relationship with the document: anne is an editor of document:new-roadmap [ // Anne is an editor of thew new-roadmap document { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] For more examples, take a look at Modeling Building Blocks: Concentric Relationships, Modeling: Roles and Permissions and Advanced Modeling: Google Drive.","s":"Referencing Other Relations On The Same Object","u":"/docs/configuration-language","h":"#referencing-other-relations-on-the-same-object","p":44},{"i":53,"t":"Another form of indirect relationships is made possible by referencing relations on other objects. The syntax is X from Y. It requires that: the other object is related to the current object as Y the user is related to another object as X Take a look at the authorization model below. DSL JSON model schema 1.1 type user type folder relations define viewer: [user, folder#viewer] type document relations define parent_folder: [folder] define viewer: [user] or viewer from parent_folder { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"folder\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"folder\", \"relation\": \"viewer\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"parent_folder\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"parent_folder\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The snippet below taken from the authorization model above is stating that viewers of a document are all users directly assigned the viewer relation and all users who can view the document's parent folder. DSL JSON type document relations define viewer: [user] or viewer from parent_folder { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In the authorization model above, user:anne is a viewer of document:new-roadmap if any one of the following relationship tuple sets exists: Anne is a viewer of the parent folder of the new-roadmap document [ // planning folder is the parent folder of the new-roadmap document { \"user\": \"folder:planning\", \"relation\": \"parent_folder\", \"object\": \"document:new-roadmap\", }, // anne is a viewer of the planning folder { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"folder:planning\", }, ] Anne is a viewer of the new-roadmap document (direct relationship) [ // anne is a viewer of the new-roadmap document { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, ] This particular use of referencing relations on related objects is defining a transitive implied relationship. If user A is related to a certain object B as a viewer, and object B is related to object C as parent, then user A is related to object C as viewer. This can be used to indicate that viewers of a folders are viewers of all documents in that folder. caution Note that OpenFGA does not allow the referenced relation (the word after from, also called the tupleset) to be referencing another relation or allow non-concrete types (type bound public access (:*) or usersets (#)) in its type restrictions and will throw a validation error when attempting to call WriteAuthorizationModel. Note: In the deprecated 1.0 schema version, the validation error will be thrown at the time of evaluation (Check, etc..). For more examples, take look at Modeling: Parent-Child Objects, Advanced Modeling: Google Drive, Advanced Modeling: GitHub, and Advanced Modeling: Entitlements.","s":"Referencing Relations On Related Objects","u":"/docs/configuration-language","h":"#referencing-relations-on-related-objects","p":44},{"i":55,"t":"The union operator (or in the DSL, union in the JSON syntax) is used to indicate that a relationship exists if the user is in any of the sets of users (union). DSL JSON type document relations define viewer: [user] or editor { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In the type definition snippet above, user:anne is a viewer of document:new-roadmap if any of the following conditions are satisfied: there exists a direct relationship with anne as editor of document:new-roadmap [ { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] anne is a viewer of document:new-roadmap [ { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, ] info The above authorization model indicates that a user is related as a viewer if they are in any of: the userset of all users related to the object as \"viewer\"; indicating that a user can be assigned a direct viewer relation the userset of all users related to the object as \"editor\"; indicating that a user who is an editor is also implicitly a viewer So if anne is in at least one of those usersets (is either an editor or a viewer), the check on {\"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\"} will return {\"allowed\": true}. For more examples, take a look at Modeling Building Blocks: Concentric Relationships, Modeling Roles and Permissions and Advanced Modeling: Modeling for IoT.","s":"The Union Operator","u":"/docs/configuration-language","h":"#the-union-operator","p":44},{"i":57,"t":"The intersection operator (and in the DSL, intersection in the JSON syntax) is used to indicate that a relationship exists if the user is in all the sets of users (intersection) DSL JSON type document relations define viewer: authorized_user and editor { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"relation\": \"authorized_user\" } }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In the type definition snippet above, user:anne is a viewer of document:new-roadmap if all of the following conditions are satisfied: anne is an editor of document:new-roadmap [ { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] AND anne is an authorized_user of document:new-roadmap: [ { \"user\": \"user:anne\", \"relation\": \"authorized_user\", \"object\": \"document:new-roadmap\", }, ] info The above authorization model indicates that a user is related as a viewer if they are in all of: the userset of all users related to the object as \"authorized_user\" the userset of all users related to the object as \"editor\" So anne has to be in the intersection of the usersets (anne has to be both an editor AND an authorized_user), in order for the check on {\"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\"} to return {\"allowed\": true}. anne is not a viewer for document:new-roadmap if either of the following is true: anne is not an editor to document:new-roadmap: no relationship tuple of {\"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\"} anne is not an authorized_user on the document:new-roadmap: no relationship tuple of {\"user\": \"user:anne\", \"relation\": \"authorized_user\", \"object\": \"document:new-roadmap\"} For more examples, take look at Modeling with Multiple Restrictions.","s":"The Intersection Operator","u":"/docs/configuration-language","h":"#the-intersection-operator","p":44},{"i":59,"t":"The exclusion operator (but not in the DSL, difference in the JSON syntax) is used to indicate that a relationship exists if the user is in the base userset, but not in the excluded userset. This is helpful in modeling exclusion or block lists. DSL JSON type document relations define viewer: [user] but not blocked { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"difference\": { \"base\": { \"this\": {} }, \"subtract\": { \"computedUserset\": { \"relation\": \"blocked\" } } } } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In the type definition snippet above, user:anne is a viewer of document:new-roadmap if: anne is assigned a direct relationship as viewer to document:new-roadmap [ { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, ] AND anne is not blocked to document:new-roadmap. That is, the following relation tuple does not exists [ { \"user\": \"user:anne\", \"relation\": \"blocked\", \"object\": \"document:new-roadmap\", }, ] For more information, see Modeling: Blocklists. info The above authorization model indicates that a user is related as a viewer if they are in: the userset of all users related to the object as \"viewer\" but not in: the userset of all users related to the object as \"blocked\" So anne has to be both a viewer AND NOT blocked, in order for the check on {\"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\"} to return {\"allowed\": true}. anne is not a viewer for document:new-roadmap if either of the following is true: anne is not assigned direct relationship as viewer to document:new-roadmap: no relationship tuple of {\"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\"} anne is blocked on the document:new-roadmap {\"user\": \"user:anne\", \"relation\": \"blocked\", \"object\": \"document:new-roadmap\"}","s":"The Exclusion Operator","u":"/docs/configuration-language","h":"#the-exclusion-operator","p":44},{"i":61,"t":"The JSON syntax accepted by the OpenFGA API closely mirrors the syntax represented in the Zanzibar paper, with a bit of flattening and converting keys from snake_case to camelCase. Zanzibar OpenFGA JSON OpenFGA DSL this this [,] union union or intersection intersection and exclusion difference but not tuple_to_userset tupleToUserset x from y In the Zanzibar paper, there's this example: name: \"doc\" relation { name: \"owner\" } relation { name: \"editor\" userset_rewrite { union { child { _this {} } child { computed_userset { relation: \"owner\" } } }}} relation { name: \"viewer\" userset_rewrite { union { child { _this {} } child { computed_userset { relation: \"editor\" } } child { tuple_to_userset { tupleset { relation: \"parent\" } computed_userset { object: $TUPLE_USERSET_OBJECT # parent folder relation: \"viewer\" }}} }}} In the OpenFGA DSL, it would become: model schema 1.1 type doc relations define owner: [user] define editor: [user] or owner define viewer: [user] or editor or viewer from parent And in the OpenFGA JSON, it would become: { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"doc\", \"relations\": { \"owner\": { \"this\": {} }, \"editor\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"owner\" } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"parent\" }, \"computedUserset\": { \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } We believe this syntax is easier to read/write. So the following: DSL JSON model schema 1.1 type doc relations define viewer: [user] or editor or viewer from parent { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"doc\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"parent\" }, \"computedUserset\": { \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Can be read as: The users with a viewer relationship to a certain doc are any of: the set of users who are directly related with this doc as viewer the set of users who are related to this doc as editor the set of users who are related to any object OBJ_1 as viewer, where object OBJ_1 is any object related to this doc as parent (e.g. viewers of this doc's parent folder, where the parent folder is OBJ_1) Learn more about Zanzibar at the Zanzibar Academy.","s":"Equivalent Zanzibar Concepts","u":"/docs/configuration-language","h":"#equivalent-zanzibar-concepts","p":44},{"i":63,"t":"Check the following sections for more on how to use the configuration language in modeling authorization. OpenFGA Concepts Learn about the OpenFGA Concepts. More Modeling: Getting Started Learn about how to get started with modeling your permission system in OpenFGA. More Direct Access Learn about modeling user access to an object. More","s":"Related Sections","u":"/docs/configuration-language","h":"#related-sections","p":44},{"i":65,"t":"Authorization Models in OpenFGA are immutable, they are created once and then can no longer be deleted or modified. Each time you write an authorization model, a new version is created.","s":"Immutable Authorization Models","u":"/docs/getting-started/immutable-models","h":"","p":64},{"i":67,"t":"You can list all the authorization models for a store using the ReadAuthorizationModels API. This endpoint returns the results sorted in reverse chronological order, as in the first model in the list is the latest model. By default, only the last 50 models are returned, but you can paginate across by passing in the appropriate continuation_token.","s":"Viewing All the Authorization Models","u":"/docs/getting-started/immutable-models","h":"#viewing-all-the-authorization-models","p":64},{"i":69,"t":"Some endpoints relating to tuples (Check, ListObjects, Expand, Write) accept an authorization_model_id, which we strongly recommend passing, especially in production. In practice, you would pin the authorization model ID alongside the store ID in your configuration management system. Your services would read this value and use it in their requests to FGA. This helps you ensure that your services are using the same consistent ID across all your applications, and that rollouts can be seemless.","s":"How to Target a Particular Model","u":"/docs/getting-started/immutable-models","h":"#how-to-target-a-particular-model","p":64},{"i":71,"t":"Targeting a specific model ID would ensure that you don't accidentally break your authorization checks in production because a mistake was made when updating the authorization model. It would also slightly improve the latency on your check requests. If that field is passed, evaluation and validation will happen for that particular authorization model ID. If this field is not passed, OpenFGA will use the last created Authorization Model for that store.","s":"Benefits of Passing in an Authorization Model ID","u":"/docs/getting-started/immutable-models","h":"#benefits-of-passing-in-an-authorization-model-id","p":64},{"i":73,"t":"Being able to target multiple versions of the authorization model enables you to progressively roll out model changes, which is something you should consider doing if the changes are significant. You could: Do shadow checks where you would perform checks against both your existing model and the new upcoming model you are hoping to replace it with.This will help you detect and resolve any accidental discrepancies you may be introducing, and ensure that your new model is at least as good as your old one. When you are confident with your model, you could implement gradual rollouts that would allow you to monitor and check if any users are having access issues before you go ahead and increase the rollout to 100% of your user base. Getting an Authorization Model's Creation Date The Authorization Model ID is a ULID which includes the date created. You can extract the creation date using a library for your particular language. For example, in JavaScript you can do the following: import ulid = require('ulid'); const time = ulid.decodeTime(id);","s":"Potential Use-cases","u":"/docs/getting-started/immutable-models","h":"#potential-use-cases","p":64},{"i":75,"t":"Learn more about modeling and production usage in OpenFGA. Configuration Language Learn about the OpenFGA Configuration Language. More Getting Started with Modeling Read how to get started with modeling. More Data and API Best Practices Learn the best practices for managing data and invoking APIs in production environment More","s":"Related Sections","u":"/docs/getting-started/immutable-models","h":"#related-sections","p":64},{"i":77,"t":"To get started, install the OpenFGA SDK packages. Node.js Go .NET Python CLI You can find the Node.js package on npm at: @openfga/sdk. Using npm: npm install @openfga/sdk Using yarn: yarn add @openfga/sdk You can find the Go package on GitHub at: @openfga/go-sdk. To install: go get -u github.com/openfga/go-sdk In your code, import the module and use it: import ( openfga \"github.com/openfga/go-sdk\" ) func main() { configuration, err := openfga.NewConfiguration(openfga.Configuration{ ApiScheme: os.Getenv(\"FGA_API_SCHEME\"), // optional, defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.openfga.example instead of https://api.openfga.example) }) if err != nil { // .. Handle error } } You can then run go mod tidy to update go.mod and go.sum if you are using them. The OpenFGA .NET SDK is available on NuGet. You can install it using: The dotnet CLI: dotnet add package OpenFGA.Sdk The Package Manager Console inside Visual Studio: Install-Package OpenFGA.Sdk Visual Studio, Visual Studio for Mac and IntelliJ Rider: Search for and install OpenFGA.Sdk in each of their respective package manager UIs. The OpenFGA Python SDK is available on PyPI. To install: pip3 install openfga_sdk In your code, import the module and use it: import openfga_sdk The OpenFGA CLI is available on GitHub. To install: Brew​ brew install openfga/tap/fga Linux (deb, rpm and apk) packages​ Download the .deb, .rpm or .apk packages from the releases page. Debian: sudo apt install ./fga__linux_.deb Fedora: sudo dnf install ./fga__linux_.rpm Alpine Linux: sudo apk add --allow-untrusted ./fga__linux_.apk Docker​ docker pull openfga/cli; docker run -it openfga/cli Go​ note that the command will be named cli go install github.com/openfga/cli@latest Manually​ Download the pre-compiled binaries from the releases page.","s":"Install SDK Client","u":"/docs/getting-started/install-sdk","h":"","p":76},{"i":79,"t":"brew install openfga/tap/fga","s":"Brew","u":"/docs/getting-started/install-sdk","h":"#brew","p":76},{"i":81,"t":"Download the .deb, .rpm or .apk packages from the releases page. Debian: sudo apt install ./fga__linux_.deb Fedora: sudo dnf install ./fga__linux_.rpm Alpine Linux: sudo apk add --allow-untrusted ./fga__linux_.apk","s":"Linux (deb, rpm and apk) packages","u":"/docs/getting-started/install-sdk","h":"#linux-deb-rpm-and-apk-packages","p":76},{"i":83,"t":"docker pull openfga/cli; docker run -it openfga/cli","s":"Docker","u":"/docs/getting-started/install-sdk","h":"#docker","p":76},{"i":85,"t":"note that the command will be named cli go install github.com/openfga/cli@latest","s":"Go","u":"/docs/getting-started/install-sdk","h":"#go","p":76},{"i":87,"t":"Download the pre-compiled binaries from the releases page.","s":"Manually","u":"/docs/getting-started/install-sdk","h":"#manually","p":76},{"i":89,"t":"Get OpenFGA's SDKs to add authorization to your API. OpenFGA Node.js SDK Install our Node.js & JavaScript SDK to get started. More OpenFGA Go SDK Use our Go SDK to easily connect your Go application to the OpenFGA API More OpenFGA .NET SDK Connect your .NET service with OpenFGA using our .NET SDK More OpenFGA Python SDK Connect your Python service with OpenFGA using our Python SDK More","s":"Related Sections","u":"/docs/getting-started/install-sdk","h":"#related-sections","p":76},{"i":91,"t":"This section will illustrate how to perform a check request to determine whether a user has a certain relationship with an object.","s":"Perform a Check","u":"/docs/getting-started/perform-check","h":"","p":90},{"i":93,"t":"Node.js Go .NET Python CLI curl Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_SERVER_URL as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables.","s":"Before You Start","u":"/docs/getting-started/perform-check","h":"#before-you-start","p":90},{"i":95,"t":"Assume that you want to check whether user anne has relationship reader with object document:Z","s":"Step By Step","u":"/docs/getting-started/perform-check","h":"#step-by-step","p":90},{"i":97,"t":"Before calling the check API, you will need to configure the API client. Node.js Go .NET Python CLI curl // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) To obtain the access token: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)","s":"01. Configure the OpenFGA API Client","u":"/docs/getting-started/perform-check","h":"#01-configure-the--api-client","p":90},{"i":99,"t":"To check whether user user:anne has relationship reader with object document:Z Node.js Go .NET Python CLI curl // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'document:Z', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"document:Z\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"document:Z\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"document:Z\", ) response = await fga_client.check(body, options) # response.allowed = true fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:Z # Response: {\"allowed\":true} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:Z\"}}' # Response: {\"allowed\":true} The result's allowed field will return true if the relationship exists and false if the relationship does not exist.","s":"02. Calling Check API","u":"/docs/getting-started/perform-check","h":"#02-calling-check-api","p":90},{"i":101,"t":"Take a look at the following section for more on how to perform authorization checks in your system OpenFGA Check API Read the Check API documentation and see how it works. More","s":"Related Sections","u":"/docs/getting-started/perform-check","h":"#related-sections","p":90},{"i":103,"t":"This section will illustrate how to integrate OpenFGA within a framework, such as Fastify or Fiber.","s":"Integrate Within a Framework","u":"/docs/getting-started/framework","h":"","p":102},{"i":105,"t":"Node.js Go Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the OpenFGA SDK. You have configured the authorization model and updated the relationship tuples. You know how to perform a Check. You have loaded FGA_API_HOST and FGA_STORE_ID as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the OpenFGA SDK. You have configured the authorization model and updated the relationship tuples. You know how to perform a Check. You have loaded FGA_API_HOST and FGA_STORE_ID as environment variables.","s":"Before You Start","u":"/docs/getting-started/framework","h":"#before-you-start","p":102},{"i":107,"t":"Assume that you want to have a web service for documents using one of the frameworks mentioned above. The service will authenticate users via JWT tokens, which contain the user ID. Note The reader should set up their own login method based on their OpenID connect provider's documentation. Assume that you want to provide a route GET /read/{document} to return documents depending on whether the authenticated user has access to it.","s":"Step By Step","u":"/docs/getting-started/framework","h":"#step-by-step","p":102},{"i":109,"t":"The first step is to install the framework. Node.js Go For the context of this example, we will use the Fastify framework. For that we need to install the following packages: the fastify package that provides the framework itself the fastify-plugin package that allows integrating plugins with Fastify the fastify-jwt package for processing JWT tokens Using npm: npm install fastify fastify-plugin fastify-jwt Using yarn: yarn add fastify fastify-plugin fastify-jwt Next, we setup the web service with the GET /read/{document} route in file app.js. // Require the framework and instantiate it const fastify = require('fastify')({ logger: true }); // Declare the route fastify.get('/read/:document', async (request, reply) => { return { read: request.params.document }; }); // Run the server const start = async () => { try { await fastify.listen(3000); } catch (err) { fastify.log.error(err); process.exit(1); } }; start(); For the context of this example, we will use the Fiber framework. For that we need to install the following Go packages: the gofiber/fiber package that provides the Fiber framework itself the gofiber/jwt middleware authentication layer for JWT the golang-jwt package that provides Go support for JWT go get -u github.com/gofiber/fiber/v2 github.com/gofiber/jwt/v3 github.com/golang-jwt/jwt/v4 Next, we setup the web service with the GET /read/{document} route. package main import \"github.com/gofiber/fiber/v2\" func main() { app := fiber.New() app.Get(\"/read/:document\", read) app.Listen(\":3000\") } func read(c *fiber.Ctx) error { return c.SendString(c.Params(\"document\")) }","s":"01. Install And Setup Framework","u":"/docs/getting-started/framework","h":"#01-install-and-setup-framework","p":102},{"i":111,"t":"Before we can call OpenFGA to protect the /read/{document} route, we need to validate the user's JWT. Node.js Go The fastify-jwt package allows validation of JWT tokens, as well as providing access to the user's identity. In jwt-authenticate.js: const fp = require('fastify-plugin'); module.exports = fp(async function (fastify, opts) { fastify.register(require('fastify-jwt'), { secret: { private: readFileSync(`${path.join(__dirname, 'certs')}/private.key`, 'utf8'), public: readFileSync(`${path.join(__dirname, 'certs')}/public.key`, 'utf8'), }, sign: { algorithm: 'RS256' }, }); fastify.decorate('authenticate', async function (request, reply) { try { await request.jwtVerify(); } catch (err) { reply.send(err); } }); }); Then, use the preValidation hook of a route to protect it and access the user information inside the JWT: In route-read.js: module.exports = async function (fastify, opts) { fastify.get( '/read/:document', { preValidation: [fastify.authenticate], }, async function (request, reply) { // the user's id is in request.user return { read: request.params.document }; }, ); }; Finally, update app.js to register the newly added hooks. const fastify = require('fastify')({ logger: true }); const jwtAuthenticate = require('./jwt-authenticate'); const routeread = require('./route-read'); fastify.register(jwtAuthenticate); fastify.register(routeread); // Run the server! const start = async () => { try { await fastify.listen(3000); } catch (err) { fastify.log.error(err); process.exit(1); } } start(); We will now setup middleware to authenticate the incoming JWTs. package main import ( \"crypto/rand\" \"crypto/rsa\" \"log\" \"github.com/gofiber/fiber/v2\" jwtware \"github.com/gofiber/jwt/v3\" \"github.com/golang-jwt/jwt/v4\" ) var ( // Do not do this in production. // In production, you would have the private key and public key pair generated // in advance. NEVER add a private key to any GitHub repo. privateKey *rsa.PrivateKey ) func main() { app := fiber.New() // Just as a demo, generate a new private/public key pair on each run. rng := rand.Reader var err error privateKey, err = rsa.GenerateKey(rng, 2048) if err != nil { log.Fatalf(\"rsa.GenerateKey: %v\", err) } // JWT Middleware app.Use(jwtware.New(jwtware.Config{ SigningMethod: \"RS256\", SigningKey: privateKey.Public(), })) app.Get(\"/read/:document\", read) app.Listen(\":3000\") } func read(c *fiber.Ctx) error { user := c.Locals(\"user\").(*jwt.Token) claims := user.Claims.(jwt.MapClaims) name := claims[\"name\"].(string) return c.SendString(name + \" read \" + c.Params(\"document\")) }","s":"02. Authenticate And Get User ID","u":"/docs/getting-started/framework","h":"#02-authenticate-and-get-user-id","p":102},{"i":113,"t":"Node.js Go First, we will create a decorator preauthorize to parse the incoming HTTP method as well as name of the document, and set the appropriate relation and object that we will call Check on. In preauthorize.js: const fp = require('fastify-plugin'); module.exports = fp(async function (fastify, opts) { fastify.decorate('preauthorize', async function (request, reply) { try { switch (request.method) { case 'GET': request.relation = 'reader'; break; case 'POST': request.relation = 'writer'; break; case 'DELETE': default: request.relation = 'owner'; break; } request.object = `document:${request.params.document}`; } catch (err) { reply.send(err); } }); }); Next, we will create a decorator called authorize. This decorator will invoke the Check API to see if the user has a relationship with the specified document. In authorize.js: const fp = require('fastify-plugin'); const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk'; module.exports = fp(async function (fastify, opts) { fastify.decorate('authorize', async function (request, reply) { try { // configure the openfga api client const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Optional. Can be \"http\" or \"https\". Defaults to \"https\" apiHost: process.env.FGA_API_HOST, storeId: process.env.FGA_STORE_ID, }); const { allowed } = await fgaClient.check({ user: request.user, relation: request.relation, object: request.object, }); if (!allowed) { reply.code(401).send(`Not authenticated`); } } catch (err) { reply.send(err); } }); }); We can now update the GET /read/{document} route to check for user permissions. In route-read.js: module.exports = async function (fastify, opts) { fastify.get( '/read/:document', { preValidation: [fastify.authenticate, fastify.preauthorize, fastify.authorize], }, async function (request, reply) { // the user's id is in request.user return { read: request.params.document }; }, ); }; Finally, we will register the new hooks in app.js: const fastify = require('fastify')({ logger: true }); const jwtAuthenticate = require('./jwt-authenticate'); const preauthorize = require('./preauthorize'); const authorize = require('./authorize'); const routeread = require('./route-read'); fastify.register(jwtAuthenticate); fastify.register(preauthorize); fastify.register(authorize); fastify.register(routeread); const start = async () => { try { await fastify.listen(3000); } catch (err) { fastify.log.error(err); process.exit(1); } } start(); We will create two middlewares: preauthorize will parse the user's JWT and prepare variables needed to call Check API. checkAuthorization will call the Check API to see if the user has a relationship with the specified document. package main import ( \"context\" \"crypto/rand\" \"crypto/rsa\" \"log\" \"os\" \"github.com/gofiber/fiber/v2\" jwtware \"github.com/gofiber/jwt/v3\" \"github.com/golang-jwt/jwt/v4\" openfga \"github.com/openfga/go-sdk\" . \"github.com/openfga/go-sdk/client\" ) var ( // Do not do this in production. // In production, you would have the private key and public key pair generated // in advance. NEVER add a private key to any GitHub repo. privateKey *rsa.PrivateKey ) func main() { app := fiber.New() // Just as a demo, generate a new private/public key pair on each run. rng := rand.Reader var err error privateKey, err = rsa.GenerateKey(rng, 2048) if err != nil { log.Fatalf(\"rsa.GenerateKey: %v\", err) } // JWT Middleware app.Use(jwtware.New(jwtware.Config{ SigningMethod: \"RS256\", SigningKey: privateKey.Public(), })) app.Use(\"/read/:document\", preauthorize) app.Use(checkAuthorization) app.Get(\"/read/:document\", read) app.Listen(\":3000\") } func read(c *fiber.Ctx) error { user := c.Locals(\"user\").(*jwt.Token) claims := user.Claims.(jwt.MapClaims) name := claims[\"name\"].(string) return c.SendString(name + \" read \" + c.Params(\"document\")) } func preauthorize(c *fiber.Ctx) error { // get the user name from JWT user := c.Locals(\"user\").(*jwt.Token) claims := user.Claims.(jwt.MapClaims) name := claims[\"name\"].(string) c.Locals(\"username\", name) // parse the HTTP method switch (c.Method()) { case \"GET\": c.Locals(\"relation\", \"reader\") case \"POST\": c.Locals(\"relation\", \"writer\") case \"DELETE\": c.Locals(\"relation\", \"owner\") default: c.Locals(\"relation\", \"owner\") } // get the object name and prepend with type name \"document:\" c.Locals(\"object\", \"document:\" + c.Params(\"document\")) return c.Next() } // Middleware to check whether user is authorized to access document func checkAuthorization(c *fiber.Ctx) error { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // optional, can be overridden per request }) if err != nil { return fiber.NewError(fiber.StatusServiceUnavailable, \"Unable to build OpenFGA client\") } body := ClientCheckRequest{ User: c.Locals(\"username\").(string), Relation: c.Locals(\"relation\").(string), Object: c.Locals(\"object\").(string), } data, err := fgaClient.OpenFga.Check(context.Background()).Body(body).Execute() if err != nil { return fiber.NewError(fiber.StatusServiceUnavailable, \"Unable to check for authorization\") } if !(*data.Allowed) { return fiber.NewError(fiber.StatusUnauthorized, \"Unauthorized to access document\") } // Go to the next middleware return c.Next() }","s":"03. Integrate The OpenFGA Check API Into The Service","u":"/docs/getting-started/framework","h":"#03-integrate-the--check-api-into-the-service","p":102},{"i":115,"t":"Take a look at the following sections for examples that you can try when integrating with SDK. Entitlements Modeling Entitlements for a System in OpenFGA. More IoT Modeling Fine Grained Authorization for an IoT Security Camera System with OpenFGA. More Slack Modeling Authorization for Slack with OpenFGA. More","s":"Related Sections","u":"/docs/getting-started/framework","h":"#related-sections","p":102},{"i":117,"t":"This section will illustrate how to perform a list objects request to determine all the objects of a given type a user has a specified relationship with.","s":"Perform a List Objects call","u":"/docs/getting-started/perform-list-objects","h":"","p":116},{"i":119,"t":"Node.js Go .NET Python CLI curl Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_SERVER_URL as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables.","s":"Before You Start","u":"/docs/getting-started/perform-list-objects","h":"#before-you-start","p":116},{"i":121,"t":"Assume that you want to list all objects of type document that user anne has reader relationship with:","s":"Step By Step","u":"/docs/getting-started/perform-list-objects","h":"#step-by-step","p":116},{"i":123,"t":"Before calling the check API, you will need to configure the API client. Node.js Go .NET Python CLI curl // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) To obtain the access token: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)","s":"01. Configure the OpenFGA API Client","u":"/docs/getting-started/perform-list-objects","h":"#01-configure-the--api-client","p":116},{"i":125,"t":"To return all documents that user user:anne has relationship reader with: Node.js Go .NET Python CLI curl const response = await fgaClient.listObjects({ user: \"user:anne\", relation: \"reader\", type: \"document\", }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }); // response.objects = [\"document:otherdoc\", \"document:planning\"] options := ClientListObjectsOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientListObjectsRequest{ User: \"user:anne\", Relation: \"reader\", Type: \"document\", } data, err := fgaClient.ListObjects(context.Background()). Body(requestBody). Options(options). Execute() // data = { \"objects\": [\"document:otherdoc\", \"document:planning\"] } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientListObjectsRequest { User = \"user:anne\", Relation = \"reader\", Type = \"document\", }; var response = await fgaClient.ListObjects(body, options); // response.Objects = [\"document:otherdoc\", \"document:planning\"] options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientListObjectsRequest( user=\"user:anne\", relation=\"reader\", type=\"document\", ) response = await fga_client.list_objects(body, options) # response.objects = [\"document:otherdoc\", \"document:planning\"] fga query list-objects --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document # Response: {\"objects\": [\"document:otherdoc\", \"document:planning\"]} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/list-objects \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{ \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"type\": \"document\", \"relation\": \"reader\", \"user\":\"user:anne\" }' # Response: {\"objects\": [\"document:otherdoc\", \"document:planning\"]} The result document:otherdoc and document:planning are the document objects that user:anne has reader relationship with.","s":"02. Calling List Objects API","u":"/docs/getting-started/perform-list-objects","h":"#02-calling-list-objects-api","p":116},{"i":127,"t":"Take a look at the following section for more on how to perform authorization checks in your system OpenFGA List Objects API Read the List Objects API documentation and see how it works. More","s":"Related Sections","u":"/docs/getting-started/perform-list-objects","h":"#related-sections","p":116},{"i":129,"t":"The following list outlines some guidelines and best practices for running OpenFGA in a production environment: Configure Authentication Enable HTTP TLS or gRPC TLS or both Set the log.format to \"json\" Set the log.level to \"info\" Disable the Playground. Set Concurrency Limits","s":"Running OpenFGA in Production","u":"/docs/getting-started/running-in-production","h":"","p":128},{"i":131,"t":"To ensure good performance for OpenFGA, it is recommended that the database be: Used exclusively for OpenFGA and not shared with other applications. This allows scaling the database independently and avoiding contention with your database. Bootstrapped and managed with the openfga migrate command. This will ensure the appropriate database indexes are created. It's strongly recommended to fine-tune your server database connection settings to avoid having to re-establish database connections frequently. Establishing database connections is slow and will negatively impact performance, and so here are some guidelines for managing database connection settings: The server setting OPENFGA_DATASTORE_MAX_OPEN_CONNS should be set to be equal to your database's max connections. For example, in Postgres, you can see this value via running the SQL query SHOW max_connections;. If you are running multiple instances of the OpenFGA server, you should divide this setting equally among the instances. For example, if your database's max_connections is 100, and you have 2 OpenFGA instances, OPENFGA_DATASTORE_MAX_OPEN_CONNS should be set to 50 for each instance. The OPENFGA_DATASTORE_MAX_IDLE_CONNS should be set to a value no greater than the maximum open connections (see the bullet point above), but it should be set sufficiently high enough to avoid having to recreate connections on each request. If, when monitoring your database stats, you see a lot of database connections being closed and subsequently reopened, then you should consider increasing the maximum number of idle connections. If idle connections are getting reaped frequently, then consider increasing the OPENFGA_DATASTORE_CONN_MAX_IDLE_TIME to a large value. When in doubt, prioritize keeping connections around for longer rather than shorter, because doing so will drastically improve performance.","s":"Database Recommendations","u":"/docs/getting-started/running-in-production","h":"#database-recommendations","p":128},{"i":133,"t":"note Before modifying concurrency limits please make sure you've followed the guidance for Database Recommendations OpenFGA queries such as Check and ListObjects can be quite database and CPU intensive in some cases. If you notice that a single request is consuming a lot of CPU or creating a high degree of database contention, then you may consider setting some concurrency limits to protect other requests from being negatively impacted by overly aggressive queries. The following table enumerates the server's concurrency specific settings: flag env config --max-concurrent-reads-for-list-objects OPENFGA_MAX_CONCURRENT_READS_FOR_LIST_OBJECTS maxConcurrentReadsForListObjects --max-concurrent-reads-for-check OPENFGA_MAX_CONCURRENT_READS_FOR_CHECK maxConcurrentReadsForCheck --resolve-node-limit OPENFGA_RESOLVE_NODE_LIMIT resolveNodeLimit --resolve-node-breadth-limit OPENFGA_RESOLVE_NODE_BREADTH_LIMIT resolveNodeBreadthLimit Determining the right values for these settings will be based on a variety of factors including, but not limited to, the database specific deployment topology, the FGA model(s) involved, and the relationship tuples in the system. However, here are some high-level guidelines: If a single ListObjects query is negatively impacting other query endpoints by increasing their latency or their error rate, then consider setting a lower value for OPENFGA_MAX_CONCURRENT_READS_FOR_LIST_OBJECTS. If a single Check query is negatively impacting other query endpoints by increasing their latency or their error rate, then consider setting a lower value for OPENFGA_MAX_CONCURRENT_READS_FOR_CHECK. If you still see high request latencies despite the guidance above, then you may additionally consider setting stricter limits on the query resolution behavior by limiting the resolution depth and resolution breadth. These can be controlled with the OPENFGA_RESOLVE_NODE_LIMIT and OPENFGA_RESOLVE_NODE_BREADTH_LIMIT settings, respectively. Consider these guidelines: OPENFGA_RESOLVE_NODE_LIMIT limits the resolution depth of a single query, and thus it sets an upper bound on how deep a relationship hierarchy may be. A high value will allow a single query to involve more hierarchical resolution and therefore more database queries, while a low value will reduce the number of hierarchical resolutions that will be allowed and thus reduce the number of database queries. OPENFGA_RESOLVE_NODE_BREADTH_LIMIT limits the resolution breadth. It sets an upper bound on the number of in-flight resolutions that can be taking place on one or more usersets. A high value will allow a single query to involve more concurrent evaluations to take place and therefore more database queries and server processes, while a low value will reduce the overall number of concurrent resolutions that will be allowed and thus reduce the number of database queries and server processes.","s":"Concurrency Limits","u":"/docs/getting-started/running-in-production","h":"#concurrency-limits","p":128},{"i":135,"t":"Check the following sections for more on how to run OpenFGA in production environment. Data and API Best Practices Learn the best practices for managing data and invoking APIs in production environment More Migrating Relations Learn how to migrate relations in a production environment More Migrating Schema 1.1 Learn how to migrate to model schema 1.1 More","s":"Related Sections","u":"/docs/getting-started/running-in-production","h":"#related-sections","p":128},{"i":137,"t":"To deploy OpenFGA into a Kubernetes environment you can use the official OpenFGA Helm chart. Please refer to the official documentation on Artifact Hub for the Helm chart for more instructions.","s":"☸️ Setup OpenFGA with Kubernetes","u":"/docs/getting-started/setup-openfga/kubernetes","h":"","p":136},{"i":139,"t":"This article explains how to start your own OpenFGA server using Docker, and how to configure it.","s":"🐳 Setup OpenFGA with Docker","u":"/docs/getting-started/setup-openfga/docker","h":"","p":138},{"i":141,"t":"If you want to run OpenFGA locally as a Docker container, follow these steps: Install Docker (if not already installed). Run docker pull openfga/openfga to get the latest docker image. Run docker run -p 8080:8080 -p 8081:8081 -p 3000:3000 openfga/openfga run. This will start an HTTP server and gRPC server with the default configuration options. Port 8080 is used to serve the HTTP API, 8081 is used to serve the gRPC API, and 3000 is used for the Playground.","s":"Step By Step","u":"/docs/getting-started/setup-openfga/docker","h":"#step-by-step","p":138},{"i":143,"t":"You may configure the OpenFGA server with a config.yaml file. The config.yaml can be specified in either: /etc/openfga $HOME/.openfga . (i.e., the current working directory). The OpenFGA server will search for the configuration file in the above order. Here is a sample configuration to run OpenFGA with a Postgres database and using a preshared key for authentication: datastore: engine: postgres uri: postgres://user:password@localhost:5432/mydatabase authn: method: preshared preshared: keys: [\"key1\", \"key2\"] All possible configurations and their default values are defined in config-schema.json. Information The OpenFGA server supports environment variables for configuration, and they will take priority over your configuration file. Each variable must be prefixed with OPENFGA_ and followed by your option in uppercase (e.g --grpc-tls-key becomes OPENFGA_GRPC_TLS_KEY).","s":"Configuring The Server","u":"/docs/getting-started/setup-openfga/docker","h":"#configuring-the-server","p":138},{"i":145,"t":"OpenFGA supports multiple storage engine options, including: memory - The memory storage engine is the default, but it is not persistent (data is lost between server restarts). postgres - The Postgres storage engine requires a Postgres instance that the OpenFGA server can reach. mysql - The MySQL storage engine requires a MySQL instance that the OpenFGA server can reach, and that the connection URI specifies the query parseTime=true. Postgres​ Docker Docker Compose Let's assume you want to run OpenFGA and Postgres in containers. The first thing we should do is create a new network as this will make communication between containers a bit simpler: docker network create openfga Start Postgres in the network you created above: docker run -d --name postgres --network=openfga -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password postgres:14 You should now have Postgres running in a container in the openfga network. However, it will not have the tables required for running OpenFGA. You can use the migrate command to create the tables. Using the OpenFGA container, this will look like: docker run --rm --network=openfga openfga/openfga migrate \\ --datastore-engine postgres \\ --datastore-uri \"postgres://postgres:password@postgres:5432/postgres?sslmode=disable\" Finally, start OpenFGA: docker run --name openfga --network=openfga -p 3000:3000 -p 8080:8080 -p 8081:8081 openfga/openfga run \\ --datastore-engine postgres \\ --datastore-uri 'postgres://postgres:password@postgres:5432/postgres?sslmode=disable' Copy the below code block into a local file named: docker-compose.yaml version: '3.8' networks: openfga: services: postgres: image: postgres:14 container_name: postgres networks: - openfga ports: - \"5432:5432\" environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=password healthcheck: test: [ \"CMD-SHELL\", \"pg_isready -U postgres\" ] interval: 5s timeout: 5s retries: 5 migrate: depends_on: postgres: condition: service_healthy image: openfga/openfga:latest container_name: migrate command: migrate environment: - OPENFGA_DATASTORE_ENGINE=postgres - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable networks: - openfga openfga: depends_on: migrate: condition: service_completed_successfully image: openfga/openfga:latest container_name: openfga environment: - OPENFGA_DATASTORE_ENGINE=postgres - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable - OPENFGA_LOG_FORMAT=json command: run networks: - openfga ports: # Needed for the http server - \"8080:8080\" # Needed for the grpc server (if used) - \"8081:8081\" # Needed for the playground (Do not enable in prod!) - \"3000:3000\" In a terminal, navigate to that directory and run: docker-compose up This will start the Postgres database, run openfga migrate to configure the database and finally start the OpenFGA server. Now you can try to Create a Store. MySQL​ Setting up MySQL and OpenFGA is very similar to setting up Postgres and OpenFGA. info Note that the MySQL datastore has stricter limits for the max length of some fields for tuples compared to other datastore engines, in particular: object type is at most 128 characters (down from 256) object id is at most 128 characters (down from 256) user is at most 256 characters (down from 512) Docker Docker Compose We first make a network: docker network create openfga Then, start MySQL in the network you created above: docker run -d --name mysql --network=openfga -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=openfga mysql:8 You should now have MySQL running in a container in the openfga network. But we still have to migrate all the tables to be able to run OpenFGA. You can use the migrate command to create the tables. Using the OpenFGA container, this will look like: docker run --rm --network=openfga openfga/openfga migrate \\ --datastore-engine mysql \\ --datastore-uri 'root:secret@tcp(mysql:3306)/openfga?parseTime=true' Finally, start OpenFGA: docker run --name openfga --network=openfga -p 3000:3000 -p 8080:8080 -p 8081:8081 openfga/openfga run \\ --datastore-engine mysql \\ --datastore-uri 'root:secret@tcp(mysql:3306)/openfga?parseTime=true' Copy the below code block into a local file named: docker-compose.yaml version: '3.8' networks: openfga: services: mysql: image: mysql:8 container_name: mysql networks: - openfga ports: - \"3306:3306\" environment: - MYSQL_ROOT_PASSWORD=secret - MYSQL_DATABASE=openfga healthcheck: test: [\"CMD\", 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p$$MYSQL_ROOT_PASSWORD' ] timeout: 20s retries: 5 migrate: depends_on: mysql: condition: service_healthy image: openfga/openfga:latest container_name: migrate command: migrate environment: - OPENFGA_DATASTORE_ENGINE=mysql - OPENFGA_DATASTORE_URI=root:secret@tcp(mysql:3306)/openfga?parseTime=true networks: - openfga openfga: depends_on: migrate: condition: service_completed_successfully image: openfga/openfga:latest container_name: openfga environment: - OPENFGA_DATASTORE_ENGINE=mysql - OPENFGA_DATASTORE_URI=root:secret@tcp(mysql:3306)/openfga?parseTime=true - OPENFGA_LOG_FORMAT=json command: run networks: - openfga ports: # Needed for the http server - \"8080:8080\" # Needed for the grpc server (if used) - \"8081:8081\" # Needed for the playground (Do not enable in prod!) - \"3000:3000\" In a terminal, navigate to that directory and run: docker-compose up This will start the MySQL database, run openfga migrate to configure the database and finally start the OpenFGA server. Now you can try to Create a Store.","s":"Configuring Data Storage","u":"/docs/getting-started/setup-openfga/docker","h":"#configuring-data-storage","p":138},{"i":147,"t":"You can configure authentication in your OpenFGA server in three ways: no authentication (the default), pre-shared key authentication or via OIDC. Pre-shared Key Authentication​ If using Pre-shared key authentication, you will configure OpenFGA with a secret key and your application calling OpenFGA will have to set an Authorization: Bearer header. You can configure multiple keys. Warning If you are going to use this setup in production, you should enable HTTP TLS in your OpenFGA server. You will need to configure the TLS certificate and key. Configuration File Environment Variables Docker Update the config.yaml file to authn: method: preshared preshared: keys: [\"key1\", \"key2\"] http: tls: enabled: true cert: /Users/myuser/key/server.crt key: /Users/myuser/key/server.key Configure the authentication method to preshared: export OPENFGA_AUTHN_METHOD=preshared. Configure the authentication keys: export OPENFGA_AUTHN_PRESHARED_KEYS=\"key1,key2\" Enable the HTTP TLS configuration: export OPENFGA_HTTP_TLS_ENABLED=true Configure the HTTP TLS certificate location: export OPENFGA_HTTP_TLS_CERT=/Users/myuser/key/server.crt Configure the HTTP TLS key location: export OPENFGA_HTTP_TLS_KEY=/Users/myuser/key/server.key To configure with pre-shared authentication and enabling TLS in http server with Docker. Copy the certificate and key files to your Docker container. Run with the following command: docker run --name openfga --network=openfga -p 3000:3000 -p 8080:8080 -p 8081:8081 openfga/openfga run \\ --authn-method=preshared \\ --authn-preshared-keys=\"key1,key2\" \\ --http-tls-enabled=true \\ --http-tls-cert=\"/Users/myuser/key/server.crt\" \\ --http-tls-key=\"/Users/myuser/key/server.key\" OIDC​ To configure with OIDC authentication, you will first need to obtain the OIDC issuer and audience from your provider. Warning If you are going to use this setup in production, you should enable HTTP TLS in your OpenFGA server. You will need to configure the TLS certificate and key. Configuration File Environment Variables Docker Update the config.yaml file to authn: method: oidc oidc: issuer: \"oidc-issuer\" audience: \"oidc-audience\" http: tls: enabled: true cert: /Users/myuser/key/server.crt key: /Users/myuser/key/server.key Configure the authentication method to preshared: export OPENFGA_AUTHN_METHOD=oidc. Configure the authentication keys: export OPENFGA_AUTHN_OIDC_ISSUER=oidc-issuer Configure the authentication keys: export OPENFGA_AUTHN_OIDC_audience=oidc-audience Enable the HTTP TLS configuration: export OPENFGA_HTTP_TLS_ENABLED=true Configure the HTTP TLS certificate location: export OPENFGA_HTTP_TLS_CERT=/Users/myuser/key/server.crt Configure the HTTP TLS key location: export OPENFGA_HTTP_TLS_KEY=/Users/myuser/key/server.key To configure with pre-shared authentication and enabling TLS in http server with Docker. Copy the certificate and key files to your docker container. Run the following command docker run --name openfga --network=openfga -p 3000:3000 -p 8080:8080 -p 8081:8081 openfga/openfga run \\ --authn-method=oidc \\ --authn-oidc-issuer=\"oidc-issuer\" \\ --authn-oidc-audience=\"oidc-audience\" \\ --http-tls-enabled=true \\ --http-tls-cert=\"/Users/myuser/key/server.crt\" \\ --http-tls-key=\"/Users/myuser/key/server.key\"","s":"Configuring Authentication","u":"/docs/getting-started/setup-openfga/docker","h":"#configuring-authentication","p":138},{"i":149,"t":"The Playground facilitates rapid development by allowing you to visualize and model your application's authorization model(s) and manage relationship tuples with a locally running OpenFGA instance. The Playground is enabled on port 3000 by default and accessible at http://localhost:3000/playground (if using Docker, make sure port 3000 is exposed to your local network). To disable the Playground, see Configuring the Server.","s":"Playground","u":"/docs/getting-started/setup-openfga/docker","h":"#playground","p":138},{"i":151,"t":"Warning Continuous profiling can be used in production deployments, but we recommend disabling it unless it is needed to troubleshoot specific performance or memory problems. Profiling through pprof can be enabled on the OpenFGA server by providing the --profiler-enabled flag. For example, in Docker: docker run -p 8080:8080 -p 8081:8081 -p 3000:3000 -p 3001:3001 openfga/openfga run --profiler-enabled If you need to serve the profiler on a different port than the default 3001, you can do so by specifying the --profiler-addr flag. For example: docker run -p 8080:8080 -p 8081:8081 -p 3000:3000 -p 3002:3002 openfga/openfga run --profiler-enabled --profiler-addr :3002","s":"Profiler (pprof)","u":"/docs/getting-started/setup-openfga/docker","h":"#profiler-pprof","p":138},{"i":153,"t":"OpenFGA is configured with an HTTP health check endpoint /healthz and a gRPC health check grpc.health.v1.Health/Check, which is wired to datastore testing. Possible response values are UNKNOWN SERVING NOT_SERVING SERVICE_UNKNOWN cURL gRPC curl -X GET $FGA_API_HOST/healthz # {\"status\":\"SERVING\"} # See https://github.com/fullstorydev/grpcurl#installation grpcurl -plaintext $FGA_API_HOST grpc.health.v1.Health/Check # {\"status\":\"SERVING\"}","s":"Health Check","u":"/docs/getting-started/setup-openfga/docker","h":"#health-check","p":138},{"i":155,"t":"Various releases of OpenFGA may have experimental features that can be enabled by providing the --experimentals flag or the experimentals config. docker run -p 8080:8080 -p 8081:8081 openfga/openfga run --experimentals=\"feature1, feature2\" or if you're using environment variables, docker run -p 8080:8080 -p 8081:8081 openfga/openfga -e OPENFGA_EXPERIMENTALS=\"feature1, feature2\" run The following table enumerates the experimental flags, a description of what they do, and the versions of OpenFGA the flag is supported in: Name Description OpenFGA Version Status otel-metrics Enables support for exposing OpenFGA metrics through OpenTelemetry 0.3.2 <= v < v0.3.5 became default in v0.3.5 list-objects Enables ListObjects API 0.2.0 <= v < v0.3.3 became default in v0.3.3 check-query-cache Enables caching of check subproblem result 1.3.1 <= v currently experimental Warning Experimental features are not guaranteed to be stable and may lead to server instabilities. It is not recommended to enable experimental features for anything other than experimentation. Experimental feature flags are also not considered part of API compatibility and are subject to change, so please refer to each OpenFGA specific release for a list of the experimental feature flags that can be enabled for that release.","s":"Experimental Features","u":"/docs/getting-started/setup-openfga/docker","h":"#experimental-features","p":138},{"i":157,"t":"OpenFGA telemetry data is collected by default starting on version v0.3.5. The telemetry information that is captured includes Metrics, Traces, and Logs. note Please refer to the docker-compose.yaml file as an example of how to collect Metrics and Tracing in OpenFGA in a Docker environment using the OpenTelemetry Collector. This should serve as a good example that you can adjust for your specific deployment scenario.","s":"Telemetry","u":"/docs/getting-started/setup-openfga/docker","h":"#telemetry","p":138},{"i":159,"t":"OpenFGA metrics are collected with the Prometheus data format and exposed on address 0.0.0.0:2112/metrics. Metrics are exposed by default, but you can disable this with --metrics-enabled=false (or OPENFGA_METRICS_ENABLED=false environment variable). To set an alternative address, you can provide the --metrics-addr flag (OPENFGA_METRICS_ADDR environment variable). For example: openfga run --metrics-addr=0.0.0.0:2114 To see the request latency per endpoint of your OpenFGA deployment, you can provide the --metrics-enable-rpc-histograms flag (OPENFGA_METRICS_ENABLE_RPC_HISTOGRAMS environment variable).","s":"Metrics","u":"/docs/getting-started/setup-openfga/docker","h":"#metrics","p":138},{"i":161,"t":"OpenFGA traces can be collected with the OTLP data format. Tracing is disabled by default, but you can enable this with the --trace-enabled=true (OPENFGA_TRACE_ENABLED=true environment variable). Traces will be exported by default to address 0.0.0.0:4317. You can change this address with the --trace-otlp-endpoint flag (OPENFGA_TRACE_OTLP_ENDPOINT environment variable). To increase or decrease the trace sampling ratio, you can provide the --trace-sample-ratio flag (OPENFGA_TRACE_SAMPLE_RATIO env variable). Tracing by default uses a insecure connection. You can enable TLS by using --trace-otlp-tls-enabled=true flag or the environment variable OPENFGA_TRACE_OTLP_TLS_ENABLED. Warning It is not recommended to sample all traces (e.g. --trace-sample-ratio=1). You will need to adjust your sampling ratio based on the amount of traffic your deployment receives. Higher traffic will require less sampling and lower traffic can tolerate higher sampling ratios.","s":"Tracing","u":"/docs/getting-started/setup-openfga/docker","h":"#tracing","p":138},{"i":163,"t":"OpenFGA generates structured logs by default, and it can be configured with the following flags: --log-format: sets the log format. Today we support text and json format. --log-level: sets the minimum log level (defaults to info). It can be set to none to turn off logging.","s":"Logging","u":"/docs/getting-started/setup-openfga/docker","h":"#logging","p":138},{"i":165,"t":"Check the following sections for more on how to use OpenFGA. Production Best Practices Learn the best practices of running OpenFGA in a production environment More","s":"Related Sections","u":"/docs/getting-started/setup-openfga/docker","h":"#related-sections","p":138},{"i":167,"t":"Follow the guides below to setup an OpenFGA server. Docker Setup Guide How to setup an OpenFGA server with Docker. Click to navigate Kubernetes Setup Guide How to setup an OpenFGA server with Kubernetes. Click to navigate","s":"Setup OpenFGA","u":"/docs/getting-started/setup-openfga/overview","h":"","p":166},{"i":169,"t":"The OpenFGA service answers authorization checks by determining whether a relationship exists between an object and a user. Checks takes into consideration the authorization model of the system and the relationship tuples present in the system at that time in order to make a decision. In this guide you will learn about the most relevant FGA concepts, such as a type or an authorization model, and you will be able to explore them using the FGA playground. What Is A Type?​ A type is a string. It should define a class of objects with similar characteristics. Examples of types: workspace repository organization document What Is A Type Definition?​ A type definition is a configuration that defines all possible relations a user or another object can have in relation to this type. Code snippet below is an example of a type definition: DSL JSON type document relations define viewer: [user] define commenter: [user] define editor: [user] define owner: [user] { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} }, \"commenter\": { \"this\": {} }, \"editor\": { \"this\": {} }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } What Is An Authorization Model?​ An authorization model is a combination of one or more type definitions. This is used to define the permission model of a system. Code snippet below is an example of an authorization model: DSL JSON model schema 1.1 type document relations define viewer: [domain#member, user] define commenter: [domain#member, user] define editor: [domain#member, user] define owner: [domain#member, user] type domain relations define member: [user] type user { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} }, \"commenter\": { \"this\": {} }, \"editor\": { \"this\": {} }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"domain\", \"relation\": \"member\" }, { \"type\": \"user\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"domain\", \"relation\": \"member\" }, { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"domain\", \"relation\": \"member\" }, { \"type\": \"user\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"domain\", \"relation\": \"member\" }, { \"type\": \"user\" } ] } } } }, { \"type\": \"domain\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"user\" } ] } Authorization model, together with relationship tuples, allow determination of whether a relationship exists between a user and an object. The OpenFGA service has two different syntaxes to define the authorization model: A JSON syntax accepted by the OpenFGA API that follows closely the original syntax discussed in the Zanzibar Paper. See Equivalent Zanzibar Concepts. A DSL that we believe is easier to use and is used in the Okta FGA Playground to help with modeling. This is translated to the API-supported syntax before being sent to the API. Learn more about the OpenFGA Configuration Language. What Is A Store?​ A \"store\" is a OpenFGA entity used for organizing data needed to answer authorization checks. Each store contains one or more versions of an authorization model and may contain various relationship tuples. Store data such as the authorization model and relationship tuples cannot be shared across stores, so it is highly recommended to store all data that may be related and may affect your authorization result in a single store. For completely separate authorization needs or isolated environments where data from one should not affect another (e.g. development/prod), you may want to create separate stores. What Is An Object?​ An object represents an entity in the system. We can define how various users have a relationship to it through relationship tuples and the authorization model. An object is a combination of a type and an identifier. For example: workspace:fb83c013-3060-41f4-9590-d3233a67938f repository:auth0/express-jwt organization:org_ajUc9kJ document:new-roadmap User, relation and object are the building blocks for relationship tuples. For more information, please see Direct Access. What Is A User?​ A user is an entity in the system that can be related to an object. A user is is a combination of a type, an identifier and an optional relation. For example, any identifier: e.g. user:anne or user:4179af14-f0c0-4930-88fd-5570c7bf6f59 any object: e.g. workspace:fb83c013-3060-41f4-9590-d3233a67938f, repository:auth0/express-jwt or organization:org_ajUc9kJ a group or a set of users (also called a userset): e.g. organization:org_ajUc9kJ#members, which represents the set of users related to the object organization:org_ajUc9kJ as member everyone, using the special syntax: * User, relation and object are the building blocks for relationship tuples. For more information, please see Direct Access. What Is A Relation?​ A relation is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system. Examples of relation: User can be a reader of a document Team can administer a repo User can be a member of a team What Is A Relation Definition?​ A relation definition lists the conditions or requirements under which this relationship would be possible. For example: editor describing a possible relationship between a user and an object in the document type allows the following: user identifier to object relationship: the user id anne of type user is related to the object document:roadmap as editor object to object relationship: the object application:ifft is related to the object document:roadmap as editor userset to object relationship: the userset organization:auth0.com#member is related to document:roadmap as editor indicating that the set of users who are related to the object organization:auth0.com as member are related to the object document:roadmap as editors this allows for potential solutions to use-cases like sharing a document internally with all members of a company or a team everyone to object relationship: everyone (*) is related to document:roadmap as editor this is how one could model publicly editable documents These would be defined in the authorization model as such: DSL JSON type document relations define viewer: [user] define commenter: [user] define editor: [user] define owner: [user] type user { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} }, \"commenter\": { \"this\": {} }, \"editor\": { \"this\": {} }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"user\" } ] } info In the configuration of the document type, we have four relations: viewer, commenter, editor and owner. User, relation and object are the building blocks for relationship tuples. For more information, please see Direct Access. What Is A Directly Related User Type?​ A directly related user type is an array specified in the type definition to indicate what types of users can be directly related to that relation. For the following model, only relationship tuple with user type user may be assigned to document. DSL JSON type document relations define viewer: [user] { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Relationship tuple with user user:anne or user:3f7768e0-4fa7-4e93-8417-4da68ce1846c may be written for objects with type document and relation viewer, so writing {\"user\": \"user:anne\",\"relation\":\"viewer\",\"object\":\"document:roadmap\"} will succeed. Relationship tuple writes with user type that is not allowed for the viewer relation on objects of type document, for example workspace:auth0 or folder:planning#editor will be rejected, so writing {\"user\": \"folder:product\",\"relation\":\"viewer\",\"object\":\"document:roadmap\"} will fail. This will affect only relations that are directly related and have the direct relationship type restrictions in their relation definition. What Is A Relationship Tuple?​ A relationship tuple is a tuple consisting of a user, relation and object stored in OpenFGA. A relationship tuple consists of a: user, e.g. user:anne, user:3f7768e0-4fa7-4e93-8417-4da68ce1846c, workspace:auth0 or folder:planning#editor relation, e.g. editor, member or parent_workspace object, e.g repo:auth0/express_jwt, domain:auth0.com or channel:marketing An authorization model, together with relationship tuples, allow the determination of whether a relationship exists between a user and an object. Throughout the documentation, you will encounter relationship tuples represented as: [ { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] For more information, please see Direct Access. What Is A Relationship?​ A relationship is the realization of a relation between a user and an object. An authorization model, together with relationship tuples, allow the determination of whether a relationship exists between a user and an object. Relationships may be classified as direct or implied. What Are Direct And Implied Relationships?​ A direct relationship R between user X and object Y means the relationship tuple (user=X, relation=R, object=Y) exists, and the OpenFGA authorization model for that relation allows this direct relationship (by use of direct relationship type restrictions). An implied (or computed) relationship R exists between user X and object Y if user X is related to an object Z that is in a direct or implied relationship with object Y, and the OpenFGA authorization model allows it. user:anne has a direct relationship with document:new-roadmap as viewer if the type definition allows it (allows direct relationship type restrictions), and one of the following relationship tuples exist: [ // Anne of type user is directly related to the document { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, ] [ // Everyone (`*`) of type user is directly related to the document { \"user\": \"*\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, ] [ // The userset is directly related to this document { \"user\": \"team:product#member\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, // AND Anne of type user is a member of a userset (e.g. team:product#member) { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"team:product#member\", }, ] user:anne has an implied relationship with document:new-roadmap as viewer if the type definition allows it, and the presence of relationship tuples satisfying the relationship exist. For example, assuming the following type definition: DSL JSON type document relations define viewer: [user] or editor define editor: [user] { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } And assuming the following relationship tuple exists in the system: [ { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] In this case, the relationship between user:anne and document:new-roadmap as a viewer is implied from the direct editor relationship user:anne has with that same document. Thus, the following request to check whether a viewer relationship exists between user:anne and document:new-roadmap will return true. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'viewer', object: 'document:new-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"viewer\", Object: \"document:new-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"viewer\", Object = \"document:new-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"viewer\", object=\"document:new-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne viewer document:new-roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"viewer\",\"object\":\"document:new-roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"viewer\", // has an `viewer` relation object = \"document:new-roadmap\", // with the object `document:new-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true What Is A Check Request?​ A check request is a call to the OpenFGA check endpoint that returns whether the user has a certain relationship with an object. This can be done using the check methods in the OpenFGA SDKs (JavaScript SDK/Go SDK/.NET SDK), by manually calling the check endpoint using curl, or in your code. The check endpoint responds with { \"allowed\": true } if a relationship exists, and with { \"allowed\": false } if the relationship does not. For example, the following will check whether anne of type user has a viewer relation to document:new-roadmap: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'viewer', object: 'document:new-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"viewer\", Object: \"document:new-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"viewer\", Object = \"document:new-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"viewer\", object=\"document:new-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne viewer document:new-roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"viewer\",\"object\":\"document:new-roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"viewer\", // has an `viewer` relation object = \"document:new-roadmap\", // with the object `document:new-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true For more information, please see the Relationship Queries page and the official Check API Reference. What Is A List Objects Request?​ A list objects request is a call to the OpenFGA list objects endpoint that returns all the objects of a given type that a user has a specified relationship with. This can be done using the listobjects methods in the OpenFGA SDKs (JavaScript SDK/Go SDK/.NET SDK), by manually calling the list objects endpoint using curl, or in your code. The list objects endpoint responds with a list of objects for a given type that the user has the specified relationship with. For example, the following will return all the objects with document type for which anne of type user has a viewer relation with: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); const response = await fgaClient.listObjects({ user: \"user:anne\", relation: \"viewer\", type: \"document\", }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }); // response.objects = [\"document:otherdoc\", \"document:planning\"] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientListObjectsOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientListObjectsRequest{ User: \"user:anne\", Relation: \"viewer\", Type: \"document\", } data, err := fgaClient.ListObjects(context.Background()). Body(requestBody). Options(options). Execute() // data = { \"objects\": [\"document:otherdoc\", \"document:planning\"] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientListObjectsRequest { User = \"user:anne\", Relation = \"viewer\", Type = \"document\", }; var response = await fgaClient.ListObjects(body, options); // response.Objects = [\"document:otherdoc\", \"document:planning\"] Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientListObjectsRequest( user=\"user:anne\", relation=\"viewer\", type=\"document\", ) response = await fga_client.list_objects(body, options) # response.objects = [\"document:otherdoc\", \"document:planning\"] Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query list-objects --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne viewer document # Response: {\"objects\": [\"document:otherdoc\", \"document:planning\"]} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/list-objects \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{ \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"type\": \"document\", \"relation\": \"viewer\", \"user\":\"user:anne\" }' # Response: {\"objects\": [\"document:otherdoc\", \"document:planning\"]} listObjects( \"user:anne\", // list the objects that the user `user:anne` \"viewer\", // has an `viewer` relation \"document\", // and that are of type `document` authorization_model_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", // for this particular authorization model id ); Reply: [\"document:otherdoc\", \"document:planning\"] For more information, please see the Relationship Queries page and the official Check API Reference. What Are Contextual Tuples?​ Contextual tuples are tuples that can be added to a check request, and only exist within the context of that particular request. Similar to relationship tuples, contextual tuples are composed of a user, relation and object. Unlike relationship tuples, they are not written to the store. However, if contextual tuples are sent alongside a check request, in the context of this particular check request, they are treated if they had been written in the store. For more information, please see Contextual and Time-Based Authorization, Authorization Through Organization Context and Check API Request Documentation. What Is Type Bound Public Access?​ In OpenFGA, type bound public access (represented by :*) is a special OpenFGA syntax meaning every object of that type when used as a user within a relationship tuple. For example, user:* represents every object of type user (including those not currently present in the system). For example, in a case where you would like to indicate a certain document document:new-roadmap is publicly writable (i.e. has everyone of type user as an editor), you can add the following relationship tuple: [ { \"user\": \"user:*\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] Note that you cannot use :* in the relation or object properties. In addition, you cannot use :* as part of a userset in the tuple's user field. For more information, please see Modeling Public Access and Advanced Modeling: Modeling Google Drive.","s":"Concepts","u":"/docs/concepts","h":"","p":168},{"i":171,"t":"A type is a string. It should define a class of objects with similar characteristics.","s":"What Is A Type?","u":"/docs/concepts","h":"#what-is-a-type","p":168},{"i":173,"t":"A type definition is a configuration that defines all possible relations a user or another object can have in relation to this type.","s":"What Is A Type Definition?","u":"/docs/concepts","h":"#what-is-a-type-definition","p":168},{"i":175,"t":"An authorization model is a combination of one or more type definitions. This is used to define the permission model of a system.","s":"What Is An Authorization Model?","u":"/docs/concepts","h":"#what-is-an-authorization-model","p":168},{"i":177,"t":"A \"store\" is a OpenFGA entity used for organizing data needed to answer authorization checks.","s":"What Is A Store?","u":"/docs/concepts","h":"#what-is-a-store","p":168},{"i":179,"t":"An object represents an entity in the system. We can define how various users have a relationship to it through relationship tuples and the authorization model.","s":"What Is An Object?","u":"/docs/concepts","h":"#what-is-an-object","p":168},{"i":181,"t":"A user is an entity in the system that can be related to an object.","s":"What Is A User?","u":"/docs/concepts","h":"#what-is-a-user","p":168},{"i":183,"t":"A relation is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system.","s":"What Is A Relation?","u":"/docs/concepts","h":"#what-is-a-relation","p":168},{"i":185,"t":"A relation definition lists the conditions or requirements under which this relationship would be possible.","s":"What Is A Relation Definition?","u":"/docs/concepts","h":"#what-is-a-relation-definition","p":168},{"i":187,"t":"A directly related user type is an array specified in the type definition to indicate what types of users can be directly related to that relation.","s":"What Is A Directly Related User Type?","u":"/docs/concepts","h":"#what-is-a-directly-related-user-type","p":168},{"i":189,"t":"A relationship tuple is a tuple consisting of a user, relation and object stored in OpenFGA.","s":"What Is A Relationship Tuple?","u":"/docs/concepts","h":"#what-is-a-relationship-tuple","p":168},{"i":191,"t":"A relationship is the realization of a relation between a user and an object.","s":"What Is A Relationship?","u":"/docs/concepts","h":"#what-is-a-relationship","p":168},{"i":193,"t":"A direct relationship R between user X and object Y means the relationship tuple (user=X, relation=R, object=Y) exists, and the OpenFGA authorization model for that relation allows this direct relationship (by use of direct relationship type restrictions). An implied (or computed) relationship R exists between user X and object Y if user X is related to an object Z that is in a direct or implied relationship with object Y, and the OpenFGA authorization model allows it.","s":"What Are Direct And Implied Relationships?","u":"/docs/concepts","h":"#what-are-direct-and-implied-relationships","p":168},{"i":195,"t":"A check request is a call to the OpenFGA check endpoint that returns whether the user has a certain relationship with an object.","s":"What Is A Check Request?","u":"/docs/concepts","h":"#what-is-a-check-request","p":168},{"i":197,"t":"A list objects request is a call to the OpenFGA list objects endpoint that returns all the objects of a given type that a user has a specified relationship with.","s":"What Is A List Objects Request?","u":"/docs/concepts","h":"#what-is-a-list-objects-request","p":168},{"i":199,"t":"Contextual tuples are tuples that can be added to a check request, and only exist within the context of that particular request.","s":"What Are Contextual Tuples?","u":"/docs/concepts","h":"#what-are-contextual-tuples","p":168},{"i":201,"t":"In OpenFGA, type bound public access (represented by :*) is a special OpenFGA syntax meaning every object of that type when used as a user within a relationship tuple. For example, user:* represents every object of type user (including those not currently present in the system).","s":"What Is Type Bound Public Access?","u":"/docs/concepts","h":"#what-is-type-bound-public-access","p":168},{"i":203,"t":"Check the following sections for more on how object-to-object relationships can be used. OpenFGA Concepts Learn about the OpenFGA Concepts More Direct access Get started with modeling your permission system in OpenFGA More","s":"Related Sections","u":"/docs/concepts","h":"#related-sections","p":168},{"i":205,"t":"The following list outlines some guidelines and best practices for using OpenFGA: Do not store Personal Identifiable Information in tuples Always specify authorization model ID whenever possible","s":"Best Practices of Managing Tuples and Invoking APIs","u":"/docs/getting-started/tuples-api-best-practices","h":"","p":204},{"i":207,"t":"You can use any string for user and object identifiers, however you should not input or assign identifiers that include Personal Data or any other sensitive data, such as data that may be restricted under regulatory requirements. Note The documentation and samples uses first names and simple ids to illustrate easy-to-follow examples.","s":"Do Not Store Personal Identifiable Information in Tuples","u":"/docs/getting-started/tuples-api-best-practices","h":"#do-not-store-personal-identifiable-information-in-tuples","p":204},{"i":209,"t":"It is strongly recommended that authorization model ID be specified in your Relationship Queries (such as Check and ListObjects) and Relationship Commands (such as Write). Specifying authorization model ID in API calls have the following advantages: Better performance as OpenFGA will not need to perform a database query to get the latest authorization model ID. Allows consistent behavior in your production system until until you are ready to switch to the new model.","s":"Always Specify Authorization Model ID Whenever Possible","u":"/docs/getting-started/tuples-api-best-practices","h":"#always-specify-authorization-model-id-whenever-possible","p":204},{"i":211,"t":"Check the following sections for more on recommendation for managing relations and model in production environment. Migrating Relations Learn how to migrate relations in a production environment More Migrating Schema 1.1 Learn how to migrate to model schema 1.1 More","s":"Related Sections","u":"/docs/getting-started/tuples-api-best-practices","h":"#related-sections","p":204},{"i":213,"t":"This article explains how to build an OpenFGA client by using the SDKs. The first step is to ensure that you have created a store by following these steps. Next, depending on the authentication scheme you want to use, there are different ways to build the client.","s":"Setup SDK Client for Store","u":"/docs/getting-started/setup-sdk-client","h":"","p":212},{"i":215,"t":"This is a simple setup but it is not recommended for production use. Node.js Go .NET Python CLI const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk'; const openFga = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // optional. Can be \"http\" or \"https\". Defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods authorizationModelId: process.env.FGA_MODEL_ID, // optional, can be overridden per request }); import ( \"os\" openfga \"github.com/openfga/go-sdk\" . \"github.com/openfga/go-sdk/client\" ) func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // optional, can be overridden per request }) if err != nil { // .. Handle error } } using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace ExampleApp; class MyProgram { static async Task Main() { var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } import os import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.Configuration( api_scheme = os.environ.get('FGA_API_SCHEME'), # optional. Can be \"http\" or \"https\". Defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID'), # optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods model_id = os.environ.get('FGA_MODEL_ID'), # optional, can be overridden per request ) async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() // call requests await fga_client.close() // close when done export FGA_SERVER_URL=https://api.fga.example # optional. Defaults to http://localhost:8080 export FGA_STORE_ID=YOUR_STORE_ID # required for all calls except \\`store create\\`, \\`store list\\` and \\`model validate\\` export FGA_MODEL_ID=YOUR_MODEL_ID # optional, can be overridden per request, latest is used if this is empty","s":"Using No Authentication","u":"/docs/getting-started/setup-sdk-client","h":"#using-no-authentication","p":212},{"i":217,"t":"If you want to use shared key authentication, you need to generate a random string that will work as secret and set that key when building your OpenFGA server. Then, when building the client, set it as environment variable FGA_API_TOKEN. Warning If you are going to use this setup in production, you should enable TLS in your OpenFGA server. Please see the Production Checklist. Node.js Go .NET Python CLI const { CredentialsMethod, OpenFgaClient } = require('@openfga/sdk'); // OR import { CredentialsMethod, OpenFgaClient } from '@openfga/sdk'; const openFga = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // optional. Can be \"http\" or \"https\". Defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods authorizationModelId: process.env.FGA_MODEL_ID, // optional, can be overridden per request credentials: { method: CredentialsMethod.ApiToken, config: { token: process.env.$FGA_API_TOKEN, }, } }); import ( \"os\" openfga \"github.com/openfga/go-sdk\" . \"github.com/openfga/go-sdk/client\" \"github.com/openfga/go-sdk/credentials\" ) func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // optional, can be overridden per request Credentials: &credentials.Credentials{ Method: credentials.CredentialsMethodApiToken, Config: &credentials.Config{ ApiToken: os.Getenv(\"OPENFGA_API_TOKEN\"), // will be passed as the \"Authorization: Bearer ${ApiToken}\" request header }, }, }) if err != nil { // .. Handle error } } using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace ExampleApp; class MyProgram { static async Task Main() { var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // optional, can be overridden per request Credentials = new Credentials() { Method = CredentialsMethod.ApiToken, Config = new CredentialsConfig() { ApiToken = Environment.GetEnvironmentVariable(\"FGA_API_TOKEN\") }, }, }; var fgaClient = new OpenFgaClient(configuration); } } import os import openfga_sdk from openfga_sdk.client import OpenFgaClient from openfga_sdk.credentials import Credentials, CredentialConfiguration credentials = Credentials(method='api_token', configuration=CredentialConfiguration(api_token=os.environ.get(FGA_API_TOKEN))) configuration = openfga_sdk.Configuration( api_scheme = os.environ.get('FGA_API_SCHEME'), # optional. Can be \"http\" or \"https\". Defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID'), # optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods model_id = os.environ.get('FGA_MODEL_ID'), # optional, can be overridden per request credentials = credentials, ) async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() // call requests await fga_client.close() // close when done export FGA_SERVER_URL=https://api.fga.example # optional. Defaults to http://localhost:8080 export FGA_STORE_ID=YOUR_STORE_ID # required for all calls except \\`store create\\`, \\`store list\\` and \\`model validate\\` export FGA_MODEL_ID=YOUR_MODEL_ID # optional, can be overridden per request, latest is used if this is empty export FGA_API_TOKEN=YOUR_API_TOKEN","s":"Using Shared Key Authentication","u":"/docs/getting-started/setup-sdk-client","h":"#using-shared-key-authentication","p":212},{"i":219,"t":"Note The OpenFGA server does not support the client credentials flow, however if you or your OpenFGA provider have implemented a client credentials wrapper on top, follow the instructions here to have the OpenFGA client handle the token exchange for you. Node.js Go .NET Python CLI const { CredentialsMethod, OpenFgaClient } = require('@openfga/sdk'); // OR import { CredentialsMethod, OpenFgaClient } from '@openfga/sdk'; const openFga = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // optional. Can be \"http\" or \"https\". Defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods authorizationModelId: process.env.FGA_MODEL_ID, // optional, can be overridden per request credentials: { method: CredentialsMethod.ClientCredentials, config: { apiTokenIssuer: process.env.FGA_API_TOKEN_ISSUER, apiAudience: process.env.FGA_API_AUDIENCE, clientId: process.env.FGA_CLIENT_ID, clientSecret: process.env.FGA_CLIENT_SECRET, }, } }); import ( \"os\" openfga \"github.com/openfga/go-sdk\" . \"github.com/openfga/go-sdk/client\" \"github.com/openfga/go-sdk/credentials\" ) func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // optional, can be overridden per request Credentials: &credentials.Credentials{ Method: credentials.CredentialsMethodClientCredentials, Config: &credentials.Config{ ClientCredentialsClientId: os.Getenv(\"FGA_CLIENT_ID\"), ClientCredentialsClientSecret: os.Getenv(\"FGA_CLIENT_SECRET\"), ClientCredentialsApiAudience: os.Getenv(\"FGA_API_AUDIENCE\"), ClientCredentialsApiTokenIssuer: os.Getenv(\"FGA_API_TOKEN_ISSUER\"), }, }, }) if err != nil { // .. Handle error } } using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace ExampleApp; class MyProgram { static async Task Main() { var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // optional, can be overridden per request Credentials = new Credentials() { Method = CredentialsMethod.ClientCredentials, Config = new CredentialsConfig() { ApiTokenIssuer = Environment.GetEnvironmentVariable(\"FGA_API_TOKEN_ISSUER\"), ApiAudience = Environment.GetEnvironmentVariable(\"FGA_API_AUDIENCE\"), ClientId = Environment.GetEnvironmentVariable(\"FGA_CLIENT_ID\"), ClientSecret = Environment.GetEnvironmentVariable(\"FGA_CLIENT_SECRET\"), } } }; var fgaClient = new OpenFgaClient(configuration); } } import os import openfga_sdk from openfga_sdk.client import OpenFgaClient from openfga_sdk.credentials import Credentials, CredentialConfiguration credentials = Credentials( method='client_credentials', configuration=CredentialConfiguration( api_issuer= os.environ.get('FGA_API_TOKEN_ISSUER'), api_audience= os.environ.get('FGA_API_AUDIENCE'), client_id= os.environ.get('FGA_CLIENT_ID'), client_secret= os.environ.get('FGA_CLIENT_SECRET'), ) ) configuration = openfga_sdk.Configuration( api_scheme = os.environ.get('FGA_API_SCHEME'), # optional. Can be \"http\" or \"https\". Defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID'), # optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods model_id = os.environ.get('FGA_MODEL_ID'), # optional, can be overridden per request credentials = credentials, ) async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() // call requests await fga_client.close() // close when done export FGA_SERVER_URL=https://api.fga.example # optional. Defaults to http://localhost:8080 export FGA_STORE_ID=YOUR_STORE_ID # required for all calls except \\`store create\\`, \\`store list\\` and \\`model validate\\` export FGA_MODEL_ID=YOUR_MODEL_ID # optional, can be overridden per request, latest is used if this is empty export FGA_API_TOKEN_ISSUER=YOUR_API_TOKEN_ISSUER export FGA_API_AUDIENCE=YOUR_API_AUDIENCE export FGA_CLIENT_ID=YOUR_CLIENT_ID export FGA_CLIENT_SECRET=YOUR_CLIENT_SECRET","s":"Using Client Credentials Flow","u":"/docs/getting-started/setup-sdk-client","h":"#using-client-credentials-flow","p":212},{"i":221,"t":"This section helps you integrate OpenFGA with your system. To do this, you will learn how to programmatically write authorization related data to OpenFGA. When to use This section is useful if you have defined an authorization model and want to understand how to write authorization data to OpenFGA to represent the state of your system.","s":"Interacting with the API","u":"/docs/interacting","h":"","p":220},{"i":223,"t":"Manage User Access Write relationship tuples to manage a user's access to an object. Click to navigate Manage Group Access Write relationship tuples to manage access to an object for all members of a group. Click to navigate Manage Group Membership Write relationship tuples to manage the users that are members of a group. Click to navigate Manage Relationships Between Object Write relationship tuples to manage how two objects are related. E.g. parent folder and child document. Click to navigate Transactional Writes Write multiple relationship tuples in a single request, so all writes either succeed or fail. Click to navigate Relationship Queries An overview of how to use the Check, Read, Expand, and ListObject APIs. Click to navigate Search with Permissions Implementing search with OpenFGA. Click to navigate","s":"Content","u":"/docs/interacting","h":"","p":220},{"i":225,"t":"In this guide you will learn how to grant a group of users access to a particular object. When to use Adding a relationship tuple specifying that a group has a relation to an object is helpful in cases where you want to encompass a set of users with the same relation to an object. For example: Grant a group of engineers viewer access to roadmap.doc Create a block_list of members who can't access a document Sharing a document with a team Granting viewer access to a photo to followers only Making a file viewable for all users within an organization Restricting access from or to users in a certain locale","s":"Managing Group Access","u":"/docs/interacting/managing-group-access","h":"","p":224},{"i":227,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have two types: company that can have a employee relation document that can have a reader relation. DSL JSON model schema 1.1 type user type company relations define employee: [user] type document relations define reader: [company#employee] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"company\", \"relations\": { \"employee\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"employee\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"reader\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"company\", \"relation\": \"employee\" } ] } } } } ] } In addition, you will need to know the following: Modeling User Groups​ You need to know how to add users to groups and grant groups access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/interacting/managing-group-access","h":"#before-you-start","p":224},{"i":229,"t":"You need to know how to add users to groups and grant groups access to an object. Learn more →","s":"Modeling User Groups","u":"/docs/interacting/managing-group-access","h":"#modeling-user-groups","p":224},{"i":231,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/interacting/managing-group-access","h":"#-concepts","p":224},{"i":234,"t":"If we want to have every employee of a type company have a reader relationship with a particular object of type document (in this case document:planning), we need to add a tuple like so: [ // Every employee in the company can read document:planning { \"user\": \"company:xyz#employee\", \"relation\": \"reader\", \"object\": \"document:planning\", }, ]","s":"01. Adding Company To The Document","u":"/docs/interacting/managing-group-access","h":"#01-adding-company-to-the-document","p":224},{"i":236,"t":"If we also write a tuple that says that Anne is a employee of company:xyz, like so: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'employee', object: 'company:xyz'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"employee\"), Object: openfga.PtrString(\"company:xyz\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"employee\", Object = \"company:xyz\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"employee\", object=\"company:xyz\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"employee\",\"object\":\"company:xyz\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne employee company:xyz write([ { \"user\":\"user:anne\", \"relation\":\"employee\", \"object\":\"company:xyz\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"02. Adding Employee To The Company","u":"/docs/interacting/managing-group-access","h":"#02-adding-employee-to-the-company","p":224},{"i":238,"t":"Then a call to the Check API to see whether Anne can read document:planning will return true: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true The same check for a different user Becky, however, will return false, because Becky does not have an employee relationship with company:xyz: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky reader document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:becky\", // check if the user `user:becky` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"03. Checking An Individual Member's Access To An Object","u":"/docs/interacting/managing-group-access","h":"#03-checking-an-individual-members-access-to-an-object","p":224},{"i":240,"t":"Check the following sections for more on how to model group. Modeling User Groups Learn about how to model users and groups. More Managing Group Membership Learn about managing group membership. More","s":"Related Sections","u":"/docs/interacting/managing-group-access","h":"#related-sections","p":224},{"i":242,"t":"This section will illustrate how to update relationship tuples.","s":"Update Relationship Tuples","u":"/docs/getting-started/update-tuples","h":"","p":241},{"i":244,"t":"Node.js Go .NET Python CLI curl Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_SERVER_URL as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables.","s":"Before You Start","u":"/docs/getting-started/update-tuples","h":"#before-you-start","p":241},{"i":246,"t":"Assume that you want to add user user:anne to have relationship reader with object document:Z { user: 'user:anne', relation: 'reader', object: 'document:Z', }","s":"Step By Step","u":"/docs/getting-started/update-tuples","h":"#step-by-step","p":241},{"i":248,"t":"Before calling the write API, you will need to configure the API client. Node.js Go .NET Python CLI curl // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) To obtain the access token: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)","s":"01. Configure The OpenFGA API Client","u":"/docs/getting-started/update-tuples","h":"#01-configure-the--api-client","p":241},{"i":250,"t":"To add the relationship tuples, we can invoke the write API. Node.js Go .NET Python CLI curl await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'reader', object: 'document:Z'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"reader\"), Object: openfga.PtrString(\"document:Z\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"reader\", Object = \"document:Z\" } }, }; var response = await fgaClient.Write(body, options); options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"reader\", object=\"document:Z\", ),, ), \", ) response = await fga_client.write(body, options) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:Z curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:Z\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}'","s":"02. Calling Write API To Add New Relationship Tuples","u":"/docs/getting-started/update-tuples","h":"#02-calling-write-api-to-add-new-relationship-tuples","p":241},{"i":252,"t":"To delete relationship tuples, we can invoke the write API. Assume that you want to delete user user:anne's reader relationship with object document:Z { user: 'user:anne', relation: 'reader', object: 'document:Z', } Node.js Go .NET Python CLI curl await fgaClient.write({ deletes: [ { user: 'user:anne', relation: 'reader', object: 'document:Z'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"reader\"), Object: openfga.PtrString(\"document:Z\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { new() { User = \"user:anne\", Relation = \"reader\", Object = \"document:Z\" } }, }; var response = await fgaClient.Write(body, options); options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( user=\"user:anne\", relation=\"reader\", object=\"document:Z\", ),], ), \", ) response = await fga_client.write(body, options) fga tuple delete --store-id=${FGA_STORE_ID} user:anne reader document:Z curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:Z\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}'","s":"03. Calling Write API To Delete Relationship Tuples","u":"/docs/getting-started/update-tuples","h":"#03-calling-write-api-to-delete-relationship-tuples","p":241},{"i":254,"t":"Check the following sections for more on how to write your authorization data Managing User Access Learn about how to give a user access to a particular object. More Managing Group Access Learn about how to give a group of users access to a particular object. More Transactional Writes Learn about how to update multiple relations within the same API call. More","s":"Related Sections","u":"/docs/getting-started/update-tuples","h":"#related-sections","p":241},{"i":256,"t":"In this guide you will learn how to grant a user access to a particular object. When to use Granting access with a relationship tuple is a core part of OpenFGA. Without any relationship tuples, any check will fail. You should use: authorization model to represent what relations are possible between the users and objects in your system relationship tuples to represent the facts about the relationships between users and objects in your system.","s":"Managing User Access","u":"/docs/interacting/managing-user-access","h":"","p":255},{"i":258,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have a type called tweet that can have a reader. DSL JSON model schema 1.1 type user type tweet relations define reader: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"tweet\", \"relations\": { \"reader\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/interacting/managing-user-access","h":"#before-you-start","p":255},{"i":260,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/interacting/managing-user-access","h":"#direct-access","p":255},{"i":262,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/interacting/managing-user-access","h":"#-concepts","p":255},{"i":265,"t":"For our application, we will give user Anne the reader relationship to a particular tweet. To do so we add a tuple as follows: [ // Anne can read tweet:1 { \"user\": \"user:anne\", \"relation\": \"reader\", \"object\": \"tweet:1\", }, ] With the above, we have added a direct relationship between Anne and tweet:1. When we call the Check API to see if Anne has a reader relationship, OpenFGA will say yes. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'tweet:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"tweet:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"tweet:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"tweet:1\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader tweet:1 # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"tweet:1\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"tweet:1\", // with the object `tweet:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"01. Adding Direct Relationship","u":"/docs/interacting/managing-user-access","h":"#01-adding-direct-relationship","p":255},{"i":267,"t":"Now let's change this so that Anne no longer has a reader relationship to tweet:1 by deleting the tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ { user: 'user:anne', relation: 'reader', object: 'tweet:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"reader\"), Object: openfga.PtrString(\"tweet:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { new() { User = \"user:anne\", Relation = \"reader\", Object = \"tweet:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( user=\"user:anne\", relation=\"reader\", object=\"tweet:1\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"tweet:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} user:anne reader tweet:1 delete([ { \"user\":\"user:anne\", \"relation\":\"reader\", \"object\":\"tweet:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") With this, we have removed the direct relationship between Anne and tweet:1. And because our type definition for reader does not include any other relations, a call to the Check API will now return a negative response. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'tweet:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"tweet:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"tweet:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"tweet:1\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader tweet:1 # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"tweet:1\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"tweet:1\", // with the object `tweet:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"02. Removing Direct Relationship","u":"/docs/interacting/managing-user-access","h":"#02-removing-direct-relationship","p":255},{"i":269,"t":"Check the following sections for more on how to manage user access. Direct Access Learn about how to model granting user access to an object. More Modeling Public Access Learn about how to model granting public access. More How to update relationship tuples Learn about how to update relationship tuples in SDK. More","s":"Related Sections","u":"/docs/interacting/managing-user-access","h":"#related-sections","p":255},{"i":271,"t":"In this guide you will learn how to update a user's membership to a group by adding and removing them from it. When to use Suppose: An employee is hired at a company and thus gains access to all of the company's resources. An employee quits and thus loses access to all of the company's resources. A user joins a GitHub organization and gains access to the organizations private repositories. A student graduates from school and loses access to the school's facilities. These are cases where using group membership can be helpful as you do not need to iterate over all of the group's resources to add or revoke access to particular objects. You can add a relationship tuple indicating that a user belongs to a group, or delete a tuple to indicate that a user is no longer part of the group.","s":"Managing Group Membership","u":"/docs/interacting/managing-group-membership","h":"","p":270},{"i":273,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have two types: org that can have a member relation document that can have a reader relation. DSL JSON model schema 1.1 type user type org relations define member: [user] type document relations define reader: [org#member] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"org\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"reader\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"org\", \"relation\": \"member\" } ] } } } } ] } Let us also assume that we have an org called \"contoso\" and a document called planning, and every member of that org can read the document. That is represented by having the following relationship tuple in the store: [ // Members of the contoso org can read the planning document { \"user\": \"org:contoso#member\", \"relation\": \"reader\", \"object\": \"document:planning\", }, ] With the above authorization model and relationship tuples, OpenFGA will respond with {\"allowed\":false} when check is called to see if Anne can read document:planning. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'anne', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"anne\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"anne\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"anne\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw anne reader document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"anne\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"anne\", // check if the user `anne` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Now let's make Anne a member of org:contoso by adding another tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is a member of the contoso org { user: 'user:anne', relation: 'member', object: 'org:contoso'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is a member of the contoso org User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"org:contoso\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is a member of the contoso org new() { User = \"user:anne\", Relation = \"member\", Object = \"org:contoso\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is a member of the contoso org user=\"user:anne\", relation=\"member\", object=\"org:contoso\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"member\",\"object\":\"org:contoso\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member org:contoso write([ // Anne is a member of the contoso org { \"user\":\"user:anne\", \"relation\":\"member\", \"object\":\"org:contoso\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") The OpenFGA service will now correctly respond with {\"allowed\":true} when check is called to see if Anne can read document:planning, but it will still respond with {\"allowed\":false} if we ask the same question for another user called Becky, who is not a member of the group org:contoso. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky reader document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:becky\", // check if the user `user:becky` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Modeling User Groups​ You need to know how to add users to groups and grant groups access to an object. Learn more → Managing Group Access​ You need to know how to manage group access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/interacting/managing-group-membership","h":"#before-you-start","p":270},{"i":275,"t":"You need to know how to add users to groups and grant groups access to an object. Learn more →","s":"Modeling User Groups","u":"/docs/interacting/managing-group-membership","h":"#modeling-user-groups","p":270},{"i":277,"t":"You need to know how to manage group access to an object. Learn more →","s":"Managing Group Access","u":"/docs/interacting/managing-group-membership","h":"#managing-group-access","p":270},{"i":279,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/interacting/managing-group-membership","h":"#-concepts","p":270},{"i":282,"t":"Imagine that every member of org:contoso has a reader relationship to 1000 documents. Now imagine that anne is no longer a member of org:contoso, so we want to revoke her access to all those documents, including document:planning. To accomplish this, we can simply delete the tuple in OpenFGA that specifies that Anne is a member of org:contoso. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ { user: 'user:anne', relation: 'member', object: 'org:contoso'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"org:contoso\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { new() { User = \"user:anne\", Relation = \"member\", Object = \"org:contoso\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( user=\"user:anne\", relation=\"member\", object=\"org:contoso\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"member\",\"object\":\"org:contoso\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} user:anne member org:contoso delete([ { \"user\":\"user:anne\", \"relation\":\"member\", \"object\":\"org:contoso\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"01. Revoking Group Membership","u":"/docs/interacting/managing-group-membership","h":"#01-revoking-group-membership","p":270},{"i":284,"t":"Once the above relationship tuple is deleted, we can check if Anne can read document:planning. OpenFGA will return { \"allowed\": false }. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"02. Validating revoked member no longer has access","u":"/docs/interacting/managing-group-membership","h":"#02-validating-revoked-member-no-longer-has-access","p":270},{"i":286,"t":"Check the following sections for more on how to model group. Modeling User Groups Learn about how to model users and groups. More Managing Group Access Learn about managing group access. More","s":"Related Sections","u":"/docs/interacting/managing-group-membership","h":"#related-sections","p":270},{"i":288,"t":"This section illustrates how to call the Read Changes API to get the list of relationship tuple changes that happened in your store, in the exact order that they happened. The API response includes tuples that have been added or removed in your store. It does not include other changes, like updates to your authorization model and adding new assertions.","s":"How to get tuple changes","u":"/docs/interacting/read-tuple-changes","h":"","p":287},{"i":290,"t":"Node.js Go .NET Python curl Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and added some relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and added some relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model and added some relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables.","s":"Before you start","u":"/docs/interacting/read-tuple-changes","h":"#before-you-start","p":287},{"i":292,"t":"To get a chronologically ordered list of tuples that have been written or deleted in your store, you can do so by calling the Read Changes API.","s":"Step By Step","u":"/docs/interacting/read-tuple-changes","h":"#step-by-step","p":287},{"i":294,"t":"First you will need to configure the API client. Node.js Go .NET Python curl // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() To obtain the access token: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)","s":"01. Configure The OpenFGA API Client","u":"/docs/interacting/read-tuple-changes","h":"#01-configure-the--api-client","p":287},{"i":296,"t":"To get a paginated list of changes that happened in your store: Node.js Go .NET Python CLI curl var type = \"\"; var continuationToken = \"\"; var pageSize = 25; await fgaClient.readChanges({ type }, { pageSize, continuationToken }); options := ClientReadChangesOptions{ PageSize: openfga.PtrInt32(25), } body := ClientReadChangesRequest{ } data, err := fgaClient.ReadChanges(context.Background()).Body(body).Options(options).Execute() if err != nil { // .. Handle error } var body = new ClientReadChangesRequest { }; var options = new ClientReadChangesOptions { PageSize = 25, }; var response = await fgaClient.ReadChanges(body, options); body = ClientReadChangesRequest() options = new ClientReadChangesOptions { page_size: 25, }; response = await fga_client.read_changes(body, options) fga tuple changes --store-id=${FGA_STORE_ID} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/changes \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"page_size\": 25}' The result will contain an array of up to 25 tuples, with the operation (write or delete), and the timestamp in which that operation took place. The result will also contain a continuation token. Save the continuation token in persistent storage between calls so that it is not lost and you do not have to restart from scratch on system restart or on error. You can then use this token to get the next set of changes: Node.js Go .NET Python CLI curl var type = \"\"; var continuationToken = \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\"; var pageSize = 25; await fgaClient.readChanges({ type }, { pageSize, continuationToken }); options := ClientReadChangesOptions{ PageSize: openfga.PtrInt32(25), ContinuationToken: openfga.PtrString(\"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\"), } body := ClientReadChangesRequest{ } data, err := fgaClient.ReadChanges(context.Background()).Body(body).Options(options).Execute() if err != nil { // .. Handle error } var body = new ClientReadChangesRequest { }; var options = new ClientReadChangesOptions { PageSize = 25, ContinuationToken = \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\", }; var response = await fgaClient.ReadChanges(body, options); body = ClientReadChangesRequest() options = new ClientReadChangesOptions { page_size: 25, continuation_token: \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\", }; response = await fga_client.read_changes(body, options) fga tuple changes --store-id=${FGA_STORE_ID} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/changes \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\", \"page_size\": 25}' Once there are no more changes to retrieve, the API will return the same token as the one you sent. Save the token in persistent storage to use at a later time. note The default page size is 50. The maximum page size allowed is 100. The API response will not return all the changes immediately. There will be a delay of one minute between the time that you add or delete a tuple and the time that you see it in the Read Changes API response. The API response does not expand the tuples. If you wrote a tuple that includes a userset, like {\"user\": \"group:abc#member\", \"relation\": \"owner\": \"doc:budget\"}, the Read Changes API will return that exact tuple.","s":"02. Get Changes For All Object Types","u":"/docs/interacting/read-tuple-changes","h":"#02-get-changes-for-all-object-types","p":287},{"i":298,"t":"Imagine you have the following authorization model: DSL JSON model schema 1.1 type user type group relations define member: [user] type folder relations define owner: [group#member, user] type doc relations define owner: [group#member, user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"group\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"folder\", \"relations\": { \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"group\", \"relation\": \"member\" }, { \"type\": \"user\" } ] } } } }, { \"type\": \"doc\", \"relations\": { \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"group\", \"relation\": \"member\" }, { \"type\": \"user\" } ] } } } } ] } It is possible to get a list of changes that happened in your store that relate only to one specific object type, like folder, by issuing a call like this: Node.js Go .NET Python CLI curl var type = \"folder\"; var continuationToken = \"\"; var pageSize = 25; await fgaClient.readChanges({ type }, { pageSize, continuationToken }); options := ClientReadChangesOptions{ PageSize: openfga.PtrInt32(25), } body := ClientReadChangesRequest{ Type: \"folder\", } data, err := fgaClient.ReadChanges(context.Background()).Body(body).Options(options).Execute() if err != nil { // .. Handle error } var body = new ClientReadChangesRequest { Type = \"folder\" }; var options = new ClientReadChangesOptions { PageSize = 25, }; var response = await fgaClient.ReadChanges(body, options); body = ClientReadChangesRequest(\"folder\") options = new ClientReadChangesOptions { page_size: 25, }; response = await fga_client.read_changes(body, options) fga tuple changes --store-id=${FGA_STORE_ID} --type folder curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/changes \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"type\": folder\", \"page_size\": 25}' The response will include a continuation token. In subsequent calls, you have to include the token and the type. (If you send this continuation token without the type parameter set, you will get an error). Node.js Go .NET Python CLI curl var type = \"folder\"; var continuationToken = \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\"; var pageSize = 25; await fgaClient.readChanges({ type }, { pageSize, continuationToken }); options := ClientReadChangesOptions{ PageSize: openfga.PtrInt32(25), ContinuationToken: openfga.PtrString(\"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\"), } body := ClientReadChangesRequest{ Type: \"folder\", } data, err := fgaClient.ReadChanges(context.Background()).Body(body).Options(options).Execute() if err != nil { // .. Handle error } var body = new ClientReadChangesRequest { Type = \"folder\" }; var options = new ClientReadChangesOptions { PageSize = 25, ContinuationToken = \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\", }; var response = await fgaClient.ReadChanges(body, options); body = ClientReadChangesRequest(\"folder\") options = new ClientReadChangesOptions { page_size: 25, continuation_token: \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\", }; response = await fga_client.read_changes(body, options) fga tuple changes --store-id=${FGA_STORE_ID} --type folder curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/changes \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"type\": folder\", \"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\", \"page_size\": 25}'","s":"03. Get Changes For A Specific Object Type","u":"/docs/interacting/read-tuple-changes","h":"#03-get-changes-for-a-specific-object-type","p":287},{"i":300,"t":"Once you implement fine-grained authorization to protect your resources, search becomes a more complex problem, because the user's access to each resource now has to be validated before the resource can be shown. The search problem can then be summarized as: \"Given a particular search filter and a sort order, what objects can the user access\"? The OpenFGA service does not store object metadata (names of files, creation dates, time of last update, etc), which means completing any search request by filtering and sorting according to certain criteria will require data from your database. The services responsible for performing these actions are: Filter: Your database Sort: Your database Authorize: OpenFGA To return the set of results that match the user's search query, you will need to get the intersection of the results from the services above.","s":"Search With Permissions","u":"/docs/interacting/search-with-permissions","h":"","p":299},{"i":302,"t":"There are three possible ways to do this:","s":"Possible Options","u":"/docs/interacting/search-with-permissions","h":"#possible-options","p":299},{"i":304,"t":"Pre-filter, then call OpenFGA Check endpoint. Filter and sort on your database. Call /check in parallel on each object returned from your database. Filter out objects the user does not have access to. Return the filtered result to the user.","s":"Option 1: Search, Then Check","u":"/docs/interacting/search-with-permissions","h":"#option-1-search-then-check","p":299},{"i":306,"t":"Consume the GET /changes endpoint to create a local index you can use to do an intersection on the two sets of results. Call the OpenFGA changes API. For the particular authorization model version(s) you are using in production, flatten/expand the changes (e.g. user:anne, writer, doc:planning becomes two tuples: user:anne, writer, doc:planning and user:anne, reader, doc:planning). Build the intersection between the objects in your database and the flattened/expanded state you created. You can then call /check on each resource in the resulting set before returning the response to filter out any resource with permissions revoked but whose authorization data has not made it into your index yet.","s":"Option 2: Build A Local Index From Changes Endpoint, Search, Then Check","u":"/docs/interacting/search-with-permissions","h":"#option-2-build-a-local-index-from-changes-endpoint-search-then-check","p":299},{"i":308,"t":"Call the GET /list-objects API to get a list of object IDs the user has access to, then run the filter restricting by the object IDs returned. Call the OpenFGA List Objects API. to get the list of all resources a user can access. Pass in the set of object IDs to the database query to limit the search. Return the filtered result to the user.","s":"Option 3: Build A List Of IDs, Then Search","u":"/docs/interacting/search-with-permissions","h":"#option-3-build-a-list-of-ids-then-search","p":299},{"i":310,"t":"Which option to choose among the three listed above depends on the following criteria: Number of objects that your database can return from a search query Number of objects of a certain type the user could have access to Percentage of objects in a type the user could have access to Consider the following scenarios: A. The number of objects a search query could return from the database is low. Search then Check is the recommended solution. Use-case: Situations where the search query can be optimized to return a small number of results. B. The number of objects of a certain type the user could have access to is low, and the percentage of objects in a namespace a user could have access to is high. Search then Check is recommended to get the final list of results. Note that this use case, because the user has access to a low number of objects which are still a high percentage of the total objects in the system, that means that the total number of objects in the system is low. C. The number of objects of a certain type the user could have access to is low (~ 100), and the percentage of the total objects that the user can have access to is also low. In this case, an API to return the list of all objects a user can access would make sense. You can query this API to get a list of object IDs and then pass these IDs to your filter function to limit the search to them. As this number increases, this solution becomes impractical, because you would need to paginate over multiple pages to get the entire list before being able to search and sort. A partial list from the API is not enough, because you won't be able to sort using it. So while List of IDs then Search would be useful for this in some situations, we would recommend Local Index from Changes Endpoint, Search then Check for the cases when the number of objects is high enough. Until OpenFGA implements an endpoint to return a list of object IDs, local index is recommended for all situations. D. The number of objects of a certain type the user could have access to is high, and the percentage of the total objects that the user can have access to is low. The recommended option for this case is to use Local Index from Changes Endpoint, Search then Check. List of IDs then Search would not work because you would have to get and paginate across thousands or tens of thousands (or in some cases more) of results from OpenFGA, only after you have retrieved the entire set can you start searching within your database for matching results. This would mean that your user could be waiting for a long time before they can start seeing results. Search then Check would also not be ideal, as you will be retrieving and checking against a lot of items and discarding most of them. Use case: Searching in Google Drive, where the list of documents and folders that a user has access to can be very high, but it still is a small percentage of the entire set of documents in Google Drive. E. The number of objects of a certain type the user could have access to is high, and the percentage of the total objects that the user can have access to is also high. In this case a Local Index from Changes Endpoint, Search then Check would be useful. If you do not want to maintain a local index, and if the user can access a high percentage of the total, meaning that the user is more likely than not to have access to the results returned by the search query, then Search then Check would work just as well. Use-case: Searching on Twitter. Most Twitter users have their profiles set to public, so the user is more likely to have access to the tweets when performing a search. So searching first then running checks against the set of returned results would be appropriate.","s":"Choosing The Best Option","u":"/docs/interacting/search-with-permissions","h":"#choosing-the-best-option","p":299},{"i":312,"t":"Scenario Use Case # of objects returned from database query # of objects user can access in a type % of objects user can access in a type Preferred Option A Search criteria enough to narrow down results Low - - 1 B Few objects the user has access to, but still a high % of total objects Low Low High 1 C Cannot narrow down search results, very high probability search returns objects user cannot access, total number of objects user can access is low enough to fit in a response High Low Low 3 or 2 D Google Drive: User has access to a lot of documents, but low percentage from total High High Low 2 E Twitter Search: Most profiles are public, and the user can access them High High High 1 or 2","s":"Summary","u":"/docs/interacting/search-with-permissions","h":"#summary","p":299},{"i":314,"t":"This section has guides, concepts and examples that help you define an authorization model. When to use The content in this section is useful: If you are starting with OpenFGA and want to learn how to represent your organization's/system's authorization needs. If you are working on iterating on an authorization model you previously defined.","s":"Modeling Guides","u":"/docs/modeling","h":"","p":313},{"i":316,"t":"Getting Started How to create an authorization model for your system starting from the requirements. Click to navigate Direct Access Learn the basics of modeling authorization and granting access to users. Click to navigate User Groups Learn to model user group membership, and to grant access to all members of a group. Click to navigate Roles and Permissions Learn to model roles for users at the object level and model permissions for those roles. Click to navigate Parent-Child objects Learn to model access based on parent-child relationships, e.g.: folders and documents. Click to navigate Block Lists Learn to model denying access if users are part of list of blocked users. Click to navigate Public Access Learn to model giving everyone specific access to an object, e.g.: everyone can read. Click to navigate Multiple Restrictions Learn to model requiring multiple privileges before granting access. Click to navigate Custom Roles Learn to model custom roles that are created by users. Click to navigate Contextual and Time-Based Authorization Learn to model and authorize when IP Address, time, and other dynamic and contextual restrictions are involved. Click to navigate Authorization Through Organization Context Learn to model and authorize when a user belongs to multiple organizations. Click to navigate Building Blocks Learn the underlying concepts/building blocks that can be used to build any model. Click to navigate Advanced Use-Cases Explore advanced use cases and patterns for authorization modeling with OpenFGA. Click to navigate Migrating Learn to migrate relations and models in a production environment. Click to navigate","s":"Content","u":"/docs/modeling","h":"","p":313},{"i":318,"t":"In this guide you will learn how to update multiple relationship tuples in a single transaction. When to use Updating multiple relationship tuples is useful to keep system state consistent.","s":"Transactional Writes","u":"/docs/interacting/transactional-writes","h":"","p":317},{"i":320,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have a type called tweet that can have a reader. You have another type called user that can have a follower and followed_by relationship. DSL JSON model schema 1.1 type tweet relations define viewer: [user, user:*, user#follower] type user relations define follower: [user] define followed_by: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"tweet\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user\", \"wildcard\": {} }, { \"type\": \"user\", \"relation\": \"follower\" } ] } } } }, { \"type\": \"user\", \"relations\": { \"follower\": { \"this\": {} }, \"followed_by\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"follower\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"followed_by\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → Modeling Public Access​ You need to know how to grant public access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/interacting/transactional-writes","h":"#before-you-start","p":317},{"i":322,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/interacting/transactional-writes","h":"#direct-access","p":317},{"i":324,"t":"You need to know how to grant public access to an object. Learn more →","s":"Modeling Public Access","u":"/docs/interacting/transactional-writes","h":"#modeling-public-access","p":317},{"i":326,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/interacting/transactional-writes","h":"#-concepts","p":317},{"i":329,"t":"When you need to add or delete tuples in your store, you can do so by calling the Write API. For example, if you want to make tweet:1 public by making everyone a viewer, you write one tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:*', relation: 'viewer', object: 'tweet:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:*\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"tweet:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:*\", Relation = \"viewer\", Object = \"tweet:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:*\", relation=\"viewer\", object=\"tweet:1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:*\",\"relation\":\"viewer\",\"object\":\"tweet:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:* viewer tweet:1 write([ { \"user\":\"user:*\", \"relation\":\"viewer\", \"object\":\"tweet:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") And if you want to convert this tweet to private, you would need to delete that tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ { user: 'user:*', relation: 'viewer', object: 'tweet:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:*\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"tweet:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { new() { User = \"user:*\", Relation = \"viewer\", Object = \"tweet:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( user=\"user:*\", relation=\"viewer\", object=\"tweet:1\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:*\",\"relation\":\"viewer\",\"object\":\"tweet:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} user:* viewer tweet:1 delete([ { \"user\":\"user:*\", \"relation\":\"viewer\", \"object\":\"tweet:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") By removing the tuple, we made the tweet visible to no-one, which may not be what we want. The Write API allows you to send up to 10 unique tuples in the request. (This limit applies to the sum of both writes and deletes in that request). This means we can submit one API call that converts the tweet from public to visible to only the user's followers. Node.js Go .NET Python curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne's followers can view tweet:1 { user: 'user:anne#follower', relation: 'viewer', object: 'tweet:1'}] }, deletes: [ // tweet:1 is no longer viewable by everyone (*) { user: 'user:*', relation: 'viewer', object: 'tweet:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne's followers can view tweet:1 User: openfga.PtrString(\"user:anne#follower\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"tweet:1\"), }, } Deletes: &[]ClientTupleKey{ { // tweet:1 is no longer viewable by everyone (*) User: openfga.PtrString(\"user:*\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"tweet:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne's followers can view tweet:1 new() { User = \"user:anne#follower\", Relation = \"viewer\", Object = \"tweet:1\" } }, Deletes = new List() { // tweet:1 is no longer viewable by everyone (*) new() { User = \"user:*\", Relation = \"viewer\", Object = \"tweet:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne's followers can view tweet:1 user=\"user:anne#follower\", relation=\"viewer\", object=\"tweet:1\", ),, ), deletes==[ ClientTuple( # tweet:1 is no longer viewable by everyone (*) user=\"user:*\", relation=\"viewer\", object=\"tweet:1\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne#follower\",\"relation\":\"viewer\",\"object\":\"tweet:1\"}] },\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:*\",\"relation\":\"viewer\",\"object\":\"tweet:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' write([ // Anne's followers can view tweet:1 { \"user\":\"user:anne#follower\", \"relation\":\"viewer\", \"object\":\"tweet:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), delete([ // tweet:1 is no longer viewable by everyone (*) { \"user\":\"user:*\", \"relation\":\"viewer\", \"object\":\"tweet:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"01. Adding And Removing Relationship Tuples In The Same Transaction","u":"/docs/interacting/transactional-writes","h":"#01-adding-and-removing-relationship-tuples-in-the-same-transaction","p":317},{"i":331,"t":"Having the ability to send multiple tuples per request is also useful when you want to maintain consistency. For example, if anne starts following becky, we want to be able to save the following two tuples, or neither of them: [ // Anne is a follower of Becky { \"user\": \"user:anne\", \"relation\": \"follower\", \"object\": \"user:becky\", }, // Becky is followed by Anne { \"user\": \"user:becky\", \"relation\": \"followed_by\", \"object\": \"user:anne\", }, ] info We have a type called user in this case because users can be related to each other, so the users now are a type in the system The OpenFGA service will attempt to perform all the changes sent in a single Write API call in one transaction. If it can't (for example, if any of the requested changes fails), it will reject all of the changes.","s":"02. Adding Multiple Related Relationship Tuples In The Same Transaction","u":"/docs/interacting/transactional-writes","h":"#02-adding-multiple-related-relationship-tuples-in-the-same-transaction","p":317},{"i":333,"t":"Check the following sections for more on how to update tuples. Update relationship tuples in SDK Learn about how to update relationship tuples in SDK. More OpenFGA API Details on the write API in the OpenFGA reference guide. More","s":"Related Sections","u":"/docs/interacting/transactional-writes","h":"#related-sections","p":317},{"i":335,"t":"This section will present advanced use cases and patterns for authorization modeling with OpenFGA. When to use The content in this section is useful if you would like to follow an end-to-end tutorial on how to build an authorization model for a common use-case or pattern.","s":"Advanced Use-Cases","u":"/docs/modeling/advanced","h":"","p":334},{"i":337,"t":"Google Drive How to create an authorization model for your system starting from the requirements. Click to navigate GitHub How to create an authorization model for your system starting from the requirements. Click to navigate IoT How to create an authorization model for your system starting from the requirements. Click to navigate Slack How to create an authorization model for your system starting from the requirements. Click to navigate","s":"Use-cases","u":"/docs/modeling/advanced","h":"#use-cases","p":334},{"i":339,"t":"Entitlements How to create an authorization model for your system starting from the requirements. Click to navigate","s":"Patterns","u":"/docs/modeling/advanced","h":"#patterns","p":334},{"i":341,"t":"This section has guides that on the building blocks of authorization model. When to use The content in this section is useful: If you are starting with OpenFGA and want to learn the building blocks that can be used to build any model.","s":"Building Blocks","u":"/docs/modeling/building-blocks","h":"","p":340},{"i":343,"t":"Direct Relationships Learn to model relationships that may or may not be assigned directly to individual users. Click to navigate Concentric Relationships Learn to model nested relationships in your application. Click to navigate Object to Object Relationships Learn to model your application with objects that are not specifically tied to a user. Click to navigate Usersets Learn to model your application by assigning relationships to groups of users. Click to navigate","s":"Content","u":"/docs/modeling/building-blocks","h":"","p":340},{"i":345,"t":"In this guide you'll see how to model preventing users from accessing objects using OpenFGA. For example, blocking users from accessing a document, even if it has been already shared with them. When to use Exclusion is useful while building applications. You may need to support access patterns like granting access to some users, but excluding specific people or groups, similar to how users can block others from following them on social media, or prevent them from sharing documents on Google Drive. This is useful when: Implementing the \"blocking\" feature, such as the profile blocking commonly present on social media platforms (e.g. Instagram and Twitter). Reduce a user's access if they are part of a particular group (e.g. restricting access to members who are also guests, or restricting access to users in a certain locality).","s":"Blocklists","u":"/docs/modeling/blocklists","h":"","p":344},{"i":347,"t":"Before you start this guide, make sure you're familiar with some OpenFGA Concepts and know how to develop the things listed below. You will start with the authorization model below, it represents a document type that can have users related as editor, and team type that can have users related as member. Let us also assume that we have a document called \"planning\", shared for editing within the product team (comprised of becky and carl). DSL JSON model schema 1.1 type user type document relations define editor: [user, team#member] type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The current state of the system is represented by the following relationship tuples being in the system already: [ // Members of the product team can edit the planning document { \"user\": \"team:product#member\", \"relation\": \"editor\", \"object\": \"document:planning\", }, // Becky is a member of the product team { \"user\": \"user:becky\", \"relation\": \"member\", \"object\": \"team:product\", }, // Carl is a member of the product team { \"user\": \"user:carl\", \"relation\": \"member\", \"object\": \"team:product\", }, ] In addition, you will need to know the following: Modeling User Groups​ You need to know how to add users to groups and grant groups access to resources. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Exclusion Operator: the exclusion operator can be used to exclude certain usersets from being related to an object","s":"Before You Start","u":"/docs/modeling/blocklists","h":"#before-you-start","p":344},{"i":349,"t":"You need to know how to add users to groups and grant groups access to resources. Learn more →","s":"Modeling User Groups","u":"/docs/modeling/blocklists","h":"#modeling-user-groups","p":344},{"i":351,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Exclusion Operator: the exclusion operator can be used to exclude certain usersets from being related to an object","s":"OpenFGA Concepts","u":"/docs/modeling/blocklists","h":"#-concepts","p":344},{"i":353,"t":"With the above authorization model and relationship tuples, OpenFGA will correctly respond with {\"allowed\":true} when check is called to see if Carl and Becky can edit this document. We can verify that by issuing two check requests: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'editor', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"editor\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"editor\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"editor\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky editor document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"editor\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:becky\", // check if the user `user:becky` relation = \"editor\", // has an `editor` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:carl', relation: 'editor', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:carl\", Relation: \"editor\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:carl\", Relation = \"editor\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:carl\", relation=\"editor\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl editor document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:carl\",\"relation\":\"editor\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:carl\", // check if the user `user:carl` relation = \"editor\", // has an `editor` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true We want to share a document with the product team and also have the ability to deny certain users access, even if they have the document shared with them already. We can verify this by blocking Carl (who we have seen already has edit access) from editing the document. In order to do that, we need to: Modify our model to allow indicating that users can be blocked from accessing a document Modify our model to indicate that users who are blocked can no longer edit the document Verify that our solution works: a. Indicate that Carl is blocked from the planning document b. Carl (now blocked) can no longer edit the document c. Becky still has edit access","s":"Step By Step","u":"/docs/modeling/blocklists","h":"#step-by-step","p":344},{"i":355,"t":"To allow users to be \"blocked\" from accessing a document, we first need to allow this relation. We'll update our store model to add a blocked relation to the document type. The authorization model becomes this: DSL JSON model schema 1.1 type user type document relations define blocked: [user] define editor: [user, team#member] type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"blocked\": { \"this\": {} }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"blocked\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Now we can add relationship tuples indicating that a certain user is blocked from editing a document.","s":"01. Modify Our Model So Users Can Be Blocked From Accessing A Document","u":"/docs/modeling/blocklists","h":"#01-modify-our-model-so-users-can-be-blocked-from-accessing-a-document","p":344},{"i":357,"t":"Now that we can mark users as blocked from editing documents, we need to support denying the editor relationship when a user is blocked. We do that by modifying the relation definition of editor, and making use of the the exclusion operator to exclude the set of blocked users, as we can see here: DSL JSON model schema 1.1 type user type document relations define blocked: [user] define editor: [user, team#member] but not blocked type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"blocked\": { \"this\": {} }, \"editor\": { \"difference\": { \"base\": { \"this\": {} }, \"subtract\": { \"computedUserset\": { \"relation\": \"blocked\" } } } } }, \"metadata\": { \"relations\": { \"blocked\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"02. Modify Our Model So Users Who Are Blocked Can No Longer Edit The Document","u":"/docs/modeling/blocklists","h":"#02-modify-our-model-so-users-who-are-blocked-can-no-longer-edit-the-document","p":344},{"i":359,"t":"To check if our new model works, we'll add a relationship tuple with Carl as blocked from document:planning and then verify that Carl no longer has editor access to that document. a. Indicate That Carl Is Blocked From The Planning Document​ With our modified authorization model, we can indicate that Carl is blocked by adding this relationship tuple. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Carl is blocked from editing the planning document { user: 'user:carl', relation: 'blocked', object: 'document:planning'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Carl is blocked from editing the planning document User: openfga.PtrString(\"user:carl\"), Relation: openfga.PtrString(\"blocked\"), Object: openfga.PtrString(\"document:planning\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Carl is blocked from editing the planning document new() { User = \"user:carl\", Relation = \"blocked\", Object = \"document:planning\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Carl is blocked from editing the planning document user=\"user:carl\", relation=\"blocked\", object=\"document:planning\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:carl\",\"relation\":\"blocked\",\"object\":\"document:planning\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl blocked document:planning write([ // Carl is blocked from editing the planning document { \"user\":\"user:carl\", \"relation\":\"blocked\", \"object\":\"document:planning\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") b. Carl (now blocked) Can No Longer Edit The Document​ We have modified the authorization model and added relationship tuples to indicate that Carl is blocked. Now let's make sure our solution works as expected. To check if Carl still has access to the document, we can issue a check request with Carl as the user. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:carl', relation: 'editor', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:carl\", Relation: \"editor\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:carl\", Relation = \"editor\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:carl\", relation=\"editor\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl editor document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:carl\",\"relation\":\"editor\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:carl\", // check if the user `user:carl` relation = \"editor\", // has an `editor` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false The response is false, so our solution is working as expected. c. Becky Still Has Edit Access​ To check if Becky still has access to the document, we'll issue another check request with Becky as the user. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'editor', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"editor\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"editor\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"editor\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky editor document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"editor\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:becky\", // check if the user `user:becky` relation = \"editor\", // has an `editor` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true The response is true, indicating our model change did not inadvertently deny access for users who have access but are not blocked. caution Note: When creating tuples for OpenFGA make sure to use unique ids for each object and user within your application domain. We are using first names and human-readable identifiers to make this task easier to read.","s":"03. Verify Our Solution Works","u":"/docs/modeling/blocklists","h":"#03-verify-our-solution-works","p":344},{"i":361,"t":"Check the following sections for more on how to model with OpenFGA. Modeling: Getting Started Learn about how to get started with modeling. More Configuration Language Learn about OpenFGA Configuration Language. More Public Access Learn about model public access. More","s":"Related Sections","u":"/docs/modeling/blocklists","h":"#related-sections","p":344},{"i":363,"t":"In this short guide, you'll learn how to represent a concentric relationships. For example, if you want to have all editors of a document also be viewers of said document. When to use Concentric relations make the most sense when your domain logic has nested relations, where one having relation implies having another relation. For example: all editors are viewers all managers are members all device_managers are device_renamers This allows you to only create a single relationship tuple rather than creating n relationship tuples for each relation.","s":"Concentric Relationships","u":"/docs/modeling/building-blocks/concentric-relationships","h":"","p":362},{"i":365,"t":"To better understand this guide, you should be familiar with some OpenFGA Concepts and know how to develop the things listed below. You will start with the authorization model below, it represents a document type that can have users related as editor and viewer. Let us also assume that we have a document called \"meeting_notes.doc\" and bob is assigned as editor to this document. DSL JSON model schema 1.1 type user type document relations define viewer: [user] define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The current state of the system is represented by the following relationship tuples being in the system already: [ { \"user\": \"user:bob\", \"relation\": \"editor\", \"object\": \"document:meeting_notes.doc\", }, ] In addition, you will need to know the following: Modeling User Groups​ You need to know how to add users to groups and grant groups access to resources. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#before-you-start","p":362},{"i":367,"t":"You need to know how to add users to groups and grant groups access to resources. Learn more →","s":"Modeling User Groups","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#modeling-user-groups","p":362},{"i":369,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#-concepts","p":362},{"i":371,"t":"With the current type definition, there isn't a way to indicate that all editors of a certain document are also automatically viewers of that document. So for a certain user, in order to indicate that they can both edit and view a certain document, two relationship tuples need to be created (one for editor, and another for viewer).","s":"Step By Step","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#step-by-step","p":362},{"i":373,"t":"Instead of creating two relationship tuples, we can leverage concentric relationships by defining editors are viewers. Our authorization model becomes the following: DSL JSON model schema 1.1 type user type document relations define viewer: [user] or editor define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info viewer of a document are any of: users that are directly assigned as viewer users that have editor of the document With this authorization model change, having an editor relationship with a certain document implies having a viewer relationship with that same document.","s":"01. Modify Our Model To Imply Editor As Viewer","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#01-modify-our-model-to-imply-editor-as-viewer","p":362},{"i":375,"t":"Since we had a relationship tuple that indicates that bob is an editor of document:meeting_notes.doc, this means bob is now implicitly a viewer of document:meeting_notes.doc. If we now check: is bob a viewer of document:meeting_notes.doc? we would get the following: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'viewer', object: 'document:meeting_notes.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"viewer\", Object: \"document:meeting_notes.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"viewer\", Object = \"document:meeting_notes.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"viewer\", object=\"document:meeting_notes.doc\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob viewer document:meeting_notes.doc # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"viewer\",\"object\":\"document:meeting_notes.doc\"}}' # Response: {\"allowed\":true} check( user = \"user:bob\", // check if the user `user:bob` relation = \"viewer\", // has an `viewer` relation object = \"document:meeting_notes.doc\", // with the object `document:meeting_notes.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Note When creating relationship tuples for OpenFGA make sure to use unique ids for each object and user within your application domain. We're using first names and simple ids to just illustrate an easy-to-follow example.","s":"02. Check That Editors Are Viewers","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#02-check-that-editors-are-viewers","p":362},{"i":377,"t":"Check the following sections for more on how concentric relationships can be used. Modeling Google Drive See how to indicate that editors are commenters and viewers in Google Drive. More Modeling GitHub See how to indicate that repository admins are writers and readers in GitHub. More","s":"Related Sections","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#related-sections","p":362},{"i":380,"t":"A userset represents a set or collection of users. Usersets can be used to indicate that a group of users in the system have a certain relation with an object. This can be used to assign permissions to groups of users rather than specific ones, allowing us to represent the permissions in our system using less tuples and granting us flexibility in granting or denying access in bulk. In OpenFGA, usersets are represented via this notation: object#relation, where object is made up of a type and an object identifier. For example: company:xyz#employee represents all users that are related to company:xyz as employee tweet:12345#viewer represents all users that are related to tweet:12345 as viewer","s":"What Is A Userset?","u":"/docs/modeling/building-blocks/usersets","h":"#what-is-a-userset","p":378},{"i":382,"t":"Imagine the following authorization model: DSL JSON model schema 1.1 type user type org relations define member: [user] type document relations define reader: [user, org#member] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"org\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"reader\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"org\", \"relation\": \"member\" } ] } } } } ] } Now let us assume that the store has the following tuples: [ // Userset \"Members of the xyz org\" can read the budget document { \"user\": \"org:xyz#member\", \"relation\": \"reader\", \"object\": \"document:budget\", }, // Anne is part of the userset \"Members of the xyz org\" { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"org:xyz\", }, ] If we call the check API to see if user anne has a reader relationship with document:budget, OpenFGA will check whether anne is part of the userset that does have a reader relationship. Because she is part of that userset, the request will return true: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'document:budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"document:budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"document:budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"document:budget\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:budget # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:budget\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"document:budget\", // with the object `document:budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"How Do Check Requests Work With Usersets?","u":"/docs/modeling/building-blocks/usersets","h":"#how-do-check-requests-work-with-usersets","p":378},{"i":384,"t":"Imagine the following authorization model: DSL JSON model schema 1.1 type user type document relations define writer: [user, org#member] define reader: [user, org#member] or writer { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"writer\": { \"this\": {} }, \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"org\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"org\", \"relation\": \"member\" } ] } } } } ] } If we wanted to see which users and usersets have a reader relationship with document:budget, we can call the Expand API. The response will contain a userset tree where the leaf nodes are specific user IDs and usersets. For example: { \"tree\": { \"root\": { \"type\": \"document:budget#reader\", \"union\": { \"nodes\": [ { \"type\": \"document:budget#reader\", \"leaf\": { \"users\": { \"users\": [\"user:bob\"] } } }, { \"type\": \"document:budget#reader\", \"leaf\": { \"computed\": { \"userset\": \"document:budget#writer\" } } } ] } } } } As you can see from the response above, with usersets we can express unions of user groups. We can also express intersections and exclusions.","s":"How Do Expand Requests Work With Usersets?","u":"/docs/modeling/building-blocks/usersets","h":"#how-do-expand-requests-work-with-usersets","p":378},{"i":386,"t":"Using the type definitions in the authorization model, some of the situations we can represent are: that a user is not in a set of users having a certain relation to an object, even if a relationship tuple exists in the system. See Disabling Direct Relationships that a user has a certain relationship with an object if they are in the union, intersection or exclusion of usersets. that a user being in a set of users having a certain relation to an object can result in them having another relation to the object. See Concentric Relationships that the user being in a set of users having a certain relation to an object and that object is in a set of users having a certain relation to another object, can imply that the original user has a certain relationship to the final object. See Object-to-Object Relationships When executing the Check API of the form check(user, relation, object), OpenFGA will perform the following steps: In the authorization model, look up type and its relation. Start building a tree where the root node will be the definition of that relation, which can be a union, exclusion, or intersection of usersets, or it can be direct users. Expand all the usersets involved into new nodes in the tree. This means recursively finding all the users that are members of the usersets. If there are direct relationships with users, create leaf nodes. Check whether user is a leaf node in the tree. If the API finds one match, it will return immediately and will not expand the remaining nodes.","s":"Internals","u":"/docs/modeling/building-blocks/usersets","h":"#internals","p":378},{"i":388,"t":"See the following sections for more information: Managing Group Membership How to add users to a userset More Managing Group Access How to add permissions to a userset More","s":"Related Sections","u":"/docs/modeling/building-blocks/usersets","h":"#related-sections","p":378},{"i":390,"t":"In this guide you'll learn how to model custom roles in your system using OpenFGA. For example, a Business-to-Business (B2B) application could allow customers to create their own custom roles on the application to grant their users. When to use In many cases, roles would fit in well as relations on an object type, as seen in Modeling Roles and Permissions. In some cases, however, they may not be enough. Custom roles are useful when: Users of the application are able to create arbitrary sets of roles with different permissions that govern the users' access to objects. It is not known beforehand (at the time of Authorization Model creation) what the application roles are. The team responsible for building the authorization model is different from the teams responsible for defining roles and access to the application.","s":"Custom Roles","u":"/docs/modeling/custom-roles","h":"","p":389},{"i":392,"t":"Before you start this guide, make sure you're familiar with some OpenFGA Concepts and know how to develop the things listed below. Initial Model​ To start, let's say there is an application with a type called asset-category. Users can have view and/or edit access to assets in that category. Any user who can edit can also view. We'll start with the following authorization model showing a system with an asset-category type. This type allows users to have view and edit access to it. DSL JSON model schema 1.1 type user type asset-category relations define viewer: [user] or editor define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"asset-category\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you'll need to know the following: Modeling Roles and Permissions​ You need to know how to add users to groups and grant groups access to resources. Learn more → Modeling Object-to-Object Relationships​ You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more → Concepts & Configuration Language​ OpenFGA Concepts Configuration Language","s":"Before you start","u":"/docs/modeling/custom-roles","h":"#before-you-start","p":389},{"i":394,"t":"To start, let's say there is an application with a type called asset-category. Users can have view and/or edit access to assets in that category. Any user who can edit can also view.","s":"Initial Model","u":"/docs/modeling/custom-roles","h":"#initial-model","p":389},{"i":396,"t":"You need to know how to add users to groups and grant groups access to resources. Learn more →","s":"Modeling Roles and Permissions","u":"/docs/modeling/custom-roles","h":"#modeling-roles-and-permissions","p":389},{"i":398,"t":"You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more →","s":"Modeling Object-to-Object Relationships","u":"/docs/modeling/custom-roles","h":"#modeling-object-to-object-relationships","p":389},{"i":400,"t":"OpenFGA Concepts Configuration Language","s":"Concepts & Configuration Language","u":"/docs/modeling/custom-roles","h":"#concepts--configuration-language","p":389},{"i":402,"t":"Starting with the authorization model mentioned above, we want to enable users to create their own custom roles, and tie permissions to those roles to our two users and to the permissions on the logo asset category. For this guide, we'll model a scenario where a certain organization using our app has created an asset-category called \"logos\", and another called \"text content\". The company administrator would like to create: a media-manager role that allows users to edit assets in the logos asset category a media-viewer role that allows users to view all assets in the logos asset category a blog-editor role that allows users to edit all assets in the text content asset category a blog-viewer role that allows users to view all assets in the text content asset category Imagine these are what the permissions the roles in one organization using our service are like: Finally, the administrator wants to assign Anne the media-manager role and Beth the media-viewer role. At the end, we'll verify our model by ensuring the following access check requests return the expected result. In order to do this, we need to: Update the Authorization Model to add a Role Type Use Relationship Tuples to tie the Users to the Roles Use Relationship Tuples to associate Permissions with the Roles Verify that the Authorization Model works","s":"Step By Step","u":"/docs/modeling/custom-roles","h":"#step-by-step","p":389},{"i":404,"t":"Because our roles are going to be dynamic and might change frequently, we represent them in a new type instead of as relations on that same type. We'll create new type called role, where users can be related as assignee to it. The authorization model becomes this: DSL JSON model schema 1.1 type user type asset-category relations define viewer: [user, role#assignee] or editor define editor: [user, role#assignee] type role relations define assignee: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"asset-category\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"role\", \"relation\": \"assignee\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"role\", \"relation\": \"assignee\" } ] } } } }, { \"type\": \"role\", \"relations\": { \"assignee\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"assignee\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } With this change we can add relationship tuples indicating that a certain user is assigned a certain role.","s":"01. Update The Authorization Model To Add A Role Type","u":"/docs/modeling/custom-roles","h":"#01-update-the-authorization-model-to-add-a-role-type","p":389},{"i":406,"t":"Once we've added the role type, we can assign roles to Anne and Beth. Anne is assigned the \"media-manager\" role and Beth is assigned the \"media-viewer\" role. We can do that by adding relationship tuples as follows: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is assigned the media-manager role { user: 'user:anne', relation: 'assignee', object: 'role:media-manager'}, // Beth is assigned the media-viewer role { user: 'user:beth', relation: 'assignee', object: 'role:media-viewer'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is assigned the media-manager role User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"assignee\"), Object: openfga.PtrString(\"role:media-manager\"), }, { // Beth is assigned the media-viewer role User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"assignee\"), Object: openfga.PtrString(\"role:media-viewer\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is assigned the media-manager role new() { User = \"user:anne\", Relation = \"assignee\", Object = \"role:media-manager\" }, // Beth is assigned the media-viewer role new() { User = \"user:beth\", Relation = \"assignee\", Object = \"role:media-viewer\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is assigned the media-manager role user=\"user:anne\", relation=\"assignee\", object=\"role:media-manager\", ), ClientTuple( # Beth is assigned the media-viewer role user=\"user:beth\", relation=\"assignee\", object=\"role:media-viewer\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"assignee\",\"object\":\"role:media-manager\"},{\"user\":\"user:beth\",\"relation\":\"assignee\",\"object\":\"role:media-viewer\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne assignee role:media-manager fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth assignee role:media-viewer write([ // Anne is assigned the media-manager role { \"user\":\"user:anne\", \"relation\":\"assignee\", \"object\":\"role:media-manager\" }, // Beth is assigned the media-viewer role { \"user\":\"user:beth\", \"relation\":\"assignee\", \"object\":\"role:media-viewer\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") We can verify they are members of said roles by issuing the following check requests: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'assignee', object: 'role:media-manager', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"assignee\", Object: \"role:media-manager\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"assignee\", Object = \"role:media-manager\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"assignee\", object=\"role:media-manager\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne assignee role:media-manager # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"assignee\",\"object\":\"role:media-manager\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"assignee\", // has an `assignee` relation object = \"role:media-manager\", // with the object `role:media-manager` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"02.Use Relationship Tuples To Tie The Users To The Roles","u":"/docs/modeling/custom-roles","h":"#02use-relationship-tuples-to-tie-the-users-to-the-roles","p":389},{"i":408,"t":"With our users and roles set up, we still need to tie members of a certain role to it's corresponding permission(s). Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Users assigned the media-manager role can edit in the Logos assets category { user: 'role:media-manager#assignee', relation: 'editor', object: 'asset-category:logos'}, // Users assigned the media-viewer role can view from the Logos assets category { user: 'role:media-viewer#assignee', relation: 'viewer', object: 'asset-category:logos'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Users assigned the media-manager role can edit in the Logos assets category User: openfga.PtrString(\"role:media-manager#assignee\"), Relation: openfga.PtrString(\"editor\"), Object: openfga.PtrString(\"asset-category:logos\"), }, { // Users assigned the media-viewer role can view from the Logos assets category User: openfga.PtrString(\"role:media-viewer#assignee\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"asset-category:logos\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Users assigned the media-manager role can edit in the Logos assets category new() { User = \"role:media-manager#assignee\", Relation = \"editor\", Object = \"asset-category:logos\" }, // Users assigned the media-viewer role can view from the Logos assets category new() { User = \"role:media-viewer#assignee\", Relation = \"viewer\", Object = \"asset-category:logos\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Users assigned the media-manager role can edit in the Logos assets category user=\"role:media-manager#assignee\", relation=\"editor\", object=\"asset-category:logos\", ), ClientTuple( # Users assigned the media-viewer role can view from the Logos assets category user=\"role:media-viewer#assignee\", relation=\"viewer\", object=\"asset-category:logos\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"role:media-manager#assignee\",\"relation\":\"editor\",\"object\":\"asset-category:logos\"},{\"user\":\"role:media-viewer#assignee\",\"relation\":\"viewer\",\"object\":\"asset-category:logos\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw role:media-manager#assignee editor asset-category:logos fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw role:media-viewer#assignee viewer asset-category:logos write([ // Users assigned the media-manager role can edit in the Logos assets category { \"user\":\"role:media-manager#assignee\", \"relation\":\"editor\", \"object\":\"asset-category:logos\" }, // Users assigned the media-viewer role can view from the Logos assets category { \"user\":\"role:media-viewer#assignee\", \"relation\":\"viewer\", \"object\":\"asset-category:logos\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"03. Use Relationship Tuples To Associate Permissions With The Roles","u":"/docs/modeling/custom-roles","h":"#03-use-relationship-tuples-to-associate-permissions-with-the-roles","p":389},{"i":410,"t":"To ensure our model works, it needs to match our expectations: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'editor', object: 'asset-category:logos', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"editor\", Object: \"asset-category:logos\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"editor\", Object = \"asset-category:logos\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"editor\", object=\"asset-category:logos\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne editor asset-category:logos # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"asset-category:logos\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"editor\", // has an `editor` relation object = \"asset-category:logos\", // with the object `asset-category:logos` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true The checks come back as we expect, so our model is working correctly.","s":"04. Verify That The Authorization Model Works","u":"/docs/modeling/custom-roles","h":"#04-verify-that-the-authorization-model-works","p":389},{"i":412,"t":"Check the following sections for more on how to model with OpenFGA. Modeling Roles and Permissions Learn how to remove the direct relationship to indicate nonassignable permissions. More Modeling Concepts: Object to Object Relationships Learn about how to model object to object relationships in OpenFGA. More","s":"Related Sections","u":"/docs/modeling/custom-roles","h":"#related-sections","p":389},{"i":414,"t":"Creating a Relationship Based Access Control (ReBAC) authorization model might feel odd at first. Most of us tend to think about authorization models in terms of roles and permissions. After all, most software works like that. Your existing systems are likely built on a model using roles and permissions. This guide outlines a process for defining your authorization model with OpenFGA.","s":"Get Started with Modeling","u":"/docs/modeling/getting-started","h":"","p":413},{"i":416,"t":"To define a ReBAC model in OpenFGA we recommend: If you have an existing system: forget about how your system works today and start thinking about how you want it to work in the future. Thinking about authorization starting from the resources, or objects as OpenFGA calls them. If that sounds hard, don't worry! We'll guide you through it. authorization checks ReBAC systems determine access from a user's relation to an object. Authorization decisions are then yes or no answers to the question: \"Does user U have relation R with object O?\". General Authorization Check \"Can user U perform an action A on object O?\" OpenFGA (ReBAC) Authorization Check \"Does user U have relation R with object O?\" In the previous example, a relation R should be defined that implies permission to action A. For example: General Authorization Check \"Can user Jane perform action view on object project sandcastle?\" OpenFGA (ReBAC) Authorization Check \"Can user Jane have relation view with object project sandcastle?\" We'll provide more detailed examples throughout this article. When you are modeling, you need to answer a more general question: Why could user U perform an action A on an object O? If you can answer that question for all types of objects in your system, then you can codify that into an authorization model. Let's get started!","s":"Introduction To Modeling","u":"/docs/modeling/getting-started","h":"#introduction-to-modeling","p":413},{"i":418,"t":"Defining an authorization model requires codifying an answer to the question \"why could user U perform an action A on an object O?\" for all use cases or actions in your system. This is an iterative process. For the purpose of this guide, we'll go through one iteration of this process using a simplified Google Drive like system as an example. Steps for defining your authorization model: Pick the most important feature List the object types List relations for those types Define relations Test the model Iterate","s":"A Process For Defining Authorization Models","u":"/docs/modeling/getting-started","h":"#a-process-for-defining-authorization-models","p":413},{"i":420,"t":"A feature, in the context of this document, is an action or related set of actions your users can perform in your system. We'll introduce an example feature later in this section. Start with the most important feature. It doesn't have to be the most complex one, but it should be the most important one. You're probably more familiar with the authorization requirements for this feature than other less important use cases. Important Requirement clarity is fundamental when defining an authorization model. The scope of the feature is not important at this point. You can always iterate later. Write It In Plain Language​ Once you've picked a feature, describe its authorization related scope using simple language. Avoid using the word \"roles\", as this ties you to an RBAC way of thinking. info Roles don't \"disappear\" in ReBAC systems like OpenFGA. Your users might have roles on a given object, rather than the entire system. But starting from the term \"role\" might lead you down the wrong path. Instead it is better to discover roles while you are modeling. Your feature description should include the objects, users and groups of users participating in the system. Sentences should look like this: A user {user} can perform action {action} to/on/in {object types} ... IF {conditions} This feature can be described with these sentences: A user can create a document in a drive if they are the owner of the drive. A user can create a folder in a drive if they are the owner of the drive. A user can create a document in a folder if they are the owner of the folder. The folder is the parent of the document. A user can create a folder in a folder if they are the owner of the folder. The existing folder is the parent of the new folder. A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document. A user can share a folder with another user or an organization as a viewer if they are an owner of the folder. A user can view a document if they are an owner, viewer or editor of the document or if they are a viewer or owner of the folder/drive that is the parent of the document. A user can edit a document if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document. A user can change the owner of a document if they are an owner of the document. A user can change the owner of a folder if they are an owner of the folder. A user can be a member of an organization. How a user is added as a member to an organization is beyond the scope of the feature we picked to write down. A user can view a folder if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder.","s":"01. Pick The Most Important Feature","u":"/docs/modeling/getting-started","h":"#01-pick-the-most-important-feature","p":413},{"i":422,"t":"Next make a list of the types of objects in your system. You might be able to identify the objects in your system from your existing domain/database model. Find all the objects in the previous step using this template: A user {user} can perform action {action} to/on/in {object type} ... IF {conditions} These are all the object types from the previous step (in order of appearance) based on that template: Document Folder Organization Let's highlight all object types in blue: A user can create a document in a drive if they are the owner of the drive. A user can create a folder in a drive if they are the owner of the drive. A user can create a document in a folder if they are the owner of the folder. A user can create a folder in a folder if they are the owner of the folder. A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document. A user can share a folder with another user or an organization as a viewer if they are an owner of the folder. A user can view a document if they are an owner, viewer or editor of the document or if they are a viewer, owner of the folder/drive that is the parent of the document. A user can edit a document if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document. A user can change the owner of a document if they are an owner of the document. A user can change the owner of a folder if they are an owner of the folder. A user can be a member of an organization. How a user is added as a member to an organization is beyond the scope of the feature we picked to write down. A user can view a folder if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder. However, the list of object types is not finished. To complete the list of object types you must also add all the second nouns that appear in conditions as part of expressions of this format: \"{first noun} of a/the {second noun}\". ... IF {first noun} of a/the {second noun} Let's highlight those expressions in green: A user can create a document in a drive if they are the owner of the drive. A user can create a folder in a drive if they are the owner of the drive. A user can create a document in a folder if they are the owner of the folder. The folder is the parent of the document. A user can create a folder in a folder if they are the owner of the folder. The existing folder is the parent of the new folder . A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document. A user can share a folder with another user or an organization as a viewer if they are an owner of the folder. A user can view a document if they are an owner, viewer or editor of the document or if they are a viewer or owner of the folder/drive that is the parent of the document. A user can edit a document if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document. A user can change the owner of a document if they are an owner of the document. A user can change the owner of a folder if they are an owner of the folder. A user can be a member of an organization. How a user is added as a member to an organization is beyond the scope of the feature we picked to write down. A user can view a folder if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder. The only second noun we didn't have in our object type list is \"Drive\", so we'll add it to the list. We will also need to add \"User\" to the list as it establishes the type of user who can establish relations. User Document Folder Organization Drive Now that we have a list of object types we can start defining them using the OpenFGA Configuration Language: model schema 1.1 type user type document type folder type organization type drive Caution You're now in the process of building a version you can use. The model above is not yet a valid authorization model accepted by OpenFGA. Important In a few cases other users can be part of determining whether an action can be performed on an action or not. Social media is an example of this \"a user can comment on a picture if they are a friend of the user that published it\". In those cases User should also be an object type. Following the last recommendation, we would discover the User type because it is a second noun in an expression: \"friend of the user\".","s":"02. List The Object Types","u":"/docs/modeling/getting-started","h":"#02-list-the-object-types","p":413},{"i":424,"t":"Each of the previously defined types has a set of relations. Relations are an important component in your model. After all, OpenFGA is a Relationship Based Access Control (ReBAC) system. To identify relations for a type we in the write-up we can perform an exercise similar to the one we did in list the type of objects in your system. Relations for a type {type} will be all of these: any noun that is the {noun} of a \"{noun} of a/an/the {type}\" expression. These are typically the Foreign Keys in a database. We'll highlight these in green. any verb or action that is the {action} of a \"can {action} (in) a/an {type}\" expression. These are typically the permissions for a type. We'll highlight these in yellow. A user can create a document in a drive if they are the owner of the drive. A user can create a folder in a drive if they are the owner of the drive. A user can create a document in a folder if they are the owner of the folder. The folder is the parent of the document. A user can create a folder in a folder if they are the owner of the folder. The existing folder is the parent of the new folder. A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document. A user can share a folder with another user or an organization as a viewer if they are an owner of the folder. A user can view a document if they are an owner, viewer or editor of the document or if they are a viewer or owner of the folder/drive that is the parent of the document. A user can edit a document if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document. A user can change the owner of a document if they are an owner of the document. A user can change the owner of a folder if they are an owner of the folder. A user can be a member of an organization. How a user is added as a member to an organization is beyond the scope of the feature we picked to write down. A user can view a folder if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder. The resulting list is: Document parent can_share owner editor can_write can_view viewer can_change_owner Folder can_create_document owner can_create_folder can_view viewer parent Organization member Drive can_create_document owner can_create_folder info In OpenFGA, relations can only have alphanumeric characters, underscores and hyphens. We recommend using underscore (_) to separate words and removing prepositions. E.g.: \"can create a document\" can become \"can_create_document\" or \"create_document\" if you are into brevity. Using the OpenFGA Configuration Language we can enumerate the relations for each type: model schema 1.1 type user type document relations define parent: define owner: define editor: define viewer: define can_share: define can_view: define can_write: define can_change_owner: type folder relations define owner: define parent: define viewer: define can_create_folder: define can_create_document: define can_view: type organization relations define member: type drive relations define owner: define can_create_document: define can_create_folder: Caution You're now in the process of building a version you can use. The model above is not yet a valid authorization model accepted by OpenFGA.","s":"03. List Relations For Those Types","u":"/docs/modeling/getting-started","h":"#03-list-relations-for-those-types","p":413},{"i":426,"t":"We will use the OpenFGA Configuration Language to create a relation definition for each of the relations we identified. At this stage we will encode the answers to the question we asked at the beginning of the document:. Why could a user U, perform an action A on an object O? We are going to go over each type and each of its relations and create a definition for it. Type: Organization​ We recommend starting from objects that represent groups/containers of users. For features in most systems these are easy to define and help reason about the other types. Examples of type names for these are \"team\", \"group\", \"organization\", etc. Relation: Member​ The member relation is used to tell OpenFGA about the members of an organization. Important Relation names in OpenFGA are arbitrary strings. There are no reserved relation names. You can use \"member\" or \"part_of\" or anything else to refer to a user that is part of a team/organization. Remember \"How a user is added as a member to an organization is beyond the scope of this feature.\" For the purposes of this model the relation definition should be: type organization relations define member: [user, organization#member] Why? This relation definition states: That organizations have members That the members of an organization with id {id} are all users described by tuples of the form: { user: {user-id}, relation: \"member\", object: \"organization:{id}\" } Important Relation definitions of the form “define {relation}: [user, organization#member]\" are fairly common. They are used to express that relationships \"to the object with that relation\" (e.g. \"users\" of type user or \"member of organization\") can be assigned by your system and that only the users that have that relation are those with a direct relationship. You can read more about group membership and types in Modeling User Groups. For the direct relationships, we need to figure out the object types that makes sense for the relationship tuples' user. In our organization example, it makes sense for member relations to have user of type user organization#member (i.e., other organization's member) However, it will not make sense for organization member's user to be of type document, folder or drive. We will specify this logic as part of directly directly related user type. Side note This also automatically supports nested organizational membership if you want such a feature in your system. You could use relationship tuples like the following one to express that \"members of organization A are members of organization B\": { user: \"organization:A#member\", relation: \"member\", object: \"organization:B\"} If you want to learn more, you can read further about this in Modeling User Groups and Managing Relationships Between Objects. Complete Type Definition​ The complete type definition for the organization type is: type organization relations define member: [user, organization#member] Type: Document​ After defining your \"group\" like types, continue with the most important type for the feature: the one that allows the main use case. In this case \"document\", since the main use case for users is to create, write, read and collaborate on documents. Defining relations for the main type lets you to focus on your core use case, and will likely make other type definitions easier. Relation: Owner​ The owner relation is used to tell OpenFGA which users are owners of the document. Important In the current version, there is no way to state that there is only one owner in the authorization model. The application must limit this set of users to just one owner if that is a requirement. When a document is created, a relationship tuple will be stored in OpenFGA representing this relationship between owner and document. This is an example of a user to object relationship. The relation definition then should be: type document relations define owner: [user, organization#member] Why? This relation definition states that: each document can have one or more owners owners of a document are assignable by creating a tuple of the format { user: \"{user_id}\", relation: \"owner\", object: \"document:{id}\" } for individual users Relation: Editor​ The editor relation is used to tell OpenFGA which users are editors of the document. When a user shares a document with another user or set of users as editor, a relationship tuple will be stored in OpenFGA representing this relationship between editor and document. This is an example of a users to object relationship. The relation definition then should be: type document relations define editor: [user, organization#member] Why? This relation definition states that: each document can have editors the editor(s) of a document are assignable by creating a tuple with shape { user: \"{user_id}\", relation: \"editor\", object: \"document:{id}\" } for individual users This also supports making all members in an organization editors of the document, through a group to object relationship. A relationship tuple like the following one states that the members of organization A are editors of document 0001. [ { \"user\": \"organization:A#member\", \"relation\": \"editor\", \"object\": \"document:0001\", }, ] You can learn more about this in Modeling User Groups. Relation: Viewer​ The viewer relation is similar to the document's editor relation. It will be defined like this: type document relations define viewer: [user, organization#member] Relation: Parent​ The parent relation is used to tell OpenFGA which folder or drive is the parent of the document. Important Relation names in OpenFGA are arbitrary strings. There are no reserved relation names. You can use \"parent\", \"container\" or \"ancestor\" to refer to a \"parent folder\". This relation is different from the others we have seen so far, as it is a relation between two objects (a folder and or drive that is the parent of the document). This is known as an object to object relationship, of which parent-child is a particular case. When a document is created a relationship tuple will be stored in OpenFGA to represent this relationship between parent and document. The relation definition then should be: type document relations define parent: [folder, drive] Why? This relation definition states that: documents may have a parent the parent(s) of a document with id {id} is either a folder or a drive, described by one of these relationship tuples: { user: \"folder:{id}\", relation: \"parent\", object: \"document:{id}\" } { user: \"drive:{id}\", relation: \"parent\", object: \"document:{id}\" } We can use direct type restriction to ensure a document's parent can only be an object of type either drive or folder. Side note You might have noticed that the \"user\" in the tuple is an object. This is a special syntax OpenFGA accepts in the \"user\" parameter to write object to object relationships. You can read more about writing data to manage object to object relationships in Managing Relationships Between Objects. Relation: can_share​ We need to express the following in the relation definition: A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder that is the parent of the document. We can achieve that with the following definition using OpenFGA Configuration Language: type undefined There are a few key things here: We don't use a direct relationship type restriction as part of the definition. can_share is a common example of representing a permission that is defined in terms of other relations but is not directly assignable by the system. The relation definition contains a union operator separating a list of relations that the user must have with the object in order to \"be able to share the document\". It is any of: Being an owner of the document Being an editor of the document Being an owner of the parent of the document. Whether the parent is a drive or a folder is not important, as they both have an owner relation. You can read more about the aforementioned items in Modeling Roles and Permissions. Relation: can_view​ We need to express the following in the relation definition: A user can view a document if they are an owner, viewer or editor of a document or if they are a viewer, owner of the folder/drive that is the parent of the document. Similar to the can_share relation, we can achieve that with the following definition using OpenFGA Configuration Language: type undefined Relation: can_write​ We need to express the following in the relation definition: A user can write a document if they are an owner or editor of a document or if they are an owner or editor of the folder/drive that is the parent of the document. Similar to the can_share relation, we can achieve that with the following definition using OpenFGA Configuration Language: type undefined Relation: can_change_owner​ We need to express the following in the relation definition: A user can change the owner of a document if they are an owner of the document. Similar to the can_share relation, we can achieve that with the following definition using OpenFGA Configuration Language: type undefined Complete Type Definition​ The complete type definition for the document type is: model schema 1.1 type document relations define owner: [user, organization#member] define editor: [user, organization#member] define viewer: [user, organization#member] define parent: [folder] define can_share: owner or editor or owner from parent define can_view: viewer or editor or owner or viewer from parent or editor from parent or owner from parent define can_write: editor or owner or owner from parent define can_change_owner: owner Combining the type definitions for document and organization, we have model schema 1.1 type user type organization relations define member: [user, organization#member] type document relations define owner: [user, organization#member] define editor: [user, organization#member] define viewer: [user, organization#member] define parent: [folder] define can_share: owner or editor or owner from parent define can_view: viewer or editor or owner or viewer from parent or editor from parent or owner from parent define can_write: editor or owner or owner from parent define can_change_owner: owner note The OpenFGA authorization model API and SDK only accepts JSON in its input. To convert from DSL to JSON, you may use the FGA CLI to run fga model transform.","s":"04. Define Relations","u":"/docs/modeling/getting-started","h":"#04-define-relations","p":413},{"i":428,"t":"Once you have defined your group like types and the most important type for your feature you want to ensure everything is working as expected. This means testing the model. How? Remember from the introduction that OpenFGA's main job is to answer the question: Can user U, perform an action A on an object O? The OpenFGA service does that by checking if a user has a particular relationship to an object, based on your authorization model and relationship tuples. General Authorization Check \"Can user U perform action A on object O?\" OpenFGA (ReBAC) Authorization Check \"Can user U have relation R with object O?\" What we want is to ensure that given our current authorization model and some sample relationship tuples, we get the expected results for those questions. So we'll write some relationship tuples and assertions. An OpenFGA assertion takes one of these forms: user U has relation R with object O user U does not have relation R with object O Much like automated tests and assertions work for programming languages, you can use assertions to prevent regressions while you change your tuples and authorization model. Essentially, assertions help you ensure things work like you expect them to work as you iterate. Write Relationship Tuples​ The relationship tuples should represent real examples from your system with fake data. At this point you haven't defined the drive or folder types, so you can only test things based on users or organization members' relationships to documents. Let's imagine an example setup and write the relationship tuples for it: System Action Relationship Tuple Anne is a member of the contoso organization { user:\"user:anne\", relation: \"member\", object: \"organization:contoso\"} Beth is a member of fabrikam organization { user:\"user:beth\", relation: \"member\", object: \"organization:fabrikam\"} Anne creates document:1, becomes its owner. { user:\"user:anne\", relation: \"owner\", object: \"document:1\"} Anne shares document:1 with all members of the fabrikam organization as editor. { user:\"organization:fabrikam#member\", relation: \"editor\", object: \"document:1\"} Beth creates document:2 and becomes its owner. { user:\"user:beth\", relation: \"owner\", object: \"document:2\"} Beth shares document:2 with all members of the contoso organization as viewer { user:\"organization:contoso#member\", relation: \"viewer\", object: \"document:2\"} Follow these steps to create relationship tuples. Create Assertions​ According to our written down model and the relationship tuples from the previous step, these assertions should be specified: Because anne is the owner of document:1: user anne has relation can_share with document:1 user anne has relation can_write with document:1 user anne has relation can_view with document:1 user anne has relation can_change_owner with document:1 Because beth is a member of organization:fabrikam and members of organization:fabrikam are writer of document:1: user beth does not have relation can_share with document:1 user beth has relation can_write with document:1 user beth has relation can_view with document:1 user beth does not have relation can_change_owner with document:1 Because beth is the owner of document:2: user beth has relation can_share with document:2 user beth has relation can_write with document:2 user beth has relation can_view with document:2 user beth has relation can_change_owner with document:2 Because anne is a member of organization:contoso and members of organization:contoso are viewer of document:2: user anne does not have relation can_share with document:2 user anne does not have relation can_write with document:2 user anne has relation can_view with document:2 user anne does not have relation can_change_owner with document:2 Follow these steps to create assertions. Run Assertions​ Run the assertions. They should all pass. If they don't you can use the query view to understand what is causing them to fail, and then update your authorization model and relation tuples accordingly. Once all the assertions are working, you should continue the iterative process of working on your model.","s":"05. Test The Model","u":"/docs/modeling/getting-started","h":"#05-test-the-model","p":413},{"i":430,"t":"We'll leave the exercise of defining the drive and folder relations, then adding relationship tuples and assertions to you. Once you are finished, check out the complete example to see how you did. When defining the authorization model for your own system, you would continue iterating on the authorization model with the next feature and so on. If you have any questions about this model or others, or would like some help creating your model, drop by our Discord.","s":"06. Iterate","u":"/docs/modeling/getting-started","h":"#06-iterate","p":413},{"i":432,"t":"Check the following sections for more on how to model with OpenFGA. OpenFGA Concepts Learn about the OpenFGA Concepts. More Configuration Language Learn about OpenFGA Configuration Language. More Direct Access Learn about modeling user access to an object. More","s":"Related Sections","u":"/docs/modeling/getting-started","h":"#related-sections","p":413},{"i":434,"t":"This section has guides that focus on migrating models and relations. When to use The content in this section is useful: If you want to introduce changes to your existing authorization model or upgrade it to the new schema version.","s":"Migrating","u":"/docs/modeling/migrating","h":"","p":433},{"i":436,"t":"Migrating Relations Learn to migrate relations in a production environment. Click to navigate Migrating To Schema 1.1 Learn to migrate models to schema 1.1. Click to navigate","s":"Content","u":"/docs/modeling/migrating","h":"","p":433},{"i":438,"t":"In this guide you will learn how to grant a user access to an object (such as a certain document) in OpenFGA. When to use Granting access with relationship tuple is a core part of OpenFGA. Without them, any checks will fail. You should use: authorization model to represent what relations are possible between the users and objects in the system relationship tuples to represent the facts about the relationships between users and objects in your system.","s":"Direct Access","u":"/docs/modeling/direct-access","h":"","p":437},{"i":440,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have a type called document that can have a viewer and/or an editor. DSL JSON model schema 1.1 type user type document relations define viewer: [user] define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before you start","u":"/docs/modeling/direct-access","h":"#before-you-start","p":437},{"i":442,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/modeling/direct-access","h":"#-concepts","p":437},{"i":444,"t":"For our applications to understand that user x has access to document y, we need to provide OpenFGA that information through relationship tuples. Each relationship tuple has three basic parameters, a user, a relation and an object.","s":"Step By Step","u":"/docs/modeling/direct-access","h":"#step-by-step","p":437},{"i":446,"t":"Let us add a relationship tuple to indicate that bob who is an editor of document:meeting_notes.doc. This is represented by adding the following: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:bob', relation: 'editor', object: 'document:meeting_notes.doc'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"editor\"), Object: openfga.PtrString(\"document:meeting_notes.doc\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:bob\", Relation = \"editor\", Object = \"document:meeting_notes.doc\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:bob\", relation=\"editor\", object=\"document:meeting_notes.doc\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:bob\",\"relation\":\"editor\",\"object\":\"document:meeting_notes.doc\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob editor document:meeting_notes.doc write([ { \"user\":\"user:bob\", \"relation\":\"editor\", \"object\":\"document:meeting_notes.doc\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"01. Create A Relationship Tuple","u":"/docs/modeling/direct-access","h":"#01-create-a-relationship-tuple","p":437},{"i":448,"t":"Once that relationship tuple is added to OpenFGA, we can check if the relationship is valid by asking the following: \"is bob an editor of document:meeting_notes.doc?\" Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'editor', object: 'document:meeting_notes.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"editor\", Object: \"document:meeting_notes.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"editor\", Object = \"document:meeting_notes.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"editor\", object=\"document:meeting_notes.doc\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob editor document:meeting_notes.doc # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"editor\",\"object\":\"document:meeting_notes.doc\"}}' # Response: {\"allowed\":true} check( user = \"user:bob\", // check if the user `user:bob` relation = \"editor\", // has an `editor` relation object = \"document:meeting_notes.doc\", // with the object `document:meeting_notes.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true If we were to check the following: \"is bob a viewer of document:meeting_notes.doc?\" it would return false since that relationship tuple does not exist within OpenFGA yet. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'viewer', object: 'document:meeting_notes.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"viewer\", Object: \"document:meeting_notes.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"viewer\", Object = \"document:meeting_notes.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"viewer\", object=\"document:meeting_notes.doc\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob viewer document:meeting_notes.doc # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"viewer\",\"object\":\"document:meeting_notes.doc\"}}' # Response: {\"allowed\":false} check( user = \"user:bob\", // check if the user `user:bob` relation = \"viewer\", // has an `viewer` relation object = \"document:meeting_notes.doc\", // with the object `document:meeting_notes.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false caution Note: When creating relationship tuples for OpenFGA make sure to use unique ids for each object and user within your application domain. We're using first names and simple ids to just illustrate an easy-to-follow example.","s":"02. Check That The Relationship Exists","u":"/docs/modeling/direct-access","h":"#02-check-that-the-relationship-exists","p":437},{"i":450,"t":"Check the following sections for more on how to model with OpenFGA. OpenFGA Concepts Learn about the OpenFGA Concepts. More Modeling: Getting Started Learn about how to get started with modeling. More Configuration Language Learn about OpenFGA Configuration Language. More","s":"Related Sections","u":"/docs/modeling/direct-access","h":"#related-sections","p":437},{"i":452,"t":"info The model schema v1.0 has been deprecated. Migrate to schema v1.1 in order to be able to write tuples and run queries on your store. A new DSL schema version has been introduced with several changes that we believe will make models easier to read and write, enable better tuple and model validations, and provide more options for optimizing the performance of different OpenFGA APIs. In short, we will be: Adding model schema version field Adding type restrictions and removing need to specify as self Disallowing string literals in user_ids Enforcing type restrictions Requiring you to specify for which relations you can write tuples with public access Changes in query evaluation behavior with type restrictions To facilitate migration to the new DSL schema, you will need to update tuples that are no longer valid. In particular, all tuples whose user field involves a wildcard character (* or user:*) defined with model schema 1.0 MUST be deleted and re-added back. info Before starting to migrate to the new model schema, it is recommended that you obtain your current authorization model ID and ensure that all your check, write, expand and list object are performed against that model id. This allows consistent behavior in your production system until you are ready to switch to the new model.","s":"Migrating Models To Schema 1.1","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"","p":451},{"i":454,"t":"Since the changes in the DSL are significant, we have decided to add a schema version to the DSL. The previous version of the DSL’s schema was 1.0, and the new schema version will be 1.1. To use the new syntax please add the following to the top of the model: model schema 1.1 info OpenFGA will eventually stop supporting schema version 1.0. Notifications will be posted in GitHub, Discord and Twitter before this change occurs.","s":"OpenFGA Model Schema Versions","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#-model-schema-versions","p":451},{"i":456,"t":"We’ll use the following version 1.0 model and tuples to illustrate the changes we’ll need to make: model schema 1.0 type user type group relations define member as self type folder relations define parent as self define viewer as self or viewer from parent type document relations define parent as self define viewer as self define can_read as viewer or viewer from parent [ // Bob is a member of the Sales group { \"user\": \"user:bob\", \"relation\": \"member\", \"object\": \"group:sales\", }, // The \"pricing\" document is in \"sales\" folder { \"user\": \"folder:sales\", \"relation\": \"parent\", \"object\": \"document:pricing\", }, // Members of the \"sales\" team can view the \"sales\" folder { \"user\": \"group:sales#member\", \"relation\": \"viewer\", \"object\": \"folder:sales\", }, // John can view the \"pricing\" document { \"user\": \"user:john\", \"relation\": \"viewer\", \"object\": \"document:pricing\", }, ] Those tuples match the intent of how the model was designed, but without type restrictions we can also write tuples that would not. For example, we can say that a document is a member of the sales group: [ // The \"pricing\" document is a member of the \"sales\" group { \"user\": \"document:pricing\", \"relation\": \"member\", \"object\": \"group:sales\", }, ] To be able to better validate tuples and make the model more readable, version 1.1 requires you to specify types for all the relations that were previously assignable (e.g. relations defined as self in any way), and it removes the as self keyword. The model above needs to be rewritten as: DSL JSON model schema 1.1 type user type group relations define member: [user] type folder relations define parent: [folder] define viewer: [user] or viewer from parent type document relations define parent: [folder] define viewer: [user] define can_read: viewer or viewer from parent { \"mode\": { \"schema_version\": \"1.1\" }, \"type_definitions\": [ { \"type\": \"user\", \"relations\": {} }, { \"type\": \"group\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"folder\", \"relations\": { \"parent\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"parent\": { \"this\": {} }, \"viewer\": { \"this\": {} }, \"can_read\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"can_read\": { \"directly_related_user_types\": [] } } } } ], \"schema_version\": \"1.1\" } After making these changes, OpenFGA will start validating the tuples more strictly, for example, you won’t be able to assign a document as a member of a group. If your application is writing invalid tuples, you’ll start getting errors when invoking the Write API.","s":"Type Restrictions & Removing as self","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#type-restrictions--removing-as-self","p":451},{"i":458,"t":"With version 1.0 models, you could write a tuple where the user id did not specify a type, for example: [ // \"bob\" is a member of the \"sales\" group { \"user\": \"bob\", \"relation\": \"member\", \"object\": \"group:sales\", }, ] However, with version 1.1 you always need to specify an object, so “bob’” is no longer a valid identifier. If you don’t have a type in your model that defines relations for users, you can add a ‘user’ type with no relations to your model, for example: DSL JSON model schema 1.1 type user { \"type_definitions\": [ { \"type\": \"user\", \"relations\": {} } ] } You can then use that type when writing tuples: [ // \"user:bob\" is a member of the \"sales\" group { \"user\": \"user:bob\", \"relation\": \"member\", \"object\": \"group:sales\", }, ]","s":"Disallowing String Literals in user_ids","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#disallowing-string-literals-in-user_ids","p":451},{"i":460,"t":"With the model above, the following tuples will be valid according to the type definitions: [ { \"user\": \"user:bob\", \"relation\": \"member\", \"object\": \"group:sales\", }, { \"user\": \"folder:sales\", \"relation\": \"parent\", \"object\": \"document:pricing\", }, { \"user\": \"user:john\", \"relation\": \"viewer\", \"object\": \"document:pricing\", }, ] However, the one below will not be valid, as we can’t assign group:sales#member to the viewer relationship of a folder. [ { \"user\": \"group:sales#member\", \"relation\": \"viewer\", \"object\": \"folder:sales\", }, ] You might think that given group:sales#member are actually users, you should still be able to assign it. OpenFGA calls expressions like group:sales#member \"usersets\", and with our model we can only assign users. The issue is that there are a lot of other usersets that you don't want to be assigned as viewers of a folder. For example, you would not want to add document:pricing#viewer as viewers of the folder as conceptually it does not make sense to say “every viewer of this document should be a viewer of this folder”. To allow these tuples to be written, you need to specify group#member as a valid type for the folder’s viewer relationship. You would want to do the same with the document’s viewer relationship if you want to define that the members of a group can be viewers of a document: DSL JSON model schema 1.1 type user type group relations define member: [user] type folder relations define parent: [folder] define viewer: [user, group#member] or viewer from parent type document relations define parent: [folder] define viewer: [user, group#member] define can_read: viewer or viewer from parent { \"type_definitions\": [ { \"type\": \"user\", \"relations\": {} }, { \"type\": \"group\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"folder\", \"relations\": { \"parent\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"group\", \"relation\": \"member\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"parent\": { \"this\": {} }, \"viewer\": { \"this\": {} }, \"can_read\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"group\", \"relation\": \"member\" } ] }, \"can_read\": { \"directly_related_user_types\": [] } } } } ], \"schema_version\": \"1.1\" } You can identify which usersets you need to add by looking at tuples in your store that have the following structure: [ // Members of the \"sales\" group are viewers of the \"sales\" folder { \"user\": \"group:sales#member\", \"relation\": \"viewer\", \"object\": \"folder:sales\", }, ] If you find a tuple like that, you’ll need to add group#member in the list of types allowed in the viewer relation of the folder type.","s":"Enforcing Type Restrictions","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#enforcing-type-restrictions","p":451},{"i":462,"t":"When using version 1.0, you can indicate public access to specific objects by specifying a wildcard user in a relationship to any object, e.g.: [ // All users are viewers of the \"pricing\" document { \"user\": \"*\", \"relation\": \"viewer\", \"object\": \"document:pricing\", }, ] When you write the tuple above, all users are granted the “viewer” relationship for the “pricing\" document. You can write those kinds of tuples for any relation that is directly assignable in the model. In version 1.1 we want to be more explicit about the tuples you can write, so you’ll need to declare in the DSL which relations allow wildcards and for which object types. If we want to let any object of type “user” to be a viewer of a specific document, we’ll need to explicitly define it. DSL JSON model schema 1.1 type user type document relations define viewer: [user, user:*] { \"type_definitions\": [ { \"type\": \"user\", \"relations\": {} }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user\", \"wildcard\": {} } ] } } } } ], \"schema_version\": \"1.1\" } You’ll need to specify user:* as the user value in the tuple to enable this: [ // All objects of type \"user\" are viewers of the \"pricing\" document { \"user\": \"user:*\", \"relation\": \"viewer\", \"object\": \"document:pricing\", }, ] Being explicit about the wildcard type restrictions also lets you model scenarios like “all employees can see this document, but not all external users”, “all user accounts can access this document, but not service/machine-to-machine accounts”. This change implies that you’ll need to change your code to write tuples with this new syntax, and that you’ll need to migrate existing tuples to use the new format. You might have 3 kinds of tuples in your model that use *, with different migration strategies: Tuples that have user = * You would need to retrieve those tuples and write them using the proper type (e.g. user:*). To retrieve them, you’ll need to use the Read endpoint, filter on your side the tuples that have user = “*”, and call the Write API for each one, with the proper type, e.g: [ // All objects of type \"user\" are viewers of the \"pricing\" document { \"user\": \"user:*\", \"relation\": \"viewer\", \"object\": \"document:pricing\", }, ] Tuples that have user = employee:*, where employee is NOT a type that is defined in the new iteration of your model. If you have tuples with this format, they will be considered invalid because they don’t have a corresponding type in the model. If you need such a type defined, you’ll need to add it to the model, and the scenario will be similar to the one described below. Tuples that have user = user:*, which would mean the user with user_id = *, where user is type that is defined in the new iteration of your model. In this case, the meaning of the tuple will change. If you were intending to specify a user with user id = *, you will need to encode it in a different way instead of using *. If you intended to specify public access to the object (e.g. \"every user has this relationship with this object\"), 1.0 models will not interpret the user:* value as a wildcard but 1.1 models will. Warning If you have any wildcard tuples (i.e., * or user:*) that were created with model schema 1.0, you must delete and re-add these tuples with the appropriate type. This allows OpenFGA to interpret these tuples appropriately with the model schema 1.1 semantics. Failure to delete and re-add may cause OpenFGA to interpret these tuples incorrectly.","s":"Public Access","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#public-access","p":451},{"i":464,"t":"It is possible to introduce new models and have existing tuples (from prior models) with incompatibilities with the new model. Some cases where this can happen include: If you rename/delete a type. If you rename/delete a relation. If you remove a type restriction from the list of type restrictions for a relation, including changes for public access. If OpenFGA introduces a change that makes a tuple invalid. In these cases, OpenFGA will not consider those invalid tuples when evaluating queries (Check, Expand, List-objects, etc). However, after any of the changes above happen, you should delete those tuples as having a large number of invalid tuples will negatively affect performance.","s":"Query Evaluation Behavior with Type Restrictions","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#query-evaluation-behavior-with-type-restrictions","p":451},{"i":466,"t":"Type restrictions allow OpenFGA to validate the schema better at the time of writing the schema instead of at the time of query evaluation. In OpenFGA, when referencing relations on related objects the relation tying the related objects (the word after from, also called the tupleset) cannot be evaluated - that means it cannot be referencing another relation, or allow non-concrete types (type bound public access (:*) or usersets (#)) in its type restrictions. In schema 1.0, because type restrictions were not available, the validation error would occur at the time of evaluation (e.g. a Check call), while in schema 1.1, the error will be thrown when writing the model (during the WriteAuthorizationModel request). In the case below, the write request will fail in the new schema 1.1 version, but would have succeeded in schema version 1.0: model schema 1.1 type user type folder relations define parent: [folder,folder#parent] define editor: [user] or editor from parent /> In schema 1.0, the WriteAuthorizationModel would have succeeded, but when attempting to write a tuple such as the one below, you would have received an error: Node.js Go .NET Python curl CLI Pseudocode await fgaClient.write({ writes: [ { user: 'folder:product#parent', relation: 'parent', object: 'folder:planning'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"folder:product#parent\"), Relation: openfga.PtrString(\"parent\"), Object: openfga.PtrString(\"folder:planning\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"folder:product#parent\", Relation = \"parent\", Object = \"folder:planning\" } }, }; var response = await fgaClient.Write(body, options); options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"folder:product#parent\", relation=\"parent\", object=\"folder:planning\", ),, ), \", ) response = await fga_client.write(body, options) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"folder:product#parent\",\"relation\":\"parent\",\"object\":\"folder:planning\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw folder:product#parent parent folder:planning write([ { \"user\":\"folder:product#parent\", \"relation\":\"parent\", \"object\":\"folder:planning\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"Improved Schema Validation","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#improved-schema-validation","p":451},{"i":468,"t":"1- February 13th 2023: Deprecation Notice This deprecation notice is posted. 2- March 15th 2023: Disallow writing and evaluating new 1.0 models with OpenFGA version 0.4.0 The API will no longer accept writing new 1.0 models (affects WriteAuthorizationModel) unless the OPENFGA_ALLOW_WRITING_1_0_MODELS flag is used to override the setting. Note: reading those earlier models and their assertions will keep working. Evaluation requests (Check, Expand, ListObjects), WriteAssertions and Write against 1.0 models will, by default, no longer be accepted unless the OPENFGA_ALLOW_EVALUATING_1_0_MODELS flag is used to override the setting. ReadAuthorizationModel, ReadAuthorizationModels and ReadAssertions will continue to serve results for 1.0 and 1.1 models. 3- March 31st 2023: Default model version in Syntax Transformer, Playground and Docs switch to 1.1 The model schema version will be required in all new authorization models, and new authorization models without the version will be rejected. model schema 1.1 4- May 15th 2023: Code Removed with OpenFGA version 0.5.0 OPENFGA_ALLOW_WRITING_1_0_MODELS and OPENFGA_ALLOW_EVALUATING_1_0_MODELS flags removed The code relating to branching and evaluating 1.0 models will be removed except for ReadAuthorizationModel, ReadAuthorizationModels and ReadAssertions.","s":"Deprecation Timeline","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#deprecation-timeline","p":451},{"i":470,"t":"Review the following sections for more information on migrating tuples. Migrating Relations Learn how to migrate relations More Production Best Practices Learn the best practices of running OpenFGA in a production environment More","s":"Related Sections","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#related-sections","p":451},{"i":472,"t":"In this guide we are going to model system that requires multiple authorizations before allowing users to perform actions on particular objects using OpenFGA. For example, users are allowed to delete a document if both of these conditions are met: they are a member of the organization that owns the document they have writer permissions on the document In this way, we prevent other users from deleting such document. When to use This is useful when: Limiting certain actions (such as deleting or reading sensitive document) to privileged users. Adding restrictions and requiring multiple authorization paths before granting access.","s":"Multiple Restrictions","u":"/docs/modeling/multiple-restrictions","h":"","p":471},{"i":474,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. You will start with the authorization model below, it represents a document type that can have users related as writer and organizations related as owner. Document's can_write relation is based on whether user is a writer to the document. The organization type can have users related as member. Let us also assume that we have: A document called \"planning\" owned by the ABC organization. Becky is a member of the ABC organization. Carl is a member of the XYZ organization. Becky and Carl both have writer access to the \"planning\" document. DSL JSON model schema 1.1 type user type document relations define owner: [organization] define writer: [user] define can_write: writer type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"can_write\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The current state of the system is represented by the following relationship tuples being in the system already: [ // organization ABC is the owner of planning document { \"user\": \"organization:ABC\", \"relation\": \"owner\", \"object\": \"document:planning\", }, // Becky is a writer to the planning document { \"user\": \"user:becky\", \"relation\": \"writer\", \"object\": \"document:planning\", }, // Carl is a writer to the planning document { \"user\": \"user:carl\", \"relation\": \"writer\", \"object\": \"document:planning\", }, // Becky is a member of the organization ABC { \"user\": \"user:becky\", \"relation\": \"member\", \"object\": \"organization:ABC\", }, // Carl is a member of the organization XYZ { \"user\": \"user:carl\", \"relation\": \"member\", \"object\": \"organization:XYZ\", }, ] info Note that we assign the organization, not the organization's members, as owner to the planning document. In addition, you will need to know the following: Modeling Parent-Child Objects​ You need to know how to model access based on parent-child relationships, e.g.: folders and documents. Learn more → Modeling Roles And Permissions​ You need to know how to model roles for users at the object level and model permissions for those roles. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Intersection Operator: the intersection operator can be used to indicate a relationship exists if the user is in all the sets of users","s":"Before You Start","u":"/docs/modeling/multiple-restrictions","h":"#before-you-start","p":471},{"i":476,"t":"You need to know how to model access based on parent-child relationships, e.g.: folders and documents. Learn more →","s":"Modeling Parent-Child Objects","u":"/docs/modeling/multiple-restrictions","h":"#modeling-parent-child-objects","p":471},{"i":478,"t":"You need to know how to model roles for users at the object level and model permissions for those roles. Learn more →","s":"Modeling Roles And Permissions","u":"/docs/modeling/multiple-restrictions","h":"#modeling-roles-and-permissions","p":471},{"i":480,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Intersection Operator: the intersection operator can be used to indicate a relationship exists if the user is in all the sets of users","s":"OpenFGA Concepts","u":"/docs/modeling/multiple-restrictions","h":"#-concepts","p":471},{"i":482,"t":"With the above authorization model and relationship tuples, OpenFGA will correctly respond with {\"allowed\":true} when checkis called to see if Carl and Becky can write this document. We can verify that by issuing two check requests: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'can_write', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"can_write\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"can_write\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"can_write\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky can_write document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"can_write\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:becky\", // check if the user `user:becky` relation = \"can_write\", // has an `can_write` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:carl', relation: 'can_write', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:carl\", Relation: \"can_write\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:carl\", Relation = \"can_write\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:carl\", relation=\"can_write\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl can_write document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:carl\",\"relation\":\"can_write\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:carl\", // check if the user `user:carl` relation = \"can_write\", // has an `can_write` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true What we would like to do is offer a way so that a document can be written by Becky and Carl, but only writers who are also members of the organization that owns the document can remove it. To do this, we need to: Add can_delete relation to only allow writers that are members of the ownership organization Verify that our solutions work","s":"Step By Step","u":"/docs/modeling/multiple-restrictions","h":"#step-by-step","p":471},{"i":484,"t":"The first step is to add the relation definition for can_delete so that it requires users to be both writer and member of the owner. This is accomplished via the keyword and. DSL JSON model schema 1.1 type user type document relations define owner: [organization] define writer: [user] define can_write: writer define can_delete: writer and member from owner type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"can_write\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, \"can_delete\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"owner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"member\" } } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"01. Add can_delete Relation To Only Allow Writers That Are Members Of The Ownership Organization","u":"/docs/modeling/multiple-restrictions","h":"#01-add-can_delete-relation-to-only-allow-writers-that-are-members-of-the-ownership-organization","p":471},{"i":486,"t":"To verify that our solutions work, we need to check that Becky can delete the planning document because she is a writer AND she is a member of organization:ABC that owns the planning document. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'can_delete', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"can_delete\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"can_delete\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"can_delete\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky can_delete document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"can_delete\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:becky\", // check if the user `user:becky` relation = \"can_delete\", // has an `can_delete` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true However, Carl cannot delete the planning document because although he is a writer, Carl is not a member of organization:ABC that owns the planning document. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:carl', relation: 'can_delete', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:carl\", Relation: \"can_delete\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:carl\", Relation = \"can_delete\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:carl\", relation=\"can_delete\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl can_delete document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:carl\",\"relation\":\"can_delete\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:carl\", // check if the user `user:carl` relation = \"can_delete\", // has an `can_delete` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"02. Verify That Our Solutions Work","u":"/docs/modeling/multiple-restrictions","h":"#02-verify-that-our-solutions-work","p":471},{"i":488,"t":"Check the following sections for more on how to model privileged access. Modeling: User Groups Learn about how to add group members. More Modeling: Blocklists Learn about how to set block lists. More Modeling: Public Access Learn about model public access. More","s":"Related Sections","u":"/docs/modeling/multiple-restrictions","h":"#related-sections","p":471},{"i":490,"t":"In this guide you will learn how to indicate relationships between objects, and how users' relationships to one object can affect their relationship with another. For example: how a editor of a folder can be an editor of all documents the folder is a parent of. When to use Object-to-Object relationships, combined with a configured authorization model can be used to indicate that a user's relation with one object can influence their relationship with another object. This can also be used in some cases to remove the need to modify relations between objects using user groups. Object-to-object relationships can be used: To indicate that managers of an employee have access to approve requests the employee has made To indicate that users who have a repository admin role (repo_admin) in an organization automatically have admin access to all repositories in that organization To indicate that users who are subscribed to a plan, get access to all the features in that plan","s":"Parent-Child Objects","u":"/docs/modeling/parent-child","h":"","p":489},{"i":492,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have two types: folder that users can be related to as an editor document that users can be related to as an editor DSL JSON model schema 1.1 type user type folder relations define editor: [user] type document relations define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"folder\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Union Operator: the union operator can be used to indicate that the user has multiple ways of being related to an object","s":"Before You Start","u":"/docs/modeling/parent-child","h":"#before-you-start","p":489},{"i":494,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/modeling/parent-child","h":"#direct-access","p":489},{"i":496,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Union Operator: the union operator can be used to indicate that the user has multiple ways of being related to an object","s":"OpenFGA Concepts","u":"/docs/modeling/parent-child","h":"#-concepts","p":489},{"i":498,"t":"We would like to model folders that contain documents and that a user having editor access to the folder, has editor access to all documents in that folder. For editors of a folder to be editors of a containing document, we need to: Update the authorization model to allow a parent relationship between folder and document Update the editor relation in the document type definition to support cascading from folder and then to indicate and verify that bob is an editor of document:meeting_notes.doc because bob is an editor of folder:notes, we then need to: Create a new relationship tuple to indicate that bob is a editor of folder:notes Create a new relationship tuple to indicate that folder:notes is a parent of document:meeting_notes.doc Check to see if bob is an editor of document:meeting_notes.doc","s":"Step By Step","u":"/docs/modeling/parent-child","h":"#step-by-step","p":489},{"i":500,"t":"To allow a parent relation between a folder and a document, we need to update the authorization model to be the following (this is to allow creating relationship tuples that can indicate a relationship between folder and document. Refer to Modeling Concepts: Object to Object Relationships to understand why): DSL JSON model schema 1.1 type user type folder relations define editor: [user] type document relations define parent: [folder] define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"folder\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"parent\": { \"this\": {} }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Notice that the document type now has a parent relation, indicating that other objects can be parents of documents","s":"01. Update The Authorization Model To Allow A Parent Relationship Between Folder And Document","u":"/docs/modeling/parent-child","h":"#01-update-the-authorization-model-to-allow-a-parent-relationship-between-folder-and-document","p":489},{"i":502,"t":"To allow cascading relations between folder and document, we can update our authorization model as the following: DSL JSON model schema 1.1 type user type folder relations define editor: [user] type document relations define parent: [folder] define editor: [user] or editor from parent { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"folder\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"parent\": { \"this\": {} }, \"editor\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"parent\" }, \"computedUserset\": { \"relation\": \"editor\" } } } ] } } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info editor of a document are any of: users that are directly assigned as editors users that are related to any parent of this document as editor (editors of the parent) So with this change, anyone related to a folder that is a parent of a document as an editor is also an editor of said document.","s":"02. Update The Editor Relation In The Document Type Definition To Support Cascading From Folder","u":"/docs/modeling/parent-child","h":"#02-update-the-editor-relation-in-the-document-type-definition-to-support-cascading-from-folder","p":489},{"i":504,"t":"To leverage our cascading relation, we need to create a relationship tuple that states: bob is an editor of folder:notes Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:bob', relation: 'editor', object: 'folder:notes'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"editor\"), Object: openfga.PtrString(\"folder:notes\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:bob\", Relation = \"editor\", Object = \"folder:notes\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:bob\", relation=\"editor\", object=\"folder:notes\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:bob\",\"relation\":\"editor\",\"object\":\"folder:notes\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob editor folder:notes write([ { \"user\":\"user:bob\", \"relation\":\"editor\", \"object\":\"folder:notes\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") caution Note: Make sure to use unique ids for each object and user within your application domain when creating relationship tuples for OpenFGA. We are using first names and simple ids to illustrate an easy-to-follow example.","s":"03. Create A New Relationship Tuple To Indicate That bob Is An Editor Of folder:notes","u":"/docs/modeling/parent-child","h":"#03-create-a-new-relationship-tuple-to-indicate-that-bob-is-an-editor-of-foldernotes","p":489},{"i":506,"t":"Now that bob is an editor of folder:notes, we need to indicate that folder:notes is a parent of document:meeting_notes.doc Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // the notes folder is a parent of the meeting notes document { user: 'folder:notes', relation: 'parent', object: 'document:meeting_notes.doc'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // the notes folder is a parent of the meeting notes document User: openfga.PtrString(\"folder:notes\"), Relation: openfga.PtrString(\"parent\"), Object: openfga.PtrString(\"document:meeting_notes.doc\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // the notes folder is a parent of the meeting notes document new() { User = \"folder:notes\", Relation = \"parent\", Object = \"document:meeting_notes.doc\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # the notes folder is a parent of the meeting notes document user=\"folder:notes\", relation=\"parent\", object=\"document:meeting_notes.doc\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"folder:notes\",\"relation\":\"parent\",\"object\":\"document:meeting_notes.doc\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw folder:notes parent document:meeting_notes.doc write([ // the notes folder is a parent of the meeting notes document { \"user\":\"folder:notes\", \"relation\":\"parent\", \"object\":\"document:meeting_notes.doc\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"04. Create A New Relationship Tuple To Indicate That folder:notes Is A Parent Of document:meeting_notes.doc","u":"/docs/modeling/parent-child","h":"#04-create-a-new-relationship-tuple-to-indicate-that-foldernotes-is-a-parent-of-documentmeeting_notesdoc","p":489},{"i":508,"t":"Now that we have done the changes to the authorization model and the addition of the two new relationship tuples, we can verify if our configuration is correct by running the following check: is bob an editor of document:meeting_notes.doc. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'editor', object: 'document:meeting_notes.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"editor\", Object: \"document:meeting_notes.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"editor\", Object = \"document:meeting_notes.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"editor\", object=\"document:meeting_notes.doc\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob editor document:meeting_notes.doc # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"editor\",\"object\":\"document:meeting_notes.doc\"}}' # Response: {\"allowed\":true} check( user = \"user:bob\", // check if the user `user:bob` relation = \"editor\", // has an `editor` relation object = \"document:meeting_notes.doc\", // with the object `document:meeting_notes.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Note: There are no other relationship tuples within the store that dictate any direct relation between bob and document:meeting_notes.doc. The check succeeds because of the cascading relation applied. The chain of resolution becomes: bob is an editor of folder:notes folder:notes is a parent of document:meeting_notes.doc editors of any parent folder of document:meeting_notes.doc are also editors of the document Therefore, bob is an editor of document:meeting_notes.doc caution Note that when searching tuples that are related to the object (the word after from, also called the tupleset), OpenFGA will not do any evaluation and will only consider concrete objects (of the form :) that were directly assigned, and will throw an error if it encounters any rewrites, or a *, a type bound public access (:*) or a userset (:#). See Referencing Relations on Related Objects for more.","s":"05. Check To See If bob Is An Editor Of document:meeting_notes.doc","u":"/docs/modeling/parent-child","h":"#05-check-to-see-if-bob-is-an-editor-of-documentmeeting_notesdoc","p":489},{"i":510,"t":"Check the following sections for more on how to model for parent and child objects. Modeling Concepts: Object to Object Relationships Learn about how to model object to object relationships in OpenFGA. More Modeling Google Drive See how to make folders parents of documents, and to make editors on the parent folders editors on documents inside them.. More Modeling GitHub See how to grant users access to all repositories owned by an organization. More","s":"Related Sections","u":"/docs/modeling/parent-child","h":"#related-sections","p":489},{"i":512,"t":"In this guide you will learn how to grant public access to an object, such as a certain document, using type bound public access. When to use Public access allows your application to grant every user in the system access to an object. You would add a relationship tuple with type-bound public access when: sharing a document publicly to indicate that everyone can view it a public poll is created to indicate that anyone can vote on it a blog post is published and anyone should be able to read it a video is made public for anyone to watch","s":"Public Access","u":"/docs/modeling/public-access","h":"","p":511},{"i":514,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have a type called document that can have a view relation. DSL JSON model schema 1.1 type user type document relations define view: [user, user:*] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"view\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"view\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user\", \"wildcard\": {} } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA A Type Bound Public Access: is a special OpenFGA concept (represented by :*) can be used in relationship tuples to represent every object of that type caution Make sure to use unique ids for each object and user within your application domain when creating relationship tuples for OpenFGA. We are using first names and simple ids to just illustrate an easy-to-follow example.","s":"Before You Start","u":"/docs/modeling/public-access","h":"#before-you-start","p":511},{"i":516,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/modeling/public-access","h":"#direct-access","p":511},{"i":518,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA A Type Bound Public Access: is a special OpenFGA concept (represented by :*) can be used in relationship tuples to represent every object of that type","s":"OpenFGA Concepts","u":"/docs/modeling/public-access","h":"#-concepts","p":511},{"i":520,"t":"In previous guides, we have shown how to indicate that objects are related to users or objects. In some cases, you might want to indicate that everyone is related to an object (for example when sharing a document publicly).","s":"Step By Step","u":"/docs/modeling/public-access","h":"#step-by-step","p":511},{"i":522,"t":"To do this we need to create a relationship tuple using the type bound public access. The type bound public access syntax is used to indicate that all users of a particular type have a relation to a specific object. Let us create a relationship tuple that states: any user can view document:company-psa.doc Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // user:* denotes every object of type user { user: 'user:*', relation: 'view', object: 'document:company-psa.doc'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // user:* denotes every object of type user User: openfga.PtrString(\"user:*\"), Relation: openfga.PtrString(\"view\"), Object: openfga.PtrString(\"document:company-psa.doc\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // user:* denotes every object of type user new() { User = \"user:*\", Relation = \"view\", Object = \"document:company-psa.doc\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # user:* denotes every object of type user user=\"user:*\", relation=\"view\", object=\"document:company-psa.doc\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:*\",\"relation\":\"view\",\"object\":\"document:company-psa.doc\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:* view document:company-psa.doc write([ // user:* denotes every object of type user { \"user\":\"user:*\", \"relation\":\"view\", \"object\":\"document:company-psa.doc\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Wildcard syntax usage Please note that type-bound public access is not a wildcard or a regex expression. You cannot use the :* syntax in the tuple's object field. The following syntax is invalid: [ // It is invalid to use this syntax in the object field. The below relationship tuple is invalid and does not mean that Bob can view all documents. { \"user\": \"user:bob\", \"relation\": \"view\", \"object\": \"document:*\", }, ] Wildcard syntax usage You cannot use :* as part of a userset in the tuple's user field. The following syntax is invalid: [ // It is invalid to use this syntax as part of a userset. The below relationship tuple is invalid and does not mean that members of any org can view the company-psa document. { \"user\": \"org:*#member\", \"relation\": \"view\", \"object\": \"document:company-psa.doc\", }, ]","s":"01. Create A Relationship Tuple","u":"/docs/modeling/public-access","h":"#01-create-a-relationship-tuple","p":511},{"i":524,"t":"Once the above relationship tuple is added, we can check if bob cab view document:company-psa.doc. OpenFGA will return { \"allowed\": true } even though no relationship tuple linking bob to the document was added. That is because the relationship tuple with user:* as the user made it so every object of type user (such as user:bob) can view the document, making it public. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'view', object: 'document:company-psa.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"view\", Object: \"document:company-psa.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"view\", Object = \"document:company-psa.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"view\", object=\"document:company-psa.doc\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob view document:company-psa.doc # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"view\",\"object\":\"document:company-psa.doc\"}}' # Response: {\"allowed\":true} check( user = \"user:bob\", // check if the user `user:bob` relation = \"view\", // has an `view` relation object = \"document:company-psa.doc\", // with the object `document:company-psa.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"02. Check That The Relationship Exists","u":"/docs/modeling/public-access","h":"#02-check-that-the-relationship-exists","p":511},{"i":526,"t":"Check the following sections for more on how to model with OpenFGA. Modeling: Getting Started Learn about how to get started with modeling. More Configuration Language Learn about OpenFGA Configuration Language. More Modeling Blocklists Learn about model block lists. More","s":"Related Sections","u":"/docs/modeling/public-access","h":"#related-sections","p":511},{"i":528,"t":"In this guide you will learn how to add users to groups and grant groups access to an object using OpenFGA. When to use Adding a relationship tuple specifying that a group has a relation to an object is helpful in cases where you want to encompass a set of users with the same relation to an object. For example: Grant a group of engineers viewer access to roadmap.doc Create a block_list of members who can't access a document Sharing a document with a team Granting viewer access to a photo to followers only Making a file viewable for all users within an organization Restricting access from or to users in a certain locale","s":"User Groups","u":"/docs/modeling/user-groups","h":"","p":527},{"i":530,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have an object called document that users can be related to as an editor. DSL JSON model schema 1.1 type user type document relations define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before you start","u":"/docs/modeling/user-groups","h":"#before-you-start","p":527},{"i":532,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/modeling/user-groups","h":"#direct-access","p":527},{"i":534,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/modeling/user-groups","h":"#-concepts","p":527},{"i":536,"t":"As we develop our application, we might encounter use cases where a group of users have a certain role or permission on an object. For example, members of a certain team might have an editor relation to a certain document. In order to represent this in OpenFGA, we need: Introduce the concept of a team to the authorization model Add users as members to the team Assign the team members a relation to an object Checking an individual member's access to the object","s":"Step By Step","u":"/docs/modeling/user-groups","h":"#step-by-step","p":527},{"i":538,"t":"We need to define the object team in our authorization model. In our use case, a team can have members, so we make the following changes to our authorization model: DSL JSON model schema 1.1 type user type document relations define editor: [team#member] type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"01. Introduce The Concept Of A Team To The Authorization Model","u":"/docs/modeling/user-groups","h":"#01-introduce-the-concept-of-a-team-to-the-authorization-model","p":527},{"i":540,"t":"We can now assign users as members of teams. Let's create a new relationship tuple that states alice is a member of team:writers. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:alice', relation: 'member', object: 'team:writers'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:alice\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"team:writers\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:alice\", Relation = \"member\", Object = \"team:writers\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:alice\", relation=\"member\", object=\"team:writers\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:alice\",\"relation\":\"member\",\"object\":\"team:writers\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice member team:writers write([ { \"user\":\"user:alice\", \"relation\":\"member\", \"object\":\"team:writers\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"02. Add Users As Members To The Team","u":"/docs/modeling/user-groups","h":"#02-add-users-as-members-to-the-team","p":527},{"i":542,"t":"To represent groups we use the type:object_id#relation format, which represents the set of users related to the type:object_id as a certain relation. For example, team:writers#members is used to represent the set of users related to the team:writers object as members. In order to assign members of a team a relation to a document, we can create the following relationship tuple that states that members of team:writers are editors of document:meeting_notes.doc. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Set of users related to 'team:writers' as 'member' { user: 'team:writers#member', relation: 'editor', object: 'document:meeting_notes.doc'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Set of users related to 'team:writers' as 'member' User: openfga.PtrString(\"team:writers#member\"), Relation: openfga.PtrString(\"editor\"), Object: openfga.PtrString(\"document:meeting_notes.doc\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Set of users related to 'team:writers' as 'member' new() { User = \"team:writers#member\", Relation = \"editor\", Object = \"document:meeting_notes.doc\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Set of users related to 'team:writers' as 'member' user=\"team:writers#member\", relation=\"editor\", object=\"document:meeting_notes.doc\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"team:writers#member\",\"relation\":\"editor\",\"object\":\"document:meeting_notes.doc\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw team:writers#member editor document:meeting_notes.doc write([ // Set of users related to 'team:writers' as 'member' { \"user\":\"team:writers#member\", \"relation\":\"editor\", \"object\":\"document:meeting_notes.doc\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"03. Assign The Team Members A Relation To An Object","u":"/docs/modeling/user-groups","h":"#03-assign-the-team-members-a-relation-to-an-object","p":527},{"i":544,"t":"Now that we have: a relationship tuple indicating that alice is an member of team:writers a relationship tuple indicating that members of team:writers are editors of document:meeting_notes.doc This means that if we *check*is alice an editor of document:meeting_notes.doc? We would get the following: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:alice', relation: 'editor', object: 'document:meeting_notes.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:alice\", Relation: \"editor\", Object: \"document:meeting_notes.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:alice\", Relation = \"editor\", Object = \"document:meeting_notes.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:alice\", relation=\"editor\", object=\"document:meeting_notes.doc\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice editor document:meeting_notes.doc # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:alice\",\"relation\":\"editor\",\"object\":\"document:meeting_notes.doc\"}}' # Response: {\"allowed\":true} check( user = \"user:alice\", // check if the user `user:alice` relation = \"editor\", // has an `editor` relation object = \"document:meeting_notes.doc\", // with the object `document:meeting_notes.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true The chain of resolution becomes: alice is member of team:writers members of team:writers are editors of document:meeting_notes therefore, alice is editor of document:meeting_notes caution Note: When creating relationship tuples for OpenFGA make sure to use unique ids for each object and user within your application domain. We're using first names and simple ids to just illustrate an easy-to-follow example.","s":"04. Checking An Individual Member's Access To An Object","u":"/docs/modeling/user-groups","h":"#04-checking-an-individual-members-access-to-an-object","p":527},{"i":546,"t":"Check the following sections for more on how user groups can be used. Managing Group Membership Learn how to add and remove users from groups More Modeling Google Drive See how User Groups can be used to share documents within a domain in the Google Drive use-case. More Modeling GitHub Granting teams permissions to a repo in the GitHub use-case. More","s":"Related Sections","u":"/docs/modeling/user-groups","h":"#related-sections","p":527},{"i":548,"t":"In this guide you will learn how to grant a user access to a particular object through a relationship with another object. When to use Giving user access through a relationship with another object is helpful because it allows scaling as the number of object grows. For example: organization that owns many repos team that administers many documents","s":"Managing Relationships Between Objects","u":"/docs/interacting/managing-relationships-between-objects","h":"","p":547},{"i":550,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model a repo type that can have a admin relation DSL JSON model schema 1.1 type user type repo relations define admin: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before you start","u":"/docs/interacting/managing-relationships-between-objects","h":"#before-you-start","p":547},{"i":552,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/interacting/managing-relationships-between-objects","h":"#direct-access","p":547},{"i":554,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/interacting/managing-relationships-between-objects","h":"#-concepts","p":547},{"i":556,"t":"For the current model, a user can be related as an admin to an object of type repo. If we wanted to have Anne be related to two repos, repo:1 and repo:2, we would have to add two relationship tuples, like so: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'admin', object: 'repo:1'}, { user: 'user:anne', relation: 'admin', object: 'repo:2'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"admin\"), Object: openfga.PtrString(\"repo:1\"), }, { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"admin\"), Object: openfga.PtrString(\"repo:2\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"admin\", Object = \"repo:1\" }, new() { User = \"user:anne\", Relation = \"admin\", Object = \"repo:2\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"admin\", object=\"repo:1\", ), ClientTuple( user=\"user:anne\", relation=\"admin\", object=\"repo:2\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"admin\",\"object\":\"repo:1\"},{\"user\":\"user:anne\",\"relation\":\"admin\",\"object\":\"repo:2\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne admin repo:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne admin repo:2 write([ { \"user\":\"user:anne\", \"relation\":\"admin\", \"object\":\"repo:1\" }, { \"user\":\"user:anne\", \"relation\":\"admin\", \"object\":\"repo:2\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") In general, every time we wanted to add a new admin relationship to a repo we'd have to add a new tuple. This doesn't scale as the list of repos and users grows.","s":"Step By Step","u":"/docs/interacting/managing-relationships-between-objects","h":"#step-by-step","p":547},{"i":558,"t":"Another way of modeling this is to have an authorization model as follows: DSL JSON model schema 1.1 type user type repo relations define admin: [user] or repo_admin from owner define owner: [org] type org relations define repo_admin: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"admin\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"owner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"repo_admin\" } } } ] } }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"org\" } ] }, \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"org\", \"relations\": { \"repo_admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"repo_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In this model, we have: added a new type org with one relation repo_admin. added a new relation owner for type repo. re-defined the relation admin for repo. A user can be defined as an admin directly, as we have seen above, or through the repo_admin from owner clause. How this works, for example, is that if user is related as repo_admin to org:xyz, and org:xyz is related as owner to repo:1, then user is an admin of repo:1.","s":"01. Modify Authorization Model","u":"/docs/interacting/managing-relationships-between-objects","h":"#01-modify-authorization-model","p":547},{"i":560,"t":"With this model, we can add tuples representing that an org is the owner of a repo. By adding following relationship tuples, we are indicating that the xyz organization is the owner of repositories with IDs 1 and 2: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'org:xyz', relation: 'owner', object: 'repo:1'}, { user: 'org:xyz', relation: 'owner', object: 'repo:2'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"org:xyz\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"repo:1\"), }, { User: openfga.PtrString(\"org:xyz\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"repo:2\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"org:xyz\", Relation = \"owner\", Object = \"repo:1\" }, new() { User = \"org:xyz\", Relation = \"owner\", Object = \"repo:2\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"org:xyz\", relation=\"owner\", object=\"repo:1\", ), ClientTuple( user=\"org:xyz\", relation=\"owner\", object=\"repo:2\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"org:xyz\",\"relation\":\"owner\",\"object\":\"repo:1\"},{\"user\":\"org:xyz\",\"relation\":\"owner\",\"object\":\"repo:2\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw org:xyz owner repo:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw org:xyz owner repo:2 write([ { \"user\":\"org:xyz\", \"relation\":\"owner\", \"object\":\"repo:1\" }, { \"user\":\"org:xyz\", \"relation\":\"owner\", \"object\":\"repo:2\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"02. Adding Relationship Tuples Where User Is Another Object","u":"/docs/interacting/managing-relationships-between-objects","h":"#02-adding-relationship-tuples-where-user-is-another-object","p":547},{"i":562,"t":"Now, imagine we have a new user Becky. If we wanted to have Becky be the admin of all repos without having to add one tuple per repo, all we need to do is add one tuple that says that Becky is related as repo_admin to org:xyz. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:becky', relation: 'repo_admin', object: 'org:xyz'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:becky\"), Relation: openfga.PtrString(\"repo_admin\"), Object: openfga.PtrString(\"org:xyz\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:becky\", Relation = \"repo_admin\", Object = \"org:xyz\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:becky\", relation=\"repo_admin\", object=\"org:xyz\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:becky\",\"relation\":\"repo_admin\",\"object\":\"org:xyz\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky repo_admin org:xyz write([ { \"user\":\"user:becky\", \"relation\":\"repo_admin\", \"object\":\"org:xyz\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"03. Adding Relationship Tuples To The Other Object","u":"/docs/interacting/managing-relationships-between-objects","h":"#03-adding-relationship-tuples-to-the-other-object","p":547},{"i":564,"t":"We can now verify that Becky an admin of all the repos owned by org:xyz: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'admin', object: 'repo:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"admin\", Object: \"repo:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"admin\", Object = \"repo:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"admin\", object=\"repo:1\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky admin repo:1 # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"admin\",\"object\":\"repo:1\"}}' # Response: {\"allowed\":true} check( user = \"user:becky\", // check if the user `user:becky` relation = \"admin\", // has an `admin` relation object = \"repo:1\", // with the object `repo:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'admin', object: 'repo:2', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"admin\", Object: \"repo:2\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"admin\", Object = \"repo:2\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"admin\", object=\"repo:2\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky admin repo:2 # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"admin\",\"object\":\"repo:2\"}}' # Response: {\"allowed\":true} check( user = \"user:becky\", // check if the user `user:becky` relation = \"admin\", // has an `admin` relation object = \"repo:2\", // with the object `repo:2` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"04. Validating User Access","u":"/docs/interacting/managing-relationships-between-objects","h":"#04-validating-user-access","p":547},{"i":566,"t":"Suppose now that we want to prevent users from being an admin of repo:1 via org:xyz. We can delete one tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ { user: 'org:xyz', relation: 'owner', object: 'repo:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { User: openfga.PtrString(\"org:xyz\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"repo:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { new() { User = \"org:xyz\", Relation = \"owner\", Object = \"repo:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( user=\"org:xyz\", relation=\"owner\", object=\"repo:1\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"org:xyz\",\"relation\":\"owner\",\"object\":\"repo:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} org:xyz owner repo:1 delete([ { \"user\":\"org:xyz\", \"relation\":\"owner\", \"object\":\"repo:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") With this change, we may now verify that Becky is no longer an admin of repo:1. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'admin', object: 'repo:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"admin\", Object: \"repo:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"admin\", Object = \"repo:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"admin\", object=\"repo:1\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky admin repo:1 # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"admin\",\"object\":\"repo:1\"}}' # Response: {\"allowed\":false} check( user = \"user:becky\", // check if the user `user:becky` relation = \"admin\", // has an `admin` relation object = \"repo:1\", // with the object `repo:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"05. Revoking Access","u":"/docs/interacting/managing-relationships-between-objects","h":"#05-revoking-access","p":547},{"i":568,"t":"Check the following sections for more on how to model relationships between objects. Modeling Parent-Child Objects Learn about how to cascade relationships from parent object to child object. More Modeling Object to Object Relationships Learn about modeling patterns on objects that are not specifically tied to a user. More Modeling GitHub An example of object to object relationships. More","s":"Related Sections","u":"/docs/interacting/managing-relationships-between-objects","h":"#related-sections","p":547},{"i":570,"t":"In this guide you will learn the uses of and limitations for the Check, Read, Expand, and ListObjects API endpoints.","s":"Relationship Queries: Check, Read, Expand, and ListObjects","u":"/docs/interacting/relationship-queries","h":"","p":569},{"i":572,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have a type called document that can have a reader and writer. All writers are readers. bob has a writer relationship with document:planning. DSL JSON model schema 1.1 type user type document relations define writer: [user] define reader: [user] or writer { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"writer\": { \"this\": {} }, \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } ] } } }, \"metadata\": { \"relations\": { \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } [ // Bob has writer relationship with planning document { \"user\": \"user:bob\", \"relation\": \"writer\", \"object\": \"document:planning\", }, ] In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/interacting/relationship-queries","h":"#before-you-start","p":569},{"i":574,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/interacting/relationship-queries","h":"#direct-access","p":569},{"i":576,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/interacting/relationship-queries","h":"#-concepts","p":569},{"i":579,"t":"The Check API is an API endpoint that returns whether the user has a certain relationship with an object. OpenFGA will resolve all prerequisite relationships to establish whether a relationship exists.","s":"What Is It For?","u":"/docs/interacting/relationship-queries","h":"#what-is-it-for","p":569},{"i":581,"t":"Check can be called if you need to establish whether a particular user has a specific relationship with a particular object. For example, you can call check to determine whether bob has a reader relationship with document:planning. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob reader document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:bob\", // check if the user `user:bob` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true The OpenFGA API will return true because there is an implied relationship as every writer is also a reader bob is a writer for document:planning","s":"When To Use?","u":"/docs/interacting/relationship-queries","h":"#when-to-use","p":569},{"i":583,"t":"Check is designed to answer the question \"Does user:X have relationship Y with object:Z?\". It is not designed to answer the following questions: \"Who has relationship Y with object:Z?\" \"What are the objects that userX has relationship Y with?\" \"Why does user:X have relationship Y with object:Z?\"","s":"Caveats And When Not To Use It","u":"/docs/interacting/relationship-queries","h":"#caveats-and-when-not-to-use-it","p":569},{"i":586,"t":"The Read API is an API endpoint that returns the relationship tuples that are stored in the system that satisfy a query.","s":"What Is It For?","u":"/docs/interacting/relationship-queries","h":"#what-is-it-for-1","p":569},{"i":588,"t":"Read can be called if you need to get all the stored relationship tuples that relate: a particular user to any objects of a specific type with a particular relation a particular user to any objects of a specific type with any relation a particular object to any user with a particular relation 1. A Particular User To Any Objects Of A Specific Type With A Particular Relation​ For example, to query all the stored relationship tuples bob has a writer relationship with, one can ask Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Execute a read const { tuples } = await fgaClient.read({ user:'user:bob', relation:'writer', object:'document:', }); // tuples = [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientReadOptions{} body := ClientReadRequest{ User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"document:\"), } data, err := fgaClient.Read(context.Background()).Body(requestBody).Options(options).Execute() // data = { \"tuples\": [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientReadOptions {} var body = new ClientReadRequest() { User = \"user:bob\", Relation = \"writer\", Object = \"document:\", }; var response = await fgaClient.Read(body, options); // data = { \"tuples\": [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = {} body = TupleKey( user=\"user:bob\", relation=\"writer\", object=\"document:\", ) response = await fga_client.read(body, options) # response = ReadResponse({\"tuples\":[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple read --store-id=${FGA_STORE_ID} --user user:bob --relation writer --object document: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:\"}}' # Response: \"tuples\": {[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]} read( // read all stored tuples \"user:bob\", // where user `user:bob` has $(opts.relation ? '': 'any ' )relation \"writer\", // `writer` \"document:\", // with the type `document:` ); Reply: tuples:[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] 2. A Particular User To Any Objects Of A Specific Type With Any Relation​ For example, to query all the stored relationship tuples in which bob is related to objects of type document as any relation, one can issue the following call: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Execute a read const { tuples } = await fgaClient.read({ user:'user:bob', object:'document:', }); // tuples = [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientReadOptions{} body := ClientReadRequest{ User: openfga.PtrString(\"user:bob\"), Object: openfga.PtrString(\"document:\"), } data, err := fgaClient.Read(context.Background()).Body(requestBody).Options(options).Execute() // data = { \"tuples\": [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientReadOptions {} var body = new ClientReadRequest() { User = \"user:bob\", Object = \"document:\", }; var response = await fgaClient.Read(body, options); // data = { \"tuples\": [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = {} body = TupleKey( user=\"user:bob\", object=\"document:\", ) response = await fga_client.read(body, options) # response = ReadResponse({\"tuples\":[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple read --store-id=${FGA_STORE_ID} --user user:bob --object document: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"tuple_key\":{\"user\":\"user:bob\",\"object\":\"document:\"}}' # Response: \"tuples\": {[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]} read( // read all stored tuples \"user:bob\", // where user `user:bob` has $(opts.relation ? '': 'any ' )relation \"document:\", // with the type `document:` ); Reply: tuples:[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] 3. A Particular Object To Any User With A Particular Relation​ For example, to query all the stored relationship tuples in which any user is related to document:planning as a writer, one can issue the following call: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Execute a read const { tuples } = await fgaClient.read({ relation:'writer', object:'document:planning', }); // tuples = [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientReadOptions{} body := ClientReadRequest{ Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"document:planning\"), } data, err := fgaClient.Read(context.Background()).Body(requestBody).Options(options).Execute() // data = { \"tuples\": [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientReadOptions {} var body = new ClientReadRequest() { Relation = \"writer\", Object = \"document:planning\", }; var response = await fgaClient.Read(body, options); // data = { \"tuples\": [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = {} body = TupleKey( relation=\"writer\", object=\"document:planning\", ) response = await fga_client.read(body, options) # response = ReadResponse({\"tuples\":[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple read --store-id=${FGA_STORE_ID} --relation writer --object document:planning Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"tuple_key\":{\"relation\":\"writer\",\"object\":\"document:planning\"}}' # Response: \"tuples\": {[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]} read( // read all stored tuples // for users who have relation \"writer\", // `writer` \"document:planning\", // with the object `document:planning` ); Reply: tuples:[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]","s":"When To Use?","u":"/docs/interacting/relationship-queries","h":"#when-to-use-1","p":569},{"i":590,"t":"The Read API will only return all the stored relationships that match the query specification. It does not expand or traverse the graph by taking the authorization model into account. For example, if you specify that writers are viewers in the authorization model, the Read API will ignore that and it will return tuples where a user is a viewer if and only if the (user_id, \"viewer\", object_type:object_id) relationship tuple exists in the system. In the following case, although all writers have reader relationships for document objects and bob is a writer for document:planning, if you query for all objects that bob has reader relationships, it will not return document:planning. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Execute a read const { tuples } = await fgaClient.read({ user:'user:bob', relation:'reader', object:'document:', }); // tuples = [] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientReadOptions{} body := ClientReadRequest{ User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"reader\"), Object: openfga.PtrString(\"document:\"), } data, err := fgaClient.Read(context.Background()).Body(requestBody).Options(options).Execute() // data = { \"tuples\": [] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientReadOptions {} var body = new ClientReadRequest() { User = \"user:bob\", Relation = \"reader\", Object = \"document:\", }; var response = await fgaClient.Read(body, options); // data = { \"tuples\": [] } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = {} body = TupleKey( user=\"user:bob\", relation=\"reader\", object=\"document:\", ) response = await fga_client.read(body, options) # response = ReadResponse({\"tuples\":[]}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple read --store-id=${FGA_STORE_ID} --user user:bob --relation reader --object document: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"reader\",\"object\":\"document:\"}}' # Response: \"tuples\": {[]} read( // read all stored tuples \"user:bob\", // where user `user:bob` has $(opts.relation ? '': 'any ' )relation \"reader\", // `reader` \"document:\", // with the type `document:` ); Reply: tuples:[] info Although bob is a writer to document:planning and every writer is also a reader, the Read API will return an empty list because there are no stored relationship tuples that relate bob to document:planning as reader.","s":"Caveats And When Not To Use It","u":"/docs/interacting/relationship-queries","h":"#caveats-and-when-not-to-use-it-1","p":569},{"i":593,"t":"The Expand API returns all users (including users and usersets) that have a specific relationship with an object. The response is represented as a tree of users or usersets. To build the full graph of access, you would need to recursively call expand on the leaves returned from the previous expand call.","s":"What Is It For?","u":"/docs/interacting/relationship-queries","h":"#what-is-it-for-2","p":569},{"i":595,"t":"Expand is used for debugging and to understand why a user has a particular relationship with a specific object. For example, to understand why bob can have a reader relationship with document:planning, one could first call Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); const { tree } = await fgaClient.expand({ relation: 'reader', // expand all who has 'reader' relation object: 'document:planning', // with the object 'document:planning' }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw' }); // tree = ... Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientExpandOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientExpandRequest{ Relation: \"reader\", // expand all who has \"reader\" relation Object: \"document:planning\", // with the object \"document:planning\" } data, err := fgaClient.Expand(context.Background()).Body(requestBody).Options(options).Execute() // data = { tree: ...} Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientExpandRequest { Relation = \"reader\", // expand all who has \"reader\" relation Object = \"document:planning\" // with the object \"document:planning\" }; var response = await fgaClient.Expand(body, options); // response = { tree: ... } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientExpandRequest( relation: \"reader\", object: \"document:planning\", ) response = await fga_client.expand(body. options) # response = ExpandResponse({\"tree\":...}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query expand --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw reader document:planning # Response: {\"tree\": ...} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/expand \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"tuple_key\":{\"relation\":\"reader\",\"object\":\"document:planning\"}, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' # Response: {\"tree\": ...} expand( \"reader\", // expand all who has `reader` relation \"document:planning\", // with the object `document:planning` authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: {tree:...} The result of this call will be like { \"tree\":{ \"root\":{ \"type\":\"document:planning#reader\", \"leaf\":{ \"computed\":{ \"userset\":\"document:planning#writer\" } } } } } } The returned tree will contain writer, for which we will call Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); const { tree } = await fgaClient.expand({ relation: 'writer', // expand all who has 'writer' relation object: 'document:planning', // with the object 'document:planning' }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw' }); // tree = ... Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientExpandOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientExpandRequest{ Relation: \"writer\", // expand all who has \"writer\" relation Object: \"document:planning\", // with the object \"document:planning\" } data, err := fgaClient.Expand(context.Background()).Body(requestBody).Options(options).Execute() // data = { tree: ...} Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientExpandRequest { Relation = \"writer\", // expand all who has \"writer\" relation Object = \"document:planning\" // with the object \"document:planning\" }; var response = await fgaClient.Expand(body, options); // response = { tree: ... } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientExpandRequest( relation: \"writer\", object: \"document:planning\", ) response = await fga_client.expand(body. options) # response = ExpandResponse({\"tree\":...}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query expand --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw writer document:planning # Response: {\"tree\": ...} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/expand \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"tuple_key\":{\"relation\":\"writer\",\"object\":\"document:planning\"}, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' # Response: {\"tree\": ...} expand( \"writer\", // expand all who has `writer` relation \"document:planning\", // with the object `document:planning` authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: {tree:...} The result of this call will be like { \"tree\":{ \"root\":{ \"type\":\"document:planning#writer\", \"leaf\":{ \"users\":{ \"users\":[ \"user:bob\" ] } } } } } } From there, we will learn that those related to document:planning as reader are all those who are related to that document as writer bob is related to document:planning as writer","s":"When To Use?","u":"/docs/interacting/relationship-queries","h":"#when-to-use-2","p":569},{"i":598,"t":"The ListObjects API is an API endpoint that returns the list of all the objects of a particular type that a specific user has a specific relationship with. It provides a solution to the Search with Permissions (Option 3) use case for access-aware filtering on small object collections.","s":"What Is It For?","u":"/docs/interacting/relationship-queries","h":"#what-is-it-for-3","p":569},{"i":600,"t":"Use the ListObjects API to get what objects a user can see based on the relationships they have. See Search with Permissions for more guidance. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); const response = await fgaClient.listObjects({ user: \"user:bob\", relation: \"reader\", type: \"document\", contextual_tuples: { tuple_keys: [{ user: \"user:bob\", relation: \"reader\", object: \"document:otherdoc\" }] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }); // response.objects = [\"document:otherdoc\", \"document:planning\"] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientListObjectsOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientListObjectsRequest{ User: \"user:bob\", Relation: \"reader\", Type: \"document\", ContextualTuples: &[]ClientTupleKey{ { User: \"user:bob\", Relation: \"reader\", Object: \"document:otherdoc\", } } } data, err := fgaClient.ListObjects(context.Background()). Body(requestBody). Options(options). Execute() // data = { \"objects\": [\"document:otherdoc\", \"document:planning\"] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientListObjectsRequest { User = \"user:bob\", Relation = \"reader\", Type = \"document\",, ContextualTuples = new List({ new(user: \"user:bob\", relation: \"reader\", _object: \"document:otherdoc\") }) }; var response = await fgaClient.ListObjects(body, options); // response.Objects = [\"document:otherdoc\", \"document:planning\"] Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientListObjectsRequest( user=\"user:bob\", relation=\"reader\", type=\"document\", contextual_tuples=[ ClientTupleKey(user=\"user:bob\", relation=\"reader\", object=\"document:otherdoc\") ], ) response = await fga_client.list_objects(body, options) # response.objects = [\"document:otherdoc\", \"document:planning\"] Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query list-objects --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob reader document --contextual_tuples \"user:bob reader document:otherdoc\" # Response: {\"objects\": [\"document:otherdoc\", \"document:planning\"]} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/list-objects \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{ \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"type\": \"document\", \"relation\": \"reader\", \"user\":\"user:bob\", \"contextual_tuples\": { \"tuple_keys\": [ {\"object\": \"document:otherdoc\", \"relation\": \"reader\", \"user\": \"user:bob\"} ] } }' # Response: {\"objects\": [\"document:otherdoc\", \"document:planning\"]} listObjects( \"user:bob\", // list the objects that the user `user:bob` \"reader\", // has an `reader` relation \"document\", // and that are of type `document` authorization_model_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", // for this particular authorization model id contextual_tuples = [ // Assuming the following is true {user = \"user:bob\", relation = \"reader\", object = \"document:otherdoc\"} ] ); Reply: [\"document:otherdoc\", \"document:planning\"] There's two variations of the List Objects API. The standard version, which waits until all results are ready and sends them in one response. The streaming version, which should be used if you want the individual results as soon as they become available.","s":"When To Use?","u":"/docs/interacting/relationship-queries","h":"#when-to-use-3","p":569},{"i":602,"t":"ListObjects will return the results found within the time allotted (listObjectsDeadline, default: 3s) up to the maximum number of results configured (listObjectsMaxResults, default: 1000). See Configuring the Server) for more on how to change the default configuration. If you set listObjectsDeadline to 1s, the server will spend at most 1 second finding results. If you set listObjectsMaxResults to 10, the server will return, at most, 10 objects. If the number of objects of that type is high, you should set a high value for listObjectsDeadline. If the number of objects of that type the user could have access to is high, you should set a high value for listObjectsMaxResults.","s":"Caveats","u":"/docs/interacting/relationship-queries","h":"#caveats","p":569},{"i":604,"t":"Check Read Expand ListObjects Purpose Check if user has particular relationship with certain object Return all stored relationship tuples that match query Expand the specific relationship on a particular object List all objects of a particular type that a user has a specific relationship with When to use Validate if user X can perform Y on object Z List stored relationships in system Understand why user X can perform Y on object Z Filter the objects a user has access to","s":"Summary","u":"/docs/interacting/relationship-queries","h":"#summary","p":569},{"i":606,"t":"Check out this additional content for more information on how to query relationships. Check API Reference Official reference guide for the Check API More Read API Reference Official reference guide for the Read API More Expand API Reference Official reference guide for the Expand API More ListObjects API Reference Official reference guide for the ListObjects API More","s":"Related Sections","u":"/docs/interacting/relationship-queries","h":"#related-sections","p":569},{"i":608,"t":"In this guide you'll learn how to model your application with objects that are not specifically tied to a user. For example, a folder is a parent of a document. When to use This design pattern is helpful in the case where there are relationships between different objects. With OpenFGA, so long as both objects are in a type defined in the authorization model, relationship tuples can be added to indicate a relationship between them. For example: communities can contain channels channels can contain posts channels can contain threads threads can contain posts bookshelf can have books trips can have bookings account can contain transactions buildings can have doors","s":"Object to Object Relationships","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"","p":607},{"i":610,"t":"To better follow this guide, make sure you're familiar with some OpenFGA Concepts and know how to develop the things listed below. You will start with the authorization model below, it represents a document type that can have users related as editor, and folder type that can have users related as viewer. DSL JSON model schema 1.1 type user type document relations define editor: [user] type folder relations define viewer: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"folder\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Modeling User Groups​ You need to know how to add users to groups and grant groups access to resources. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#before-you-start","p":607},{"i":612,"t":"You need to know how to add users to groups and grant groups access to resources. Learn more →","s":"Modeling User Groups","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#modeling-user-groups","p":607},{"i":614,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#-concepts","p":607},{"i":617,"t":"To represent that a folder can be a parent of a document, we first need to modify our document type definition to allow a parent relation. DSL JSON model schema 1.1 type user type document relations define parent: [folder] define editor: [user] type folder relations define viewer: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"parent\": { \"this\": {} }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"folder\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"01. Create Parent Relations In Document","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#01-create-parent-relations-in-document","p":607},{"i":619,"t":"Once the type definition is updated, we can now create the relationship between a folder as a parent of a document. To do this, we will create a new relationship tuple that describes: folder:budgets is a parent of document:may_budget.doc. In OpenFGA, users in the relationship tuples can not only be IDs, but also other objects in the form of type:object_id. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // The user in this case is another object where the type is `folder` and the object_id is `budgets` { user: 'folder:budgets', relation: 'parent', object: 'document:may_budget.doc'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // The user in this case is another object where the type is `folder` and the object_id is `budgets` User: openfga.PtrString(\"folder:budgets\"), Relation: openfga.PtrString(\"parent\"), Object: openfga.PtrString(\"document:may_budget.doc\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // The user in this case is another object where the type is `folder` and the object_id is `budgets` new() { User = \"folder:budgets\", Relation = \"parent\", Object = \"document:may_budget.doc\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # The user in this case is another object where the type is `folder` and the object_id is `budgets` user=\"folder:budgets\", relation=\"parent\", object=\"document:may_budget.doc\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"folder:budgets\",\"relation\":\"parent\",\"object\":\"document:may_budget.doc\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw folder:budgets parent document:may_budget.doc write([ // The user in this case is another object where the type is `folder` and the object_id is `budgets` { \"user\":\"folder:budgets\", \"relation\":\"parent\", \"object\":\"document:may_budget.doc\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"02. Add Parent Relationship Tuples","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#02-add-parent-relationship-tuples","p":607},{"i":621,"t":"Once that relationship tuple is added to OpenFGA, we can check if the relationship is valid by asking the following: \"is folder:budgets a parent of document:may_budget.doc?\" Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'folder:budgets', relation: 'parent', object: 'document:may_budget.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"folder:budgets\", Relation: \"parent\", Object: \"document:may_budget.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"folder:budgets\", Relation = \"parent\", Object = \"document:may_budget.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"folder:budgets\", relation=\"parent\", object=\"document:may_budget.doc\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw folder:budgets parent document:may_budget.doc # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"folder:budgets\",\"relation\":\"parent\",\"object\":\"document:may_budget.doc\"}}' # Response: {\"allowed\":true} check( user = \"folder:budgets\", // check if the user `folder:budgets` relation = \"parent\", // has an `parent` relation object = \"document:may_budget.doc\", // with the object `document:may_budget.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true It is important to note that the current authorization model does not imply inheritance of permissions. Even though folder:budgets is a parent of document:may_budget.doc, it does not inherit the editor relation from parent to document. Meaning editors on folder:budgets are not editors on document:may_budget.doc. Further configuration changes are needed to indicate that and will be tackled in a later guide. caution Note: When creating relationship tuples for OpenFGA make sure to use unique ids for each object and user within your application domain. We are using first names and simple ids to just illustrate an easy-to-follow example.","s":"03. Check That Parent Folders Have Permissions","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#03-check-that-parent-folders-have-permissions","p":607},{"i":623,"t":"Object to object can be used for more advanced use case, such as entitlements. An example use case is to allow subscribers to be entitled to different plans.","s":"Advanced Object to Object Relationships","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#advanced-object-to-object-relationships","p":607},{"i":625,"t":"To do this, the authorization model will have two types - feature and plan. DSL JSON model schema 1.1 type user type feature relations define associated_plan: [plan] define access: [user] or subscriber_member from associated_plan type plan relations define subscriber_member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber_member\" } } } ] } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"plan\", \"relations\": { \"subscriber_member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"subscriber_member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Type feature has two relations, associated_plan and access. Relation associated_plan allows associating plans with features while access defines who can access the feature. In our case, the access can be achieved either from direct relationship via [direct relationship type restrictions](/docs/configuration-language#the-direct-relationship-type-restrictions). or `this` object to object relationship where a user can access because it is a subscriber_member of a particular plan AND that plan is associated with the feature. Here, we define plan as the user of object feature with relationship associated_plan rather than defining feature as the user of object plan with relationship feature. The reason we choose the former is that we want to describe our system in the following plain language: A user can access a feature in a plan if they are a subscriber member of a plan that is the associated plan of a feature. This will give us a flow of user->organization->plan->feature and allows us to answer the question of whether user can access a feature rather than whether user is subscriber of a plan.","s":"01. Create Authorization Model With Object To Object Relationships","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#01-create-authorization-model-with-object-to-object-relationships","p":607},{"i":627,"t":"To realize the relationship, we will need to add the following relationship tuples. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // make anne as subscriber_member for plan:advanced { user: 'user:anne', relation: 'subscriber_member', object: 'plan:advanced'}, // The advanced plan is associated with the data preview feature { user: 'plan:advanced', relation: 'associated_plan', object: 'feature:data_preview'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // make anne as subscriber_member for plan:advanced User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"subscriber_member\"), Object: openfga.PtrString(\"plan:advanced\"), }, { // The advanced plan is associated with the data preview feature User: openfga.PtrString(\"plan:advanced\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:data_preview\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // make anne as subscriber_member for plan:advanced new() { User = \"user:anne\", Relation = \"subscriber_member\", Object = \"plan:advanced\" }, // The advanced plan is associated with the data preview feature new() { User = \"plan:advanced\", Relation = \"associated_plan\", Object = \"feature:data_preview\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # make anne as subscriber_member for plan:advanced user=\"user:anne\", relation=\"subscriber_member\", object=\"plan:advanced\", ), ClientTuple( # The advanced plan is associated with the data preview feature user=\"plan:advanced\", relation=\"associated_plan\", object=\"feature:data_preview\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"subscriber_member\",\"object\":\"plan:advanced\"},{\"user\":\"plan:advanced\",\"relation\":\"associated_plan\",\"object\":\"feature:data_preview\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne subscriber_member plan:advanced fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:advanced associated_plan feature:data_preview write([ // make anne as subscriber_member for plan:advanced { \"user\":\"user:anne\", \"relation\":\"subscriber_member\", \"object\":\"plan:advanced\" }, // The advanced plan is associated with the data preview feature { \"user\":\"plan:advanced\", \"relation\":\"associated_plan\", \"object\":\"feature:data_preview\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"02. Adding Relationship Tuples","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#02-adding-relationship-tuples","p":607},{"i":629,"t":"To validate that the authorization model and relationship tuples are correct, we can ask the question: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'access', object: 'feature:data_preview', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"access\", Object: \"feature:data_preview\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"access\", Object = \"feature:data_preview\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"access\", object=\"feature:data_preview\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:data_preview # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"access\",\"object\":\"feature:data_preview\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"access\", // has an `access` relation object = \"feature:data_preview\", // with the object `feature:data_preview` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true We see that anne is allowed to access feature:data_preview without requiring direct relationship.","s":"03. Check To See If Access Is Allowed Without Direct Relationship","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#03-check-to-see-if-access-is-allowed-without-direct-relationship","p":607},{"i":631,"t":"At any point in time, plan:advanced may be disassociated from feature:data_preview. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ // Remove advanced plan from data preview feature { user: 'plan:advanced', relation: 'associated_plan', object: 'feature:data_preview'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { // Remove advanced plan from data preview feature User: openfga.PtrString(\"plan:advanced\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:data_preview\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { // Remove advanced plan from data preview feature new() { User = \"plan:advanced\", Relation = \"associated_plan\", Object = \"feature:data_preview\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( # Remove advanced plan from data preview feature user=\"plan:advanced\", relation=\"associated_plan\", object=\"feature:data_preview\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"plan:advanced\",\"relation\":\"associated_plan\",\"object\":\"feature:data_preview\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} plan:advanced associated_plan feature:data_preview delete([ // Remove advanced plan from data preview feature { \"user\":\"plan:advanced\", \"relation\":\"associated_plan\", \"object\":\"feature:data_preview\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") When this is the case, anne will no longer have access to feature:data_preview even though she is still a subscriber_member of plan:advanced. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'access', object: 'feature:data_preview', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"access\", Object: \"feature:data_preview\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"access\", Object = \"feature:data_preview\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"access\", object=\"feature:data_preview\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:data_preview # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"access\",\"object\":\"feature:data_preview\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"access\", // has an `access` relation object = \"feature:data_preview\", // with the object `feature:data_preview` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'subscriber_member', object: 'plan:advanced', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"subscriber_member\", Object: \"plan:advanced\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"subscriber_member\", Object = \"plan:advanced\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"subscriber_member\", object=\"plan:advanced\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne subscriber_member plan:advanced # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"subscriber_member\",\"object\":\"plan:advanced\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"subscriber_member\", // has an `subscriber_member` relation object = \"plan:advanced\", // with the object `plan:advanced` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"04. Disassociating Plan From Feature","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#04-disassociating-plan-from-feature","p":607},{"i":633,"t":"Check the following sections for more on how object-to-object relationships can be used. Advanced Modeling Patterns: Entitlements Learn how to model entitlement access patterns. More Modeling Parent-Child Relationships Learn how to model parent and child relationships. More Modeling User Groups Learn how to model user groups. More","s":"Related Sections","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#related-sections","p":607},{"i":635,"t":"In this guide you'll learn how to model relationships that may or may not be assigned directly to individual users. When to use Disabling direct relationships for a certain relation on an objects are useful especially in cases where you are trying to model some permissions that are not usually granted individually to a user. This is useful when: For security reason, not permitting permissions assigned directly to individuals without associating roles","s":"Direct Relationships","u":"/docs/modeling/building-blocks/direct-relationships","h":"","p":634},{"i":637,"t":"To better understand this guide, you should be familiar with some OpenFGA Concepts and know how to develop the things listed below. You will need to know the following: Direct Access OpenFGA Concepts Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Direct Relationship Type Restrictions: used in the context of the relation definition can be used to allow direct relationships to the objects of this type","s":"Before You Start","u":"/docs/modeling/building-blocks/direct-relationships","h":"#before-you-start","p":634},{"i":639,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/modeling/building-blocks/direct-relationships","h":"#direct-access","p":634},{"i":641,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Direct Relationship Type Restrictions: used in the context of the relation definition can be used to allow direct relationships to the objects of this type","s":"OpenFGA Concepts","u":"/docs/modeling/building-blocks/direct-relationships","h":"#-concepts","p":634},{"i":643,"t":"Direct relationships are relationships where a user has a relationship to an object that is not dependent on any other relationship they have with that object. When checking for a relationship, a direct relationship exists if a relationship tuple is present in the system with the exact same object and relation that were in the query and where the user is one of: the same user ID as that in the query type bound public access (:*) a set of users that contains the user ID present in the query","s":"What Are Direct Relationships?","u":"/docs/modeling/building-blocks/direct-relationships","h":"#what-are-direct-relationships","p":634},{"i":645,"t":"Direct relationships can be enabled for a specific relation on an object type by adding direct relationship type restrictions from that relation's definition. Likewise, they can be disabled by removing the direct relationship type restrictions. DSL JSON model schema 1.1 type user type document relations define viewer: [user, user:*, team#member] or editor define editor: [user, team#member] type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user\", \"wildcard\": {} }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info The authorization model describes two object types: document and team. The document type definition has two relations, editor and viewer. Both relations allow a direct relationship; viewer also allows an indirect relationship through editor. In the team type definition, there is a single member relation that only allows direct relationships.","s":"Enable Or Disable Direct Relationships","u":"/docs/modeling/building-blocks/direct-relationships","h":"#enable-or-disable-direct-relationships","p":634},{"i":647,"t":"To illustrate the effect enabling or disabling direct relationships on a specific relation has, we'll investigate several situations.","s":"How It Affects Your System","u":"/docs/modeling/building-blocks/direct-relationships","h":"#how-it-affects-your-system","p":634},{"i":649,"t":"Let us start with the authorization model we had above: DSL JSON model schema 1.1 type user type document relations define viewer: [user, user:*, team#member] or editor define editor: [user, team#member] type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user\", \"wildcard\": {} }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Now choose the type of relation to see how it affects your system: Direct User Type Bound Public Access Userset Indirect Relationship Assume you have a tuple that states that Anne is a viewer of document:planning [ { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] Now if we do a check request to see if Anne can view the planning document, we will get a response of {\"allowed\": true}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne viewer document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true This is because: There is a relationship tuple specifying that Anne has a viewer relationship with document:planning. Direct relationships are allowed in the viewer relation definition in the document type definition. Assume you have a type bound public access tuple where everyone of type user is a viewer of document:planning (In other words, the document is public) [ { \"user\": \"user:*\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] Now if we do a check request to see if Beth can view the planning document, we will get a response of {\"allowed\": true}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth viewer document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true This is because: There is a relationship tuple specifying that everyone of type user has a viewer relationship with document:planning. Direct relationships are allowed in the viewer relation definition in the document type definition. info Note: Even though the relationship tuple stored in the system does not specify the user (beth), this is still considered a direct relationship. Usersets are the third way direct relationships apply, we will see how in this section. Assume you have two relationship tuples: Charlie is a member of the product team. Members of the product team are viewers of the planning document. [ { \"user\": \"user:charlie\", \"relation\": \"member\", \"object\": \"team:product\", }, { \"user\": \"team:product#member\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] info Note that these two relationship tuples are specifying that: user:charlie is a member of team:product. any member of team:product is a viewer of document:planning. Note that this second relationship tuple is specifying that the members of the team have viewer access, and not the team object itself. Now if we do a check request to see if charlie can view the planning document, we will get a response of {\"allowed\": true}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:charlie', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:charlie\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:charlie\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:charlie\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charlie viewer document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:charlie\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:charlie\", // check if the user `user:charlie` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true This is because: Charlie is a member of the product team. There is a relationship tuple specifying that all members of the product team have a viewer relationship with document:planning. Direct relationships are allowed in the viewer relation definition in the document type definition. Note that this is still considered a direct relationship no matter how many resolutions occur on the usersets until the user is found. For example, if our relationship tuples were the following relationship tuples: Dany is a member of the product leads team. Members of the product leads team are members of the product team. Members of the product team are members of the contoso team. Members of the contoso team are viewers of the planning document. [ { \"user\": \"user:dany\", \"relation\": \"member\", \"object\": \"team:product-leads\", }, { \"user\": \"team:product-leads#member\", \"relation\": \"member\", \"object\": \"team:product\", }, { \"user\": \"team:product#member\", \"relation\": \"member\", \"object\": \"team:contoso\", }, { \"user\": \"team:contoso#member\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] A subsequent check request to see if Dany can view the planning document will still return a response of {\"allowed\": true}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:dany', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:dany\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:dany\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:dany\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:dany viewer document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:dany\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:dany\", // check if the user `user:dany` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true info Note: Even though the relationship tuple stored in the system does not specify the user (charlie or dany), this is still considered a direct relationship. Here we will cover one example of an indirect relationship in order to see how they differ from direct relationships. With the same authorization model we have above, assume there is a relationship tuple that specifies that Emily is an editor of document:planning. [ { \"user\": \"user:emily\", \"relation\": \"editor\", \"object\": \"document:planning\", }, ] A subsequent check request to see if emily can view the planning document will still return a response of {\"allowed\": true}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:emily', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:emily\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:emily\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:emily\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily viewer document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:emily\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:emily\", // check if the user `user:emily` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true This is because: Emily is an editor of the planning document. The authorization model specified that anyone who is an editor on a document is also a viewer on that document. In this case, there is NO direct viewer relationship between Emily and the planning document. The only viewer relationship that exists is implied because Emily is an editor and the authorization model specified that any document's editor is that document's viewer.","s":"1. With Direct Relationships Enabled","u":"/docs/modeling/building-blocks/direct-relationships","h":"#1-with-direct-relationships-enabled","p":634},{"i":651,"t":"In this section, we will investigate the effect of disabling direct relationships on the document's viewer relation. DSL JSON model schema 1.1 type user type document relations define viewer: editor define editor: [user, team#member] type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"computedUserset\": { \"relation\": \"editor\" } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Notice that in this updated authorization model, the direct relationship keyword has been removed from the document's viewer relation definition. Now choose the type of relation to see how it affects your system: Direct User Everyone Userset Indirect Relationship Assume you have a tuple that states that Fred is a viewer of document:planning [ { \"user\": \"user:fred\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] Now if we do a check request to see if Fred can view the planning document, we will get a response of {\"allowed\": false}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:fred', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:fred\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:fred\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:fred\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:fred viewer document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:fred\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:fred\", // check if the user `user:fred` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false This is because: Even though there is a relationship tuple specifying that Fred has a viewer relationship with document:planning. Direct relationships are NOT allowed in the viewer relation definition in the document type definition. You will see the same behaviour with a relationship tuple specifying everyone of type user as the user. Assume you have a tuple that states that everyone of type user is a viewer of document:planning. [ { \"user\": \"user:*\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] Now if we do a check request to see if Gabriel can view the planning document, we will get a response of {\"allowed\": false}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:gabriel', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:gabriel\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:gabriel\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:gabriel\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:gabriel viewer document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:gabriel\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:gabriel\", // check if the user `user:gabriel` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false This is because: Even though there is a relationship tuple specifying that everyone has a viewer relationship with document:planning. Direct relationships are NOT allowed in the viewer relation definition in the document type definition. The same logic applies to usersets. Assume you have two relationship tuples: Henry is a member of the product team. Members of the product team are viewers of the planning document. [ { \"user\": \"user:henry\", \"relation\": \"member\", \"object\": \"team:product\", }, { \"user\": \"team:product#member\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] Now if we do a check request to see if Henry can view the planning document, we will get a response of {\"allowed\": false}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:henry', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:henry\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:henry\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:henry\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:henry viewer document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:henry\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:henry\", // check if the user `user:henry` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false This is because although: Henry is a member of the product team. There is a relationship tuple specifying that all members of the product team have a viewer relationship with document:planning. Direct relationships are NOT allowed in the viewer relation definition in the document type definition. Indirect relationships are not affected by disabling a direct relationship on a certain relation. Assume there is a relationship tuple that specifies that Ingred is an editor of document:planning. [ { \"user\": \"user:ingred\", \"relation\": \"editor\", \"object\": \"document:planning\", }, ] A subsequent check request to see if Ingred can view the planning document will still return a response of {\"allowed\": true}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:ingred', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:ingred\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:ingred\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:ingred\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:ingred viewer document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:ingred\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:ingred\", // check if the user `user:ingred` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"2. With Direct Relationships Disabled","u":"/docs/modeling/building-blocks/direct-relationships","h":"#2-with-direct-relationships-disabled","p":634},{"i":653,"t":"Check the following sections for more one how direct relationships can be used. Also, take a look at the access relation in the feature type in Modeling Entitlements for another use-case. Modeling Roles and Permissions Learn how to remove the direct relationship to indicate nonassignable permissions. More Modeling for IoT See how Roles and Permissions can be used in an IoT use-case. More Modeling Entitlements Take a look at the access relation in the feature type for an example of removing the direct relationship More","s":"Related Sections","u":"/docs/modeling/building-blocks/direct-relationships","h":"#related-sections","p":634},{"i":655,"t":"This section tackles cases where a user may have access to a particular resource through their presence in a particular organization, and they should have that access only when logged in within the context of that organization. When to use Contextual Tuples should be used when modeling cases where a user's access to an object depends on the context of their request. For example: An employee’s ability to access a document when they are connected to the organization VPN or the api call is originating from an internal IP address. A support engineer is only able to access a user's account during office hours. If a user belongs to multiple organizations, they are only able to access a resource if they set a specific organization in their current context.","s":"Authorization Through Organization Context","u":"/docs/modeling/organization-context-authorization","h":"","p":654},{"i":657,"t":"To follow this guide, you should be familiar with some OpenFGA Concepts.","s":"Before You Start","u":"/docs/modeling/organization-context-authorization","h":"#before-you-start","p":654},{"i":659,"t":"A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system A Check Request: is a call to the OpenFGA check endpoint that returns whether the user has a certain relationship with an object. A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA A Contextual Tuple: a tuple that can be added to a check request, and only exist within the context of that particular request. You also need to be familiar with: Modeling Object-to-Object Relationships: You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more → Modeling Multiple Restrictions: You need to know how to model requiring multiple authorizations before allowing users to perform certain actions. Learn more →","s":"OpenFGA Concepts","u":"/docs/modeling/organization-context-authorization","h":"#-concepts","p":654},{"i":661,"t":"For the scope of this guide, we are going to consider the following scenario. Consider you are building the authorization model for a multi-tenant project management system. In this particular system: projects are owned and managed by companies users can be members of multiple companies project access is governed by the user's role in the organization that manages the project In order for a user to access a project: The project needs to be managed by an organization the user is a member of A project is owned by a single organization A project can be shared with partner companies (that are able to view, edit but not perform admin actions, such as deletion, on the project) The user should have a role that grants access to the project The user should be logged in within the context of that organization We will start with the following authorization model: DSL JSON model schema 1.1 type user type organization relations define member: [user] define project_manager: [user] define project_editor: [user] type project relations define owner: [organization] define partner: [organization] define manager: project_manager from owner define editor: project_editor from owner or project_editor from partner or manager define can_delete: manager define can_edit: editor define can_view: editor { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} }, \"project_manager\": { \"this\": {} }, \"project_editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"project_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"project_editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"project\", \"relations\": { \"owner\": { \"this\": {} }, \"partner\": { \"this\": {} }, \"manager\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"owner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"project_manager\" } } }, \"editor\": { \"union\": { \"child\": [ { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"owner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"project_editor\" } } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"partner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"project_editor\" } } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"manager\" } } ] } }, \"can_delete\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"manager\" } }, \"can_edit\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"editor\" } }, \"can_view\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"editor\" } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] }, \"partner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } } ] } We are considering the case that: Anne has a project manager role at organizations A, B and C Beth has a project manager role at organization B Carl has a project manager role at organization C Project X is owned by organization A Project X is shared with organization B The above state translates to the following relationship tuples: Node.js Go .NET Python curl CLI Pseudocode await fgaClient.write({ writes: [ // Anne has a `project manager` role at organization A { user: 'user:anne', relation: 'project_manager', object: 'organization:A'}, // Anne has a `project manager` role at organization B { user: 'user:anne', relation: 'project_manager', object: 'organization:B'}, // Anne has a `project manager` role at organization C { user: 'user:anne', relation: 'project_manager', object: 'organization:C'}, // Beth has a `project manager` role at organization B { user: 'user:anne', relation: 'project_manager', object: 'organization:B'}, // Carl has a `project manager` role at organization C { user: 'user:carl', relation: 'project_manager', object: 'organization:C'}, // Organization A owns Project X { user: 'organization:A', relation: 'owner', object: 'project:X'}, // Project X is shared with Organization B { user: 'organization:B', relation: 'partner', object: 'project:X'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne has a `project manager` role at organization A User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:A\"), }, { // Anne has a `project manager` role at organization B User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:B\"), }, { // Anne has a `project manager` role at organization C User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:C\"), }, { // Beth has a `project manager` role at organization B User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:B\"), }, { // Carl has a `project manager` role at organization C User: openfga.PtrString(\"user:carl\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:C\"), }, { // Organization A owns Project X User: openfga.PtrString(\"organization:A\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"project:X\"), }, { // Project X is shared with Organization B User: openfga.PtrString(\"organization:B\"), Relation: openfga.PtrString(\"partner\"), Object: openfga.PtrString(\"project:X\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne has a `project manager` role at organization A new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:A\" }, // Anne has a `project manager` role at organization B new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:B\" }, // Anne has a `project manager` role at organization C new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:C\" }, // Beth has a `project manager` role at organization B new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:B\" }, // Carl has a `project manager` role at organization C new() { User = \"user:carl\", Relation = \"project_manager\", Object = \"organization:C\" }, // Organization A owns Project X new() { User = \"organization:A\", Relation = \"owner\", Object = \"project:X\" }, // Project X is shared with Organization B new() { User = \"organization:B\", Relation = \"partner\", Object = \"project:X\" } }, }; var response = await fgaClient.Write(body, options); options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne has a `project manager` role at organization A user=\"user:anne\", relation=\"project_manager\", object=\"organization:A\", ), ClientTuple( # Anne has a `project manager` role at organization B user=\"user:anne\", relation=\"project_manager\", object=\"organization:B\", ), ClientTuple( # Anne has a `project manager` role at organization C user=\"user:anne\", relation=\"project_manager\", object=\"organization:C\", ), ClientTuple( # Beth has a `project manager` role at organization B user=\"user:anne\", relation=\"project_manager\", object=\"organization:B\", ), ClientTuple( # Carl has a `project manager` role at organization C user=\"user:carl\", relation=\"project_manager\", object=\"organization:C\", ), ClientTuple( # Organization A owns Project X user=\"organization:A\", relation=\"owner\", object=\"project:X\", ), ClientTuple( # Project X is shared with Organization B user=\"organization:B\", relation=\"partner\", object=\"project:X\", ),, ), \", ) response = await fga_client.write(body, options) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:A\"},{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:B\"},{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:C\"},{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:B\"},{\"user\":\"user:carl\",\"relation\":\"project_manager\",\"object\":\"organization:C\"},{\"user\":\"organization:A\",\"relation\":\"owner\",\"object\":\"project:X\"},{\"user\":\"organization:B\",\"relation\":\"partner\",\"object\":\"project:X\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:A fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:B fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:C fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:B fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl project_manager organization:C fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:A owner project:X fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:B partner project:X write([ // Anne has a `project manager` role at organization A { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:A\" }, // Anne has a `project manager` role at organization B { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:B\" }, // Anne has a `project manager` role at organization C { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:C\" }, // Beth has a `project manager` role at organization B { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:B\" }, // Carl has a `project manager` role at organization C { \"user\":\"user:carl\", \"relation\":\"project_manager\", \"object\":\"organization:C\" }, // Organization A owns Project X { \"user\":\"organization:A\", \"relation\":\"owner\", \"object\":\"project:X\" }, // Project X is shared with Organization B { \"user\":\"organization:B\", \"relation\":\"partner\", \"object\":\"project:X\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"Scenario","u":"/docs/modeling/organization-context-authorization","h":"#scenario","p":654},{"i":663,"t":"When logging in within the context of organization A, Anne should be able to view and delete project X. When logging in within the context of organization B, Anne should be able to view, but not delete, project X. When logging in within the context of organization C, Anne should not be able to view nor delete project X. When logging in within the context of organization B, Beth should be able to view, but not delete, project X. Carl should not be able to view nor delete project X.","s":"Requirements","u":"/docs/modeling/organization-context-authorization","h":"#requirements","p":654},{"i":665,"t":"In order to solve for the requirements above, we will break the problem down into three steps: Understand relationships without contextual tuples. For example, we need to ensure that Anne can view and delete \"Project X\". Take organization context into consideration. This includes extending the authorization model and a temporary step of adding the required tuples to mark that Anne is in an approved context. Use contextual tuples for context related checks.","s":"Step By Step","u":"/docs/modeling/organization-context-authorization","h":"#step-by-step","p":654},{"i":667,"t":"With the authorization model and relationship tuples shown above, OpenFGA has all the information needed to ensure that Anne can view and delete \"Project X\". We can verify that using the following checks: Anne can view Project X Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = true fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X # Response: {\"allowed\":true} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"project:X\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Anne can delete Project X Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_delete', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_delete\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_delete\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_delete\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = true fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_delete project:X # Response: {\"allowed\":true} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_delete\",\"object\":\"project:X\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_delete\", // has an `can_delete` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true More checks * Beth can view Project X Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'can_view', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"can_view\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"can_view\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"can_view\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = true fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth can_view project:X # Response: {\"allowed\":true} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"can_view\",\"object\":\"project:X\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true * Beth cannot delete Project X Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'can_delete', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"can_delete\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"can_delete\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"can_delete\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = false fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth can_delete project:X # Response: {\"allowed\":false} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"can_delete\",\"object\":\"project:X\"}}' # Response: {\"allowed\":false} check( user = \"user:beth\", // check if the user `user:beth` relation = \"can_delete\", // has an `can_delete` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false * Carl cannot view Project X Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:carl', relation: 'can_view', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:carl\", Relation: \"can_view\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:carl\", Relation = \"can_view\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:carl\", relation=\"can_view\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = false fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl can_view project:X # Response: {\"allowed\":false} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:carl\",\"relation\":\"can_view\",\"object\":\"project:X\"}}' # Response: {\"allowed\":false} check( user = \"user:carl\", // check if the user `user:carl` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false * Carl cannot delete Project X Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:carl', relation: 'can_delete', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:carl\", Relation: \"can_delete\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:carl\", Relation = \"can_delete\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:carl\", relation=\"can_delete\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = false fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl can_delete project:X # Response: {\"allowed\":false} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:carl\",\"relation\":\"can_delete\",\"object\":\"project:X\"}}' # Response: {\"allowed\":false} check( user = \"user:carl\", // check if the user `user:carl` relation = \"can_delete\", // has an `can_delete` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Note that so far, we have not prevented Anne from viewing \"Project X\" even if Anne is viewing it from the context of Organization C.","s":"Understand Relationships Without Contextual Data","u":"/docs/modeling/organization-context-authorization","h":"#understand-relationships-without-contextual-data","p":654},{"i":669,"t":"Extend The Authorization Model​ In order to add a restriction based on the current organization context, we will make use of OpenFGA configuration language's support for intersection to specify that a user has to both have access and be in the correct context in order to be authorized. We can do that by introducing some new relations and updating existing relation definitions: On the \"organization\" type Add \"user_in_context\" relation to mark that a user's access is being evaluated within that particular context Update the \"project_manager\" relation to require that the user be in the correct context (by adding and user_in_context to the relation definition) Considering that OpenFGA does not yet support multiple logical operations within the same definition, we will split \"project_editor\" into two: \"base_project_editor\" editor which will contain the original relation definition ([user] or project_manager) \"project_editor\" which will require that a user has both the \"base_project_editor\" and the \"user_in_context\" relations The \"organization\" type definition then becomes: DSL JSON type organization relations define member: [user] define project_manager: [user] and user_in_context define base_project_editor: [user] or project_manager define project_editor: base_project_editor and user_in_context define user_in_context: [user] { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} }, \"project_manager\": { \"intersection\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"user_in_context\" } } ] } }, \"base_project_editor\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"project_manager\" } } ] } }, \"project_editor\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"base_project_editor\" } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"user_in_context\" } } ] } }, \"user_in_context\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"project_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"base_project_editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"user_in_context\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } On the \"project\" type Nothing will need to be done, as it will inherit the updated \"project_manager\" and \"project_editor\" relation definitions from \"organization\" Add The Required Tuples To Mark That Anne Is In An Approved Context​ Now that we have updated our authorization model to take the current user's organization context into consideration, you will notice that Anne has lost access because nothing indicates that Anne is authorizing from the context of an organization. You can verify that by issuing the following check: Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = false fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X # Response: {\"allowed\":false} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"project:X\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false In order for Anne to be authorized, a tuple indicating Anne's current organization context will need to be present: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is authorizing from the context of organization:A { user: 'user:anne', relation: 'user_in_context', object: 'organization:A'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is authorizing from the context of organization:A User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"user_in_context\"), Object: openfga.PtrString(\"organization:A\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is authorizing from the context of organization:A new() { User = \"user:anne\", Relation = \"user_in_context\", Object = \"organization:A\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is authorizing from the context of organization:A user=\"user:anne\", relation=\"user_in_context\", object=\"organization:A\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"user_in_context\",\"object\":\"organization:A\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne user_in_context organization:A write([ // Anne is authorizing from the context of organization:A { \"user\":\"user:anne\", \"relation\":\"user_in_context\", \"object\":\"organization:A\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") We can verify this by running a check request Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = true fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X # Response: {\"allowed\":true} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"project:X\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"Take Organization Context Into Consideration","u":"/docs/modeling/organization-context-authorization","h":"#take-organization-context-into-consideration","p":654},{"i":671,"t":"Now that we know we can authorize based on present state, we have a different problem to solve. We are storing the tuples in the state in order for OpenFGA to evaluate them, which fails in certain use-cases where Anne can be connected to two different contexts in different browser windows at the same time, as each has a different context at the same time, so if they are written to the state, which will OpenFGA use to compute Anne's access to the project? For Check calls, OpenFGA has a concept called \"Contextual Tuples\". Contextual Tuples are tuples that do not exist in the system state and are not written beforehand to OpenFGA. They are tuples that are sent alongside the Check request and will be treated as if they already exist in the state for the context of that particular Check call. That means that Anne can be using two different sessions, each within a different organization context, and OpenFGA will correctly respond to each one with the correct authorization decision. First, we will undo the temporary step and remove the stored tuples for which Anne has a user_in_context relation with organization:A. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ // Delete stored tuples where Anne is authorizing from the context of organization:A { user: 'user:anne', relation: 'user_in_context', object: 'organization:A'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { // Delete stored tuples where Anne is authorizing from the context of organization:A User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"user_in_context\"), Object: openfga.PtrString(\"organization:A\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { // Delete stored tuples where Anne is authorizing from the context of organization:A new() { User = \"user:anne\", Relation = \"user_in_context\", Object = \"organization:A\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( # Delete stored tuples where Anne is authorizing from the context of organization:A user=\"user:anne\", relation=\"user_in_context\", object=\"organization:A\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"user_in_context\",\"object\":\"organization:A\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} user:anne user_in_context organization:A delete([ // Delete stored tuples where Anne is authorizing from the context of organization:A { \"user\":\"user:anne\", \"relation\":\"user_in_context\", \"object\":\"organization:A\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Next, when Anne is connecting from the context of organization A, OpenFGA will return {\"allowed\":true}: Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'project:X', contextual_tuples: [ { user: \"user:anne\", relation: \"user_in_context\", object: \"organization:A\" } ]}, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"project:X\", ContextualTuples: &[]ClientTupleKey{ { User: \"user:anne\", Relation: \"user_in_context\", Object: \"organization:A\", } } } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"project:X\",, ContextualTuples = new List({ new(user: \"user:anne\", relation: \"user_in_context\", _object: \"organization:A\") }) }; var response = await fgaClient.Check(body, options); // response.Allowed = true options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"project:X\", contextual_tuples=[ ClientTupleKey(user=\"user:anne\", relation=\"user_in_context\", object=\"organization:A\") ], ) response = await fga_client.check(body, options) # response.allowed = true fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X --contextual_tuples \"user:anne user_in_context organization:A\" # Response: {\"allowed\":true} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"project:X\"},\"contextual_tuples\":{\"tuple_keys\":[{\"user\":\"user:anne\",\"relation\":\"user_in_context\",\"object\":\"organization:A\"}]}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` contextual_tuples = [ // Assuming the following is true {user = \"user:anne\", relation = \"user_in_context\", object = \"organization:A\"} ], authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true When Anne is connecting from the context of organization C, OpenFGA will return {\"allowed\":false}: Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'project:X', contextual_tuples: [ { user: \"user:anne\", relation: \"user_in_context\", object: \"organization:C\" } ]}, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"project:X\", ContextualTuples: &[]ClientTupleKey{ { User: \"user:anne\", Relation: \"user_in_context\", Object: \"organization:C\", } } } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"project:X\",, ContextualTuples = new List({ new(user: \"user:anne\", relation: \"user_in_context\", _object: \"organization:C\") }) }; var response = await fgaClient.Check(body, options); // response.Allowed = false options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"project:X\", contextual_tuples=[ ClientTupleKey(user=\"user:anne\", relation=\"user_in_context\", object=\"organization:C\") ], ) response = await fga_client.check(body, options) # response.allowed = false fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X --contextual_tuples \"user:anne user_in_context organization:C\" # Response: {\"allowed\":false} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"project:X\"},\"contextual_tuples\":{\"tuple_keys\":[{\"user\":\"user:anne\",\"relation\":\"user_in_context\",\"object\":\"organization:C\"}]}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` contextual_tuples = [ // Assuming the following is true {user = \"user:anne\", relation = \"user_in_context\", object = \"organization:C\"} ], authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Using this, you can check that the following requirements are satisfied: User Organization Context Action Allowed Anne Organization A View Yes Anne Organization B View Yes Anne Organization C View Yes Anne Organization A Delete Yes Anne Organization B Delete No Anne Organization C Delete No Beth Organization B View Yes Beth Organization B Delete No Carl Organization C View No Carl Organization C Delete No","s":"Use Contextual Tuples For Context Related Checks","u":"/docs/modeling/organization-context-authorization","h":"#use-contextual-tuples-for-context-related-checks","p":654},{"i":673,"t":"Final version of the Authorization Model and Relationship tuples DSL JSON model schema 1.1 type user type organization relations define member: [user] define project_manager: [user] and user_in_context define base_project_editor: [user] or project_manager define project_editor: base_project_editor and user_in_context define user_in_context: [user] type project relations define owner: [organization] define partner: [organization] define manager: project_manager from owner define editor: manager or project_editor from owner or project_editor from partner define can_delete: manager define can_edit: editor define can_view: editor { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} }, \"project_manager\": { \"intersection\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"user_in_context\" } } ] } }, \"base_project_editor\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"project_manager\" } } ] } }, \"project_editor\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"base_project_editor\" } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"user_in_context\" } } ] } }, \"user_in_context\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"project_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"base_project_editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"user_in_context\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"project\", \"relations\": { \"owner\": { \"this\": {} }, \"partner\": { \"this\": {} }, \"manager\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"owner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"project_manager\" } } }, \"editor\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"manager\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"owner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"project_editor\" } } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"partner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"project_editor\" } } } ] } }, \"can_delete\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"manager\" } }, \"can_edit\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"editor\" } }, \"can_view\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"editor\" } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] }, \"partner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } } ] } Node.js Go .NET Python curl CLI Pseudocode await fgaClient.write({ writes: [ // Anne has a `project manager` role at organization A { user: 'user:anne', relation: 'project_manager', object: 'organization:A'}, // Anne has a `project manager` role at organization B { user: 'user:anne', relation: 'project_manager', object: 'organization:B'}, // Anne has a `project manager` role at organization C { user: 'user:anne', relation: 'project_manager', object: 'organization:C'}, // Beth has a `project manager` role at organization B { user: 'user:beth', relation: 'project_manager', object: 'organization:B'}, // Carl has a `project manager` role at organization C { user: 'user:carl', relation: 'project_manager', object: 'organization:C'}, // Organization A owns Project X { user: 'organization:A', relation: 'owner', object: 'project:X'}, // Project X is shared with Organization B { user: 'organization:B', relation: 'partner', object: 'project:X'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne has a `project manager` role at organization A User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:A\"), }, { // Anne has a `project manager` role at organization B User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:B\"), }, { // Anne has a `project manager` role at organization C User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:C\"), }, { // Beth has a `project manager` role at organization B User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:B\"), }, { // Carl has a `project manager` role at organization C User: openfga.PtrString(\"user:carl\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:C\"), }, { // Organization A owns Project X User: openfga.PtrString(\"organization:A\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"project:X\"), }, { // Project X is shared with Organization B User: openfga.PtrString(\"organization:B\"), Relation: openfga.PtrString(\"partner\"), Object: openfga.PtrString(\"project:X\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne has a `project manager` role at organization A new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:A\" }, // Anne has a `project manager` role at organization B new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:B\" }, // Anne has a `project manager` role at organization C new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:C\" }, // Beth has a `project manager` role at organization B new() { User = \"user:beth\", Relation = \"project_manager\", Object = \"organization:B\" }, // Carl has a `project manager` role at organization C new() { User = \"user:carl\", Relation = \"project_manager\", Object = \"organization:C\" }, // Organization A owns Project X new() { User = \"organization:A\", Relation = \"owner\", Object = \"project:X\" }, // Project X is shared with Organization B new() { User = \"organization:B\", Relation = \"partner\", Object = \"project:X\" } }, }; var response = await fgaClient.Write(body, options); options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne has a `project manager` role at organization A user=\"user:anne\", relation=\"project_manager\", object=\"organization:A\", ), ClientTuple( # Anne has a `project manager` role at organization B user=\"user:anne\", relation=\"project_manager\", object=\"organization:B\", ), ClientTuple( # Anne has a `project manager` role at organization C user=\"user:anne\", relation=\"project_manager\", object=\"organization:C\", ), ClientTuple( # Beth has a `project manager` role at organization B user=\"user:beth\", relation=\"project_manager\", object=\"organization:B\", ), ClientTuple( # Carl has a `project manager` role at organization C user=\"user:carl\", relation=\"project_manager\", object=\"organization:C\", ), ClientTuple( # Organization A owns Project X user=\"organization:A\", relation=\"owner\", object=\"project:X\", ), ClientTuple( # Project X is shared with Organization B user=\"organization:B\", relation=\"partner\", object=\"project:X\", ),, ), \", ) response = await fga_client.write(body, options) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:A\"},{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:B\"},{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:C\"},{\"user\":\"user:beth\",\"relation\":\"project_manager\",\"object\":\"organization:B\"},{\"user\":\"user:carl\",\"relation\":\"project_manager\",\"object\":\"organization:C\"},{\"user\":\"organization:A\",\"relation\":\"owner\",\"object\":\"project:X\"},{\"user\":\"organization:B\",\"relation\":\"partner\",\"object\":\"project:X\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:A fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:B fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:C fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth project_manager organization:B fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl project_manager organization:C fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:A owner project:X fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:B partner project:X write([ // Anne has a `project manager` role at organization A { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:A\" }, // Anne has a `project manager` role at organization B { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:B\" }, // Anne has a `project manager` role at organization C { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:C\" }, // Beth has a `project manager` role at organization B { \"user\":\"user:beth\", \"relation\":\"project_manager\", \"object\":\"organization:B\" }, // Carl has a `project manager` role at organization C { \"user\":\"user:carl\", \"relation\":\"project_manager\", \"object\":\"organization:C\" }, // Organization A owns Project X { \"user\":\"organization:A\", \"relation\":\"owner\", \"object\":\"project:X\" }, // Project X is shared with Organization B { \"user\":\"organization:B\", \"relation\":\"partner\", \"object\":\"project:X\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Warning Contextual tuples: Are not persisted in the store. Are only supported on the Check API endpoint and ListObjects API endpoint. They are not supported on read, expand and other endpoints. If you are using the Read Changes API endpoint to build a permission aware search index, note that it will not be trivial to take contextual tuples into account.","s":"Summary","u":"/docs/modeling/organization-context-authorization","h":"#summary","p":654},{"i":675,"t":"Check the following sections for more on how user groups can be used. Modeling with Multiple Restrictions Learn how to model requiring multiple relationships before users are authorized to perform certain actions. More Contextual and Time-Based Authorization Learn how to authorize access that depends on dynamic or contextual criteria. More OpenFGA Check API Details on the Check API in the OpenFGA reference guide. More","s":"Related Sections","u":"/docs/modeling/organization-context-authorization","h":"#related-sections","p":654},{"i":677,"t":"In this guide you will learn how to model roles and permissions model within OpenFGA using the authorization model and relationship tuple. Roles are assigned to users or a group of users, where any user can have more than one role (editor, owner, etc..). Permissions are what allows users to access certain objects based on their specific roles (device_renamer, channel_archiver, etc..). For example, the role viewer of a trip can have permissions to view bookings or the role owners can have permissions to add/view bookings to a trip. When to use When trying to create a role and permissions model within OpenFGA.: Create roles by creating relations that can be directly assigned to users Assign permissions by creating relations that users get through other relations For example: Grant someone an admin role that can edit and read a document Grant someone a security_guard role that can live_video_viewer on a device Grant someone a viewer role that can view_products on a shop There are advantages to implementing roles and permissions within OpenFGA, such as: Breaking down existing roles to have more fine grained permissions. This allows your application to check whether a user has access to a certain object without having to explicitly check that specific users role. Introduce new roles/permissions or consolidate roles without affecting your application behavior. For example: if in your app all the checks are for the fine permissions check('bob', 'booking_adder', 'trip:Europe') instead of check('bob', 'owner', 'trip:Europe'), and then you later decide owners can no longer add bookings to a trip, you can remove the relation within the trip type with no code changes in your application, and all the permissions will automatically honor the change.","s":"Roles and Permissions","u":"/docs/modeling/roles-and-permissions","h":"","p":676},{"i":679,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have a type called trip that users can be related to as viewer and/or an owner. DSL JSON model schema 1.1 type user type trip relations define owner: [user] define viewer: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"trip\", \"relations\": { \"owner\": { \"this\": {} }, \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in Auth OpenFGA A Relationship: OpenFGA will be called to check if there is a relationship between a user and an object, indicating that the access is allowed Direct Relationship Type Restrictions: can be used to indicate direct relationships between users and objects A Check API Request the Check API Request is used to check for relationships between users and objects","s":"Before you start","u":"/docs/modeling/roles-and-permissions","h":"#before-you-start","p":676},{"i":681,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/modeling/roles-and-permissions","h":"#direct-access","p":676},{"i":683,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in Auth OpenFGA A Relationship: OpenFGA will be called to check if there is a relationship between a user and an object, indicating that the access is allowed Direct Relationship Type Restrictions: can be used to indicate direct relationships between users and objects A Check API Request the Check API Request is used to check for relationships between users and objects","s":"OpenFGA Concepts","u":"/docs/modeling/roles-and-permissions","h":"#-concepts","p":676},{"i":685,"t":"To illustrate modeling Roles and Permissions in OpenFGA, we will use a trip booking system where you can have owners and/or viewers that can have more granular permissions such as adding bookings to a trip or viewing bookings on it. In order to represent this, we need to: Understand how roles are related to direct relations for our trip booking system Adding implied relations to existing authorization model to define permissions for bookings Checking user roles and their permissions based on *relationship tuples* for direct and implied relations","s":"Step By Step","u":"/docs/modeling/roles-and-permissions","h":"#step-by-step","p":676},{"i":687,"t":"Relating roles within OpenFGA can be best described as the following: Roles are relations that can be directly assigned to users. Looking at our authorization model, our roles would then be owner and viewer. Meaning that a specific user can be an owner and/or a viewer. DSL JSON model schema 1.1 type user type trip relations define owner: [user] define viewer: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"trip\", \"relations\": { \"owner\": { \"this\": {} }, \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"01. Understand How Roles Work Within Our Trip Booking System","u":"/docs/modeling/roles-and-permissions","h":"#01-understand-how-roles-work-within-our-trip-booking-system","p":676},{"i":689,"t":"Permissions within OpenFGA can be best described as the following: Permissions are relations that users get only through other relations. To represent permissions, we avoid adding a direct relationship type restriction to the relation in the authorization model. Instead, we define the relation from other relations to indicate that it is a permission granted to and implied from a different relation. To add permissions related to bookings, we can add new relations to the trip object type denoting the various actions a user can take on trips (view, edit, delete, rename, etc...) To allow viewers of a trip to have permissions to view bookings and owners to have permissions to add/view bookings, we would modify the type as the following: DSL JSON model schema 1.1 type user type trip relations define owner: [user] define viewer: [user] define booking_adder: owner define booking_viewer: viewer or owner { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"trip\", \"relations\": { \"owner\": { \"this\": {} }, \"viewer\": { \"this\": {} }, \"booking_adder\": { \"computedUserset\": { \"relation\": \"owner\" } }, \"booking_viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"relation\": \"viewer\" } }, { \"computedUserset\": { \"relation\": \"owner\" } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Note: notice how both booking_viewer and booking_adder don't have direct relationship type restrictions. This is to ensure that the relation can only be assigned through the role and not directly.","s":"02. Adding Permissions For Bookings","u":"/docs/modeling/roles-and-permissions","h":"#02-adding-permissions-for-bookings","p":676},{"i":691,"t":"Now that our type definitions reflects the roles and permissions on how bookings can be viewed/added. Let's create relationship tuples to assign roles to users and then check if users have the proper permissions. Let us create two relationship tuples: that gives bob the role of viewer on trip: Europe. that gives alice the role of owner on trip: Europe. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Add bob as viewer on trip:Europe { user: 'user:bob', relation: 'viewer', object: 'trip:Europe'}, // Add alice as owner on trip:Europe { user: 'user:alice', relation: 'owner', object: 'trip:Europe'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Add bob as viewer on trip:Europe User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"trip:Europe\"), }, { // Add alice as owner on trip:Europe User: openfga.PtrString(\"user:alice\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"trip:Europe\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Add bob as viewer on trip:Europe new() { User = \"user:bob\", Relation = \"viewer\", Object = \"trip:Europe\" }, // Add alice as owner on trip:Europe new() { User = \"user:alice\", Relation = \"owner\", Object = \"trip:Europe\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Add bob as viewer on trip:Europe user=\"user:bob\", relation=\"viewer\", object=\"trip:Europe\", ), ClientTuple( # Add alice as owner on trip:Europe user=\"user:alice\", relation=\"owner\", object=\"trip:Europe\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:bob\",\"relation\":\"viewer\",\"object\":\"trip:Europe\"},{\"user\":\"user:alice\",\"relation\":\"owner\",\"object\":\"trip:Europe\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob viewer trip:Europe fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice owner trip:Europe write([ // Add bob as viewer on trip:Europe { \"user\":\"user:bob\", \"relation\":\"viewer\", \"object\":\"trip:Europe\" }, // Add alice as owner on trip:Europe { \"user\":\"user:alice\", \"relation\":\"owner\", \"object\":\"trip:Europe\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Now we can check: is bob allowed to view bookings on trip Europe? Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'booking_viewer', object: 'trip:Europe', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"booking_viewer\", Object: \"trip:Europe\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"booking_viewer\", Object = \"trip:Europe\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"booking_viewer\", object=\"trip:Europe\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob booking_viewer trip:Europe # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"booking_viewer\",\"object\":\"trip:Europe\"}}' # Response: {\"allowed\":true} check( user = \"user:bob\", // check if the user `user:bob` relation = \"booking_viewer\", // has an `booking_viewer` relation object = \"trip:Europe\", // with the object `trip:Europe` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true bob is a booking_viewer because of the following chain of resolution: bob is a viewer on trip: Europe Any user related to the object trip:Europe as viewer is also related as a booking_viewer (i.e usersRelatedToObjectAs: viewer) Therefore, all viewers on a given trip are booking_viewers To confirm that bob is not allowed to add bookings on trip Europe, we can do the following check: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'booking_adder', object: 'trip:Europe', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"booking_adder\", Object: \"trip:Europe\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"booking_adder\", Object = \"trip:Europe\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"booking_adder\", object=\"trip:Europe\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob booking_adder trip:Europe # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"booking_adder\",\"object\":\"trip:Europe\"}}' # Response: {\"allowed\":false} check( user = \"user:bob\", // check if the user `user:bob` relation = \"booking_adder\", // has an `booking_adder` relation object = \"trip:Europe\", // with the object `trip:Europe` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false We can also check: is alice allowed to view and add bookings on trip Europe? Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:alice', relation: 'booking_viewer', object: 'trip:Europe', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:alice\", Relation: \"booking_viewer\", Object: \"trip:Europe\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:alice\", Relation = \"booking_viewer\", Object = \"trip:Europe\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:alice\", relation=\"booking_viewer\", object=\"trip:Europe\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice booking_viewer trip:Europe # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:alice\",\"relation\":\"booking_viewer\",\"object\":\"trip:Europe\"}}' # Response: {\"allowed\":true} check( user = \"user:alice\", // check if the user `user:alice` relation = \"booking_viewer\", // has an `booking_viewer` relation object = \"trip:Europe\", // with the object `trip:Europe` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:alice', relation: 'booking_adder', object: 'trip:Europe', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:alice\", Relation: \"booking_adder\", Object: \"trip:Europe\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:alice\", Relation = \"booking_adder\", Object = \"trip:Europe\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:alice\", relation=\"booking_adder\", object=\"trip:Europe\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice booking_adder trip:Europe # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:alice\",\"relation\":\"booking_adder\",\"object\":\"trip:Europe\"}}' # Response: {\"allowed\":true} check( user = \"user:alice\", // check if the user `user:alice` relation = \"booking_adder\", // has an `booking_adder` relation object = \"trip:Europe\", // with the object `trip:Europe` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true alice is a booking_viewer and booking_adder because of the following chain of resolution: alice is a owner on trip: Europe Any user related to the object trip:Europe as owner is also related as a booking_viewer Any user related to the object trip:Europe as owner is also related as a booking_adder Therefore, all owners on a given trip are booking_viewers and booking_adders on that trip caution Note: Make sure to use unique ids for each object and user within your application domain when creating relationship tuples for OpenFGA. We are using first names and simple ids to just illustrate an easy-to-follow example.","s":"03. Checking User Roles And Their Permissions","u":"/docs/modeling/roles-and-permissions","h":"#03-checking-user-roles-and-their-permissions","p":676},{"i":693,"t":"Check the following sections for more on how to model for roles and permissions. Modeling Concepts: Concentric Relationships Learn about how to represent a concentric relationships in OpenFGA. More Modeling Google Drive See how to indicate that editors are commenters and viewers in Google Drive. More Modeling GitHub See how to indicate that repository admins are writers and readers in GitHub. More","s":"Related Sections","u":"/docs/modeling/roles-and-permissions","h":"#related-sections","p":676},{"i":695,"t":"In the lifecycle of software development, you will need to make updates or changes to the authorization model. In this guide, you will learn best practices for changing your existing authorization model. With these recommendations, you will minimize downtime and ensure your relationship models stay up to date.","s":"Migrating Relations","u":"/docs/modeling/migrating/migrating-relations","h":"","p":694},{"i":697,"t":"This guide assumes you are familiar with the following OpenFGA concepts: A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Intersection Operator: the intersection operator can be used to indicate a relationship exists if the user is in all the sets of users","s":"Before You Start","u":"/docs/modeling/migrating/migrating-relations","h":"#before-you-start","p":694},{"i":699,"t":"The document below is an example of a relational authorization model. In this model, you can assign users to the editor relation. The editor relation has write privileges that regular users do not. In this scenario, you will migrate the following model: DSL JSON model schema 1.1 type document relations define editor: [user] define can_edit: editor type user { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} }, \"can_edit\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"editor\" } } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"user\" } ] } There are existing relationship tuples associated with editor relation. [ { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:roadmap\", }, { \"user\": \"user:charles\", \"relation\": \"editor\", \"object\": \"document:roadmap\", }, ] This is the authorization model that you will want to migrate to: DSL JSON model schema 1.1 type document relations define writer: [user] define can_write: writer type user { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"writer\": { \"this\": {} }, \"can_write\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } }, \"metadata\": { \"relations\": { \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"user\" } ] }","s":"Step By Step","u":"/docs/modeling/migrating/migrating-relations","h":"#step-by-step","p":694},{"i":701,"t":"To avoid service disruption, you will create a backwards compatible model. The backwards compatible model ensures the existing relationship tuple will still work. In the example below, user:Anne still has write privileges to the document:roadmap resource. DSL JSON model schema 1.1 type document relations define editor: [user] define writer: [user] or editor define can_write: writer define can_edit: writer type user { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"can_write\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, \"can_edit\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"user\" } ] } Test the can_edit definition. It should produce a value of true. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_write', object: 'document:roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_write\", Object: \"document:roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_write\", Object = \"document:roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_write\", object=\"document:roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_write document:roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_write\",\"object\":\"document:roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_write\", // has an `can_write` relation object = \"document:roadmap\", // with the object `document:roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_edit', object: 'document:roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_edit\", Object: \"document:roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_edit\", Object = \"document:roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_edit\", object=\"document:roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_edit document:roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_edit\",\"object\":\"document:roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_edit\", // has an `can_edit` relation object = \"document:roadmap\", // with the object `document:roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"01. Create A Backwards Compatible Model","u":"/docs/modeling/migrating/migrating-relations","h":"#01-create-a-backwards-compatible-model","p":694},{"i":703,"t":"Now that you have a backwards compatible model, you can create new relationship tuples with a new relation. In this example, you will add Bethany to the writer relationship. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Bethany assigned writer instead of editor { user: 'user:bethany', relation: 'writer', object: 'document:roadmap'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Bethany assigned writer instead of editor User: openfga.PtrString(\"user:bethany\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"document:roadmap\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Bethany assigned writer instead of editor new() { User = \"user:bethany\", Relation = \"writer\", Object = \"document:roadmap\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Bethany assigned writer instead of editor user=\"user:bethany\", relation=\"writer\", object=\"document:roadmap\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:bethany\",\"relation\":\"writer\",\"object\":\"document:roadmap\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bethany writer document:roadmap write([ // Bethany assigned writer instead of editor { \"user\":\"user:bethany\", \"relation\":\"writer\", \"object\":\"document:roadmap\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Run a check in the API for Bethany to ensure correct access. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bethany', relation: 'can_write', object: 'document:roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bethany\", Relation: \"can_write\", Object: \"document:roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bethany\", Relation = \"can_write\", Object = \"document:roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bethany\", relation=\"can_write\", object=\"document:roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bethany can_write document:roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bethany\",\"relation\":\"can_write\",\"object\":\"document:roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:bethany\", // check if the user `user:bethany` relation = \"can_write\", // has an `can_write` relation object = \"document:roadmap\", // with the object `document:roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"02. Create a New Relationship Tuple","u":"/docs/modeling/migrating/migrating-relations","h":"#02-create-a-new-relationship-tuple","p":694},{"i":705,"t":"Next, migrate the existing relationship tuples. The new relation makes this definition obsolete. Use the read API to lookup all relationship tuples. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Execute a read const { tuples } = await fgaClient.read({ }); // tuples = [{\"key\": {\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"},{\"key\": {\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientReadOptions{} body := ClientReadRequest{ } data, err := fgaClient.Read(context.Background()).Body(requestBody).Options(options).Execute() // data = { \"tuples\": [{\"key\": {\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"},{\"key\": {\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientReadOptions {} var body = new ClientReadRequest() { }; var response = await fgaClient.Read(body, options); // data = { \"tuples\": [{\"key\": {\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"},{\"key\": {\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = {} body = TupleKey( ) response = await fga_client.read(body, options) # response = ReadResponse({\"tuples\":[{\"key\": {\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"},{\"key\": {\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple read --store-id=${FGA_STORE_ID} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" ' # Response: \"tuples\": {[{\"key\": {\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"},{\"key\": {\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]} read( // read all stored tuples ); Reply: tuples:[{\"key\": {\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"},{\"key\": {\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] Then filter out the tuples that do not match the object type or relation (in this case, document and editor respectively), and update the new tuples with the write relationship. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'writer', object: 'document:roadmap'}, { user: 'user:charles', relation: 'writer', object: 'document:roadmap'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"document:roadmap\"), }, { User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"document:roadmap\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"writer\", Object = \"document:roadmap\" }, new() { User = \"user:charles\", Relation = \"writer\", Object = \"document:roadmap\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"writer\", object=\"document:roadmap\", ), ClientTuple( user=\"user:charles\", relation=\"writer\", object=\"document:roadmap\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"writer\",\"object\":\"document:roadmap\"},{\"user\":\"user:charles\",\"relation\":\"writer\",\"object\":\"document:roadmap\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne writer document:roadmap fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles writer document:roadmap write([ { \"user\":\"user:anne\", \"relation\":\"writer\", \"object\":\"document:roadmap\" }, { \"user\":\"user:charles\", \"relation\":\"writer\", \"object\":\"document:roadmap\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Finally, remove the old relationship tuples. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ { user: 'user:anne', relation: 'editor', object: 'document:roadmap'}, { user: 'user:charles', relation: 'editor', object: 'document:roadmap'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"editor\"), Object: openfga.PtrString(\"document:roadmap\"), }, { User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"editor\"), Object: openfga.PtrString(\"document:roadmap\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { new() { User = \"user:anne\", Relation = \"editor\", Object = \"document:roadmap\" }, new() { User = \"user:charles\", Relation = \"editor\", Object = \"document:roadmap\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( user=\"user:anne\", relation=\"editor\", object=\"document:roadmap\", ), ClientTuple( user=\"user:charles\", relation=\"editor\", object=\"document:roadmap\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:roadmap\"},{\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:roadmap\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} user:anne editor document:roadmap fga tuple delete --store-id=${FGA_STORE_ID} user:charles editor document:roadmap delete([ { \"user\":\"user:anne\", \"relation\":\"editor\", \"object\":\"document:roadmap\" }, { \"user\":\"user:charles\", \"relation\":\"editor\", \"object\":\"document:roadmap\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") info Perform a write operation before a delete operation to ensure Anne still has access. Confirm the tuples are correct by running a check on the user. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_write', object: 'document:roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_write\", Object: \"document:roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_write\", Object = \"document:roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_write\", object=\"document:roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_write document:roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_write\",\"object\":\"document:roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_write\", // has an `can_write` relation object = \"document:roadmap\", // with the object `document:roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true The old relationship tuple no longer exists. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'editor', object: 'document:roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"editor\", Object: \"document:roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"editor\", Object = \"document:roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"editor\", object=\"document:roadmap\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne editor document:roadmap # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:roadmap\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"editor\", // has an `editor` relation object = \"document:roadmap\", // with the object `document:roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"03. Migrate The Existing Relationship Tuples","u":"/docs/modeling/migrating/migrating-relations","h":"#03-migrate-the-existing-relationship-tuples","p":694},{"i":707,"t":"After you remove the previous relationship tuples, update your authorization model to remove the obsolete relation. DSL JSON model schema 1.1 type document relations define writer: [user] define can_write: writer type user { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"writer\": { \"this\": {} }, \"can_write\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } }, \"metadata\": { \"relations\": { \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"user\" } ] } Now, the write API will only accept the new relation name.","s":"04. Remove Obsolete Relationship From The Model","u":"/docs/modeling/migrating/migrating-relations","h":"#04-remove-obsolete-relationship-from-the-model","p":694},{"i":709,"t":"Review the following sections for more information on managing relationship tuples. Transactional Writes Learn how to perform transactional write More Relationship Queries Understand the differences between check, read, expand and list objects. More Production Best Practices Learn the best practices of running OpenFGA in a production environment More","s":"Related Sections","u":"/docs/modeling/migrating/migrating-relations","h":"#related-sections","p":694},{"i":711,"t":"This tutorial explains how to model entitlements for a platform like GitHub using OpenFGA. What you will learn How to model an entitlement use case in OpenFGA How to start with a given set of requirements and scenarios and iterate on the OpenFGA model until those requirements are met","s":"Modeling Entitlements for a System with OpenFGA","u":"/docs/modeling/advanced/entitlements","h":"","p":710},{"i":713,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA concepts and know how to develop the things that we will list below. OpenFGA Concepts​ It would be helpful to have an understanding of some concepts of OpenFGA before you start. Modeling Object-to-Object Relationships​ You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more → Used here to indicate that members of an org are subscriber members of the plan the org is subscriber to, and subscriber members of a plan get access to all the plan's features. Direct Relationships​ You need to know how to disallow granting direct relation to an object and requiring the user to have a relation with another object that would imply a relation with the first one. Learn more → Used here to indicate that \"access\" to a feature cannot be directly granted to a user, but is implied through the users organization subscribing to a plan that offers that feature. Concepts & Configuration Language​ Some OpenFGA Concepts Configuration Language","s":"Before You Start","u":"/docs/modeling/advanced/entitlements","h":"#before-you-start","p":710},{"i":715,"t":"It would be helpful to have an understanding of some concepts of OpenFGA before you start.","s":"OpenFGA Concepts","u":"/docs/modeling/advanced/entitlements","h":"#-concepts","p":710},{"i":717,"t":"In many product offerings, the features are behind multiple tiers. In this tutorial, you will build an authorization model for a subset of GitHub's entitlements (detailed below) using OpenFGA. You will use some scenarios to validate the model. At their core, entitlements is just asking: does a user X have access to feature Y? In GitHub's case for example, they have a concept called \"Draft Pull Requests\". Once the user loads the Pull Request page, the frontend needs to know whether it can show the \"Draft Pull Request\" option, as in it needs to know: \"Does the current user have access to feature Draft Pull Request?\". Note: For brevity, this tutorial will not model all of GitHub entitlements. Instead, it will focus on modeling for the scenarios outlined below","s":"What You Will Be Modeling","u":"/docs/modeling/advanced/entitlements","h":"#what-you-will-be-modeling","p":710},{"i":719,"t":"You will model an entitlement system similar to GitHub's, focusing on a few scenarios. GitHub has 3 plans: \"Free\", \"Team\" and \"Enterprise\", with each of them offering several features. The higher-priced plans include all the features of the lower priced plans. You will be focusing on a subset of the features offered. A summary of GitHub's entitlement system: Free Issues Team Everything from the free plan Draft Pull Requests Enterprise Everything from the team plan SAML Single Sign-On","s":"Requirements","u":"/docs/modeling/advanced/entitlements","h":"#requirements","p":710},{"i":721,"t":"Use the following scenarios to be able to validate whether the model of the requirements is correct. Take these three organizations Alpha Beta Gamma (alpha), a subscriber on the free plan Bayer Water Supplies (bayer), a subscriber on the team plan Cups and Dishes (cups), a subscriber on the enterprise plan Take these three users Anne, member of Alpha Beta Gamma Beth, member of Bayer Water Supplies Charles, member of Cups and Dishes By the end of this tutorial, you should be able to query OpenFGA with queries like: Anne has access to Issues (expecting yes) Anne has access to Draft Pull Requests (expecting no) Anne has access to Single Sign-on (expecting no) Beth has access to Issues (expecting yes) Beth has access to Draft Pull Requests (expecting yes) Beth has access to Single Sign-on (expecting no) Charles has access to Issues (expecting yes) Charles has access to Draft Pull Requests (expecting yes) Charles has access to Single Sign-on (expecting yes)","s":"Defined Scenarios","u":"/docs/modeling/advanced/entitlements","h":"#defined-scenarios","p":710},{"i":724,"t":"In this tutorial you are going to take a different approach to previous tutorials. You will start with a simpleauthorization model, add relationship tuples to represent some sample scenarios, and iterate until those scenarios return the results you expect. In the scenarios outlined above, you have organizations, plans and features. Similar to the example above, start with a basic listing of the types and their relations: A feature has a plan associated to it, we'll call the relation between them associated_plan A plan has an organization as a subscriber to it An organization has users as members DSL JSON model schema 1.1 type user type feature relations define associated_plan: [plan] type plan relations define subscriber: [organization] type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] } } } }, { \"type\": \"plan\", \"relations\": { \"subscriber\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"subscriber\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"01. Building The Initial Authorization Model And Relationship Tuples","u":"/docs/modeling/advanced/entitlements","h":"#01-building-the-initial-authorization-model-and-relationship-tuples","p":710},{"i":726,"t":"Now you can add the relationship tuples to represent these relationships mentioned in the requirements and scenarios sections: The relations between the features and plans are as follows: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // the free plan is the associated plan of the issues feature { user: 'plan:free', relation: 'associated_plan', object: 'feature:issues'}, // the team plan is the associated plan of the issues feature { user: 'plan:team', relation: 'associated_plan', object: 'feature:issues'}, // the team plan is the associated plan of the draft pull requests feature { user: 'plan:team', relation: 'associated_plan', object: 'feature:draft_prs'}, // the enterprise plan is the associated plan of the issues feature { user: 'plan:enterprise', relation: 'associated_plan', object: 'feature:issues'}, // the enterprise plan is the associated plan of the draft pull requests feature { user: 'plan:enterprise', relation: 'associated_plan', object: 'feature:draft_prs'}, // the enterprise plan is the associated plan of the SAML Single Sign-on feature { user: 'plan:enterprise', relation: 'associated_plan', object: 'feature:sso'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // the free plan is the associated plan of the issues feature User: openfga.PtrString(\"plan:free\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:issues\"), }, { // the team plan is the associated plan of the issues feature User: openfga.PtrString(\"plan:team\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:issues\"), }, { // the team plan is the associated plan of the draft pull requests feature User: openfga.PtrString(\"plan:team\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:draft_prs\"), }, { // the enterprise plan is the associated plan of the issues feature User: openfga.PtrString(\"plan:enterprise\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:issues\"), }, { // the enterprise plan is the associated plan of the draft pull requests feature User: openfga.PtrString(\"plan:enterprise\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:draft_prs\"), }, { // the enterprise plan is the associated plan of the SAML Single Sign-on feature User: openfga.PtrString(\"plan:enterprise\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:sso\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // the free plan is the associated plan of the issues feature new() { User = \"plan:free\", Relation = \"associated_plan\", Object = \"feature:issues\" }, // the team plan is the associated plan of the issues feature new() { User = \"plan:team\", Relation = \"associated_plan\", Object = \"feature:issues\" }, // the team plan is the associated plan of the draft pull requests feature new() { User = \"plan:team\", Relation = \"associated_plan\", Object = \"feature:draft_prs\" }, // the enterprise plan is the associated plan of the issues feature new() { User = \"plan:enterprise\", Relation = \"associated_plan\", Object = \"feature:issues\" }, // the enterprise plan is the associated plan of the draft pull requests feature new() { User = \"plan:enterprise\", Relation = \"associated_plan\", Object = \"feature:draft_prs\" }, // the enterprise plan is the associated plan of the SAML Single Sign-on feature new() { User = \"plan:enterprise\", Relation = \"associated_plan\", Object = \"feature:sso\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # the free plan is the associated plan of the issues feature user=\"plan:free\", relation=\"associated_plan\", object=\"feature:issues\", ), ClientTuple( # the team plan is the associated plan of the issues feature user=\"plan:team\", relation=\"associated_plan\", object=\"feature:issues\", ), ClientTuple( # the team plan is the associated plan of the draft pull requests feature user=\"plan:team\", relation=\"associated_plan\", object=\"feature:draft_prs\", ), ClientTuple( # the enterprise plan is the associated plan of the issues feature user=\"plan:enterprise\", relation=\"associated_plan\", object=\"feature:issues\", ), ClientTuple( # the enterprise plan is the associated plan of the draft pull requests feature user=\"plan:enterprise\", relation=\"associated_plan\", object=\"feature:draft_prs\", ), ClientTuple( # the enterprise plan is the associated plan of the SAML Single Sign-on feature user=\"plan:enterprise\", relation=\"associated_plan\", object=\"feature:sso\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"plan:free\",\"relation\":\"associated_plan\",\"object\":\"feature:issues\"},{\"user\":\"plan:team\",\"relation\":\"associated_plan\",\"object\":\"feature:issues\"},{\"user\":\"plan:team\",\"relation\":\"associated_plan\",\"object\":\"feature:draft_prs\"},{\"user\":\"plan:enterprise\",\"relation\":\"associated_plan\",\"object\":\"feature:issues\"},{\"user\":\"plan:enterprise\",\"relation\":\"associated_plan\",\"object\":\"feature:draft_prs\"},{\"user\":\"plan:enterprise\",\"relation\":\"associated_plan\",\"object\":\"feature:sso\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:free associated_plan feature:issues fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:team associated_plan feature:issues fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:team associated_plan feature:draft_prs fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:enterprise associated_plan feature:issues fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:enterprise associated_plan feature:draft_prs fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:enterprise associated_plan feature:sso write([ // the free plan is the associated plan of the issues feature { \"user\":\"plan:free\", \"relation\":\"associated_plan\", \"object\":\"feature:issues\" }, // the team plan is the associated plan of the issues feature { \"user\":\"plan:team\", \"relation\":\"associated_plan\", \"object\":\"feature:issues\" }, // the team plan is the associated plan of the draft pull requests feature { \"user\":\"plan:team\", \"relation\":\"associated_plan\", \"object\":\"feature:draft_prs\" }, // the enterprise plan is the associated plan of the issues feature { \"user\":\"plan:enterprise\", \"relation\":\"associated_plan\", \"object\":\"feature:issues\" }, // the enterprise plan is the associated plan of the draft pull requests feature { \"user\":\"plan:enterprise\", \"relation\":\"associated_plan\", \"object\":\"feature:draft_prs\" }, // the enterprise plan is the associated plan of the SAML Single Sign-on feature { \"user\":\"plan:enterprise\", \"relation\":\"associated_plan\", \"object\":\"feature:sso\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") The relations between the plans and the organizations are as follows: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // the Alpha Beta Gamma organization is a subscriber of the free plan { user: 'organization:alpha', relation: 'subscriber', object: 'plan:free'}, // the Bayer Water Supplies organization is a subscriber of the team plan { user: 'organization:bayer', relation: 'subscriber', object: 'plan:team'}, // the Cups and Dishes organization is a subscriber of the enterprise plan { user: 'organization:cups', relation: 'subscriber', object: 'plan:enterprise'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // the Alpha Beta Gamma organization is a subscriber of the free plan User: openfga.PtrString(\"organization:alpha\"), Relation: openfga.PtrString(\"subscriber\"), Object: openfga.PtrString(\"plan:free\"), }, { // the Bayer Water Supplies organization is a subscriber of the team plan User: openfga.PtrString(\"organization:bayer\"), Relation: openfga.PtrString(\"subscriber\"), Object: openfga.PtrString(\"plan:team\"), }, { // the Cups and Dishes organization is a subscriber of the enterprise plan User: openfga.PtrString(\"organization:cups\"), Relation: openfga.PtrString(\"subscriber\"), Object: openfga.PtrString(\"plan:enterprise\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // the Alpha Beta Gamma organization is a subscriber of the free plan new() { User = \"organization:alpha\", Relation = \"subscriber\", Object = \"plan:free\" }, // the Bayer Water Supplies organization is a subscriber of the team plan new() { User = \"organization:bayer\", Relation = \"subscriber\", Object = \"plan:team\" }, // the Cups and Dishes organization is a subscriber of the enterprise plan new() { User = \"organization:cups\", Relation = \"subscriber\", Object = \"plan:enterprise\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # the Alpha Beta Gamma organization is a subscriber of the free plan user=\"organization:alpha\", relation=\"subscriber\", object=\"plan:free\", ), ClientTuple( # the Bayer Water Supplies organization is a subscriber of the team plan user=\"organization:bayer\", relation=\"subscriber\", object=\"plan:team\", ), ClientTuple( # the Cups and Dishes organization is a subscriber of the enterprise plan user=\"organization:cups\", relation=\"subscriber\", object=\"plan:enterprise\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"organization:alpha\",\"relation\":\"subscriber\",\"object\":\"plan:free\"},{\"user\":\"organization:bayer\",\"relation\":\"subscriber\",\"object\":\"plan:team\"},{\"user\":\"organization:cups\",\"relation\":\"subscriber\",\"object\":\"plan:enterprise\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:alpha subscriber plan:free fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:bayer subscriber plan:team fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:cups subscriber plan:enterprise write([ // the Alpha Beta Gamma organization is a subscriber of the free plan { \"user\":\"organization:alpha\", \"relation\":\"subscriber\", \"object\":\"plan:free\" }, // the Bayer Water Supplies organization is a subscriber of the team plan { \"user\":\"organization:bayer\", \"relation\":\"subscriber\", \"object\":\"plan:team\" }, // the Cups and Dishes organization is a subscriber of the enterprise plan { \"user\":\"organization:cups\", \"relation\":\"subscriber\", \"object\":\"plan:enterprise\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") The relations between the organizations and the users are as follows: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // anne is a member of the Alpha Beta Gamma organization { user: 'user:anne', relation: 'member', object: 'organization:alpha'}, // beth is a member of the Bayer Water Supplies { user: 'user:beth', relation: 'member', object: 'organization:bayer'}, // charles is a member of the Cups and Dishes organization { user: 'user:charles', relation: 'member', object: 'organization:cups'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // anne is a member of the Alpha Beta Gamma organization User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"organization:alpha\"), }, { // beth is a member of the Bayer Water Supplies User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"organization:bayer\"), }, { // charles is a member of the Cups and Dishes organization User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"organization:cups\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // anne is a member of the Alpha Beta Gamma organization new() { User = \"user:anne\", Relation = \"member\", Object = \"organization:alpha\" }, // beth is a member of the Bayer Water Supplies new() { User = \"user:beth\", Relation = \"member\", Object = \"organization:bayer\" }, // charles is a member of the Cups and Dishes organization new() { User = \"user:charles\", Relation = \"member\", Object = \"organization:cups\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # anne is a member of the Alpha Beta Gamma organization user=\"user:anne\", relation=\"member\", object=\"organization:alpha\", ), ClientTuple( # beth is a member of the Bayer Water Supplies user=\"user:beth\", relation=\"member\", object=\"organization:bayer\", ), ClientTuple( # charles is a member of the Cups and Dishes organization user=\"user:charles\", relation=\"member\", object=\"organization:cups\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"member\",\"object\":\"organization:alpha\"},{\"user\":\"user:beth\",\"relation\":\"member\",\"object\":\"organization:bayer\"},{\"user\":\"user:charles\",\"relation\":\"member\",\"object\":\"organization:cups\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member organization:alpha fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth member organization:bayer fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles member organization:cups write([ // anne is a member of the Alpha Beta Gamma organization { \"user\":\"user:anne\", \"relation\":\"member\", \"object\":\"organization:alpha\" }, // beth is a member of the Bayer Water Supplies { \"user\":\"user:beth\", \"relation\":\"member\", \"object\":\"organization:bayer\" }, // charles is a member of the Cups and Dishes organization { \"user\":\"user:charles\", \"relation\":\"member\", \"object\":\"organization:cups\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") So far you have given OpenFGA a representation of the current state of your system's relationships. You will keep iterating and updating the authorization model until the results of the queries match what you expect. caution In production, it is highly recommended to use unique, immutable identifiers. Names are used in this article to make it easier to read and follow. For example, the relationship tuple indicating that anne is a member of organization:alpha could be written as: user: user:2b4840f2-7c9c-42c8-9329-911002051524 relation: member object: project:52e529c6-c571-4d5c-b78a-bc574cf98b54 Verification​ Now that you have some data, you can start using it to ask is ${USER} related to ${OBJECT} as ${RELATION}? First, you will check if anne is a member of organization:alpha. This is one of the relationship tuples you previously added, you will make sure OpenFGA can detect a relation in this case. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'member', object: 'organization:alpha', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"member\", Object: \"organization:alpha\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"member\", Object = \"organization:alpha\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"member\", object=\"organization:alpha\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member organization:alpha # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"member\",\"object\":\"organization:alpha\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"member\", // has an `member` relation object = \"organization:alpha\", // with the object `organization:alpha` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Querying for relationship tuples that you fed into OpenFGA earlier should work, try a few before proceeding to make sure everything is working well. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'member', object: 'organization:bayer', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"member\", Object: \"organization:bayer\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"member\", Object = \"organization:bayer\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"member\", object=\"organization:bayer\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member organization:bayer # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"member\",\"object\":\"organization:bayer\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"member\", // has an `member` relation object = \"organization:bayer\", // with the object `organization:bayer` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'organization:bayer', relation: 'subscriber', object: 'plan:team', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"organization:bayer\", Relation: \"subscriber\", Object: \"plan:team\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"organization:bayer\", Relation = \"subscriber\", Object = \"plan:team\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"organization:bayer\", relation=\"subscriber\", object=\"plan:team\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:bayer subscriber plan:team # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"organization:bayer\",\"relation\":\"subscriber\",\"object\":\"plan:team\"}}' # Response: {\"allowed\":true} check( user = \"organization:bayer\", // check if the user `organization:bayer` relation = \"subscriber\", // has an `subscriber` relation object = \"plan:team\", // with the object `plan:team` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'plan:free', relation: 'associated_plan', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"plan:free\", Relation: \"associated_plan\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"plan:free\", Relation = \"associated_plan\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"plan:free\", relation=\"associated_plan\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:free associated_plan feature:issues # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"plan:free\",\"relation\":\"associated_plan\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":true} check( user = \"plan:free\", // check if the user `plan:free` relation = \"associated_plan\", // has an `associated_plan` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"02. Populating The Relationship Tuples","u":"/docs/modeling/advanced/entitlements","h":"#02-populating-the-relationship-tuples","p":710},{"i":728,"t":"You are working towards OpenFGA returning the correct answer when you query whether anne has access to feature:issues. It won't work yet, but you will keep updating your configuration to reach that goal. To start, try to run that query on is anne related to feature:issues as access? Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'access', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = undefined Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"access\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: undefined } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"access\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = undefined Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"access\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = undefined Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues # Response: {\"allowed\":undefined} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"access\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":undefined} check( user = \"user:anne\", // check if the user `user:anne` relation = \"access\", // has an `access` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: undefined The OpenFGA service is returning that the query tuple is invalid. That is because you are asking for relation as access, but that relation is not in the configuration of the feature type! Add it now. Like so: DSL JSON type feature relations define associated_plan: [plan] define access: [user] { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } info access relation was added to the configuration of the feature type. note In this tutorial, you will find the phrases direct relationship and implied relationship. A direct relationship R between user X and object Y means the relationship tuple (user=X, relation=R, object=Y) exists, and the OpenFGA authorization model for that relation allows this direct relationship (by use of direct relationship type restrictions). An implied relationship R exists between user X and object Y if user X is related to an object Z that is in direct or implied relationship with object Y, and the OpenFGA authorization model allows it. The resulting updated configuration would be: DSL JSON model schema 1.1 type user type feature relations define associated_plan: [plan] define access: [user] type plan relations define subscriber: [organization] type organization relations define member: [] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"plan\", \"relations\": { \"subscriber\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"subscriber\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"subscriber\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Adding Modeling Pattern Of Parent-Child Objects​ Now we can ask the following query: is anne related to feature:issues as access? again. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'access', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"access\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"access\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"access\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"access\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"access\", // has an `access` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false So far so good. OpenFGA understood your query, but said that no relation exists. That is because according to the configuration provided so far, there is no access relation between anne and feature:issues. We can also try to query is organization:alpha related to feature:issues as access? and we see that there is no relationship. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'organization:alpha', relation: 'access', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"organization:alpha\", Relation: \"access\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"organization:alpha\", Relation = \"access\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"organization:alpha\", relation=\"access\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:alpha access feature:issues # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"organization:alpha\",\"relation\":\"access\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":false} check( user = \"organization:alpha\", // check if the user `organization:alpha` relation = \"access\", // has an `access` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false If you have already completed some of the other tutorials you might have encountered the modeling pattern of parent-child objects which is modeled as such: DSL JSON type object relations define viewer: all_objects_viewer from parent { \"type_definitions\": [ { \"type\": \"object\", \"relations\": { \"viewer\": { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"parent\" }, \"computedUserset\": { \"relation\": \"all_objects_viewer\" } } } } } ] } info With this, when asked to check a user's viewer relationship with the object, OpenFGA will: Read all relationship tuples of users related to this particular object as relation parent For each relationship tuple, return all usersets that have all_objects_viewer relation to the objects in those relationship tuples If the user is in any of those usersets, return yes, as the user is a viewer on this object. In other words, users related as all_objects_viewer to any of this object's parents are related as viewer to this object. If you want to give all subscribers on a plan access to a feature, you can do it like so: DSL JSON type feature relations define associated_plan: [plan] define access: [user] or subscriber from associated_plan { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber\" } } } ] } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } info Users related to feature as access are the union of (any of): the set of users with a direct access relation the set of users related to the associated_plan as subscriber (the feature's associated plans' subscribers) So everyone who has direct access, as well as the subscribers of the associated plan That would mean that in order for an object to have an access relation to a feature y, there needs to be either: a direct relationship via a relationship tuple: e.g. { \"user\": \"user:x\", \"relation\": \"access\", \"object\": \"feature:y\" } a subscriber relationship with another object related to x associated_plan: e.g. { \"user\": \"user:x\", \"relation\": \"subscriber\", \"object\": \"plan:z\" } { \"user\": \"plan:z\", \"relation\": \"associated_plan\", \"object\": \"feature:y\" } That brings you close. That will allow you to grant organizations access to the feature (as organizations have a subscriber relation with the plan). Adding Subscriber Relationship With Another Object Related To x associated_plan​ One way forward would be to add a direct access relation between a user and a feature e.g. { \"user\": \"anne\", \"relation\": \"access\", \"object\": \"feature:y\" } whenever the organization anne is subscribed to a plan, or the organization anne is in subscribes to a new plan. But there are several downsides to this: Your application layer now needs to worry about computing this relationship. Instead of letting OpenFGA figure this all out, the app layer needs to do the checks whenever a user is being added or removed If an organization changes its subscription, your application layer has to loop through all the users and update their access relationships to features accordingly Later in this tutorial, you will remove the possibility of having a direct access relation completely, but for now you will make sure the changes to the store you have made so far are working. Replace all the existing code you had previously with the updated authorization model from the below snippet. DSL JSON model schema 1.1 type user type feature relations define associated_plan: [plan] define access: [user] or subscriber from associated_plan type plan relations define subscriber: [organization] type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber\" } } } ] } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"plan\", \"relations\": { \"subscriber\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"subscriber\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Now we can ask following query: is organization:alpha related to feature:issues as access? again. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'organization:alpha', relation: 'access', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"organization:alpha\", Relation: \"access\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"organization:alpha\", Relation = \"access\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"organization:alpha\", relation=\"access\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:alpha access feature:issues # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"organization:alpha\",\"relation\":\"access\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":true} check( user = \"organization:alpha\", // check if the user `organization:alpha` relation = \"access\", // has an `access` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true You will notice that OpenFGA now did find a relation, as organization:alpha is a subscriber to plan:free which has an associated_plan relation to feature:issues. From that and the authorization model you updated above, OpenFGA deduced that organization:alpha has an implied access relation to feature:issues. That is good, but you want to be able to ask is anne related to feature:issues as access?, not is organization:alpha related to feature:issues as access?. As in, you want the subscriber members to have access to the feature, not the subscriber itself. In order to do that, you will add a relation on the plan, that indicates that all members of an organization subscribed to it, have a subscriber_member relation to the plan. And you can modify the change you did above to give implied access to the subscriber_member instead of the subscriber. Like so: DSL JSON model schema 1.1 type user type feature relations define associated_plan: [plan] define access: [user] or subscriber_member from associated_plan type plan relations define subscriber: [organization] define subscriber_member: member from subscriber type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber_member\" } } } ] } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"plan\", \"relations\": { \"subscriber\": { \"this\": {} }, \"subscriber_member\": { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"subscriber\" }, \"computedUserset\": { \"relation\": \"member\" } } } }, \"metadata\": { \"relations\": { \"subscriber\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Notice that subscriber has been updated to subscriber_member in the access relation of the feature type. Under the plan type, in order for someone to have a subscriber_member relation to the plan, they have to be related as a member to the object related as a subscriber to the plan (as in they have to be a member of on of the plan's subscribers). Now ask the following query: is anne related to feature:issues as access? Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'access', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"access\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"access\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"access\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"access\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"access\", // has an `access` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Disallow Direct Relationship​ So far, with just a OpenFGA authorization model, and the initial relationship tuples indicating the relations you know, you configured OpenFGA to give you the correct response. Earlier on, the idea of not allowing a direct access relation between a user and a feature was discussed, e.g. adding a relationship tuple like { \"user\": \"user:anne\", \"relation\": \"access\", \"object\": \"feature:y\" }. You will remove it now. To disallow a direct relationship, you need to remove the direct relationship type restriction. The following snippet: DSL JSON type feature relations define associated_plan: [plan] define access: [user] or subscriber_member from associated_plan { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber_member\" } } } ] } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } becomes DSL JSON type feature relations define associated_plan: [plan] define access: subscriber_member from associated_plan { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber_member\" } } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] } } } } With this change, even if your app layer added the following relationship tuple: { \"user\": \"user:anne\", \"relation\": \"access\", \"object\": feature:issues } a subsequent check for is anne related to feature:issues as access? would return no relation. The only way for a relation to exist is if the following three relationship tuples do: { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"organization:z\" } { \"user\": \"organization:z\", \"relation\": \"subscriber\", \"object\": \"plan:y\" } { \"user\": \"plan:y\", \"relation\": \"associated_plan\", \"object\": \"feature:issues\" } Verification​ Ensure that your authorization model matches the one below DSL JSON model schema 1.1 type user type feature relations define associated_plan: [plan] define access: subscriber_member from associated_plan type plan relations define subscriber: [organization] define subscriber_member: member from subscriber type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber_member\" } } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] } } } }, { \"type\": \"plan\", \"relations\": { \"subscriber\": { \"this\": {} }, \"subscriber_member\": { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"subscriber\" }, \"computedUserset\": { \"relation\": \"member\" } } } }, \"metadata\": { \"relations\": { \"subscriber\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } You will now verify that the configuration is correct by running checks for all the scenarios mentioned at the beginning of the tutorial: Anne has access to Issues (expecting yes) Anne has access to Draft Pull Requests (expecting no) Anne has access to Single Sign-on (expecting no) Beth has access to Issues (expecting yes) Beth has access to Draft Pull Requests (expecting yes) Beth has access to Single Sign-on (expecting no) Charles has access to Issues (expecting yes) Charles has access to Draft Pull Requests (expecting yes) Charles has access to Single Sign-on (expecting yes) Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'access', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"access\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"access\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"access\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"access\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"access\", // has an `access` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Try to verify for the other user, object and relation combinations as listed below. User Object Relation Query Relation? anne feature:issues access is anne related to feature:issues as access? Yes anne feature:draft_prs access is anne related to feature:draft_prs as access? No anne feature:sso access is anne related to feature:sso as access? No beth feature:issues access is beth related to feature:issues as access? Yes beth feature:draft_prs access is beth related to feature:draft_prs as access? Yes beth feature:sso access is beth related to feature:sso as access? No charles feature:issues access is charles related to feature:issues as access? Yes charles feature:draft_prs access is charles related to feature:draft_prs as access? Yes charles feature:sso access is charles related to feature:sso as access? Yes","s":"03. Updating The Authorization Model","u":"/docs/modeling/advanced/entitlements","h":"#03-updating-the-authorization-model","p":710},{"i":730,"t":"In this tutorial, you learned: to model entitlements for a system in OpenFGA how to start with a set of requirements and scenarios and iterate on the OpenFGA authorization model until the checks match the expected scenarios how to model parent-child relationships to indicate that a user having a relationship with a certain object implies having a relationship with another object in OpenFGA how to use the union operator condition to indicate multiple possible paths for a relationship between two objects to be computed using direct relationship type restrictions in a OpenFGA authorization model, and how to block direct relationships by removing it Upcoming tutorials will dive deeper into OpenFGA, introducing concepts that will improve on the model you built today, and tackling different permission systems, with other relations and requirements that need to be met.","s":"Summary","u":"/docs/modeling/advanced/entitlements","h":"#summary","p":710},{"i":732,"t":"This tutorial explains how to model GitHub's Organization permission model using OpenFGA. This article from the GitHub docs has links to all other articles we are going to be exploring in this document. What you will learn Indicate relationships between a group of users and an object. See Modeling User Groups for more details. Used here to indicate that all members of an organization are repository admins on the organization. Modeling concentric relationship to have a certain relation on an object imply another relation on the same object. See Modeling Concepts: Concentric Relationships for more. Used here to indicate that maintainers of a repository are also writers of that repository. Using the union operator condition to indicate that a user might have a certain relation with an object if they match any of the criteria indicated. Used here to indicate that a user can be a reader on a repository, or can have the reader relationship implied through triager. Model parent-child objects to indicate that a user having a relationship with a certain object implies having a relationship with another object in OpenFGA. Used here to indicate that a repository admin on a GitHub organization, is an admin on all repositories that organization owns.","s":"Modeling GitHub permissions with OpenFGA","u":"/docs/modeling/advanced/github","h":"","p":731},{"i":734,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA concepts and know how to develop the things that we will list below. OpenFGA Concepts​ It would be helpful to have an understanding of some concepts of OpenFGA before you start. Modeling Concentric Relationships​ You need to know how to update the authorization model to allow having nested relations such as all writers are readers. Learn more → Modeling Object-to-Object Relationships​ You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more → Used here to indicate that users who have repo admin access on an organization, have admin access to all repositories owned by that organization. Concepts & Configuration Language​ Some OpenFGA Concepts Configuration Language","s":"Before You Start","u":"/docs/modeling/advanced/github","h":"#before-you-start","p":731},{"i":736,"t":"It would be helpful to have an understanding of some concepts of OpenFGA before you start.","s":"OpenFGA Concepts","u":"/docs/modeling/advanced/github","h":"#-concepts","p":731},{"i":738,"t":"GitHub is a system to develop and collaborate on code. In this tutorial, you will build a subset of the GitHub permission model (detailed below) in OpenFGA, using some scenarios to validate the model. Note: For brevity, this tutorial will not model all of GitHub's permissions. Instead, it will focus on modeling for the scenarios outlined below","s":"What You Will Be Modeling","u":"/docs/modeling/advanced/github","h":"#what-you-will-be-modeling","p":731},{"i":740,"t":"GitHub's permission model is represented in their documentation. In this tutorial, you will be focusing on a subset of these permissions. Requirements: Users can be admins, maintainers, writers, triagers or readers of repositories (each level inherits all access of the level lower than it. e.g. admins inherit maintainer access and so forth) Teams can have members Organizations can have members Organizations can own repositories Users can have repository admin access on organizations, and thus have admin access to all repositories owned by that organization","s":"Requirements","u":"/docs/modeling/advanced/github","h":"#requirements","p":731},{"i":742,"t":"There will be the following users: Anne Beth Charles, a member of the contoso/engineering team Diane, a member of the contoso/protocols team Erik, a member of the contoso org And these requirements: members of the contoso/protocols team are members of the contoso/engineering team members of the contoso org are repo_admins on the org repo admins on the org are admins on all the repos the org owns There will be a: contoso/tooling repository, owned by the contoso org and of which Beth is a writer and Anne is a reader and members of the contoso/engineering team are admins","s":"Defined Scenarios","u":"/docs/modeling/advanced/github","h":"#defined-scenarios","p":731},{"i":745,"t":"GitHub has 5 different permission levels for repositories: At the end of this section we want to end up with the following permissions represented: To represent permissions in OpenFGA we use relations. For repository permissions we need to create the following authorization model: DSL JSON model schema 1.1 type user type repo relations define reader: [user] define triager: [user] define writer: [user] define maintainer: [user] define admin: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"reader\": { \"this\": {} }, \"triager\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"maintainer\": { \"this\": {} }, \"admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"triager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"maintainer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The OpenFGA service determines if a user has access to an object by checking if the user has a relation to that object. Let us examine one of those relations in detail: DSL JSON model schema 1.1 type user type repo relations define reader: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"reader\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Objects of type \"repo\" have users related to them as \"reader\" if those users belong to the userset of all users related to the repo as \"reader\" If we want to say anne is a reader of repository repo:contoso/tooling we create this relationship tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'reader', object: 'repo:contoso/tooling'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"reader\"), Object: openfga.PtrString(\"repo:contoso/tooling\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"reader\", Object = \"repo:contoso/tooling\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"reader\", object=\"repo:contoso/tooling\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"repo:contoso/tooling\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader repo:contoso/tooling write([ { \"user\":\"user:anne\", \"relation\":\"reader\", \"object\":\"repo:contoso/tooling\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") We can now ask OpenFGA \"is anne a reader of repository repo:contoso/tooling?\" Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader repo:contoso/tooling # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true We could also say that beth is a writer of the same repository: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:beth', relation: 'writer', object: 'repo:contoso/tooling'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"repo:contoso/tooling\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:beth\", Relation = \"writer\", Object = \"repo:contoso/tooling\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:beth\", relation=\"writer\", object=\"repo:contoso/tooling\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:beth\",\"relation\":\"writer\",\"object\":\"repo:contoso/tooling\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth writer repo:contoso/tooling write([ { \"user\":\"user:beth\", \"relation\":\"writer\", \"object\":\"repo:contoso/tooling\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") And ask some questions to OpenFGA: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'writer', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"writer\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"writer\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"writer\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth writer repo:contoso/tooling # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"writer\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"writer\", // has an `writer` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'reader', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"reader\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"reader\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"reader\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth reader repo:contoso/tooling # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"reader\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":false} check( user = \"user:beth\", // check if the user `user:beth` relation = \"reader\", // has an `reader` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false The first reply makes sense but the second one does not. Intuitively, if beth was writer, she was also be a reader. In fact, GitHub explains this in their documentation To make OpenFGA aware of this \"concentric\" permission model we need to update our definitions: DSL JSON model schema 1.1 type user type repo relations define reader: [user] or triager define triager: [user] or writer define writer: [user] or maintainer define maintainer: [user] or admin define admin: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"triager\" } } ] } }, \"triager\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"maintainer\" } } ] } }, \"maintainer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"admin\" } } ] } }, \"admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"triager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"maintainer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Let us examine one of those relations in detail: DSL JSON type repo relations define reader: [user] or triager { \"type\": \"repo\", \"relations\": { \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"triager\" } } ] } } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } info The users with a reader relationship to a certain object of type \"repo\" are any of: the \"readers\": the set of users who are directly related to the repo as a \"reader\" the \"triagers\": the set of users who are related to the object as \"triager\" With this simple update our model now supports nested definitions and now: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'writer', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"writer\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"writer\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"writer\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth writer repo:contoso/tooling # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"writer\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"writer\", // has an `writer` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'reader', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"reader\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"reader\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"reader\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth reader repo:contoso/tooling # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"reader\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"reader\", // has an `reader` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"01. Permissions For Individuals In An Org","u":"/docs/modeling/advanced/github","h":"#01-permissions-for-individuals-in-an-org","p":731},{"i":747,"t":"GitHub also supports creating teams in an organization, adding members to a team and granting teams permissions, rather than individuals. At the end of this section we want to end up with the following permissions represented: To add support for teams and memberships all we need to do is add this object to the OpenFGA authorization model: DSL JSON model schema 1.1 type team relations define member: [user, team#member] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } } ] } In addition, the repo's relations should be add team member as a directly related user types. DSL JSON model schema 1.1 type user type repo relations define reader: [user, team#member] or triager define triager: [user, team#member] or writer define writer: [user, team#member] or maintainer define maintainer: [user, team#member] or admin define admin: [user, team#member] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"triager\" } } ] } }, \"triager\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"maintainer\" } } ] } }, \"maintainer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"admin\" } } ] } }, \"admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"triager\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"maintainer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } } ] } Let us now create a team, add a member to it and make it an admin of repo:contoso/tooling by adding the following relationship tuples: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // make charles a member of the contoso/engineering team { user: 'user:charles', relation: 'member', object: 'team:contoso/engineering'}, // make members of contoso/engineering team admins of contoso/tooling { user: 'team:contoso/engineering#member', relation: 'admin', object: 'repo:contoso/tooling'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // make charles a member of the contoso/engineering team User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"team:contoso/engineering\"), }, { // make members of contoso/engineering team admins of contoso/tooling User: openfga.PtrString(\"team:contoso/engineering#member\"), Relation: openfga.PtrString(\"admin\"), Object: openfga.PtrString(\"repo:contoso/tooling\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // make charles a member of the contoso/engineering team new() { User = \"user:charles\", Relation = \"member\", Object = \"team:contoso/engineering\" }, // make members of contoso/engineering team admins of contoso/tooling new() { User = \"team:contoso/engineering#member\", Relation = \"admin\", Object = \"repo:contoso/tooling\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # make charles a member of the contoso/engineering team user=\"user:charles\", relation=\"member\", object=\"team:contoso/engineering\", ), ClientTuple( # make members of contoso/engineering team admins of contoso/tooling user=\"team:contoso/engineering#member\", relation=\"admin\", object=\"repo:contoso/tooling\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:charles\",\"relation\":\"member\",\"object\":\"team:contoso/engineering\"},{\"user\":\"team:contoso/engineering#member\",\"relation\":\"admin\",\"object\":\"repo:contoso/tooling\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles member team:contoso/engineering fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw team:contoso/engineering#member admin repo:contoso/tooling write([ // make charles a member of the contoso/engineering team { \"user\":\"user:charles\", \"relation\":\"member\", \"object\":\"team:contoso/engineering\" }, // make members of contoso/engineering team admins of contoso/tooling { \"user\":\"team:contoso/engineering#member\", \"relation\":\"admin\", \"object\":\"repo:contoso/tooling\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") The last relationship tuple introduces a new OpenFGA concept. A userset. When the value of a user is formatted like this type:objectId#relation, OpenFGA will automatically expand the userset into all its individual user identifiers: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:charles', relation: 'admin', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:charles\", Relation: \"admin\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:charles\", Relation = \"admin\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:charles\", relation=\"admin\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles admin repo:contoso/tooling # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:charles\",\"relation\":\"admin\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":true} check( user = \"user:charles\", // check if the user `user:charles` relation = \"admin\", // has an `admin` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"02. Permissions For Teams In An Org","u":"/docs/modeling/advanced/github","h":"#02-permissions-for-teams-in-an-org","p":731},{"i":749,"t":"GitHub also supports team nesting, known as \"child teams\". Child teams inherit the access permissions of the parent team. Let's say we have a protocols team that is part of the engineering. The simplest way to achieve the aforementioned requirement is just adding this relationship tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'team:contoso/protocols#member', relation: 'member', object: 'team:contoso/engineering'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"team:contoso/protocols#member\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"team:contoso/engineering\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"team:contoso/protocols#member\", Relation = \"member\", Object = \"team:contoso/engineering\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"team:contoso/protocols#member\", relation=\"member\", object=\"team:contoso/engineering\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"team:contoso/protocols#member\",\"relation\":\"member\",\"object\":\"team:contoso/engineering\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw team:contoso/protocols#member member team:contoso/engineering write([ { \"user\":\"team:contoso/protocols#member\", \"relation\":\"member\", \"object\":\"team:contoso/engineering\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") which says that members of protocols are members of engineering. Note: this is enough and valid for our current requirements, and for other read cases allows determining members of the direct team vs sub teams as the latter come from team:contoso/protocols#member. If the #member relation should not be followed for use cases a different approach could be taken. We can now add a member to the protocols team and check that they are admins of the tooling repository. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // make diane a member of the contoso/protocols team { user: 'user:diane', relation: 'member', object: 'team:contoso/protocols'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // make diane a member of the contoso/protocols team User: openfga.PtrString(\"user:diane\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"team:contoso/protocols\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // make diane a member of the contoso/protocols team new() { User = \"user:diane\", Relation = \"member\", Object = \"team:contoso/protocols\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # make diane a member of the contoso/protocols team user=\"user:diane\", relation=\"member\", object=\"team:contoso/protocols\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:diane\",\"relation\":\"member\",\"object\":\"team:contoso/protocols\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane member team:contoso/protocols write([ // make diane a member of the contoso/protocols team { \"user\":\"user:diane\", \"relation\":\"member\", \"object\":\"team:contoso/protocols\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:diane', relation: 'admin', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:diane\", Relation: \"admin\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:diane\", Relation = \"admin\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:diane\", relation=\"admin\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane admin repo:contoso/tooling # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:diane\",\"relation\":\"admin\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":true} check( user = \"user:diane\", // check if the user `user:diane` relation = \"admin\", // has an `admin` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true At the end of this section ended with the following permissions represented:","s":"03. Permissions For Child Teams In An Org","u":"/docs/modeling/advanced/github","h":"#03-permissions-for-child-teams-in-an-org","p":731},{"i":751,"t":"In GitHub, \"you can set base permissions that apply to all members of an organization when accessing any of the organization's repositories\". For our purposes this means that if: User erik is a member of an organization contoso and contoso has a repository tooling and contoso has configured base permission to be \"write\" then erik has write permissions to tooling. Let us model that! At the end of this section we want to end up with the following permissions represented: We need to introduce the notion of organization as a type, user organization membership and repository ownership as a relation. - It is worth calling that before this addition we were able to represent almost the entire GitHub repo permissions without adding the notion of organization to OpenFGA. Identifiers for users, repositories and teams were all that was necessary. Let us add support for organizations and membership. Hopefully this feels familiar by now: DSL JSON model schema 1.1 type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } And support for repositories having owners: DSL JSON model schema 1.1 type repo relations define reader: [user, team#member] or triager define triager: [user, team#member] or writer define writer: [user, team#member] or maintainer define maintainer: [user, team#member] or admin define admin: [user, team#member] define owner: [organization] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"repo\", \"relations\": { \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"triager\" } } ] } }, \"triager\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"maintainer\" } } ] } }, \"maintainer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"admin\" } } ] } }, \"admin\": { \"this\": {} }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"triager\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"maintainer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } } ] } info Note the added \"owner\" relation, indicating that organizations can own repositories. We can now make Erik a member of contoso and make contoso own contoso/tooling: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:erik', relation: 'member', object: 'organization:contoso'}, { user: 'organization:contoso', relation: 'owner', object: 'repo:contoso/tooling'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:erik\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"organization:contoso\"), }, { User: openfga.PtrString(\"organization:contoso\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"repo:contoso/tooling\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:erik\", Relation = \"member\", Object = \"organization:contoso\" }, new() { User = \"organization:contoso\", Relation = \"owner\", Object = \"repo:contoso/tooling\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:erik\", relation=\"member\", object=\"organization:contoso\", ), ClientTuple( user=\"organization:contoso\", relation=\"owner\", object=\"repo:contoso/tooling\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:erik\",\"relation\":\"member\",\"object\":\"organization:contoso\"},{\"user\":\"organization:contoso\",\"relation\":\"owner\",\"object\":\"repo:contoso/tooling\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik member organization:contoso fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:contoso owner repo:contoso/tooling write([ { \"user\":\"user:erik\", \"relation\":\"member\", \"object\":\"organization:contoso\" }, { \"user\":\"organization:contoso\", \"relation\":\"owner\", \"object\":\"repo:contoso/tooling\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") What we still lack is the ability to create \"default permissions\" for the organization and have those be considered when determining if a user has a particular relation to a repository. Let's start with the simplest case admin. We want to say that a user is a admin of a repo if either: [done] they have a repo admin relation (directly or through team membership) [pending] their organization is configured with repo_admin as the base permission We need a way to consider the organization members, not just direct relations to the repo when getting a check for: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:erik', relation: 'admin', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = undefined Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:erik\", Relation: \"admin\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: undefined } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:erik\", Relation = \"admin\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = undefined Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:erik\", relation=\"admin\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = undefined Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik admin repo:contoso/tooling # Response: {\"allowed\":undefined} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:erik\",\"relation\":\"admin\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":undefined} check( user = \"user:erik\", // check if the user `user:erik` relation = \"admin\", // has an `admin` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: undefined More details on this technique can be found in the section Modeling Parent-Child Objects. We express it like this: DSL JSON type repo relations define admin: [user, team#member, organization#member] or repo_admin from owner { \"type_definitions\": [ { \"type\": \"repo\", \"relations\": { \"admin\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"owner\" }, \"computedUserset\": { \"relation\": \"repo_admin\" } } } ] } } }, \"metadata\": { \"relations\": { \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] } } } } ] } info The users with an admin relationship to a certain object of type \"repo\" are any of: the \"admins\": the set of users who are directly related to the repo as an \"admin\" the \"repository admins of the org that owns the repo\": from the objects who are related to the doc as owner, return the sets of users who are related to those objects as \"repo_admin\" What the added section is doing is: read all relationship tuples related to repo:contoso/tooling as owner which returns: [{ \"object\": \"repo:contoso/tooling\", \"relation\": \"owner\", \"user\": \"organization:contoso\" }] for each relationship tuple read, return all usersets that match the following, returning tuples of shape: { \"object\": \"organization:contoso\", \"relation\": \"repo_admin\", \"user\": ??? } What should the users in those relationship tuples with ??? be? Well: If the base permission for org contoso is repo_admin then it should be organization:contoso#member. If the base permission for org contoso is NOT repo_admin, then it should be empty (no relationship tuple). Whenever the value of this dropdown changes: Delete the previous relationship tuple and create a new one: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'organization:contoso#member', relation: 'repo_admin', object: 'organization:contoso'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"organization:contoso#member\"), Relation: openfga.PtrString(\"repo_admin\"), Object: openfga.PtrString(\"organization:contoso\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"organization:contoso#member\", Relation = \"repo_admin\", Object = \"organization:contoso\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"organization:contoso#member\", relation=\"repo_admin\", object=\"organization:contoso\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"organization:contoso#member\",\"relation\":\"repo_admin\",\"object\":\"organization:contoso\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:contoso#member repo_admin organization:contoso write([ { \"user\":\"organization:contoso#member\", \"relation\":\"repo_admin\", \"object\":\"organization:contoso\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") The updated authorization model looks like this: DSL JSON model schema 1.1 type user type repo relations define admin: [user, team#member, organization#member] or admin from owner define maintainer: [user, team#member, organization#member] or admin define writer: [user, team#member, organization#member] or maintainer or writer from owner define triager: [user, team#member, organization#member] or writer define reader: [user, team#member, organization#member] or triager or reader from owner define owner: [organization] type organization relations define owner: [organization] define repo_admin: [user, team#member, organization#member] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"admin\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"admin\" }, \"tupleset\": { \"relation\": \"owner\" } } } ] } }, \"maintainer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"admin\" } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"maintainer\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"writer\" }, \"tupleset\": { \"relation\": \"owner\" } } } ] } }, \"triager\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"triager\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"reader\" }, \"tupleset\": { \"relation\": \"owner\" } } } ] } }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] }, \"triager\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] }, \"maintainer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] }, \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"owner\": { \"this\": {} }, \"repo_admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] }, \"repo_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] } } } } ] }","s":"04. Base Permissions For Org Members","u":"/docs/modeling/advanced/github","h":"#04-base-permissions-for-org-members","p":731},{"i":753,"t":"GitHub has a number of other permissions. You have organization billing managers, users that can manage specific apps, etc. We might explore those in the future, but hopefully this blog post has shown you how you could represent those cases using OpenFGA.","s":"Summary","u":"/docs/modeling/advanced/github","h":"#summary","p":731},{"i":755,"t":"This section explores some methods available to you to tackle some use-cases where the expected authorization check may depend on certain dynamic or contextual data (such as time, location, ip address, weather) that have not been written to the OpenFGA store. When to use Contextual Tuples should be used when modeling cases where a user's access to an object depends on the context of their request. For example: An employee’s ability to access a document when they are connected to the company VPN or the api call is originating from an internal IP address. A support engineer is only able to access a user's account during office hours. If a user belongs to multiple organizations, they are only able to access a resource if they set a specific organization in their current context.","s":"Contextual and Time-Based Authorization","u":"/docs/modeling/contextual-time-based-authorization","h":"","p":754},{"i":757,"t":"To follow this guide, you should be familiar with some OpenFGA Concepts.","s":"Before You Start","u":"/docs/modeling/contextual-time-based-authorization","h":"#before-you-start","p":754},{"i":759,"t":"A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system. A Check Request: is a call to the OpenFGA check endpoint that returns whether the user has a certain relationship with an object. A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA A Contextual Tuple: a tuple that can be added to a Check request, and only exists within the context of that particular request. You also need to be familiar with: Modeling Object-to-Object Relationships: You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more → Modeling Multiple Restrictions: You need to know how to model requiring multiple authorizations before allowing users to perform certain actions. Learn more →","s":"OpenFGA Concepts","u":"/docs/modeling/contextual-time-based-authorization","h":"#-concepts","p":754},{"i":761,"t":"For the scope of this guide, we are going to consider the following scenario. Consider you are building the authorization model for WeBank Inc. In order for an Account Manager at WeBank Inc. to be able to access a customer's account and its transactions, they would need to be: An account manager at the same branch as the customer's account Connected via the branch's internal network or through the branch's VPN Connected during this particular branch's office hours We will start with the following Authorization Model DSL JSON model schema 1.1 type user type branch relations define account_manager: [user] type account relations define branch: [branch] define account_manager: account_manager from branch define customer: [user] define viewer: customer or account_manager define can_view: viewer type transaction relations define account: [account] define can_view: viewer from account { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"branch\", \"relations\": { \"account_manager\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"account_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"account\", \"relations\": { \"branch\": { \"this\": {} }, \"account_manager\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } } }, \"customer\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"customer\" } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } } ] } }, \"can_view\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } }, \"metadata\": { \"relations\": { \"branch\": { \"directly_related_user_types\": [ { \"type\": \"branch\" } ] }, \"customer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"transaction\", \"relations\": { \"account\": { \"this\": {} }, \"can_view\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"account\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } }, \"metadata\": { \"relations\": { \"account\": { \"directly_related_user_types\": [ { \"type\": \"account\" } ] } } } } ] } We are considering the case that: Anne is the Account Manager at the West-Side branch Caroline is the customer for checking account number 526 The West-Side branch is the branch that the checking account number 526 has been created at Checking account number 526 has a transaction, we'll call it transaction A The West-Side branch’s office hours is from 8am-3pm UTC The above state translates to the following relationship tuples: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is the Account Manager at the West-Side branch { user: 'user:anne', relation: 'account_manager', object: 'branch:west-side'}, // Caroline is the customer for checking account number 526 { user: 'user:caroline', relation: 'customer', object: 'account:checking-526'}, // The West-Side branch is the branch that the Checking account number 526 has been created at { user: 'branch:west-side', relation: 'branch', object: 'account:checking-526'}, // Checking account number 526 is the account for transaction A { user: 'account:checking-526', relation: 'account', object: 'transaction:A'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is the Account Manager at the West-Side branch User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"account_manager\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // Caroline is the customer for checking account number 526 User: openfga.PtrString(\"user:caroline\"), Relation: openfga.PtrString(\"customer\"), Object: openfga.PtrString(\"account:checking-526\"), }, { // The West-Side branch is the branch that the Checking account number 526 has been created at User: openfga.PtrString(\"branch:west-side\"), Relation: openfga.PtrString(\"branch\"), Object: openfga.PtrString(\"account:checking-526\"), }, { // Checking account number 526 is the account for transaction A User: openfga.PtrString(\"account:checking-526\"), Relation: openfga.PtrString(\"account\"), Object: openfga.PtrString(\"transaction:A\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is the Account Manager at the West-Side branch new() { User = \"user:anne\", Relation = \"account_manager\", Object = \"branch:west-side\" }, // Caroline is the customer for checking account number 526 new() { User = \"user:caroline\", Relation = \"customer\", Object = \"account:checking-526\" }, // The West-Side branch is the branch that the Checking account number 526 has been created at new() { User = \"branch:west-side\", Relation = \"branch\", Object = \"account:checking-526\" }, // Checking account number 526 is the account for transaction A new() { User = \"account:checking-526\", Relation = \"account\", Object = \"transaction:A\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is the Account Manager at the West-Side branch user=\"user:anne\", relation=\"account_manager\", object=\"branch:west-side\", ), ClientTuple( # Caroline is the customer for checking account number 526 user=\"user:caroline\", relation=\"customer\", object=\"account:checking-526\", ), ClientTuple( # The West-Side branch is the branch that the Checking account number 526 has been created at user=\"branch:west-side\", relation=\"branch\", object=\"account:checking-526\", ), ClientTuple( # Checking account number 526 is the account for transaction A user=\"account:checking-526\", relation=\"account\", object=\"transaction:A\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"account_manager\",\"object\":\"branch:west-side\"},{\"user\":\"user:caroline\",\"relation\":\"customer\",\"object\":\"account:checking-526\"},{\"user\":\"branch:west-side\",\"relation\":\"branch\",\"object\":\"account:checking-526\"},{\"user\":\"account:checking-526\",\"relation\":\"account\",\"object\":\"transaction:A\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne account_manager branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:caroline customer account:checking-526 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw branch:west-side branch account:checking-526 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw account:checking-526 account transaction:A write([ // Anne is the Account Manager at the West-Side branch { \"user\":\"user:anne\", \"relation\":\"account_manager\", \"object\":\"branch:west-side\" }, // Caroline is the customer for checking account number 526 { \"user\":\"user:caroline\", \"relation\":\"customer\", \"object\":\"account:checking-526\" }, // The West-Side branch is the branch that the Checking account number 526 has been created at { \"user\":\"branch:west-side\", \"relation\":\"branch\", \"object\":\"account:checking-526\" }, // Checking account number 526 is the account for transaction A { \"user\":\"account:checking-526\", \"relation\":\"account\", \"object\":\"transaction:A\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"Scenario","u":"/docs/modeling/contextual-time-based-authorization","h":"#scenario","p":754},{"i":763,"t":"By the end of this guide we would like to validate that: If Anne is at the branch, and it is 12pm UTC, Anne should be able to view transaction A If Anne is connecting remotely at 12pm UTC but is not connected to the VPN, Anne should not be able to view transaction A If Anne is connecting remotely and is connected to the VPN at 12pm UTC, should be able to view transaction A at 6pm UTC, should not be able to view transaction A","s":"Requirements","u":"/docs/modeling/contextual-time-based-authorization","h":"#requirements","p":754},{"i":765,"t":"In order to solve for the requirements above, we will break the problem down to three steps: Understand relationships without contextual tuples. We will want to ensure that the customer can view a transaction tied to their account the account manager can view a transaction whose account is at the same branch Extend the Authorization Model to take time and ip address into consideration Use contextual tuples for context related checks.","s":"Step By Step","u":"/docs/modeling/contextual-time-based-authorization","h":"#step-by-step","p":754},{"i":767,"t":"With the Authorization Model and relationship tuples shown above, OpenFGA has all the information needed to Ensure that the customer can view a transaction tied to their account Ensure that the account manager can view a transaction whose account is at the same branch We can verify that using the following checks Anne can view transaction:A because she is an account manager of an account that is at the same branch. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'transaction:A', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"transaction:A\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"transaction:A\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"transaction:A\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view transaction:A # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"transaction:A\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Caroline can view transaction:A because she is a customer and the transaction is tied to her account. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:caroline', relation: 'can_view', object: 'transaction:A', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:caroline\", Relation: \"can_view\", Object: \"transaction:A\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:caroline\", Relation = \"can_view\", Object = \"transaction:A\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:caroline\", relation=\"can_view\", object=\"transaction:A\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:caroline can_view transaction:A # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:caroline\",\"relation\":\"can_view\",\"object\":\"transaction:A\"}}' # Response: {\"allowed\":true} check( user = \"user:caroline\", // check if the user `user:caroline` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Additionally, we will check that Mary, an account manager at a different branch cannot view transaction A. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Mary is an account manager at the East-Side branch { user: 'user:mary', relation: 'account_manager', object: 'branch:east-side'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Mary is an account manager at the East-Side branch User: openfga.PtrString(\"user:mary\"), Relation: openfga.PtrString(\"account_manager\"), Object: openfga.PtrString(\"branch:east-side\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Mary is an account manager at the East-Side branch new() { User = \"user:mary\", Relation = \"account_manager\", Object = \"branch:east-side\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Mary is an account manager at the East-Side branch user=\"user:mary\", relation=\"account_manager\", object=\"branch:east-side\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:mary\",\"relation\":\"account_manager\",\"object\":\"branch:east-side\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:mary account_manager branch:east-side write([ // Mary is an account manager at the East-Side branch { \"user\":\"user:mary\", \"relation\":\"account_manager\", \"object\":\"branch:east-side\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:mary', relation: 'can_view', object: 'transaction:A', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:mary\", Relation: \"can_view\", Object: \"transaction:A\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:mary\", Relation = \"can_view\", Object = \"transaction:A\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:mary\", relation=\"can_view\", object=\"transaction:A\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:mary can_view transaction:A # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:mary\",\"relation\":\"can_view\",\"object\":\"transaction:A\"}}' # Response: {\"allowed\":false} check( user = \"user:mary\", // check if the user `user:mary` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Note that so far, we have not prevented Anne from viewing the transaction outside office hours, let's see if we can do better.","s":"Understand Relationships Without Contextual Data","u":"/docs/modeling/contextual-time-based-authorization","h":"#understand-relationships-without-contextual-data","p":754},{"i":769,"t":"Extend The Authorization Model​ In order to add time and ip address to our authorization model, we will add appropriate types for them. We will have a \"timeslot\" and an \"ip-address-range\" as types, and each can have users related to it as a user. DSL JSON type timeslot relations define user: [user] { \"type\": \"timeslot\", \"relations\": { \"user\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"user\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } DSL JSON type ip-address-range relations define user: [user] { \"type\": \"ip-address-range\", \"relations\": { \"user\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"user\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } We'll also need to introduce some new relations, and modify some others. On the \"branch\" type: Add \"approved_timeslot\" relation to mark than a certain timeslot is approved to view transactions for accounts in this branch Add \"approved_ip_address_range\" relation to mark than an ip address range is approved to view transactions for accounts in this branch Add \"approved_context\" relation to combine the two authorizations above (user from approved_timeslot and user from approved_ip_address_range), and indicate that the user is in an approved context The branch type definition then becomes: DSL JSON type branch relations define account_manager: [user] define approved_ip_address_range: [ip-address-range] define approved_timeslot: [timeslot] define approved_context: user from approved_timeslot and user from approved_ip_address_range { \"type\": \"branch\", \"relations\": { \"account_manager\": { \"this\": {} }, \"approved_ip_address_range\": { \"this\": {} }, \"approved_timeslot\": { \"this\": {} }, \"approved_context\": { \"intersection\": { \"child\": [ { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"approved_timeslot\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"user\" } } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"approved_ip_address_range\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"user\" } } } ] } } }, \"metadata\": { \"relations\": { \"account_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"approved_ip_address_range\": { \"directly_related_user_types\": [ { \"type\": \"ip-address-range\" } ] }, \"approved_timeslot\": { \"directly_related_user_types\": [ { \"type\": \"timeslot\" } ] } } } } On the \"account\" type: Add \"account_manager_viewer\" relation to combine the \"account_manager\" relationship and the new \"approved_context\" relation from the branch Update the \"viewer\" relation definition to customer or account_manager_viewer where \"customer\" can view without being subjected to contextual authorization, while \"account_manager_viewer\" needs to be within the branch allowed context to view The account type definition then becomes: DSL JSON type account relations define branch: [branch] define account_manager: account_manager from branch define customer: [user] define account_manager_viewer: account_manager and approved_context from branch define viewer: customer or account_manager_viewer define can_view: viewer { \"type\": \"account\", \"relations\": { \"branch\": { \"this\": {} }, \"account_manager\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } } }, \"customer\": { \"this\": {} }, \"account_manager_viewer\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"approved_context\" } } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"customer\" } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager_viewer\" } } ] } }, \"can_view\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } }, \"metadata\": { \"relations\": { \"branch\": { \"directly_related_user_types\": [ { \"type\": \"branch\" } ] }, \"customer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } note On the \"transaction\" type: Nothing will need to be done, as it will inherit the updated \"viewer\" relation definition from \"account\" Add The Required Tuples To Mark That Anne Is In An Approved Context​ Now that we have updated our authorization model to take time and ip address into consideration, you will notice that Anne has lost access because nothing indicates that Anne is connecting from an approved ip address and time. You can verify that by issuing the following check: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'anne', relation: 'can_view', object: 'transaction:A', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"anne\", Relation: \"can_view\", Object: \"transaction:A\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"anne\", Relation = \"can_view\", Object = \"transaction:A\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"anne\", relation=\"can_view\", object=\"transaction:A\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw anne can_view transaction:A # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"anne\",\"relation\":\"can_view\",\"object\":\"transaction:A\"}}' # Response: {\"allowed\":false} check( user = \"anne\", // check if the user `anne` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false We need to add relationship tuples to mark some approved timeslots and ip address ranges: note Here we added the time slots in increments of 1 hour periods, but this is not a requirement. We did not add all the office hours to keep this guide shorter. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // 11am to 12pm is within the office hours of the West-Side branch { user: 'timeslot:11_12', relation: 'approved_timeslot', object: 'branch:west-side'}, // 12pm to 1pm is within the office hours of the West-Side branch { user: 'timeslot:12_13', relation: 'approved_timeslot', object: 'branch:west-side'}, // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch { user: 'ip-address-range:10.0.0.0/16', relation: 'approved_ip_address_range', object: 'branch:west-side'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // 11am to 12pm is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:11_12\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 12pm to 1pm is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:12_13\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch User: openfga.PtrString(\"ip-address-range:10.0.0.0/16\"), Relation: openfga.PtrString(\"approved_ip_address_range\"), Object: openfga.PtrString(\"branch:west-side\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // 11am to 12pm is within the office hours of the West-Side branch new() { User = \"timeslot:11_12\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 12pm to 1pm is within the office hours of the West-Side branch new() { User = \"timeslot:12_13\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch new() { User = \"ip-address-range:10.0.0.0/16\", Relation = \"approved_ip_address_range\", Object = \"branch:west-side\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # 11am to 12pm is within the office hours of the West-Side branch user=\"timeslot:11_12\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 12pm to 1pm is within the office hours of the West-Side branch user=\"timeslot:12_13\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch user=\"ip-address-range:10.0.0.0/16\", relation=\"approved_ip_address_range\", object=\"branch:west-side\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"timeslot:11_12\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:12_13\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"ip-address-range:10.0.0.0/16\",\"relation\":\"approved_ip_address_range\",\"object\":\"branch:west-side\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:11_12 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:12_13 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw ip-address-range:10.0.0.0/16 approved_ip_address_range branch:west-side write([ // 11am to 12pm is within the office hours of the West-Side branch { \"user\":\"timeslot:11_12\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 12pm to 1pm is within the office hours of the West-Side branch { \"user\":\"timeslot:12_13\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch { \"user\":\"ip-address-range:10.0.0.0/16\", \"relation\":\"approved_ip_address_range\", \"object\":\"branch:west-side\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Now that we have added the allowed timeslots and ip address ranges we need to add the following relationship tuples to give Anne access. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is connecting from within the 10.0.0.0/16 ip address range { user: 'user:anne', relation: 'user', object: 'ip-address-range:10.0.0.0/16'}, // Anne is connecting between 12pm and 1pm { user: 'user:anne', relation: 'user', object: 'timeslot:12_13'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is connecting from within the 10.0.0.0/16 ip address range User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"user\"), Object: openfga.PtrString(\"ip-address-range:10.0.0.0/16\"), }, { // Anne is connecting between 12pm and 1pm User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"user\"), Object: openfga.PtrString(\"timeslot:12_13\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is connecting from within the 10.0.0.0/16 ip address range new() { User = \"user:anne\", Relation = \"user\", Object = \"ip-address-range:10.0.0.0/16\" }, // Anne is connecting between 12pm and 1pm new() { User = \"user:anne\", Relation = \"user\", Object = \"timeslot:12_13\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is connecting from within the 10.0.0.0/16 ip address range user=\"user:anne\", relation=\"user\", object=\"ip-address-range:10.0.0.0/16\", ), ClientTuple( # Anne is connecting between 12pm and 1pm user=\"user:anne\", relation=\"user\", object=\"timeslot:12_13\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"ip-address-range:10.0.0.0/16\"},{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"timeslot:12_13\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne user ip-address-range:10.0.0.0/16 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne user timeslot:12_13 write([ // Anne is connecting from within the 10.0.0.0/16 ip address range { \"user\":\"user:anne\", \"relation\":\"user\", \"object\":\"ip-address-range:10.0.0.0/16\" }, // Anne is connecting between 12pm and 1pm { \"user\":\"user:anne\", \"relation\":\"user\", \"object\":\"timeslot:12_13\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") If we have the above two tuples in the system, when checking whether Anne can view transaction A we should get a response stating that Anne can view it. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'transaction:A', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"transaction:A\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"transaction:A\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"transaction:A\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view transaction:A # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"transaction:A\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"Take Time And IP Address Into Consideration","u":"/docs/modeling/contextual-time-based-authorization","h":"#take-time-and-ip-address-into-consideration","p":754},{"i":771,"t":"Now that we know we can authorize based on present state, we have a different problem to solve. We are storing the tuples in the state in order for OpenFGA to evaluate them, which means that: For the case of the IP Address, we are not able to truly authorize based on the context of the request. E.g. if Anne was trying to connect from the phone and from the PC at the same time, and only the PC was connected to the VPN, how would OpenFGA know to deny one and allow the other if the data is stored in the state? On every check call we have to first write the correct tuples, then call the Check api, then clean up those tuples. This causes a substantial increase in latency as well as incorrect answers for requests happening in parallel (they could write/delete each other's tuples). How do we solve this? How do we tie the above two tuples to the context of the request instead of the system state? First, we will need to undo adding the stored relationship tuples where Anne is connecting from within the 10.0.0.0/16 ip address range and Anne connecting between 12pm and 1pm Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ // Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range { user: 'user:anne', relation: 'user', object: 'ip-address-range:10.0.0.0/16'}, // Remove stored tuples where Anne is connecting between 12pm and 1pm { user: 'user:anne', relation: 'user', object: 'timeslot:12_13'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { // Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"user\"), Object: openfga.PtrString(\"ip-address-range:10.0.0.0/16\"), }, { // Remove stored tuples where Anne is connecting between 12pm and 1pm User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"user\"), Object: openfga.PtrString(\"timeslot:12_13\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { // Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range new() { User = \"user:anne\", Relation = \"user\", Object = \"ip-address-range:10.0.0.0/16\" }, // Remove stored tuples where Anne is connecting between 12pm and 1pm new() { User = \"user:anne\", Relation = \"user\", Object = \"timeslot:12_13\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( # Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range user=\"user:anne\", relation=\"user\", object=\"ip-address-range:10.0.0.0/16\", ), ClientTuple( # Remove stored tuples where Anne is connecting between 12pm and 1pm user=\"user:anne\", relation=\"user\", object=\"timeslot:12_13\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"ip-address-range:10.0.0.0/16\"},{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"timeslot:12_13\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} user:anne user ip-address-range:10.0.0.0/16 fga tuple delete --store-id=${FGA_STORE_ID} user:anne user timeslot:12_13 delete([ // Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range { \"user\":\"user:anne\", \"relation\":\"user\", \"object\":\"ip-address-range:10.0.0.0/16\" }, // Remove stored tuples where Anne is connecting between 12pm and 1pm { \"user\":\"user:anne\", \"relation\":\"user\", \"object\":\"timeslot:12_13\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") For Check calls, OpenFGA has a concept called \"Contextual Tuples\". Contextual Tuples are tuples that do not exist in the system state and are not written beforehand to OpenFGA. They are tuples that are sent alongside the Check request and will be treated as if they already exist in the state for the context of that particular Check call. When Anne is connecting from an allowed ip address range and timeslot, OpenFGA will return {\"allowed\":true}: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'transaction:A', contextual_tuples: [ { user: \"user:anne\", relation: \"user\", object: \"ip-address-range:10.0.0.0/16\" }, { user: \"user:anne\", relation: \"user\", object: \"timeslot:12_13\" } ]}, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"transaction:A\", ContextualTuples: &[]ClientTupleKey{ { User: \"user:anne\", Relation: \"user\", Object: \"ip-address-range:10.0.0.0/16\", }, { User: \"user:anne\", Relation: \"user\", Object: \"timeslot:12_13\", } } } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"transaction:A\",, ContextualTuples = new List({ new(user: \"user:anne\", relation: \"user\", _object: \"ip-address-range:10.0.0.0/16\"), new(user: \"user:anne\", relation: \"user\", _object: \"timeslot:12_13\") }) }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"transaction:A\", contextual_tuples=[ ClientTupleKey(user=\"user:anne\", relation=\"user\", object=\"ip-address-range:10.0.0.0/16\"), ClientTupleKey(user=\"user:anne\", relation=\"user\", object=\"timeslot:12_13\") ], ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view transaction:A --contextual_tuples \"user:anne user ip-address-range:10.0.0.0/16\" \"user:anne user timeslot:12_13\" # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"transaction:A\"},\"contextual_tuples\":{\"tuple_keys\":[{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"ip-address-range:10.0.0.0/16\"},{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"timeslot:12_13\"}]}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` contextual_tuples = [ // Assuming the following is true {user = \"user:anne\", relation = \"user\", object = \"ip-address-range:10.0.0.0/16\"}, {user = \"user:anne\", relation = \"user\", object = \"timeslot:12_13\"} ], authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true When Anne is connecting from a denied ip address range or timeslot, OpenFGA will return {\"allowed\":false}: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'transaction:A', contextual_tuples: [ { user: \"user:anne\", relation: \"user\", object: \"ip-address-range:10.0.0.0/16\" }, { user: \"user:anne\", relation: \"user\", object: \"timeslot:18_19\" } ]}, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"transaction:A\", ContextualTuples: &[]ClientTupleKey{ { User: \"user:anne\", Relation: \"user\", Object: \"ip-address-range:10.0.0.0/16\", }, { User: \"user:anne\", Relation: \"user\", Object: \"timeslot:18_19\", } } } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"transaction:A\",, ContextualTuples = new List({ new(user: \"user:anne\", relation: \"user\", _object: \"ip-address-range:10.0.0.0/16\"), new(user: \"user:anne\", relation: \"user\", _object: \"timeslot:18_19\") }) }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"transaction:A\", contextual_tuples=[ ClientTupleKey(user=\"user:anne\", relation=\"user\", object=\"ip-address-range:10.0.0.0/16\"), ClientTupleKey(user=\"user:anne\", relation=\"user\", object=\"timeslot:18_19\") ], ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view transaction:A --contextual_tuples \"user:anne user ip-address-range:10.0.0.0/16\" \"user:anne user timeslot:18_19\" # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"transaction:A\"},\"contextual_tuples\":{\"tuple_keys\":[{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"ip-address-range:10.0.0.0/16\"},{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"timeslot:18_19\"}]}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` contextual_tuples = [ // Assuming the following is true {user = \"user:anne\", relation = \"user\", object = \"ip-address-range:10.0.0.0/16\"}, {user = \"user:anne\", relation = \"user\", object = \"timeslot:18_19\"} ], authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"Use Contextual Tuples For Context Related Checks","u":"/docs/modeling/contextual-time-based-authorization","h":"#use-contextual-tuples-for-context-related-checks","p":754},{"i":773,"t":"Final version of the Authorization Model and Relationship tuples DSL JSON model schema 1.1 type user type branch relations define account_manager: [user] define approved_ip_address_range: [ip-address-range] define approved_timeslot: [timeslot] define approved_context: user from approved_timeslot and user from approved_ip_address_range type account relations define branch: [branch] define account_manager: account_manager from branch define customer: [user] define account_manager_viewer: account_manager and approved_context from branch define viewer: customer or account_manager_viewer define can_view: viewer type transaction relations define account: [account] define can_view: viewer from account type timeslot relations define user: [user] type ip-address-range relations define user: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"branch\", \"relations\": { \"account_manager\": { \"this\": {} }, \"approved_ip_address_range\": { \"this\": {} }, \"approved_timeslot\": { \"this\": {} }, \"approved_context\": { \"intersection\": { \"child\": [ { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"approved_timeslot\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"user\" } } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"approved_ip_address_range\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"user\" } } } ] } } }, \"metadata\": { \"relations\": { \"account_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"approved_ip_address_range\": { \"directly_related_user_types\": [ { \"type\": \"ip-address-range\" } ] }, \"approved_timeslot\": { \"directly_related_user_types\": [ { \"type\": \"timeslot\" } ] } } } }, { \"type\": \"account\", \"relations\": { \"branch\": { \"this\": {} }, \"account_manager\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } } }, \"customer\": { \"this\": {} }, \"account_manager_viewer\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"approved_context\" } } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"customer\" } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager_viewer\" } } ] } }, \"can_view\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } }, \"metadata\": { \"relations\": { \"branch\": { \"directly_related_user_types\": [ { \"type\": \"branch\" } ] }, \"customer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"transaction\", \"relations\": { \"account\": { \"this\": {} }, \"can_view\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"account\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } }, \"metadata\": { \"relations\": { \"account\": { \"directly_related_user_types\": [ { \"type\": \"account\" } ] } } } }, { \"type\": \"timeslot\", \"relations\": { \"user\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"user\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"ip-address-range\", \"relations\": { \"user\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"user\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is the Account Manager at the West-Side branch { user: 'user:anne', relation: 'account_manager', object: 'branch:west-side'}, // Caroline is the customer for checking account number 526 { user: 'user:caroline', relation: 'customer', object: 'account:checking-526'}, // The West-Side branch is the branch that the Checking account number 526 has been created at { user: 'branch:west-side', relation: 'branch', object: 'account:checking-526'}, // Checking account number 526 is the account for transaction A { user: 'account:checking-526', relation: 'account', object: 'transaction:A'}, // 8am to 9am is within the office hours of the West-Side branch { user: 'timeslot:8_9', relation: 'approved_timeslot', object: 'branch:west-side'}, // 9am to 10am is within the office hours of the West-Side branch { user: 'timeslot:9_10', relation: 'approved_timeslot', object: 'branch:west-side'}, // 10am to 11am is within the office hours of the West-Side branch { user: 'timeslot:10_11', relation: 'approved_timeslot', object: 'branch:west-side'}, // 11am to 12pm is within the office hours of the West-Side branch { user: 'timeslot:11_12', relation: 'approved_timeslot', object: 'branch:west-side'}, // 12pm to 1pm is within the office hours of the West-Side branch { user: 'timeslot:12_13', relation: 'approved_timeslot', object: 'branch:west-side'}, // 1pm to 2pm is within the office hours of the West-Side branch { user: 'timeslot:13_14', relation: 'approved_timeslot', object: 'branch:west-side'}, // 2pm to 3pm is within the office hours of the West-Side branch { user: 'timeslot:14_15', relation: 'approved_timeslot', object: 'branch:west-side'}, // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch { user: 'ip-address-range:10.0.0.0/16', relation: 'approved_ip_address_range', object: 'branch:west-side'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is the Account Manager at the West-Side branch User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"account_manager\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // Caroline is the customer for checking account number 526 User: openfga.PtrString(\"user:caroline\"), Relation: openfga.PtrString(\"customer\"), Object: openfga.PtrString(\"account:checking-526\"), }, { // The West-Side branch is the branch that the Checking account number 526 has been created at User: openfga.PtrString(\"branch:west-side\"), Relation: openfga.PtrString(\"branch\"), Object: openfga.PtrString(\"account:checking-526\"), }, { // Checking account number 526 is the account for transaction A User: openfga.PtrString(\"account:checking-526\"), Relation: openfga.PtrString(\"account\"), Object: openfga.PtrString(\"transaction:A\"), }, { // 8am to 9am is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:8_9\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 9am to 10am is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:9_10\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 10am to 11am is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:10_11\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 11am to 12pm is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:11_12\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 12pm to 1pm is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:12_13\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 1pm to 2pm is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:13_14\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 2pm to 3pm is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:14_15\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch User: openfga.PtrString(\"ip-address-range:10.0.0.0/16\"), Relation: openfga.PtrString(\"approved_ip_address_range\"), Object: openfga.PtrString(\"branch:west-side\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is the Account Manager at the West-Side branch new() { User = \"user:anne\", Relation = \"account_manager\", Object = \"branch:west-side\" }, // Caroline is the customer for checking account number 526 new() { User = \"user:caroline\", Relation = \"customer\", Object = \"account:checking-526\" }, // The West-Side branch is the branch that the Checking account number 526 has been created at new() { User = \"branch:west-side\", Relation = \"branch\", Object = \"account:checking-526\" }, // Checking account number 526 is the account for transaction A new() { User = \"account:checking-526\", Relation = \"account\", Object = \"transaction:A\" }, // 8am to 9am is within the office hours of the West-Side branch new() { User = \"timeslot:8_9\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 9am to 10am is within the office hours of the West-Side branch new() { User = \"timeslot:9_10\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 10am to 11am is within the office hours of the West-Side branch new() { User = \"timeslot:10_11\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 11am to 12pm is within the office hours of the West-Side branch new() { User = \"timeslot:11_12\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 12pm to 1pm is within the office hours of the West-Side branch new() { User = \"timeslot:12_13\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 1pm to 2pm is within the office hours of the West-Side branch new() { User = \"timeslot:13_14\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 2pm to 3pm is within the office hours of the West-Side branch new() { User = \"timeslot:14_15\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch new() { User = \"ip-address-range:10.0.0.0/16\", Relation = \"approved_ip_address_range\", Object = \"branch:west-side\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is the Account Manager at the West-Side branch user=\"user:anne\", relation=\"account_manager\", object=\"branch:west-side\", ), ClientTuple( # Caroline is the customer for checking account number 526 user=\"user:caroline\", relation=\"customer\", object=\"account:checking-526\", ), ClientTuple( # The West-Side branch is the branch that the Checking account number 526 has been created at user=\"branch:west-side\", relation=\"branch\", object=\"account:checking-526\", ), ClientTuple( # Checking account number 526 is the account for transaction A user=\"account:checking-526\", relation=\"account\", object=\"transaction:A\", ), ClientTuple( # 8am to 9am is within the office hours of the West-Side branch user=\"timeslot:8_9\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 9am to 10am is within the office hours of the West-Side branch user=\"timeslot:9_10\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 10am to 11am is within the office hours of the West-Side branch user=\"timeslot:10_11\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 11am to 12pm is within the office hours of the West-Side branch user=\"timeslot:11_12\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 12pm to 1pm is within the office hours of the West-Side branch user=\"timeslot:12_13\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 1pm to 2pm is within the office hours of the West-Side branch user=\"timeslot:13_14\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 2pm to 3pm is within the office hours of the West-Side branch user=\"timeslot:14_15\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch user=\"ip-address-range:10.0.0.0/16\", relation=\"approved_ip_address_range\", object=\"branch:west-side\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"account_manager\",\"object\":\"branch:west-side\"},{\"user\":\"user:caroline\",\"relation\":\"customer\",\"object\":\"account:checking-526\"},{\"user\":\"branch:west-side\",\"relation\":\"branch\",\"object\":\"account:checking-526\"},{\"user\":\"account:checking-526\",\"relation\":\"account\",\"object\":\"transaction:A\"},{\"user\":\"timeslot:8_9\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:9_10\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:10_11\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:11_12\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:12_13\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:13_14\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:14_15\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"ip-address-range:10.0.0.0/16\",\"relation\":\"approved_ip_address_range\",\"object\":\"branch:west-side\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne account_manager branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:caroline customer account:checking-526 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw branch:west-side branch account:checking-526 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw account:checking-526 account transaction:A fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:8_9 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:9_10 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:10_11 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:11_12 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:12_13 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:13_14 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:14_15 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw ip-address-range:10.0.0.0/16 approved_ip_address_range branch:west-side write([ // Anne is the Account Manager at the West-Side branch { \"user\":\"user:anne\", \"relation\":\"account_manager\", \"object\":\"branch:west-side\" }, // Caroline is the customer for checking account number 526 { \"user\":\"user:caroline\", \"relation\":\"customer\", \"object\":\"account:checking-526\" }, // The West-Side branch is the branch that the Checking account number 526 has been created at { \"user\":\"branch:west-side\", \"relation\":\"branch\", \"object\":\"account:checking-526\" }, // Checking account number 526 is the account for transaction A { \"user\":\"account:checking-526\", \"relation\":\"account\", \"object\":\"transaction:A\" }, // 8am to 9am is within the office hours of the West-Side branch { \"user\":\"timeslot:8_9\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 9am to 10am is within the office hours of the West-Side branch { \"user\":\"timeslot:9_10\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 10am to 11am is within the office hours of the West-Side branch { \"user\":\"timeslot:10_11\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 11am to 12pm is within the office hours of the West-Side branch { \"user\":\"timeslot:11_12\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 12pm to 1pm is within the office hours of the West-Side branch { \"user\":\"timeslot:12_13\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 1pm to 2pm is within the office hours of the West-Side branch { \"user\":\"timeslot:13_14\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 2pm to 3pm is within the office hours of the West-Side branch { \"user\":\"timeslot:14_15\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch { \"user\":\"ip-address-range:10.0.0.0/16\", \"relation\":\"approved_ip_address_range\", \"object\":\"branch:west-side\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Warning Contextual tuples: Are not persisted in the store. Are only supported on the Check API endpoint and ListObjects API endpoint. They are not supported on read, expand and other endpoints.- If you are using the ReadChanges API endpoint to build a permission aware search index, note that it will not be trivial to take contextual tuples into account. If you are using the Read Changes API endpoint to build a permission aware search index, note that it will not be trivial to take contextual tuples into account.","s":"Summary","u":"/docs/modeling/contextual-time-based-authorization","h":"#summary","p":754},{"i":775,"t":"In order to keep this guide concise, we assumed you were modeling for a single bank. What if you were offering a multi-tenant service where each bank is a single tenant? In that case, we can extend the model like so: DSL JSON model schema 1.1 type user type bank relations define admin: [user] type branch relations define bank: [bank] define account_manager: [user] define approved_ip_address_range: [ip-address-range] define approved_timeslot: [timeslot] define approved_context: user from approved_timeslot and user from approved_ip_address_range type account relations define branch: [branch] define account_manager: account_manager from branch define customer: [user] define account_manager_viewer: account_manager and approved_context from branch define viewer: customer or account_manager_viewer define can_view: viewer type transaction relations define account: [account] define can_view: viewer from account type timeslot relations define user: [user] type ip-address-range relations define user: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"bank\", \"relations\": { \"admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"branch\", \"relations\": { \"bank\": { \"this\": {} }, \"account_manager\": { \"this\": {} }, \"approved_ip_address_range\": { \"this\": {} }, \"approved_timeslot\": { \"this\": {} }, \"approved_context\": { \"intersection\": { \"child\": [ { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"approved_timeslot\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"user\" } } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"approved_ip_address_range\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"user\" } } } ] } } }, \"metadata\": { \"relations\": { \"bank\": { \"directly_related_user_types\": [ { \"type\": \"bank\" } ] }, \"account_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"approved_ip_address_range\": { \"directly_related_user_types\": [ { \"type\": \"ip-address-range\" } ] }, \"approved_timeslot\": { \"directly_related_user_types\": [ { \"type\": \"timeslot\" } ] } } } }, { \"type\": \"account\", \"relations\": { \"branch\": { \"this\": {} }, \"account_manager\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } } }, \"customer\": { \"this\": {} }, \"account_manager_viewer\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"approved_context\" } } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"customer\" } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager_viewer\" } } ] } }, \"can_view\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } }, \"metadata\": { \"relations\": { \"branch\": { \"directly_related_user_types\": [ { \"type\": \"branch\" } ] }, \"customer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"transaction\", \"relations\": { \"account\": { \"this\": {} }, \"can_view\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"account\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } }, \"metadata\": { \"relations\": { \"account\": { \"directly_related_user_types\": [ { \"type\": \"account\" } ] } } } }, { \"type\": \"timeslot\", \"relations\": { \"user\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"user\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"ip-address-range\", \"relations\": { \"user\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"user\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"Taking It A Step Further: Banks As A Service Authorization","u":"/docs/modeling/contextual-time-based-authorization","h":"#taking-it-a-step-further-banks-as-a-service-authorization","p":754},{"i":777,"t":"Check the following sections for more on how user groups can be used. Object to Object Relationships Learn how objects can relate to one another and how that can affect user's access. More Modeling with Multiple Restrictions Learn how to model requiring multiple relationships before users are authorized to perform certain actions. More OpenFGA API Details on the Check API in the OpenFGA reference guide. More","s":"Related Sections","u":"/docs/modeling/contextual-time-based-authorization","h":"#related-sections","p":754},{"i":779,"t":"This tutorial explains how to model permissions for an IoT system using OpenFGA. What you will learn How to model a permission system using OpenFGA How to see OpenFGA Authorization in action by modeling an IoT Security Camera System","s":"Modeling Authorization for an IoT Security System with OpenFGA","u":"/docs/modeling/advanced/iot","h":"","p":778},{"i":781,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA concepts and know how to develop the things that we will list below. OpenFGA Concepts​ It would be helpful to have an understanding of some concepts of OpenFGA before you start. Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → Modeling Concentric Relationships​ You need to know how to update the authorization model to allow having nested relations such as all writers are readers. Learn more → Used here to indicate that both IT Admins and Security Guards can view live video. Direct Relationships​ You need to know how to disallow granting direct relation to an object and requiring the user to have a relation with another object that would imply a relation with the first one. Learn more → Used here to indicate that \"Rename Device\" is a permission that cannot be assigned directly, but can only be granted through the \"IT Admin\" role. User Groups​ You need to know how to add users to groups and create relationships between groups of users and an object. Learn more → Used here to indicate that security guards on a certain group are security guards on a device in that group. Concepts & Configuration Language​ Some OpenFGA Concepts Configuration Language","s":"Before You Start","u":"/docs/modeling/advanced/iot","h":"#before-you-start","p":778},{"i":783,"t":"It would be helpful to have an understanding of some concepts of OpenFGA before you start.","s":"OpenFGA Concepts","u":"/docs/modeling/advanced/iot","h":"#-concepts","p":778},{"i":785,"t":"In this tutorial, you will build an authorization model for a sample IoT Security Camera System (detailed below) using OpenFGA. You will use some scenarios to validate the model. The goal by the end of this post is to ask OpenFGA: Does person X have permission to perform action Y on device Z? In response, you want to either get a confirmation that person X can indeed do that, or a rejection that they cannot.","s":"What You Will Be Modeling","u":"/docs/modeling/advanced/iot","h":"#what-you-will-be-modeling","p":778},{"i":787,"t":"These are the requirements: Security guards have access to view live and recorded video from Devices. IT Admins can view live and recorded videos, as well as rename Devices. To make access management easier, Devices can be grouped into Device Groups. Security guards with access to the Device Group are Security Guards with access to each Device in the group. Similarly for IT Admins.","s":"Requirements","u":"/docs/modeling/advanced/iot","h":"#requirements","p":778},{"i":789,"t":"Use the following scenarios to be able to validate whether the model of the requirements is correct. There will be the following users: Anne Beth Charles Dianne These users have the following roles and permissions: Anne is a Security Guard with access to only Device 1 Beth is an IT Admin with access to only Device 1 Charles is a Security Guard with access to Device 1 and everything in Device Group 1 (which is Device 2 and Device 3) Dianne is an IT Admin with access to Device 1 and everything in Device Group 1 caution In production, it is highly recommended to use unique, immutable identifiers. Names are used in this article to make it easier to read and follow.","s":"Defined Scenarios","u":"/docs/modeling/advanced/iot","h":"#defined-scenarios","p":778},{"i":791,"t":"The OpenFGA service is based on Zanzibar, a Relationship Based Access Control system. This means it relies on object and user relations to perform authorization checks. Starting with devices, you will learn how to express the requirements in terms of relations you can feed into OpenFGA.","s":"Modeling Device Authorization","u":"/docs/modeling/advanced/iot","h":"#modeling-device-authorization","p":778},{"i":793,"t":"The requirements stated: Security guards have access to view live and recorded video from Devices. IT Admins can view live and recorded videos, as well as rename Devices. The goal is to ask OpenFGA whether person X has permission to perform action Y on device Z. To start, you will set aside the Security Guard and IT Admin designations and focus on the actions a user can take. The actions users can take on a device are: view live videos, view recorded videos, and rename devices. Mapping them to relations, they become: live_video_viewer, recorded_video_viewer, device_renamer. In OpenFGA, the authorization model for the device would be: DSL JSON model schema 1.1 type user type device relations define live_video_viewer: [user] define recorded_video_viewer: [user] define device_renamer: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"device\", \"relations\": { \"live_video_viewer\": { \"this\": {} }, \"recorded_video_viewer\": { \"this\": {} }, \"device_renamer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"live_video_viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"recorded_video_viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"device_renamer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"01. Writing The Initial Model For A Device","u":"/docs/modeling/advanced/iot","h":"#01-writing-the-initial-model-for-a-device","p":778},{"i":795,"t":"The requirements are: Anne is a Security Guard with access to only Device 1 Beth is an IT Admin with access to only Device 1 Security Guards can view live and recorded video IT Admins can view live and recorded video and rename devices Before we tackle the problem of users access to device based on their role, we will try to grant user access based on their view relationship directly. We will first focus on Anne and Beth's relationship with Device 1. To add Anne as live_video_viewer of device:1: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'live_video_viewer', object: 'device:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"live_video_viewer\"), Object: openfga.PtrString(\"device:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"live_video_viewer\", Object = \"device:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"live_video_viewer\", object=\"device:1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"live_video_viewer\",\"object\":\"device:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne live_video_viewer device:1 write([ { \"user\":\"user:anne\", \"relation\":\"live_video_viewer\", \"object\":\"device:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") To add Anne as recorded_video_viewer of device:1 Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'recorded_video_viewer', object: 'device:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"recorded_video_viewer\"), Object: openfga.PtrString(\"device:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"recorded_video_viewer\", Object = \"device:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"recorded_video_viewer\", object=\"device:1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"recorded_video_viewer\",\"object\":\"device:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne recorded_video_viewer device:1 write([ { \"user\":\"user:anne\", \"relation\":\"recorded_video_viewer\", \"object\":\"device:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Likewise, we will add Beth's relationship with device:1. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:beth', relation: 'live_video_viewer', object: 'device:1'}, { user: 'user:beth', relation: 'recorded_video_viewer', object: 'device:1'}, { user: 'user:beth', relation: 'device_renamer', object: 'device:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"live_video_viewer\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"recorded_video_viewer\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"device_renamer\"), Object: openfga.PtrString(\"device:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:beth\", Relation = \"live_video_viewer\", Object = \"device:1\" }, new() { User = \"user:beth\", Relation = \"recorded_video_viewer\", Object = \"device:1\" }, new() { User = \"user:beth\", Relation = \"device_renamer\", Object = \"device:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:beth\", relation=\"live_video_viewer\", object=\"device:1\", ), ClientTuple( user=\"user:beth\", relation=\"recorded_video_viewer\", object=\"device:1\", ), ClientTuple( user=\"user:beth\", relation=\"device_renamer\", object=\"device:1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:beth\",\"relation\":\"live_video_viewer\",\"object\":\"device:1\"},{\"user\":\"user:beth\",\"relation\":\"recorded_video_viewer\",\"object\":\"device:1\"},{\"user\":\"user:beth\",\"relation\":\"device_renamer\",\"object\":\"device:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth live_video_viewer device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth recorded_video_viewer device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth device_renamer device:1 write([ { \"user\":\"user:beth\", \"relation\":\"live_video_viewer\", \"object\":\"device:1\" }, { \"user\":\"user:beth\", \"relation\":\"recorded_video_viewer\", \"object\":\"device:1\" }, { \"user\":\"user:beth\", \"relation\":\"device_renamer\", \"object\":\"device:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Verification​ Now that you have some relationship tuples added, you can start using it to ask some questions, e.g., whether a person has access to rename a device. First, you will find out if anne has permission to view the live video on device:1, then you will see if anne can rename device:1. Anne has live_video_viewer relationship with device:1. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'live_video_viewer', object: 'device:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"live_video_viewer\", Object: \"device:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"live_video_viewer\", Object = \"device:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"live_video_viewer\", object=\"device:1\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne live_video_viewer device:1 # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"live_video_viewer\",\"object\":\"device:1\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"live_video_viewer\", // has an `live_video_viewer` relation object = \"device:1\", // with the object `device:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true On the other hand, Anne does not have device_renamer relationship with device:1. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'device_renamer', object: 'device:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"device_renamer\", Object: \"device:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"device_renamer\", Object = \"device:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"device_renamer\", object=\"device:1\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne device_renamer device:1 # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"device_renamer\",\"object\":\"device:1\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"device_renamer\", // has an `device_renamer` relation object = \"device:1\", // with the object `device:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Now, check the other relationships fore Anne and Beth. User Object Relation Query Relation? anne device:1 live_video_viewer is anne related to device:1 as live_video_viewer? Yes beth device:1 live_video_viewer is beth related to device:1 as live_video_viewer? Yes anne device:1 recorded_video_viewer is anne related to device:1 as recorded_video_viewer? Yes beth device:1 recorded_video_viewer is beth related to device:1 as recorded_video_viewer? Yes anne device:1 device_renamer is anne related to device:1 as device_renamer? No beth device:1 device_renamer is beth related to device:1 as device_renamer? Yes","s":"02. Inserting Some Relationship Tuples","u":"/docs/modeling/advanced/iot","h":"#02-inserting-some-relationship-tuples","p":778},{"i":797,"t":"Notice how you had to add the Anne and Beth as direct relations to all the actions they can take on Device 1 instead of just stating that they are related as Security Guard or IT Admin, and having the other permissions implied? In practice this might have some disadvantages: if your authorization model changes, (e.g so that Security Guards can no longer view previously recorded videos), you would need to change relationship tuples in the system instead of just changing the configuration. We can address this by using concentric relation models. It allows you to express that sets of users who have a relation X to the object also have relation Y. For example, anyone that is related to the device as a security_guard is also related as a live_video_viewer and recorded_video_viewer, and anyone who is related to the device as an it_admin is also related as a live_video_viewer, a recorded_video_viewer, and a device_renamer. At the end you want to make sure that checking if Anne, Beth, Charles, or Dianne have permission to view the live video or rename the device, will get you the correct answers back. The resulting authorization model is: DSL JSON model schema 1.1 type device relations define it_admin: [user] define security_guard: [user] define live_video_viewer: [user] or it_admin or security_guard define recorded_video_viewer: [user] or it_admin or security_guard define device_renamer: [user] or it_admin { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"device\", \"relations\": { \"it_admin\": { \"this\": {} }, \"security_guard\": { \"this\": {} }, \"live_video_viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"it_admin\" } }, { \"computedUserset\": { \"relation\": \"security_guard\" } } ] } }, \"recorded_video_viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"it_admin\" } }, { \"computedUserset\": { \"relation\": \"security_guard\" } } ] } }, \"device_renamer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"it_admin\" } } ] } } }, \"metadata\": { \"relations\": { \"it_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"security_guard\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"live_video_viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"recorded_video_viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"device_renamer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The requirements are: Anne and Charles are Security Guards with access Device 1 Beth and Dianne are IT Admins with access Device 1 Security Guards can view live and recorded video IT Admins can view live and recorded video and rename devices Instead of adding different relationship tuples with direct relations to the actions they can take, as you did in the previous section, you will only add the relation to their role: it_admin or security_guard. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'security_guard', object: 'device:1'}, { user: 'user:beth', relation: 'it_admin', object: 'device:1'}, { user: 'user:charles', relation: 'security_guard', object: 'device:1'}, { user: 'user:dianne', relation: 'it_admin', object: 'device:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"security_guard\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"it_admin\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"security_guard\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:dianne\"), Relation: openfga.PtrString(\"it_admin\"), Object: openfga.PtrString(\"device:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"security_guard\", Object = \"device:1\" }, new() { User = \"user:beth\", Relation = \"it_admin\", Object = \"device:1\" }, new() { User = \"user:charles\", Relation = \"security_guard\", Object = \"device:1\" }, new() { User = \"user:dianne\", Relation = \"it_admin\", Object = \"device:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"security_guard\", object=\"device:1\", ), ClientTuple( user=\"user:beth\", relation=\"it_admin\", object=\"device:1\", ), ClientTuple( user=\"user:charles\", relation=\"security_guard\", object=\"device:1\", ), ClientTuple( user=\"user:dianne\", relation=\"it_admin\", object=\"device:1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"security_guard\",\"object\":\"device:1\"},{\"user\":\"user:beth\",\"relation\":\"it_admin\",\"object\":\"device:1\"},{\"user\":\"user:charles\",\"relation\":\"security_guard\",\"object\":\"device:1\"},{\"user\":\"user:dianne\",\"relation\":\"it_admin\",\"object\":\"device:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne security_guard device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth it_admin device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles security_guard device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:dianne it_admin device:1 write([ { \"user\":\"user:anne\", \"relation\":\"security_guard\", \"object\":\"device:1\" }, { \"user\":\"user:beth\", \"relation\":\"it_admin\", \"object\":\"device:1\" }, { \"user\":\"user:charles\", \"relation\":\"security_guard\", \"object\":\"device:1\" }, { \"user\":\"user:dianne\", \"relation\":\"it_admin\", \"object\":\"device:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Verification​ We can now verify whether charles is related to device:1 as live_video_viewer. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:charles', relation: 'live_video_viewer', object: 'device:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:charles\", Relation: \"live_video_viewer\", Object: \"device:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:charles\", Relation = \"live_video_viewer\", Object = \"device:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:charles\", relation=\"live_video_viewer\", object=\"device:1\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles live_video_viewer device:1 # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:charles\",\"relation\":\"live_video_viewer\",\"object\":\"device:1\"}}' # Response: {\"allowed\":true} check( user = \"user:charles\", // check if the user `user:charles` relation = \"live_video_viewer\", // has an `live_video_viewer` relation object = \"device:1\", // with the object `device:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Check the other relationships for anne, beth, charles and dianne. User Object Relation Query Relation? anne device:1 live_video_viewer is anne related to device:1 as live_video_viewer? Yes beth device:1 live_video_viewer is beth related to device:1 as live_video_viewer? Yes anne device:1 recorded_video_viewer is anne related to device:1 as recorded_video_viewer? Yes beth device:1 recorded_video_viewer is beth related to device:1 as recorded_video_viewer? Yes anne device:1 device_renamer is anne related to device:1 as device_renamer? No beth device:1 device_renamer is beth related to device:1 as device_renamer? Yes charles device:1 live_video_viewer is charles related to device:1 as live_video_viewer? Yes dianne device:1 live_video_viewer is dianne related to device:1 as live_video_viewer? Yes charles device:1 recorded_video_viewer is charles related to device:1 as recorded_video_viewer? Yes dianne device:1 recorded_video_viewer is dianne related to device:1 as recorded_video_viewer? Yes charles device:1 device_renamer is charles related to device:1 as device_renamer? No dianne device:1 device_renamer is dianne related to device:1 as device_renamer? Yes","s":"03. Updating Our Authorization Model To Facilitate Future Changes","u":"/docs/modeling/advanced/iot","h":"#03-updating-our-authorization-model-to-facilitate-future-changes","p":778},{"i":799,"t":"Now that you are done with devices. Let us tackle device groups. The requirements regarding device groups were: Devices can be grouped into Device Groups Security guards with access to the Device Group are Security Guards with access to the Devices within the Device Group. Similarly for IT Admins The type definition for the device group: DSL JSON type device_group relations define it_admin: [user] define security_guard: [user] { \"type\": \"device_group\", \"relations\": { \"it_admin\": { \"this\": {} }, \"security_guard\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"it_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"security_guard\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } With this change, the full authorization model becomes: DSL JSON model schema 1.1 type user type device relations define it_admin: [user, device_group#it_admin] define security_guard: [user, device_group#security_guard] define live_video_viewer: [user] or it_admin or security_guard define recorded_video_viewer: [user] or it_admin or security_guard define device_renamer: [user] or it_admin type device_group relations define it_admin: [user] define security_guard: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"device\", \"relations\": { \"it_admin\": { \"this\": {} }, \"security_guard\": { \"this\": {} }, \"live_video_viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"it_admin\" } }, { \"computedUserset\": { \"relation\": \"security_guard\" } } ] } }, \"recorded_video_viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"it_admin\" } }, { \"computedUserset\": { \"relation\": \"security_guard\" } } ] } }, \"device_renamer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"it_admin\" } } ] } } }, \"metadata\": { \"relations\": { \"it_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"device_group\", \"relation\": \"it_admin\" } ] }, \"security_guard\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"device_group\", \"relation\": \"security_guard\" } ] }, \"live_video_viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"recorded_video_viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"device_renamer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"device_group\", \"relations\": { \"it_admin\": { \"this\": {} }, \"security_guard\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"it_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"security_guard\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Updating Relationship Tuples On Roles​ Remember that Charles is a Security Guard, and Dianne an IT Admin on Group 1, enter the relationship tuples below to reflect that. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:charles', relation: 'security_guard', object: 'device_group:group1'}, { user: 'user:dianne', relation: 'it_admin', object: 'device_group:group1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"security_guard\"), Object: openfga.PtrString(\"device_group:group1\"), }, { User: openfga.PtrString(\"user:dianne\"), Relation: openfga.PtrString(\"it_admin\"), Object: openfga.PtrString(\"device_group:group1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:charles\", Relation = \"security_guard\", Object = \"device_group:group1\" }, new() { User = \"user:dianne\", Relation = \"it_admin\", Object = \"device_group:group1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:charles\", relation=\"security_guard\", object=\"device_group:group1\", ), ClientTuple( user=\"user:dianne\", relation=\"it_admin\", object=\"device_group:group1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:charles\",\"relation\":\"security_guard\",\"object\":\"device_group:group1\"},{\"user\":\"user:dianne\",\"relation\":\"it_admin\",\"object\":\"device_group:group1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles security_guard device_group:group1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:dianne it_admin device_group:group1 write([ { \"user\":\"user:charles\", \"relation\":\"security_guard\", \"object\":\"device_group:group1\" }, { \"user\":\"user:dianne\", \"relation\":\"it_admin\", \"object\":\"device_group:group1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") You still need to give all the security guards of group1 a security_guard relation to devices 2 and 3, and similarly for IT Admins. Add the following relationship tuples to do that. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'device_group:group1#security_guard', relation: 'security_guard', object: 'device:2'}, { user: 'device_group:group1#security_guard', relation: 'security_guard', object: 'device:3'}, { user: 'device_group:group1#it_admin', relation: 'it_admin', object: 'device:2'}, { user: 'device_group:group1#it_admin', relation: 'it_admin', object: 'device:3'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"device_group:group1#security_guard\"), Relation: openfga.PtrString(\"security_guard\"), Object: openfga.PtrString(\"device:2\"), }, { User: openfga.PtrString(\"device_group:group1#security_guard\"), Relation: openfga.PtrString(\"security_guard\"), Object: openfga.PtrString(\"device:3\"), }, { User: openfga.PtrString(\"device_group:group1#it_admin\"), Relation: openfga.PtrString(\"it_admin\"), Object: openfga.PtrString(\"device:2\"), }, { User: openfga.PtrString(\"device_group:group1#it_admin\"), Relation: openfga.PtrString(\"it_admin\"), Object: openfga.PtrString(\"device:3\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"device_group:group1#security_guard\", Relation = \"security_guard\", Object = \"device:2\" }, new() { User = \"device_group:group1#security_guard\", Relation = \"security_guard\", Object = \"device:3\" }, new() { User = \"device_group:group1#it_admin\", Relation = \"it_admin\", Object = \"device:2\" }, new() { User = \"device_group:group1#it_admin\", Relation = \"it_admin\", Object = \"device:3\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"device_group:group1#security_guard\", relation=\"security_guard\", object=\"device:2\", ), ClientTuple( user=\"device_group:group1#security_guard\", relation=\"security_guard\", object=\"device:3\", ), ClientTuple( user=\"device_group:group1#it_admin\", relation=\"it_admin\", object=\"device:2\", ), ClientTuple( user=\"device_group:group1#it_admin\", relation=\"it_admin\", object=\"device:3\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"device_group:group1#security_guard\",\"relation\":\"security_guard\",\"object\":\"device:2\"},{\"user\":\"device_group:group1#security_guard\",\"relation\":\"security_guard\",\"object\":\"device:3\"},{\"user\":\"device_group:group1#it_admin\",\"relation\":\"it_admin\",\"object\":\"device:2\"},{\"user\":\"device_group:group1#it_admin\",\"relation\":\"it_admin\",\"object\":\"device:3\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw device_group:group1#security_guard security_guard device:2 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw device_group:group1#security_guard security_guard device:3 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw device_group:group1#it_admin it_admin device:2 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw device_group:group1#it_admin it_admin device:3 write([ { \"user\":\"device_group:group1#security_guard\", \"relation\":\"security_guard\", \"object\":\"device:2\" }, { \"user\":\"device_group:group1#security_guard\", \"relation\":\"security_guard\", \"object\":\"device:3\" }, { \"user\":\"device_group:group1#it_admin\", \"relation\":\"it_admin\", \"object\":\"device:2\" }, { \"user\":\"device_group:group1#it_admin\", \"relation\":\"it_admin\", \"object\":\"device:3\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Verification​ Now that you have finalized the model and added the relationship tuples, you can start asking some queries. Try asking the same queries you did earlier but on device 2 instead of device 1. We can ask is dianne related to device:2 as live_video_viewer? Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'dianne', relation: 'live_video_viewer', object: 'device:2', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"dianne\", Relation: \"live_video_viewer\", Object: \"device:2\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"dianne\", Relation = \"live_video_viewer\", Object = \"device:2\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"dianne\", relation=\"live_video_viewer\", object=\"device:2\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw dianne live_video_viewer device:2 # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"dianne\",\"relation\":\"live_video_viewer\",\"object\":\"device:2\"}}' # Response: {\"allowed\":true} check( user = \"dianne\", // check if the user `dianne` relation = \"live_video_viewer\", // has an `live_video_viewer` relation object = \"device:2\", // with the object `device:2` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Type any of the following queries in the TUPLE QUERIES section and press ENTER on your keyboard to see the results. User Object Relation Query Relation? anne device:2 live_video_viewer is anne related to device:2 as live_video_viewer? No beth device:2 live_video_viewer is beth related to device:2 as live_video_viewer? No anne device:2 recorded_video_viewer is anne related to device:2 as recorded_video_viewer? No beth device:2 recorded_video_viewer is beth related to device:2 as recorded_video_viewer? No anne device:2 device_renamer is anne related to device:2 as device_renamer? No beth device:2 device_renamer is beth related to device:2 as device_renamer? No charles device:2 live_video_viewer is charles related to device:2 as live_video_viewer? Yes dianne device:2 live_video_viewer is dianne related to device:2 as live_video_viewer? Yes charles device:2 recorded_video_viewer is charles related to device:2 as recorded_video_viewer? Yes dianne device:2 recorded_video_viewer is dianne related to device:2 as recorded_video_viewer? Yes charles device:2 device_renamer is charles related to device:2 as device_renamer? No dianne device:2 device_renamer is dianne related to device:2 as device_renamer? Yes","s":"04. Modeling Device Groups","u":"/docs/modeling/advanced/iot","h":"#04-modeling-device-groups","p":778},{"i":801,"t":"Notice that despite following Step 03, anne and beth still have direct relations to all the actions they can take on device:1. Updating The Authorization Model​ anne is a live_video_viewer by both her position as security_guard as well as her direct relationship assignment. This is undesirable. Imagine anne left her position of security_guard and she will still have live_video_viewer access to device:1. To remedy this, remove [user] from live_video_viewer, recorded_video_viewer and device_renamer. This denies direct relations to live_video_viewer, recorded_video_viewer and device_renamer from having an effect. To do this: DSL JSON model schema 1.1 type user type device relations define it_admin: [user, device_group#it_admin] define security_guard: [user, device_group#security_guard] define live_video_viewer: it_admin or security_guard define recorded_video_viewer: it_admin or security_guard define device_renamer: it_admin type device_group relations define it_admin: [user] define security_guard: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"device\", \"relations\": { \"it_admin\": { \"this\": {} }, \"security_guard\": { \"this\": {} }, \"live_video_viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"relation\": \"it_admin\" } }, { \"computedUserset\": { \"relation\": \"security_guard\" } } ] } }, \"recorded_video_viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"relation\": \"it_admin\" } }, { \"computedUserset\": { \"relation\": \"security_guard\" } } ] } }, \"device_renamer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"relation\": \"it_admin\" } } ] } } }, \"metadata\": { \"relations\": { \"it_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"device_group\", \"relation\": \"it_admin\" } ] }, \"security_guard\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"device_group\", \"relation\": \"security_guard\" } ] } } } }, { \"type\": \"device_group\", \"relations\": { \"it_admin\": { \"this\": {} }, \"security_guard\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"it_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"security_guard\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Notice that any reference to the direct relationship type restrictions has been removed. That indicates that a user cannot have a direct relationship with an object in this type. With this change, anne can no longer have a live_video_viewer permission for device:1 except through having a security_guard or it_admin role first, and when she loses access to that role, she will automatically lose access to the live_video_viewer permission. Verification​ Now that direct relationship is denied, we should see that anne has live_video_viewer relation to device:1 solely based on her position as security_guard to device:1. Let's find out. To test this, we can add a new user emily. Emily is not a security_guard nor an it_admin. However, we attempt to access via direct relations by adding the following relationship tuples: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:emily', relation: 'live_video_viewer', object: 'device:1'}, { user: 'user:emily', relation: 'recorded_video_viewer', object: 'device:1'}, { user: 'user:emily', relation: 'device_renamer', object: 'device:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:emily\"), Relation: openfga.PtrString(\"live_video_viewer\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:emily\"), Relation: openfga.PtrString(\"recorded_video_viewer\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:emily\"), Relation: openfga.PtrString(\"device_renamer\"), Object: openfga.PtrString(\"device:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:emily\", Relation = \"live_video_viewer\", Object = \"device:1\" }, new() { User = \"user:emily\", Relation = \"recorded_video_viewer\", Object = \"device:1\" }, new() { User = \"user:emily\", Relation = \"device_renamer\", Object = \"device:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:emily\", relation=\"live_video_viewer\", object=\"device:1\", ), ClientTuple( user=\"user:emily\", relation=\"recorded_video_viewer\", object=\"device:1\", ), ClientTuple( user=\"user:emily\", relation=\"device_renamer\", object=\"device:1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:emily\",\"relation\":\"live_video_viewer\",\"object\":\"device:1\"},{\"user\":\"user:emily\",\"relation\":\"recorded_video_viewer\",\"object\":\"device:1\"},{\"user\":\"user:emily\",\"relation\":\"device_renamer\",\"object\":\"device:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily live_video_viewer device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily recorded_video_viewer device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily device_renamer device:1 write([ { \"user\":\"user:emily\", \"relation\":\"live_video_viewer\", \"object\":\"device:1\" }, { \"user\":\"user:emily\", \"relation\":\"recorded_video_viewer\", \"object\":\"device:1\" }, { \"user\":\"user:emily\", \"relation\":\"device_renamer\", \"object\":\"device:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Now try to query is emily related to device:1 as live_video_viewer?. The returned result should be emily is not related to device:1 as live_video_viewer. This confirms that direct relations have no effect on the live_video_viewer relations, and that is because the direct relationship type restriction was removed from the relation configuration. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:emily', relation: 'live_video_viewer', object: 'device:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:emily\", Relation: \"live_video_viewer\", Object: \"device:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:emily\", Relation = \"live_video_viewer\", Object = \"device:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:emily\", relation=\"live_video_viewer\", object=\"device:1\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily live_video_viewer device:1 # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:emily\",\"relation\":\"live_video_viewer\",\"object\":\"device:1\"}}' # Response: {\"allowed\":false} check( user = \"user:emily\", // check if the user `user:emily` relation = \"live_video_viewer\", // has an `live_video_viewer` relation object = \"device:1\", // with the object `device:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Query on the other relationships and you will see: User Object Relation Query Relation? emily device:1 recorded_video_viewer is emily related to device:1 as recorded_video_viewer? No emily device:1 device_renamer is emily related to device:1 as device_renamer? No","s":"05. Disallow Direct Relationships To Users","u":"/docs/modeling/advanced/iot","h":"#05-disallow-direct-relationships-to-users","p":778},{"i":803,"t":"In this post, you were introduced to fine grain authentication and OpenFGA. Upcoming posts will dive deeper into OpenFGA, introducing concepts that will improve on the model you built today, and tackling more complex permission systems, with more relations and requirements that need to be met.","s":"Summary","u":"/docs/modeling/advanced/iot","h":"#summary","p":778},{"i":805,"t":"Try adding a second group tied to devices 4 and 5. Add only Charles and Dianne to this group, then try to run queries that would validate your model. Management has decided that Security Guards can only access live videos, and instituted a new position called Security Officer who can view both live and recorded videos. Can you update the authorization model to reflect that?","s":"Exercises For You","u":"/docs/modeling/advanced/iot","h":"#exercises-for-you","p":778},{"i":807,"t":"This tutorial explains how to model permissions for a communication platform like Slack using OpenFGA. What you will learn How to indicate relationships between a group of users and an object. Used here to indicate that all members of a slack workspace can write in a certain channel. See Modeling User Groups for more. How to Model concentric relationship to have a certain relation on an object imply another relation on the same object. Used here to indicate that legacy admins have all the permissions of the more granular channels admin. See Modeling Concentric Relationships for more. How to use the union operator condition to indicate that a user might have a certain relation with an object if they match any of the criteria indicated.","s":"Modeling Authorization for Slack with OpenFGA","u":"/docs/modeling/advanced/slack","h":"","p":806},{"i":809,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA concepts and know how to develop the things that we will list below. OpenFGA Concepts​ It would be helpful to have an understanding of some concepts of OpenFGA before you start. Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → Modeling Concentric Relationships​ You need to know how to update the authorization model to allow having nested relations such as all writers are readers. Learn more → Concepts & Configuration Language​ Some OpenFGA Concepts Configuration Language","s":"Before You Start","u":"/docs/modeling/advanced/slack","h":"#before-you-start","p":806},{"i":811,"t":"It would be helpful to have an understanding of some concepts of OpenFGA before you start.","s":"OpenFGA Concepts","u":"/docs/modeling/advanced/slack","h":"#-concepts","p":806},{"i":813,"t":"Slack is a messaging app for businesses that connects people to the information they need. By bringing people together to work as one unified team, Slack transforms the way organizations communicate. (Source: What is Slack?) In this tutorial, you will build a subset of the Slack permission model (detailed below) in OpenFGA, using some scenarios to validate the model. As reference, you can refer to Slack's publicly available docs: Role Management at Slack Types of Roles in Slack Permissions by Role in Slack Manage a Workspace on Enterprise Grid Manage channel posting permissions Note: For brevity, this tutorial will not model all of Slack's permissions. Instead, it will focus on modeling the scenarios outlined below.","s":"What you will be modeling","u":"/docs/modeling/advanced/slack","h":"#what-you-will-be-modeling","p":806},{"i":815,"t":"This tutorial will focus on the following sections (this is a partial list of Slack's roles): Workspace Roles: Guest: This type of user is limited in their ability to use Slack, and is only permitted to see one or multiple delegated channels. Member: This is the base type of user that does not have any particular administrative abilities, but has basic access to the organization's Slack workspaces. When an administrative change needs to be made, these users need the support of admins and owners to make the changes. Legacy Admin: This type of user is the basic administrator of any organization, and can make a wide variety of administrative changes across Slack, such as renaming channels, archiving channels, setting up preferences and policies, inviting new users, and installing applications. Users with this role perform the majority of administrative tasks across a team. System Roles: Channels Admin: This type of user has the permission to archive channels, rename channels, create private channels, and convert public channels into private channels. Channel Settings: Visibility: Public: Visible to all members and open to join Private: Visible to admins and invited members Posting Permissions: Open: Anyone can post Limited: Only allowed members can post","s":"Requirements","u":"/docs/modeling/advanced/slack","h":"#requirements","p":806},{"i":817,"t":"Use the following scenarios to be able to validate whether the model of the requirements is correct. There will be the following users: Amy Bob Catherine David Emily These users will interact in the following scenarios: You will assume there is a Slack workspace called Sandcastle Amy is a legacy admin of the Sandcastle workspace Bob is a member of the Sandcastle workspace with a channels admin role (Read more about system roles at Slack here) Catherine and Emily are normal members of the Sandcastle workspace, they can view all public channels, as well as channels they have been invited to David is a guest user with only view and write access to #proj-marketing-campaign, one of the public channels in the Sandcastle workspace Bob and Emily are in a private channel #marketing-internal in the Sandcastle workspace which only they can view and post to All members of the Sandcastle workspace can view the general channel, but only Amy and Emily can post to it caution In production, it is highly recommended to use unique, immutable identifiers. Names are used in this article to make it easier to read and follow.","s":"Defined Scenarios","u":"/docs/modeling/advanced/slack","h":"#defined-scenarios","p":806},{"i":819,"t":"The goal by the end of this post is to ask OpenFGA: Does person X have permission to perform action Y on channel Z? In response, you want to either get a confirmation that person X can indeed do that, or a rejection that they cannot. E.g. does David have access to view #general? The OpenFGA is based on Zanzibar, a Relation Based Access Control system. This means it relies on objects and user relations to perform authorization checks. Setting aside the permissions, you will start with the roles and learn how to express the requirements in terms of relations you can feed into OpenFGA. The requirements stated: Amy is a legacy admin of the Sandcastle workspace Bob is a channels admin of the Sandcastle workspace Catherine and Emily are a normal members of the Sandcastle workspace David is a guest user Here is how you would express than in OpenFGA's authorization model: You have a type called \"workspace\", and users can be related to it as a legacy_admin, channels_admin, member and guest DSL JSON model schema 1.1 type user type workspace relations define legacy_admin: [user] define channels_admin: [user] define member: [user] define guest: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relations\": { \"legacy_admin\": { \"this\": {} }, \"channels_admin\": { \"this\": {} }, \"member\": { \"this\": {} }, \"guest\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"legacy_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"channels_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"guest\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Objects of type workspace have users related to them as: Legacy Admin (legacy_admin) Channels Admin (channels_admin) Member (member) Guest (guest) Direct relationship type restrictions indicate that a user can have a direct relationship with an object of the type the relation specifies.","s":"Modeling Workspaces & Channels","u":"/docs/modeling/advanced/slack","h":"#modeling-workspaces--channels","p":806},{"i":821,"t":"To keep things simple and focus on OpenFGA rather than Slack complexity, we will model only four roles (legacy_admin, channels_admin, member, guest). At the end of this section we want to have the following permissions represented User Relation Object amy legacy_admin workspace:sandcastle bob channels_admin workspace:sandcastle catherine member workspace:sandcastle david guest workspace:sandcastle emily member workspace:sandcastle To represent permissions in OpenFGA we use relations. For workspace permissions we need to create the following authorization model: DSL JSON model schema 1.1 type user type workspace relations define legacy_admin: [user] define channels_admin: [user] define member: [user] define guest: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relations\": { \"legacy_admin\": { \"this\": {} }, \"channels_admin\": { \"this\": {} }, \"member\": { \"this\": {} }, \"guest\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"legacy_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"channels_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"guest\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The OpenFGA service determines if a user has access to an object by checking if the user has a relation to that object. Let us examine one of those relations in detail: DSL JSON type workspace relations define member: [user] { \"type\": \"workspace\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } info The snippet above indicates that objects of type workspace have users related to them as \"member\" if those users belong to the userset of all users related to the workspace as \"member\". This means that a user can be directly related as a member to an object of type \"workspace\" If we want to say amy is a legacy_admin of workspace:sandcastle we create this relationship tuple Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Amy is a Legacy Admin in the Sandcastle workspace { user: 'user:amy', relation: 'legacy_admin', object: 'workspace:sandcastle'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Amy is a Legacy Admin in the Sandcastle workspace User: openfga.PtrString(\"user:amy\"), Relation: openfga.PtrString(\"legacy_admin\"), Object: openfga.PtrString(\"workspace:sandcastle\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Amy is a Legacy Admin in the Sandcastle workspace new() { User = \"user:amy\", Relation = \"legacy_admin\", Object = \"workspace:sandcastle\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Amy is a Legacy Admin in the Sandcastle workspace user=\"user:amy\", relation=\"legacy_admin\", object=\"workspace:sandcastle\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:amy\",\"relation\":\"legacy_admin\",\"object\":\"workspace:sandcastle\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy legacy_admin workspace:sandcastle write([ // Amy is a Legacy Admin in the Sandcastle workspace { \"user\":\"user:amy\", \"relation\":\"legacy_admin\", \"object\":\"workspace:sandcastle\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") We can now ask OpenFGA \"is amy a legacy_admin of workspace:sandcastle?\" Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:amy', relation: 'legacy_admin', object: 'workspace:sandcastle', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:amy\", Relation: \"legacy_admin\", Object: \"workspace:sandcastle\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:amy\", Relation = \"legacy_admin\", Object = \"workspace:sandcastle\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:amy\", relation=\"legacy_admin\", object=\"workspace:sandcastle\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy legacy_admin workspace:sandcastle # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:amy\",\"relation\":\"legacy_admin\",\"object\":\"workspace:sandcastle\"}}' # Response: {\"allowed\":true} check( user = \"user:amy\", // check if the user `user:amy` relation = \"legacy_admin\", // has an `legacy_admin` relation object = \"workspace:sandcastle\", // with the object `workspace:sandcastle` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true We can also say that catherine is a member of workspace:sandcastle: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Catherine is a Member in the Sandcastle workspace { user: 'user:catherine', relation: 'member', object: 'workspace:sandcastle'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Catherine is a Member in the Sandcastle workspace User: openfga.PtrString(\"user:catherine\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"workspace:sandcastle\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Catherine is a Member in the Sandcastle workspace new() { User = \"user:catherine\", Relation = \"member\", Object = \"workspace:sandcastle\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Catherine is a Member in the Sandcastle workspace user=\"user:catherine\", relation=\"member\", object=\"workspace:sandcastle\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:catherine\",\"relation\":\"member\",\"object\":\"workspace:sandcastle\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:catherine member workspace:sandcastle write([ // Catherine is a Member in the Sandcastle workspace { \"user\":\"user:catherine\", \"relation\":\"member\", \"object\":\"workspace:sandcastle\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") And verify by asking OpenFGA Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:catherine', relation: 'member', object: 'workspace:sandcastle', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:catherine\", Relation: \"member\", Object: \"workspace:sandcastle\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:catherine\", Relation = \"member\", Object = \"workspace:sandcastle\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:catherine\", relation=\"member\", object=\"workspace:sandcastle\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:catherine member workspace:sandcastle # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:catherine\",\"relation\":\"member\",\"object\":\"workspace:sandcastle\"}}' # Response: {\"allowed\":true} check( user = \"user:catherine\", // check if the user `user:catherine` relation = \"member\", // has an `member` relation object = \"workspace:sandcastle\", // with the object `workspace:sandcastle` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Catherine, on the other hand, is not a legacy_admin of workspace:sandcastle. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:catherine', relation: 'legacy_admin', object: 'workspace:sandcastle', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:catherine\", Relation: \"legacy_admin\", Object: \"workspace:sandcastle\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:catherine\", Relation = \"legacy_admin\", Object = \"workspace:sandcastle\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:catherine\", relation=\"legacy_admin\", object=\"workspace:sandcastle\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:catherine legacy_admin workspace:sandcastle # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:catherine\",\"relation\":\"legacy_admin\",\"object\":\"workspace:sandcastle\"}}' # Response: {\"allowed\":false} check( user = \"user:catherine\", // check if the user `user:catherine` relation = \"legacy_admin\", // has an `legacy_admin` relation object = \"workspace:sandcastle\", // with the object `workspace:sandcastle` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Repeat this process for the other relationships [ { // Bob is a Channels Admin in the Sandcastle workspace user: 'user:bob', relation: 'channels_admin', object: 'workspace:sandcastle', }, { // David is a guest in the Sandcastle workspace user: 'user:david', relation: 'guest', object: 'workspace:sandcastle', }, { // Emily is a Member in the Sandcastle workspace user: 'user:emily', relation: 'member', object: 'workspace:sandcastle', }, ] Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Bob is a Channels Admin in the Sandcastle workspace { user: 'user:bob', relation: 'channels_admin', object: 'workspace:sandcastle'}, // David is a guest in the Sandcastle workspace { user: 'user:david', relation: 'guest', object: 'workspace:sandcastle'}, // Emily is a Member in the Sandcastle workspace { user: 'user:emily', relation: 'member', object: 'workspace:sandcastle'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Bob is a Channels Admin in the Sandcastle workspace User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"channels_admin\"), Object: openfga.PtrString(\"workspace:sandcastle\"), }, { // David is a guest in the Sandcastle workspace User: openfga.PtrString(\"user:david\"), Relation: openfga.PtrString(\"guest\"), Object: openfga.PtrString(\"workspace:sandcastle\"), }, { // Emily is a Member in the Sandcastle workspace User: openfga.PtrString(\"user:emily\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"workspace:sandcastle\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Bob is a Channels Admin in the Sandcastle workspace new() { User = \"user:bob\", Relation = \"channels_admin\", Object = \"workspace:sandcastle\" }, // David is a guest in the Sandcastle workspace new() { User = \"user:david\", Relation = \"guest\", Object = \"workspace:sandcastle\" }, // Emily is a Member in the Sandcastle workspace new() { User = \"user:emily\", Relation = \"member\", Object = \"workspace:sandcastle\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Bob is a Channels Admin in the Sandcastle workspace user=\"user:bob\", relation=\"channels_admin\", object=\"workspace:sandcastle\", ), ClientTuple( # David is a guest in the Sandcastle workspace user=\"user:david\", relation=\"guest\", object=\"workspace:sandcastle\", ), ClientTuple( # Emily is a Member in the Sandcastle workspace user=\"user:emily\", relation=\"member\", object=\"workspace:sandcastle\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:bob\",\"relation\":\"channels_admin\",\"object\":\"workspace:sandcastle\"},{\"user\":\"user:david\",\"relation\":\"guest\",\"object\":\"workspace:sandcastle\"},{\"user\":\"user:emily\",\"relation\":\"member\",\"object\":\"workspace:sandcastle\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob channels_admin workspace:sandcastle fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:david guest workspace:sandcastle fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily member workspace:sandcastle write([ // Bob is a Channels Admin in the Sandcastle workspace { \"user\":\"user:bob\", \"relation\":\"channels_admin\", \"object\":\"workspace:sandcastle\" }, // David is a guest in the Sandcastle workspace { \"user\":\"user:david\", \"relation\":\"guest\", \"object\":\"workspace:sandcastle\" }, // Emily is a Member in the Sandcastle workspace { \"user\":\"user:emily\", \"relation\":\"member\", \"object\":\"workspace:sandcastle\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Verification​ To verify, we can issue check request to verify it is working as expected. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:amy', relation: 'legacy_admin', object: 'workspace:sandcastle', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:amy\", Relation: \"legacy_admin\", Object: \"workspace:sandcastle\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:amy\", Relation = \"legacy_admin\", Object = \"workspace:sandcastle\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:amy\", relation=\"legacy_admin\", object=\"workspace:sandcastle\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy legacy_admin workspace:sandcastle # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:amy\",\"relation\":\"legacy_admin\",\"object\":\"workspace:sandcastle\"}}' # Response: {\"allowed\":true} check( user = \"user:amy\", // check if the user `user:amy` relation = \"legacy_admin\", // has an `legacy_admin` relation object = \"workspace:sandcastle\", // with the object `workspace:sandcastle` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Let's try to verify the followings: User Object Relation Query Relation? amy workspace:sandcastle legacy_admin is amy related to workspace:sandcastle as legacy_admin? Yes david workspace:sandcastle legacy_admin is david related to workspace:sandcastle as legacy_admin? No amy workspace:sandcastle guest is amy related to workspace:sandcastle as guest? No david workspace:sandcastle guest is david related to workspace:sandcastle as guest? Yes amy workspace:sandcastle member is amy related to workspace:sandcastle as member? No david workspace:sandcastle member is david related to workspace:sandcastle as member? No","s":"01. Individual Permissions","u":"/docs/modeling/advanced/slack","h":"#01-individual-permissions","p":806},{"i":823,"t":"Some of the queries that you ran earlier, while returning the correct response, do not match reality. One of which is: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:amy', relation: 'member', object: 'workspace:sandcastle', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:amy\", Relation: \"member\", Object: \"workspace:sandcastle\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:amy\", Relation = \"member\", Object = \"workspace:sandcastle\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:amy\", relation=\"member\", object=\"workspace:sandcastle\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy member workspace:sandcastle # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:amy\",\"relation\":\"member\",\"object\":\"workspace:sandcastle\"}}' # Response: {\"allowed\":false} check( user = \"user:amy\", // check if the user `user:amy` relation = \"member\", // has an `member` relation object = \"workspace:sandcastle\", // with the object `workspace:sandcastle` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false As you saw before, running this query will return amy is not a member of workspace:sandcastle, which is correct based on the data you have given OpenFGA so far. But in reality, Amy, who is a legacy_admin already has an implied channels_admin and member relations. In fact anyone (other than a guest) is a member of the workspace. To change this behavior, we will update our system with a concentric relationship model. With the following updated authorization model, you are informing OpenFGA that any user who is related to a workspace as legacy_admin, is also related as a channels_admin and a member . DSL JSON model schema 1.1 type user type workspace relations define legacy_admin: [user] define channels_admin: [user] or legacy_admin define member: [user] or channels_admin or legacy_admin define guest: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relations\": { \"legacy_admin\": { \"this\": {} }, \"channels_admin\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"legacy_admin\" } } ] } }, \"member\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"channels_admin\" } }, { \"computedUserset\": { \"relation\": \"legacy_admin\" } } ] } }, \"guest\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"legacy_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"channels_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"guest\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } We can then verify amy is a member of workspace:sandcastle. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:amy', relation: 'member', object: 'workspace:sandcastle', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:amy\", Relation: \"member\", Object: \"workspace:sandcastle\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:amy\", Relation = \"member\", Object = \"workspace:sandcastle\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:amy\", relation=\"member\", object=\"workspace:sandcastle\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy member workspace:sandcastle # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:amy\",\"relation\":\"member\",\"object\":\"workspace:sandcastle\"}}' # Response: {\"allowed\":true} check( user = \"user:amy\", // check if the user `user:amy` relation = \"member\", // has an `member` relation object = \"workspace:sandcastle\", // with the object `workspace:sandcastle` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true We can check for other users and relationships. User Object Relation Query Relation? amy workspace:sandcastle legacy_admin is amy related to workspace:sandcastle as legacy_admin? Yes david workspace:sandcastle legacy_admin is david related to workspace:sandcastle as legacy_admin? No amy workspace:sandcastle guest is amy related to workspace:sandcastle as guest? No david workspace:sandcastle guest is david related to workspace:sandcastle as guest? Yes amy workspace:sandcastle member is amy related to workspace:sandcastle as member? Yes david workspace:sandcastle member is david related to workspace:sandcastle as member? No","s":"02. Updating The workspace Authorization Model With Implied Relations","u":"/docs/modeling/advanced/slack","h":"#02-updating-the-workspace-authorization-model-with-implied-relations","p":806},{"i":825,"t":"So far, you have modeled the users' relations to the workspace itself. In this task you will expand the model to include the relations concerning the channels. By the end of it, you will run some queries to check whether a user can view or write to a certain channel. Queries such as: is david related to channel:general as viewer? (expected answer: No relation, as David is a guest user with only a relation to #proj-marketing-campaign) is david related to channel:proj_marketing_campaign as viewer? (expected answer: There is a relation, as there is a relation between David and #proj-marketing-campaign as a writer) is bob related to channel:general as viewer? (expected answer: There is a relation, as Bob is a member of the Sandcastle workspace, and all members of the workspace have a viewer relation to #general) The requirements are: Amy, Bob, Catherine and Emily, are normal members of the Sandcastle workspace, they can view all public channels, in this case: #general and #proj-marketing-campaign David, a guest user, has only view and write access to the #proj-marketing-campaign channel Bob and Emily are the only ones with either view or write access to the #marketing-internal channel Amy and Emily are the only ones with write access to the #general channel The possible relations to channels are: Workspace includes the channel, consider the relation that of a parent workspace A user can be a viewer and/or writer on a channel The authorization model already has a section describing the workspace, what remains is describing the channel. That can be done by adding the following section to the configuration above: DSL JSON type channel relations define parent_workspace: [workspace] define writer: [user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest] define viewer: [user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest] { \"type\": \"channel\", \"relations\": { \"parent_workspace\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"parent_workspace\": { \"directly_related_user_types\": [ { \"type\": \"workspace\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relation\": \"legacy_admin\" }, { \"type\": \"workspace\", \"relation\": \"channels_admin\" }, { \"type\": \"workspace\", \"relation\": \"member\" }, { \"type\": \"workspace\", \"relation\": \"guest\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relation\": \"legacy_admin\" }, { \"type\": \"workspace\", \"relation\": \"channels_admin\" }, { \"type\": \"workspace\", \"relation\": \"member\" }, { \"type\": \"workspace\", \"relation\": \"guest\" } ] } } } } info The configuration snippet above describes a channel that can have the following relations: workspaces related to it as parent_workspace users related to it as writer users related to it as viewer Implied Relation​ There is an implied relation that anyone who can write to a channel can also read from it, so the authorization model can be modified to be: DSL JSON type channel relations define parent_workspace: [workspace] define writer: [user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest] define viewer: [user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest] or writer { \"type\": \"channel\", \"relations\": { \"parent_workspace\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } } }, \"metadata\": { \"relations\": { \"parent_workspace\": { \"directly_related_user_types\": [ { \"type\": \"workspace\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relation\": \"legacy_admin\" }, { \"type\": \"workspace\", \"relation\": \"channels_admin\" }, { \"type\": \"workspace\", \"relation\": \"member\" }, { \"type\": \"workspace\", \"relation\": \"guest\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relation\": \"legacy_admin\" }, { \"type\": \"workspace\", \"relation\": \"channels_admin\" }, { \"type\": \"workspace\", \"relation\": \"member\" }, { \"type\": \"workspace\", \"relation\": \"guest\" } ] } } } } info Note that the channel type definition has been updated to indicate that viewer is the union of: the set of users with a direct viewer relation to this object the set of users with writer relations to this object As a result, the authorization model is: DSL JSON model schema 1.1 type user type workspace relations define legacy_admin: [user] define channels_admin: [user] or legacy_admin define member: [user] or channels_admin or legacy_admin define guest: [user] type channel relations define parent_workspace: [workspace] define writer: [user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest] define viewer: [user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest] or writer { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relations\": { \"legacy_admin\": { \"this\": {} }, \"channels_admin\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"legacy_admin\" } } ] } }, \"member\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"channels_admin\" } }, { \"computedUserset\": { \"relation\": \"legacy_admin\" } } ] } }, \"guest\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"legacy_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"channels_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"guest\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"channel\", \"relations\": { \"parent_workspace\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } } }, \"metadata\": { \"relations\": { \"parent_workspace\": { \"directly_related_user_types\": [ { \"type\": \"workspace\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relation\": \"legacy_admin\" }, { \"type\": \"workspace\", \"relation\": \"channels_admin\" }, { \"type\": \"workspace\", \"relation\": \"member\" }, { \"type\": \"workspace\", \"relation\": \"guest\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relation\": \"legacy_admin\" }, { \"type\": \"workspace\", \"relation\": \"channels_admin\" }, { \"type\": \"workspace\", \"relation\": \"member\" }, { \"type\": \"workspace\", \"relation\": \"guest\" } ] } } } } ] } Updating Relationship Tuples​ What remains is to add the relationship tuples to indicate the relation between the users, workspace and the channels. The Sandcastle workspace is a parent workspace of the #general, #marketing-internal and #proj-marketing-campaign channels. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'workspace:sandcastle', relation: 'parent_workspace', object: 'channel:general'}, { user: 'workspace:sandcastle', relation: 'parent_workspace', object: 'channel:marketing_internal'}, { user: 'workspace:sandcastle', relation: 'parent_workspace', object: 'channel:proj_marketing_campaign'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"workspace:sandcastle\"), Relation: openfga.PtrString(\"parent_workspace\"), Object: openfga.PtrString(\"channel:general\"), }, { User: openfga.PtrString(\"workspace:sandcastle\"), Relation: openfga.PtrString(\"parent_workspace\"), Object: openfga.PtrString(\"channel:marketing_internal\"), }, { User: openfga.PtrString(\"workspace:sandcastle\"), Relation: openfga.PtrString(\"parent_workspace\"), Object: openfga.PtrString(\"channel:proj_marketing_campaign\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"workspace:sandcastle\", Relation = \"parent_workspace\", Object = \"channel:general\" }, new() { User = \"workspace:sandcastle\", Relation = \"parent_workspace\", Object = \"channel:marketing_internal\" }, new() { User = \"workspace:sandcastle\", Relation = \"parent_workspace\", Object = \"channel:proj_marketing_campaign\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"workspace:sandcastle\", relation=\"parent_workspace\", object=\"channel:general\", ), ClientTuple( user=\"workspace:sandcastle\", relation=\"parent_workspace\", object=\"channel:marketing_internal\", ), ClientTuple( user=\"workspace:sandcastle\", relation=\"parent_workspace\", object=\"channel:proj_marketing_campaign\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"workspace:sandcastle\",\"relation\":\"parent_workspace\",\"object\":\"channel:general\"},{\"user\":\"workspace:sandcastle\",\"relation\":\"parent_workspace\",\"object\":\"channel:marketing_internal\"},{\"user\":\"workspace:sandcastle\",\"relation\":\"parent_workspace\",\"object\":\"channel:proj_marketing_campaign\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle parent_workspace channel:general fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle parent_workspace channel:marketing_internal fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle parent_workspace channel:proj_marketing_campaign write([ { \"user\":\"workspace:sandcastle\", \"relation\":\"parent_workspace\", \"object\":\"channel:general\" }, { \"user\":\"workspace:sandcastle\", \"relation\":\"parent_workspace\", \"object\":\"channel:marketing_internal\" }, { \"user\":\"workspace:sandcastle\", \"relation\":\"parent_workspace\", \"object\":\"channel:proj_marketing_campaign\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") #general Channel​ The #general channel is a public channel visible to all the members of the workspace. In OpenFGA, you represent this relation in the form of the following relationship tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer` { user: 'workspace:sandcastle#member', relation: 'viewer', object: 'channel:general'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer` User: openfga.PtrString(\"workspace:sandcastle#member\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"channel:general\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer` new() { User = \"workspace:sandcastle#member\", Relation = \"viewer\", Object = \"channel:general\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer` user=\"workspace:sandcastle#member\", relation=\"viewer\", object=\"channel:general\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"workspace:sandcastle#member\",\"relation\":\"viewer\",\"object\":\"channel:general\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle#member viewer channel:general write([ // The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer` { \"user\":\"workspace:sandcastle#member\", \"relation\":\"viewer\", \"object\":\"channel:general\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") info This indicates The set of users related to workspace:sandcastle as member are also related to channel:general as viewer And to indicate that Amy and Emily can write to it: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation { user: 'user:amy', relation: 'writer', object: 'channel:general'}, { user: 'user:emily', relation: 'writer', object: 'channel:general'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation User: openfga.PtrString(\"user:amy\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"channel:general\"), }, { User: openfga.PtrString(\"user:emily\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"channel:general\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation new() { User = \"user:amy\", Relation = \"writer\", Object = \"channel:general\" }, new() { User = \"user:emily\", Relation = \"writer\", Object = \"channel:general\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation user=\"user:amy\", relation=\"writer\", object=\"channel:general\", ), ClientTuple( user=\"user:emily\", relation=\"writer\", object=\"channel:general\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:amy\",\"relation\":\"writer\",\"object\":\"channel:general\"},{\"user\":\"user:emily\",\"relation\":\"writer\",\"object\":\"channel:general\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy writer channel:general fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily writer channel:general write([ // Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation { \"user\":\"user:amy\", \"relation\":\"writer\", \"object\":\"channel:general\" }, { \"user\":\"user:emily\", \"relation\":\"writer\", \"object\":\"channel:general\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") #marketing-internal Channel​ The #marketing-internal is visible to only Bob and Emily. They can view and write in it. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:bob', relation: 'writer', object: 'channel:marketing_internal'}, { user: 'user:emily', relation: 'writer', object: 'channel:marketing_internal'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"channel:marketing_internal\"), }, { User: openfga.PtrString(\"user:emily\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"channel:marketing_internal\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:bob\", Relation = \"writer\", Object = \"channel:marketing_internal\" }, new() { User = \"user:emily\", Relation = \"writer\", Object = \"channel:marketing_internal\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:bob\", relation=\"writer\", object=\"channel:marketing_internal\", ), ClientTuple( user=\"user:emily\", relation=\"writer\", object=\"channel:marketing_internal\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"channel:marketing_internal\"},{\"user\":\"user:emily\",\"relation\":\"writer\",\"object\":\"channel:marketing_internal\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob writer channel:marketing_internal fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily writer channel:marketing_internal write([ { \"user\":\"user:bob\", \"relation\":\"writer\", \"object\":\"channel:marketing_internal\" }, { \"user\":\"user:emily\", \"relation\":\"writer\", \"object\":\"channel:marketing_internal\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") #proj-marketing-campaign Channel​ The #proj-marketing-campaign is public to all members of the Sandcastle workspace. They can view and write in it. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'workspace:sandcastle#member', relation: 'writer', object: 'channel:proj_marketing_campaign'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"workspace:sandcastle#member\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"channel:proj_marketing_campaign\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"workspace:sandcastle#member\", Relation = \"writer\", Object = \"channel:proj_marketing_campaign\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"workspace:sandcastle#member\", relation=\"writer\", object=\"channel:proj_marketing_campaign\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"workspace:sandcastle#member\",\"relation\":\"writer\",\"object\":\"channel:proj_marketing_campaign\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle#member writer channel:proj_marketing_campaign write([ { \"user\":\"workspace:sandcastle#member\", \"relation\":\"writer\", \"object\":\"channel:proj_marketing_campaign\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") David is a guest user who can also view and write to #proj-marketing-campaign Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:david', relation: 'writer', object: 'channel:proj_marketing_campaign'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:david\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"channel:proj_marketing_campaign\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:david\", Relation = \"writer\", Object = \"channel:proj_marketing_campaign\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:david\", relation=\"writer\", object=\"channel:proj_marketing_campaign\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:david\",\"relation\":\"writer\",\"object\":\"channel:proj_marketing_campaign\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:david writer channel:proj_marketing_campaign write([ { \"user\":\"user:david\", \"relation\":\"writer\", \"object\":\"channel:proj_marketing_campaign\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Verification​ Now that you have added the necessary relationship tuples, you will check to make sure that your configuration is valid. First, we want to ensure david is not related to channel:general as viewer. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:david', relation: 'viewer', object: 'channel:general', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:david\", Relation: \"viewer\", Object: \"channel:general\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:david\", Relation = \"viewer\", Object = \"channel:general\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:david\", relation=\"viewer\", object=\"channel:general\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:david viewer channel:general # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:david\",\"relation\":\"viewer\",\"object\":\"channel:general\"}}' # Response: {\"allowed\":false} check( user = \"user:david\", // check if the user `user:david` relation = \"viewer\", // has an `viewer` relation object = \"channel:general\", // with the object `channel:general` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false David should be related to channel:proj_marketing_campaign as viewer. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:david', relation: 'viewer', object: 'channel:proj_marketing_campaign', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:david\", Relation: \"viewer\", Object: \"channel:proj_marketing_campaign\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:david\", Relation = \"viewer\", Object = \"channel:proj_marketing_campaign\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:david\", relation=\"viewer\", object=\"channel:proj_marketing_campaign\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:david viewer channel:proj_marketing_campaign # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:david\",\"relation\":\"viewer\",\"object\":\"channel:proj_marketing_campaign\"}}' # Response: {\"allowed\":true} check( user = \"user:david\", // check if the user `user:david` relation = \"viewer\", // has an `viewer` relation object = \"channel:proj_marketing_campaign\", // with the object `channel:proj_marketing_campaign` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Repeat this for the following relations User Object Relation Query Relation? amy workspace:sandcastle legacy_admin is amy related to workspace:sandcastle as legacy_admin? Yes amy workspace:sandcastle member is amy related to workspace:sandcastle as member? Yes amy workspace:sandcastle channels_admin is amy related to workspace:sandcastle as channels_admin? Yes amy channel:general writer is amy related to channel:general as writer? Yes amy channel:general viewer is amy related to channel:general as viewer? Yes amy channel:marketing_internal writer is amy related to channel:marketing_internal as writer? No amy channel:marketing_internal viewer is amy related to channel:marketing_internal as viewer? No emily channel:marketing_internal writer is emily related to channel:marketing_internal as writer? Yes emily channel:marketing_internal viewer is emily related to channel:marketing_internal as viewer? Yes david workspace:sandcastle guest is david related to workspace:sandcastle as guest? Yes david workspace:sandcastle member is david related to workspace:sandcastle as member? No david channel:general viewer is david related to channel:general as viewer? No david channel:marketing_internal viewer is david related to channel:marketing_internal as viewer? No david channel:proj_marketing_campaign viewer is david related to channel:proj_marketing_campaign as viewer? Yes","s":"03. Updating The Authorization Model To Include Channels","u":"/docs/modeling/advanced/slack","h":"#03-updating-the-authorization-model-to-include-channels","p":806},{"i":827,"t":"Have a basic understanding of authorization and OpenFGA Concepts. Understand how to model authorization for a communication platform like Slack using OpenFGA. In this tutorial, you: were introduced to fine grain authentication and OpenFGA. learned how to build and test an OpenFGA authorization model for a communication platforms like Slack. Upcoming tutorials will dive deeper into OpenFGA, introducing concepts that will improve on the model you built today, and tackling different permission systems, with other relations and requirements that need to be met. If you are interested in learning more about Authorization and Role Management at Slack, check out the Okta Fine Grained Authorization (FGA) team's chat with the Slack engineering team.","s":"Summary","u":"/docs/modeling/advanced/slack","h":"#summary","p":806},{"i":829,"t":"Try adding more relationship tuples to represent other users and channels being added. Then run queries to make sure that the authorization model remains valid. Update the configuration to model more Slack permissions (workspace owners, Slack orgs), then add the relationship tuples necessary and run some queries to validate your configuration.","s":"Exercises For You","u":"/docs/modeling/advanced/slack","h":"#exercises-for-you","p":806},{"i":831,"t":"This tutorial explains how to represent Google Drive permissions model with OpenFGA. What you will learn Indicate relationships between a group of users and an object. See Modeling User Groups for more. Used here to indicate that all users within a domain can access a document (sharing a document within an organization). Model concentric relationship to have a certain relation on an object imply another relation on the same object. See Modeling Concepts: Concentric Relationships for more. Used here is to indicate that writers are also commenters and viewers. Using the union operator condition to indicate that a user might have a certain relation with an object if they match any of the criteria indicated. Used here to indicate that a user can be a viewer on a document, or can have the viewer relationship implied through commenter. Using the type bound public access in a relationship tuple's user field to indicate that everyone has a certain relation with an object. See Modeling Public Access for more. Used here to share documents publicly. Model parent-child objects to indicate that a user having a relationship with a certain object implies having a relationship with another object in OpenFGA. Used here is to indicate that a writer on a folder is a writer on all documents inside that folder.","s":"Modeling Google Drive permissions with OpenFGA","u":"/docs/modeling/advanced/gdrive","h":"","p":830},{"i":833,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA concepts and know how to develop the things that we will list below. OpenFGA Concepts​ It would be helpful to have an understanding of some concepts of OpenFGA before you start. Modeling Concentric Relationships​ You need to know how to update the authorization model to allow having nested relations such as all writers are readers. Learn more → Modeling Object-to-Object Relationships​ You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more → Used here to indicate that users who have access to view a folder have access to view all documents inside it. Modeling Public Access​ You need to know how to add a relationship tuple to indicate that a resource is publicly available. Learn more → Concepts & Configuration Language​ The OpenFGA Concepts Configuration Language","s":"Before You Start","u":"/docs/modeling/advanced/gdrive","h":"#before-you-start","p":830},{"i":835,"t":"It would be helpful to have an understanding of some concepts of OpenFGA before you start.","s":"OpenFGA Concepts","u":"/docs/modeling/advanced/gdrive","h":"#-concepts","p":830},{"i":837,"t":"Google Drive is a system to store, share, and collaborate on files and folders. Source In this tutorial, you will build a subset of the Google Drive permission model (detailed below) in OpenFGA, using some scenarios to validate the model. Note: For brevity, this tutorial will not model all of Google Drive's permissions. Instead, it will focus on modeling for the scenarios outlined below","s":"What You Will Be Modeling","u":"/docs/modeling/advanced/gdrive","h":"#what-you-will-be-modeling","p":830},{"i":839,"t":"Google Drive's permission model is represented in their documentation. In this tutorial, you will be focusing on a subset of these permissions. Requirements: Users can be owners, editors, commenters and viewers of documents Documents can be shared with all users in a domain Folders can contain documents and users with a certain permission on a folder have that same permission to a document in that folder Documents and folders can be shared publicly","s":"Requirements","u":"/docs/modeling/advanced/gdrive","h":"#requirements","p":830},{"i":841,"t":"There will be the following users: Anne, who is in the xyz domain Beth, who is in the xyz domain Charles, who is in the xyz domain Diane, who is NOT in the xyz domain Erik, who is NOT in the xyz domain There will be: a 2021-budget document, owned by Anne, shared for commenting with Beth and viewable by all members of the xyz domain. a 2021-planning folder, viewable by Diane and contains the 2021-budget document a 2021-public-roadmap document, owned by Anne, available for members xyz domain to comment on and is publicly viewable","s":"Defined Scenarios","u":"/docs/modeling/advanced/gdrive","h":"#defined-scenarios","p":830},{"i":844,"t":"To keep thing simple and focus on OpenFGA features rather than Google Drive complexity we will model only four roles (Viewer, Commenter, Writer, Owner). At the end of this section we want to have the following permissions represented: To represent permissions in OpenFGA we use relations. For document permissions we need to create the following authorization model: DSL JSON model schema 1.1 type user type document relations define owner: [user] define writer: [user] define commenter: [user] define viewer: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"commenter\": { \"this\": {} }, \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The OpenFGA service determines if a user has access to an object by checking if the user has a relation to that object. Let us examine one of those relations in detail: DSL JSON type document relations define viewer: [user] { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } info The snippet above indicates that objects of type document have users related to them as \"viewer\" if those users belong to the userset of all users related to the document as \"viewer\". This means that a user can be directly related as a viewer to an object of type \"document\" If we want to say beth is a commenter of document:2021-budget we create this relationship tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:beth', relation: 'commenter', object: 'document:2021-budget'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"commenter\"), Object: openfga.PtrString(\"document:2021-budget\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:beth\", Relation = \"commenter\", Object = \"document:2021-budget\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:beth\", relation=\"commenter\", object=\"document:2021-budget\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:beth\",\"relation\":\"commenter\",\"object\":\"document:2021-budget\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth commenter document:2021-budget write([ { \"user\":\"user:beth\", \"relation\":\"commenter\", \"object\":\"document:2021-budget\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") We can now ask OpenFGA \"is beth a commenter of repository document:2021-budget?\" Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'commenter', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"commenter\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"commenter\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"commenter\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth commenter document:2021-budget # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"commenter\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"commenter\", // has an `commenter` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true We could also say that anne is an owner of the same document: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'owner', object: 'document:2021-budget'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"document:2021-budget\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"owner\", Object = \"document:2021-budget\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"owner\", object=\"document:2021-budget\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"owner\",\"object\":\"document:2021-budget\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-budget write([ { \"user\":\"user:anne\", \"relation\":\"owner\", \"object\":\"document:2021-budget\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") And ask some questions to OpenFGA: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'owner', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"owner\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"owner\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"owner\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-budget # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"owner\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"owner\", // has an `owner` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'writer', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"writer\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"writer\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"writer\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne writer document:2021-budget # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"writer\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"writer\", // has an `writer` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false The first reply makes sense but the second one does not. Intuitively, if anne was an owner, she was also be a writer. In fact, Google Drive explains this in their documentation To make OpenFGA aware of this \"concentric\" permission model we need to update our definitions: DSL JSON model schema 1.1 type user type document relations define owner: [user] define writer: [user] or owner define commenter: [user] or writer define viewer: [user] or commenter { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"this\": {} }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"owner\" } } ] } }, \"commenter\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"commenter\" } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Let's examine one of those relations in detail: objects of type document have users related to them as \"viewer\": if they belong to any of (the union of) the following: the userset of all users related to the document as \"viewer\" the userset of all users related to the document as \"commenter\" With this update our model now supports nested definitions and now: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'owner', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"owner\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"owner\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"owner\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-budget # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"owner\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"owner\", // has an `owner` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'writer', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"writer\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"writer\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"writer\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne writer document:2021-budget # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"writer\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"writer\", // has an `writer` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"01. Individual Permissions","u":"/docs/modeling/advanced/gdrive","h":"#01-individual-permissions","p":830},{"i":846,"t":"Google Drive allows you to share a file with everyone in your organization as a viewer, commenter or writer/editor. At the end of this section we want to end up with the following permissions represented: To add support for domains and members all we need to do is add this object to the OpenFGA authorization model. In addition, update the model to allow domain member to be assigned to document: DSL JSON model schema 1.1 type user type document relations define owner: [user, domain#member] define writer: [user, domain#member] or owner define commenter: [user, domain#member] or writer define viewer: [user, domain#member] or commenter type domain relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"this\": {} }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"owner\" } } ] } }, \"commenter\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"commenter\" } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } }, { \"type\": \"domain\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Objects of type \"domain\" have users related to them as \"member\" if they belong to the userset of all users related to the domain as \"member\". In other words, users can be direct members of a domain. Let's now create a domain, add members to it and make all members viewers of document:2021-budget. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // make anne, beth, charles a member of the xyz domain { user: 'user:anne', relation: 'member', object: 'domain:xyz'}, { user: 'user:beth', relation: 'member', object: 'domain:xyz'}, { user: 'user:charles', relation: 'member', object: 'domain:xyz'}, // make members of xyz domain viewers of document:2021-budget { user: 'domain:xyz#member', relation: 'viewer', object: 'document:2021-budget'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // make anne, beth, charles a member of the xyz domain User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"domain:xyz\"), }, { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"domain:xyz\"), }, { User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"domain:xyz\"), }, { // make members of xyz domain viewers of document:2021-budget User: openfga.PtrString(\"domain:xyz#member\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"document:2021-budget\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // make anne, beth, charles a member of the xyz domain new() { User = \"user:anne\", Relation = \"member\", Object = \"domain:xyz\" }, new() { User = \"user:beth\", Relation = \"member\", Object = \"domain:xyz\" }, new() { User = \"user:charles\", Relation = \"member\", Object = \"domain:xyz\" }, // make members of xyz domain viewers of document:2021-budget new() { User = \"domain:xyz#member\", Relation = \"viewer\", Object = \"document:2021-budget\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # make anne, beth, charles a member of the xyz domain user=\"user:anne\", relation=\"member\", object=\"domain:xyz\", ), ClientTuple( user=\"user:beth\", relation=\"member\", object=\"domain:xyz\", ), ClientTuple( user=\"user:charles\", relation=\"member\", object=\"domain:xyz\", ), ClientTuple( # make members of xyz domain viewers of document:2021-budget user=\"domain:xyz#member\", relation=\"viewer\", object=\"document:2021-budget\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"member\",\"object\":\"domain:xyz\"},{\"user\":\"user:beth\",\"relation\":\"member\",\"object\":\"domain:xyz\"},{\"user\":\"user:charles\",\"relation\":\"member\",\"object\":\"domain:xyz\"},{\"user\":\"domain:xyz#member\",\"relation\":\"viewer\",\"object\":\"document:2021-budget\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member domain:xyz fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth member domain:xyz fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles member domain:xyz fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw domain:xyz#member viewer document:2021-budget write([ // make anne, beth, charles a member of the xyz domain { \"user\":\"user:anne\", \"relation\":\"member\", \"object\":\"domain:xyz\" }, { \"user\":\"user:beth\", \"relation\":\"member\", \"object\":\"domain:xyz\" }, { \"user\":\"user:charles\", \"relation\":\"member\", \"object\":\"domain:xyz\" }, // make members of xyz domain viewers of document:2021-budget { \"user\":\"domain:xyz#member\", \"relation\":\"viewer\", \"object\":\"document:2021-budget\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") The last relationship tuple introduces a new OpenFGA concept. A userset. When the value of a user is formatted like this objectType:objectId#relation, OpenFGA will automatically expand the userset into all its individual user identifiers: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:charles', relation: 'viewer', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:charles\", Relation: \"viewer\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:charles\", Relation = \"viewer\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:charles\", relation=\"viewer\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles viewer document:2021-budget # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:charles\",\"relation\":\"viewer\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":true} check( user = \"user:charles\", // check if the user `user:charles` relation = \"viewer\", // has an `viewer` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"02. Organization Permissions","u":"/docs/modeling/advanced/gdrive","h":"#02-organization-permissions","p":830},{"i":848,"t":"Permission propagation happens between folders and files: if you are a viewer in a folder, you can view its documents. This applies even when you are not explicitly a viewer in a document. At the end of this section we want to end up with the following permissions represented. Note that a folder is an object in the document type, as we do not need a separate type: We need to add the notion that a document can be the parent of another document. We know how to do that: DSL JSON model schema 1.1 type user type document relations define parent: [document] define owner: [user, domain#member] define writer: [user, domain#member] or owner define commenter: [user, domain#member] or writer define viewer: [user, domain#member] or commenter { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"parent\": { \"this\": {} }, \"owner\": { \"this\": {} }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"owner\" } } ] } }, \"commenter\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"commenter\" } } ] } } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"document\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } } ] } info Notice the newly added \"parent\" relation in the configuration above. We can indicate this relation by adding the following relationship tuples Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Diane is a viewer of document:2021-planning { user: 'user:diane', relation: 'viewer', object: 'document:2021-planning'}, // document:2021-planning is a parent of document:2021-budget { user: 'document:2021-planning', relation: 'parent', object: 'document:2021-budget'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Diane is a viewer of document:2021-planning User: openfga.PtrString(\"user:diane\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"document:2021-planning\"), }, { // document:2021-planning is a parent of document:2021-budget User: openfga.PtrString(\"document:2021-planning\"), Relation: openfga.PtrString(\"parent\"), Object: openfga.PtrString(\"document:2021-budget\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Diane is a viewer of document:2021-planning new() { User = \"user:diane\", Relation = \"viewer\", Object = \"document:2021-planning\" }, // document:2021-planning is a parent of document:2021-budget new() { User = \"document:2021-planning\", Relation = \"parent\", Object = \"document:2021-budget\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Diane is a viewer of document:2021-planning user=\"user:diane\", relation=\"viewer\", object=\"document:2021-planning\", ), ClientTuple( # document:2021-planning is a parent of document:2021-budget user=\"document:2021-planning\", relation=\"parent\", object=\"document:2021-budget\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:diane\",\"relation\":\"viewer\",\"object\":\"document:2021-planning\"},{\"user\":\"document:2021-planning\",\"relation\":\"parent\",\"object\":\"document:2021-budget\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane viewer document:2021-planning fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw document:2021-planning parent document:2021-budget write([ // Diane is a viewer of document:2021-planning { \"user\":\"user:diane\", \"relation\":\"viewer\", \"object\":\"document:2021-planning\" }, // document:2021-planning is a parent of document:2021-budget { \"user\":\"document:2021-planning\", \"relation\":\"parent\", \"object\":\"document:2021-budget\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") What we still lack is the ability to propagate permissions from parent to children. We want to say that a user is a viewer of a document if either: [done] they have a viewer relationship (directly or through domain membership) [pending] they have a viewer relationship with the parent document We need a way to consider the parent viewers, not just direct viewers of the document when getting a check for: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:diane', relation: 'viewer', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = undefined Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:diane\", Relation: \"viewer\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: undefined } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:diane\", Relation = \"viewer\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = undefined Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:diane\", relation=\"viewer\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = undefined Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane viewer document:2021-budget # Response: {\"allowed\":undefined} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:diane\",\"relation\":\"viewer\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":undefined} check( user = \"user:diane\", // check if the user `user:diane` relation = \"viewer\", // has an `viewer` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: undefined More details on this technique can be found in the section Modeling Parent-Child Objects. We express it like this: DSL JSON type document relations define viewer: [user, domain#member] or commenter or viewer from parent { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"commenter\" } }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"parent\" }, \"computedUserset\": { \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } } ] } info The users with a viewer relationship to a certain object of type \"document\" are any of: the \"viewers\": the set of users who are directly related to the document as a \"viewer\" the \"commenters\": the set of users who are related to the object as \"commenter\" the \"viewers of the parents\": from the objects who are related to the doc as parent, return the sets of users who are related to those objects as \"viewer\" What the added section is doing is: read all relationship tuples related to document:2021-budget as parent which returns: [{ \"object\": \"document:2021-budget\", \"relation\": \"parent\", \"user\": \"document:2021-planning\" }] for each relationship tuple read, return all usersets that match the following, returning tuples of shape: { \"object\": \"document:2021-planning\", \"viewer\", \"user\": ??? } including: { \"object\": \"document:2021-planning\", \"viewer\", \"user\": \"user:diane\" } The updated authorization model looks like this: DSL JSON model schema 1.1 type user type document relations define owner: [user, domain#member] or owner from parent define writer: [user, domain#member] or owner or writer from parent define commenter: [user, domain#member] or writer or commenter from parent define viewer: [user, domain#member] or commenter or viewer from parent define parent: [document] type domain relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"owner\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"owner\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"writer\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"commenter\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"commenter\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"commenter\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"viewer\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"parent\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"document\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } }, { \"type\": \"domain\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"03. Folder Permission Propagation","u":"/docs/modeling/advanced/gdrive","h":"#03-folder-permission-propagation","p":830},{"i":850,"t":"Google Drive has a feature which allows sharing a file or folder publicly, and specifying the permissions a public user might have (writer/commenter/viewer). Assume that Anne has created a new document: 2021-public-roadmap, has shared it with commenter permissions to the xyz.com, and has shared it as view only with the public at large. Here's where another OpenFGA feature, type bound public access (as in everyone), would come in handy. First, we will need to update our model to allow for public access with type user for viewer relation. DSL JSON model schema 1.1 type user type document relations define owner: [user, domain#member] or owner from parent define writer: [user, domain#member] or owner or writer from parent define commenter: [user, domain#member] or writer or commenter from parent define viewer: [user, user:*, domain#member] or commenter or viewer from parent define parent: [document] type domain relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"owner\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"owner\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"writer\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"commenter\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"commenter\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"commenter\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"viewer\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"parent\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"document\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user\", \"wildcard\": {} }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } }, { \"type\": \"domain\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } To mark Anne as the owner, the domain members as commenters and the public as viewers, we need to add the following relationship tuples: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is the owner of document:2021-public-roadmap { user: 'user:anne', relation: 'owner', object: 'document:2021-public-roadmap'}, // Members of the domain:xyz can comment on document:2021-public-roadmap { user: 'domain:xyz#member', relation: 'commenter', object: 'document:2021-public-roadmap'}, // Everyone with type `user` can view document:2021-public-roadmap { user: 'user:*', relation: 'viewer', object: 'document:2021-public-roadmap'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is the owner of document:2021-public-roadmap User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"document:2021-public-roadmap\"), }, { // Members of the domain:xyz can comment on document:2021-public-roadmap User: openfga.PtrString(\"domain:xyz#member\"), Relation: openfga.PtrString(\"commenter\"), Object: openfga.PtrString(\"document:2021-public-roadmap\"), }, { // Everyone with type `user` can view document:2021-public-roadmap User: openfga.PtrString(\"user:*\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"document:2021-public-roadmap\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is the owner of document:2021-public-roadmap new() { User = \"user:anne\", Relation = \"owner\", Object = \"document:2021-public-roadmap\" }, // Members of the domain:xyz can comment on document:2021-public-roadmap new() { User = \"domain:xyz#member\", Relation = \"commenter\", Object = \"document:2021-public-roadmap\" }, // Everyone with type `user` can view document:2021-public-roadmap new() { User = \"user:*\", Relation = \"viewer\", Object = \"document:2021-public-roadmap\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is the owner of document:2021-public-roadmap user=\"user:anne\", relation=\"owner\", object=\"document:2021-public-roadmap\", ), ClientTuple( # Members of the domain:xyz can comment on document:2021-public-roadmap user=\"domain:xyz#member\", relation=\"commenter\", object=\"document:2021-public-roadmap\", ), ClientTuple( # Everyone with type `user` can view document:2021-public-roadmap user=\"user:*\", relation=\"viewer\", object=\"document:2021-public-roadmap\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"owner\",\"object\":\"document:2021-public-roadmap\"},{\"user\":\"domain:xyz#member\",\"relation\":\"commenter\",\"object\":\"document:2021-public-roadmap\"},{\"user\":\"user:*\",\"relation\":\"viewer\",\"object\":\"document:2021-public-roadmap\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-public-roadmap fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw domain:xyz#member commenter document:2021-public-roadmap fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:* viewer document:2021-public-roadmap write([ // Anne is the owner of document:2021-public-roadmap { \"user\":\"user:anne\", \"relation\":\"owner\", \"object\":\"document:2021-public-roadmap\" }, // Members of the domain:xyz can comment on document:2021-public-roadmap { \"user\":\"domain:xyz#member\", \"relation\":\"commenter\", \"object\":\"document:2021-public-roadmap\" }, // Everyone with type `user` can view document:2021-public-roadmap { \"user\":\"user:*\", \"relation\":\"viewer\", \"object\":\"document:2021-public-roadmap\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Anne is an owner of the document Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'owner', object: 'document:2021-public-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"owner\", Object: \"document:2021-public-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"owner\", Object = \"document:2021-public-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"owner\", object=\"document:2021-public-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-public-roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"owner\",\"object\":\"document:2021-public-roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"owner\", // has an `owner` relation object = \"document:2021-public-roadmap\", // with the object `document:2021-public-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Beth is a member of the xyz.com domain, and so can comment but cannot write Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'writer', object: 'document:2021-public-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"writer\", Object: \"document:2021-public-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"writer\", Object = \"document:2021-public-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"writer\", object=\"document:2021-public-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth writer document:2021-public-roadmap # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"writer\",\"object\":\"document:2021-public-roadmap\"}}' # Response: {\"allowed\":false} check( user = \"user:beth\", // check if the user `user:beth` relation = \"writer\", // has an `writer` relation object = \"document:2021-public-roadmap\", // with the object `document:2021-public-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'commenter', object: 'document:2021-public-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"commenter\", Object: \"document:2021-public-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"commenter\", Object = \"document:2021-public-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"commenter\", object=\"document:2021-public-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth commenter document:2021-public-roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"commenter\",\"object\":\"document:2021-public-roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"commenter\", // has an `commenter` relation object = \"document:2021-public-roadmap\", // with the object `document:2021-public-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Erik is NOT a member of the xyz.com domain, and so can only view the document Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:erik', relation: 'writer', object: 'document:2021-public-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:erik\", Relation: \"writer\", Object: \"document:2021-public-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:erik\", Relation = \"writer\", Object = \"document:2021-public-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:erik\", relation=\"writer\", object=\"document:2021-public-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik writer document:2021-public-roadmap # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:erik\",\"relation\":\"writer\",\"object\":\"document:2021-public-roadmap\"}}' # Response: {\"allowed\":false} check( user = \"user:erik\", // check if the user `user:erik` relation = \"writer\", // has an `writer` relation object = \"document:2021-public-roadmap\", // with the object `document:2021-public-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:erik', relation: 'viewer', object: 'document:2021-public-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:erik\", Relation: \"viewer\", Object: \"document:2021-public-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:erik\", Relation = \"viewer\", Object = \"document:2021-public-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:erik\", relation=\"viewer\", object=\"document:2021-public-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik viewer document:2021-public-roadmap # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:erik\",\"relation\":\"viewer\",\"object\":\"document:2021-public-roadmap\"}}' # Response: {\"allowed\":false} check( user = \"user:erik\", // check if the user `user:erik` relation = \"viewer\", // has an `viewer` relation object = \"document:2021-public-roadmap\", // with the object `document:2021-public-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"04. Sharing Files And Folders Publicly","u":"/docs/modeling/advanced/gdrive","h":"#04-sharing-files-and-folders-publicly","p":830},{"i":852,"t":"Take a look at the following sections for more information. Search with permissions Give your users search results with objects that they have access to More","s":"Related Sections","u":"/docs/modeling/advanced/gdrive","h":"#related-sections","p":830}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/3",[0,1.139,1,1.452,2,4.465,3,0.902,4,6.119,5,3.467,6,2.741,7,0.768,8,5.128,9,1.794,10,3.135,11,3.234,12,4.579,13,2.187,14,1.013,15,4.858,16,1.974,17,0.576,18,6.035,19,2.13,20,3.687,21,4.311,22,5.459,23,4.643,24,7.382,25,1.668,26,5.128,27,2.393,28,3.081,29,1.924,30,2.838,31,3.481,32,3.37,33,4.858,34,4.311,35,4.643,36,5.488,37,1.668,38,4.858,39,4.465,40,6.035,41,1.217,42,7.794,43,7.382,44,1.867,45,2.92,46,6.035,47,6.035,48,6.035,49,5.488,50,1.783,51,2.845,52,2.505,53,3.951,54,3.605,55,4.839,56,6.035,57,2.677,58,5.488,59,3.764,60,4.858,61,5.128,62,5.128,63,5.488,64,1.632,65,6.035,66,6.035,67,3.135,68,6.035,69,6.035,70,6.035,71,6.035,72,4.643,73,3.467,74,5.97,75,2.708,76,4.465,77,2.453,78,5.488,79,1.743,80,1.719,81,1.204,82,6.035,83,2.768,84,4.465,85,2.881,86,8.118,87,6.035,88,6.035,89,6.035,90,2.248,91,5.128,92,1.743,93,1.769,94,1.058,95,1.083,96,3.856,97,9.811,98,6.035,99,6.535,100,9.811,101,9.811,102,1.637,103,10.953,104,1.81,105,0.872,106,4.765,107,10.091,108,4.013,109,3.001,110,2.752,111,8.336,112,9.811,113,6.035,114,6.035,115,5.459,116,4.684,117,1.527,118,4.765,119,3.335,120,2.865,121,8.118,122,6.035,123,2.774,124,2.104,125,6.168,126,6.897,127,6.005,128,4.579,129,6.035,130,2.429,131,4.858,132,8.118,133,2.616,134,6.035,135,1.411,136,6.035,137,6.035,138,4.058,139,3.404]],["t/5",[3,0.963,5,4.977,7,0.594,9,1.961,10,4.5,13,3.14,20,5.083,27,2.385,42,7.362,53,5.672,54,5.176,55,4.57,61,7.362,62,7.362,63,7.879,74,4.801,75,4.577,81,1.728,83,3.478,91,7.362,94,1.129,118,4.5,140,5.997,141,1.599,142,4.977,143,6.667,144,4.033,145,6.975,146,1.882,147,5.002,148,6.41,149,0.963,150,3.169,151,5.286,152,3.452,153,8.665,154,2.466,155,5.532,156,7.362,157,5.176,158,2.139,159,4.249]],["t/7",[0,1.046,1,1.43,3,1.223,17,0.702,27,2.313,41,1.234,74,6.098,80,1.442,127,6.089,139,4.642,146,1.788,147,4.036,149,1.179,159,4.036,160,4.342,161,8.231,162,10.607,163,5.138,164,3.178,165,6.652,166,6.616,167,9.893,168,7.847,169,6.089,170,6.089,171,6.333,172,8.231,173,8.231,174,3.982,175,6.993,176,3.066,177,6.626,178,6.993,179,5.255,180,5.697,181,4.728,182,6.993,183,4.44,184,6.993,185,6.626,186,2.493,187,1.898,188,4.275,189,2.074,190,8.231,191,7.132,192,6.333,193,8.231,194,5.021,195,2.93,196,2.179,197,4.212,198,5.021]],["t/9",[1,1.047,7,0.739,9,1.673,12,5.385,17,0.734,28,2.946,29,2.707,38,6.25,41,1.164,54,4.638,59,4.843,67,4.033,74,5.73,75,3.484,80,1.36,81,1.549,92,2.243,93,2.276,94,1.245,95,0.857,102,1.608,110,2.492,115,5.221,126,6.597,127,5.744,128,5.385,138,5.221,149,1.149,177,6.25,178,6.597,179,6.097,180,5.374,183,3.484,189,1.957,191,5.221,195,2.764,199,6.597,200,4.095,201,5.221,202,2.519,203,4.737,204,5.374,205,2.402,206,5.974,207,6.25,208,7.06,209,2.085,210,2.946,211,4.23,212,5.547,213,4.886,214,6.597,215,1.6,216,4.46,217,9.81,218,7.764,219,7.764,220,7.764,221,3.093,222,7.649,223,2.54,224,1.104,225,3.556,226,4.094,227,4.843,228,6.25,229,5.974,230,5.974,231,2.892,232,5.083,233,5.547,234,3.124,235,9.548,236,4.958,237,7.764,238,5.374,239,7.764,240,7.06,241,5.744,242,6.25,243,4.958]],["t/11",[147,4.57,149,1.036,195,3.318,212,6.658,244,2.208,245,6.101,246,7.918,247,5.813,248,7.918,249,4.769,250,5.685,251,9.32]],["t/13",[14,1.056,22,6.302,151,5.718,252,3.116,253,6.302,254,6.487,255,7.963,256,8.523]],["t/15",[3,0.984,14,0.876,19,3.124,22,5.952,34,6.323,45,4.282,57,3.926,160,4.669,180,6.126,186,2.603,202,2.872,209,2.377,241,6.548,253,5.952,254,6.126,257,7.52,258,7.52,259,6.126,260,6.323,261,2.36,262,7.52,263,8.851,264,6.323,265,6.81,266,8.851,267,7.125,268,6.81,269,6.323,270,2.411,271,8.049,272,4.401,273,8.851,274,8.049,275,2.246,276,2.246,277,1.217,278,8.851,279,4.464,280,7.52]],["t/17",[5,5.085,7,0.708,10,4.597,14,1.022,28,3.359,77,3.598,81,1.765,90,3.847,117,1.665,207,7.125,277,1.217,281,6.442,282,8.775,283,7.354,284,4.597,285,5.285,286,8.049,287,10.328,288,4.401,289,3.754,290,4.529,291,6.126,292,7.947,293,4.822,294,8.851,295,8.851,296,5.288,297,3.018,298,6.548,299,3.359]],["t/19",[6,3.894,7,0.764,9,1.954,10,4.453,14,0.848,29,2.402,30,2.652,32,3.559,75,4.549,81,1.71,83,3.68,95,0.946,105,0.96,146,1.863,154,2.44,176,3.193,209,2.302,241,6.343,253,5.766,254,5.935,261,2.286,269,6.125,288,4.263,300,5.443,301,7.016,302,2.468,303,8.574,304,4.079,305,7.797,306,10.137,307,3.193,308,8.574,309,6.597,310,4.595,311,4.263,312,4.148,313,6.343,314,2.851,315,5.766,316,7.285]],["t/21",[7,0.768,9,1.791,10,4.516,20,5.188,21,7.302,30,3.162,42,9.519,83,3.485,133,3.77,224,1.236,255,7.388,256,7.907,277,1.196,299,3.3,300,4.385,302,2.117,317,4.602,318,2.558,319,2.965,320,4.818,321,2.631,322,2.269,323,1.876,324,4.737,325,8.684,326,3.728,327,7.388,328,4.207,329,6.69,330,7.907]],["t/23",[7,0.725,20,4.193,22,6.208,27,2.158,28,4.016,29,2.188,31,3.958,32,3.832,81,1.842,95,1.019,105,0.989,203,5.632,331,9.232]],["t/25",[1,1.189,5,5.066,6,4.005,7,0.748,9,1.545,14,1.02,50,2.605,95,1.242,105,0.971,117,1.659,141,1.627,149,0.98,158,2.177,226,3.781,244,2.09,264,7.801,277,1.213,302,2.148,310,5.524,311,4.385,332,8.82,333,3.549,334,8.82,335,8.82,336,8.82,337,4.005,338,8.82,339,7.493,340,6.105,341,8.02,342,8.02]],["t/27",[0,0.835,3,1.206,14,0.955,57,4.281,74,4.378,111,6.713,146,1.716,147,3.874,148,5.845,149,1.158,179,5.045,186,1.991,189,1.991,195,2.813,207,6.361,208,7.185,211,6.064,244,2.287,245,5.173,277,1.433,300,3.984,312,3.822,316,6.713,326,3.388,337,3.588,343,7.901,344,4.82,345,9.651,346,7.901,347,9.651,348,7.901,349,7.901,350,7.901,351,7.901,352,7.901,353,7.901,354,7.901,355,7.901,356,6.318,357,7.901,358,5.845,359,5.845,360,6.713,361,5.172,362,7.901,363,7.901,364,7.901,365,7.901,366,7.901,367,7.901,368,7.901,369,7.901,370,7.901,371,3.772,372,9.651,373,6.49,374,9.476,375,7.901,376,7.901,377,7.901,378,7.901,379,7.901,380,7.901,381,7.901,382,6.361,383,5.644,384,7.901,385,7.901,386,7.901,387,7.901,388,5.845,389,3.724,390,7.901,391,7.901,392,6.713,393,6.713,394,6.713,395,7.901,396,7.901,397,7.901,398,6.079,399,7.901,400,4.043,401,7.901,402,1.872]],["t/29",[3,1.176,16,3.02,19,3.258,80,1.617,139,5.207,149,1.176,195,3.287,244,2.188,252,3.07,403,6.456,404,3.548,405,3.958,406,6.595]],["t/31",[0,0.998,1,1.382,3,1.297,14,1.137,17,0.782,52,3.163,104,2.285,105,0.839,117,1.929,141,2.099,144,3.547,145,6.135,158,1.881,164,2.201,176,2.838,180,6.533,186,2.701,201,5.124,202,2.472,223,3.087,244,1.806,261,2.516,272,3.789,289,4.545,326,3.267,337,4.286,407,2.734,408,3.843,409,8.154,410,7.922,411,5.527,412,2.918,413,7.62,414,4.377,415,2.213,416,9.746,417,7.262,418,2.207,419,3.304,420,7.598,421,7.262,422,6.929,423,6.843,424,6.843,425,1.856,426,5.274]],["t/33",[3,1.044,14,0.929,17,0.667,141,1.733,151,5.729,408,4.736,415,2.026,427,6.314]],["t/35",[3,1.243,25,3.091,141,2.064,186,2.89,187,1.734,189,2.359,198,6.824,224,1.59,261,2.982,275,1.907,276,1.907,407,3.121,408,5.641,411,6.424,412,3.035,425,2.762,428,1.868,429,1.976,430,7.522,431,6.309,432,8.7,433,8.362,434,3.025,435,7.991,436,6.777,437,2.171]],["t/37",[3,0.471,7,0.732,14,0.928,17,0.709,25,1.17,29,1.788,37,2.085,41,1.457,50,1.25,64,2.041,80,0.742,81,1.259,92,1.222,93,2.212,94,1.407,95,0.987,102,1.709,104,1.893,110,1.105,124,1.956,130,1.703,135,1.764,141,1.164,146,1.639,149,1.135,158,1.045,181,3.625,186,2.692,187,0.976,189,1.591,195,1.507,196,2.214,202,2.713,209,1.694,215,1.555,224,1.189,231,2.35,270,2.909,275,1.074,276,1.074,277,1.038,318,2.5,321,1.089,322,2.183,323,1.805,402,1.788,407,2.012,412,2.147,415,1.805,418,1.955,425,1.031,426,2.93,428,1.052,429,1.659,434,1.145,437,2.416,438,1.922,439,1.85,440,1.535,441,3.675,442,3.753,443,4.014,444,2.031,445,1.967,446,1.907,447,2.857,448,2.871,449,2.547,450,2.547,451,2.547,452,2.547,453,2.727,454,2.663,455,2.07,456,2.398,457,1.213,458,2.212,459,2.163,460,2.147,461,1.213,462,2.137,463,2.147,464,1.213,465,2.018,466,2.363,467,2.398,468,2.863,469,2.163,470,1.222,471,2.041,472,1.232,473,2.398,474,2.363,475,1.757,476,3.427,477,2.351,478,4.233,479,2.452,480,1.204,481,1.213,482,1.809,483,1.187,484,1.744,485,2.537,486,1.213,487,1.26,488,1.204,489,1.213,490,2.163,491,2.163,492,1.213,493,2.026,494,2.573,495,4.233,496,7.545,497,2.116,498,6.311,499,4.233,500,4.233,501,1.983,502,4.233,503,4.233,504,1.222,505,1.222,506,1.222,507,1.222,508,1.213,509,0.97,510,1.045,511,1.222,512,2.131,513,1.213,514,1.222,515,1.222,516,1.222,517,1.222,518,1.222,519,1.823,520,4.233,521,4.233,522,4.233,523,4.233,524,1.213,525,1.222,526,1.26,527,1.232,528,1.222,529,1.222,530,1.222,531,1.232,532,1.232,533,1.232,534,1.26,535,1.222,536,1.222,537,1.232,538,1.232,539,4.233,540,3.849,541,4.233,542,4.233,543,4.233,544,4.233,545,2.434,546,2.286,547,1.455,548,6.311,549,1.097,550,4.233,551,1.77,552,1.187,553,1.128,554,1.196,555,1.17,556,2.771,557,4.233,558,3.257,559,4.233]],["t/39",[0,0.956,7,0.62,9,1.585,14,1.035,17,0.82,80,1.585,83,3.084,141,1.669,144,4.21,252,3.008,277,1.518,299,3.969,404,3.507,406,6.462,415,1.952,560,5.013,561,5.013,562,5.642,563,3.22]],["t/41",[0,0.969,1,1.235,3,1.233,14,1.043,17,0.651,52,3.804,135,2.142,141,2.047,151,5.59,158,2.262,224,1.303,261,2.443,307,3.413,407,2.443,427,6.162,564,5.264]],["t/43",[3,0.878,37,2.182,41,1.346,64,2.136,94,0.755,102,1.703,109,5.301,124,2.047,135,1.846,141,2.089,146,1.952,149,1.072,186,1.46,187,1.336,189,1.46,196,2.378,209,2.988,215,1.851,224,1.123,261,2.572,270,2.904,275,1.47,276,1.47,318,2.249,321,1.491,322,2.345,382,8.735,389,2.731,415,1.704,418,1.846,425,1.411,428,1.44,429,2.076,436,3.461,453,2.668,454,2.778,455,2.465,456,2.894,457,1.661,459,2.264,460,2.557,461,1.661,462,2.296,463,2.557,464,1.661,465,2.04,466,2.725,467,2.264,468,2.264,469,2.576,471,2.136,473,2.264,474,2.231,476,4.08,477,2.536,480,2.247,481,1.661,482,2.264,483,1.625,484,2.182,485,2.518,486,1.661,488,1.649,489,1.661,490,2.264,491,2.264,492,1.661,493,2.12,494,2.378,497,2.214,501,1.523,504,1.673,505,1.673,506,1.673,507,1.673,508,1.661,509,1.327,511,1.673,512,2.538,513,1.661,514,1.673,515,1.673,516,1.673,517,1.673,518,1.673,519,2.281,524,1.661,525,1.673,528,1.673,529,1.673,530,1.673,535,1.673,536,1.673,540,5.269,549,1.502,551,1.625,553,1.545,554,1.637,555,1.601,565,4.286,566,5.269,567,5.269,568,5.794,569,4.286,570,5.794,571,5.794,572,5.794,573,4.664,574,4.664,575,5.794,576,5.794,577,5.794,578,8.984,579,4.664,580,5.794,581,7.897,582,3.268,583,5.794,584,4.286,585,5.794,586,6.076,587,5.794,588,5.794,589,5.794,590,4.923,591,4.286,592,5.794,593,5.794,594,4.286,595,5.794]],["t/45",[3,1.086,13,2.919,14,0.797,16,2.635,17,0.746,19,2.843,29,1.909,39,5.96,50,2.38,51,4.603,74,4.464,76,5.96,90,3,94,1.273,95,1.16,105,0.934,115,5.417,135,1.883,149,0.896,181,6.276,186,2.03,202,3.631,204,5.576,215,1.66,223,2.635,264,5.755,272,4.855,277,1.108,300,4.063,302,1.962,356,6.393,389,3.797,404,2.701,405,3.454,415,2.107,439,3.203,440,2.222,556,5.274,561,4.464,596,8.46,597,3.749,598,7.326,599,7.326,600,3.539,601,3.659,602,6.091,603,2.946,604,5.576,605,4.464,606,6.845,607,8.056,608,8.056,609,6.845,610,6.845,611,5.274,612,5.96,613,8.056,614,5.274,615,6.845,616,3.387,617,7.326,618,6.845,619,6.198,620,5.274,621,3.749]],["t/47",[0,0.489,3,0.514,7,0.773,13,1.676,14,0.667,17,0.564,27,1.081,29,2.069,32,4.253,41,1.612,84,3.422,92,1.336,93,1.975,94,1.518,95,1.306,96,3.698,102,1.716,105,1.013,119,1.9,140,3.202,187,1.067,211,2.52,215,0.953,252,1.538,272,2.3,415,0.998,439,1.356,440,0.941,442,4.778,443,5.003,444,1.489,445,1.442,446,2.402,447,3.182,563,1.647,597,2.153,602,2.885,622,3.11,623,2.609,624,5.881,625,3.388,626,7.47,627,7.452,628,10.357,629,4.166,630,3.71,631,3.51,632,5.276,633,5.108,634,2.052,635,3.724,636,2.151,637,2.763,638,2.005,639,4.626]],["t/49",[0,1.149,1,1.397,3,0.924,7,0.808,9,1.096,17,0.444,27,1.463,41,1.246,57,5.113,77,3.381,80,1.096,81,1.659,85,2.987,94,1.555,95,1.307,102,1.688,105,1.019,108,3.097,126,5.316,144,3.871,149,0.924,150,2.288,152,2.493,154,1.781,181,3.594,202,2.03,221,3.721,226,2.683,277,0.861,300,3.155,302,1.524,307,3.097,318,2.492,323,1.795,337,4.242,389,3.92,439,2.438,440,1.273,446,1.891,447,1.906,510,1.545,560,4.609,563,3.793,597,2.912,600,2.268,623,3.529,625,3.742,634,2.775,636,2.982,640,5.316,641,4.207,642,4.096,643,3.212,644,6.115,645,6.257,646,4.544,647,6.257,648,6.257,649,5.316,650,4.629,651,6.257,652,6.257,653,5.037,654,3.409,655,6.257,656,5.444,657,5.69,658,3.664,659,2.876,660,4.814,661,3.995,662,3.385,663,8.014,664,2.597,665,3.903,666,6.152,667,5.69,668,5.69]],["t/51",[0,1.157,1,0.868,7,0.77,17,0.673,27,1.505,29,2.664,30,1.991,41,1.509,80,1.128,81,1.284,94,1.479,95,1.293,96,3.902,102,1.699,105,0.93,108,3.528,118,3.343,133,3.674,144,2.996,146,2.058,149,0.716,150,2.354,152,3.376,277,0.885,310,3.45,311,3.2,314,2.818,317,2.644,319,4.008,323,1.389,324,4.616,389,3.034,439,1.887,440,1.309,446,1.945,447,2.581,560,4.696,563,3.372,597,2.996,600,2.333,601,2.923,603,2.354,616,2.232,623,3.63,629,3.246,630,3.246,631,2.333,634,2.855,636,3.214,643,2.213,646,2.822,661,4.11,662,4.073,664,2.672,669,5.169,670,5.853,671,10.739,672,5.182,673,3.927,674,4.762,675,5.469,676,4.953,677,8.219,678,7.914,679,6.437,680,3.507,681,4.015]],["t/53",[0,0.977,1,0.706,3,0.582,4,3.268,7,0.782,9,0.918,14,0.843,17,0.752,27,1.722,28,1.988,29,2.585,31,4.175,32,4.62,41,1.459,55,2.764,77,2.13,80,0.918,81,1.045,90,1.952,92,2.128,93,2.16,94,1.489,95,1.305,96,4.057,102,1.708,105,1.02,108,3.173,117,0.986,119,3.026,124,1.909,130,2.964,133,2.272,144,3.428,146,2.007,149,0.819,152,2.935,163,2.722,181,3.01,183,3.306,200,2.764,215,1.518,249,2.681,277,0.721,279,3.715,310,2.808,311,2.605,323,1.131,340,3.627,389,2.47,439,2.16,440,1.498,444,1.686,445,2.296,446,2.574,447,2.814,465,1.059,510,1.294,549,1.909,560,4.082,563,1.865,600,1.899,601,3.869,603,1.916,628,9.629,629,2.822,630,2.822,631,3.087,632,4.013,633,4.493,643,1.802,646,2.298,658,3.068,659,2.409,661,3.346,662,3.349,664,2.175,672,7.439,676,4.032,677,6.302,678,7.18,681,5.313,682,3.743,683,3.43,684,4.494,685,5.24,686,4.765,687,2.681,688,4.032,689,6.698,690,5.24,691,2.681,692,4.822,693,4.822,694,3.13,695,3.627,696,4.765,697,4.452,698,4.452,699,4.765,700,4.765,701,4.218,702,4.452,703,4.452,704,3.627,705,4.765,706,3.43]],["t/55",[0,1.051,7,0.8,14,0.704,17,0.766,27,1.663,29,2.142,30,2.201,41,1.066,74,3.943,80,1.246,81,1.419,94,1.363,95,1.282,96,4.014,102,1.696,105,0.96,108,3.894,117,1.338,118,3.695,120,2.511,133,3.085,144,3.311,149,0.791,152,3.602,181,4.087,226,3.05,231,2.65,277,0.979,317,2.922,319,3.821,323,1.535,439,2.651,440,1.839,445,2.218,446,2.15,447,2.167,560,3.943,563,3.219,597,3.311,600,2.578,623,4.013,629,2.726,630,4.006,631,2.578,634,3.156,636,2.271,643,3.595,659,4.568,661,4.543,662,3.601,664,3.753,677,8.161,678,7.636,680,3.876,681,4.438,707,5.474,708,6.47,709,5.263]],["t/57",[0,1.04,1,1.202,7,0.793,14,0.689,17,0.633,27,1.628,29,2.113,41,1.044,74,3.859,80,1.562,81,1.389,94,1.352,95,1.291,96,3.835,102,1.695,105,0.992,108,4.086,117,1.31,118,3.617,120,3.147,144,3.241,149,0.774,152,3.553,181,4,231,2.594,277,0.958,319,3.851,323,1.503,324,3.794,439,2.615,440,1.814,445,2.171,446,2.105,447,2.121,560,3.859,629,3.416,631,2.524,634,3.089,636,2.223,643,3.067,646,3.054,659,4.523,661,4.447,662,4.042,664,2.891,677,8.563,678,8.012,707,5.358,710,6.279,711,11.295,712,2.747,713,3.462]],["t/59",[0,1.096,1,1.201,7,0.793,14,0.688,17,0.698,20,4.046,27,1.626,29,2.111,41,1.042,80,1.561,94,1.351,95,1.291,96,4.021,102,1.692,105,0.991,108,4.084,117,1.308,118,3.612,120,3.144,133,3.863,149,0.773,152,3.55,181,3.995,223,2.275,231,2.59,277,0.956,324,3.789,402,1.648,439,2.612,440,1.812,445,2.168,446,2.102,447,2.118,561,3.854,563,3.172,623,6.432,629,2.664,634,3.084,636,2.22,643,3.064,659,4.766,661,4.44,662,3.974,664,3.698,677,8.561,678,8.01,712,2.743,714,5.991,715,4.43,716,5.351,717,3.507,718,6.324,719,5.908]],["t/61",[0,0.592,3,1.109,7,0.771,17,0.548,31,4.683,32,3.662,41,1.425,44,1.731,80,0.981,81,1.116,90,2.084,92,2.227,93,2.788,94,1.403,95,1.302,96,3.962,102,1.713,105,0.845,109,4.728,181,5.068,202,1.816,244,1.326,264,7.125,277,0.77,299,2.124,318,1.401,319,3.769,323,1.904,342,5.089,389,2.638,439,2.587,440,1.934,443,4.74,444,2.482,445,2.404,446,2.331,447,2.896,549,1.451,556,3.664,558,4.306,604,3.874,606,6.552,614,3.664,629,3.821,630,4.047,631,3.9,632,4.807,633,4.654,684,3.414,710,4.516,714,3.763,715,2.783,720,5.597,721,5.089,722,5.597,723,3.664,724,5.597,725,5.597,726,5.597,727,7.712,728,5.089,729,7.802,730,7.712,731,7.712,732,8.823,733,5.597,734,4.273,735,4.755,736,5.597,737,8.823,738,5.597]],["t/63",[3,1.222,7,0.614,9,1.823,14,0.887,17,0.803,19,3.672,30,2.773,80,1.57,105,0.797,117,1.686,149,0.996,244,2.605,252,2.981,272,4.457,277,1.556,302,2.183,404,3.488,415,1.934,562,5.591,563,3.191]],["t/65",[3,1.026,14,1.047,17,0.751,55,4.87,104,2.769,146,2.005,163,4.795,261,2.822,328,4.467,421,7.104,638,4.003,739,5.632,740,5.207,741,5.895]],["t/67",[14,0.895,17,0.806,116,4.319,141,1.669,149,1.006,202,2.935,223,3.421,231,3.896,383,6.462,462,2.312,712,3.568,742,8.226,743,4.772,744,7.282,745,9.046,746,8.226,747,4.012,748,6.692,749,7.686,750,7.686,751,6.462,752,6.692,753,7.686]],["t/69",[1,1.191,14,0.874,17,0.627,67,4.589,95,0.975,104,2.65,117,1.662,128,4.983,141,1.63,149,1.147,209,2.372,284,4.589,299,3.353,302,2.151,314,2.938,326,3.788,333,3.555,337,4.013,371,4.218,415,1.907,418,2.066,424,5.642,431,4.983,475,2.46,476,4.963,546,2.637,556,5.784,717,4.456,743,4.66,751,6.312,754,7.507,755,4.735,756,8.034,757,8.835,758,7.113,759,8.034,760,8.835]],["t/71",[3,0.986,4,5.531,14,1.116,17,0.801,75,3.979,77,3.605,117,1.945,138,5.962,141,1.636,149,0.986,176,3.303,183,3.979,212,6.334,261,2.364,268,6.823,284,4.606,337,4.027,418,2.073,476,4.695,683,5.805,748,6.56,751,7.386,761,8.063,762,8.063,763,6.823,764,8.867,765,8.867,766,7.386,767,6.334]],["t/73",[7,0.67,9,1.416,12,4.559,14,1.041,17,0.818,20,3.671,27,1.89,55,4.263,73,4.643,77,3.286,80,1.416,81,1.612,102,1.364,117,1.98,135,1.89,146,2.126,149,0.898,160,4.263,163,4.198,185,6.507,187,1.864,197,4.136,201,5.435,216,4.643,247,5.041,261,2.155,272,4.019,284,4.198,289,3.428,300,4.076,304,3.938,309,6.219,324,4.403,417,6.219,454,2.155,455,2.218,476,3.671,562,5.041,600,2.929,664,3.355,713,4.019,717,4.076,759,8.898,761,7.35,762,7.35,768,8.082,769,8.082,770,8.082,771,6.507,772,7.35,773,8.082,774,6.507,775,8.082,776,7.35,777,8.082,778,7.35,779,6.867,780,8.082,781,7.35,782,8.082,783,8.082,784,7.35,785,4.733,786,8.082,787,5.979,788,6.507,789,8.082,790,8.314,791,8.942,792,9.785,793,8.082,794,8.082,795,8.082,796,8.082]],["t/75",[3,1.155,17,0.78,156,7.602,158,2.566,202,3.372,244,2.603,272,5.168,277,1.555,299,3.395,326,3.836,337,4.72,404,3.485,415,2.243,423,6.636,424,6.636,425,2.179,426,6.193,562,5.581]],["t/77",[3,1.186,27,1.603,41,1.028,64,1.855,102,1.627,109,3.409,124,1.777,130,2.759,149,1.215,164,2.55,165,4.611,166,6.092,176,2.554,177,7.863,178,8.298,179,5.638,186,2.754,187,2.52,189,2.599,196,1.815,205,3.021,249,4.518,270,1.868,275,2.241,276,2.241,313,5.073,318,1.716,322,1.79,326,3.786,404,2.299,411,6.834,415,1.48,428,2.195,453,1.716,454,2.75,460,1.951,462,1.753,463,1.951,465,1.386,466,1.937,480,2.513,483,1.923,484,1.895,485,2.305,488,1.951,493,1.841,524,2.531,565,7.225,566,6.236,567,6.236,569,5.073,610,5.826,638,2.973,797,8.753,798,6.112,799,8.881,800,8.03,801,6.857,802,4.899,803,8.83,804,6.857,805,6.857,806,6.857,807,6.857,808,6.857,809,6.977,810,6.857,811,8.83,812,9.767,813,6.857,814,6.857,815,6.857,816,6.857,817,4.183,818,5.826,819,6.857,820,6.857,821,6.857,822,8.03,823,6.236,824,8.03,825,8.03,826,8.03,827,8.881,828,7.502,829,7.109,830,6.308,831,6.236,832,8.881,833,6.236,834,6.236,835,6.236,836,6.236,837,6.236,838,6.236,839,6.236,840,6.236,841,8.03,842,5.073,843,6.236,844,6.236,845,5.52,846,6.236]],["t/79",[411,5.551,822,8.621,823,8.621]],["t/81",[27,2.126,205,2.814,411,6.144,797,6.999,824,8.271,825,8.271,826,8.271,827,9.542,828,7.728,829,7.323,830,6.498,831,8.271,832,10.056,833,8.271,834,8.271,835,8.271,836,8.271,837,8.271,838,8.271,839,8.271,840,8.271]],["t/83",[164,2.723,165,6.339,166,6.68,841,9.739]],["t/85",[109,4.678,130,3.786,187,2.17,189,2.371,411,5.509,842,6.96,843,8.556]],["t/87",[610,8.009,828,8.009,829,7.589,830,6.734,845,7.589,846,8.572]],["t/89",[3,1.299,14,0.86,43,7.907,102,1.212,149,1.207,185,7,186,2.983,187,2.504,202,3.316,205,2.69,275,2.755,276,2.755,277,1.541,371,4.152,404,2.915,411,5.091,428,2.541,546,2.612,596,7,847,6.623]],["t/91",[0,0.987,5,5.364,6,4.24,7,0.64,90,3.478,105,0.83,117,1.757,252,3.105,289,3.96,418,2.183,848,5.364]],["t/93",[0,1.158,1,1.476,3,1.242,14,1.105,17,0.793,25,3.087,176,4.079,186,2.682,187,1.723,189,1.883,198,6.814,224,1.588,275,1.896,276,1.896,407,2.978,408,5.632,411,6.231,415,2.41,425,2.72,428,1.857,429,1.964,430,7.51,431,6.299,432,8.693,433,8.355,434,3.021,435,7.979,436,6.672,437,2.158]],["t/95",[0,0.989,6,4.248,7,0.641,105,0.832,117,1.76,195,3.33,438,4.248,441,3.843,662,3.39,849,7.198]],["t/97",[9,1.046,25,1.65,37,2.521,41,1.464,64,1.614,81,1.607,102,1.696,110,1.558,117,1.123,124,1.547,135,2.283,146,1.982,149,1.168,186,2.754,187,1.377,189,1.505,196,2.586,202,2.614,215,2.013,224,1.389,270,3.099,275,1.515,276,1.515,277,1.255,318,2.631,322,2.549,323,1.739,402,2.162,407,2.432,412,2.78,415,1.969,418,2.283,425,1.454,428,1.484,429,1.569,437,2.327,440,1.214,448,2.695,453,2.801,454,2.864,455,2.211,456,2.8,457,1.711,458,2.674,459,2.615,460,2.596,461,1.711,462,2.496,463,2.596,464,1.711,465,2.171,466,2.759,467,2.8,468,3.013,469,2.615,470,1.724,471,2.467,472,1.737,473,2.8,474,2.759,475,1.662,477,2.118,480,1.699,481,1.711,482,2.31,483,1.674,484,2.227,485,2.103,486,1.711,487,1.777,488,1.699,489,1.711,490,2.615,491,2.615,492,1.711,493,1.603,494,2.133,504,1.724,505,1.724,506,1.724,507,1.724,508,1.711,509,1.368,510,1.474,511,1.724,512,2.276,513,1.711,514,1.724,515,1.724,516,1.724,517,1.724,518,1.724,519,2.327,524,1.711,525,1.724,526,1.777,527,1.737,528,1.724,529,1.724,530,1.724,531,1.737,532,1.737,533,1.737,534,1.777,535,1.724,536,1.724,537,1.737,538,1.737,545,2.345,546,2.059,850,4.416,851,3.811]],["t/99",[0,1.052,6,3.24,7,0.717,14,0.896,17,0.507,27,2.447,79,2.061,94,0.93,95,1.098,102,1.7,105,0.931,108,4.024,117,1.872,120,3.812,123,3.28,141,1.317,146,1.967,158,2.236,164,2.061,187,1.646,189,1.798,209,1.916,224,1.014,231,2.657,275,1.811,276,1.811,321,1.836,428,1.774,429,2.381,434,1.93,441,4.438,453,2.704,455,1.958,465,1.442,471,2.45,475,2.77,477,2.616,479,3.069,485,1.862,494,2.634,497,2.79,501,2.751,546,1.824,549,1.849,551,2.54,552,2.001,553,1.902,554,2.016,555,1.972,664,3.76,766,5.097,849,8.312,852,2.563,853,3.253,854,2.108,855,3.574,856,2.586,857,2.586,858,3.282,859,2.962,860,4.262,861,6.062,862,2.586,863,2.586,864,2.14,865,3.47,866,2.586,867,7.135,868,7.135]],["t/101",[3,1.022,14,0.91,29,2.18,80,1.611,117,2.09,144,4.281,202,3.426,252,3.058,277,1.452,289,3.901,299,3.49,302,2.24,400,4.706,402,2.18,560,5.097]],["t/103",[3,1.042,45,4.534,180,6.487,252,3.116,419,4.063,420,7.545,848,5.384,869,7.545,870,8.523]],["t/105",[0,1.072,1,1.367,3,1.24,14,1.003,17,0.72,25,2.802,117,1.907,176,3.776,186,2.555,187,1.978,198,6.184,224,1.441,225,3.776,289,4.299,407,2.703,408,5.112,411,5.936,415,2.188,425,2.468,428,2.131,430,6.816,431,5.717,432,8.251,433,7.968,434,2.742,435,7.242,436,6.056]],["t/107",[6,4.005,7,0.748,9,1.545,20,4.005,29,2.588,37,2.437,130,3.549,139,4.974,149,0.98,152,3.514,195,3.669,231,3.285,281,6.428,323,1.903,420,7.1,438,4.681,441,3.623,476,4.005,546,2.634,564,5.066,600,3.196,847,5.38,851,5.631,871,8.02,872,7.1,873,5.774,874,6.786,875,4.974,876,8.82,877,8.82,878,8.82,879,7.1,880,7.1,881,6.3]],["t/109",[26,6.098,27,1.678,80,1.593,81,1.813,102,1.677,110,2.373,120,2.533,124,1.86,139,5.627,149,1.166,159,3.519,164,2.073,180,4.967,187,2.419,194,4.378,205,2.22,224,1.293,231,3.386,274,6.526,281,4.476,283,4.826,297,2.447,299,3.45,403,4.378,404,3.048,407,2.424,408,3.619,411,6.142,418,1.678,420,8.901,428,1.784,454,1.913,455,2.494,465,1.45,477,1.886,483,2.549,484,2.512,485,1.873,512,2.568,546,2.323,582,4.048,622,6.113,747,3.183,797,8.743,799,8.267,800,8.267,802,5.127,851,4.582,869,9.409,870,8.267,871,8.267,874,8.64,879,8.032,880,7.318,882,7.318,883,8.912,884,6.098,885,7.177,886,6.098,887,6.098,888,7.177,889,6.098,890,6.098,891,6.098,892,6.098,893,6.098,894,7.177,895,7.177,896,6.098,897,6.526,898,7.724,899,6.098,900,6.098,901,6.098,902,4.967,903,6.098,904,6.098,905,6.098,906,6.098,907,6.098,908,7.177]],["t/111",[3,0.689,7,0.566,9,1.447,27,1.448,102,1.703,109,3.08,120,2.186,124,2.141,135,1.448,139,3.494,146,1.346,149,0.689,164,2.386,176,2.307,183,3.707,187,1.429,205,1.916,210,2.351,215,1.277,224,0.881,231,3.077,249,3.169,281,5.152,285,4.756,286,5.633,291,4.287,297,2.817,299,3.762,307,2.307,313,4.582,337,3.752,382,4.987,404,2.77,407,1.651,408,3.124,418,1.931,428,1.54,454,1.651,455,2.834,476,2.813,477,2.171,483,2.316,484,2.283,485,2.773,493,1.663,494,2.187,510,2.039,512,2.801,561,3.432,582,4.659,638,2.685,681,3.863,723,6.491,797,6.356,851,3.955,869,7.982,874,8.477,879,7.482,880,4.987,883,5.263,884,5.263,886,7.019,887,5.263,889,5.263,890,5.263,891,7.019,892,5.263,893,5.263,896,7.019,898,5.263,899,5.263,900,5.263,901,5.263,902,4.287,903,5.263,904,5.263,905,5.263,906,5.263,907,5.263,909,7.019,910,3.863,911,6.194,912,5.633,913,7.512,914,5.633,915,8.424,916,7.512,917,6.194,918,5.263,919,6.876,920,8.261,921,6.194,922,8.261,923,6.194,924,4.766,925,6.194,926,7.512,927,6.194,928,6.194,929,5.633,930,7.512,931,7.512,932,5.633,933,5.633,934,5.633,935,5.633,936,5.633,937,4.055,938,5.633,939,5.633,940,5.633,941,5.633,942,5.633,943,5.633,944,5.633,945,5.633,946,5.633,947,5.633,948,5.633,949,5.633,950,7.512,951,5.408,952,5.633,953,3.558,954,7.512,955,5.633,956,5.633,957,5.633,958,5.633,959,5.633,960,5.633,961,5.633,962,5.263,963,5.633,964,5.633,965,5.633,966,5.633,967,5.633,968,5.633,969,5.633,970,5.633,971,5.633,972,5.633]],["t/113",[0,0.705,3,0.876,6,2.07,7,0.713,9,1.168,14,0.858,27,1.558,29,2.358,30,1.41,37,2.177,41,0.683,51,2.148,85,3.182,94,0.594,95,0.87,102,1.705,105,0.771,109,4.948,110,1.189,117,1.872,120,1.608,124,2.247,135,1.065,146,1.711,150,3.523,158,1.125,164,1.316,176,1.697,186,1.149,187,1.537,196,1.206,202,2.812,205,1.41,210,1.729,215,1.901,224,0.948,231,3.706,249,2.332,261,2.101,270,2.779,281,4.157,285,3.41,291,3.154,297,2.686,299,3.29,318,1.141,321,1.715,322,1.189,323,0.983,328,3.224,337,3.027,382,3.669,402,1.579,404,2.234,412,1.897,415,0.983,418,2.027,426,3.154,428,1.133,436,2.722,441,2.737,442,2.796,443,3.536,453,2.17,454,1.777,455,2.941,456,2.259,457,1.306,459,1.911,460,1.897,461,1.306,462,2.215,463,1.897,464,1.306,465,1.347,466,1.287,467,1.306,468,1.306,469,1.911,470,1.316,471,1.232,473,1.306,474,1.287,476,2.07,477,1.752,480,1.897,481,1.306,482,1.306,483,2.431,484,1.842,485,2.798,486,1.306,488,1.297,489,1.306,490,1.306,491,1.306,492,1.306,493,2.116,494,1.764,497,1.278,510,1.125,512,2.605,565,3.371,569,3.371,582,4.444,597,2.121,619,5.128,622,4.481,638,1.976,681,2.842,723,5.675,747,2.021,752,3.371,763,6.062,797,3.506,852,1.637,855,1.637,869,6.978,874,6.062,879,5.365,880,3.669,883,5.662,884,3.872,886,6.694,887,3.872,889,3.872,890,3.872,891,6.694,892,3.872,893,3.872,896,7.365,898,3.872,899,3.872,900,3.872,901,3.872,902,3.154,903,3.872,904,3.872,905,3.872,906,3.872,907,6.694,910,2.842,912,6.06,913,7.165,914,6.06,915,8.186,916,7.165,919,4.93,926,4.144,929,6.06,930,4.144,931,4.144,932,4.144,933,4.144,934,4.144,935,4.144,936,6.06,937,2.983,938,4.144,940,4.144,941,4.144,942,4.144,943,4.144,944,4.144,945,4.144,946,4.144,947,4.144,948,4.144,949,4.144,950,6.06,951,4.363,952,4.144,953,2.618,954,6.06,955,4.144,956,4.144,957,4.144,958,4.144,959,4.144,960,4.144,961,4.144,962,3.872,963,4.144,964,4.144,965,4.144,966,4.144,967,6.06,968,6.06,969,6.06,970,6.06,971,4.144,972,6.06,973,7.879,974,8.669,975,7.879,976,4.557,977,4.557,978,4.557,979,8.669,980,6.664,981,4.557,982,4.557,983,4.557,984,4.557,985,4.557,986,4.557,987,4.557,988,4.557,989,4.557,990,4.557,991,4.557,992,4.557,993,4.557,994,4.557,995,4.557,996,4.557,997,4.557,998,8.669,999,4.557,1000,4.557,1001,6.664,1002,4.557,1003,6.664,1004,6.664,1005,4.557,1006,4.557,1007,4.557,1008,4.557,1009,4.557,1010,4.557,1011,4.557]],["t/115",[3,1.224,14,1.032,17,0.782,80,1.576,81,1.794,144,4.187,180,6.227,186,2.267,252,2.991,253,6.049,254,6.227,277,1.514,302,2.539,560,4.985,582,5.074,706,6.826,709,7.713,1012,5.611,1013,7.644,1014,7.011]],["t/117",[0,0.983,5,5.344,7,0.637,85,4.441,94,1.212,105,0.945,223,3.043,227,5.802,252,3.093,289,3.945,418,2.175,848,5.344]],["t/119",[0,1.158,1,1.476,3,1.242,14,1.105,17,0.793,25,3.087,176,4.079,186,2.682,187,1.723,189,1.883,198,6.814,224,1.588,275,1.896,276,1.896,407,2.978,408,5.632,411,6.231,415,2.41,425,2.72,428,1.857,429,1.964,430,7.51,431,6.299,432,8.693,433,8.355,434,3.021,435,7.979,436,6.672,437,2.158]],["t/121",[0,0.989,7,0.641,29,2.217,94,1.219,105,0.832,195,3.33,223,3.06,438,4.248,441,3.843,662,3.39]],["t/123",[9,1.046,25,1.65,37,2.521,41,1.464,64,1.614,81,1.607,102,1.696,110,1.558,117,1.123,124,1.547,135,2.283,146,1.982,149,1.168,186,2.754,187,1.377,189,1.505,196,2.586,202,2.614,215,2.013,224,1.389,270,3.099,275,1.515,276,1.515,277,1.255,318,2.631,322,2.549,323,1.739,402,2.162,407,2.432,412,2.78,415,1.969,418,2.283,425,1.454,428,1.484,429,1.569,437,2.327,440,1.214,448,2.695,453,2.801,454,2.864,455,2.211,456,2.8,457,1.711,458,2.674,459,2.615,460,2.596,461,1.711,462,2.496,463,2.596,464,1.711,465,2.171,466,2.759,467,2.8,468,3.013,469,2.615,470,1.724,471,2.467,472,1.737,473,2.8,474,2.759,475,1.662,477,2.118,480,1.699,481,1.711,482,2.31,483,1.674,484,2.227,485,2.103,486,1.711,487,1.777,488,1.699,489,1.711,490,2.615,491,2.615,492,1.711,493,1.603,494,2.133,504,1.724,505,1.724,506,1.724,507,1.724,508,1.711,509,1.368,510,1.474,511,1.724,512,2.276,513,1.711,514,1.724,515,1.724,516,1.724,517,1.724,518,1.724,519,2.327,524,1.711,525,1.724,526,1.777,527,1.737,528,1.724,529,1.724,530,1.724,531,1.737,532,1.737,533,1.737,534,1.777,535,1.724,536,1.724,537,1.737,538,1.737,545,2.345,546,2.059,850,4.416,851,3.811]],["t/125",[0,0.949,7,0.713,14,0.888,17,0.499,29,2.649,79,2.031,94,1.402,95,1.149,102,1.698,105,0.978,108,4.096,116,3.358,141,1.298,146,1.95,158,2.216,187,1.622,189,1.773,209,1.889,223,2.301,224,1,231,2.62,275,1.785,276,1.785,321,1.81,428,1.748,429,2.359,434,1.902,441,4.592,453,2.692,455,1.93,465,1.421,471,2.427,475,2.752,477,2.598,479,3.053,485,1.836,494,2.617,497,2.772,501,2.827,546,1.798,547,2.419,549,1.823,551,2.517,552,1.972,553,1.875,554,1.987,555,1.944,854,2.078,859,2.92,860,4.202,864,2.109,1015,5.976,1016,8.398,1017,9.498,1018,5.897,1019,3.252,1020,8.398,1021,5.976,1022,5.976,1023,5.976,1024,5.025,1025,5.976,1026,5.976,1027,5.976,1028,5.976,1029,3.497]],["t/127",[3,1.019,14,0.907,29,2.171,80,1.605,105,0.937,117,1.724,144,4.265,202,3.419,223,3.447,252,3.047,277,1.449,289,3.886,299,3.477,302,2.231,400,4.689,402,2.171,560,5.078]],["t/129",[3,1.004,59,5.632,80,1.582,164,2.608,204,6.25,216,5.187,223,2.953,270,2.46,281,5.632,323,2.379,324,4.919,337,4.101,415,1.948,423,5.765,424,5.765,425,2.199,440,1.837,634,4.005,1030,6.25,1031,7.269,1032,8.039,1033,6.947,1034,9.029,1035,9.029,1036,5.911,1037,8.211]],["t/131",[3,1.211,12,5.199,23,7.093,25,2.922,27,1.715,60,7.421,79,2.119,81,1.839,149,0.816,152,2.923,164,2.662,192,5.645,197,4.717,212,5.241,214,6.234,238,5.078,241,5.428,242,5.906,243,4.685,253,4.933,257,6.234,261,1.956,269,5.241,284,4.788,289,4.275,300,3.7,309,5.645,312,3.55,323,2.463,326,3.952,361,3.932,371,3.503,402,2.388,408,5.083,418,1.715,431,5.685,553,1.956,562,4.576,604,5.078,638,3.996,713,3.648,714,4.933,740,4.138,749,6.234,752,5.428,754,6.234,755,4.94,771,5.906,784,6.672,787,6.819,788,5.906,842,5.428,847,7.116,873,4.803,1031,5.906,1038,7.233,1039,7.337,1040,8.114,1041,7.337,1042,4.576,1043,5.645,1044,7.337,1045,5.906,1046,8.382,1047,7.337,1048,5.906,1049,6.672,1050,9.218,1051,9.218,1052,9.218,1053,6.234,1054,6.234,1055,7.337,1056,6.234,1057,9.218,1058,7.337,1059,7.337,1060,7.337,1061,7.337,1062,7.337,1063,5.428,1064,7.337,1065,7.337,1066,5.645,1067,5.645,1068,7.337,1069,9.218,1070,7.337,1071,7.337,1072,7.337,1073,7.337,1074,4.933,1075,7.337,1076,6.672,1077,7.337]],["t/133",[0,0.897,1,0.869,3,0.716,4,4.02,5,3.702,12,5.902,13,2.336,20,2.927,21,4.604,27,2.355,45,3.118,59,7.012,75,3.806,79,3.359,80,1.486,105,0.573,117,1.783,124,2.198,128,4.783,130,2.594,135,1.507,144,3.947,150,2.357,152,2.568,160,3.4,198,3.932,209,1.731,223,2.108,243,6.681,245,4.219,261,1.718,267,6.827,268,7.293,269,7.475,277,1.439,283,5.703,299,3.218,300,3.25,302,1.569,305,7.712,323,2.426,361,3.454,402,1.527,408,4.277,418,2.216,431,6.177,553,1.718,590,5.476,600,2.336,637,6.418,658,4.966,659,2.963,673,3.932,741,4.115,743,4.473,755,3.454,779,7.206,787,6.274,818,5.476,909,5.476,1031,6.827,1037,9.959,1038,6.932,1048,7.631,1049,8.62,1053,7.206,1066,4.959,1078,3.572,1079,5.861,1080,7.712,1081,5.861,1082,8.481,1083,6.445,1084,5.861,1085,6.445,1086,6.445,1087,6.445,1088,5.476,1089,5.476,1090,6.445,1091,4.604,1092,4.959,1093,8.481,1094,6.445,1095,8.481,1096,6.445,1097,7.206,1098,9.479,1099,6.445,1100,9.479,1101,9.479,1102,6.445,1103,6.445,1104,5.861,1105,6.445,1106,6.445,1107,5.861,1108,7.631,1109,4.604,1110,6.827,1111,3.572,1112,5.861,1113,5.861,1114,5.861,1115,8.651,1116,4.959,1117,8.481,1118,7.631,1119,8.481,1120,6.445,1121,6.445,1122,8.481,1123,6.827,1124,9.159,1125,6.445,1126,7.712,1127,6.445]],["t/135",[3,0.986,17,0.63,80,1.553,92,2.986,93,3.031,95,1.141,117,1.668,158,2.552,164,2.561,202,3.354,244,2.593,252,2.948,277,1.551,326,3.802,337,4.97,423,6.602,424,6.602,425,2.665,426,6.137,1042,7.032]],["t/137",[3,1.174,29,2.18,149,1.022,198,5.611,245,6.022,277,1.265,360,7.815,425,2.24,669,5.611,1128,8.972,1129,10.56,1130,10.56,1131,9.198,1132,9.198,1133,8.364]],["t/139",[3,1.044,149,1.044,151,5.729,166,5.857,404,3.148,408,4.736,415,2.026,427,6.314]],["t/141",[3,0.963,80,1.518,149,1.205,164,3.296,165,5.826,166,7.119,168,8.019,169,6.41,170,6.41,171,6.667,195,3.085,202,3.309,204,5.997,270,2.778,383,6.19,403,5.286,404,2.905,408,5.144,411,5.973,415,1.87,453,2.169,462,2.214,564,4.977,1033,7.848,1134,5.997,1135,5.532,1136,7.848,1137,7.879,1138,6.975,1139,8.665,1140,7.848,1141,8.665,1142,7.879]],["t/143",[3,1.227,37,2.298,41,1.246,80,1.457,84,6.15,85,3.97,102,1.159,140,5.755,144,3.869,149,0.924,152,3.312,159,4.077,164,2.401,194,6.499,200,4.385,281,5.186,282,7.064,318,2.081,361,4.456,400,4.254,408,5.372,415,2.473,425,2.025,431,4.689,436,5.946,453,2.081,462,2.125,561,4.607,603,3.04,638,3.605,712,3.279,723,6.974,734,4.607,817,5.072,1032,6.397,1033,6.397,1038,5.186,1054,8.456,1092,6.397,1143,9.051,1144,8.314,1145,8.314,1146,6.397,1147,7.56,1148,9.687,1149,7.064,1150,5.755,1151,7.56,1152,8.314,1153,7.56,1154,7.56,1155,8.314,1156,8.314,1157,8.314,1158,8.314,1159,8.314,1160,8.314]],["t/145",[1,0.653,3,1.318,7,0.332,13,2.524,25,1.925,50,2.058,59,3.021,74,4.943,77,1.969,79,1.399,85,2.313,94,0.631,102,1.603,105,0.619,109,4.892,119,2.861,130,1.949,141,1.285,146,1.052,149,1.094,152,2.775,158,1.196,159,2.375,160,2.555,163,3.618,164,3.309,166,7.045,168,7.279,169,6.598,170,6.598,171,6.863,179,4.448,191,4.684,194,4.249,195,1.724,204,4.821,210,3.385,216,4.001,224,1.399,234,1.949,246,5.918,261,2.817,270,1.897,323,1.503,388,3.583,404,3.478,408,5.328,410,4.684,415,1.503,425,2.396,438,2.2,453,1.212,462,1.238,465,1.648,476,2.2,546,1.78,551,1.358,555,1.925,560,3.86,564,5.652,582,3.929,586,6.863,611,5.34,623,3.929,634,2.148,654,2.639,713,2.408,721,4.405,747,3.09,766,3.46,802,4.976,842,7.279,847,2.955,875,5.031,937,5.839,1033,5.359,1038,5.563,1042,7.004,1053,4.115,1054,9.597,1088,7.578,1111,2.684,1114,4.405,1134,4.821,1136,6.863,1137,8.947,1138,7.18,1147,6.334,1149,9.112,1150,7.313,1151,8.593,1161,8.111,1162,6.334,1163,3.899,1164,3.899,1165,4.405,1166,11.229,1167,4.844,1168,8.111,1169,2.343,1170,9.597,1171,4.844,1172,8.947,1173,6.966,1174,6.966,1175,6.966,1176,6.966,1177,6.966,1178,6.334,1179,6.334,1180,6.966,1181,9.839,1182,4.844,1183,6.966,1184,6.966,1185,4.844,1186,4.844,1187,4.844,1188,6.966,1189,6.966,1190,6.966,1191,5.918,1192,8.919,1193,6.966,1194,8.919,1195,6.966,1196,6.966,1197,6.966,1198,6.966,1199,6.966,1200,6.966,1201,4.115,1202,4.844,1203,4.844,1204,6.966,1205,6.93,1206,8.157,1207,4.844,1208,6.966,1209,6.966,1210,6.966,1211,6.966,1212,4.844,1213,4.844,1214,4.844,1215,4.844,1216,3.899,1217,4.844,1218,4.844,1219,6.966,1220,6.966]],["t/147",[3,1.196,11,3.219,14,0.594,37,2.706,80,1.418,102,1.575,109,4.023,120,2.855,139,3.387,149,1.017,164,3.041,166,6.824,168,7.789,169,5.986,170,5.986,171,6.226,176,3.014,187,1.866,194,6.423,215,1.238,216,6.285,224,1.301,270,3.188,281,7.147,282,9.143,312,4.945,323,1.296,337,3.675,361,3.219,371,2.867,407,2.157,408,5.154,415,2.546,425,1.97,436,4.834,462,1.535,552,1.684,564,4.648,591,8.362,641,4.038,713,2.986,723,7.663,747,2.664,842,5.986,845,8.228,850,4.443,873,3.932,918,5.103,1032,9.056,1136,6.226,1143,7.358,1148,9.295,1153,5.461,1154,5.461,1172,7.358,1178,7.358,1221,11.204,1222,5.461,1223,5.601,1224,10.529,1225,8.091,1226,8.091,1227,8.091,1228,6.006,1229,6.006,1230,8.091,1231,8.904,1232,8.091,1233,8.091,1234,6.006,1235,6.006,1236,7.358,1237,8.091,1238,8.091,1239,10.221,1240,10.221,1241,6.006,1242,6.006,1243,6.006,1244,6.006,1245,6.006,1246,6.006]],["t/149",[0,0.939,1,1.197,3,0.987,9,1.556,13,3.219,14,0.879,17,0.631,25,2.455,27,2.077,149,0.987,164,2.566,166,5.541,174,4.298,177,7.151,204,7.581,216,5.103,326,3.809,402,2.105,408,4.48,415,1.917,462,2.27,1036,5.815,1078,4.923,1107,8.078,1134,7.164,1138,8.332,1142,9.412,1170,7.547,1247,8.078,1248,8.883,1249,8.883,1250,8.883,1251,7.547]],["t/151",[3,0.934,75,3.769,81,1.997,85,4.01,139,4.737,149,0.934,164,3.2,166,6.673,168,8.656,169,7.408,170,7.408,171,7.705,198,5.124,216,6.364,224,1.424,289,3.562,337,3.814,408,4.236,462,2.147,616,2.913,715,4.176,755,4.501,1036,5.498,1091,7.153,1136,7.705,1138,6.761,1140,6.462,1162,7.638,1223,5.813,1252,6,1253,9.419,1254,7.638,1255,8.399,1256,6,1257,8.399,1258,8.399,1259,8.399,1260,9.106,1261,8.399,1262,8.399]],["t/153",[3,0.989,102,1.528,117,1.949,191,5.984,270,2.424,402,2.109,415,1.92,429,2.723,431,5.019,433,6.357,501,2.339,549,2.306,603,3.254,743,4.694,1033,7.972,1140,6.847,1149,7.561,1263,10.361,1264,8.899,1265,10.361,1266,8.899,1267,8.899,1268,8.899,1269,8.899,1270,8.899,1271,10.361,1272,8.899,1273,8.899,1274,8.899]],["t/155",[3,1.225,12,4.305,75,3.425,79,2.204,80,1.337,102,1.536,105,0.679,109,3.795,116,3.644,117,1.777,128,4.305,139,4.305,147,5.404,149,0.848,159,4.633,163,4.907,164,3.097,166,5.893,168,7.933,169,6.989,170,6.989,200,4.026,202,3.065,216,6.45,217,6.94,223,3.09,245,4.996,304,3.071,408,3.849,425,1.858,436,4.559,462,2.415,586,5.872,616,2.647,638,3.309,669,4.656,755,4.09,829,8.261,962,8.718,1088,6.484,1089,6.484,1091,7.873,1092,5.872,1136,7.269,1223,5.283,1251,6.484,1275,6.144,1276,11.668,1277,7.632,1278,9.448,1279,5.452,1280,7.632,1281,8.591,1282,7.632,1283,8.027,1284,6.94,1285,7.632,1286,8.591,1287,9.448,1288,7.632,1289,9.448,1290,9.448,1291,7.632,1292,7.632,1293,7.632,1294,7.632,1295,6.484,1296,7.632,1297,6.94,1298,4.76,1299,6.484,1300,6.94]],["t/157",[3,1.151,75,3.986,81,2.064,130,3.575,149,0.987,158,2.193,160,4.686,163,4.614,166,6.455,194,5.419,198,5.419,213,4.545,245,5.815,291,6.149,309,6.835,404,2.978,425,2.163,462,2.27,561,4.923,669,5.419,1140,6.835,1179,8.078,1283,8.793,1284,8.078,1286,8.078,1301,10.35,1302,7.963,1303,8.883,1304,9.412,1305,8.883,1306,8.078]],["t/159",[3,1.208,54,6.112,81,1.737,139,5.771,158,2.15,164,2.516,198,5.314,216,5.004,268,6.702,323,1.88,402,2.064,418,2.036,425,2.645,436,6.49,462,2.226,474,2.461,642,5.702,743,4.595,1036,5.702,1091,7.309,1251,8.693,1260,7.921,1283,9.839,1302,6.702,1307,8.711,1308,8.711,1309,8.711,1310,8.711,1311,8.711,1312,8.711,1313,8.711,1314,8.711,1315,8.711,1316,8.711]],["t/161",[3,0.909,20,3.713,54,5.886,61,6.947,139,4.611,140,7.991,149,1.095,158,2.018,198,4.988,216,5.66,224,1.162,304,3.29,318,2.047,425,2.576,436,6.559,462,2.703,465,1.652,590,6.947,591,6.049,642,5.353,743,4.313,755,4.382,787,6.049,847,4.988,1032,7.581,1036,5.353,1091,7.556,1110,6.582,1223,5.659,1236,8.96,1302,6.291,1304,10.767,1306,7.435,1317,10.577,1318,8.176,1319,8.176,1320,8.176,1321,8.176,1322,10.98,1323,8.176,1324,8.176,1325,8.176,1326,8.176,1327,10.577,1328,7.435,1329,8.96,1330,6.947,1331,8.176]],["t/163",[3,1.002,38,7.256,80,1.579,159,4.42,291,8.075,323,2.378,415,1.945,440,1.833,462,2.668,634,3.998,642,7.213,951,5.9,1091,6.439,1109,7.456,1332,6.935,1333,8.196,1334,9.013,1335,9.013,1336,9.013]],["t/165",[3,1.176,80,1.617,117,1.737,149,1.026,164,2.667,244,2.188,252,3.07,277,1.456,337,4.806,423,6.757,424,6.757,425,2.248]],["t/167",[3,1.23,16,3.62,80,1.597,119,3.743,166,6.552,360,8.925,407,3.083,408,5.581,409,7.271,410,7.063]],["t/169",[0,1.154,1,1.319,3,0.867,5,2.323,6,2.582,7,0.789,9,0.996,13,0.485,14,0.955,15,1.077,16,0.438,17,0.68,19,0.852,20,0.608,25,0.913,27,2.02,29,2.363,30,0.414,35,1.03,37,1.956,39,0.99,41,1.511,44,1.446,45,1.597,50,2.091,51,0.631,52,1.371,55,1.274,57,1.465,64,0.893,74,0.742,76,0.99,77,1.342,78,1.217,79,1.35,80,1.189,81,1.723,85,1.576,90,0.9,92,0.387,93,0.708,94,1.481,95,1.25,96,3.614,102,1.705,104,0.99,105,0.989,108,3.62,110,1.361,116,0.639,117,1.753,119,0.992,120,2.591,123,0.615,124,0.856,125,0.9,128,1.362,130,0.539,133,0.58,135,1.587,141,1.438,142,0.769,144,0.623,146,1.736,149,1.137,150,1.207,154,0.381,158,1.676,159,0.656,160,0.706,163,0.695,164,0.698,179,2.582,181,2.996,185,1.945,186,2.589,187,0.762,188,0.695,189,0.832,195,0.476,196,1.943,200,0.706,202,1.692,204,1.672,205,0.414,209,1.4,215,1.607,221,0.962,223,2.114,224,1.108,226,0.574,227,1.507,231,1.506,234,0.972,244,0.572,245,3.992,259,0.926,261,0.357,262,1.137,264,1.726,270,2.746,272,0.665,275,0.838,276,0.838,277,1.206,288,1.201,297,1.126,300,0.675,302,1.485,307,0.498,310,0.717,311,0.665,312,1.169,314,0.803,315,0.9,318,2.466,319,3.236,320,0.742,321,0.85,322,1.916,323,1.725,333,0.972,356,1.581,358,0.99,389,2.68,402,2.013,407,1.723,412,1.839,415,1.395,418,2.107,419,1.047,422,1.217,425,0.985,428,0.821,429,1.603,434,0.893,437,2.12,438,1.097,439,1.529,440,1.315,441,0.55,443,3.046,444,0.431,445,1.261,446,1.576,447,2.49,448,2.628,449,2.236,450,2.236,451,2.236,452,2.236,453,2.716,454,2.372,455,1.773,456,2.105,457,0.947,458,1.895,459,1.853,460,1.839,461,0.947,462,1.876,463,1.839,464,0.947,465,1.883,466,2.074,467,2.105,468,2.644,469,1.853,470,0.954,471,2.162,472,0.961,473,2.105,474,2.074,475,2.11,476,1.097,477,2.101,479,2.343,480,0.94,481,0.947,482,1.495,483,0.926,484,1.441,485,1.687,486,0.947,487,0.983,488,0.94,489,0.947,490,1.853,491,1.853,492,0.947,493,0.887,494,2.116,497,1.812,501,1.992,504,0.954,505,0.954,506,0.954,507,0.954,508,0.947,509,0.926,510,1.287,511,0.954,512,1.473,513,0.947,514,0.954,515,0.954,516,0.954,517,0.954,518,0.954,519,1.506,524,0.947,525,0.954,526,0.983,527,0.961,528,0.954,529,0.954,530,0.954,531,0.961,532,0.961,533,0.961,534,0.983,535,0.954,536,0.954,537,0.961,538,0.961,545,2.136,546,2.132,547,0.46,549,1.352,551,1.462,552,0.926,553,0.88,554,0.933,555,0.913,556,0.876,561,3.379,563,2.775,564,1.388,594,1.787,597,1.537,600,1.694,601,1.097,602,0.835,603,1.479,604,0.926,606,1.137,612,1.787,614,0.876,616,0.838,618,1.137,623,1.862,624,2.89,625,2.489,627,3.111,629,0.513,630,0.513,631,0.485,634,0.594,635,1.077,636,2.42,637,0.799,638,0.58,643,1.135,644,2.162,646,1.448,653,1.077,658,1.415,659,2.397,660,2.54,661,1.542,662,1.694,664,3.047,665,2.915,669,1.474,677,6.892,678,6.678,681,0.835,684,2.014,691,2.668,707,1.03,712,0.528,715,0.665,717,0.675,735,1.137,743,2.751,755,0.717,758,1.077,766,0.956,830,1.726,844,2.197,852,0.868,853,1.452,854,0.975,855,1.873,856,0.875,857,0.875,858,1.465,859,1.371,862,0.875,863,0.875,864,0.99,865,1.549,866,0.875,874,1.859,953,0.769,1015,1.137,1016,2.805,1017,4.83,1018,2.999,1019,0.875,1020,2.805,1021,1.137,1022,1.137,1023,1.137,1024,0.956,1025,1.137,1026,1.137,1027,1.137,1028,1.137,1029,0.665,1118,1.077,1128,2.052,1146,1.03,1168,1.217,1275,1.945,1298,0.835,1337,1.507,1338,1.03,1339,1.03,1340,0.587,1341,0.876,1342,1.302,1343,4.334,1344,2.443,1345,3.003,1346,1.03,1347,1.217,1348,1.338,1349,1.933,1350,0.99,1351,1.945,1352,1.338,1353,1.338,1354,2.323,1355,2.416,1356,2.416,1357,2.416,1358,2.416,1359,2.416,1360,2.416,1361,3.302,1362,1.338,1363,1.338,1364,1.338,1365,1.338,1366,1.338,1367,1.338,1368,1.859,1369,1.217,1370,3.596,1371,1.338,1372,1.338,1373,1.338,1374,1.338,1375,0.99,1376,1.624,1377,1.137,1378,2.416,1379,2.416,1380,2.416,1381,2.416,1382,2.416,1383,1.338,1384,1.137,1385,2.416,1386,2.416,1387,1.338,1388,1.217,1389,1.338,1390,1.338,1391,1.338,1392,1.137,1393,1.338,1394,1.137,1395,1.137,1396,1.137,1397,0.956,1398,0.956,1399,1.217,1400,0.99,1401,1.972,1402,2.416,1403,2.416,1404,0.883,1405,1.542,1406,2.416,1407,2.416,1408,1.859,1409,2.736,1410,1.338,1411,1.137,1412,1.338,1413,1.137]],["t/171",[41,1.41,94,1.226,105,0.836,221,3.748,234,3.786,509,2.156,1340,4.125]],["t/173",[7,0.64,41,1.399,94,1.388,95,1.176,105,0.83,415,2.015,601,4.24,603,3.414,636,2.981]],["t/175",[14,0.922,17,0.756,30,2.883,41,1.397,94,1.215,149,1.036,277,1.282,302,2.269,600,3.377,636,2.975,1344,6.894]],["t/177",[3,1.04,14,0.926,52,3.883,117,1.76,141,1.726,149,1.04,158,2.309,224,1.33,1337,5.835,1342,3.69]],["t/179",[0,1.124,1,1.254,7,0.637,14,0.92,17,0.661,41,1.394,44,2.877,52,3.861,105,0.827,302,2.265,616,3.226,1275,7.488]],["t/181",[7,0.647,52,3.92,95,1.042,105,0.84,302,2.3]],["t/183",[0,0.974,7,0.631,14,0.912,17,0.654,41,1.584,50,2.722,94,1.449,95,1.017,105,0.819,221,3.671,302,2.244,314,3.064,603,3.37,636,3.375]],["t/185",[0,0.993,74,5.204,76,6.947,95,1.036,223,3.072,465,1.898,603,3.434,636,2.998]],["t/187",[7,0.727,85,4.433,94,1.453,95,1.231,389,5.004,636,2.964,643,3.193,1377,7.888]],["t/189",[0,0.991,1,1.439,3,1.042,7,0.642,95,1.035,105,0.833,141,1.729,333,3.772]],["t/191",[0,0.997,7,0.646,50,2.785,95,1.04,105,0.838,1392,8.009]],["t/193",[0,1.223,1,1.17,3,1.135,7,0.743,14,1.01,17,0.725,27,2.387,50,3.016,94,1.131,95,1.127,105,0.996,149,0.965,288,4.316,549,2.812,563,3.986,594,7.553,646,3.806,664,4.238,684,6.618,691,5.225,1394,7.375,1395,7.375,1396,7.375,1397,6.201,1398,6.201]],["t/195",[0,0.985,3,1.036,6,4.232,7,0.638,90,3.471,105,0.829,117,2.002,215,1.921,231,3.471,418,2.179,743,4.916]],["t/197",[0,0.98,3,1.03,7,0.635,85,4.425,94,1.208,105,0.991,215,1.91,223,3.469,227,5.78,231,3.451,418,2.166,743,4.888]],["t/199",[1,1.436,77,3.796,110,2.437,117,1.757,307,3.478,418,2.49,419,4.048,664,3.876,1409,5.467]],["t/201",[0,0.955,1,1.217,3,1.161,7,0.755,9,1.582,44,3.232,81,1.801,94,1.478,105,0.929,149,1.004,160,4.763,181,5.187,200,4.763,226,3.871,288,4.489,302,2.199,356,5.911,419,3.915,510,2.229,658,5.287,1368,6.947]],["t/203",[0,0.967,3,1.232,9,1.602,17,0.65,19,3.715,30,2.829,80,1.602,105,0.936,117,1.721,149,1.017,244,2.167,252,3.041,277,1.524,302,2.227,404,3.067,563,3.256]],["t/205",[1,1.238,3,1.021,14,0.908,17,0.652,80,1.608,85,4.383,131,7.391,141,1.694,149,1.021,223,3.003,423,5.862,424,5.862,476,4.169,561,5.087,603,3.357,1030,6.355,1031,7.391,1354,5.274,1414,6.792,1415,7.8]],["t/207",[7,0.616,29,2.132,45,4.352,76,6.655,80,1.576,81,1.794,105,0.8,109,4.473,130,3.62,133,3.9,140,6.227,149,1.159,158,2.718,160,4.745,221,3.584,465,1.818,476,4.086,646,3.945,747,3.99,848,5.168,1354,5.989,1414,6.655,1416,8.181,1417,8.181,1418,8.997,1419,5.488,1420,6.049]],["t/209",[0,1.086,3,0.975,14,1.078,17,0.798,27,2.051,45,4.971,79,2.967,80,1.537,85,4.906,104,2.631,117,1.65,128,4.948,145,7.062,146,1.906,202,2.846,215,1.808,224,1.247,289,4.357,302,2.136,333,3.53,337,3.984,383,6.267,430,5.899,476,4.948,619,6.75,620,5.743,754,7.453,755,4.701,842,6.49,1038,5.472,1116,6.75,1421,6.909]],["t/211",[17,0.744,80,1.588,92,3.024,93,3.07,95,1.219,117,1.705,244,2.481,252,3.013,277,1.519,326,3.886,337,4.755,425,2.55,755,4.857,1042,7.081]],["t/213",[3,1.013,11,4.884,80,1.597,141,1.681,149,1.168,151,5.559,186,2.297,195,3.244,261,2.43,281,5.684,284,4.733,403,6.408,412,2.989,427,6.128,466,2.574,597,4.889,622,6.128,715,4.531,747,4.042,881,6.51]],["t/215",[3,0.902,17,0.429,37,2.711,41,1.47,64,1.632,102,1.698,124,1.564,135,2.294,141,1.498,146,1.993,149,1.172,183,2.708,186,1.521,187,1.392,189,1.521,196,2.597,215,2.173,223,1.974,224,1.395,261,1.609,270,3.104,275,1.532,276,1.532,318,2.456,322,2.561,337,2.741,383,4.311,407,1.609,415,1.752,418,2.465,425,1.47,428,1.5,453,2.886,454,2.73,455,2.227,456,2.813,457,1.73,459,2.327,460,2.61,461,1.73,462,2.617,463,2.61,464,1.73,465,2.242,466,2.771,467,2.813,468,2.813,469,2.63,470,1.743,471,2.481,472,1.756,473,2.935,474,2.892,477,2.134,480,2.31,481,1.73,482,2.327,483,1.692,484,2.244,485,2.119,486,1.73,488,1.717,489,1.73,490,2.813,491,2.813,492,1.73,493,1.621,494,2.149,504,1.743,505,1.743,506,1.743,507,1.743,508,1.73,509,1.383,511,1.743,512,2.293,513,1.73,514,1.743,515,1.743,516,1.743,517,1.743,518,1.743,519,2.345,524,1.73,525,1.743,527,1.756,528,1.743,529,1.743,530,1.743,531,1.756,532,1.756,533,1.756,535,1.743,536,1.743,537,1.756,538,1.756,565,4.465,569,4.465,573,4.858,574,4.858,579,4.858,584,4.465,591,6.786,604,4.177,755,3.234,1405,3.853,1419,3.682,1422,5.128,1423,5.128,1424,5.128,1425,5.128,1426,5.128,1427,4.643]],["t/217",[3,1.043,14,0.537,17,0.385,37,2.894,41,1.406,64,1.467,102,1.7,124,1.406,135,2.193,141,1.392,146,2.142,149,1.164,183,2.434,186,1.367,187,1.741,189,1.367,195,1.931,196,2.484,215,2.104,216,3.116,221,2.161,223,1.774,224,1.402,245,3.551,261,1.446,270,3.05,275,1.377,276,1.377,281,3.383,312,2.624,318,2.348,322,2.449,323,1.628,337,3.427,383,3.875,400,2.776,402,1.285,407,1.446,408,3.806,412,1.544,415,1.628,418,2.448,425,1.838,428,1.348,434,1.467,436,3.24,453,2.842,454,2.722,455,2.071,456,2.69,457,1.555,459,2.163,460,2.47,461,1.555,462,2.52,463,2.47,464,1.555,465,2.192,466,2.65,467,2.69,468,2.69,469,2.488,470,1.567,471,2.347,472,1.578,473,2.827,474,2.786,477,1.984,480,2.47,481,1.555,482,2.163,483,1.521,484,2.086,485,1.97,486,1.555,488,1.544,489,1.555,490,2.69,491,2.69,492,1.555,493,1.457,494,1.998,504,1.567,505,1.567,506,1.567,507,1.567,508,1.555,509,1.243,511,1.567,512,2.132,513,1.555,514,1.567,515,1.567,516,1.567,517,1.567,518,1.567,519,2.18,524,1.555,525,1.567,527,1.578,528,1.567,529,1.567,530,1.567,531,1.578,532,1.578,533,1.578,535,1.567,536,1.567,537,1.578,538,1.578,552,1.521,565,4.013,569,4.013,573,4.367,574,4.367,579,4.367,584,4.013,591,6.94,597,3.512,604,3.755,723,4.94,751,3.875,851,3.464,918,4.609,951,3.551,1032,4.174,1092,6.677,1222,4.933,1223,3.755,1405,3.464,1422,4.609,1423,4.609,1424,4.609,1425,4.609,1426,4.609,1427,4.174,1428,5.424,1429,5.424,1430,6.862,1431,9.712,1432,7.547,1433,5.424,1434,4.933,1435,4.933,1436,5.424,1437,4.933,1438,8.678,1439,5.424,1440,4.933,1441,5.424,1442,4.933,1443,4.933,1444,5.424,1445,5.424,1446,5.424]],["t/219",[3,1.088,17,0.378,37,2.879,41,1.394,64,2.013,80,0.932,102,1.7,124,1.379,130,2.14,135,2.175,139,3,141,1.373,146,2.127,149,1.088,159,2.608,183,2.387,186,1.341,187,1.227,189,1.341,196,2.462,201,3.577,215,2.091,223,1.74,224,1.323,261,1.418,270,3.04,275,1.35,276,1.35,318,2.328,322,2.428,361,2.851,383,3.8,408,2.682,412,2.444,415,1.606,418,2.372,425,1.295,428,1.322,449,2.267,450,2.267,451,2.267,452,2.267,453,2.834,454,2.705,455,2.042,456,2.667,457,1.525,459,2.134,460,2.444,461,1.525,462,2.502,463,2.444,464,1.525,465,2.182,466,2.628,467,2.667,468,2.667,469,2.462,470,1.536,471,2.323,472,1.548,473,2.807,474,2.766,477,1.957,480,2.444,481,1.525,482,2.134,483,1.492,484,2.057,485,1.943,486,1.525,488,1.514,489,1.525,490,2.667,491,2.667,492,1.525,493,1.428,494,1.971,504,1.536,505,1.536,506,1.536,507,1.536,508,1.525,509,1.219,511,1.536,512,2.103,513,1.525,514,1.536,515,1.536,516,1.536,517,1.536,518,1.536,519,2.15,524,1.525,525,1.536,527,1.548,528,1.536,529,1.536,530,1.536,531,1.548,532,1.548,533,1.548,535,1.536,536,1.536,537,1.548,538,1.548,565,3.935,569,3.935,573,4.282,574,4.282,579,4.282,584,3.935,591,7.706,604,3.682,609,4.519,851,3.396,1092,6.607,1133,4.837,1405,3.396,1422,4.519,1423,4.519,1424,4.519,1425,4.519,1426,4.519,1427,4.093,1430,6.769,1431,10.056,1434,4.837,1435,4.837,1437,4.837,1440,4.837,1442,4.837,1443,4.837,1447,4.837,1448,5.319,1449,5.319,1450,7.444,1451,5.319,1452,5.319,1453,5.319,1454,5.319,1455,5.319,1456,5.319,1457,5.319,1458,5.319,1459,5.319,1460,5.319,1461,5.319,1462,5.319,1463,5.319,1464,5.319,1465,5.319,1466,5.319,1467,5.319,1468,5.319,1469,5.319,1470,5.319,1471,5.319,1472,5.319,1473,5.319,1474,5.319,1475,5.319,1476,5.319,1477,5.319,1478,5.319,1479,5.319,1480,5.319,1481,5.319]],["t/221",[3,1.228,14,1.093,17,0.644,41,1.358,44,2.803,95,1,104,3.14,149,1.164,158,2.585,180,6.273,195,3.226,244,2.148,252,3.482,302,2.55,405,3.886,416,8.241,687,4.637,717,4.57]],["t/223",[0,1.22,1,1.515,3,0.909,7,0.675,9,1.924,29,1.937,30,2.529,31,3.506,32,3.394,50,2.415,51,3.854,67,4.247,79,2.361,95,0.902,104,3.463,105,0.976,117,1.538,125,5.498,128,4.611,149,0.909,154,3.125,155,5.221,157,4.884,201,5.498,202,2.653,285,4.184,299,3.103,318,2.047,326,4.993,409,7.991,410,7.763,418,1.911,625,3.146,631,2.963,637,4.884,713,4.065,817,6.011,1384,6.947,1482,8.176]],["t/225",[0,0.908,1,1.158,7,0.765,9,1.995,13,3.113,16,2.809,29,2.405,57,3.81,77,3.492,80,1.505,81,1.713,83,3.683,85,4.101,90,3.199,95,1.12,96,3.489,105,0.96,149,0.955,150,3.141,154,3.074,194,5.24,195,3.058,228,6.915,244,2.035,261,2.29,307,3.199,312,4.155,314,2.856,323,1.853,339,7.298,419,3.724,625,2.742,646,3.766,717,4.331,1134,5.945,1150,5.945,1342,3.388,1483,7.81,1484,7.81,1485,7.81,1486,6.915]],["t/227",[0,1.103,1,1.214,3,1.102,7,0.79,9,1.239,14,0.981,16,2.314,17,0.765,19,3.179,29,2.348,41,1.615,44,2.188,50,2.09,51,3.334,52,3.739,80,1.578,83,2.412,92,2.043,93,2.641,94,1.527,95,1.288,102,1.697,105,0.979,119,2.906,141,1.305,154,2.969,174,3.422,188,3.674,205,2.188,221,2.818,223,2.314,224,1.281,225,3.691,234,2.847,244,1.676,277,0.973,302,2.413,314,2.352,315,7.016,333,2.847,405,3.033,438,3.213,439,2.074,440,1.439,441,4.286,444,2.277,445,2.205,446,2.722,447,2.743,509,1.621,603,2.587,616,2.453,621,3.292,636,2.876,712,2.79,1169,3.422,1340,3.102,1487,3.731,1488,7.458,1489,7.074]],["t/229",[7,0.638,9,1.633,83,3.178,102,1.299,105,0.829,154,3.028,205,2.883,224,1.325,225,3.471,244,2.208,277,1.282]],["t/231",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,509,1.996,603,3.185,616,3.021,636,3.266,1340,3.819]],["t/234",[0,0.953,1,1.215,7,0.617,29,2.136,77,3.664,94,1.36,95,0.995,102,1.607,105,0.928,150,3.296,195,3.209,205,2.788,224,1.281,299,3.42,315,7.018,441,4.287,1018,5.812,1488,7.224,1490,8.196]],["t/236",[1,0.93,7,0.555,14,0.683,17,0.34,25,1.322,37,2.238,41,1.329,64,1.867,81,1.377,94,0.623,95,0.894,102,1.705,104,3.101,105,0.72,108,3.016,110,1.248,124,1.789,135,1.893,141,0.882,146,2.194,149,1.149,158,1.181,186,2.758,187,1.103,189,1.205,196,2.347,209,1.284,215,1.669,224,1.261,270,2.981,275,1.214,276,1.214,277,1.114,318,2.588,321,1.231,322,2.314,323,1.914,402,1.919,407,2.159,412,2.305,415,1.489,418,2.073,425,1.165,428,1.189,429,1.814,434,1.293,437,2.561,440,0.973,448,2.983,449,2.701,450,2.701,451,2.701,452,2.701,453,2.863,454,2.693,455,1.894,456,2.542,457,1.371,458,2.374,459,2.322,460,2.305,461,1.371,462,2.266,463,2.305,464,1.371,465,2.089,466,2.505,467,2.542,468,2.964,469,2.322,470,1.381,471,2.543,472,1.392,473,2.542,474,2.505,475,2.468,477,2.472,479,2.6,480,1.361,481,1.371,482,1.979,483,1.341,484,1.908,485,2.314,486,1.371,487,1.423,488,1.361,489,1.371,490,2.322,491,2.322,492,1.371,493,1.853,494,2.489,497,2.487,501,1.814,504,1.381,505,1.381,506,1.381,507,1.381,508,1.371,509,1.096,510,1.181,511,1.381,512,1.95,513,1.371,514,1.381,515,1.381,516,1.381,517,1.381,518,1.381,519,1.994,524,1.371,525,1.381,526,1.423,527,1.392,528,1.381,529,1.381,530,1.381,531,1.392,532,1.392,533,1.392,534,1.423,535,1.381,536,1.381,537,1.392,538,1.392,545,2.58,546,2.403,547,1.645,549,1.24,551,1.936,552,1.341,553,1.275,554,1.351,555,1.322,662,1.733,854,1.413,859,1.985,864,1.434,1019,1.733,1029,2.378,1400,1.434,1488,6.138,1491,7.534,1492,1.781,1493,1.781,1494,1.781,1495,1.765,1496,2.378,1497,4.783,1498,4.783,1499,1.781,1500,2.571,1501,1.765,1502,1.781,1503,1.781,1504,4.783,1505,4.783,1506,1.781,1507,1.781,1508,1.765,1509,4.783,1510,4.783,1511,4.783,1512,1.798]],["t/238",[0,0.33,6,1.417,7,0.669,14,0.704,17,0.354,25,1.378,27,1.938,37,2.291,41,1.355,64,1.349,79,1.44,81,1.419,94,0.65,95,1.055,102,1.706,105,0.85,108,3.088,110,1.302,117,1.798,120,2.926,123,3.811,124,1.292,135,1.938,141,0.92,146,2.076,149,1.162,158,1.756,164,1.44,186,2.78,187,1.15,189,1.257,196,2.393,202,1.013,209,1.339,215,1.793,224,1.285,231,1.857,270,3.005,275,1.266,276,1.266,277,1.14,297,1.7,299,1.184,314,1.038,318,2.617,321,1.283,322,2.359,323,1.95,402,2.062,407,2.21,412,2.359,415,1.535,418,2.113,425,1.214,428,1.24,429,1.869,434,1.349,437,2.611,440,1.014,441,4.081,448,3.021,449,2.753,450,2.753,451,2.753,452,2.753,453,2.878,454,2.726,455,2.275,456,2.591,457,1.43,458,2.43,459,2.377,460,2.359,461,1.43,462,2.31,463,2.359,464,1.43,465,2.113,466,2.553,467,2.591,468,2.997,469,2.377,470,1.44,471,2.584,472,1.451,473,2.591,474,2.553,475,2.516,477,2.512,479,2.802,480,1.419,481,1.43,482,2.039,483,1.398,484,1.966,485,2.164,486,1.43,487,1.484,488,1.419,489,1.43,490,2.377,491,2.377,492,1.43,493,1.339,494,2.53,497,2.325,501,2.376,504,1.44,505,1.44,506,1.44,507,1.44,508,1.43,509,1.142,510,1.231,511,1.44,512,2.009,513,1.43,514,1.44,515,1.44,516,1.44,517,1.44,518,1.44,519,2.054,524,1.43,525,1.44,526,1.484,527,1.451,528,1.44,529,1.44,530,1.44,531,1.451,532,1.451,533,1.451,534,1.484,535,1.44,536,1.44,537,1.451,538,1.451,545,2.63,546,2.442,549,1.292,551,1.994,552,1.398,553,1.329,554,1.409,555,1.378,662,1.131,715,1.552,852,1.791,853,2.555,854,1.473,855,2.978,856,1.807,857,1.807,858,2.577,859,1.295,860,2.979,862,1.807,863,1.807,864,1.496,865,1.91,866,1.807,1018,5.322,1400,1.496,1404,1.824,1488,2.16,1491,2.652,1513,3.184,1514,2.652,1515,3.11,1516,5.171,1517,2.099,1518,2.381,1519,2.838]],["t/240",[7,0.721,17,0.787,80,1.602,117,1.721,154,3.294,155,6.721,244,2.494,252,3.041,277,1.524,326,4.513]],["t/242",[0,0.998,1,1.273,176,3.518,252,3.14,848,5.425]],["t/244",[3,1.249,14,1.111,17,0.798,25,3.104,186,2.704,187,1.763,189,1.927,198,6.853,224,1.597,275,1.94,276,1.94,407,2.995,408,5.664,411,6.282,415,2.424,425,2.735,428,1.9,429,2.009,430,7.553,431,6.335,432,8.719,433,8.382,434,3.038,435,8.024,436,6.71,437,2.208]],["t/246",[0,0.976,7,0.725,95,1.019,102,1.475,105,0.941,108,3.942,195,3.287,205,2.856,438,4.193,441,4.347,849,8.143]],["t/248",[9,1.046,25,1.65,37,2.521,41,1.464,64,1.614,81,1.607,102,1.696,104,1.79,110,1.558,124,1.547,135,2.283,146,1.982,149,1.168,186,2.754,187,1.377,189,1.505,196,2.586,202,2.614,215,2.013,224,1.389,270,3.099,275,1.515,276,1.515,277,1.255,318,2.631,322,2.549,323,1.739,402,2.162,407,2.432,412,2.78,415,1.969,418,2.283,425,1.454,428,1.484,429,1.569,437,2.327,440,1.214,448,2.695,453,2.801,454,2.864,455,2.211,456,2.8,457,1.711,458,2.674,459,2.615,460,2.596,461,1.711,462,2.496,463,2.596,464,1.711,465,2.171,466,2.759,467,2.8,468,3.013,469,2.615,470,1.724,471,2.467,472,1.737,473,2.8,474,2.759,475,1.662,477,2.118,480,1.699,481,1.711,482,2.31,483,1.674,484,2.227,485,2.103,486,1.711,487,1.777,488,1.699,489,1.711,490,2.615,491,2.615,492,1.711,493,1.603,494,2.133,504,1.724,505,1.724,506,1.724,507,1.724,508,1.711,509,1.368,510,1.474,511,1.724,512,2.276,513,1.711,514,1.724,515,1.724,516,1.724,517,1.724,518,1.724,519,2.327,524,1.711,525,1.724,526,1.777,527,1.737,528,1.724,529,1.724,530,1.724,531,1.737,532,1.737,533,1.737,534,1.777,535,1.724,536,1.724,537,1.737,538,1.737,545,2.345,546,2.059,850,4.416,851,3.811]],["t/250",[0,0.761,1,1.228,7,0.684,14,0.901,17,0.511,64,1.947,94,0.938,95,1.103,102,1.704,104,3.37,105,0.888,108,3.721,124,1.865,141,1.328,146,2.281,158,1.777,187,1.66,189,1.814,202,2.335,205,2.226,209,1.933,224,1.023,275,1.827,276,1.827,321,1.852,426,4.982,428,1.789,429,2.394,434,1.947,441,4.104,453,2.711,465,1.455,471,2.463,475,2.781,477,2.626,479,3.078,485,2.377,493,1.933,494,2.645,497,2.945,501,2.394,546,1.84,547,2.475,549,1.865,551,2.554,552,2.018,553,1.919,554,2.033,555,1.989,849,7.687,854,2.126,859,2.988,860,4.3,861,6.115,864,2.159,1019,2.608,1492,2.681,1493,2.681,1494,2.681,1495,2.656,1496,3.579,1499,2.681,1500,3.392,1501,2.656,1502,2.681,1503,2.681,1506,2.681,1507,2.681,1508,2.656,1520,5.538,1521,6.545,1522,6.545]],["t/252",[0,0.95,1,1.211,7,0.737,14,0.889,64,1.905,94,0.918,95,1.15,102,1.704,104,2.112,105,0.957,108,3.88,124,1.826,141,1.3,146,2.263,158,1.739,187,1.625,189,1.775,195,2.508,202,2.285,209,1.891,224,1.001,275,1.788,276,1.788,321,1.813,328,5.477,426,4.875,428,1.751,429,2.361,434,1.905,438,3.199,441,4.42,453,2.693,465,1.423,471,2.429,475,2.753,477,2.6,479,3.054,485,2.345,493,1.891,494,2.618,497,2.921,501,2.361,546,1.8,547,2.422,549,1.826,551,2.519,552,1.975,553,1.878,554,1.99,555,1.947,849,8.28,854,2.081,859,2.924,860,4.208,861,5.984,1019,2.553,1492,2.623,1493,2.623,1494,2.623,1495,2.599,1496,3.502,1499,2.623,1500,3.346,1501,2.599,1502,2.623,1503,2.623,1506,2.623,1507,2.623,1508,2.599,1520,5.419,1521,6.405,1522,6.405,1523,7.043]],["t/254",[7,0.75,9,1.975,14,0.877,77,4.203,80,1.553,95,0.979,104,3.101,105,0.919,117,1.668,154,2.942,157,5.297,158,2.189,176,3.303,202,2.877,215,1.827,244,2.593,252,2.948,277,1.551,314,2.948,326,4.433,419,3.844,713,4.409,1524,6.768]],["t/256",[0,1.192,1,1.475,2,6.56,3,0.986,7,0.75,9,1.811,14,0.877,16,2.9,17,0.63,44,3.198,50,3.054,77,3.605,83,3.525,95,0.979,105,0.973,117,1.668,125,5.962,149,1.149,196,2.347,244,2.101,302,2.518,603,3.243,1298,5.531,1525,7.138]],["t/258",[0,1.158,1,1.37,3,1.13,7,0.791,9,1.633,14,1.053,16,2.443,17,0.778,19,3.29,41,1.595,44,2.311,50,2.207,52,3.87,80,1.633,83,2.547,92,2.158,93,2.733,94,1.516,95,1.233,102,1.682,105,0.993,119,3.069,141,1.378,154,2.126,174,3.614,188,3.88,215,1.54,221,2.976,223,2.443,224,1.325,225,3.785,234,3.006,244,1.77,261,2.486,277,1.027,298,7.518,302,2.475,314,2.484,333,3.006,405,3.203,438,3.393,439,2.19,440,1.519,441,4.371,444,2.404,445,2.329,446,2.258,447,2.275,509,1.712,563,2.659,603,2.732,616,2.591,621,3.477,636,2.976,712,2.947,1169,3.614,1340,3.276,1487,3.94]],["t/260",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.451,244,2.196,261,2.828,277,1.275]],["t/262",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,509,1.996,603,3.185,616,3.021,636,3.266,1340,3.819]],["t/265",[0,0.834,1,0.616,3,0.508,7,0.682,14,0.661,17,0.325,25,1.263,27,1.845,37,2.181,41,1.301,50,1.35,64,1.236,77,1.858,79,1.32,80,0.801,81,1.332,94,0.596,95,1.064,102,1.703,105,0.857,108,3.709,110,1.193,117,1.737,120,3.258,124,1.184,135,1.845,141,0.843,146,2.006,149,1.135,152,1.821,158,1.649,164,1.32,186,2.734,187,1.054,189,1.152,196,2.298,202,1.483,205,1.414,209,1.227,215,1.789,224,1.234,270,2.955,275,1.16,276,1.16,277,1.085,297,1.558,298,3.381,299,1.734,307,1.702,318,2.556,321,1.176,322,2.266,323,1.873,371,2.182,402,2.057,407,2.104,412,2.246,415,1.441,418,2.029,425,1.113,428,1.136,429,1.755,434,1.236,437,2.507,440,0.93,441,4.278,448,2.942,449,2.644,450,2.644,451,2.644,452,2.644,453,2.846,454,2.655,455,2.165,456,2.488,457,1.31,458,2.314,459,2.262,460,2.246,461,1.31,462,2.218,463,2.246,464,1.31,465,2.063,466,2.452,467,2.488,468,2.927,469,2.262,470,1.32,471,2.497,472,1.33,473,2.488,474,2.452,475,2.416,477,2.427,479,2.707,480,1.3,481,1.31,482,1.914,483,1.281,484,1.846,485,2.06,486,1.31,487,1.36,488,1.3,489,1.31,490,2.262,491,2.262,492,1.31,493,1.227,494,2.444,497,2.213,501,2.282,504,1.32,505,1.32,506,1.32,507,1.32,508,1.31,509,1.047,510,1.128,511,1.32,512,1.886,513,1.31,514,1.32,515,1.32,516,1.32,517,1.32,518,1.32,519,1.929,524,1.31,525,1.32,526,1.36,527,1.33,528,1.32,529,1.32,530,1.32,531,1.33,532,1.33,533,1.33,534,1.36,535,1.32,536,1.32,537,1.33,538,1.33,545,2.526,546,2.36,549,1.184,551,1.873,552,1.281,553,1.218,554,1.291,555,1.263,563,1.627,662,3.146,852,1.641,853,2.399,854,1.35,855,2.834,856,1.656,857,1.656,858,2.42,859,1.897,860,2.73,862,1.656,863,1.656,864,1.371,865,2.558,866,1.656,1400,1.371,1404,1.671,1524,2.992,1526,8.849,1527,2.918,1528,3.883,1529,4.156]],["t/267",[0,0.529,1,0.675,7,0.62,14,0.705,17,0.223,25,1.383,27,1.46,37,2.296,41,1.357,50,0.926,64,1.689,79,0.905,81,1.422,94,0.814,95,1.03,102,1.706,105,0.805,108,3.476,110,1.306,117,1.466,123,3.582,124,1.619,135,1.942,141,0.923,146,2.161,149,1.163,158,1.542,160,1.654,164,0.905,186,2.782,187,1.154,189,1.261,196,2.397,202,1.017,209,1.344,210,1.899,215,1.797,224,1.287,231,1.168,270,3.007,275,1.27,276,1.27,277,1.142,297,1.069,304,1.261,318,2.619,321,1.288,322,2.363,323,1.954,328,4.38,402,1.968,407,2.215,412,2.364,415,1.539,418,2.116,425,1.219,428,1.244,429,1.874,434,1.353,437,2.615,440,1.018,441,4.014,448,3.024,449,2.757,450,2.757,451,2.757,452,2.757,453,2.879,454,2.729,455,2.138,456,2.595,457,1.435,458,2.435,459,2.381,460,2.364,461,1.435,462,2.314,463,2.364,464,1.435,465,2.115,466,2.557,467,2.595,468,3,469,2.381,470,1.445,471,2.588,472,1.456,473,2.595,474,2.557,475,2.52,477,2.515,479,2.736,480,1.424,481,1.435,482,2.044,483,1.403,484,1.971,485,2.275,486,1.435,487,1.489,488,1.424,489,1.435,490,2.381,491,2.381,492,1.435,493,1.677,494,2.533,497,2.445,501,2.291,504,1.445,505,1.445,506,1.445,507,1.445,508,1.435,509,1.147,510,1.235,511,1.445,512,2.014,513,1.435,514,1.445,515,1.445,516,1.445,517,1.445,518,1.445,519,2.059,524,1.435,525,1.445,526,1.489,527,1.456,528,1.445,529,1.445,530,1.445,531,1.456,532,1.456,533,1.456,534,1.489,535,1.445,536,1.445,537,1.456,538,1.456,545,2.634,546,2.446,547,1.078,549,1.297,551,1.999,552,1.403,553,1.334,554,1.414,555,1.383,563,1.116,636,1.001,654,1.708,662,1.814,740,1.768,852,1.126,853,1.797,854,1.478,855,2.243,856,1.136,857,1.136,858,1.814,859,2.077,860,2.989,862,1.136,863,1.136,864,0.94,866,1.136,1019,1.136,1029,1.559,1048,2.524,1400,1.501,1404,1.146,1492,1.168,1493,1.168,1494,1.168,1495,1.157,1496,1.559,1499,1.168,1500,1.864,1501,1.157,1502,1.168,1503,1.168,1506,1.168,1507,1.168,1508,1.157,1512,1.178,1518,2.389,1520,2.412,1526,8.303,1528,4.252,1529,2.851,1530,2.851,1531,3.135,1532,2.851,1533,2.851,1534,1.559]],["t/269",[0,1.099,1,1.401,7,0.712,9,2.016,17,0.78,80,1.568,83,3.544,105,0.795,117,1.683,176,3.871,186,2.255,244,2.603,252,2.975,277,1.555,326,3.836,510,2.566,563,3.185]],["t/271",[0,0.888,1,1.35,7,0.733,9,1.983,10,5.557,16,2.747,77,3.414,84,6.213,105,0.747,142,4.825,149,1.113,150,3.071,154,3.153,155,6.394,176,3.128,205,3.097,224,1.194,244,1.99,249,4.298,285,4.298,307,3.128,315,5.648,328,4.063,643,3.443,717,4.236,740,4.737,919,6.213,1081,7.638,1118,8.061,1298,5.239,1342,3.95,1488,6.931,1534,4.176,1535,7.638,1536,8.399,1537,10.014,1538,10.014,1539,9.106,1540,7.638,1541,8.399,1542,8.399,1543,8.399,1544,8.399,1545,8.399,1546,5.363,1547,8.399,1548,7.136,1549,5.813]],["t/273",[0,0.642,1,0.819,3,0.612,7,0.703,9,0.704,13,0.62,14,0.807,16,0.559,17,0.542,19,1.061,25,1.337,27,1.71,29,1.439,37,2.253,41,1.432,44,0.93,50,0.505,51,0.806,52,1.247,64,1.49,79,1.161,80,0.527,81,1.388,83,0.583,92,0.494,93,0.881,94,1.181,95,1.139,102,1.707,104,1.964,105,0.889,108,2.725,110,1.263,117,1.612,119,0.702,120,1.944,123,3.507,124,1.428,135,1.906,141,1.12,146,2.097,149,1.153,152,0.681,154,1.864,158,1.617,164,1.161,174,0.827,186,2.764,187,1.116,189,1.219,196,2.36,197,0.875,205,0.529,209,1.299,210,1.14,215,1.868,221,0.681,223,0.559,224,1.308,225,1.497,234,0.688,244,0.712,250,1.043,270,2.988,275,1.228,276,1.228,277,1.179,279,1.516,297,1.371,299,1.836,302,0.979,307,0.637,314,0.999,318,2.596,321,1.245,322,2.327,323,1.924,326,1.289,333,0.688,402,2.031,405,0.733,407,2.173,412,2.32,415,1.502,418,2.084,425,1.178,428,1.203,429,1.829,434,1.308,437,2.575,438,1.365,439,0.501,440,1.121,441,4.004,444,0.55,445,0.533,446,0.908,447,0.915,448,2.994,449,2.715,450,2.715,451,2.715,452,2.715,453,2.867,454,2.702,455,2.169,456,2.556,457,1.387,458,2.39,459,2.337,460,2.32,461,1.387,462,2.278,463,2.32,464,1.387,465,2.096,466,2.518,467,2.556,468,2.973,469,2.337,470,1.397,471,2.554,472,1.408,473,2.556,474,2.518,475,2.482,477,2.483,479,2.735,480,1.377,481,1.387,482,1.995,483,1.357,484,1.923,485,2.185,486,1.387,487,1.44,488,1.377,489,1.387,490,2.337,491,2.337,492,1.387,493,1.479,494,2.5,497,2.348,501,2.253,504,1.397,505,1.397,506,1.397,507,1.397,508,1.387,509,1.262,510,1.194,511,1.397,512,1.966,513,1.387,514,1.397,515,1.397,516,1.397,517,1.397,518,1.397,519,2.01,524,1.387,525,1.397,526,1.44,527,1.408,528,1.397,529,1.397,530,1.397,531,1.408,532,1.408,533,1.408,534,1.44,535,1.397,536,1.397,537,1.408,538,1.408,545,2.594,546,2.442,547,0.588,549,1.254,551,1.952,552,1.357,553,1.29,554,1.367,555,1.337,601,1.365,603,0.625,616,0.593,621,0.796,625,2.894,636,0.959,654,0.932,662,3.106,666,4.845,712,0.674,852,1.444,853,2.181,854,1.429,855,2.628,856,1.457,857,1.457,858,2.2,859,1.247,860,2.402,862,1.457,863,1.457,864,1.451,865,1.54,866,1.457,1018,5.039,1019,0.62,1029,0.85,1111,0.948,1169,0.827,1340,0.75,1400,1.451,1404,1.47,1408,3.093,1487,1.585,1492,0.637,1493,0.637,1494,0.637,1495,0.631,1496,0.85,1499,0.637,1500,1.119,1501,0.631,1502,0.637,1503,0.637,1506,0.637,1507,0.637,1508,0.631,1512,0.643,1513,2.567,1514,1.453,1515,1.066,1516,3.787,1517,1.15,1518,2.899,1519,1.555,1550,5.336,1551,1.453,1552,1.71,1553,1.555,1554,1.71,1555,5.01,1556,1.15,1557,1.555,1558,1.119,1559,1.555,1560,1.555,1561,1.15,1562,1.555,1563,0.964]],["t/275",[7,0.638,9,1.633,83,3.178,102,1.299,105,0.829,154,3.028,205,2.883,224,1.325,225,3.471,244,2.208,277,1.282]],["t/277",[9,1.642,102,1.306,105,0.833,154,2.667,224,1.333,225,3.491,244,2.221,277,1.289,326,4.019]],["t/279",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,509,1.996,603,3.185,616,3.021,636,3.266,1340,3.819]],["t/282",[0,0.495,1,0.916,3,0.521,7,0.548,9,0.82,14,0.673,25,1.294,29,1.611,37,2.212,41,1.316,64,1.838,81,1.356,85,2.236,94,0.61,95,0.883,102,1.704,105,0.711,108,2.98,110,1.222,124,1.762,135,1.871,141,0.864,146,2.18,149,1.143,158,1.156,160,2.47,186,2.747,187,1.08,189,1.18,195,1.667,196,2.324,209,1.257,210,1.777,215,1.649,224,1.248,226,2.008,270,2.969,275,1.188,276,1.188,277,1.101,318,2.573,321,1.205,322,2.292,323,1.895,328,4.973,402,1.896,407,2.134,412,2.277,415,1.467,418,2.053,425,1.14,428,1.164,429,1.787,434,1.266,437,2.536,440,0.952,441,1.923,448,2.964,449,2.674,450,2.674,451,2.674,452,2.674,453,2.855,454,2.675,455,1.865,456,2.517,457,1.342,458,2.346,459,2.294,460,2.277,461,1.342,462,2.244,463,2.277,464,1.342,465,2.077,466,2.48,467,2.517,468,2.947,469,2.294,470,1.352,471,2.522,472,1.363,473,2.517,474,2.48,475,2.444,477,2.451,479,2.574,480,1.333,481,1.342,482,1.949,483,1.313,484,1.879,485,2.292,486,1.342,487,1.394,488,1.333,489,1.342,490,2.294,491,2.294,492,1.342,493,1.825,494,2.468,497,2.462,501,1.787,504,1.352,505,1.352,506,1.352,507,1.352,508,1.342,509,1.073,510,1.156,511,1.352,512,1.92,513,1.342,514,1.352,515,1.352,516,1.352,517,1.352,518,1.352,519,1.963,524,1.342,525,1.352,526,1.394,527,1.363,528,1.352,529,1.352,530,1.352,531,1.363,532,1.363,533,1.363,534,1.394,535,1.352,536,1.352,537,1.363,538,1.363,545,2.555,546,2.383,547,1.61,549,1.214,551,1.906,552,1.313,553,1.248,554,1.323,555,1.294,625,3.105,662,2.463,740,2.641,854,1.383,859,1.944,1018,2.47,1019,1.697,1029,2.328,1400,1.404,1492,1.744,1493,1.744,1494,1.744,1495,1.728,1496,2.328,1499,1.744,1500,2.532,1501,1.728,1502,1.744,1503,1.744,1506,1.744,1507,1.744,1508,1.728,1512,1.76,1548,3.979,1555,8.844,1556,3.149,1557,4.258,1558,3.066,1559,4.258,1560,4.258,1561,3.149,1562,4.258,1564,4.705,1565,4.258,1566,4.258,1567,4.683]],["t/284",[0,0.495,1,0.631,3,0.521,7,0.639,14,0.673,17,0.333,25,1.294,27,2.053,37,2.212,41,1.316,64,1.266,79,1.352,81,1.356,94,0.61,95,1.029,102,1.704,105,0.829,108,3.623,110,1.222,117,1.754,123,4.471,124,1.214,135,1.871,141,0.864,146,2.025,149,1.143,152,1.865,158,1.678,164,1.352,186,2.747,187,1.08,189,1.18,196,2.324,209,1.257,215,1.649,224,1.248,231,1.744,270,2.969,275,1.188,276,1.188,277,1.101,297,1.597,299,1.777,318,2.573,321,1.205,322,2.292,323,1.895,328,2.265,402,1.896,407,2.134,412,2.277,415,1.467,418,2.053,425,1.14,428,1.164,429,1.787,434,1.266,437,2.536,440,0.952,441,3.995,448,2.964,449,2.674,450,2.674,451,2.674,452,2.674,453,2.855,454,2.675,455,2.196,456,2.517,457,1.342,458,2.346,459,2.294,460,2.277,461,1.342,462,2.244,463,2.277,464,1.342,465,2.077,466,2.48,467,2.517,468,2.947,469,2.294,470,1.352,471,2.522,472,1.363,473,2.517,474,2.48,475,2.444,477,2.451,479,2.734,480,1.333,481,1.342,482,1.949,483,1.313,484,1.879,485,2.089,486,1.342,487,1.394,488,1.333,489,1.342,490,2.294,491,2.294,492,1.342,493,1.257,494,2.468,497,2.244,501,2.308,504,1.352,505,1.352,506,1.352,507,1.352,508,1.342,509,1.073,510,1.156,511,1.352,512,1.92,513,1.342,514,1.352,515,1.352,516,1.352,517,1.352,518,1.352,519,1.963,524,1.342,525,1.352,526,1.394,527,1.363,528,1.352,529,1.352,530,1.352,531,1.363,532,1.363,533,1.363,534,1.394,535,1.352,536,1.352,537,1.363,538,1.363,545,2.555,546,2.383,549,1.214,551,1.906,552,1.313,553,1.248,554,1.323,555,1.294,662,1.697,739,2.857,852,1.682,853,2.442,854,1.383,855,2.874,856,1.697,857,1.697,858,2.463,859,1.944,860,2.797,862,1.697,863,1.697,864,1.404,866,1.697,1018,5.293,1400,1.404,1404,1.712,1513,2.99,1514,3.979,1518,3.246]],["t/286",[7,0.721,9,1.844,17,0.787,80,1.602,117,1.721,154,3.294,244,2.494,252,3.041,277,1.524,326,4.513]],["t/288",[0,0.953,1,1.407,14,0.892,17,0.64,141,1.926,146,1.958,160,5.505,176,3.357,202,3.386,206,6.935,215,1.857,223,2.948,252,2.997,299,3.42,304,4.434,307,3.887,501,2.369,712,3.555,767,7.456,848,5.177,1534,4.481,1568,7.658]],["t/290",[0,1.094,1,1.395,3,1.232,14,1.096,17,0.787,25,3.062,186,2.72,187,1.794,198,6.759,224,1.575,275,1.974,276,1.974,307,3.854,407,2.954,408,5.588,411,6.32,415,2.391,425,2.698,428,1.933,429,2.044,430,7.45,431,6.249,432,8.656,433,8.359,434,2.997,435,7.915,436,6.619]],["t/292",[1,1.259,141,1.723,202,3.029,215,1.924,223,3.054,299,3.543,304,3.757,328,4.517,644,6.113,712,3.683,746,8.491]],["t/294",[9,1.06,25,1.672,37,2.538,41,1.472,64,1.636,81,1.622,102,1.697,110,1.579,124,1.568,135,2.147,146,1.995,149,1.139,186,2.762,187,1.395,196,2.6,202,1.963,215,1.893,224,1.396,270,3.105,275,1.535,276,1.535,277,1.263,318,2.565,322,2.563,323,1.306,402,2.176,407,2.449,412,2.795,415,1.982,418,2.296,425,1.473,428,1.504,429,1.59,437,1.747,440,1.231,448,2.713,453,2.808,454,2.874,455,2.231,456,2.815,457,1.734,458,2.693,459,2.633,460,2.614,461,1.734,462,2.51,463,2.614,464,1.734,465,2.179,466,2.774,467,2.815,468,2.938,469,2.633,470,1.747,471,2.484,472,1.76,473,2.815,474,2.774,475,1.684,477,2.137,480,1.722,481,1.734,482,2.331,483,1.696,484,2.247,485,2.122,486,1.734,487,1.801,488,1.722,489,1.734,490,2.633,491,2.633,492,1.734,493,1.624,494,2.153,504,1.747,505,1.747,506,1.747,507,1.747,508,1.734,509,1.386,510,1.494,511,1.747,512,2.297,513,1.734,514,1.747,515,1.747,516,1.747,517,1.747,518,1.747,519,2.349,524,1.734,525,1.747,526,1.801,527,1.76,528,1.747,529,1.747,530,1.747,531,1.76,532,1.76,533,1.76,534,1.801,535,1.747,536,1.747,537,1.76,538,1.76,545,1.76,546,1.546,747,2.683,850,4.475,851,3.863]],["t/296",[1,1.432,7,0.391,14,0.949,27,1.336,50,2.311,55,4.705,58,7.113,60,4.599,64,2.115,67,2.968,94,1.352,95,0.631,99,4.599,102,1.699,104,1.714,116,3.735,118,4.063,124,2.312,130,2.299,141,1.646,146,2.253,149,0.869,158,1.931,160,3.014,187,1.804,189,1.971,202,3.259,205,1.767,209,2.1,215,1.177,223,1.869,224,1.112,231,3.322,275,1.985,276,1.985,277,0.786,299,2.968,302,1.391,304,4.352,314,1.9,321,2.013,323,1.233,328,3.784,402,1.354,428,1.944,429,2.521,434,2.115,443,2.564,453,2.778,462,1.46,465,1.581,477,2.727,485,2.503,493,2.1,494,2.99,497,2.909,501,2.792,546,1.999,547,2.69,549,2.027,551,2.69,552,2.193,553,2.085,554,2.21,555,2.162,564,4.493,600,2.835,612,4.227,622,3.842,659,2.626,739,3.486,749,4.854,750,4.854,753,6.646,767,4.082,788,4.599,830,5.588,851,6.415,875,3.222,1126,5.195,1161,7.113,1163,6.297,1164,4.599,1165,7.113,1252,5.588,1377,4.854,1568,4.854,1569,9.434,1570,9.835,1571,9.976,1572,7.113,1573,9.434,1574,7.113,1575,9.434,1576,7.113,1577,7.113,1578,8.722,1579,7.113,1580,7.113,1581,5.713,1582,7.113,1583,5.713,1584,8.722,1585,5.195,1586,4.854,1587,4.396,1588,5.195,1589,5.713,1590,5.713,1591,5.713,1592,5.713,1593,5.713]],["t/298",[1,0.993,7,0.725,14,0.963,17,0.523,32,4.656,41,1.277,64,1.992,75,2.351,80,0.918,92,1.513,93,2.16,94,1.545,95,1.228,102,1.71,105,0.466,124,2.208,127,3.876,141,1.572,146,2.194,154,2.63,158,1.819,160,3.885,187,1.699,189,1.857,196,1.387,209,1.978,215,1.518,223,1.714,224,1.047,229,4.032,275,1.87,276,1.87,304,3.428,321,1.896,323,1.131,428,1.831,429,2.429,434,1.992,439,1.536,440,1.066,443,4.532,444,1.686,445,1.634,446,2.574,447,2.594,453,2.73,465,1.489,477,2.654,485,2.412,493,1.978,494,2.946,497,2.832,501,2.559,546,1.883,547,2.533,549,1.909,551,2.591,552,2.066,553,1.964,554,2.081,555,2.036,600,1.899,603,1.916,625,3.109,649,6.259,729,5.262,753,6.259,767,3.743,785,3.068,851,5.439,1067,4.032,1252,5.262,1564,3.627,1569,9.182,1570,9.629,1571,9.629,1572,6.698,1573,9.182,1574,6.698,1575,8.403,1576,6.698,1577,6.698,1578,8.403,1579,6.698,1580,6.698,1584,8.403,1585,4.765,1594,7.366]],["t/300",[3,1.102,7,0.566,9,1.737,10,5.517,14,0.981,55,4.356,77,3.357,79,2.385,90,3.076,105,0.881,109,4.106,116,4.733,135,1.931,141,1.524,152,3.29,158,2.039,176,3.076,183,3.706,194,5.038,201,5.553,210,3.134,224,1.174,227,5.151,231,3.076,232,6.954,253,5.553,254,5.716,277,1.136,285,5.072,288,4.106,289,3.502,290,4.226,323,1.782,340,5.716,418,1.931,446,2.496,465,1.669,501,2.171,545,2.403,546,2.715,605,4.576,638,3.58,710,4.836,712,3.257,734,4.576,739,5.038,744,8.551,748,6.109,790,7.017,791,7.017,817,6.874,909,7.017,1038,6.625,1256,7.082,1350,6.109,1595,6.354,1596,6.354,1597,8.258,1598,5.9]],["t/302",[11,5.081,603,3.467,641,6.375]],["t/304",[3,1.011,7,0.719,9,1.594,105,0.933,116,4.343,117,1.974,215,2.162,231,3.908,232,7.441,247,5.673,638,3.944,743,4.798,744,7.323,845,7.323,1038,6.545,1599,8.271]],["t/306",[1,1.146,3,0.945,10,5.238,14,0.998,17,0.604,30,2.629,50,2.511,51,4.753,77,3.456,105,0.756,108,4.005,116,4.815,117,1.599,135,1.987,149,1.121,158,2.098,202,2.758,215,2.078,231,3.166,232,5.565,247,5.302,261,2.689,304,4.327,318,2.128,323,2.176,337,3.86,441,3.492,442,4.231,501,2.234,597,3.956,638,3.685,683,5.565,687,4.35,710,5.905,734,4.71,743,4.484,1038,5.302,1043,7.76,1084,7.73,1134,5.884,1548,7.222,1600,8.5,1601,8.5,1602,10.754,1603,8.5,1604,6.843]],["t/308",[3,0.991,7,0.751,9,1.817,10,4.631,59,5.561,79,2.575,105,1.022,116,4.257,164,2.575,202,3.365,215,2.137,223,3.694,231,3.863,232,6.79,323,1.924,476,4.981,646,3.909,751,6.369,817,5.439,1038,5.561]],["t/310",[3,0.883,7,0.799,9,2.03,12,3.295,13,2.117,29,1.882,32,2.425,55,3.081,59,3.644,79,2.924,80,1.391,84,4.322,90,3.771,94,1.361,102,0.814,105,1.041,116,5.101,117,2.074,130,2.351,135,1.857,149,1.209,150,4.031,152,2.327,164,1.687,195,2.08,201,3.928,202,2.927,213,2.989,223,3.646,224,0.831,231,3.979,232,3.825,243,7.239,259,5.497,267,8.601,269,7.767,277,1.241,288,4.486,289,2.477,292,6.11,298,4.322,300,2.946,302,1.934,304,3.631,310,4.256,311,3.948,323,2.089,400,4.064,402,1.384,404,2.663,417,6.11,419,2.533,453,1.988,476,4.598,508,1.675,510,1.442,555,1.615,586,4.495,605,3.237,641,3.928,692,3.825,693,3.825,713,2.905,734,3.237,743,5.107,744,6.393,747,2.591,750,6.747,751,4.173,752,4.322,755,5.426,787,4.322,788,4.703,817,7.161,830,4.173,881,4.173,910,3.644,915,4.964,937,3.825,1038,5.627,1043,7.79,1063,5.875,1066,4.495,1111,4.401,1134,7.008,1201,4.964,1253,4.703,1421,3.928,1586,6.747,1598,4.173,1605,4.703,1606,9.886,1607,7.666,1608,5.312,1609,7.222,1610,9.497,1611,4.322,1612,5.842,1613,7.666,1614,5.312,1615,5.312,1616,7.941,1617,5.842,1618,5.312,1619,5.312,1620,5.842,1621,5.312,1622,5.842,1623,4.173]],["t/312",[7,0.789,9,2.017,29,1.909,79,2.327,94,1.273,102,1.523,105,1.023,116,4.663,149,0.896,150,2.946,213,4.122,231,3.637,236,6.71,238,7.274,243,5.144,267,9.35,269,8.356,292,6.198,310,4.317,311,4.005,453,2.016,501,2.118,510,1.989,555,2.226,586,6.198,611,6.393,692,5.274,693,5.274,817,6.665,1038,5.025,1063,7.224,1066,6.198,1111,4.464,1201,6.845,1253,6.485,1598,5.755,1606,7.326,1610,9.556,1624,7.326,1625,9.766,1626,6.198,1627,7.326,1628,7.326,1629,5.576]],["t/314",[3,1.009,14,1.093,16,2.97,17,0.744,19,3.204,41,1.571,44,2.808,81,1.811,149,1.165,195,3.232,224,1.291,244,2.151,252,3.485,400,4.646,404,3.044,553,2.421,717,4.579,1546,5.797,1630,9.079,1631,6.717]],["t/316",[0,0.754,3,0.793,7,0.778,9,1.989,14,1.11,17,0.839,20,4.113,29,1.691,30,2.802,31,3.883,32,2.962,53,4.671,54,4.262,55,4.777,75,3.202,83,3.393,95,0.788,105,0.885,110,1.862,135,1.668,149,1.106,150,3.312,154,2.832,155,4.556,223,2.962,226,3.059,244,2.767,261,2.415,299,2.708,302,1.737,317,4.438,318,2.267,337,3.24,404,3.037,406,5.097,409,8.151,410,7.919,425,1.737,465,1.83,510,1.761,562,4.45,563,2.54,597,4.215,616,2.475,623,5.903,625,2.278,631,3.282,646,3.971,665,5.649,681,5.649,713,4.947,1042,5.649,1108,5.744,1109,5.097,1298,4.45,1339,5.49,1342,3.572,1409,5.303,1524,4.671,1549,4.939,1632,5.097,1633,5.49,1634,6.09,1635,5.744,1636,7.135,1637,7.135,1638,5.097]],["t/318",[0,1.118,1,1.425,16,3.014,149,1.175,157,5.505,176,3.937,244,2.184,302,2.244,333,3.708,637,5.505,687,4.715,713,5.256,1074,6.196]],["t/320",[0,1.147,1,1.301,3,1.073,7,0.809,9,1.79,14,1.011,16,2.188,17,0.771,19,3.067,41,1.627,44,2.069,50,1.976,52,3.607,80,1.936,83,2.963,92,1.932,93,2.548,94,1.529,95,1.261,96,3.319,102,1.701,105,0.982,119,2.748,141,1.234,154,1.904,174,3.237,188,3.475,215,1.791,221,2.665,223,2.188,224,1.372,225,3.806,234,2.692,244,2.059,261,2.317,277,1.195,298,7.14,302,2.35,314,2.224,333,2.692,405,2.868,438,3.038,439,1.961,440,1.361,441,2.748,444,2.153,445,2.086,446,2.626,447,2.94,509,1.533,510,2.145,563,2.382,601,3.038,603,2.446,616,2.32,621,3.114,636,2.774,712,2.639,1169,3.237,1340,2.933,1487,3.529,1639,9.291,1640,6.69,1641,4.631]],["t/322",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.451,244,2.196,261,2.828,277,1.275]],["t/324",[9,1.642,83,3.196,102,1.306,105,0.833,224,1.333,225,3.491,244,2.221,277,1.289,510,2.314]],["t/326",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,509,1.996,603,3.185,616,3.021,636,3.266,1340,3.819]],["t/329",[1,1.016,7,0.693,13,1.381,14,0.7,17,0.16,25,1.369,27,0.526,28,2.474,37,2.283,41,1.351,59,1.404,64,1.914,80,1.24,81,1.504,94,0.646,95,0.995,96,3.024,102,1.708,104,2.939,105,0.801,110,1.293,124,1.835,135,1.931,141,0.914,146,2.252,149,1.144,158,1.223,186,2.777,187,1.143,189,0.96,195,1.763,196,2.386,202,1.607,205,0.696,209,1.023,215,1.812,224,1.333,229,1.732,260,1.608,270,3.001,275,1.257,276,1.257,277,1.136,285,1.152,288,1.119,298,3.664,318,2.575,321,1.275,322,2.352,323,1.844,324,1.226,328,4.679,402,1.957,407,2.202,412,2.35,415,1.527,418,2.192,425,1.206,428,1.231,429,1.861,434,1.34,437,2.468,440,1.008,448,3.015,449,2.744,450,2.744,451,2.744,452,2.744,453,2.875,454,2.721,455,1.942,456,2.583,457,1.42,458,2.422,459,2.368,460,2.35,461,1.42,462,2.303,463,2.35,464,1.42,465,2.109,466,2.546,467,2.583,468,2.95,469,2.368,470,1.431,471,2.578,472,1.441,473,2.583,474,2.546,475,2.509,477,2.506,479,2.642,480,1.41,481,1.42,482,2.029,483,1.389,484,1.956,485,2.352,486,1.42,487,1.474,488,1.41,489,1.42,490,2.368,491,2.368,492,1.42,493,1.901,494,2.523,497,2.527,501,1.861,504,1.431,505,1.431,506,1.431,507,1.431,508,1.42,509,1.135,510,1.609,511,1.431,512,2,513,1.42,514,1.431,515,1.431,516,1.431,517,1.431,518,1.431,519,2.044,524,1.42,525,1.431,526,1.474,527,1.441,528,1.431,529,1.431,530,1.431,531,1.441,532,1.441,533,1.441,534,1.474,535,1.431,536,1.431,537,1.441,538,1.441,545,2.486,546,2.352,547,1.31,549,1.284,551,1.985,552,1.389,553,1.321,554,1.399,555,1.369,558,2.931,600,1.795,665,4.415,683,1.473,740,3.677,854,1.463,864,0.675,875,1.269,919,1.665,1019,1.795,1400,1.486,1401,3.482,1486,5.248,1492,1.845,1493,1.845,1494,1.845,1495,2.151,1499,1.845,1500,2.636,1501,2.151,1502,1.845,1503,2.171,1506,1.845,1507,1.845,1508,2.151,1512,2.191,1526,8.671,1528,4.952,1530,5.3,1533,5.3,1534,1.119,1642,3.811,1643,4.034,1644,4.209,1645,4.953,1646,4.209,1647,4.034,1648,3.237,1649,1.812,1650,1.404,1651,2.251,1652,2.251,1653,5.539,1654,3.81,1655,2.251,1656,2.251,1657,2.251,1658,2.251]],["t/331",[1,1.339,3,0.921,7,0.773,51,3.906,80,1.976,81,1.981,94,1.295,95,1.174,102,1.627,104,2.485,105,0.883,108,3.699,125,5.572,149,0.921,150,3.03,157,4.95,195,3.536,197,4.24,202,2.688,210,3.144,215,2.047,228,6.671,229,6.375,289,3.514,302,2.018,304,4.281,333,3.334,358,6.13,404,2.778,418,2.322,474,2.341,546,2.118,600,3.003,612,6.13,634,3.675,637,4.95,638,3.592,662,3.855,701,6.671,713,4.12,1515,6.635,1516,6.195,1582,7.535,1623,5.919,1639,7.535,1659,5.919]],["t/333",[0,1.109,1,1.491,3,1.166,16,2.975,80,1.594,104,2.728,117,1.711,176,4.119,186,2.645,202,3.404,244,2.155,252,3.024,277,1.521,669,5.549,1660,5.326]],["t/335",[3,1.013,14,1.039,17,0.746,80,1.597,149,1.264,150,3.841,252,3.493,356,5.966,553,2.43,597,4.241,681,5.684,1638,7.504,1661,6.034,1662,4.965,1663,8.287]],["t/337",[14,1.117,17,0.802,249,4.554,261,3.009,302,2.749,310,4.769,311,4.425,404,3.784,409,7.813,410,7.59,465,2.281,709,6.583,1014,5.984]],["t/339",[14,0.927,17,0.666,261,2.499,302,2.282,404,3.142,409,6.487,410,6.302,465,1.894,706,6.136]],["t/341",[3,1.022,14,0.91,16,3.008,17,0.75,149,1.235,195,3.274,244,2.18,252,3.511,404,3.084,553,2.452,597,5.17,623,5.956]],["t/343",[0,1.228,7,0.748,17,0.799,75,3.958,105,0.971,133,4.468,154,2.51,244,2.667,301,6.105,371,5.214,389,4.157,409,7.791,410,7.568,563,3.14,659,4.054,680,4.805,1664,5.774,1665,6.3]],["t/345",[3,0.923,7,0.773,9,2.029,16,2.715,17,0.589,29,2.356,45,4.015,75,3.725,77,3.374,80,1.454,81,1.656,83,2.83,90,3.091,105,0.738,115,5.581,147,4.07,149,1.227,154,2.829,159,4.07,201,5.581,224,1.18,234,3.34,285,4.247,292,6.386,310,4.448,311,4.127,312,4.81,318,2.489,329,6.386,356,5.434,371,3.963,402,1.967,597,3.863,623,6.224,625,2.65,646,4.36,714,5.581,716,6.386,1124,7.548,1134,5.745,1135,5.3,1253,6.682,1298,5.177,1638,5.929,1666,7.355,1667,5.3,1668,7.548,1669,9.041,1670,7.65,1671,8.3,1672,6.682,1673,8.3,1674,5.929]],["t/347",[0,1.098,1,1.263,3,1.042,7,0.803,9,1.103,10,3.271,13,2.282,14,0.927,16,2.06,17,0.737,19,2.947,29,2.461,41,1.556,44,2.899,50,1.86,52,3.467,57,4.905,80,1.463,83,2.147,90,2.345,92,1.819,93,2.449,94,1.518,95,1.29,102,1.697,105,0.995,118,4.338,119,3.431,135,1.472,141,1.162,149,0.7,154,2.84,174,3.046,188,3.271,200,3.322,205,1.948,215,1.298,221,2.509,223,2.06,224,1.187,225,3.49,234,2.534,244,1.492,277,0.866,279,4.212,300,4.212,302,2.529,312,3.046,314,2.094,319,3.541,320,4.628,333,2.534,337,4.532,404,2.8,419,2.73,438,2.86,439,1.846,440,1.281,444,2.027,445,1.963,446,2.524,447,2.544,509,1.443,603,2.303,616,2.184,621,2.931,625,3.608,636,2.666,656,4.122,659,2.895,660,4.845,663,6.723,687,3.222,714,5.616,716,4.845,1018,3.322,1078,3.489,1135,4.021,1169,3.046,1279,4.498,1340,2.761,1515,5.209,1516,3.928,1675,6.297,1676,5.333,1677,4.234]],["t/349",[7,0.638,9,1.633,10,4.841,83,3.178,102,1.299,154,3.028,205,2.883,224,1.325,225,3.471,244,2.208,277,1.282]],["t/351",[0,1.178,1,1.364,3,0.95,7,0.763,14,1.001,17,0.718,41,1.615,44,2.643,50,2.524,52,4.199,90,3.182,94,1.452,95,1.23,105,1.025,118,5.254,141,1.577,149,0.95,154,2.432,221,3.404,234,3.438,300,4.309,302,2.624,314,2.841,333,3.438,509,1.958,603,3.125,616,2.963,636,3.23,659,3.928,714,6.802,716,6.574,1340,3.747]],["t/353",[0,0.318,1,0.405,3,0.334,7,0.685,9,1.219,14,0.755,17,0.542,25,1.337,27,2.004,29,2.112,37,2.253,41,1.336,51,1.416,57,1.333,64,1.308,79,1.397,81,1.388,90,1.119,94,0.631,95,1.042,102,1.705,105,0.84,110,1.263,117,1.777,120,3.333,124,1.254,135,1.906,141,0.893,146,2.052,149,1.153,152,1.197,158,1.718,164,1.397,186,2.764,187,1.116,189,1.219,195,1.07,196,2.36,209,1.299,210,1.14,215,1.766,224,1.308,259,2.08,270,2.988,275,1.228,276,1.228,277,1.121,279,1.515,293,3.308,297,1.649,312,2.34,318,2.596,319,3.353,320,4.517,321,1.245,322,2.327,323,1.924,337,1.365,400,1.538,402,2.031,407,2.173,412,2.319,415,1.502,418,2.151,425,1.178,428,1.202,429,1.829,434,1.308,437,2.575,440,0.984,448,2.994,449,2.715,450,2.715,451,2.715,452,2.715,453,2.867,454,2.702,455,2.236,456,2.556,457,1.387,458,2.39,459,2.337,460,2.319,461,1.387,462,2.278,463,2.319,464,1.387,465,2.096,466,2.518,467,2.556,468,2.973,469,2.337,470,1.397,471,2.554,472,1.408,473,2.556,474,2.518,475,2.482,477,2.483,479,2.769,480,1.377,481,1.387,482,1.995,483,1.356,484,1.923,485,2.127,486,1.387,487,1.44,488,1.377,489,1.387,490,2.337,491,2.337,492,1.387,493,1.299,494,2.5,497,2.286,501,2.343,504,1.397,505,1.397,506,1.397,507,1.397,508,1.387,509,1.108,510,1.194,511,1.397,512,1.966,513,1.387,514,1.397,515,1.397,516,1.397,517,1.397,518,1.397,519,2.01,524,1.387,525,1.397,526,1.44,527,1.408,528,1.397,529,1.397,530,1.397,531,1.408,532,1.408,533,1.408,534,1.44,535,1.397,536,1.397,537,1.408,538,1.408,545,2.594,546,2.414,549,1.254,551,1.951,552,1.356,553,1.29,554,1.366,555,1.337,623,4.302,643,2.088,692,1.967,693,1.967,712,1.185,740,2.728,741,3.089,785,1.76,852,1.737,853,2.5,854,1.429,855,2.928,856,1.753,857,1.753,858,2.522,862,1.753,863,1.753,864,1.451,865,2.922,866,1.753,1018,5.188,1111,1.665,1135,3.089,1400,1.451,1404,1.769,1408,2.312,1487,1.585,1513,3.089,1515,3.017,1516,5.084,1517,2.021,1632,2.147,1659,2.147,1667,1.919,1676,4.444,1677,5.481,1678,3.089,1679,2.733,1680,2.147,1681,2.733,1682,2.419]],["t/355",[0,0.795,1,1.013,7,0.797,9,1.317,14,0.744,17,0.724,27,2.188,29,2.6,41,1.527,57,4.52,90,2.799,92,2.171,93,2.744,94,1.526,95,1.276,102,1.706,141,1.387,176,2.799,205,2.895,210,2.852,211,4.095,224,1.069,319,3.475,320,4.165,439,2.203,440,1.529,444,2.419,445,2.343,446,2.828,447,3.104,623,6.309,625,3.405,643,2.584,656,4.92,734,4.165,747,3.334]],["t/357",[0,0.781,7,0.8,13,2.679,17,0.525,20,3.357,29,2.397,41,1.516,57,4.486,92,2.135,93,2.715,94,1.513,95,1.273,102,1.708,118,3.839,149,0.822,159,3.625,210,2.805,224,1.051,319,3.723,320,4.096,323,1.595,361,3.961,402,1.752,439,2.167,440,1.504,444,2.379,445,2.304,446,2.799,447,3.08,623,6.446,625,3.385,629,2.832,636,2.36,656,4.839,714,4.97,715,3.675,716,5.687,718,6.722,741,4.72,1632,5.281,1683,5.687]],["t/359",[0,0.518,1,0.872,3,0.247,7,0.669,9,1.231,13,1.777,14,0.78,17,0.532,25,1.355,27,1.643,29,2.014,37,2.27,41,1.344,64,1.562,79,1.088,81,1.402,94,0.639,95,1.012,102,1.706,104,2.247,105,0.83,109,1.104,110,1.28,117,1.724,120,2.48,123,3.231,124,1.497,130,0.893,135,1.92,141,0.905,146,2.146,149,1.172,158,1.597,164,1.088,186,2.772,187,1.131,189,1.236,196,2.375,205,0.687,209,1.317,210,1.429,211,2.052,215,1.693,224,1.275,259,2.607,261,0.592,270,2.995,275,1.245,276,1.245,277,1.13,279,3.544,293,1.21,297,1.284,299,0.843,304,0.893,307,1.403,318,2.605,319,3.125,320,4.151,321,1.262,322,2.341,323,1.936,344,2.298,371,1.06,400,2.509,402,1.946,407,2.19,412,2.337,415,1.517,418,2.183,419,0.963,425,1.194,428,1.219,429,1.847,434,1.326,437,2.591,440,0.998,448,3.006,449,2.732,450,2.732,451,2.732,452,2.732,453,2.872,454,2.713,455,2.162,456,2.572,457,1.406,458,2.408,459,2.355,460,2.337,461,1.406,462,2.293,463,2.337,464,1.406,465,2.103,466,2.534,467,2.572,468,2.984,469,2.355,470,1.416,471,2.568,472,1.427,473,2.572,474,2.534,475,2.497,476,1.008,477,2.496,479,2.738,480,1.396,481,1.406,482,2.015,483,1.375,484,1.942,485,2.219,486,1.406,487,1.46,488,1.396,489,1.406,490,2.355,491,2.355,492,1.406,493,1.551,494,2.514,497,2.384,501,2.358,504,1.416,505,1.416,506,1.416,507,1.416,508,1.406,509,1.124,510,1.211,511,1.416,512,1.985,513,1.656,514,1.416,515,1.416,516,1.416,517,1.416,518,1.416,519,2.03,524,1.406,525,1.416,526,1.46,527,1.427,528,1.416,529,1.416,530,1.416,531,1.427,532,1.427,533,1.427,534,1.46,535,1.416,536,1.416,537,1.427,538,1.427,545,2.61,546,2.427,547,0.763,549,1.271,551,1.971,552,1.375,553,1.307,554,1.385,555,1.355,601,1.008,614,1.454,623,5.267,624,1.23,638,0.963,643,1.987,654,1.21,692,1.454,693,1.454,694,1.326,740,2.124,741,2.405,747,0.985,785,2.205,852,1.353,853,2.075,854,1.449,855,2.524,856,1.365,857,1.365,858,2.094,862,1.365,863,1.365,864,1.471,865,1.443,866,1.365,1018,5.083,1019,0.805,1078,2.087,1111,2.718,1354,1.275,1400,1.471,1404,1.377,1492,0.827,1493,0.827,1494,0.827,1495,0.819,1499,0.827,1500,1.403,1501,0.819,1502,0.827,1503,0.827,1506,0.827,1507,0.827,1508,0.819,1512,0.835,1513,3.131,1515,3.059,1516,4.383,1517,1.493,1518,1.798,1632,1.586,1650,1.385,1676,5.852,1677,5.523,1678,2.405,1679,2.019,1680,2.69,1681,2.019,1684,1.886,1685,2.22,1686,2.019,1687,2.22,1688,2.22,1689,1.886,1690,2.22,1691,2.22,1692,2.22,1693,2.22,1694,2.019]],["t/361",[3,1.164,9,1.834,17,0.806,80,1.588,117,1.705,244,2.617,252,3.013,272,5.206,277,1.561,404,3.511,415,2.259,510,2.585,562,5.653]],["t/363",[0,1.15,1,1.382,13,3.168,16,2.859,27,2.044,29,2.43,44,2.704,81,2.045,95,1.263,96,3.526,115,5.878,149,0.972,195,3.112,197,5.246,244,2.071,261,2.734,319,3.496,326,3.748,600,3.168,601,3.97,624,4.844,625,2.791,637,5.222,638,3.79,680,5.586,691,4.473,1611,6.467,1664,5.723,1695,7.949,1696,7.037,1697,8.741,1698,6.245,1699,8.741]],["t/365",[0,1.135,1,1.329,3,1.096,7,0.805,9,1.225,10,3.632,14,0.975,16,2.287,17,0.762,19,3.156,29,2.544,41,1.609,44,3.049,50,2.066,52,3.712,80,1.567,83,2.384,92,2.02,93,2.622,94,1.51,95,1.248,96,3.573,102,1.692,105,0.976,106,3.632,119,3.673,133,3.032,141,1.29,154,2.957,174,3.383,188,3.632,200,3.689,205,2.163,215,1.441,221,2.786,223,2.287,224,1.271,225,3.672,234,2.814,244,1.657,277,0.962,300,3.527,302,2.615,314,2.325,319,3.745,333,2.814,404,2.345,405,2.998,438,3.176,439,2.05,440,1.423,444,2.251,445,2.18,446,2.114,447,2.723,509,1.602,603,2.557,616,2.426,620,4.578,621,3.255,636,2.855,687,3.579,1135,4.465,1169,3.383,1340,3.067,1700,6.994,1701,3.632,1702,4.703]],["t/367",[7,0.638,9,1.633,10,4.841,83,3.178,102,1.299,154,3.028,205,2.883,224,1.325,225,3.471,244,2.208,277,1.282]],["t/369",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,509,1.996,603,3.185,616,3.021,636,3.266,1340,3.819]],["t/371",[0,0.953,1,1.215,7,0.617,11,4.83,28,3.42,29,2.611,51,4.248,90,4.104,94,1.175,96,3.589,200,4.754,224,1.281,261,2.403,319,3.559,320,4.994,324,4.91,600,3.266,601,4.093,636,2.877,643,3.589,712,3.555,1703,9.013,1704,6.439]],["t/373",[0,1.137,1,1.038,7,0.789,14,0.94,17,0.732,29,2.667,41,1.544,51,3.631,80,1.35,90,2.869,92,2.225,93,2.786,94,1.467,95,1.187,96,3.921,102,1.703,133,3.34,197,4.862,261,2.054,304,3.1,314,2.561,319,3.928,322,2.011,389,3.631,439,2.259,440,1.567,444,2.479,445,2.402,446,2.328,447,2.894,629,2.951,630,2.951,631,2.792,634,3.417,680,4.197,691,3.942,734,4.269,1705,7.005]],["t/375",[0,0.705,1,0.898,3,0.507,7,0.66,13,1.652,14,0.659,17,0.324,25,1.259,27,1.842,37,2.177,41,1.299,64,1.232,79,1.316,80,1.168,81,1.572,94,0.594,95,1.018,96,3.508,102,1.702,105,0.857,106,5.004,109,2.266,110,1.189,117,1.735,120,3.255,124,1.181,130,1.834,135,1.842,141,0.841,146,2.004,149,1.176,158,1.645,164,1.316,186,2.733,187,1.051,189,1.149,196,2.295,209,1.224,210,2.529,215,1.624,224,1.233,261,1.215,270,2.953,275,1.157,276,1.157,277,1.084,288,2.266,297,1.554,318,2.554,319,1.554,321,1.173,322,2.263,323,1.871,371,2.176,402,1.867,407,2.101,412,2.242,415,1.438,418,2.027,419,1.976,425,1.11,428,1.133,429,1.752,434,1.232,437,2.504,440,0.927,448,2.94,449,2.64,450,2.64,451,2.64,452,2.64,453,2.845,454,2.653,455,2.162,456,2.485,457,1.306,458,2.31,459,2.259,460,2.242,461,1.306,462,2.215,463,2.242,464,1.306,465,2.062,466,2.449,467,2.485,468,2.925,469,2.259,470,1.316,471,2.494,472,1.326,473,2.485,474,2.449,475,2.413,476,3.027,477,2.424,479,2.704,480,1.297,481,1.306,482,1.911,483,1.278,484,1.842,485,2.056,486,1.306,487,1.356,488,1.297,489,1.306,490,2.259,491,2.259,492,1.306,493,1.224,494,2.442,497,2.209,501,2.279,504,1.316,505,1.316,506,1.316,507,1.316,508,1.306,509,1.044,510,1.125,511,1.316,512,1.883,513,1.306,514,1.316,515,1.316,516,1.316,517,1.316,518,1.316,519,1.925,524,1.306,525,1.316,526,1.356,527,1.326,528,1.316,529,1.316,530,1.316,531,1.326,532,1.326,533,1.326,534,1.356,535,1.316,536,1.316,537,1.326,538,1.326,545,2.522,546,2.357,549,1.181,551,1.869,552,1.278,553,1.215,554,1.287,555,1.259,624,2.525,638,1.976,643,1.567,708,4.144,747,2.021,848,2.618,852,1.637,853,2.394,854,1.346,855,2.83,856,1.652,857,1.652,858,2.415,862,1.652,863,1.652,864,1.367,865,2.553,866,1.652,1078,2.525,1400,1.367,1401,2.722,1404,1.667,1419,2.78,1420,3.064,1650,2.842,1701,4.092,1702,6.998,1706,2.78,1707,3.256,1708,4.144,1709,3.872]],["t/377",[0,0.956,17,0.743,80,1.585,96,3.111,117,1.702,142,5.196,149,1.006,249,5.352,252,3.008,277,1.518,310,5.606,311,5.2,319,3.084,402,2.479,441,3.716,442,3.795,643,3.597,680,4.928,1343,5.776,1710,4.108]],["t/380",[1,1.154,3,0.951,7,0.779,9,1.5,27,2.001,30,3.132,36,7.783,44,3.519,75,3.841,81,1.707,83,3.453,90,3.188,94,1.116,95,1.19,96,2.943,105,0.959,133,3.711,149,1.199,154,2.882,302,2.466,323,1.847,600,3.102,643,2.943,659,4.958,683,5.603,873,5.603,875,4.828,1302,6.586,1330,7.272,1354,4.917,1488,5.924,1490,7.783,1491,7.272,1632,6.115,1711,8.559,1712,8.559,1713,8.559,1714,8.559,1715,8.559]],["t/382",[0,0.655,1,0.557,3,0.459,6,1.877,7,0.743,14,0.736,17,0.528,25,1.142,27,1.739,29,1.763,37,2.056,41,1.394,64,1.118,79,1.194,80,1.086,81,1.237,92,1.194,93,1.818,94,1.347,95,1.197,102,1.707,105,0.857,108,3.591,110,1.079,117,1.749,120,3.281,124,1.071,135,1.739,141,1.144,146,1.924,149,1.103,158,1.53,164,1.194,186,2.678,187,0.953,189,1.042,196,2.188,202,1.341,209,1.11,210,1.568,215,1.703,224,1.175,231,1.539,270,2.895,275,1.049,276,1.049,277,1.023,297,1.409,299,1.568,318,2.482,321,1.064,322,2.157,323,1.784,402,1.959,407,1.983,412,2.117,415,1.338,418,2.07,425,1.006,428,1.027,429,1.63,434,1.118,437,2.387,438,1.877,439,1.212,440,1.261,441,4.365,444,1.33,445,1.289,446,1.874,447,1.888,448,2.848,449,2.517,450,2.517,451,2.517,452,2.517,453,2.807,454,2.571,455,2.041,456,2.37,457,1.185,458,2.181,459,2.133,460,2.117,461,1.185,462,2.112,463,2.117,464,1.185,465,2.004,466,2.335,467,2.37,468,2.843,469,2.133,470,1.194,471,2.395,472,1.203,473,2.37,474,2.335,475,2.301,477,2.328,479,2.596,480,1.176,481,1.185,482,1.777,483,1.159,484,1.713,485,1.942,486,1.185,487,1.23,488,1.176,489,1.185,490,2.133,491,2.133,492,1.185,493,1.11,494,2.344,497,2.086,501,2.173,504,1.194,505,1.194,506,1.194,507,1.194,508,1.185,509,0.947,510,1.02,511,1.194,512,1.751,513,1.185,514,1.194,515,1.194,516,1.194,517,1.194,518,1.194,519,1.791,524,1.185,525,1.194,526,1.23,527,1.203,528,1.194,529,1.194,530,1.194,531,1.203,532,1.203,533,1.203,534,1.23,535,1.194,536,1.194,537,1.203,538,1.203,545,2.405,546,2.263,549,1.071,551,1.738,552,1.159,553,1.102,554,1.168,555,1.142,625,3.078,659,3.8,662,2.696,852,1.485,853,2.227,854,1.221,855,2.672,856,1.498,857,1.498,858,2.247,859,1.716,860,2.469,862,1.498,863,1.498,864,1.24,865,2.375,866,1.498,1298,4.64,1400,1.24,1404,1.511,1550,5.797,1551,3.512,1564,2.861,1716,4.77,1717,3.058,1718,4.133,1719,9.019,1720,3.058,1721,4.133,1722,4.133]],["t/384",[0,0.754,7,0.796,14,0.706,17,0.643,29,2.146,41,1.357,67,3.706,75,3.202,80,1.25,81,1.423,92,2.061,93,2.655,94,1.514,95,1.219,102,1.709,106,3.706,152,2.842,154,2.03,195,2.54,202,2.315,203,5.525,215,1.47,402,2.146,439,2.092,440,1.451,441,4.299,442,4.532,444,2.296,445,2.224,446,2.156,447,2.758,476,3.24,501,2.381,564,4.099,625,2.892,629,2.733,630,3.812,631,2.586,659,4.966,710,4.178,714,4.798,1097,7.695,1216,5.744,1397,5.097,1550,5.929,1551,7.695,1564,4.939,1719,6.488,1723,7.291,1724,8.454,1725,9.951,1726,7.135]],["t/386",[0,1.2,1,1.016,3,0.838,6,3.424,7,0.809,14,0.928,17,0.666,44,2.332,67,4.87,80,1.321,90,4.169,94,1.222,95,1.266,105,1.041,116,3.599,117,1.764,146,1.638,149,0.838,197,5.619,202,3.042,231,2.808,261,2.01,288,3.748,289,3.197,300,4.728,302,1.836,323,2.304,402,2.418,403,4.599,404,2.528,560,4.178,563,3.633,597,3.509,600,2.732,601,4.258,605,4.178,625,2.407,630,3.592,636,2.993,659,4.908,664,3.129,680,4.107,682,5.386,691,3.857,710,5.49,714,6.304,798,6.49,875,4.252,937,4.935,1024,5.386,1036,4.935,1097,9.33,1108,6.069,1216,6.069,1346,5.8,1588,6.855,1607,6.405,1667,4.814,1723,8.215,1724,7.966,1727,7.539,1728,6.855,1729,6.405]],["t/388",[7,0.63,9,1.611,30,2.845,80,1.611,154,3.005,155,5.873,205,3.267,252,3.058,277,1.528,326,4.528,402,2.18,561,5.097,659,4.854]],["t/390",[3,0.93,7,0.732,9,1.751,14,0.989,16,2.738,17,0.786,27,1.957,30,3.091,41,1.255,55,4.415,57,4.432,81,1.67,83,2.854,94,1.091,95,0.924,105,0.888,115,5.629,149,1.188,150,3.654,244,1.983,261,2.664,302,2.038,317,4.803,323,1.806,371,5.399,501,2.627,597,3.896,715,4.969,790,7.112,910,5.221,1063,6.192,1628,7.612,1634,7.441,1682,6.738,1730,9.087,1731,8.37,1732,6.738,1733,7.612,1734,7.612,1735,7.112,1736,7.112]],["t/392",[0,1.047,3,1,7,0.79,9,1.735,10,3.669,13,2.56,14,0.699,16,2.31,17,0.765,19,3.495,27,1.651,28,3.758,30,2.185,41,1.349,50,2.087,80,1.577,83,2.408,92,2.04,93,2.638,94,1.491,95,1.151,96,3.406,102,1.699,105,0.927,115,4.75,119,2.901,135,1.651,154,2.561,174,3.417,188,3.669,205,2.185,211,3.848,215,1.456,223,2.31,224,1.408,225,3.884,226,3.029,244,2.133,261,1.883,272,4.474,277,1.238,285,3.614,302,1.72,317,2.901,319,3.672,320,5.488,371,3.373,404,3.321,415,1.942,439,2.071,440,1.437,444,2.273,445,2.202,446,2.135,447,2.741,448,2.087,621,3.288,629,2.706,630,2.706,631,2.56,654,3.848,1056,6.002,1078,3.914,1169,3.417,1279,5.046,1349,4.136,1737,7.968,1738,8.287,1739,5.046]],["t/394",[7,0.725,9,1.617,28,4.016,94,1.203,215,1.903,320,5.864,371,4.408,404,3.095,654,5.03,1737,7.829,1738,8.143,1739,6.595]],["t/396",[7,0.638,9,1.633,10,4.841,83,3.178,102,1.299,154,3.028,205,2.883,224,1.325,225,3.471,244,2.208,277,1.282]],["t/398",[0,1.122,50,2.743,102,1.294,105,0.944,224,1.32,225,3.458,226,3.981,244,2.2,261,2.475,277,1.277,285,4.751,1349,5.436]],["t/400",[3,1.052,19,3.339,272,4.705,415,2.042]],["t/402",[0,0.991,1,1.264,7,0.778,9,1.321,14,1.01,16,2.466,17,0.78,27,2.496,28,3.558,30,3.303,51,3.553,80,1.321,90,2.808,94,0.983,96,3.509,116,3.599,117,1.418,133,3.268,149,1.187,152,3.003,176,2.808,195,2.684,205,2.332,211,5.108,213,3.857,215,1.932,216,4.331,224,1.072,226,3.232,231,2.808,261,2.721,284,3.916,293,5.108,315,5.069,317,4.833,319,2.57,320,5.196,326,4.02,344,4.599,400,3.857,404,2.528,418,1.762,546,1.927,553,2.721,600,2.732,601,3.424,662,2.732,712,2.974,872,6.069,902,5.218,937,4.935,1333,9.28,1342,3.698,1564,5.218,1634,5.069,1661,4.331,1670,8.215,1737,8.615,1738,8.613,1740,7.966,1741,9.709,1742,8.526,1743,7.966,1744,3.857,1745,5.218]],["t/404",[0,0.762,1,0.972,7,0.792,14,0.713,17,0.647,41,1.498,44,2.23,90,3.395,92,2.082,93,2.673,94,1.537,95,1.284,96,3.438,102,1.708,133,3.125,146,1.98,187,1.663,205,2.23,211,3.927,215,1.486,261,1.922,304,3.668,314,2.397,317,4.617,319,3.695,322,1.881,439,2.113,440,1.466,444,2.32,445,2.247,446,2.755,447,3.045,629,2.761,630,2.761,631,2.612,643,2.479,734,3.994,1046,6.555,1635,5.803,1737,6.744,1738,7.014,1746,10.065,1747,9.116]],["t/406",[0,0.306,1,0.797,7,0.654,14,0.673,17,0.42,25,1.296,27,1.382,37,2.213,41,1.317,64,1.599,79,0.835,80,0.821,81,1.357,94,0.771,95,1.053,96,3.402,102,1.706,104,2.635,105,0.848,108,3.381,110,1.224,117,1.407,120,2.639,124,1.533,133,4.289,135,1.872,141,1.091,146,2.149,149,1.143,158,1.46,164,0.835,186,2.748,187,1.081,189,1.182,196,2.326,209,1.588,215,1.65,224,1.249,270,2.97,275,1.19,276,1.19,277,1.101,293,1.575,297,0.986,307,1.746,317,4.176,318,2.574,321,1.206,322,2.293,323,1.896,326,4.564,402,1.897,407,2.135,412,2.279,415,1.468,418,2.122,425,1.142,428,1.165,429,1.788,434,1.268,437,2.537,440,0.954,448,2.965,449,2.676,450,2.676,451,2.676,452,2.676,453,2.856,454,2.676,455,2.052,456,2.519,457,1.344,458,2.348,459,2.296,460,2.279,461,1.344,462,2.245,463,2.279,464,1.344,465,2.078,466,2.482,467,2.519,468,2.948,469,2.296,470,1.354,471,2.523,472,1.364,473,2.519,474,2.482,475,2.446,477,2.452,479,2.662,480,1.334,481,1.344,482,1.95,483,1.315,484,1.88,485,2.201,486,1.344,487,1.395,488,1.334,489,1.344,490,2.296,491,2.296,492,1.344,493,1.588,494,2.469,497,2.365,501,2.105,504,1.354,505,1.354,506,1.354,507,1.354,508,1.344,509,1.074,510,1.157,511,1.354,512,1.922,513,1.344,514,1.354,515,1.354,516,1.354,517,1.354,518,1.354,519,1.965,524,1.344,525,1.354,526,1.395,527,1.364,528,1.354,529,1.354,530,1.354,531,1.364,532,1.364,533,1.364,534,1.395,535,1.354,536,1.354,537,1.364,538,1.364,545,2.556,546,2.384,547,1.612,549,1.215,551,1.908,552,1.315,553,1.25,554,1.324,555,1.296,625,0.923,662,3.057,739,1.763,785,1.693,852,1.038,853,1.684,854,1.385,855,2.124,856,1.048,857,1.048,858,1.699,859,1.946,862,1.048,863,1.048,864,1.774,865,1.796,866,1.048,1019,1.048,1029,1.437,1400,1.406,1404,1.057,1492,1.077,1493,1.077,1494,1.077,1495,1.067,1496,1.437,1499,1.077,1500,1.746,1501,1.067,1502,1.077,1503,1.746,1506,1.077,1507,1.077,1508,1.067,1512,1.087,1670,7.486,1744,4.316,1746,8.848,1748,2.89,1749,8.848,1750,3.776,1751,4.688,1752,4.263,1753,2.001,1754,5.914,1755,5.914,1756,1.846,1757,2.89,1758,2.89,1759,4.688,1760,4.688,1761,2.001,1762,2.89]],["t/408",[1,0.825,7,0.758,14,0.605,17,0.434,25,1.123,28,3.335,37,2.034,41,1.228,64,1.655,81,1.22,90,1.513,94,0.529,95,1.02,96,3.393,102,1.702,104,2.959,105,0.821,110,1.06,124,1.586,133,4.459,135,1.721,141,1.129,146,2.143,149,1.097,158,1.003,186,2.668,187,0.937,189,1.024,196,2.169,209,1.643,214,3.451,215,1.517,224,1.25,270,2.884,275,1.031,276,1.031,277,1.012,317,4.348,318,2.469,319,2.51,320,4.871,321,1.045,322,2.139,323,1.897,326,3.768,402,1.744,407,1.963,412,2.095,415,1.32,418,1.915,425,0.989,428,1.01,429,1.608,434,1.098,437,2.366,440,0.826,448,2.832,449,2.495,450,2.495,451,2.495,452,2.495,453,2.8,454,2.556,455,1.679,456,2.349,457,1.164,458,2.158,459,2.11,460,2.095,461,1.164,462,2.094,463,2.095,464,1.164,465,1.994,466,2.314,467,2.349,468,2.828,469,2.11,470,1.173,471,2.377,472,1.182,473,2.349,474,2.314,475,2.281,477,2.31,479,2.402,480,1.156,481,1.164,482,1.754,483,1.139,484,1.691,485,2.139,486,1.164,487,1.209,488,1.156,489,1.164,490,2.11,491,2.11,492,1.164,493,1.643,494,2.327,497,2.298,501,1.608,504,1.173,505,1.173,506,1.173,507,1.173,508,1.164,509,0.931,510,1.003,511,1.173,512,1.728,513,1.164,514,1.173,515,1.173,516,1.173,517,1.173,518,1.173,519,1.767,524,1.164,525,1.173,526,1.209,527,1.182,528,1.173,529,1.173,530,1.173,531,1.182,532,1.182,533,1.182,534,1.209,535,1.173,536,1.173,537,1.182,538,1.182,545,2.384,546,2.246,547,2.104,549,1.053,551,1.716,552,1.139,553,1.083,554,1.147,555,1.123,625,1.297,854,1.2,864,1.835,875,2.291,1019,1.472,1111,2.251,1400,1.218,1401,2.426,1492,1.513,1493,1.513,1494,1.513,1495,1.499,1499,1.513,1500,2.279,1501,1.499,1502,1.513,1503,2.279,1506,1.513,1507,1.513,1508,1.499,1512,1.527,1643,2.811,1647,2.811,1670,7.914,1678,2.593,1737,8.128,1738,7.914,1740,3.451,1741,9.353,1749,8.4,1752,5.564,1763,3.694,1764,4.062,1765,9.237,1766,9.736,1767,9.237,1768,3.125,1769,6.119,1770,6.119,1771,5.564,1772,7.361,1773,4.062,1774,4.062,1775,4.062,1776,3.125,1777,6.119]],["t/410",[7,0.637,14,0.67,17,0.566,25,1.287,27,1.865,37,2.204,41,1.312,64,1.259,79,1.345,81,1.35,94,0.607,95,1.027,102,1.703,105,0.827,108,3.615,110,1.215,117,1.75,120,3.283,124,1.207,135,1.865,141,0.859,146,2.021,149,1.141,158,1.671,164,1.345,186,2.744,187,1.074,189,1.174,196,2.318,209,1.25,215,1.644,224,1.323,270,2.966,275,1.182,276,1.182,277,1.097,284,2.418,297,1.588,318,2.569,319,3.31,321,1.198,322,2.286,323,1.89,344,4.13,400,3.464,402,1.89,407,2.127,412,2.27,415,1.461,418,2.047,425,1.134,428,1.157,429,1.779,434,1.259,437,2.529,440,0.947,448,2.959,449,2.667,450,2.667,451,2.667,452,2.667,453,2.853,454,2.671,455,2.189,456,2.511,457,1.335,458,2.339,459,2.287,460,2.27,461,1.335,462,2.238,463,2.27,464,1.335,465,2.074,466,2.474,467,2.511,468,2.942,469,2.287,470,1.345,471,2.516,472,1.355,473,2.511,474,2.474,475,2.438,477,2.445,479,2.728,480,1.325,481,1.335,482,1.941,483,1.306,484,1.871,485,2.082,486,1.335,487,1.386,488,1.325,489,1.335,490,2.287,491,2.287,492,1.335,493,1.25,494,2.463,497,2.237,501,2.302,504,1.345,505,1.345,506,1.345,507,1.345,508,1.335,509,1.067,510,1.149,511,1.345,512,1.912,513,1.335,514,1.345,515,1.345,516,1.345,517,1.345,518,1.345,519,1.955,524,1.335,525,1.345,526,1.386,527,1.355,528,1.345,529,1.345,530,1.345,531,1.355,532,1.355,533,1.355,534,1.386,535,1.345,536,1.345,537,1.355,538,1.355,545,2.548,546,2.378,549,1.207,551,1.898,552,1.306,553,1.241,554,1.315,555,1.287,605,2.58,852,1.672,853,2.431,854,1.375,855,2.865,856,1.687,857,1.687,858,2.453,859,1.933,862,1.687,863,1.687,864,1.396,865,2.593,866,1.687,1400,1.396,1404,1.703,1487,2.456,1678,2.973,1737,7.181,1766,9.333,1771,4.234,1778,4.656,1779,3.956,1780,3.956]],["t/412",[0,1.166,3,1.161,17,0.805,19,3.186,30,3.232,80,1.582,105,1.008,117,1.699,244,2.476,252,3.002,277,1.516,317,3.709,563,3.215,643,3.105,1534,4.489,1781,8.211]],["t/414",[0,0.946,3,0.995,9,1.568,14,1.087,16,2.927,17,0.803,20,4.063,21,6.392,22,6.017,30,3.215,41,1.341,149,0.995,261,2.386,283,6.017,302,2.179,317,4.269,400,4.578,664,3.714,747,3.969,1030,6.193,1782,8.136,1783,8.948,1784,8.948,1785,7.203,1786,6.884,1787,8.136,1788,7.203]],["t/416",[3,1.192,5,4.384,7,0.769,9,1.337,10,3.964,14,1.138,15,6.144,16,2.496,17,0.729,22,7.21,28,3.585,30,2.361,41,1.416,81,2.047,94,0.995,95,1.216,105,1.031,117,2.073,138,5.132,139,4.305,195,2.717,211,5.147,215,1.573,224,1.085,250,6.26,277,1.299,280,6.484,285,3.905,289,4.352,290,5.487,302,2.611,373,6.353,400,4.834,404,3.44,427,5.132,594,7.591,616,2.647,618,6.484,654,4.158,664,3.168,691,3.905,755,4.09,802,7.66,951,6.718,1332,5.872,1337,6.4,1527,4.873,1660,4.469,1785,7.606,1789,7.632,1790,7.632,1791,7.632,1792,6.94,1793,8.632,1794,4.996,1795,9.448,1796,7.269,1797,6.94]],["t/418",[7,0.594,14,1.009,16,2.834,17,0.77,41,1.625,81,1.728,94,1.33,95,1.126,105,0.907,147,4.249,149,1.134,150,3.169,187,1.999,191,5.826,211,4.72,223,3.336,226,3.715,250,5.286,283,6.859,289,3.674,290,5.219,302,2.484,310,4.644,311,4.308,398,6.667,403,5.286,454,2.31,465,1.751,600,3.14,616,3.005,670,7.879,802,6.19,1337,5.404,1546,6.922,1793,6.975,1797,7.879,1798,6.975]],["t/420",[3,0.728,7,0.815,11,3.509,14,0.945,17,0.609,22,4.403,28,3.252,29,2.772,31,4.714,32,4.902,41,0.981,73,3.761,74,3.628,81,1.306,94,0.853,95,0.946,96,3.617,102,0.913,104,2.57,105,0.849,110,1.709,131,5.271,138,4.403,146,1.422,147,5.53,149,1.062,150,2.394,154,1.863,160,3.454,192,5.038,211,3.567,227,4.084,252,2.177,255,5.563,261,2.702,272,4.261,277,0.901,289,3.634,290,5.185,302,2.468,304,3.448,307,2.439,311,5.229,312,4.146,317,4.32,319,3.455,320,3.628,322,1.709,323,1.413,398,6.593,404,2.873,443,5.285,454,2.804,465,1.732,560,3.628,600,3.106,601,3.892,602,5.345,611,5.61,620,4.287,621,3.047,625,2.736,634,2.904,664,2.718,695,4.532,739,3.995,1040,5.271,1079,5.954,1279,4.678,1281,5.954,1295,5.563,1330,5.563,1342,3.997,1419,3.995,1546,4.181,1587,6.593,1595,5.038,1613,5.563,1627,5.954,1665,4.678,1785,5.271,1786,5.038,1799,5.954,1800,6.548,1801,6.548,1802,7.067,1803,5.954,1804,6.548,1805,6.548,1806,5.563,1807,5.954,1808,6.548,1809,8.569,1810,5.954,1811,7.69,1812,5.271]],["t/422",[3,0.836,5,3.099,6,2.45,7,0.824,13,1.955,14,0.534,17,0.665,20,2.45,23,5.784,28,3.552,29,2.816,31,4.796,32,4.967,41,0.809,74,4.166,80,0.945,81,1.076,92,1.558,93,1.582,94,1.495,95,0.595,96,3.773,102,1.206,104,2.255,105,0.986,146,1.172,147,3.686,149,0.962,150,2.749,152,2.149,163,2.802,182,6.387,183,2.421,203,5.279,205,2.677,210,2.853,211,2.939,223,3.42,224,0.767,226,3.223,261,2.844,272,2.682,283,3.627,289,3.188,290,4.789,302,1.831,304,3.766,307,2.8,311,5.604,312,4.528,319,3.637,320,4.166,327,4.583,398,5.784,403,4.586,404,1.809,415,1.164,443,5.359,454,1.438,556,3.532,597,2.511,601,4.251,611,4.922,622,3.627,625,2.988,642,3.532,654,4.096,664,3.121,694,3.223,712,2.128,747,3.334,748,3.991,755,2.891,798,3.734,1279,3.854,1298,4.689,1342,4.374,1343,3.445,1350,3.991,1354,3.099,1626,4.151,1669,4.906,1670,4.151,1794,4.922,1802,5.561,1807,4.906,1810,4.906,1811,8.205,1812,6.052,1813,5.395,1814,7.518,1815,7.518,1816,5.395,1817,4.906,1818,7.281,1819,9.509,1820,7.518,1821,4.906,1822,5.395,1823,5.395,1824,7.518]],["t/424",[0,0.641,3,1.093,7,0.797,9,1.063,14,0.6,17,0.698,20,2.754,21,4.332,22,4.078,28,3.091,29,2.768,30,1.876,31,4.854,32,4.89,41,1.761,92,1.752,93,1.778,94,1.504,95,1.239,96,3.82,104,2.443,105,0.539,116,2.896,146,1.317,147,2.974,149,1.022,152,2.416,163,3.15,182,6.92,183,2.722,203,4.969,210,2.301,211,4.437,223,2.664,234,2.44,261,2.734,272,3.015,283,4.078,289,2.572,290,4.706,302,1.983,304,3.278,307,2.259,311,5.364,312,3.94,318,1.518,319,3.6,320,3.361,323,1.309,398,4.666,415,1.309,443,5.322,454,1.617,556,3.97,597,2.823,600,2.198,601,3.699,611,3.97,625,3.138,626,6.557,634,2.69,638,3.531,664,2.517,694,3.623,695,4.198,723,3.97,734,3.361,755,3.25,875,3.421,1038,3.783,1089,5.153,1205,5.153,1279,4.332,1342,4.165,1351,4.882,1354,3.484,1534,3.015,1631,4.486,1802,4.486,1811,7.403,1812,4.882,1819,8.362,1821,5.515,1825,6.065,1826,5.515,1827,6.065,1828,8.145,1829,6.065,1830,6.065,1831,6.065,1832,6.065,1833,5.201,1834,5.873,1835,6.92,1836,10.255,1837,9.831,1838,6.065,1839,8.145,1840,6.065,1841,6.065,1842,6.065,1843,6.065,1844,4.666]],["t/426",[0,1.17,1,1.348,3,1.183,6,1.547,7,0.812,11,1.825,13,2.94,14,0.529,17,0.696,27,0.796,28,1.292,29,2.778,30,1.653,31,4.885,32,4.15,41,1.703,44,2.509,45,1.648,50,2.543,51,1.605,57,1.51,59,2.124,77,1.384,80,1.718,81,1.618,84,2.519,85,1.626,92,1.543,93,1.566,94,1.513,95,1.316,96,3.494,102,1.469,104,2.24,105,1.001,109,4.034,118,1.769,127,2.519,130,2.653,133,3.238,138,2.29,141,1.217,147,3.662,149,1.21,150,2.967,154,2.562,155,3.412,158,0.841,159,2.62,163,1.769,164,0.984,181,1.956,186,0.858,187,1.232,189,0.858,195,1.902,200,1.796,202,1.105,203,5.252,209,1.435,221,2.129,223,1.114,224,1.153,226,1.46,233,3.817,234,3.005,244,1.266,247,2.124,250,2.078,261,2.4,272,4.034,277,1.184,284,1.769,289,1.444,290,1.743,299,3.079,300,3.325,301,3.698,302,1.818,304,1.37,307,1.268,311,4.475,312,3.19,317,1.399,318,0.852,319,3.862,323,1.153,324,1.855,326,2.827,329,2.62,340,2.357,361,1.825,371,1.626,389,3.108,404,1.142,415,1.751,439,0.998,440,1.087,443,5.193,454,2.295,465,0.688,476,3.684,484,1.822,556,3.498,558,2.62,563,2.658,564,3.069,600,3.262,601,2.427,602,3.333,614,2.229,616,1.181,625,3.475,626,7.246,630,1.305,631,1.234,636,3.605,638,3.517,640,2.893,642,2.229,646,2.343,669,3.26,673,2.078,682,3.817,687,4.405,688,4.111,692,2.229,712,1.343,715,1.693,717,1.717,723,2.229,755,1.825,802,2.433,1146,2.62,1169,1.648,1252,2.433,1297,3.097,1298,4.113,1337,2.124,1342,4.293,1344,2.519,1350,5.524,1351,2.741,1354,1.956,1368,2.62,1416,3.097,1420,2.29,1525,2.741,1563,1.921,1611,4.878,1621,3.097,1626,2.62,1663,4.859,1664,2.229,1682,2.741,1696,2.741,1704,2.433,1733,4.859,1735,2.893,1786,2.62,1793,2.741,1798,2.741,1802,2.519,1811,4.301,1812,2.741,1833,4.21,1834,3.939,1835,5.602,1845,3.405,1846,3.097,1847,3.405,1848,2.893,1849,7.468,1850,5.343,1851,3.405,1852,3.405,1853,2.893,1854,9.484,1855,3.405,1856,3.405,1857,3.097,1858,2.741,1859,3.097,1860,3.405,1861,5.343,1862,2.893,1863,3.097,1864,2.893,1865,2.893,1866,2.174,1867,4.301,1868,7.468,1869,3.405,1870,2.893,1871,3.405,1872,3.405,1873,3.405,1874,2.433,1875,3.405,1876,3.405,1877,3.405,1878,6.345,1879,6.012,1880,3.097,1881,2.893]],["t/428",[0,1.179,1,1.503,3,0.978,7,0.806,14,1.018,17,0.749,20,3.489,22,3.742,28,2.112,29,1.319,32,2.31,41,1.151,44,1.721,77,2.262,79,1.607,80,1.346,81,1.532,85,2.657,94,1.147,95,1.307,96,3.025,102,1.434,104,2.638,105,1,107,10.364,116,2.657,117,1.655,125,3.742,138,3.742,140,3.852,144,2.59,147,2.729,149,0.854,154,1.584,158,1.374,164,2.219,176,2.073,191,5.915,192,4.282,195,2.735,200,2.935,206,8.581,211,3.032,226,2.386,227,3.471,250,4.686,261,2.654,271,5.061,272,2.767,283,3.742,284,4.569,288,2.767,289,3.258,290,4.501,302,1.871,304,2.239,311,2.767,312,3.716,319,2.619,344,5.367,400,5.266,403,5.367,405,2.386,407,1.484,442,2.335,443,4.618,454,1.484,484,1.538,545,1.619,546,1.422,594,6.508,596,4.48,600,2.017,611,3.643,625,3.56,626,7.636,644,3.643,654,3.032,662,4.105,666,5.683,682,3.976,717,2.806,734,4.257,739,4.686,751,3.976,802,7.11,951,3.643,1169,3.716,1252,3.976,1337,3.471,1342,3.926,1546,4.905,1564,3.852,1666,4.117,1744,5.796,1793,8.012,1794,3.643,1833,6.057,1834,5.666,1835,8.059,1853,4.728,1882,4.48,1883,5.565,1884,5.565,1885,5.565,1886,5.565,1887,5.565,1888,5.565,1889,5.565,1890,5.565,1891,5.565,1892,7.682,1893,7.999,1894,7.682,1895,7.682,1896,8.797,1897,5.565,1898,11.397,1899,5.565,1900,4.728,1901,5.061]],["t/430",[0,0.942,1,1.202,14,1.026,17,0.802,32,3.701,41,1.554,81,1.778,95,0.984,117,1.677,147,4.372,206,6.86,211,4.857,247,5.561,248,7.575,250,5.439,261,2.377,302,2.171,307,3.32,311,4.433,329,6.86,402,2.113,622,5.995,717,4.496,739,5.439,1252,6.369,1350,6.595,1546,5.693,1817,8.107,1826,8.107,1902,8.107,1903,8.915]],["t/432",[3,1.262,7,0.621,9,1.834,17,0.744,19,3.695,80,1.588,105,0.806,117,1.705,244,2.617,252,3.013,272,5.206,277,1.561,415,2.259,563,3.226]],["t/434",[14,0.908,16,3.003,17,0.749,73,5.274,92,2.652,95,1.013,146,1.994,149,1.173,163,4.769,195,3.268,252,3.508,304,3.694,553,2.448,664,3.811,1042,5.726,1866,5.862,1904,9.181]],["t/436",[17,0.653,92,3.05,93,3.096,95,1.166,244,2.502,337,4.177,409,7.309,410,7.101,425,2.24,1042,7.114]],["t/438",[0,1.156,1,1.392,2,6.548,3,1.148,7,0.749,9,1.809,14,0.876,16,2.895,17,0.629,29,2.097,44,3.195,45,4.282,50,3.051,83,3.521,90,3.297,95,0.977,105,0.972,117,1.665,125,5.952,149,1.148,196,2.343,244,2.097,302,2.515,603,3.237,1298,5.521,1525,7.125]],["t/440",[0,1.124,1,1.254,3,1.128,7,0.796,14,1.004,16,2.436,17,0.755,19,3.284,29,2.405,41,1.64,44,2.304,50,2.2,52,3.862,80,1.63,92,2.151,93,2.728,94,1.524,95,1.232,96,3.655,102,1.693,105,0.973,119,3.059,141,1.374,154,2.119,174,3.603,188,3.868,215,1.535,221,2.967,223,2.436,224,1.059,225,3.466,234,2.997,302,2.471,314,2.476,319,3.625,333,2.997,405,3.193,438,3.382,439,2.183,440,1.515,444,2.397,445,2.322,446,2.251,447,2.834,509,1.706,603,2.724,616,2.583,621,3.466,636,2.971,712,2.938,1169,3.603,1340,3.266,1487,3.928,1739,5.32]],["t/442",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,509,1.996,603,3.185,616,3.021,636,3.266,1340,3.819]],["t/444",[0,1.112,1,1.418,3,1.015,7,0.72,9,1.6,29,2.163,95,1.008,105,0.812,127,6.754,139,5.149,224,1.298,371,4.359,405,3.914,406,6.522,549,2.366,561,5.059,616,3.166,638,3.958,641,6.139,684,5.57]],["t/446",[0,0.503,1,0.927,7,0.553,14,0.681,17,0.338,25,1.315,37,2.232,41,1.326,44,1.472,64,1.86,80,0.834,81,1.372,94,0.62,95,0.891,102,1.704,104,3.025,105,0.718,106,4.195,110,1.242,124,1.783,135,1.888,141,0.878,146,2.191,149,1.148,158,1.175,186,2.756,187,1.098,189,1.2,196,2.342,205,1.472,209,1.278,215,1.664,224,1.258,270,2.979,275,1.208,276,1.208,277,1.111,307,1.773,318,2.584,319,3.017,321,1.225,322,2.309,323,1.909,402,1.914,407,2.153,412,2.298,415,1.484,418,2.068,425,1.159,428,1.183,429,1.808,434,1.287,437,2.555,440,0.968,448,2.979,449,2.695,450,2.695,451,2.695,452,2.695,453,2.861,454,2.689,455,1.887,456,2.536,457,1.364,458,2.368,459,2.315,460,2.298,461,1.364,462,2.261,463,2.298,464,1.364,465,2.087,466,2.499,467,2.536,468,2.96,469,2.315,470,1.375,471,2.538,472,1.385,473,2.536,474,2.499,475,2.463,477,2.467,479,2.594,480,1.354,481,1.364,482,1.972,483,1.335,484,1.901,485,2.309,486,1.364,487,1.417,488,1.354,489,1.364,490,2.315,491,2.315,492,1.364,493,1.847,494,2.484,497,2.481,501,1.808,504,1.375,505,1.375,506,1.375,507,1.375,508,1.364,509,1.09,510,1.175,511,1.375,512,1.943,513,1.364,514,1.375,515,1.375,516,1.375,517,1.375,518,1.375,519,1.987,524,1.364,525,1.375,526,1.417,527,1.385,528,1.375,529,1.375,530,1.375,531,1.385,532,1.385,533,1.385,534,1.417,535,1.375,536,1.375,537,1.385,538,1.385,545,2.574,546,2.398,547,1.637,549,1.234,551,1.929,552,1.335,553,1.269,554,1.344,555,1.315,643,1.637,854,1.406,864,1.427,1019,1.725,1400,1.427,1492,1.773,1493,1.773,1494,1.773,1495,1.756,1499,1.773,1500,2.562,1501,1.756,1502,1.773,1503,1.773,1506,1.773,1507,1.773,1508,1.756,1512,1.789,1678,3.039,1701,2.472,1702,5.949,1706,2.904,1707,3.4,1768,3.662,1776,3.662,1905,3.4,1906,4.044,1907,4.759,1908,3.521,1909,4.044]],["t/448",[0,0.744,1,0.829,3,0.683,7,0.665,13,1.109,14,0.696,17,0.349,25,1.357,27,1.921,37,2.271,41,1.345,64,1.328,79,1.418,80,1.077,81,1.536,94,0.64,95,1.048,96,2.969,102,1.705,105,0.863,106,5.134,109,1.522,110,1.281,117,1.787,120,2.717,123,3.778,124,1.272,130,1.232,135,1.921,141,0.906,146,2.063,149,1.178,158,1.736,164,1.418,183,1.374,186,2.772,187,1.132,189,1.237,196,2.376,209,1.318,215,1.694,224,1.276,231,1.14,261,0.816,270,2.996,275,1.246,276,1.246,277,1.13,297,1.674,307,1.14,318,2.606,319,2.944,321,1.264,322,2.343,323,1.937,371,1.461,402,1.948,407,2.191,412,2.339,415,1.518,418,2.098,419,2.129,425,1.196,428,1.22,429,1.849,434,1.328,437,2.592,440,0.999,448,3.007,449,2.733,450,2.733,451,2.733,452,2.733,453,2.872,454,2.714,455,2.255,456,2.573,457,1.407,458,2.41,459,2.356,460,2.339,461,1.407,462,2.294,463,2.339,464,1.407,465,2.104,466,2.535,467,2.573,468,2.985,469,2.356,470,1.418,471,2.569,472,1.429,473,2.573,474,2.535,475,2.498,476,2.23,477,2.497,479,2.785,480,1.397,481,1.407,482,2.016,483,1.377,484,1.944,485,2.145,486,1.407,487,1.461,488,1.397,489,1.407,490,2.356,491,2.356,492,1.407,493,1.318,494,2.515,497,2.305,501,2.359,504,1.418,505,1.418,506,1.418,507,1.418,508,1.407,509,1.125,510,1.212,511,1.418,512,1.987,513,1.407,514,1.418,515,1.418,516,1.418,517,1.418,518,1.418,519,2.031,524,1.407,525,1.418,526,1.461,527,1.429,528,1.418,529,1.418,530,1.418,531,1.429,532,1.429,533,1.429,534,1.461,535,1.418,536,1.418,537,1.429,538,1.429,545,2.612,546,2.428,549,1.272,551,1.972,552,1.377,553,1.309,554,1.387,555,1.357,624,1.696,638,1.327,664,1.271,694,1.829,739,1.867,747,1.358,848,1.758,852,1.763,853,2.526,854,1.45,855,2.952,856,1.779,857,1.779,858,2.549,862,1.779,863,1.779,864,1.472,865,1.881,866,1.779,1078,1.696,1400,1.472,1401,1.829,1404,1.795,1419,1.867,1420,2.058,1518,2.344,1563,1.726,1650,1.909,1678,1.954,1701,2.55,1702,6.845,1706,2.995,1707,3.507,1708,2.783,1709,2.601,1910,2.783]],["t/450",[3,1.263,17,0.785,19,3.699,80,1.591,117,1.708,244,2.619,252,3.019,272,5.211,277,1.562,404,3.514,415,2.262,562,5.663]],["t/452",[1,1.482,3,0.842,4,4.724,7,0.644,9,1.327,13,2.745,14,0.749,17,0.822,27,1.771,41,1.135,67,3.934,73,4.351,77,3.079,79,2.716,85,4.489,92,3.282,94,1.333,95,0.836,102,1.056,104,3.207,105,0.673,117,1.425,135,1.771,139,4.271,141,1.397,143,5.827,146,2.323,163,4.884,164,2.187,176,2.821,183,4.22,200,3.995,202,2.457,216,4.351,221,3.017,223,2.477,224,1.337,277,1.042,284,3.934,289,3.987,299,2.874,302,1.844,304,3.784,307,3.809,328,3.664,333,3.048,337,3.439,404,2.539,417,5.827,430,5.093,439,2.757,453,1.896,465,1.53,476,4.27,510,1.87,614,4.958,619,5.827,620,4.958,634,4.17,646,4.484,650,5.603,703,6.435,704,5.242,712,2.987,715,3.765,735,6.435,740,4.271,755,4.059,766,6.717,850,5.603,1042,6.378,1045,6.097,1108,6.097,1116,7.235,1205,6.435,1247,6.887,1421,5.093,1534,3.765,1604,6.097,1608,6.887,1641,5.242,1695,6.887,1780,6.435,1867,6.097,1911,7.573,1912,7.573,1913,6.887,1914,7.573,1915,7.573]],["t/454",[3,0.977,17,0.73,80,1.54,92,3.309,93,3.015,135,2.054,146,2.234,149,0.977,159,4.309,163,5.839,181,5.048,205,3.181,245,5.753,248,7.467,249,4.497,292,6.762,304,4.139,321,2.262,439,3.015,609,7.467,634,3.898,704,7.119,772,7.991,1794,5.753,1916,7.467,1917,8.788,1918,8.788,1919,8.788,1920,8.788,1921,7.467]],["t/456",[1,1.362,3,0.584,7,0.774,11,2.814,13,3.091,17,0.718,28,2.799,29,2.511,31,4.873,32,4.47,41,1.682,57,2.329,80,0.92,81,1.471,85,2.507,92,2.131,93,2.712,94,1.508,95,1.298,96,3.978,102,1.711,104,2.558,105,0.97,106,2.727,124,1.361,133,3.198,149,0.584,152,2.092,154,2.954,163,3.832,183,3.311,196,1.39,199,6.268,202,1.704,224,1.049,226,2.251,240,4.775,265,4.04,277,1.015,304,2.969,318,1.314,371,2.507,404,2.473,426,3.635,439,1.539,440,1.068,444,2.374,445,1.637,446,2.577,447,3.078,465,1.061,562,3.275,605,2.91,620,3.438,625,3.522,629,3.267,630,2.826,631,2.674,632,4.019,633,3.891,646,2.302,704,5.106,848,3.016,1534,2.611,1631,3.885,1694,4.775,1701,2.727,1913,9.438,1922,8.411,1923,8.585,1924,6.268,1925,7.246,1926,6.708,1927,7.246,1928,4.775,1929,5.251,1930,4.775,1931,5.251,1932,4.461,1933,5.251,1934,5.251,1935,5.251,1936,4.04,1937,4.461]],["t/458",[1,1.331,7,0.791,17,0.781,41,1.229,81,1.969,85,4.714,92,2.369,93,2.895,94,1.489,95,1.241,102,1.677,104,2.961,105,0.942,106,5.128,131,6.604,149,0.912,154,2.81,163,5.128,183,3.681,205,2.537,224,1.166,439,2.405,440,1.669,445,2.557,476,3.726,625,3.509,704,5.678,740,4.627,1354,4.712,1701,5.501,1923,8.389,1924,8.389,1938,7.46]],["t/460",[0,0.917,1,1.264,3,0.602,7,0.782,13,1.964,17,0.616,27,1.763,29,2.222,31,4.758,32,4.647,38,4.362,41,1.569,49,4.927,80,1.321,81,1.081,85,2.587,92,1.565,93,2.211,94,1.513,95,1.296,96,4.054,102,1.712,105,0.976,106,2.814,119,2.226,133,4.066,138,3.643,141,1,152,2.159,154,2.904,183,3.892,195,3.338,203,3.306,205,2.683,215,1.117,223,1.772,224,1.233,227,3.38,314,1.802,439,1.589,440,1.102,444,1.744,445,1.689,446,2.621,447,3.108,545,1.577,560,3.003,600,1.964,625,3.409,629,3.323,630,2.889,631,2.733,632,4.108,633,3.978,636,1.73,644,3.547,649,7.967,659,3.987,785,3.173,798,3.75,1066,4.169,1111,3.003,1354,3.113,1611,4.008,1785,4.362,1922,7.887,1923,6.407,1924,4.604,1926,7.887,1927,6.407,1928,8.964,1930,4.927,1937,4.604,1939,5.418,1940,5.418,1941,5.418,1942,5.418,1943,5.418]],["t/462",[0,0.929,1,1.564,3,0.853,7,0.82,9,1.539,11,2.976,12,3.132,17,0.798,26,4.718,27,1.793,29,2.584,41,1.491,45,2.686,75,3.442,83,1.893,85,4.525,92,2.538,93,2.916,94,1.512,95,1.203,96,3.833,102,1.691,104,3.084,105,0.991,119,2.281,133,2.407,146,2.059,149,1.143,150,2.031,152,2.212,163,3.984,179,3.545,181,3.19,195,2.73,199,4.718,202,1.801,205,2.718,213,3.925,215,1.144,216,3.19,224,1.569,226,3.288,232,3.635,233,3.967,234,2.234,261,1.48,277,0.764,288,3.813,299,2.107,300,2.8,304,3.536,318,2.372,322,1.449,328,3.711,389,2.617,402,1.316,431,4.326,439,2.249,440,1.129,444,1.787,445,1.731,446,1.678,447,1.691,476,2.522,510,1.893,600,2.78,602,3.463,638,2.407,642,5.021,643,1.909,646,2.435,664,2.305,691,2.841,704,6.082,715,3.813,743,2.929,752,5.674,1042,4.784,1045,6.174,1146,4.272,1223,3.843,1488,6.082,1546,4.897,1586,6.516,1629,3.843,1641,7.118,1763,5.049,1846,5.049,1865,4.718,1867,4.47,1900,4.718,1925,8.051,1927,7.465,1936,4.272,1937,8.738,1938,5.049,1944,7.67,1945,7.67,1946,4.718,1947,5.553,1948,4.784,1949,5.553,1950,5.553,1951,5.553,1952,6.974,1953,7.67,1954,8.787,1955,5.553,1956,5.553,1957,5.553]],["t/464",[1,1.531,3,1.122,4,5.311,9,1.492,12,4.803,13,3.086,17,0.764,67,4.423,73,5.799,79,2.459,94,1.403,95,1.114,105,0.757,117,1.602,146,2.193,150,3.692,152,3.392,160,5.325,197,4.357,223,3.302,226,4.328,242,6.855,243,5.437,289,3.611,304,4.33,328,4.119,340,5.894,510,2.102,603,3.114,646,4.427,664,3.535,767,7.212,1048,6.855,1349,4.986,1534,4.234,1936,8.28,1958,8.515,1959,8.515,1960,10.096]],["t/466",[1,1.114,3,0.918,4,5.797,7,0.708,9,1.085,14,0.817,17,0.66,27,1.931,31,4.428,32,2.571,41,1.238,45,2.997,55,4.903,64,1.675,79,1.789,92,3.182,93,2.725,94,1.436,95,1.231,102,1.697,104,3.408,105,0.918,117,1.165,119,3.393,124,2.57,125,4.165,141,1.143,146,2.244,148,4.582,150,2.265,158,1.529,163,4.291,183,3.707,187,1.429,189,1.561,209,1.663,215,1.702,224,0.881,275,1.572,276,1.572,288,3.08,318,1.55,319,2.817,321,1.594,322,1.617,418,1.931,428,1.54,429,2.171,434,1.675,453,2.585,465,1.252,471,2.234,475,2.587,477,2.443,479,2.907,485,2.156,493,1.663,494,2.46,497,2.78,501,2.171,510,1.529,546,1.583,547,2.13,549,1.605,551,2.316,552,1.737,553,1.651,554,1.75,555,1.712,600,2.245,601,2.813,620,4.055,633,3.267,646,4.075,658,3.627,659,2.847,672,6.65,689,8.452,695,4.287,696,5.633,697,5.263,698,5.263,699,5.633,701,4.987,702,7.019,704,6.433,705,5.633,809,4.425,854,1.83,864,1.858,1019,2.245,1328,5.633,1400,1.858,1492,2.307,1493,2.307,1494,2.307,1495,2.286,1499,2.307,1500,3.077,1501,2.286,1502,2.307,1503,2.307,1506,2.307,1507,2.307,1508,2.286,1512,2.329,1921,5.263,1961,6.194,1962,8.261,1963,6.194,1964,9.294,1965,6.194,1966,4.987,1967,6.194,1968,6.194,1969,4.766,1970,6.194,1971,6.194,1972,6.194,1973,4.987,1974,6.194]],["t/468",[3,1.054,4,6.418,14,0.938,17,0.834,67,3.989,92,2.739,93,3.017,95,0.848,104,3.086,111,9.13,116,3.667,117,1.445,128,4.331,130,3.09,146,2.334,149,1.054,163,5.734,179,6.056,181,4.412,196,2.033,202,2.492,204,5.316,206,5.909,226,3.293,236,4.904,238,5.316,299,2.914,321,1.976,323,2.047,358,5.681,400,3.93,417,5.909,418,1.795,462,2.424,465,1.552,556,6.209,584,5.681,619,5.909,650,5.681,673,5.786,702,6.525,703,8.058,704,7.642,729,5.486,740,5.349,742,9.772,1074,5.164,1091,7.351,1140,5.909,1252,5.486,1254,8.624,1349,4.497,1534,5.116,1629,5.316,1881,6.525,1975,7.68,1976,7.68,1977,9.484,1978,9.484,1979,7.68,1980,9.484,1981,9.484,1982,5.681,1983,7.68,1984,9.484,1985,9.484,1986,7.68,1987,6.983,1988,7.68,1989,5.316]],["t/470",[1,1.228,3,1.013,80,1.597,95,1.159,164,2.632,244,2.489,252,3.03,277,1.522,337,4.77,423,6.707,424,6.707,425,2.219,561,5.05,1042,6.903,1990,8.287]],["t/472",[3,0.953,7,0.764,9,1.502,11,4.595,14,1.003,16,2.804,17,0.609,27,2.37,29,2.697,30,2.652,45,4.904,59,5.348,74,4.751,77,3.486,81,1.71,83,2.923,90,3.193,105,0.762,135,2.37,149,1.2,187,1.978,289,3.636,290,5.187,299,3.254,302,2.088,307,3.193,324,4.671,328,5.221,414,4.925,442,3.597,465,2.049,625,2.737,646,3.76,713,5.04,1342,3.382,1417,7.797,1633,6.597,1666,6.343,1806,7.285,1991,6.597]],["t/474",[0,1.117,1,1.191,3,0.982,6,2.547,7,0.803,9,1.353,14,0.874,16,1.835,17,0.776,19,2.726,20,3.508,29,2.646,30,2.389,31,3.312,32,2.328,41,1.584,44,2.732,50,1.657,52,3.206,80,1.353,92,1.62,93,2.264,94,1.495,95,1.286,102,1.7,105,1.008,118,4.012,119,3.173,130,2.257,133,2.432,141,1.035,149,0.624,154,1.596,174,2.714,188,2.914,200,2.959,215,1.156,221,2.235,223,1.835,224,1.256,225,3.545,226,2.405,234,2.257,244,1.83,277,1.062,279,5.202,300,2.829,302,2.43,314,1.865,317,3.629,318,1.404,323,1.21,324,3.056,333,2.257,404,1.881,405,2.405,414,3.222,438,2.547,439,1.645,440,1.141,442,4.724,443,4.743,444,1.805,445,1.749,446,2.334,447,2.69,509,1.285,603,2.051,616,1.945,621,2.611,625,3.565,629,2.149,631,2.799,634,2.488,636,2.466,643,1.929,664,2.328,687,2.87,688,4.316,710,4.523,712,2.213,1018,4.66,1109,4.007,1135,3.582,1169,2.714,1340,2.46,1342,4.473,1487,2.959,1515,5.936,1516,4.817,1676,6.077,1677,5.194,1716,5.943,1833,5.64,1858,4.516,1992,9.518,1993,7.024,1994,5.609]],["t/476",[0,0.981,9,1.627,17,0.659,20,4.216,29,2.2,31,3.981,32,3.854,102,1.294,224,1.32,225,3.458,244,2.2,277,1.277,318,2.324,631,3.365]],["t/478",[7,0.636,17,0.754,30,2.872,102,1.294,105,0.825,224,1.32,225,3.458,226,3.981,244,2.2,277,1.277,317,4.361,1109,6.633]],["t/480",[0,1.202,1,1.364,3,0.95,7,0.79,14,1.001,17,0.718,41,1.615,44,2.643,50,2.524,52,4.199,94,1.452,95,1.19,105,1.011,118,5.254,141,1.577,149,0.95,154,2.432,221,3.404,234,3.438,302,2.624,314,2.841,323,1.844,333,3.438,509,1.958,603,3.125,616,2.963,636,3.23,643,2.938,664,3.547,710,5.923,1340,3.747]],["t/482",[0,0.325,1,0.414,3,0.342,7,0.652,11,1.648,14,0.764,17,0.438,25,1.362,27,2.022,29,1.461,34,2.196,37,2.276,41,1.347,51,1.449,64,1.332,79,1.423,81,1.406,94,0.642,95,1.073,102,1.705,104,0.922,105,0.846,110,1.286,117,1.744,120,3.357,124,1.277,135,1.925,141,0.909,146,2.066,149,1.158,152,1.225,158,1.741,164,1.423,186,2.774,187,1.136,189,1.242,196,2.38,205,0.951,209,1.323,215,1.783,224,1.318,259,2.128,270,2.998,275,1.25,276,1.25,277,1.133,293,2.684,297,1.68,318,2.608,321,1.268,322,2.346,323,1.94,400,1.573,402,2.05,407,2.195,412,2.343,414,1.766,415,1.522,418,2.168,425,1.2,428,1.225,429,1.853,434,1.332,437,2.596,440,1.002,442,2.067,448,3.01,449,2.738,450,2.738,451,2.738,452,2.738,453,2.874,454,2.717,455,2.259,456,2.577,457,1.412,458,2.414,459,2.361,460,2.343,461,1.412,462,2.297,463,2.343,464,1.412,465,2.106,466,2.539,467,2.577,468,2.988,469,2.361,470,1.423,471,2.573,472,1.434,473,2.577,474,2.539,475,2.502,477,2.5,479,2.789,480,1.402,481,1.412,482,2.021,483,1.382,484,1.949,485,2.149,486,1.412,487,1.466,488,1.402,489,1.412,490,2.361,491,2.361,492,1.412,493,1.323,494,2.518,497,2.309,501,2.363,504,1.423,505,1.423,506,1.423,507,1.423,508,1.412,509,1.129,510,1.216,511,1.423,512,1.992,513,1.412,514,1.423,515,1.423,516,1.423,517,1.423,518,1.423,519,2.037,524,1.412,525,1.423,526,1.466,527,1.434,528,1.423,529,1.423,530,1.423,531,1.434,532,1.434,533,1.434,534,1.466,535,1.423,536,1.423,537,1.434,538,1.434,545,2.616,546,2.431,549,1.277,551,1.977,552,1.382,553,1.314,554,1.392,555,1.362,625,1.573,644,2.013,785,1.8,852,1.77,853,2.533,854,1.455,855,2.958,856,1.785,857,1.785,858,2.555,862,1.785,863,1.785,864,1.478,865,2.956,866,1.785,1018,5.22,1342,1.943,1400,1.478,1404,1.802,1408,2.365,1487,1.622,1513,3.146,1515,3.073,1516,5.136,1517,2.067,1534,1.529,1676,3.146,1677,5.537,1680,2.196,1833,6.319,1995,3.074,1996,3.966,1997,3.074,1998,3.074,1999,2.274,2000,2.796]],["t/484",[7,0.769,17,0.509,29,2.152,41,1.621,92,2.07,93,2.663,94,1.495,95,1.283,102,1.711,105,0.932,205,2.217,324,3.904,403,4.372,439,2.101,440,1.458,442,4.766,443,4.96,444,2.306,445,2.234,446,2.745,447,3.037,465,1.448,625,3.528,629,3.82,631,2.597,632,3.904,633,3.78,636,2.288,710,4.196,747,3.179,873,4.692,1342,4.135,1566,6.517,1833,5.799,1932,6.089,1999,7.376]],["t/486",[7,0.654,14,0.702,17,0.353,25,1.374,27,1.935,29,1.682,33,2.503,37,2.287,41,1.353,64,1.345,79,1.436,81,1.416,94,0.648,95,1.054,102,1.706,105,0.849,110,1.298,117,1.751,120,2.739,123,3.567,124,1.288,135,1.935,141,0.917,146,2.073,149,1.161,158,1.752,164,1.436,186,2.779,187,1.147,189,1.253,196,2.389,209,1.335,215,1.706,224,1.323,259,2.152,270,3.003,275,1.262,276,1.262,277,1.138,279,3.579,293,1.694,297,1.695,318,2.615,321,1.279,322,2.356,323,1.948,328,2.405,400,1.591,402,1.961,407,2.207,412,2.355,414,2.856,415,1.531,418,2.11,425,1.211,428,1.236,429,1.865,434,1.345,437,2.607,440,1.011,442,2.086,448,3.018,449,2.749,450,2.749,451,2.749,452,2.749,453,2.877,454,2.724,455,2.271,456,2.588,457,1.425,458,2.426,459,2.373,460,2.355,461,1.425,462,2.307,463,2.355,464,1.425,465,2.111,466,2.55,467,2.588,468,2.995,469,2.373,470,1.436,471,2.581,472,1.447,473,2.588,474,2.55,475,2.513,477,2.509,479,2.798,480,1.415,481,1.425,482,2.035,483,1.394,484,1.961,485,2.16,486,1.425,487,1.48,488,1.415,489,1.425,490,2.373,491,2.373,492,1.425,493,1.335,494,2.527,497,2.321,501,2.373,504,1.436,505,1.436,506,1.436,507,1.436,508,1.425,509,1.139,510,1.227,511,1.436,512,2.005,513,1.425,514,1.436,515,1.436,516,1.436,517,1.436,518,1.436,519,2.05,524,1.425,525,1.436,526,1.48,527,1.447,528,1.436,529,1.436,530,1.436,531,1.447,532,1.447,533,1.447,534,1.48,535,1.436,536,1.436,537,1.447,538,1.447,545,2.627,546,2.44,549,1.288,551,1.99,552,1.394,553,1.325,554,1.404,555,1.374,625,1.587,852,1.786,853,2.549,854,1.469,855,2.973,856,1.802,857,1.802,858,2.572,862,1.802,863,1.802,864,1.491,865,1.905,866,1.802,1018,5.236,1400,1.491,1404,1.818,1513,3.174,1515,1.939,1516,5.162,1517,2.091,1518,2.374,1676,3.174,1677,5.565,1680,2.221,1993,4.521,1999,7.343,2001,4.521,2002,3.109,2003,3.109]],["t/488",[7,0.617,9,1.93,17,0.819,80,1.579,117,1.696,154,2.97,205,2.788,223,2.948,244,2.611,252,2.997,277,1.559,323,1.945,510,2.577,623,5.083,625,2.877,719,7.658,1633,6.935]],["t/490",[0,1.209,7,0.755,9,1.861,14,0.817,16,2.701,17,0.586,29,1.957,31,3.541,32,4.115,50,2.928,81,1.647,95,1.094,105,1.044,142,5.694,147,4.05,149,1.253,150,3.02,154,2.35,224,1.174,244,1.957,279,4.999,285,4.226,317,3.392,319,3.38,326,3.541,415,1.782,418,1.931,600,3.592,601,4.502,643,3.874,683,5.406,741,5.273,1342,3.91,1344,6.109,1349,4.836,1488,6.861,1534,4.106,1704,5.9,1710,4.502,2004,8.258,2005,6.354,2006,6.354,2007,5.716]],["t/492",[0,1.132,1,1.324,3,1.091,7,0.804,9,1.558,11,3.716,14,1.025,16,2.268,17,0.76,19,3.139,29,2.327,32,4.076,41,1.605,44,2.145,50,2.048,51,3.268,52,3.692,80,1.558,83,2.364,92,2.003,93,2.607,94,1.524,95,1.284,102,1.695,105,0.991,118,4.62,119,2.848,141,1.279,149,0.771,154,1.973,174,3.355,188,3.602,221,2.763,223,2.268,224,1.265,225,3.657,234,2.791,244,1.643,261,2.371,277,0.954,300,3.497,302,2.391,314,2.306,319,3.848,333,2.791,405,2.973,438,3.149,439,2.033,440,1.411,444,2.232,445,2.162,446,2.688,447,2.709,509,1.589,563,2.469,603,2.536,616,2.405,621,3.227,630,3.407,636,2.839,643,2.385,712,2.735,713,3.448,1169,3.355,1340,3.041,1487,3.658]],["t/494",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.451,244,2.196,261,2.828,277,1.275]],["t/496",[0,1.177,1,1.362,3,0.948,7,0.779,11,4.571,14,1,17,0.718,41,1.614,44,2.638,50,2.52,52,4.195,94,1.451,95,1.229,105,1.025,118,5.249,141,1.574,149,0.948,154,2.427,221,3.398,234,3.432,300,4.301,302,2.622,314,2.836,333,3.432,509,1.954,603,3.119,616,2.958,630,3.872,636,3.226,643,2.933,713,4.241,1340,3.74]],["t/498",[0,1.134,1,1.354,7,0.578,9,1.76,14,0.835,17,0.713,27,1.974,29,2.686,31,4.306,32,4.773,50,2.494,94,1.1,95,0.932,117,1.588,146,2.182,159,4.14,176,3.741,197,4.32,224,1.428,261,2.678,293,4.599,319,4.018,402,2,564,5.77,636,2.695,643,3.687,1701,5.764,1702,7.21,2008,6.496,2009,8.632]],["t/500",[0,1.077,1,1.013,7,0.766,14,0.744,17,0.724,19,2.652,27,2.188,29,2.651,31,4.796,32,4.643,41,1.527,50,2.764,80,1.317,92,2.171,93,2.744,94,1.517,95,1.266,102,1.705,105,0.906,176,2.799,210,2.852,224,1.069,261,2.004,319,3.814,405,3.222,439,2.203,440,1.529,444,2.419,445,2.343,446,2.828,447,3.104,634,3.334,643,3.218,669,4.585,673,4.585]],["t/502",[7,0.781,14,0.722,17,0.652,27,1.705,29,2.671,31,4.888,32,4.608,41,1.507,50,2.154,80,1.278,92,2.107,93,2.692,94,1.499,95,1.286,102,1.709,133,3.162,176,2.716,304,2.935,319,4.025,389,3.438,439,2.138,440,1.484,444,2.347,445,2.274,446,2.776,447,3.061,629,2.794,630,2.794,631,2.643,632,3.973,633,3.847,634,3.235,2008,5.612,2010,5.21]],["t/504",[0,0.714,1,1.073,3,0.516,7,0.599,13,1.681,14,0.668,17,0.329,25,1.282,37,2.2,41,1.31,64,1.826,80,0.813,81,1.588,94,0.605,95,0.965,102,1.703,104,3.001,105,0.777,106,4.134,109,2.306,110,1.211,124,1.75,130,1.867,135,1.861,141,0.856,146,2.174,149,1.181,158,1.145,186,2.742,187,1.07,189,1.169,196,2.314,209,1.246,215,1.64,224,1.321,261,1.8,270,2.964,275,1.177,276,1.177,277,1.095,318,2.566,319,2.98,321,1.194,322,2.282,323,1.886,371,2.215,402,1.886,407,2.122,412,2.265,415,1.457,418,2.044,419,2.011,425,1.13,428,1.153,429,1.775,434,1.255,437,2.525,440,0.944,448,2.956,449,2.662,450,2.662,451,2.662,452,2.662,453,2.852,454,2.668,455,1.852,456,2.506,457,1.33,458,2.333,459,2.282,460,2.265,461,1.33,462,2.234,463,2.265,464,1.33,465,2.072,466,2.469,467,2.506,468,2.939,469,2.282,470,1.34,471,2.512,472,1.35,473,2.506,474,2.469,475,2.433,476,3.066,477,2.442,479,2.563,480,1.32,481,1.33,482,1.935,483,1.301,484,1.866,485,2.282,486,1.33,487,1.381,488,1.32,489,1.33,490,2.282,491,2.282,492,1.33,493,1.813,494,2.459,497,2.451,501,1.775,504,1.34,505,1.34,506,1.34,507,1.34,508,1.33,509,1.063,510,1.145,511,1.34,512,1.907,513,1.33,514,1.34,515,1.34,516,1.34,517,1.34,518,1.34,519,1.95,524,1.33,525,1.34,526,1.381,527,1.35,528,1.34,529,1.34,530,1.34,531,1.35,532,1.35,533,1.35,534,1.381,535,1.34,536,1.34,537,1.35,538,1.35,545,2.544,546,2.374,547,1.595,549,1.202,551,1.893,552,1.301,553,1.237,554,1.31,555,1.282,624,2.57,638,2.011,687,2.374,694,2.771,747,2.057,848,2.665,854,1.37,864,1.391,1019,1.681,1078,2.57,1400,1.391,1419,2.83,1420,3.119,1492,1.728,1493,1.728,1494,1.728,1495,1.712,1499,1.728,1500,2.514,1501,1.712,1502,1.728,1503,1.728,1506,1.728,1507,1.728,1508,1.712,1512,1.744,1650,2.893,1678,2.962,1701,2.409,1705,4.218,1706,2.83,1768,3.569,1776,3.569,1905,3.314,1908,3.432,2008,3.569,2009,7.037,2011,4.218,2012,4.639,2013,4.639,2014,4.639]],["t/506",[1,0.621,7,0.543,14,0.665,17,0.327,25,1.274,29,2.195,31,4.475,32,3.846,37,2.191,41,1.306,64,1.817,81,1.34,94,0.601,95,0.875,102,1.704,104,2.995,105,0.705,110,1.203,124,1.741,130,4.267,135,1.854,141,0.85,146,2.169,149,1.138,158,1.138,186,2.739,187,1.063,189,1.161,196,2.307,209,1.237,210,1.749,215,1.634,224,1.317,270,2.96,275,1.17,276,1.17,277,1.091,318,2.562,319,1.571,321,1.186,322,2.275,323,1.881,374,8.425,402,1.879,407,2.114,412,2.257,415,1.45,418,2.037,425,1.122,428,1.146,429,1.766,434,1.246,437,2.517,440,0.937,448,2.95,449,2.654,450,2.654,451,2.654,452,2.654,453,2.849,454,2.662,455,1.843,456,2.498,457,1.321,458,2.325,459,2.273,460,2.257,461,1.321,462,2.227,463,2.257,464,1.321,465,2.068,466,2.462,467,2.498,468,2.934,469,2.273,470,1.331,471,2.506,472,1.341,473,2.498,474,2.462,475,2.426,477,2.435,479,2.555,480,1.311,481,1.321,482,1.926,483,1.292,484,1.857,485,2.275,486,1.321,487,1.372,488,1.311,489,1.321,490,2.273,491,2.273,492,1.321,493,1.804,494,2.453,497,2.444,501,1.766,504,1.331,505,1.331,506,1.331,507,1.331,508,1.321,509,1.056,510,1.138,511,1.331,512,1.898,513,1.321,514,1.331,515,1.331,516,1.331,517,1.331,518,1.331,519,1.941,524,1.321,525,1.331,526,1.372,527,1.341,528,1.331,529,1.331,530,1.331,531,1.341,532,1.341,533,1.341,534,1.372,535,1.331,536,1.331,537,1.341,538,1.341,545,2.536,546,2.368,547,1.585,549,1.194,551,1.884,552,1.292,553,1.229,554,1.302,555,1.274,643,1.585,854,1.361,864,1.382,1019,1.67,1400,1.382,1492,1.716,1493,1.716,1494,1.716,1495,1.701,1499,1.716,1500,2.502,1501,1.701,1502,1.716,1503,1.716,1506,1.716,1507,1.716,1508,1.701,1512,1.732,1701,2.394,1702,5.86,1707,3.292,1906,3.915,1909,3.915,1966,3.71,1969,3.546,1973,3.71,2009,7.459,2011,4.191,2015,4.608,2016,4.608,2017,4.608]],["t/508",[0,0.683,1,1.037,3,0.486,4,2.727,7,0.621,9,0.766,12,2.465,14,0.761,17,0.459,25,1.208,27,1.798,29,1.036,31,2.771,32,1.815,37,2.125,39,3.234,41,1.273,50,1.291,51,2.06,64,1.182,79,1.263,80,0.766,81,1.289,94,0.842,95,1.156,102,1.701,105,0.896,106,4.93,110,1.141,117,1.786,120,3.2,124,1.675,130,2.601,133,1.895,135,1.798,141,1.193,146,2.062,149,1.121,158,1.596,164,1.867,186,2.71,187,1.008,188,2.271,189,1.102,196,2.249,209,1.174,210,1.659,215,1.751,224,1.208,260,3.123,270,2.929,275,1.109,276,1.109,277,1.169,293,2.382,296,2.611,297,1.49,304,1.759,318,2.524,319,3.622,321,1.125,322,2.218,323,1.834,389,2.06,402,2.013,407,2.05,412,2.188,415,1.66,418,1.986,419,1.895,425,1.064,428,1.087,429,1.699,434,1.182,437,2.454,440,0.889,448,2.901,449,2.588,450,2.588,451,2.588,452,2.588,453,2.829,454,2.618,455,2.11,456,2.436,457,1.253,458,2.255,459,2.205,460,2.188,461,1.253,462,2.172,463,2.188,464,1.253,465,2.038,466,2.4,467,2.436,468,2.891,469,2.205,470,1.263,471,2.452,472,1.272,473,2.436,474,2.4,475,2.365,477,2.383,479,2.658,480,1.244,481,1.253,482,1.853,483,1.226,484,1.786,485,2.007,486,1.253,487,1.301,488,1.244,489,1.253,490,2.205,491,2.205,492,1.253,493,1.174,494,2.4,497,2.157,501,2.233,504,1.263,505,1.263,506,1.263,507,1.263,508,1.253,509,1.002,510,1.596,511,1.263,512,1.826,513,1.253,514,1.263,515,1.263,516,1.263,517,1.263,518,1.263,519,1.867,524,1.253,525,1.263,526,1.301,527,1.272,528,1.263,529,1.263,530,1.263,531,1.272,532,1.272,533,1.272,534,1.301,535,1.263,536,1.263,537,1.272,538,1.272,545,2.472,546,2.317,549,1.133,551,1.813,552,1.226,553,1.165,554,1.235,555,1.208,563,1.556,633,2.306,658,2.56,659,2.009,672,3.519,682,3.123,694,2.611,695,3.026,697,3.714,698,3.714,700,3.975,734,2.422,817,2.667,852,1.57,853,2.322,854,1.291,855,2.762,856,1.584,857,1.584,858,2.342,862,1.584,863,1.584,864,1.311,865,2.476,866,1.584,1115,3.363,1123,3.519,1384,3.714,1400,1.311,1404,1.599,1405,2.791,1678,2.791,1701,4.413,1702,7.144,1706,2.667,1707,3.123,1910,3.975,2008,3.363,2009,5.203,2018,4.371,2019,3.714,2020,4.371,2021,4.371,2022,4.371]],["t/510",[0,1.085,3,0.973,7,0.6,9,1.534,13,3.72,17,0.813,19,3.09,29,2.432,31,4.668,32,4.26,80,1.534,83,2.986,105,1.018,117,1.647,142,5.03,244,2.075,249,4.481,252,2.912,277,1.544,310,4.693,311,4.354,313,6.478,319,3.499,402,2.432,414,5.03,631,3.174,1342,3.454]],["t/512",[0,0.914,1,1.166,7,0.593,9,1.999,16,2.829,27,2.022,28,3.282,29,2.415,45,4.185,83,3.474,90,3.221,94,1.328,105,0.906,149,1.133,205,2.675,244,2.05,261,2.306,299,3.282,302,2.106,312,4.185,321,2.226,327,7.349,371,4.13,510,2.854,643,3.504,658,5.966,665,5.395,683,5.662,1376,5.816,1743,7.349,2010,7.738,2023,8.649,2024,8.649,2025,6.179,2026,8.649]],["t/514",[0,1.179,1,1.446,3,1.192,7,0.797,9,1.724,13,2.524,14,1.026,16,2.278,17,0.761,19,3.472,28,3.936,29,2.331,41,1.555,44,3.043,50,2.057,52,3.702,80,1.724,81,1.389,83,2.374,92,2.011,93,2.615,94,1.531,95,1.231,102,1.679,105,1.004,109,3.462,119,2.861,141,1.285,149,1.094,154,1.982,174,3.369,188,3.617,215,1.435,221,2.774,223,2.278,224,1.268,225,3.664,234,2.802,244,1.65,261,2.623,277,0.958,302,2.396,314,2.316,333,2.802,371,3.325,405,2.986,419,3.019,438,3.163,439,2.042,440,1.417,444,2.241,445,2.171,446,2.105,447,2.121,476,4.05,509,1.595,510,1.719,563,2.479,603,2.547,616,2.415,621,3.241,624,3.859,636,2.847,638,3.019,658,4.078,694,4.16,712,2.747,747,3.089,848,4,1078,3.859,1169,3.369,1340,3.054,1368,5.358,1419,4.248,1420,4.683,1487,3.673,1641,4.82,1650,4.344]],["t/516",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.451,244,2.196,261,2.828,277,1.275]],["t/518",[0,1.2,1,1.449,3,1.12,7,0.761,9,1.487,14,0.997,17,0.715,19,2.995,41,1.611,44,3.324,50,2.507,52,4.182,94,1.516,95,1.186,105,1.023,141,1.566,149,0.943,154,2.415,221,3.38,234,3.415,302,2.617,314,2.822,333,3.415,509,1.944,510,2.095,603,3.103,616,2.943,636,3.216,658,4.969,1340,3.721,1368,6.529]],["t/520",[7,0.631,16,3.014,29,2.184,81,1.838,95,1.167,105,0.988,150,3.37,195,3.281,312,4.458,643,3.635,665,5.748,1376,6.196,1596,7.09,1794,6.033]],["t/522",[0,0.879,1,1.2,7,0.777,9,1.313,14,0.619,17,0.297,25,1.156,28,3.777,29,1.775,37,2.07,41,1.246,64,1.692,75,1.877,77,1.7,80,1.096,81,1.248,94,1.389,95,1.031,102,1.702,104,2.903,105,0.957,106,2.172,110,1.092,119,2.569,124,1.621,130,1.683,135,1.751,141,0.772,146,2.103,149,1.208,156,5.314,158,1.032,181,5.717,186,2.685,187,0.965,189,1.054,196,2.201,203,2.551,209,1.123,215,1.544,224,1.265,245,2.738,261,1.668,270,2.902,275,1.061,276,1.061,277,1.03,288,3.11,315,2.812,318,2.491,321,1.076,322,2.17,323,1.794,402,1.775,407,1.997,412,2.132,415,1.35,418,1.944,425,1.018,428,1.04,429,1.644,434,1.131,437,2.401,440,0.851,448,2.86,449,2.532,450,2.532,451,2.532,452,2.532,453,2.812,454,2.581,455,1.716,456,2.384,457,1.199,458,2.196,459,2.148,460,2.132,461,1.199,462,2.125,463,2.132,464,1.199,465,2.011,466,2.349,467,2.384,468,2.853,469,2.148,470,1.208,471,2.407,472,1.217,473,2.384,474,2.349,475,2.315,477,2.34,479,2.438,480,1.19,481,1.199,482,1.793,483,1.173,484,1.729,485,2.17,486,1.199,487,1.245,488,1.19,489,1.199,490,2.148,491,2.148,492,1.199,493,1.679,494,2.356,497,2.331,501,1.644,504,1.208,505,1.208,506,1.208,507,1.208,508,1.199,509,0.958,510,2.053,511,1.208,512,1.767,513,1.199,514,1.208,515,1.208,516,1.208,517,1.208,518,1.208,519,1.806,524,1.199,525,1.208,526,1.245,527,1.217,528,1.208,529,1.208,530,1.208,531,1.217,532,1.217,533,1.217,534,1.245,535,1.208,536,1.208,537,1.217,538,1.217,545,2.419,546,2.275,547,1.438,549,1.084,551,1.754,552,1.173,553,1.115,554,1.181,555,1.156,625,1.335,643,1.438,658,4.387,659,2.875,687,2.14,766,5.352,854,1.235,864,1.254,1019,1.516,1298,3.901,1400,1.254,1401,2.498,1413,5.314,1492,1.558,1493,1.558,1494,1.558,1495,1.543,1499,1.558,1500,2.329,1501,1.543,1502,1.558,1503,1.558,1506,1.558,1507,1.558,1508,1.543,1512,1.572,1550,2.738,1641,5.186,1642,3.218,1643,2.895,1644,3.553,1646,3.553,1647,2.895,1701,2.172,1936,7.186,2027,8.094,2028,9.253,2029,8.094,2030,4.182,2031,3.803,2032,4.182,2033,4.182,2034,4.182,2035,4.182,2036,4.182]],["t/524",[0,0.832,1,1.06,3,0.505,7,0.698,13,1.647,14,0.658,17,0.323,25,1.256,27,2.024,28,3.869,29,1.576,37,2.174,41,1.298,45,2.199,64,1.229,79,1.313,81,1.327,94,0.867,95,1.017,102,1.703,105,0.856,106,5.164,110,1.186,117,1.733,120,3.397,124,1.178,135,1.839,141,0.839,146,2.001,149,1.133,152,1.81,158,1.642,164,1.313,186,2.731,187,1.048,189,1.145,196,2.292,209,1.22,215,1.621,224,1.231,231,1.693,270,2.952,275,1.153,276,1.153,277,1.082,297,1.55,307,2.477,318,2.552,321,1.17,322,2.26,323,1.868,402,1.864,407,2.097,412,2.239,415,1.435,418,2.024,425,1.107,428,1.13,429,1.748,434,1.229,437,2.5,440,0.924,448,2.937,449,2.637,450,2.637,451,2.637,452,2.637,453,2.844,454,2.651,455,2.158,456,2.482,457,1.303,458,2.306,459,2.255,460,2.239,461,1.303,462,2.213,463,2.239,464,1.303,465,2.06,466,2.446,467,2.482,468,2.923,469,2.255,470,1.313,471,2.492,472,1.322,473,2.482,474,2.446,475,2.41,477,2.422,479,2.701,480,1.293,481,1.303,482,1.907,483,1.274,484,1.838,485,2.053,486,1.303,487,1.353,488,1.293,489,1.303,490,2.255,491,2.255,492,1.303,493,1.22,494,2.439,497,2.206,501,2.276,504,1.313,505,1.313,506,1.313,507,1.313,508,1.303,509,1.041,510,1.642,511,1.313,512,1.879,513,1.303,514,1.313,515,1.313,516,1.313,517,1.313,518,1.313,519,1.921,524,1.303,525,1.313,526,1.353,527,1.322,528,1.313,529,1.313,530,1.313,531,1.322,532,1.322,533,1.322,534,1.353,535,1.313,536,1.313,537,1.322,538,1.322,545,2.519,546,2.355,549,1.178,551,1.865,552,1.274,553,1.212,554,1.284,555,1.256,683,2.975,739,2.772,852,1.632,853,2.389,854,1.342,855,2.825,856,1.647,857,1.647,858,2.41,862,1.647,863,1.647,864,1.363,865,2.548,866,1.647,1400,1.363,1401,2.715,1404,1.662,1667,2.902,1701,3.455,1706,2.772,2027,9.041,2028,9.457,2031,4.133,2037,4.545,2038,3.497,2039,4.133,2040,4.545]],["t/526",[3,1.164,17,0.82,80,1.588,117,1.705,223,2.964,244,2.617,252,3.013,272,5.206,277,1.561,404,3.511,415,2.259,562,5.653,623,5.111,719,7.7]],["t/528",[0,0.903,1,1.152,3,0.95,7,0.763,9,1.992,13,3.097,16,2.795,29,2.397,57,3.79,80,1.497,81,1.704,83,3.674,85,4.08,90,3.182,95,1.117,96,3.479,105,0.958,149,1.125,150,3.125,154,3.17,194,5.213,195,3.042,205,2.643,228,6.879,244,2.025,261,2.278,307,3.182,312,4.134,314,2.841,323,1.844,339,7.26,419,3.704,625,2.728,646,3.747,717,4.309,1134,5.914,1150,5.914,1342,3.37,1483,7.77,1484,7.77,1485,7.77,1486,6.879]],["t/530",[0,1.157,1,1.368,3,1.128,7,0.796,9,1.63,14,1.052,16,2.436,17,0.777,19,3.284,29,2.405,41,1.593,44,2.304,50,2.2,52,3.862,80,1.63,83,2.539,92,2.151,93,2.728,94,1.505,95,1.25,102,1.681,105,1.007,119,3.059,141,1.374,154,2.119,174,3.603,188,3.868,215,1.535,221,2.967,223,2.436,224,1.323,225,3.78,234,2.997,244,1.765,261,2.481,277,1.024,302,2.471,314,2.476,319,3.625,333,2.997,405,3.193,438,3.382,439,2.183,440,1.515,444,2.397,445,2.322,446,2.251,447,2.268,509,1.706,563,2.651,603,2.724,616,2.583,621,3.466,636,2.971,712,2.938,1169,3.603,1340,3.266,1487,3.928]],["t/532",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.451,244,2.196,261,2.828,277,1.275]],["t/534",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,509,1.996,603,3.185,616,3.021,636,3.266,1340,3.819]],["t/536",[3,0.98,7,0.706,9,1.545,14,0.873,17,0.626,19,3.112,29,2.09,30,2.728,39,6.524,44,2.728,57,4.992,73,5.066,81,1.759,90,4.067,95,1.138,105,0.971,117,1.659,133,3.824,149,0.98,150,3.225,154,2.51,174,4.267,205,2.728,224,1.254,301,6.105,317,3.623,319,3.007,371,4.211,625,3.486,712,3.479,1859,8.02]],["t/538",[7,0.746,13,2.891,14,0.961,17,0.743,29,2.3,41,1.568,57,4.95,80,1.398,92,2.304,93,2.846,94,1.511,95,1.268,102,1.704,105,0.709,149,0.887,150,2.917,224,1.134,304,3.21,319,3.568,439,2.339,440,1.623,444,2.567,445,2.487,446,2.934,447,2.957,625,3.563,656,5.223]],["t/540",[0,0.501,1,0.925,7,0.605,14,0.679,17,0.337,25,1.31,37,2.227,41,1.324,57,2.103,64,1.855,81,1.368,94,0.618,95,0.89,102,1.704,104,3.021,105,0.716,110,1.237,124,1.778,133,2.056,135,1.884,141,0.875,146,2.241,149,1.147,158,1.17,186,2.754,187,1.094,189,1.195,196,2.338,209,1.273,210,1.799,215,1.661,224,1.256,261,1.264,270,2.976,275,1.203,276,1.203,277,1.108,318,2.582,321,1.22,322,2.305,323,1.906,402,1.91,407,2.149,412,2.293,415,1.48,418,2.065,425,1.155,428,1.179,429,1.803,434,1.282,437,2.551,440,0.964,448,2.976,449,2.69,450,2.69,451,2.69,452,2.69,453,2.86,454,2.686,455,1.882,456,2.532,457,1.359,458,2.363,459,2.31,460,2.293,461,1.359,462,2.257,463,2.293,464,1.359,465,2.084,466,2.495,467,2.532,468,2.957,469,2.31,470,1.369,471,2.534,472,1.38,473,2.532,474,2.495,475,2.459,477,2.463,479,2.589,480,1.349,481,1.359,482,1.966,483,1.33,484,1.896,485,2.305,486,1.359,487,1.411,488,1.349,489,1.359,490,2.31,491,2.31,492,1.359,493,1.842,494,2.481,497,2.477,501,1.803,504,1.369,505,1.369,506,1.369,507,1.369,508,1.359,509,1.086,510,1.17,511,1.369,512,1.938,513,1.359,514,1.369,515,1.369,516,1.369,517,1.369,518,1.369,519,1.981,524,1.359,525,1.369,526,1.411,527,1.38,528,1.369,529,1.369,530,1.369,531,1.38,532,1.38,533,1.38,534,1.411,535,1.369,536,1.369,537,1.38,538,1.38,545,2.57,546,2.395,547,1.63,549,1.229,551,1.923,552,1.33,553,1.264,554,1.339,555,1.31,625,2.992,654,2.583,687,2.426,854,1.401,864,1.422,1019,1.718,1400,1.422,1492,1.766,1493,1.766,1494,1.766,1495,1.75,1499,1.766,1500,2.555,1501,1.75,1502,1.766,1503,1.766,1506,1.766,1507,1.766,1508,1.75,1512,1.782,1556,3.188,1558,3.104,1561,3.188,2041,4.028,2042,7.504,2043,6.847,2044,4.311,2045,4.741,2046,4.028,2047,4.741,2048,4.741,2049,4.311,2050,4.741]],["t/542",[0,0.477,1,0.892,7,0.723,14,0.655,17,0.32,25,1.247,29,1.069,37,2.165,41,1.293,44,2.423,57,2.001,64,1.789,80,0.79,81,1.562,90,1.68,94,0.588,95,1.194,102,1.703,104,2.975,105,0.767,110,1.177,124,1.715,133,1.956,135,1.831,141,0.832,146,2.155,149,1.173,154,1.284,158,1.114,186,2.727,187,1.041,189,1.137,196,2.284,209,1.211,215,1.614,224,1.227,261,1.203,270,2.947,275,1.145,276,1.145,277,1.077,318,2.546,319,2.941,321,1.161,322,2.252,323,2.308,402,1.856,407,2.088,412,2.229,415,1.428,418,2.017,425,1.099,428,1.121,429,1.739,434,1.22,437,2.492,440,0.918,448,2.93,449,2.627,450,2.627,451,2.627,452,2.627,453,2.841,454,2.645,455,1.815,456,2.473,457,1.293,458,2.296,459,2.246,460,2.229,461,1.293,462,2.205,463,2.229,464,1.293,465,2.056,466,2.437,467,2.473,468,2.917,469,2.246,470,1.303,471,2.484,472,1.313,473,2.473,474,2.437,475,2.402,477,2.414,479,2.529,480,1.284,481,1.293,482,1.896,483,1.265,484,1.828,485,2.252,486,1.293,487,1.343,488,1.284,489,1.293,490,2.246,491,2.246,492,1.293,493,1.776,494,2.432,497,2.419,501,1.739,504,1.303,505,1.303,506,1.303,507,1.303,508,1.293,509,1.034,510,1.114,511,1.303,512,1.869,513,1.293,514,1.303,515,1.303,516,1.303,517,1.303,518,1.303,519,1.911,524,1.293,525,1.303,526,1.343,527,1.313,528,1.303,529,1.303,530,1.303,531,1.313,532,1.313,533,1.313,534,1.343,535,1.303,536,1.303,537,1.313,538,1.313,545,2.51,546,2.348,547,1.551,549,1.169,551,1.855,552,1.265,553,1.203,554,1.274,555,1.247,625,3.248,642,2.953,687,2.308,712,1.779,854,1.333,864,1.353,1019,1.635,1400,1.353,1492,1.68,1493,1.68,1494,1.68,1495,1.665,1499,1.68,1500,2.464,1501,1.665,1502,1.68,1503,1.68,1506,1.68,1507,1.68,1508,1.665,1512,1.696,1678,2.881,1702,5.801,1707,3.223,1768,3.471,1776,3.471,1906,3.833,1909,3.833,2042,8.428,2051,4.511,2052,4.102,2053,8.627,2054,4.511,2055,4.511,2056,4.511,2057,4.511]],["t/544",[0,0.825,1,1.053,3,0.499,7,0.656,13,1.626,14,0.652,17,0.319,25,1.24,27,1.825,37,2.158,41,1.29,64,1.213,79,1.296,80,1.154,81,1.557,94,0.585,95,1.012,102,1.702,105,0.852,109,2.231,110,1.171,117,1.619,120,3.234,124,1.163,130,1.805,135,1.825,141,0.828,146,1.991,149,1.172,158,1.627,164,1.296,186,2.724,187,1.035,189,1.131,196,2.278,209,1.205,210,1.703,215,1.609,224,1.223,261,1.196,270,2.944,275,1.139,276,1.139,277,1.074,288,2.231,297,1.53,318,2.543,319,3.593,321,1.155,322,2.246,323,1.857,371,2.142,402,1.85,407,2.082,412,2.222,415,1.422,418,2.012,419,1.945,425,1.093,428,1.115,429,1.732,434,1.213,437,2.485,440,0.913,448,2.925,449,2.621,450,2.621,451,2.621,452,2.621,453,2.839,454,2.64,455,2.142,456,2.467,457,1.286,458,2.289,459,2.238,460,2.222,461,1.286,462,2.199,463,2.222,464,1.286,465,2.053,466,2.431,467,2.467,468,2.912,469,2.238,470,1.296,471,2.479,472,1.306,473,2.467,474,2.431,475,2.395,476,2.992,477,2.409,479,2.687,480,1.277,481,1.286,482,1.889,483,1.258,484,1.821,485,2.038,486,1.286,487,1.335,488,1.277,489,1.286,490,2.238,491,2.238,492,1.286,493,1.205,494,2.426,497,2.19,501,2.262,504,1.296,505,1.296,506,1.296,507,1.296,508,1.286,509,1.028,510,1.108,511,1.296,512,1.861,513,1.286,514,1.296,515,1.296,516,1.296,517,1.296,518,1.296,519,1.903,524,1.286,525,1.296,526,1.335,527,1.306,528,1.296,529,1.296,530,1.296,531,1.306,532,1.306,533,1.306,534,1.335,535,1.296,536,1.296,537,1.306,538,1.306,545,2.504,546,2.342,549,1.163,551,1.848,552,1.258,553,1.196,554,1.267,555,1.24,624,2.486,625,2.747,638,1.945,643,2.266,694,2.68,734,2.486,747,1.99,848,2.577,852,1.612,853,2.367,854,1.325,855,2.804,856,1.626,857,1.626,858,2.388,862,1.626,863,1.626,864,1.346,865,2.524,866,1.626,1078,2.486,1115,3.452,1123,3.612,1400,1.346,1404,1.641,1419,2.737,1420,3.017,1650,2.798,1678,2.865,1702,6.83,1707,3.205,1709,3.812,2019,3.812,2041,7.31,2042,7.31,2043,8.141,2046,3.812,2058,4.487,2059,4.487,2060,6.589]],["t/546",[7,0.748,17,0.732,29,2.09,30,2.728,57,3.912,80,1.545,83,3.007,117,1.659,149,1.251,150,3.769,154,3.203,155,5.631,205,2.728,244,2.09,249,5.274,252,2.933,277,1.548,310,5.524,311,5.124,312,4.267,326,3.781,402,2.09,419,3.824,624,4.887,953,5.066,1534,4.385]],["t/548",[0,1.099,7,0.712,9,1.821,16,2.927,27,2.092,29,2.12,57,3.969,77,3.638,81,1.785,83,3.051,105,1.005,149,0.995,241,6.619,243,5.713,244,2.12,414,5.14,601,4.72,616,3.605,717,4.512,953,5.14,1342,3.529,1369,8.136,1524,5.858,1732,8.367,2061,8.136]],["t/550",[0,1.158,1,1.37,3,1.13,7,0.791,9,1.633,14,1.053,16,2.443,17,0.778,19,3.29,41,1.595,44,2.311,50,2.207,52,3.87,80,1.633,83,2.547,92,2.158,93,2.733,94,1.516,95,1.25,102,1.682,105,0.993,119,3.069,141,1.378,154,2.126,174,3.614,188,3.88,221,2.976,223,2.443,224,1.325,225,3.785,234,3.006,244,1.77,261,2.486,277,1.027,302,2.475,314,2.484,333,3.006,405,3.203,438,3.393,439,2.19,440,1.519,444,2.404,445,2.329,446,2.258,447,2.275,509,1.712,563,2.659,603,2.732,616,2.591,621,3.477,636,2.976,712,2.947,953,5.838,1169,3.614,1340,3.276,1487,3.94,1710,4.833]],["t/552",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.451,244,2.196,261,2.828,277,1.275]],["t/554",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,509,1.996,603,3.185,616,3.021,636,3.266,1340,3.819]],["t/556",[0,0.691,1,1.154,7,0.694,14,0.647,17,0.551,25,1.228,37,2.145,41,1.283,51,3.083,55,2.343,64,1.769,81,1.305,94,0.853,95,1.118,102,1.704,104,3.038,105,0.878,108,3.556,110,1.159,124,1.695,135,1.815,141,1.207,146,2.284,149,1.126,158,1.097,186,2.719,187,1.025,189,1.12,195,2.329,196,2.267,200,2.343,205,2.401,209,1.756,215,1.6,223,1.453,224,1.218,241,3.286,270,2.938,275,1.127,276,1.127,277,1.068,318,2.535,321,1.143,322,2.235,323,1.848,402,1.84,407,2.07,412,2.209,415,1.411,418,2.002,425,1.082,428,1.104,429,1.719,434,1.201,437,2.473,440,0.904,448,2.916,449,2.608,450,2.608,451,2.608,452,2.608,453,2.836,454,2.632,455,1.795,456,2.455,457,1.274,458,2.276,459,2.226,460,2.209,461,1.274,462,2.189,463,2.209,464,1.274,465,2.047,466,2.419,467,2.455,468,2.904,469,2.226,470,1.283,471,2.469,472,1.293,473,2.455,474,2.419,475,2.384,477,2.399,479,2.511,480,1.264,481,1.274,482,1.875,483,1.246,484,1.808,485,2.235,486,1.274,487,1.322,488,1.264,489,1.274,490,2.226,491,2.226,492,1.274,493,1.756,494,2.416,497,2.401,501,1.719,504,1.283,505,1.283,506,1.283,507,1.283,508,1.274,509,1.018,510,1.097,511,1.283,512,1.848,513,1.274,514,1.283,515,1.283,516,1.283,517,1.283,518,1.283,519,1.889,524,1.274,525,1.283,526,1.322,527,1.293,528,1.283,529,1.283,530,1.283,531,1.293,532,1.293,533,1.293,534,1.322,535,1.283,536,1.283,537,1.293,538,1.293,545,2.492,546,2.333,547,2.249,549,1.151,551,1.834,552,1.246,553,1.184,554,1.255,555,1.228,662,1.61,854,1.312,859,2.715,864,1.962,951,2.908,953,4.919,1019,1.61,1029,3.252,1400,1.332,1492,1.655,1493,1.655,1494,1.655,1495,1.639,1496,3.252,1499,1.655,1500,2.436,1501,1.639,1502,1.655,1503,2.436,1506,1.655,1507,1.655,1508,1.639,1512,1.67,1710,4.6,1799,4.04,2061,4.04,2062,6.589,2063,7.276,2064,5.948,2065,3.774,2066,4.04,2067,4.839,2068,3.576,2069,3.774,2070,4.442,2071,5.948,2072,3.774,2073,4.04,2074,4.442]],["t/558",[7,0.784,11,3.802,14,0.702,17,0.742,41,1.616,80,1.243,81,1.415,92,2.049,93,2.646,94,1.513,95,1.294,102,1.708,105,0.802,146,1.96,152,2.826,307,3.361,389,3.344,400,3.63,439,2.08,440,1.443,443,5.088,444,2.283,445,2.212,446,2.727,447,3.022,600,2.571,601,3.222,616,2.46,629,2.718,630,2.718,631,2.571,632,3.865,633,3.742,953,6,1045,5.711,1550,7.06,1682,5.711,1710,5.006,1720,6.676,2006,8.723,2062,6.943,2075,7.094]],["t/560",[0,0.477,1,1.163,7,0.658,14,0.655,17,0.557,25,1.248,37,2.166,41,1.294,44,1.397,64,1.79,80,0.791,81,1.32,94,0.589,95,1.06,102,1.705,104,3.052,105,0.854,110,1.179,124,1.716,135,1.832,141,1.221,142,2.594,146,2.211,149,1.131,158,1.115,186,2.728,187,1.042,189,1.138,196,2.285,205,1.397,209,1.778,215,1.615,224,1.227,236,2.883,238,3.125,270,2.948,275,1.146,276,1.146,277,1.078,307,1.682,318,2.547,321,1.162,322,2.253,323,1.862,402,1.857,407,2.089,412,2.23,415,1.428,418,2.018,425,1.1,428,1.122,429,1.74,434,1.221,437,2.493,440,0.918,443,4.567,448,2.931,449,2.629,450,2.629,451,2.629,452,2.629,453,2.842,454,2.645,455,1.816,456,2.474,457,1.295,458,2.298,459,2.247,460,2.23,461,1.295,462,2.206,463,2.23,464,1.295,465,2.056,466,2.438,467,2.474,468,2.917,469,2.247,470,1.304,471,2.485,472,1.314,473,2.474,474,2.438,475,2.403,476,2.051,477,2.415,479,2.53,480,1.285,481,1.295,482,1.898,483,1.266,484,1.829,485,2.253,486,1.295,487,1.344,488,1.285,489,1.295,490,2.247,491,2.247,492,1.295,493,1.778,494,2.433,497,2.42,501,1.74,504,1.304,505,1.304,506,1.304,507,1.304,508,1.295,509,1.035,510,1.115,511,1.304,512,1.87,513,1.295,514,1.304,515,1.304,516,1.304,517,1.304,518,1.304,519,1.912,524,1.295,525,1.304,526,1.344,527,1.314,528,1.304,529,1.304,530,1.304,531,1.314,532,1.314,533,1.314,534,1.344,535,1.304,536,1.304,537,1.314,538,1.314,545,2.511,546,2.348,547,2.276,549,1.17,551,1.856,552,1.266,553,1.204,554,1.276,555,1.248,643,1.553,854,1.334,864,1.985,953,2.594,1019,1.636,1342,1.781,1400,1.354,1492,1.682,1493,1.682,1494,1.682,1495,1.666,1499,1.682,1500,2.465,1501,1.666,1502,1.682,1503,2.465,1506,1.682,1507,1.682,1508,1.666,1512,1.697,1550,2.956,1716,3.474,1720,7.104,2062,6.03,2063,6.659,2065,3.836,2066,4.106,2068,3.635,2069,3.836,2072,3.836,2073,4.106,2076,5.624,2077,4.582,2078,6.02,2079,4.582,2080,4.515,2081,6.02,2082,4.582]],["t/562",[1,1.081,7,0.602,14,0.674,17,0.333,25,1.298,37,2.215,41,1.318,64,1.842,81,1.359,94,0.612,95,0.97,102,1.704,104,3.012,105,0.713,110,1.226,124,1.765,135,1.874,141,0.866,146,2.235,149,1.144,158,1.159,186,2.749,187,1.083,189,1.184,195,1.672,196,2.471,197,2.403,205,2.107,209,1.261,210,1.782,215,1.652,224,1.327,270,2.971,275,1.192,276,1.192,277,1.102,318,2.575,321,1.209,322,2.295,323,1.897,402,1.899,407,2.137,412,2.281,415,1.47,418,2.055,425,1.144,428,1.167,429,1.79,434,1.27,437,2.539,440,0.955,448,2.967,449,2.678,450,2.678,451,2.678,452,2.678,453,2.856,454,2.678,455,1.869,456,2.521,457,1.346,458,2.35,459,2.298,460,2.281,461,1.346,462,2.247,463,2.281,464,1.346,465,2.079,466,2.484,467,2.521,468,2.949,469,2.298,470,1.356,471,2.525,472,1.366,473,2.521,474,2.637,475,2.448,477,2.454,479,2.578,480,1.336,481,1.346,482,1.953,483,1.317,484,1.883,485,2.295,486,1.346,487,1.398,488,1.336,489,1.346,490,2.298,491,2.298,492,1.346,493,1.829,494,2.471,497,2.466,501,1.79,504,1.356,505,1.356,506,1.356,507,1.356,508,1.346,509,1.076,510,1.159,511,1.356,512,1.924,513,1.346,514,1.356,515,1.356,516,1.356,517,1.356,518,1.356,519,1.967,524,1.346,525,1.356,526,1.398,527,1.366,528,1.356,529,1.356,530,1.356,531,1.366,532,1.366,533,1.366,534,1.398,535,1.356,536,1.356,537,1.366,538,1.366,545,2.558,546,2.386,547,1.615,549,1.217,551,1.91,552,1.317,553,1.252,554,1.327,555,1.298,600,2.469,854,1.387,864,1.408,953,3.913,1019,1.702,1400,1.408,1492,1.749,1493,1.749,1494,1.749,1495,1.733,1499,1.749,1500,2.537,1501,1.733,1502,1.749,1503,1.749,1506,1.749,1507,1.749,1508,1.733,1512,1.765,1515,4.999,1516,4.999,1517,3.158,1564,3.25,1710,2.133,1720,6.504,2006,6.765,2076,3.99,2083,4.696,2084,4.27,2085,4.27,2086,4.696,2087,4.696,2088,4.696,2089,4.27,2090,4.696]],["t/564",[7,0.656,14,0.707,17,0.357,25,1.388,27,1.946,37,2.3,41,1.359,64,1.358,79,1.45,81,1.426,94,0.655,95,1.058,102,1.706,105,0.852,110,1.311,117,1.706,120,3.382,124,1.302,135,1.946,141,0.927,146,2.082,149,1.164,158,1.765,164,1.45,186,2.784,187,1.158,189,1.266,196,2.4,209,1.349,210,1.195,215,1.715,224,1.289,270,3.009,275,1.275,276,1.275,277,1.145,293,1.716,297,1.712,318,2.622,321,1.293,322,2.367,323,1.957,402,1.972,407,2.219,412,2.368,414,1.809,415,1.543,418,2.12,425,1.223,428,1.248,429,1.879,434,1.358,437,2.619,440,1.022,448,3.027,449,2.762,450,2.762,451,2.762,452,2.762,453,2.88,454,2.732,455,2.284,456,2.6,457,1.44,458,2.44,459,2.386,460,2.368,461,1.44,462,2.317,463,2.368,464,1.44,465,2.117,466,2.561,467,2.6,468,3.003,469,2.386,470,1.45,471,2.592,472,1.461,473,2.6,474,2.561,475,2.524,477,2.519,479,2.809,480,1.429,481,1.44,482,2.049,483,1.408,484,1.976,485,2.172,486,1.44,487,1.495,488,1.429,489,1.44,490,2.386,491,2.386,492,1.44,493,1.349,494,2.537,497,2.334,501,2.383,504,1.45,505,1.45,506,1.45,507,1.45,508,1.44,509,1.151,510,1.24,511,1.45,512,2.019,513,1.44,514,1.45,515,1.45,516,1.45,517,1.45,518,1.45,519,2.065,524,1.44,525,1.45,526,1.495,527,1.461,528,1.45,529,1.45,530,1.45,531,1.461,532,1.461,533,1.461,534,1.495,535,1.45,536,1.45,537,1.461,538,1.461,545,2.639,546,2.449,549,1.302,551,2.005,552,1.408,553,1.339,554,1.419,555,1.388,852,1.804,853,2.567,854,1.483,855,2.989,856,1.82,857,1.82,858,2.591,862,1.82,863,1.82,864,1.506,865,2.738,866,1.82,953,1.809,1400,1.506,1404,1.837,1515,1.964,1516,6.212,1517,3.377,1710,4.592,1720,2.329,2062,6.404,2063,7.071,2067,3.715,2068,2.535,2069,2.675,2091,2.863,2092,3.149]],["t/566",[1,0.677,7,0.64,14,0.708,17,0.224,25,1.389,27,1.465,37,2.301,41,1.359,64,1.695,79,0.91,81,1.426,94,0.655,95,1.001,102,1.706,105,0.806,110,1.311,117,1.345,123,3.591,124,1.624,135,1.946,141,0.927,146,2.164,149,1.164,158,1.547,164,0.91,186,2.784,187,1.159,189,1.266,195,1.122,196,2.401,209,1.349,210,1.907,215,1.716,224,1.29,270,3.009,275,1.275,276,1.275,277,1.145,293,1.717,297,1.074,300,1.589,304,1.268,318,2.622,321,1.293,322,2.367,323,1.957,328,4.388,402,1.973,407,2.22,412,2.369,415,1.543,418,2.12,425,1.224,428,1.249,429,1.88,434,1.359,437,2.62,440,1.022,443,2.812,448,3.027,449,2.762,450,2.762,451,2.762,452,2.762,453,2.88,454,2.732,455,2.143,456,2.6,457,1.44,458,2.441,459,2.387,460,2.369,461,1.44,462,2.318,463,2.369,464,1.44,465,2.117,466,2.562,467,2.6,468,3.003,469,2.387,470,1.451,471,2.592,472,1.462,473,2.6,474,2.562,475,2.525,477,2.519,479,2.741,480,1.43,481,1.44,482,2.05,483,1.409,484,1.976,485,2.28,486,1.44,487,1.496,488,1.43,489,1.44,490,2.387,491,2.387,492,1.44,493,1.683,494,2.537,497,2.449,501,2.188,504,1.451,505,1.451,506,1.451,507,1.451,508,1.44,509,1.151,510,1.24,511,1.451,512,2.02,513,1.44,514,1.451,515,1.451,516,1.451,517,1.451,518,1.451,519,2.065,524,1.44,525,1.451,526,1.496,527,1.462,528,1.451,529,1.451,530,1.451,531,1.462,532,1.462,533,1.462,534,1.496,535,1.451,536,1.451,537,1.462,538,1.462,545,2.639,546,2.449,547,1.083,549,1.302,551,2.005,552,1.409,553,1.34,554,1.419,555,1.389,600,1.142,740,1.777,852,1.132,853,1.805,854,1.484,855,2.251,856,1.142,857,1.142,858,1.821,862,1.142,863,1.142,864,0.945,866,1.142,873,2.063,1019,1.142,1400,1.507,1404,1.152,1492,1.174,1493,1.174,1494,1.174,1495,1.163,1499,1.174,1500,1.871,1501,1.163,1502,1.174,1503,1.174,1506,1.174,1507,1.174,1508,1.163,1512,1.185,1515,1.965,1516,5.193,1517,2.119,1518,2.399,1535,2.865,1666,2.331,1710,4.119,1720,5.29,2062,7.53,2065,2.677,2067,2.331,2068,4.045,2072,2.677,2076,2.677,2077,2.181,2078,2.865,2079,2.181,2081,2.865,2082,2.181,2091,2.865,2093,3.151]],["t/568",[0,1.192,7,0.607,17,0.815,31,4.433,50,2.619,75,3.979,80,1.553,81,1.769,105,1.055,117,1.668,244,2.45,249,4.537,252,2.948,277,1.551,631,3.747,1638,6.334,1665,6.334,2008,6.823]],["t/570",[16,3.06,59,5.835,67,4.859,117,1.76,128,5.276,149,1.04,202,3.035,244,2.217,299,3.55,743,4.934]],["t/572",[0,1.175,1,1.317,3,1.086,7,0.796,9,1.548,14,1.021,16,2.246,17,0.758,19,3.119,29,2.445,41,1.6,44,2.124,50,2.028,52,3.669,80,1.548,83,2.341,92,1.983,93,2.591,94,1.506,95,1.243,102,1.7,105,1.001,106,3.567,119,2.821,141,1.267,154,1.954,174,3.322,188,3.567,215,1.415,221,2.736,223,2.246,224,1.257,225,3.64,234,2.763,244,1.627,261,2.356,277,0.944,279,3.463,302,2.38,314,2.283,333,2.763,405,2.944,438,3.119,439,2.013,440,1.397,441,4.386,442,4.813,444,2.21,445,2.141,446,2.075,447,2.692,509,1.573,563,2.445,603,2.511,616,2.382,621,3.196,629,2.631,630,2.631,631,2.489,636,2.822,712,2.709,1018,4.662,1169,3.322,1340,3.011,1487,3.622,1701,4.591]],["t/574",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.451,244,2.196,261,2.828,277,1.275]],["t/576",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,509,1.996,603,3.185,616,3.021,636,3.266,1340,3.819]],["t/579",[0,1.175,3,1.024,6,4.801,7,0.631,23,7.09,90,3.432,105,0.819,117,1.734,202,3.43,231,3.432,664,3.825,743,4.861,779,7.829,2094,9.215]],["t/581",[0,0.839,3,0.513,5,2.65,6,3.053,7,0.663,14,0.665,17,0.328,23,3.549,25,1.275,27,1.855,37,2.193,41,1.307,64,1.247,75,2.07,77,2.733,79,1.332,81,1.582,94,0.601,95,1.023,102,1.703,105,0.86,106,5.025,110,1.204,117,1.82,120,3.414,124,1.195,135,1.855,141,0.851,146,2.013,149,1.138,158,1.66,164,1.332,186,2.739,187,1.064,189,1.163,196,2.308,202,1.496,209,1.239,215,1.91,224,1.318,231,1.718,270,2.96,275,1.171,276,1.171,277,1.091,297,1.573,318,2.562,321,1.187,322,2.276,323,1.881,402,1.88,407,2.115,412,2.258,415,1.451,418,2.038,425,1.123,428,1.147,429,1.767,434,1.247,437,2.518,440,0.938,441,4.205,442,2.821,448,2.951,449,2.655,450,2.655,451,2.655,452,2.655,453,2.85,454,2.663,455,2.177,456,2.499,457,1.322,458,2.326,459,2.274,460,2.258,461,1.322,462,2.228,463,2.258,464,1.322,465,2.069,466,2.463,467,2.499,468,2.935,469,2.274,470,1.332,471,2.507,472,1.342,473,2.499,474,2.463,475,2.427,477,2.436,479,2.717,480,1.313,481,1.322,482,1.928,483,1.293,484,1.858,485,2.071,486,1.322,487,1.373,488,1.313,489,1.322,490,2.274,491,2.274,492,1.322,493,1.239,494,2.454,497,2.225,501,2.292,504,1.332,505,1.332,506,1.332,507,1.332,508,1.322,509,1.057,510,1.139,511,1.332,512,1.899,513,1.322,514,1.332,515,1.332,516,1.332,517,1.332,518,1.332,519,1.942,524,1.322,525,1.332,526,1.373,527,1.342,528,1.332,529,1.332,530,1.332,531,1.342,532,1.342,533,1.342,534,1.373,535,1.332,536,1.332,537,1.342,538,1.342,545,2.537,546,2.369,549,1.195,551,1.885,552,1.293,553,1.23,554,1.303,555,1.275,691,2.36,852,1.657,853,2.415,854,1.363,855,2.85,856,1.672,857,1.672,858,2.437,860,2.755,862,1.672,863,1.672,864,1.383,865,2.576,866,1.672,1018,5.4,1400,1.383,1404,1.687,1513,2.945,1701,3.492,1706,2.814,2095,4.613]],["t/583",[0,1.203,80,1.6,105,0.812,117,1.718,250,6.415,265,8.091,684,6.942,1337,6.559,2096,9.562,2097,11.076,2098,9.13]],["t/586",[0,0.987,1,1.259,79,2.697,141,1.723,202,3.456,231,3.478,299,3.543,302,2.274,707,7.184,743,4.925]],["t/588",[0,0.693,1,1.418,7,0.664,14,0.704,25,1.379,29,1.965,37,2.292,41,1.355,64,1.349,75,2.632,77,3.486,79,1.441,80,0.673,81,1.654,94,1.118,95,1.108,99,8,102,1.704,105,0.873,106,4.136,110,1.302,124,1.293,135,1.938,141,1.582,146,2.076,149,1.162,158,2.047,186,2.78,187,1.151,189,1.257,196,2.393,209,1.34,215,1.863,224,1.313,236,1.451,238,1.573,270,3.005,275,1.266,276,1.266,277,1.14,297,1.701,299,3.504,318,2.617,321,1.284,322,2.36,323,1.951,402,1.965,407,2.211,412,2.36,415,1.535,418,2.113,425,1.215,428,1.24,429,1.87,434,1.349,437,2.611,440,1.015,442,3.598,448,3.021,449,2.753,450,2.753,451,2.753,452,2.753,453,2.878,454,2.727,455,2.275,456,2.592,457,1.43,458,2.431,459,2.377,460,2.36,461,1.43,462,2.31,463,2.36,464,1.43,465,2.113,466,2.554,467,2.592,468,2.997,469,2.377,470,1.441,471,2.243,472,1.452,473,2.592,474,2.554,475,1.389,477,2.512,480,1.42,481,1.43,482,2.04,483,1.399,484,1.966,485,2.164,486,1.43,487,1.485,488,1.42,489,1.43,490,2.377,491,2.377,492,1.43,493,1.34,494,2.53,497,2.325,501,2.376,504,1.441,505,1.441,506,1.441,507,1.441,508,1.43,509,1.143,510,1.232,511,1.441,512,2.01,513,1.43,514,1.441,515,1.441,516,1.441,517,1.441,518,1.441,519,2.055,524,1.43,525,1.441,526,1.485,527,1.452,528,1.441,529,1.441,530,1.441,531,1.452,532,1.452,533,1.452,534,1.485,535,1.441,536,1.441,537,1.452,538,1.452,545,2.631,546,2.443,547,1.715,549,1.293,551,1.995,552,1.399,553,1.33,554,1.409,555,1.379,600,1.808,723,5.918,785,2.249,1018,3.458,1024,3.564,1400,1.496,1513,1.451,1563,1.282,1629,1.573,1649,8,1686,2.066,1701,1.995,1706,2.343,1905,2.744,2099,4.238,2100,3.493,2101,3.841,2102,3.493,2103,9.937,2104,8,2105,9.036,2106,6.044,2107,6.044,2108,2.955,2109,3.493,2110,4.238,2111,4.238,2112,4.238,2113,2.744,2114,3.493,2115,4.238,2116,4.536,2117,4.238,2118,2.272,2119,3.493,2120,4.536,2121,2.272,2122,2.272,2123,2.066]],["t/590",[0,0.972,1,1.443,7,0.63,14,0.854,17,0.47,25,1.249,29,2.178,33,5.333,37,2.167,41,1.294,64,1.222,67,2.348,75,2.028,79,1.913,80,0.792,81,1.564,85,2.158,94,0.863,95,1.015,96,2.696,102,1.702,105,0.817,106,4.485,110,1.18,124,1.171,135,1.833,141,1.593,144,2.103,146,1.997,149,1.132,150,1.653,158,1.936,186,2.728,187,1.042,189,1.139,196,2.286,202,2.544,209,1.214,215,1.616,223,1.478,224,1.228,231,3.216,270,2.949,275,1.147,276,1.147,277,1.078,297,1.541,299,3.766,302,1.101,318,2.548,321,1.163,322,2.254,323,1.863,341,4.11,402,1.858,407,2.091,412,2.231,415,1.429,418,2.019,425,1.101,428,1.123,429,1.741,434,1.222,437,2.494,440,0.919,441,4.181,442,3.856,448,2.932,449,2.63,450,2.63,451,2.63,452,2.63,453,2.842,454,2.646,455,2.151,456,2.475,457,1.296,458,2.299,459,2.248,460,2.231,461,1.296,462,2.207,463,2.231,464,1.296,465,2.057,466,2.439,467,2.475,468,2.918,469,2.248,470,1.305,471,2.121,472,1.315,473,2.475,474,2.439,475,1.258,477,2.416,480,1.286,481,1.296,482,1.899,483,1.267,484,1.831,485,2.047,486,1.296,487,1.345,488,1.286,489,1.296,490,2.248,491,2.248,492,1.296,493,1.214,494,2.433,497,2.199,501,2.27,504,1.305,505,1.305,506,1.305,507,1.305,508,1.296,509,1.035,510,1.116,511,1.305,512,1.871,513,1.296,514,1.305,515,1.305,516,1.305,517,1.305,518,1.305,519,1.913,524,1.296,525,1.305,526,1.345,527,1.315,528,1.305,529,1.305,530,1.305,531,1.315,532,1.315,533,1.315,534,1.345,535,1.305,536,1.305,537,1.315,538,1.315,545,2.513,546,2.349,547,1.554,549,1.171,551,1.858,552,1.267,553,1.205,554,1.277,555,1.249,605,2.505,634,2.005,664,1.876,860,2.7,1018,4.554,1024,3.229,1400,1.356,1427,3.477,1520,3.477,1701,4.485,1706,2.757,1867,3.638,1905,3.229,1948,2.819,2099,3.84,2100,4.11,2102,4.11,2106,5.628,2107,5.628,2109,4.11,2110,3.84,2111,3.84,2112,3.84,2114,4.11,2115,3.84,2117,3.84,2119,4.11,2124,4.11,2125,4.52,2126,4.52,2127,4.52,2128,4.52,2129,4.52]],["t/593",[0,0.956,7,0.756,9,1.585,44,2.798,67,5.731,75,4.06,105,0.804,160,4.772,202,2.935,215,2.156,224,1.286,231,3.896,501,2.378,597,4.21,659,4.808,1723,7.282,1728,8.226,1794,5.922,1902,8.226,2124,8.226,2130,8.226]],["t/595",[0,0.513,7,0.417,14,0.691,17,0.345,25,1.342,29,0.716,37,2.258,41,1.338,64,1.313,67,5.197,75,1.355,77,1.228,79,1.403,81,1.525,94,0.633,95,1.176,102,1.707,105,0.932,106,1.568,110,1.268,116,2.319,124,1.259,135,1.91,141,0.896,146,2.055,149,1.165,158,1.723,186,2.766,187,1.12,189,1.224,196,2.364,209,1.304,215,1.949,224,1.27,226,2.082,231,1.125,244,0.716,270,2.99,275,1.233,276,1.233,277,1.123,297,1.656,318,2.599,321,1.25,322,2.331,323,1.927,402,1.936,405,2.082,407,2.178,412,2.325,415,1.506,418,2.088,425,1.183,428,1.207,429,1.834,434,1.313,437,2.579,440,0.988,441,4.045,442,4.198,448,2.997,449,2.72,450,2.72,451,2.72,452,2.72,453,2.868,454,2.705,455,2.241,456,2.56,457,1.392,458,2.395,459,2.342,460,2.325,461,1.392,462,2.282,463,2.325,464,1.392,465,2.098,466,2.523,467,2.56,468,2.976,469,2.342,470,1.403,471,2.558,472,1.413,473,2.56,474,2.523,475,2.486,477,2.486,479,2.618,480,1.382,481,1.392,482,2.001,483,1.362,484,1.929,485,2.132,486,1.392,487,1.445,488,1.382,489,1.392,490,2.342,491,2.342,492,1.392,493,1.304,494,2.504,497,2.291,501,2.589,504,1.403,505,1.403,506,1.403,507,1.403,508,1.392,509,1.113,510,1.199,511,1.403,512,1.971,513,1.392,514,1.403,515,1.403,516,1.403,517,1.403,518,1.403,519,2.016,524,1.392,525,1.403,526,1.445,527,1.413,528,1.403,529,1.403,530,1.403,531,1.413,532,1.413,533,1.413,534,1.445,535,1.403,536,1.403,537,1.413,538,1.413,545,2.599,546,2.418,547,1.67,549,1.259,551,1.957,552,1.362,553,1.295,554,1.372,555,1.342,564,1.735,600,1.094,747,1.339,853,1.744,854,1.435,864,1.457,1018,5.761,1216,3.91,1397,2.157,1400,1.457,1512,1.826,1701,2.522,1723,8.438,1724,4.126,2123,2.746,2131,3.02,2132,4.856,2133,4.856,2134,8.169,2135,4.856,2136,4.856,2137,4.856,2138,4.856,2139,4.856,2140,3.02,2141,3.02,2142,3.02,2143,3.02]],["t/598",[0,0.958,7,0.621,9,1.588,30,2.803,75,4.699,77,3.684,94,1.181,105,0.931,128,5.111,139,5.111,149,1.007,150,3.314,202,3.397,223,2.964,231,3.375,232,5.933,259,6.273,453,2.268,743,4.78,817,5.529,1302,6.973,1609,8.241,1629,6.273,2144,6.973]],["t/600",[0,0.449,7,0.7,14,0.748,17,0.449,20,1.927,25,1.173,29,2.305,30,1.313,37,2.088,41,1.255,51,2,64,1.148,77,1.725,79,1.226,80,0.743,81,1.261,94,1.224,95,1.148,102,1.703,105,0.95,106,5.55,110,1.108,116,3.019,120,1.497,124,1.1,128,3.566,135,1.767,141,0.783,146,2.04,149,1.156,158,1.561,163,3.284,186,2.693,187,0.979,189,1.07,195,1.511,196,2.217,202,2.051,209,1.139,215,1.557,223,2.472,224,1.191,229,3.265,270,2.911,275,1.077,276,1.077,277,1.152,297,1.447,301,2.937,318,2.502,321,1.092,322,2.186,323,1.807,402,2.122,407,2.015,412,2.15,415,1.364,418,1.958,425,1.033,428,1.055,429,1.662,430,2.853,434,1.148,437,2.419,438,1.927,440,0.863,441,4.436,448,2.873,449,2.55,450,2.55,451,2.55,452,2.55,453,2.818,454,2.593,455,2.073,456,2.401,457,1.217,458,2.216,459,2.166,460,2.15,461,1.217,462,2.14,463,2.15,464,1.217,465,2.02,466,2.366,467,2.401,468,2.866,469,2.166,470,1.226,471,2.422,472,1.235,473,2.401,474,2.366,475,2.493,476,1.927,477,2.354,479,2.626,480,1.208,481,1.217,482,1.813,483,1.19,484,1.747,485,1.972,486,1.217,487,1.263,488,1.208,489,1.217,490,2.166,491,2.166,492,1.217,493,1.139,494,2.371,497,2.119,501,2.468,504,1.226,505,1.226,506,1.226,507,1.226,508,1.217,509,0.972,510,1.048,511,1.226,512,1.786,513,1.217,514,1.226,515,1.226,516,1.226,517,1.226,518,1.226,519,1.826,524,1.217,525,1.226,526,1.263,527,1.235,528,1.226,529,1.226,530,1.226,531,1.235,532,1.235,533,1.235,534,1.263,535,1.226,536,1.226,537,1.235,538,1.235,545,2.437,546,2.289,547,1.459,549,1.1,551,1.773,552,1.19,553,1.131,554,1.199,555,1.173,600,1.538,728,3.859,734,2.351,809,3.031,817,2.589,854,1.254,860,3.777,864,1.273,1015,3.605,1016,6.421,1017,9.176,1018,5.131,1019,2.291,1020,6.421,1021,3.605,1022,3.605,1023,3.605,1024,3.031,1025,3.605,1026,3.605,1027,3.605,1028,3.605,1080,3.859,1400,1.273,1421,2.853,1495,1.566,1501,1.566,1508,2.333,1618,3.859,1706,2.589,1908,3.139,2145,7.609,2146,5.372,2147,3.605,2148,3.605,2149,4.243,2150,4.243,2151,4.243,2152,4.243,2153,4.243,2154,4.243]],["t/602",[7,0.586,9,1.5,55,4.515,60,6.891,94,1.32,105,0.959,116,5.149,128,4.828,231,3.772,236,5.465,243,6.886,269,7.963,277,1.177,304,3.444,323,2.405,402,2.028,408,5.439,415,2.327,419,3.711,431,5.711,462,2.756,798,5.924,875,4.828,1565,7.783,1649,8.152,1818,6.332,2155,6.891,2156,8.559,2157,10.785,2158,8.559,2159,10.785,2160,8.559,2161,8.559]],["t/604",[0,1.207,1,1.168,7,0.782,9,1.518,67,5.298,75,4.577,77,4.407,79,2.503,90,3.227,94,1.129,105,1.028,117,1.919,128,4.887,141,1.882,149,0.963,183,3.888,223,3.336,231,3.227,232,5.672,289,4.326,299,3.288,302,2.11,405,3.715,549,2.644,605,4.801,684,6.223,1398,7.287,1798,6.975]],["t/606",[0,0.929,16,3.677,67,5.342,79,2.538,117,2.051,128,5.801,188,4.565,202,3.826,247,5.481,277,1.576,299,3.903,553,2.343,561,4.87,669,7.193,1128,9.552]],["t/608",[0,1.141,1,1.156,3,0.953,7,0.587,14,0.848,16,2.804,17,0.72,29,2.032,31,3.676,32,3.559,41,1.285,50,2.994,75,3.848,81,2.022,94,1.118,105,0.96,115,5.766,149,0.953,150,3.135,157,5.122,244,2.032,265,6.597,307,3.193,321,2.609,324,4.671,371,4.094,388,6.343,564,6.538,597,3.991,643,2.948,715,4.263,717,4.324,1619,7.797,1638,6.125,1665,6.125,1948,5.348,2162,7.257,2163,10.137,2164,8.574,2165,7.8,2166,6.125,2167,8.574]],["t/610",[0,1.101,1,1.211,3,1.099,7,0.806,9,1.234,10,3.658,13,2.553,14,0.979,16,2.304,17,0.764,19,3.17,29,2.344,32,4.106,41,1.613,44,2.779,50,2.081,52,3.729,80,1.574,83,2.402,92,2.034,93,2.634,94,1.533,95,1.28,96,3.582,102,1.696,105,0.957,119,3.69,141,1.3,154,2.964,174,3.408,188,3.658,205,2.179,221,2.806,223,2.304,224,1.277,225,3.684,234,2.834,244,1.669,277,0.969,302,2.408,314,2.342,319,3.552,333,2.834,404,2.362,439,2.065,440,1.433,444,2.267,445,2.196,446,2.715,447,2.736,509,1.614,603,2.576,616,2.443,620,4.611,621,3.278,636,2.868,1078,3.903,1169,3.408,1279,5.032,1340,3.088]],["t/612",[7,0.638,9,1.633,10,4.841,83,3.178,102,1.299,154,3.028,205,2.883,224,1.325,225,3.471,244,2.208,277,1.282]],["t/614",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,509,1.996,603,3.185,616,3.021,636,3.266,1340,3.819]],["t/617",[7,0.774,17,0.555,27,1.827,29,2.562,31,4.757,32,4.605,41,1.554,44,2.417,92,2.257,93,2.81,94,1.526,95,1.262,96,3.566,102,1.707,224,1.111,319,3.535,439,2.291,440,1.589,444,2.515,445,2.436,446,2.897,447,3.158,636,2.494,741,4.989,747,3.466]],["t/619",[0,0.826,1,1.053,3,0.499,7,0.71,14,0.652,17,0.319,25,1.241,29,1.064,31,3.931,32,3.978,37,2.159,41,1.29,50,1.327,64,1.783,81,1.315,94,1.291,95,0.862,102,1.703,104,2.971,105,0.922,110,1.172,124,1.709,135,1.826,141,0.829,146,2.207,149,1.129,150,3.353,158,1.109,176,1.673,186,2.725,187,1.036,189,1.132,196,2.279,209,1.206,210,1.704,215,1.61,224,1.224,261,1.758,270,2.945,275,1.14,276,1.14,277,1.074,318,2.543,321,1.156,322,2.247,323,1.858,402,1.851,407,2.083,412,2.223,415,1.423,418,2.012,425,1.094,428,1.116,429,1.733,434,1.215,437,2.486,440,0.913,448,2.926,449,2.622,450,2.622,451,2.622,452,2.622,453,2.84,454,2.641,455,1.809,456,2.468,457,1.287,458,2.29,459,2.24,460,2.223,461,1.287,462,2.2,463,2.223,464,1.287,465,2.053,466,2.432,467,2.468,468,2.913,469,2.24,470,1.297,471,2.48,472,1.307,473,2.468,474,2.432,475,2.396,476,2.039,477,2.41,479,2.524,480,1.278,481,1.287,482,1.89,483,1.259,484,1.822,485,2.247,486,1.287,487,1.337,488,1.278,489,1.287,490,2.24,491,2.24,492,1.287,493,1.77,494,2.427,497,2.414,501,1.733,504,1.297,505,1.297,506,1.297,507,1.297,508,1.287,509,1.029,510,1.109,511,1.297,512,1.862,513,1.287,514,1.297,515,1.297,516,1.297,517,1.297,518,1.297,519,1.904,524,1.287,525,1.297,526,1.337,527,1.307,528,1.297,529,1.297,530,1.297,531,1.307,532,1.307,533,1.307,534,1.337,535,1.297,536,1.297,537,1.307,538,1.307,545,2.505,546,2.343,547,1.544,549,1.164,551,1.849,552,1.259,553,1.197,554,1.269,555,1.241,601,4.164,602,2.801,636,1.434,682,3.208,739,2.74,854,1.327,864,1.347,1019,1.627,1400,1.347,1492,1.673,1493,1.673,1494,1.673,1495,1.657,1499,1.673,1500,2.456,1501,1.657,1502,1.673,1503,1.673,1506,1.673,1507,1.673,1508,1.657,1512,1.688,1717,6.783,1966,3.615,1969,3.455,1973,3.615,2052,4.084,2168,7.828,2169,7.828,2170,9.168,2171,4.491,2172,4.491,2173,4.084,2174,4.084,2175,4.491,2176,4.491,2177,4.491]],["t/621",[0,0.822,1,0.883,3,0.728,7,0.654,13,1.613,14,0.769,16,1.456,17,0.465,25,1.23,27,1.817,29,1.055,30,1.377,31,4.435,37,2.148,41,1.285,64,1.204,79,1.285,80,1.147,81,1.55,94,0.58,95,1.054,102,1.701,105,0.849,109,2.213,110,1.162,117,1.718,120,3.223,124,1.153,130,2.636,135,1.817,141,0.821,146,1.984,149,1.169,158,1.617,164,1.285,183,1.997,186,2.72,187,1.026,189,1.122,196,2.269,200,2.347,209,1.195,215,1.602,224,1.299,261,1.186,270,2.939,275,1.129,276,1.129,277,1.069,288,2.213,297,1.517,304,1.791,307,1.657,318,2.537,319,2.65,321,1.145,322,2.237,323,1.849,371,2.125,402,1.841,407,2.072,412,2.211,415,1.677,418,2.004,419,1.929,425,1.084,428,1.106,429,1.722,434,1.204,437,2.475,440,0.905,448,2.918,449,2.61,450,2.61,451,2.61,452,2.61,453,2.836,454,2.702,455,2.132,456,2.457,457,1.276,458,2.278,459,2.228,460,2.211,461,1.276,462,2.19,463,2.211,464,1.276,465,2.048,466,2.421,467,2.457,468,2.905,469,2.228,470,1.285,471,2.47,472,1.295,473,2.457,474,2.421,475,2.386,476,2.974,477,2.401,479,2.678,480,1.266,481,1.276,482,1.878,483,1.248,484,1.81,485,2.028,486,1.276,487,1.325,488,1.266,489,1.276,490,2.228,491,2.228,492,1.276,493,1.195,494,2.418,497,2.179,501,2.253,504,1.285,505,1.285,506,1.285,507,1.285,508,1.276,509,1.02,510,1.099,511,1.285,512,1.85,513,1.276,514,1.285,515,1.285,516,1.285,517,1.285,518,1.285,519,1.892,524,1.276,525,1.285,526,1.325,527,1.295,528,1.285,529,1.285,530,1.285,531,1.295,532,1.295,533,1.295,534,1.325,535,1.285,536,1.285,537,1.295,538,1.295,545,2.494,546,2.335,549,1.153,551,1.837,552,1.248,553,1.186,554,1.257,555,1.23,624,2.466,638,1.929,643,1.53,674,4.845,691,2.277,694,2.658,739,2.715,747,1.974,848,2.556,852,1.598,853,2.352,854,1.315,855,2.791,856,1.613,857,1.613,858,2.373,862,1.613,863,1.613,864,1.335,865,2.509,866,1.613,1078,2.466,1400,1.335,1404,1.627,1419,2.715,1420,2.992,1563,2.51,1587,3.424,1650,2.776,1667,2.842,1863,4.047,1969,3.424,2038,3.424,2168,9.406,2169,9.406,2173,4.047,2174,4.047,2178,4.45,2179,3.08]],["t/623",[27,2.158,45,4.467,81,1.842,105,0.941,149,1.237,150,3.87,277,1.27,279,4.656,681,5.758,706,6.928,715,4.59,2007,6.39]],["t/625",[0,1.145,6,3.929,7,0.796,9,1.999,14,0.657,17,0.614,27,2.023,41,1.624,51,4.078,77,2.701,80,1.164,92,1.919,93,2.537,94,1.515,95,1.259,102,1.704,105,0.906,147,5.725,150,2.43,195,2.366,250,4.054,272,3.304,279,5.91,302,1.618,361,3.561,439,1.948,440,1.352,444,2.138,445,2.072,446,2.615,447,2.93,563,3.425,602,4.145,625,2.121,629,2.546,630,2.546,631,2.408,632,3.62,633,3.505,646,2.914,873,4.35,1337,4.145,1342,2.621,1447,6.042,1524,4.35,1605,5.349,1745,6.659,1803,6.042,1848,5.646,1878,5.646,2007,5.989,2180,8.275,2181,8.721,2182,6.645,2183,6.645,2184,6.645]],["t/627",[0,0.678,1,1.03,7,0.648,13,3.272,14,0.635,17,0.455,25,1.195,37,2.112,41,1.267,64,1.734,80,0.758,81,1.279,94,0.564,95,1.044,102,1.705,104,3.015,105,0.841,108,2.847,110,1.129,124,1.662,135,1.787,141,1.183,146,2.184,147,4.427,149,1.117,158,2.334,186,2.704,187,0.998,189,1.09,196,2.238,205,1.338,209,1.722,215,1.575,224,1.284,270,2.922,275,1.098,276,1.098,277,1.051,279,4.552,318,2.516,321,1.113,322,2.206,323,1.824,402,1.811,407,2.038,412,2.175,415,1.384,418,1.976,425,1.053,428,1.075,429,1.686,434,1.17,437,2.441,440,0.88,448,2.891,449,2.574,450,2.574,451,2.574,452,2.574,453,2.825,454,2.609,455,1.76,456,2.423,457,1.24,458,2.241,459,2.191,460,2.175,461,1.24,462,2.16,463,2.175,464,1.24,465,2.031,466,2.388,467,2.423,468,2.882,469,2.191,470,1.249,471,2.441,472,1.259,473,2.423,474,2.388,475,2.353,477,2.373,479,2.478,480,1.231,481,1.24,482,1.839,483,1.213,484,1.772,485,2.206,486,1.24,487,1.287,488,1.231,489,1.24,490,2.191,491,2.191,492,1.24,493,1.722,494,2.39,497,2.37,501,1.686,504,1.249,505,1.249,506,1.249,507,1.249,508,1.24,509,0.991,510,1.068,511,1.249,512,1.812,513,1.24,514,1.249,515,1.249,516,1.249,517,1.249,518,1.249,519,1.852,524,1.24,525,1.249,526,1.287,527,1.259,528,1.249,529,1.249,530,1.249,531,1.259,532,1.259,533,1.259,534,1.287,535,1.249,536,1.249,537,1.259,538,1.259,545,2.46,546,2.307,547,2.205,549,1.121,551,1.798,552,1.213,553,1.153,554,1.222,555,1.195,662,3.272,681,5.631,854,1.278,859,1.795,864,1.923,1019,1.568,1029,2.151,1392,3.675,1400,1.297,1492,1.611,1493,1.611,1494,1.611,1495,1.596,1496,2.151,1499,1.611,1500,2.389,1501,1.596,1502,1.611,1503,2.389,1506,1.611,1507,1.611,1508,1.596,1512,1.626,1745,6.248,2180,5.654,2181,8.092,2185,9.638,2186,8.209,2187,6.493,2188,4.325,2189,5.832,2190,3.675,2191,3.933,2192,3.933,2193,3.933,2194,3.933,2195,3.675,2196,3.675,2197,4.325,2198,4.325,2199,4.325,2200,3.933,2201,3.675,2202,3.933]],["t/629",[0,0.718,1,0.63,7,0.638,9,1.757,14,0.791,17,0.482,25,1.292,27,2.051,37,2.209,41,1.315,64,1.264,79,1.35,81,1.354,94,0.609,95,1.028,102,1.703,105,0.828,108,3.62,110,1.22,117,1.65,120,3.288,124,1.211,135,1.869,141,0.862,146,2.024,149,1.142,158,1.676,164,1.35,183,2.097,186,2.746,187,1.078,189,1.178,196,2.467,209,1.255,215,1.647,224,1.247,250,2.851,270,2.968,275,1.186,276,1.186,277,1.099,296,2.792,297,1.594,318,2.572,321,1.203,322,2.29,323,1.893,402,2.079,407,2.131,412,2.275,415,1.465,418,2.051,425,1.138,428,1.162,429,1.784,434,1.264,437,2.534,440,0.951,448,2.963,449,2.672,450,2.672,451,2.672,452,2.672,453,2.855,454,2.674,455,2.193,456,2.515,457,1.34,458,2.344,459,2.292,460,2.275,461,1.34,462,2.242,463,2.275,464,1.34,465,2.117,466,2.478,467,2.515,468,2.946,469,2.292,470,1.35,471,2.52,472,1.36,473,2.515,474,2.478,475,2.442,477,2.449,479,2.732,480,1.33,481,1.34,482,1.946,483,1.311,484,1.876,485,2.086,486,1.34,487,1.391,488,1.33,489,1.34,490,2.292,491,2.292,492,1.34,493,1.255,494,2.467,497,2.242,501,2.306,504,1.35,505,1.35,506,1.35,507,1.35,508,1.34,509,1.071,510,1.154,511,1.35,512,1.918,513,1.34,514,1.35,515,1.35,516,1.35,517,1.35,518,1.35,519,1.961,524,1.34,525,1.35,526,1.391,527,1.36,528,1.35,529,1.35,530,1.35,531,1.36,532,1.36,533,1.36,534,1.391,535,1.35,536,1.35,537,1.36,538,1.36,545,2.553,546,2.381,549,1.211,551,1.904,552,1.311,553,1.246,554,1.32,555,1.292,563,1.664,662,1.694,852,1.679,853,2.438,854,1.381,855,2.871,856,1.694,857,1.694,858,2.46,859,1.94,862,1.694,863,1.694,864,1.402,865,2.601,866,1.694,1400,1.402,1404,1.709,1563,2.636,2187,8.521,2196,3.971,2203,3.971,2204,4.25]],["t/631",[1,0.314,7,0.637,9,1.343,14,0.713,17,0.279,25,1.404,27,1.685,37,2.315,41,1.366,55,1.229,64,1.612,79,1.133,81,1.438,94,0.662,95,1.027,102,1.707,105,0.827,108,3.395,110,1.326,117,1.514,120,2.347,123,3.057,124,1.545,135,1.958,141,0.937,146,2.147,147,3.261,149,1.168,150,0.852,158,2.137,164,1.133,186,2.79,187,1.172,189,1.281,192,1.793,196,2.413,209,1.364,215,1.726,224,1.296,270,3.015,275,1.29,276,1.29,277,1.152,279,3.354,297,1.338,318,2.63,321,1.308,322,2.379,323,1.967,328,3.709,402,1.985,407,2.233,412,2.384,415,1.555,418,2.131,425,1.237,428,1.263,429,1.895,434,1.374,437,2.633,440,1.034,448,3.037,449,2.776,450,2.776,451,2.776,452,2.776,453,2.884,454,2.741,455,2.209,456,2.613,457,1.457,458,2.456,459,2.401,460,2.384,461,1.457,462,2.33,463,2.384,464,1.457,465,2.123,466,2.575,467,2.613,468,3.012,469,2.401,470,1.468,471,2.603,472,1.479,473,2.613,474,2.575,475,2.538,477,2.53,479,2.777,480,1.446,481,1.457,482,2.066,483,1.425,484,1.992,485,2.26,486,1.457,487,1.512,488,1.446,489,1.457,490,2.401,491,2.401,492,1.457,493,1.6,494,2.548,497,2.428,501,2.276,504,1.468,505,1.468,506,1.468,507,1.468,508,1.457,509,1.164,510,1.254,511,1.468,512,2.036,513,1.457,514,1.468,515,1.468,516,1.468,517,1.468,518,1.468,519,2.082,524,1.457,525,1.468,526,1.512,527,1.479,528,1.468,529,1.468,530,1.468,531,1.479,532,1.479,533,1.479,534,1.512,535,1.468,536,1.468,537,1.479,538,1.479,545,2.652,546,2.46,547,0.801,549,1.317,551,2.021,552,1.425,553,1.355,554,1.435,555,1.404,662,0.845,681,4.148,740,1.314,852,1.409,853,2.141,854,1.501,855,2.589,856,1.422,857,1.422,858,2.16,859,1.629,862,1.422,863,1.422,864,1.177,865,1.503,866,1.422,1019,0.845,1111,1.291,1400,1.524,1404,1.435,1492,0.868,1493,0.868,1494,0.868,1495,0.86,1499,0.868,1500,1.461,1501,0.86,1502,0.868,1503,0.868,1506,0.868,1507,0.868,1508,0.86,1512,0.876,1518,1.873,1534,3.307,1667,1.488,2038,1.793,2180,3.759,2181,6.171,2185,8.094,2186,6.048,2187,7.563,2189,2.119,2190,1.98,2191,2.119,2192,2.119,2193,2.119,2194,2.119,2195,1.98,2196,3.333,2200,2.119,2201,1.98,2202,2.119,2203,1.98,2204,2.119,2205,2.33,2206,2.33,2207,2.33]],["t/633",[0,1.16,7,0.711,9,1.562,17,0.826,31,4.447,80,1.562,105,0.922,117,1.677,149,0.991,154,2.951,244,2.599,252,2.964,277,1.553,631,3.759,681,5.561,706,6.79,1638,7.409]],["t/635",[0,1.095,7,0.71,8,7.561,16,2.911,17,0.736,30,3.205,83,3.034,90,3.314,95,0.982,105,0.791,115,5.984,133,4.492,149,1.218,150,3.254,196,2.356,244,2.109,301,7.587,317,3.655,389,4.883,563,3.168,582,5.019,756,8.092,1012,5.551,1036,5.826,1745,6.16,1848,7.561,2208,8.899]],["t/637",[0,1.215,1,1.412,3,1.211,7,0.765,9,1.835,14,1.036,16,2.614,17,0.744,19,3.695,27,1.868,41,1.569,44,2.472,50,2.36,52,4.034,80,1.4,83,2.724,94,1.48,95,1.203,102,1.114,105,1.022,110,2.086,119,3.282,141,1.474,149,1.08,154,2.274,174,3.866,221,3.183,223,2.614,224,1.382,225,3.9,234,3.216,244,1.894,261,2.591,277,1.099,302,2.55,314,2.657,333,3.216,405,3.426,509,1.831,563,3.879,603,2.922,616,2.771,620,5.231,621,3.719,636,3.343,646,3.504,1169,3.866,1340,3.504]],["t/639",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.451,244,2.196,261,2.828,277,1.275]],["t/641",[0,1.217,1,1.36,3,0.945,7,0.762,14,0.998,17,0.716,27,1.987,41,1.612,44,2.629,50,2.511,52,4.186,94,1.501,95,1.228,105,1.024,110,2.219,141,1.568,149,1.121,154,2.419,221,3.386,234,3.421,302,2.619,314,2.826,333,3.421,509,1.948,563,3.59,603,3.108,616,2.948,636,3.433,646,3.727,1340,3.727]],["t/643",[0,1.239,1,1.191,7,0.786,9,1.548,79,3.156,94,1.345,95,0.975,105,0.972,117,1.662,302,2.151,314,3.431,323,1.907,356,6.754,476,4.686,510,2.181,563,3.673,564,5.075,600,3.202,658,5.173,664,3.667,881,6.312,1568,7.507]],["t/645",[0,1.158,7,0.787,14,0.685,17,0.631,27,2.294,29,2.453,41,1.471,51,4.188,57,4.859,75,3.108,92,2,93,2.605,94,1.548,95,1.29,96,3.681,102,1.707,105,0.79,216,3.978,307,2.579,319,3.798,324,3.773,439,2.03,440,1.409,444,2.229,445,2.159,446,2.686,447,2.988,563,3.811,602,4.319,616,2.402,625,3.497,629,2.653,630,2.653,631,2.51,634,3.071,636,3.133,637,4.137,646,3.896,656,5.817,676,5.328,1036,4.533,1534,3.443,1641,4.793,2209,6.925,2210,6.297]],["t/647",[0,0.985,75,4.182,95,1.029,143,7.171,211,5.077,216,5.354,563,3.318,848,5.354,1036,6.101,1607,7.918,2211,7.918,2212,8.475]],["t/649",[0,0.995,1,1.023,7,0.731,9,0.58,11,0.719,12,1.866,14,0.772,17,0.483,25,1.294,27,2.134,28,1.777,29,1.979,37,2.211,41,1.368,50,0.396,51,1.141,57,3.63,64,1.266,79,1.352,80,0.235,81,1.466,85,3.245,92,0.388,93,0.71,94,1.215,95,1.164,96,3.689,102,1.707,105,0.892,108,2.121,110,1.222,117,1.754,120,3.432,124,1.213,130,1.884,135,1.871,141,1.051,146,2.025,149,1.143,150,0.491,152,0.965,158,1.678,164,1.352,186,2.747,187,1.08,189,1.18,196,2.324,209,1.257,210,1.538,215,1.649,224,1.248,231,0.902,252,0.446,260,0.959,270,2.969,275,1.188,276,1.188,277,1.101,279,3.264,297,1.596,302,0.806,314,0.446,318,2.573,319,2.417,321,1.205,322,2.292,323,1.895,337,2.774,361,0.719,402,2.163,404,0.45,407,2.133,412,2.277,415,1.467,418,2.18,425,1.14,428,1.164,429,1.787,434,1.266,437,2.536,438,1.84,439,0.393,440,1.063,444,0.432,445,0.418,446,0.732,447,1.008,448,2.964,449,2.674,450,2.674,451,2.674,452,2.674,453,2.855,454,2.675,455,2.195,456,2.517,457,1.342,458,2.346,459,2.294,460,2.277,461,1.342,462,2.244,463,2.277,464,1.342,465,2.077,466,2.48,467,2.517,468,2.947,469,2.294,470,1.352,471,2.522,472,1.362,473,2.517,474,2.48,475,2.444,477,2.451,479,2.734,480,1.332,481,1.342,482,1.949,483,1.313,484,1.878,485,2.089,486,1.342,487,1.394,488,1.332,489,1.342,490,2.294,491,2.294,492,1.342,493,1.257,494,2.468,497,2.244,501,2.451,504,1.352,505,1.352,506,1.352,507,1.352,508,1.342,509,1.073,510,1.508,511,1.352,512,1.92,513,1.342,514,1.352,515,1.352,516,1.352,517,1.352,518,1.352,519,1.963,524,1.342,525,1.352,526,1.394,527,1.362,528,1.352,529,1.352,530,1.352,531,1.362,532,1.362,533,1.362,534,1.394,535,1.352,536,1.352,537,1.362,538,1.362,545,2.555,546,2.383,549,1.213,551,1.906,552,1.313,553,1.248,554,1.323,555,1.294,563,2.42,600,0.486,625,2.879,629,0.514,630,0.514,631,0.486,634,1.468,636,1.668,656,1.585,658,1.418,659,1.521,660,1.863,662,1.199,663,4.205,664,0.557,665,1.51,666,1.791,667,1.22,668,1.22,676,1.863,687,0.687,688,1.863,691,0.687,695,0.929,712,0.529,715,0.667,852,1.682,853,2.441,854,1.383,855,2.874,856,1.697,857,1.697,858,2.463,859,0.557,862,1.697,863,1.697,864,1.404,865,2.604,866,1.697,882,1.08,1018,5.467,1067,1.863,1111,2.595,1115,1.032,1295,2.812,1349,0.786,1400,1.404,1401,2.797,1404,1.712,1421,0.902,1513,2.99,1605,1.08,1641,0.929,1667,1.546,1732,1.08,1744,1.239,1750,3.336,1756,0.857,1818,0.993,1921,1.14,2010,0.959,2038,1.863,2155,1.08,2213,1.342,2214,1.342,2215,1.342,2216,4.052,2217,6.107,2218,1.342,2219,1.342,2220,1.342,2221,3.309,2222,5.695,2223,1.342,2224,1.342,2225,1.342,2226,1.342,2227,3.464,2228,4.584,2229,1.08,2230,1.342]],["t/651",[0,0.952,1,0.928,7,0.721,14,0.716,17,0.426,25,1.316,27,2.167,28,1.807,29,1.79,33,1.347,37,2.233,41,1.389,51,0.788,57,2.87,64,1.288,79,1.376,81,1.373,85,2.594,90,0.623,92,0.483,93,0.864,94,1.208,95,1.179,96,3.674,102,1.707,105,0.877,110,1.243,117,1.766,120,2.115,123,4.202,124,1.234,135,1.889,141,0.879,146,2.039,149,1.148,158,1.699,164,1.376,176,0.623,186,2.756,187,1.099,189,1.2,196,2.343,209,1.279,210,1.807,215,1.665,224,1.258,231,0.623,252,0.556,260,1.195,270,2.979,275,1.209,276,1.209,277,1.111,279,2.739,297,1.624,302,0.407,314,0.98,318,2.585,319,2.206,321,1.226,322,2.31,323,1.91,337,2.163,402,2.166,407,2.154,412,2.299,415,1.485,418,2.195,425,1.16,428,1.184,429,1.809,434,1.288,437,2.556,438,2.163,439,0.49,440,1.105,444,0.538,445,0.521,446,0.891,447,0.898,448,2.98,449,2.695,450,2.695,451,2.695,452,2.695,453,2.861,454,2.689,455,2.217,456,2.537,457,1.365,458,2.369,459,2.316,460,2.299,461,1.365,462,2.262,463,2.299,464,1.365,465,2.087,466,2.5,467,2.537,468,2.961,469,2.316,470,1.376,471,2.539,472,1.386,473,2.537,474,2.5,475,2.464,477,2.468,479,2.752,480,1.355,481,1.365,482,1.973,483,1.336,484,1.902,485,2.109,486,1.365,487,1.418,488,1.355,489,1.365,490,2.316,491,2.316,492,1.365,493,1.279,494,2.485,497,2.266,501,2.468,504,1.376,505,1.376,506,1.376,507,1.376,508,1.365,509,1.091,510,1.176,511,1.376,512,1.944,513,1.365,514,1.376,515,1.376,516,1.376,517,1.376,518,1.376,519,1.988,524,1.365,525,1.376,526,1.418,527,1.386,528,1.376,529,1.376,530,1.376,531,1.386,532,1.386,533,1.386,534,1.418,535,1.376,536,1.376,537,1.386,538,1.386,545,2.575,546,2.399,549,1.234,551,1.93,552,1.336,553,1.27,554,1.345,555,1.316,563,2.304,625,2.311,629,0.641,634,0.742,636,2.066,656,1.095,659,1.355,660,1.287,663,1.347,665,2.971,673,1.021,676,2.268,687,1.508,688,2.268,852,1.711,853,2.472,854,1.407,855,2.902,856,1.726,857,1.726,858,2.494,862,1.726,863,1.726,864,1.429,865,1.129,866,1.726,1018,5.502,1036,1.93,1067,1.287,1111,0.927,1349,1.726,1400,1.429,1401,2.845,1404,1.742,1513,3.041,1518,2.861,1534,0.832,1605,1.347,1667,1.882,1696,1.347,1932,1.421,2038,2.268,2211,1.421,2212,1.521,2231,3.952,2232,6.471,2233,1.673,2234,1.673,2235,1.673,2236,1.673,2237,5.993,2238,1.673,2239,1.673,2240,3.952,2241,6.471,2242,1.673,2243,1.673,2244,2.948,2245,6.471,2246,1.673,2247,1.673]],["t/653",[0,1.145,9,1.785,17,0.794,30,3.351,80,1.515,81,1.725,94,1.328,95,1.125,117,1.627,144,4.742,147,4.997,149,1.243,150,3.726,244,2.05,252,2.876,277,1.538,317,4.185,402,2.05,560,5.646,563,3.856,600,3.135,601,3.928,643,2.974,706,6.671,709,7.538,1534,5.066,1781,7.865]],["t/655",[1,1.15,7,0.692,9,2.019,10,5.249,17,0.606,29,2.021,53,5.584,54,5.095,75,3.828,77,4.108,81,1.701,105,0.758,110,2.811,148,6.31,149,1.123,150,3.696,159,4.183,200,4.499,202,2.767,215,1.758,252,2.836,285,5.171,291,5.904,323,1.841,418,1.994,419,3.698,616,2.958,713,4.241,847,5.204,881,6.093,1150,5.904,1342,4.483,1346,6.563,1375,6.31,1399,7.756,1409,4.995,1549,5.904,1659,6.093,1948,5.32,2179,5.904,2248,7.756,2249,6.093,2250,6.093,2251,6.31]],["t/657",[3,1.05,16,3.089,19,3.333,80,1.655,621,4.396]],["t/659",[0,1.206,1,1.424,3,1.093,6,3.701,7,0.751,14,0.973,17,0.779,27,1.905,41,1.474,50,2.905,77,3.313,90,3.663,94,1.377,95,1.085,102,1.371,105,1.026,110,2.127,117,1.987,135,1.905,141,1.504,154,2.319,215,1.679,221,3.246,224,1.502,225,3.663,226,3.494,231,3.035,244,2.33,261,2.173,277,1.352,285,4.17,289,3.456,290,4.17,302,1.984,307,3.035,314,2.71,333,3.279,418,2.469,419,3.533,465,1.647,603,2.98,621,3.793,636,3.139,646,3.573,664,3.383,713,4.889,743,4.298,1349,4.772,1409,4.772]],["t/661",[0,0.333,1,1.223,7,0.782,9,1.098,12,3.535,14,0.708,16,1.031,17,0.681,28,1.196,41,1.436,45,1.524,64,0.852,77,1.281,80,1.098,83,1.074,92,0.91,93,1.473,94,1.298,95,1.268,102,1.71,104,3.033,105,1.007,108,3.71,110,0.822,124,0.817,141,1.612,146,2.082,150,1.152,152,1.255,158,0.778,187,1.159,189,0.794,209,2.345,213,1.612,224,0.714,275,0.8,276,0.8,285,1.612,289,1.336,290,1.612,291,2.181,302,1.224,312,4.226,315,4.214,317,4.638,319,2.839,320,1.746,321,0.811,326,4.934,328,1.524,373,7.89,404,1.056,414,5.21,419,1.366,428,0.783,429,1.321,434,0.852,439,0.924,440,0.641,443,4.301,444,1.014,445,0.982,446,1.519,447,2.379,453,1.955,465,0.637,471,1.359,475,1.745,477,1.647,479,2.096,485,1.311,493,0.846,494,1.659,497,2.005,501,1.321,546,0.805,547,3.004,549,2.621,551,1.409,552,0.884,553,0.84,554,0.89,555,0.871,597,1.466,625,2.494,629,3.346,630,1.207,631,1.142,632,3.414,633,3.306,637,1.882,653,2.537,662,3.796,687,1.612,692,6.978,693,6.521,712,1.243,713,1.567,854,0.931,859,2.968,864,2.62,1019,1.142,1029,3.555,1342,4.619,1400,0.945,1492,1.174,1493,1.174,1494,1.174,1495,1.163,1496,3.555,1499,1.174,1500,1.871,1501,1.163,1502,1.174,1503,3.253,1506,1.174,1507,1.174,1508,1.163,1512,1.185,1676,5.316,1677,4.214,1680,2.251,1684,2.677,1689,2.677,1710,1.431,1734,2.865,1744,4.26,1802,2.331,1834,3.002,1862,7.943,1999,3.717,2077,2.181,2079,2.181,2082,2.181,2252,2.865,2253,2.865,2254,8.501,2255,9.185,2256,7.421,2257,4.045,2258,6.702,2259,7.073,2260,6.405,2261,7.104,2262,4.045,2263,5.699,2264,4.569,2265,4.569,2266,2.865,2267,7.104,2268,2.537,2269,4.569,2270,4.269,2271,2.865,2272,3.866,2273,2.865,2274,2.865,2275,3.151,2276,7.104,2277,2.537,2278,4.569,2279,4.569,2280,2.865,2281,4.569,2282,2.865,2283,2.865]],["t/663",[28,4.347,110,2.934,291,7.782,328,5.542,373,7.703,419,4.874,549,2.969,662,3.952,692,6.733,693,5.753,1342,4.434,1676,5.611,1744,4.497]],["t/665",[0,0.927,1,1.469,14,0.868,17,0.623,28,3.329,81,1.75,95,0.968,110,2.844,117,1.65,144,4.083,149,0.975,152,3.495,160,4.627,196,2.322,224,1.247,284,4.556,307,3.267,328,4.244,359,6.49,373,5.899,403,6.268,405,3.761,465,2.076,549,2.274,611,5.743,641,5.899,662,3.723,712,3.46,763,6.75,1256,6.267,1338,6.75,1342,3.46,1409,6.016,1683,6.75,2005,6.75,2284,7.062,2285,7.977]],["t/667",[0,0.311,1,0.396,3,0.327,7,0.767,14,0.983,17,0.603,27,2.459,28,3.063,79,2.331,80,0.515,94,1.052,95,1.236,102,1.711,105,0.995,108,3.641,110,0.767,117,2.075,120,3.602,123,4.693,130,1.183,141,1.489,146,2.124,149,0.327,152,1.171,158,2.414,164,2.331,187,1.862,189,2.034,209,2.167,224,1.208,275,2.048,276,2.048,277,0.404,284,1.527,293,1.602,297,2.752,321,2.077,328,3.325,373,5.946,428,2.006,429,2.57,434,2.183,453,2.802,455,2.214,465,1.631,471,2.644,475,2.928,477,2.765,479,3.283,485,2.107,494,2.784,497,2.949,501,2.873,546,2.063,549,2.613,551,2.742,552,2.263,553,2.152,554,2.28,555,2.23,561,1.629,662,2.734,693,1.925,852,2.899,853,3.511,854,2.384,855,3.778,856,2.925,857,2.925,858,3.543,859,1.973,862,2.925,863,2.925,864,2.421,865,3.092,866,2.925,1342,1.16,1400,2.421,1404,2.951,1518,3.853,1596,2.262,1666,2.175,1667,1.878,1676,3.035,1677,6.574,1680,3.396,1744,2.432,1750,6.242,1756,3.035,1834,6.283,1874,2.101,1999,7.781,2001,5.441,2260,8.756,2272,6.21,2286,4.426,2287,2.674,2288,2.94,2289,2.94,2290,2.94,2291,2.94,2292,2.94]],["t/669",[1,0.794,3,0.519,4,1.793,7,0.75,9,1.032,12,1.622,13,1.042,14,1.016,17,0.53,20,1.306,25,0.795,27,1.867,37,1.628,41,1.358,51,1.355,64,1.262,73,1.652,77,1.169,79,1.348,80,0.504,81,0.931,85,1.373,94,1.266,95,1.224,102,1.71,104,2.524,105,0.922,108,3.782,110,2.617,117,1.752,118,1.493,120,2.632,123,3.428,124,1.21,135,1.378,141,1.087,144,1.338,146,2.11,149,1.007,158,1.841,159,2.289,164,1.702,176,2.526,186,2.449,187,1.359,189,1.485,196,1.795,200,3.108,205,1.823,209,1.582,210,1.091,215,1.214,224,1.247,270,2.646,275,1.495,276,1.495,277,0.81,285,2.389,293,2.543,296,2.789,297,1.592,300,1.45,307,1.071,314,0.956,318,2.195,319,0.98,321,1.517,322,1.77,323,1.464,324,2.543,356,1.882,359,2.127,373,1.933,402,1.396,407,1.571,412,1.677,415,1.272,418,1.743,419,2.024,425,0.7,428,1.465,429,2.1,434,1.594,437,1.959,439,0.843,440,0.949,446,0.869,447,2.066,448,2.486,449,2.066,450,2.066,451,2.066,452,2.066,453,2.785,454,2.244,455,1.861,456,1.944,457,0.824,458,1.728,459,1.689,460,1.677,461,0.824,462,1.733,463,1.677,464,0.824,465,1.997,466,1.916,467,1.944,468,2.514,469,1.689,470,0.83,471,2.451,472,0.837,473,1.944,474,1.916,475,2.592,477,2.505,479,2.939,480,0.818,481,0.824,482,1.338,483,0.806,484,1.29,485,2.085,486,0.824,487,0.856,488,0.818,489,0.824,490,1.689,491,1.689,492,0.824,493,1.253,494,2.522,497,2.611,501,2.448,504,0.83,505,0.83,506,0.83,507,0.83,508,0.824,509,0.659,510,0.71,511,0.83,512,1.319,513,0.824,514,0.83,515,0.83,516,0.83,517,0.83,518,0.83,519,1.348,524,0.824,525,0.83,526,0.856,527,0.837,528,0.83,529,0.83,530,0.83,531,0.837,532,0.837,533,0.837,534,0.856,535,0.83,536,0.83,537,0.837,538,0.837,545,1.973,546,2.151,547,0.989,549,1.527,551,2.24,552,1.652,553,1.571,554,1.665,555,1.628,564,1.652,625,1.881,629,2.598,630,1.102,631,2.135,636,2.55,643,1.605,646,1.261,662,3.284,664,1.194,673,1.754,674,2.127,710,3.45,712,2.324,713,1.43,734,1.593,785,1.684,852,1.677,853,2.436,854,1.741,855,2.869,856,1.692,857,1.692,858,2.458,859,2.446,862,1.692,863,1.692,864,1.767,865,1.788,866,1.692,1019,1.042,1029,1.43,1164,2.315,1338,2.212,1342,3.574,1346,2.212,1400,1.767,1404,1.707,1405,1.836,1492,1.071,1493,1.071,1494,1.071,1495,1.061,1496,1.43,1499,1.071,1500,1.739,1501,1.061,1502,1.071,1503,1.071,1506,1.071,1507,1.071,1508,1.061,1512,1.081,1518,2.229,1653,2.443,1683,3.592,1696,2.315,1834,5.804,2005,2.212,2255,7.449,2256,6.336,2258,7.058,2260,7.475,2262,2.315,2268,2.315,2272,3.592,2277,2.315,2286,3.453,2287,4.245,2293,2.875,2294,8.394,2295,2.875,2296,7.653,2297,4.245,2298,2.615,2299,2.615,2300,2.615,2301,2.615]],["t/671",[1,1.309,3,0.935,4,1.792,7,0.729,9,0.503,14,0.977,15,2.313,17,0.331,19,1.014,20,1.305,25,0.794,27,1.967,28,2.829,37,1.628,41,1.016,51,2.199,55,2.461,64,1.262,77,1.168,79,1.348,80,1.032,81,0.931,90,1.07,94,0.768,95,1.189,102,1.706,105,0.938,108,4.077,110,2.578,117,1.827,120,2.969,123,3.427,124,1.209,125,1.932,135,1.377,141,1.718,146,2.146,149,1.08,150,1.051,158,1.841,164,1.348,186,2.448,187,1.359,189,1.485,196,1.795,209,1.582,210,1.09,215,1.646,224,1.135,225,1.07,231,1.738,270,2.646,275,1.495,276,1.495,277,0.81,288,1.429,290,1.47,296,1.717,297,1.591,302,0.7,314,1.551,318,2.194,321,1.516,322,1.77,323,1.463,328,5.019,356,1.881,373,1.932,402,1.396,403,1.753,407,1.57,412,1.676,415,1.007,418,1.743,419,1.246,425,0.7,428,1.464,429,2.099,434,1.593,437,1.958,438,2.119,440,0.585,448,2.485,449,2.065,450,2.065,451,2.065,452,2.065,453,2.785,454,2.243,455,1.86,456,1.944,457,0.824,458,1.727,459,1.689,460,1.676,461,0.824,462,1.733,463,1.676,464,0.824,465,1.925,466,1.915,467,1.944,468,2.513,469,1.689,470,0.83,471,2.45,472,0.836,473,1.944,474,1.915,475,2.592,477,2.504,479,2.939,480,0.818,481,0.824,482,1.338,483,0.806,484,1.289,485,2.084,486,0.824,487,0.855,488,0.818,489,0.824,490,1.689,491,1.689,492,0.824,493,1.253,494,2.522,497,2.611,501,2.447,504,0.83,505,0.83,506,0.83,507,0.83,508,0.824,509,0.658,510,0.709,511,0.83,512,1.318,513,0.824,514,0.83,515,0.83,516,0.83,517,0.83,518,0.83,519,1.348,524,0.824,525,0.83,526,0.855,527,0.836,528,0.83,529,0.83,530,0.83,531,0.836,532,0.836,533,0.836,534,0.855,535,0.83,536,0.83,537,0.836,538,0.836,545,1.973,546,2.15,547,0.988,549,1.527,551,2.239,552,1.652,553,1.57,554,1.664,555,1.628,600,1.041,612,2.126,622,1.932,638,2.554,644,3.054,662,3.722,664,1.937,687,3.815,692,4.438,693,4.881,707,2.211,712,1.133,715,3.971,747,1.275,758,2.313,847,3.593,852,1.676,853,2.435,854,1.74,855,2.868,856,1.691,857,1.691,858,2.457,859,2.445,862,1.691,863,1.691,864,1.399,865,2.257,866,1.691,1019,1.041,1029,1.429,1135,1.835,1256,2.053,1342,3.954,1397,2.053,1400,1.767,1404,1.706,1408,2.211,1409,2.732,1411,2.442,1487,1.516,1492,1.07,1493,1.07,1494,1.07,1495,2.174,1496,1.429,1499,1.07,1500,1.738,1501,2.174,1502,1.07,1503,1.07,1506,1.07,1507,1.07,1508,1.06,1512,1.08,1518,2.812,1527,4.76,1534,1.429,1653,2.442,1676,2.979,1736,2.442,1744,2.387,1834,5.803,2145,7.447,2146,5.76,2147,3.964,2148,3.964,2258,8.069,2259,6.334,2260,7.474,2262,2.313,2268,3.756,2270,2.442,2272,3.59,2277,2.313,2284,2.313,2285,2.613,2286,3.452,2294,8.517,2298,2.613,2299,5.356,2300,2.613,2301,2.613,2302,2.874,2303,2.874,2304,2.874,2305,2.613,2306,4.243,2307,2.874,2308,2.874]],["t/673",[0,0.33,1,1.289,7,0.775,14,0.617,17,0.662,30,0.967,41,1.49,64,0.845,67,1.623,92,0.903,93,1.463,94,1.316,95,1.276,102,1.712,104,3.027,105,1.016,108,3.472,117,0.588,124,0.81,128,1.762,130,1.257,141,1.668,144,1.454,146,2.077,149,0.347,158,0.771,159,2.448,163,1.623,187,0.721,189,0.788,202,2.022,209,2.338,224,0.444,275,0.793,276,0.793,299,1.894,304,1.257,312,3.764,317,4.552,319,2.828,321,0.804,326,4.851,373,7.717,414,4.469,428,0.777,429,1.312,434,0.845,439,0.916,440,0.636,443,4.29,444,1.006,445,0.974,446,1.509,447,2.526,453,1.947,465,0.631,471,1.35,475,1.735,477,1.638,479,2.087,485,1.303,493,0.839,494,1.65,497,1.996,501,1.312,546,0.799,547,2.994,549,2.53,551,1.4,552,0.876,553,0.833,554,0.883,555,0.864,597,1.454,625,1.99,629,3.74,630,1.912,631,2.579,632,3.396,633,3.288,662,3.751,692,6.775,693,6.259,710,2.923,743,3.754,817,1.906,854,0.923,859,2.587,864,2.611,937,2.046,1019,1.132,1029,3.099,1043,2.404,1163,2.516,1223,2.163,1342,4.56,1400,0.937,1409,2.923,1492,1.164,1493,1.164,1494,1.164,1495,1.153,1496,3.099,1499,1.164,1500,1.859,1501,1.153,1502,1.164,1503,3.243,1506,1.164,1507,1.164,1508,1.153,1512,1.175,1676,4.968,1677,4.191,1680,2.232,1684,2.655,1689,2.655,1744,3.981,1750,3.98,1753,2.163,1756,1.995,1761,2.163,1834,2.982,1862,7.921,1948,1.949,1999,3.693,2077,2.163,2079,2.163,2082,2.163,2144,2.404,2254,8.223,2255,9.281,2256,7.047,2257,4.018,2258,6.678,2259,7.047,2260,6.382,2261,7.075,2262,4.018,2263,5.668,2264,4.539,2265,4.539,2266,2.842,2267,7.075,2268,2.516,2269,4.539,2270,4.241,2271,2.842,2272,3.841,2273,2.842,2274,2.842,2276,7.075,2277,2.516,2278,4.539,2279,4.539,2280,2.842,2281,4.539,2282,2.842,2283,2.842,2294,7.397,2296,7.075,2309,3.125,2310,2.842]],["t/675",[0,0.929,3,1.143,7,0.705,9,1.54,14,1.079,16,2.874,17,0.73,20,3.991,55,4.636,80,1.54,90,3.273,117,2.051,135,2.054,149,0.977,154,2.501,202,3.337,244,2.437,252,2.922,277,1.546,289,3.727,290,4.497,465,1.776,646,3.853,669,5.361,713,5.114,881,6.278,1409,6.022,1598,6.278,1635,7.075,1660,5.146]],["t/677",[0,0.768,1,0.979,3,1.115,6,3.298,7,0.78,9,1.604,14,0.718,16,2.375,17,0.748,20,3.298,27,2.141,28,2.755,29,1.721,30,3.581,45,3.513,73,4.171,75,4.11,81,2.001,83,3.42,90,3.411,94,0.946,95,1.163,96,3.149,105,0.814,117,1.887,133,4.349,145,5.846,146,1.577,149,1.018,154,2.066,179,4.636,196,2.424,197,3.716,201,4.883,205,2.246,244,1.721,253,6.158,254,5.026,261,2.808,277,1.26,299,2.755,304,3.685,317,4.863,319,2.476,320,4.024,322,1.895,340,6.339,371,4.79,389,3.422,419,4.567,443,4.727,582,4.095,600,2.631,611,4.754,616,2.518,664,3.014,740,4.095,763,5.587,902,5.026,1116,5.587,1349,4.252,1534,3.61,1587,5.587,1698,5.187,1704,5.187,1710,3.298,1916,6.169,1946,6.169,2165,7.719,2166,7.525,2311,7.261,2312,6.603,2313,9.122,2314,5.846,2315,5.372,2316,4.529,2317,7.261,2318,7.261,2319,7.261,2320,7.261,2321,9.158,2322,6.169,2323,8.328,2324,7.261]],["t/679",[0,1.213,1,1.319,3,1.148,7,0.806,9,1.715,14,1.022,16,2.252,17,0.759,19,3.124,27,1.61,41,1.602,44,2.13,50,3.051,52,3.675,80,1.551,83,2.348,92,1.989,93,2.596,94,1.515,95,1.228,96,3.552,102,1.687,105,1.012,117,1.943,119,2.829,141,1.271,149,0.984,154,1.96,174,3.331,188,3.577,202,2.873,215,1.825,221,2.743,223,2.252,224,1.259,225,3.645,234,2.771,244,1.632,261,2.361,277,0.947,302,2.383,314,2.29,333,2.771,405,2.952,418,2.07,438,3.127,439,2.019,440,1.401,443,4.636,444,2.216,445,2.147,446,2.081,447,2.697,458,2.019,509,1.578,563,3.484,603,2.518,616,2.388,621,3.205,636,2.827,643,3.045,646,3.019,712,2.716,1169,3.331,1340,3.019,1487,3.632,1739,4.919,2166,6.991]],["t/681",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.451,244,2.196,261,2.828,277,1.275]],["t/683",[0,1.24,1,1.331,3,1.098,7,0.791,9,1.437,14,0.977,17,0.701,27,1.918,41,1.587,44,2.537,50,3.247,52,4.098,94,1.466,95,1.169,105,1.036,117,2.068,141,1.514,149,1.098,154,2.334,202,3.203,215,1.691,221,3.268,234,3.301,302,2.579,314,2.728,333,3.301,418,2.308,458,2.405,509,1.879,563,3.515,603,3,616,2.845,636,3.152,643,3.395,646,3.597,1340,3.597]],["t/685",[0,0.918,1,1.17,3,0.965,7,0.595,14,0.859,17,0.725,20,3.942,28,3.294,30,3.464,41,1.301,44,2.685,45,4.199,95,1.236,96,2.985,117,1.633,149,0.965,224,1.234,277,1.194,302,2.486,307,3.803,317,4.456,405,3.721,443,3.895,563,3.635,664,3.603,691,5.225,712,3.424,848,4.986,1739,6.201,2165,8.786,2166,7.75,2325,7.893]],["t/687",[3,0.9,7,0.796,14,0.801,17,0.696,41,1.468,75,3.633,80,1.418,92,2.338,93,2.872,94,1.484,95,1.237,96,3.853,102,1.7,133,3.51,288,4.025,317,4.326,389,3.816,419,3.51,423,5.169,439,2.373,440,1.647,443,5.029,444,2.605,445,2.524,446,2.447,447,2.983,560,4.486,602,5.049,1739,5.783,2166,6.997]],["t/689",[0,0.945,3,0.777,7,0.774,14,0.692,17,0.635,27,1.635,28,3.393,30,3.453,41,1.609,44,2.163,80,1.567,83,2.384,92,2.02,93,2.622,94,1.5,95,1.301,96,3.776,102,1.702,105,0.622,130,2.814,133,3.032,138,4.703,144,3.255,146,1.519,205,2.766,284,3.632,290,3.579,307,2.605,317,2.873,320,3.875,322,1.825,324,3.81,328,3.383,340,4.841,389,3.296,419,3.032,423,4.465,439,2.05,440,1.423,443,5.073,444,2.251,445,2.18,446,2.114,447,2.723,563,3.183,602,4.362,616,3.101,629,3.777,630,2.679,631,2.534,643,2.405,646,3.921,673,4.266,691,3.579,715,3.477,741,4.465,1040,5.63,1275,5.63,2029,6.36,2165,7.585,2166,7.671,2312,6.36,2322,8.376,2326,4.996,2327,8.964]],["t/691",[0,0.377,1,0.673,3,0.164,7,0.689,13,0.534,14,0.704,17,0.394,25,1.38,27,1.939,28,0.999,30,0.814,37,2.293,41,1.355,51,0.694,64,1.499,79,1.255,80,0.761,81,1.477,94,0.723,95,1.111,96,2.714,102,1.707,104,1.929,105,0.884,106,4.309,109,0.732,110,1.303,117,1.701,120,2.927,123,2.295,124,1.437,130,0.593,133,0.639,135,1.939,141,1.023,146,2.129,149,1.171,158,1.678,164,1.255,186,2.781,187,1.151,189,1.258,196,2.394,205,2.37,209,1.489,210,0.999,215,1.71,224,1.286,227,1.642,261,0.952,270,3.005,275,1.267,276,1.267,277,1.141,297,1.481,317,1.784,318,2.618,321,1.285,322,2.36,323,1.951,371,0.703,402,1.966,407,2.212,412,2.361,415,1.536,418,2.114,419,0.639,425,1.216,428,1.241,429,1.871,434,1.35,437,2.612,440,1.015,443,3.542,448,3.022,449,2.754,450,2.754,451,2.754,452,2.754,453,2.878,454,2.727,455,2.223,456,2.593,457,1.431,458,2.432,459,2.378,460,2.361,461,1.431,462,2.311,463,2.361,464,1.431,465,2.113,466,2.555,467,2.593,468,2.998,469,2.378,470,1.442,471,2.586,472,1.453,473,2.593,474,2.555,475,2.517,476,1.196,477,2.513,479,2.776,480,1.421,481,1.431,482,2.041,483,1.4,484,1.967,485,2.211,486,1.431,487,1.486,488,1.421,489,1.431,490,2.378,491,2.378,492,1.431,493,1.489,494,2.531,497,2.375,501,2.308,504,1.442,505,1.442,506,1.442,507,1.442,508,1.431,509,1.144,510,1.232,511,1.442,512,2.011,513,1.431,514,1.442,515,1.442,516,1.442,517,1.442,518,1.442,519,2.056,524,1.431,525,1.442,526,1.486,527,1.453,528,1.442,529,1.442,530,1.442,531,1.453,532,1.453,533,1.453,534,1.486,535,1.442,536,1.442,537,1.453,538,1.453,545,2.631,546,2.443,547,0.905,549,1.294,551,1.996,552,1.4,553,1.331,554,1.41,555,1.38,624,0.816,636,0.47,638,0.639,654,0.802,694,0.88,747,0.653,848,0.846,852,1.56,853,2.311,854,1.475,855,2.752,856,1.574,857,1.574,858,2.331,862,1.574,863,1.574,864,1.663,865,2.124,866,1.574,1019,0.534,1078,0.816,1115,2.026,1123,2.12,1146,1.133,1400,1.497,1401,0.88,1404,1.588,1419,0.899,1420,0.99,1492,0.549,1493,0.549,1494,0.549,1495,0.544,1499,0.549,1500,0.981,1501,0.544,1502,0.549,1503,0.981,1506,0.549,1507,0.549,1508,0.544,1512,0.554,1518,1.257,1524,1.724,1643,1.02,1647,1.02,1650,0.919,1701,3.697,1706,2.178,1905,1.052,1908,1.09,1952,1.339,2019,2.237,2041,5.774,2043,7.048,2044,1.339,2046,3.033,2049,1.339,2077,1.02,2079,1.02,2082,1.02,2165,3.342,2166,5.085,2322,7.048,2323,9.615,2327,7.983,2328,1.251,2329,1.473,2330,6.019,2331,2.633,2332,5.544,2333,1.473,2334,2.633,2335,2.633,2336,1.473,2337,1.473,2338,1.133,2339,2.633,2340,1.473,2341,1.473,2342,1.473]],["t/693",[0,1.094,3,0.987,17,0.801,19,3.135,30,2.748,44,2.748,80,1.556,96,3.055,117,1.671,142,5.103,244,2.105,249,5.296,252,2.954,277,1.552,310,5.547,311,5.146,317,3.649,319,3.029,402,2.453,441,3.649,442,3.727,643,3.559,680,5.639,1343,5.672,1710,4.034]],["t/695",[0,0.96,13,3.29,14,1.037,16,2.97,17,0.785,174,4.393,176,3.382,224,1.291,244,2.151,284,4.716,304,4.218,423,5.797,424,5.797,664,3.769,755,4.866,791,7.714,875,5.121,1787,8.256,2343,9.079,2344,9.079,2345,9.079,2346,9.079]],["t/697",[0,1.199,1,1.355,3,1.118,7,0.788,14,0.995,16,2.766,17,0.714,19,2.984,41,1.608,44,2.616,50,2.498,52,4.173,80,1.482,94,1.447,95,1.184,105,1.008,118,5.222,141,1.56,149,0.94,154,2.407,221,3.369,234,3.403,302,2.613,314,2.812,323,1.825,333,3.403,438,3.841,509,1.937,603,3.092,616,2.933,621,3.936,636,3.21,643,2.908,664,3.51,710,5.887,1340,3.708]],["t/699",[0,0.751,1,0.958,7,0.8,14,0.894,17,0.783,29,2.557,41,1.566,80,1.245,81,1.417,92,2.609,93,3.064,94,1.504,95,1.299,102,1.707,104,2.131,105,0.929,108,2.646,119,2.918,133,3.08,195,2.529,213,3.635,319,3.934,439,2.648,440,1.837,442,4.526,444,2.907,445,2.816,446,2.73,447,2.751,629,3.46,664,2.949,1042,5.634,1370,6.95,1633,5.466,1745,4.917,1833,5.767,2257,7.271,2347,7.104,2348,5.075]],["t/701",[0,0.307,1,0.391,7,0.705,10,1.508,14,0.675,17,0.532,25,1.3,27,1.876,29,1.115,37,2.217,41,1.46,64,1.272,79,1.358,81,1.495,92,0.838,93,1.379,94,1.147,95,1.136,102,1.708,104,0.87,105,0.866,108,3.689,110,1.228,117,1.655,119,1.192,120,3.372,124,1.219,135,1.876,141,0.868,146,2.029,149,1.144,158,1.684,164,1.358,186,2.75,187,1.085,189,1.185,191,1.952,196,2.329,209,1.263,215,1.653,224,1.251,261,0.774,270,2.972,275,1.194,276,1.194,277,1.103,284,1.508,297,1.604,318,2.576,319,2.555,321,1.211,322,2.297,323,1.899,400,1.485,402,1.901,407,2.139,412,2.283,415,1.472,418,2.057,425,1.145,428,1.169,429,1.793,431,1.637,434,1.272,437,2.541,439,0.851,440,1.206,442,3.544,444,0.934,445,0.905,446,0.877,447,1.433,448,2.968,449,2.68,450,2.68,451,2.68,452,2.68,453,2.857,454,2.679,455,2.201,456,2.522,457,1.348,458,2.352,459,2.3,460,2.283,461,1.348,462,2.249,463,2.283,464,1.348,465,2.08,466,2.486,467,2.522,468,2.951,469,2.3,470,1.358,471,2.526,472,1.369,473,2.522,474,2.486,475,2.449,477,2.455,479,2.739,480,1.338,481,1.348,482,1.955,483,1.319,484,1.885,485,2.094,486,1.348,487,1.4,488,1.338,489,1.348,490,2.3,491,2.3,492,1.348,493,1.263,494,2.473,497,2.25,501,2.313,504,1.358,505,1.358,506,1.358,507,1.358,508,1.348,509,1.078,510,1.161,511,1.358,512,1.926,513,1.348,514,1.358,515,1.358,516,1.358,517,1.358,518,1.358,519,1.97,524,1.348,525,1.358,526,1.4,527,1.369,528,1.358,529,1.358,530,1.358,531,1.369,532,1.369,533,1.369,534,1.4,535,1.358,536,1.358,537,1.369,538,1.369,545,2.56,546,2.442,549,1.219,551,1.912,552,1.319,553,1.254,554,1.329,555,1.3,629,2.272,630,1.112,631,1.052,636,0.927,664,1.205,852,1.689,853,2.449,854,1.389,855,2.882,856,1.705,857,1.705,858,2.471,859,1.952,862,1.705,863,1.705,864,1.411,865,2.613,866,1.705,1040,2.337,1111,2.606,1299,3.996,1370,7.621,1400,1.411,1404,1.72,1633,2.233,1833,5.618,1996,2.337,2257,7.319,2349,2.902,2350,4.277,2351,2.902,2352,3.996,2353,2.639,2354,2.902,2355,2.902]],["t/703",[0,0.522,1,0.666,7,0.617,9,0.54,14,0.699,17,0.439,25,1.365,27,1.444,37,2.279,41,1.349,64,1.671,79,0.891,81,1.542,94,0.644,95,1.025,102,1.706,104,2.597,105,0.8,110,1.289,117,1.454,120,2.727,124,1.601,133,3.351,135,1.928,141,0.911,146,2.215,149,1.159,158,1.525,164,1.427,186,2.775,187,1.139,189,1.245,196,2.382,202,1.001,205,0.954,209,1.326,210,1.17,215,1.699,224,1.28,261,0.822,270,2.999,275,1.254,276,1.254,277,1.134,284,1.602,296,1.842,297,1.051,318,2.61,319,2.635,321,1.271,322,2.626,323,1.942,402,1.954,407,2.199,412,2.347,415,1.524,418,2.104,425,1.203,428,1.228,429,1.857,434,1.336,437,2.599,440,1.005,442,3.894,448,3.012,449,2.741,450,2.741,451,2.741,452,2.741,453,2.874,454,2.719,455,2.121,456,2.58,457,1.416,458,2.418,459,2.364,460,2.347,461,1.416,462,2.3,463,2.347,464,1.416,465,2.107,466,2.542,467,2.58,468,2.99,469,2.364,470,1.427,471,2.575,472,1.437,473,2.58,474,2.542,475,2.505,477,2.503,479,2.721,480,1.406,481,1.416,482,2.025,483,1.385,484,1.952,485,2.26,486,1.416,487,1.47,488,1.406,489,1.416,490,2.364,491,2.364,492,1.416,493,1.659,494,2.521,497,2.429,501,2.168,504,1.427,505,1.427,506,1.427,507,1.427,508,1.416,509,1.132,510,1.219,511,1.427,512,1.995,513,1.416,514,1.427,515,1.427,516,1.427,517,1.427,518,1.427,519,2.04,524,1.416,525,1.427,526,1.47,527,1.437,528,1.427,529,1.427,530,1.427,531,1.437,532,1.437,533,1.437,534,1.47,535,1.427,536,1.427,537,1.437,538,1.437,545,2.619,546,2.433,547,1.06,549,1.28,551,1.981,552,1.385,553,1.317,554,1.395,555,1.365,852,1.108,853,1.774,854,1.459,855,2.219,856,1.118,857,1.118,858,1.79,862,1.118,863,1.118,864,1.481,865,1.892,866,1.118,1019,1.118,1299,2.62,1370,7.142,1400,1.481,1404,1.128,1492,1.149,1493,1.149,1494,1.149,1495,1.138,1499,1.149,1500,1.84,1501,1.138,1502,1.149,1503,1.149,1506,1.149,1507,1.149,1508,1.138,1512,1.159,1833,5.265,1996,2.483,2108,2.373,2113,2.203,2350,2.804,2352,4.196,2356,8.66,2357,9.282,2358,3.084,2359,2.804,2360,4.939,2361,3.084,2362,3.084,2363,2.483,2364,2.804,2365,3.084]],["t/705",[0,0.539,1,1.196,7,0.648,9,0.266,13,0.551,14,0.715,17,0.316,25,1.41,27,1.322,29,0.36,37,2.32,41,1.369,64,1.658,79,0.782,81,1.442,94,0.737,95,1.054,99,6.253,102,1.707,104,2.168,105,0.841,108,3.304,110,1.331,117,1.299,118,1.407,120,1.8,123,2.345,124,1.589,135,2.003,141,1.208,146,2.213,149,1.173,150,0.556,158,1.705,164,1.058,176,0.566,186,2.792,187,1.176,189,1.286,196,2.417,202,0.493,209,1.646,215,1.73,224,1.298,232,0.995,247,0.948,270,3.017,275,1.294,276,1.294,277,1.154,284,0.79,289,0.645,296,0.908,297,1.249,299,1.936,318,2.632,319,2.727,321,1.313,322,2.383,323,1.97,328,3.342,402,1.989,407,2.238,412,2.389,415,1.56,418,2.135,425,1.242,428,1.268,429,1.9,434,1.379,437,2.637,440,1.037,442,2.373,448,3.041,449,2.781,450,2.781,451,2.781,452,2.781,453,2.886,454,2.744,455,2.194,456,2.618,457,1.462,458,2.461,459,2.406,460,2.389,461,1.462,462,2.334,463,2.389,464,1.462,465,2.125,466,2.579,467,2.618,468,3.015,469,2.406,470,1.473,471,2.557,472,1.484,473,2.618,474,2.579,475,2.429,477,2.534,479,2.601,480,1.451,481,1.462,482,2.072,483,1.43,484,1.997,485,2.277,486,1.462,487,1.518,488,1.451,489,1.462,490,2.406,491,2.406,492,1.462,493,1.646,494,2.552,497,2.447,501,2.252,504,1.473,505,1.473,506,1.473,507,1.473,508,1.462,509,1.169,510,1.259,511,1.473,512,2.042,513,1.462,514,1.473,515,1.473,516,1.473,517,1.473,518,1.473,519,2.087,524,1.462,525,1.473,526,1.518,527,1.484,528,1.473,529,1.473,530,1.473,531,1.484,532,1.484,533,1.484,534,1.518,535,1.473,536,1.473,537,1.484,538,1.484,545,2.657,546,2.463,547,1.754,549,1.322,551,2.027,552,1.43,553,1.36,554,1.441,555,1.229,605,0.843,622,1.023,634,0.674,636,0.485,662,0.551,664,1.124,723,2.911,740,0.858,781,2.463,818,1.292,852,0.973,853,1.597,854,1.313,855,2.031,856,0.982,857,0.982,858,1.611,859,1.846,862,0.982,863,0.982,864,1.334,865,1.038,866,0.982,937,0.995,1019,0.982,1024,1.086,1029,1.347,1042,0.948,1111,0.843,1370,7.348,1400,1.53,1404,0.991,1492,1.009,1493,1.009,1494,1.009,1495,1,1496,1.347,1499,1.009,1500,1.656,1501,1,1502,1.009,1503,1.656,1506,1.009,1507,1.009,1508,1,1512,1.018,1518,1.293,1534,0.756,1649,6.253,1678,2.339,1768,2.084,1776,2.084,1833,3.611,1996,1.224,2099,1.292,2104,6.253,2105,5.143,2106,2.302,2107,2.302,2108,2.084,2110,1.292,2111,1.292,2112,1.292,2113,1.935,2115,1.292,2116,1.383,2117,1.292,2120,1.383,2338,1.17,2348,4.04,2352,4.805,2353,1.383,2359,4.043,2363,2.181,2364,4.043,2366,1.383,2367,1.521,2368,5.655,2369,5.655,2370,5.655,2371,2.004,2372,2.004,2373,1.521,2374,2.004,2375,1.521,2376,1.521]],["t/707",[0,0.872,1,1.111,7,0.754,14,0.816,17,0.703,29,2.347,41,1.484,92,2.381,93,2.903,94,1.468,95,1.262,102,1.697,104,2.473,105,0.733,109,4.099,146,1.791,176,3.071,202,2.675,210,3.129,439,2.417,440,1.677,442,4.725,444,2.653,445,2.57,446,2.492,447,2.511,556,5.397,629,3.158,1534,4.924,1794,5.397,1833,6.323,2366,7.497]],["t/709",[0,1.095,1,1.2,3,0.989,50,2.629,67,4.622,79,2.57,80,1.559,104,3.107,105,0.791,117,1.674,157,6.189,164,2.57,223,2.911,244,2.455,252,2.959,277,1.552,289,3.774,299,3.377,326,3.815,337,4.705,405,3.815,423,6.615,424,6.615,425,2.167,561,4.931,715,4.425,1990,8.092]],["t/711",[3,1.228,17,0.785,149,1.165,150,3.32,151,5.539,213,4.646,226,3.893,227,5.663,244,2.151,249,4.646,323,1.959,404,3.044,465,2.118,706,6.862,1421,6.105,1546,5.797,1662,4.946,1672,7.309,1991,6.986]],["t/713",[0,1.152,3,1.212,7,0.718,9,1.704,16,2.618,17,0.568,19,3.942,34,5.718,50,2.364,83,3.317,95,1.157,102,1.461,105,1.01,119,3.288,135,1.871,147,5.139,149,1.081,174,3.872,223,2.618,224,1.383,225,3.903,226,3.432,244,2.305,261,2.134,272,4.836,277,1.338,279,5.285,285,4.095,361,5.213,389,3.772,404,2.683,405,4.171,415,2.099,465,1.617,563,3.463,600,2.901,601,3.635,616,2.776,621,3.725,625,3.346,643,3.345,650,5.921,691,4.977,712,3.157,717,4.036,747,3.55,1169,3.872,1342,3.157,1349,4.687,1487,4.222,1550,6.368,2007,7.545,2377,7.278]],["t/715",[3,1.048,19,3.327,135,2.204,404,3.16,405,4.042,717,4.754]],["t/717",[3,0.927,6,3.789,7,0.731,9,1.747,14,0.825,17,0.785,19,2.944,34,5.959,81,1.664,119,4.097,130,3.357,147,5.231,149,1.109,150,3.051,165,7.433,183,3.744,200,4.4,213,5.103,215,1.719,222,7.892,224,1.418,225,3.714,249,4.269,322,2.177,337,3.789,418,2.584,435,5.959,453,2.088,549,2.162,597,3.883,684,5.089,706,6.984,713,4.148,739,5.089,830,5.959,1030,5.774,1056,7.088,1525,6.716,1563,4.705,1660,4.885,1662,5.433,1732,6.716,1844,6.419,1866,5.327,2378,8.342,2379,8.342,2380,5.959,2381,7.673,2382,8.342]],["t/719",[17,0.617,34,7.302,57,4.815,143,6.69,147,5.323,160,4.586,165,5.847,213,4.449,222,6.432,234,3.499,249,4.449,279,5.761,302,2.489,418,2.033,637,5.194,638,3.77,706,6.691,785,5.091,924,6.69,1110,7,1329,7.907,1626,6.69,1629,6.018,1882,8.228,1925,8.684,2380,6.212,2381,7.864,2383,8.684,2384,9.224,2385,8.228,2386,8.695,2387,7.907]],["t/721",[3,0.883,6,3.606,7,0.544,9,2.044,17,0.564,57,3.521,79,2.796,80,1.391,144,4.505,149,0.883,165,7.022,183,3.563,184,8.224,213,4.062,222,7.725,279,5.266,296,4.743,344,7.119,418,2.441,465,1.604,625,3.334,637,6.238,641,6.509,662,3.94,785,6.114,924,8.035,1342,3.132,1527,7.238,1661,4.561,1662,4.325,1744,5.562,2007,7.228,2384,6.745,2385,6.391,2388,9.496,2389,8.802,2390,9.496,2391,8.802,2392,8.802,2393,9.496,2394,8.802,2395,6.941]],["t/724",[0,0.761,1,0.97,7,0.742,17,0.647,41,1.497,44,2.226,50,2.126,81,1.436,92,2.079,93,2.67,94,1.524,95,1.284,102,1.706,116,3.437,140,4.982,144,3.35,147,5.149,152,3.628,187,1.66,205,2.226,211,3.921,213,5.112,215,1.483,223,2.354,226,3.086,231,2.681,234,2.896,279,5.667,344,4.391,404,3.054,406,5.142,439,2.11,440,1.464,444,2.316,445,2.244,446,3.02,447,3.043,625,3.352,715,3.579,1030,4.982,1342,4.432,1421,4.84,1546,4.596,1662,4.962,1745,4.982,1794,4.712,2007,7.268,2180,7.768,2396,6.545,2397,7.198]],["t/726",[0,0.44,1,0.959,3,0.278,7,0.707,13,0.906,14,0.685,17,0.518,25,1.27,27,1.456,35,0.741,37,2.188,41,1.305,44,0.298,50,0.738,57,3.069,64,1.532,79,1.202,80,0.547,81,1.38,94,0.599,95,1.151,102,1.707,104,2.663,105,0.915,108,2.577,109,0.479,110,1.2,116,0.46,117,1.373,120,2.441,123,1.688,124,1.469,135,1.882,141,1.313,146,2.176,147,4.395,149,1.147,150,0.352,158,1.538,164,0.902,165,3.81,176,0.359,184,4.814,186,2.737,187,1.06,189,1.159,196,2.304,200,0.508,205,0.298,209,1.91,210,0.678,213,0.493,215,1.632,222,4.192,224,1.238,227,0.6,252,0.32,270,2.958,275,1.167,276,1.167,277,1.089,279,5.416,297,1.065,299,0.365,307,0.359,318,2.56,321,1.183,322,2.272,323,1.878,337,0.437,344,0.587,400,0.914,402,1.876,404,0.323,407,2.111,412,2.253,415,1.447,418,2.208,421,0.741,425,1.119,427,0.647,428,1.143,429,1.763,434,1.243,437,2.514,440,0.935,448,2.947,449,2.651,450,2.651,451,2.651,452,2.651,453,2.848,454,2.66,455,2.049,456,2.495,457,1.318,458,2.321,459,2.27,460,2.253,461,1.318,462,2.225,463,2.253,464,1.318,465,2.073,466,2.459,467,2.495,468,2.932,469,2.27,470,1.328,471,2.503,472,1.338,473,2.495,474,2.459,475,2.423,477,2.433,479,2.651,480,1.308,481,1.318,482,1.923,483,1.289,484,1.853,485,2.164,486,1.318,487,1.368,488,1.308,489,1.318,490,2.27,491,2.27,492,1.318,493,1.521,494,2.45,497,2.325,501,2.116,504,1.328,505,1.328,506,1.328,507,1.328,508,1.318,509,1.053,510,1.135,511,1.328,512,1.894,513,1.318,514,1.328,515,1.328,516,1.328,517,1.328,518,1.328,519,1.937,524,1.318,525,1.328,526,1.368,527,1.338,528,1.328,529,1.328,530,1.328,531,1.338,532,1.338,533,1.338,534,1.368,535,1.328,536,1.328,537,1.338,538,1.338,545,2.533,546,2.365,547,2.142,549,1.191,551,1.881,552,1.289,553,1.226,554,1.298,555,1.27,582,0.543,598,0.875,599,0.875,600,0.349,605,0.533,614,0.63,625,3.034,637,2.194,643,0.331,644,0.63,662,1.666,687,0.493,694,0.575,747,0.427,755,0.516,778,0.875,785,4.051,852,1.122,853,1.792,854,1.358,855,2.238,856,1.132,857,1.132,858,1.808,859,1.038,862,1.132,863,1.132,864,2.134,865,1.594,866,1.132,872,0.775,910,0.6,924,2.826,1019,0.906,1029,0.479,1074,0.647,1078,0.99,1342,3.396,1354,0.553,1400,1.379,1404,1.142,1421,0.647,1492,0.931,1493,0.931,1494,0.931,1495,0.922,1496,0.479,1499,0.931,1500,1.55,1501,0.922,1502,0.931,1503,2.32,1506,0.931,1507,0.931,1508,0.922,1512,0.94,1518,0.853,1546,0.615,1556,1.681,1558,2.404,1561,1.681,1563,0.543,1626,0.741,1631,0.712,1650,0.6,1744,1.879,1745,6.147,1750,1.596,1753,0.666,1756,0.615,1761,0.666,1874,0.688,1882,0.775,1982,0.712,2007,6.147,2180,6.135,2190,3.535,2195,3.905,2201,3.535,2348,1.786,2371,0.712,2372,0.712,2374,0.712,2384,4.814,2385,6.261,2387,3.339,2388,5.153,2389,5.153,2390,5.153,2391,5.153,2392,5.153,2393,5.153,2394,5.153,2395,2.345,2398,5.665,2399,6.291,2400,6.918,2401,3.783,2402,6.23,2403,2.273,2404,1.787,2405,2.5,2406,2.5,2407,1.787,2408,3.123,2409,0.963,2410,1.787,2411,2.84,2412,1.787,2413,1.787,2414,2.5,2415,0.963,2416,0.963,2417,0.963,2418,2.5,2419,1.787,2420,1.787,2421,2.5,2422,0.963,2423,6.099,2424,7.468,2425,4.16,2426,1.787,2427,2.5,2428,1.787,2429,1.787,2430,0.875,2431,3.123,2432,0.963,2433,1.787,2434,1.787,2435,0.963,2436,0.963,2437,0.963,2438,0.963,2439,2.5,2440,0.963,2441,0.963,2442,0.963,2443,0.963,2444,0.963,2445,1.787,2446,1.787,2447,0.963,2448,0.963,2449,0.963,2450,0.963,2451,0.963,2452,0.963,2453,0.963,2454,0.963,2455,0.963,2456,0.963,2457,0.963,2458,0.963,2459,0.963,2460,0.963,2461,0.963,2462,0.666,2463,0.963,2464,0.963,2465,0.963,2466,0.963,2467,0.963,2468,0.963]],["t/728",[0,0.888,1,0.747,3,0.648,6,0.421,7,0.738,9,1.961,11,0.924,13,0.336,14,0.727,17,0.533,25,1.118,27,1.854,31,1.735,37,2.029,39,0.685,41,1.495,45,0.448,50,1.053,64,1.094,76,0.685,77,0.376,79,1.961,80,0.709,81,1.217,83,0.316,92,0.874,93,1.426,94,1.389,95,1.271,96,1.226,102,1.71,105,0.908,108,3.165,110,1.056,116,0.442,117,1.617,119,0.993,120,2.396,123,2.546,124,1.048,130,0.373,135,1.717,139,0.522,141,0.826,143,0.713,146,1.924,147,4.167,149,1.1,152,0.687,158,1.506,164,1.405,165,1.625,176,1.507,179,0.591,186,2.666,187,0.933,189,1.02,195,0.861,196,2.165,197,0.474,205,0.748,209,1.086,210,1.98,213,0.474,215,1.513,222,1.788,223,0.303,224,1.222,225,0.345,226,0.739,230,0.713,231,1.328,246,0.787,247,0.578,270,2.881,275,1.027,276,1.027,277,1.01,279,4.617,284,0.481,285,0.474,288,0.857,293,0.939,296,1.444,297,1.379,299,0.351,300,0.467,304,1.218,307,1.507,309,1.326,318,2.506,321,1.041,322,2.192,323,1.812,344,3.183,371,0.823,400,1.237,402,1.778,404,0.311,407,1.958,412,2.09,415,1.619,418,1.987,425,0.985,428,1.006,429,1.603,434,1.094,437,2.362,439,1.53,440,1.381,444,0.974,445,1.111,446,2.112,447,2.416,448,2.843,449,2.49,450,2.49,451,2.49,452,2.49,453,2.799,454,2.552,455,2.015,456,2.344,457,1.16,458,2.153,459,2.105,460,2.09,461,1.16,462,2.09,463,2.09,464,1.16,465,1.991,466,2.31,467,2.344,468,2.825,469,2.105,470,1.168,471,2.373,472,1.177,473,2.344,474,2.31,475,2.276,477,2.306,479,2.572,480,1.151,481,1.16,482,1.749,483,1.134,484,1.686,485,1.917,486,1.16,487,1.204,488,1.151,489,1.16,490,2.105,491,2.105,492,1.16,493,1.086,494,2.323,497,2.059,501,2.179,504,1.168,505,1.168,506,1.168,507,1.168,508,1.16,509,0.927,510,0.999,511,1.168,512,1.723,513,1.16,514,1.168,515,1.168,516,1.168,517,1.168,518,1.168,519,1.762,524,1.16,525,1.168,526,1.204,527,1.177,528,1.168,529,1.168,530,1.168,531,1.177,532,1.177,533,1.177,534,1.204,535,1.168,536,1.168,537,1.177,538,1.177,545,2.412,546,2.264,549,1.511,551,1.711,552,1.134,553,1.079,554,1.143,555,1.118,563,2.342,582,1.363,594,1.275,600,0.625,601,0.783,603,0.339,604,0.641,605,0.513,616,0.321,625,2.444,629,1.999,630,1.366,631,1.466,632,2.842,633,2.752,634,1.342,637,1.444,638,0.402,640,0.787,641,0.623,643,0.593,646,0.756,650,1.275,659,0.792,661,1.1,662,2.72,664,1.48,665,0.578,673,1.051,683,0.606,684,1.846,691,1.824,695,0.641,712,0.953,734,0.513,741,0.591,776,0.842,785,1.415,798,1.193,852,1.453,853,2.191,854,1.195,855,2.638,856,1.466,857,1.466,858,2.211,859,1.256,862,1.466,863,1.466,864,1.213,865,1.55,866,1.466,872,0.746,873,0.606,882,0.746,897,2.752,902,1.193,910,0.578,924,1.86,1067,0.713,1074,0.623,1078,0.513,1135,0.591,1337,0.578,1342,3.128,1344,0.685,1347,0.842,1350,1.275,1394,0.787,1395,0.787,1396,0.787,1397,0.662,1398,0.662,1400,1.213,1404,1.479,1415,1.464,1518,1.445,1524,1.582,1527,4.053,1534,1.505,1563,2.282,1587,0.713,1615,0.842,1631,0.685,1638,1.231,1662,1.649,1667,0.591,1744,2.669,1745,1.193,1792,0.842,1857,0.842,1865,0.787,1874,2.162,1879,2.87,1901,0.842,1936,0.713,1982,0.685,2007,6.552,2096,1.567,2180,7.082,2181,5.625,2203,3.437,2313,0.842,2377,0.842,2395,3.331,2398,0.842,2399,9.231,2401,3.679,2403,3.679,2411,3.679,2423,6.521,2430,1.567,2462,0.641,2469,0.926,2470,1.464,2471,3.026,2472,0.926,2473,1.723,2474,0.926,2475,1.723,2476,3.026,2477,0.926,2478,0.926,2479,3.026,2480,1.723,2481,0.842,2482,0.926,2483,0.926,2484,0.926,2485,0.926,2486,0.926,2487,0.926,2488,1.723,2489,1.723]],["t/730",[0,1.21,3,1.253,7,0.567,14,0.982,17,0.8,19,2.919,30,2.559,31,3.547,50,2.444,51,3.899,73,4.752,74,4.584,90,3.081,94,1.078,95,0.913,105,0.945,117,1.556,118,4.297,149,1.103,197,5.077,212,5.909,213,5.077,224,1.176,244,1.96,302,2.416,323,1.785,344,5.047,404,2.773,465,2.005,563,3.533,601,3.757,603,3.025,605,4.584,623,4.666,630,3.169,631,2.998,643,3.412,646,3.627,691,4.233,706,5.415,713,4.113,715,4.113,774,6.659,1332,6.365,1397,5.909,1421,5.562,1534,4.113,1546,5.282,1662,5.406,1788,6.659,1806,7.028,1991,6.365,2179,5.726,2490,7.028,2491,7.028]],["t/732",[0,1.195,3,1.068,7,0.761,17,0.802,19,2.766,29,1.857,30,2.425,31,3.361,50,2.315,74,4.344,90,3.867,95,1.146,105,1.018,118,4.071,142,6.492,149,1.256,151,4.782,154,2.733,187,1.808,197,4.914,244,1.857,249,4.914,277,1.321,314,2.606,361,5.8,402,2.276,414,4.503,427,6.458,441,3.945,442,3.288,601,4.362,605,4.344,616,2.719,625,2.502,630,3.003,631,2.841,643,3.974,680,5.232,691,5.313,729,5.599,1339,6.031,1342,4.38,1598,5.599,1623,5.599,1660,4.59,1662,4.27,1710,4.716,2039,7.128,2381,6.031,2492,6.031]],["t/734",[0,1.167,3,1.227,7,0.569,9,1.742,14,0.821,16,2.715,17,0.756,19,3.982,27,1.94,45,4.015,50,2.452,95,0.916,102,1.484,105,0.981,119,3.409,135,1.94,142,4.768,149,0.923,174,4.015,176,3.091,197,4.247,223,2.715,224,1.414,225,3.965,226,3.559,244,2.356,261,2.213,272,4.944,277,1.367,285,4.247,361,4.448,404,2.783,405,4.263,414,4.768,415,2.146,441,3.409,442,3.482,621,3.863,643,2.854,680,4.522,712,3.274,717,4.186,953,4.768,1169,4.015,1342,3.922,1349,4.86,1487,4.378,1664,5.434,1710,4.516]],["t/736",[3,1.048,19,3.327,135,2.204,404,3.16,405,4.042,717,4.754]],["t/738",[3,1.002,17,0.805,30,3.229,119,4.287,130,3.627,149,1.002,174,4.36,179,5.755,183,4.045,213,5.341,249,5.341,302,2.195,322,2.352,597,4.195,1030,6.238,1660,5.277,1662,5.686,1844,6.935,1864,7.658,1866,5.755,2380,6.439,2381,6.935]],["t/740",[7,0.703,9,1.967,17,0.622,29,2.075,30,3.175,44,2.709,57,3.884,142,6.451,318,2.192,414,5.03,441,3.597,442,3.674,465,1.77,625,3.277,638,3.797,674,7.593,1109,7.332,1110,7.05,1118,7.05,1342,4.429,1623,7.332,1662,4.771,1710,5.1,2380,6.256,2381,6.738,2383,7.44,2492,6.738,2493,8.757]],["t/742",[7,0.598,57,5.072,80,1.529,142,5.013,414,5.884,441,3.584,442,3.661,465,1.763,625,3.733,662,3.712,666,8.043,953,5.884,1550,7.584,1710,4.938,1744,5.241,2006,6.714,2395,5.572,2494,9.886,2495,7.025,2496,9.314,2497,7.025,2498,7.414]],["t/745",[0,0.205,1,0.364,2,0.78,3,0.437,5,0.605,7,0.735,9,0.185,13,0.704,14,0.714,17,0.482,25,1.35,27,1.687,29,0.25,30,1.216,37,2.265,41,1.464,44,0.601,64,1.527,79,1.136,80,0.34,81,1.398,90,0.393,92,0.781,93,1.301,94,1.236,95,1.148,102,1.71,104,2.102,105,0.848,108,2.103,110,1.275,117,1.542,120,2.844,123,1.808,124,1.463,135,1.916,141,0.901,142,2.259,146,2.11,149,1.159,151,0.643,158,1.613,159,0.517,164,1.136,176,0.724,186,2.77,187,1.127,189,1.231,195,0.692,196,2.371,209,1.312,210,1.025,215,1.689,224,1.297,226,1.159,249,0.994,250,0.643,252,0.35,261,0.518,270,2.993,275,1.24,276,1.24,277,1.127,297,1.513,314,0.35,318,2.603,321,1.257,322,2.337,323,1.969,389,0.497,402,1.942,407,2.185,412,2.332,415,1.512,418,2.093,425,1.19,428,1.214,429,1.842,434,1.321,437,2.586,439,0.985,440,1.275,441,4.033,442,3.636,444,0.87,445,0.842,446,1.015,447,1.99,448,3.002,449,2.727,450,2.727,451,2.727,452,2.727,453,2.871,454,2.71,455,2.171,456,2.567,457,1.401,458,2.403,459,2.35,460,2.332,461,1.401,462,2.289,463,2.332,464,1.401,465,2.101,466,2.53,467,2.567,468,2.981,469,2.35,470,1.411,471,2.564,472,1.422,473,2.567,474,2.53,475,2.493,477,2.492,479,2.741,480,1.39,481,1.401,482,2.009,483,1.37,484,1.937,485,2.204,486,1.401,487,1.454,488,1.39,489,1.401,490,2.35,491,2.35,492,1.401,493,1.516,494,2.51,497,2.368,501,2.25,504,1.411,505,1.411,506,1.411,507,1.411,508,1.401,509,1.119,510,1.206,511,1.411,512,1.98,513,1.401,514,1.411,515,1.411,516,1.411,517,1.411,518,1.411,519,2.024,524,1.401,525,1.411,526,1.454,527,1.422,528,1.411,529,1.411,530,1.411,531,1.422,532,1.422,533,1.422,534,1.454,535,1.411,536,1.411,537,1.422,538,1.422,545,2.606,546,2.439,547,0.668,549,1.266,551,1.965,552,1.37,553,1.303,554,1.38,555,1.35,600,0.979,615,0.895,629,1.507,630,1.507,631,1.425,634,0.862,636,0.62,659,0.484,662,0.704,680,0.574,715,0.524,747,0.467,852,1.412,853,2.145,854,1.443,855,2.593,856,1.425,857,1.425,858,2.164,859,0.806,860,2.007,862,1.425,863,1.425,864,1.465,865,2.025,866,1.425,875,0.594,953,3.754,1019,0.704,1029,0.524,1109,0.753,1191,0.895,1400,1.465,1404,1.438,1419,0.643,1492,0.724,1493,0.724,1494,0.724,1495,0.717,1496,0.524,1499,0.724,1500,1.251,1501,0.717,1502,0.724,1503,0.724,1506,0.724,1507,0.724,1508,0.717,1512,0.73,1518,0.928,1520,0.811,1532,0.958,1549,0.73,1563,1.096,1611,0.78,1623,3.776,1660,1.138,1661,1.116,1664,0.69,1710,2.401,1744,0.994,1750,5.66,1753,0.73,1756,2.511,1761,0.73,1818,0.78,2108,0.811,2113,1.931,2144,0.811,2363,0.848,2492,5.028,2499,1.651,2500,7.777,2501,1.651,2502,3.933,2503,1.054,2504,1.651,2505,1.054,2506,1.054,2507,1.943,2508,1.943]],["t/747",[0,0.435,1,0.833,3,0.588,7,0.742,13,3.288,14,0.679,17,0.527,19,0.87,25,1.137,27,1.237,30,1.272,37,2.05,41,1.443,44,0.763,57,4.708,64,1.431,67,1.281,73,1.416,79,0.712,80,0.721,81,1.232,83,0.841,92,1.188,93,1.811,94,1.356,95,1.201,102,1.71,104,2.473,105,0.825,110,1.074,117,1.162,120,2.423,124,1.372,135,1.734,141,0.976,146,2.091,149,1.101,155,1.574,158,1.306,159,2.017,164,0.712,186,2.675,187,0.949,188,1.281,189,1.037,195,0.878,196,2.183,205,1.911,209,1.421,210,0.936,215,1.529,224,1.218,249,1.262,252,0.82,261,1.097,270,2.892,275,1.044,276,1.044,277,1.02,297,0.841,301,2.847,307,1.532,318,2.479,321,1.059,322,2.152,323,1.779,389,1.162,402,1.758,407,1.978,412,2.111,415,1.333,418,1.928,425,1.002,428,1.022,429,1.624,431,1.391,434,1.112,437,2.381,439,1.206,440,1.256,441,2.174,442,2.88,444,1.324,445,1.282,446,1.243,447,2.259,448,2.844,449,2.511,450,2.511,451,2.511,452,2.511,453,2.805,454,2.567,455,1.884,456,2.364,457,1.179,458,2.175,459,2.126,460,2.111,461,1.179,462,2.107,463,2.111,464,1.179,465,2.001,466,2.329,467,2.364,468,2.839,469,2.126,470,1.188,471,2.39,472,1.197,473,2.364,474,2.329,475,2.295,477,2.323,479,2.511,480,1.17,481,1.179,482,1.771,483,1.153,484,1.707,485,2.054,486,1.179,487,1.224,488,1.17,489,1.179,490,2.126,491,2.126,492,1.179,493,1.421,494,2.339,497,2.207,501,1.95,504,1.188,505,1.188,506,1.188,507,1.188,508,1.179,509,0.942,510,1.015,511,1.188,512,1.745,513,1.179,514,1.188,515,1.188,516,1.188,517,1.188,518,1.188,519,1.784,524,1.179,525,1.188,526,1.224,527,1.197,528,1.188,529,1.188,530,1.188,531,1.197,532,1.197,533,1.197,534,1.224,535,1.188,536,1.188,537,1.197,538,1.197,545,2.399,546,2.259,547,1.414,549,1.066,551,1.732,552,1.153,553,1.097,554,1.162,555,1.137,625,3.408,629,2.366,630,2.366,631,2.238,642,1.614,656,4.856,659,1.891,748,1.824,852,0.886,853,1.477,854,1.215,855,1.901,856,0.894,857,0.894,858,1.491,862,0.894,863,0.894,864,1.587,865,1.576,866,0.894,875,1.391,953,2.363,1019,0.894,1342,0.973,1354,1.416,1400,1.234,1404,0.902,1492,0.918,1493,0.918,1494,0.918,1495,0.91,1499,0.918,1500,1.532,1501,0.91,1502,0.918,1503,1.532,1506,0.918,1507,0.918,1508,0.91,1512,0.927,1556,1.658,1558,1.614,1561,1.658,1623,4.905,1661,2.363,1704,1.761,1710,4.686,2064,2.242,2067,3.043,2071,2.242,2348,6.118,2371,1.824,2372,3.043,2374,1.824,2395,4.384,2492,5.283,2494,8.036,2498,5.833,2500,7.114,2501,2.095,2502,3.311,2504,2.095,2509,2.466,2510,4.812,2511,5.292,2512,2.242,2513,2.466,2514,2.242,2515,2.466,2516,2.466,2517,2.242,2518,2.466,2519,2.466,2520,2.466]],["t/749",[0,0.242,1,0.675,5,1.313,7,0.606,9,0.4,11,1.225,13,2.383,14,0.706,17,0.356,25,1.384,27,1.376,30,1.194,31,0.98,37,2.297,41,1.357,44,0.707,57,4.102,64,1.779,79,0.66,80,0.676,81,1.423,94,0.653,95,1,102,1.706,104,2.825,105,0.786,110,1.307,117,1.237,120,2.321,124,1.704,130,0.92,135,1.943,141,0.924,142,1.313,146,2.184,149,1.171,150,1.411,158,1.453,159,1.121,164,0.66,175,1.941,183,1.025,186,2.782,187,1.155,189,1.262,196,2.398,200,1.205,205,0.707,207,1.84,209,1.345,210,0.867,215,1.713,224,1.288,249,1.169,252,0.76,270,3.007,275,1.271,276,1.271,277,1.143,297,0.779,299,0.867,307,0.851,318,2.62,321,1.289,322,2.364,323,1.954,402,1.969,407,2.216,412,2.365,415,1.54,418,2.117,425,1.22,428,1.245,429,1.875,434,1.355,437,2.616,440,1.019,448,3.025,449,2.758,450,2.758,451,2.758,452,2.758,453,2.879,454,2.73,455,2.084,456,2.596,457,1.436,458,2.436,459,2.383,460,2.365,461,1.436,462,2.315,463,2.365,464,1.436,465,2.141,466,2.558,467,2.596,468,3.001,469,2.383,470,1.447,471,2.589,472,1.457,473,2.596,474,2.558,475,2.521,477,2.516,479,2.711,480,1.425,481,1.436,482,2.045,483,1.405,484,1.972,485,2.307,486,1.436,487,1.491,488,1.425,489,1.436,490,2.383,491,2.383,492,1.436,493,1.766,494,2.534,497,2.479,501,2.098,504,1.447,505,1.447,506,1.447,507,1.447,508,1.436,509,1.148,510,1.237,511,1.447,512,2.015,513,1.436,514,1.447,515,1.447,516,1.447,517,1.447,518,1.447,519,2.061,524,1.436,525,1.447,526,1.491,527,1.457,528,1.447,529,1.447,530,1.447,531,1.457,532,1.457,533,1.457,534,1.491,535,1.447,536,1.447,537,1.457,538,1.457,545,2.635,546,2.447,547,1.327,549,1.298,551,2.001,552,1.405,553,1.335,554,1.415,555,1.384,563,0.814,625,3.1,631,1.398,654,1.245,674,1.69,686,2.078,715,1.136,852,0.821,853,1.386,854,1.48,855,1.799,856,0.828,857,0.828,858,1.398,862,0.828,863,0.828,864,1.502,865,1.478,866,0.828,1019,1.398,1063,1.69,1150,2.671,1298,1.425,1400,1.502,1404,0.836,1492,1.437,1493,1.437,1494,1.437,1495,1.424,1499,1.437,1500,2.192,1501,1.424,1502,1.437,1503,1.437,1506,1.437,1507,1.437,1508,1.424,1512,1.451,1556,2.595,1558,2.526,1561,2.595,1661,2.217,1664,1.496,1710,3.449,1735,1.941,1779,1.941,1878,1.941,1880,2.078,2067,1.69,2396,2.078,2495,5.294,2496,5.98,2500,5.744,2502,1.84,2510,4.555,2512,2.078,2514,2.078,2517,2.078,2521,5.009,2522,2.078,2523,5.886,2524,2.285,2525,2.285,2526,2.285,2527,2.285,2528,2.285,2529,2.285,2530,7.557,2531,5.009,2532,2.078,2533,2.285,2534,3.509,2535,2.285,2536,2.285,2537,2.078,2538,2.285,2539,2.285]],["t/751",[0,0.614,1,0.952,3,0.177,5,0.912,7,0.753,9,0.278,11,0.851,12,1.588,13,1.02,14,0.622,17,0.524,20,2.384,25,1.048,27,0.887,30,2.183,31,0.681,37,1.951,41,1.495,44,0.871,57,3.7,64,1.42,73,0.912,77,0.646,79,0.459,80,0.493,81,1.159,90,0.592,92,1.095,93,1.703,94,1.429,95,1.254,102,1.712,104,2.655,105,0.822,110,0.99,117,0.988,124,1.361,130,0.639,135,1.724,141,0.847,142,3.848,146,2.034,149,1.074,150,0.581,155,2.422,158,1.133,159,1.381,164,0.459,175,2.392,176,0.592,186,2.628,187,0.875,188,0.825,189,0.956,195,1.002,196,2.154,197,0.813,203,0.969,205,0.491,209,1.232,210,1.068,215,1.52,224,1.186,226,1.626,231,1.709,249,1.441,252,1.261,260,1.135,261,0.751,270,2.84,275,0.963,276,0.963,277,1.015,288,0.79,297,0.542,299,1.068,304,0.639,307,1.413,318,2.417,321,0.976,322,2.065,323,1.84,328,0.768,389,1.327,402,1.673,404,0.532,407,1.882,412,2.009,414,0.912,415,1.445,418,1.849,425,0.924,428,0.943,429,1.527,431,0.896,434,1.026,437,2.285,439,1.345,440,1.279,441,2.751,442,3.319,443,4.373,444,1.221,445,1.431,446,1.587,447,2.649,448,2.766,449,2.409,450,2.409,451,2.409,452,2.409,453,2.772,454,2.496,455,1.725,456,2.268,457,1.087,458,2.07,459,2.024,460,2.009,461,1.087,462,2.08,463,2.009,464,1.087,465,1.952,466,2.235,467,2.268,468,2.769,469,2.024,470,1.095,471,2.306,472,1.104,473,2.268,474,2.235,475,2.202,477,2.242,479,2.386,480,1.079,481,1.087,482,1.665,483,1.064,484,1.605,485,1.999,486,1.087,487,1.129,488,1.079,489,1.087,490,2.024,491,2.024,492,1.087,493,1.41,494,2.257,497,2.148,501,1.761,504,1.095,505,1.095,506,1.095,507,1.095,508,1.087,509,0.869,510,0.936,511,1.095,512,1.641,513,1.087,514,1.095,515,1.095,516,1.095,517,1.095,518,1.095,519,1.678,524,1.087,525,1.095,526,1.129,527,1.104,528,1.095,529,1.095,530,1.095,531,1.104,532,1.104,533,1.104,534,1.129,535,1.095,536,1.095,537,1.104,538,1.104,545,2.302,546,2.179,547,1.304,549,0.983,551,1.629,552,1.064,553,1.011,554,1.071,555,1.048,560,0.88,562,0.991,563,0.565,600,0.576,605,0.88,616,0.551,621,0.739,625,3.205,629,3.03,630,2.826,631,2.775,632,2.5,633,2.421,634,1.249,638,0.689,643,0.546,654,0.865,656,5.179,659,0.73,666,4.65,729,1.135,771,1.279,852,0.57,853,1.011,854,1.12,855,1.362,856,0.576,857,0.576,858,1.02,862,0.576,863,0.576,864,1.376,866,0.576,875,0.896,910,0.991,953,4.674,1019,1.02,1111,0.88,1342,3.905,1354,0.912,1400,1.138,1404,0.581,1405,1.014,1415,1.349,1427,1.222,1492,1.049,1493,1.049,1494,1.049,1495,1.039,1499,1.049,1500,1.709,1501,1.039,1502,1.049,1503,1.413,1506,1.049,1507,1.049,1508,1.039,1512,1.058,1550,2.483,1556,1.068,1558,1.04,1561,1.068,1613,1.349,1623,5.27,1659,1.135,1660,0.93,1661,1.617,1710,4.529,1782,1.444,1794,1.04,1798,1.279,1854,5.716,1858,1.279,1870,1.349,1879,4.227,1893,6.964,2000,1.444,2006,6.261,2067,1.175,2077,1.099,2079,1.099,2082,1.099,2084,1.444,2085,1.444,2089,1.444,2155,1.279,2470,2.392,2492,5.676,2497,3.053,2498,1.349,2500,6.165,2501,1.349,2502,2.267,2504,1.349,2522,1.444,2540,2.56,2541,1.588,2542,1.349,2543,1.444,2544,6.419,2545,1.588,2546,3.793,2547,2.56,2548,2.816,2549,1.588,2550,1.588,2551,1.588,2552,2.816,2553,1.588,2554,1.444,2555,1.444,2556,1.588,2557,1.444,2558,4.589,2559,1.588,2560,1.588,2561,1.588,2562,1.588,2563,1.588]],["t/753",[3,1.015,7,0.625,30,2.824,44,2.824,75,4.097,149,1.015,150,3.339,226,4.508,243,5.83,249,4.672,280,7.757,321,2.35,326,4.508,340,6.319,902,6.319,1339,7.025,1342,3.601,1596,7.025,1743,7.757,2543,8.302,2564,9.13]],["t/755",[1,1.134,3,0.935,7,0.576,9,1.942,10,4.37,14,0.832,17,0.597,29,1.994,37,2.325,45,4.07,53,6.562,54,5.988,55,4.438,75,3.776,81,1.678,90,3.134,105,0.748,110,2.616,117,1.583,141,1.552,148,6.224,149,1.19,150,3.666,158,2.077,159,4.126,200,4.438,202,2.73,215,1.734,252,2.797,285,5.129,315,5.657,323,1.816,344,5.133,418,1.967,644,5.508,713,4.183,809,6.01,847,5.133,881,7.161,1150,5.823,1231,7.651,1339,6.473,1342,3.954,1346,6.473,1375,6.224,1409,5.869,1549,5.823,1635,6.773,1659,6.01,1948,5.248,2179,5.823,2248,7.651,2249,6.01,2250,6.01,2251,6.224,2565,8.413]],["t/757",[3,1.05,16,3.089,19,3.333,80,1.655,621,4.396]],["t/759",[0,1.206,1,1.424,3,1.093,6,3.701,7,0.751,14,0.973,17,0.779,27,1.905,41,1.474,50,2.905,77,3.313,90,3.663,94,1.377,95,1.085,102,1.371,105,1.026,110,2.127,117,1.987,135,1.905,141,1.504,154,2.319,215,1.679,221,3.246,224,1.502,225,3.663,226,3.494,231,3.035,244,2.33,261,2.173,277,1.352,285,4.17,289,3.456,290,4.17,302,1.984,307,3.035,314,2.71,333,3.279,418,2.469,419,3.533,465,1.647,603,2.98,621,3.793,636,3.139,646,3.573,664,3.383,713,4.889,743,4.298,1349,4.772,1409,4.772]],["t/761",[0,0.311,1,1.018,7,0.721,9,0.516,12,3.379,14,0.681,16,0.964,17,0.604,25,0.814,37,1.656,41,1.466,64,1.287,77,1.198,80,1.049,81,0.95,92,0.851,93,1.396,94,1.296,95,1.228,96,2.778,102,1.708,104,2.815,105,0.943,108,2.231,110,0.769,117,1.979,124,1.234,135,1.4,141,1.269,146,2.039,148,2.179,149,0.984,150,1.077,152,1.174,157,5.607,158,0.727,186,2.465,187,1.098,189,0.742,196,1.821,209,1.847,211,1.605,213,1.507,215,1.418,224,1.074,233,7.849,243,6.718,261,2.154,270,2.664,275,0.748,276,0.748,277,0.824,314,0.979,318,2.215,321,0.758,322,1.795,323,1.484,326,3.794,392,2.503,393,2.503,394,2.503,402,1.419,404,0.988,407,1.597,412,1.705,415,1.027,418,1.608,425,0.717,428,0.732,429,1.251,434,0.797,437,1.987,439,0.864,440,0.968,444,0.948,445,0.918,446,1.81,447,2.095,448,2.511,449,2.095,450,2.095,451,2.095,452,2.095,453,2.655,454,2.266,455,1.306,456,1.972,457,0.844,458,1.756,459,1.717,460,1.705,461,0.844,462,1.758,463,1.705,464,0.844,465,1.788,466,1.943,467,1.972,468,2.537,469,1.717,470,0.851,471,2.042,472,0.857,473,1.972,474,1.943,475,1.915,477,1.985,479,2.017,480,0.838,481,0.844,482,1.365,483,0.826,484,1.316,485,1.795,486,0.844,487,0.877,488,0.838,489,0.844,490,1.717,491,1.717,492,0.844,493,1.278,494,1.999,497,1.929,501,1.251,504,0.851,505,0.851,506,0.851,507,0.851,508,0.844,509,0.675,510,0.727,511,0.851,512,1.345,513,0.844,514,0.851,515,0.851,516,0.851,517,0.851,518,0.851,519,1.375,524,0.844,525,0.851,526,0.877,527,0.857,528,0.851,529,0.851,530,0.851,531,0.857,532,0.857,533,0.857,534,0.877,535,0.851,536,0.851,537,0.857,538,0.857,545,2.002,546,1.93,547,2.365,549,0.763,551,1.335,552,0.826,553,0.785,554,0.832,555,0.814,597,1.371,616,1.022,629,2.893,630,1.129,631,1.068,632,2.593,633,2.511,653,2.371,662,2.927,687,1.507,712,1.162,847,2.904,854,0.87,859,1.223,864,2.063,873,1.928,1019,1.068,1029,1.465,1170,2.503,1375,2.179,1400,0.883,1492,1.097,1493,1.097,1494,1.097,1495,1.087,1496,1.465,1499,1.097,1500,1.773,1501,1.087,1502,1.097,1503,2.562,1506,1.097,1507,1.097,1508,1.087,1512,1.107,1634,6.782,1802,2.179,1834,4.109,1948,7.217,1989,7.776,2249,2.104,2250,3.401,2251,3.522,2566,4.76,2567,4.76,2568,4.76,2569,5.99,2570,7.526,2571,8.448,2572,6.863,2573,10.35,2574,2.946,2575,6.863,2576,5.09,2577,8.31,2578,4.609,2579,2.503,2580,4.044,2581,2.679,2582,2.679,2583,5.447,2584,2.679,2585,2.679,2586,2.679,2587,2.503,2588,2.503,2589,2.503,2590,2.679,2591,4.329,2592,2.679,2593,2.679,2594,2.679,2595,2.679,2596,2.266,2597,2.679,2598,2.679,2599,2.679,2600,2.679,2601,2.679,2602,2.946,2603,2.503,2604,2.503,2605,2.679,2606,2.679,2607,4.329,2608,2.679,2609,2.679,2610,2.679,2611,2.679,2612,2.679]],["t/763",[16,2.932,28,4.293,157,6.758,183,4.023,393,9.612,662,4.173,847,6.902,1661,5.149,1989,6.204,2249,7.433,2613,8.85,2614,10.404,2615,8.964]],["t/765",[0,0.931,1,1.388,14,0.871,17,0.625,28,3.907,53,5.764,54,5.259,55,4.644,95,0.972,110,2.298,117,1.656,144,4.097,149,0.979,152,3.507,157,6.15,195,3.134,196,2.331,284,4.573,314,2.927,326,3.775,359,6.513,403,5.371,405,3.775,465,1.779,611,5.764,641,5.92,712,3.473,763,6.774,1256,6.289,1338,6.774,1409,6.029,1604,7.087,1634,5.92,1665,6.289,1948,6.806,1989,6.094,2284,7.087]],["t/767",[0,0.193,1,0.43,3,0.203,7,0.643,14,0.747,17,0.408,25,1.402,27,1.765,28,2.397,37,2.313,41,1.365,64,1.556,79,1.224,80,0.321,81,1.436,94,0.661,95,1.036,102,1.707,104,2.037,105,0.834,108,2.353,110,1.324,117,1.651,120,2.773,123,2.644,124,1.491,130,0.736,135,1.957,141,0.936,146,2.133,149,1.173,152,0.729,157,3.436,158,1.677,164,1.224,186,2.789,187,1.17,189,1.279,196,2.411,209,1.362,215,1.725,224,1.316,233,5.979,270,3.014,275,1.287,276,1.287,277,1.151,284,1.656,293,0.997,297,1.445,314,1.06,316,1.555,318,2.629,321,1.306,322,2.377,323,1.966,326,3.087,402,2.034,407,2.231,412,2.382,415,1.554,418,2.129,425,1.235,428,1.261,429,1.892,434,1.372,437,2.631,440,1.032,448,3.036,449,2.774,450,2.774,451,2.774,452,2.774,453,2.884,454,2.74,455,2.23,456,2.611,457,1.454,458,2.454,459,2.399,460,2.382,461,1.454,462,2.328,463,2.382,464,1.454,465,2.122,466,2.573,467,2.611,468,3.011,469,2.399,470,1.465,471,2.601,472,1.476,473,2.611,474,2.573,475,2.536,477,2.528,479,2.787,480,1.444,481,1.454,482,2.064,483,1.423,484,1.99,485,2.24,486,1.454,487,1.51,488,1.444,489,1.454,490,2.399,491,2.399,492,1.454,493,1.545,494,2.546,497,2.407,501,2.307,504,1.465,505,1.465,506,1.465,507,1.465,508,1.454,509,1.162,510,1.252,511,1.465,512,2.034,513,1.454,514,1.465,515,1.465,516,1.465,517,1.465,518,1.465,519,2.079,524,1.454,525,1.465,526,1.51,527,1.476,528,1.465,529,1.465,530,1.465,531,1.476,532,1.476,533,1.476,534,1.51,535,1.465,536,1.465,537,1.476,538,1.476,545,2.651,546,2.458,547,0.629,549,1.315,551,2.019,552,1.423,553,1.352,554,1.433,555,1.402,561,1.014,620,1.198,654,0.997,662,1.156,715,0.91,852,1.522,853,2.269,854,1.499,855,2.712,856,1.536,857,1.536,858,2.289,859,0.76,862,1.536,863,1.536,864,1.521,865,1.943,866,1.536,1019,0.663,1113,1.664,1400,1.521,1404,1.55,1492,0.682,1493,0.682,1494,0.682,1495,0.675,1499,0.682,1500,1.188,1501,0.675,1502,0.682,1503,0.682,1506,0.682,1507,0.682,1508,0.675,1512,0.688,1518,1.523,1596,1.408,1604,1.473,1634,2.144,1665,2.278,1666,1.354,1834,5.607,1874,1.307,1948,5.22,1989,4.983,2250,1.307,2251,1.354,2286,3.135,2570,3.261,2572,1.555,2576,5.367,2578,7.401,2579,1.555,2587,1.555,2589,1.555,2596,3.261,2603,1.555,2616,1.664,2617,1.83,2618,6.317,2619,5.753,2620,7.551,2621,4.238,2622,1.83,2623,1.83,2624,3.189,2625,1.83,2626,1.83,2627,1.83,2628,1.83,2629,1.83]],["t/769",[0,0.36,1,0.889,6,0.631,7,0.741,9,0.438,14,0.762,16,0.454,17,0.491,25,1.149,27,1.456,28,2.027,37,2.063,41,1.448,50,1.416,51,1.177,53,5.966,54,6.038,55,2.193,64,1.444,72,6.622,73,0.798,79,0.721,80,0.438,81,1.242,90,0.517,91,1.18,94,1.238,95,1.204,96,1.837,102,1.708,104,2.536,105,0.908,108,2.78,110,1.517,117,1.301,120,1.692,123,2.204,124,1.384,130,1.005,135,1.745,141,1.073,144,0.646,146,2.115,149,1.104,152,0.995,157,2.484,158,1.319,164,0.721,176,1.268,186,2.682,187,0.959,189,1.048,196,2.238,205,2.139,209,1.561,210,0.948,211,0.757,215,1.539,224,1.28,233,7.182,236,0.887,270,2.898,275,1.055,276,1.055,277,1.027,293,0.757,297,0.852,300,0.7,302,0.338,307,0.93,318,2.487,321,1.07,322,2.164,323,1.789,329,1.069,359,1.027,361,0.744,402,1.769,407,1.99,412,2.124,415,1.344,418,1.938,419,3.594,425,1.012,428,1.034,429,1.637,434,1.124,437,2.394,439,1.219,440,1.267,446,1.257,447,1.771,448,2.854,449,2.525,450,2.525,451,2.525,452,2.525,453,2.81,454,2.576,455,1.897,456,2.377,457,1.192,458,2.189,459,2.14,460,2.124,461,1.192,462,2.119,463,2.124,464,1.192,465,2.032,466,2.342,467,2.377,468,2.848,469,2.14,470,1.201,471,2.401,472,1.21,473,2.377,474,2.342,475,2.308,477,2.334,479,2.523,480,1.183,481,1.192,482,1.785,483,1.166,484,1.721,485,2.066,486,1.192,487,1.237,488,1.183,489,1.192,490,2.14,491,2.14,492,1.192,493,1.434,494,2.35,497,2.22,501,2.024,504,1.201,505,1.201,506,1.201,507,1.201,508,1.192,509,0.953,510,1.026,511,1.201,512,1.759,513,1.192,514,1.201,515,1.201,516,1.201,517,1.201,518,1.201,519,1.798,524,1.192,525,1.201,526,1.237,527,1.21,528,1.201,529,1.201,530,1.201,531,1.21,532,1.21,533,1.21,534,1.237,535,1.201,536,1.201,537,1.21,538,1.21,545,2.412,546,2.269,547,1.649,549,1.078,551,1.746,552,1.166,553,1.108,554,1.174,555,1.149,629,2.386,630,0.532,631,1.233,632,2.265,633,2.193,636,1.327,638,0.602,643,0.859,662,3.303,673,0.847,674,1.027,687,0.711,710,1.462,712,0.548,734,1.384,741,0.887,752,1.027,785,0.813,847,4.395,852,0.897,853,1.493,854,1.228,855,1.918,856,0.905,857,0.905,858,1.507,859,1.413,862,0.905,863,0.905,864,1.744,865,0.957,866,0.905,1019,0.905,1029,1.242,1074,0.934,1076,1.263,1164,1.118,1300,1.263,1338,1.069,1344,1.848,1400,1.247,1404,0.913,1405,0.887,1409,0.813,1492,0.93,1493,0.93,1494,0.93,1495,0.922,1496,1.242,1499,0.93,1500,1.549,1501,0.922,1502,0.93,1503,1.786,1506,0.93,1507,0.93,1508,0.922,1512,0.939,1518,1.193,1524,0.909,1553,1.263,1634,3.909,1642,1.922,1683,3.199,1834,4.728,1948,3.626,1989,6.877,2005,5.544,2249,3.425,2250,5.922,2251,5.523,2286,1.848,2297,2.271,2570,5.321,2571,6.891,2575,5.6,2578,5.744,2580,2.892,2588,2.892,2596,1.922,2604,2.892,2613,6.529,2616,1.263,2630,5.013,2631,6.543,2632,5.875,2633,4.538,2634,4.939,2635,1.389,2636,1.389,2637,1.389,2638,4.36,2639,3.095,2640,5.875,2641,4.538,2642,4.36,2643,5.875,2644,6.343,2645,1.263,2646,2.271,2647,2.122,2648,2.122,2649,1.263,2650,1.263,2651,2.271,2652,1.263,2653,1.263,2654,1.263,2655,1.389,2656,1.263,2657,1.263,2658,1.263,2659,1.263,2660,2.271,2661,1.263,2662,1.263,2663,1.263,2664,2.271,2665,1.263,2666,1.263,2667,1.263,2668,1.263,2669,2.271,2670,1.263,2671,1.263]],["t/771",[0,0.201,1,1.336,3,0.718,4,1.187,7,0.771,14,0.726,17,0.234,19,0.672,20,1.499,25,1.207,27,1.716,37,2.125,41,1.273,50,1.908,51,0.897,53,6.489,54,6.256,55,1.004,64,1.41,72,5.647,77,0.774,79,0.953,80,0.578,81,1.289,94,0.569,95,1.167,102,1.705,104,0.571,105,0.921,108,4.032,110,1.686,117,1.638,120,2.447,123,2.71,124,1.351,135,1.797,141,1.727,146,2.111,149,1.121,150,0.696,152,0.758,158,1.595,164,0.953,186,2.709,187,1.008,189,1.101,196,2.249,202,0.617,209,1.4,210,0.722,215,1.833,224,1.238,225,1.229,226,0.816,231,1.229,268,1.464,270,2.928,275,1.109,276,1.109,277,1.057,288,0.946,296,1.137,297,1.125,302,0.804,307,0.709,314,0.633,318,2.542,321,1.124,322,2.272,323,1.833,328,3.55,356,1.246,402,1.822,407,2.05,412,2.188,415,1.394,418,2.155,419,2.801,425,1.064,428,1.086,429,1.698,434,1.181,437,2.453,438,1.499,440,0.889,448,2.9,449,2.587,450,2.587,451,2.587,452,2.587,453,2.829,454,2.618,455,2.014,456,2.435,457,1.252,458,2.254,459,2.204,460,2.188,461,1.252,462,2.171,463,2.188,464,1.252,465,2.037,466,2.399,467,2.435,468,2.89,469,2.204,470,1.262,471,2.452,472,1.271,473,2.435,474,2.399,475,2.365,477,2.383,479,2.608,480,1.243,481,1.252,482,1.852,483,1.225,484,1.785,485,2.086,486,1.252,487,1.3,488,1.243,489,1.252,490,2.204,491,2.204,492,1.252,493,1.4,494,2.4,497,2.241,501,2.1,504,1.262,505,1.262,506,1.262,507,1.262,508,1.252,509,1.001,510,1.078,511,1.262,512,1.825,513,1.252,514,1.262,515,1.262,516,1.262,517,1.262,518,1.262,519,1.866,524,1.252,525,1.262,526,1.3,527,1.271,528,1.262,529,1.262,530,1.262,531,1.271,532,1.271,533,1.271,534,1.3,535,1.262,536,1.262,537,1.271,538,1.271,545,2.472,546,2.317,547,1.135,549,1.132,551,1.812,552,1.225,553,1.165,554,1.234,555,1.207,582,1.073,600,0.69,612,1.408,638,0.825,644,1.246,662,3.285,664,1.37,687,3.306,712,0.751,715,0.946,747,1.464,758,1.532,767,1.36,787,1.408,847,5.625,852,1.185,853,1.872,854,1.29,855,2.32,856,1.196,857,1.196,858,1.889,859,2.164,862,1.196,863,1.196,864,0.99,865,1.674,866,1.196,875,1.073,910,1.187,1019,0.69,1029,1.641,1135,1.215,1256,1.36,1337,1.187,1400,1.31,1404,1.207,1409,1.932,1411,1.617,1492,0.709,1493,0.709,1494,0.709,1495,1.612,1496,1.641,1499,0.709,1500,1.229,1501,1.612,1502,0.709,1503,1.229,1506,0.709,1507,0.709,1508,0.702,1512,0.715,1518,2.086,1534,3.973,1599,1.731,1632,2.357,1642,2.539,1736,1.617,1740,1.617,1834,5.074,1900,1.617,2145,6.235,2146,4.429,2147,4.429,2148,4.429,2249,1.36,2284,2.656,2286,2.441,2305,1.731,2306,4.74,2578,6.535,2596,2.539,2613,5.201,2630,2.656,2640,5.489,2641,6.235,2643,5.489,2644,8.063,2647,1.617,2648,1.617,2664,5.875,2665,3.972,2666,3.001,2667,1.731,2668,3.001,2669,3.001,2670,1.731,2671,1.731,2672,1.903,2673,1.903,2674,3.3,2675,1.903,2676,1.903,2677,1.903,2678,1.903,2679,1.903,2680,3.3,2681,5.896,2682,1.903,2683,1.903]],["t/773",[0,0.196,1,1.234,7,0.771,14,0.424,17,0.626,25,0.513,30,0.999,37,1.185,41,1.413,53,4.482,54,5.467,64,0.874,67,0.965,72,5.85,81,0.644,92,0.536,93,0.947,94,1.272,95,1.258,96,2.191,102,1.709,104,2.827,105,0.99,108,1.597,110,0.485,117,1.722,124,0.837,128,1.048,130,1.3,135,1.002,141,1.592,144,1.504,146,2.047,149,0.879,157,4.09,158,0.459,159,1.584,163,0.965,186,2.121,187,0.428,189,0.468,196,1.357,202,1.663,209,2.26,215,0.884,224,0.729,233,8.425,243,5.743,261,1.548,270,2.293,275,0.471,276,0.471,277,0.59,299,1.226,304,0.747,318,1.815,321,0.478,322,1.338,323,1.106,326,2.49,392,4.934,394,4.934,402,1.016,407,1.143,412,1.22,415,0.697,418,1.198,419,4.625,425,0.452,428,0.462,429,0.849,434,0.502,437,1.48,439,0.545,440,0.657,444,0.598,445,0.579,446,1.755,447,2.209,448,2.022,449,1.561,450,1.561,451,1.561,452,1.561,453,2.389,454,1.825,455,0.886,456,1.469,457,0.532,458,1.257,459,1.229,460,1.22,461,0.532,462,1.31,463,1.22,464,0.532,465,1.466,466,1.448,467,1.469,468,2.079,469,1.229,470,0.536,471,1.57,472,0.54,473,1.469,474,1.448,475,1.427,477,1.526,479,1.503,480,0.529,481,0.532,482,0.926,483,0.521,484,0.893,485,1.338,486,0.532,487,0.553,488,0.529,489,0.532,490,1.229,491,1.229,492,0.532,493,0.868,494,1.537,497,1.437,501,0.849,504,0.536,505,0.536,506,0.536,507,0.536,508,0.532,509,0.426,510,0.459,511,0.536,512,0.913,513,0.532,514,0.536,515,0.536,516,0.536,517,0.536,518,0.536,519,0.933,524,0.532,525,0.536,526,0.553,527,0.54,528,0.536,529,0.536,530,0.536,531,0.54,532,0.54,533,0.54,534,0.553,535,0.536,536,0.536,537,0.54,538,0.54,545,1.491,546,1.484,547,2.894,549,0.481,551,0.906,552,0.521,553,0.495,554,0.525,555,0.513,597,1.504,629,2.913,630,0.712,631,1.554,632,3.164,633,3.063,662,2.104,710,1.892,743,3.063,817,1.971,854,0.549,859,0.771,864,2.524,937,1.216,1019,0.673,1029,0.923,1043,2.486,1163,1.495,1223,1.286,1400,0.557,1409,2.51,1492,0.692,1493,0.692,1494,0.692,1495,0.685,1496,0.923,1499,0.692,1500,1.203,1501,0.685,1502,0.692,1503,3.135,1506,0.692,1507,0.692,1508,0.685,1512,0.698,1634,5.803,1834,3.062,1948,6.75,1989,7.928,2005,4.468,2144,2.486,2249,4.148,2250,7.756,2251,7.891,2310,2.938,2570,6.476,2571,9.459,2572,4.934,2573,9.619,2575,8.857,2576,3.643,2577,6.914,2578,3.299,2579,1.578,2580,6.72,2581,1.689,2582,1.689,2583,3.899,2584,1.689,2585,1.689,2586,1.689,2587,1.578,2588,6.46,2589,1.578,2590,1.689,2591,2.938,2592,1.689,2593,1.689,2594,1.689,2595,1.689,2596,1.429,2597,1.689,2598,1.689,2599,1.689,2600,1.689,2601,1.689,2603,1.578,2604,6.46,2605,1.689,2606,1.689,2607,2.938,2608,1.689,2609,1.689,2610,1.689,2611,1.689,2612,1.689,2613,6.367,2630,4.126,2631,8.646,2632,6.162,2633,4.355,2634,4.355,2638,7.192,2639,3.899,2640,6.72,2641,3.643,2642,5.28,2643,4.934,2644,5.413,2645,1.689,2646,6.226,2647,1.578,2648,1.578,2649,1.689,2650,1.689,2651,6.226,2652,1.689,2653,1.689,2654,1.689,2656,1.689,2657,1.689,2658,1.689,2659,1.689,2660,6.226,2661,1.689,2662,1.689,2663,1.689,2684,7.909,2685,4.287,2686,7.909,2687,4.287,2688,4.287,2689,7.909,2690,4.287,2691,4.287,2692,1.857,2693,1.857,2694,1.857,2695,1.857,2696,1.857,2697,1.857,2698,1.857,2699,1.857,2700,1.857,2701,1.857,2702,1.857,2703,1.857,2704,1.857,2705,1.857,2706,1.857,2707,1.857,2708,1.857,2709,1.857,2710,1.857,2711,1.857,2712,1.857,2713,1.857]],["t/775",[7,0.793,16,1.589,17,0.58,34,3.47,41,1.694,53,5.847,54,5.336,62,8.984,72,6.872,92,1.403,93,2.047,94,1.518,95,1.305,96,3.387,102,1.716,105,0.992,150,1.776,157,4.17,359,3.594,438,2.206,439,1.424,440,0.988,444,1.563,445,1.514,446,2.977,447,3.268,546,1.242,629,4.051,630,1.861,631,2.961,632,5.154,633,4.99,637,4.17,638,2.106,710,4.087,712,1.916,1074,3.267,1634,6.361,1710,3.711,1834,5.336,1948,6.595,1989,7.52,2252,4.418,2253,6.348,2570,8.135,2630,7.19,2631,8.038,2632,8.038,2633,7.589,2634,7.589,2714,4.858]],["t/777",[0,1.088,3,1.145,7,0.705,9,1.542,14,0.871,16,2.88,17,0.731,80,1.542,90,3.279,95,0.972,105,0.97,117,1.937,135,2.058,149,0.979,154,2.505,202,3.34,244,2.44,252,2.927,277,1.547,285,4.505,289,3.734,290,4.505,465,1.779,600,3.191,601,3.998,646,3.86,669,5.371,713,5.119,1349,5.155,1660,5.155]],["t/779",[3,1.231,14,0.903,17,0.786,30,3.253,149,1.169,151,5.57,244,2.163,290,4.672,302,2.697,402,2.163,709,7.779,1012,5.694,1013,7.757,1662,4.974]],["t/781",[0,1.131,1,1.023,3,1.189,7,0.754,9,1.649,14,0.931,16,2.481,17,0.727,19,3.882,27,1.773,28,2.878,30,2.346,45,3.67,50,2.241,83,3.489,90,2.825,95,1.181,102,1.533,105,0.951,119,3.116,133,3.289,135,1.773,149,1.138,154,3.131,174,3.67,176,2.825,197,3.881,205,2.346,223,2.481,224,1.521,225,4.097,244,2.535,261,2.728,272,4.679,277,1.472,317,3.116,324,4.132,361,5.484,389,3.575,404,2.543,405,4.035,415,2.031,441,3.116,442,3.182,465,1.533,563,3.643,600,2.749,601,3.445,616,2.631,621,3.53,643,3.519,650,5.611,680,4.132,691,3.881,712,2.992,717,3.825,747,3.364,1012,6.382,1169,3.67,1487,4.001,1664,4.966,1710,4.274,2025,5.419,2316,5.87,2326,5.419,2715,7.083,2716,5.611]],["t/783",[3,1.048,19,3.327,135,2.204,404,3.16,405,4.042,717,4.754]],["t/785",[3,1.152,14,0.881,17,0.736,30,2.753,119,3.655,140,6.16,149,1.152,183,3.994,195,3.168,213,4.554,230,6.847,289,3.774,290,4.554,302,2.167,321,2.29,358,6.583,501,2.339,549,2.685,597,4.142,684,5.429,709,6.583,1012,5.551,1013,7.561,1398,6.357,1414,7.664,1563,5.019,1660,5.211,1661,5.112,1662,4.848,2316,5.551,2338,6.847,2717,8.092]],["t/787",[9,1.976,13,3.219,28,3.928,154,3.21,326,3.809,465,1.795,614,5.815,638,3.851,910,5.541,1012,6.831,1710,4.7,2025,7.394,2316,7.254,2326,6.346,2715,7.581,2716,7.656,2718,7.963,2719,8.078]],["t/789",[6,3.834,7,0.688,9,1.944,13,3.059,17,0.599,30,2.611,35,6.496,80,1.944,109,4.197,149,1.192,154,2.858,183,3.789,213,4.32,236,7.342,238,5.843,296,5.043,299,3.204,317,3.468,337,3.834,421,6.496,427,5.677,465,1.706,614,5.527,662,3.64,694,5.043,755,4.524,1012,6.265,1354,4.85,1629,5.843,1650,5.266,1710,4.561,1744,5.139,1882,8.086,2316,7.304,2395,6.413,2715,6.952,2720,8.086]],["t/791",[0,0.96,3,1.165,7,0.622,9,1.591,14,0.898,20,4.76,21,6.486,95,1.157,105,0.807,117,1.708,203,5.539,244,2.151,264,6.486,288,4.514,289,3.85,302,2.211,404,3.044,465,1.835,546,2.32,1786,6.986,2316,5.663,2721,8.256,2722,8.256]],["t/793",[3,1.031,6,3.367,7,0.796,9,1.299,14,0.734,17,0.659,28,4.028,30,2.293,41,1.518,92,2.141,93,2.72,94,1.474,95,1.171,102,1.7,144,4.318,230,5.705,265,5.705,289,3.144,290,5.182,323,1.6,404,2.486,439,2.174,440,1.508,444,2.386,445,2.311,446,2.241,447,3.085,465,1.498,549,1.922,684,4.523,687,3.794,734,4.108,910,4.624,1012,5.787,1398,5.296,1414,5.485,1563,4.182,1698,7.582,1710,4.214,1866,4.734,2025,7.582,2315,7.851,2316,7.133,2326,6.629,2715,6.422,2716,7.492,2718,7.793,2723,6.742,2724,7.414,2725,8.166]],["t/795",[0,0.638,1,0.749,6,0.671,7,0.672,9,0.877,14,0.705,17,0.428,20,1.2,25,1.383,27,1.299,28,1.653,30,0.457,37,2.296,41,1.357,64,1.743,79,1.034,81,1.422,83,0.504,94,0.652,95,1.118,102,1.707,104,2.814,105,0.858,108,3.274,110,1.306,117,1.281,120,1.766,123,2.3,124,1.671,135,1.983,141,1.113,146,2.2,149,1.168,158,1.489,164,0.763,186,2.782,187,1.154,189,1.261,196,2.397,205,1.108,209,1.62,210,1.002,215,1.712,224,1.287,236,2.286,247,0.922,250,0.902,270,3.007,275,1.27,276,1.27,277,1.142,297,0.901,307,0.551,317,0.607,318,2.629,321,1.288,322,2.363,323,1.954,389,0.697,402,2.01,404,0.496,407,2.215,412,2.364,415,1.539,418,2.116,425,1.219,428,1.244,429,1.874,434,1.353,437,2.615,440,1.018,448,3.024,449,2.757,450,2.757,451,2.757,452,2.757,453,2.879,454,2.729,455,2.105,456,2.595,457,1.435,458,2.435,459,2.381,460,2.364,461,1.435,462,2.314,463,2.364,464,1.435,465,2.123,466,2.557,467,2.595,468,3,469,2.381,470,1.445,471,2.588,472,1.456,473,2.595,474,2.557,475,2.52,477,2.515,479,2.721,480,1.424,481,1.435,482,2.044,483,1.403,484,1.971,485,2.294,486,1.435,487,1.489,488,1.424,489,1.435,490,2.381,491,2.381,492,1.435,493,1.731,494,2.533,497,2.465,501,2.133,504,1.445,505,1.445,506,1.445,507,1.445,508,1.435,509,1.147,510,1.235,511,1.445,512,2.014,513,1.435,514,1.445,515,1.445,516,1.445,517,1.445,518,1.445,519,2.059,524,1.435,525,1.445,526,1.489,527,1.456,528,1.445,529,1.445,530,1.445,531,1.456,532,1.456,533,1.456,534,1.489,535,1.445,536,1.445,537,1.456,538,1.456,545,2.634,546,2.446,547,1.721,549,1.297,551,1.999,552,1.403,553,1.334,554,1.414,555,1.383,582,0.834,662,3.01,675,1.256,747,1.172,798,1.023,852,0.949,853,1.564,854,1.478,855,1.996,856,0.957,857,0.957,858,1.578,859,1.808,862,0.957,863,0.957,864,1.809,865,1.012,866,0.957,1012,1.648,1019,1.298,1029,1.313,1256,1.056,1400,1.501,1404,0.966,1414,1.094,1492,1.334,1493,1.334,1494,1.334,1495,1.321,1496,1.313,1499,1.334,1500,2.07,1501,1.321,1502,1.334,1503,1.864,1506,1.334,1507,1.334,1508,1.321,1512,1.346,1518,1.261,1527,3.195,1563,0.834,1698,5.797,1710,1.2,1744,3.298,1750,4.348,1753,2.478,1756,2.286,1761,2.478,1866,0.944,2025,2.558,2179,1.023,2210,1.344,2315,6.502,2316,3.466,2326,2.558,2462,1.023,2715,1.828,2716,2.649,2718,2.032,2725,5.706,2726,2.641,2727,9.075,2728,2.402,2729,4.252,2730,2.883,2731,5.125,2732,1.478,2733,2.402,2734,4.252,2735,2.402,2736,2.402,2737,1.478,2738,2.402,2739,1.344,2740,2.402,2741,1.478,2742,1.344,2743,1.478,2744,1.478,2745,1.478]],["t/797",[0,0.538,1,0.973,6,1.06,7,0.739,9,0.688,13,0.846,14,0.714,17,0.595,25,1.086,27,1.395,28,2.265,30,1.216,37,1.994,41,1.395,54,1.395,64,1.376,79,1.135,81,1.328,92,0.674,93,1.152,94,1.093,95,1.262,102,1.707,104,2.598,105,0.898,108,1.895,110,1.026,116,1.115,117,1.357,120,2.35,124,1.319,135,1.687,141,1.228,144,1.829,146,2.092,149,1.099,158,1.256,164,0.674,186,2.649,187,0.906,189,0.99,195,0.831,196,2.133,197,1.195,203,1.424,205,1.216,209,1.788,210,0.886,215,1.487,224,1.192,236,3.249,252,0.776,270,2.863,275,0.997,276,0.997,277,0.992,290,2.011,293,1.272,296,1.395,297,0.796,302,0.569,304,2.047,307,0.87,317,0.959,318,2.475,321,1.011,322,2.325,323,1.809,402,1.71,407,1.924,412,2.053,415,1.437,418,1.883,424,1.491,425,0.957,428,0.977,429,1.569,434,1.063,437,2.327,439,0.685,440,1.035,444,0.751,445,0.728,446,0.706,447,2.028,448,2.8,449,2.454,450,2.454,451,2.454,452,2.454,453,2.787,454,2.527,455,1.827,456,2.31,457,1.127,458,2.115,459,2.068,460,2.053,461,1.127,462,2.059,463,2.053,464,1.127,465,1.999,466,2.276,467,2.31,468,2.8,469,2.068,470,1.135,471,2.343,472,1.143,473,2.31,474,2.276,475,2.243,477,2.277,479,2.458,480,1.118,481,1.127,482,1.711,483,1.102,484,1.649,485,2.003,486,1.127,487,1.17,488,1.118,489,1.127,490,2.068,491,2.068,492,1.127,493,1.366,494,2.293,497,2.152,501,1.896,504,1.135,505,1.135,506,1.135,507,1.135,508,1.127,509,0.9,510,0.97,511,1.135,512,1.686,513,1.127,514,1.135,515,1.135,516,1.135,517,1.135,518,1.135,519,1.724,524,1.127,525,1.135,526,1.17,527,1.143,528,1.135,529,1.135,530,1.135,531,1.143,532,1.143,533,1.143,534,1.17,535,1.135,536,1.135,537,1.143,538,1.143,545,2.344,546,2.214,547,2.052,549,1.319,551,1.673,552,1.102,553,1.048,554,1.11,555,1.086,563,1.399,629,2.551,630,1.949,631,1.844,662,3.14,673,1.424,680,1.272,684,1.424,687,1.195,691,1.195,715,1.161,740,1.317,852,0.839,853,1.411,854,1.161,855,1.827,856,0.846,857,0.846,858,1.424,859,0.969,862,0.846,863,0.846,864,1.997,865,1.505,866,0.846,1012,3.722,1019,0.846,1029,1.161,1078,1.294,1337,1.456,1400,1.179,1404,0.854,1492,0.87,1493,0.87,1494,0.87,1495,0.862,1496,1.161,1499,0.87,1500,1.464,1501,0.862,1502,0.87,1503,2.223,1506,0.87,1507,0.87,1508,0.862,1512,0.878,1527,5.532,1631,1.727,1661,1.341,1698,6.516,1710,2.311,1744,4.433,1750,3.249,1753,1.616,1756,1.491,1761,1.616,1780,1.984,1794,1.529,2010,2.807,2025,4.263,2314,7.752,2315,7.545,2316,5.228,2326,2.807,2348,5.988,2371,1.727,2372,2.907,2374,1.727,2395,5.532,2462,1.616,2715,4.131,2716,3.764,2718,3.915,2720,6.748,2725,7.164,2727,9.573,2729,5.07,2730,1.88,2731,5.657,2734,5.07,2746,2.335,2747,8.403,2748,4.627,2749,3.573,2750,3.573,2751,2.123,2752,3.573,2753,3.573,2754,2.123,2755,2.335,2756,3.573,2757,3.573,2758,2.123,2759,2.335]],["t/799",[0,0.53,1,1.088,7,0.749,9,0.55,14,0.666,17,0.554,25,1.155,27,0.977,37,2.07,41,1.451,64,1.538,79,1.806,80,0.55,81,1.247,92,0.519,93,0.92,94,1.297,95,1.236,102,1.709,104,2.8,105,0.885,110,1.091,116,0.858,117,0.942,119,0.738,120,2.007,124,1.474,135,1.751,141,1.241,146,2.143,149,1.106,154,2.031,158,1.237,164,0.519,176,0.669,186,2.685,187,0.964,189,1.053,196,2.2,205,0.556,209,1.807,210,1.191,215,1.543,224,1.212,236,2.004,238,2.173,252,0.598,270,2.901,275,1.061,276,1.061,277,1.03,297,0.613,304,0.723,307,0.669,314,0.598,317,0.738,318,2.491,321,1.076,322,2.226,323,1.794,402,1.848,404,0.603,407,1.997,412,2.131,415,1.349,418,1.943,419,0.779,425,1.018,428,1.039,429,1.643,434,1.13,437,2.401,439,0.92,440,1.157,444,0.578,445,0.56,446,1.263,447,2.281,448,2.859,449,2.531,450,2.531,451,2.531,452,2.531,453,2.812,454,2.58,455,1.846,456,2.383,457,1.198,458,2.196,459,2.147,460,2.131,461,1.198,462,2.124,463,2.131,464,1.198,465,2.027,466,2.348,467,2.383,468,2.853,469,2.147,470,1.207,471,2.406,472,1.216,473,2.383,474,2.348,475,2.314,477,2.339,479,2.5,480,1.189,481,1.198,482,1.792,483,1.172,484,1.728,485,2.106,486,1.198,487,1.244,488,1.189,489,1.198,490,2.147,491,2.147,492,1.198,493,1.527,494,2.355,497,2.263,501,1.876,504,1.207,505,1.207,506,1.207,507,1.207,508,1.198,509,0.958,510,1.032,511,1.207,512,1.766,513,1.198,514,1.207,515,1.207,516,1.207,517,1.207,518,1.207,519,1.806,524,1.198,525,1.207,526,1.244,527,1.216,528,1.207,529,1.207,530,1.207,531,1.216,532,1.216,533,1.216,534,1.693,535,1.207,536,1.207,537,1.216,538,1.216,545,2.419,546,2.274,547,2.15,549,1.083,551,1.753,552,1.172,553,1.114,554,1.181,555,1.155,582,1.014,629,2.179,630,1.601,631,1.515,636,0.574,662,2.266,734,0.996,852,0.645,853,1.128,854,1.235,855,1.501,856,0.651,857,0.651,858,1.138,862,0.651,863,0.651,864,2.018,865,1.203,866,0.651,937,1.177,1012,3.125,1019,1.138,1111,0.996,1400,1.254,1404,0.657,1405,1.148,1492,1.169,1493,1.169,1494,1.169,1495,1.158,1499,1.169,1500,1.866,1501,1.158,1502,1.169,1503,2.328,1506,1.169,1507,1.169,1508,1.158,1512,1.18,1524,1.177,1527,3.632,1563,2.357,1629,1.244,1698,5.765,1710,1.898,1744,3.199,1853,1.527,1982,1.329,2130,1.634,2179,1.244,2314,8.011,2315,6.907,2316,5.44,2328,1.527,2348,2.986,2371,1.329,2372,1.329,2374,1.329,2395,4.296,2462,1.244,2715,3.468,2719,2.855,2720,7.022,2725,6.209,2730,1.447,2747,8.522,2748,3.801,2749,3.801,2750,3.801,2751,1.634,2752,3.801,2753,3.801,2754,1.634,2756,3.801,2757,3.801,2758,1.634,2760,1.797,2761,5.685,2762,1.634,2763,1.634,2764,6.251,2765,3.139,2766,3.139,2767,1.797,2768,3.139,2769,1.797,2770,6.251,2771,10.692,2772,6.251,2773,6.251,2774,3.139,2775,3.139,2776,3.139,2777,3.139,2778,3.139,2779,4.18,2780,3.139,2781,3.139,2782,1.797,2783,3.139,2784,3.139,2785,3.139,2786,3.139,2787,1.797,2788,1.797,2789,1.797,2790,1.797]],["t/801",[0,0.829,1,0.829,7,0.742,9,1.078,14,0.677,17,0.525,20,1.113,25,1.131,27,1.231,30,1.265,37,2.043,41,1.462,64,1.425,79,1.777,80,0.717,81,1.227,92,0.708,93,1.199,94,1.304,95,1.242,102,1.708,104,2.562,105,0.879,110,1.068,116,1.17,117,1.157,123,3.145,124,1.365,133,1.062,135,1.728,141,1.135,144,1.14,146,2.119,149,1.099,158,1.3,164,0.708,176,0.912,186,2.672,187,0.944,189,1.031,191,1.647,196,2.177,197,2.093,205,0.758,209,1.652,210,1.552,215,1.524,224,1.169,231,0.912,247,1.528,270,2.888,275,1.038,276,1.038,277,1.017,290,1.253,297,0.835,304,0.986,307,0.912,317,1.68,318,2.475,321,1.053,322,2.146,323,1.774,324,1.335,402,1.949,403,1.494,407,1.971,412,2.104,415,1.476,418,1.922,425,0.996,428,1.017,429,1.617,434,1.106,437,2.375,439,0.718,440,1.071,444,0.788,445,0.764,446,1.236,447,1.874,448,2.839,449,2.504,450,2.504,451,2.504,452,2.504,453,2.803,454,2.562,455,1.877,456,2.357,457,1.173,458,2.168,459,2.12,460,2.104,461,1.173,462,2.102,463,2.104,464,1.173,465,1.998,466,2.323,467,2.357,468,2.835,469,2.12,470,1.182,471,2.384,472,1.19,473,2.357,474,2.323,475,2.289,477,2.317,479,2.504,480,1.164,481,1.173,482,1.764,483,1.147,484,1.7,485,2.048,486,1.173,487,1.218,488,1.164,489,1.173,490,2.12,491,2.12,492,1.173,493,1.414,494,2.334,497,2.2,501,1.943,504,1.182,505,1.182,506,1.182,507,1.182,508,1.173,509,0.937,510,1.01,511,1.182,512,1.738,513,1.173,514,1.182,515,1.182,516,1.182,517,1.182,518,1.182,519,1.777,524,1.173,525,1.182,526,1.218,527,1.19,528,1.182,529,1.182,530,1.182,531,1.19,532,1.19,533,1.19,534,1.218,535,1.182,536,1.182,537,1.19,538,1.19,545,2.393,546,2.253,547,1.811,549,1.06,551,1.725,552,1.147,553,1.091,554,1.156,555,1.131,563,3.041,582,1.382,584,1.812,616,0.85,629,2.621,630,2.018,631,1.909,634,1.087,643,0.842,646,1.794,654,1.335,662,2.479,669,1.494,673,2.496,701,1.972,740,1.382,747,1.087,798,1.696,852,0.88,853,1.469,854,1.208,855,1.892,856,0.888,857,0.888,858,1.483,862,0.888,863,0.888,864,1.845,866,0.888,873,1.604,910,1.528,1019,0.888,1111,2.267,1112,2.228,1400,1.227,1404,0.896,1492,0.912,1493,0.912,1494,0.912,1495,0.904,1499,0.912,1500,1.524,1501,0.904,1502,0.912,1503,1.962,1506,0.912,1507,0.912,1508,0.904,1512,0.921,1518,1.953,1534,2.619,1539,3.72,1564,1.696,1632,2.922,1698,6.103,1704,1.75,1744,1.253,2211,3.476,2227,6.083,2228,7.854,2229,4.952,2314,7.96,2315,7.685,2316,2.552,2338,1.885,2462,1.696,2725,6.573,2727,9.11,2728,2.228,2729,4.475,2730,3.293,2731,5.227,2733,2.228,2734,4.475,2735,2.228,2736,2.228,2738,2.228,2739,2.228,2740,2.228,2742,2.228,2747,8.289,2761,5.594,2762,2.228,2763,2.228,2791,2.45,2792,4.79,2793,2.45,2794,2.45,2795,2.45,2796,2.45,2797,4.475,2798,2.45,2799,4.475,2800,2.45]],["t/803",[3,1.164,17,0.644,19,3.198,30,2.803,73,6.015,95,1,212,6.474,224,1.289,253,6.094,254,6.273,277,1.44,281,5.653,302,2.207,321,2.695,465,1.831,774,7.296,1332,6.973,1595,6.973,1788,7.296,1991,6.973,2179,6.273,2490,7.7,2491,7.7]],["t/805",[9,1.553,14,0.877,17,0.734,28,3.365,79,2.561,146,1.926,154,2.942,164,2.561,176,3.303,183,3.979,205,2.743,215,1.827,307,3.303,324,4.831,326,3.802,582,5.831,1012,6.449,1191,7.534,1665,6.334,1818,6.56,1916,7.534,1987,8.063,2025,7.386,2250,6.334,2316,5.531,2328,7.534,2395,5.662,2715,6.137,2716,7.648,2718,6.823,2720,7.138,2792,8.063,2801,8.867]],["t/807",[0,1.133,3,0.937,7,0.734,17,0.788,30,3.104,50,2.49,74,4.67,90,3.991,95,1.183,104,2.528,105,0.986,118,4.377,149,1.233,151,5.141,154,2.855,244,1.997,277,1.474,314,2.802,361,5.377,388,6.235,402,2.378,601,3.827,605,4.67,625,2.691,630,3.229,643,3.896,680,5.466,691,4.312,1014,6.747,1341,5.517,1598,6.021,1662,4.591,1672,6.785,1710,4.557,2162,6.747,2325,7.664,2802,6.484]],["t/809",[0,1.066,1,1.146,3,1.236,7,0.582,9,1.767,14,0.998,16,2.78,17,0.764,19,4.007,27,1.987,45,4.112,83,2.898,95,0.938,102,1.499,105,0.756,119,3.492,135,1.987,174,4.112,176,3.166,197,4.35,223,2.78,224,1.434,225,4.005,244,2.39,261,2.689,272,5.014,277,1.387,404,2.85,405,4.324,415,2.176,441,3.492,442,3.566,563,3.026,621,3.956,680,4.631,712,3.353,717,4.287,1169,4.112,1487,4.484,1664,5.565]],["t/811",[3,1.048,19,3.327,135,2.204,404,3.16,405,4.042,717,4.754]],["t/813",[3,0.934,11,4.501,17,0.787,30,3.427,57,3.725,94,1.095,119,4.113,130,3.38,149,0.934,183,3.769,213,5.124,224,1.194,258,7.136,317,4.395,321,2.162,322,2.192,326,4.587,388,6.213,400,4.298,561,4.654,597,3.909,600,3.044,669,6.109,729,6,809,6,847,5.124,902,5.813,1014,7.805,1030,5.813,1341,5.498,1342,3.313,1345,7.638,1376,5.648,1660,4.918,1662,5.455,1668,9.106,1730,7.638,1844,6.462,1866,5.363,1881,7.136,2162,5.648,2380,6,2385,6.761,2481,7.638,2803,8.399,2804,8.399,2805,9.106,2806,8.399]],["t/815",[7,0.782,8,6.566,9,1.354,13,3.45,20,3.51,24,7.027,27,1.807,30,2.945,45,3.739,57,3.428,59,5.938,77,3.142,80,1.354,94,1.404,146,1.679,149,0.859,159,3.789,223,2.528,224,1.354,252,2.57,257,8.089,261,2.06,289,3.277,302,1.882,304,4.152,317,4.424,321,2.656,323,2.054,371,3.69,402,1.831,406,6.801,411,4.525,443,3.468,510,2.35,513,2.215,558,5.946,600,2.801,625,3.438,683,5.059,713,3.842,875,4.359,919,7.633,1014,6.938,1104,7.027,1341,6.233,1342,3.048,1540,7.027,1614,7.027,1624,7.027,1648,8.767,1659,6.801,1662,4.21,1674,5.521,1710,4.891,1742,10.057,1858,6.221,1866,4.934,2010,5.521,2162,7.861,2326,6.801,2802,5.946,2805,7.027,2807,7.728,2808,7.728,2809,9.521,2810,8.657,2811,7.728]],["t/817",[6,3.617,7,0.716,9,1.395,13,2.886,17,0.566,28,4.13,35,6.128,80,1.907,104,2.389,109,3.96,149,1.162,183,3.574,213,4.963,215,1.641,277,1.095,296,4.758,299,3.68,302,1.94,317,3.984,321,2.496,325,8.24,337,3.617,361,4.269,421,6.128,427,5.356,438,3.617,465,1.61,510,2.394,600,2.886,614,5.214,617,7.243,625,3.338,694,4.758,755,4.269,910,4.968,919,5.892,951,5.214,1014,6.521,1341,7.518,1354,4.575,1375,5.892,1650,4.968,1674,5.69,1701,5.431,1710,4.405,1796,8.836,2162,7.628,2227,8.051,2802,6.128,2810,7.243,2812,8.046,2813,7.808,2814,7.462,2815,6.767,2816,7.243,2817,7.243]],["t/819",[0,0.92,3,1.074,7,0.804,9,1.525,14,0.861,17,0.618,20,3.954,21,4.792,28,2.546,30,2.693,41,1.533,85,3.203,92,1.937,93,2.552,94,1.509,95,1.25,102,1.699,105,0.859,117,1.262,195,2.388,203,5.311,215,1.382,230,5.161,244,1.59,264,4.792,288,3.335,289,3.692,290,3.432,302,1.633,317,2.755,318,1.679,321,1.726,323,1.448,358,4.963,361,3.595,404,2.249,439,1.967,440,1.364,444,2.159,445,2.091,446,2.027,447,3.115,465,1.759,501,1.763,549,2.256,563,3.099,596,5.4,625,3.53,634,2.975,643,2.307,646,2.941,684,4.092,687,3.432,951,4.392,1341,7.239,1398,4.792,1414,6.44,1563,3.783,1661,3.853,1674,7.899,1701,3.484,1710,4.645,1786,5.161,1796,7.436,2162,6.499,2227,4.963,2338,5.161,2717,6.1,2721,6.1,2722,6.1,2723,6.1,2802,6.698,2812,5.161,2813,5.4,2814,6.698,2815,5.699,2818,8.533,2819,8.533]],["t/821",[0,0.204,1,0.595,3,0.435,5,0.601,7,0.715,9,0.183,14,0.712,17,0.462,25,1.344,27,1.522,30,0.831,37,2.259,41,1.398,44,0.597,64,1.608,79,1.129,80,0.47,81,1.393,92,0.302,93,0.566,94,1.048,95,1.156,102,1.708,104,2.526,105,0.884,106,1.734,110,1.269,117,1.455,120,2.538,123,1.798,124,1.541,135,1.911,141,1.037,146,2.15,149,1.158,152,0.417,158,1.541,164,0.964,186,2.767,187,1.121,189,1.225,195,0.687,196,2.365,209,1.509,210,0.397,215,1.684,224,1.283,226,0.827,252,0.348,261,0.514,270,2.991,275,1.234,276,1.234,277,1.124,283,0.703,288,0.52,293,1.819,297,1.139,317,0.43,318,2.599,321,1.251,322,2.332,323,1.928,344,0.638,389,0.493,400,0.535,402,1.937,407,2.179,412,2.326,415,1.507,418,2.109,425,1.184,428,1.208,429,1.836,434,1.315,437,2.58,439,0.566,440,1.143,444,0.337,445,0.326,446,0.583,447,1.191,448,2.998,449,2.721,450,2.721,451,2.721,452,2.721,453,2.869,454,2.706,455,2.122,456,2.561,457,1.394,458,2.396,459,2.343,460,2.326,461,1.394,462,2.283,463,2.326,464,1.394,465,2.099,466,2.524,467,2.561,468,2.977,469,2.343,470,1.404,471,2.559,472,1.415,473,2.561,474,2.524,475,2.487,477,2.487,479,2.714,480,1.383,481,1.394,482,2.002,483,1.363,484,1.93,485,2.228,486,1.394,487,1.447,488,1.383,489,1.394,490,2.343,491,2.343,492,1.394,493,1.597,494,2.505,497,2.394,501,2.182,504,1.404,505,1.404,506,1.404,507,1.404,508,1.394,509,1.114,510,1.2,511,1.404,512,1.973,513,1.394,514,1.404,515,1.404,516,1.404,517,1.404,518,1.404,519,2.017,524,1.394,525,1.404,526,1.447,527,1.415,528,1.404,529,1.404,530,1.404,531,1.415,532,1.415,533,1.415,534,1.447,535,1.404,536,1.404,537,1.415,538,1.415,545,2.6,546,2.434,547,1.345,549,1.26,551,1.958,552,1.363,553,1.296,554,1.373,555,1.344,582,0.59,600,0.379,625,3.129,634,0.464,635,0.842,643,0.36,654,0.57,659,0.481,661,0.668,675,0.889,785,0.613,852,1.199,853,1.89,854,1.436,855,2.338,856,1.21,857,1.21,858,1.907,862,1.21,863,1.21,864,1.686,865,1.691,866,1.21,1014,0.703,1019,0.973,1074,0.703,1169,0.506,1341,6.236,1400,1.458,1404,1.221,1419,0.638,1492,1,1493,1,1494,1,1495,0.991,1499,1,1500,1.644,1501,0.991,1502,1,1503,1.457,1506,1,1507,1,1508,0.991,1512,1.009,1518,0.921,1527,1.232,1549,0.724,1556,1.297,1558,1.758,1561,1.297,1563,1.088,1595,0.805,1660,0.613,1661,0.601,1674,5.637,1701,2.525,1706,0.638,1710,2.834,1796,6.874,1866,0.668,1905,0.747,1908,0.774,2162,2.968,2227,3.596,2228,2.688,2229,0.842,2462,0.724,2499,0.889,2797,0.889,2799,0.889,2802,3.009,2812,5.374,2813,4.235,2814,5.199,2818,7.51,2819,4.525,2820,8.985,2821,6.112,2822,0.951,2823,1.046,2824,3.556,2825,2.281,2826,3.339,2827,5.111,2828,1.046,2829,0.951,2830,1.046,2831,3.911,2832,1.929,2833,7.193,2834,1.046,2835,2.685,2836,1.046,2837,1.046,2838,1.046,2839,1.046,2840,0.951,2841,3.036,2842,1.046,2843,0.951,2844,1.046,2845,1.046,2846,0.951,2847,1.046,2848,1.046,2849,1.046,2850,0.951,2851,1.046]],["t/823",[0,0.471,2,2.01,3,0.495,7,0.735,14,0.716,17,0.514,20,1.234,25,1.232,27,1.818,37,2.15,41,1.433,64,1.205,79,2.091,80,0.476,81,1.308,92,0.785,93,1.307,94,1.191,95,1.209,102,1.708,105,0.832,110,1.163,117,1.671,120,2.554,123,3.328,124,1.155,135,1.921,141,0.822,146,1.985,149,1.127,158,1.787,164,1.637,176,1.66,186,2.721,187,1.028,189,1.123,196,2.27,209,1.197,215,1.603,224,1.219,227,1.695,231,1.66,270,2.94,275,1.131,276,1.131,277,1.07,293,1.48,296,2.663,297,1.52,302,0.662,304,1.093,318,2.538,321,1.147,322,2.239,323,1.851,402,1.843,407,2.074,412,2.213,415,1.415,418,2.005,425,1.085,428,1.108,429,1.723,434,1.205,437,2.477,439,0.797,440,1.153,444,0.874,445,0.847,446,0.821,447,1.997,448,2.919,449,2.612,450,2.612,451,2.612,452,2.612,453,2.837,454,2.635,455,2.134,456,2.459,457,1.278,458,2.28,459,2.23,460,2.213,461,1.278,462,2.192,463,2.213,464,1.278,465,2.049,466,2.423,467,2.459,468,2.907,469,2.23,470,1.287,471,2.472,472,1.297,473,2.459,474,2.423,475,2.388,477,2.403,479,2.68,480,1.268,481,1.278,482,1.88,483,1.25,484,1.812,485,2.03,486,1.278,487,1.327,488,1.268,489,1.278,490,2.23,491,2.23,492,1.278,493,1.197,494,2.42,497,2.181,501,2.334,504,1.287,505,1.287,506,1.287,507,1.287,508,1.278,509,1.021,510,1.1,511,1.287,512,1.852,513,1.278,514,1.287,515,1.287,516,1.287,517,1.287,518,1.287,519,1.894,524,1.278,525,1.287,526,1.327,527,1.297,528,1.287,529,1.287,530,1.287,531,1.297,532,1.297,533,1.297,534,1.327,535,1.287,536,1.287,537,1.297,538,1.297,545,2.496,546,2.336,549,1.155,551,1.839,552,1.25,553,1.188,554,1.259,555,1.232,561,1.506,600,0.985,605,1.506,625,3.446,629,2.171,630,1.707,631,1.615,680,1.48,691,1.39,852,1.601,853,2.355,854,1.317,855,2.794,856,1.615,857,1.615,858,2.376,862,1.615,863,1.615,864,1.337,865,1.707,866,1.615,1116,2.09,1135,1.735,1341,4.292,1400,1.337,1404,1.63,1518,2.128,1527,3.618,1558,2.918,1674,6.127,1874,1.941,1982,2.01,2010,1.941,2812,6.833,2814,5.985,2818,7.833,2819,6.614,2820,9.263,2821,8.121,2825,3.787,2827,4.053,2852,2.717,2853,4.457,2854,4.457,2855,2.717]],["t/825",[0,0.295,1,0.843,3,0.093,6,0.382,7,0.725,9,0.389,12,0.474,13,0.305,14,0.712,17,0.499,25,1.26,27,0.88,28,1.587,31,0.675,37,2.178,41,1.423,44,0.26,45,0.407,50,0.465,64,1.691,67,0.437,79,0.955,80,0.489,81,1.33,90,0.313,92,0.243,93,0.461,94,1.297,95,1.25,96,3.434,102,1.709,104,2.974,105,0.835,106,1.153,110,1.19,116,0.401,117,0.982,120,1.167,123,1.52,124,1.621,130,0.338,135,1.842,141,1.066,146,2.162,149,1.134,150,0.307,152,0.627,158,1.289,160,0.83,164,0.641,176,1.558,183,0.377,186,2.733,187,1.052,189,1.149,195,0.299,196,2.295,205,0.26,209,1.551,210,0.319,215,1.624,224,1.233,252,0.523,270,2.954,275,1.157,276,1.157,277,1.084,284,0.437,297,0.537,299,0.319,307,1.558,318,2.554,321,1.173,322,2.263,323,1.991,325,4.908,344,1.354,402,1.868,407,2.101,412,2.243,415,1.701,418,2.027,425,1.11,428,1.133,429,1.752,434,1.233,437,2.504,439,0.651,440,1.121,442,4.004,444,0.27,445,0.262,446,0.844,447,1.835,448,2.94,449,2.641,450,2.641,451,2.641,452,2.641,453,2.845,454,2.653,455,1.928,456,2.486,457,1.307,458,2.311,459,2.259,460,2.243,461,1.307,462,2.216,463,2.243,464,1.307,465,2.068,466,2.449,467,2.486,468,2.925,469,2.259,470,1.317,471,2.495,472,1.327,473,2.486,474,2.449,475,2.414,477,2.425,479,2.588,480,1.298,481,1.307,482,1.911,483,1.279,484,1.842,485,2.219,486,1.307,487,1.357,488,1.298,489,1.307,490,2.259,491,2.259,492,1.307,493,1.679,494,2.442,497,2.384,501,1.931,504,1.317,505,1.317,506,1.317,507,1.317,508,1.307,509,1.045,510,1.36,511,1.317,512,1.883,513,1.406,514,1.317,515,1.317,516,1.317,517,1.317,518,1.317,519,1.926,524,1.307,525,1.317,526,1.357,527,1.327,528,1.317,529,1.317,530,1.317,531,1.327,532,1.327,533,1.327,534,1.357,535,1.317,536,1.317,537,1.327,538,1.327,545,2.523,546,2.358,547,1.795,549,1.182,551,1.87,552,1.279,553,1.216,554,1.288,555,1.26,563,0.299,600,0.57,602,1.385,603,0.307,625,2.516,629,1.266,630,1.266,631,1.012,634,0.985,636,0.268,643,0.961,657,3.006,661,0.537,682,0.6,691,2.14,741,0.537,747,0.373,852,0.565,853,1.003,854,1.347,855,1.353,856,0.57,857,0.57,858,1.012,862,0.57,863,0.57,864,1.733,865,0.603,866,0.57,882,0.677,951,2.465,1019,1.365,1063,2.445,1078,0.466,1135,0.537,1337,1.385,1341,6.216,1375,2.067,1388,6.54,1400,1.367,1401,1.326,1404,0.576,1405,0.537,1492,1.403,1493,1.403,1494,1.403,1495,1.39,1499,1.403,1500,2.152,1501,1.39,1502,1.403,1503,1.944,1506,1.403,1507,1.403,1508,1.39,1512,1.416,1518,0.752,1527,3.131,1643,0.582,1647,0.582,1648,1.337,1661,0.483,1674,4.468,1701,1.717,1706,0.513,1729,1.337,1739,0.6,1796,2.149,1874,0.6,1905,0.6,1908,0.622,1982,2.445,2010,0.6,2108,2.898,2113,2.69,2162,5.452,2227,3.628,2228,3.032,2229,1.267,2363,3.032,2462,0.582,2542,0.714,2797,1.337,2799,1.337,2812,5.273,2813,0.677,2814,5.407,2815,0.714,2816,4.146,2817,4.146,2818,5.207,2819,4.85,2820,6.795,2821,1.886,2822,0.764,2824,2.019,2825,0.714,2829,0.764,2840,0.764,2841,5.881,2843,0.764,2846,2.019,2850,0.764,2856,0.84,2857,8.75,2858,7.192,2859,3.766,2860,3.766,2861,3.766,2862,3.766,2863,7.192,2864,2.22,2865,2.793,2866,2.22,2867,2.22,2868,2.22,2869,2.22,2870,3.306,2871,2.22,2872,2.793,2873,0.84,2874,2.22,2875,2.22,2876,2.793,2877,2.22,2878,2.22,2879,3.766,2880,1.574,2881,1.574,2882,0.84,2883,1.574,2884,0.84,2885,0.84,2886,0.84,2887,0.84,2888,0.84,2889,0.84]],["t/827",[3,1.261,14,1.122,17,0.762,19,3.548,30,2.616,57,3.751,73,5.776,95,0.933,117,1.591,149,0.94,191,5.686,209,2.271,212,6.041,224,1.202,244,2.383,247,5.275,253,6.761,254,6.959,262,7.185,277,1.163,281,5.275,302,2.059,317,3.474,326,3.626,330,7.69,388,7.438,405,4.311,406,6.041,465,1.709,597,3.936,715,4.205,774,6.808,1014,7.466,1150,5.853,1332,6.507,1662,5.478,1672,8.094,1788,6.808,1991,6.507,2179,5.853,2490,7.185,2491,7.185,2890,8.457,2891,8.457]],["t/829",[0,1.096,1,1.398,7,0.611,13,3.231,14,0.882,17,0.736,30,2.758,44,2.758,79,2.996,164,2.996,176,3.32,183,4.654,205,2.758,277,1.426,300,4.496,307,3.863,415,2.238,443,4.001,582,5.028,1014,6.974,1078,4.94,1341,5.836,1550,5.836,1729,7.575,2162,5.995,2542,7.575]],["t/831",[0,1.204,3,1.052,7,0.78,9,1.8,17,0.798,19,2.702,29,2.614,30,2.368,31,3.282,32,3.929,44,2.368,50,2.261,74,4.242,90,3.998,94,0.998,95,1.185,96,3.533,105,1.023,118,3.976,149,1.266,151,4.671,154,2.694,197,4.844,244,1.814,277,1.413,310,4.103,311,3.806,312,4.579,313,5.664,314,2.546,361,5.912,402,2.435,419,4.104,442,4.311,510,2.337,601,4.299,605,4.242,616,2.655,624,4.242,630,2.933,631,2.774,643,3.988,658,4.483,665,4.775,680,5.157,691,5.258,766,5.469,1342,3.02,1343,6.044,1376,5.148,1413,6.505,1598,5.469,1662,4.171]],["t/833",[0,1.186,1,1.095,3,1.218,7,0.556,9,1.848,10,4.219,14,0.804,16,2.657,17,0.778,19,3.958,27,1.899,28,3.724,29,1.925,32,3.372,45,3.93,50,2.399,95,0.896,102,1.527,105,0.974,119,3.336,135,1.899,149,0.903,174,3.93,176,3.025,197,4.156,205,2.512,223,2.657,224,1.5,225,4.08,226,3.482,244,2.499,261,2.165,272,4.88,277,1.451,285,4.156,313,6.009,361,4.353,404,2.723,405,4.208,415,2.118,441,3.336,442,3.408,510,2.005,621,3.78,643,3.375,680,4.425,712,3.204,717,4.096,809,5.802,1169,3.93,1349,4.756,1376,5.462,1487,4.284,1664,5.317]],["t/835",[3,1.048,19,3.327,135,2.204,404,3.16,405,4.042,717,4.754]],["t/837",[3,0.991,17,0.802,30,3.208,32,3.701,119,4.26,130,3.588,141,1.645,149,0.991,183,4.001,194,5.439,213,5.307,258,7.575,302,2.171,310,5.878,311,5.157,312,4.313,322,2.327,597,4.149,1030,6.171,1660,5.22,1662,5.65,1844,6.86,1864,7.575,1866,5.693,2380,6.369,2892,8.107]],["t/839",[7,0.751,17,0.633,29,2.758,30,3.493,32,4.688,44,2.758,90,3.32,96,3.066,310,4.778,312,5.018,314,2.964,319,3.04,443,4.001,465,1.802,564,5.121,624,4.94,1343,5.693,1376,5.995,1662,4.857,2380,6.369,2383,7.575,2892,8.107]],["t/841",[7,0.595,29,2.571,32,3.603,80,1.521,279,4.377,312,4.199,414,5.865,510,2.143,564,4.986,624,6.473,625,3.26,662,3.931,678,6.008,809,6.201,1343,6.52,1376,5.837,1486,8.733,1716,8.988,1717,7.553,1744,5.225,2104,9.015,2395,5.542,2495,8.22,2497,6.988]],["t/844",[0,0.112,1,0.367,2,0.787,3,0.496,5,0.611,7,0.725,9,0.186,13,0.71,14,0.717,17,0.484,25,1.358,27,1.695,29,1.718,30,1.047,37,2.273,41,1.443,44,0.606,64,1.535,79,1.144,80,0.477,81,1.404,92,0.566,93,0.992,94,1.182,95,1.139,96,2.492,102,1.709,104,2.111,105,0.85,108,3.311,110,1.283,117,1.547,120,2.854,123,1.82,124,1.471,135,1.923,141,0.907,142,0.611,146,2.115,147,0.522,149,1.161,151,0.649,152,0.424,158,1.621,159,0.522,164,1.144,176,0.73,186,2.773,187,1.134,189,1.239,195,0.698,196,2.377,209,1.32,210,1.034,215,1.695,224,1.301,226,1.168,250,0.649,252,0.354,261,0.522,270,2.997,275,1.248,276,1.248,277,1.131,288,0.529,297,1.523,310,1.05,311,0.974,314,0.354,317,0.437,318,2.607,321,1.265,322,2.344,323,1.938,389,0.501,402,1.949,407,2.193,412,2.34,415,1.519,418,2.099,425,1.197,428,1.222,429,1.85,434,1.329,437,2.594,439,0.799,440,1.221,442,3.504,443,3.946,444,0.631,445,0.611,446,0.823,447,1.729,448,3.008,449,2.735,450,2.735,451,2.735,452,2.735,453,2.873,454,2.715,455,2.179,456,2.574,457,1.409,458,2.411,459,2.358,460,2.34,461,1.409,462,2.295,463,2.34,464,1.409,465,2.105,466,2.537,467,2.574,468,2.986,469,2.358,470,1.42,471,2.57,472,1.43,473,2.574,474,2.537,475,2.5,477,2.498,479,2.747,480,1.399,481,1.409,482,2.018,483,1.378,484,1.945,485,2.211,486,1.409,487,1.463,488,1.399,489,1.409,490,2.358,491,2.358,492,1.409,493,1.524,494,2.516,497,2.376,501,2.257,504,1.42,505,1.42,506,1.42,507,1.42,508,1.409,509,1.126,510,1.213,511,1.42,512,1.989,513,1.409,514,1.42,515,1.42,516,1.42,517,1.42,518,1.42,519,2.033,524,1.409,525,1.42,526,1.463,527,1.43,528,1.42,529,1.42,530,1.42,531,1.43,532,1.43,533,1.43,534,1.463,535,1.42,536,1.42,537,1.43,538,1.43,545,2.613,546,2.445,547,0.674,549,1.274,551,1.974,552,1.378,553,1.311,554,1.389,555,1.358,600,0.987,615,0.904,629,1.043,630,1.296,631,0.987,634,0.869,635,0.856,636,0.626,643,0.366,654,0.58,659,1.252,661,0.679,662,0.71,680,0.58,747,0.472,852,1.422,853,2.156,854,1.452,855,2.603,856,1.435,857,1.435,858,2.175,859,1.644,862,1.435,863,1.435,864,1.474,865,2.037,866,1.435,1019,0.71,1029,0.529,1074,0.715,1169,0.515,1343,5.251,1400,1.474,1404,1.448,1419,0.649,1492,0.73,1493,0.73,1494,0.73,1495,0.723,1496,0.529,1499,0.73,1500,1.26,1501,0.723,1502,0.73,1503,0.73,1506,0.73,1507,0.73,1508,0.723,1512,0.737,1518,0.935,1549,1.356,1563,1.105,1595,0.818,1611,0.787,1660,1.147,1661,0.611,1664,0.696,1717,7.705,1744,1.003,1750,3.625,1753,0.736,1756,1.251,1761,0.736,1818,0.787,1866,0.679,2077,0.736,2079,1.885,2082,0.736,2113,1.4,2144,0.818,2499,1.665,2893,7.794,2894,0.967,2895,1.577,2896,1.782,2897,3.957,2898,1.064,2899,0.967,2900,1.577,2901,0.967,2902,0.967,2903,1.782,2904,1.959]],["t/846",[0,0.251,1,0.906,3,0.572,7,0.755,13,3.246,14,0.665,17,0.576,19,0.837,25,1.101,27,1.571,29,1.22,30,0.734,37,2.011,41,1.402,44,0.734,64,1.392,67,1.233,73,1.363,79,0.685,80,0.416,81,1.203,92,0.685,93,1.168,94,1.309,95,1.209,96,3.487,102,1.709,104,2.614,105,0.902,108,1.917,110,1.04,117,1.134,120,2.371,124,1.334,133,1.029,135,1.701,141,1.24,146,2.13,149,1.09,158,1.271,159,1.164,164,0.685,176,0.884,186,2.657,187,0.919,188,1.233,189,1.004,194,1.448,195,0.845,196,2.148,205,1.592,209,1.804,210,0.901,215,1.499,224,1.2,252,0.789,261,0.633,270,2.871,275,1.011,276,1.011,277,1.001,297,0.809,301,1.643,310,1.272,311,1.18,312,1.148,318,2.455,321,1.025,322,2.118,323,1.751,402,1.724,407,1.94,412,2.07,415,1.301,418,1.897,425,0.97,428,0.99,429,1.585,431,1.338,434,1.077,437,2.343,439,0.696,440,1.047,442,2.819,443,3.016,444,0.764,445,0.74,446,1.204,447,2.047,448,2.813,449,2.471,450,2.471,451,2.471,452,2.471,453,2.792,454,2.539,455,1.844,456,2.326,457,1.142,458,2.133,459,2.086,460,2.07,461,1.142,462,2.073,463,2.07,464,1.142,465,1.982,466,2.292,467,2.326,468,2.812,469,2.086,470,1.151,471,2.357,472,1.159,473,2.326,474,2.292,475,2.259,477,2.291,479,2.474,480,1.134,481,1.142,482,1.729,483,1.117,484,1.666,485,2.018,486,1.142,487,1.186,488,1.134,489,1.142,490,2.086,491,2.086,492,1.142,493,1.382,494,2.307,497,2.168,501,1.912,504,1.151,505,1.151,506,1.151,507,1.151,508,1.142,509,0.913,510,0.983,511,1.151,512,1.703,513,1.142,514,1.151,515,1.151,516,1.151,517,1.151,518,1.151,519,1.741,524,1.142,525,1.151,526,1.186,527,1.159,528,1.151,529,1.151,530,1.151,531,1.159,532,1.159,533,1.159,534,1.186,535,1.151,536,1.151,537,1.159,538,1.159,545,2.361,546,2.227,547,2.073,549,1.032,551,1.691,552,1.117,553,1.062,554,1.125,555,1.101,563,0.845,624,5.763,625,3.509,627,4.639,629,1.972,630,1.972,631,1.866,634,1.053,642,1.554,654,1.293,659,2.367,662,2.435,665,1.48,695,1.643,748,1.756,852,0.852,853,1.431,854,1.177,855,1.849,856,0.86,857,0.86,858,1.444,859,0.985,862,0.86,863,0.86,864,2.015,865,1.526,866,0.86,875,1.338,1019,0.86,1029,1.18,1342,0.936,1343,4.645,1354,1.363,1400,1.195,1401,2.38,1404,0.868,1492,0.884,1493,0.884,1494,0.884,1495,0.876,1496,1.18,1499,0.884,1500,1.484,1501,0.876,1502,0.884,1503,2.246,1506,0.884,1507,0.884,1508,0.876,1512,0.892,1549,1.643,1556,3.462,1558,3.37,1561,3.462,1643,1.643,1647,1.643,1661,2.288,1704,1.695,1716,6.706,1717,7.635,1744,3.438,1750,3.287,1753,1.643,1756,1.515,1761,1.643,2348,6.027,2371,1.756,2372,2.947,2374,1.756,2395,4.291,2893,7.787,2895,1.91,2897,3.207,2900,1.91,2905,2.373,2906,7.672,2907,4.681,2908,5.148,2909,2.158,2910,5.148,2911,2.158,2912,2.373,2913,5.148,2914,2.158,2915,2.373,2916,2.373]],["t/848",[0,0.706,1,0.901,7,0.759,11,1.083,12,1.14,14,0.605,17,0.508,25,0.96,27,1.069,28,0.767,29,2.338,30,1.414,31,4.618,32,1.898,37,1.846,41,1.478,44,0.625,50,0.597,64,1.237,79,0.584,80,0.801,81,1.083,90,0.753,92,1.004,93,1.592,94,1.424,95,1.255,96,3.788,102,1.712,104,2.265,105,0.877,110,0.907,117,1.151,124,1.185,130,0.813,135,1.562,141,0.844,146,1.93,149,1.043,152,0.805,155,1.29,158,1.129,160,1.066,164,0.584,176,0.753,186,2.574,187,0.802,189,0.876,194,1.233,195,1.237,196,1.999,203,1.233,205,0.625,209,1.228,215,1.377,224,1.202,225,0.753,226,0.867,231,2.022,252,1.52,260,1.444,270,2.782,275,0.882,276,0.882,277,0.984,279,5.186,297,0.689,299,1.319,307,1.703,318,2.349,321,0.894,322,1.971,323,1.824,389,1.638,402,1.583,407,1.781,412,1.901,415,1.32,418,1.765,425,0.846,428,0.864,429,1.427,434,0.94,437,2.181,439,1.34,440,1.244,442,3.642,443,3.896,444,1.118,445,1.425,446,1.641,447,2.644,448,2.679,449,2.3,450,2.3,451,2.3,452,2.3,453,2.734,454,2.418,455,1.678,456,2.165,457,0.996,458,1.959,459,1.915,460,1.901,461,0.996,462,1.93,463,1.901,464,0.996,465,1.897,466,2.133,467,2.165,468,2.691,469,1.915,470,1.004,471,2.215,472,1.011,473,2.165,474,2.133,475,2.102,477,2.153,479,2.314,480,0.989,481,0.996,482,1.556,483,0.975,484,1.5,485,1.867,486,0.996,487,1.034,488,0.989,489,0.996,490,1.915,491,1.915,492,0.996,493,1.228,494,2.168,497,2.005,501,1.756,504,1.004,505,1.004,506,1.004,507,1.004,508,0.996,509,0.796,510,0.858,511,1.004,512,1.534,513,0.996,514,1.004,515,1.004,516,1.004,517,1.004,518,1.004,519,1.568,524,0.996,525,1.004,526,1.034,527,1.011,528,1.004,529,1.004,530,1.004,531,1.011,532,1.011,533,1.011,534,1.034,535,1.004,536,1.004,537,1.011,538,1.011,545,2.197,546,2.093,547,1.195,549,0.901,551,1.522,552,0.975,553,0.927,554,0.982,555,0.96,560,1.12,562,1.261,563,0.719,601,0.918,605,1.12,616,0.701,624,4.811,625,2.772,627,6.074,629,3.326,630,2.893,631,2.861,632,3.332,633,3.226,634,1.542,638,0.876,643,0.695,659,0.929,673,1.233,729,1.444,767,1.444,771,1.627,852,0.726,853,1.248,854,1.027,855,1.642,856,0.732,857,0.732,858,1.26,862,0.732,863,0.732,864,1.371,866,0.732,875,1.14,939,1.838,1019,0.732,1111,1.12,1343,5.993,1351,1.627,1400,1.042,1401,2.076,1404,0.739,1405,1.29,1492,0.753,1493,0.753,1494,0.753,1495,0.746,1499,0.753,1500,1.294,1501,0.746,1502,0.753,1503,1.294,1506,0.753,1507,0.753,1508,0.746,1512,0.76,1643,1.399,1647,1.399,1659,1.444,1660,1.183,1661,1.996,1667,1.29,1717,7.435,1870,1.717,1879,4.924,1946,1.717,1966,1.627,1969,1.555,1973,1.627,2155,1.627,2470,2.953,2495,4.924,2530,7.449,2532,1.838,2534,3.16,2537,1.838,2540,1.838,2554,1.838,2555,1.838,2557,1.838,2893,8.703,2895,3.681,2897,3.681,2900,2.798,2917,3.475,2918,2.021,2919,2.021,2920,2.021,2921,2.021,2922,2.021,2923,2.021,2924,2.021]],["t/850",[0,0.12,1,0.48,3,0.126,7,0.725,9,0.365,14,0.672,17,0.442,25,1.292,27,1.83,28,1.947,29,1.216,30,0.644,31,2.795,32,0.471,37,2.209,41,1.396,64,1.387,79,1.2,80,0.199,81,1.354,85,0.542,92,0.328,93,0.61,94,1.214,95,1.162,96,2.632,102,1.709,104,1.867,105,0.853,108,2.197,110,1.22,117,1.559,120,2.197,123,3.431,124,1.33,135,1.869,141,1.021,146,2.098,147,1.02,149,1.142,158,1.61,164,1.2,176,0.423,186,2.746,187,1.078,189,1.178,194,0.693,196,2.322,205,0.351,209,1.486,215,1.647,224,1.276,242,0.914,261,0.303,270,2.968,275,1.186,276,1.186,277,1.099,297,1.417,310,0.609,311,0.565,312,1.393,318,2.572,321,1.203,322,2.29,323,1.893,402,1.894,407,2.131,412,2.275,415,1.465,418,2.051,425,1.138,428,1.162,429,1.784,434,1.264,437,2.534,438,0.516,439,0.333,440,1.044,442,3.417,443,3.887,444,0.366,445,0.354,446,0.629,447,1.423,448,2.963,449,2.672,450,2.672,451,2.672,452,2.672,453,2.855,454,2.674,455,2.148,456,2.515,457,1.34,458,2.344,459,2.292,460,2.275,461,1.34,462,2.242,463,2.275,464,1.34,465,2.076,466,2.478,467,2.515,468,2.945,469,2.292,470,1.35,471,2.52,472,1.36,473,2.515,474,2.478,475,2.442,477,2.449,479,2.708,480,1.33,481,1.34,482,1.946,483,1.311,484,1.876,485,2.126,486,1.34,487,1.391,488,1.33,489,1.34,490,2.292,491,2.292,492,1.34,493,1.378,494,2.466,497,2.284,501,2.246,504,1.35,505,1.35,506,1.35,507,1.35,508,1.34,509,1.071,510,2.75,511,1.35,512,1.918,513,1.34,514,1.35,515,1.35,516,1.35,517,1.35,518,1.35,519,1.961,524,1.34,525,1.35,526,1.391,527,1.36,528,1.35,529,1.35,530,1.35,531,1.36,532,1.36,533,1.36,534,1.391,535,1.35,536,1.35,537,1.36,538,1.36,545,2.553,546,2.381,547,0.99,549,1.211,551,1.904,552,1.311,553,1.246,554,1.32,555,1.292,601,0.516,624,3.269,625,2.383,627,2.742,629,1.965,630,1.365,631,1.291,632,1.941,633,1.88,658,0.665,662,2.006,665,2.915,678,7.579,747,0.504,852,1.493,853,2.236,854,1.381,855,2.681,856,1.506,857,1.506,858,2.256,859,0.864,862,1.506,863,1.506,864,1.66,865,1.365,866,1.506,1019,0.412,1029,0.565,1343,5.601,1376,0.764,1400,1.402,1401,1.243,1404,1.52,1492,0.423,1493,0.423,1494,0.423,1495,0.419,1496,0.565,1499,0.423,1500,0.775,1501,0.419,1502,0.423,1503,1.073,1506,0.423,1507,0.423,1508,0.419,1512,0.427,1518,2.231,1641,0.786,1642,0.874,1643,0.786,1644,0.965,1646,0.965,1647,0.786,1683,0.874,1744,0.581,1750,4.334,1756,1.329,1779,0.965,2077,0.786,2079,1.44,2082,0.786,2104,0.914,2113,1.487,2497,0.914,2544,6.173,2547,1.892,2893,8.432,2894,1.033,2895,2.318,2896,1.892,2897,4.456,2899,1.033,2900,2.318,2901,1.033,2902,1.033,2903,1.033,2906,3.779,2907,2.619,2909,1.033,2911,1.033,2914,1.033,2925,1.136,2926,2.88,2927,1.136,2928,1.136,2929,1.136,2930,1.136,2931,1.136,2932,1.136,2933,1.136]],["t/852",[7,0.635,9,1.624,30,2.867,80,1.624,105,0.824,116,4.425,144,4.313,252,3.081,277,1.459,560,5.135,561,5.135,817,6.47,1524,6.067]]],"invertedIndex":[["",{"_index":102,"t":{"3":{"position":[[1685,1],[1700,1],[1713,1],[1730,1],[1857,1],[1886,1],[1888,1],[1901,1],[1940,1],[1945,1],[2083,1],[2131,1],[2162,1],[2210,1],[2241,1],[2283,1],[2544,1],[2576,1],[2949,1]]},"9":{"position":[[299,1],[676,1],[685,2],[696,1],[1047,1],[1073,1],[1100,1],[1117,1]]},"37":{"position":[[196,1],[243,1],[245,1],[262,2],[265,1],[300,1],[312,1],[322,2],[325,2],[338,1],[348,2],[351,2],[363,1],[373,2],[376,1],[378,2],[393,1],[408,1],[420,1],[453,1],[455,1],[472,1],[474,1],[476,2],[489,1],[522,1],[524,1],[541,1],[543,1],[545,2],[557,1],[590,1],[592,1],[609,1],[611,1],[613,1],[615,1],[617,1],[619,1],[621,1],[623,1],[760,2],[832,2],[856,1],[872,1],[874,1],[901,2],[1001,1],[1062,2],[1146,2],[1326,2],[1369,3],[1379,1],[1408,1],[1410,1],[1499,1],[1501,1],[1518,2],[1521,1],[1556,1],[1568,1],[1578,2],[1581,2],[1594,1],[1604,2],[1607,2],[1619,1],[1629,2],[1632,1],[1634,2],[1649,1],[1664,1],[1676,1],[1709,1],[1711,1],[1728,1],[1730,1],[1732,2],[1745,1],[1778,1],[1780,1],[1797,1],[1799,1],[1801,2],[1813,1],[1846,1],[1848,1],[1865,1],[1867,1],[1869,1],[1871,1],[1873,1],[1875,1],[1877,1],[1879,3],[1883,2],[1889,1],[1940,2],[2019,1],[2021,1],[2063,1],[2077,1],[2079,2],[2178,2],[2252,2],[2337,2],[2470,2],[2644,2],[2687,2],[2697,2],[2704,1],[2706,2],[2709,2],[2725,1],[2727,1],[2770,1],[3238,2],[3314,2],[3321,1],[3343,2],[3346,2],[3369,1],[3391,2],[3492,2],[3499,1],[3501,2],[3504,2],[3520,1],[3522,2],[3551,1],[3602,2],[3674,2],[3793,1],[3848,1],[3882,1],[3884,2],[3986,1],[4014,1],[4026,1],[4082,2],[4139,1],[4193,2],[4298,1],[4352,2],[4479,1],[4533,2],[4576,2],[4593,1],[4629,1],[4631,1],[4647,1],[5078,1],[5182,1],[5231,2],[5264,1],[5315,1],[5486,1],[5532,1],[5568,1],[5625,1],[5659,1],[5764,1],[5797,1],[5925,1],[5959,1],[6001,1],[6003,1],[6127,1],[6199,1],[6348,1],[6778,1],[6850,1],[6884,1],[7747,1],[7791,1],[7793,1],[7884,1]]},"43":{"position":[[38,1],[54,1],[56,1],[83,2],[96,1],[112,1],[149,1],[210,2],[277,2],[382,3],[392,1],[406,1],[408,1],[462,3],[473,1],[511,1],[553,1],[567,1],[584,2],[662,2],[757,2],[890,2],[1068,2],[1111,2],[1121,2],[1128,1],[1130,2],[1133,2],[1149,1],[1161,2],[1274,2],[1281,1],[1283,2],[1286,2],[1302,1],[1304,1],[1407,1],[1467,1],[1494,1],[1514,1],[1542,1],[1554,1],[1610,2],[1677,1],[1731,2],[1836,1],[1890,2],[2021,1],[2075,2],[2118,2],[2135,1],[2181,1],[2247,1],[2262,1],[2269,1],[2288,3],[2292,1],[2294,1],[2455,1],[2491,1],[2536,1],[2570,1],[2632,1],[2659,1],[2679,1],[2690,1],[2759,1],[2781,1],[2808,1],[2822,1],[2837,1],[2987,1],[3033,1],[3107,1],[3172,1],[3219,1],[3257,1]]},"47":{"position":[[808,1],[855,1],[857,1],[874,2],[877,1],[910,1],[922,1],[932,2],[935,1],[937,2],[952,1],[967,1],[979,1],[1012,1],[1014,1],[1031,1],[1033,1],[1035,1],[1037,1],[1039,1],[1041,2],[1044,1],[1077,1],[1092,1],[1113,1],[1125,3],[1150,1],[1152,2],[1164,1],[1175,1],[1186,1],[1188,1],[1198,2],[1201,2],[1204,1],[1224,1],[1238,1],[1250,3],[1282,2],[1304,1],[1316,3],[1340,1],[1342,1],[1344,1],[1346,1],[1348,1],[1350,2],[1370,1],[1380,2],[1383,2],[1396,1],[1407,1],[1418,1],[1420,1],[1430,2],[1433,2],[1436,1],[1457,1],[1469,3],[1494,1],[1496,2],[1499,1],[1519,1],[1533,1],[1545,3],[1577,2],[1599,1],[1611,3],[1636,1],[1638,1],[1640,1],[1642,1],[1644,1],[1646,2],[1659,1],[1670,1],[1681,1],[1683,1],[1693,2],[1696,2],[1699,1],[1720,1],[1732,3],[1756,1],[1758,2],[1761,1],[1781,1],[1795,1],[1807,3],[1839,2],[1861,1],[1873,3],[1898,1],[1900,1],[1902,1],[1904,1],[1906,1],[1908,1],[1910,2],[1925,1],[1940,1],[1951,1],[1984,1],[1986,1],[2003,2],[2006,1],[2047,1],[2049,1],[2051,2],[2071,1],[2104,1],[2106,1],[2125,1],[2127,1],[2129,2],[2142,1],[2175,1],[2177,1],[2194,2],[2197,1],[2238,1],[2240,1],[2242,2],[2255,1],[2288,1],[2290,1],[2307,2],[2310,1],[2351,1],[2353,1],[2355,1],[2357,1],[2359,1],[2361,2],[2364,1],[2399,1],[2414,1],[2435,1],[2447,3],[2472,1],[2474,2],[2486,1],[2497,1],[2508,1],[2510,1],[2520,2],[2523,2],[2526,1],[2546,1],[2560,1],[2572,3],[2604,2],[2626,1],[2638,3],[2662,1],[2664,1],[2666,1],[2668,1],[2670,1],[2672,2],[2692,1],[2702,2],[2705,2],[2718,1],[2729,1],[2740,1],[2742,1],[2752,2],[2755,2],[2758,1],[2779,1],[2791,3],[2816,1],[2818,2],[2821,1],[2841,1],[2855,1],[2867,3],[2899,2],[2921,1],[2933,3],[2958,1],[2960,1],[2962,1],[2964,1],[2966,1],[2968,2],[2981,1],[2992,1],[3003,1],[3005,1],[3015,2],[3018,2],[3021,1],[3042,1],[3054,3],[3078,1],[3080,2],[3083,1],[3103,1],[3117,1],[3129,3],[3161,2],[3183,1],[3195,3],[3220,1],[3222,1],[3224,1],[3226,1],[3228,1],[3230,1],[3232,2],[3247,1],[3262,1],[3273,1],[3306,1],[3308,1],[3325,2],[3328,1],[3369,1],[3371,1],[3373,2],[3393,1],[3426,1],[3428,1],[3447,1],[3449,1],[3451,2],[3464,1],[3497,1],[3499,1],[3516,2],[3519,1],[3560,1],[3562,1],[3564,2],[3577,1],[3610,1],[3612,1],[3629,2],[3632,1],[3673,1],[3675,1],[3677,1],[3679,1],[3681,1],[3683,1],[3685,1],[3687,1]]},"49":{"position":[[20,5],[942,4],[1140,1],[1171,1],[1183,1],[1193,2],[1196,1],[1198,2],[1213,1],[1228,1],[1240,1],[1273,1],[1275,1],[1292,2],[1295,1],[1314,2],[1317,1],[1356,1],[1358,1],[1360,1],[1362,1],[1364,1],[1366,1],[1951,1],[1953,2],[2013,1],[2084,2],[2087,1],[2089,1],[2091,2],[2103,5],[2161,1],[2229,2],[2232,1],[2234,1],[2236,2],[2299,1],[2380,2],[2383,2],[2423,1],[2494,2],[2497,1]]},"51":{"position":[[226,1],[261,1],[273,1],[283,2],[286,2],[299,1],[310,1],[321,1],[323,1],[333,2],[336,2],[339,1],[360,1],[383,1],[385,1],[387,1],[389,1],[391,2],[408,1],[429,1],[452,1],[454,1],[456,2],[471,1],[486,1],[498,1],[531,1],[533,1],[550,1],[552,1],[554,2],[567,1],[600,1],[602,1],[619,1],[621,1],[623,1],[625,1],[627,1],[629,1],[1489,1],[1491,2],[1540,1],[1619,2],[1622,1],[1665,1],[1667,2],[1715,1],[1794,2],[1797,1],[1961,1],[1963,2],[2013,1],[2092,2],[2095,1]]},"53":{"position":[[486,1],[533,1],[535,1],[552,2],[555,1],[588,1],[600,1],[610,2],[613,1],[615,2],[630,1],[645,1],[657,1],[690,1],[692,1],[709,2],[712,1],[753,1],[755,1],[757,1],[759,1],[761,1],[763,2],[766,1],[801,1],[820,1],[830,2],[833,2],[846,1],[857,1],[868,1],[870,1],[880,2],[883,2],[886,1],[906,1],[920,1],[932,3],[964,2],[986,1],[998,3],[1023,1],[1025,1],[1027,1],[1029,1],[1031,1],[1033,1],[1035,2],[1050,1],[1065,1],[1084,1],[1117,1],[1119,1],[1138,1],[1140,1],[1142,2],[1155,1],[1188,1],[1190,1],[1207,1],[1209,1],[1211,1],[1213,1],[1215,1],[1217,1],[1219,1],[1221,1],[1513,1],[1535,1],[1537,1],[1572,1],[1584,1],[1595,1],[1606,1],[1608,1],[1618,2],[1621,2],[1624,1],[1644,1],[1658,1],[1670,3],[1702,2],[1724,1],[1736,3],[1761,1],[1763,1],[1765,1],[1767,1],[1769,1],[1771,1],[1773,2],[1788,1],[1803,1],[1815,1],[1848,1],[1850,1],[1867,1],[1869,1],[1871,1],[1873,1],[1875,1],[1877,1],[1879,1],[1881,1],[2089,1],[2091,2],[2159,1],[2251,2],[2254,2],[2297,1],[2371,2],[2374,1],[2443,1],[2445,2],[2493,1],[2572,2],[2575,1]]},"55":{"position":[[225,1],[247,1],[249,1],[284,1],[296,1],[307,1],[318,1],[320,1],[330,2],[333,2],[336,1],[357,1],[380,1],[382,1],[384,1],[386,1],[388,1],[390,2],[405,1],[420,1],[432,1],[465,1],[467,1],[484,1],[486,1],[488,1],[490,1],[492,1],[494,1],[496,1],[498,1],[713,1],[715,1],[794,2],[797,1],[840,1],[842,1],[921,2],[924,1]]},"57":{"position":[[253,1],[275,1],[277,1],[312,1],[324,1],[342,1],[353,1],[355,1],[376,1],[408,1],[410,2],[413,1],[434,1],[457,1],[459,1],[461,1],[463,1],[465,1],[467,2],[482,1],[497,1],[509,1],[542,1],[544,1],[561,1],[563,1],[565,1],[567,1],[569,1],[571,1],[573,1],[575,1],[753,1],[755,1],[834,2],[837,1],[895,1],[897,1],[985,2],[988,1]]},"59":{"position":[[316,1],[338,1],[340,1],[375,1],[387,1],[403,1],[413,1],[423,2],[426,2],[441,1],[462,1],[486,1],[488,1],[490,1],[492,1],[494,2],[509,1],[524,1],[536,1],[569,1],[571,1],[588,1],[590,1],[592,1],[594,1],[596,1],[598,1],[600,1],[602,1],[765,1],[767,1],[846,2],[849,1],[954,1],[956,1],[1036,2],[1039,1]]},"61":{"position":[[424,1],[440,1],[451,1],[484,1],[492,1],[500,1],[508,2],[511,1],[519,1],[538,1],[558,1],[560,1],[562,3],[575,1],[608,1],[616,1],[624,1],[632,2],[635,1],[643,1],[662,1],[683,1],[685,1],[693,1],[712,1],[723,1],[744,1],[763,1],[795,1],[830,3],[834,3],[1059,1],[1106,1],[1108,1],[1138,1],[1149,1],[1159,2],[1162,2],[1175,1],[1186,1],[1197,1],[1199,1],[1209,2],[1212,2],[1215,1],[1236,1],[1258,1],[1260,1],[1262,1],[1264,1],[1266,2],[1279,1],[1290,1],[1301,1],[1303,1],[1313,2],[1316,2],[1319,1],[1340,1],[1363,1],[1365,2],[1368,1],[1388,1],[1402,1],[1425,2],[1447,1],[1470,1],[1472,1],[1474,1],[1476,1],[1478,1],[1480,1],[1482,2],[1497,1],[1512,1],[1523,1],[1556,1],[1558,1],[1575,1],[1577,1],[1579,2],[1592,1],[1625,1],[1627,1],[1644,1],[1646,1],[1648,2],[1661,1],[1694,1],[1696,1],[1713,1],[1715,1],[1717,1],[1719,1],[1721,1],[1723,1],[1725,1],[1727,1],[1894,1],[1941,1],[1943,1],[1973,1],[1985,1],[1996,1],[2007,1],[2009,1],[2019,2],[2022,2],[2025,1],[2046,1],[2069,1],[2071,2],[2074,1],[2094,1],[2108,1],[2131,2],[2153,1],[2176,1],[2178,1],[2180,1],[2182,1],[2184,1],[2186,1],[2188,2],[2203,1],[2218,1],[2230,1],[2263,1],[2265,1],[2282,1],[2284,1],[2286,1],[2288,1],[2290,1],[2292,1],[2294,1],[2296,1]]},"73":{"position":[[999,1],[1029,1]]},"77":{"position":[[363,1],[401,1],[415,1],[436,2],[527,2],[596,2],[701,2],[711,2],[718,1],[720,2],[723,2],[739,1],[741,1]]},"89":{"position":[[93,1]]},"97":{"position":[[105,2],[129,1],[145,1],[147,1],[174,2],[274,1],[335,2],[419,2],[599,2],[642,3],[653,1],[655,1],[697,1],[711,1],[713,2],[812,2],[886,2],[971,2],[1104,2],[1278,2],[1321,2],[1331,2],[1338,1],[1340,2],[1343,2],[1359,1],[1361,1],[1363,2],[1482,1],[1537,1],[1571,1],[1573,2],[1675,1],[1703,1],[1715,1],[1771,2],[1828,1],[1882,2],[1987,1],[2041,2],[2168,1],[2222,2],[2265,2],[2282,1],[2318,1],[2320,1],[2422,1],[2468,1],[2504,1],[2561,1],[2595,1],[2700,1],[2733,1],[2861,1],[2895,1],[2937,1],[2939,1],[3063,1]]},"99":{"position":[[111,2],[132,1],[142,1],[144,1],[231,2],[234,1],[291,3],[295,2],[306,1],[321,2],[416,1],[423,2],[507,1],[519,2],[598,2],[606,1],[608,1],[624,1],[638,1],[663,1],[686,1],[719,2],[731,1],[756,1],[763,1],[787,1],[806,1],[822,2],[838,1],[878,2],[898,1],[913,1],[915,1],[973,1],[980,1],[1060,1],[1071,1],[1111,1],[1130,1],[1245,1],[1330,1],[1374,1],[1376,1],[1467,1],[1608,1]]},"109":{"position":[[549,2],[607,1],[643,3],[647,2],[722,2],[725,1],[734,1],[766,2],[769,3],[773,2],[803,1],[811,2],[814,2],[817,1],[823,1],[853,1],[867,1],[910,1],[912,2],[1447,1],[1453,2],[1521,1],[1553,1],[1597,1]]},"111":{"position":[[255,1],[299,1],[335,1],[378,1],[388,1],[546,2],[555,1],[576,2],[579,3],[648,1],[654,1],[683,1],[697,1],[716,1],[718,3],[722,3],[865,1],[898,1],[932,1],[973,2],[1008,1],[1010,2],[1053,1],[1085,2],[1088,2],[1091,2],[1094,2],[1169,1],[1205,3],[1231,1],[1280,1],[1371,2],[1402,1],[1410,2],[1413,2],[1416,1],[1422,1],[1452,1],[1466,1],[1509,1],[1511,1],[1606,1],[1738,1],[1744,1],[1746,2],[1779,2],[1858,2],[1944,1],[1958,1],[1964,2],[1979,2],[2054,2],[2099,1],[2135,2],[2142,1],[2183,1],[2185,2],[2296,3],[2353,1],[2385,1],[2392,2],[2432,2],[2468,2],[2520,1],[2522,1],[2529,1],[2531,1],[2555,1]]},"113":{"position":[[226,1],[270,1],[306,1],[373,1],[379,1],[405,1],[436,1],[485,1],[545,1],[563,1],[580,1],[621,1],[635,1],[654,1],[656,3],[660,3],[849,1],[884,1],[900,1],[902,1],[929,2],[942,1],[958,1],[996,1],[1032,1],[1096,1],[1102,1],[1104,2],[1156,1],[1217,2],[1346,3],[1356,1],[1366,1],[1368,1],[1466,3],[1484,1],[1529,1],[1531,1],[1545,1],[1564,1],[1566,3],[1570,3],[1687,1],[1720,1],[1754,1],[1836,2],[1871,1],[1873,2],[1916,1],[1948,2],[1951,2],[1954,2],[1957,2],[2025,1],[2061,3],[2087,1],[2139,1],[2184,1],[2226,1],[2390,1],[2398,2],[2401,2],[2404,1],[2410,1],[2440,1],[2454,1],[2497,1],[2499,1],[2759,1],[2942,1],[2979,1],[2985,1],[2987,2],[3020,2],[3099,2],[3185,1],[3199,1],[3205,2],[3220,2],[3295,2],[3340,1],[3376,2],[3383,1],[3424,1],[3426,2],[3537,3],[3663,1],[3695,1],[3702,2],[3742,2],[3778,2],[3830,1],[3832,1],[3839,1],[3841,1],[3865,1],[3905,1],[3907,2],[3942,2],[3982,2],[4018,2],[4072,2],[4117,1],[4290,1],[4292,2],[4385,1],[4425,1],[4427,2],[4540,1],[4557,2],[4635,2],[4730,2],[4863,2],[5041,2],[5084,2],[5094,2],[5101,1],[5191,1],[5198,2],[5336,1],[5348,2],[5425,2],[5432,1],[5525,1],[5547,1],[5632,1],[5634,2],[5679,1]]},"123":{"position":[[105,2],[129,1],[145,1],[147,1],[174,2],[274,1],[335,2],[419,2],[599,2],[642,3],[653,1],[655,1],[697,1],[711,1],[713,2],[812,2],[886,2],[971,2],[1104,2],[1278,2],[1321,2],[1331,2],[1338,1],[1340,2],[1343,2],[1359,1],[1361,1],[1363,2],[1482,1],[1537,1],[1571,1],[1573,2],[1675,1],[1703,1],[1715,1],[1771,2],[1828,1],[1882,2],[1987,1],[2041,2],[2168,1],[2222,2],[2265,2],[2282,1],[2318,1],[2320,1],[2422,1],[2468,1],[2504,1],[2561,1],[2595,1],[2700,1],[2733,1],[2861,1],[2895,1],[2937,1],[2939,1],[3063,1]]},"125":{"position":[[121,1],[210,2],[213,1],[270,3],[274,2],[294,1],[347,2],[448,1],[455,2],[541,1],[553,2],[648,2],[656,1],[658,1],[714,1],[728,1],[759,1],[782,1],[815,2],[827,1],[858,1],[865,1],[889,1],[906,1],[920,2],[936,1],[982,2],[1002,1],[1055,1],[1057,1],[1115,1],[1122,1],[1204,1],[1215,1],[1262,1],[1281,1],[1441,1],[1572,1],[1616,1],[1618,1],[1709,1],[1714,2],[1835,2],[1838,1]]},"143":{"position":[[134,1]]},"145":{"position":[[1154,1],[1184,1],[1399,1],[1429,1],[1813,1],[1853,1],[2514,1],[2557,1],[2610,1],[3841,1],[3868,1],[4066,1],[4093,1],[4480,1],[4499,1],[4513,1],[4539,1],[5145,1],[5188,1],[5241,1]]},"147":{"position":[[1522,1],[1549,1],[1586,1],[1612,1],[1661,1],[3041,1],[3063,1],[3099,1],[3139,1],[3165,1],[3214,1]]},"153":{"position":[[273,1],[296,1],[416,1]]},"155":{"position":[[651,2],[656,1],[733,2],[738,1],[839,2]]},"169":{"position":[[962,1],[997,1],[1009,1],[1019,2],[1022,2],[1038,1],[1048,2],[1051,2],[1064,1],[1074,2],[1077,2],[1089,1],[1099,2],[1102,1],[1104,2],[1119,1],[1134,1],[1146,1],[1179,1],[1181,1],[1198,1],[1200,1],[1202,2],[1218,1],[1251,1],[1253,1],[1270,1],[1272,1],[1274,2],[1287,1],[1320,1],[1322,1],[1339,1],[1341,1],[1343,2],[1355,1],[1388,1],[1390,1],[1407,1],[1409,1],[1411,1],[1413,1],[1415,1],[1417,1],[1896,1],[1943,1],[1945,1],[1980,1],[1992,1],[2002,2],[2005,2],[2021,1],[2031,2],[2034,2],[2047,1],[2057,2],[2060,2],[2072,1],[2082,2],[2085,1],[2087,2],[2102,1],[2117,1],[2129,1],[2162,1],[2164,1],[2205,2],[2208,1],[2225,1],[2227,1],[2229,2],[2245,1],[2278,1],[2280,1],[2321,2],[2324,1],[2341,1],[2343,1],[2345,2],[2358,1],[2391,1],[2393,1],[2434,2],[2437,1],[2454,1],[2456,1],[2458,2],[2470,1],[2503,1],[2505,1],[2546,2],[2549,1],[2566,1],[2568,1],[2570,1],[2572,1],[2574,1],[2576,2],[2579,1],[2612,1],[2624,1],[2634,2],[2637,1],[2639,2],[2654,1],[2669,1],[2681,1],[2714,1],[2716,1],[2733,1],[2735,1],[2737,1],[2739,1],[2741,1],[2743,2],[2746,1],[2763,1],[2765,1],[2767,1],[5086,1],[6489,3],[6782,1],[6804,1],[6806,1],[6841,1],[6853,1],[6863,2],[6866,2],[6882,1],[6892,2],[6895,2],[6908,1],[6918,2],[6921,2],[6933,1],[6943,2],[6946,1],[6948,2],[6963,1],[6978,1],[6990,1],[7023,1],[7025,1],[7042,1],[7044,1],[7046,2],[7062,1],[7095,1],[7097,1],[7114,1],[7116,1],[7118,2],[7131,1],[7164,1],[7166,1],[7183,1],[7185,1],[7187,2],[7199,1],[7232,1],[7234,1],[7251,1],[7253,1],[7255,1],[7257,1],[7259,1],[7261,2],[7264,1],[7281,1],[7283,1],[7285,1],[7859,1],[7881,1],[7883,1],[7918,1],[7930,1],[7940,2],[7943,1],[7945,2],[7960,1],[7975,1],[7987,1],[8020,1],[8022,1],[8039,1],[8041,1],[8043,1],[8045,1],[8047,1],[8049,1],[8051,1],[8053,1],[9345,1],[9347,1],[9426,2],[9429,1],[10505,1],[10507,2],[10564,1],[10643,2],[10646,1],[10648,1],[10650,2],[10662,5],[10717,1],[10727,4],[10788,2],[10791,1],[10793,1],[10795,2],[10847,1],[10936,2],[10939,2],[11016,1],[11094,2],[11097,1],[11422,1],[11444,1],[11446,1],[11481,1],[11493,1],[11504,1],[11515,1],[11517,1],[11527,2],[11530,2],[11533,1],[11554,1],[11577,1],[11579,1],[11581,1],[11583,1],[11585,2],[11598,1],[11608,2],[11611,1],[11613,2],[11628,1],[11643,1],[11655,1],[11688,1],[11690,1],[11707,1],[11709,1],[11711,2],[11724,1],[11757,1],[11759,1],[11776,1],[11778,1],[11780,1],[11782,1],[11784,1],[11786,1],[11788,1],[11790,1],[11860,1],[11862,1],[11941,2],[11944,1],[12315,2],[12387,2],[12411,1],[12427,1],[12429,1],[12456,2],[12556,1],[12617,2],[12701,2],[12881,2],[12924,3],[12928,2],[12949,1],[12959,1],[12961,1],[13058,2],[13061,1],[13118,3],[13122,2],[13133,1],[13159,2],[13238,1],[13240,1],[13282,1],[13296,1],[13298,2],[13397,2],[13471,2],[13556,2],[13689,2],[13863,2],[13906,2],[13916,2],[13923,1],[13925,2],[13928,2],[13944,1],[13946,1],[13956,2],[14051,1],[14058,2],[14152,1],[14164,2],[14243,2],[14251,1],[14253,1],[14269,1],[14290,2],[14362,2],[14481,1],[14536,1],[14570,1],[14572,2],[14674,1],[14702,1],[14714,1],[14770,2],[14827,1],[14881,2],[14986,1],[15040,2],[15167,1],[15221,2],[15264,2],[15281,1],[15317,1],[15319,1],[15333,1],[15358,1],[15381,1],[15414,2],[15426,1],[15451,1],[15458,1],[15482,1],[15501,1],[15527,2],[15543,1],[15583,2],[15603,1],[15629,1],[15800,1],[15846,1],[15882,1],[15939,1],[15973,1],[16078,1],[16111,1],[16239,1],[16273,1],[16315,1],[16317,1],[16441,1],[16521,1],[16523,1],[16581,1],[16588,1],[16678,1],[16689,1],[16729,1],[16748,1],[17051,1],[17314,1],[17358,1],[17360,1],[17451,1],[17602,1],[17643,1],[17658,2],[17700,1],[17712,2],[17747,1],[17773,2],[17832,1],[17864,2],[18230,1],[18248,1],[18285,1],[18304,1],[18509,2],[18581,2],[18605,1],[18621,1],[18623,1],[18650,2],[18750,1],[18811,2],[18895,2],[19075,2],[19118,3],[19122,2],[19143,1],[19153,1],[19155,1],[19252,2],[19255,1],[19312,3],[19316,2],[19327,1],[19353,2],[19432,1],[19434,1],[19476,1],[19490,1],[19492,2],[19591,2],[19665,2],[19750,2],[19883,2],[20057,2],[20100,2],[20110,2],[20117,1],[20119,2],[20122,2],[20138,1],[20140,1],[20150,2],[20245,1],[20252,2],[20346,1],[20358,2],[20437,2],[20445,1],[20447,1],[20463,1],[20484,2],[20556,2],[20675,1],[20730,1],[20764,1],[20766,2],[20868,1],[20896,1],[20908,1],[20964,2],[21021,1],[21075,2],[21180,1],[21234,2],[21361,1],[21415,2],[21458,2],[21475,1],[21511,1],[21513,1],[21527,1],[21552,1],[21575,1],[21608,2],[21620,1],[21645,1],[21652,1],[21676,1],[21695,1],[21721,2],[21737,1],[21777,2],[21797,1],[21823,1],[21994,1],[22040,1],[22076,1],[22133,1],[22167,1],[22272,1],[22305,1],[22433,1],[22467,1],[22509,1],[22511,1],[22635,1],[22715,1],[22717,1],[22775,1],[22782,1],[22872,1],[22883,1],[22923,1],[22942,1],[23245,1],[23508,1],[23552,1],[23554,1],[23645,1],[23796,1],[23837,1],[23852,2],[23894,1],[23906,2],[23941,1],[23967,2],[24026,1],[24058,2],[24863,2],[24935,2],[24959,1],[24975,1],[24977,1],[25004,2],[25104,1],[25165,2],[25249,2],[25429,2],[25472,3],[25491,1],[25580,2],[25583,1],[25640,3],[25644,2],[25664,1],[25728,2],[25807,1],[25809,1],[25851,1],[25865,1],[25867,2],[25966,2],[26040,2],[26125,2],[26258,2],[26432,2],[26475,2],[26485,2],[26492,1],[26494,2],[26497,2],[26513,1],[26515,1],[26525,2],[26626,1],[26633,2],[26719,1],[26731,2],[26826,2],[26834,1],[26836,1],[26892,1],[26913,2],[26985,2],[27104,1],[27159,1],[27193,1],[27195,2],[27297,1],[27325,1],[27337,1],[27393,2],[27450,1],[27504,2],[27609,1],[27663,2],[27790,1],[27844,2],[27887,2],[27904,1],[27940,1],[27942,1],[27956,1],[27987,1],[28010,1],[28043,2],[28055,1],[28086,1],[28093,1],[28117,1],[28134,1],[28148,2],[28164,1],[28210,2],[28230,1],[28294,1],[28465,1],[28511,1],[28547,1],[28604,1],[28638,1],[28743,1],[28776,1],[28904,1],[28938,1],[28980,1],[28982,1],[29106,1],[29186,1],[29188,1],[29246,1],[29253,1],[29335,1],[29346,1],[29393,1],[29412,1],[29750,1],[30059,1],[30103,1],[30105,1],[30196,1],[30201,2],[30322,2],[30325,1],[30419,2],[30475,2],[30515,2],[30573,1],[30606,2],[30652,2],[31978,1],[31980,1],[32056,2],[32059,1]]},"215":{"position":[[102,1],[118,1],[120,1],[147,2],[160,1],[176,1],[213,1],[274,2],[368,2],[500,2],[658,2],[701,3],[712,1],[755,1],[792,1],[806,1],[823,2],[901,2],[996,2],[1129,2],[1307,2],[1350,2],[1360,2],[1367,1],[1369,2],[1372,2],[1388,1],[1390,1],[1493,1],[1553,1],[1580,1],[1600,1],[1628,1],[1640,1],[1696,2],[1763,1],[1817,2],[1922,1],[1976,2],[2107,1],[2161,2],[2204,2],[2221,1],[2257,1],[2259,1],[2349,1],[2389,1],[2425,1],[2492,1],[2526,1],[2631,1],[2665,1],[2783,1],[2817,1],[2859,1],[2929,1],[2976,2],[3018,2],[3083,1],[3163,1],[3285,1]]},"217":{"position":[[412,1],[447,1],[449,1],[476,2],[489,1],[524,1],[561,1],[622,2],[716,2],[848,2],[1006,2],[1062,1],[1108,1],[1145,2],[1148,1],[1150,3],[1161,1],[1204,1],[1281,1],[1295,1],[1312,2],[1390,2],[1485,2],[1618,2],[1796,2],[1996,2],[2072,2],[2075,2],[2078,2],[2088,2],[2095,1],[2097,2],[2100,2],[2116,1],[2118,1],[2221,1],[2281,1],[2308,1],[2328,1],[2356,1],[2368,1],[2424,2],[2491,1],[2545,2],[2650,1],[2704,2],[2835,1],[2889,2],[2944,1],[2964,1],[2973,1],[3010,1],[3036,1],[3047,1],[3101,2],[3104,2],[3107,2],[3124,1],[3160,1],[3162,1],[3323,1],[3451,1],[3491,1],[3527,1],[3594,1],[3628,1],[3733,1],[3767,1],[3885,1],[3919,1],[3973,1],[3988,1],[4058,1],[4105,2],[4147,2],[4212,1],[4292,1],[4414,1]]},"219":{"position":[[288,1],[323,1],[325,1],[352,2],[365,1],[400,1],[437,1],[498,2],[592,2],[724,2],[882,2],[938,1],[993,1],[1170,2],[1173,1],[1175,3],[1186,1],[1229,1],[1306,1],[1320,1],[1337,2],[1415,2],[1510,2],[1643,2],[1821,2],[2235,2],[2238,2],[2241,2],[2251,2],[2258,1],[2260,2],[2263,2],[2279,1],[2281,1],[2384,1],[2444,1],[2471,1],[2491,1],[2519,1],[2531,1],[2587,2],[2654,1],[2708,2],[2813,1],[2867,2],[2998,1],[3052,2],[3107,1],[3127,1],[3136,1],[3182,1],[3208,1],[3225,1],[3299,1],[3366,1],[3434,1],[3493,1],[3495,1],[3497,2],[3514,1],[3550,1],[3552,1],[3713,1],[3994,1],[3996,1],[4012,1],[4052,1],[4088,1],[4155,1],[4189,1],[4294,1],[4328,1],[4446,1],[4480,1],[4534,1],[4549,1],[4619,1],[4666,2],[4708,2],[4773,1],[4853,1],[4975,1]]},"227":{"position":[[453,1],[500,1],[502,1],[519,2],[522,1],[556,1],[570,1],[580,2],[583,1],[585,2],[600,1],[615,1],[629,1],[662,1],[664,1],[681,1],[683,1],[685,1],[687,1],[689,1],[691,2],[694,1],[729,1],[741,1],[751,2],[754,1],[756,2],[771,1],[786,1],[798,1],[831,1],[833,1],[877,1],[879,1],[881,1],[883,1],[885,1],[887,1],[889,1],[891,1],[1058,1]]},"229":{"position":[[93,1]]},"234":{"position":[[187,1],[189,2],[249,1],[336,2],[339,1]]},"236":{"position":[[146,2],[218,2],[242,1],[258,1],[260,1],[287,2],[387,1],[448,2],[532,2],[712,2],[755,3],[791,1],[793,1],[860,2],[863,2],[866,1],[922,3],[945,2],[1024,1],[1026,1],[1068,1],[1082,1],[1084,2],[1183,2],[1257,2],[1342,2],[1475,2],[1649,2],[1692,2],[1702,2],[1709,1],[1711,2],[1714,2],[1730,1],[1732,1],[1742,2],[1837,1],[1844,2],[1904,1],[2027,2],[2030,1],[2032,1],[2044,2],[2137,2],[2144,1],[2146,2],[2149,2],[2165,1],[2186,2],[2258,2],[2377,1],[2432,1],[2466,1],[2468,2],[2570,1],[2598,1],[2610,1],[2666,2],[2723,1],[2777,2],[2882,1],[2936,2],[3063,1],[3117,2],[3160,2],[3177,1],[3213,1],[3215,1],[3229,1],[3260,1],[3283,1],[3316,2],[3328,1],[3355,1],[3364,1],[3393,1],[3401,1],[3408,1],[3432,1],[3453,1],[3469,1],[3471,2],[3474,2],[3490,1],[3549,1],[3720,1],[3766,1],[3802,1],[3859,1],[3893,1],[3998,1],[4031,1],[4159,1],[4193,1],[4235,1],[4237,1],[4361,1],[4441,1],[4443,1],[4501,1],[4508,1],[4515,1],[4620,3],[4624,2],[4627,2],[4630,1],[4641,1],[4915,1],[4959,1],[4961,1],[5052,1],[5069,1],[5084,1],[5154,2],[5514,1],[5582,1],[5584,2]]},"238":{"position":[[156,2],[228,2],[252,1],[268,1],[270,1],[297,2],[397,1],[458,2],[542,2],[722,2],[765,3],[769,2],[790,1],[800,1],[802,1],[896,2],[899,1],[956,3],[960,2],[971,1],[997,2],[1076,1],[1078,1],[1120,1],[1134,1],[1136,2],[1235,2],[1309,2],[1394,2],[1527,2],[1701,2],[1744,2],[1754,2],[1761,1],[1763,2],[1766,2],[1782,1],[1784,1],[1794,2],[1889,1],[1896,2],[1987,1],[1999,2],[2078,2],[2086,1],[2088,1],[2104,1],[2125,2],[2197,2],[2316,1],[2371,1],[2405,1],[2407,2],[2509,1],[2537,1],[2549,1],[2605,2],[2662,1],[2716,2],[2821,1],[2875,2],[3002,1],[3056,2],[3099,2],[3116,1],[3152,1],[3154,1],[3168,1],[3193,1],[3216,1],[3249,2],[3261,1],[3286,1],[3293,1],[3317,1],[3336,1],[3359,2],[3375,1],[3415,2],[3435,1],[3461,1],[3632,1],[3678,1],[3714,1],[3771,1],[3805,1],[3910,1],[3943,1],[4071,1],[4105,1],[4147,1],[4149,1],[4273,1],[4353,1],[4355,1],[4413,1],[4420,1],[4507,1],[4518,1],[4558,1],[4577,1],[4877,1],[5140,1],[5184,1],[5186,1],[5277,1],[5425,1],[5466,1],[5481,2],[5523,1],[5535,2],[5570,1],[5593,2],[5649,1],[5681,2],[5900,2],[5972,2],[5996,1],[6012,1],[6014,1],[6041,2],[6141,1],[6202,2],[6286,2],[6466,2],[6509,3],[6513,2],[6534,1],[6544,1],[6546,1],[6641,2],[6644,1],[6701,3],[6705,2],[6716,1],[6743,2],[6822,1],[6824,1],[6866,1],[6880,1],[6882,2],[6981,2],[7055,2],[7140,2],[7273,2],[7447,2],[7490,2],[7500,2],[7507,1],[7509,2],[7512,2],[7528,1],[7530,1],[7540,2],[7635,1],[7642,2],[7734,1],[7746,2],[7825,2],[7833,1],[7835,1],[7852,1],[7873,2],[7945,2],[8064,1],[8119,1],[8153,1],[8155,2],[8257,1],[8285,1],[8297,1],[8353,2],[8410,1],[8464,2],[8569,1],[8623,2],[8750,1],[8804,2],[8847,2],[8864,1],[8900,1],[8902,1],[8916,1],[8941,1],[8964,1],[8997,2],[9009,1],[9034,1],[9041,1],[9066,1],[9085,1],[9108,2],[9124,1],[9164,2],[9184,1],[9211,1],[9382,1],[9428,1],[9464,1],[9521,1],[9555,1],[9660,1],[9693,1],[9821,1],[9855,1],[9897,1],[9899,1],[10023,1],[10103,1],[10105,1],[10163,1],[10170,1],[10258,1],[10269,1],[10309,1],[10328,1],[10630,1],[10894,1],[10938,1],[10940,1],[11031,1],[11180,1],[11222,1],[11238,2],[11281,1],[11293,2],[11328,1],[11351,2],[11407,1],[11439,2]]},"246":{"position":[[94,1],[157,1]]},"248":{"position":[[105,2],[129,1],[145,1],[147,1],[174,2],[274,1],[335,2],[419,2],[599,2],[642,3],[653,1],[655,1],[697,1],[711,1],[713,2],[812,2],[886,2],[971,2],[1104,2],[1278,2],[1321,2],[1331,2],[1338,1],[1340,2],[1343,2],[1359,1],[1361,1],[1363,2],[1482,1],[1537,1],[1571,1],[1573,2],[1675,1],[1703,1],[1715,1],[1771,2],[1828,1],[1882,2],[1987,1],[2041,2],[2168,1],[2222,2],[2265,2],[2282,1],[2318,1],[2320,1],[2422,1],[2468,1],[2504,1],[2561,1],[2595,1],[2700,1],[2733,1],[2861,1],[2895,1],[2937,1],[2939,1],[3063,1]]},"250":{"position":[[125,1],[127,1],[191,2],[194,2],[197,1],[253,3],[265,2],[360,1],[367,2],[427,1],[547,2],[550,1],[552,1],[564,2],[657,2],[664,1],[666,2],[669,2],[685,1],[699,1],[730,1],[753,1],[786,2],[798,1],[825,1],[834,1],[863,1],[871,1],[878,1],[902,1],[921,1],[936,1],[938,2],[941,2],[957,1],[1005,1],[1007,1],[1065,1],[1072,1],[1079,1],[1181,3],[1185,2],[1188,2],[1191,1],[1202,1],[1408,1],[1452,1],[1454,1],[1545,1],[1562,1],[1577,1],[1644,2]]},"252":{"position":[[151,1],[214,1],[281,1],[283,1],[347,2],[350,2],[353,1],[409,3],[421,2],[516,1],[523,2],[584,1],[704,2],[707,1],[709,1],[721,2],[814,2],[821,1],[823,2],[826,2],[842,1],[856,1],[887,1],[910,1],[943,2],[955,1],[982,1],[992,1],[1021,1],[1029,1],[1036,1],[1060,1],[1079,1],[1094,1],[1096,2],[1099,2],[1115,1],[1163,1],[1165,1],[1223,1],[1230,1],[1237,1],[1341,4],[1346,2],[1349,2],[1352,1],[1363,1],[1531,1],[1575,1],[1577,1],[1668,1],[1686,1],[1701,1],[1768,2]]},"258":{"position":[[340,1],[387,1],[389,1],[406,2],[409,1],[441,1],[453,1],[463,2],[466,1],[468,2],[483,1],[498,1],[510,1],[543,1],[545,1],[562,1],[564,1],[566,1],[568,1],[570,1],[572,1],[574,1],[576,1],[777,1]]},"260":{"position":[[134,1]]},"265":{"position":[[127,1],[129,2],[154,1],[220,2],[223,1],[456,2],[528,2],[552,1],[568,1],[570,1],[597,2],[697,1],[758,2],[842,2],[1022,2],[1065,3],[1069,2],[1090,1],[1100,1],[1102,1],[1186,2],[1189,1],[1246,3],[1250,2],[1261,1],[1287,2],[1366,1],[1368,1],[1410,1],[1424,1],[1426,2],[1525,2],[1599,2],[1684,2],[1817,2],[1991,2],[2034,2],[2044,2],[2051,1],[2053,2],[2056,2],[2072,1],[2074,1],[2084,2],[2179,1],[2186,2],[2267,1],[2279,2],[2358,2],[2366,1],[2368,1],[2384,1],[2405,2],[2477,2],[2596,1],[2651,1],[2685,1],[2687,2],[2789,1],[2817,1],[2829,1],[2885,2],[2942,1],[2996,2],[3101,1],[3155,2],[3282,1],[3336,2],[3379,2],[3396,1],[3432,1],[3434,1],[3448,1],[3473,1],[3496,1],[3529,2],[3541,1],[3566,1],[3573,1],[3597,1],[3616,1],[3629,2],[3645,1],[3685,2],[3705,1],[3731,1],[3902,1],[3948,1],[3984,1],[4041,1],[4075,1],[4180,1],[4213,1],[4341,1],[4375,1],[4417,1],[4419,1],[4543,1],[4623,1],[4625,1],[4683,1],[4690,1],[4767,1],[4778,1],[4818,1],[4837,1],[5127,1],[5390,1],[5434,1],[5436,1],[5527,1],[5665,1],[5706,1],[5721,2],[5763,1],[5775,2],[5810,1],[5823,2],[5869,1],[5901,2]]},"267":{"position":[[167,2],[239,2],[263,1],[279,1],[281,1],[308,2],[408,1],[469,2],[553,2],[733,2],[776,3],[813,1],[815,1],[876,2],[879,2],[882,1],[938,3],[961,2],[1040,1],[1042,1],[1084,1],[1098,1],[1100,2],[1199,2],[1273,2],[1358,2],[1491,2],[1665,2],[1708,2],[1718,2],[1725,1],[1727,2],[1730,2],[1746,1],[1748,1],[1758,2],[1853,1],[1860,2],[1921,1],[2038,2],[2041,1],[2043,1],[2055,2],[2148,2],[2155,1],[2157,2],[2160,2],[2176,1],[2197,2],[2269,2],[2388,1],[2443,1],[2477,1],[2479,2],[2581,1],[2609,1],[2621,1],[2677,2],[2734,1],[2788,2],[2893,1],[2947,2],[3074,1],[3128,2],[3171,2],[3188,1],[3224,1],[3226,1],[3240,1],[3271,1],[3294,1],[3327,2],[3339,1],[3366,1],[3376,1],[3405,1],[3413,1],[3420,1],[3444,1],[3463,1],[3475,1],[3477,2],[3480,2],[3496,1],[3555,1],[3726,1],[3772,1],[3808,1],[3865,1],[3899,1],[4004,1],[4037,1],[4165,1],[4199,1],[4241,1],[4243,1],[4367,1],[4447,1],[4449,1],[4507,1],[4514,1],[4521,1],[4622,4],[4627,2],[4630,2],[4633,1],[4644,1],[4918,1],[4962,1],[4964,1],[5055,1],[5073,1],[5088,1],[5152,2],[5469,1],[5531,1],[5533,2],[5871,2],[5943,2],[5967,1],[5983,1],[5985,1],[6012,2],[6112,1],[6173,2],[6257,2],[6437,2],[6480,3],[6484,2],[6505,1],[6515,1],[6517,1],[6601,2],[6604,1],[6661,3],[6665,2],[6676,1],[6703,2],[6782,1],[6784,1],[6826,1],[6840,1],[6842,2],[6941,2],[7015,2],[7100,2],[7233,2],[7407,2],[7450,2],[7460,2],[7467,1],[7469,2],[7472,2],[7488,1],[7490,1],[7500,2],[7595,1],[7602,2],[7683,1],[7695,2],[7774,2],[7782,1],[7784,1],[7801,1],[7822,2],[7894,2],[8013,1],[8068,1],[8102,1],[8104,2],[8206,1],[8234,1],[8246,1],[8302,2],[8359,1],[8413,2],[8518,1],[8572,2],[8699,1],[8753,2],[8796,2],[8813,1],[8849,1],[8851,1],[8865,1],[8890,1],[8913,1],[8946,2],[8958,1],[8983,1],[8990,1],[9014,1],[9033,1],[9046,2],[9062,1],[9102,2],[9122,1],[9149,1],[9320,1],[9366,1],[9402,1],[9459,1],[9493,1],[9598,1],[9631,1],[9759,1],[9793,1],[9835,1],[9837,1],[9961,1],[10041,1],[10043,1],[10101,1],[10108,1],[10185,1],[10196,1],[10236,1],[10255,1],[10546,1],[10810,1],[10854,1],[10856,1],[10947,1],[11085,1],[11127,1],[11142,2],[11184,1],[11196,2],[11231,1],[11244,2],[11290,1],[11322,2]]},"273":{"position":[[435,1],[482,1],[484,1],[501,2],[504,1],[534,1],[546,1],[556,2],[559,1],[561,2],[576,1],[591,1],[603,1],[636,1],[638,1],[655,1],[657,1],[659,1],[661,1],[663,1],[665,2],[668,1],[703,1],[715,1],[725,2],[728,1],[730,2],[745,1],[760,1],[772,1],[805,1],[807,1],[845,1],[847,1],[849,1],[851,1],[853,1],[855,1],[857,1],[859,1],[1078,1],[1080,2],[1141,1],[1226,2],[1229,1],[1461,2],[1533,2],[1557,1],[1573,1],[1575,1],[1602,2],[1702,1],[1763,2],[1847,2],[2027,2],[2070,3],[2074,2],[2095,1],[2105,1],[2107,1],[2196,2],[2199,1],[2256,3],[2260,2],[2271,1],[2298,2],[2377,1],[2379,1],[2421,1],[2435,1],[2437,2],[2536,2],[2610,2],[2695,2],[2828,2],[3002,2],[3045,2],[3055,2],[3062,1],[3064,2],[3067,2],[3083,1],[3085,1],[3095,2],[3190,1],[3197,2],[3283,1],[3295,2],[3374,2],[3382,1],[3384,1],[3401,1],[3422,2],[3494,2],[3613,1],[3668,1],[3702,1],[3704,2],[3806,1],[3834,1],[3846,1],[3902,2],[3959,1],[4013,2],[4118,1],[4172,2],[4299,1],[4353,2],[4396,2],[4413,1],[4449,1],[4451,1],[4465,1],[4490,1],[4513,1],[4546,2],[4558,1],[4583,1],[4590,1],[4609,1],[4628,1],[4651,2],[4667,1],[4707,2],[4727,1],[4754,1],[4925,1],[4971,1],[5007,1],[5064,1],[5098,1],[5203,1],[5236,1],[5364,1],[5398,1],[5440,1],[5442,1],[5566,1],[5646,1],[5648,1],[5706,1],[5713,1],[5795,1],[5806,1],[5846,1],[5865,1],[6161,1],[6425,1],[6469,1],[6471,1],[6562,1],[6705,1],[6747,1],[6757,2],[6794,1],[6806,2],[6841,1],[6864,2],[6920,1],[6952,2],[7099,2],[7171,2],[7195,1],[7211,1],[7213,1],[7240,2],[7340,1],[7401,2],[7485,2],[7665,2],[7708,3],[7744,1],[7746,2],[7785,1],[7850,2],[7853,2],[7856,1],[7912,3],[7935,2],[8014,1],[8016,1],[8058,1],[8072,1],[8074,2],[8173,2],[8247,2],[8332,2],[8465,2],[8639,2],[8682,2],[8692,2],[8699,1],[8701,2],[8704,2],[8720,1],[8722,1],[8732,2],[8827,1],[8834,2],[8894,1],[8896,2],[9054,2],[9057,1],[9059,1],[9071,2],[9164,2],[9171,1],[9173,2],[9176,2],[9192,1],[9213,2],[9285,2],[9404,1],[9459,1],[9493,1],[9495,2],[9597,1],[9625,1],[9637,1],[9693,2],[9750,1],[9804,2],[9909,1],[9963,2],[10090,1],[10144,2],[10187,2],[10204,1],[10240,1],[10242,1],[10256,1],[10287,1],[10310,1],[10343,2],[10355,1],[10382,1],[10391,1],[10420,1],[10422,2],[10467,1],[10474,1],[10498,1],[10517,1],[10533,1],[10535,2],[10538,2],[10554,1],[10613,1],[10784,1],[10830,1],[10866,1],[10923,1],[10957,1],[11062,1],[11095,1],[11223,1],[11257,1],[11299,1],[11301,1],[11425,1],[11505,1],[11507,1],[11565,1],[11572,1],[11579,1],[11623,1],[11720,3],[11724,2],[11727,2],[11730,1],[11741,1],[12015,1],[12059,1],[12061,1],[12152,1],[12169,1],[12184,1],[12252,2],[12610,2],[12649,1],[12715,1],[12717,2],[13123,2],[13195,2],[13219,1],[13235,1],[13237,1],[13264,2],[13364,1],[13425,2],[13509,2],[13689,2],[13732,3],[13736,2],[13757,1],[13767,1],[13769,1],[13863,2],[13866,1],[13923,3],[13927,2],[13938,1],[13964,2],[14043,1],[14045,1],[14087,1],[14101,1],[14103,2],[14202,2],[14276,2],[14361,2],[14494,2],[14668,2],[14711,2],[14721,2],[14728,1],[14730,2],[14733,2],[14749,1],[14751,1],[14761,2],[14856,1],[14863,2],[14954,1],[14966,2],[15045,2],[15053,1],[15055,1],[15071,1],[15092,2],[15164,2],[15283,1],[15338,1],[15372,1],[15374,2],[15476,1],[15504,1],[15516,1],[15572,2],[15629,1],[15683,2],[15788,1],[15842,2],[15969,1],[16023,2],[16066,2],[16083,1],[16119,1],[16121,1],[16135,1],[16160,1],[16183,1],[16216,2],[16228,1],[16253,1],[16260,1],[16284,1],[16303,1],[16326,2],[16342,1],[16382,2],[16402,1],[16428,1],[16599,1],[16645,1],[16681,1],[16738,1],[16772,1],[16877,1],[16910,1],[17038,1],[17072,1],[17114,1],[17116,1],[17240,1],[17320,1],[17322,1],[17380,1],[17387,1],[17474,1],[17485,1],[17525,1],[17544,1],[17844,1],[18107,1],[18151,1],[18153,1],[18244,1],[18392,1],[18433,1],[18448,2],[18490,1],[18502,2],[18537,1],[18560,2],[18616,1],[18648,2],[18725,2],[18797,2],[18821,1],[18837,1],[18839,1],[18866,2],[18966,1],[19027,2],[19111,2],[19291,2],[19334,3],[19338,2],[19359,1],[19369,1],[19371,1],[19466,2],[19469,1],[19526,3],[19530,2],[19541,1],[19568,2],[19647,1],[19649,1],[19691,1],[19705,1],[19707,2],[19806,2],[19880,2],[19965,2],[20098,2],[20272,2],[20315,2],[20325,2],[20332,1],[20334,2],[20337,2],[20353,1],[20355,1],[20365,2],[20460,1],[20467,2],[20559,1],[20571,2],[20650,2],[20658,1],[20660,1],[20677,1],[20698,2],[20770,2],[20889,1],[20944,1],[20978,1],[20980,2],[21082,1],[21110,1],[21122,1],[21178,2],[21235,1],[21289,2],[21394,1],[21448,2],[21575,1],[21629,2],[21672,2],[21689,1],[21725,1],[21727,1],[21741,1],[21766,1],[21789,1],[21822,2],[21834,1],[21859,1],[21866,1],[21891,1],[21910,1],[21933,2],[21949,1],[21989,2],[22009,1],[22036,1],[22207,1],[22253,1],[22289,1],[22346,1],[22380,1],[22485,1],[22518,1],[22646,1],[22680,1],[22722,1],[22724,1],[22848,1],[22928,1],[22930,1],[22988,1],[22995,1],[23083,1],[23094,1],[23134,1],[23153,1],[23455,1],[23719,1],[23763,1],[23765,1],[23856,1],[24005,1],[24047,1],[24063,2],[24106,1],[24118,2],[24153,1],[24176,2],[24232,1],[24264,2],[24395,1],[24489,1]]},"275":{"position":[[93,1]]},"277":{"position":[[69,1]]},"282":{"position":[[408,2],[480,2],[504,1],[520,1],[522,1],[549,2],[649,1],[710,2],[794,2],[974,2],[1017,3],[1054,1],[1056,1],[1121,2],[1124,2],[1127,1],[1183,3],[1206,2],[1285,1],[1287,1],[1329,1],[1343,1],[1345,2],[1444,2],[1518,2],[1603,2],[1736,2],[1910,2],[1953,2],[1963,2],[1970,1],[1972,2],[1975,2],[1991,1],[1993,1],[2003,2],[2098,1],[2105,2],[2166,1],[2287,2],[2290,1],[2292,1],[2304,2],[2397,2],[2404,1],[2406,2],[2409,2],[2425,1],[2446,2],[2518,2],[2637,1],[2692,1],[2726,1],[2728,2],[2830,1],[2858,1],[2870,1],[2926,2],[2983,1],[3037,2],[3142,1],[3196,2],[3323,1],[3377,2],[3420,2],[3437,1],[3473,1],[3475,1],[3489,1],[3520,1],[3543,1],[3576,2],[3588,1],[3615,1],[3625,1],[3654,1],[3662,1],[3669,1],[3693,1],[3712,1],[3728,1],[3730,2],[3733,2],[3749,1],[3808,1],[3979,1],[4025,1],[4061,1],[4118,1],[4152,1],[4257,1],[4290,1],[4418,1],[4452,1],[4494,1],[4496,1],[4620,1],[4700,1],[4702,1],[4760,1],[4767,1],[4774,1],[4879,4],[4884,2],[4887,2],[4890,1],[4901,1],[5175,1],[5219,1],[5221,1],[5312,1],[5330,1],[5345,1],[5413,2],[5734,1],[5800,1],[5802,2]]},"284":{"position":[[115,1],[134,2],[199,2],[271,2],[295,1],[311,1],[313,1],[340,2],[440,1],[501,2],[585,2],[765,2],[808,3],[812,2],[833,1],[843,1],[845,1],[939,2],[942,1],[999,3],[1003,2],[1014,1],[1041,2],[1120,1],[1122,1],[1164,1],[1178,1],[1180,2],[1279,2],[1353,2],[1438,2],[1571,2],[1745,2],[1788,2],[1798,2],[1805,1],[1807,2],[1810,2],[1826,1],[1828,1],[1838,2],[1933,1],[1940,2],[2031,1],[2043,2],[2122,2],[2130,1],[2132,1],[2149,1],[2170,2],[2242,2],[2361,1],[2416,1],[2450,1],[2452,2],[2554,1],[2582,1],[2594,1],[2650,2],[2707,1],[2761,2],[2866,1],[2920,2],[3047,1],[3101,2],[3144,2],[3161,1],[3197,1],[3199,1],[3213,1],[3238,1],[3261,1],[3294,2],[3306,1],[3331,1],[3338,1],[3362,1],[3381,1],[3404,2],[3420,1],[3460,2],[3480,1],[3507,1],[3678,1],[3724,1],[3760,1],[3817,1],[3851,1],[3956,1],[3989,1],[4117,1],[4151,1],[4193,1],[4195,1],[4319,1],[4399,1],[4401,1],[4459,1],[4466,1],[4553,1],[4564,1],[4604,1],[4623,1],[4924,1],[5188,1],[5232,1],[5234,1],[5325,1],[5473,1],[5515,1],[5530,2],[5572,1],[5584,2],[5619,1],[5642,2],[5698,1],[5730,2]]},"294":{"position":[[77,2],[101,1],[117,1],[119,1],[146,2],[246,1],[307,2],[391,2],[571,2],[614,3],[625,1],[627,1],[669,1],[683,1],[685,2],[784,2],[858,2],[943,2],[1076,2],[1250,2],[1293,2],[1303,2],[1310,1],[1312,2],[1315,2],[1331,1],[1333,1],[1335,2],[1454,1],[1509,1],[1543,1],[1545,2],[1647,1],[1675,1],[1687,1],[1743,2],[1800,1],[1854,2],[1959,1],[2013,2],[2140,1],[2194,2],[2237,2],[2254,1],[2290,1],[2292,1],[2394,1],[2440,1],[2476,1],[2533,1],[2567,1],[2672,1],[2705,1],[2833,1],[2867,1],[2909,1],[2911,1],[3035,1]]},"296":{"position":[[105,1],[107,3],[133,1],[135,3],[152,1],[193,2],[196,1],[226,3],[238,2],[299,1],[306,2],[335,1],[347,2],[439,2],[446,1],[448,2],[451,2],[467,1],[478,1],[509,1],[511,2],[526,1],[557,1],[568,1],[574,2],[590,1],[641,1],[678,1],[709,1],[726,2],[738,1],[888,1],[932,1],[934,1],[1025,1],[1509,1],[1511,3],[1537,1],[1652,1],[1693,2],[1696,1],[1726,3],[1738,2],[1937,1],[1944,2],[1973,1],[1985,2],[2077,2],[2084,1],[2086,2],[2089,2],[2105,1],[2116,1],[2147,1],[2149,2],[2164,1],[2195,1],[2206,1],[2230,1],[2332,2],[2348,1],[2399,1],[2436,1],[2467,1],[2604,2],[2616,1],[2766,1],[2810,1],[2812,1],[2903,1]]},"298":{"position":[[242,1],[289,1],[291,1],[308,2],[311,1],[343,1],[355,1],[365,2],[368,1],[370,2],[385,1],[400,1],[412,1],[445,1],[447,1],[464,1],[466,1],[468,1],[470,1],[472,1],[474,2],[477,1],[510,1],[521,1],[531,2],[534,1],[536,2],[551,1],[566,1],[577,1],[610,1],[612,1],[652,2],[655,1],[672,1],[674,1],[676,1],[678,1],[680,1],[682,2],[685,1],[715,1],[726,1],[736,2],[739,1],[741,2],[756,1],[771,1],[782,1],[815,1],[817,1],[857,2],[860,1],[877,1],[879,1],[881,1],[883,1],[885,1],[887,1],[889,1],[891,1],[1090,1],[1124,1],[1126,3],[1143,1],[1184,2],[1187,1],[1217,3],[1229,2],[1290,1],[1297,2],[1342,1],[1354,2],[1446,2],[1453,1],[1455,2],[1458,2],[1474,1],[1485,1],[1516,1],[1523,1],[1534,2],[1549,1],[1580,1],[1591,1],[1597,2],[1613,1],[1664,1],[1709,1],[1740,1],[1757,2],[1769,1],[1933,1],[1977,1],[1979,1],[2070,1],[2359,1],[2393,1],[2508,1],[2549,2],[2552,1],[2582,3],[2594,2],[2793,1],[2800,2],[2845,1],[2857,2],[2949,2],[2956,1],[2958,2],[2961,2],[2977,1],[2988,1],[3019,1],[3026,1],[3037,2],[3052,1],[3083,1],[3094,1],[3118,1],[3220,2],[3236,1],[3287,1],[3332,1],[3363,1],[3500,2],[3512,1],[3676,1],[3720,1],[3722,1],[3813,1]]},"310":{"position":[[1067,2]]},"312":{"position":[[18,1],[60,1],[99,1],[268,1]]},"320":{"position":[[513,1],[560,1],[562,1],[594,1],[606,1],[616,2],[619,1],[621,2],[636,1],[651,1],[663,1],[696,1],[698,1],[715,2],[718,1],[748,2],[751,2],[754,1],[795,1],[797,1],[799,1],[801,1],[803,1],[805,2],[808,1],[839,1],[853,1],[863,2],[866,2],[884,1],[894,2],[897,1],[899,2],[914,1],[929,1],[943,1],[976,1],[978,1],[995,1],[997,1],[999,2],[1017,1],[1050,1],[1052,1],[1069,1],[1071,1],[1073,1],[1075,1],[1077,1],[1079,1],[1081,1],[1083,1],[1284,1],[1379,1]]},"322":{"position":[[134,1]]},"324":{"position":[[69,1]]},"329":{"position":[[253,2],[325,2],[349,1],[365,1],[367,1],[394,2],[494,1],[555,2],[639,2],[819,2],[862,3],[898,1],[900,1],[958,2],[961,2],[964,1],[1020,3],[1043,2],[1122,1],[1124,1],[1166,1],[1180,1],[1182,2],[1281,2],[1355,2],[1440,2],[1573,2],[1747,2],[1790,2],[1800,2],[1807,1],[1809,2],[1812,2],[1828,1],[1830,1],[1840,2],[1935,1],[1942,2],[2002,1],[2116,2],[2119,1],[2121,1],[2133,2],[2226,2],[2233,1],[2235,2],[2238,2],[2254,1],[2275,2],[2347,2],[2466,1],[2521,1],[2555,1],[2557,2],[2659,1],[2687,1],[2699,1],[2755,2],[2812,1],[2866,2],[2971,1],[3025,2],[3152,1],[3206,2],[3249,2],[3266,1],[3302,1],[3304,1],[3318,1],[3349,1],[3372,1],[3405,2],[3417,1],[3444,1],[3453,1],[3482,1],[3490,1],[3497,1],[3518,1],[3537,1],[3549,1],[3551,2],[3554,2],[3570,1],[3629,1],[3800,1],[3846,1],[3882,1],[3939,1],[3973,1],[4078,1],[4111,1],[4239,1],[4273,1],[4315,1],[4317,1],[4441,1],[4521,1],[4523,1],[4581,1],[4588,1],[4595,1],[4691,3],[4695,2],[4698,2],[4701,1],[4712,1],[4986,1],[5030,1],[5032,1],[5123,1],[5140,1],[5155,1],[5216,2],[5567,1],[5626,1],[5628,2],[5834,2],[5906,2],[5930,1],[5946,1],[5948,1],[5975,2],[6075,1],[6136,2],[6220,2],[6400,2],[6443,3],[6480,1],[6482,1],[6540,2],[6543,2],[6546,1],[6602,3],[6625,2],[6704,1],[6706,1],[6748,1],[6762,1],[6764,2],[6863,2],[6937,2],[7022,2],[7155,2],[7329,2],[7372,2],[7382,2],[7389,1],[7391,2],[7394,2],[7410,1],[7412,1],[7422,2],[7517,1],[7524,2],[7585,1],[7699,2],[7702,1],[7704,1],[7716,2],[7809,2],[7816,1],[7818,2],[7821,2],[7837,1],[7858,2],[7930,2],[8049,1],[8104,1],[8138,1],[8140,2],[8242,1],[8270,1],[8282,1],[8338,2],[8395,1],[8449,2],[8554,1],[8608,2],[8735,1],[8789,2],[8832,2],[8849,1],[8885,1],[8887,1],[8901,1],[8932,1],[8955,1],[8988,2],[9000,1],[9027,1],[9037,1],[9066,1],[9074,1],[9081,1],[9102,1],[9121,1],[9133,1],[9135,2],[9138,2],[9154,1],[9213,1],[9384,1],[9430,1],[9466,1],[9523,1],[9557,1],[9662,1],[9695,1],[9823,1],[9857,1],[9899,1],[9901,1],[10025,1],[10105,1],[10107,1],[10165,1],[10172,1],[10179,1],[10277,4],[10282,2],[10285,2],[10288,1],[10299,1],[10573,1],[10617,1],[10619,1],[10710,1],[10728,1],[10743,1],[10804,2],[11118,1],[11177,1],[11179,2],[11648,2],[11720,2],[11744,1],[11760,1],[11762,1],[11789,2],[11889,1],[11950,2],[12034,2],[12214,2],[12257,3],[12293,1],[12295,2],[12332,1],[12402,2],[12414,1],[12416,2],[12461,3],[12465,1],[12523,2],[12526,2],[12529,1],[12585,3],[12608,2],[12687,1],[12689,1],[12731,1],[12745,1],[12747,2],[12846,2],[12920,2],[13005,2],[13138,2],[13312,2],[13355,2],[13365,2],[13372,1],[13374,2],[13377,2],[13393,1],[13395,1],[13405,2],[13500,1],[13507,2],[13567,1],[13569,2],[13730,2],[13733,1],[13763,1],[13765,2],[13810,3],[13926,2],[13929,1],[13931,1],[13943,2],[14036,2],[14043,1],[14045,2],[14048,2],[14064,1],[14085,2],[14157,2],[14276,1],[14331,1],[14365,1],[14367,2],[14469,1],[14497,1],[14509,1],[14565,2],[14622,1],[14676,2],[14781,1],[14835,2],[14962,1],[15016,2],[15059,2],[15076,1],[15112,1],[15114,1],[15128,1],[15159,1],[15182,1],[15215,2],[15227,1],[15254,1],[15263,1],[15292,1],[15294,2],[15337,1],[15344,1],[15377,1],[15396,1],[15408,1],[15410,2],[15421,1],[15450,1],[15452,2],[15497,3],[15507,1],[15514,1],[15535,1],[15554,1],[15566,1],[15568,2],[15571,2],[15587,1],[15646,1],[15817,1],[15863,1],[15899,1],[15956,1],[15990,1],[16095,1],[16128,1],[16256,1],[16290,1],[16332,1],[16334,1],[16458,1],[16538,1],[16540,1],[16598,1],[16605,1],[16612,1],[16656,1],[16756,3],[16760,2],[16787,1],[16831,3],[16887,4],[16892,2],[16895,2],[16898,1],[16909,1],[17183,1],[17227,1],[17229,1],[17320,1],[17337,1],[17352,1],[17438,1],[17453,1],[17514,2],[17583,2],[17620,1],[17691,1],[17693,2],[17760,2],[17805,3],[17809,1],[17868,1],[17870,2]]},"331":{"position":[[227,1],[229,2],[260,1],[331,2],[334,2],[363,1],[437,2],[440,1]]},"347":{"position":[[577,1],[624,1],[626,1],[643,2],[646,1],[681,1],[693,1],[703,2],[706,1],[708,2],[723,1],[738,1],[750,1],[783,1],[785,1],[802,2],[805,1],[844,1],[846,1],[848,1],[850,1],[852,1],[854,2],[857,1],[888,1],[900,1],[910,2],[913,1],[915,2],[930,1],[945,1],[957,1],[990,1],[992,1],[1009,1],[1011,1],[1013,1],[1015,1],[1017,1],[1019,1],[1021,1],[1023,1],[1138,1],[1140,2],[1202,1],[1288,2],[1291,2],[1332,1],[1404,2],[1407,2],[1447,1],[1518,2],[1521,1],[1688,1]]},"349":{"position":[[93,1]]},"353":{"position":[[295,2],[367,2],[391,1],[407,1],[409,1],[436,2],[536,1],[597,2],[681,2],[861,2],[904,3],[908,2],[929,1],[939,1],[941,1],[1036,2],[1039,1],[1096,3],[1100,2],[1111,1],[1137,2],[1216,1],[1218,1],[1260,1],[1274,1],[1276,2],[1375,2],[1449,2],[1534,2],[1667,2],[1841,2],[1884,2],[1894,2],[1901,1],[1903,2],[1906,2],[1922,1],[1924,1],[1934,2],[2029,1],[2036,2],[2128,1],[2140,2],[2219,2],[2227,1],[2229,1],[2245,1],[2266,2],[2338,2],[2457,1],[2512,1],[2546,1],[2548,2],[2650,1],[2678,1],[2690,1],[2746,2],[2803,1],[2857,2],[2962,1],[3016,2],[3143,1],[3197,2],[3240,2],[3257,1],[3293,1],[3295,1],[3309,1],[3334,1],[3357,1],[3390,2],[3402,1],[3427,1],[3434,1],[3459,1],[3478,1],[3501,2],[3517,1],[3557,2],[3577,1],[3603,1],[3774,1],[3820,1],[3856,1],[3913,1],[3947,1],[4052,1],[4085,1],[4213,1],[4247,1],[4289,1],[4291,1],[4415,1],[4495,1],[4497,1],[4555,1],[4562,1],[4650,1],[4661,1],[4701,1],[4720,1],[5021,1],[5284,1],[5328,1],[5330,1],[5421,1],[5570,1],[5611,1],[5627,2],[5670,1],[5682,2],[5717,1],[5740,2],[5796,1],[5828,2],[5905,2],[5977,2],[6001,1],[6017,1],[6019,1],[6046,2],[6146,1],[6207,2],[6291,2],[6471,2],[6514,3],[6518,2],[6539,1],[6549,1],[6551,1],[6645,2],[6648,1],[6705,3],[6709,2],[6720,1],[6746,2],[6825,1],[6827,1],[6869,1],[6883,1],[6885,2],[6984,2],[7058,2],[7143,2],[7276,2],[7450,2],[7493,2],[7503,2],[7510,1],[7512,2],[7515,2],[7531,1],[7533,1],[7543,2],[7638,1],[7645,2],[7736,1],[7748,2],[7827,2],[7835,1],[7837,1],[7853,1],[7874,2],[7946,2],[8065,1],[8120,1],[8154,1],[8156,2],[8258,1],[8286,1],[8298,1],[8354,2],[8411,1],[8465,2],[8570,1],[8624,2],[8751,1],[8805,2],[8848,2],[8865,1],[8901,1],[8903,1],[8917,1],[8942,1],[8965,1],[8998,2],[9010,1],[9035,1],[9042,1],[9066,1],[9085,1],[9108,2],[9124,1],[9164,2],[9184,1],[9210,1],[9381,1],[9427,1],[9463,1],[9520,1],[9554,1],[9659,1],[9692,1],[9820,1],[9854,1],[9896,1],[9898,1],[10022,1],[10102,1],[10104,1],[10162,1],[10169,1],[10256,1],[10267,1],[10307,1],[10326,1],[10626,1],[10889,1],[10933,1],[10935,1],[11026,1],[11174,1],[11215,1],[11230,2],[11272,1],[11284,2],[11319,1],[11342,2],[11398,1],[11430,2]]},"355":{"position":[[371,1],[418,1],[420,1],[437,2],[440,1],[475,1],[488,1],[498,2],[501,2],[514,1],[524,2],[527,1],[529,2],[544,1],[559,1],[572,1],[605,1],[607,1],[624,1],[626,1],[628,2],[641,1],[674,1],[676,1],[693,2],[696,1],[735,1],[737,1],[739,1],[741,1],[743,1],[745,2],[748,1],[779,1],[791,1],[801,2],[804,1],[806,2],[821,1],[836,1],[848,1],[881,1],[883,1],[900,1],[902,1],[904,1],[906,1],[908,1],[910,1],[912,1],[914,1]]},"357":{"position":[[474,1],[521,1],[523,1],[540,2],[543,1],[578,1],[591,1],[601,2],[604,2],[617,1],[633,1],[643,1],[653,2],[656,2],[671,1],[692,1],[716,1],[718,1],[720,1],[722,1],[724,2],[739,1],[754,1],[767,1],[800,1],[802,1],[819,1],[821,1],[823,2],[836,1],[869,1],[871,1],[888,2],[891,1],[930,1],[932,1],[934,1],[936,1],[938,1],[940,2],[943,1],[974,1],[986,1],[996,2],[999,1],[1001,2],[1016,1],[1031,1],[1043,1],[1076,1],[1078,1],[1095,1],[1097,1],[1099,1],[1101,1],[1103,1],[1105,1],[1107,1],[1109,1]]},"359":{"position":[[414,2],[486,2],[510,1],[526,1],[528,1],[555,2],[655,1],[716,2],[800,2],[980,2],[1023,3],[1059,1],[1061,2],[1115,1],[1187,2],[1190,2],[1193,1],[1249,3],[1272,2],[1351,1],[1353,1],[1395,1],[1409,1],[1411,2],[1510,2],[1584,2],[1669,2],[1802,2],[1976,2],[2019,2],[2029,2],[2036,1],[2038,2],[2041,2],[2057,1],[2059,1],[2069,2],[2164,1],[2171,2],[2231,1],[2233,2],[2413,2],[2416,1],[2418,1],[2430,2],[2523,2],[2530,1],[2532,2],[2535,2],[2551,1],[2572,2],[2644,2],[2763,1],[2818,1],[2852,1],[2854,2],[2956,1],[2984,1],[2996,1],[3052,2],[3109,1],[3163,2],[3268,1],[3322,2],[3449,1],[3503,2],[3546,2],[3563,1],[3599,1],[3601,1],[3615,1],[3646,1],[3669,1],[3702,2],[3714,1],[3741,1],[3750,1],[3779,1],[3781,2],[3841,1],[3848,1],[3872,1],[3892,1],[3914,1],[3916,2],[3919,2],[3935,1],[3994,1],[4165,1],[4211,1],[4247,1],[4304,1],[4338,1],[4443,1],[4476,1],[4604,1],[4638,1],[4680,1],[4682,1],[4806,1],[4886,1],[4888,1],[4946,1],[4953,1],[4960,1],[5004,1],[5123,3],[5127,2],[5130,2],[5133,1],[5144,1],[5418,1],[5462,1],[5464,1],[5555,1],[5572,1],[5587,1],[5662,2],[6027,2],[6081,1],[6154,1],[6156,2],[6590,2],[6662,2],[6686,1],[6702,1],[6704,1],[6731,2],[6831,1],[6892,2],[6976,2],[7156,2],[7199,3],[7203,2],[7224,1],[7234,1],[7236,1],[7330,2],[7333,1],[7390,3],[7394,2],[7405,1],[7432,2],[7511,1],[7513,1],[7555,1],[7569,1],[7571,2],[7670,2],[7744,2],[7829,2],[7962,2],[8136,2],[8179,2],[8189,2],[8196,1],[8198,2],[8201,2],[8217,1],[8219,1],[8229,2],[8324,1],[8331,2],[8422,1],[8434,2],[8513,2],[8521,1],[8523,1],[8540,1],[8561,2],[8633,2],[8752,1],[8807,1],[8841,1],[8843,2],[8945,1],[8973,1],[8985,1],[9041,2],[9098,1],[9152,2],[9257,1],[9311,2],[9438,1],[9492,2],[9535,2],[9552,1],[9588,1],[9590,1],[9604,1],[9629,1],[9652,1],[9685,2],[9697,1],[9722,1],[9729,1],[9753,1],[9772,1],[9795,2],[9811,1],[9851,2],[9871,1],[9898,1],[10069,1],[10115,1],[10151,1],[10208,1],[10242,1],[10347,1],[10380,1],[10508,1],[10542,1],[10584,1],[10586,1],[10710,1],[10790,1],[10792,1],[10850,1],[10857,1],[10944,1],[10955,1],[10995,1],[11014,1],[11315,1],[11579,1],[11623,1],[11625,1],[11716,1],[11864,1],[11906,1],[11921,2],[11963,1],[11975,2],[12010,1],[12033,2],[12089,1],[12121,2],[12404,2],[12476,2],[12500,1],[12516,1],[12518,1],[12545,2],[12645,1],[12706,2],[12790,2],[12970,2],[13013,3],[13017,2],[13038,1],[13048,1],[13050,1],[13145,2],[13148,1],[13205,3],[13209,2],[13220,1],[13246,2],[13325,1],[13327,1],[13369,1],[13383,1],[13385,2],[13484,2],[13558,2],[13643,2],[13776,2],[13950,2],[13993,2],[14003,2],[14010,1],[14012,2],[14015,2],[14031,1],[14033,1],[14043,2],[14138,1],[14145,2],[14237,1],[14249,2],[14328,2],[14336,1],[14338,1],[14354,1],[14375,2],[14447,2],[14566,1],[14621,1],[14655,1],[14657,2],[14759,1],[14787,1],[14799,1],[14855,2],[14912,1],[14966,2],[15071,1],[15125,2],[15252,1],[15306,2],[15349,2],[15366,1],[15402,1],[15404,1],[15418,1],[15443,1],[15466,1],[15499,2],[15511,1],[15536,1],[15543,1],[15568,1],[15587,1],[15610,2],[15626,1],[15666,2],[15686,1],[15712,1],[15883,1],[15929,1],[15965,1],[16022,1],[16056,1],[16161,1],[16194,1],[16322,1],[16356,1],[16398,1],[16400,1],[16524,1],[16604,1],[16606,1],[16664,1],[16671,1],[16759,1],[16770,1],[16810,1],[16829,1],[17130,1],[17393,1],[17437,1],[17439,1],[17530,1],[17679,1],[17720,1],[17736,2],[17779,1],[17791,2],[17826,1],[17849,2],[17905,1],[17937,2]]},"365":{"position":[[485,1],[532,1],[534,1],[551,2],[554,1],[589,1],[601,1],[611,2],[614,2],[627,1],[637,2],[640,1],[642,2],[657,1],[672,1],[684,1],[717,1],[719,1],[736,1],[738,1],[740,2],[753,1],[786,1],[788,1],[805,1],[807,1],[809,1],[811,1],[813,1],[815,1],[817,1],[819,1],[934,1],[936,1],[1020,2],[1023,1],[1190,1]]},"367":{"position":[[93,1]]},"373":{"position":[[280,1],[327,1],[329,1],[346,2],[349,1],[384,1],[396,1],[407,1],[418,1],[420,1],[430,2],[433,2],[436,1],[457,1],[480,1],[482,1],[484,1],[486,1],[488,2],[501,1],[511,2],[514,1],[516,2],[531,1],[546,1],[558,1],[591,1],[593,1],[610,1],[612,1],[614,2],[627,1],[660,1],[662,1],[679,1],[681,1],[683,1],[685,1],[687,1],[689,1],[691,1],[693,1]]},"375":{"position":[[329,2],[401,2],[425,1],[441,1],[443,1],[470,2],[570,1],[631,2],[715,2],[895,2],[938,3],[942,2],[963,1],[973,1],[975,1],[1077,2],[1080,1],[1137,3],[1141,2],[1152,1],[1178,2],[1257,1],[1259,1],[1301,1],[1315,1],[1317,2],[1416,2],[1490,2],[1575,2],[1708,2],[1882,2],[1925,2],[1935,2],[1942,1],[1944,2],[1947,2],[1963,1],[1965,1],[1975,2],[2070,1],[2077,2],[2176,1],[2188,2],[2267,2],[2275,1],[2277,1],[2293,1],[2314,2],[2386,2],[2505,1],[2560,1],[2594,1],[2596,2],[2698,1],[2726,1],[2738,1],[2794,2],[2851,1],[2905,2],[3010,1],[3064,2],[3191,1],[3245,2],[3288,2],[3305,1],[3341,1],[3343,1],[3357,1],[3382,1],[3405,1],[3438,2],[3450,1],[3475,1],[3482,1],[3505,1],[3524,1],[3556,2],[3572,1],[3612,2],[3632,1],[3658,1],[3829,1],[3875,1],[3911,1],[3968,1],[4002,1],[4107,1],[4140,1],[4268,1],[4302,1],[4344,1],[4346,1],[4470,1],[4550,1],[4552,1],[4610,1],[4617,1],[4712,1],[4723,1],[4763,1],[4782,1],[5090,1],[5353,1],[5397,1],[5399,1],[5490,1],[5646,1],[5687,1],[5701,2],[5742,1],[5754,2],[5789,1],[5821,2],[5886,1],[5918,2]]},"382":{"position":[[178,1],[225,1],[227,1],[244,2],[247,1],[277,1],[289,1],[299,2],[302,1],[304,2],[319,1],[334,1],[346,1],[379,1],[381,1],[398,1],[400,1],[402,1],[404,1],[406,1],[408,2],[411,1],[446,1],[458,1],[468,2],[471,1],[473,2],[488,1],[503,1],[515,1],[548,1],[550,1],[567,2],[570,1],[608,1],[610,1],[612,1],[614,1],[616,1],[618,1],[620,1],[622,1],[683,1],[685,2],[750,1],[829,2],[832,2],[888,1],[954,2],[957,1],[1274,2],[1346,2],[1370,1],[1386,1],[1388,1],[1415,2],[1515,1],[1576,2],[1660,2],[1840,2],[1883,3],[1887,2],[1908,1],[1918,1],[1920,1],[2012,2],[2015,1],[2072,3],[2076,2],[2087,1],[2113,2],[2192,1],[2194,1],[2236,1],[2250,1],[2252,2],[2351,2],[2425,2],[2510,2],[2643,2],[2817,2],[2860,2],[2870,2],[2877,1],[2879,2],[2882,2],[2898,1],[2900,1],[2910,2],[3005,1],[3012,2],[3101,1],[3113,2],[3192,2],[3200,1],[3202,1],[3218,1],[3239,2],[3311,2],[3430,1],[3485,1],[3519,1],[3521,2],[3623,1],[3651,1],[3663,1],[3719,2],[3776,1],[3830,2],[3935,1],[3989,2],[4116,1],[4170,2],[4213,2],[4230,1],[4266,1],[4268,1],[4282,1],[4307,1],[4330,1],[4363,2],[4375,1],[4400,1],[4407,1],[4431,1],[4450,1],[4471,2],[4487,1],[4527,2],[4547,1],[4573,1],[4744,1],[4790,1],[4826,1],[4883,1],[4917,1],[5022,1],[5055,1],[5183,1],[5217,1],[5259,1],[5261,1],[5385,1],[5465,1],[5467,1],[5525,1],[5532,1],[5617,1],[5628,1],[5668,1],[5687,1],[5985,1],[6248,1],[6292,1],[6294,1],[6385,1],[6531,1],[6572,1],[6587,2],[6629,1],[6641,2],[6676,1],[6697,2],[6751,1],[6783,2]]},"384":{"position":[[181,1],[228,1],[230,1],[247,2],[250,1],[285,1],[297,1],[307,2],[310,2],[323,1],[334,1],[345,1],[347,1],[357,2],[360,2],[363,1],[384,1],[407,1],[409,1],[411,1],[413,1],[415,1],[417,2],[432,1],[447,1],[459,1],[492,1],[494,1],[511,2],[514,1],[552,1],[554,1],[556,2],[569,1],[602,1],[604,1],[621,2],[624,1],[662,1],[664,1],[666,1],[668,1],[670,1],[672,1],[674,1],[676,1],[911,1],[921,1],[931,1],[976,1],[987,1],[989,1],[1033,1],[1044,1],[1068,1],[1070,1],[1072,2],[1075,1],[1119,1],[1133,1],[1171,1],[1173,1],[1175,1],[1177,1],[1179,1],[1181,1],[1183,1],[1185,1]]},"392":{"position":[[605,1],[652,1],[654,1],[671,2],[674,1],[715,1],[727,1],[738,1],[749,1],[751,1],[761,2],[764,2],[767,1],[788,1],[811,1],[813,1],[815,1],[817,1],[819,2],[832,1],[842,2],[845,1],[847,2],[862,1],[877,1],[889,1],[922,1],[924,1],[941,1],[943,1],[945,2],[958,1],[991,1],[993,1],[1010,1],[1012,1],[1014,1],[1016,1],[1018,1],[1020,1],[1022,1],[1024,1],[1199,1],[1381,1],[1392,1]]},"396":{"position":[[93,1]]},"398":{"position":[[139,1]]},"404":{"position":[[459,1],[506,1],[508,1],[525,2],[528,1],[569,1],[581,1],[592,1],[603,1],[605,1],[615,2],[618,2],[621,1],[642,1],[665,1],[667,1],[669,1],[671,1],[673,2],[686,1],[696,2],[699,1],[701,2],[716,1],[731,1],[743,1],[776,1],[778,1],[795,2],[798,1],[839,1],[841,1],[843,2],[856,1],[889,1],[891,1],[908,2],[911,1],[952,1],[954,1],[956,1],[958,1],[960,1],[962,2],[965,1],[996,1],[1010,1],[1020,2],[1023,1],[1025,2],[1040,1],[1055,1],[1069,1],[1102,1],[1104,1],[1121,1],[1123,1],[1125,1],[1127,1],[1129,1],[1131,1],[1133,1],[1135,1]]},"406":{"position":[[277,2],[349,2],[373,1],[389,1],[391,1],[418,2],[518,1],[579,2],[663,2],[843,2],[886,3],[922,1],[924,2],[967,1],[1041,2],[1083,1],[1156,2],[1159,2],[1162,1],[1218,3],[1241,2],[1320,1],[1322,1],[1364,1],[1378,1],[1380,2],[1479,2],[1553,2],[1638,2],[1771,2],[1945,2],[1988,2],[1998,2],[2005,1],[2007,2],[2010,2],[2026,1],[2028,1],[2038,2],[2133,1],[2140,2],[2200,1],[2202,2],[2373,2],[2376,1],[2378,2],[2547,2],[2550,1],[2552,1],[2564,2],[2657,2],[2664,1],[2666,2],[2669,2],[2685,1],[2706,2],[2778,2],[2897,1],[2952,1],[2986,1],[2988,2],[3090,1],[3118,1],[3130,1],[3186,2],[3243,1],[3297,2],[3402,1],[3456,2],[3583,1],[3637,2],[3680,2],[3697,1],[3733,1],[3735,1],[3749,1],[3780,1],[3803,1],[3836,2],[3848,1],[3875,1],[3884,1],[3913,1],[3915,2],[3964,1],[3971,1],[3995,1],[4016,1],[4039,2],[4042,2],[4090,1],[4097,1],[4121,1],[4142,1],[4164,1],[4166,2],[4169,2],[4185,1],[4244,1],[4415,1],[4461,1],[4497,1],[4554,1],[4588,1],[4693,1],[4726,1],[4854,1],[4888,1],[4930,1],[4932,1],[5056,1],[5136,1],[5138,1],[5196,1],[5203,1],[5210,1],[5254,1],[5364,2],[5380,1],[5488,3],[5492,2],[5495,2],[5498,1],[5509,1],[5783,1],[5827,1],[5829,1],[5920,1],[5937,1],[5952,1],[6101,2],[6587,2],[6630,1],[6705,2],[6708,2],[6750,1],[6824,1],[6826,2],[7031,2],[7103,2],[7127,1],[7143,1],[7145,1],[7172,2],[7272,1],[7333,2],[7417,2],[7597,2],[7640,3],[7644,2],[7665,1],[7675,1],[7677,1],[7774,2],[7777,1],[7834,3],[7838,2],[7849,1],[7875,2],[7954,1],[7956,1],[7998,1],[8012,1],[8014,2],[8113,2],[8187,2],[8272,2],[8405,2],[8579,2],[8622,2],[8632,2],[8639,1],[8641,2],[8644,2],[8660,1],[8662,1],[8672,2],[8767,1],[8774,2],[8868,1],[8880,2],[8959,2],[8967,1],[8969,1],[8985,1],[9006,2],[9078,2],[9197,1],[9252,1],[9286,1],[9288,2],[9390,1],[9418,1],[9430,1],[9486,2],[9543,1],[9597,2],[9702,1],[9756,2],[9883,1],[9937,2],[9980,2],[9997,1],[10033,1],[10035,1],[10049,1],[10074,1],[10097,1],[10130,2],[10142,1],[10167,1],[10174,1],[10198,1],[10219,1],[10243,2],[10259,1],[10299,2],[10319,1],[10345,1],[10516,1],[10562,1],[10598,1],[10655,1],[10689,1],[10794,1],[10827,1],[10955,1],[10989,1],[11031,1],[11033,1],[11157,1],[11237,1],[11239,1],[11297,1],[11304,1],[11394,1],[11405,1],[11445,1],[11464,1],[11767,1],[12030,1],[12074,1],[12076,1],[12167,1],[12318,1],[12359,1],[12374,2],[12416,1],[12430,2],[12467,1],[12491,2],[12548,1],[12580,2]]},"408":{"position":[[179,2],[251,2],[275,1],[291,1],[293,1],[320,2],[420,1],[481,2],[565,2],[745,2],[788,3],[824,1],[826,2],[905,1],[997,2],[1077,1],[1168,2],[1171,2],[1174,1],[1230,3],[1253,2],[1332,1],[1334,1],[1376,1],[1390,1],[1392,2],[1491,2],[1565,2],[1650,2],[1783,2],[1957,2],[2000,2],[2010,2],[2017,1],[2019,2],[2022,2],[2038,1],[2040,1],[2050,2],[2145,1],[2152,2],[2212,1],[2214,2],[2439,2],[2442,1],[2444,2],[2669,2],[2672,1],[2674,1],[2686,2],[2779,2],[2786,1],[2788,2],[2791,2],[2807,1],[2828,2],[2900,2],[3019,1],[3074,1],[3108,1],[3110,2],[3212,1],[3240,1],[3252,1],[3308,2],[3365,1],[3419,2],[3524,1],[3578,2],[3705,1],[3759,2],[3802,2],[3819,1],[3855,1],[3857,1],[3871,1],[3902,1],[3925,1],[3958,2],[3970,1],[3997,1],[4006,1],[4035,1],[4037,2],[4122,1],[4129,1],[4171,1],[4190,1],[4215,2],[4218,2],[4304,1],[4311,1],[4352,1],[4371,1],[4396,1],[4398,2],[4401,2],[4417,1],[4476,1],[4647,1],[4693,1],[4729,1],[4786,1],[4820,1],[4925,1],[4958,1],[5086,1],[5120,1],[5162,1],[5164,1],[5288,1],[5368,1],[5370,1],[5428,1],[5435,1],[5442,1],[5486,1],[5650,2],[5666,1],[5830,3],[5834,2],[5837,2],[5840,1],[5851,1],[6125,1],[6169,1],[6171,1],[6262,1],[6279,1],[6294,1],[6479,2],[7001,2],[7080,1],[7173,2],[7176,2],[7256,1],[7348,1],[7350,2]]},"410":{"position":[[125,2],[197,2],[221,1],[237,1],[239,1],[266,2],[366,1],[427,2],[511,2],[691,2],[734,3],[738,2],[759,1],[769,1],[771,1],[868,2],[871,1],[928,3],[932,2],[943,1],[969,2],[1048,1],[1050,1],[1092,1],[1106,1],[1108,2],[1207,2],[1281,2],[1366,2],[1499,2],[1673,2],[1716,2],[1726,2],[1733,1],[1735,2],[1738,2],[1754,1],[1756,1],[1766,2],[1861,1],[1868,2],[1962,1],[1974,2],[2053,2],[2061,1],[2063,1],[2079,1],[2100,2],[2172,2],[2291,1],[2346,1],[2380,1],[2382,2],[2484,1],[2512,1],[2524,1],[2580,2],[2637,1],[2691,2],[2796,1],[2850,2],[2977,1],[3031,2],[3074,2],[3091,1],[3127,1],[3129,1],[3143,1],[3168,1],[3191,1],[3224,2],[3236,1],[3261,1],[3268,1],[3292,1],[3311,1],[3337,2],[3353,1],[3393,2],[3413,1],[3439,1],[3610,1],[3656,1],[3692,1],[3749,1],[3783,1],[3888,1],[3921,1],[4049,1],[4083,1],[4125,1],[4127,1],[4251,1],[4331,1],[4333,1],[4391,1],[4398,1],[4488,1],[4499,1],[4539,1],[4558,1],[4861,1],[5124,1],[5168,1],[5170,1],[5261,1],[5412,1],[5453,1],[5468,2],[5510,1],[5522,2],[5557,1],[5583,2],[5642,1],[5674,2]]},"420":{"position":[[1269,3]]},"422":{"position":[[284,3],[2135,3],[2620,1]]},"426":{"position":[[1341,1],[1408,1],[2547,1],[4057,1],[4121,1],[4738,1],[4803,1],[5064,1],[5066,1],[5150,2],[5153,1],[6360,1],[6427,1],[6429,1],[6495,1]]},"428":{"position":[[1647,1],[1761,1],[1878,1],[2019,1],[2147,1],[2286,1]]},"440":{"position":[[385,1],[432,1],[434,1],[451,2],[454,1],[489,1],[501,1],[511,2],[514,2],[527,1],[537,2],[540,1],[542,2],[557,1],[572,1],[584,1],[617,1],[619,1],[636,1],[638,1],[640,2],[653,1],[686,1],[688,1],[705,1],[707,1],[709,1],[711,1],[713,1],[715,1],[717,1],[719,1]]},"446":{"position":[[208,2],[280,2],[304,1],[320,1],[322,1],[349,2],[449,1],[510,2],[594,2],[774,2],[817,3],[853,1],[855,1],[934,2],[937,2],[940,1],[996,3],[1019,2],[1098,1],[1100,1],[1142,1],[1156,1],[1158,2],[1257,2],[1331,2],[1416,2],[1549,2],[1723,2],[1766,2],[1776,2],[1783,1],[1785,2],[1788,2],[1804,1],[1806,1],[1816,2],[1911,1],[1918,2],[1978,1],[2113,2],[2116,1],[2118,1],[2130,2],[2223,2],[2230,1],[2232,2],[2235,2],[2251,1],[2272,2],[2344,2],[2463,1],[2518,1],[2552,1],[2554,2],[2656,1],[2684,1],[2696,1],[2752,2],[2809,1],[2863,2],[2968,1],[3022,2],[3149,1],[3203,2],[3246,2],[3263,1],[3299,1],[3301,1],[3315,1],[3346,1],[3369,1],[3402,2],[3414,1],[3441,1],[3450,1],[3479,1],[3487,1],[3494,1],[3517,1],[3536,1],[3567,1],[3569,2],[3572,2],[3588,1],[3647,1],[3818,1],[3864,1],[3900,1],[3957,1],[3991,1],[4096,1],[4129,1],[4257,1],[4291,1],[4333,1],[4335,1],[4459,1],[4539,1],[4541,1],[4599,1],[4606,1],[4613,1],[4730,3],[4734,2],[4737,2],[4740,1],[4751,1],[5025,1],[5069,1],[5071,1],[5162,1],[5179,1],[5194,1],[5276,2],[5648,1],[5728,1],[5730,2]]},"448":{"position":[[229,2],[301,2],[325,1],[341,1],[343,1],[370,2],[470,1],[531,2],[615,2],[795,2],[838,3],[842,2],[863,1],[873,1],[875,1],[977,2],[980,1],[1037,3],[1041,2],[1052,1],[1078,2],[1157,1],[1159,1],[1201,1],[1215,1],[1217,2],[1316,2],[1390,2],[1475,2],[1608,2],[1782,2],[1825,2],[1835,2],[1842,1],[1844,2],[1847,2],[1863,1],[1865,1],[1875,2],[1970,1],[1977,2],[2076,1],[2088,2],[2167,2],[2175,1],[2177,1],[2193,1],[2214,2],[2286,2],[2405,1],[2460,1],[2494,1],[2496,2],[2598,1],[2626,1],[2638,1],[2694,2],[2751,1],[2805,2],[2910,1],[2964,2],[3091,1],[3145,2],[3188,2],[3205,1],[3241,1],[3243,1],[3257,1],[3282,1],[3305,1],[3338,2],[3350,1],[3375,1],[3382,1],[3405,1],[3424,1],[3456,2],[3472,1],[3512,2],[3532,1],[3558,1],[3729,1],[3775,1],[3811,1],[3868,1],[3902,1],[4007,1],[4040,1],[4168,1],[4202,1],[4244,1],[4246,1],[4370,1],[4450,1],[4452,1],[4510,1],[4517,1],[4612,1],[4623,1],[4663,1],[4682,1],[4990,1],[5253,1],[5297,1],[5299,1],[5390,1],[5546,1],[5587,1],[5601,2],[5642,1],[5654,2],[5689,1],[5721,2],[5786,1],[5818,2],[6066,2],[6138,2],[6162,1],[6178,1],[6180,1],[6207,2],[6307,1],[6368,2],[6452,2],[6632,2],[6675,3],[6679,2],[6700,1],[6710,1],[6712,1],[6814,2],[6817,1],[6874,3],[6878,2],[6889,1],[6916,2],[6995,1],[6997,1],[7039,1],[7053,1],[7055,2],[7154,2],[7228,2],[7313,2],[7446,2],[7620,2],[7663,2],[7673,2],[7680,1],[7682,2],[7685,2],[7701,1],[7703,1],[7713,2],[7808,1],[7815,2],[7914,1],[7926,2],[8005,2],[8013,1],[8015,1],[8032,1],[8053,2],[8125,2],[8244,1],[8299,1],[8333,1],[8335,2],[8437,1],[8465,1],[8477,1],[8533,2],[8590,1],[8644,2],[8749,1],[8803,2],[8930,1],[8984,2],[9027,2],[9044,1],[9080,1],[9082,1],[9096,1],[9121,1],[9144,1],[9177,2],[9189,1],[9214,1],[9221,1],[9244,1],[9263,1],[9295,2],[9311,1],[9351,2],[9371,1],[9398,1],[9569,1],[9615,1],[9651,1],[9708,1],[9742,1],[9847,1],[9880,1],[10008,1],[10042,1],[10084,1],[10086,1],[10210,1],[10290,1],[10292,1],[10350,1],[10357,1],[10452,1],[10463,1],[10503,1],[10522,1],[10831,1],[11095,1],[11139,1],[11141,1],[11232,1],[11388,1],[11430,1],[11444,2],[11485,1],[11497,2],[11532,1],[11564,2],[11629,1],[11661,2]]},"452":{"position":[[897,2]]},"456":{"position":[[373,1],[375,2],[413,1],[482,2],[485,2],[532,1],[610,2],[613,2],[672,1],[752,2],[755,2],[795,1],[870,2],[873,1],[1079,1],[1081,2],[1140,1],[1217,2],[1220,1],[1797,1],[1807,1],[1833,2],[1856,1],[1858,1],[1889,2],[1892,2],[1895,1],[1927,1],[1939,1],[1949,2],[1952,1],[1954,2],[1969,1],[1984,1],[1996,1],[2029,1],[2031,1],[2048,1],[2050,1],[2052,1],[2054,1],[2056,1],[2058,2],[2061,1],[2094,1],[2106,1],[2116,2],[2119,2],[2132,1],[2143,1],[2154,1],[2156,1],[2166,2],[2169,2],[2172,1],[2192,1],[2206,1],[2218,3],[2243,2],[2265,1],[2277,3],[2302,1],[2304,1],[2306,1],[2308,1],[2310,1],[2312,1],[2314,2],[2329,1],[2344,1],[2356,1],[2389,1],[2391,1],[2410,1],[2412,1],[2414,2],[2427,1],[2460,1],[2462,1],[2479,1],[2481,1],[2483,1],[2485,1],[2487,1],[2489,2],[2492,1],[2527,1],[2539,1],[2549,2],[2552,2],[2565,1],[2575,2],[2578,2],[2593,1],[2604,1],[2615,1],[2617,1],[2638,1],[2650,3],[2675,1],[2677,2],[2680,1],[2700,1],[2714,1],[2726,3],[2751,2],[2773,1],[2785,3],[2810,1],[2812,1],[2814,1],[2816,1],[2818,1],[2820,1],[2822,2],[2837,1],[2852,1],[2864,1],[2897,1],[2899,1],[2918,1],[2920,1],[2922,2],[2935,1],[2968,1],[2970,1],[2987,1],[2989,1],[2991,2],[3006,1],[3039,2],[3042,1],[3044,1],[3046,1],[3048,1],[3050,2],[3077,1]]},"458":{"position":[[104,1],[106,2],[148,1],[212,2],[215,1],[505,1],[527,1],[529,1],[560,2],[563,1],[565,1],[567,1],[617,1],[619,2],[666,1],[735,2],[738,1]]},"460":{"position":[[92,1],[94,1],[163,2],[166,1],[244,2],[247,1],[322,2],[325,1],[447,1],[449,1],[529,2],[532,1],[1645,1],[1667,1],[1669,1],[1700,2],[1703,2],[1706,1],[1738,1],[1750,1],[1760,2],[1763,1],[1765,2],[1780,1],[1795,1],[1807,1],[1840,1],[1842,1],[1859,1],[1861,1],[1863,1],[1865,1],[1867,1],[1869,2],[1872,1],[1905,1],[1917,1],[1927,2],[1930,2],[1943,1],[1954,1],[1965,1],[1967,1],[1977,2],[1980,2],[1983,1],[2003,1],[2017,1],[2029,3],[2054,2],[2076,1],[2088,3],[2113,1],[2115,1],[2117,1],[2119,1],[2121,1],[2123,1],[2125,2],[2140,1],[2155,1],[2167,1],[2200,1],[2202,1],[2221,1],[2223,1],[2225,2],[2238,1],[2271,1],[2273,1],[2290,2],[2293,1],[2333,1],[2335,1],[2337,1],[2339,1],[2341,1],[2343,2],[2346,1],[2381,1],[2393,1],[2403,2],[2406,2],[2419,1],[2429,2],[2432,2],[2447,1],[2458,1],[2469,1],[2471,1],[2492,1],[2504,3],[2529,1],[2531,2],[2534,1],[2554,1],[2568,1],[2580,3],[2605,2],[2627,1],[2639,3],[2664,1],[2666,1],[2668,1],[2670,1],[2672,1],[2674,1],[2676,2],[2691,1],[2706,1],[2718,1],[2751,1],[2753,1],[2772,1],[2774,1],[2776,2],[2789,1],[2822,1],[2824,1],[2841,2],[2844,1],[2884,1],[2886,1],[2888,2],[2903,1],[2936,2],[2939,1],[2941,1],[2943,1],[2945,1],[2947,2],[2974,1],[3094,1],[3096,2],[3162,1],[3242,2],[3245,1]]},"462":{"position":[[144,1],[146,2],[197,1],[207,4],[264,2],[267,1],[853,1],[875,1],[877,1],[908,2],[911,2],[914,1],[949,1],[961,1],[971,2],[974,1],[976,2],[991,1],[1006,1],[1018,1],[1051,1],[1053,1],[1070,2],[1073,1],[1103,2],[1106,1],[1108,1],[1110,1],[1112,1],[1114,1],[1116,1],[1118,2],[1145,1],[1224,1],[1226,2],[1294,1],[1366,2],[1369,1],[1838,2],[1900,1],[1902,1],[2098,1],[2100,4],[2169,1],[2171,2],[2239,1],[2311,2],[2314,1],[2338,1],[2713,1],[2762,1],[2764,2],[2943,1],[2945,2],[3011,2],[3258,1]]},"466":{"position":[[1012,2],[1249,1],[1251,1],[1332,2],[1335,2],[1338,1],[1394,3],[1406,2],[1501,1],[1508,2],[1568,1],[1705,2],[1708,1],[1710,1],[1722,2],[1815,2],[1822,1],[1824,2],[1827,2],[1843,1],[1857,1],[1888,1],[1911,1],[1944,2],[1956,1],[1983,1],[1992,1],[2021,1],[2029,1],[2036,1],[2072,1],[2091,1],[2111,1],[2113,2],[2116,2],[2132,1],[2180,1],[2182,1],[2240,1],[2247,1],[2254,1],[2373,3],[2377,2],[2380,2],[2383,1],[2394,1],[2490,1],[2534,1],[2536,1],[2627,1],[2644,1],[2659,1],[2743,2],[2939,1],[3021,1],[3023,2]]},"474":{"position":[[878,1],[925,1],[927,1],[944,2],[947,1],[982,1],[993,1],[1003,2],[1006,2],[1019,1],[1029,2],[1032,2],[1048,1],[1069,1],[1081,3],[1106,1],[1108,1],[1110,2],[1125,1],[1140,1],[1151,1],[1184,1],[1186,1],[1211,1],[1213,1],[1215,2],[1228,1],[1261,1],[1263,1],[1280,1],[1282,1],[1284,1],[1286,1],[1288,1],[1290,2],[1293,1],[1332,1],[1344,1],[1354,2],[1357,1],[1359,2],[1374,1],[1389,1],[1401,1],[1434,1],[1436,1],[1453,1],[1455,1],[1457,1],[1459,1],[1461,1],[1463,1],[1465,1],[1467,1],[1582,1],[1584,2],[1638,1],[1720,2],[1723,2],[1769,1],[1846,2],[1849,2],[1894,1],[1970,2],[1973,2],[2018,1],[2094,2],[2097,2],[2141,1],[2216,2],[2219,1],[2526,1],[2676,1]]},"476":{"position":[[114,1]]},"478":{"position":[[116,1]]},"482":{"position":[[295,2],[367,2],[391,1],[407,1],[409,1],[436,2],[536,1],[597,2],[681,2],[861,2],[904,3],[908,2],[929,1],[939,1],[941,1],[1039,2],[1042,1],[1099,3],[1103,2],[1114,1],[1140,2],[1219,1],[1221,1],[1263,1],[1277,1],[1279,2],[1378,2],[1452,2],[1537,2],[1670,2],[1844,2],[1887,2],[1897,2],[1904,1],[1906,2],[1909,2],[1925,1],[1927,1],[1937,2],[2032,1],[2039,2],[2134,1],[2146,2],[2225,2],[2233,1],[2235,1],[2251,1],[2272,2],[2344,2],[2463,1],[2518,1],[2552,1],[2554,2],[2656,1],[2684,1],[2696,1],[2752,2],[2809,1],[2863,2],[2968,1],[3022,2],[3149,1],[3203,2],[3246,2],[3263,1],[3299,1],[3301,1],[3315,1],[3340,1],[3363,1],[3396,2],[3408,1],[3433,1],[3440,1],[3465,1],[3487,1],[3510,2],[3526,1],[3566,2],[3586,1],[3612,1],[3783,1],[3829,1],[3865,1],[3922,1],[3956,1],[4061,1],[4094,1],[4222,1],[4256,1],[4298,1],[4300,1],[4424,1],[4504,1],[4506,1],[4564,1],[4571,1],[4662,1],[4673,1],[4713,1],[4732,1],[5036,1],[5299,1],[5343,1],[5345,1],[5436,1],[5588,1],[5629,1],[5645,2],[5688,1],[5703,2],[5741,1],[5764,2],[5820,1],[5852,2],[5929,2],[6001,2],[6025,1],[6041,1],[6043,1],[6070,2],[6170,1],[6231,2],[6315,2],[6495,2],[6538,3],[6542,2],[6563,1],[6573,1],[6575,1],[6672,2],[6675,1],[6732,3],[6736,2],[6747,1],[6773,2],[6852,1],[6854,1],[6896,1],[6910,1],[6912,2],[7011,2],[7085,2],[7170,2],[7303,2],[7477,2],[7520,2],[7530,2],[7537,1],[7539,2],[7542,2],[7558,1],[7560,1],[7570,2],[7665,1],[7672,2],[7766,1],[7778,2],[7857,2],[7865,1],[7867,1],[7883,1],[7904,2],[7976,2],[8095,1],[8150,1],[8184,1],[8186,2],[8288,1],[8316,1],[8328,1],[8384,2],[8441,1],[8495,2],[8600,1],[8654,2],[8781,1],[8835,2],[8878,2],[8895,1],[8931,1],[8933,1],[8947,1],[8972,1],[8995,1],[9028,2],[9040,1],[9065,1],[9072,1],[9096,1],[9118,1],[9141,2],[9157,1],[9197,2],[9217,1],[9243,1],[9414,1],[9460,1],[9496,1],[9553,1],[9587,1],[9692,1],[9725,1],[9853,1],[9887,1],[9929,1],[9931,1],[10055,1],[10135,1],[10137,1],[10195,1],[10202,1],[10292,1],[10303,1],[10343,1],[10362,1],[10665,1],[10928,1],[10972,1],[10974,1],[11065,1],[11216,1],[11257,1],[11272,2],[11314,1],[11329,2],[11367,1],[11390,2],[11446,1],[11478,2]]},"484":{"position":[[409,1],[456,1],[458,1],[475,2],[478,1],[513,1],[524,1],[534,2],[537,2],[550,1],[560,2],[563,2],[579,1],[600,1],[612,3],[637,1],[639,2],[656,1],[674,1],[685,1],[687,1],[708,1],[720,3],[745,1],[747,2],[750,1],[770,1],[784,1],[796,3],[820,2],[842,1],[854,3],[879,1],[881,1],[883,1],[885,1],[887,1],[889,1],[891,2],[906,1],[921,1],[932,1],[965,1],[967,1],[992,1],[994,1],[996,2],[1009,1],[1042,1],[1044,1],[1061,1],[1063,1],[1065,1],[1067,1],[1069,1],[1071,2],[1074,1],[1113,1],[1125,1],[1135,2],[1138,1],[1140,2],[1155,1],[1170,1],[1182,1],[1215,1],[1217,1],[1234,1],[1236,1],[1238,1],[1240,1],[1242,1],[1244,1],[1246,1],[1248,1]]},"486":{"position":[[255,2],[327,2],[351,1],[367,1],[369,1],[396,2],[496,1],[557,2],[641,2],[821,2],[864,3],[868,2],[889,1],[899,1],[901,1],[1000,2],[1003,1],[1060,3],[1064,2],[1075,1],[1101,2],[1180,1],[1182,1],[1224,1],[1238,1],[1240,2],[1339,2],[1413,2],[1498,2],[1631,2],[1805,2],[1848,2],[1858,2],[1865,1],[1867,2],[1870,2],[1886,1],[1888,1],[1898,2],[1993,1],[2000,2],[2096,1],[2108,2],[2187,2],[2195,1],[2197,1],[2213,1],[2234,2],[2306,2],[2425,1],[2480,1],[2514,1],[2516,2],[2618,1],[2646,1],[2658,1],[2714,2],[2771,1],[2825,2],[2930,1],[2984,2],[3111,1],[3165,2],[3208,2],[3225,1],[3261,1],[3263,1],[3277,1],[3302,1],[3325,1],[3358,2],[3370,1],[3395,1],[3402,1],[3427,1],[3450,1],[3473,2],[3489,1],[3529,2],[3549,1],[3575,1],[3746,1],[3792,1],[3828,1],[3885,1],[3919,1],[4024,1],[4057,1],[4185,1],[4219,1],[4261,1],[4263,1],[4387,1],[4467,1],[4469,1],[4527,1],[4534,1],[4626,1],[4637,1],[4677,1],[4696,1],[5001,1],[5264,1],[5308,1],[5310,1],[5401,1],[5554,1],[5595,1],[5611,2],[5654,1],[5670,2],[5709,1],[5732,2],[5788,1],[5820,2],[6054,2],[6126,2],[6150,1],[6166,1],[6168,1],[6195,2],[6295,1],[6356,2],[6440,2],[6620,2],[6663,3],[6667,2],[6688,1],[6698,1],[6700,1],[6798,2],[6801,1],[6858,3],[6862,2],[6873,1],[6900,2],[6979,1],[6981,1],[7023,1],[7037,1],[7039,2],[7138,2],[7212,2],[7297,2],[7430,2],[7604,2],[7647,2],[7657,2],[7664,1],[7666,2],[7669,2],[7685,1],[7687,1],[7697,2],[7792,1],[7799,2],[7894,1],[7906,2],[7985,2],[7993,1],[7995,1],[8012,1],[8033,2],[8105,2],[8224,1],[8279,1],[8313,1],[8315,2],[8417,1],[8445,1],[8457,1],[8513,2],[8570,1],[8624,2],[8729,1],[8783,2],[8910,1],[8964,2],[9007,2],[9024,1],[9060,1],[9062,1],[9076,1],[9101,1],[9124,1],[9157,2],[9169,1],[9194,1],[9201,1],[9225,1],[9248,1],[9271,2],[9287,1],[9327,2],[9347,1],[9374,1],[9545,1],[9591,1],[9627,1],[9684,1],[9718,1],[9823,1],[9856,1],[9984,1],[10018,1],[10060,1],[10062,1],[10186,1],[10266,1],[10268,1],[10326,1],[10333,1],[10424,1],[10435,1],[10475,1],[10494,1],[10799,1],[11063,1],[11107,1],[11109,1],[11200,1],[11352,1],[11394,1],[11409,2],[11451,1],[11467,2],[11506,1],[11529,2],[11585,1],[11617,2]]},"492":{"position":[[454,1],[501,1],[503,1],[520,2],[523,1],[556,1],[568,1],[578,2],[581,1],[583,2],[598,1],[613,1],[625,1],[658,1],[660,1],[677,1],[679,1],[681,1],[683,1],[685,1],[687,2],[690,1],[725,1],[737,1],[747,2],[750,1],[752,2],[767,1],[782,1],[794,1],[827,1],[829,1],[846,1],[848,1],[850,1],[852,1],[854,1],[856,1],[858,1],[860,1],[1061,1]]},"494":{"position":[[134,1]]},"500":{"position":[[460,1],[507,1],[509,1],[526,2],[529,1],[562,1],[574,1],[584,2],[587,1],[589,2],[604,1],[619,1],[631,1],[664,1],[666,1],[683,1],[685,1],[687,1],[689,1],[691,1],[693,2],[696,1],[731,1],[743,1],[753,2],[756,2],[769,1],[779,2],[782,1],[784,2],[799,1],[814,1],[826,1],[859,1],[861,1],[880,1],[882,1],[884,2],[897,1],[930,1],[932,1],[949,1],[951,1],[953,1],[955,1],[957,1],[959,1],[961,1],[963,1]]},"502":{"position":[[286,1],[333,1],[335,1],[352,2],[355,1],[388,1],[400,1],[410,2],[413,1],[415,2],[430,1],[445,1],[457,1],[490,1],[492,1],[509,1],[511,1],[513,1],[515,1],[517,1],[519,2],[522,1],[557,1],[569,1],[579,2],[582,2],[595,1],[606,1],[617,1],[619,1],[629,2],[632,2],[635,1],[655,1],[669,1],[692,2],[714,1],[737,1],[739,1],[741,1],[743,1],[745,1],[747,1],[749,2],[764,1],[779,1],[791,1],[824,1],[826,1],[845,1],[847,1],[849,2],[862,1],[895,1],[897,1],[914,1],[916,1],[918,1],[920,1],[922,1],[924,1],[926,1],[928,1]]},"504":{"position":[[183,2],[255,2],[279,1],[295,1],[297,1],[324,2],[424,1],[485,2],[569,2],[749,2],[792,3],[828,1],[830,1],[895,2],[898,2],[901,1],[957,3],[980,2],[1059,1],[1061,1],[1103,1],[1117,1],[1119,2],[1218,2],[1292,2],[1377,2],[1510,2],[1684,2],[1727,2],[1737,2],[1744,1],[1746,2],[1749,2],[1765,1],[1767,1],[1777,2],[1872,1],[1879,2],[1939,1],[2060,2],[2063,1],[2065,1],[2077,2],[2170,2],[2177,1],[2179,2],[2182,2],[2198,1],[2219,2],[2291,2],[2410,1],[2465,1],[2499,1],[2501,2],[2603,1],[2631,1],[2643,1],[2699,2],[2756,1],[2810,2],[2915,1],[2969,2],[3096,1],[3150,2],[3193,2],[3210,1],[3246,1],[3248,1],[3262,1],[3293,1],[3316,1],[3349,2],[3361,1],[3388,1],[3397,1],[3426,1],[3434,1],[3441,1],[3464,1],[3483,1],[3500,1],[3502,2],[3505,2],[3521,1],[3580,1],[3751,1],[3797,1],[3833,1],[3890,1],[3924,1],[4029,1],[4062,1],[4190,1],[4224,1],[4266,1],[4268,1],[4392,1],[4472,1],[4474,1],[4532,1],[4539,1],[4546,1],[4649,3],[4653,2],[4656,2],[4659,1],[4670,1],[4944,1],[4988,1],[4990,1],[5081,1],[5098,1],[5113,1],[5181,2],[5539,1],[5605,1],[5607,2]]},"506":{"position":[[185,2],[257,2],[281,1],[297,1],[299,1],[326,2],[426,1],[487,2],[571,2],[751,2],[794,3],[830,1],[832,2],[894,1],[977,2],[980,2],[983,1],[1039,3],[1062,2],[1141,1],[1143,1],[1185,1],[1199,1],[1201,2],[1300,2],[1374,2],[1459,2],[1592,2],[1766,2],[1809,2],[1819,2],[1826,1],[1828,2],[1831,2],[1847,1],[1849,1],[1859,2],[1954,1],[1961,2],[2021,1],[2023,2],[2222,2],[2225,1],[2227,1],[2239,2],[2332,2],[2339,1],[2341,2],[2344,2],[2360,1],[2381,2],[2453,2],[2572,1],[2627,1],[2661,1],[2663,2],[2765,1],[2793,1],[2805,1],[2861,2],[2918,1],[2972,2],[3077,1],[3131,2],[3258,1],[3312,2],[3355,2],[3372,1],[3408,1],[3410,1],[3424,1],[3455,1],[3478,1],[3511,2],[3523,1],[3550,1],[3559,1],[3588,1],[3590,2],[3658,1],[3665,1],[3692,1],[3711,1],[3742,1],[3744,2],[3747,2],[3763,1],[3822,1],[3993,1],[4039,1],[4075,1],[4132,1],[4166,1],[4271,1],[4304,1],[4432,1],[4466,1],[4508,1],[4510,1],[4634,1],[4714,1],[4716,1],[4774,1],[4781,1],[4788,1],[4832,1],[4970,3],[4974,2],[4977,2],[4980,1],[4991,1],[5265,1],[5309,1],[5311,1],[5402,1],[5419,1],[5434,1],[5520,2],[5896,2],[5958,1],[6042,1],[6044,2]]},"508":{"position":[[302,2],[374,2],[398,1],[414,1],[416,1],[443,2],[543,1],[604,2],[688,2],[868,2],[911,3],[915,2],[936,1],[946,1],[948,1],[1050,2],[1053,1],[1110,3],[1114,2],[1125,1],[1151,2],[1230,1],[1232,1],[1274,1],[1288,1],[1290,2],[1389,2],[1463,2],[1548,2],[1681,2],[1855,2],[1898,2],[1908,2],[1915,1],[1917,2],[1920,2],[1936,1],[1938,1],[1948,2],[2043,1],[2050,2],[2149,1],[2161,2],[2240,2],[2248,1],[2250,1],[2266,1],[2287,2],[2359,2],[2478,1],[2533,1],[2567,1],[2569,2],[2671,1],[2699,1],[2711,1],[2767,2],[2824,1],[2878,2],[2983,1],[3037,2],[3164,1],[3218,2],[3261,2],[3278,1],[3314,1],[3316,1],[3330,1],[3355,1],[3378,1],[3411,2],[3423,1],[3448,1],[3455,1],[3478,1],[3497,1],[3529,2],[3545,1],[3585,2],[3605,1],[3631,1],[3802,1],[3848,1],[3884,1],[3941,1],[3975,1],[4080,1],[4113,1],[4241,1],[4275,1],[4317,1],[4319,1],[4443,1],[4523,1],[4525,1],[4583,1],[4590,1],[4685,1],[4696,1],[4736,1],[4755,1],[5063,1],[5326,1],[5370,1],[5372,1],[5463,1],[5619,1],[5660,1],[5674,2],[5715,1],[5727,2],[5762,1],[5794,2],[5859,1],[5891,2],[6702,2]]},"514":{"position":[[359,1],[406,1],[408,1],[425,2],[428,1],[463,1],[473,1],[483,2],[486,1],[488,2],[503,1],[518,1],[528,1],[561,1],[563,1],[580,2],[583,1],[613,2],[616,1],[618,1],[620,1],[622,1],[624,1],[626,1],[628,1],[630,1],[831,1]]},"516":{"position":[[134,1]]},"522":{"position":[[369,2],[441,2],[465,1],[481,1],[483,1],[510,2],[610,1],[671,2],[755,2],[935,2],[978,3],[1014,1],[1016,2],[1060,1],[1133,2],[1136,2],[1139,1],[1195,3],[1218,2],[1297,1],[1299,1],[1341,1],[1355,1],[1357,2],[1456,2],[1530,2],[1615,2],[1748,2],[1922,2],[1965,2],[1975,2],[1982,1],[1984,2],[1987,2],[2003,1],[2005,1],[2015,2],[2110,1],[2117,2],[2177,1],[2179,2],[2350,2],[2353,1],[2355,1],[2367,2],[2460,2],[2467,1],[2469,2],[2472,2],[2488,1],[2509,2],[2581,2],[2700,1],[2755,1],[2789,1],[2791,2],[2893,1],[2921,1],[2933,1],[2989,2],[3046,1],[3100,2],[3205,1],[3259,2],[3386,1],[3440,2],[3483,2],[3500,1],[3536,1],[3538,1],[3552,1],[3583,1],[3606,1],[3639,2],[3651,1],[3678,1],[3687,1],[3716,1],[3718,2],[3768,1],[3775,1],[3796,1],[3813,1],[3842,1],[3844,2],[3847,2],[3863,1],[3922,1],[4093,1],[4139,1],[4175,1],[4232,1],[4266,1],[4371,1],[4404,1],[4532,1],[4566,1],[4608,1],[4610,1],[4734,1],[4814,1],[4816,1],[4874,1],[4881,1],[4888,1],[4932,1],[5042,3],[5046,2],[5049,2],[5052,1],[5063,1],[5337,1],[5381,1],[5383,1],[5474,1],[5491,1],[5506,1],[5582,2],[5948,2],[5992,1],[6066,1],[6068,2],[6327,1],[6329,2],[6477,1],[6543,2],[6546,1],[6675,1],[6677,2],[6852,1],[6936,2],[6939,1]]},"524":{"position":[[119,1],[137,1],[434,2],[506,2],[530,1],[546,1],[548,1],[575,2],[675,1],[736,2],[820,2],[1000,2],[1043,3],[1047,2],[1068,1],[1078,1],[1080,1],[1178,2],[1181,1],[1238,3],[1242,2],[1253,1],[1279,2],[1358,1],[1360,1],[1402,1],[1416,1],[1418,2],[1517,2],[1591,2],[1676,2],[1809,2],[1983,2],[2026,2],[2036,2],[2043,1],[2045,2],[2048,2],[2064,1],[2066,1],[2076,2],[2171,1],[2178,2],[2273,1],[2285,2],[2364,2],[2372,1],[2374,1],[2390,1],[2411,2],[2483,2],[2602,1],[2657,1],[2691,1],[2693,2],[2795,1],[2823,1],[2835,1],[2891,2],[2948,1],[3002,2],[3107,1],[3161,2],[3288,1],[3342,2],[3385,2],[3402,1],[3438,1],[3440,1],[3454,1],[3479,1],[3502,1],[3535,2],[3547,1],[3572,1],[3579,1],[3602,1],[3619,1],[3649,2],[3665,1],[3705,2],[3725,1],[3751,1],[3922,1],[3968,1],[4004,1],[4061,1],[4095,1],[4200,1],[4233,1],[4361,1],[4395,1],[4437,1],[4439,1],[4563,1],[4643,1],[4645,1],[4703,1],[4710,1],[4801,1],[4812,1],[4852,1],[4871,1],[5175,1],[5438,1],[5482,1],[5484,1],[5575,1],[5727,1],[5768,1],[5782,2],[5823,1],[5833,2],[5866,1],[5896,2],[5959,1],[5991,2]]},"530":{"position":[[368,1],[415,1],[417,1],[434,2],[437,1],[472,1],[484,1],[494,2],[497,1],[499,2],[514,1],[529,1],[541,1],[574,1],[576,1],[593,1],[595,1],[597,1],[599,1],[601,1],[603,1],[605,1],[607,1],[808,1]]},"532":{"position":[[134,1]]},"538":{"position":[[296,1],[343,1],[345,1],[362,2],[365,1],[400,1],[412,1],[422,2],[425,1],[427,2],[442,1],[457,1],[469,1],[502,1],[504,1],[543,1],[545,1],[547,1],[549,1],[551,1],[553,2],[556,1],[587,1],[599,1],[609,2],[612,1],[614,2],[629,1],[644,1],[656,1],[689,1],[691,1],[708,1],[710,1],[712,1],[714,1],[716,1],[718,1],[720,1],[722,1]]},"540":{"position":[[192,2],[264,2],[288,1],[304,1],[306,1],[333,2],[433,1],[494,2],[578,2],[758,2],[801,3],[837,1],[839,1],[906,2],[909,2],[912,1],[968,3],[991,2],[1070,1],[1072,1],[1114,1],[1128,1],[1130,2],[1229,2],[1303,2],[1388,2],[1521,2],[1695,2],[1738,2],[1748,2],[1755,1],[1757,2],[1760,2],[1776,1],[1778,1],[1788,2],[1883,1],[1890,2],[1950,1],[2073,2],[2076,1],[2078,1],[2090,2],[2183,2],[2190,1],[2192,2],[2195,2],[2211,1],[2232,2],[2304,2],[2423,1],[2478,1],[2512,1],[2514,2],[2616,1],[2644,1],[2656,1],[2712,2],[2769,1],[2823,2],[2928,1],[2982,2],[3109,1],[3163,2],[3206,2],[3223,1],[3259,1],[3261,1],[3275,1],[3306,1],[3329,1],[3362,2],[3374,1],[3401,1],[3410,1],[3439,1],[3447,1],[3454,1],[3479,1],[3498,1],[3515,1],[3517,2],[3520,2],[3536,1],[3595,1],[3766,1],[3812,1],[3848,1],[3905,1],[3939,1],[4044,1],[4077,1],[4205,1],[4239,1],[4281,1],[4283,1],[4407,1],[4487,1],[4489,1],[4547,1],[4554,1],[4561,1],[4666,3],[4670,2],[4673,2],[4676,1],[4687,1],[4961,1],[5005,1],[5007,1],[5098,1],[5115,1],[5130,1],[5200,2],[5560,1],[5628,1],[5630,2]]},"542":{"position":[[525,2],[597,2],[621,1],[637,1],[639,1],[666,2],[766,1],[827,2],[911,2],[1091,2],[1134,3],[1170,1],[1172,2],[1226,1],[1316,2],[1319,2],[1322,1],[1378,3],[1401,2],[1480,1],[1482,1],[1524,1],[1538,1],[1540,2],[1639,2],[1713,2],[1798,2],[1931,2],[2105,2],[2148,2],[2158,2],[2165,1],[2167,2],[2170,2],[2186,1],[2188,1],[2198,2],[2293,1],[2300,2],[2360,1],[2362,2],[2560,2],[2563,1],[2565,1],[2577,2],[2670,2],[2677,1],[2679,2],[2682,2],[2698,1],[2719,2],[2791,2],[2910,1],[2965,1],[2999,1],[3001,2],[3103,1],[3131,1],[3143,1],[3199,2],[3256,1],[3310,2],[3415,1],[3469,2],[3596,1],[3650,2],[3693,2],[3710,1],[3746,1],[3748,1],[3762,1],[3793,1],[3816,1],[3849,2],[3861,1],[3888,1],[3897,1],[3926,1],[3928,2],[3988,1],[3995,1],[4029,1],[4048,1],[4079,1],[4081,2],[4084,2],[4100,1],[4159,1],[4330,1],[4376,1],[4412,1],[4469,1],[4503,1],[4608,1],[4641,1],[4769,1],[4803,1],[4845,1],[4847,1],[4971,1],[5051,1],[5053,1],[5111,1],[5118,1],[5125,1],[5169,1],[5306,3],[5310,2],[5313,2],[5316,1],[5327,1],[5601,1],[5645,1],[5647,1],[5738,1],[5755,1],[5770,1],[5863,2],[6246,2],[6300,1],[6391,1],[6393,2]]},"544":{"position":[[362,2],[434,2],[458,1],[474,1],[476,1],[503,2],[603,1],[664,2],[748,2],[928,2],[971,3],[975,2],[996,1],[1006,1],[1008,1],[1112,2],[1115,1],[1172,3],[1176,2],[1187,1],[1213,2],[1292,1],[1294,1],[1336,1],[1350,1],[1352,2],[1451,2],[1525,2],[1610,2],[1743,2],[1917,2],[1960,2],[1970,2],[1977,1],[1979,2],[1982,2],[1998,1],[2000,1],[2010,2],[2105,1],[2112,2],[2213,1],[2225,2],[2304,2],[2312,1],[2314,1],[2330,1],[2351,2],[2423,2],[2542,1],[2597,1],[2631,1],[2633,2],[2735,1],[2763,1],[2775,1],[2831,2],[2888,1],[2942,2],[3047,1],[3101,2],[3228,1],[3282,2],[3325,2],[3342,1],[3378,1],[3380,1],[3394,1],[3419,1],[3442,1],[3475,2],[3487,1],[3512,1],[3519,1],[3544,1],[3563,1],[3595,2],[3611,1],[3651,2],[3671,1],[3697,1],[3868,1],[3914,1],[3950,1],[4007,1],[4041,1],[4146,1],[4179,1],[4307,1],[4341,1],[4383,1],[4385,1],[4509,1],[4589,1],[4591,1],[4649,1],[4656,1],[4753,1],[4764,1],[4804,1],[4823,1],[5133,1],[5396,1],[5440,1],[5442,1],[5533,1],[5691,1],[5732,1],[5748,2],[5791,1],[5803,2],[5838,1],[5870,2],[5935,1],[5967,2]]},"550":{"position":[[327,1],[374,1],[376,1],[393,2],[396,1],[427,1],[438,1],[448,2],[451,1],[453,2],[468,1],[483,1],[494,1],[527,1],[529,1],[546,1],[548,1],[550,1],[552,1],[554,1],[556,1],[558,1],[560,1],[761,1]]},"552":{"position":[[134,1]]},"556":{"position":[[271,2],[343,2],[367,1],[383,1],[385,1],[412,2],[512,1],[573,2],[657,2],[837,2],[880,3],[916,1],[918,1],[977,1],[1036,2],[1039,2],[1042,1],[1098,3],[1121,2],[1200,1],[1202,1],[1244,1],[1258,1],[1260,2],[1359,2],[1433,2],[1518,2],[1651,2],[1825,2],[1868,2],[1878,2],[1885,1],[1887,2],[1890,2],[1906,1],[1908,1],[1918,2],[2013,1],[2020,2],[2080,1],[2195,2],[2198,1],[2313,2],[2316,1],[2318,1],[2330,2],[2423,2],[2430,1],[2432,2],[2435,2],[2451,1],[2472,2],[2544,2],[2663,1],[2718,1],[2752,1],[2754,2],[2856,1],[2884,1],[2896,1],[2952,2],[3009,1],[3063,2],[3168,1],[3222,2],[3349,1],[3403,2],[3446,2],[3463,1],[3499,1],[3501,1],[3515,1],[3546,1],[3569,1],[3602,2],[3614,1],[3641,1],[3650,1],[3679,1],[3687,1],[3694,1],[3718,1],[3736,1],[3747,2],[3756,1],[3763,1],[3787,1],[3805,1],[3816,1],[3818,2],[3821,2],[3837,1],[3896,1],[4067,1],[4113,1],[4149,1],[4206,1],[4240,1],[4345,1],[4378,1],[4506,1],[4540,1],[4582,1],[4584,1],[4708,1],[4788,1],[4790,1],[4848,1],[4855,1],[4862,1],[4959,2],[5028,3],[5032,2],[5035,2],[5038,1],[5049,1],[5323,1],[5367,1],[5369,1],[5460,1],[5477,1],[5492,1],[5612,2],[6069,1],[6129,2],[6132,1],[6192,1],[6194,2]]},"558":{"position":[[242,1],[289,1],[291,1],[308,2],[311,1],[342,1],[353,1],[364,1],[375,1],[377,1],[387,2],[390,2],[393,1],[413,1],[427,1],[439,3],[463,2],[485,1],[497,3],[526,1],[528,1],[530,1],[532,1],[534,1],[536,2],[548,1],[558,2],[561,1],[563,2],[578,1],[593,1],[604,1],[637,1],[639,1],[655,1],[657,1],[659,2],[671,1],[704,1],[706,1],[723,1],[725,1],[727,1],[729,1],[731,1],[733,2],[736,1],[766,1],[782,1],[792,2],[795,1],[797,2],[812,1],[827,1],[843,1],[876,1],[878,1],[895,1],[897,1],[899,1],[901,1],[903,1],[905,1],[907,1],[909,1]]},"560":{"position":[[278,2],[350,2],[374,1],[390,1],[392,1],[419,2],[519,1],[580,2],[664,2],[844,2],[887,3],[923,1],[925,1],[982,1],[1039,2],[1042,2],[1045,1],[1101,3],[1124,2],[1203,1],[1205,1],[1247,1],[1261,1],[1263,2],[1362,2],[1436,2],[1521,2],[1654,2],[1828,2],[1871,2],[1881,2],[1888,1],[1890,2],[1893,2],[1909,1],[1911,1],[1921,2],[2016,1],[2023,2],[2083,1],[2196,2],[2199,1],[2312,2],[2315,1],[2317,1],[2329,2],[2422,2],[2429,1],[2431,2],[2434,2],[2450,1],[2471,2],[2543,2],[2662,1],[2717,1],[2751,1],[2753,2],[2855,1],[2883,1],[2895,1],[2951,2],[3008,1],[3062,2],[3167,1],[3221,2],[3348,1],[3402,2],[3445,2],[3462,1],[3498,1],[3500,1],[3514,1],[3545,1],[3568,1],[3601,2],[3613,1],[3640,1],[3649,1],[3678,1],[3686,1],[3693,1],[3715,1],[3733,1],[3744,2],[3753,1],[3760,1],[3782,1],[3800,1],[3811,1],[3813,2],[3816,2],[3832,1],[3891,1],[4062,1],[4108,1],[4144,1],[4201,1],[4235,1],[4340,1],[4373,1],[4501,1],[4535,1],[4577,1],[4579,1],[4703,1],[4783,1],[4785,1],[4843,1],[4850,1],[4857,1],[4952,2],[5019,3],[5023,2],[5026,2],[5029,1],[5040,1],[5314,1],[5358,1],[5360,1],[5451,1],[5468,1],[5483,1],[5599,2],[6052,1],[6110,2],[6113,1],[6171,1],[6173,2]]},"562":{"position":[[289,2],[361,2],[385,1],[401,1],[403,1],[430,2],[530,1],[591,2],[675,2],[855,2],[898,3],[934,1],[936,1],[1002,2],[1005,2],[1008,1],[1064,3],[1087,2],[1166,1],[1168,1],[1210,1],[1224,1],[1226,2],[1325,2],[1399,2],[1484,2],[1617,2],[1791,2],[1834,2],[1844,2],[1851,1],[1853,2],[1856,2],[1872,1],[1874,1],[1884,2],[1979,1],[1986,2],[2046,1],[2168,2],[2171,1],[2173,1],[2185,2],[2278,2],[2285,1],[2287,2],[2290,2],[2306,1],[2327,2],[2399,2],[2518,1],[2573,1],[2607,1],[2609,2],[2711,1],[2739,1],[2751,1],[2807,2],[2864,1],[2918,2],[3023,1],[3077,2],[3204,1],[3258,2],[3301,2],[3318,1],[3354,1],[3356,1],[3370,1],[3401,1],[3424,1],[3457,2],[3469,1],[3496,1],[3505,1],[3534,1],[3542,1],[3549,1],[3574,1],[3597,1],[3609,1],[3611,2],[3614,2],[3630,1],[3689,1],[3860,1],[3906,1],[3942,1],[3999,1],[4033,1],[4138,1],[4171,1],[4299,1],[4333,1],[4375,1],[4377,1],[4501,1],[4581,1],[4583,1],[4641,1],[4648,1],[4655,1],[4759,3],[4763,2],[4766,2],[4769,1],[4780,1],[5054,1],[5098,1],[5100,1],[5191,1],[5208,1],[5223,1],[5292,2],[5651,1],[5718,1],[5720,2]]},"564":{"position":[[135,2],[207,2],[231,1],[247,1],[249,1],[276,2],[376,1],[437,2],[521,2],[701,2],[744,3],[748,2],[769,1],[779,1],[781,1],[864,2],[867,1],[924,3],[928,2],[939,1],[965,2],[1044,1],[1046,1],[1088,1],[1102,1],[1104,2],[1203,2],[1277,2],[1362,2],[1495,2],[1669,2],[1712,2],[1722,2],[1729,1],[1731,2],[1734,2],[1750,1],[1752,1],[1762,2],[1857,1],[1864,2],[1944,1],[1956,2],[2035,2],[2043,1],[2045,1],[2061,1],[2082,2],[2154,2],[2273,1],[2328,1],[2362,1],[2364,2],[2466,1],[2494,1],[2506,1],[2562,2],[2619,1],[2673,2],[2778,1],[2832,2],[2959,1],[3013,2],[3056,2],[3073,1],[3109,1],[3111,1],[3125,1],[3150,1],[3173,1],[3206,2],[3218,1],[3243,1],[3250,1],[3275,1],[3293,1],[3305,2],[3321,1],[3361,2],[3381,1],[3407,1],[3578,1],[3624,1],[3660,1],[3717,1],[3751,1],[3856,1],[3889,1],[4017,1],[4051,1],[4093,1],[4095,1],[4219,1],[4299,1],[4301,1],[4359,1],[4366,1],[4442,1],[4453,1],[4493,1],[4512,1],[4801,1],[5064,1],[5108,1],[5110,1],[5201,1],[5338,1],[5379,1],[5395,2],[5438,1],[5449,2],[5483,1],[5495,2],[5540,1],[5572,2],[5649,2],[5721,2],[5745,1],[5761,1],[5763,1],[5790,2],[5890,1],[5951,2],[6035,2],[6215,2],[6258,3],[6262,2],[6283,1],[6293,1],[6295,1],[6378,2],[6381,1],[6438,3],[6442,2],[6453,1],[6479,2],[6558,1],[6560,1],[6602,1],[6616,1],[6618,2],[6717,2],[6791,2],[6876,2],[7009,2],[7183,2],[7226,2],[7236,2],[7243,1],[7245,2],[7248,2],[7264,1],[7266,1],[7276,2],[7371,1],[7378,2],[7458,1],[7470,2],[7549,2],[7557,1],[7559,1],[7575,1],[7596,2],[7668,2],[7787,1],[7842,1],[7876,1],[7878,2],[7980,1],[8008,1],[8020,1],[8076,2],[8133,1],[8187,2],[8292,1],[8346,2],[8473,1],[8527,2],[8570,2],[8587,1],[8623,1],[8625,1],[8639,1],[8664,1],[8687,1],[8720,2],[8732,1],[8757,1],[8764,1],[8789,1],[8807,1],[8819,2],[8835,1],[8875,2],[8895,1],[8921,1],[9092,1],[9138,1],[9174,1],[9231,1],[9265,1],[9370,1],[9403,1],[9531,1],[9565,1],[9607,1],[9609,1],[9733,1],[9813,1],[9815,1],[9873,1],[9880,1],[9956,1],[9967,1],[10007,1],[10026,1],[10315,1],[10578,1],[10622,1],[10624,1],[10715,1],[10852,1],[10893,1],[10909,2],[10952,1],[10963,2],[10997,1],[11009,2],[11054,1],[11086,2]]},"566":{"position":[[172,2],[244,2],[268,1],[284,1],[286,1],[313,2],[413,1],[474,2],[558,2],[738,2],[781,3],[818,1],[820,1],[877,2],[880,2],[883,1],[939,3],[962,2],[1041,1],[1043,1],[1085,1],[1099,1],[1101,2],[1200,2],[1274,2],[1359,2],[1492,2],[1666,2],[1709,2],[1719,2],[1726,1],[1728,2],[1731,2],[1747,1],[1749,1],[1759,2],[1854,1],[1861,2],[1922,1],[2035,2],[2038,1],[2040,1],[2052,2],[2145,2],[2152,1],[2154,2],[2157,2],[2173,1],[2194,2],[2266,2],[2385,1],[2440,1],[2474,1],[2476,2],[2578,1],[2606,1],[2618,1],[2674,2],[2731,1],[2785,2],[2890,1],[2944,2],[3071,1],[3125,2],[3168,2],[3185,1],[3221,1],[3223,1],[3237,1],[3268,1],[3291,1],[3324,2],[3336,1],[3363,1],[3373,1],[3402,1],[3410,1],[3417,1],[3439,1],[3457,1],[3468,1],[3470,2],[3473,2],[3489,1],[3548,1],[3719,1],[3765,1],[3801,1],[3858,1],[3892,1],[3997,1],[4030,1],[4158,1],[4192,1],[4234,1],[4236,1],[4360,1],[4440,1],[4442,1],[4500,1],[4507,1],[4514,1],[4611,4],[4616,2],[4619,2],[4622,1],[4633,1],[4907,1],[4951,1],[4953,1],[5044,1],[5062,1],[5077,1],[5137,2],[5450,1],[5508,1],[5510,2],[5709,2],[5781,2],[5805,1],[5821,1],[5823,1],[5850,2],[5950,1],[6011,2],[6095,2],[6275,2],[6318,3],[6322,2],[6343,1],[6353,1],[6355,1],[6438,2],[6441,1],[6498,3],[6502,2],[6513,1],[6540,2],[6619,1],[6621,1],[6663,1],[6677,1],[6679,2],[6778,2],[6852,2],[6937,2],[7070,2],[7244,2],[7287,2],[7297,2],[7304,1],[7306,2],[7309,2],[7325,1],[7327,1],[7337,2],[7432,1],[7439,2],[7519,1],[7531,2],[7610,2],[7618,1],[7620,1],[7637,1],[7658,2],[7730,2],[7849,1],[7904,1],[7938,1],[7940,2],[8042,1],[8070,1],[8082,1],[8138,2],[8195,1],[8249,2],[8354,1],[8408,2],[8535,1],[8589,2],[8632,2],[8649,1],[8685,1],[8687,1],[8701,1],[8726,1],[8749,1],[8782,2],[8794,1],[8819,1],[8826,1],[8851,1],[8869,1],[8881,2],[8897,1],[8937,2],[8957,1],[8984,1],[9155,1],[9201,1],[9237,1],[9294,1],[9328,1],[9433,1],[9466,1],[9594,1],[9628,1],[9670,1],[9672,1],[9796,1],[9876,1],[9878,1],[9936,1],[9943,1],[10019,1],[10030,1],[10070,1],[10089,1],[10379,1],[10643,1],[10687,1],[10689,1],[10780,1],[10917,1],[10959,1],[10975,2],[11018,1],[11029,2],[11063,1],[11075,2],[11120,1],[11152,2]]},"572":{"position":[[468,1],[515,1],[517,1],[534,2],[537,1],[572,1],[584,1],[594,2],[597,2],[610,1],[621,1],[632,1],[634,1],[644,2],[647,2],[650,1],[671,1],[683,3],[708,1],[710,1],[712,1],[714,1],[716,1],[718,2],[733,1],[748,1],[760,1],[793,1],[795,1],[812,1],[814,1],[816,2],[829,1],[862,1],[864,1],[881,1],[883,1],[885,1],[887,1],[889,1],[891,1],[893,1],[895,1],[897,1],[899,2],[953,1],[1028,2],[1031,1],[1232,1]]},"574":{"position":[[134,1]]},"581":{"position":[[294,2],[366,2],[390,1],[406,1],[408,1],[435,2],[535,1],[596,2],[680,2],[860,2],[903,3],[907,2],[928,1],[938,1],[940,1],[1033,2],[1036,1],[1093,3],[1097,2],[1108,1],[1134,2],[1213,1],[1215,1],[1257,1],[1271,1],[1273,2],[1372,2],[1446,2],[1531,2],[1664,2],[1838,2],[1881,2],[1891,2],[1898,1],[1900,2],[1903,2],[1919,1],[1921,1],[1931,2],[2026,1],[2033,2],[2123,1],[2135,2],[2214,2],[2222,1],[2224,1],[2240,1],[2261,2],[2333,2],[2452,1],[2507,1],[2541,1],[2543,2],[2645,1],[2673,1],[2685,1],[2741,2],[2798,1],[2852,2],[2957,1],[3011,2],[3138,1],[3192,2],[3235,2],[3252,1],[3288,1],[3290,1],[3304,1],[3329,1],[3352,1],[3385,2],[3397,1],[3422,1],[3429,1],[3452,1],[3471,1],[3494,2],[3510,1],[3550,2],[3570,1],[3596,1],[3767,1],[3813,1],[3849,1],[3906,1],[3940,1],[4045,1],[4078,1],[4206,1],[4240,1],[4282,1],[4284,1],[4408,1],[4488,1],[4490,1],[4548,1],[4555,1],[4641,1],[4652,1],[4692,1],[4711,1],[5010,1],[5273,1],[5317,1],[5319,1],[5410,1],[5557,1],[5598,1],[5612,2],[5653,1],[5665,2],[5700,1],[5723,2],[5779,1],[5811,2]]},"588":{"position":[[544,2],[616,2],[640,1],[656,1],[658,1],[685,2],[785,1],[846,2],[930,2],[1110,2],[1153,3],[1157,2],[1181,1],[1190,1],[1192,1],[1273,3],[1277,2],[1287,1],[1429,2],[1508,1],[1510,1],[1552,1],[1566,1],[1568,2],[1667,2],[1741,2],[1826,2],[1959,2],[2133,2],[2176,2],[2186,2],[2193,1],[2195,2],[2198,2],[2214,1],[2216,1],[2226,2],[2254,2],[2392,1],[2404,2],[2489,2],[2497,1],[2499,1],[2632,1],[2653,2],[2725,2],[2844,1],[2899,1],[2933,1],[2935,2],[3037,1],[3065,1],[3077,1],[3133,2],[3190,1],[3244,2],[3349,1],[3403,2],[3530,1],[3584,2],[3627,2],[3644,1],[3680,1],[3682,1],[3696,1],[3720,2],[3732,1],[3758,1],[3765,1],[3788,1],[3807,1],[3822,2],[3838,1],[3877,2],[3885,1],[3887,1],[4020,1],[4041,1],[4212,1],[4258,1],[4294,1],[4351,1],[4385,1],[4490,1],[4523,1],[4651,1],[4685,1],[4727,1],[4729,1],[4853,1],[4933,1],[4935,2],[4943,1],[5011,1],[5022,1],[5061,1],[5072,1],[5726,1],[5770,1],[5772,1],[5863,1],[5945,1],[6096,2],[6134,2],[6179,1],[6181,3],[6190,1],[6212,2],[6237,2],[6266,2],[6700,2],[6772,2],[6796,1],[6812,1],[6814,1],[6841,2],[6941,1],[7002,2],[7086,2],[7266,2],[7309,3],[7313,2],[7337,1],[7346,1],[7348,1],[7410,3],[7414,2],[7424,1],[7566,2],[7645,1],[7647,1],[7689,1],[7703,1],[7705,2],[7804,2],[7878,2],[7963,2],[8096,2],[8270,2],[8313,2],[8323,2],[8330,1],[8332,2],[8335,2],[8351,1],[8353,1],[8363,2],[8391,2],[8490,1],[8502,2],[8587,2],[8595,1],[8597,1],[8730,1],[8751,2],[8823,2],[8942,1],[8997,1],[9031,1],[9033,2],[9135,1],[9163,1],[9175,1],[9231,2],[9288,1],[9342,2],[9447,1],[9501,2],[9628,1],[9682,2],[9725,2],[9742,1],[9778,1],[9780,1],[9794,1],[9818,2],[9830,1],[9856,1],[9863,1],[9884,1],[9899,2],[9915,1],[9954,2],[9962,1],[9964,1],[10097,1],[10118,1],[10289,1],[10335,1],[10371,1],[10428,1],[10462,1],[10567,1],[10600,1],[10728,1],[10762,1],[10804,1],[10806,1],[10930,1],[11010,1],[11012,2],[11020,1],[11069,1],[11080,1],[11119,1],[11130,1],[11766,1],[11810,1],[11812,1],[11903,1],[11965,1],[12116,2],[12154,2],[12199,1],[12201,3],[12210,1],[12235,2],[12264,2],[12681,2],[12753,2],[12777,1],[12793,1],[12795,1],[12822,2],[12922,1],[12983,2],[13067,2],[13247,2],[13290,3],[13294,2],[13318,1],[13327,1],[13329,1],[13401,3],[13405,2],[13415,1],[13557,2],[13636,1],[13638,1],[13680,1],[13694,1],[13696,2],[13795,2],[13869,2],[13954,2],[14087,2],[14261,2],[14304,2],[14314,2],[14321,1],[14323,2],[14326,2],[14342,1],[14344,1],[14354,2],[14382,2],[14491,1],[14503,2],[14588,2],[14596,1],[14598,1],[14731,1],[14752,2],[14824,2],[14943,1],[14998,1],[15032,1],[15034,2],[15136,1],[15164,1],[15176,1],[15232,2],[15289,1],[15343,2],[15448,1],[15502,2],[15629,1],[15683,2],[15726,2],[15743,1],[15779,1],[15781,1],[15795,1],[15819,2],[15831,1],[15857,1],[15868,1],[15887,1],[15910,2],[15926,1],[15965,2],[15973,1],[15975,1],[16108,1],[16129,1],[16300,1],[16346,1],[16382,1],[16439,1],[16473,1],[16578,1],[16611,1],[16739,1],[16773,1],[16815,1],[16817,1],[16941,1],[17021,1],[17023,2],[17031,1],[17090,1],[17101,1],[17140,1],[17151,1],[17797,1],[17841,1],[17843,1],[17934,1],[18006,1],[18157,2],[18183,2],[18224,2],[18257,2],[18296,2]]},"590":{"position":[[747,2],[819,2],[843,1],[859,1],[861,1],[888,2],[988,1],[1049,2],[1133,2],[1313,2],[1356,3],[1360,2],[1384,1],[1393,1],[1395,1],[1476,3],[1480,2],[1490,1],[1492,2],[1514,2],[1593,1],[1595,1],[1637,1],[1651,1],[1653,2],[1752,2],[1826,2],[1911,2],[2044,2],[2218,2],[2261,2],[2271,2],[2278,1],[2280,2],[2283,2],[2299,1],[2301,1],[2311,2],[2339,2],[2477,1],[2489,2],[2574,2],[2582,1],[2584,1],[2596,2],[2599,1],[2620,2],[2692,2],[2811,1],[2866,1],[2900,1],[2902,2],[3004,1],[3032,1],[3044,1],[3100,2],[3157,1],[3211,2],[3316,1],[3370,2],[3497,1],[3551,2],[3594,2],[3611,1],[3647,1],[3649,1],[3663,1],[3687,2],[3699,1],[3725,1],[3732,1],[3755,1],[3774,1],[3789,2],[3805,1],[3844,2],[3852,1],[3854,1],[3866,2],[3869,1],[3890,1],[4061,1],[4107,1],[4143,1],[4200,1],[4234,1],[4339,1],[4372,1],[4500,1],[4534,1],[4576,1],[4578,1],[4702,1],[4782,1],[4784,2],[4792,1],[4860,1],[4871,1],[4910,1],[4921,1],[5457,1],[5501,1],[5503,1],[5594,1],[5676,1],[5698,4],[5709,2],[5747,2],[5792,1],[5794,3],[5803,1],[5825,2],[5850,2],[5879,2]]},"595":{"position":[[285,2],[357,2],[381,1],[397,1],[399,1],[426,2],[526,1],[587,2],[671,2],[851,2],[894,3],[904,1],[911,1],[913,1],[960,2],[1029,2],[1068,2],[1071,1],[1127,3],[1131,2],[1139,1],[1141,3],[1164,2],[1243,1],[1245,1],[1287,1],[1301,1],[1303,2],[1402,2],[1476,2],[1561,2],[1694,2],[1868,2],[1911,2],[1921,2],[1928,1],[1930,2],[1933,2],[1949,1],[1951,1],[1961,2],[2057,1],[2064,2],[2108,2],[2177,2],[2216,1],[2228,2],[2315,2],[2323,1],[2325,1],[2333,4],[2357,2],[2429,2],[2548,1],[2603,1],[2637,1],[2639,2],[2741,1],[2769,1],[2781,1],[2837,2],[2894,1],[2948,2],[3053,1],[3107,2],[3234,1],[3288,2],[3331,2],[3348,1],[3384,1],[3386,1],[3400,1],[3425,1],[3448,1],[3481,2],[3493,1],[3519,1],[3530,1],[3542,2],[3589,1],[3611,2],[3650,2],[3666,1],[3707,2],[3719,1],[3721,1],[3729,3],[3733,1],[3754,1],[3925,1],[3971,1],[4007,1],[4064,1],[4098,1],[4203,1],[4236,1],[4364,1],[4398,1],[4440,1],[4442,1],[4566,1],[4646,1],[4648,1],[4706,1],[4713,1],[4785,1],[4796,1],[4837,1],[4848,1],[5165,1],[5186,4],[5426,1],[5470,1],[5472,1],[5563,1],[5692,1],[5713,4],[5736,2],[5797,2],[5889,2],[5947,1],[6061,1],[6063,1],[6065,1],[6067,1],[6069,1],[6071,1],[6197,2],[6269,2],[6293,1],[6309,1],[6311,1],[6338,2],[6438,1],[6499,2],[6583,2],[6763,2],[6806,3],[6816,1],[6823,1],[6825,1],[6872,2],[6941,2],[6980,2],[6983,1],[7039,3],[7043,2],[7051,1],[7053,3],[7076,2],[7155,1],[7157,1],[7199,1],[7213,1],[7215,2],[7314,2],[7388,2],[7473,2],[7606,2],[7780,2],[7823,2],[7833,2],[7840,1],[7842,2],[7845,2],[7861,1],[7863,1],[7873,2],[7969,1],[7976,2],[8020,2],[8089,2],[8128,1],[8140,2],[8227,2],[8235,1],[8237,1],[8245,4],[8269,2],[8341,2],[8460,1],[8515,1],[8549,1],[8551,2],[8653,1],[8681,1],[8693,1],[8749,2],[8806,1],[8860,2],[8965,1],[9019,2],[9146,1],[9200,2],[9243,2],[9260,1],[9296,1],[9298,1],[9312,1],[9337,1],[9360,1],[9393,2],[9405,1],[9431,1],[9442,1],[9454,2],[9501,1],[9523,2],[9562,2],[9578,1],[9619,2],[9631,1],[9633,1],[9641,3],[9645,1],[9666,1],[9837,1],[9883,1],[9919,1],[9976,1],[10010,1],[10115,1],[10148,1],[10276,1],[10310,1],[10352,1],[10354,1],[10478,1],[10558,1],[10560,1],[10618,1],[10625,1],[10697,1],[10708,1],[10749,1],[10760,1],[11077,1],[11098,4],[11338,1],[11382,1],[11384,1],[11475,1],[11604,1],[11625,4],[11648,2],[11709,2],[11801,2],[11859,1],[11954,1],[11956,1],[11958,1],[11960,1],[11962,1],[11964,1],[11966,1]]},"600":{"position":[[206,2],[278,2],[302,1],[318,1],[320,1],[347,2],[447,1],[508,2],[592,2],[772,2],[815,3],[834,1],[941,1],[955,2],[1024,2],[1027,2],[1030,2],[1033,1],[1090,3],[1094,2],[1114,1],[1178,2],[1257,1],[1259,1],[1301,1],[1315,1],[1317,2],[1416,2],[1490,2],[1575,2],[1708,2],[1882,2],[1925,2],[1935,2],[1942,1],[1944,2],[1947,2],[1963,1],[1965,1],[1975,2],[2076,1],[2083,2],[2205,1],[2274,1],[2276,1],[2278,1],[2290,2],[2385,2],[2393,1],[2395,1],[2451,1],[2472,2],[2544,2],[2663,1],[2718,1],[2752,1],[2754,2],[2856,1],[2884,1],[2896,1],[2952,2],[3009,1],[3063,2],[3168,1],[3222,2],[3349,1],[3403,2],[3446,2],[3463,1],[3499,1],[3501,1],[3515,1],[3546,1],[3569,1],[3602,2],[3614,1],[3645,1],[3652,1],[3675,1],[3692,1],[3724,1],[3825,2],[3828,2],[3844,1],[3890,2],[3910,1],[3974,1],[4145,1],[4191,1],[4227,1],[4284,1],[4318,1],[4423,1],[4456,1],[4584,1],[4618,1],[4660,1],[4662,1],[4786,1],[4866,1],[4868,1],[4926,1],[4933,1],[5113,2],[5116,1],[5127,1],[5174,1],[5193,1],[5586,1],[5895,1],[5939,1],[5941,1],[6032,1],[6037,2],[6179,1],[6195,1],[6271,1],[6273,1],[6275,2],[6278,1],[6371,2],[6426,2],[6466,2],[6524,1],[6557,2],[6621,1],[6623,1],[6625,2],[6665,1],[6688,1],[6707,1],[6730,1],[6732,2]]},"610":{"position":[[432,1],[479,1],[481,1],[498,2],[501,1],[536,1],[548,1],[558,2],[561,1],[563,2],[578,1],[593,1],[605,1],[638,1],[640,1],[657,1],[659,1],[661,1],[663,1],[665,1],[667,2],[670,1],[703,1],[715,1],[725,2],[728,1],[730,2],[745,1],[760,1],[772,1],[805,1],[807,1],[824,1],[826,1],[828,1],[830,1],[832,1],[834,1],[836,1],[838,1],[1005,1]]},"612":{"position":[[93,1]]},"617":{"position":[[289,1],[336,1],[338,1],[355,2],[358,1],[393,1],[405,1],[415,2],[418,2],[431,1],[441,2],[444,1],[446,2],[461,1],[476,1],[488,1],[521,1],[523,1],[542,1],[544,1],[546,2],[559,1],[592,1],[594,1],[611,1],[613,1],[615,1],[617,1],[619,1],[621,2],[624,1],[657,1],[669,1],[679,2],[682,1],[684,2],[699,1],[714,1],[726,1],[759,1],[761,1],[778,1],[780,1],[782,1],[784,1],[786,1],[788,1],[790,1],[792,1]]},"619":{"position":[[421,2],[493,2],[517,1],[533,1],[535,1],[562,2],[662,1],[723,2],[807,2],[987,2],[1030,3],[1066,1],[1068,2],[1169,1],[1251,2],[1254,2],[1257,1],[1313,3],[1336,2],[1415,1],[1417,1],[1459,1],[1473,1],[1475,2],[1574,2],[1648,2],[1733,2],[1866,2],[2040,2],[2083,2],[2093,2],[2100,1],[2102,2],[2105,2],[2121,1],[2123,1],[2133,2],[2228,1],[2235,2],[2295,1],[2297,2],[2534,2],[2537,1],[2539,1],[2551,2],[2644,2],[2651,1],[2653,2],[2656,2],[2672,1],[2693,2],[2765,2],[2884,1],[2939,1],[2973,1],[2975,2],[3077,1],[3105,1],[3117,1],[3173,2],[3230,1],[3284,2],[3389,1],[3443,2],[3570,1],[3624,2],[3667,2],[3684,1],[3720,1],[3722,1],[3736,1],[3767,1],[3790,1],[3823,2],[3835,1],[3862,1],[3871,1],[3900,1],[3902,2],[4009,1],[4016,1],[4045,1],[4064,1],[4092,1],[4094,2],[4097,2],[4113,1],[4172,1],[4343,1],[4389,1],[4425,1],[4482,1],[4516,1],[4621,1],[4654,1],[4782,1],[4816,1],[4858,1],[4860,1],[4984,1],[5064,1],[5066,1],[5124,1],[5131,1],[5138,1],[5182,1],[5358,3],[5362,2],[5365,2],[5368,1],[5379,1],[5653,1],[5697,1],[5699,1],[5790,1],[5807,1],[5822,1],[5907,2],[6282,2],[6383,1],[6466,1],[6468,2]]},"621":{"position":[[236,2],[308,2],[332,1],[348,1],[350,1],[377,2],[477,1],[538,2],[622,2],[802,2],[845,3],[849,2],[870,1],[880,1],[882,1],[987,2],[990,1],[1047,3],[1051,2],[1062,1],[1088,2],[1167,1],[1169,1],[1211,1],[1225,1],[1227,2],[1326,2],[1400,2],[1485,2],[1618,2],[1792,2],[1835,2],[1845,2],[1852,1],[1854,2],[1857,2],[1873,1],[1875,1],[1885,2],[1980,1],[1987,2],[2089,1],[2101,2],[2180,2],[2188,1],[2190,1],[2206,1],[2227,2],[2299,2],[2418,1],[2473,1],[2507,1],[2509,2],[2611,1],[2639,1],[2651,1],[2707,2],[2764,1],[2818,2],[2923,1],[2977,2],[3104,1],[3158,2],[3201,2],[3218,1],[3254,1],[3256,1],[3270,1],[3295,1],[3318,1],[3351,2],[3363,1],[3388,1],[3395,1],[3424,1],[3443,1],[3472,2],[3488,1],[3528,2],[3548,1],[3574,1],[3745,1],[3791,1],[3827,1],[3884,1],[3918,1],[4023,1],[4056,1],[4184,1],[4218,1],[4260,1],[4262,1],[4386,1],[4466,1],[4468,1],[4526,1],[4533,1],[4631,1],[4642,1],[4682,1],[4701,1],[5012,1],[5275,1],[5319,1],[5321,1],[5412,1],[5571,1],[5612,1],[5632,2],[5679,1],[5691,2],[5726,1],[5755,2],[5817,1],[5849,2]]},"625":{"position":[[283,1],[330,1],[332,1],[349,2],[352,1],[386,1],[407,1],[417,2],[420,2],[433,1],[444,1],[455,1],[457,1],[467,2],[470,2],[473,1],[493,1],[507,1],[539,2],[561,1],[595,1],[597,1],[599,1],[601,1],[603,1],[605,1],[607,2],[622,1],[637,1],[658,1],[691,1],[693,1],[710,1],[712,1],[714,2],[727,1],[760,1],[762,1],[779,1],[781,1],[783,1],[785,1],[787,1],[789,2],[792,1],[823,1],[846,1],[856,2],[859,1],[861,2],[876,1],[891,1],[914,1],[947,1],[949,1],[966,1],[968,1],[970,1],[972,1],[974,1],[976,1],[978,1],[980,1]]},"627":{"position":[[146,2],[218,2],[242,1],[258,1],[260,1],[287,2],[387,1],[448,2],[532,2],[712,2],[755,3],[791,1],[793,2],[845,1],[923,2],[988,1],[1075,2],[1078,2],[1081,1],[1137,3],[1160,2],[1239,1],[1241,1],[1283,1],[1297,1],[1299,2],[1398,2],[1472,2],[1557,2],[1690,2],[1864,2],[1907,2],[1917,2],[1924,1],[1926,2],[1929,2],[1945,1],[1947,1],[1957,2],[2052,1],[2059,2],[2119,1],[2121,2],[2305,2],[2308,1],[2310,2],[2516,2],[2519,1],[2521,1],[2533,2],[2626,2],[2633,1],[2635,2],[2638,2],[2654,1],[2675,2],[2747,2],[2866,1],[2921,1],[2955,1],[2957,2],[3059,1],[3087,1],[3099,1],[3155,2],[3212,1],[3266,2],[3371,1],[3425,2],[3552,1],[3606,2],[3649,2],[3666,1],[3702,1],[3704,1],[3718,1],[3749,1],[3772,1],[3805,2],[3817,1],[3844,1],[3853,1],[3882,1],[3884,2],[3942,1],[3949,1],[3973,1],[4003,1],[4021,2],[4024,2],[4095,1],[4102,1],[4130,1],[4158,1],[4183,1],[4185,2],[4188,2],[4204,1],[4263,1],[4434,1],[4480,1],[4516,1],[4573,1],[4607,1],[4712,1],[4745,1],[4873,1],[4907,1],[4949,1],[4951,1],[5075,1],[5155,1],[5157,1],[5215,1],[5222,1],[5229,1],[5273,1],[5396,2],[5412,1],[5557,3],[5561,2],[5564,2],[5567,1],[5578,1],[5852,1],[5896,1],[5898,1],[5989,1],[6006,1],[6021,1],[6188,2],[6692,2],[6744,1],[6823,2],[6826,2],[6891,1],[6979,1],[6981,2]]},"629":{"position":[[165,2],[237,2],[261,1],[277,1],[279,1],[306,2],[406,1],[467,2],[551,2],[731,2],[774,3],[778,2],[799,1],[809,1],[811,1],[908,2],[911,1],[968,3],[972,2],[983,1],[1009,2],[1088,1],[1090,1],[1132,1],[1146,1],[1148,2],[1247,2],[1321,2],[1406,2],[1539,2],[1713,2],[1756,2],[1766,2],[1773,1],[1775,2],[1778,2],[1794,1],[1796,1],[1806,2],[1901,1],[1908,2],[2002,1],[2014,2],[2093,2],[2101,1],[2103,1],[2119,1],[2140,2],[2212,2],[2331,1],[2386,1],[2420,1],[2422,2],[2524,1],[2552,1],[2564,1],[2620,2],[2677,1],[2731,2],[2836,1],[2890,2],[3017,1],[3071,2],[3114,2],[3131,1],[3167,1],[3169,1],[3183,1],[3208,1],[3231,1],[3264,2],[3276,1],[3301,1],[3308,1],[3332,1],[3351,1],[3377,2],[3393,1],[3433,2],[3453,1],[3479,1],[3650,1],[3696,1],[3732,1],[3789,1],[3823,1],[3928,1],[3961,1],[4089,1],[4123,1],[4165,1],[4167,1],[4291,1],[4371,1],[4373,1],[4431,1],[4438,1],[4528,1],[4539,1],[4579,1],[4598,1],[4901,1],[5164,1],[5208,1],[5210,1],[5301,1],[5452,1],[5493,1],[5508,2],[5550,1],[5562,2],[5597,1],[5623,2],[5682,1],[5714,2]]},"631":{"position":[[146,2],[218,2],[242,1],[258,1],[260,1],[287,2],[387,1],[448,2],[532,2],[712,2],[755,3],[792,1],[794,2],[844,1],[931,2],[934,2],[937,1],[993,3],[1016,2],[1095,1],[1097,1],[1139,1],[1153,1],[1155,2],[1254,2],[1328,2],[1413,2],[1546,2],[1720,2],[1763,2],[1773,2],[1780,1],[1782,2],[1785,2],[1801,1],[1803,1],[1813,2],[1908,1],[1915,2],[1976,1],[1978,2],[2169,2],[2172,1],[2174,1],[2186,2],[2279,2],[2286,1],[2288,2],[2291,2],[2307,1],[2328,2],[2400,2],[2519,1],[2574,1],[2608,1],[2610,2],[2712,1],[2740,1],[2752,1],[2808,2],[2865,1],[2919,2],[3024,1],[3078,2],[3205,1],[3259,2],[3302,2],[3319,1],[3355,1],[3357,1],[3371,1],[3402,1],[3425,1],[3458,2],[3470,1],[3497,1],[3507,1],[3536,1],[3538,2],[3594,1],[3601,1],[3629,1],[3657,1],[3682,1],[3684,2],[3687,2],[3703,1],[3762,1],[3933,1],[3979,1],[4015,1],[4072,1],[4106,1],[4211,1],[4244,1],[4372,1],[4406,1],[4448,1],[4450,1],[4574,1],[4654,1],[4656,1],[4714,1],[4721,1],[4728,1],[4774,1],[4904,4],[4909,2],[4912,2],[4915,1],[4926,1],[5200,1],[5244,1],[5246,1],[5337,1],[5355,1],[5370,1],[5460,2],[5803,2],[5853,1],[5941,1],[5943,2],[6204,2],[6276,2],[6300,1],[6316,1],[6318,1],[6345,2],[6445,1],[6506,2],[6590,2],[6770,2],[6813,3],[6817,2],[6838,1],[6848,1],[6850,1],[6947,2],[6950,1],[7007,3],[7011,2],[7022,1],[7049,2],[7128,1],[7130,1],[7172,1],[7186,1],[7188,2],[7287,2],[7361,2],[7446,2],[7579,2],[7753,2],[7796,2],[7806,2],[7813,1],[7815,2],[7818,2],[7834,1],[7836,1],[7846,2],[7941,1],[7948,2],[8042,1],[8054,2],[8133,2],[8141,1],[8143,1],[8160,1],[8181,2],[8253,2],[8372,1],[8427,1],[8461,1],[8463,2],[8565,1],[8593,1],[8605,1],[8661,2],[8718,1],[8772,2],[8877,1],[8931,2],[9058,1],[9112,2],[9155,2],[9172,1],[9208,1],[9210,1],[9224,1],[9249,1],[9272,1],[9305,2],[9317,1],[9342,1],[9349,1],[9373,1],[9392,1],[9418,2],[9434,1],[9474,2],[9494,1],[9521,1],[9692,1],[9738,1],[9774,1],[9831,1],[9865,1],[9970,1],[10003,1],[10131,1],[10165,1],[10207,1],[10209,1],[10333,1],[10413,1],[10415,1],[10473,1],[10480,1],[10570,1],[10581,1],[10621,1],[10640,1],[10944,1],[11208,1],[11252,1],[11254,1],[11345,1],[11496,1],[11538,1],[11553,2],[11595,1],[11607,2],[11642,1],[11668,2],[11727,1],[11759,2],[11837,2],[11909,2],[11933,1],[11949,1],[11951,1],[11978,2],[12078,1],[12139,2],[12223,2],[12403,2],[12446,3],[12450,2],[12471,1],[12481,1],[12483,1],[12584,2],[12587,1],[12644,3],[12648,2],[12659,1],[12685,2],[12764,1],[12766,1],[12808,1],[12822,1],[12824,2],[12923,2],[12997,2],[13082,2],[13215,2],[13389,2],[13432,2],[13442,2],[13449,1],[13451,2],[13454,2],[13470,1],[13472,1],[13482,2],[13577,1],[13584,2],[13682,1],[13694,2],[13773,2],[13781,1],[13783,1],[13799,1],[13820,2],[13892,2],[14011,1],[14066,1],[14100,1],[14102,2],[14204,1],[14232,1],[14244,1],[14300,2],[14357,1],[14411,2],[14516,1],[14570,2],[14697,1],[14751,2],[14794,2],[14811,1],[14847,1],[14849,1],[14863,1],[14888,1],[14911,1],[14944,2],[14956,1],[14981,1],[14988,1],[15012,1],[15042,1],[15061,2],[15077,1],[15117,2],[15137,1],[15163,1],[15334,1],[15380,1],[15416,1],[15473,1],[15507,1],[15612,1],[15645,1],[15773,1],[15807,1],[15849,1],[15851,1],[15975,1],[16055,1],[16057,1],[16115,1],[16122,1],[16216,1],[16227,1],[16267,1],[16286,1],[16593,1],[16856,1],[16900,1],[16902,1],[16993,1],[17148,1],[17189,1],[17204,2],[17246,1],[17269,2],[17315,1],[17334,2],[17386,1],[17418,2]]},"637":{"position":[[349,1]]},"639":{"position":[[134,1]]},"645":{"position":[[435,1],[482,1],[484,1],[501,2],[504,1],[539,1],[551,1],[562,1],[573,1],[575,1],[585,2],[588,2],[591,1],[612,1],[635,1],[637,1],[639,1],[641,1],[643,2],[656,1],[666,2],[669,1],[671,2],[686,1],[701,1],[713,1],[746,1],[748,1],[765,2],[768,1],[798,2],[801,2],[804,1],[843,1],[845,1],[847,2],[860,1],[893,1],[895,1],[912,2],[915,1],[954,1],[956,1],[958,1],[960,1],[962,1],[964,2],[967,1],[998,1],[1010,1],[1020,2],[1023,1],[1025,2],[1040,1],[1055,1],[1067,1],[1100,1],[1102,1],[1119,1],[1121,1],[1123,1],[1125,1],[1127,1],[1129,1],[1131,1],[1133,1]]},"649":{"position":[[246,1],[293,1],[295,1],[312,2],[315,1],[350,1],[362,1],[373,1],[384,1],[386,1],[396,2],[399,2],[402,1],[423,1],[446,1],[448,1],[450,1],[452,1],[454,2],[467,1],[477,2],[480,1],[482,2],[497,1],[512,1],[524,1],[557,1],[559,1],[576,2],[579,1],[609,2],[612,2],[615,1],[654,1],[656,1],[658,2],[671,1],[704,1],[706,1],[723,2],[726,1],[765,1],[767,1],[769,1],[771,1],[773,1],[775,2],[778,1],[809,1],[821,1],[831,2],[834,1],[836,2],[851,1],[866,1],[878,1],[911,1],[913,1],[930,1],[932,1],[934,1],[936,1],[938,1],[940,1],[942,1],[944,1],[1159,1],[1161,1],[1237,2],[1240,1],[1425,2],[1497,2],[1521,1],[1537,1],[1539,1],[1566,2],[1666,1],[1727,2],[1811,2],[1991,2],[2034,3],[2038,2],[2059,1],[2069,1],[2071,1],[2165,2],[2168,1],[2225,3],[2229,2],[2240,1],[2266,2],[2345,1],[2347,1],[2389,1],[2403,1],[2405,2],[2504,2],[2578,2],[2663,2],[2796,2],[2970,2],[3013,2],[3023,2],[3030,1],[3032,2],[3035,2],[3051,1],[3053,1],[3063,2],[3158,1],[3165,2],[3256,1],[3268,2],[3347,2],[3355,1],[3357,1],[3373,1],[3394,2],[3466,2],[3585,1],[3640,1],[3674,1],[3676,2],[3778,1],[3806,1],[3818,1],[3874,2],[3931,1],[3985,2],[4090,1],[4144,2],[4271,1],[4325,2],[4368,2],[4385,1],[4421,1],[4423,1],[4437,1],[4462,1],[4485,1],[4518,2],[4530,1],[4555,1],[4562,1],[4586,1],[4605,1],[4628,2],[4644,1],[4684,2],[4704,1],[4730,1],[4901,1],[4947,1],[4983,1],[5040,1],[5074,1],[5179,1],[5212,1],[5340,1],[5374,1],[5416,1],[5418,1],[5542,1],[5622,1],[5624,1],[5682,1],[5689,1],[5776,1],[5787,1],[5827,1],[5846,1],[6146,1],[6409,1],[6453,1],[6455,1],[6546,1],[6694,1],[6735,1],[6750,2],[6792,1],[6804,2],[6839,1],[6862,2],[6918,1],[6950,2],[7334,1],[7336,1],[7409,2],[7412,1],[7597,2],[7669,2],[7693,1],[7709,1],[7711,1],[7738,2],[7838,1],[7899,2],[7983,2],[8163,2],[8206,3],[8210,2],[8231,1],[8241,1],[8243,1],[8337,2],[8340,1],[8397,3],[8401,2],[8412,1],[8438,2],[8517,1],[8519,1],[8561,1],[8575,1],[8577,2],[8676,2],[8750,2],[8835,2],[8968,2],[9142,2],[9185,2],[9195,2],[9202,1],[9204,2],[9207,2],[9223,1],[9225,1],[9235,2],[9330,1],[9337,2],[9428,1],[9440,2],[9519,2],[9527,1],[9529,1],[9545,1],[9566,2],[9638,2],[9757,1],[9812,1],[9846,1],[9848,2],[9950,1],[9978,1],[9990,1],[10046,2],[10103,1],[10157,2],[10262,1],[10316,2],[10443,1],[10497,2],[10540,2],[10557,1],[10593,1],[10595,1],[10609,1],[10634,1],[10657,1],[10690,2],[10702,1],[10727,1],[10734,1],[10758,1],[10777,1],[10800,2],[10816,1],[10856,2],[10876,1],[10902,1],[11073,1],[11119,1],[11155,1],[11212,1],[11246,1],[11351,1],[11384,1],[11512,1],[11546,1],[11588,1],[11590,1],[11714,1],[11794,1],[11796,1],[11854,1],[11861,1],[11948,1],[11959,1],[11999,1],[12018,1],[12318,1],[12581,1],[12625,1],[12627,1],[12718,1],[12866,1],[12907,1],[12922,2],[12964,1],[12976,2],[13011,1],[13034,2],[13090,1],[13122,2],[13757,1],[13759,1],[13833,2],[13836,1],[13922,2],[13925,1],[14418,2],[14490,2],[14514,1],[14530,1],[14532,1],[14559,2],[14659,1],[14720,2],[14804,2],[14984,2],[15027,3],[15031,2],[15052,1],[15062,1],[15064,1],[15161,2],[15164,1],[15221,3],[15225,2],[15236,1],[15262,2],[15341,1],[15343,1],[15385,1],[15399,1],[15401,2],[15500,2],[15574,2],[15659,2],[15792,2],[15966,2],[16009,2],[16019,2],[16026,1],[16028,2],[16031,2],[16047,1],[16049,1],[16059,2],[16154,1],[16161,2],[16255,1],[16267,2],[16346,2],[16354,1],[16356,1],[16372,1],[16393,2],[16465,2],[16584,1],[16639,1],[16673,1],[16675,2],[16777,1],[16805,1],[16817,1],[16873,2],[16930,1],[16984,2],[17089,1],[17143,2],[17270,1],[17324,2],[17367,2],[17384,1],[17420,1],[17422,1],[17436,1],[17461,1],[17484,1],[17517,2],[17529,1],[17554,1],[17561,1],[17588,1],[17607,1],[17630,2],[17646,1],[17686,2],[17706,1],[17732,1],[17903,1],[17949,1],[17985,1],[18042,1],[18076,1],[18181,1],[18214,1],[18342,1],[18376,1],[18418,1],[18420,1],[18544,1],[18624,1],[18626,1],[18684,1],[18691,1],[18781,1],[18792,1],[18832,1],[18851,1],[19154,1],[19417,1],[19461,1],[19463,1],[19554,1],[19705,1],[19746,1],[19764,2],[19809,1],[19821,2],[19856,1],[19879,2],[19935,1],[19967,2],[20722,1],[20724,1],[20801,2],[20804,1],[20891,2],[20894,1],[20975,2],[20978,1],[21064,2],[21067,1],[21255,2],[21327,2],[21351,1],[21367,1],[21369,1],[21396,2],[21496,1],[21557,2],[21641,2],[21821,2],[21864,3],[21868,2],[21889,1],[21899,1],[21901,1],[21995,2],[21998,1],[22055,3],[22059,2],[22070,1],[22096,2],[22175,1],[22177,1],[22219,1],[22233,1],[22235,2],[22334,2],[22408,2],[22493,2],[22626,2],[22800,2],[22843,2],[22853,2],[22860,1],[22862,2],[22865,2],[22881,1],[22883,1],[22893,2],[22988,1],[22995,2],[23086,1],[23098,2],[23177,2],[23185,1],[23187,1],[23203,1],[23224,2],[23296,2],[23415,1],[23470,1],[23504,1],[23506,2],[23608,1],[23636,1],[23648,1],[23704,2],[23761,1],[23815,2],[23920,1],[23974,2],[24101,1],[24155,2],[24198,2],[24215,1],[24251,1],[24253,1],[24267,1],[24292,1],[24315,1],[24348,2],[24360,1],[24385,1],[24392,1],[24416,1],[24435,1],[24458,2],[24474,1],[24514,2],[24534,1],[24560,1],[24731,1],[24777,1],[24813,1],[24870,1],[24904,1],[25009,1],[25042,1],[25170,1],[25204,1],[25246,1],[25248,1],[25372,1],[25452,1],[25454,1],[25512,1],[25519,1],[25606,1],[25617,1],[25657,1],[25676,1],[25976,1],[26239,1],[26283,1],[26285,1],[26376,1],[26524,1],[26565,1],[26580,2],[26622,1],[26634,2],[26669,1],[26692,2],[26748,1],[26780,2],[27220,1],[27222,1],[27299,2],[27302,1],[27491,2],[27563,2],[27587,1],[27603,1],[27605,1],[27632,2],[27732,1],[27793,2],[27877,2],[28057,2],[28100,3],[28104,2],[28125,1],[28135,1],[28137,1],[28232,2],[28235,1],[28292,3],[28296,2],[28307,1],[28333,2],[28412,1],[28414,1],[28456,1],[28470,1],[28472,2],[28571,2],[28645,2],[28730,2],[28863,2],[29037,2],[29080,2],[29090,2],[29097,1],[29099,2],[29102,2],[29118,1],[29120,1],[29130,2],[29225,1],[29232,2],[29324,1],[29336,2],[29415,2],[29423,1],[29425,1],[29441,1],[29462,2],[29534,2],[29653,1],[29708,1],[29742,1],[29744,2],[29846,1],[29874,1],[29886,1],[29942,2],[29999,1],[30053,2],[30158,1],[30212,2],[30339,1],[30393,2],[30436,2],[30453,1],[30489,1],[30491,1],[30505,1],[30530,1],[30553,1],[30586,2],[30598,1],[30623,1],[30630,1],[30655,1],[30674,1],[30697,2],[30713,1],[30753,2],[30773,1],[30799,1],[30970,1],[31016,1],[31052,1],[31109,1],[31143,1],[31248,1],[31281,1],[31409,1],[31443,1],[31485,1],[31487,1],[31611,1],[31691,1],[31693,1],[31751,1],[31758,1],[31846,1],[31857,1],[31897,1],[31916,1],[32217,1],[32480,1],[32524,1],[32526,1],[32617,1],[32766,1],[32807,1],[32823,2],[32866,1],[32878,2],[32913,1],[32936,2],[32992,1],[33024,2]]},"651":{"position":[[276,1],[323,1],[325,1],[342,2],[345,1],[380,1],[392,1],[413,1],[436,1],[438,2],[451,1],[461,2],[464,1],[466,2],[481,1],[496,1],[508,1],[541,1],[543,1],[560,2],[563,1],[602,1],[604,1],[606,1],[608,1],[610,1],[612,2],[615,1],[646,1],[658,1],[668,2],[671,1],[673,2],[688,1],[703,1],[715,1],[748,1],[750,1],[767,1],[769,1],[771,1],[773,1],[775,1],[777,1],[779,1],[781,1],[1131,1],[1133,1],[1209,2],[1212,1],[1398,2],[1470,2],[1494,1],[1510,1],[1512,1],[1539,2],[1639,1],[1700,2],[1784,2],[1964,2],[2007,3],[2011,2],[2032,1],[2042,1],[2044,1],[2138,2],[2141,1],[2198,3],[2202,2],[2213,1],[2240,2],[2319,1],[2321,1],[2363,1],[2377,1],[2379,2],[2478,2],[2552,2],[2637,2],[2770,2],[2944,2],[2987,2],[2997,2],[3004,1],[3006,2],[3009,2],[3025,1],[3027,1],[3037,2],[3132,1],[3139,2],[3230,1],[3242,2],[3321,2],[3329,1],[3331,1],[3348,1],[3369,2],[3441,2],[3560,1],[3615,1],[3649,1],[3651,2],[3753,1],[3781,1],[3793,1],[3849,2],[3906,1],[3960,2],[4065,1],[4119,2],[4246,1],[4300,2],[4343,2],[4360,1],[4396,1],[4398,1],[4412,1],[4437,1],[4460,1],[4493,2],[4505,1],[4530,1],[4537,1],[4561,1],[4580,1],[4603,2],[4619,1],[4659,2],[4679,1],[4706,1],[4877,1],[4923,1],[4959,1],[5016,1],[5050,1],[5155,1],[5188,1],[5316,1],[5350,1],[5392,1],[5394,1],[5518,1],[5598,1],[5600,1],[5658,1],[5665,1],[5752,1],[5763,1],[5803,1],[5822,1],[6123,1],[6387,1],[6431,1],[6433,1],[6524,1],[6672,1],[6714,1],[6729,2],[6771,1],[6783,2],[6818,1],[6841,2],[6897,1],[6929,2],[7380,1],[7382,1],[7455,2],[7458,1],[7647,2],[7719,2],[7743,1],[7759,1],[7761,1],[7788,2],[7888,1],[7949,2],[8033,2],[8213,2],[8256,3],[8260,2],[8281,1],[8291,1],[8293,1],[8390,2],[8393,1],[8450,3],[8454,2],[8465,1],[8492,2],[8571,1],[8573,1],[8615,1],[8629,1],[8631,2],[8730,2],[8804,2],[8889,2],[9022,2],[9196,2],[9239,2],[9249,2],[9256,1],[9258,2],[9261,2],[9277,1],[9279,1],[9289,2],[9384,1],[9391,2],[9485,1],[9497,2],[9576,2],[9584,1],[9586,1],[9603,1],[9624,2],[9696,2],[9815,1],[9870,1],[9904,1],[9906,2],[10008,1],[10036,1],[10048,1],[10104,2],[10161,1],[10215,2],[10320,1],[10374,2],[10501,1],[10555,2],[10598,2],[10615,1],[10651,1],[10653,1],[10667,1],[10692,1],[10715,1],[10748,2],[10760,1],[10785,1],[10792,1],[10819,1],[10838,1],[10861,2],[10877,1],[10917,2],[10937,1],[10964,1],[11135,1],[11181,1],[11217,1],[11274,1],[11308,1],[11413,1],[11446,1],[11574,1],[11608,1],[11650,1],[11652,1],[11776,1],[11856,1],[11858,1],[11916,1],[11923,1],[12013,1],[12024,1],[12064,1],[12083,1],[12387,1],[12651,1],[12695,1],[12697,1],[12788,1],[12939,1],[12981,1],[12999,2],[13044,1],[13056,2],[13091,1],[13114,2],[13170,1],[13202,2],[13638,1],[13640,1],[13712,2],[13715,1],[13801,2],[13804,1],[13991,2],[14063,2],[14087,1],[14103,1],[14105,1],[14132,2],[14232,1],[14293,2],[14377,2],[14557,2],[14600,3],[14604,2],[14625,1],[14635,1],[14637,1],[14732,2],[14735,1],[14792,3],[14796,2],[14807,1],[14834,2],[14913,1],[14915,1],[14957,1],[14971,1],[14973,2],[15072,2],[15146,2],[15231,2],[15364,2],[15538,2],[15581,2],[15591,2],[15598,1],[15600,2],[15603,2],[15619,1],[15621,1],[15631,2],[15726,1],[15733,2],[15825,1],[15837,2],[15916,2],[15924,1],[15926,1],[15943,1],[15964,2],[16036,2],[16155,1],[16210,1],[16244,1],[16246,2],[16348,1],[16376,1],[16388,1],[16444,2],[16501,1],[16555,2],[16660,1],[16714,2],[16841,1],[16895,2],[16938,2],[16955,1],[16991,1],[16993,1],[17007,1],[17032,1],[17055,1],[17088,2],[17100,1],[17125,1],[17132,1],[17157,1],[17176,1],[17199,2],[17215,1],[17255,2],[17275,1],[17302,1],[17473,1],[17519,1],[17555,1],[17612,1],[17646,1],[17751,1],[17784,1],[17912,1],[17946,1],[17988,1],[17990,1],[18114,1],[18194,1],[18196,1],[18254,1],[18261,1],[18349,1],[18360,1],[18400,1],[18419,1],[18721,1],[18985,1],[19029,1],[19031,1],[19122,1],[19271,1],[19313,1],[19329,2],[19372,1],[19384,2],[19419,1],[19442,2],[19498,1],[19530,2],[20041,1],[20043,1],[20121,2],[20124,1],[20314,2],[20386,2],[20410,1],[20426,1],[20428,1],[20455,2],[20555,1],[20616,2],[20700,2],[20880,2],[20923,3],[20927,2],[20948,1],[20958,1],[20960,1],[21056,2],[21059,1],[21116,3],[21120,2],[21131,1],[21157,2],[21236,1],[21238,1],[21280,1],[21294,1],[21296,2],[21395,2],[21469,2],[21554,2],[21687,2],[21861,2],[21904,2],[21914,2],[21921,1],[21923,2],[21926,2],[21942,1],[21944,1],[21954,2],[22049,1],[22056,2],[22149,1],[22161,2],[22240,2],[22248,1],[22250,1],[22266,1],[22287,2],[22359,2],[22478,1],[22533,1],[22567,1],[22569,2],[22671,1],[22699,1],[22711,1],[22767,2],[22824,1],[22878,2],[22983,1],[23037,2],[23164,1],[23218,2],[23261,2],[23278,1],[23314,1],[23316,1],[23330,1],[23355,1],[23378,1],[23411,2],[23423,1],[23448,1],[23455,1],[23481,1],[23500,1],[23523,2],[23539,1],[23579,2],[23599,1],[23625,1],[23796,1],[23842,1],[23878,1],[23935,1],[23969,1],[24074,1],[24107,1],[24235,1],[24269,1],[24311,1],[24313,1],[24437,1],[24517,1],[24519,1],[24577,1],[24584,1],[24673,1],[24684,1],[24724,1],[24743,1],[25045,1],[25308,1],[25352,1],[25354,1],[25445,1],[25595,1],[25636,1],[25653,2],[25697,1],[25709,2],[25744,1],[25767,2],[25823,1],[25855,2]]},"659":{"position":[[782,1],[941,1]]},"661":{"position":[[1296,1],[1343,1],[1345,1],[1362,2],[1365,1],[1404,1],[1416,1],[1426,2],[1429,2],[1451,1],[1461,2],[1464,2],[1485,1],[1495,2],[1498,1],[1500,2],[1515,1],[1530,1],[1542,1],[1575,1],[1577,1],[1594,1],[1596,1],[1598,2],[1620,1],[1653,1],[1655,1],[1672,1],[1674,1],[1676,2],[1697,1],[1730,1],[1732,1],[1749,1],[1751,1],[1753,1],[1755,1],[1757,1],[1759,2],[1762,1],[1796,1],[1807,1],[1817,2],[1820,2],[1834,1],[1844,2],[1847,2],[1861,1],[1881,1],[1895,1],[1907,3],[1931,2],[1953,1],[1965,3],[1999,1],[2001,1],[2003,2],[2016,1],[2027,1],[2038,1],[2040,1],[2060,1],[2074,1],[2086,3],[2110,2],[2132,1],[2144,3],[2177,1],[2179,1],[2181,2],[2184,1],[2204,1],[2218,1],[2230,3],[2256,2],[2278,1],[2290,3],[2323,1],[2325,1],[2327,2],[2330,1],[2351,1],[2363,3],[2389,1],[2391,1],[2393,1],[2395,1],[2397,2],[2414,1],[2435,1],[2447,3],[2473,1],[2475,2],[2490,1],[2511,1],[2523,3],[2548,1],[2550,2],[2565,1],[2586,1],[2598,3],[2623,1],[2625,1],[2627,2],[2642,1],[2657,1],[2668,1],[2701,1],[2703,1],[2728,1],[2730,1],[2732,2],[2746,1],[2779,1],[2781,1],[2806,1],[2808,1],[2810,1],[2812,1],[2814,1],[2816,1],[2818,1],[2820,1],[3233,1],[3235,2],[3290,1],[3367,2],[3422,1],[3499,2],[3554,1],[3631,2],[3686,1],[3763,2],[3818,1],[3895,2],[3928,1],[3995,2],[4038,1],[4107,2],[4110,2],[4113,1],[4169,3],[4181,2],[4276,1],[4283,2],[4343,1],[4345,2],[4531,2],[4534,1],[4536,2],[4722,2],[4725,1],[4727,2],[4913,2],[4916,1],[4918,2],[5104,2],[5107,1],[5109,2],[5295,2],[5298,1],[5300,2],[5454,2],[5457,1],[5459,2],[5625,2],[5628,1],[5630,1],[5642,2],[5735,2],[5742,1],[5744,2],[5747,2],[5763,1],[5777,1],[5808,1],[5831,1],[5864,2],[5876,1],[5903,1],[5912,1],[5941,1],[5943,2],[6004,1],[6011,1],[6035,1],[6063,1],[6082,2],[6085,2],[6146,1],[6153,1],[6177,1],[6205,1],[6224,2],[6227,2],[6288,1],[6295,1],[6319,1],[6347,1],[6366,2],[6369,2],[6430,1],[6437,1],[6461,1],[6489,1],[6508,2],[6511,2],[6572,1],[6579,1],[6603,1],[6631,1],[6650,2],[6653,2],[6692,1],[6699,1],[6728,1],[6746,1],[6760,2],[6763,2],[6812,1],[6819,1],[6848,1],[6868,1],[6882,1],[6884,2],[6887,2],[6903,1],[6951,1],[6953,1],[7011,1],[7018,1],[7025,1],[7069,1],[7194,2],[7210,1],[7335,2],[7351,1],[7476,2],[7492,1],[7617,2],[7633,1],[7758,2],[7774,1],[7867,2],[7883,1],[7988,3],[7992,2],[7995,2],[7998,1],[8009,1],[8105,1],[8149,1],[8151,1],[8242,1],[8259,1],[8274,1],[8792,2],[9704,2],[9759,1],[9837,2],[9840,2],[9895,1],[9973,2],[9976,2],[10031,1],[10109,2],[10112,2],[10167,1],[10245,2],[10248,2],[10303,1],[10381,2],[10384,2],[10417,1],[10485,2],[10488,2],[10531,1],[10601,1],[10603,2]]},"667":{"position":[[272,2],[293,1],[303,1],[305,1],[393,2],[396,1],[453,3],[457,2],[468,1],[483,2],[578,1],[585,2],[670,1],[682,2],[761,2],[769,1],[771,1],[787,1],[801,1],[826,1],[849,1],[882,2],[894,1],[919,1],[926,1],[950,1],[971,1],[986,2],[1002,1],[1042,2],[1062,1],[1077,1],[1079,1],[1137,1],[1144,1],[1225,1],[1236,1],[1276,1],[1295,1],[1411,1],[1496,1],[1540,1],[1542,1],[1633,1],[1775,1],[1816,1],[1831,2],[1873,1],[1887,2],[1924,1],[1939,2],[1987,1],[2019,2],[2103,2],[2124,1],[2134,1],[2136,1],[2226,2],[2229,1],[2286,3],[2290,2],[2301,1],[2316,2],[2411,1],[2418,2],[2505,1],[2517,2],[2596,2],[2604,1],[2606,1],[2622,1],[2636,1],[2661,1],[2684,1],[2717,2],[2729,1],[2754,1],[2761,1],[2785,1],[2808,1],[2823,2],[2839,1],[2879,2],[2899,1],[2914,1],[2916,1],[2974,1],[2981,1],[3064,1],[3075,1],[3115,1],[3134,1],[3252,1],[3337,1],[3381,1],[3383,1],[3474,1],[3618,1],[3659,1],[3674,2],[3716,1],[3732,2],[3771,1],[3786,2],[3834,1],[3866,2],[3893,1],[3962,2],[3983,1],[3993,1],[3995,1],[4083,2],[4086,1],[4143,3],[4147,2],[4158,1],[4173,2],[4268,1],[4275,2],[4360,1],[4372,2],[4451,2],[4459,1],[4461,1],[4477,1],[4491,1],[4516,1],[4539,1],[4572,2],[4584,1],[4609,1],[4616,1],[4640,1],[4661,1],[4676,2],[4692,1],[4732,2],[4752,1],[4767,1],[4769,1],[4827,1],[4834,1],[4915,1],[4926,1],[4966,1],[4985,1],[5101,1],[5186,1],[5230,1],[5232,1],[5323,1],[5465,1],[5506,1],[5521,2],[5563,1],[5577,2],[5614,1],[5629,2],[5677,1],[5709,2],[5724,1],[5798,2],[5819,1],[5829,1],[5831,1],[5921,2],[5924,1],[5981,3],[5985,2],[5996,1],[6012,2],[6107,1],[6114,2],[6201,1],[6213,2],[6292,2],[6300,1],[6302,1],[6319,1],[6333,1],[6358,1],[6381,1],[6414,2],[6426,1],[6451,1],[6458,1],[6482,1],[6505,1],[6520,2],[6536,1],[6576,2],[6596,1],[6612,1],[6614,1],[6672,1],[6679,1],[6762,1],[6773,1],[6813,1],[6832,1],[6951,1],[7037,1],[7081,1],[7083,1],[7174,1],[7318,1],[7360,1],[7375,2],[7417,1],[7433,2],[7472,1],[7487,2],[7535,1],[7567,2],[7583,1],[7655,2],[7676,1],[7686,1],[7688,1],[7776,2],[7779,1],[7836,3],[7840,2],[7851,1],[7867,2],[7962,1],[7969,2],[8054,1],[8066,2],[8145,2],[8153,1],[8155,1],[8172,1],[8186,1],[8211,1],[8234,1],[8267,2],[8279,1],[8304,1],[8311,1],[8335,1],[8356,1],[8371,2],[8387,1],[8427,2],[8447,1],[8463,1],[8465,1],[8523,1],[8530,1],[8611,1],[8622,1],[8662,1],[8681,1],[8798,1],[8884,1],[8928,1],[8930,1],[9021,1],[9163,1],[9205,1],[9220,2],[9262,1],[9276,2],[9313,1],[9328,2],[9376,1],[9408,2],[9424,1],[9498,2],[9519,1],[9529,1],[9531,1],[9621,2],[9624,1],[9681,3],[9685,2],[9696,1],[9712,2],[9807,1],[9814,2],[9901,1],[9913,2],[9992,2],[10000,1],[10002,1],[10019,1],[10033,1],[10058,1],[10081,1],[10114,2],[10126,1],[10151,1],[10158,1],[10182,1],[10205,1],[10220,2],[10236,1],[10276,2],[10296,1],[10312,1],[10314,1],[10372,1],[10379,1],[10462,1],[10473,1],[10513,1],[10532,1],[10651,1],[10737,1],[10781,1],[10783,1],[10874,1],[11018,1],[11060,1],[11075,2],[11117,1],[11133,2],[11172,1],[11187,2],[11235,1],[11267,2]]},"669":{"position":[[1343,1],[1382,1],[1394,1],[1404,2],[1407,2],[1429,1],[1447,1],[1458,1],[1460,1],[1470,2],[1473,2],[1476,1],[1497,1],[1509,3],[1543,1],[1545,1],[1547,1],[1549,1],[1551,2],[1577,1],[1588,1],[1599,1],[1601,1],[1611,2],[1614,2],[1617,1],[1638,1],[1650,3],[1684,1],[1686,1],[1688,1],[1690,1],[1692,2],[1713,1],[1731,1],[1742,1],[1744,1],[1765,1],[1777,3],[1815,1],[1817,2],[1820,1],[1841,1],[1853,3],[1887,1],[1889,1],[1891,1],[1893,1],[1895,2],[1917,1],[1927,2],[1930,1],[1932,2],[1947,1],[1962,1],[1974,1],[2007,1],[2009,1],[2026,1],[2028,1],[2030,2],[2052,1],[2085,1],[2087,1],[2104,1],[2106,1],[2108,2],[2134,1],[2167,1],[2169,1],[2186,1],[2188,1],[2190,2],[2212,1],[2245,1],[2247,1],[2264,1],[2266,1],[2268,1],[2270,1],[2272,1],[2274,1],[2850,2],[2871,1],[2881,1],[2883,1],[2971,2],[2974,1],[3031,3],[3035,2],[3046,1],[3062,2],[3157,1],[3164,2],[3249,1],[3261,2],[3340,2],[3348,1],[3350,1],[3367,1],[3381,1],[3406,1],[3429,1],[3462,2],[3474,1],[3499,1],[3506,1],[3530,1],[3551,1],[3566,2],[3582,1],[3622,2],[3642,1],[3658,1],[3660,1],[3718,1],[3725,1],[3806,1],[3817,1],[3857,1],[3876,1],[3993,1],[4079,1],[4123,1],[4125,1],[4216,1],[4358,1],[4400,1],[4415,2],[4457,1],[4471,2],[4508,1],[4523,2],[4571,1],[4603,2],[4797,2],[4869,2],[4893,1],[4909,1],[4911,1],[4938,2],[5038,1],[5099,2],[5183,2],[5363,2],[5406,3],[5442,1],[5444,2],[5502,1],[5579,2],[5582,2],[5585,1],[5641,3],[5664,2],[5743,1],[5745,1],[5787,1],[5801,1],[5803,2],[5902,2],[5976,2],[6061,2],[6194,2],[6368,2],[6411,2],[6421,2],[6428,1],[6430,2],[6433,2],[6449,1],[6451,1],[6461,2],[6556,1],[6563,2],[6623,1],[6625,2],[6814,2],[6817,1],[6819,1],[6831,2],[6924,2],[6931,1],[6933,2],[6936,2],[6952,1],[6973,2],[7045,2],[7164,1],[7219,1],[7253,1],[7255,2],[7357,1],[7385,1],[7397,1],[7453,2],[7510,1],[7564,2],[7669,1],[7723,2],[7850,1],[7904,2],[7947,2],[7964,1],[8000,1],[8002,1],[8016,1],[8047,1],[8070,1],[8103,2],[8115,1],[8142,1],[8151,1],[8180,1],[8182,2],[8246,1],[8253,1],[8277,1],[8305,1],[8324,1],[8326,2],[8329,2],[8345,1],[8404,1],[8575,1],[8621,1],[8657,1],[8714,1],[8748,1],[8853,1],[8886,1],[9014,1],[9048,1],[9090,1],[9092,1],[9216,1],[9296,1],[9298,1],[9356,1],[9363,1],[9370,1],[9414,1],[9542,3],[9546,2],[9549,2],[9552,1],[9563,1],[9837,1],[9881,1],[9883,1],[9974,1],[9991,1],[10006,1],[10086,2],[10456,2],[10514,1],[10592,1],[10594,2],[10740,2],[10761,1],[10771,1],[10773,1],[10861,2],[10864,1],[10921,3],[10925,2],[10936,1],[10951,2],[11046,1],[11053,2],[11138,1],[11150,2],[11229,2],[11237,1],[11239,1],[11255,1],[11269,1],[11294,1],[11317,1],[11350,2],[11362,1],[11387,1],[11394,1],[11418,1],[11439,1],[11454,2],[11470,1],[11510,2],[11530,1],[11545,1],[11547,1],[11605,1],[11612,1],[11693,1],[11704,1],[11744,1],[11763,1],[11879,1],[11964,1],[12008,1],[12010,1],[12101,1],[12243,1],[12284,1],[12299,2],[12341,1],[12355,2],[12392,1],[12407,2],[12455,1],[12487,2]]},"671":{"position":[[1188,2],[1260,2],[1284,1],[1300,1],[1302,1],[1329,2],[1429,1],[1490,2],[1574,2],[1754,2],[1797,3],[1834,1],[1836,2],[1921,1],[1998,2],[2001,2],[2004,1],[2060,3],[2083,2],[2162,1],[2164,1],[2206,1],[2220,1],[2222,2],[2321,2],[2395,2],[2480,2],[2613,2],[2787,2],[2830,2],[2840,2],[2847,1],[2849,2],[2852,2],[2868,1],[2870,1],[2880,2],[2975,1],[2982,2],[3043,1],[3045,2],[3261,2],[3264,1],[3266,1],[3278,2],[3371,2],[3378,1],[3380,2],[3383,2],[3399,1],[3420,2],[3492,2],[3611,1],[3666,1],[3700,1],[3702,2],[3804,1],[3832,1],[3844,1],[3900,2],[3957,1],[4011,2],[4116,1],[4170,2],[4297,1],[4351,2],[4394,2],[4411,1],[4447,1],[4449,1],[4463,1],[4494,1],[4517,1],[4550,2],[4562,1],[4589,1],[4599,1],[4628,1],[4630,2],[4721,1],[4728,1],[4752,1],[4780,1],[4799,1],[4801,2],[4804,2],[4820,1],[4879,1],[5050,1],[5096,1],[5132,1],[5189,1],[5223,1],[5328,1],[5361,1],[5489,1],[5523,1],[5565,1],[5567,1],[5691,1],[5771,1],[5773,1],[5831,1],[5838,1],[5845,1],[5891,1],[6046,4],[6051,2],[6054,2],[6057,1],[6068,1],[6342,1],[6386,1],[6388,1],[6479,1],[6497,1],[6512,1],[6592,2],[6925,2],[7010,1],[7088,1],[7090,2],[7294,2],[7315,1],[7325,1],[7327,1],[7434,1],[7436,1],[7511,1],[7513,3],[7517,1],[7574,3],[7578,2],[7589,1],[7604,2],[7699,1],[7706,2],[7828,1],[7904,1],[7906,1],[7908,1],[7920,2],[7999,2],[8007,1],[8009,1],[8025,1],[8039,1],[8064,1],[8087,1],[8120,2],[8132,1],[8157,1],[8164,1],[8188,1],[8209,1],[8242,1],[8350,2],[8353,2],[8369,1],[8409,2],[8429,1],[8444,1],[8446,1],[8504,1],[8511,1],[8698,2],[8701,1],[8712,1],[8752,1],[8771,1],[8950,1],[9035,1],[9079,1],[9081,1],[9172,1],[9427,1],[9468,1],[9483,2],[9525,1],[9539,2],[9576,1],[9591,2],[9640,1],[9642,1],[9644,2],[9684,1],[9708,1],[9736,1],[9756,2],[9776,1],[9808,2],[9965,2],[9986,1],[9996,1],[9998,1],[10105,1],[10107,1],[10182,1],[10184,3],[10188,1],[10245,3],[10249,2],[10260,1],[10276,2],[10371,1],[10378,2],[10500,1],[10576,1],[10578,1],[10580,1],[10592,2],[10671,2],[10679,1],[10681,1],[10698,1],[10712,1],[10737,1],[10760,1],[10793,2],[10805,1],[10830,1],[10837,1],[10861,1],[10882,1],[10915,1],[11023,2],[11026,2],[11042,1],[11082,2],[11102,1],[11118,1],[11120,1],[11178,1],[11185,1],[11372,2],[11375,1],[11386,1],[11426,1],[11445,1],[11625,1],[11711,1],[11755,1],[11757,1],[11848,1],[12103,1],[12145,1],[12160,2],[12202,1],[12216,2],[12253,1],[12268,2],[12317,1],[12319,1],[12321,2],[12361,1],[12385,1],[12413,1],[12433,2],[12453,1],[12485,2]]},"673":{"position":[[634,1],[681,1],[683,1],[700,2],[703,1],[742,1],[754,1],[764,2],[767,2],[789,1],[807,1],[818,1],[820,1],[830,2],[833,2],[836,1],[857,1],[869,3],[903,1],[905,1],[907,1],[909,1],[911,2],[937,1],[948,1],[959,1],[961,1],[971,2],[974,2],[977,1],[998,1],[1010,3],[1044,1],[1046,1],[1048,1],[1050,1],[1052,2],[1073,1],[1091,1],[1102,1],[1104,1],[1125,1],[1137,3],[1175,1],[1177,2],[1180,1],[1201,1],[1213,3],[1247,1],[1249,1],[1251,1],[1253,1],[1255,2],[1277,1],[1287,2],[1290,1],[1292,2],[1307,1],[1322,1],[1334,1],[1367,1],[1369,1],[1386,1],[1388,1],[1390,2],[1412,1],[1445,1],[1447,1],[1464,1],[1466,1],[1468,2],[1494,1],[1527,1],[1529,1],[1546,1],[1548,1],[1550,2],[1572,1],[1605,1],[1607,1],[1624,1],[1626,1],[1628,1],[1630,1],[1632,1],[1634,2],[1637,1],[1671,1],[1682,1],[1692,2],[1695,2],[1709,1],[1719,2],[1722,2],[1736,1],[1756,1],[1770,1],[1782,3],[1806,2],[1828,1],[1840,3],[1874,1],[1876,1],[1878,2],[1891,1],[1902,1],[1913,1],[1915,1],[1936,1],[1948,3],[1974,1],[1976,2],[1979,1],[1999,1],[2013,1],[2025,3],[2049,2],[2071,1],[2083,3],[2116,1],[2118,1],[2120,2],[2123,1],[2143,1],[2157,1],[2169,3],[2195,2],[2217,1],[2229,3],[2262,1],[2264,1],[2266,1],[2268,1],[2270,1],[2272,2],[2289,1],[2310,1],[2322,3],[2348,1],[2350,2],[2365,1],[2386,1],[2398,3],[2423,1],[2425,2],[2440,1],[2461,1],[2473,3],[2498,1],[2500,1],[2502,2],[2517,1],[2532,1],[2543,1],[2576,1],[2578,1],[2603,1],[2605,1],[2607,2],[2621,1],[2654,1],[2656,1],[2681,1],[2683,1],[2685,1],[2687,1],[2689,1],[2691,1],[2693,1],[2695,1],[2772,1],[2774,2],[2829,1],[2906,2],[2961,1],[3038,2],[3093,1],[3170,2],[3225,1],[3302,2],[3357,1],[3434,2],[3467,1],[3534,2],[3577,1],[3646,2],[3649,2],[3652,1],[3708,3],[3720,2],[3815,1],[3822,2],[3882,1],[3884,2],[4070,2],[4073,1],[4075,2],[4261,2],[4264,1],[4266,2],[4452,2],[4455,1],[4457,2],[4643,2],[4646,1],[4648,2],[4834,2],[4837,1],[4839,2],[4993,2],[4996,1],[4998,2],[5164,2],[5167,1],[5169,1],[5181,2],[5274,2],[5281,1],[5283,2],[5286,2],[5302,1],[5316,1],[5347,1],[5370,1],[5403,2],[5415,1],[5442,1],[5451,1],[5480,1],[5482,2],[5543,1],[5550,1],[5574,1],[5602,1],[5621,2],[5624,2],[5685,1],[5692,1],[5716,1],[5744,1],[5763,2],[5766,2],[5827,1],[5834,1],[5858,1],[5886,1],[5905,2],[5908,2],[5969,1],[5976,1],[6000,1],[6028,1],[6047,2],[6050,2],[6111,1],[6118,1],[6142,1],[6170,1],[6189,2],[6192,2],[6231,1],[6238,1],[6267,1],[6285,1],[6299,2],[6302,2],[6351,1],[6358,1],[6387,1],[6407,1],[6421,1],[6423,2],[6426,2],[6442,1],[6490,1],[6492,1],[6550,1],[6557,1],[6564,1],[6608,1],[6733,2],[6749,1],[6874,2],[6890,1],[7015,2],[7031,1],[7156,2],[7172,1],[7297,2],[7313,1],[7406,2],[7422,1],[7527,3],[7531,2],[7534,2],[7537,1],[7548,1],[7644,1],[7688,1],[7690,1],[7781,1],[7798,1],[7813,1],[8331,2],[9243,2],[9298,1],[9376,2],[9379,2],[9434,1],[9512,2],[9515,2],[9570,1],[9648,2],[9651,2],[9706,1],[9784,2],[9787,2],[9842,1],[9920,2],[9923,2],[9956,1],[10024,2],[10027,2],[10070,1],[10140,1],[10142,2]]},"679":{"position":[[391,1],[438,1],[440,1],[457,2],[460,1],[491,1],[502,1],[512,2],[515,2],[528,1],[538,2],[541,1],[543,2],[558,1],[573,1],[584,1],[617,1],[619,1],[636,1],[638,1],[640,2],[653,1],[686,1],[688,1],[705,1],[707,1],[709,1],[711,1],[713,1],[715,1],[717,1],[719,1],[920,1]]},"681":{"position":[[134,1]]},"687":{"position":[[369,1],[416,1],[418,1],[435,2],[438,1],[469,1],[480,1],[490,2],[493,2],[506,1],[516,2],[519,1],[521,2],[536,1],[551,1],[562,1],[595,1],[597,1],[614,1],[616,1],[618,2],[631,1],[664,1],[666,1],[683,1],[685,1],[687,1],[689,1],[691,1],[693,1],[695,1],[697,1]]},"689":{"position":[[908,1],[955,1],[957,1],[974,2],[977,1],[1008,1],[1019,1],[1029,2],[1032,2],[1045,1],[1055,2],[1058,2],[1078,1],[1099,1],[1121,1],[1123,2],[1144,1],[1155,1],[1166,1],[1168,1],[1189,1],[1212,1],[1214,2],[1217,1],[1238,1],[1260,1],[1262,1],[1264,1],[1266,1],[1268,1],[1270,2],[1285,1],[1300,1],[1311,1],[1344,1],[1346,1],[1363,1],[1365,1],[1367,2],[1380,1],[1413,1],[1415,1],[1432,1],[1434,1],[1436,1],[1438,1],[1440,1],[1442,1],[1444,1],[1446,1]]},"691":{"position":[[417,2],[489,2],[513,1],[529,1],[531,1],[558,2],[658,1],[719,2],[803,2],[983,2],[1026,3],[1062,1],[1064,2],[1100,1],[1164,2],[1201,1],[1266,2],[1269,2],[1272,1],[1328,3],[1351,2],[1430,1],[1432,1],[1474,1],[1488,1],[1490,2],[1589,2],[1663,2],[1748,2],[1881,2],[2055,2],[2098,2],[2108,2],[2115,1],[2117,2],[2120,2],[2136,1],[2138,1],[2148,2],[2243,1],[2250,2],[2310,1],[2312,2],[2466,2],[2469,1],[2471,2],[2627,2],[2630,1],[2632,1],[2644,2],[2737,2],[2744,1],[2746,2],[2749,2],[2765,1],[2786,2],[2858,2],[2977,1],[3032,1],[3066,1],[3068,2],[3170,1],[3198,1],[3210,1],[3266,2],[3323,1],[3377,2],[3482,1],[3536,2],[3663,1],[3717,2],[3760,2],[3777,1],[3813,1],[3815,1],[3829,1],[3860,1],[3883,1],[3916,2],[3928,1],[3955,1],[3964,1],[3993,1],[3995,2],[4037,1],[4044,1],[4067,1],[4086,1],[4102,2],[4105,2],[4148,1],[4155,1],[4180,1],[4198,1],[4214,1],[4216,2],[4219,2],[4235,1],[4294,1],[4465,1],[4511,1],[4547,1],[4604,1],[4638,1],[4743,1],[4776,1],[4904,1],[4938,1],[4980,1],[4982,1],[5106,1],[5186,1],[5188,1],[5246,1],[5253,1],[5260,1],[5304,1],[5397,2],[5413,1],[5508,3],[5512,2],[5515,2],[5518,1],[5529,1],[5803,1],[5847,1],[5849,1],[5940,1],[5957,1],[5972,1],[6103,2],[6571,2],[6607,1],[6672,2],[6675,2],[6712,1],[6778,1],[6780,2],[6965,2],[7037,2],[7061,1],[7077,1],[7079,1],[7106,2],[7206,1],[7267,2],[7351,2],[7531,2],[7574,3],[7578,2],[7599,1],[7609,1],[7611,1],[7706,2],[7709,1],[7766,3],[7770,2],[7781,1],[7807,2],[7886,1],[7888,1],[7930,1],[7944,1],[7946,2],[8045,2],[8119,2],[8204,2],[8337,2],[8511,2],[8554,2],[8564,2],[8571,1],[8573,2],[8576,2],[8592,1],[8594,1],[8604,2],[8699,1],[8706,2],[8798,1],[8810,2],[8889,2],[8897,1],[8899,1],[8915,1],[8936,2],[9008,2],[9127,1],[9182,1],[9216,1],[9218,2],[9320,1],[9348,1],[9360,1],[9416,2],[9473,1],[9527,2],[9632,1],[9686,2],[9813,1],[9867,2],[9910,2],[9927,1],[9963,1],[9965,1],[9979,1],[10004,1],[10027,1],[10060,2],[10072,1],[10097,1],[10104,1],[10127,1],[10154,1],[10171,2],[10187,1],[10227,2],[10247,1],[10273,1],[10444,1],[10490,1],[10526,1],[10583,1],[10617,1],[10722,1],[10755,1],[10883,1],[10917,1],[10959,1],[10961,1],[11085,1],[11165,1],[11167,1],[11225,1],[11232,1],[11320,1],[11331,1],[11371,1],[11390,1],[11691,1],[11954,1],[11998,1],[12000,1],[12091,1],[12240,1],[12281,1],[12295,2],[12336,1],[12356,2],[12399,1],[12416,2],[12466,1],[12498,2],[12960,2],[13032,2],[13056,1],[13072,1],[13074,1],[13101,2],[13201,1],[13262,2],[13346,2],[13526,2],[13569,3],[13573,2],[13594,1],[13604,1],[13606,1],[13700,2],[13703,1],[13760,3],[13764,2],[13775,1],[13802,2],[13881,1],[13883,1],[13925,1],[13939,1],[13941,2],[14040,2],[14114,2],[14199,2],[14332,2],[14506,2],[14549,2],[14559,2],[14566,1],[14568,2],[14571,2],[14587,1],[14589,1],[14599,2],[14694,1],[14701,2],[14792,1],[14804,2],[14883,2],[14891,1],[14893,1],[14910,1],[14931,2],[15003,2],[15122,1],[15177,1],[15211,1],[15213,2],[15315,1],[15343,1],[15355,1],[15411,2],[15468,1],[15522,2],[15627,1],[15681,2],[15808,1],[15862,2],[15905,2],[15922,1],[15958,1],[15960,1],[15974,1],[15999,1],[16022,1],[16055,2],[16067,1],[16092,1],[16099,1],[16122,1],[16148,1],[16165,2],[16181,1],[16221,2],[16241,1],[16268,1],[16439,1],[16485,1],[16521,1],[16578,1],[16612,1],[16717,1],[16750,1],[16878,1],[16912,1],[16954,1],[16956,1],[17080,1],[17160,1],[17162,1],[17220,1],[17227,1],[17314,1],[17325,1],[17365,1],[17384,1],[17685,1],[17949,1],[17993,1],[17995,1],[18086,1],[18234,1],[18276,1],[18290,2],[18331,1],[18350,2],[18392,1],[18409,2],[18459,1],[18491,2],[18646,2],[18718,2],[18742,1],[18758,1],[18760,1],[18787,2],[18887,1],[18948,2],[19032,2],[19212,2],[19255,3],[19259,2],[19280,1],[19290,1],[19292,1],[19389,2],[19392,1],[19449,3],[19453,2],[19464,1],[19490,2],[19569,1],[19571,1],[19613,1],[19627,1],[19629,2],[19728,2],[19802,2],[19887,2],[20020,2],[20194,2],[20237,2],[20247,2],[20254,1],[20256,2],[20259,2],[20275,1],[20277,1],[20287,2],[20382,1],[20389,2],[20483,1],[20495,2],[20574,2],[20582,1],[20584,1],[20600,1],[20621,2],[20693,2],[20812,1],[20867,1],[20901,1],[20903,2],[21005,1],[21033,1],[21045,1],[21101,2],[21158,1],[21212,2],[21317,1],[21371,2],[21498,1],[21552,2],[21595,2],[21612,1],[21648,1],[21650,1],[21664,1],[21689,1],[21712,1],[21745,2],[21757,1],[21782,1],[21789,1],[21814,1],[21841,1],[21858,2],[21874,1],[21914,2],[21934,1],[21960,1],[22131,1],[22177,1],[22213,1],[22270,1],[22304,1],[22409,1],[22442,1],[22570,1],[22604,1],[22646,1],[22648,1],[22772,1],[22852,1],[22854,1],[22912,1],[22919,1],[23009,1],[23020,1],[23060,1],[23079,1],[23382,1],[23645,1],[23689,1],[23691,1],[23782,1],[23933,1],[23974,1],[23990,2],[24033,1],[24053,2],[24096,1],[24113,2],[24163,1],[24195,2],[24272,2],[24344,2],[24368,1],[24384,1],[24386,1],[24413,2],[24513,1],[24574,2],[24658,2],[24838,2],[24881,3],[24885,2],[24906,1],[24916,1],[24918,1],[25014,2],[25017,1],[25074,3],[25078,2],[25089,1],[25115,2],[25194,1],[25196,1],[25238,1],[25252,1],[25254,2],[25353,2],[25427,2],[25512,2],[25645,2],[25819,2],[25862,2],[25872,2],[25879,1],[25881,2],[25884,2],[25900,1],[25902,1],[25912,2],[26007,1],[26014,2],[26107,1],[26119,2],[26198,2],[26206,1],[26208,1],[26224,1],[26245,2],[26317,2],[26436,1],[26491,1],[26525,1],[26527,2],[26629,1],[26657,1],[26669,1],[26725,2],[26782,1],[26836,2],[26941,1],[26995,2],[27122,1],[27176,2],[27219,2],[27236,1],[27272,1],[27274,1],[27288,1],[27313,1],[27336,1],[27369,2],[27381,1],[27406,1],[27413,1],[27438,1],[27464,1],[27481,2],[27497,1],[27537,2],[27557,1],[27583,1],[27754,1],[27800,1],[27836,1],[27893,1],[27927,1],[28032,1],[28065,1],[28193,1],[28227,1],[28269,1],[28271,1],[28395,1],[28475,1],[28477,1],[28535,1],[28542,1],[28631,1],[28642,1],[28682,1],[28701,1],[29003,1],[29266,1],[29310,1],[29312,1],[29403,1],[29553,1],[29594,1],[29610,2],[29653,1],[29672,2],[29714,1],[29731,2],[29781,1],[29813,2]]},"699":{"position":[[360,1],[407,1],[409,1],[444,1],[456,1],[466,2],[469,2],[484,1],[505,1],[517,3],[542,1],[544,1],[546,2],[561,1],[576,1],[588,1],[621,1],[623,1],[640,1],[642,1],[644,1],[646,1],[648,1],[650,2],[653,1],[670,1],[672,1],[674,1],[748,1],[750,1],[825,2],[828,1],[906,2],[909,1],[1084,1],[1131,1],[1133,1],[1168,1],[1180,1],[1190,2],[1193,2],[1209,1],[1230,1],[1242,3],[1267,1],[1269,1],[1271,2],[1286,1],[1301,1],[1313,1],[1346,1],[1348,1],[1365,1],[1367,1],[1369,1],[1371,1],[1373,1],[1375,2],[1378,1],[1395,1],[1397,1],[1399,1]]},"701":{"position":[[419,1],[466,1],[468,1],[503,1],[515,1],[525,2],[528,2],[541,1],[552,1],[563,1],[565,1],[575,2],[578,2],[581,1],[602,1],[625,1],[627,1],[629,1],[631,1],[633,2],[649,1],[670,1],[682,3],[707,1],[709,2],[724,1],[745,1],[757,3],[782,1],[784,1],[786,2],[801,1],[816,1],[828,1],[861,1],[863,1],[880,1],[882,1],[884,2],[897,1],[930,1],[932,1],[949,1],[951,1],[953,1],[955,1],[957,1],[959,2],[962,1],[979,1],[981,1],[983,1],[1112,2],[1184,2],[1208,1],[1224,1],[1226,1],[1253,2],[1353,1],[1414,2],[1498,2],[1678,2],[1721,3],[1725,2],[1746,1],[1756,1],[1758,1],[1854,2],[1857,1],[1914,3],[1918,2],[1929,1],[1955,2],[2034,1],[2036,1],[2078,1],[2092,1],[2094,2],[2193,2],[2267,2],[2352,2],[2485,2],[2659,2],[2702,2],[2712,2],[2719,1],[2721,2],[2724,2],[2740,1],[2742,1],[2752,2],[2847,1],[2854,2],[2947,1],[2959,2],[3038,2],[3046,1],[3048,1],[3064,1],[3085,2],[3157,2],[3276,1],[3331,1],[3365,1],[3367,2],[3469,1],[3497,1],[3509,1],[3565,2],[3622,1],[3676,2],[3781,1],[3835,2],[3962,1],[4016,2],[4059,2],[4076,1],[4112,1],[4114,1],[4128,1],[4153,1],[4176,1],[4209,2],[4221,1],[4246,1],[4253,1],[4277,1],[4299,1],[4321,2],[4337,1],[4377,2],[4397,1],[4423,1],[4594,1],[4640,1],[4676,1],[4733,1],[4767,1],[4872,1],[4905,1],[5033,1],[5067,1],[5109,1],[5111,1],[5235,1],[5315,1],[5317,1],[5375,1],[5382,1],[5471,1],[5482,1],[5522,1],[5541,1],[5843,1],[6106,1],[6150,1],[6152,1],[6243,1],[6393,1],[6434,1],[6449,2],[6491,1],[6506,2],[6544,1],[6566,2],[6621,1],[6653,2],[6730,2],[6802,2],[6826,1],[6842,1],[6844,1],[6871,2],[6971,1],[7032,2],[7116,2],[7296,2],[7339,3],[7343,2],[7364,1],[7374,1],[7376,1],[7471,2],[7474,1],[7531,3],[7535,2],[7546,1],[7572,2],[7651,1],[7653,1],[7695,1],[7709,1],[7711,2],[7810,2],[7884,2],[7969,2],[8102,2],[8276,2],[8319,2],[8329,2],[8336,1],[8338,2],[8341,2],[8357,1],[8359,1],[8369,2],[8464,1],[8471,2],[8563,1],[8575,2],[8654,2],[8662,1],[8664,1],[8680,1],[8701,2],[8773,2],[8892,1],[8947,1],[8981,1],[8983,2],[9085,1],[9113,1],[9125,1],[9181,2],[9238,1],[9292,2],[9397,1],[9451,2],[9578,1],[9632,2],[9675,2],[9692,1],[9728,1],[9730,1],[9744,1],[9769,1],[9792,1],[9825,2],[9837,1],[9862,1],[9869,1],[9893,1],[9914,1],[9936,2],[9952,1],[9992,2],[10012,1],[10038,1],[10209,1],[10255,1],[10291,1],[10348,1],[10382,1],[10487,1],[10520,1],[10648,1],[10682,1],[10724,1],[10726,1],[10850,1],[10930,1],[10932,1],[10990,1],[10997,1],[11085,1],[11096,1],[11136,1],[11155,1],[11456,1],[11719,1],[11763,1],[11765,1],[11856,1],[12005,1],[12046,1],[12061,2],[12103,1],[12117,2],[12154,1],[12176,2],[12231,1],[12263,2]]},"703":{"position":[[236,2],[308,2],[332,1],[348,1],[350,1],[377,2],[477,1],[538,2],[622,2],[802,2],[845,3],[881,1],[883,2],[928,1],[1001,2],[1004,2],[1007,1],[1063,3],[1086,2],[1165,1],[1167,1],[1209,1],[1223,1],[1225,2],[1324,2],[1398,2],[1483,2],[1616,2],[1790,2],[1833,2],[1843,2],[1850,1],[1852,2],[1855,2],[1871,1],[1873,1],[1883,2],[1978,1],[1985,2],[2045,1],[2047,2],[2219,2],[2222,1],[2224,1],[2236,2],[2329,2],[2336,1],[2338,2],[2341,2],[2357,1],[2378,2],[2450,2],[2569,1],[2624,1],[2658,1],[2660,2],[2762,1],[2790,1],[2802,1],[2858,2],[2915,1],[2969,2],[3074,1],[3128,2],[3255,1],[3309,2],[3352,2],[3369,1],[3405,1],[3407,1],[3421,1],[3452,1],[3475,1],[3508,2],[3520,1],[3547,1],[3556,1],[3585,1],[3587,2],[3638,1],[3645,1],[3672,1],[3691,1],[3712,1],[3714,2],[3717,2],[3733,1],[3792,1],[3963,1],[4009,1],[4045,1],[4102,1],[4136,1],[4241,1],[4274,1],[4402,1],[4436,1],[4478,1],[4480,1],[4604,1],[4684,1],[4686,1],[4744,1],[4751,1],[4758,1],[4802,1],[4913,3],[4917,2],[4920,2],[4923,1],[4934,1],[5208,1],[5252,1],[5254,1],[5345,1],[5362,1],[5377,1],[5453,2],[5819,2],[5864,1],[5938,1],[5940,2],[6120,2],[6192,2],[6216,1],[6232,1],[6234,1],[6261,2],[6361,1],[6422,2],[6506,2],[6686,2],[6729,3],[6733,2],[6754,1],[6764,1],[6766,1],[6865,2],[6868,1],[6925,3],[6929,2],[6940,1],[6966,2],[7045,1],[7047,1],[7089,1],[7103,1],[7105,2],[7204,2],[7278,2],[7363,2],[7496,2],[7670,2],[7713,2],[7723,2],[7730,1],[7732,2],[7735,2],[7751,1],[7753,1],[7763,2],[7858,1],[7865,2],[7961,1],[7973,2],[8052,2],[8060,1],[8062,1],[8078,1],[8099,2],[8171,2],[8290,1],[8345,1],[8379,1],[8381,2],[8483,1],[8511,1],[8523,1],[8579,2],[8636,1],[8690,2],[8795,1],[8849,2],[8976,1],[9030,2],[9073,2],[9090,1],[9126,1],[9128,1],[9142,1],[9167,1],[9190,1],[9223,2],[9235,1],[9260,1],[9267,1],[9294,1],[9316,1],[9338,2],[9354,1],[9394,2],[9414,1],[9440,1],[9611,1],[9657,1],[9693,1],[9750,1],[9784,1],[9889,1],[9922,1],[10050,1],[10084,1],[10126,1],[10128,1],[10252,1],[10332,1],[10334,1],[10392,1],[10399,1],[10491,1],[10502,1],[10542,1],[10561,1],[10866,1],[11129,1],[11173,1],[11175,1],[11266,1],[11419,1],[11460,1],[11478,2],[11523,1],[11538,2],[11576,1],[11598,2],[11653,1],[11685,2]]},"705":{"position":[[211,2],[283,2],[307,1],[323,1],[325,1],[352,2],[452,1],[513,2],[597,2],[777,2],[820,3],[824,2],[848,1],[857,1],[859,1],[884,3],[888,2],[898,1],[1164,2],[1243,1],[1245,1],[1287,1],[1301,1],[1303,2],[1402,2],[1476,2],[1561,2],[1694,2],[1868,2],[1911,2],[1921,2],[1928,1],[1930,2],[1933,2],[1949,1],[1951,1],[1961,2],[1989,2],[2011,1],[2023,2],[2108,2],[2116,1],[2118,1],[2375,1],[2396,2],[2468,2],[2587,1],[2642,1],[2676,1],[2678,2],[2780,1],[2808,1],[2820,1],[2876,2],[2933,1],[2987,2],[3092,1],[3146,2],[3273,1],[3327,2],[3370,2],[3387,1],[3423,1],[3425,1],[3439,1],[3463,2],[3475,1],[3501,1],[3503,2],[3519,1],[3558,2],[3566,1],[3568,1],[3825,1],[3846,1],[4017,1],[4063,1],[4099,1],[4156,1],[4190,1],[4295,1],[4328,1],[4456,1],[4490,1],[4532,1],[4534,1],[4658,1],[4738,1],[4740,2],[4748,1],[4760,1],[4771,1],[4810,1],[4821,1],[5546,1],[5590,1],[5592,1],[5683,1],[5685,1],[5960,2],[5986,2],[6488,2],[6560,2],[6584,1],[6600,1],[6602,1],[6629,2],[6729,1],[6790,2],[6874,2],[7054,2],[7097,3],[7133,1],[7135,1],[7205,1],[7278,2],[7281,2],[7284,1],[7340,3],[7363,2],[7442,1],[7444,1],[7486,1],[7500,1],[7502,2],[7601,2],[7675,2],[7760,2],[7893,2],[8067,2],[8110,2],[8120,2],[8127,1],[8129,2],[8132,2],[8148,1],[8150,1],[8160,2],[8255,1],[8262,2],[8322,1],[8448,2],[8451,1],[8580,2],[8583,1],[8585,1],[8597,2],[8690,2],[8697,1],[8699,2],[8702,2],[8718,1],[8739,2],[8811,2],[8930,1],[8985,1],[9019,1],[9021,2],[9123,1],[9151,1],[9163,1],[9219,2],[9276,1],[9330,2],[9435,1],[9489,2],[9616,1],[9670,2],[9713,2],[9730,1],[9766,1],[9768,1],[9782,1],[9813,1],[9836,1],[9869,2],[9881,1],[9908,1],[9917,1],[9946,1],[9954,1],[9961,1],[9985,1],[10004,1],[10025,2],[10034,1],[10041,1],[10068,1],[10087,1],[10108,1],[10110,2],[10113,2],[10129,1],[10188,1],[10359,1],[10405,1],[10441,1],[10498,1],[10532,1],[10637,1],[10670,1],[10798,1],[10832,1],[10874,1],[10876,1],[11000,1],[11080,1],[11082,1],[11140,1],[11147,1],[11154,1],[11262,2],[11345,3],[11349,2],[11352,2],[11355,1],[11366,1],[11640,1],[11684,1],[11686,1],[11777,1],[11794,1],[11809,1],[11954,2],[12436,1],[12507,2],[12510,1],[12584,1],[12586,2],[12750,2],[12822,2],[12846,1],[12862,1],[12864,1],[12891,2],[12991,1],[13052,2],[13136,2],[13316,2],[13359,3],[13396,1],[13398,1],[13468,1],[13541,2],[13544,2],[13547,1],[13603,3],[13626,2],[13705,1],[13707,1],[13749,1],[13763,1],[13765,2],[13864,2],[13938,2],[14023,2],[14156,2],[14330,2],[14373,2],[14383,2],[14390,1],[14392,2],[14395,2],[14411,1],[14413,1],[14423,2],[14518,1],[14525,2],[14586,1],[14712,2],[14715,1],[14844,2],[14847,1],[14849,1],[14861,2],[14954,2],[14961,1],[14963,2],[14966,2],[14982,1],[15003,2],[15075,2],[15194,1],[15249,1],[15283,1],[15285,2],[15387,1],[15415,1],[15427,1],[15483,2],[15540,1],[15594,2],[15699,1],[15753,2],[15880,1],[15934,2],[15977,2],[15994,1],[16030,1],[16032,1],[16046,1],[16077,1],[16100,1],[16133,2],[16145,1],[16172,1],[16182,1],[16211,1],[16219,1],[16226,1],[16250,1],[16269,1],[16290,2],[16299,1],[16306,1],[16333,1],[16352,1],[16373,1],[16375,2],[16378,2],[16394,1],[16453,1],[16624,1],[16670,1],[16706,1],[16763,1],[16797,1],[16902,1],[16935,1],[17063,1],[17097,1],[17139,1],[17141,1],[17265,1],[17345,1],[17347,1],[17405,1],[17412,1],[17419,1],[17529,2],[17612,4],[17617,2],[17620,2],[17623,1],[17634,1],[17908,1],[17952,1],[17954,1],[18045,1],[18063,1],[18078,1],[18223,2],[18630,1],[18701,2],[18704,1],[18778,1],[18780,2],[19052,2],[19124,2],[19148,1],[19164,1],[19166,1],[19193,2],[19293,1],[19354,2],[19438,2],[19618,2],[19661,3],[19665,2],[19686,1],[19696,1],[19698,1],[19794,2],[19797,1],[19854,3],[19858,2],[19869,1],[19895,2],[19974,1],[19976,1],[20018,1],[20032,1],[20034,2],[20133,2],[20207,2],[20292,2],[20425,2],[20599,2],[20642,2],[20652,2],[20659,1],[20661,2],[20664,2],[20680,1],[20682,1],[20692,2],[20787,1],[20794,2],[20887,1],[20899,2],[20978,2],[20986,1],[20988,1],[21004,1],[21025,2],[21097,2],[21216,1],[21271,1],[21305,1],[21307,2],[21409,1],[21437,1],[21449,1],[21505,2],[21562,1],[21616,2],[21721,1],[21775,2],[21902,1],[21956,2],[21999,2],[22016,1],[22052,1],[22054,1],[22068,1],[22093,1],[22116,1],[22149,2],[22161,1],[22186,1],[22193,1],[22217,1],[22239,1],[22261,2],[22277,1],[22317,2],[22337,1],[22363,1],[22534,1],[22580,1],[22616,1],[22673,1],[22707,1],[22812,1],[22845,1],[22973,1],[23007,1],[23049,1],[23051,1],[23175,1],[23255,1],[23257,1],[23315,1],[23322,1],[23411,1],[23422,1],[23462,1],[23481,1],[23783,1],[24046,1],[24090,1],[24092,1],[24183,1],[24333,1],[24374,1],[24389,2],[24431,1],[24446,2],[24484,1],[24506,2],[24561,1],[24593,2],[24715,2],[24787,2],[24811,1],[24827,1],[24829,1],[24856,2],[24956,1],[25017,2],[25101,2],[25281,2],[25324,3],[25328,2],[25349,1],[25359,1],[25361,1],[25454,2],[25457,1],[25514,3],[25518,2],[25529,1],[25556,2],[25635,1],[25637,1],[25679,1],[25693,1],[25695,2],[25794,2],[25868,2],[25953,2],[26086,2],[26260,2],[26303,2],[26313,2],[26320,1],[26322,2],[26325,2],[26341,1],[26343,1],[26353,2],[26448,1],[26455,2],[26545,1],[26557,2],[26636,2],[26644,1],[26646,1],[26663,1],[26684,2],[26756,2],[26875,1],[26930,1],[26964,1],[26966,2],[27068,1],[27096,1],[27108,1],[27164,2],[27221,1],[27275,2],[27380,1],[27434,2],[27561,1],[27615,2],[27658,2],[27675,1],[27711,1],[27713,1],[27727,1],[27752,1],[27775,1],[27808,2],[27820,1],[27845,1],[27852,1],[27876,1],[27895,1],[27917,2],[27933,1],[27973,2],[27993,1],[28020,1],[28191,1],[28237,1],[28273,1],[28330,1],[28364,1],[28469,1],[28502,1],[28630,1],[28664,1],[28706,1],[28708,1],[28832,1],[28912,1],[28914,1],[28972,1],[28979,1],[29065,1],[29076,1],[29116,1],[29135,1],[29435,1],[29699,1],[29743,1],[29745,1],[29836,1],[29983,1],[30025,1],[30040,2],[30082,1],[30094,2],[30129,1],[30151,2],[30206,1],[30238,2]]},"707":{"position":[[223,1],[270,1],[272,1],[307,1],[319,1],[329,2],[332,2],[348,1],[369,1],[381,3],[406,1],[408,1],[410,2],[425,1],[440,1],[452,1],[485,1],[487,1],[504,1],[506,1],[508,1],[510,1],[512,1],[514,2],[517,1],[534,1],[536,1],[538,1]]},"713":{"position":[[441,1],[835,1],[1027,1]]},"724":{"position":[[797,1],[844,1],[846,1],[863,2],[866,1],[900,1],[921,1],[931,2],[934,1],[936,2],[951,1],[966,1],[987,1],[1020,1],[1022,1],[1039,1],[1041,1],[1043,1],[1045,1],[1047,1],[1049,2],[1052,1],[1083,1],[1099,1],[1109,2],[1112,1],[1114,2],[1129,1],[1144,1],[1160,1],[1193,1],[1195,1],[1220,1],[1222,1],[1224,1],[1226,1],[1228,1],[1230,2],[1233,1],[1272,1],[1284,1],[1294,2],[1297,1],[1299,2],[1314,1],[1329,1],[1341,1],[1374,1],[1376,1],[1393,1],[1395,1],[1397,1],[1399,1],[1401,1],[1403,1],[1405,1],[1407,1]]},"726":{"position":[[250,2],[322,2],[346,1],[362,1],[364,1],[391,2],[491,1],[552,2],[636,2],[816,2],[859,3],[895,1],[897,2],[959,1],[1036,2],[1098,1],[1175,2],[1250,1],[1330,2],[1398,1],[1481,2],[1562,1],[1648,2],[1729,1],[1809,2],[1812,2],[1815,1],[1871,3],[1894,2],[1973,1],[1975,1],[2017,1],[2031,1],[2033,2],[2132,2],[2206,2],[2291,2],[2424,2],[2598,2],[2641,2],[2651,2],[2658,1],[2660,2],[2663,2],[2679,1],[2681,1],[2691,2],[2786,1],[2793,2],[2853,1],[2855,2],[3048,2],[3051,1],[3053,2],[3246,2],[3249,1],[3251,2],[3460,2],[3463,1],[3465,2],[3670,2],[3673,1],[3675,2],[3896,2],[3899,1],[3901,2],[4116,2],[4119,1],[4121,1],[4133,2],[4226,2],[4233,1],[4235,2],[4238,2],[4254,1],[4275,2],[4347,2],[4466,1],[4521,1],[4555,1],[4557,2],[4659,1],[4687,1],[4699,1],[4755,2],[4812,1],[4866,2],[4971,1],[5025,2],[5152,1],[5206,2],[5249,2],[5266,1],[5302,1],[5304,1],[5318,1],[5349,1],[5372,1],[5405,2],[5417,1],[5444,1],[5453,1],[5482,1],[5484,2],[5552,1],[5559,1],[5583,1],[5611,1],[5630,2],[5633,2],[5701,1],[5708,1],[5732,1],[5760,1],[5779,2],[5782,2],[5863,1],[5870,1],[5894,1],[5922,1],[5944,2],[5947,2],[6021,1],[6028,1],[6058,1],[6086,1],[6105,2],[6108,2],[6195,1],[6202,1],[6232,1],[6260,1],[6282,2],[6285,2],[6372,1],[6379,1],[6409,1],[6437,1],[6453,1],[6455,2],[6458,2],[6474,1],[6533,1],[6704,1],[6750,1],[6786,1],[6843,1],[6877,1],[6982,1],[7015,1],[7143,1],[7177,1],[7219,1],[7221,1],[7345,1],[7425,1],[7427,1],[7485,1],[7492,1],[7499,1],[7543,1],[7675,2],[7691,1],[7823,2],[7839,1],[7987,2],[8003,1],[8147,2],[8163,1],[8323,2],[8339,1],[8493,3],[8497,2],[8500,2],[8503,1],[8514,1],[8788,1],[8832,1],[8834,1],[8925,1],[8942,1],[8957,1],[9438,2],[10444,2],[10506,1],[10584,2],[10587,2],[10649,1],[10727,2],[10730,2],[10805,1],[10886,2],[10889,2],[10957,1],[11041,2],[11044,2],[11125,1],[11212,2],[11215,2],[11296,1],[11377,1],[11379,2],[11568,2],[11640,2],[11664,1],[11680,1],[11682,1],[11709,2],[11809,1],[11870,2],[11954,2],[12134,2],[12177,3],[12213,1],[12215,2],[12285,1],[12361,2],[12435,1],[12511,2],[12586,1],[12667,2],[12670,2],[12673,1],[12729,3],[12752,2],[12831,1],[12833,1],[12875,1],[12889,1],[12891,2],[12990,2],[13064,2],[13149,2],[13282,2],[13456,2],[13499,2],[13509,2],[13516,1],[13518,2],[13521,2],[13537,1],[13539,1],[13549,2],[13644,1],[13651,2],[13711,1],[13713,2],[13913,2],[13916,1],[13918,2],[14122,2],[14125,1],[14127,2],[14337,2],[14340,1],[14342,1],[14354,2],[14447,2],[14454,1],[14456,2],[14459,2],[14475,1],[14496,2],[14568,2],[14687,1],[14742,1],[14776,1],[14778,2],[14880,1],[14908,1],[14920,1],[14976,2],[15033,1],[15087,2],[15192,1],[15246,2],[15373,1],[15427,2],[15470,2],[15487,1],[15523,1],[15525,1],[15539,1],[15570,1],[15593,1],[15626,2],[15638,1],[15665,1],[15674,1],[15703,1],[15705,2],[15781,1],[15788,1],[15821,1],[15844,1],[15858,2],[15861,2],[15941,1],[15948,1],[15981,1],[16004,1],[16018,2],[16021,2],[16102,1],[16109,1],[16141,1],[16164,1],[16184,1],[16186,2],[16189,2],[16205,1],[16264,1],[16435,1],[16481,1],[16517,1],[16574,1],[16608,1],[16713,1],[16746,1],[16874,1],[16908,1],[16950,1],[16952,1],[17076,1],[17156,1],[17158,1],[17216,1],[17223,1],[17230,1],[17274,1],[17413,2],[17429,1],[17572,2],[17588,1],[17737,3],[17741,2],[17744,2],[17747,1],[17758,1],[18032,1],[18076,1],[18078,1],[18169,1],[18186,1],[18201,1],[18435,2],[19053,2],[19123,1],[19200,2],[19203,2],[19277,1],[19354,2],[19357,2],[19432,1],[19514,1],[19516,2],[19705,2],[19777,2],[19801,1],[19817,1],[19819,1],[19846,2],[19946,1],[20007,2],[20091,2],[20271,2],[20314,3],[20350,1],[20352,2],[20409,1],[20481,2],[20529,1],[20601,2],[20660,1],[20734,2],[20737,2],[20740,1],[20796,3],[20819,2],[20898,1],[20900,1],[20942,1],[20956,1],[20958,2],[21057,2],[21131,2],[21216,2],[21349,2],[21523,2],[21566,2],[21576,2],[21583,1],[21585,2],[21588,2],[21604,1],[21606,1],[21616,2],[21711,1],[21718,2],[21778,1],[21780,2],[21963,2],[21966,1],[21968,2],[22142,2],[22145,1],[22147,2],[22334,2],[22337,1],[22339,1],[22351,2],[22444,2],[22451,1],[22453,2],[22456,2],[22472,1],[22493,2],[22565,2],[22684,1],[22739,1],[22773,1],[22775,2],[22877,1],[22905,1],[22917,1],[22973,2],[23030,1],[23084,2],[23189,1],[23243,2],[23370,1],[23424,2],[23467,2],[23484,1],[23520,1],[23522,1],[23536,1],[23567,1],[23590,1],[23623,2],[23635,1],[23662,1],[23671,1],[23700,1],[23702,2],[23765,1],[23772,1],[23796,1],[23815,1],[23838,2],[23841,2],[23895,1],[23902,1],[23926,1],[23945,1],[23968,2],[23971,2],[24036,1],[24043,1],[24070,1],[24089,1],[24111,1],[24113,2],[24116,2],[24132,1],[24191,1],[24362,1],[24408,1],[24444,1],[24501,1],[24535,1],[24640,1],[24673,1],[24801,1],[24835,1],[24877,1],[24879,1],[25003,1],[25083,1],[25085,1],[25143,1],[25150,1],[25157,1],[25201,1],[25323,2],[25339,1],[25452,2],[25468,1],[25594,3],[25598,2],[25601,2],[25604,1],[25615,1],[25889,1],[25933,1],[25935,1],[26026,1],[26043,1],[26058,1],[26277,2],[26880,2],[26937,1],[27010,2],[27013,2],[27061,1],[27134,2],[27137,2],[27196,1],[27271,1],[27273,2],[28304,2],[28376,2],[28400,1],[28416,1],[28418,1],[28445,2],[28545,1],[28606,2],[28690,2],[28870,2],[28913,3],[28917,2],[28938,1],[28948,1],[28950,1],[29045,2],[29048,1],[29105,3],[29109,2],[29120,1],[29146,2],[29225,1],[29227,1],[29269,1],[29283,1],[29285,2],[29384,2],[29458,2],[29543,2],[29676,2],[29850,2],[29893,2],[29903,2],[29910,1],[29912,2],[29915,2],[29931,1],[29933,1],[29943,2],[30038,1],[30045,2],[30137,1],[30149,2],[30228,2],[30236,1],[30238,1],[30254,1],[30275,2],[30347,2],[30466,1],[30521,1],[30555,1],[30557,2],[30659,1],[30687,1],[30699,1],[30755,2],[30812,1],[30866,2],[30971,1],[31025,2],[31152,1],[31206,2],[31249,2],[31266,1],[31302,1],[31304,1],[31318,1],[31343,1],[31366,1],[31399,2],[31411,1],[31436,1],[31443,1],[31467,1],[31486,1],[31510,2],[31526,1],[31566,2],[31586,1],[31612,1],[31783,1],[31829,1],[31865,1],[31922,1],[31956,1],[32061,1],[32094,1],[32222,1],[32256,1],[32298,1],[32300,1],[32424,1],[32504,1],[32506,1],[32564,1],[32571,1],[32659,1],[32670,1],[32710,1],[32729,1],[33030,1],[33293,1],[33337,1],[33339,1],[33430,1],[33579,1],[33620,1],[33635,2],[33677,1],[33689,2],[33724,1],[33748,2],[33805,1],[33837,2],[34063,2],[34135,2],[34159,1],[34175,1],[34177,1],[34204,2],[34304,1],[34365,2],[34449,2],[34629,2],[34672,3],[34676,2],[34697,1],[34707,1],[34709,1],[34804,2],[34807,1],[34864,3],[34868,2],[34879,1],[34906,2],[34985,1],[34987,1],[35029,1],[35043,1],[35045,2],[35144,2],[35218,2],[35303,2],[35436,2],[35610,2],[35653,2],[35663,2],[35670,1],[35672,2],[35675,2],[35691,1],[35693,1],[35703,2],[35798,1],[35805,2],[35897,1],[35909,2],[35988,2],[35996,1],[35998,1],[36015,1],[36036,2],[36108,2],[36227,1],[36282,1],[36316,1],[36318,2],[36420,1],[36448,1],[36460,1],[36516,2],[36573,1],[36627,2],[36732,1],[36786,2],[36913,1],[36967,2],[37010,2],[37027,1],[37063,1],[37065,1],[37079,1],[37104,1],[37127,1],[37160,2],[37172,1],[37197,1],[37204,1],[37228,1],[37247,1],[37271,2],[37287,1],[37327,2],[37347,1],[37374,1],[37545,1],[37591,1],[37627,1],[37684,1],[37718,1],[37823,1],[37856,1],[37984,1],[38018,1],[38060,1],[38062,1],[38186,1],[38266,1],[38268,1],[38326,1],[38333,1],[38421,1],[38432,1],[38472,1],[38491,1],[38793,1],[39057,1],[39101,1],[39103,1],[39194,1],[39343,1],[39385,1],[39400,2],[39442,1],[39454,2],[39489,1],[39513,2],[39570,1],[39602,2],[39680,2],[39752,2],[39776,1],[39792,1],[39794,1],[39821,2],[39921,1],[39982,2],[40066,2],[40246,2],[40289,3],[40293,2],[40314,1],[40324,1],[40326,1],[40425,2],[40428,1],[40485,3],[40489,2],[40500,1],[40526,2],[40605,1],[40607,1],[40649,1],[40663,1],[40665,2],[40764,2],[40838,2],[40923,2],[41056,2],[41230,2],[41273,2],[41283,2],[41290,1],[41292,2],[41295,2],[41311,1],[41313,1],[41323,2],[41418,1],[41425,2],[41521,1],[41533,2],[41612,2],[41620,1],[41622,1],[41638,1],[41659,2],[41731,2],[41850,1],[41905,1],[41939,1],[41941,2],[42043,1],[42071,1],[42083,1],[42139,2],[42196,1],[42250,2],[42355,1],[42409,2],[42536,1],[42590,2],[42633,2],[42650,1],[42686,1],[42688,1],[42702,1],[42727,1],[42750,1],[42783,2],[42795,1],[42820,1],[42827,1],[42860,1],[42883,1],[42898,2],[42914,1],[42954,2],[42974,1],[43000,1],[43171,1],[43217,1],[43253,1],[43310,1],[43344,1],[43449,1],[43482,1],[43610,1],[43644,1],[43686,1],[43688,1],[43812,1],[43892,1],[43894,1],[43952,1],[43959,1],[44051,1],[44062,1],[44102,1],[44121,1],[44426,1],[44689,1],[44733,1],[44735,1],[44826,1],[44979,1],[45020,1],[45044,2],[45095,1],[45111,2],[45150,1],[45165,2],[45213,1],[45245,2],[45322,2],[45394,2],[45418,1],[45434,1],[45436,1],[45463,2],[45563,1],[45624,2],[45708,2],[45888,2],[45931,3],[45935,2],[45956,1],[45966,1],[45968,1],[46068,2],[46071,1],[46128,3],[46132,2],[46143,1],[46169,2],[46248,1],[46250,1],[46292,1],[46306,1],[46308,2],[46407,2],[46481,2],[46566,2],[46699,2],[46873,2],[46916,2],[46926,2],[46933,1],[46935,2],[46938,2],[46954,1],[46956,1],[46966,2],[47061,1],[47068,2],[47165,1],[47177,2],[47256,2],[47264,1],[47266,1],[47282,1],[47303,2],[47375,2],[47494,1],[47549,1],[47583,1],[47585,2],[47687,1],[47715,1],[47727,1],[47783,2],[47840,1],[47894,2],[47999,1],[48053,2],[48180,1],[48234,2],[48277,2],[48294,1],[48330,1],[48332,1],[48346,1],[48371,1],[48394,1],[48427,2],[48439,1],[48464,1],[48471,1],[48495,1],[48523,1],[48543,2],[48559,1],[48599,2],[48619,1],[48645,1],[48816,1],[48862,1],[48898,1],[48955,1],[48989,1],[49094,1],[49127,1],[49255,1],[49289,1],[49331,1],[49333,1],[49457,1],[49537,1],[49539,1],[49597,1],[49604,1],[49697,1],[49708,1],[49748,1],[49767,1],[50073,1],[50336,1],[50380,1],[50382,1],[50473,1],[50627,1],[50668,1],[50683,2],[50725,1],[50746,2],[50790,1],[50810,2],[50863,1],[50895,2]]},"728":{"position":[[346,2],[418,2],[442,1],[458,1],[460,1],[487,2],[587,1],[648,2],[732,2],[912,2],[955,3],[959,2],[980,1],[990,1],[992,1],[1083,2],[1086,1],[1143,3],[1147,2],[1158,1],[1189,2],[1268,1],[1270,1],[1312,1],[1326,1],[1328,2],[1427,2],[1501,2],[1586,2],[1719,2],[1893,2],[1936,2],[1946,2],[1953,1],[1955,2],[1958,2],[1974,1],[1976,1],[1986,2],[2081,1],[2088,2],[2176,1],[2188,2],[2267,2],[2275,1],[2277,1],[2298,1],[2319,2],[2391,2],[2510,1],[2565,1],[2599,1],[2601,2],[2703,1],[2731,1],[2743,1],[2799,2],[2856,1],[2910,2],[3015,1],[3069,2],[3196,1],[3250,2],[3293,2],[3310,1],[3346,1],[3348,1],[3362,1],[3387,1],[3410,1],[3443,2],[3455,1],[3480,1],[3487,1],[3511,1],[3530,1],[3550,2],[3566,1],[3606,2],[3626,1],[3657,1],[3828,1],[3874,1],[3910,1],[3967,1],[4001,1],[4106,1],[4139,1],[4267,1],[4301,1],[4343,1],[4345,1],[4469,1],[4549,1],[4551,1],[4609,1],[4616,1],[4700,1],[4711,1],[4751,1],[4770,1],[5072,1],[5340,1],[5384,1],[5386,1],[5477,1],[5622,1],[5668,1],[5683,2],[5725,1],[5737,2],[5772,1],[5792,2],[5845,1],[5877,2],[6191,1],[6225,1],[6246,1],[6256,2],[6259,2],[6272,1],[6282,2],[6285,1],[6287,2],[6302,1],[6317,1],[6338,1],[6371,1],[6373,1],[6390,1],[6392,1],[6394,2],[6407,1],[6440,1],[6442,1],[6459,1],[6461,1],[6463,1],[6465,1],[6467,1],[6469,1],[7352,2],[7355,1],[7402,1],[7404,1],[7421,2],[7424,1],[7458,1],[7479,1],[7489,2],[7492,2],[7505,1],[7515,2],[7518,1],[7520,2],[7535,1],[7550,1],[7571,1],[7604,1],[7606,1],[7623,1],[7625,1],[7627,2],[7640,1],[7673,1],[7675,1],[7692,1],[7694,1],[7696,1],[7698,1],[7700,1],[7702,2],[7705,1],[7736,1],[7752,1],[7762,2],[7765,1],[7767,2],[7782,1],[7797,1],[7813,1],[7846,1],[7848,1],[7873,1],[7875,1],[7877,1],[7879,1],[7881,1],[7883,2],[7886,1],[7925,1],[7937,1],[7947,2],[7950,1],[7952,2],[7967,1],[7982,1],[7998,1],[8031,1],[8033,1],[8050,1],[8052,1],[8054,1],[8056,1],[8058,1],[8060,1],[8062,1],[8064,1],[8265,2],[8337,2],[8361,1],[8377,1],[8379,1],[8406,2],[8506,1],[8567,2],[8651,2],[8831,2],[8874,3],[8878,2],[8899,1],[8909,1],[8911,1],[9002,2],[9005,1],[9062,3],[9066,2],[9077,1],[9104,2],[9183,1],[9185,1],[9227,1],[9241,1],[9243,2],[9342,2],[9416,2],[9501,2],[9634,2],[9808,2],[9851,2],[9861,2],[9868,1],[9870,2],[9873,2],[9889,1],[9891,1],[9901,2],[9996,1],[10003,2],[10091,1],[10103,2],[10182,2],[10190,1],[10192,1],[10209,1],[10230,2],[10302,2],[10421,1],[10476,1],[10510,1],[10512,2],[10614,1],[10642,1],[10654,1],[10710,2],[10767,1],[10821,2],[10926,1],[10980,2],[11107,1],[11161,2],[11204,2],[11221,1],[11257,1],[11259,1],[11273,1],[11298,1],[11321,1],[11354,2],[11366,1],[11391,1],[11398,1],[11422,1],[11441,1],[11461,2],[11477,1],[11517,2],[11537,1],[11564,1],[11735,1],[11781,1],[11817,1],[11874,1],[11908,1],[12013,1],[12046,1],[12174,1],[12208,1],[12250,1],[12252,1],[12376,1],[12456,1],[12458,1],[12516,1],[12523,1],[12607,1],[12618,1],[12658,1],[12677,1],[12975,1],[13239,1],[13283,1],[13285,1],[13376,1],[13521,1],[13563,1],[13578,2],[13620,1],[13632,2],[13667,1],[13687,2],[13740,1],[13772,2],[14182,2],[14254,2],[14278,1],[14294,1],[14296,1],[14323,2],[14423,1],[14484,2],[14568,2],[14748,2],[14791,3],[14795,2],[14816,1],[14826,1],[14828,1],[14928,2],[14931,1],[14988,3],[14992,2],[15003,1],[15030,2],[15109,1],[15111,1],[15153,1],[15167,1],[15169,2],[15268,2],[15342,2],[15427,2],[15560,2],[15734,2],[15777,2],[15787,2],[15794,1],[15796,2],[15799,2],[15815,1],[15817,1],[15827,2],[15922,1],[15929,2],[16026,1],[16038,2],[16117,2],[16125,1],[16127,1],[16144,1],[16165,2],[16237,2],[16356,1],[16411,1],[16445,1],[16447,2],[16549,1],[16577,1],[16589,1],[16645,2],[16702,1],[16756,2],[16861,1],[16915,2],[17042,1],[17096,2],[17139,2],[17156,1],[17192,1],[17194,1],[17208,1],[17233,1],[17256,1],[17289,2],[17301,1],[17326,1],[17333,1],[17366,1],[17385,1],[17405,2],[17421,1],[17461,2],[17481,1],[17508,1],[17679,1],[17725,1],[17761,1],[17818,1],[17852,1],[17957,1],[17990,1],[18118,1],[18152,1],[18194,1],[18196,1],[18320,1],[18400,1],[18402,1],[18460,1],[18467,1],[18560,1],[18571,1],[18611,1],[18630,1],[18937,1],[19201,1],[19245,1],[19247,1],[19338,1],[19492,1],[19534,1],[19558,2],[19609,1],[19621,2],[19656,1],[19676,2],[19729,1],[19761,2],[20010,1],[20032,1],[20034,1],[20067,1],[20079,1],[20099,1],[20113,1],[20136,2],[20158,1],[20193,1],[20195,1],[20197,1],[20199,1],[20201,1],[20203,1],[20205,1],[20950,1],[20984,1],[21005,1],[21015,2],[21018,2],[21031,1],[21042,1],[21053,1],[21055,1],[21065,2],[21068,2],[21071,1],[21091,1],[21105,1],[21137,2],[21159,1],[21186,1],[21188,1],[21190,1],[21192,1],[21194,1],[21196,1],[21198,2],[21213,1],[21228,1],[21249,1],[21282,1],[21284,1],[21301,1],[21303,1],[21305,2],[21318,1],[21351,1],[21353,1],[21370,1],[21372,1],[21374,1],[21376,1],[21378,1],[21380,1],[21855,1],[21919,1],[22002,1],[22067,1],[22069,1],[22142,1],[22465,1],[22527,1],[23605,1],[23652,1],[23654,1],[23671,2],[23674,1],[23708,1],[23729,1],[23739,2],[23742,2],[23755,1],[23766,1],[23777,1],[23779,1],[23789,2],[23792,2],[23795,1],[23815,1],[23829,1],[23861,2],[23883,1],[23910,1],[23912,1],[23914,1],[23916,1],[23918,1],[23920,1],[23922,2],[23937,1],[23952,1],[23973,1],[24006,1],[24008,1],[24025,1],[24027,1],[24029,2],[24042,1],[24075,1],[24077,1],[24094,1],[24096,1],[24098,1],[24100,1],[24102,1],[24104,2],[24107,1],[24138,1],[24154,1],[24164,2],[24167,1],[24169,2],[24184,1],[24199,1],[24215,1],[24248,1],[24250,1],[24275,1],[24277,1],[24279,1],[24281,1],[24283,1],[24285,2],[24288,1],[24327,1],[24339,1],[24349,2],[24352,1],[24354,2],[24369,1],[24384,1],[24396,1],[24429,1],[24431,1],[24448,1],[24450,1],[24452,1],[24454,1],[24456,1],[24458,1],[24460,1],[24462,1],[24624,2],[24696,2],[24720,1],[24736,1],[24738,1],[24765,2],[24865,1],[24926,2],[25010,2],[25190,2],[25233,3],[25237,2],[25258,1],[25268,1],[25270,1],[25370,2],[25373,1],[25430,3],[25434,2],[25445,1],[25471,2],[25550,1],[25552,1],[25594,1],[25608,1],[25610,2],[25709,2],[25783,2],[25868,2],[26001,2],[26175,2],[26218,2],[26228,2],[26235,1],[26237,2],[26240,2],[26256,1],[26258,1],[26268,2],[26363,1],[26370,2],[26467,1],[26479,2],[26558,2],[26566,1],[26568,1],[26584,1],[26605,2],[26677,2],[26796,1],[26851,1],[26885,1],[26887,2],[26989,1],[27017,1],[27029,1],[27085,2],[27142,1],[27196,2],[27301,1],[27355,2],[27482,1],[27536,2],[27579,2],[27596,1],[27632,1],[27634,1],[27648,1],[27673,1],[27696,1],[27729,2],[27741,1],[27766,1],[27773,1],[27806,1],[27825,1],[27845,2],[27861,1],[27901,2],[27921,1],[27947,1],[28118,1],[28164,1],[28200,1],[28257,1],[28291,1],[28396,1],[28429,1],[28557,1],[28591,1],[28633,1],[28635,1],[28759,1],[28839,1],[28841,1],[28899,1],[28906,1],[28999,1],[29010,1],[29050,1],[29069,1],[29375,1],[29638,1],[29682,1],[29684,1],[29775,1],[29929,1],[29970,1],[29994,2],[30045,1],[30057,2],[30092,1],[30112,2],[30165,1],[30197,2],[31382,1],[31429,1],[31431,1],[31448,2],[31451,1],[31485,1],[31506,1],[31516,2],[31519,2],[31532,1],[31543,1],[31554,1],[31556,1],[31566,2],[31569,2],[31572,1],[31592,1],[31606,1],[31638,2],[31660,1],[31694,1],[31696,1],[31698,1],[31700,1],[31702,1],[31704,1],[31706,2],[31721,1],[31736,1],[31757,1],[31790,1],[31792,1],[31809,1],[31811,1],[31813,2],[31826,1],[31859,1],[31861,1],[31878,1],[31880,1],[31882,1],[31884,1],[31886,1],[31888,2],[31891,1],[31922,1],[31938,1],[31948,2],[31951,2],[31975,1],[31995,1],[32009,1],[32036,2],[32058,1],[32081,1],[32083,1],[32085,1],[32087,2],[32102,1],[32117,1],[32133,1],[32166,1],[32168,1],[32193,1],[32195,1],[32197,1],[32199,1],[32201,1],[32203,2],[32206,1],[32245,1],[32257,1],[32267,2],[32270,1],[32272,2],[32287,1],[32302,1],[32314,1],[32347,1],[32349,1],[32366,1],[32368,1],[32370,1],[32372,1],[32374,1],[32376,1],[32378,1],[32380,1],[32872,2],[32944,2],[32968,1],[32984,1],[32986,1],[33013,2],[33113,1],[33174,2],[33258,2],[33438,2],[33481,3],[33485,2],[33506,1],[33516,1],[33518,1],[33609,2],[33612,1],[33669,3],[33673,2],[33684,1],[33710,2],[33789,1],[33791,1],[33833,1],[33847,1],[33849,2],[33948,2],[34022,2],[34107,2],[34240,2],[34414,2],[34457,2],[34467,2],[34474,1],[34476,2],[34479,2],[34495,1],[34497,1],[34507,2],[34602,1],[34609,2],[34697,1],[34709,2],[34788,2],[34796,1],[34798,1],[34814,1],[34835,2],[34907,2],[35026,1],[35081,1],[35115,1],[35117,2],[35219,1],[35247,1],[35259,1],[35315,2],[35372,1],[35426,2],[35531,1],[35585,2],[35712,1],[35766,2],[35809,2],[35826,1],[35862,1],[35864,1],[35878,1],[35903,1],[35926,1],[35959,2],[35971,1],[35996,1],[36003,1],[36027,1],[36046,1],[36066,2],[36082,1],[36122,2],[36142,1],[36168,1],[36339,1],[36385,1],[36421,1],[36478,1],[36512,1],[36617,1],[36650,1],[36778,1],[36812,1],[36854,1],[36856,1],[36980,1],[37060,1],[37062,1],[37120,1],[37127,1],[37211,1],[37222,1],[37262,1],[37281,1],[37578,1],[37841,1],[37885,1],[37887,1],[37978,1],[38123,1],[38164,1],[38179,2],[38221,1],[38233,2],[38268,1],[38288,2],[38341,1],[38373,2],[38739,1],[38806,2],[39079,1],[39113,1],[39134,1],[39144,2],[39147,2],[39160,1],[39171,1],[39182,1],[39184,1],[39194,2],[39197,2],[39200,1],[39220,1],[39234,1],[39266,2],[39288,1],[39322,1],[39324,1],[39326,1],[39328,1],[39330,1],[39332,1],[39334,2],[39349,1],[39364,1],[39385,1],[39418,1],[39420,1],[39437,1],[39439,1],[39441,2],[39454,1],[39487,1],[39489,1],[39506,1],[39508,1],[39510,1],[39512,1],[39514,1],[39516,1],[39643,1],[39677,1],[39698,1],[39708,2],[39711,2],[39724,1],[39744,1],[39758,1],[39790,2],[39812,1],[39846,1],[39848,1],[39850,1],[39852,2],[39867,1],[39882,1],[39903,1],[39936,1],[39938,1],[39955,1],[39957,1],[39959,1],[39961,1],[39963,1],[39965,1],[40048,1],[40118,1],[40301,1],[40373,1],[40375,1],[40448,1],[40450,1],[40528,1],[40900,1],[40947,1],[40949,1],[40966,2],[40969,1],[41003,1],[41024,1],[41034,2],[41037,2],[41050,1],[41070,1],[41084,1],[41116,2],[41138,1],[41172,1],[41174,1],[41176,1],[41178,2],[41193,1],[41208,1],[41229,1],[41262,1],[41264,1],[41281,1],[41283,1],[41285,1],[41287,1],[41289,1],[41291,2],[41294,1],[41325,1],[41341,1],[41351,2],[41354,2],[41378,1],[41398,1],[41412,1],[41439,2],[41461,1],[41484,1],[41486,1],[41488,1],[41490,2],[41505,1],[41520,1],[41536,1],[41569,1],[41571,1],[41596,1],[41598,1],[41600,1],[41602,1],[41604,1],[41606,2],[41609,1],[41648,1],[41660,1],[41670,2],[41673,1],[41675,2],[41690,1],[41705,1],[41717,1],[41750,1],[41752,1],[41769,1],[41771,1],[41773,1],[41775,1],[41777,1],[41779,1],[41781,1],[41783,1],[42432,2],[42504,2],[42528,1],[42544,1],[42546,1],[42573,2],[42673,1],[42734,2],[42818,2],[42998,2],[43041,3],[43045,2],[43066,1],[43076,1],[43078,1],[43169,2],[43172,1],[43229,3],[43233,2],[43244,1],[43270,2],[43349,1],[43351,1],[43393,1],[43407,1],[43409,2],[43508,2],[43582,2],[43667,2],[43800,2],[43974,2],[44017,2],[44027,2],[44034,1],[44036,2],[44039,2],[44055,1],[44057,1],[44067,2],[44162,1],[44169,2],[44257,1],[44269,2],[44348,2],[44356,1],[44358,1],[44374,1],[44395,2],[44467,2],[44586,1],[44641,1],[44675,1],[44677,2],[44779,1],[44807,1],[44819,1],[44875,2],[44932,1],[44986,2],[45091,1],[45145,2],[45272,1],[45326,2],[45369,2],[45386,1],[45422,1],[45424,1],[45438,1],[45463,1],[45486,1],[45519,2],[45531,1],[45556,1],[45563,1],[45587,1],[45606,1],[45626,2],[45642,1],[45682,2],[45702,1],[45728,1],[45899,1],[45945,1],[45981,1],[46038,1],[46072,1],[46177,1],[46210,1],[46338,1],[46372,1],[46414,1],[46416,1],[46540,1],[46620,1],[46622,1],[46680,1],[46687,1],[46771,1],[46782,1],[46822,1],[46841,1],[47138,1],[47401,1],[47445,1],[47447,1],[47538,1],[47683,1],[47724,1],[47739,2],[47781,1],[47793,2],[47828,1],[47848,2],[47901,1],[47933,2]]},"734":{"position":[[428,1],[610,1],[767,1]]},"745":{"position":[[452,1],[499,1],[501,1],[518,2],[521,1],[552,1],[564,1],[574,2],[577,2],[591,1],[601,2],[604,2],[617,1],[627,2],[630,2],[647,1],[657,2],[660,2],[672,1],[682,2],[685,1],[687,2],[702,1],[717,1],[729,1],[762,1],[764,1],[781,1],[783,1],[785,2],[799,1],[832,1],[834,1],[851,1],[853,1],[855,2],[868,1],[901,1],[903,1],[920,1],[922,1],[924,2],[941,1],[974,1],[976,1],[993,1],[995,1],[997,2],[1009,1],[1042,1],[1044,1],[1061,1],[1063,1],[1065,1],[1067,1],[1069,1],[1071,1],[1073,1],[1075,1],[1324,1],[1371,1],[1373,1],[1390,2],[1393,1],[1424,1],[1436,1],[1446,2],[1449,1],[1451,2],[1466,1],[1481,1],[1493,1],[1526,1],[1528,1],[1545,1],[1547,1],[1549,1],[1551,1],[1553,1],[1555,1],[1557,1],[1559,1],[1877,2],[1949,2],[1973,1],[1989,1],[1991,1],[2018,2],[2118,1],[2179,2],[2263,2],[2443,2],[2486,3],[2522,1],[2524,1],[2598,2],[2601,2],[2604,1],[2660,3],[2683,2],[2762,1],[2764,1],[2806,1],[2820,1],[2822,2],[2921,2],[2995,2],[3080,2],[3213,2],[3387,2],[3430,2],[3440,2],[3447,1],[3449,2],[3452,2],[3468,1],[3470,1],[3480,2],[3575,1],[3582,2],[3642,1],[3772,2],[3775,1],[3777,1],[3789,2],[3882,2],[3889,1],[3891,2],[3894,2],[3910,1],[3931,2],[4003,2],[4122,1],[4177,1],[4211,1],[4213,2],[4315,1],[4343,1],[4355,1],[4411,2],[4468,1],[4522,2],[4627,1],[4681,2],[4808,1],[4862,2],[4905,2],[4922,1],[4958,1],[4960,1],[4974,1],[5005,1],[5028,1],[5061,2],[5073,1],[5100,1],[5109,1],[5138,1],[5146,1],[5153,1],[5177,1],[5196,1],[5221,1],[5223,2],[5226,2],[5242,1],[5301,1],[5472,1],[5518,1],[5554,1],[5611,1],[5645,1],[5750,1],[5783,1],[5911,1],[5945,1],[5987,1],[5989,1],[6113,1],[6193,1],[6195,1],[6253,1],[6260,1],[6267,1],[6379,3],[6383,2],[6386,2],[6389,1],[6400,1],[6674,1],[6718,1],[6720,1],[6811,1],[6828,1],[6843,1],[6920,2],[7287,1],[7362,1],[7364,2],[7561,2],[7633,2],[7657,1],[7673,1],[7675,1],[7702,2],[7802,1],[7863,2],[7947,2],[8127,2],[8170,3],[8174,2],[8195,1],[8205,1],[8207,1],[8304,2],[8307,1],[8364,3],[8368,2],[8379,1],[8405,2],[8484,1],[8486,1],[8528,1],[8542,1],[8544,2],[8643,2],[8717,2],[8802,2],[8935,2],[9109,2],[9152,2],[9162,2],[9169,1],[9171,2],[9174,2],[9190,1],[9192,1],[9202,2],[9297,1],[9304,2],[9398,1],[9410,2],[9489,2],[9497,1],[9499,1],[9515,1],[9536,2],[9608,2],[9727,1],[9782,1],[9816,1],[9818,2],[9920,1],[9948,1],[9960,1],[10016,2],[10073,1],[10127,2],[10232,1],[10286,2],[10413,1],[10467,2],[10510,2],[10527,1],[10563,1],[10565,1],[10579,1],[10604,1],[10627,1],[10660,2],[10672,1],[10697,1],[10704,1],[10728,1],[10747,1],[10773,2],[10789,1],[10829,2],[10849,1],[10875,1],[11046,1],[11092,1],[11128,1],[11185,1],[11219,1],[11324,1],[11357,1],[11485,1],[11519,1],[11561,1],[11563,1],[11687,1],[11767,1],[11769,1],[11827,1],[11834,1],[11924,1],[11935,1],[11975,1],[11994,1],[12297,1],[12560,1],[12604,1],[12606,1],[12697,1],[12848,1],[12889,1],[12904,2],[12946,1],[12958,2],[12993,1],[13019,2],[13078,1],[13110,2],[13251,2],[13323,2],[13347,1],[13363,1],[13365,1],[13392,2],[13492,1],[13553,2],[13637,2],[13817,2],[13860,3],[13896,1],[13898,1],[13972,2],[13975,2],[13978,1],[14034,3],[14057,2],[14136,1],[14138,1],[14180,1],[14194,1],[14196,2],[14295,2],[14369,2],[14454,2],[14587,2],[14761,2],[14804,2],[14814,2],[14821,1],[14823,2],[14826,2],[14842,1],[14844,1],[14854,2],[14949,1],[14956,2],[15016,1],[15146,2],[15149,1],[15151,1],[15163,2],[15256,2],[15263,1],[15265,2],[15268,2],[15284,1],[15305,2],[15377,2],[15496,1],[15551,1],[15585,1],[15587,2],[15689,1],[15717,1],[15729,1],[15785,2],[15842,1],[15896,2],[16001,1],[16055,2],[16182,1],[16236,2],[16279,2],[16296,1],[16332,1],[16334,1],[16348,1],[16379,1],[16402,1],[16435,2],[16447,1],[16474,1],[16483,1],[16512,1],[16520,1],[16527,1],[16551,1],[16570,1],[16595,1],[16597,2],[16600,2],[16616,1],[16675,1],[16846,1],[16892,1],[16928,1],[16985,1],[17019,1],[17124,1],[17157,1],[17285,1],[17319,1],[17361,1],[17363,1],[17487,1],[17567,1],[17569,1],[17627,1],[17634,1],[17641,1],[17753,3],[17757,2],[17760,2],[17763,1],[17774,1],[18048,1],[18092,1],[18094,1],[18185,1],[18202,1],[18217,1],[18294,2],[18661,1],[18736,1],[18738,2],[18892,2],[18964,2],[18988,1],[19004,1],[19006,1],[19033,2],[19133,1],[19194,2],[19278,2],[19458,2],[19501,3],[19505,2],[19526,1],[19536,1],[19538,1],[19635,2],[19638,1],[19695,3],[19699,2],[19710,1],[19736,2],[19815,1],[19817,1],[19859,1],[19873,1],[19875,2],[19974,2],[20048,2],[20133,2],[20266,2],[20440,2],[20483,2],[20493,2],[20500,1],[20502,2],[20505,2],[20521,1],[20523,1],[20533,2],[20628,1],[20635,2],[20729,1],[20741,2],[20820,2],[20828,1],[20830,1],[20846,1],[20867,2],[20939,2],[21058,1],[21113,1],[21147,1],[21149,2],[21251,1],[21279,1],[21291,1],[21347,2],[21404,1],[21458,2],[21563,1],[21617,2],[21744,1],[21798,2],[21841,2],[21858,1],[21894,1],[21896,1],[21910,1],[21935,1],[21958,1],[21991,2],[22003,1],[22028,1],[22035,1],[22059,1],[22078,1],[22104,2],[22120,1],[22160,2],[22180,1],[22206,1],[22377,1],[22423,1],[22459,1],[22516,1],[22550,1],[22655,1],[22688,1],[22816,1],[22850,1],[22892,1],[22894,1],[23018,1],[23098,1],[23100,1],[23158,1],[23165,1],[23255,1],[23266,1],[23306,1],[23325,1],[23628,1],[23891,1],[23935,1],[23937,1],[24028,1],[24179,1],[24220,1],[24235,2],[24277,1],[24289,2],[24324,1],[24350,2],[24409,1],[24441,2],[24518,2],[24590,2],[24614,1],[24630,1],[24632,1],[24659,2],[24759,1],[24820,2],[24904,2],[25084,2],[25127,3],[25131,2],[25152,1],[25162,1],[25164,1],[25261,2],[25264,1],[25321,3],[25325,2],[25336,1],[25363,2],[25442,1],[25444,1],[25486,1],[25500,1],[25502,2],[25601,2],[25675,2],[25760,2],[25893,2],[26067,2],[26110,2],[26120,2],[26127,1],[26129,2],[26132,2],[26148,1],[26150,1],[26160,2],[26255,1],[26262,2],[26356,1],[26368,2],[26447,2],[26455,1],[26457,1],[26474,1],[26495,2],[26567,2],[26686,1],[26741,1],[26775,1],[26777,2],[26879,1],[26907,1],[26919,1],[26975,2],[27032,1],[27086,2],[27191,1],[27245,2],[27372,1],[27426,2],[27469,2],[27486,1],[27522,1],[27524,1],[27538,1],[27563,1],[27586,1],[27619,2],[27631,1],[27656,1],[27663,1],[27687,1],[27706,1],[27732,2],[27748,1],[27788,2],[27808,1],[27835,1],[28006,1],[28052,1],[28088,1],[28145,1],[28179,1],[28284,1],[28317,1],[28445,1],[28479,1],[28521,1],[28523,1],[28647,1],[28727,1],[28729,1],[28787,1],[28794,1],[28884,1],[28895,1],[28935,1],[28954,1],[29258,1],[29522,1],[29566,1],[29568,1],[29659,1],[29810,1],[29852,1],[29867,2],[29909,1],[29921,2],[29956,1],[29982,2],[30041,1],[30073,2],[30567,1],[30614,1],[30616,1],[30633,2],[30636,1],[30667,1],[30679,1],[30690,1],[30701,1],[30703,1],[30713,2],[30716,2],[30719,1],[30740,1],[30764,1],[30766,1],[30768,1],[30770,1],[30772,2],[30786,1],[30797,1],[30808,1],[30810,1],[30820,2],[30823,2],[30826,1],[30847,1],[30870,1],[30872,1],[30874,1],[30876,1],[30878,2],[30891,1],[30902,1],[30913,1],[30915,1],[30925,2],[30928,2],[30931,1],[30952,1],[30979,1],[30981,1],[30983,1],[30985,1],[30987,2],[31004,1],[31015,1],[31026,1],[31028,1],[31038,2],[31041,2],[31044,1],[31065,1],[31087,1],[31089,1],[31091,1],[31093,1],[31095,2],[31107,1],[31117,2],[31120,1],[31122,2],[31137,1],[31152,1],[31164,1],[31197,1],[31199,1],[31216,1],[31218,1],[31220,2],[31234,1],[31267,1],[31269,1],[31286,1],[31288,1],[31290,2],[31303,1],[31336,1],[31338,1],[31355,1],[31357,1],[31359,2],[31376,1],[31409,1],[31411,1],[31428,1],[31430,1],[31432,2],[31444,1],[31477,1],[31479,1],[31496,1],[31498,1],[31500,1],[31502,1],[31504,1],[31506,1],[31508,1],[31510,1],[31623,1],[31654,1],[31666,1],[31677,1],[31688,1],[31690,1],[31700,2],[31703,2],[31706,1],[31727,1],[31751,1],[31753,1],[31755,1],[31757,1],[31759,1],[31761,2],[31776,1],[31791,1],[31803,1],[31836,1],[31838,1],[31855,1],[31857,1],[31859,1],[31861,1],[31863,1],[31865,1],[32252,2],[32324,2],[32348,1],[32364,1],[32366,1],[32393,2],[32493,1],[32554,2],[32638,2],[32818,2],[32861,3],[32865,2],[32886,1],[32896,1],[32898,1],[32995,2],[32998,1],[33055,3],[33059,2],[33070,1],[33096,2],[33175,1],[33177,1],[33219,1],[33233,1],[33235,2],[33334,2],[33408,2],[33493,2],[33626,2],[33800,2],[33843,2],[33853,2],[33860,1],[33862,2],[33865,2],[33881,1],[33883,1],[33893,2],[33988,1],[33995,2],[34089,1],[34101,2],[34180,2],[34188,1],[34190,1],[34206,1],[34227,2],[34299,2],[34418,1],[34473,1],[34507,1],[34509,2],[34611,1],[34639,1],[34651,1],[34707,2],[34764,1],[34818,2],[34923,1],[34977,2],[35104,1],[35158,2],[35201,2],[35218,1],[35254,1],[35256,1],[35270,1],[35295,1],[35318,1],[35351,2],[35363,1],[35388,1],[35395,1],[35419,1],[35438,1],[35464,2],[35480,1],[35520,2],[35540,1],[35566,1],[35737,1],[35783,1],[35819,1],[35876,1],[35910,1],[36015,1],[36048,1],[36176,1],[36210,1],[36252,1],[36254,1],[36378,1],[36458,1],[36460,1],[36518,1],[36525,1],[36615,1],[36626,1],[36666,1],[36685,1],[36988,1],[37251,1],[37295,1],[37297,1],[37388,1],[37539,1],[37580,1],[37595,2],[37637,1],[37649,2],[37684,1],[37710,2],[37769,1],[37801,2],[37878,2],[37950,2],[37974,1],[37990,1],[37992,1],[38019,2],[38119,1],[38180,2],[38264,2],[38444,2],[38487,3],[38491,2],[38512,1],[38522,1],[38524,1],[38621,2],[38624,1],[38681,3],[38685,2],[38696,1],[38722,2],[38801,1],[38803,1],[38845,1],[38859,1],[38861,2],[38960,2],[39034,2],[39119,2],[39252,2],[39426,2],[39469,2],[39479,2],[39486,1],[39488,2],[39491,2],[39507,1],[39509,1],[39519,2],[39614,1],[39621,2],[39715,1],[39727,2],[39806,2],[39814,1],[39816,1],[39832,1],[39853,2],[39925,2],[40044,1],[40099,1],[40133,1],[40135,2],[40237,1],[40265,1],[40277,1],[40333,2],[40390,1],[40444,2],[40549,1],[40603,2],[40730,1],[40784,2],[40827,2],[40844,1],[40880,1],[40882,1],[40896,1],[40921,1],[40944,1],[40977,2],[40989,1],[41014,1],[41021,1],[41045,1],[41064,1],[41090,2],[41106,1],[41146,2],[41166,1],[41192,1],[41363,1],[41409,1],[41445,1],[41502,1],[41536,1],[41641,1],[41674,1],[41802,1],[41836,1],[41878,1],[41880,1],[42004,1],[42084,1],[42086,1],[42144,1],[42151,1],[42241,1],[42252,1],[42292,1],[42311,1],[42614,1],[42877,1],[42921,1],[42923,1],[43014,1],[43165,1],[43206,1],[43221,2],[43263,1],[43275,2],[43310,1],[43336,2],[43395,1],[43427,2]]},"747":{"position":[[422,1],[469,1],[471,1],[502,1],[514,1],[524,2],[527,1],[529,2],[544,1],[559,1],[571,1],[604,1],[606,1],[623,2],[626,1],[665,1],[667,1],[669,1],[671,1],[673,1],[675,1],[677,1],[679,1],[1054,1],[1101,1],[1103,1],[1120,2],[1123,1],[1154,1],[1166,1],[1177,1],[1188,1],[1190,1],[1200,2],[1203,2],[1206,1],[1227,1],[1251,1],[1253,1],[1255,1],[1257,1],[1259,2],[1273,1],[1284,1],[1295,1],[1297,1],[1307,2],[1310,2],[1313,1],[1334,1],[1357,1],[1359,1],[1361,1],[1363,1],[1365,2],[1378,1],[1389,1],[1400,1],[1402,1],[1412,2],[1415,2],[1418,1],[1439,1],[1466,1],[1468,1],[1470,1],[1472,1],[1474,2],[1491,1],[1502,1],[1513,1],[1515,1],[1525,2],[1528,2],[1531,1],[1552,1],[1574,1],[1576,1],[1578,1],[1580,1],[1582,2],[1594,1],[1604,2],[1607,1],[1609,2],[1624,1],[1639,1],[1651,1],[1684,1],[1686,1],[1703,2],[1706,1],[1745,1],[1747,1],[1749,2],[1763,1],[1796,1],[1798,1],[1815,2],[1818,1],[1857,1],[1859,1],[1861,2],[1874,1],[1907,1],[1909,1],[1926,2],[1929,1],[1968,1],[1970,1],[1972,2],[1989,1],[2022,1],[2024,1],[2041,2],[2044,1],[2083,1],[2085,1],[2087,2],[2099,1],[2132,1],[2134,1],[2151,2],[2154,1],[2193,1],[2195,1],[2197,1],[2199,1],[2201,1],[2203,1],[2205,1],[2207,1],[2406,2],[2478,2],[2502,1],[2518,1],[2520,1],[2547,2],[2647,1],[2708,2],[2792,2],[2972,2],[3015,3],[3051,1],[3053,2],[3110,1],[3191,2],[3261,1],[3356,2],[3359,2],[3362,1],[3418,3],[3441,2],[3520,1],[3522,1],[3564,1],[3578,1],[3580,2],[3679,2],[3753,2],[3838,2],[3971,2],[4145,2],[4188,2],[4198,2],[4205,1],[4207,2],[4210,2],[4226,1],[4228,1],[4238,2],[4333,1],[4340,2],[4400,1],[4402,2],[4594,2],[4597,1],[4599,2],[4818,2],[4821,1],[4823,1],[4835,2],[4928,2],[4935,1],[4937,2],[4940,2],[4956,1],[4977,2],[5049,2],[5168,1],[5223,1],[5257,1],[5259,2],[5361,1],[5389,1],[5401,1],[5457,2],[5514,1],[5568,2],[5673,1],[5727,2],[5854,1],[5908,2],[5951,2],[5968,1],[6004,1],[6006,1],[6020,1],[6051,1],[6074,1],[6107,2],[6119,1],[6146,1],[6155,1],[6184,1],[6186,2],[6249,1],[6256,1],[6283,1],[6302,1],[6331,2],[6334,2],[6410,1],[6417,1],[6463,1],[6481,1],[6506,1],[6508,2],[6511,2],[6527,1],[6586,1],[6757,1],[6803,1],[6839,1],[6896,1],[6930,1],[7035,1],[7068,1],[7196,1],[7230,1],[7272,1],[7274,1],[7398,1],[7478,1],[7480,1],[7538,1],[7545,1],[7552,1],[7596,1],[7727,2],[7743,1],[7901,3],[7905,2],[7908,2],[7911,1],[7922,1],[8196,1],[8240,1],[8242,1],[8333,1],[8350,1],[8365,1],[8543,2],[9058,2],[9115,1],[9197,2],[9200,2],[9270,1],[9366,1],[9368,2],[9720,2],[9792,2],[9816,1],[9832,1],[9834,1],[9861,2],[9961,1],[10022,2],[10106,2],[10286,2],[10329,3],[10333,2],[10354,1],[10364,1],[10366,1],[10465,2],[10468,1],[10525,3],[10529,2],[10540,1],[10566,2],[10645,1],[10647,1],[10689,1],[10703,1],[10705,2],[10804,2],[10878,2],[10963,2],[11096,2],[11270,2],[11313,2],[11323,2],[11330,1],[11332,2],[11335,2],[11351,1],[11353,1],[11363,2],[11458,1],[11465,2],[11561,1],[11573,2],[11652,2],[11660,1],[11662,1],[11678,1],[11699,2],[11771,2],[11890,1],[11945,1],[11979,1],[11981,2],[12083,1],[12111,1],[12123,1],[12179,2],[12236,1],[12290,2],[12395,1],[12449,2],[12576,1],[12630,2],[12673,2],[12690,1],[12726,1],[12728,1],[12742,1],[12767,1],[12790,1],[12823,2],[12835,1],[12860,1],[12867,1],[12894,1],[12912,1],[12938,2],[12954,1],[12994,2],[13014,1],[13040,1],[13211,1],[13257,1],[13293,1],[13350,1],[13384,1],[13489,1],[13522,1],[13650,1],[13684,1],[13726,1],[13728,1],[13852,1],[13932,1],[13934,1],[13992,1],[13999,1],[14091,1],[14102,1],[14142,1],[14161,1],[14466,1],[14729,1],[14773,1],[14775,1],[14866,1],[15019,1],[15060,1],[15078,2],[15123,1],[15134,2],[15168,1],[15194,2],[15253,1],[15285,2]]},"749":{"position":[[351,2],[423,2],[447,1],[463,1],[465,1],[492,2],[592,1],[653,2],[737,2],[917,2],[960,3],[996,1],[998,1],[1096,2],[1099,2],[1102,1],[1158,3],[1181,2],[1260,1],[1262,1],[1304,1],[1318,1],[1320,2],[1419,2],[1493,2],[1578,2],[1711,2],[1885,2],[1928,2],[1938,2],[1945,1],[1947,2],[1950,2],[1966,1],[1968,1],[1978,2],[2073,1],[2080,2],[2140,1],[2294,2],[2297,1],[2299,1],[2311,2],[2404,2],[2411,1],[2413,2],[2416,2],[2432,1],[2453,2],[2525,2],[2644,1],[2699,1],[2733,1],[2735,2],[2837,1],[2865,1],[2877,1],[2933,2],[2990,1],[3044,2],[3149,1],[3203,2],[3330,1],[3384,2],[3427,2],[3444,1],[3480,1],[3482,1],[3496,1],[3527,1],[3550,1],[3583,2],[3595,1],[3622,1],[3631,1],[3660,1],[3668,1],[3675,1],[3719,1],[3738,1],[3767,1],[3769,2],[3772,2],[3788,1],[3847,1],[4018,1],[4064,1],[4100,1],[4157,1],[4191,1],[4296,1],[4329,1],[4457,1],[4491,1],[4533,1],[4535,1],[4659,1],[4739,1],[4741,1],[4799,1],[4806,1],[4813,1],[4949,3],[4953,2],[4956,2],[4959,1],[4970,1],[5244,1],[5288,1],[5290,1],[5381,1],[5398,1],[5413,1],[5514,2],[5905,1],[6004,1],[6006,2],[6592,2],[6664,2],[6688,1],[6704,1],[6706,1],[6733,2],[6833,1],[6894,2],[6978,2],[7158,2],[7201,3],[7237,1],[7239,2],[7292,1],[7369,2],[7372,2],[7375,1],[7431,3],[7454,2],[7533,1],[7535,1],[7577,1],[7591,1],[7593,2],[7692,2],[7766,2],[7851,2],[7984,2],[8158,2],[8201,2],[8211,2],[8218,1],[8220,2],[8223,2],[8239,1],[8241,1],[8251,2],[8346,1],[8353,2],[8413,1],[8415,2],[8599,2],[8602,1],[8604,1],[8616,2],[8709,2],[8716,1],[8718,2],[8721,2],[8737,1],[8758,2],[8830,2],[8949,1],[9004,1],[9038,1],[9040,2],[9142,1],[9170,1],[9182,1],[9238,2],[9295,1],[9349,2],[9454,1],[9508,2],[9635,1],[9689,2],[9732,2],[9749,1],[9785,1],[9787,1],[9801,1],[9832,1],[9855,1],[9888,2],[9900,1],[9927,1],[9936,1],[9965,1],[9967,2],[10026,1],[10033,1],[10058,1],[10077,1],[10104,1],[10106,2],[10109,2],[10125,1],[10184,1],[10355,1],[10401,1],[10437,1],[10494,1],[10528,1],[10633,1],[10666,1],[10794,1],[10828,1],[10870,1],[10872,1],[10996,1],[11076,1],[11078,1],[11136,1],[11143,1],[11150,1],[11194,1],[11317,3],[11321,2],[11324,2],[11327,1],[11338,1],[11612,1],[11656,1],[11658,1],[11749,1],[11766,1],[11781,1],[11861,2],[12231,2],[12284,1],[12362,1],[12364,2],[12483,2],[12555,2],[12579,1],[12595,1],[12597,1],[12624,2],[12724,1],[12785,2],[12869,2],[13049,2],[13092,3],[13096,2],[13117,1],[13127,1],[13129,1],[13226,2],[13229,1],[13286,3],[13290,2],[13301,1],[13327,2],[13406,1],[13408,1],[13450,1],[13464,1],[13466,2],[13565,2],[13639,2],[13724,2],[13857,2],[14031,2],[14074,2],[14084,2],[14091,1],[14093,2],[14096,2],[14112,1],[14114,1],[14124,2],[14219,1],[14226,2],[14320,1],[14332,2],[14411,2],[14419,1],[14421,1],[14437,1],[14458,2],[14530,2],[14649,1],[14704,1],[14738,1],[14740,2],[14842,1],[14870,1],[14882,1],[14938,2],[14995,1],[15049,2],[15154,1],[15208,2],[15335,1],[15389,2],[15432,2],[15449,1],[15485,1],[15487,1],[15501,1],[15526,1],[15549,1],[15582,2],[15594,1],[15619,1],[15626,1],[15651,1],[15669,1],[15695,2],[15711,1],[15751,2],[15771,1],[15797,1],[15968,1],[16014,1],[16050,1],[16107,1],[16141,1],[16246,1],[16279,1],[16407,1],[16441,1],[16483,1],[16485,1],[16609,1],[16689,1],[16691,1],[16749,1],[16756,1],[16846,1],[16857,1],[16897,1],[16916,1],[17219,1],[17482,1],[17526,1],[17528,1],[17619,1],[17770,1],[17811,1],[17827,2],[17870,1],[17881,2],[17915,1],[17941,2],[18000,1],[18032,2]]},"751":{"position":[[1014,1],[1061,1],[1063,1],[1102,1],[1114,1],[1124,2],[1127,1],[1129,2],[1144,1],[1159,1],[1171,1],[1204,1],[1206,1],[1223,1],[1225,1],[1227,1],[1229,1],[1231,1],[1233,1],[1235,1],[1237,1],[1581,1],[1628,1],[1630,1],[1661,1],[1673,1],[1684,1],[1695,1],[1697,1],[1707,2],[1710,2],[1713,1],[1734,1],[1758,1],[1760,1],[1762,1],[1764,1],[1766,2],[1780,1],[1791,1],[1802,1],[1804,1],[1814,2],[1817,2],[1820,1],[1841,1],[1864,1],[1866,1],[1868,1],[1870,1],[1872,2],[1885,1],[1896,1],[1907,1],[1909,1],[1919,2],[1922,2],[1925,1],[1946,1],[1973,1],[1975,1],[1977,1],[1979,1],[1981,2],[1998,1],[2009,1],[2020,1],[2022,1],[2032,2],[2035,2],[2038,1],[2059,1],[2081,1],[2083,1],[2085,1],[2087,1],[2089,2],[2101,1],[2111,2],[2114,2],[2126,1],[2136,2],[2139,1],[2141,2],[2156,1],[2171,1],[2183,1],[2216,1],[2218,1],[2235,2],[2238,1],[2277,1],[2279,1],[2281,2],[2295,1],[2328,1],[2330,1],[2347,2],[2350,1],[2389,1],[2391,1],[2393,2],[2406,1],[2439,1],[2441,1],[2458,2],[2461,1],[2500,1],[2502,1],[2504,2],[2521,1],[2554,1],[2556,1],[2573,2],[2576,1],[2615,1],[2617,1],[2619,2],[2631,1],[2664,1],[2666,1],[2683,2],[2686,1],[2725,1],[2727,1],[2729,2],[2741,1],[2774,1],[2776,1],[2801,1],[2803,1],[2805,1],[2807,1],[2809,1],[2811,1],[2813,1],[2815,1],[3048,2],[3120,2],[3144,1],[3160,1],[3162,1],[3189,2],[3289,1],[3350,2],[3434,2],[3614,2],[3657,3],[3693,1],[3695,1],[3769,1],[3853,2],[3856,2],[3859,1],[3915,3],[3938,2],[4017,1],[4019,1],[4061,1],[4075,1],[4077,2],[4176,2],[4250,2],[4335,2],[4468,2],[4642,2],[4685,2],[4695,2],[4702,1],[4704,2],[4707,2],[4723,1],[4725,1],[4735,2],[4830,1],[4837,2],[4897,1],[5027,2],[5030,1],[5170,2],[5173,1],[5175,1],[5187,2],[5280,2],[5287,1],[5289,2],[5292,2],[5308,1],[5329,2],[5401,2],[5520,1],[5575,1],[5609,1],[5611,2],[5713,1],[5741,1],[5753,1],[5809,2],[5866,1],[5920,2],[6025,1],[6079,2],[6206,1],[6260,2],[6303,2],[6320,1],[6356,1],[6358,1],[6372,1],[6403,1],[6426,1],[6459,2],[6471,1],[6498,1],[6507,1],[6536,1],[6544,1],[6551,1],[6575,1],[6594,1],[6619,2],[6628,1],[6635,1],[6670,1],[6688,1],[6713,1],[6715,2],[6718,2],[6734,1],[6793,1],[6964,1],[7010,1],[7046,1],[7103,1],[7137,1],[7242,1],[7275,1],[7403,1],[7437,1],[7479,1],[7481,1],[7605,1],[7685,1],[7687,1],[7745,1],[7752,1],[7759,1],[7871,2],[7965,3],[7969,2],[7972,2],[7975,1],[7986,1],[8260,1],[8304,1],[8306,1],[8397,1],[8414,1],[8429,1],[8589,2],[9086,1],[9161,2],[9164,1],[9249,1],[9251,2],[9932,2],[10004,2],[10028,1],[10044,1],[10046,1],[10073,2],[10173,1],[10234,2],[10318,2],[10498,2],[10541,3],[10545,2],[10566,1],[10576,1],[10578,1],[10674,2],[10677,1],[10734,3],[10738,2],[10749,1],[10780,2],[10859,1],[10861,1],[10903,1],[10917,1],[10919,2],[11018,2],[11092,2],[11177,2],[11310,2],[11484,2],[11527,2],[11537,2],[11544,1],[11546,2],[11549,2],[11565,1],[11567,1],[11577,2],[11672,1],[11679,2],[11772,1],[11784,2],[11863,2],[11871,1],[11873,1],[11894,1],[11915,2],[11987,2],[12106,1],[12161,1],[12195,1],[12197,2],[12299,1],[12327,1],[12339,1],[12395,2],[12452,1],[12506,2],[12611,1],[12665,2],[12792,1],[12846,2],[12889,2],[12906,1],[12942,1],[12944,1],[12958,1],[12983,1],[13006,1],[13039,2],[13051,1],[13076,1],[13083,1],[13107,1],[13125,1],[13151,2],[13167,1],[13207,2],[13227,1],[13258,1],[13429,1],[13475,1],[13511,1],[13568,1],[13602,1],[13707,1],[13740,1],[13868,1],[13902,1],[13944,1],[13946,1],[14070,1],[14150,1],[14152,1],[14210,1],[14217,1],[14306,1],[14317,1],[14357,1],[14376,1],[14683,1],[14951,1],[14995,1],[14997,1],[15088,1],[15238,1],[15284,1],[15299,2],[15341,1],[15352,2],[15386,1],[15412,2],[15471,1],[15503,2],[15747,1],[15769,1],[15771,1],[15802,1],[15813,1],[15824,1],[15835,1],[15837,1],[15847,2],[15850,2],[15853,1],[15873,1],[15887,1],[15909,2],[15931,1],[15958,1],[15960,1],[15962,1],[15964,1],[15966,1],[15968,1],[15970,2],[15985,1],[16000,1],[16011,1],[16044,1],[16046,1],[16063,2],[16066,1],[16105,2],[16108,1],[16155,1],[16157,1],[16159,1],[16161,1],[16163,1],[16165,1],[16167,1],[16169,1],[16646,2],[16735,2],[16845,1],[16915,3],[16919,1],[16977,3],[17366,2],[17438,2],[17462,1],[17478,1],[17480,1],[17507,2],[17607,1],[17668,2],[17752,2],[17932,2],[17975,3],[18011,1],[18013,1],[18109,2],[18112,2],[18115,1],[18171,3],[18194,2],[18273,1],[18275,1],[18317,1],[18331,1],[18333,2],[18432,2],[18506,2],[18591,2],[18724,2],[18898,2],[18941,2],[18951,2],[18958,1],[18960,2],[18963,2],[18979,1],[18981,1],[18991,2],[19086,1],[19093,2],[19153,1],[19305,2],[19308,1],[19310,1],[19322,2],[19415,2],[19422,1],[19424,2],[19427,2],[19443,1],[19464,2],[19536,2],[19655,1],[19710,1],[19744,1],[19746,2],[19848,1],[19876,1],[19888,1],[19944,2],[20001,1],[20055,2],[20160,1],[20214,2],[20341,1],[20395,2],[20438,2],[20455,1],[20491,1],[20493,1],[20507,1],[20538,1],[20561,1],[20594,2],[20606,1],[20633,1],[20642,1],[20671,1],[20679,1],[20686,1],[20728,1],[20751,1],[20776,1],[20778,2],[20781,2],[20797,1],[20856,1],[21027,1],[21073,1],[21109,1],[21166,1],[21200,1],[21305,1],[21338,1],[21466,1],[21500,1],[21542,1],[21544,1],[21668,1],[21748,1],[21750,1],[21808,1],[21815,1],[21822,1],[21956,3],[21960,2],[21963,2],[21966,1],[21977,1],[22251,1],[22295,1],[22297,1],[22388,1],[22405,1],[22420,1],[22519,2],[22908,1],[23005,1],[23007,2],[23705,1],[23752,1],[23754,1],[23771,2],[23774,1],[23805,1],[23816,1],[23827,1],[23838,1],[23840,1],[23850,2],[23853,2],[23856,1],[23876,1],[23897,1],[23919,2],[23934,1],[23956,1],[23958,1],[23960,1],[23962,1],[23964,1],[23966,2],[23983,1],[23994,1],[24005,1],[24007,1],[24017,2],[24020,2],[24023,1],[24044,1],[24066,1],[24068,1],[24070,1],[24072,1],[24074,2],[24087,1],[24098,1],[24109,1],[24111,1],[24121,2],[24124,2],[24127,1],[24148,1],[24175,1],[24177,2],[24180,1],[24200,1],[24221,1],[24244,2],[24259,1],[24281,1],[24283,1],[24285,1],[24287,1],[24289,1],[24291,2],[24305,1],[24316,1],[24327,1],[24329,1],[24339,2],[24342,2],[24345,1],[24366,1],[24389,1],[24391,1],[24393,1],[24395,1],[24397,2],[24410,1],[24421,1],[24432,1],[24434,1],[24444,2],[24447,2],[24450,1],[24471,1],[24495,1],[24497,2],[24500,1],[24520,1],[24541,1],[24564,2],[24579,1],[24601,1],[24603,1],[24605,1],[24607,1],[24609,1],[24611,2],[24623,1],[24633,2],[24636,1],[24638,2],[24653,1],[24668,1],[24680,1],[24713,1],[24715,1],[24732,2],[24735,1],[24774,2],[24777,1],[24824,1],[24826,1],[24828,2],[24842,1],[24875,1],[24877,1],[24894,2],[24897,1],[24936,2],[24939,1],[24986,1],[24988,1],[24990,2],[25003,1],[25036,1],[25038,1],[25055,2],[25058,1],[25097,2],[25100,1],[25147,1],[25149,1],[25151,2],[25168,1],[25201,1],[25203,1],[25220,2],[25223,1],[25262,2],[25265,1],[25312,1],[25314,1],[25316,2],[25328,1],[25361,1],[25363,1],[25380,2],[25383,1],[25422,2],[25425,1],[25472,1],[25474,1],[25476,2],[25488,1],[25521,1],[25523,1],[25548,1],[25550,1],[25552,1],[25554,1],[25556,1],[25558,2],[25561,1],[25600,1],[25611,1],[25621,2],[25624,2],[25641,1],[25651,2],[25654,1],[25656,2],[25671,1],[25686,1],[25697,1],[25730,1],[25732,1],[25757,1],[25759,1],[25761,2],[25778,1],[25811,1],[25813,1],[25830,2],[25833,1],[25872,2],[25875,1],[25922,1],[25924,1],[25926,1],[25928,1],[25930,1],[25932,1],[25934,1],[25936,1]]},"759":{"position":[[784,1],[943,1]]},"761":{"position":[[891,1],[938,1],[940,1],[957,2],[960,1],[993,1],[1014,1],[1024,2],[1027,1],[1029,2],[1044,1],[1059,1],[1080,1],[1113,1],[1115,1],[1132,1],[1134,1],[1136,1],[1138,1],[1140,1],[1142,2],[1145,1],[1179,1],[1191,1],[1201,2],[1204,2],[1226,1],[1246,1],[1260,1],[1272,3],[1297,2],[1319,1],[1331,3],[1365,1],[1367,1],[1369,2],[1384,1],[1394,2],[1397,2],[1410,1],[1421,1],[1432,1],[1434,1],[1455,1],[1467,3],[1494,1],[1496,2],[1499,1],[1520,1],[1532,3],[1566,1],[1568,1],[1570,1],[1572,1],[1574,2],[1589,1],[1610,1],[1622,3],[1647,1],[1649,1],[1651,2],[1666,1],[1681,1],[1693,1],[1726,1],[1728,1],[1747,1],[1749,1],[1751,2],[1766,1],[1799,1],[1801,1],[1818,1],[1820,1],[1822,1],[1824,1],[1826,1],[1828,2],[1831,1],[1869,1],[1882,1],[1892,2],[1895,2],[1910,1],[1930,1],[1944,1],[1956,3],[1982,2],[2004,1],[2016,3],[2041,1],[2043,1],[2045,1],[2047,2],[2062,1],[2077,1],[2090,1],[2123,1],[2125,1],[2145,1],[2147,1],[2149,1],[2151,1],[2153,1],[2155,1],[2157,1],[2159,1],[2654,2],[2726,2],[2750,1],[2766,1],[2768,1],[2795,2],[2895,1],[2956,2],[3040,2],[3220,2],[3263,3],[3299,1],[3301,2],[3356,1],[3435,2],[3495,1],[3575,2],[3670,1],[3751,2],[3815,1],[3894,2],[3897,2],[3900,1],[3956,3],[3979,2],[4058,1],[4060,1],[4102,1],[4116,1],[4118,2],[4217,2],[4291,2],[4376,2],[4509,2],[4683,2],[4726,2],[4736,2],[4743,1],[4745,2],[4748,2],[4764,1],[4766,1],[4776,2],[4871,1],[4878,2],[4938,1],[4940,2],[5128,2],[5131,1],[5133,2],[5327,2],[5330,1],[5332,2],[5562,2],[5565,1],[5567,2],[5764,2],[5767,1],[5769,1],[5781,2],[5874,2],[5881,1],[5883,2],[5886,2],[5902,1],[5923,2],[5995,2],[6114,1],[6169,1],[6203,1],[6205,2],[6307,1],[6335,1],[6347,1],[6403,2],[6460,1],[6514,2],[6619,1],[6673,2],[6800,1],[6854,2],[6897,2],[6914,1],[6950,1],[6952,1],[6966,1],[6997,1],[7020,1],[7053,2],[7065,1],[7092,1],[7101,1],[7130,1],[7132,2],[7193,1],[7200,1],[7224,1],[7252,1],[7273,2],[7276,2],[7342,1],[7349,1],[7377,1],[7398,1],[7423,2],[7426,2],[7527,1],[7534,1],[7565,1],[7584,1],[7609,2],[7612,2],[7682,1],[7689,1],[7724,1],[7744,1],[7762,1],[7764,2],[7767,2],[7783,1],[7842,1],[8013,1],[8059,1],[8095,1],[8152,1],[8186,1],[8291,1],[8324,1],[8452,1],[8486,1],[8528,1],[8530,1],[8654,1],[8734,1],[8736,1],[8794,1],[8801,1],[8808,1],[8852,1],[8979,2],[8995,1],[9128,2],[9144,1],[9313,2],[9329,1],[9465,3],[9469,2],[9472,2],[9475,1],[9486,1],[9760,1],[9804,1],[9806,1],[9897,1],[9914,1],[9929,1],[10248,2],[10998,2],[11053,1],[11133,2],[11136,2],[11196,1],[11277,2],[11280,2],[11375,1],[11457,2],[11460,2],[11524,1],[11604,1],[11606,2]]},"767":{"position":[[481,2],[553,2],[577,1],[593,1],[595,1],[622,2],[722,1],[783,2],[867,2],[1047,2],[1090,3],[1094,2],[1115,1],[1125,1],[1127,1],[1219,2],[1222,1],[1279,3],[1283,2],[1294,1],[1320,2],[1399,1],[1401,1],[1443,1],[1457,1],[1459,2],[1558,2],[1632,2],[1717,2],[1850,2],[2024,2],[2067,2],[2077,2],[2084,1],[2086,2],[2089,2],[2105,1],[2107,1],[2117,2],[2212,1],[2219,2],[2308,1],[2320,2],[2399,2],[2407,1],[2409,1],[2425,1],[2446,2],[2518,2],[2637,1],[2692,1],[2726,1],[2728,2],[2830,1],[2858,1],[2870,1],[2926,2],[2983,1],[3037,2],[3142,1],[3196,2],[3323,1],[3377,2],[3420,2],[3437,1],[3473,1],[3475,1],[3489,1],[3514,1],[3537,1],[3570,2],[3582,1],[3607,1],[3614,1],[3638,1],[3659,1],[3678,2],[3694,1],[3734,2],[3754,1],[3780,1],[3951,1],[3997,1],[4033,1],[4090,1],[4124,1],[4229,1],[4262,1],[4390,1],[4424,1],[4466,1],[4468,1],[4592,1],[4672,1],[4674,1],[4732,1],[4739,1],[4824,1],[4835,1],[4875,1],[4894,1],[5192,1],[5455,1],[5499,1],[5501,1],[5592,1],[5738,1],[5779,1],[5794,2],[5836,1],[5850,2],[5887,1],[5906,2],[5958,1],[5990,2],[6169,2],[6241,2],[6265,1],[6281,1],[6283,1],[6310,2],[6410,1],[6471,2],[6555,2],[6735,2],[6778,3],[6782,2],[6803,1],[6813,1],[6815,1],[6911,2],[6914,1],[6971,3],[6975,2],[6986,1],[7012,2],[7091,1],[7093,1],[7135,1],[7149,1],[7151,2],[7250,2],[7324,2],[7409,2],[7542,2],[7716,2],[7759,2],[7769,2],[7776,1],[7778,2],[7781,2],[7797,1],[7799,1],[7809,2],[7904,1],[7911,2],[8004,1],[8016,2],[8095,2],[8103,1],[8105,1],[8121,1],[8142,2],[8214,2],[8333,1],[8388,1],[8422,1],[8424,2],[8526,1],[8554,1],[8566,1],[8622,2],[8679,1],[8733,2],[8838,1],[8892,2],[9019,1],[9073,2],[9116,2],[9133,1],[9169,1],[9171,1],[9185,1],[9210,1],[9233,1],[9266,2],[9278,1],[9303,1],[9310,1],[9338,1],[9359,1],[9378,2],[9394,1],[9434,2],[9454,1],[9480,1],[9651,1],[9697,1],[9733,1],[9790,1],[9824,1],[9929,1],[9962,1],[10090,1],[10124,1],[10166,1],[10168,1],[10292,1],[10372,1],[10374,1],[10432,1],[10439,1],[10528,1],[10539,1],[10579,1],[10598,1],[10900,1],[11163,1],[11207,1],[11209,1],[11300,1],[11450,1],[11491,1],[11510,2],[11556,1],[11570,2],[11607,1],[11626,2],[11678,1],[11710,2],[11894,2],[11966,2],[11990,1],[12006,1],[12008,1],[12035,2],[12135,1],[12196,2],[12280,2],[12460,2],[12503,3],[12539,1],[12541,2],[12595,1],[12674,2],[12677,2],[12680,1],[12736,3],[12759,2],[12838,1],[12840,1],[12882,1],[12896,1],[12898,2],[12997,2],[13071,2],[13156,2],[13289,2],[13463,2],[13506,2],[13516,2],[13523,1],[13525,2],[13528,2],[13544,1],[13546,1],[13556,2],[13651,1],[13658,2],[13718,1],[13720,2],[13907,2],[13910,1],[13912,1],[13924,2],[14017,2],[14024,1],[14026,2],[14029,2],[14045,1],[14066,2],[14138,2],[14257,1],[14312,1],[14346,1],[14348,2],[14450,1],[14478,1],[14490,1],[14546,2],[14603,1],[14657,2],[14762,1],[14816,2],[14943,1],[14997,2],[15040,2],[15057,1],[15093,1],[15095,1],[15109,1],[15140,1],[15163,1],[15196,2],[15208,1],[15235,1],[15244,1],[15273,1],[15275,2],[15335,1],[15342,1],[15366,1],[15394,1],[15415,1],[15417,2],[15420,2],[15436,1],[15495,1],[15666,1],[15712,1],[15748,1],[15805,1],[15839,1],[15944,1],[15977,1],[16105,1],[16139,1],[16181,1],[16183,1],[16307,1],[16387,1],[16389,1],[16447,1],[16454,1],[16461,1],[16505,1],[16631,3],[16635,2],[16638,2],[16641,1],[16652,1],[16926,1],[16970,1],[16972,1],[17063,1],[17080,1],[17095,1],[17177,2],[17549,2],[17603,1],[17683,1],[17685,2],[17804,2],[17876,2],[17900,1],[17916,1],[17918,1],[17945,2],[18045,1],[18106,2],[18190,2],[18370,2],[18413,3],[18417,2],[18438,1],[18448,1],[18450,1],[18542,2],[18545,1],[18602,3],[18606,2],[18617,1],[18644,2],[18723,1],[18725,1],[18767,1],[18781,1],[18783,2],[18882,2],[18956,2],[19041,2],[19174,2],[19348,2],[19391,2],[19401,2],[19408,1],[19410,2],[19413,2],[19429,1],[19431,1],[19441,2],[19536,1],[19543,2],[19632,1],[19644,2],[19723,2],[19731,1],[19733,1],[19750,1],[19771,2],[19843,2],[19962,1],[20017,1],[20051,1],[20053,2],[20155,1],[20183,1],[20195,1],[20251,2],[20308,1],[20362,2],[20467,1],[20521,2],[20648,1],[20702,2],[20745,2],[20762,1],[20798,1],[20800,1],[20814,1],[20839,1],[20862,1],[20895,2],[20907,1],[20932,1],[20939,1],[20963,1],[20984,1],[21003,2],[21019,1],[21059,2],[21079,1],[21106,1],[21277,1],[21323,1],[21359,1],[21416,1],[21450,1],[21555,1],[21588,1],[21716,1],[21750,1],[21792,1],[21794,1],[21918,1],[21998,1],[22000,1],[22058,1],[22065,1],[22150,1],[22161,1],[22201,1],[22220,1],[22519,1],[22783,1],[22827,1],[22829,1],[22920,1],[23066,1],[23108,1],[23123,2],[23165,1],[23179,2],[23216,1],[23235,2],[23287,1],[23319,2]]},"769":{"position":[[300,1],[335,1],[345,1],[355,2],[358,1],[360,2],[375,1],[390,1],[400,1],[433,1],[435,1],[452,1],[454,1],[456,1],[458,1],[460,1],[462,1],[525,1],[568,1],[578,1],[588,2],[591,1],[593,2],[608,1],[623,1],[633,1],[666,1],[668,1],[685,1],[687,1],[689,1],[691,1],[693,1],[695,1],[1535,1],[1568,1],[1589,1],[1599,2],[1602,2],[1634,1],[1644,2],[1647,2],[1671,1],[1681,2],[1684,2],[1707,1],[1725,1],[1736,1],[1738,1],[1758,1],[1772,1],[1784,3],[1820,2],[1842,1],[1854,3],[1877,1],[1879,1],[1881,2],[1884,1],[1904,1],[1918,1],[1930,3],[1974,2],[1996,1],[2008,3],[2031,1],[2033,1],[2035,1],[2037,1],[2039,1],[2041,1],[2043,2],[2058,1],[2073,1],[2094,1],[2127,1],[2129,1],[2146,1],[2148,1],[2150,2],[2182,1],[2215,1],[2217,1],[2246,1],[2248,1],[2250,2],[2274,1],[2307,1],[2309,1],[2330,1],[2332,1],[2334,1],[2336,1],[2338,1],[2340,1],[3075,1],[3109,1],[3121,1],[3131,2],[3134,2],[3156,1],[3176,1],[3190,1],[3202,3],[3227,2],[3249,1],[3261,3],[3295,1],[3297,1],[3299,2],[3314,1],[3324,2],[3327,2],[3356,1],[3374,1],[3385,1],[3387,1],[3408,1],[3420,3],[3454,1],[3456,2],[3459,1],[3479,1],[3493,1],[3505,3],[3530,2],[3552,1],[3564,3],[3599,1],[3601,1],[3603,1],[3605,1],[3607,1],[3609,2],[3622,1],[3633,1],[3644,1],[3646,1],[3667,1],[3679,3],[3706,1],[3708,2],[3711,1],[3732,1],[3744,3],[3785,1],[3787,1],[3789,1],[3791,1],[3793,2],[3808,1],[3829,1],[3841,3],[3866,1],[3868,1],[3870,2],[3885,1],[3900,1],[3912,1],[3945,1],[3947,1],[3966,1],[3968,1],[3970,2],[3985,1],[4018,1],[4020,1],[4037,1],[4039,1],[4041,1],[4043,1],[4045,1],[4047,1],[4596,2],[4668,2],[4692,1],[4708,1],[4710,1],[4737,2],[4837,1],[4898,2],[4982,2],[5162,2],[5205,3],[5209,2],[5230,1],[5240,1],[5242,1],[5329,2],[5332,1],[5389,3],[5393,2],[5404,1],[5431,2],[5510,1],[5512,1],[5554,1],[5568,1],[5570,2],[5669,2],[5743,2],[5828,2],[5961,2],[6135,2],[6178,2],[6188,2],[6195,1],[6197,2],[6200,2],[6216,1],[6218,1],[6228,2],[6323,1],[6330,2],[6414,1],[6426,2],[6505,2],[6513,1],[6515,1],[6532,1],[6553,2],[6625,2],[6744,1],[6799,1],[6833,1],[6835,2],[6937,1],[6965,1],[6977,1],[7033,2],[7090,1],[7144,2],[7249,1],[7303,2],[7430,1],[7484,2],[7527,2],[7544,1],[7580,1],[7582,1],[7596,1],[7621,1],[7644,1],[7677,2],[7689,1],[7714,1],[7721,1],[7740,1],[7761,1],[7780,2],[7796,1],[7836,2],[7856,1],[7883,1],[8054,1],[8100,1],[8136,1],[8193,1],[8227,1],[8332,1],[8365,1],[8493,1],[8527,1],[8569,1],[8571,1],[8695,1],[8775,1],[8777,1],[8835,1],[8842,1],[8922,1],[8933,1],[8973,1],[8992,1],[9286,1],[9550,1],[9594,1],[9596,1],[9687,1],[9828,1],[9870,1],[9880,2],[9917,1],[9931,2],[9968,1],[9987,2],[10039,1],[10071,2],[10401,2],[10473,2],[10497,1],[10513,1],[10515,1],[10542,2],[10642,1],[10703,2],[10787,2],[10967,2],[11010,3],[11046,1],[11048,2],[11115,1],[11201,2],[11267,1],[11353,2],[11441,1],[11549,2],[11552,2],[11555,1],[11611,3],[11634,2],[11713,1],[11715,1],[11757,1],[11771,1],[11773,2],[11872,2],[11946,2],[12031,2],[12164,2],[12338,2],[12381,2],[12391,2],[12398,1],[12400,2],[12403,2],[12419,1],[12421,1],[12431,2],[12526,1],[12533,2],[12593,1],[12595,2],[12802,2],[12805,1],[12807,2],[13013,2],[13016,1],[13018,2],[13268,2],[13271,1],[13273,1],[13285,2],[13378,2],[13385,1],[13387,2],[13390,2],[13406,1],[13427,2],[13499,2],[13618,1],[13673,1],[13707,1],[13709,2],[13811,1],[13839,1],[13851,1],[13907,2],[13964,1],[14018,2],[14123,1],[14177,2],[14304,1],[14358,2],[14401,2],[14418,1],[14454,1],[14456,1],[14470,1],[14501,1],[14524,1],[14557,2],[14569,1],[14596,1],[14605,1],[14634,1],[14636,2],[14709,1],[14716,1],[14745,1],[14775,1],[14796,2],[14799,2],[14871,1],[14878,1],[14907,1],[14937,1],[14958,2],[14961,2],[15055,1],[15062,1],[15105,1],[15143,1],[15164,1],[15166,2],[15169,2],[15185,1],[15244,1],[15415,1],[15461,1],[15497,1],[15554,1],[15588,1],[15693,1],[15726,1],[15854,1],[15888,1],[15930,1],[15932,1],[16056,1],[16136,1],[16138,1],[16196,1],[16203,1],[16210,1],[16254,1],[16400,2],[16416,1],[16561,2],[16577,1],[16766,3],[16770,2],[16773,2],[16776,1],[16787,1],[17061,1],[17105,1],[17107,1],[17198,1],[17215,1],[17230,1],[17511,2],[18176,2],[18243,1],[18330,2],[18333,2],[18399,1],[18486,2],[18489,2],[18577,1],[18686,1],[18688,2],[18944,2],[19016,2],[19040,1],[19056,1],[19058,1],[19085,2],[19185,1],[19246,2],[19330,2],[19510,2],[19553,3],[19589,1],[19591,2],[19658,1],[19738,2],[19781,1],[19847,2],[19850,2],[19853,1],[19909,3],[19932,2],[20011,1],[20013,1],[20055,1],[20069,1],[20071,2],[20170,2],[20244,2],[20329,2],[20462,2],[20636,2],[20679,2],[20689,2],[20696,1],[20698,2],[20701,2],[20717,1],[20719,1],[20729,2],[20824,1],[20831,2],[20891,1],[20893,2],[21094,2],[21097,1],[21099,2],[21262,2],[21265,1],[21267,1],[21279,2],[21372,2],[21379,1],[21381,2],[21384,2],[21400,1],[21421,2],[21493,2],[21612,1],[21667,1],[21701,1],[21703,2],[21805,1],[21833,1],[21845,1],[21901,2],[21958,1],[22012,2],[22117,1],[22171,2],[22298,1],[22352,2],[22395,2],[22412,1],[22448,1],[22450,1],[22464,1],[22495,1],[22518,1],[22551,2],[22563,1],[22590,1],[22599,1],[22628,1],[22630,2],[22703,1],[22710,1],[22734,1],[22751,1],[22784,2],[22787,2],[22836,1],[22843,1],[22867,1],[22884,1],[22903,1],[22905,2],[22908,2],[22924,1],[22983,1],[23154,1],[23200,1],[23236,1],[23293,1],[23327,1],[23432,1],[23465,1],[23593,1],[23627,1],[23669,1],[23671,1],[23795,1],[23875,1],[23877,1],[23935,1],[23942,1],[23949,1],[23993,1],[24133,2],[24149,1],[24251,3],[24255,2],[24258,2],[24261,1],[24272,1],[24546,1],[24590,1],[24592,1],[24683,1],[24700,1],[24715,1],[24863,2],[25348,2],[25415,1],[25496,2],[25499,2],[25542,1],[25609,1],[25611,2],[25883,2],[25955,2],[25979,1],[25995,1],[25997,1],[26024,2],[26124,1],[26185,2],[26269,2],[26449,2],[26492,3],[26496,2],[26517,1],[26527,1],[26529,1],[26621,2],[26624,1],[26681,3],[26685,2],[26696,1],[26722,2],[26801,1],[26803,1],[26845,1],[26859,1],[26861,2],[26960,2],[27034,2],[27119,2],[27252,2],[27426,2],[27469,2],[27479,2],[27486,1],[27488,2],[27491,2],[27507,1],[27509,1],[27519,2],[27614,1],[27621,2],[27710,1],[27722,2],[27801,2],[27809,1],[27811,1],[27827,1],[27848,2],[27920,2],[28039,1],[28094,1],[28128,1],[28130,2],[28232,1],[28260,1],[28272,1],[28328,2],[28385,1],[28439,2],[28544,1],[28598,2],[28725,1],[28779,2],[28822,2],[28839,1],[28875,1],[28877,1],[28891,1],[28916,1],[28939,1],[28972,2],[28984,1],[29009,1],[29016,1],[29040,1],[29061,1],[29080,2],[29096,1],[29136,2],[29156,1],[29182,1],[29353,1],[29399,1],[29435,1],[29492,1],[29526,1],[29631,1],[29664,1],[29792,1],[29826,1],[29868,1],[29870,1],[29994,1],[30074,1],[30076,1],[30134,1],[30141,1],[30226,1],[30237,1],[30277,1],[30296,1],[30594,1],[30857,1],[30901,1],[30903,1],[30994,1],[31140,1],[31181,1],[31196,2],[31238,1],[31252,2],[31289,1],[31308,2],[31360,1],[31392,2]]},"771":{"position":[[1141,2],[1213,2],[1237,1],[1253,1],[1255,1],[1282,2],[1382,1],[1443,2],[1527,2],[1707,2],[1750,3],[1787,1],[1789,2],[1883,1],[1963,2],[2033,1],[2099,2],[2102,2],[2105,1],[2161,3],[2184,2],[2263,1],[2265,1],[2307,1],[2321,1],[2323,2],[2422,2],[2496,2],[2581,2],[2714,2],[2888,2],[2931,2],[2941,2],[2948,1],[2950,2],[2953,2],[2969,1],[2971,1],[2981,2],[3076,1],[3083,2],[3144,1],[3146,2],[3374,2],[3377,1],[3379,2],[3569,2],[3572,1],[3574,1],[3586,2],[3679,2],[3686,1],[3688,2],[3691,2],[3707,1],[3728,2],[3800,2],[3919,1],[3974,1],[4008,1],[4010,2],[4112,1],[4140,1],[4152,1],[4208,2],[4265,1],[4319,2],[4424,1],[4478,2],[4605,1],[4659,2],[4702,2],[4719,1],[4755,1],[4757,1],[4771,1],[4802,1],[4825,1],[4858,2],[4870,1],[4897,1],[4907,1],[4936,1],[4938,2],[5038,1],[5045,1],[5069,1],[5086,1],[5119,2],[5122,2],[5198,1],[5205,1],[5229,1],[5246,1],[5265,1],[5267,2],[5270,2],[5286,1],[5345,1],[5516,1],[5562,1],[5598,1],[5655,1],[5689,1],[5794,1],[5827,1],[5955,1],[5989,1],[6031,1],[6033,1],[6157,1],[6237,1],[6239,1],[6297,1],[6304,1],[6311,1],[6357,1],[6524,2],[6540,1],[6669,4],[6674,2],[6677,2],[6680,1],[6691,1],[6965,1],[7009,1],[7011,1],[7102,1],[7120,1],[7135,1],[7283,2],[7693,2],[7787,1],[7868,2],[7871,2],[7941,1],[8008,1],[8010,2],[8578,2],[8650,2],[8674,1],[8690,1],[8692,1],[8719,2],[8819,1],[8880,2],[8964,2],[9144,2],[9187,3],[9191,2],[9212,1],[9222,1],[9224,1],[9335,1],[9337,1],[9415,2],[9418,1],[9482,1],[9484,3],[9488,1],[9545,3],[9549,2],[9560,1],[9586,2],[9665,1],[9667,1],[9709,1],[9723,1],[9725,2],[9824,2],[9898,2],[9983,2],[10116,2],[10290,2],[10333,2],[10343,2],[10350,1],[10352,2],[10355,2],[10371,1],[10373,1],[10383,2],[10478,1],[10485,2],[10611,1],[10690,2],[10693,1],[10758,1],[10760,1],[10762,1],[10774,2],[10853,2],[10861,1],[10863,1],[10879,1],[10900,2],[10972,2],[11091,1],[11146,1],[11180,1],[11182,2],[11284,1],[11312,1],[11324,1],[11380,2],[11437,1],[11491,2],[11596,1],[11650,2],[11777,1],[11831,2],[11874,2],[11891,1],[11927,1],[11929,1],[11943,1],[11968,1],[11991,1],[12024,2],[12036,1],[12061,1],[12068,1],[12092,1],[12113,1],[12150,1],[12330,2],[12333,2],[12349,1],[12389,2],[12409,1],[12435,1],[12606,1],[12652,1],[12688,1],[12745,1],[12779,1],[12884,1],[12917,1],[13045,1],[13079,1],[13121,1],[13123,1],[13247,1],[13327,1],[13329,1],[13387,1],[13394,1],[13664,2],[13667,1],[13678,1],[13718,1],[13737,1],[14133,1],[14396,1],[14440,1],[14442,1],[14533,1],[14860,1],[14901,1],[14916,2],[14958,1],[14972,2],[15009,1],[15028,2],[15081,1],[15083,1],[15085,2],[15125,1],[15149,1],[15166,1],[15207,1],[15231,1],[15248,1],[15268,2],[15288,1],[15320,2],[15504,2],[15576,2],[15600,1],[15616,1],[15618,1],[15645,2],[15745,1],[15806,2],[15890,2],[16070,2],[16113,3],[16117,2],[16138,1],[16148,1],[16150,1],[16261,1],[16263,1],[16341,2],[16344,1],[16408,1],[16410,3],[16414,1],[16471,3],[16475,2],[16486,1],[16513,2],[16592,1],[16594,1],[16636,1],[16650,1],[16652,2],[16751,2],[16825,2],[16910,2],[17043,2],[17217,2],[17260,2],[17270,2],[17277,1],[17279,2],[17282,2],[17298,1],[17300,1],[17310,2],[17405,1],[17412,2],[17538,1],[17617,2],[17620,1],[17685,1],[17687,1],[17689,1],[17701,2],[17780,2],[17788,1],[17790,1],[17807,1],[17828,2],[17900,2],[18019,1],[18074,1],[18108,1],[18110,2],[18212,1],[18240,1],[18252,1],[18308,2],[18365,1],[18419,2],[18524,1],[18578,2],[18705,1],[18759,2],[18802,2],[18819,1],[18855,1],[18857,1],[18871,1],[18896,1],[18919,1],[18952,2],[18964,1],[18989,1],[18996,1],[19020,1],[19041,1],[19078,1],[19258,2],[19261,2],[19277,1],[19317,2],[19337,1],[19364,1],[19535,1],[19581,1],[19617,1],[19674,1],[19708,1],[19813,1],[19846,1],[19974,1],[20008,1],[20050,1],[20052,1],[20176,1],[20256,1],[20258,1],[20316,1],[20323,1],[20593,2],[20596,1],[20607,1],[20647,1],[20666,1],[21063,1],[21327,1],[21371,1],[21373,1],[21464,1],[21791,1],[21833,1],[21848,2],[21890,1],[21904,2],[21941,1],[21960,2],[22013,1],[22015,1],[22017,2],[22057,1],[22081,1],[22098,1],[22139,1],[22163,1],[22180,1],[22200,2],[22220,1],[22252,2]]},"773":{"position":[[800,1],[847,1],[849,1],[866,2],[869,1],[902,1],[923,1],[933,2],[936,2],[968,1],[978,2],[981,2],[1005,1],[1015,2],[1018,2],[1041,1],[1059,1],[1070,1],[1072,1],[1092,1],[1106,1],[1118,3],[1154,2],[1176,1],[1188,3],[1211,1],[1213,1],[1215,2],[1218,1],[1238,1],[1252,1],[1264,3],[1308,2],[1330,1],[1342,3],[1365,1],[1367,1],[1369,1],[1371,1],[1373,1],[1375,1],[1377,2],[1392,1],[1407,1],[1428,1],[1461,1],[1463,1],[1480,1],[1482,1],[1484,2],[1516,1],[1549,1],[1551,1],[1580,1],[1582,1],[1584,2],[1608,1],[1641,1],[1643,1],[1664,1],[1666,1],[1668,1],[1670,1],[1672,1],[1674,2],[1677,1],[1711,1],[1723,1],[1733,2],[1736,2],[1758,1],[1778,1],[1792,1],[1804,3],[1829,2],[1851,1],[1863,3],[1897,1],[1899,1],[1901,2],[1916,1],[1926,2],[1929,2],[1958,1],[1976,1],[1987,1],[1989,1],[2010,1],[2022,3],[2056,1],[2058,2],[2061,1],[2081,1],[2095,1],[2107,3],[2132,2],[2154,1],[2166,3],[2201,1],[2203,1],[2205,1],[2207,1],[2209,1],[2211,2],[2224,1],[2235,1],[2246,1],[2248,1],[2269,1],[2281,3],[2308,1],[2310,2],[2313,1],[2334,1],[2346,3],[2387,1],[2389,1],[2391,1],[2393,1],[2395,2],[2410,1],[2431,1],[2443,3],[2468,1],[2470,1],[2472,2],[2487,1],[2502,1],[2514,1],[2547,1],[2549,1],[2568,1],[2570,1],[2572,2],[2587,1],[2620,1],[2622,1],[2639,1],[2641,1],[2643,1],[2645,1],[2647,1],[2649,2],[2652,1],[2690,1],[2703,1],[2713,2],[2716,2],[2731,1],[2751,1],[2765,1],[2777,3],[2803,2],[2825,1],[2837,3],[2862,1],[2864,1],[2866,1],[2868,2],[2883,1],[2898,1],[2911,1],[2944,1],[2946,1],[2966,1],[2968,1],[2970,1],[2972,1],[2974,1],[2976,2],[2979,1],[3014,1],[3024,1],[3034,2],[3037,1],[3039,2],[3054,1],[3069,1],[3079,1],[3112,1],[3114,1],[3131,1],[3133,1],[3135,1],[3137,1],[3139,1],[3141,2],[3144,1],[3187,1],[3197,1],[3207,2],[3210,1],[3212,2],[3227,1],[3242,1],[3252,1],[3285,1],[3287,1],[3304,1],[3306,1],[3308,1],[3310,1],[3312,1],[3314,1],[3316,1],[3318,1],[3382,2],[3454,2],[3478,1],[3494,1],[3496,1],[3523,2],[3623,1],[3684,2],[3768,2],[3948,2],[3991,3],[4027,1],[4029,2],[4084,1],[4163,2],[4223,1],[4303,2],[4398,1],[4479,2],[4543,1],[4622,2],[4687,1],[4771,2],[4837,1],[4922,2],[4989,1],[5075,2],[5142,1],[5228,2],[5294,1],[5380,2],[5445,1],[5531,2],[5596,1],[5682,2],[5770,1],[5878,2],[5881,2],[5884,1],[5940,3],[5963,2],[6042,1],[6044,1],[6086,1],[6100,1],[6102,2],[6201,2],[6275,2],[6360,2],[6493,2],[6667,2],[6710,2],[6720,2],[6727,1],[6729,2],[6732,2],[6748,1],[6750,1],[6760,2],[6855,1],[6862,2],[6922,1],[6924,2],[7112,2],[7115,1],[7117,2],[7311,2],[7314,1],[7316,2],[7546,2],[7549,1],[7551,2],[7748,2],[7751,1],[7753,2],[7956,2],[7959,1],[7961,2],[8166,2],[8169,1],[8171,2],[8378,2],[8381,1],[8383,2],[8590,2],[8593,1],[8595,2],[8801,2],[8804,1],[8806,2],[9011,2],[9014,1],[9016,2],[9221,2],[9224,1],[9226,2],[9476,2],[9479,1],[9481,1],[9493,2],[9586,2],[9593,1],[9595,2],[9598,2],[9614,1],[9635,2],[9707,2],[9826,1],[9881,1],[9915,1],[9917,2],[10019,1],[10047,1],[10059,1],[10115,2],[10172,1],[10226,2],[10331,1],[10385,2],[10512,1],[10566,2],[10609,2],[10626,1],[10662,1],[10664,1],[10678,1],[10709,1],[10732,1],[10765,2],[10777,1],[10804,1],[10813,1],[10842,1],[10844,2],[10905,1],[10912,1],[10936,1],[10964,1],[10985,2],[10988,2],[11054,1],[11061,1],[11089,1],[11110,1],[11135,2],[11138,2],[11239,1],[11246,1],[11277,1],[11296,1],[11321,2],[11324,2],[11394,1],[11401,1],[11436,1],[11456,1],[11474,2],[11477,2],[11548,1],[11555,1],[11582,1],[11612,1],[11633,2],[11636,2],[11708,1],[11715,1],[11743,1],[11773,1],[11794,2],[11797,2],[11870,1],[11877,1],[11906,1],[11936,1],[11957,2],[11960,2],[12033,1],[12040,1],[12069,1],[12099,1],[12120,2],[12123,2],[12195,1],[12202,1],[12231,1],[12261,1],[12282,2],[12285,2],[12356,1],[12363,1],[12392,1],[12422,1],[12443,2],[12446,2],[12517,1],[12524,1],[12553,1],[12583,1],[12604,2],[12607,2],[12701,1],[12708,1],[12751,1],[12789,1],[12810,1],[12812,2],[12815,2],[12831,1],[12890,1],[13061,1],[13107,1],[13143,1],[13200,1],[13234,1],[13339,1],[13372,1],[13500,1],[13534,1],[13576,1],[13578,1],[13702,1],[13782,1],[13784,1],[13842,1],[13849,1],[13856,1],[13900,1],[14027,2],[14043,1],[14176,2],[14192,1],[14361,2],[14377,1],[14513,2],[14529,1],[14671,2],[14687,1],[14831,2],[14847,1],[14993,2],[15009,1],[15155,2],[15171,1],[15316,2],[15332,1],[15476,2],[15492,1],[15636,2],[15652,1],[15841,3],[15845,2],[15848,2],[15851,1],[15862,1],[16136,1],[16180,1],[16182,1],[16273,1],[16290,1],[16305,1],[17323,2],[19148,2],[19203,1],[19283,2],[19286,2],[19346,1],[19427,2],[19430,2],[19525,1],[19607,2],[19610,2],[19674,1],[19754,2],[19757,2],[19822,1],[19907,2],[19910,2],[19976,1],[20062,2],[20065,2],[20132,1],[20219,2],[20222,2],[20289,1],[20376,2],[20379,2],[20445,1],[20532,2],[20535,2],[20600,1],[20687,2],[20690,2],[20755,1],[20842,2],[20845,2],[20933,1],[21042,1],[21044,2]]},"775":{"position":[[1013,1],[1060,1],[1062,1],[1079,2],[1082,1],[1113,1],[1124,1],[1134,2],[1137,1],[1139,2],[1154,1],[1169,1],[1180,1],[1213,1],[1215,1],[1232,1],[1234,1],[1236,1],[1238,1],[1240,1],[1242,2],[1245,1],[1278,1],[1288,1],[1298,2],[1301,2],[1323,1],[1333,2],[1336,2],[1368,1],[1378,2],[1381,2],[1405,1],[1415,2],[1418,2],[1441,1],[1459,1],[1470,1],[1472,1],[1492,1],[1506,1],[1518,3],[1554,2],[1576,1],[1588,3],[1611,1],[1613,1],[1615,2],[1618,1],[1638,1],[1652,1],[1664,3],[1708,2],[1730,1],[1742,3],[1765,1],[1767,1],[1769,1],[1771,1],[1773,1],[1775,1],[1777,2],[1792,1],[1807,1],[1817,1],[1850,1],[1852,1],[1869,1],[1871,1],[1873,2],[1895,1],[1928,1],[1930,1],[1947,1],[1949,1],[1951,2],[1983,1],[2016,1],[2018,1],[2047,1],[2049,1],[2051,2],[2075,1],[2108,1],[2110,1],[2131,1],[2133,1],[2135,1],[2137,1],[2139,1],[2141,2],[2144,1],[2178,1],[2190,1],[2200,2],[2203,2],[2225,1],[2245,1],[2259,1],[2271,3],[2296,2],[2318,1],[2330,3],[2364,1],[2366,1],[2368,2],[2383,1],[2393,2],[2396,2],[2425,1],[2443,1],[2454,1],[2456,1],[2477,1],[2489,3],[2523,1],[2525,2],[2528,1],[2548,1],[2562,1],[2574,3],[2599,2],[2621,1],[2633,3],[2668,1],[2670,1],[2672,1],[2674,1],[2676,1],[2678,2],[2691,1],[2702,1],[2713,1],[2715,1],[2736,1],[2748,3],[2775,1],[2777,2],[2780,1],[2801,1],[2813,3],[2854,1],[2856,1],[2858,1],[2860,1],[2862,2],[2877,1],[2898,1],[2910,3],[2935,1],[2937,1],[2939,2],[2954,1],[2969,1],[2981,1],[3014,1],[3016,1],[3035,1],[3037,1],[3039,2],[3054,1],[3087,1],[3089,1],[3106,1],[3108,1],[3110,1],[3112,1],[3114,1],[3116,2],[3119,1],[3157,1],[3170,1],[3180,2],[3183,2],[3198,1],[3218,1],[3232,1],[3244,3],[3270,2],[3292,1],[3304,3],[3329,1],[3331,1],[3333,1],[3335,2],[3350,1],[3365,1],[3378,1],[3411,1],[3413,1],[3433,1],[3435,1],[3437,1],[3439,1],[3441,1],[3443,2],[3446,1],[3481,1],[3491,1],[3501,2],[3504,1],[3506,2],[3521,1],[3536,1],[3546,1],[3579,1],[3581,1],[3598,1],[3600,1],[3602,1],[3604,1],[3606,1],[3608,2],[3611,1],[3654,1],[3664,1],[3674,2],[3677,1],[3679,2],[3694,1],[3709,1],[3719,1],[3752,1],[3754,1],[3771,1],[3773,1],[3775,1],[3777,1],[3779,1],[3781,1],[3783,1],[3785,1]]},"781":{"position":[[410,1],[579,1],[878,1],[1158,1],[1278,1]]},"793":{"position":[[800,1],[847,1],[849,1],[866,2],[869,1],[902,1],[925,1],[935,2],[938,2],[966,1],[976,2],[979,2],[1000,1],[1010,2],[1013,1],[1015,2],[1030,1],[1045,1],[1068,1],[1101,1],[1103,1],[1120,1],[1122,1],[1124,2],[1152,1],[1185,1],[1187,1],[1204,1],[1206,1],[1208,2],[1229,1],[1262,1],[1264,1],[1281,1],[1283,1],[1285,1],[1287,1],[1289,1],[1291,1],[1293,1],[1295,1]]},"795":{"position":[[563,2],[635,2],[659,1],[675,1],[677,1],[704,2],[804,1],[865,2],[949,2],[1129,2],[1172,3],[1208,1],[1210,1],[1283,2],[1286,2],[1289,1],[1345,3],[1368,2],[1447,1],[1449,1],[1491,1],[1505,1],[1507,2],[1606,2],[1680,2],[1765,2],[1898,2],[2072,2],[2115,2],[2125,2],[2132,1],[2134,2],[2137,2],[2153,1],[2155,1],[2165,2],[2260,1],[2267,2],[2327,1],[2456,2],[2459,1],[2461,1],[2473,2],[2566,2],[2573,1],[2575,2],[2578,2],[2594,1],[2615,2],[2687,2],[2806,1],[2861,1],[2895,1],[2897,2],[2999,1],[3027,1],[3039,1],[3095,2],[3152,1],[3206,2],[3311,1],[3365,2],[3492,1],[3546,2],[3589,2],[3606,1],[3642,1],[3644,1],[3658,1],[3689,1],[3712,1],[3745,2],[3757,1],[3784,1],[3793,1],[3822,1],[3830,1],[3837,1],[3861,1],[3891,1],[3904,1],[3906,2],[3909,2],[3925,1],[3984,1],[4155,1],[4201,1],[4237,1],[4294,1],[4328,1],[4433,1],[4466,1],[4594,1],[4628,1],[4670,1],[4672,1],[4796,1],[4876,1],[4878,1],[4936,1],[4943,1],[4950,1],[5061,3],[5065,2],[5068,2],[5071,1],[5082,1],[5356,1],[5400,1],[5402,1],[5493,1],[5510,1],[5525,1],[5601,2],[5967,1],[6041,1],[6043,2],[6211,2],[6283,2],[6307,1],[6323,1],[6325,1],[6352,2],[6452,1],[6513,2],[6597,2],[6777,2],[6820,3],[6856,1],[6858,1],[6935,2],[6938,2],[6941,1],[6997,3],[7020,2],[7099,1],[7101,1],[7143,1],[7157,1],[7159,2],[7258,2],[7332,2],[7417,2],[7550,2],[7724,2],[7767,2],[7777,2],[7784,1],[7786,2],[7789,2],[7805,1],[7807,1],[7817,2],[7912,1],[7919,2],[7979,1],[8112,2],[8115,1],[8117,1],[8129,2],[8222,2],[8229,1],[8231,2],[8234,2],[8250,1],[8271,2],[8343,2],[8462,1],[8517,1],[8551,1],[8553,2],[8655,1],[8683,1],[8695,1],[8751,2],[8808,1],[8862,2],[8967,1],[9021,2],[9148,1],[9202,2],[9245,2],[9262,1],[9298,1],[9300,1],[9314,1],[9345,1],[9368,1],[9401,2],[9413,1],[9440,1],[9449,1],[9478,1],[9486,1],[9493,1],[9517,1],[9551,1],[9564,1],[9566,2],[9569,2],[9585,1],[9644,1],[9815,1],[9861,1],[9897,1],[9954,1],[9988,1],[10093,1],[10126,1],[10254,1],[10288,1],[10330,1],[10332,1],[10456,1],[10536,1],[10538,1],[10596,1],[10603,1],[10610,1],[10725,3],[10729,2],[10732,2],[10735,1],[10746,1],[11020,1],[11064,1],[11066,1],[11157,1],[11174,1],[11189,1],[11269,2],[11639,1],[11717,1],[11719,2],[11895,2],[11967,2],[11991,1],[12007,1],[12009,1],[12036,2],[12136,1],[12197,2],[12281,2],[12461,2],[12504,3],[12540,1],[12542,1],[12615,1],[12692,1],[12762,2],[12765,2],[12768,1],[12824,3],[12847,2],[12926,1],[12928,1],[12970,1],[12984,1],[12986,2],[13085,2],[13159,2],[13244,2],[13377,2],[13551,2],[13594,2],[13604,2],[13611,1],[13613,2],[13616,2],[13632,1],[13634,1],[13644,2],[13739,1],[13746,2],[13806,1],[13935,2],[13938,1],[14071,2],[14074,1],[14200,2],[14203,1],[14205,1],[14217,2],[14310,2],[14317,1],[14319,2],[14322,2],[14338,1],[14359,2],[14431,2],[14550,1],[14605,1],[14639,1],[14641,2],[14743,1],[14771,1],[14783,1],[14839,2],[14896,1],[14950,2],[15055,1],[15109,2],[15236,1],[15290,2],[15333,2],[15350,1],[15386,1],[15388,1],[15402,1],[15433,1],[15456,1],[15489,2],[15501,1],[15528,1],[15537,1],[15566,1],[15574,1],[15581,1],[15605,1],[15635,1],[15648,2],[15657,1],[15664,1],[15688,1],[15722,1],[15735,2],[15744,1],[15751,1],[15775,1],[15802,1],[15815,1],[15817,2],[15820,2],[15836,1],[15895,1],[16066,1],[16112,1],[16148,1],[16205,1],[16239,1],[16344,1],[16377,1],[16505,1],[16539,1],[16581,1],[16583,1],[16707,1],[16787,1],[16789,1],[16847,1],[16854,1],[16861,1],[16972,2],[17059,2],[17139,3],[17143,2],[17146,2],[17149,1],[17160,1],[17434,1],[17478,1],[17480,1],[17571,1],[17588,1],[17603,1],[17824,2],[18429,1],[18503,2],[18506,1],[18584,2],[18587,1],[18658,1],[18660,2],[19129,2],[19201,2],[19225,1],[19241,1],[19243,1],[19270,2],[19370,1],[19431,2],[19515,2],[19695,2],[19738,3],[19742,2],[19763,1],[19773,1],[19775,1],[19871,2],[19874,1],[19931,3],[19935,2],[19946,1],[19972,2],[20051,1],[20053,1],[20095,1],[20109,1],[20111,2],[20210,2],[20284,2],[20369,2],[20502,2],[20676,2],[20719,2],[20729,2],[20736,1],[20738,2],[20741,2],[20757,1],[20759,1],[20769,2],[20864,1],[20871,2],[20964,1],[20976,2],[21055,2],[21063,1],[21065,1],[21081,1],[21102,2],[21174,2],[21293,1],[21348,1],[21382,1],[21384,2],[21486,1],[21514,1],[21526,1],[21582,2],[21639,1],[21693,2],[21798,1],[21852,2],[21979,1],[22033,2],[22076,2],[22093,1],[22129,1],[22131,1],[22145,1],[22170,1],[22193,1],[22226,2],[22238,1],[22263,1],[22270,1],[22294,1],[22324,1],[22338,2],[22354,1],[22394,2],[22414,1],[22440,1],[22611,1],[22657,1],[22693,1],[22750,1],[22784,1],[22889,1],[22922,1],[23050,1],[23084,1],[23126,1],[23128,1],[23252,1],[23332,1],[23334,1],[23392,1],[23399,1],[23488,1],[23499,1],[23539,1],[23558,1],[23860,1],[24123,1],[24167,1],[24169,1],[24260,1],[24410,1],[24451,1],[24466,2],[24508,1],[24531,2],[24577,1],[24591,2],[24638,1],[24670,2],[24828,2],[24900,2],[24924,1],[24940,1],[24942,1],[24969,2],[25069,1],[25130,2],[25214,2],[25394,2],[25437,3],[25441,2],[25462,1],[25472,1],[25474,1],[25567,2],[25570,1],[25627,3],[25631,2],[25642,1],[25669,2],[25748,1],[25750,1],[25792,1],[25806,1],[25808,2],[25907,2],[25981,2],[26066,2],[26199,2],[26373,2],[26416,2],[26426,2],[26433,1],[26435,2],[26438,2],[26454,1],[26456,1],[26466,2],[26561,1],[26568,2],[26658,1],[26670,2],[26749,2],[26757,1],[26759,1],[26776,1],[26797,2],[26869,2],[26988,1],[27043,1],[27077,1],[27079,2],[27181,1],[27209,1],[27221,1],[27277,2],[27334,1],[27388,2],[27493,1],[27547,2],[27674,1],[27728,2],[27771,2],[27788,1],[27824,1],[27826,1],[27840,1],[27865,1],[27888,1],[27921,2],[27933,1],[27958,1],[27965,1],[27989,1],[28016,1],[28030,2],[28046,1],[28086,2],[28106,1],[28133,1],[28304,1],[28350,1],[28386,1],[28443,1],[28477,1],[28582,1],[28615,1],[28743,1],[28777,1],[28819,1],[28821,1],[28945,1],[29025,1],[29027,1],[29085,1],[29092,1],[29178,1],[29189,1],[29229,1],[29248,1],[29548,1],[29812,1],[29856,1],[29858,1],[29949,1],[30096,1],[30138,1],[30153,2],[30195,1],[30215,2],[30258,1],[30272,2],[30319,1],[30351,2]]},"797":{"position":[[1423,1],[1470,1],[1472,1],[1505,1],[1519,1],[1529,2],[1532,2],[1553,1],[1563,2],[1566,2],[1590,1],[1601,1],[1612,1],[1614,1],[1624,2],[1627,2],[1630,1],[1651,1],[1676,1],[1678,2],[1681,1],[1702,1],[1733,1],[1735,1],[1737,1],[1739,1],[1741,2],[1769,1],[1780,1],[1791,1],[1793,1],[1803,2],[1806,2],[1809,1],[1830,1],[1855,1],[1857,2],[1860,1],[1881,1],[1912,1],[1914,1],[1916,1],[1918,1],[1920,2],[1941,1],[1952,1],[1963,1],[1965,1],[1975,2],[1978,2],[1981,1],[2002,1],[2027,1],[2029,1],[2031,1],[2033,1],[2035,1],[2037,2],[2052,1],[2067,1],[2081,1],[2114,1],[2116,1],[2133,1],[2135,1],[2137,2],[2158,1],[2191,1],[2193,1],[2210,1],[2212,1],[2214,2],[2238,1],[2271,1],[2273,1],[2290,1],[2292,1],[2294,2],[2322,1],[2355,1],[2357,1],[2374,1],[2376,1],[2378,2],[2399,1],[2432,1],[2434,1],[2451,1],[2453,1],[2455,1],[2457,1],[2459,1],[2461,1],[2463,1],[2465,1],[2981,2],[3053,2],[3077,1],[3093,1],[3095,1],[3122,2],[3222,1],[3283,2],[3367,2],[3547,2],[3590,3],[3626,1],[3628,1],[3698,1],[3762,1],[3835,1],[3901,2],[3904,2],[3907,1],[3963,3],[3986,2],[4065,1],[4067,1],[4109,1],[4123,1],[4125,2],[4224,2],[4298,2],[4383,2],[4516,2],[4690,2],[4733,2],[4743,2],[4750,1],[4752,2],[4755,2],[4771,1],[4773,1],[4783,2],[4878,1],[4885,2],[4945,1],[5071,2],[5074,1],[5194,2],[5197,1],[5326,2],[5329,1],[5451,2],[5454,1],[5456,1],[5468,2],[5561,2],[5568,1],[5570,2],[5573,2],[5589,1],[5610,2],[5682,2],[5801,1],[5856,1],[5890,1],[5892,2],[5994,1],[6022,1],[6034,1],[6090,2],[6147,1],[6201,2],[6306,1],[6360,2],[6487,1],[6541,2],[6584,2],[6601,1],[6637,1],[6639,1],[6653,1],[6684,1],[6707,1],[6740,2],[6752,1],[6779,1],[6788,1],[6817,1],[6825,1],[6832,1],[6856,1],[6883,1],[6896,2],[6905,1],[6912,1],[6936,1],[6957,1],[6970,2],[6979,1],[6986,1],[7013,1],[7040,1],[7053,2],[7062,1],[7069,1],[7095,1],[7116,1],[7129,1],[7131,2],[7134,2],[7150,1],[7209,1],[7380,1],[7426,1],[7462,1],[7519,1],[7553,1],[7658,1],[7691,1],[7819,1],[7853,1],[7895,1],[7897,1],[8021,1],[8101,1],[8103,1],[8161,1],[8168,1],[8175,1],[8283,2],[8357,2],[8440,2],[8516,3],[8520,2],[8523,2],[8526,1],[8537,1],[8811,1],[8855,1],[8857,1],[8948,1],[8965,1],[8980,1],[9253,2],[9957,1],[10028,2],[10031,1],[10096,2],[10099,1],[10173,2],[10176,1],[10243,1],[10245,2],[10457,2],[10529,2],[10553,1],[10569,1],[10571,1],[10598,2],[10698,1],[10759,2],[10843,2],[11023,2],[11066,3],[11070,2],[11091,1],[11101,1],[11103,1],[11202,2],[11205,1],[11262,3],[11266,2],[11277,1],[11303,2],[11382,1],[11384,1],[11426,1],[11440,1],[11442,2],[11541,2],[11615,2],[11700,2],[11833,2],[12007,2],[12050,2],[12060,2],[12067,1],[12069,2],[12072,2],[12088,1],[12090,1],[12100,2],[12195,1],[12202,2],[12298,1],[12310,2],[12389,2],[12397,1],[12399,1],[12415,1],[12436,2],[12508,2],[12627,1],[12682,1],[12716,1],[12718,2],[12820,1],[12848,1],[12860,1],[12916,2],[12973,1],[13027,2],[13132,1],[13186,2],[13313,1],[13367,2],[13410,2],[13427,1],[13463,1],[13465,1],[13479,1],[13504,1],[13527,1],[13560,2],[13572,1],[13597,1],[13604,1],[13631,1],[13661,1],[13675,2],[13691,1],[13731,2],[13751,1],[13777,1],[13948,1],[13994,1],[14030,1],[14087,1],[14121,1],[14226,1],[14259,1],[14387,1],[14421,1],[14463,1],[14465,1],[14589,1],[14669,1],[14671,1],[14729,1],[14736,1],[14828,1],[14839,1],[14879,1],[14898,1],[15203,1],[15466,1],[15510,1],[15512,1],[15603,1],[15756,1],[15797,1],[15815,2],[15860,1],[15883,2],[15929,1],[15943,2],[15990,1],[16022,2]]},"799":{"position":[[431,1],[470,1],[484,1],[494,2],[497,2],[518,1],[528,2],[531,1],[533,2],[548,1],[563,1],[577,1],[610,1],[612,1],[629,1],[631,1],[633,2],[654,1],[687,1],[689,1],[706,1],[708,1],[710,1],[712,1],[714,1],[716,1],[1192,1],[1239,1],[1241,1],[1258,2],[1261,1],[1294,1],[1308,1],[1318,2],[1321,2],[1342,1],[1352,2],[1355,2],[1379,1],[1390,1],[1401,1],[1403,1],[1413,2],[1416,2],[1419,1],[1440,1],[1465,1],[1467,2],[1470,1],[1491,1],[1522,1],[1524,1],[1526,1],[1528,1],[1530,2],[1558,1],[1569,1],[1580,1],[1582,1],[1592,2],[1595,2],[1598,1],[1619,1],[1644,1],[1646,2],[1649,1],[1670,1],[1701,1],[1703,1],[1705,1],[1707,1],[1709,2],[1730,1],[1741,1],[1752,1],[1754,1],[1764,2],[1767,2],[1770,1],[1791,1],[1816,1],[1818,1],[1820,1],[1822,1],[1824,1],[1826,2],[1841,1],[1856,1],[1870,1],[1903,1],[1905,1],[1922,2],[1925,1],[1974,1],[1976,1],[1978,2],[1999,1],[2032,1],[2034,1],[2051,2],[2054,1],[2109,1],[2111,1],[2113,2],[2137,1],[2170,1],[2172,1],[2189,1],[2191,1],[2193,2],[2221,1],[2254,1],[2256,1],[2273,1],[2275,1],[2277,2],[2298,1],[2331,1],[2333,1],[2350,1],[2352,1],[2354,1],[2356,1],[2358,1],[2360,2],[2363,1],[2402,1],[2416,1],[2426,2],[2429,2],[2450,1],[2460,2],[2463,1],[2465,2],[2480,1],[2495,1],[2509,1],[2542,1],[2544,1],[2561,1],[2563,1],[2565,2],[2586,1],[2619,1],[2621,1],[2638,1],[2640,1],[2642,1],[2644,1],[2646,1],[2648,1],[2650,1],[2652,1],[2886,2],[2958,2],[2982,1],[2998,1],[3000,1],[3027,2],[3127,1],[3188,2],[3272,2],[3452,2],[3495,3],[3531,1],[3533,1],[3617,1],[3694,2],[3697,2],[3700,1],[3756,3],[3779,2],[3858,1],[3860,1],[3902,1],[3916,1],[3918,2],[4017,2],[4091,2],[4176,2],[4309,2],[4483,2],[4526,2],[4536,2],[4543,1],[4545,2],[4548,2],[4564,1],[4566,1],[4576,2],[4671,1],[4678,2],[4738,1],[4878,2],[4881,1],[5014,2],[5017,1],[5019,1],[5031,2],[5124,2],[5131,1],[5133,2],[5136,2],[5152,1],[5173,2],[5245,2],[5364,1],[5419,1],[5453,1],[5455,2],[5557,1],[5585,1],[5597,1],[5653,2],[5710,1],[5764,2],[5869,1],[5923,2],[6050,1],[6104,2],[6147,2],[6164,1],[6200,1],[6202,1],[6216,1],[6247,1],[6270,1],[6303,2],[6315,1],[6342,1],[6351,1],[6380,1],[6388,1],[6395,1],[6422,1],[6449,1],[6473,2],[6482,1],[6489,1],[6515,1],[6536,1],[6560,1],[6562,2],[6565,2],[6581,1],[6640,1],[6811,1],[6857,1],[6893,1],[6950,1],[6984,1],[7089,1],[7122,1],[7250,1],[7284,1],[7326,1],[7328,1],[7452,1],[7532,1],[7534,1],[7592,1],[7599,1],[7606,1],[7728,2],[7815,3],[7819,2],[7822,2],[7825,1],[7836,1],[8110,1],[8154,1],[8156,1],[8247,1],[8264,1],[8279,1],[8442,2],[8942,1],[9027,2],[9030,1],[9108,1],[9110,2],[9411,2],[9483,2],[9507,1],[9523,1],[9525,1],[9552,2],[9652,1],[9713,2],[9797,2],[9977,2],[10020,3],[10056,1],[10058,1],[10153,1],[10248,1],[10331,1],[10414,2],[10417,2],[10420,1],[10476,3],[10499,2],[10578,1],[10580,1],[10622,1],[10636,1],[10638,2],[10737,2],[10811,2],[10896,2],[11029,2],[11203,2],[11246,2],[11256,2],[11263,1],[11265,2],[11268,2],[11284,1],[11286,1],[11296,2],[11391,1],[11398,2],[11458,1],[11609,2],[11612,1],[11763,2],[11766,1],[11905,2],[11908,1],[12047,2],[12050,1],[12052,1],[12064,2],[12157,2],[12164,1],[12166,2],[12169,2],[12185,1],[12206,2],[12278,2],[12397,1],[12452,1],[12486,1],[12488,2],[12590,1],[12618,1],[12630,1],[12686,2],[12743,1],[12797,2],[12902,1],[12956,2],[13083,1],[13137,2],[13180,2],[13197,1],[13233,1],[13235,1],[13249,1],[13280,1],[13303,1],[13336,2],[13348,1],[13375,1],[13384,1],[13413,1],[13421,1],[13428,1],[13477,1],[13504,1],[13517,2],[13526,1],[13533,1],[13582,1],[13609,1],[13622,2],[13631,1],[13638,1],[13681,1],[13702,1],[13715,2],[13724,1],[13731,1],[13774,1],[13795,1],[13808,1],[13810,2],[13813,2],[13829,1],[13888,1],[14059,1],[14105,1],[14141,1],[14198,1],[14232,1],[14337,1],[14370,1],[14498,1],[14532,1],[14574,1],[14576,1],[14700,1],[14780,1],[14782,1],[14840,1],[14847,1],[14854,1],[14987,2],[15092,2],[15185,2],[15278,3],[15282,2],[15285,2],[15288,1],[15299,1],[15573,1],[15617,1],[15619,1],[15710,1],[15727,1],[15742,1],[16098,2],[16885,1],[16981,2],[16984,1],[17080,2],[17083,1],[17167,2],[17170,1],[17254,1],[17256,2],[17641,2],[17713,2],[17737,1],[17753,1],[17755,1],[17782,2],[17882,1],[17943,2],[18027,2],[18207,2],[18250,3],[18254,2],[18275,1],[18285,1],[18287,1],[18380,2],[18383,1],[18440,3],[18444,2],[18455,1],[18481,2],[18560,1],[18562,1],[18604,1],[18618,1],[18620,2],[18719,2],[18793,2],[18878,2],[19011,2],[19185,2],[19228,2],[19238,2],[19245,1],[19247,2],[19250,2],[19266,1],[19268,1],[19278,2],[19373,1],[19380,2],[19470,1],[19482,2],[19561,2],[19569,1],[19571,1],[19587,1],[19608,2],[19680,2],[19799,1],[19854,1],[19888,1],[19890,2],[19992,1],[20020,1],[20032,1],[20088,2],[20145,1],[20199,2],[20304,1],[20358,2],[20485,1],[20539,2],[20582,2],[20599,1],[20635,1],[20637,1],[20651,1],[20676,1],[20699,1],[20732,2],[20744,1],[20769,1],[20776,1],[20797,1],[20827,1],[20841,2],[20857,1],[20897,2],[20917,1],[20943,1],[21114,1],[21160,1],[21196,1],[21253,1],[21287,1],[21392,1],[21425,1],[21553,1],[21587,1],[21629,1],[21631,1],[21755,1],[21835,1],[21837,1],[21895,1],[21902,1],[21988,1],[21999,1],[22039,1],[22058,1],[22357,1],[22620,1],[22664,1],[22666,1],[22757,1],[22904,1],[22945,1],[22957,2],[22996,1],[23019,2],[23065,1],[23079,2],[23126,1],[23158,2]]},"801":{"position":[[1018,1],[1065,1],[1067,1],[1084,2],[1087,1],[1120,1],[1134,1],[1144,2],[1147,2],[1168,1],[1178,2],[1181,2],[1205,1],[1216,1],[1227,1],[1229,1],[1250,1],[1275,1],[1277,2],[1280,1],[1301,1],[1332,1],[1334,1],[1336,1],[1338,1],[1340,2],[1368,1],[1379,1],[1390,1],[1392,1],[1413,1],[1438,1],[1440,2],[1443,1],[1464,1],[1495,1],[1497,1],[1499,1],[1501,1],[1503,2],[1524,1],[1535,1],[1546,1],[1548,1],[1569,1],[1594,1],[1596,1],[1598,1],[1600,1],[1602,1],[1604,2],[1619,1],[1634,1],[1648,1],[1681,1],[1683,1],[1700,2],[1703,1],[1752,1],[1754,1],[1756,2],[1777,1],[1810,1],[1812,1],[1829,2],[1832,1],[1887,1],[1889,1],[1891,1],[1893,1],[1895,1],[1897,2],[1900,1],[1939,1],[1953,1],[1963,2],[1966,2],[1987,1],[1997,2],[2000,1],[2002,2],[2017,1],[2032,1],[2046,1],[2079,1],[2081,1],[2098,1],[2100,1],[2102,2],[2123,1],[2156,1],[2158,1],[2175,1],[2177,1],[2179,1],[2181,1],[2183,1],[2185,1],[2187,1],[2189,1],[3081,2],[3153,2],[3177,1],[3193,1],[3195,1],[3222,2],[3322,1],[3383,2],[3467,2],[3647,2],[3690,3],[3726,1],[3728,1],[3802,1],[3880,1],[3951,2],[3954,2],[3957,1],[4013,3],[4036,2],[4115,1],[4117,1],[4159,1],[4173,1],[4175,2],[4274,2],[4348,2],[4433,2],[4566,2],[4740,2],[4783,2],[4793,2],[4800,1],[4802,2],[4805,2],[4821,1],[4823,1],[4833,2],[4928,1],[4935,2],[4995,1],[5125,2],[5128,1],[5262,2],[5265,1],[5392,2],[5395,1],[5397,1],[5409,2],[5502,2],[5509,1],[5511,2],[5514,2],[5530,1],[5551,2],[5623,2],[5742,1],[5797,1],[5831,1],[5833,2],[5935,1],[5963,1],[5975,1],[6031,2],[6088,1],[6142,2],[6247,1],[6301,2],[6428,1],[6482,2],[6525,2],[6542,1],[6578,1],[6580,1],[6594,1],[6625,1],[6648,1],[6681,2],[6693,1],[6720,1],[6729,1],[6758,1],[6766,1],[6773,1],[6798,1],[6828,1],[6841,2],[6850,1],[6857,1],[6882,1],[6916,1],[6929,2],[6938,1],[6945,1],[6970,1],[6997,1],[7010,1],[7012,2],[7015,2],[7031,1],[7090,1],[7261,1],[7307,1],[7343,1],[7400,1],[7434,1],[7539,1],[7572,1],[7700,1],[7734,1],[7776,1],[7778,1],[7902,1],[7982,1],[7984,1],[8042,1],[8049,1],[8056,1],[8168,2],[8256,2],[8337,3],[8341,2],[8344,2],[8347,1],[8358,1],[8632,1],[8676,1],[8678,1],[8769,1],[8786,1],[8801,1],[9025,2],[9633,1],[9708,2],[9711,1],[9790,2],[9793,1],[9865,1],[9867,2],[10333,2],[10405,2],[10429,1],[10445,1],[10447,1],[10474,2],[10574,1],[10635,2],[10719,2],[10899,2],[10942,3],[10946,2],[10967,1],[10977,1],[10979,1],[11076,2],[11079,1],[11136,3],[11140,2],[11151,1],[11178,2],[11257,1],[11259,1],[11301,1],[11315,1],[11317,2],[11416,2],[11490,2],[11575,2],[11708,2],[11882,2],[11925,2],[11935,2],[11942,1],[11944,2],[11947,2],[11963,1],[11965,1],[11975,2],[12070,1],[12077,2],[12171,1],[12183,2],[12262,2],[12270,1],[12272,1],[12289,1],[12310,2],[12382,2],[12501,1],[12556,1],[12590,1],[12592,2],[12694,1],[12722,1],[12734,1],[12790,2],[12847,1],[12901,2],[13006,1],[13060,2],[13187,1],[13241,2],[13284,2],[13301,1],[13337,1],[13339,1],[13353,1],[13378,1],[13401,1],[13434,2],[13446,1],[13471,1],[13478,1],[13503,1],[13533,1],[13547,2],[13563,1],[13603,2],[13623,1],[13650,1],[13821,1],[13867,1],[13903,1],[13960,1],[13994,1],[14099,1],[14132,1],[14260,1],[14294,1],[14336,1],[14338,1],[14462,1],[14542,1],[14544,1],[14602,1],[14609,1],[14699,1],[14710,1],[14750,1],[14769,1],[15073,1],[15337,1],[15381,1],[15383,1],[15474,1],[15625,1],[15667,1],[15683,2],[15726,1],[15749,2],[15795,1],[15809,2],[15856,1],[15888,2]]},"809":{"position":[[410,1],[579,1],[590,1]]},"819":{"position":[[1158,1],[1205,1],[1207,1],[1224,2],[1227,1],[1263,1],[1281,1],[1291,2],[1294,2],[1315,1],[1325,2],[1328,2],[1341,1],[1351,2],[1354,2],[1366,1],[1376,2],[1379,1],[1381,2],[1396,1],[1411,1],[1429,1],[1462,1],[1464,1],[1481,1],[1483,1],[1485,2],[1506,1],[1539,1],[1541,1],[1558,1],[1560,1],[1562,2],[1575,1],[1608,1],[1610,1],[1627,1],[1629,1],[1631,2],[1643,1],[1676,1],[1678,1],[1695,1],[1697,1],[1699,1],[1701,1],[1703,1],[1705,1],[1707,1],[1709,1]]},"821":{"position":[[730,1],[777,1],[779,1],[796,2],[799,1],[835,1],[853,1],[863,2],[866,2],[887,1],[897,2],[900,2],[913,1],[923,2],[926,2],[938,1],[948,2],[951,1],[953,2],[968,1],[983,1],[1001,1],[1034,1],[1036,1],[1053,1],[1055,1],[1057,2],[1078,1],[1111,1],[1113,1],[1130,1],[1132,1],[1134,2],[1147,1],[1180,1],[1182,1],[1199,1],[1201,1],[1203,2],[1215,1],[1248,1],[1250,1],[1267,1],[1269,1],[1271,1],[1273,1],[1275,1],[1277,1],[1279,1],[1281,1],[1508,1],[1544,1],[1556,1],[1566,2],[1569,1],[1571,2],[1586,1],[1601,1],[1613,1],[1646,1],[1648,1],[1665,1],[1667,1],[1669,1],[1671,1],[1673,1],[1675,1],[2120,2],[2192,2],[2216,1],[2232,1],[2234,1],[2261,2],[2361,1],[2422,2],[2506,2],[2686,2],[2729,3],[2765,1],[2767,2],[2820,1],[2899,2],[2902,2],[2905,1],[2961,3],[2984,2],[3063,1],[3065,1],[3107,1],[3121,1],[3123,2],[3222,2],[3296,2],[3381,2],[3514,2],[3688,2],[3731,2],[3741,2],[3748,1],[3750,2],[3753,2],[3769,1],[3771,1],[3781,2],[3876,1],[3883,2],[3943,1],[3945,2],[4131,2],[4134,1],[4136,1],[4148,2],[4241,2],[4248,1],[4250,2],[4253,2],[4269,1],[4290,2],[4362,2],[4481,1],[4536,1],[4570,1],[4572,2],[4674,1],[4702,1],[4714,1],[4770,2],[4827,1],[4881,2],[4986,1],[5040,2],[5167,1],[5221,2],[5264,2],[5281,1],[5317,1],[5319,1],[5333,1],[5364,1],[5387,1],[5420,2],[5432,1],[5459,1],[5468,1],[5497,1],[5499,2],[5558,1],[5565,1],[5588,1],[5613,1],[5638,1],[5640,2],[5643,2],[5659,1],[5718,1],[5889,1],[5935,1],[5971,1],[6028,1],[6062,1],[6167,1],[6200,1],[6328,1],[6362,1],[6404,1],[6406,1],[6530,1],[6610,1],[6612,1],[6670,1],[6677,1],[6684,1],[6728,1],[6853,3],[6857,2],[6860,2],[6863,1],[6874,1],[7148,1],[7192,1],[7194,1],[7285,1],[7302,1],[7317,1],[7399,2],[7771,2],[7824,1],[7904,1],[7906,2],[8097,2],[8169,2],[8193,1],[8209,1],[8211,1],[8238,2],[8338,1],[8399,2],[8483,2],[8663,2],[8706,3],[8710,2],[8731,1],[8741,1],[8743,1],[8845,2],[8848,1],[8905,3],[8909,2],[8920,1],[8946,2],[9025,1],[9027,1],[9069,1],[9083,1],[9085,2],[9184,2],[9258,2],[9343,2],[9476,2],[9650,2],[9693,2],[9703,2],[9710,1],[9712,2],[9715,2],[9731,1],[9733,1],[9743,2],[9838,1],[9845,2],[9944,1],[9956,2],[10035,2],[10043,1],[10045,1],[10061,1],[10082,2],[10154,2],[10273,1],[10328,1],[10362,1],[10364,2],[10466,1],[10494,1],[10506,1],[10562,2],[10619,1],[10673,2],[10778,1],[10832,2],[10959,1],[11013,2],[11056,2],[11073,1],[11109,1],[11111,1],[11125,1],[11150,1],[11173,1],[11206,2],[11218,1],[11243,1],[11250,1],[11273,1],[11298,1],[11324,2],[11340,1],[11380,2],[11400,1],[11426,1],[11597,1],[11643,1],[11679,1],[11736,1],[11770,1],[11875,1],[11908,1],[12036,1],[12070,1],[12112,1],[12114,1],[12238,1],[12318,1],[12320,1],[12378,1],[12385,1],[12480,1],[12491,1],[12531,1],[12550,1],[12858,1],[13121,1],[13165,1],[13167,1],[13258,1],[13414,1],[13455,1],[13469,2],[13510,1],[13528,2],[13569,1],[13595,2],[13654,1],[13686,2],[13831,2],[13903,2],[13927,1],[13943,1],[13945,1],[13972,2],[14072,1],[14133,2],[14217,2],[14397,2],[14440,3],[14476,1],[14478,2],[14531,1],[14610,2],[14613,2],[14616,1],[14672,3],[14695,2],[14774,1],[14776,1],[14818,1],[14832,1],[14834,2],[14933,2],[15007,2],[15092,2],[15225,2],[15399,2],[15442,2],[15452,2],[15459,1],[15461,2],[15464,2],[15480,1],[15482,1],[15492,2],[15587,1],[15594,2],[15654,1],[15656,2],[15842,2],[15845,1],[15847,1],[15859,2],[15952,2],[15959,1],[15961,2],[15964,2],[15980,1],[16001,2],[16073,2],[16192,1],[16247,1],[16281,1],[16283,2],[16385,1],[16413,1],[16425,1],[16481,2],[16538,1],[16592,2],[16697,1],[16751,2],[16878,1],[16932,2],[16975,2],[16992,1],[17028,1],[17030,1],[17044,1],[17075,1],[17098,1],[17131,2],[17143,1],[17170,1],[17179,1],[17208,1],[17210,2],[17269,1],[17276,1],[17305,1],[17324,1],[17349,1],[17351,2],[17354,2],[17370,1],[17429,1],[17600,1],[17646,1],[17682,1],[17739,1],[17773,1],[17878,1],[17911,1],[18039,1],[18073,1],[18115,1],[18117,1],[18241,1],[18321,1],[18323,1],[18381,1],[18388,1],[18395,1],[18439,1],[18564,3],[18568,2],[18571,2],[18574,1],[18585,1],[18859,1],[18903,1],[18905,1],[18996,1],[19013,1],[19028,1],[19110,2],[19482,2],[19535,1],[19615,1],[19617,2],[19765,2],[19837,2],[19861,1],[19877,1],[19879,1],[19906,2],[20006,1],[20067,2],[20151,2],[20331,2],[20374,3],[20378,2],[20399,1],[20409,1],[20411,1],[20513,2],[20516,1],[20573,3],[20577,2],[20588,1],[20614,2],[20693,1],[20695,1],[20737,1],[20751,1],[20753,2],[20852,2],[20926,2],[21011,2],[21144,2],[21318,2],[21361,2],[21371,2],[21378,1],[21380,2],[21383,2],[21399,1],[21401,1],[21411,2],[21506,1],[21513,2],[21612,1],[21624,2],[21703,2],[21711,1],[21713,1],[21729,1],[21750,2],[21822,2],[21941,1],[21996,1],[22030,1],[22032,2],[22134,1],[22162,1],[22174,1],[22230,2],[22287,1],[22341,2],[22446,1],[22500,2],[22627,1],[22681,2],[22724,2],[22741,1],[22777,1],[22779,1],[22793,1],[22818,1],[22841,1],[22874,2],[22886,1],[22911,1],[22918,1],[22947,1],[22966,1],[22992,2],[23008,1],[23048,2],[23068,1],[23094,1],[23265,1],[23311,1],[23347,1],[23404,1],[23438,1],[23543,1],[23576,1],[23704,1],[23738,1],[23780,1],[23782,1],[23906,1],[23986,1],[23988,1],[24046,1],[24053,1],[24148,1],[24159,1],[24199,1],[24218,1],[24526,1],[24789,1],[24833,1],[24835,1],[24926,1],[25082,1],[25123,1],[25143,2],[25190,1],[25202,2],[25237,1],[25263,2],[25322,1],[25354,2],[25508,2],[25580,2],[25604,1],[25620,1],[25622,1],[25649,2],[25749,1],[25810,2],[25894,2],[26074,2],[26117,3],[26121,2],[26142,1],[26152,1],[26154,1],[26262,2],[26265,1],[26322,3],[26326,2],[26337,1],[26364,2],[26443,1],[26445,1],[26487,1],[26501,1],[26503,2],[26602,2],[26676,2],[26761,2],[26894,2],[27068,2],[27111,2],[27121,2],[27128,1],[27130,2],[27133,2],[27149,1],[27151,1],[27161,2],[27256,1],[27263,2],[27368,1],[27380,2],[27459,2],[27467,1],[27469,1],[27486,1],[27507,2],[27579,2],[27698,1],[27753,1],[27787,1],[27789,2],[27891,1],[27919,1],[27931,1],[27987,2],[28044,1],[28098,2],[28203,1],[28257,2],[28384,1],[28438,2],[28481,2],[28498,1],[28534,1],[28536,1],[28550,1],[28575,1],[28598,1],[28631,2],[28643,1],[28668,1],[28675,1],[28704,1],[28729,1],[28755,2],[28771,1],[28811,2],[28831,1],[28858,1],[29029,1],[29075,1],[29111,1],[29168,1],[29202,1],[29307,1],[29340,1],[29468,1],[29502,1],[29544,1],[29546,1],[29670,1],[29750,1],[29752,1],[29810,1],[29817,1],[29918,1],[29929,1],[29969,1],[29988,1],[30303,1],[30567,1],[30611,1],[30613,1],[30704,1],[30866,1],[30908,1],[30928,2],[30975,1],[30993,2],[31034,1],[31060,2],[31119,1],[31151,2],[31215,1],[31217,1],[31219,2],[31352,2],[31355,1],[31357,2],[31476,2],[31479,1],[31481,2],[31602,2],[31605,1],[31669,2],[31741,2],[31765,1],[31781,1],[31783,1],[31810,2],[31910,1],[31971,2],[32055,2],[32235,2],[32278,3],[32314,1],[32316,2],[32371,1],[32452,2],[32500,1],[32574,2],[32623,1],[32698,2],[32701,2],[32704,1],[32760,3],[32783,2],[32862,1],[32864,1],[32906,1],[32920,1],[32922,2],[33021,2],[33095,2],[33180,2],[33313,2],[33487,2],[33530,2],[33540,2],[33547,1],[33549,2],[33552,2],[33568,1],[33570,1],[33580,2],[33675,1],[33682,2],[33742,1],[33744,2],[33934,2],[33937,1],[33939,2],[34115,2],[34118,1],[34120,2],[34298,2],[34301,1],[34303,1],[34315,2],[34408,2],[34415,1],[34417,2],[34420,2],[34436,1],[34457,2],[34529,2],[34648,1],[34703,1],[34737,1],[34739,2],[34841,1],[34869,1],[34881,1],[34937,2],[34994,1],[35048,2],[35153,1],[35207,2],[35334,1],[35388,2],[35431,2],[35448,1],[35484,1],[35486,1],[35500,1],[35531,1],[35554,1],[35587,2],[35599,1],[35626,1],[35635,1],[35664,1],[35666,2],[35727,1],[35734,1],[35757,1],[35784,1],[35809,2],[35812,2],[35866,1],[35873,1],[35898,1],[35916,1],[35941,2],[35944,2],[35999,1],[36006,1],[36031,1],[36050,1],[36075,1],[36077,2],[36080,2],[36096,1],[36155,1],[36326,1],[36372,1],[36408,1],[36465,1],[36499,1],[36604,1],[36637,1],[36765,1],[36799,1],[36841,1],[36843,1],[36967,1],[37047,1],[37049,1],[37107,1],[37114,1],[37121,1],[37165,1],[37294,2],[37310,1],[37425,2],[37441,1],[37558,3],[37562,2],[37565,2],[37568,1],[37579,1],[37853,1],[37897,1],[37899,1],[37990,1],[38007,1],[38022,1],[38253,2],[38868,2],[38923,1],[39005,2],[39008,2],[39056,1],[39131,2],[39134,2],[39183,1],[39259,1],[39261,2],[39469,2],[39541,2],[39565,1],[39581,1],[39583,1],[39610,2],[39710,1],[39771,2],[39855,2],[40035,2],[40078,3],[40082,2],[40103,1],[40113,1],[40115,1],[40217,2],[40220,1],[40277,3],[40281,2],[40292,1],[40318,2],[40397,1],[40399,1],[40441,1],[40455,1],[40457,2],[40556,2],[40630,2],[40715,2],[40848,2],[41022,2],[41065,2],[41075,2],[41082,1],[41084,2],[41087,2],[41103,1],[41105,1],[41115,2],[41210,1],[41217,2],[41316,1],[41328,2],[41407,2],[41415,1],[41417,1],[41433,1],[41454,2],[41526,2],[41645,1],[41700,1],[41734,1],[41736,2],[41838,1],[41866,1],[41878,1],[41934,2],[41991,1],[42045,2],[42150,1],[42204,2],[42331,1],[42385,2],[42428,2],[42445,1],[42481,1],[42483,1],[42497,1],[42522,1],[42545,1],[42578,2],[42590,1],[42615,1],[42622,1],[42645,1],[42670,1],[42696,2],[42712,1],[42752,2],[42772,1],[42798,1],[42969,1],[43015,1],[43051,1],[43108,1],[43142,1],[43247,1],[43280,1],[43408,1],[43442,1],[43484,1],[43486,1],[43610,1],[43690,1],[43692,1],[43750,1],[43757,1],[43852,1],[43863,1],[43903,1],[43922,1],[44230,1],[44493,1],[44537,1],[44539,1],[44630,1],[44786,1],[44827,1],[44841,2],[44882,1],[44900,2],[44941,1],[44967,2],[45026,1],[45058,2]]},"823":{"position":[[181,2],[253,2],[277,1],[293,1],[295,1],[322,2],[422,1],[483,2],[567,2],[747,2],[790,3],[794,2],[815,1],[825,1],[827,1],[923,2],[926,1],[983,3],[987,2],[998,1],[1025,2],[1104,1],[1106,1],[1148,1],[1162,1],[1164,2],[1263,2],[1337,2],[1422,2],[1555,2],[1729,2],[1772,2],[1782,2],[1789,1],[1791,2],[1794,2],[1810,1],[1812,1],[1822,2],[1917,1],[1924,2],[2017,1],[2029,2],[2108,2],[2116,1],[2118,1],[2135,1],[2156,2],[2228,2],[2347,1],[2402,1],[2436,1],[2438,2],[2540,1],[2568,1],[2580,1],[2636,2],[2693,1],[2747,2],[2852,1],[2906,2],[3033,1],[3087,2],[3130,2],[3147,1],[3183,1],[3185,1],[3199,1],[3224,1],[3247,1],[3280,2],[3292,1],[3317,1],[3324,1],[3347,1],[3366,1],[3392,2],[3408,1],[3448,2],[3468,1],[3495,1],[3666,1],[3712,1],[3748,1],[3805,1],[3839,1],[3944,1],[3977,1],[4105,1],[4139,1],[4181,1],[4183,1],[4307,1],[4387,1],[4389,1],[4447,1],[4454,1],[4543,1],[4554,1],[4594,1],[4613,1],[4916,1],[5180,1],[5224,1],[5226,1],[5317,1],[5467,1],[5509,1],[5523,2],[5564,1],[5576,2],[5611,1],[5637,2],[5696,1],[5728,2],[6347,1],[6561,1],[6608,1],[6610,1],[6627,2],[6630,1],[6666,1],[6684,1],[6694,2],[6697,2],[6718,1],[6729,1],[6740,1],[6742,1],[6752,2],[6755,2],[6758,1],[6779,1],[6808,1],[6810,1],[6812,1],[6814,1],[6816,2],[6829,1],[6840,1],[6851,1],[6853,1],[6863,2],[6866,2],[6869,1],[6890,1],[6921,1],[6923,2],[6926,1],[6947,1],[6976,1],[6978,1],[6980,1],[6982,1],[6984,2],[6996,1],[7006,2],[7009,1],[7011,2],[7026,1],[7041,1],[7059,1],[7092,1],[7094,1],[7111,1],[7113,1],[7115,2],[7136,1],[7169,1],[7171,1],[7188,1],[7190,1],[7192,2],[7205,1],[7238,1],[7240,1],[7257,1],[7259,1],[7261,2],[7273,1],[7306,1],[7308,1],[7325,1],[7327,1],[7329,1],[7331,1],[7333,1],[7335,1],[7337,1],[7339,1],[7463,2],[7535,2],[7559,1],[7575,1],[7577,1],[7604,2],[7704,1],[7765,2],[7849,2],[8029,2],[8072,3],[8076,2],[8097,1],[8107,1],[8109,1],[8205,2],[8208,1],[8265,3],[8269,2],[8280,1],[8306,2],[8385,1],[8387,1],[8429,1],[8443,1],[8445,2],[8544,2],[8618,2],[8703,2],[8836,2],[9010,2],[9053,2],[9063,2],[9070,1],[9072,2],[9075,2],[9091,1],[9093,1],[9103,2],[9198,1],[9205,2],[9298,1],[9310,2],[9389,2],[9397,1],[9399,1],[9415,1],[9436,2],[9508,2],[9627,1],[9682,1],[9716,1],[9718,2],[9820,1],[9848,1],[9860,1],[9916,2],[9973,1],[10027,2],[10132,1],[10186,2],[10313,1],[10367,2],[10410,2],[10427,1],[10463,1],[10465,1],[10479,1],[10504,1],[10527,1],[10560,2],[10572,1],[10597,1],[10604,1],[10627,1],[10646,1],[10672,2],[10688,1],[10728,2],[10748,1],[10774,1],[10945,1],[10991,1],[11027,1],[11084,1],[11118,1],[11223,1],[11256,1],[11384,1],[11418,1],[11460,1],[11462,1],[11586,1],[11666,1],[11668,1],[11726,1],[11733,1],[11822,1],[11833,1],[11873,1],[11892,1],[12194,1],[12457,1],[12501,1],[12503,1],[12594,1],[12744,1],[12785,1],[12799,2],[12840,1],[12852,2],[12887,1],[12913,2],[12972,1],[13004,2]]},"825":{"position":[[1917,1],[1951,1],[1973,1],[1983,2],[1986,2],[1999,1],[2009,2],[2012,2],[2025,1],[2035,2],[2038,1],[2040,2],[2055,1],[2070,1],[2092,1],[2125,1],[2127,1],[2149,1],[2151,1],[2153,2],[2166,1],[2199,1],[2201,1],[2218,2],[2221,1],[2271,2],[2274,1],[2326,2],[2329,1],[2373,2],[2376,1],[2419,1],[2421,1],[2423,2],[2436,1],[2469,1],[2471,1],[2488,2],[2491,1],[2541,2],[2544,1],[2596,2],[2599,1],[2643,2],[2646,1],[2689,1],[2691,1],[2693,1],[2695,1],[2697,1],[2699,1],[3354,1],[3388,1],[3410,1],[3420,2],[3423,2],[3436,1],[3446,2],[3449,2],[3462,1],[3473,1],[3484,1],[3486,1],[3496,2],[3499,2],[3502,1],[3523,1],[3546,1],[3548,1],[3550,1],[3552,1],[3554,1],[3556,2],[3571,1],[3586,1],[3608,1],[3641,1],[3643,1],[3665,1],[3667,1],[3669,2],[3682,1],[3715,1],[3717,1],[3734,2],[3737,1],[3787,2],[3790,1],[3842,2],[3845,1],[3889,2],[3892,1],[3935,1],[3937,1],[3939,2],[3952,1],[3985,1],[3987,1],[4004,2],[4007,1],[4057,2],[4060,1],[4112,2],[4115,1],[4159,2],[4162,1],[4205,1],[4207,1],[4209,1],[4211,1],[4213,1],[4215,1],[4971,1],[5018,1],[5020,1],[5037,2],[5040,1],[5076,1],[5094,1],[5104,2],[5107,2],[5128,1],[5139,1],[5150,1],[5152,1],[5162,2],[5165,2],[5168,1],[5189,1],[5218,1],[5220,1],[5222,1],[5224,1],[5226,2],[5239,1],[5250,1],[5261,1],[5263,1],[5273,2],[5276,2],[5279,1],[5300,1],[5331,1],[5333,2],[5336,1],[5357,1],[5386,1],[5388,1],[5390,1],[5392,1],[5394,2],[5406,1],[5416,2],[5419,1],[5421,2],[5436,1],[5451,1],[5469,1],[5502,1],[5504,1],[5521,1],[5523,1],[5525,2],[5546,1],[5579,1],[5581,1],[5598,1],[5600,1],[5602,2],[5615,1],[5648,1],[5650,1],[5667,1],[5669,1],[5671,2],[5683,1],[5716,1],[5718,1],[5735,1],[5737,1],[5739,1],[5741,1],[5743,1],[5745,2],[5748,1],[5782,1],[5804,1],[5814,2],[5817,2],[5830,1],[5840,2],[5843,2],[5856,1],[5867,1],[5878,1],[5880,1],[5890,2],[5893,2],[5896,1],[5917,1],[5940,1],[5942,1],[5944,1],[5946,1],[5948,1],[5950,2],[5965,1],[5980,1],[6002,1],[6035,1],[6037,1],[6059,1],[6061,1],[6063,2],[6076,1],[6109,1],[6111,1],[6128,2],[6131,1],[6181,2],[6184,1],[6236,2],[6239,1],[6283,2],[6286,1],[6329,1],[6331,1],[6333,2],[6346,1],[6379,1],[6381,1],[6398,2],[6401,1],[6451,2],[6454,1],[6506,2],[6509,1],[6553,2],[6556,1],[6599,1],[6601,1],[6603,1],[6605,1],[6607,1],[6609,1],[6611,1],[6613,1],[6949,2],[7021,2],[7045,1],[7061,1],[7063,1],[7090,2],[7190,1],[7251,2],[7335,2],[7515,2],[7558,3],[7594,1],[7596,1],[7686,1],[7787,1],[7893,2],[7896,2],[7899,1],[7955,3],[7978,2],[8057,1],[8059,1],[8101,1],[8115,1],[8117,2],[8216,2],[8290,2],[8375,2],[8508,2],[8682,2],[8725,2],[8735,2],[8742,1],[8744,2],[8747,2],[8763,1],[8765,1],[8775,2],[8870,1],[8877,2],[8937,1],[9083,2],[9086,1],[9243,2],[9246,1],[9408,2],[9411,1],[9413,1],[9425,2],[9518,2],[9525,1],[9527,2],[9530,2],[9546,1],[9567,2],[9639,2],[9758,1],[9813,1],[9847,1],[9849,2],[9951,1],[9979,1],[9991,1],[10047,2],[10104,1],[10158,2],[10263,1],[10317,2],[10444,1],[10498,2],[10541,2],[10558,1],[10594,1],[10596,1],[10610,1],[10641,1],[10664,1],[10697,2],[10709,1],[10736,1],[10745,1],[10774,1],[10782,1],[10789,1],[10824,1],[10853,1],[10873,2],[10882,1],[10889,1],[10924,1],[10953,1],[10984,2],[10993,1],[11000,1],[11035,1],[11064,1],[11100,1],[11102,2],[11105,2],[11121,1],[11180,1],[11351,1],[11397,1],[11433,1],[11490,1],[11524,1],[11629,1],[11662,1],[11790,1],[11824,1],[11866,1],[11868,1],[11992,1],[12072,1],[12074,1],[12132,1],[12139,1],[12146,1],[12274,2],[12385,2],[12501,3],[12505,2],[12508,2],[12511,1],[12522,1],[12796,1],[12840,1],[12842,1],[12933,1],[12950,1],[12965,1],[13263,2],[13945,1],[14036,2],[14039,1],[14141,2],[14144,1],[14251,1],[14253,2],[14565,2],[14637,2],[14661,1],[14677,1],[14679,1],[14706,2],[14806,1],[14867,2],[14951,2],[15131,2],[15174,3],[15210,1],[15212,2],[15326,1],[15413,2],[15416,2],[15419,1],[15475,3],[15498,2],[15577,1],[15579,1],[15621,1],[15635,1],[15637,2],[15736,2],[15810,2],[15895,2],[16028,2],[16202,2],[16245,2],[16255,2],[16262,1],[16264,2],[16267,2],[16283,1],[16285,1],[16295,2],[16390,1],[16397,2],[16457,1],[16459,2],[16714,2],[16717,1],[16719,1],[16731,2],[16824,2],[16831,1],[16833,2],[16836,2],[16852,1],[16873,2],[16945,2],[17064,1],[17119,1],[17153,1],[17155,2],[17257,1],[17285,1],[17297,1],[17353,2],[17410,1],[17464,2],[17569,1],[17623,2],[17750,1],[17804,2],[17847,2],[17864,1],[17900,1],[17902,1],[17916,1],[17947,1],[17970,1],[18003,2],[18015,1],[18042,1],[18051,1],[18080,1],[18082,2],[18202,1],[18209,1],[18251,1],[18270,1],[18290,1],[18292,2],[18295,2],[18311,1],[18370,1],[18541,1],[18587,1],[18623,1],[18680,1],[18714,1],[18819,1],[18852,1],[18980,1],[19014,1],[19056,1],[19058,1],[19182,1],[19262,1],[19264,1],[19322,1],[19329,1],[19336,1],[19380,1],[19574,3],[19578,2],[19581,2],[19584,1],[19595,1],[19869,1],[19913,1],[19915,1],[20006,1],[20023,1],[20038,1],[20128,2],[20508,2],[20622,1],[20710,1],[20712,2],[21008,2],[21080,2],[21104,1],[21120,1],[21122,1],[21149,2],[21249,1],[21310,2],[21394,2],[21574,2],[21617,3],[21653,1],[21655,2],[21762,1],[21830,1],[21900,2],[21903,2],[21906,1],[21962,3],[21985,2],[22064,1],[22066,1],[22108,1],[22122,1],[22124,2],[22223,2],[22297,2],[22382,2],[22515,2],[22689,2],[22732,2],[22742,2],[22749,1],[22751,2],[22754,2],[22770,1],[22772,1],[22782,2],[22877,1],[22884,2],[22944,1],[22946,2],[23175,2],[23178,1],[23304,2],[23307,1],[23309,1],[23321,2],[23414,2],[23421,1],[23423,2],[23426,2],[23442,1],[23463,2],[23535,2],[23654,1],[23709,1],[23743,1],[23745,2],[23847,1],[23875,1],[23887,1],[23943,2],[24000,1],[24054,2],[24159,1],[24213,2],[24340,1],[24394,2],[24437,2],[24454,1],[24490,1],[24492,1],[24506,1],[24537,1],[24560,1],[24593,2],[24605,1],[24632,1],[24641,1],[24670,1],[24672,2],[24785,1],[24792,1],[24815,1],[24834,1],[24854,2],[24863,1],[24870,1],[24895,1],[24914,1],[24934,1],[24936,2],[24939,2],[24955,1],[25014,1],[25185,1],[25231,1],[25267,1],[25324,1],[25358,1],[25463,1],[25496,1],[25624,1],[25658,1],[25700,1],[25702,1],[25826,1],[25906,1],[25908,1],[25966,1],[25973,1],[25980,1],[26024,1],[26192,2],[26272,3],[26276,2],[26279,2],[26282,1],[26293,1],[26567,1],[26611,1],[26613,1],[26704,1],[26721,1],[26736,1],[26876,2],[27353,2],[27460,1],[27529,2],[27532,1],[27603,1],[27605,2],[27842,2],[27914,2],[27938,1],[27954,1],[27956,1],[27983,2],[28083,1],[28144,2],[28228,2],[28408,2],[28451,3],[28487,1],[28489,1],[28568,1],[28649,2],[28652,2],[28655,1],[28711,3],[28734,2],[28813,1],[28815,1],[28857,1],[28871,1],[28873,2],[28972,2],[29046,2],[29131,2],[29264,2],[29438,2],[29481,2],[29491,2],[29498,1],[29500,2],[29503,2],[29519,1],[29521,1],[29531,2],[29626,1],[29633,2],[29693,1],[29828,2],[29831,1],[29968,2],[29971,1],[29973,1],[29985,2],[30078,2],[30085,1],[30087,2],[30090,2],[30106,1],[30127,2],[30199,2],[30318,1],[30373,1],[30407,1],[30409,2],[30511,1],[30539,1],[30551,1],[30607,2],[30664,1],[30718,2],[30823,1],[30877,2],[31004,1],[31058,2],[31101,2],[31118,1],[31154,1],[31156,1],[31170,1],[31201,1],[31224,1],[31257,2],[31269,1],[31296,1],[31305,1],[31334,1],[31342,1],[31349,1],[31372,1],[31391,1],[31422,2],[31431,1],[31438,1],[31463,1],[31482,1],[31513,1],[31515,2],[31518,2],[31534,1],[31593,1],[31764,1],[31810,1],[31846,1],[31903,1],[31937,1],[32042,1],[32075,1],[32203,1],[32237,1],[32279,1],[32281,1],[32405,1],[32485,1],[32487,1],[32545,1],[32552,1],[32559,1],[32676,2],[32767,3],[32771,2],[32774,2],[32777,1],[32788,1],[33062,1],[33106,1],[33108,1],[33199,1],[33216,1],[33231,1],[33393,2],[33892,1],[33972,2],[33975,1],[34057,1],[34059,2],[34326,2],[34398,2],[34422,1],[34438,1],[34440,1],[34467,2],[34567,1],[34628,2],[34712,2],[34892,2],[34935,3],[34971,1],[34973,1],[35076,2],[35079,2],[35082,1],[35138,3],[35161,2],[35240,1],[35242,1],[35284,1],[35298,1],[35300,2],[35399,2],[35473,2],[35558,2],[35691,2],[35865,2],[35908,2],[35918,2],[35925,1],[35927,2],[35930,2],[35946,1],[35948,1],[35958,2],[36053,1],[36060,2],[36120,1],[36279,2],[36282,1],[36284,1],[36296,2],[36389,2],[36396,1],[36398,2],[36401,2],[36417,1],[36438,2],[36510,2],[36629,1],[36684,1],[36718,1],[36720,2],[36822,1],[36850,1],[36862,1],[36918,2],[36975,1],[37029,2],[37134,1],[37188,2],[37315,1],[37369,2],[37412,2],[37429,1],[37465,1],[37467,1],[37481,1],[37512,1],[37535,1],[37568,2],[37580,1],[37607,1],[37616,1],[37645,1],[37653,1],[37660,1],[37702,1],[37721,1],[37757,1],[37759,2],[37762,2],[37778,1],[37837,1],[38008,1],[38054,1],[38090,1],[38147,1],[38181,1],[38286,1],[38319,1],[38447,1],[38481,1],[38523,1],[38525,1],[38649,1],[38729,1],[38731,1],[38789,1],[38796,1],[38803,1],[38944,3],[38948,2],[38951,2],[38954,1],[38965,1],[39239,1],[39283,1],[39285,1],[39376,1],[39393,1],[39408,1],[39514,2],[39910,1],[40014,1],[40016,2],[40213,2],[40285,2],[40309,1],[40325,1],[40327,1],[40354,2],[40454,1],[40515,2],[40599,2],[40779,2],[40822,3],[40858,1],[40860,1],[40946,2],[40949,2],[40952,1],[41008,3],[41031,2],[41110,1],[41112,1],[41154,1],[41168,1],[41170,2],[41269,2],[41343,2],[41428,2],[41561,2],[41735,2],[41778,2],[41788,2],[41795,1],[41797,2],[41800,2],[41816,1],[41818,1],[41828,2],[41923,1],[41930,2],[41990,1],[42132,2],[42135,1],[42137,1],[42149,2],[42242,2],[42249,1],[42251,2],[42254,2],[42270,1],[42291,2],[42363,2],[42482,1],[42537,1],[42571,1],[42573,2],[42675,1],[42703,1],[42715,1],[42771,2],[42828,1],[42882,2],[42987,1],[43041,2],[43168,1],[43222,2],[43265,2],[43282,1],[43318,1],[43320,1],[43334,1],[43365,1],[43388,1],[43421,2],[43433,1],[43460,1],[43469,1],[43498,1],[43506,1],[43513,1],[43538,1],[43557,1],[43593,1],[43595,2],[43598,2],[43614,1],[43673,1],[43844,1],[43890,1],[43926,1],[43983,1],[44017,1],[44122,1],[44155,1],[44283,1],[44317,1],[44359,1],[44361,1],[44485,1],[44565,1],[44567,1],[44625,1],[44632,1],[44639,1],[44763,3],[44767,2],[44770,2],[44773,1],[44784,1],[45058,1],[45102,1],[45104,1],[45195,1],[45212,1],[45227,1],[45316,2],[45695,1],[45782,1],[45784,2],[46114,2],[46186,2],[46210,1],[46226,1],[46228,1],[46255,2],[46355,1],[46416,2],[46500,2],[46680,2],[46723,3],[46727,2],[46748,1],[46758,1],[46760,1],[46853,2],[46856,1],[46913,3],[46917,2],[46928,1],[46955,2],[47034,1],[47036,1],[47078,1],[47092,1],[47094,2],[47193,2],[47267,2],[47352,2],[47485,2],[47659,2],[47702,2],[47712,2],[47719,1],[47721,2],[47724,2],[47740,1],[47742,1],[47752,2],[47847,1],[47854,2],[47944,1],[47956,2],[48035,2],[48043,1],[48045,1],[48062,1],[48083,2],[48155,2],[48274,1],[48329,1],[48363,1],[48365,2],[48467,1],[48495,1],[48507,1],[48563,2],[48620,1],[48674,2],[48779,1],[48833,2],[48960,1],[49014,2],[49057,2],[49074,1],[49110,1],[49112,1],[49126,1],[49151,1],[49174,1],[49207,2],[49219,1],[49244,1],[49251,1],[49276,1],[49295,1],[49316,2],[49332,1],[49372,2],[49392,1],[49419,1],[49590,1],[49636,1],[49672,1],[49729,1],[49763,1],[49868,1],[49901,1],[50029,1],[50063,1],[50105,1],[50107,1],[50231,1],[50311,1],[50313,1],[50371,1],[50378,1],[50464,1],[50475,1],[50515,1],[50534,1],[50834,1],[51098,1],[51142,1],[51144,1],[51235,1],[51382,1],[51424,1],[51440,2],[51483,1],[51495,2],[51530,1],[51551,2],[51605,1],[51637,2],[51785,2],[51857,2],[51881,1],[51897,1],[51899,1],[51926,2],[52026,1],[52087,2],[52171,2],[52351,2],[52394,3],[52398,2],[52419,1],[52429,1],[52431,1],[52540,2],[52543,1],[52600,3],[52604,2],[52615,1],[52641,2],[52720,1],[52722,1],[52764,1],[52778,1],[52780,2],[52879,2],[52953,2],[53038,2],[53171,2],[53345,2],[53388,2],[53398,2],[53405,1],[53407,2],[53410,2],[53426,1],[53428,1],[53438,2],[53533,1],[53540,2],[53646,1],[53658,2],[53737,2],[53745,1],[53747,1],[53763,1],[53784,2],[53856,2],[53975,1],[54030,1],[54064,1],[54066,2],[54168,1],[54196,1],[54208,1],[54264,2],[54321,1],[54375,2],[54480,1],[54534,2],[54661,1],[54715,2],[54758,2],[54775,1],[54811,1],[54813,1],[54827,1],[54852,1],[54875,1],[54908,2],[54920,1],[54945,1],[54952,1],[54977,1],[54996,1],[55033,2],[55049,1],[55089,2],[55109,1],[55135,1],[55306,1],[55352,1],[55388,1],[55445,1],[55479,1],[55584,1],[55617,1],[55745,1],[55779,1],[55821,1],[55823,1],[55947,1],[56027,1],[56029,1],[56087,1],[56094,1],[56196,1],[56207,1],[56247,1],[56266,1],[56581,1],[56844,1],[56888,1],[56890,1],[56981,1],[57144,1],[57185,1],[57201,2],[57244,1],[57256,2],[57291,1],[57328,2],[57398,1],[57430,2]]},"833":{"position":[[428,1],[610,1],[858,1],[869,1]]},"844":{"position":[[517,1],[564,1],[566,1],[583,2],[586,1],[621,1],[632,1],[642,2],[645,2],[658,1],[668,2],[671,2],[687,1],[697,2],[700,2],[713,1],[723,2],[726,1],[728,2],[743,1],[758,1],[769,1],[802,1],[804,1],[821,1],[823,1],[825,2],[838,1],[871,1],[873,1],[890,1],[892,1],[894,2],[910,1],[943,1],[945,1],[962,1],[964,1],[966,2],[979,1],[1012,1],[1014,1],[1031,1],[1033,1],[1035,1],[1037,1],[1039,1],[1041,1],[1043,1],[1045,1],[1271,1],[1306,1],[1318,1],[1328,2],[1331,1],[1333,2],[1348,1],[1363,1],[1375,1],[1408,1],[1410,1],[1427,1],[1429,1],[1431,1],[1433,1],[1435,1],[1437,1],[1878,2],[1950,2],[1974,1],[1990,1],[1992,1],[2019,2],[2119,1],[2180,2],[2264,2],[2444,2],[2487,3],[2523,1],[2525,1],[2602,2],[2605,2],[2608,1],[2664,3],[2687,2],[2766,1],[2768,1],[2810,1],[2824,1],[2826,2],[2925,2],[2999,2],[3084,2],[3217,2],[3391,2],[3434,2],[3444,2],[3451,1],[3453,2],[3456,2],[3472,1],[3474,1],[3484,2],[3579,1],[3586,2],[3646,1],[3779,2],[3782,1],[3784,1],[3796,2],[3889,2],[3896,1],[3898,2],[3901,2],[3917,1],[3938,2],[4010,2],[4129,1],[4184,1],[4218,1],[4220,2],[4322,1],[4350,1],[4362,1],[4418,2],[4475,1],[4529,2],[4634,1],[4688,2],[4815,1],[4869,2],[4912,2],[4929,1],[4965,1],[4967,1],[4981,1],[5012,1],[5035,1],[5068,2],[5080,1],[5107,1],[5116,1],[5145,1],[5153,1],[5160,1],[5184,1],[5206,1],[5231,1],[5233,2],[5236,2],[5252,1],[5311,1],[5482,1],[5528,1],[5564,1],[5621,1],[5655,1],[5760,1],[5793,1],[5921,1],[5955,1],[5997,1],[5999,1],[6123,1],[6203,1],[6205,1],[6263,1],[6270,1],[6277,1],[6392,3],[6396,2],[6399,2],[6402,1],[6413,1],[6687,1],[6731,1],[6733,1],[6824,1],[6841,1],[6856,1],[6936,2],[7306,1],[7384,1],[7386,2],[7586,2],[7658,2],[7682,1],[7698,1],[7700,1],[7727,2],[7827,1],[7888,2],[7972,2],[8152,2],[8195,3],[8199,2],[8220,1],[8230,1],[8232,1],[8332,2],[8335,1],[8392,3],[8396,2],[8407,1],[8433,2],[8512,1],[8514,1],[8556,1],[8570,1],[8572,2],[8671,2],[8745,2],[8830,2],[8963,2],[9137,2],[9180,2],[9190,2],[9197,1],[9199,2],[9202,2],[9218,1],[9220,1],[9230,2],[9325,1],[9332,2],[9429,1],[9441,2],[9520,2],[9528,1],[9530,1],[9546,1],[9567,2],[9639,2],[9758,1],[9813,1],[9847,1],[9849,2],[9951,1],[9979,1],[9991,1],[10047,2],[10104,1],[10158,2],[10263,1],[10317,2],[10444,1],[10498,2],[10541,2],[10558,1],[10594,1],[10596,1],[10610,1],[10635,1],[10658,1],[10691,2],[10703,1],[10728,1],[10735,1],[10759,1],[10781,1],[10807,2],[10823,1],[10863,2],[10883,1],[10909,1],[11080,1],[11126,1],[11162,1],[11219,1],[11253,1],[11358,1],[11391,1],[11519,1],[11553,1],[11595,1],[11597,1],[11721,1],[11801,1],[11803,1],[11861,1],[11868,1],[11961,1],[11972,1],[12012,1],[12031,1],[12337,1],[12600,1],[12644,1],[12646,1],[12737,1],[12891,1],[12932,1],[12947,2],[12989,1],[13004,2],[13042,1],[13068,2],[13127,1],[13159,2],[13298,2],[13370,2],[13394,1],[13410,1],[13412,1],[13439,2],[13539,1],[13600,2],[13684,2],[13864,2],[13907,3],[13943,1],[13945,1],[14018,2],[14021,2],[14024,1],[14080,3],[14103,2],[14182,1],[14184,1],[14226,1],[14240,1],[14242,2],[14341,2],[14415,2],[14500,2],[14633,2],[14807,2],[14850,2],[14860,2],[14867,1],[14869,2],[14872,2],[14888,1],[14890,1],[14900,2],[14995,1],[15002,2],[15062,1],[15191,2],[15194,1],[15196,1],[15208,2],[15301,2],[15308,1],[15310,2],[15313,2],[15329,1],[15350,2],[15422,2],[15541,1],[15596,1],[15630,1],[15632,2],[15734,1],[15762,1],[15774,1],[15830,2],[15887,1],[15941,2],[16046,1],[16100,2],[16227,1],[16281,2],[16324,2],[16341,1],[16377,1],[16379,1],[16393,1],[16424,1],[16447,1],[16480,2],[16492,1],[16519,1],[16528,1],[16557,1],[16565,1],[16572,1],[16596,1],[16614,1],[16639,1],[16641,2],[16644,2],[16660,1],[16719,1],[16890,1],[16936,1],[16972,1],[17029,1],[17063,1],[17168,1],[17201,1],[17329,1],[17363,1],[17405,1],[17407,1],[17531,1],[17611,1],[17613,1],[17671,1],[17678,1],[17685,1],[17796,3],[17800,2],[17803,2],[17806,1],[17817,1],[18091,1],[18135,1],[18137,1],[18228,1],[18245,1],[18260,1],[18336,2],[18702,1],[18776,1],[18778,2],[18932,2],[19004,2],[19028,1],[19044,1],[19046,1],[19073,2],[19173,1],[19234,2],[19318,2],[19498,2],[19541,3],[19545,2],[19566,1],[19576,1],[19578,1],[19674,2],[19677,1],[19734,3],[19738,2],[19749,1],[19775,2],[19854,1],[19856,1],[19898,1],[19912,1],[19914,2],[20013,2],[20087,2],[20172,2],[20305,2],[20479,2],[20522,2],[20532,2],[20539,1],[20541,2],[20544,2],[20560,1],[20562,1],[20572,2],[20667,1],[20674,2],[20767,1],[20779,2],[20858,2],[20866,1],[20868,1],[20884,1],[20905,2],[20977,2],[21096,1],[21151,1],[21185,1],[21187,2],[21289,1],[21317,1],[21329,1],[21385,2],[21442,1],[21496,2],[21601,1],[21655,2],[21782,1],[21836,2],[21879,2],[21896,1],[21932,1],[21934,1],[21948,1],[21973,1],[21996,1],[22029,2],[22041,1],[22066,1],[22073,1],[22097,1],[22115,1],[22141,2],[22157,1],[22197,2],[22217,1],[22243,1],[22414,1],[22460,1],[22496,1],[22553,1],[22587,1],[22692,1],[22725,1],[22853,1],[22887,1],[22929,1],[22931,1],[23055,1],[23135,1],[23137,1],[23195,1],[23202,1],[23291,1],[23302,1],[23342,1],[23361,1],[23663,1],[23926,1],[23970,1],[23972,1],[24063,1],[24213,1],[24254,1],[24269,2],[24311,1],[24322,2],[24356,1],[24382,2],[24441,1],[24473,2],[24550,2],[24622,2],[24646,1],[24662,1],[24664,1],[24691,2],[24791,1],[24852,2],[24936,2],[25116,2],[25159,3],[25163,2],[25184,1],[25194,1],[25196,1],[25293,2],[25296,1],[25353,3],[25357,2],[25368,1],[25395,2],[25474,1],[25476,1],[25518,1],[25532,1],[25534,2],[25633,2],[25707,2],[25792,2],[25925,2],[26099,2],[26142,2],[26152,2],[26159,1],[26161,2],[26164,2],[26180,1],[26182,1],[26192,2],[26287,1],[26294,2],[26388,1],[26400,2],[26479,2],[26487,1],[26489,1],[26506,1],[26527,2],[26599,2],[26718,1],[26773,1],[26807,1],[26809,2],[26911,1],[26939,1],[26951,1],[27007,2],[27064,1],[27118,2],[27223,1],[27277,2],[27404,1],[27458,2],[27501,2],[27518,1],[27554,1],[27556,1],[27570,1],[27595,1],[27618,1],[27651,2],[27663,1],[27688,1],[27695,1],[27719,1],[27738,1],[27764,2],[27780,1],[27820,2],[27840,1],[27867,1],[28038,1],[28084,1],[28120,1],[28177,1],[28211,1],[28316,1],[28349,1],[28477,1],[28511,1],[28553,1],[28555,1],[28679,1],[28759,1],[28761,1],[28819,1],[28826,1],[28916,1],[28927,1],[28967,1],[28986,1],[29290,1],[29554,1],[29598,1],[29600,1],[29691,1],[29842,1],[29884,1],[29899,2],[29941,1],[29953,2],[29988,1],[30014,2],[30073,1],[30105,2],[30575,1],[30622,1],[30624,1],[30641,2],[30644,1],[30679,1],[30690,1],[30700,2],[30703,2],[30716,1],[30727,1],[30738,1],[30740,1],[30750,2],[30753,2],[30756,1],[30777,1],[30799,1],[30801,1],[30803,1],[30805,1],[30807,2],[30823,1],[30834,1],[30845,1],[30847,1],[30857,2],[30860,2],[30863,1],[30884,1],[30907,1],[30909,1],[30911,1],[30913,1],[30915,2],[30928,1],[30939,1],[30950,1],[30952,1],[30962,2],[30965,2],[30968,1],[30989,1],[31015,1],[31017,1],[31019,1],[31021,1],[31023,1],[31025,2],[31040,1],[31055,1],[31066,1],[31099,1],[31101,1],[31118,1],[31120,1],[31122,2],[31135,1],[31168,1],[31170,1],[31187,1],[31189,1],[31191,2],[31207,1],[31240,1],[31242,1],[31259,1],[31261,1],[31263,2],[31276,1],[31309,1],[31311,1],[31328,1],[31330,1],[31332,1],[31334,1],[31336,1],[31338,1],[31340,1],[31342,1],[31772,2],[31844,2],[31868,1],[31884,1],[31886,1],[31913,2],[32013,1],[32074,2],[32158,2],[32338,2],[32381,3],[32385,2],[32406,1],[32416,1],[32418,1],[32514,2],[32517,1],[32574,3],[32578,2],[32589,1],[32615,2],[32694,1],[32696,1],[32738,1],[32752,1],[32754,2],[32853,2],[32927,2],[33012,2],[33145,2],[33319,2],[33362,2],[33372,2],[33379,1],[33381,2],[33384,2],[33400,1],[33402,1],[33412,2],[33507,1],[33514,2],[33607,1],[33619,2],[33698,2],[33706,1],[33708,1],[33724,1],[33745,2],[33817,2],[33936,1],[33991,1],[34025,1],[34027,2],[34129,1],[34157,1],[34169,1],[34225,2],[34282,1],[34336,2],[34441,1],[34495,2],[34622,1],[34676,2],[34719,2],[34736,1],[34772,1],[34774,1],[34788,1],[34813,1],[34836,1],[34869,2],[34881,1],[34906,1],[34913,1],[34937,1],[34955,1],[34981,2],[34997,1],[35037,2],[35057,1],[35083,1],[35254,1],[35300,1],[35336,1],[35393,1],[35427,1],[35532,1],[35565,1],[35693,1],[35727,1],[35769,1],[35771,1],[35895,1],[35975,1],[35977,1],[36035,1],[36042,1],[36131,1],[36142,1],[36182,1],[36201,1],[36503,1],[36766,1],[36810,1],[36812,1],[36903,1],[37053,1],[37094,1],[37109,2],[37151,1],[37162,2],[37196,1],[37222,2],[37281,1],[37313,2],[37390,2],[37462,2],[37486,1],[37502,1],[37504,1],[37531,2],[37631,1],[37692,2],[37776,2],[37956,2],[37999,3],[38003,2],[38024,1],[38034,1],[38036,1],[38133,2],[38136,1],[38193,3],[38197,2],[38208,1],[38234,2],[38313,1],[38315,1],[38357,1],[38371,1],[38373,2],[38472,2],[38546,2],[38631,2],[38764,2],[38938,2],[38981,2],[38991,2],[38998,1],[39000,2],[39003,2],[39019,1],[39021,1],[39031,2],[39126,1],[39133,2],[39227,1],[39239,2],[39318,2],[39326,1],[39328,1],[39344,1],[39365,2],[39437,2],[39556,1],[39611,1],[39645,1],[39647,2],[39749,1],[39777,1],[39789,1],[39845,2],[39902,1],[39956,2],[40061,1],[40115,2],[40242,1],[40296,2],[40339,2],[40356,1],[40392,1],[40394,1],[40408,1],[40433,1],[40456,1],[40489,2],[40501,1],[40526,1],[40533,1],[40557,1],[40576,1],[40602,2],[40618,1],[40658,2],[40678,1],[40704,1],[40875,1],[40921,1],[40957,1],[41014,1],[41048,1],[41153,1],[41186,1],[41314,1],[41348,1],[41390,1],[41392,1],[41516,1],[41596,1],[41598,1],[41656,1],[41663,1],[41753,1],[41764,1],[41804,1],[41823,1],[42126,1],[42389,1],[42433,1],[42435,1],[42526,1],[42677,1],[42718,1],[42733,2],[42775,1],[42787,2],[42822,1],[42848,2],[42907,1],[42939,2]]},"846":{"position":[[684,1],[731,1],[733,1],[750,2],[753,1],[788,1],[799,1],[809,2],[812,2],[825,1],[836,1],[847,1],[849,1],[859,2],[862,2],[865,1],[886,1],[908,1],[910,1],[912,1],[914,1],[916,2],[932,1],[943,1],[954,1],[956,1],[966,2],[969,2],[972,1],[993,1],[1016,1],[1018,1],[1020,1],[1022,1],[1024,2],[1037,1],[1048,1],[1059,1],[1061,1],[1071,2],[1074,2],[1077,1],[1098,1],[1124,1],[1126,1],[1128,1],[1130,1],[1132,1],[1134,2],[1149,1],[1164,1],[1175,1],[1208,1],[1210,1],[1227,2],[1230,1],[1271,1],[1273,1],[1275,2],[1288,1],[1321,1],[1323,1],[1340,2],[1343,1],[1384,1],[1386,1],[1388,2],[1404,1],[1437,1],[1439,1],[1456,2],[1459,1],[1500,1],[1502,1],[1504,2],[1517,1],[1550,1],[1552,1],[1569,2],[1572,1],[1613,1],[1615,1],[1617,1],[1619,1],[1621,1],[1623,2],[1626,1],[1659,1],[1671,1],[1681,2],[1684,1],[1686,2],[1701,1],[1716,1],[1728,1],[1761,1],[1763,1],[1780,1],[1782,1],[1784,1],[1786,1],[1788,1],[1790,1],[1792,1],[1794,1],[2161,2],[2233,2],[2257,1],[2273,1],[2275,1],[2302,2],[2402,1],[2463,2],[2547,2],[2727,2],[2770,3],[2806,1],[2808,2],[2863,1],[2927,1],[2991,1],[3058,2],[3120,1],[3202,2],[3205,2],[3208,1],[3264,3],[3287,2],[3366,1],[3368,1],[3410,1],[3424,1],[3426,2],[3525,2],[3599,2],[3684,2],[3817,2],[3991,2],[4034,2],[4044,2],[4051,1],[4053,2],[4056,2],[4072,1],[4074,1],[4084,2],[4179,1],[4186,2],[4246,1],[4248,2],[4421,2],[4424,1],[4544,2],[4547,1],[4670,2],[4673,1],[4675,2],[4873,2],[4876,1],[4878,1],[4890,2],[4983,2],[4990,1],[4992,2],[4995,2],[5011,1],[5032,2],[5104,2],[5223,1],[5278,1],[5312,1],[5314,2],[5416,1],[5444,1],[5456,1],[5512,2],[5569,1],[5623,2],[5728,1],[5782,2],[5909,1],[5963,2],[6006,2],[6023,1],[6059,1],[6061,1],[6075,1],[6106,1],[6129,1],[6162,2],[6174,1],[6201,1],[6210,1],[6239,1],[6241,2],[6302,1],[6309,1],[6333,1],[6352,1],[6367,2],[6376,1],[6383,1],[6407,1],[6426,1],[6441,2],[6450,1],[6457,1],[6484,1],[6503,1],[6518,2],[6521,2],[6589,1],[6596,1],[6628,1],[6647,1],[6672,1],[6674,2],[6677,2],[6693,1],[6752,1],[6923,1],[6969,1],[7005,1],[7062,1],[7096,1],[7201,1],[7234,1],[7362,1],[7396,1],[7438,1],[7440,1],[7564,1],[7644,1],[7646,1],[7704,1],[7711,1],[7718,1],[7762,1],[7874,2],[7948,2],[8025,2],[8041,1],[8178,3],[8182,2],[8185,2],[8188,1],[8199,1],[8473,1],[8517,1],[8519,1],[8610,1],[8627,1],[8642,1],[8919,2],[9627,2],[9682,1],[9747,2],[9750,1],[9815,2],[9818,1],[9886,2],[9889,2],[9951,1],[10034,1],[10036,2],[10394,2],[10466,2],[10490,1],[10506,1],[10508,1],[10535,2],[10635,1],[10696,2],[10780,2],[10960,2],[11003,3],[11007,2],[11028,1],[11038,1],[11040,1],[11140,2],[11143,1],[11200,3],[11204,2],[11215,1],[11241,2],[11320,1],[11322,1],[11364,1],[11378,1],[11380,2],[11479,2],[11553,2],[11638,2],[11771,2],[11945,2],[11988,2],[11998,2],[12005,1],[12007,2],[12010,2],[12026,1],[12028,1],[12038,2],[12133,1],[12140,2],[12237,1],[12249,2],[12328,2],[12336,1],[12338,1],[12354,1],[12375,2],[12447,2],[12566,1],[12621,1],[12655,1],[12657,2],[12759,1],[12787,1],[12799,1],[12855,2],[12912,1],[12966,2],[13071,1],[13125,2],[13252,1],[13306,2],[13349,2],[13366,1],[13402,1],[13404,1],[13418,1],[13443,1],[13466,1],[13499,2],[13511,1],[13536,1],[13543,1],[13570,1],[13589,1],[13615,2],[13631,1],[13671,2],[13691,1],[13717,1],[13888,1],[13934,1],[13970,1],[14027,1],[14061,1],[14166,1],[14199,1],[14327,1],[14361,1],[14403,1],[14405,1],[14529,1],[14609,1],[14611,1],[14669,1],[14676,1],[14769,1],[14780,1],[14820,1],[14839,1],[15145,1],[15408,1],[15452,1],[15454,1],[15545,1],[15699,1],[15740,1],[15758,2],[15803,1],[15815,2],[15850,1],[15876,2],[15935,1],[15967,2]]},"848":{"position":[[740,1],[787,1],[789,1],[806,2],[809,1],[844,1],[856,1],[866,2],[869,2],[881,1],[891,2],[894,2],[907,1],[918,1],[929,1],[931,1],[941,2],[944,2],[947,1],[968,1],[990,1],[992,1],[994,1],[996,1],[998,2],[1014,1],[1025,1],[1036,1],[1038,1],[1048,2],[1051,2],[1054,1],[1075,1],[1098,1],[1100,1],[1102,1],[1104,1],[1106,2],[1119,1],[1130,1],[1141,1],[1143,1],[1153,2],[1156,2],[1159,1],[1180,1],[1206,1],[1208,1],[1210,1],[1212,1],[1214,1],[1216,2],[1231,1],[1246,1],[1258,1],[1291,1],[1293,1],[1314,1],[1316,1],[1318,2],[1330,1],[1363,1],[1365,1],[1382,2],[1385,1],[1426,1],[1428,1],[1430,2],[1443,1],[1476,1],[1478,1],[1495,2],[1498,1],[1539,1],[1541,1],[1543,2],[1559,1],[1592,1],[1594,1],[1611,2],[1614,1],[1655,1],[1657,1],[1659,2],[1672,1],[1705,1],[1707,1],[1724,2],[1727,1],[1768,1],[1770,1],[1772,1],[1774,1],[1776,1],[1778,1],[1780,1],[1782,1],[1994,2],[2066,2],[2090,1],[2106,1],[2108,1],[2135,2],[2235,1],[2296,2],[2380,2],[2560,2],[2603,3],[2639,1],[2641,2],[2688,1],[2765,2],[2827,1],[2914,2],[2917,2],[2920,1],[2976,3],[2999,2],[3078,1],[3080,1],[3122,1],[3136,1],[3138,2],[3237,2],[3311,2],[3396,2],[3529,2],[3703,2],[3746,2],[3756,2],[3763,1],[3765,2],[3768,2],[3784,1],[3786,1],[3796,2],[3891,1],[3898,2],[3958,1],[3960,2],[4138,2],[4141,1],[4143,2],[4346,2],[4349,1],[4351,1],[4363,2],[4456,2],[4463,1],[4465,2],[4468,2],[4484,1],[4505,2],[4577,2],[4696,1],[4751,1],[4785,1],[4787,2],[4889,1],[4917,1],[4929,1],[4985,2],[5042,1],[5096,2],[5201,1],[5255,2],[5382,1],[5436,2],[5479,2],[5496,1],[5532,1],[5534,1],[5548,1],[5579,1],[5602,1],[5635,2],[5647,1],[5674,1],[5683,1],[5712,1],[5714,2],[5767,1],[5774,1],[5799,1],[5818,1],[5845,2],[5848,2],[5916,1],[5923,1],[5960,1],[5979,1],[6004,1],[6006,2],[6009,2],[6025,1],[6084,1],[6255,1],[6301,1],[6337,1],[6394,1],[6428,1],[6533,1],[6566,1],[6694,1],[6728,1],[6770,1],[6772,1],[6896,1],[6976,1],[6978,1],[7036,1],[7043,1],[7050,1],[7094,1],[7211,2],[7227,1],[7369,3],[7373,2],[7376,2],[7379,1],[7390,1],[7664,1],[7708,1],[7710,1],[7801,1],[7818,1],[7833,1],[7999,2],[8502,2],[8549,1],[8627,2],[8630,2],[8692,1],[8780,1],[8782,2],[9307,2],[9379,2],[9403,1],[9419,1],[9421,1],[9448,2],[9548,1],[9609,2],[9693,2],[9873,2],[9916,3],[9920,2],[9941,1],[9951,1],[9953,1],[10051,2],[10054,1],[10111,3],[10115,2],[10126,1],[10157,2],[10236,1],[10238,1],[10280,1],[10294,1],[10296,2],[10395,2],[10469,2],[10554,2],[10687,2],[10861,2],[10904,2],[10914,2],[10921,1],[10923,2],[10926,2],[10942,1],[10944,1],[10954,2],[11049,1],[11056,2],[11151,1],[11163,2],[11242,2],[11250,1],[11252,1],[11273,1],[11294,2],[11366,2],[11485,1],[11540,1],[11574,1],[11576,2],[11678,1],[11706,1],[11718,1],[11774,2],[11831,1],[11885,2],[11990,1],[12044,2],[12171,1],[12225,2],[12268,2],[12285,1],[12321,1],[12323,1],[12337,1],[12362,1],[12385,1],[12418,2],[12430,1],[12455,1],[12462,1],[12487,1],[12506,1],[12532,2],[12548,1],[12588,2],[12608,1],[12639,1],[12810,1],[12856,1],[12892,1],[12949,1],[12983,1],[13088,1],[13121,1],[13249,1],[13283,1],[13325,1],[13327,1],[13451,1],[13531,1],[13533,1],[13591,1],[13598,1],[13689,1],[13700,1],[13740,1],[13759,1],[14068,1],[14336,1],[14380,1],[14382,1],[14473,1],[14625,1],[14671,1],[14687,2],[14730,1],[14742,2],[14777,1],[14803,2],[14862,1],[14894,2],[15134,1],[15156,1],[15158,1],[15193,1],[15205,1],[15216,1],[15227,1],[15229,1],[15239,2],[15242,2],[15245,1],[15266,1],[15292,1],[15294,2],[15297,1],[15317,1],[15331,1],[15354,2],[15376,1],[15399,1],[15401,1],[15403,1],[15405,1],[15407,1],[15409,1],[15411,2],[15426,1],[15441,1],[15453,1],[15486,1],[15488,1],[15505,2],[15508,1],[15549,1],[15551,1],[15553,1],[15555,1],[15557,1],[15559,1],[15561,1],[15563,1],[16102,2],[16194,2],[16304,1],[16360,3],[16364,1],[16377,1],[16446,1],[16899,1],[16946,1],[16948,1],[16965,2],[16968,1],[17003,1],[17014,1],[17025,1],[17036,1],[17038,1],[17048,2],[17051,2],[17054,1],[17074,1],[17095,1],[17117,2],[17132,1],[17155,1],[17157,1],[17159,1],[17161,1],[17163,1],[17165,2],[17178,1],[17189,1],[17200,1],[17202,1],[17212,2],[17215,2],[17218,1],[17239,1],[17261,1],[17263,2],[17266,1],[17286,1],[17307,1],[17330,2],[17345,1],[17368,1],[17370,1],[17372,1],[17374,1],[17376,1],[17378,2],[17394,1],[17405,1],[17416,1],[17418,1],[17428,2],[17431,2],[17434,1],[17455,1],[17478,1],[17480,2],[17483,1],[17503,1],[17524,1],[17550,2],[17565,1],[17588,1],[17590,1],[17592,1],[17594,1],[17596,1],[17598,2],[17611,1],[17622,1],[17633,1],[17635,1],[17645,2],[17648,2],[17651,1],[17672,1],[17698,1],[17700,2],[17703,1],[17723,1],[17744,1],[17767,2],[17782,1],[17805,1],[17807,1],[17809,1],[17811,1],[17813,1],[17815,2],[17828,1],[17838,2],[17841,1],[17843,2],[17858,1],[17873,1],[17885,1],[17918,1],[17920,1],[17941,1],[17943,1],[17945,2],[17957,1],[17990,1],[17992,1],[18009,2],[18012,1],[18053,1],[18055,1],[18057,2],[18070,1],[18103,1],[18105,1],[18122,2],[18125,1],[18166,1],[18168,1],[18170,2],[18186,1],[18219,1],[18221,1],[18238,2],[18241,1],[18282,1],[18284,1],[18286,2],[18299,1],[18332,1],[18334,1],[18351,2],[18354,1],[18395,1],[18397,1],[18399,1],[18401,1],[18403,1],[18405,2],[18408,1],[18441,1],[18453,1],[18463,2],[18466,1],[18468,2],[18483,1],[18498,1],[18510,1],[18543,1],[18545,1],[18562,1],[18564,1],[18566,1],[18568,1],[18570,1],[18572,1],[18574,1],[18576,1]]},"850":{"position":[[953,1],[1000,1],[1002,1],[1019,2],[1022,1],[1057,1],[1068,1],[1079,1],[1090,1],[1092,1],[1102,2],[1105,2],[1108,1],[1128,1],[1149,1],[1171,2],[1186,1],[1209,1],[1211,1],[1213,1],[1215,1],[1217,1],[1219,2],[1232,1],[1243,1],[1254,1],[1256,1],[1266,2],[1269,2],[1272,1],[1293,1],[1315,1],[1317,2],[1320,1],[1340,1],[1361,1],[1384,2],[1399,1],[1422,1],[1424,1],[1426,1],[1428,1],[1430,1],[1432,2],[1448,1],[1459,1],[1470,1],[1472,1],[1482,2],[1485,2],[1488,1],[1509,1],[1532,1],[1534,2],[1537,1],[1557,1],[1578,1],[1604,2],[1619,1],[1642,1],[1644,1],[1646,1],[1648,1],[1650,1],[1652,2],[1665,1],[1676,1],[1687,1],[1689,1],[1699,2],[1702,2],[1705,1],[1726,1],[1752,1],[1754,2],[1757,1],[1777,1],[1798,1],[1821,2],[1836,1],[1859,1],[1861,1],[1863,1],[1865,1],[1867,1],[1869,2],[1882,1],[1892,2],[1895,1],[1897,2],[1912,1],[1927,1],[1939,1],[1972,1],[1974,1],[1995,1],[1997,1],[1999,2],[2011,1],[2044,1],[2046,1],[2063,2],[2066,1],[2107,1],[2109,1],[2111,2],[2124,1],[2157,1],[2159,1],[2176,2],[2179,1],[2220,1],[2222,1],[2224,2],[2240,1],[2273,1],[2275,1],[2292,2],[2295,1],[2336,1],[2338,1],[2340,2],[2353,1],[2386,1],[2388,1],[2405,2],[2408,1],[2438,2],[2441,2],[2444,1],[2485,1],[2487,1],[2489,1],[2491,1],[2493,1],[2495,2],[2498,1],[2531,1],[2543,1],[2553,2],[2556,1],[2558,2],[2573,1],[2588,1],[2600,1],[2633,1],[2635,1],[2652,1],[2654,1],[2656,1],[2658,1],[2660,1],[2662,1],[2664,1],[2666,1],[2867,2],[2939,2],[2963,1],[2979,1],[2981,1],[3008,2],[3108,1],[3169,2],[3253,2],[3433,2],[3476,3],[3512,1],[3514,2],[3567,1],[3648,2],[3721,1],[3814,2],[3881,1],[3960,2],[3963,2],[3966,1],[4022,3],[4045,2],[4124,1],[4126,1],[4168,1],[4182,1],[4184,2],[4283,2],[4357,2],[4442,2],[4575,2],[4749,2],[4792,2],[4802,2],[4809,1],[4811,2],[4814,2],[4830,1],[4832,1],[4842,2],[4937,1],[4944,2],[5004,1],[5006,2],[5194,2],[5197,1],[5199,2],[5419,2],[5422,1],[5424,2],[5624,2],[5627,1],[5629,1],[5641,2],[5734,2],[5741,1],[5743,2],[5746,2],[5762,1],[5783,2],[5855,2],[5974,1],[6029,1],[6063,1],[6065,2],[6167,1],[6195,1],[6207,1],[6263,2],[6320,1],[6374,2],[6479,1],[6533,2],[6660,1],[6714,2],[6757,2],[6774,1],[6810,1],[6812,1],[6826,1],[6857,1],[6880,1],[6913,2],[6925,1],[6952,1],[6961,1],[6990,1],[6992,2],[7051,1],[7058,1],[7082,1],[7100,1],[7133,2],[7136,2],[7215,1],[7222,1],[7254,1],[7276,1],[7309,2],[7312,2],[7385,1],[7392,1],[7413,1],[7432,1],[7465,1],[7467,2],[7470,2],[7486,1],[7545,1],[7716,1],[7762,1],[7798,1],[7855,1],[7889,1],[7994,1],[8027,1],[8155,1],[8189,1],[8231,1],[8233,1],[8357,1],[8437,1],[8439,1],[8497,1],[8504,1],[8511,1],[8555,1],[8682,2],[8698,1],[8857,2],[8873,1],[9012,3],[9016,2],[9019,2],[9022,1],[9033,1],[9307,1],[9351,1],[9353,1],[9444,1],[9461,1],[9476,1],[9730,2],[10368,2],[10421,1],[10503,2],[10506,2],[10579,1],[10673,2],[10676,2],[10743,1],[10823,1],[10825,2],[10977,2],[11049,2],[11073,1],[11089,1],[11091,1],[11118,2],[11218,1],[11279,2],[11363,2],[11543,2],[11586,3],[11590,2],[11611,1],[11621,1],[11623,1],[11727,2],[11730,1],[11787,3],[11791,2],[11802,1],[11828,2],[11907,1],[11909,1],[11951,1],[11965,1],[11967,2],[12066,2],[12140,2],[12225,2],[12358,2],[12532,2],[12575,2],[12585,2],[12592,1],[12594,2],[12597,2],[12613,1],[12615,1],[12625,2],[12720,1],[12727,2],[12828,1],[12840,2],[12919,2],[12927,1],[12929,1],[12945,1],[12966,2],[13038,2],[13157,1],[13212,1],[13246,1],[13248,2],[13350,1],[13378,1],[13390,1],[13446,2],[13503,1],[13557,2],[13662,1],[13716,2],[13843,1],[13897,2],[13940,2],[13957,1],[13993,1],[13995,1],[14009,1],[14034,1],[14057,1],[14090,2],[14102,1],[14127,1],[14134,1],[14158,1],[14176,1],[14210,2],[14226,1],[14266,2],[14286,1],[14312,1],[14483,1],[14529,1],[14565,1],[14622,1],[14656,1],[14761,1],[14794,1],[14922,1],[14956,1],[14998,1],[15000,1],[15124,1],[15204,1],[15206,1],[15264,1],[15271,1],[15368,1],[15379,1],[15419,1],[15438,1],[15748,1],[16011,1],[16055,1],[16057,1],[16148,1],[16306,1],[16347,1],[16362,2],[16404,1],[16415,2],[16449,1],[16483,2],[16550,1],[16582,2],[16735,2],[16807,2],[16831,1],[16847,1],[16849,1],[16876,2],[16976,1],[17037,2],[17121,2],[17301,2],[17344,3],[17348,2],[17369,1],[17379,1],[17381,1],[17486,2],[17489,1],[17546,3],[17550,2],[17561,1],[17588,2],[17667,1],[17669,1],[17711,1],[17725,1],[17727,2],[17826,2],[17900,2],[17985,2],[18118,2],[18292,2],[18335,2],[18345,2],[18352,1],[18354,2],[18357,2],[18373,1],[18375,1],[18385,2],[18480,1],[18487,2],[18589,1],[18601,2],[18680,2],[18688,1],[18690,1],[18707,1],[18728,2],[18800,2],[18919,1],[18974,1],[19008,1],[19010,2],[19112,1],[19140,1],[19152,1],[19208,2],[19265,1],[19319,2],[19424,1],[19478,2],[19605,1],[19659,2],[19702,2],[19719,1],[19755,1],[19757,1],[19771,1],[19796,1],[19819,1],[19852,2],[19864,1],[19889,1],[19896,1],[19920,1],[19939,1],[19973,2],[19989,1],[20029,2],[20049,1],[20076,1],[20247,1],[20293,1],[20329,1],[20386,1],[20420,1],[20525,1],[20558,1],[20686,1],[20720,1],[20762,1],[20764,1],[20888,1],[20968,1],[20970,1],[21028,1],[21035,1],[21133,1],[21144,1],[21184,1],[21203,1],[21515,1],[21779,1],[21823,1],[21825,1],[21916,1],[22075,1],[22117,1],[22132,2],[22174,1],[22186,2],[22221,1],[22255,2],[22322,1],[22354,2],[22432,2],[22504,2],[22528,1],[22544,1],[22546,1],[22573,2],[22673,1],[22734,2],[22818,2],[22998,2],[23041,3],[23045,2],[23066,1],[23076,1],[23078,1],[23186,2],[23189,1],[23246,3],[23250,2],[23261,1],[23287,2],[23366,1],[23368,1],[23410,1],[23424,1],[23426,2],[23525,2],[23599,2],[23684,2],[23817,2],[23991,2],[24034,2],[24044,2],[24051,1],[24053,2],[24056,2],[24072,1],[24074,1],[24084,2],[24179,1],[24186,2],[24291,1],[24303,2],[24382,2],[24390,1],[24392,1],[24408,1],[24429,2],[24501,2],[24620,1],[24675,1],[24709,1],[24711,2],[24813,1],[24841,1],[24853,1],[24909,2],[24966,1],[25020,2],[25125,1],[25179,2],[25306,1],[25360,2],[25403,2],[25420,1],[25456,1],[25458,1],[25472,1],[25497,1],[25520,1],[25553,2],[25565,1],[25590,1],[25597,1],[25621,1],[25643,1],[25677,2],[25693,1],[25733,2],[25753,1],[25779,1],[25950,1],[25996,1],[26032,1],[26089,1],[26123,1],[26228,1],[26261,1],[26389,1],[26423,1],[26465,1],[26467,1],[26591,1],[26671,1],[26673,1],[26731,1],[26738,1],[26839,1],[26850,1],[26890,1],[26909,1],[27223,1],[27486,1],[27530,1],[27532,1],[27623,1],[27785,1],[27826,1],[27841,2],[27883,1],[27898,2],[27936,1],[27970,2],[28037,1],[28069,2],[28224,2],[28296,2],[28320,1],[28336,1],[28338,1],[28365,2],[28465,1],[28526,2],[28610,2],[28790,2],[28833,3],[28837,2],[28858,1],[28868,1],[28870,1],[28975,2],[28978,1],[29035,3],[29039,2],[29050,1],[29077,2],[29156,1],[29158,1],[29200,1],[29214,1],[29216,2],[29315,2],[29389,2],[29474,2],[29607,2],[29781,2],[29824,2],[29834,2],[29841,1],[29843,2],[29846,2],[29862,1],[29864,1],[29874,2],[29969,1],[29976,2],[30078,1],[30090,2],[30169,2],[30177,1],[30179,1],[30196,1],[30217,2],[30289,2],[30408,1],[30463,1],[30497,1],[30499,2],[30601,1],[30629,1],[30641,1],[30697,2],[30754,1],[30808,2],[30913,1],[30967,2],[31094,1],[31148,2],[31191,2],[31208,1],[31244,1],[31246,1],[31260,1],[31285,1],[31308,1],[31341,2],[31353,1],[31378,1],[31385,1],[31409,1],[31428,1],[31462,2],[31478,1],[31518,2],[31538,1],[31565,1],[31736,1],[31782,1],[31818,1],[31875,1],[31909,1],[32014,1],[32047,1],[32175,1],[32209,1],[32251,1],[32253,1],[32377,1],[32457,1],[32459,1],[32517,1],[32524,1],[32622,1],[32633,1],[32673,1],[32692,1],[33004,1],[33268,1],[33312,1],[33314,1],[33405,1],[33564,1],[33606,1],[33621,2],[33663,1],[33675,2],[33710,1],[33744,2],[33811,1],[33843,2],[33921,2],[33993,2],[34017,1],[34033,1],[34035,1],[34062,2],[34162,1],[34223,2],[34307,2],[34487,2],[34530,3],[34534,2],[34555,1],[34565,1],[34567,1],[34672,2],[34675,1],[34732,3],[34736,2],[34747,1],[34774,2],[34853,1],[34855,1],[34897,1],[34911,1],[34913,2],[35012,2],[35086,2],[35171,2],[35304,2],[35478,2],[35521,2],[35531,2],[35538,1],[35540,2],[35543,2],[35559,1],[35561,1],[35571,2],[35666,1],[35673,2],[35775,1],[35787,2],[35866,2],[35874,1],[35876,1],[35893,1],[35914,2],[35986,2],[36105,1],[36160,1],[36194,1],[36196,2],[36298,1],[36326,1],[36338,1],[36394,2],[36451,1],[36505,2],[36610,1],[36664,2],[36791,1],[36845,2],[36888,2],[36905,1],[36941,1],[36943,1],[36957,1],[36982,1],[37005,1],[37038,2],[37050,1],[37075,1],[37082,1],[37106,1],[37125,1],[37159,2],[37175,1],[37215,2],[37235,1],[37262,1],[37433,1],[37479,1],[37515,1],[37572,1],[37606,1],[37711,1],[37744,1],[37872,1],[37906,1],[37948,1],[37950,1],[38074,1],[38154,1],[38156,1],[38214,1],[38221,1],[38319,1],[38330,1],[38370,1],[38389,1],[38701,1],[38965,1],[39009,1],[39011,1],[39102,1],[39261,1],[39303,1],[39318,2],[39360,1],[39372,2],[39407,1],[39441,2],[39508,1],[39540,2]]}}}],["0.0.0.0:2112/metric",{"_index":1308,"t":{"159":{"position":[[85,21]]}}}],["0.0.0.0:4317",{"_index":1319,"t":{"161":{"position":[[242,13]]}}}],["0.2.0",{"_index":1288,"t":{"155":{"position":[[727,5]]}}}],["0.3.2",{"_index":1285,"t":{"155":{"position":[[645,5]]}}}],["0.4.0",{"_index":1979,"t":{"468":{"position":[[165,5]]}}}],["0.5.0",{"_index":1988,"t":{"468":{"position":[[1067,5]]}}}],["0001",{"_index":1871,"t":{"426":{"position":[[5058,5]]}}}],["01",{"_index":112,"t":{"3":{"position":[[1908,2],[2138,2],[2217,2],[2551,2]]}}}],["01t00:00:00z",{"_index":113,"t":{"3":{"position":[[1911,13]]}}}],["01t00:10:00z",{"_index":121,"t":{"3":{"position":[[2141,12],[2554,12]]}}}],["01t02:00:00z",{"_index":122,"t":{"3":{"position":[[2220,12]]}}}],["03",{"_index":2791,"t":{"801":{"position":[[35,3]]}}}],["06t15:32:11.128z",{"_index":2105,"t":{"588":{"position":[[1390,19],[2612,19],[4000,19],[5198,21],[6069,20],[6384,19],[7527,19],[8710,19],[10077,19],[11256,21],[12089,20],[12382,19],[13518,19],[14711,19],[16088,19],[17277,21],[18130,20],[18414,19]]},"705":{"position":[[1125,19],[2355,19],[3805,19],[5071,21],[5933,20],[6228,19]]}}}],["06t15:32:11.128z\"},{\"key",{"_index":2369,"t":{"705":{"position":[[1002,26],[2232,26],[3682,26],[4948,26],[5810,26],[6105,26]]}}}],["1",{"_index":236,"t":{"9":{"position":[[1049,3]]},"312":{"position":[[211,1],[300,1],[688,1]]},"468":{"position":[[0,1]]},"560":{"position":[[207,1]]},"588":{"position":[[294,2]]},"602":{"position":[[338,1]]},"769":{"position":[[10228,1]]},"789":{"position":[[267,1],[316,1],[368,1],[401,1],[480,1],[513,1]]},"795":{"position":[[74,1],[123,1],[452,2]]},"797":{"position":[[107,1],[2545,1],[2596,1]]},"799":{"position":[[2768,2],[17513,2]]}}}],["1.0",{"_index":704,"t":{"53":{"position":[[3329,3]]},"452":{"position":[[937,3]]},"454":{"position":[[143,4],[337,4]]},"456":{"position":[[32,3],[112,3]]},"458":{"position":[[13,3]]},"462":{"position":[[19,4],[3129,3],[3307,4]]},"466":{"position":[[509,4],[876,4],[1025,4]]},"468":{"position":[[133,3],[213,3],[499,3],[737,3],[1206,3]]}}}],["1.1",{"_index":93,"t":{"3":{"position":[[1494,3]]},"9":{"position":[[539,3]]},"37":{"position":[[93,3],[216,6],[1472,6]]},"47":{"position":[[162,3],[828,6]]},"53":{"position":[[307,3],[506,6]]},"61":{"position":[[888,3],[1079,6],[1817,3],[1914,6]]},"135":{"position":[[308,3],[349,3]]},"169":{"position":[[1664,3],[1916,6]]},"211":{"position":[[217,3],[258,3]]},"227":{"position":[[334,3],[473,6]]},"258":{"position":[[283,3],[360,6]]},"273":{"position":[[328,3],[455,6]]},"298":{"position":[[74,3],[262,6]]},"320":{"position":[[372,3],[533,6]]},"347":{"position":[[462,3],[597,6]]},"355":{"position":[[233,3],[391,6]]},"357":{"position":[[320,3],[494,6]]},"365":{"position":[[403,3],[505,6]]},"373":{"position":[[188,3],[300,6]]},"382":{"position":[[65,3],[198,6]]},"384":{"position":[[65,3],[201,6]]},"392":{"position":[[507,3],[625,6]]},"404":{"position":[[287,3],[479,6]]},"422":{"position":[[4117,3]]},"424":{"position":[[2864,3]]},"426":{"position":[[9216,3],[9728,3]]},"436":{"position":[[114,3],[152,4]]},"440":{"position":[[303,3],[405,6]]},"454":{"position":[[183,4],[273,3]]},"456":{"position":[[1301,3],[1534,3],[1827,5],[3071,5]]},"458":{"position":[[239,3],[491,3]]},"460":{"position":[[1354,3],[2968,5]]},"462":{"position":[[483,3],[785,3],[1139,5],[3194,3],[3461,3]]},"466":{"position":[[656,4],[820,3],[894,3]]},"468":{"position":[[745,3],[852,3],[1011,3]]},"474":{"position":[[714,3],[898,6]]},"484":{"position":[[197,3],[429,6]]},"492":{"position":[[350,3],[474,6]]},"500":{"position":[[332,3],[480,6]]},"502":{"position":[[136,3],[306,6]]},"514":{"position":[[293,3],[379,6]]},"530":{"position":[[308,3],[388,6]]},"538":{"position":[[187,3],[316,6]]},"550":{"position":[[272,3],[347,6]]},"558":{"position":[[97,3],[262,6]]},"572":{"position":[[376,3],[488,6]]},"610":{"position":[[328,3],[452,6]]},"617":{"position":[[161,3],[309,6]]},"625":{"position":[[98,3],[303,6]]},"645":{"position":[[267,3],[455,6]]},"649":{"position":[[78,3],[266,6]]},"651":{"position":[[139,3],[296,6]]},"661":{"position":[[887,3],[1316,6]]},"673":{"position":[[87,3],[654,6]]},"679":{"position":[[314,3],[411,6]]},"687":{"position":[[292,3],[389,6]]},"689":{"position":[[764,3],[928,6]]},"699":{"position":[[276,3],[380,6],[999,3],[1104,6]]},"701":{"position":[[278,3],[439,6]]},"707":{"position":[[138,3],[243,6]]},"724":{"position":[[625,3],[817,6]]},"728":{"position":[[7165,3],[7375,6],[23376,3],[23625,6],[31097,3],[31402,6],[40625,3],[40920,6]]},"745":{"position":[[304,3],[472,6],[1268,3],[1344,6],[30375,3],[30587,6]]},"747":{"position":[[363,3],[442,6],[797,3],[1074,6]]},"751":{"position":[[960,3],[1034,6],[1305,3],[1601,6],[23135,3],[23725,6]]},"761":{"position":[[544,3],[911,6]]},"773":{"position":[[87,3],[820,6]]},"775":{"position":[[239,3],[1033,6]]},"793":{"position":[[664,3],[820,6]]},"797":{"position":[[1171,3],[1443,6]]},"799":{"position":[[796,3],[1212,6]]},"801":{"position":[[652,3],[1038,6]]},"819":{"position":[[1018,3],[1178,6]]},"821":{"position":[[590,3],[750,6]]},"823":{"position":[[6371,3],[6581,6]]},"825":{"position":[[4497,3],[4991,6]]},"844":{"position":[[389,3],[537,6],[30415,3],[30595,6]]},"846":{"position":[[420,3],[704,6]]},"848":{"position":[[494,3],[760,6],[16519,3],[16919,6]]},"850":{"position":[[565,3],[973,6]]}}}],["1.3.1",{"_index":1292,"t":{"155":{"position":[[833,5]]}}}],["1.4.0",{"_index":161,"t":{"7":{"position":[[56,5]]}}}],["10",{"_index":1649,"t":{"329":{"position":[[11366,2]]},"588":{"position":[[1387,2],[2609,2],[3997,2],[5195,2],[6066,2],[6381,2],[7524,2],[8707,2],[10074,2],[11253,2],[12086,2],[12379,2],[13515,2],[14708,2],[16085,2],[17274,2],[18127,2],[18411,2]]},"602":{"position":[[400,3],[437,2]]},"705":{"position":[[999,2],[1122,2],[2229,2],[2352,2],[3679,2],[3802,2],[4945,2],[5068,2],[5807,2],[5930,2],[6102,2],[6225,2]]}}}],["10.0.0.0/16",{"_index":2643,"t":{"769":{"position":[[11378,11],[13043,11],[14986,11],[16601,11],[18514,11],[19629,11],[20931,11],[22668,11],[24030,11],[25386,11]]},"771":{"position":[[1009,11],[1854,11],[3211,11],[5003,11],[6421,11],[7758,11]]},"773":{"position":[[5707,11],[9251,11],[12632,11],[15676,11],[20870,11]]}}}],["100",{"_index":788,"t":{"73":{"position":[[713,4]]},"131":{"position":[[1048,4]]},"296":{"position":[[3278,4]]},"310":{"position":[[1070,5]]}}}],["1000",{"_index":1565,"t":{"282":{"position":[[70,4]]},"602":{"position":[[182,6]]}}}],["10am",{"_index":2686,"t":{"773":{"position":[[4781,4],[4925,4],[7971,4],[8174,4],[11646,4],[11800,4],[14696,4],[14849,4],[19920,4],[20068,4]]}}}],["11am",{"_index":2638,"t":{"769":{"position":[[11051,4],[12598,4],[14639,4],[16256,4],[18179,4]]},"773":{"position":[[4933,4],[5078,4],[8182,4],[8386,4],[11808,4],[11963,4],[14857,4],[15011,4],[20076,4],[20225,4]]}}}],["128",{"_index":1204,"t":{"145":{"position":[[3167,3],[3219,3]]}}}],["12pm",{"_index":2613,"t":{"763":{"position":[[93,4],[179,4],[329,4]]},"769":{"position":[[11059,4],[11204,4],[12606,4],[12810,4],[14647,4],[14802,4],[16264,4],[16418,4],[18187,4],[18336,4],[19768,4],[21129,4],[22817,4],[24178,4],[25529,4]]},"771":{"position":[[1066,4],[2020,4],[3436,4],[5179,4],[6596,4],[7928,4]]},"773":{"position":[[5086,4],[5231,4],[8394,4],[8598,4],[11971,4],[12126,4],[15019,4],[15173,4],[20233,4],[20382,4]]}}}],["13th",{"_index":1976,"t":{"468":{"position":[[12,4]]}}}],["15th",{"_index":1978,"t":{"468":{"position":[[86,4],[1022,4]]}}}],["1h",{"_index":114,"t":{"3":{"position":[[1942,2]]}}}],["1pm",{"_index":2640,"t":{"769":{"position":[[11212,3],[12818,3],[14810,3],[16426,3],[18344,3],[19777,3],[21138,3],[22826,3],[24187,3],[25538,3]]},"771":{"position":[[1075,3],[2029,3],[3445,3],[5188,3],[6605,3],[7937,3]]},"773":{"position":[[5239,3],[5383,3],[8606,3],[8809,3],[12134,3],[12288,3],[15181,3],[15334,3],[20390,3],[20538,3]]}}}],["1s",{"_index":2160,"t":{"602":{"position":[[304,3]]}}}],["1uhxcsutp0vkpysnkq1pbb1jezw",{"_index":479,"t":{"37":{"position":[[1891,29],[3553,29],[5266,29],[6886,29]]},"99":{"position":[[260,30],[688,30],[943,29],[1500,30]]},"125":{"position":[[239,30],[784,30],[1085,29],[1743,30]]},"169":{"position":[[13087,30],[15383,30],[16551,29],[17484,30],[17834,29],[19281,30],[21577,30],[22745,29],[23678,30],[24028,29],[25609,30],[28012,30],[29216,29],[30230,30],[30575,30]]},"236":{"position":[[892,29],[3285,30],[4471,29],[5183,31]]},"238":{"position":[[925,30],[3218,30],[4383,29],[5310,30],[5651,29],[6670,30],[8966,30],[10133,29],[11064,30],[11409,29]]},"250":{"position":[[223,29],[755,30],[1035,29],[1673,31]]},"252":{"position":[[379,29],[912,30],[1193,29],[1797,31]]},"265":{"position":[[1215,30],[3498,30],[4653,29],[5560,30],[5871,29]]},"267":{"position":[[908,29],[3296,30],[4477,29],[5181,31],[6630,30],[8915,30],[10071,29],[10980,30],[11292,29]]},"273":{"position":[[2225,30],[4515,30],[5676,29],[6595,30],[6922,29],[7882,29],[10312,30],[11535,29],[12281,31],[13892,30],[16185,30],[17350,29],[18277,30],[18618,29],[19495,30],[21791,30],[22958,29],[23889,30],[24234,29]]},"282":{"position":[[1153,29],[3545,30],[4730,29],[5442,31]]},"284":{"position":[[968,30],[3263,30],[4429,29],[5358,30],[5700,29]]},"329":{"position":[[990,29],[3374,30],[4551,29],[5245,31],[6572,29],[8957,30],[10135,29],[10833,31],[12555,29],[15184,30],[16568,29],[17543,31]]},"353":{"position":[[1065,30],[3359,30],[4525,29],[5454,30],[5798,29],[6674,30],[8967,30],[10132,29],[11059,30],[11400,29]]},"359":{"position":[[1219,29],[3671,30],[4916,29],[5691,31],[7359,30],[9654,30],[10820,29],[11749,30],[12091,29],[13174,30],[15468,30],[16634,29],[17563,30],[17907,29]]},"375":{"position":[[1106,30],[3407,30],[4580,29],[5523,30],[5888,29]]},"382":{"position":[[2041,30],[4332,30],[5495,29],[6418,30],[6753,29]]},"406":{"position":[[1188,29],[3805,30],[5166,29],[6130,31],[7803,30],[10099,30],[11267,29],[12200,30],[12550,29]]},"408":{"position":[[1200,29],[3927,30],[5398,29],[6508,31]]},"410":{"position":[[897,30],[3193,30],[4361,29],[5294,30],[5644,29]]},"446":{"position":[[966,29],[3371,30],[4569,29],[5305,31]]},"448":{"position":[[1006,30],[3307,30],[4480,29],[5423,30],[5788,29],[6843,30],[9146,30],[10320,29],[11265,30],[11631,29]]},"466":{"position":[[1364,29],[1913,30],[2210,29],[2772,31]]},"482":{"position":[[1068,30],[3365,30],[4534,29],[5469,30],[5822,29],[6701,30],[8997,30],[10165,29],[11098,30],[11448,29]]},"486":{"position":[[1029,30],[3327,30],[4497,29],[5434,30],[5790,29],[6827,30],[9126,30],[10296,29],[11233,30],[11587,29]]},"504":{"position":[[927,29],[3318,30],[4502,29],[5210,31]]},"506":{"position":[[1009,29],[3480,30],[4744,29],[5549,31]]},"508":{"position":[[1079,30],[3380,30],[4553,29],[5496,30],[5861,29]]},"522":{"position":[[1165,29],[3608,30],[4844,29],[5611,31]]},"524":{"position":[[1207,30],[3504,30],[4673,29],[5608,30],[5961,29]]},"540":{"position":[[938,29],[3331,30],[4517,29],[5229,31]]},"542":{"position":[[1348,29],[3818,30],[5081,29],[5892,31]]},"544":{"position":[[1141,30],[3444,30],[4619,29],[5566,30],[5937,29]]},"556":{"position":[[1068,29],[3571,30],[4818,29],[5641,31]]},"560":{"position":[[1071,29],[3570,30],[4813,29],[5628,31]]},"562":{"position":[[1034,29],[3426,30],[4611,29],[5321,31]]},"564":{"position":[[893,30],[3175,30],[4329,29],[5234,30],[5542,29],[6407,30],[8689,30],[9843,29],[10748,30],[11056,29]]},"566":{"position":[[909,29],[3293,30],[4470,29],[5166,31],[6467,30],[8751,30],[9906,29],[10813,30],[11122,29]]},"581":{"position":[[1062,30],[3354,30],[4518,29],[5443,30],[5781,29]]},"595":{"position":[[1097,29],[3450,30],[4676,29],[5660,31],[7009,29],[9362,30],[10588,29],[11572,31]]},"600":{"position":[[1059,30],[3571,30],[4896,29],[6066,30],[6526,30]]},"619":{"position":[[1283,29],[3792,30],[5094,29],[5936,31]]},"621":{"position":[[1016,30],[3320,30],[4496,29],[5445,30],[5819,29]]},"627":{"position":[[1107,29],[3774,30],[5185,29],[6217,31]]},"629":{"position":[[937,30],[3233,30],[4401,29],[5334,30],[5684,29]]},"631":{"position":[[963,29],[3427,30],[4684,29],[5489,31],[6976,30],[9274,30],[10443,29],[11378,30],[11729,29],[12613,30],[14913,30],[16085,29],[17026,30],[17388,29]]},"649":{"position":[[2194,30],[4487,30],[5652,29],[6579,30],[6920,29],[8366,30],[10659,30],[11824,29],[12751,30],[13092,29],[15190,30],[17486,30],[18654,29],[19587,30],[19937,29],[22024,30],[24317,30],[25482,29],[26409,30],[26750,29],[28261,30],[30555,30],[31721,29],[32650,30],[32994,29]]},"651":{"position":[[2167,30],[4462,30],[5628,29],[6557,30],[6899,29],[8419,30],[10717,30],[11886,29],[12821,30],[13172,29],[14761,30],[17057,30],[18224,29],[19155,30],[19500,29],[21085,30],[23380,30],[24547,29],[25478,30],[25825,29]]},"661":{"position":[[4139,29],[5833,30],[6981,29],[8821,31]]},"667":{"position":[[422,30],[851,30],[1107,29],[1666,30],[1989,29],[2255,30],[2686,30],[2944,29],[3507,30],[3836,29],[4112,30],[4541,30],[4797,29],[5356,30],[5679,29],[5950,30],[6383,30],[6642,29],[7207,30],[7537,29],[7805,30],[8236,30],[8493,29],[9054,30],[9378,29],[9650,30],[10083,30],[10342,29],[10907,30],[11237,29]]},"669":{"position":[[3000,30],[3431,30],[3688,29],[4249,30],[4573,29],[5611,29],[8072,30],[9326,29],[10115,31],[10890,30],[11319,30],[11575,29],[12134,30],[12457,29]]},"671":{"position":[[2030,29],[4519,30],[5801,29],[6621,31],[7543,30],[8089,30],[8474,29],[9205,30],[9778,29],[10214,30],[10762,30],[11148,29],[11881,30],[12455,29]]},"673":{"position":[[3678,29],[5372,30],[6520,29],[8360,31]]},"691":{"position":[[1298,29],[3885,30],[5216,29],[6132,31],[7735,30],[10029,30],[11195,29],[12124,30],[12468,29],[13729,30],[16024,30],[17190,29],[18119,30],[18461,29],[19418,30],[21714,30],[22882,29],[23815,30],[24165,29],[25043,30],[27338,30],[28505,29],[29436,30],[29783,29]]},"701":{"position":[[1883,30],[4178,30],[5345,29],[6276,30],[6623,29],[7500,30],[9794,30],[10960,29],[11889,30],[12233,29]]},"703":{"position":[[1033,29],[3477,30],[4714,29],[5482,31],[6894,30],[9192,30],[10362,29],[11299,30],[11655,29]]},"705":{"position":[[7310,29],[9838,30],[11110,29],[11983,31],[13573,29],[16102,30],[17375,29],[18252,31],[19823,30],[22118,30],[23285,29],[24216,30],[24563,29],[25483,30],[27777,30],[28942,29],[29869,30],[30208,29]]},"726":{"position":[[1841,29],[5374,30],[7455,29],[9467,31],[12699,29],[15595,30],[17186,29],[18464,31],[20766,29],[23592,30],[25113,29],[26306,31],[29074,30],[31368,30],[32534,29],[33463,30],[33807,29],[34833,30],[37129,30],[38296,29],[39227,30],[39572,29],[40454,30],[42752,30],[43922,29],[44859,30],[45215,29],[46097,30],[48396,30],[49567,29],[50506,30],[50865,29]]},"728":{"position":[[1112,30],[3412,30],[4579,29],[5510,30],[5847,29],[9031,30],[11323,30],[12486,29],[13409,30],[13742,29],[14957,30],[17258,30],[18430,29],[19371,30],[19731,29],[25399,30],[27698,30],[28869,29],[29808,30],[30167,29],[33638,30],[35928,30],[37090,29],[38011,30],[38343,29],[43198,30],[45488,30],[46650,29],[47571,30],[47903,29]]},"745":{"position":[[2630,29],[5030,30],[6223,29],[6949,31],[8333,30],[10629,30],[11797,29],[12730,30],[13080,29],[14004,29],[16404,30],[17597,29],[18323,31],[19664,30],[21960,30],[23128,29],[24061,30],[24411,29],[25290,30],[27588,30],[28757,29],[29692,30],[30043,29],[33024,30],[35320,30],[36488,29],[37421,30],[37771,29],[38650,30],[40946,30],[42114,29],[43047,30],[43397,29]]},"747":{"position":[[3388,29],[6076,30],[7508,29],[8572,31],[10494,30],[12792,30],[13962,29],[14899,30],[15255,29]]},"749":{"position":[[1128,29],[3552,30],[4769,29],[5543,31],[7401,29],[9857,30],[11106,29],[11890,31],[13255,30],[15551,30],[16719,29],[17652,30],[18002,29]]},"751":{"position":[[3885,29],[6428,30],[7715,29],[8618,31],[10703,30],[13008,30],[14180,29],[15121,30],[15473,29],[18141,29],[20563,30],[21778,29],[22548,31]]},"761":{"position":[[3926,29],[7022,30],[8764,29],[10277,31]]},"767":{"position":[[1248,30],[3539,30],[4702,29],[5625,30],[5960,29],[6940,30],[9235,30],[10402,29],[11333,30],[11680,29],[12706,29],[15165,30],[16417,29],[17206,31],[18571,30],[20864,30],[22028,29],[22953,30],[23289,29]]},"769":{"position":[[5358,30],[7646,30],[8805,29],[9720,30],[10041,29],[11581,29],[14526,30],[16166,29],[17540,31],[19879,29],[22520,30],[23905,29],[24892,31],[26650,30],[28941,30],[30104,29],[31027,30],[31362,29]]},"771":{"position":[[2131,29],[4827,30],[6267,29],[7312,31],[9514,30],[11993,30],[13357,29],[14566,30],[15290,29],[16440,30],[18921,30],[20286,29],[21497,30],[22222,29]]},"773":{"position":[[5910,29],[10734,30],[13812,29],[17352,31]]},"795":{"position":[[1315,29],[3714,30],[4906,29],[5630,31],[6967,29],[9370,30],[10566,29],[11298,31],[12794,29],[15458,30],[16817,29],[17853,31],[19900,30],[22195,30],[23362,29],[24293,30],[24640,29],[25596,30],[27890,30],[29055,29],[29982,30],[30321,29]]},"797":{"position":[[3933,29],[6709,30],[8131,29],[9282,31],[11231,30],[13529,30],[14699,29],[15636,30],[15992,29]]},"799":{"position":[[3726,29],[6272,30],[7562,29],[8471,31],[10446,29],[13305,30],[14810,29],[16127,31],[18409,30],[20701,30],[21865,29],[22790,30],[23128,29]]},"801":{"position":[[3983,29],[6650,30],[8012,29],[9054,31],[11105,30],[13403,30],[14572,29],[15507,30],[15858,29]]},"821":{"position":[[2931,29],[5389,30],[6640,29],[7428,31],[8874,30],[11175,30],[12348,29],[13291,30],[13656,29],[14642,29],[17100,30],[18351,29],[19139,31],[20542,30],[22843,30],[24016,29],[24959,30],[25324,29],[26291,30],[28600,30],[29780,29],[30737,30],[31121,29],[32730,29],[35556,30],[37077,29],[38282,31],[40246,30],[42547,30],[43720,29],[44663,30],[45028,29]]},"823":{"position":[[952,30],[3249,30],[4417,29],[5350,30],[5698,29],[8234,30],[10529,30],[11696,29],[12627,30],[12974,29]]},"825":{"position":[[7925,29],[10666,30],[12102,29],[13292,31],[15445,29],[17972,30],[19292,29],[20157,31],[21932,29],[24562,30],[25936,29],[26905,31],[28681,29],[31226,30],[32515,29],[33422,31],[35108,29],[37537,30],[38759,29],[39543,31],[40978,29],[43390,30],[44595,29],[45345,31],[46882,30],[49176,30],[50341,29],[51268,30],[51607,29],[52569,30],[54877,30],[56057,29],[57014,30],[57400,29]]},"844":{"position":[[2634,29],[5037,30],[6233,29],[6965,31],[8361,30],[10660,30],[11831,29],[12770,30],[13129,29],[14050,29],[16449,30],[17641,29],[18365,31],[19703,30],[21998,30],[23165,29],[24096,30],[24443,29],[25322,30],[27620,30],[28789,29],[29724,30],[30075,29],[32543,30],[34838,30],[36005,29],[36936,30],[37283,29],[38162,30],[40458,30],[41626,29],[42559,30],[42909,29]]},"846":{"position":[[3234,29],[6131,30],[7674,29],[8948,31],[11169,30],[13468,30],[14639,29],[15578,30],[15937,29]]},"848":{"position":[[2946,29],[5604,30],[7006,29],[8028,31],[10080,30],[12387,30],[13561,29],[14506,30],[14864,29]]},"850":{"position":[[3992,29],[6882,30],[8467,29],[9759,31],[11756,30],[14059,30],[15234,29],[16181,30],[16552,29],[17515,30],[19821,30],[20998,29],[21949,30],[22324,29],[23215,30],[25522,30],[26701,29],[27656,30],[28039,29],[29004,30],[31310,30],[32487,29],[33438,30],[33813,29],[34701,30],[37007,30],[38184,29],[39135,30],[39510,29]]}}}],["2",{"_index":238,"t":{"9":{"position":[[1102,3]]},"131":{"position":[[1066,1]]},"312":{"position":[[497,1],[598,1],[693,1]]},"468":{"position":[[77,1]]},"560":{"position":[[213,2]]},"588":{"position":[[6404,2]]},"789":{"position":[[420,1]]},"799":{"position":[[9261,1],[17493,1]]}}}],["20",{"_index":1218,"t":{"145":{"position":[[4550,3]]}}}],["2021",{"_index":2104,"t":{"588":{"position":[[1381,5],[2603,5],[3991,5],[5189,5],[6060,5],[6375,5],[7518,5],[8701,5],[10068,5],[11247,5],[12080,5],[12373,5],[13509,5],[14702,5],[16079,5],[17268,5],[18121,5],[18405,5]]},"705":{"position":[[993,5],[1116,5],[2223,5],[2346,5],[3673,5],[3796,5],[4939,5],[5062,5],[5801,5],[5924,5],[6096,5],[6219,5]]},"841":{"position":[[219,4],[337,4],[394,4],[417,4]]},"850":{"position":[[203,4]]}}}],["2023",{"_index":111,"t":{"3":{"position":[[1903,4],[2133,4],[2212,4],[2546,4]]},"27":{"position":[[56,4]]},"468":{"position":[[17,5],[91,5],[771,5],[1027,5]]}}}],["2048",{"_index":960,"t":{"111":{"position":[[2122,5]]},"113":{"position":[[3363,5]]}}}],["25",{"_index":1571,"t":{"296":{"position":[[154,3],[570,3],[722,3],[1045,4],[1092,2],[1654,3],[2208,3],[2480,3],[3045,4]]},"298":{"position":[[1145,3],[1593,3],[1753,3],[2107,4],[2510,3],[3096,3],[3376,3],[3972,4]]}}}],["256",{"_index":1206,"t":{"145":{"position":[[3193,4],[3245,4],[3266,3]]}}}],["2pm",{"_index":2689,"t":{"773":{"position":[[5390,3],[5534,3],[8816,3],[9019,3],[12295,3],[12449,3],[15341,3],[15494,3],[20545,3],[20693,3]]}}}],["3",{"_index":1629,"t":{"312":{"position":[[492,1]]},"462":{"position":[[1797,1]]},"468":{"position":[[757,1]]},"588":{"position":[[12402,2]]},"598":{"position":[[218,2]]},"719":{"position":[[98,1]]},"789":{"position":[[433,2]]},"799":{"position":[[9267,2]]}}}],["3.8",{"_index":1180,"t":{"145":{"position":[[1597,5],[4244,5]]}}}],["3000",{"_index":1142,"t":{"141":{"position":[[428,4]]},"149":{"position":[[232,4],[332,4]]}}}],["3000:3000",{"_index":171,"t":{"7":{"position":[[196,9]]},"141":{"position":[[229,9]]},"145":{"position":[[1343,9],[2665,11],[4010,9],[5296,11]]},"147":{"position":[[1466,9],[2985,9]]},"151":{"position":[[342,9],[588,9]]}}}],["3001",{"_index":1259,"t":{"151":{"position":[[475,5]]}}}],["3001:3001",{"_index":1258,"t":{"151":{"position":[[355,9]]}}}],["3002",{"_index":1262,"t":{"151":{"position":[[666,5]]}}}],["3002:3002",{"_index":1261,"t":{"151":{"position":[[601,9]]}}}],["3060",{"_index":1356,"t":{"169":{"position":[[4269,4],[4783,4]]}}}],["31st",{"_index":1986,"t":{"468":{"position":[[766,4]]}}}],["3306:3306",{"_index":1212,"t":{"145":{"position":[[4352,11]]}}}],["3pm",{"_index":392,"t":{"27":{"position":[[857,3]]},"761":{"position":[[2519,3]]},"773":{"position":[[5541,3],[9026,3],[12456,3],[15501,3],[20700,3]]}}}],["3s",{"_index":2158,"t":{"602":{"position":[[98,3]]}}}],["4",{"_index":1987,"t":{"468":{"position":[[1015,1]]},"805":{"position":[[42,1]]}}}],["41f4",{"_index":1357,"t":{"169":{"position":[[4274,4],[4788,4]]}}}],["42c8",{"_index":2454,"t":{"726":{"position":[[27839,4]]}}}],["4930",{"_index":1364,"t":{"169":{"position":[[4724,4]]}}}],["4d5c",{"_index":2459,"t":{"726":{"position":[[27909,4]]}}}],["4da68ce1846c",{"_index":1382,"t":{"169":{"position":[[8126,12],[8934,13]]}}}],["4e93",{"_index":1380,"t":{"169":{"position":[[8116,4],[8924,4]]}}}],["4fa7",{"_index":1379,"t":{"169":{"position":[[8111,4],[8919,4]]}}}],["5",{"_index":1191,"t":{"145":{"position":[[1889,1],[4563,1]]},"745":{"position":[[11,1]]},"805":{"position":[[48,2]]}}}],["50",{"_index":749,"t":{"67":{"position":[[247,2]]},"131":{"position":[[1137,2]]},"296":{"position":[[3241,3]]}}}],["512",{"_index":1207,"t":{"145":{"position":[[3292,4]]}}}],["526",{"_index":2573,"t":{"761":{"position":[[2300,3],[2372,3],[2420,3],[3491,3],[3568,6],[3646,3],[3744,6],[3778,3],[3841,5],[5189,3],[5320,6],[5403,3],[5555,6],[5594,3],[5673,6],[7332,3],[7418,4],[7497,3],[7604,4],[7639,3],[7709,5],[9050,3],[9122,5],[9214,3],[9307,5],[9355,3],[9415,5],[10734,3],[10861,3],[10964,3],[11192,3],[11272,4],[11351,3],[11452,4],[11487,3],[11551,5]]},"773":{"position":[[4219,3],[4296,6],[4374,3],[4472,6],[4506,3],[4569,5],[7173,3],[7304,6],[7387,3],[7539,6],[7578,3],[7657,6],[11044,3],[11130,4],[11209,3],[11316,4],[11351,3],[11421,5],[14098,3],[14170,5],[14262,3],[14355,5],[14403,3],[14463,5],[17809,3],[17936,3],[18039,3],[19342,3],[19422,4],[19501,3],[19602,4],[19637,3],[19701,5]]}}}],["526\",\"relation\":\"account\",\"object\":\"transaction:a",{"_index":2602,"t":{"761":{"position":[[10195,52]]}}}],["526\",\"relation\":\"account\",\"object\":\"transaction:a\"},{\"user\":\"timeslot:8_9\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west",{"_index":2702,"t":{"773":{"position":[[16571,127]]}}}],["526\"},{\"user\":\"account:check",{"_index":2601,"t":{"761":{"position":[[10163,31]]},"773":{"position":[[16539,31]]}}}],["526\"},{\"user\":\"branch:west",{"_index":2599,"t":{"761":{"position":[[10083,26]]},"773":{"position":[[16459,26]]}}}],["5432:5432",{"_index":1182,"t":{"145":{"position":[[1715,11]]}}}],["5570c7bf6f59",{"_index":1366,"t":{"169":{"position":[[4734,12]]}}}],["5s",{"_index":1188,"t":{"145":{"position":[[1865,2],[1877,2]]}}}],["6pm",{"_index":2615,"t":{"763":{"position":[[379,3]]}}}],["7c9c",{"_index":2453,"t":{"726":{"position":[[27834,4]]}}}],["8080",{"_index":1139,"t":{"141":{"position":[[352,4]]}}}],["8080:8080",{"_index":169,"t":{"7":{"position":[[170,9]]},"141":{"position":[[203,9]]},"145":{"position":[[1356,9],[2545,11],[4023,9],[5176,11]]},"147":{"position":[[1479,9],[2998,9]]},"151":{"position":[[316,9],[562,9]]},"155":{"position":[[160,9],[296,9]]}}}],["8081",{"_index":1141,"t":{"141":{"position":[[388,4]]}}}],["8081:8081",{"_index":170,"t":{"7":{"position":[[183,9]]},"141":{"position":[[216,9]]},"145":{"position":[[1369,9],[2598,11],[4036,9],[5229,11]]},"147":{"position":[[1492,9],[3011,9]]},"151":{"position":[[329,9],[575,9]]},"155":{"position":[[173,9],[309,9]]}}}],["8417",{"_index":1381,"t":{"169":{"position":[[8121,4],[8929,4]]}}}],["88fd",{"_index":1365,"t":{"169":{"position":[[4729,4]]}}}],["8am",{"_index":394,"t":{"27":{"position":[[865,4]]},"761":{"position":[[2515,3]]},"773":{"position":[[4625,3],[7756,3],[11480,3],[14531,3],[19760,3]]}}}],["9.30",{"_index":376,"t":{"27":{"position":[[498,4]]}}}],["911002051524",{"_index":2456,"t":{"726":{"position":[[27849,12]]}}}],["9329",{"_index":2455,"t":{"726":{"position":[[27844,4]]}}}],["9590",{"_index":1358,"t":{"169":{"position":[[4279,4],[4793,4]]}}}],["9am",{"_index":2684,"t":{"773":{"position":[[4632,3],[4774,3],[7763,3],[7964,3],[11487,3],[11639,3],[14538,3],[14689,3],[19767,3],[19913,3]]}}}],["9th",{"_index":391,"t":{"27":{"position":[[850,3]]}}}],["_",{"_index":1841,"t":{"424":{"position":[[2606,3]]}}}],["_object",{"_index":2148,"t":{"600":{"position":[[3795,8]]},"671":{"position":[[8323,8],[10996,8]]},"771":{"position":[[12220,8],[12303,8],[19148,8],[19231,8]]}}}],["_thi",{"_index":731,"t":{"61":{"position":[[502,5],[626,5]]}}}],["a/an",{"_index":1831,"t":{"424":{"position":[[607,4]]}}}],["a/an/th",{"_index":1827,"t":{"424":{"position":[[430,8]]}}}],["a/th",{"_index":1820,"t":{"422":{"position":[[2113,5],[2158,5]]}}}],["abac",{"_index":256,"t":{"13":{"position":[[71,5]]},"21":{"position":[[504,5]]}}}],["abc",{"_index":1992,"t":{"474":{"position":[[522,3],[565,3],[1600,3],[2014,3]]}}}],["abil",{"_index":1659,"t":{"331":{"position":[[11,7]]},"353":{"position":[[11513,7]]},"655":{"position":[[396,7]]},"751":{"position":[[9334,7]]},"755":{"position":[[428,7]]},"815":{"position":[[156,7],[330,10]]},"848":{"position":[[8865,7]]}}}],["abov",{"_index":152,"t":{"5":{"position":[[172,7]]},"49":{"position":[[1852,6]]},"51":{"position":[[635,5],[1339,6]]},"53":{"position":[[1276,5],[1910,6]]},"55":{"position":[[531,6],[935,5]]},"57":{"position":[[608,6],[999,5]]},"59":{"position":[[635,6],[1098,5]]},"107":{"position":[[95,6]]},"131":{"position":[[1288,7]]},"133":{"position":[[1680,6]]},"143":{"position":[[240,5]]},"145":{"position":[[726,6],[3419,6]]},"265":{"position":[[234,6]]},"273":{"position":[[1240,5]]},"284":{"position":[[9,5]]},"300":{"position":[[848,6]]},"310":{"position":[[46,5]]},"353":{"position":[[9,5]]},"384":{"position":[[1220,6]]},"402":{"position":[[48,6]]},"422":{"position":[[4265,5]]},"424":{"position":[[3387,5]]},"456":{"position":[[1480,5]]},"460":{"position":[[15,6]]},"462":{"position":[[294,6]]},"464":{"position":[[568,5]]},"482":{"position":[[9,5]]},"524":{"position":[[9,5]]},"558":{"position":[[1128,6]]},"649":{"position":[[49,6],[27115,6]]},"661":{"position":[[3097,5]]},"665":{"position":[[39,6]]},"667":{"position":[[59,6]]},"724":{"position":[[283,6],[357,6]]},"728":{"position":[[30424,6],[30985,5]]},"761":{"position":[[2531,5]]},"765":{"position":[[39,6]]},"767":{"position":[[59,6]]},"769":{"position":[[1119,5],[25683,5]]},"771":{"position":[[826,5]]},"821":{"position":[[1694,5]]},"825":{"position":[[1627,6],[2732,5]]},"844":{"position":[[1456,5]]},"848":{"position":[[1851,6]]}}}],["academi",{"_index":342,"t":{"25":{"position":[[409,8]]},"61":{"position":[[2747,8]]}}}],["accept",{"_index":556,"t":{"37":{"position":[[8331,7]]},"45":{"position":[[452,8]]},"61":{"position":[[16,8]]},"69":{"position":[[70,6]]},"169":{"position":[[3004,8]]},"422":{"position":[[4310,8]]},"424":{"position":[[3432,8]]},"426":{"position":[[6725,7],[10292,7]]},"468":{"position":[[194,6],[541,8]]},"707":{"position":[[569,6]]}}}],["access",{"_index":9,"t":{"3":{"position":[[105,6],[285,6],[1315,6],[1426,6],[1436,6]]},"5":{"position":[[108,6],[186,6],[234,6],[298,6]]},"9":{"position":[[477,6],[859,6]]},"19":{"position":[[67,6],[288,6],[383,6],[493,6]]},"21":{"position":[[14,6],[170,6]]},"25":{"position":[[119,6]]},"39":{"position":[[274,6]]},"49":{"position":[[1725,6]]},"53":{"position":[[3132,6]]},"63":{"position":[[280,6],[313,6]]},"73":{"position":[[651,6]]},"97":{"position":[[3238,6]]},"107":{"position":[[419,6]]},"111":{"position":[[191,6],[788,6]]},"113":{"position":[[4480,6],[5614,6]]},"123":{"position":[[3238,6]]},"149":{"position":[[252,10]]},"169":{"position":[[4487,7],[5203,7],[7511,7],[9471,7],[31473,8],[31512,6],[32267,6]]},"201":{"position":[[30,6]]},"203":{"position":[[151,6]]},"223":{"position":[[12,6],[64,6],[116,6],[159,6]]},"225":{"position":[[59,6],[329,6],[392,6],[457,6],[565,6]]},"227":{"position":[[1026,6]]},"229":{"position":[[61,6]]},"248":{"position":[[3238,6]]},"254":{"position":[[92,6],[130,6],[181,6],[229,6]]},"256":{"position":[[49,6],[101,6]]},"258":{"position":[[635,7],[745,6]]},"260":{"position":[[102,6]]},"269":{"position":[[60,7],[75,6],[121,6],[163,6],[211,7]]},"271":{"position":[[181,6],[256,6],[343,6],[435,6],[611,6]]},"273":{"position":[[24363,6],[24412,7],[24457,6]]},"275":{"position":[[61,6]]},"277":{"position":[[37,6]]},"282":{"position":[[171,6]]},"286":{"position":[[145,6],[179,7]]},"294":{"position":[[3121,6]]},"300":{"position":[[131,6],[337,8]]},"304":{"position":[[190,6]]},"308":{"position":[[72,6],[222,7]]},"310":{"position":[[211,6],[273,6],[604,6],[685,6],[817,6],[1050,6],[1139,6],[1228,6],[2031,6],[2113,6],[2842,6],[3016,6],[3098,6],[3273,6],[3366,6],[3587,6]]},"312":{"position":[[82,6],[121,6],[240,6],[396,7],[437,6],[524,6],[661,6]]},"316":{"position":[[126,6],[189,6],[287,6],[505,6],[631,6],[707,6],[754,6],[901,7]]},"320":{"position":[[1142,7],[1252,6],[1302,7],[1347,6]]},"322":{"position":[[102,6]]},"324":{"position":[[37,6]]},"345":{"position":[[60,9],[126,9],[279,6],[309,6],[679,6],[743,6],[797,6]]},"347":{"position":[[1656,6]]},"349":{"position":[[61,6]]},"353":{"position":[[11543,7],[11679,7],[11815,9],[12094,6]]},"355":{"position":[[36,9]]},"359":{"position":[[155,6],[6452,6],[12224,7],[12260,6],[18029,6],[18055,6]]},"361":{"position":[[224,6],[256,7]]},"365":{"position":[[1158,6]]},"367":{"position":[[61,6]]},"380":{"position":[[369,6]]},"388":{"position":[[125,6]]},"390":{"position":[[555,6],[800,6]]},"392":{"position":[[257,6],[471,6],[1167,6]]},"394":{"position":[[111,6]]},"396":{"position":[[61,6]]},"402":{"position":[[1037,6]]},"414":{"position":[[30,6]]},"416":{"position":[[385,6]]},"424":{"position":[[156,6]]},"432":{"position":[[203,6],[236,6]]},"438":{"position":[[49,6],[131,6]]},"444":{"position":[[51,6]]},"452":{"position":[[653,6]]},"462":{"position":[[48,6],[1548,6],[3048,6]]},"464":{"position":[[344,7]]},"466":{"position":[[408,6]]},"472":{"position":[[626,7]]},"474":{"position":[[657,6],[2442,6]]},"476":{"position":[[30,6]]},"488":{"position":[[65,7],[217,6],[249,7]]},"490":{"position":[[670,6],[832,6],[937,6]]},"492":{"position":[[919,7],[1029,6]]},"494":{"position":[[102,6]]},"498":{"position":[[84,6],[117,6]]},"508":{"position":[[6725,6]]},"510":{"position":[[396,6]]},"512":{"position":[[49,6],[122,7],[149,6],[214,6],[293,6]]},"514":{"position":[[689,7],[799,6],[1450,7]]},"516":{"position":[[102,6]]},"518":{"position":[[599,7]]},"522":{"position":[[78,7],[108,6],[6182,6]]},"528":{"position":[[73,6],[347,6],[410,6],[475,6],[583,6]]},"530":{"position":[[666,7],[776,6]]},"532":{"position":[[102,6]]},"536":{"position":[[443,6]]},"548":{"position":[[49,6],[147,6]]},"550":{"position":[[619,7],[729,6]]},"552":{"position":[[102,6]]},"572":{"position":[[1090,7],[1200,6]]},"574":{"position":[[102,6]]},"593":{"position":[[201,7]]},"598":{"position":[[234,6]]},"602":{"position":[[607,6]]},"604":{"position":[[465,6]]},"610":{"position":[[973,6]]},"612":{"position":[[61,6]]},"625":{"position":[[173,7],[423,9],[717,9],[1034,7],[1112,6],[1135,6],[1172,6],[1401,6],[1792,6],[2022,6]]},"629":{"position":[[866,9],[1960,9],[3334,9],[4873,6],[5552,9],[5572,8],[5760,6]]},"631":{"position":[[6048,6],[6905,9],[8000,9],[9375,9],[10916,6],[11597,9],[11617,8]]},"633":{"position":[[161,6]]},"637":{"position":[[176,6],[207,7],[317,6]]},"639":{"position":[[102,6]]},"643":{"position":[[421,6]]},"649":{"position":[[1043,6],[7219,6],[14192,7]]},"653":{"position":[[105,6],[432,6]]},"655":{"position":[[49,6],[160,6],[308,6],[407,6],[568,6],[680,6]]},"661":{"position":[[296,6],[402,6],[720,6]]},"669":{"position":[[223,6],[460,6],[2660,6]]},"671":{"position":[[436,6]]},"675":{"position":[[282,6]]},"677":{"position":[[292,6],[1191,6]]},"679":{"position":[[778,7],[888,6],[1649,6]]},"681":{"position":[[102,6]]},"683":{"position":[[709,6]]},"703":{"position":[[6050,7]]},"705":{"position":[[18919,7]]},"713":{"position":[[586,6],[864,8]]},"717":{"position":[[307,6],[583,6]]},"721":{"position":[[529,6],[571,6],[625,6],[674,6],[716,6],[771,6],[823,6],[868,6],[926,6]]},"728":{"position":[[93,6],[276,7],[1047,9],[2140,9],[3513,9],[5050,6],[5727,9],[5747,8],[6010,7],[6176,7],[6262,9],[6397,9],[6476,6],[7240,7],[7495,9],[7630,9],[8188,7],[8966,9],[10055,9],[11424,9],[12953,6],[13622,9],[13642,8],[13945,6],[14070,7],[14892,9],[15990,9],[17368,9],[18915,6],[19611,9],[19631,8],[20786,6],[20900,7],[21021,9],[21308,9],[21415,6],[21480,6],[21631,7],[21744,6],[21887,9],[22210,6],[22415,6],[22495,9],[23006,6],[23126,6],[23451,7],[23745,9],[24032,9],[24547,7],[25334,9],[26431,9],[27808,9],[29353,6],[30047,9],[30067,8],[30486,6],[30603,8],[30667,8],[30723,6],[31007,6],[31172,7],[31522,9],[31816,9],[32455,6],[32802,7],[33573,9],[34661,9],[36029,9],[37556,6],[38223,9],[38243,8],[38641,6],[38774,9],[39022,7],[39150,9],[39444,9],[39596,7],[39714,9],[40083,9],[40180,7],[40700,7],[41040,9],[41932,6],[41974,6],[42028,6],[42077,6],[42119,6],[42174,6],[42226,6],[42271,6],[42329,6],[43133,9],[44221,9],[45589,9],[47116,6],[47783,9],[47803,8],[48089,6],[48133,7],[48168,6],[48215,7],[48243,6],[48284,7],[48315,6],[48359,7],[48394,6],[48441,7],[48470,6],[48511,7],[48545,6],[48592,7],[48630,6],[48680,7],[48712,6],[48756,7]]},"734":{"position":[[665,6],[703,6]]},"740":{"position":[[256,6],[322,6],[464,6],[509,6]]},"745":{"position":[[1122,6]]},"749":{"position":[[83,6]]},"751":{"position":[[91,9]]},"755":{"position":[[340,6],[439,6],[595,6],[707,6]]},"761":{"position":[[205,6]]},"769":{"position":[[4387,6],[18874,7]]},"777":{"position":[[176,7]]},"781":{"position":[[268,7],[378,6]]},"787":{"position":[[49,6],[182,6],[272,6],[324,6]]},"789":{"position":[[245,6],[294,6],[351,6],[463,6]]},"791":{"position":[[63,6]]},"793":{"position":[[46,6]]},"795":{"position":[[52,6],[101,6],[274,6],[338,6],[18854,6]]},"797":{"position":[[2531,6],[2582,6]]},"799":{"position":[[175,6],[227,6]]},"801":{"position":[[387,6],[2543,6],[2592,6],[2946,6]]},"805":{"position":[[203,6]]},"809":{"position":[[268,7],[378,6]]},"815":{"position":[[355,6]]},"817":{"position":[[643,6]]},"819":{"position":[[255,6],[331,6]]},"821":{"position":[[1328,6]]},"825":{"position":[[1053,6],[1158,6],[1243,6]]},"831":{"position":[[260,6],[870,6],[999,6]]},"833":{"position":[[654,6],[683,6],[739,7]]},"844":{"position":[[1092,6]]},"850":{"position":[[394,6],[500,6]]},"852":{"position":[[143,6]]}}}],["accident",{"_index":762,"t":{"71":{"position":[[58,12]]},"73":{"position":[[391,10]]}}}],["accomplish",{"_index":1566,"t":{"282":{"position":[[234,10]]},"484":{"position":[[141,12]]}}}],["accord",{"_index":545,"t":{"37":{"position":[[6935,9],[7024,9],[7517,9],[7606,9]]},"97":{"position":[[3154,9],[3271,9]]},"123":{"position":[[3154,9],[3271,9]]},"169":{"position":[[16774,9],[16863,9],[17099,9],[17188,9],[22968,9],[23057,9],[23293,9],[23382,9],[29476,9],[29565,9],[29837,9],[29926,9]]},"236":{"position":[[4700,9],[4789,9],[5234,9],[5323,9]]},"238":{"position":[[4603,9],[4692,9],[4925,9],[5014,9],[10355,9],[10444,9],[10679,9],[10768,9]]},"248":{"position":[[3154,9],[3271,9]]},"265":{"position":[[4863,9],[4952,9],[5175,9],[5264,9]]},"267":{"position":[[4703,9],[4792,9],[5232,9],[5321,9],[10282,9],[10371,9],[10595,9],[10684,9]]},"273":{"position":[[5892,9],[5981,9],[6210,9],[6299,9],[11800,9],[11889,9],[12332,9],[12421,9],[17570,9],[17659,9],[17892,9],[17981,9],[23180,9],[23269,9],[23504,9],[23593,9]]},"282":{"position":[[4960,9],[5049,9],[5493,9],[5582,9]]},"284":{"position":[[4650,9],[4739,9],[4973,9],[5062,9]]},"294":{"position":[[3154,9]]},"300":{"position":[[524,9]]},"329":{"position":[[4771,9],[4860,9],[5296,9],[5385,9],[10358,9],[10447,9],[10884,9],[10973,9],[16968,9],[17057,9]]},"353":{"position":[[4746,9],[4835,9],[5069,9],[5158,9],[10352,9],[10441,9],[10674,9],[10763,9]]},"359":{"position":[[5203,9],[5292,9],[5742,9],[5831,9],[11041,9],[11130,9],[11364,9],[11453,9],[16855,9],[16944,9],[17178,9],[17267,9]]},"375":{"position":[[4808,9],[4897,9],[5138,9],[5227,9]]},"382":{"position":[[5713,9],[5802,9],[6033,9],[6122,9]]},"406":{"position":[[5568,9],[5657,9],[6181,9],[6270,9],[11490,9],[11579,9],[11815,9],[11904,9]]},"408":{"position":[[5910,9],[5999,9],[6559,9],[6648,9]]},"410":{"position":[[4584,9],[4673,9],[4909,9],[4998,9]]},"428":{"position":[[2435,9]]},"446":{"position":[[4810,9],[4899,9],[5356,9],[5445,9]]},"448":{"position":[[4708,9],[4797,9],[5038,9],[5127,9],[10549,9],[10638,9],[10880,9],[10969,9]]},"460":{"position":[[57,9]]},"482":{"position":[[4758,9],[4847,9],[5084,9],[5173,9],[10388,9],[10477,9],[10713,9],[10802,9]]},"486":{"position":[[4722,9],[4811,9],[5049,9],[5138,9],[10521,9],[10610,9],[10848,9],[10937,9]]},"504":{"position":[[4729,9],[4818,9],[5261,9],[5350,9]]},"506":{"position":[[5050,9],[5139,9],[5600,9],[5689,9]]},"508":{"position":[[4781,9],[4870,9],[5111,9],[5200,9]]},"522":{"position":[[5122,9],[5211,9],[5662,9],[5751,9]]},"524":{"position":[[4897,9],[4986,9],[5223,9],[5312,9]]},"540":{"position":[[4746,9],[4835,9],[5280,9],[5369,9]]},"542":{"position":[[5386,9],[5475,9],[5943,9],[6032,9]]},"544":{"position":[[4849,9],[4938,9],[5181,9],[5270,9]]},"556":{"position":[[5108,9],[5197,9],[5692,9],[5781,9]]},"560":{"position":[[5099,9],[5188,9],[5679,9],[5768,9]]},"562":{"position":[[4839,9],[4928,9],[5372,9],[5461,9]]},"564":{"position":[[4538,9],[4627,9],[4849,9],[4938,9],[10052,9],[10141,9],[10363,9],[10452,9]]},"566":{"position":[[4692,9],[4781,9],[5217,9],[5306,9],[10116,9],[10205,9],[10428,9],[10517,9]]},"581":{"position":[[4737,9],[4826,9],[5058,9],[5147,9]]},"588":{"position":[[5239,9],[5328,9],[5512,9],[5601,9],[11297,9],[11386,9],[11552,9],[11641,9],[17318,9],[17407,9],[17583,9],[17672,9]]},"590":{"position":[[4970,9],[5059,9],[5243,9],[5332,9]]},"595":{"position":[[4898,9],[4987,9],[5210,9],[5299,9],[10810,9],[10899,9],[11122,9],[11211,9]]},"600":{"position":[[5257,9],[5346,9],[5673,9],[5762,9]]},"619":{"position":[[5438,9],[5527,9],[5987,9],[6076,9]]},"621":{"position":[[4727,9],[4816,9],[5060,9],[5149,9]]},"627":{"position":[[5637,9],[5726,9],[6268,9],[6357,9]]},"629":{"position":[[4624,9],[4713,9],[4949,9],[5038,9]]},"631":{"position":[[4985,9],[5074,9],[5540,9],[5629,9],[10667,9],[10756,9],[10993,9],[11082,9],[16312,9],[16401,9],[16641,9],[16730,9]]},"649":{"position":[[5872,9],[5961,9],[6194,9],[6283,9],[12044,9],[12133,9],[12366,9],[12455,9],[18877,9],[18966,9],[19202,9],[19291,9],[25702,9],[25791,9],[26024,9],[26113,9],[31942,9],[32031,9],[32265,9],[32354,9]]},"651":{"position":[[5849,9],[5938,9],[6172,9],[6261,9],[12110,9],[12199,9],[12436,9],[12525,9],[18446,9],[18535,9],[18770,9],[18859,9],[24769,9],[24858,9],[25093,9],[25182,9]]},"669":{"position":[[9622,9],[9711,9],[10166,9],[10255,9]]},"671":{"position":[[6127,9],[6216,9],[6672,9],[6761,9]]},"691":{"position":[[5588,9],[5677,9],[6183,9],[6272,9],[11416,9],[11505,9],[11739,9],[11828,9],[17411,9],[17500,9],[17734,9],[17823,9],[23105,9],[23194,9],[23430,9],[23519,9],[28727,9],[28816,9],[29051,9],[29140,9]]},"701":{"position":[[5567,9],[5656,9],[5891,9],[5980,9],[11181,9],[11270,9],[11504,9],[11593,9]]},"703":{"position":[[4993,9],[5082,9],[5533,9],[5622,9],[10587,9],[10676,9],[10914,9],[11003,9]]},"705":{"position":[[5112,9],[5201,9],[5332,9],[5421,9],[11425,9],[11514,9],[12034,9],[12123,9],[17693,9],[17782,9],[18303,9],[18392,9],[23507,9],[23596,9],[23831,9],[23920,9],[29162,9],[29251,9],[29484,9],[29573,9]]},"726":{"position":[[8573,9],[8662,9],[9518,9],[9607,9],[17817,9],[17906,9],[18515,9],[18604,9],[25674,9],[25763,9],[26357,9],[26446,9],[32755,9],[32844,9],[33078,9],[33167,9],[38518,9],[38607,9],[38842,9],[38931,9],[44147,9],[44236,9],[44474,9],[44563,9],[49793,9],[49882,9],[50121,9],[50210,9]]},"728":{"position":[[4801,9],[4890,9],[5125,9],[5214,9],[12704,9],[12793,9],[13024,9],[13113,9],[13885,9],[18657,9],[18746,9],[18986,9],[19075,9],[29095,9],[29184,9],[29423,9],[29512,9],[37307,9],[37396,9],[37626,9],[37715,9],[46867,9],[46956,9],[47186,9],[47275,9]]},"745":{"position":[[6459,9],[6548,9],[7000,9],[7089,9],[12020,9],[12109,9],[12345,9],[12434,9],[17833,9],[17922,9],[18374,9],[18463,9],[23351,9],[23440,9],[23676,9],[23765,9],[28981,9],[29070,9],[29307,9],[29396,9],[36711,9],[36800,9],[37036,9],[37125,9],[42337,9],[42426,9],[42662,9],[42751,9]]},"747":{"position":[[7981,9],[8070,9],[8623,9],[8712,9],[14187,9],[14276,9],[14514,9],[14603,9]]},"749":{"position":[[5029,9],[5118,9],[5594,9],[5683,9],[11397,9],[11486,9],[11941,9],[12030,9],[16942,9],[17031,9],[17267,9],[17356,9]]},"751":{"position":[[8045,9],[8134,9],[8669,9],[8758,9],[14407,9],[14496,9],[14736,9],[14825,9],[22036,9],[22125,9],[22599,9],[22688,9]]},"761":{"position":[[9545,9],[9634,9],[10328,9],[10417,9]]},"767":{"position":[[4920,9],[5009,9],[5240,9],[5329,9],[10624,9],[10713,9],[10948,9],[11037,9],[16711,9],[16800,9],[17257,9],[17346,9],[22247,9],[22336,9],[22568,9],[22657,9]]},"769":{"position":[[9019,9],[9108,9],[9335,9],[9424,9],[16846,9],[16935,9],[17591,9],[17680,9],[24331,9],[24420,9],[24943,9],[25032,9],[30322,9],[30411,9],[30642,9],[30731,9]]},"771":{"position":[[6750,9],[6839,9],[7363,9],[7452,9],[13763,9],[13852,9],[14181,9],[14270,9],[20693,9],[20782,9],[21112,9],[21201,9]]},"773":{"position":[[15921,9],[16010,9],[17403,9],[17492,9]]},"795":{"position":[[5141,9],[5230,9],[5681,9],[5770,9],[10805,9],[10894,9],[11349,9],[11438,9],[17219,9],[17308,9],[17904,9],[17993,9],[23584,9],[23673,9],[23908,9],[23997,9],[29275,9],[29364,9],[29597,9],[29686,9]]},"797":{"position":[[8596,9],[8685,9],[9333,9],[9422,9],[14924,9],[15013,9],[15251,9],[15340,9]]},"799":{"position":[[7895,9],[7984,9],[8522,9],[8611,9],[15358,9],[15447,9],[16178,9],[16267,9],[22084,9],[22173,9],[22405,9],[22494,9]]},"801":{"position":[[8417,9],[8506,9],[9105,9],[9194,9],[14796,9],[14885,9],[15122,9],[15211,9]]},"821":{"position":[[6933,9],[7022,9],[7479,9],[7568,9],[12576,9],[12665,9],[12906,9],[12995,9],[18644,9],[18733,9],[19190,9],[19279,9],[24244,9],[24333,9],[24574,9],[24663,9],[30015,9],[30104,9],[30352,9],[30441,9],[37638,9],[37727,9],[38333,9],[38422,9],[43948,9],[44037,9],[44278,9],[44367,9]]},"823":{"position":[[4640,9],[4729,9],[4965,9],[5054,9],[11918,9],[12007,9],[12242,9],[12331,9]]},"825":{"position":[[12581,9],[12670,9],[13343,9],[13432,9],[19654,9],[19743,9],[20208,9],[20297,9],[26352,9],[26441,9],[26956,9],[27045,9],[32847,9],[32936,9],[33473,9],[33562,9],[39024,9],[39113,9],[39594,9],[39683,9],[44843,9],[44932,9],[45396,9],[45485,9],[50561,9],[50650,9],[50883,9],[50972,9],[56292,9],[56381,9],[56629,9],[56718,9]]},"844":{"position":[[6472,9],[6561,9],[7016,9],[7105,9],[12057,9],[12146,9],[12385,9],[12474,9],[17876,9],[17965,9],[18416,9],[18505,9],[23387,9],[23476,9],[23711,9],[23800,9],[29013,9],[29102,9],[29339,9],[29428,9],[36227,9],[36316,9],[36551,9],[36640,9],[41849,9],[41938,9],[42174,9],[42263,9]]},"846":{"position":[[8258,9],[8347,9],[8999,9],[9088,9],[14865,9],[14954,9],[15193,9],[15282,9]]},"848":{"position":[[7449,9],[7538,9],[8079,9],[8168,9],[13790,9],[13879,9],[14121,9],[14210,9]]},"850":{"position":[[9092,9],[9181,9],[9810,9],[9899,9],[15464,9],[15553,9],[15796,9],[15885,9],[21230,9],[21319,9],[21564,9],[21653,9],[26935,9],[27024,9],[27271,9],[27360,9],[32719,9],[32808,9],[33053,9],[33142,9],[38416,9],[38505,9],[38750,9],[38839,9]]}}}],["accordingli",{"_index":1901,"t":{"428":{"position":[[3970,12]]},"728":{"position":[[23039,11]]}}}],["account",{"_index":1948,"t":{"462":{"position":[[1535,8],[1605,10]]},"590":{"position":[[175,8]]},"608":{"position":[[612,7]]},"655":{"position":[[584,7]]},"673":{"position":[[10546,8]]},"755":{"position":[[611,7]]},"761":{"position":[[160,7],[225,7],[281,7],[334,7],[616,7],[835,8],[844,9],[883,7],[1155,10],[1871,10],[1972,9],[2079,10],[2135,9],[2207,7],[2285,7],[2357,7],[2405,7],[3316,7],[3476,7],[3631,7],[3763,7],[3789,7],[3857,10],[4955,7],[5174,7],[5388,7],[5579,7],[5605,7],[7147,7],[7317,7],[7482,7],[7624,7],[7650,7],[7726,10],[8866,7],[9035,7],[9199,7],[9340,7],[9366,7],[10968,7],[11013,7],[11177,7],[11336,7],[11472,7],[11498,7]]},"765":{"position":[[223,7],[235,7],[280,7]]},"767":{"position":[[170,7],[194,7],[239,7],[361,7],[383,7],[6098,8],[11767,7],[12555,7],[13734,7],[15289,7],[16518,7],[17563,7]]},"769":{"position":[[894,8],[1029,8],[2349,9],[2751,7],[2803,7],[3085,10],[4176,9]]},"773":{"position":[[342,7],[648,8],[657,9],[696,7],[1687,10],[2692,10],[2793,9],[2900,10],[2956,9],[4044,7],[4204,7],[4359,7],[4491,7],[4517,7],[4585,10],[6939,7],[7158,7],[7372,7],[7563,7],[7589,7],[10859,7],[11029,7],[11194,7],[11336,7],[11362,7],[11438,10],[13914,7],[14083,7],[14247,7],[14388,7],[14414,7],[18043,7],[19163,7],[19327,7],[19486,7],[19622,7],[19648,7],[21448,8],[21610,8]]},"775":{"position":[[555,7],[861,8],[870,9],[909,7],[2154,10],[3159,10],[3260,9],[3367,10],[3423,9]]}}}],["account:check",{"_index":2577,"t":{"761":{"position":[[3550,17],[3726,17],[3823,17],[7400,17],[7586,17],[7691,17],[10717,16],[10844,16],[10947,16]]},"773":{"position":[[4278,17],[4454,17],[4551,17],[11112,17],[11298,17],[11403,17],[17792,16],[17919,16],[18022,16]]}}}],["account_manag",{"_index":2570,"t":{"761":{"position":[[587,16],[665,16],[682,15],[761,15],[995,18],[1061,18],[1207,18],[1347,17],[1548,17],[3387,18],[7226,18],[10579,15]]},"767":{"position":[[12626,18],[15368,18],[17508,15]]},"769":{"position":[[1328,16],[1570,18],[2075,18],[2418,17],[2852,16],[2869,15],[2952,15],[3137,18],[3277,17],[3436,17]]},"773":{"position":[[130,16],[391,16],[408,15],[491,15],[904,18],[1409,18],[1739,18],[1879,17],[2038,17],[4115,18],[10938,18],[17654,15]]},"775":{"position":[[343,16],[604,16],[621,15],[704,15],[1304,18],[1876,18],[2206,18],[2346,17],[2505,17]]}}}],["account_manager_view",{"_index":2634,"t":{"769":{"position":[[2369,24],[2560,22],[2668,24],[2928,23],[3028,22],[3330,25],[3760,24]]},"773":{"position":[[467,23],[567,22],[1932,25],[2362,24]]},"775":{"position":[[680,23],[780,22],[2399,25],[2829,24]]}}}],["achiev",{"_index":1878,"t":{"426":{"position":[[7219,7],[8336,7],[8719,7],[9026,7]]},"625":{"position":[[1186,8]]},"749":{"position":[[210,7]]}}}],["action",{"_index":290,"t":{"17":{"position":[[146,6]]},"300":{"position":[[638,7]]},"416":{"position":[[594,6],[781,6],[855,6],[1158,6]]},"418":{"position":[[106,6],[153,7]]},"420":{"position":[[50,6],[75,7],[1229,6],[1236,8]]},"422":{"position":[[245,6],[252,8],[4406,6],[4436,6]]},"424":{"position":[[555,6],[574,8],[593,8]]},"426":{"position":[[252,6]]},"428":{"position":[[283,6],[511,6],[1576,6]]},"472":{"position":[[114,7],[469,7]]},"659":{"position":[[921,8]]},"661":{"position":[[637,8]]},"671":{"position":[[12600,6]]},"675":{"position":[[205,8]]},"689":{"position":[[512,7]]},"759":{"position":[[923,8]]},"777":{"position":[[324,8]]},"779":{"position":[[184,6]]},"785":{"position":[[272,6]]},"793":{"position":[[241,6],[354,7],[383,7]]},"797":{"position":[[75,7],[2786,7]]},"801":{"position":[[92,7]]},"819":{"position":[[93,6]]}}}],["actual",{"_index":1940,"t":{"460":{"position":[[584,8]]}}}],["ad",{"_index":307,"t":{"19":{"position":[[278,5]]},"41":{"position":[[117,6]]},"49":{"position":[[451,5],[664,5]]},"111":{"position":[[1142,5]]},"169":{"position":[[30876,5]]},"199":{"position":[[41,5]]},"225":{"position":[[102,6]]},"265":{"position":[[249,5]]},"271":{"position":[[77,6]]},"273":{"position":[[7015,6]]},"288":{"position":[[220,5],[332,6]]},"290":{"position":[[246,5],[568,5],[1436,5]]},"359":{"position":[[320,6],[6313,5]]},"406":{"position":[[11,5],[176,6]]},"420":{"position":[[2606,5]]},"422":{"position":[[1646,5],[3488,5]]},"424":{"position":[[1978,5]]},"426":{"position":[[963,5]]},"430":{"position":[[74,6]]},"446":{"position":[[124,6]]},"448":{"position":[[32,5]]},"452":{"position":[[411,6],[445,6],[964,5]]},"472":{"position":[[547,6]]},"524":{"position":[[37,6],[205,6]]},"528":{"position":[[120,6]]},"558":{"position":[[935,5],[986,5]]},"560":{"position":[[87,6]]},"608":{"position":[[388,5]]},"621":{"position":[[32,5]]},"645":{"position":[[81,6]]},"659":{"position":[[479,5]]},"665":{"position":[[339,6]]},"669":{"position":[[610,6]]},"685":{"position":[[180,6],[354,6]]},"689":{"position":[[173,6]]},"726":{"position":[[28172,6]]},"728":{"position":[[6496,5],[8066,6],[22293,6],[22870,5],[38706,6],[40008,5]]},"747":{"position":[[56,6],[2302,6]]},"749":{"position":[[257,6]]},"751":{"position":[[726,6],[2831,5],[16534,5]]},"759":{"position":[[480,5]]},"769":{"position":[[10190,5],[18762,5]]},"771":{"position":[[930,6]]},"795":{"position":[[18774,6]]},"797":{"position":[[2720,6]]},"799":{"position":[[17369,5]]},"801":{"position":[[2977,6]]},"805":{"position":[[4,6]]},"825":{"position":[[1577,6],[21694,5],[22985,5],[24711,5],[26062,5],[27392,5],[45873,5]]},"829":{"position":[[4,6],[80,6]]},"848":{"position":[[1806,5],[1891,6],[15989,5]]}}}],["add",{"_index":205,"t":{"9":{"position":[[223,3]]},"77":{"position":[[188,3],[916,3],[1630,3]]},"81":{"position":[[204,3]]},"89":{"position":[[22,3]]},"109":{"position":[[427,3]]},"111":{"position":[[1879,3]]},"113":{"position":[[3120,3]]},"169":{"position":[[31940,3]]},"227":{"position":[[989,3]]},"229":{"position":[[24,3]]},"234":{"position":[[166,3]]},"246":{"position":[[24,3]]},"250":{"position":[[3,3]]},"265":{"position":[[103,3]]},"271":{"position":[[597,3],[649,3]]},"273":{"position":[[24326,3]]},"275":{"position":[[24,3]]},"296":{"position":[[3407,3]]},"329":{"position":[[17,3]]},"347":{"position":[[1619,3]]},"349":{"position":[[24,3]]},"355":{"position":[[128,3],[927,3]]},"359":{"position":[[39,3]]},"365":{"position":[[1121,3]]},"367":{"position":[[24,3]]},"388":{"position":[[82,3],[139,3]]},"392":{"position":[[1130,3]]},"396":{"position":[[24,3]]},"402":{"position":[[1154,3]]},"404":{"position":[[1161,3]]},"422":{"position":[[2006,3],[3827,3],[3868,3]]},"446":{"position":[[7,3]]},"454":{"position":[[65,3],[217,3]]},"458":{"position":[[405,3]]},"460":{"position":[[892,3],[3020,3],[3293,3]]},"462":{"position":[[2609,3],[3335,3],[3501,3]]},"482":{"position":[[11706,3]]},"484":{"position":[[21,3]]},"488":{"position":[[114,3]]},"512":{"position":[[245,3]]},"528":{"position":[[36,3]]},"536":{"position":[[330,3]]},"546":{"position":[[109,3]]},"556":{"position":[[171,3],[6287,3],[6339,3]]},"560":{"position":[[24,3]]},"562":{"position":[[110,3],[155,3]]},"610":{"position":[[936,3]]},"612":{"position":[[24,3]]},"627":{"position":[[45,3]]},"669":{"position":[[44,3],[407,3],[2439,3]]},"677":{"position":[[1590,3]]},"689":{"position":[[405,3],[449,3]]},"691":{"position":[[1067,3],[1167,3],[2315,3],[2474,3],[3998,3],[4108,3],[5306,3],[5415,3],[6574,3],[6678,3],[12838,3],[18555,3]]},"703":{"position":[[134,3]]},"724":{"position":[[132,3]]},"726":{"position":[[12,3]]},"728":{"position":[[6085,3],[22402,3],[30803,3]]},"747":{"position":[[230,3],[289,3],[725,3],[2235,3]]},"749":{"position":[[6437,3]]},"751":{"position":[[854,3]]},"769":{"position":[[44,3],[104,3],[792,3],[918,3],[1053,3],[2365,3],[4186,3],[10098,3],[10286,3],[18823,3]]},"781":{"position":[[1063,3]]},"795":{"position":[[458,3],[6103,3],[11794,3]]},"797":{"position":[[22,3],[2859,3]]},"799":{"position":[[9299,3]]},"801":{"position":[[2854,3]]},"805":{"position":[[51,3]]},"825":{"position":[[6664,3]]},"829":{"position":[[255,3]]},"833":{"position":[[771,3]]},"846":{"position":[[208,3],[265,3],[2027,3]]},"848":{"position":[[378,3]]},"850":{"position":[[2766,3]]}}}],["add/view",{"_index":2312,"t":{"677":{"position":[[508,8]]},"689":{"position":[[680,8]]}}}],["addit",{"_index":188,"t":{"7":{"position":[[542,10]]},"169":{"position":[[32136,9]]},"227":{"position":[[896,9]]},"258":{"position":[[581,9]]},"320":{"position":[[1088,9]]},"347":{"position":[[1526,9]]},"365":{"position":[[1028,9]]},"392":{"position":[[1029,9]]},"440":{"position":[[724,9]]},"474":{"position":[[2334,9]]},"492":{"position":[[865,9]]},"508":{"position":[[69,8]]},"514":{"position":[[635,9]]},"530":{"position":[[612,9]]},"550":{"position":[[565,9]]},"572":{"position":[[1036,9]]},"606":{"position":[[15,10]]},"610":{"position":[[843,9]]},"679":{"position":[[724,9]]},"747":{"position":[[684,9]]},"751":{"position":[[641,8]]},"846":{"position":[[320,9]]}}}],["addition",{"_index":1113,"t":{"133":{"position":[[1700,12]]},"767":{"position":[[11725,13]]}}}],["addr",{"_index":1260,"t":{"151":{"position":[[524,4],[661,4]]},"159":{"position":[[311,4]]}}}],["addr=0.0.0.0:2114",{"_index":1313,"t":{"159":{"position":[[401,17]]}}}],["address",{"_index":54,"t":{"3":{"position":[[833,9]]},"5":{"position":[[216,8]]},"9":{"position":[[6,7]]},"159":{"position":[[77,7],[272,8]]},"161":{"position":[[234,7],[276,7]]},"316":{"position":[[1090,8]]},"655":{"position":[[524,8]]},"755":{"position":[[193,8],[551,8]]},"765":{"position":[[361,7]]},"769":{"position":[[60,7],[173,7],[481,7],[539,7],[978,7],[1390,7],[2231,7],[4324,7],[4464,7],[10161,7],[11390,7],[11453,7],[13055,7],[13134,7],[14998,7],[15068,7],[16613,7],[16673,7],[17415,7],[18099,7],[18526,7],[18590,7],[18797,7],[19644,7],[19709,7],[20946,7],[21065,7],[22683,7],[22757,7],[24045,7],[24105,7],[24769,7],[25202,7],[25401,7],[25469,7]]},"771":{"position":[[215,8],[1024,7],[1869,7],[1934,7],[3226,7],[3345,7],[5018,7],[5092,7],[6436,7],[6496,7],[7189,7],[7584,7],[7773,7],[7841,7],[8450,7],[9388,7],[10662,7],[12233,7],[13560,7],[14074,7],[14763,7],[15172,7],[15376,7],[16314,7],[17589,7],[19161,7],[20489,7],[21004,7],[21694,7],[22104,7]]},"773":{"position":[[192,7],[756,7],[1565,7],[3158,7],[5719,7],[5782,7],[9263,7],[9342,7],[12644,7],[12714,7],[15688,7],[15748,7],[17227,7],[19071,7],[20882,7],[20946,7]]},"775":{"position":[[405,7],[969,7],[2032,7],[3625,7]]},"797":{"position":[[500,7]]}}}],["adjust",{"_index":1306,"t":{"157":{"position":[[375,6]]},"161":{"position":[[780,6]]}}}],["admin",{"_index":1710,"t":{"377":{"position":[[239,6]]},"490":{"position":[[764,5],[826,5]]},"550":{"position":[[235,5],[313,6],[429,8],[485,8]]},"556":{"position":[[51,5],[949,8],[1008,8],[3720,8],[3789,8],[5943,5],[6048,5],[6297,5]]},"558":{"position":[[138,6],[344,8],[662,8],[1052,5],[1096,5],[1321,5]]},"562":{"position":[[73,5]]},"564":{"position":[[32,5],[837,8],[1917,8],[3277,8],[4788,5],[5440,8],[5459,7],[6351,8],[7431,8],[8791,8],[10302,5],[10954,8],[10973,7]]},"566":{"position":[[56,5],[5630,5],[6411,8],[7492,8],[8853,8],[10366,5],[11020,8],[11039,7]]},"661":{"position":[[631,5]]},"677":{"position":[[801,5]]},"693":{"position":[[354,6]]},"732":{"position":[[402,6],[1170,5],[1208,5]]},"734":{"position":[[659,5],[697,5]]},"740":{"position":[[165,7],[296,6],[458,5],[503,5]]},"742":{"position":[[340,6],[362,6],[568,6]]},"745":{"position":[[438,6],[663,8],[1000,8],[30540,5],[30553,6],[31079,7],[31098,8],[31435,8]]},"747":{"position":[[1014,5],[1027,6],[1566,7],[1585,8],[2090,8],[2269,5],[3235,6],[3314,8],[4643,6],[6378,6],[6465,8],[7786,6],[9023,5],[9244,6],[10424,8],[11520,8],[12896,8],[14439,5],[15125,8],[15144,7]]},"749":{"position":[[6496,6],[13185,8],[14279,8],[15653,8],[17192,5],[17872,8],[17891,7]]},"751":{"position":[[1512,5],[1525,6],[2073,7],[2092,8],[2622,8],[9529,6],[9568,5],[9619,5],[10633,8],[11731,8],[13109,8],[14656,5],[15343,8],[15362,7],[15674,6],[15804,8],[16002,8],[16194,5],[16264,9],[16334,7],[16358,6],[23176,6],[23227,5],[23307,5],[23807,8],[23911,7],[24058,7],[25319,8]]},"775":{"position":[[280,6],[1115,8],[1171,8]]},"781":{"position":[[616,6],[1013,6]]},"787":{"position":[[105,6],[377,7]]},"789":{"position":[[283,5],[452,5]]},"793":{"position":[[102,6],[318,5]]},"795":{"position":[[90,5],[177,6]]},"797":{"position":[[179,6],[2570,6],[2650,6]]},"799":{"position":[[291,6],[2753,5],[9291,7]]},"807":{"position":[[474,6],[536,6]]},"815":{"position":[[482,6],[528,6],[906,6],[1162,6]]},"817":{"position":[[297,5],[391,5]]},"819":{"position":[[631,5],[683,5],[1780,5],[1810,5]]},"821":{"position":[[2786,5],[3964,5],[5518,5],[6746,5],[7790,5],[31240,5],[32337,5],[33765,5],[35687,5],[37185,5],[38889,5]]}}}],["administ",{"_index":1369,"t":{"169":{"position":[[5509,10]]},"548":{"position":[[322,11]]}}}],["administr",{"_index":1742,"t":{"402":{"position":[[391,13],[886,13]]},"815":{"position":[[315,14],[410,14],[566,13],[632,14],[847,14]]}}}],["advanc",{"_index":681,"t":{"51":{"position":[[2219,8]]},"53":{"position":[[3491,8],[3524,8],[3555,8]]},"55":{"position":[[1607,8]]},"111":{"position":[[1864,8]]},"113":{"position":[[3105,8]]},"169":{"position":[[32278,8]]},"316":{"position":[[1437,8],[1464,8]]},"335":{"position":[[26,8]]},"623":{"position":[[38,8]]},"627":{"position":[[930,8],[2317,8],[4031,8],[5418,8],[6833,8]]},"631":{"position":[[804,8],[1988,8],[3548,8],[4783,8],[5813,8]]},"633":{"position":[[89,8]]}}}],["advantag",{"_index":145,"t":{"5":{"position":[[68,9]]},"31":{"position":[[955,9]]},"209":{"position":[[238,11]]},"677":{"position":[[992,10]]}}}],["affect",{"_index":1349,"t":{"169":{"position":[[3768,6],[3920,6],[8594,6]]},"392":{"position":[[1322,6]]},"398":{"position":[[80,6]]},"464":{"position":[[672,6]]},"468":{"position":[[224,8]]},"490":{"position":[[123,6]]},"649":{"position":[[992,7]]},"651":{"position":[[980,7],[19875,8]]},"659":{"position":[[723,6]]},"677":{"position":[[1340,9]]},"713":{"position":[[382,6]]},"734":{"position":[[551,6]]},"759":{"position":[[725,6]]},"777":{"position":[[162,6]]},"833":{"position":[[551,6]]}}}],["aforement",{"_index":1880,"t":{"426":{"position":[[7990,14]]},"749":{"position":[[222,14]]}}}],["afternoon",{"_index":387,"t":{"27":{"position":[[763,11]]}}}],["again",{"_index":2473,"t":{"728":{"position":[[8196,6],[24555,6]]}}}],["against",{"_index":417,"t":{"31":{"position":[[643,7],[766,7]]},"73":{"position":[[255,7]]},"310":{"position":[[2697,7],[3673,7]]},"452":{"position":[[1179,7]]},"468":{"position":[[491,7]]}}}],["agenda",{"_index":350,"t":{"27":{"position":[[97,6]]}}}],["aggress",{"_index":1087,"t":{"133":{"position":[[450,10]]}}}],["aguiar",{"_index":366,"t":{"27":{"position":[[320,6]]}}}],["ahead",{"_index":786,"t":{"73":{"position":[[679,5]]}}}],["algorithm",{"_index":925,"t":{"111":{"position":[[557,10]]}}}],["alic",{"_index":2041,"t":{"540":{"position":[[95,5]]},"544":{"position":[[55,5],[225,5],[6015,5],[6120,5]]},"691":{"position":[[314,5],[1171,5],[2478,5],[4112,5],[5419,5],[6682,5],[18529,5],[29828,5],[29918,5]]}}}],["all_objects_view",{"_index":2476,"t":{"728":{"position":[[19979,18],[20172,20],[20453,18],[20651,18]]}}}],["allot",{"_index":2156,"t":{"602":{"position":[[58,8]]}}}],["allow",{"_index":27,"t":{"3":{"position":[[392,7],[1113,5],[2075,7],[2154,7],[2233,7]]},"5":{"position":[[180,5],[292,5]]},"7":{"position":[[525,6],[581,6]]},"23":{"position":[[6,6]]},"47":{"position":[[3859,6]]},"49":{"position":[[78,6]]},"51":{"position":[[1236,6]]},"53":{"position":[[2972,5],[3088,5]]},"55":{"position":[[1467,11]]},"57":{"position":[[1444,11]]},"59":{"position":[[1479,11]]},"73":{"position":[[596,5]]},"77":{"position":[[1636,5]]},"81":{"position":[[210,5]]},"99":{"position":[[134,7],[298,7],[610,8],[1650,7]]},"109":{"position":[[262,6]]},"111":{"position":[[137,6]]},"113":{"position":[[1358,7],[1473,10]]},"131":{"position":[[154,6]]},"133":{"position":[[2155,5],[2335,7],[2587,5],[2807,7]]},"149":{"position":[[48,8]]},"169":{"position":[[2825,5],[5803,6],[6328,6],[8354,7],[9173,5],[9641,5],[10000,6],[10289,6],[10395,6],[10405,7],[11196,6],[12951,7],[13125,7],[14255,8],[18232,10],[18287,10],[19145,7],[19319,7],[20449,8]]},"193":{"position":[[174,6],[463,6]]},"209":{"position":[[364,6]]},"238":{"position":[[792,7],[963,7],[2090,8],[6536,7],[6708,7],[7837,8]]},"265":{"position":[[1092,7],[1253,7],[2370,8]]},"267":{"position":[[6507,7],[6668,7],[7786,8]]},"273":{"position":[[2097,7],[2263,7],[3386,8],[13759,7],[13930,7],[15057,8],[19361,7],[19533,7],[20662,8]]},"284":{"position":[[117,10],[835,7],[1006,7],[2134,8]]},"296":{"position":[[3267,7]]},"329":{"position":[[11341,6]]},"353":{"position":[[931,7],[1103,7],[2231,8],[6541,7],[6712,7],[7839,8],[11767,5]]},"355":{"position":[[3,5],[75,5]]},"359":{"position":[[7226,7],[7397,7],[8525,8],[13040,7],[13212,7],[14340,8]]},"363":{"position":[[436,6]]},"375":{"position":[[965,7],[1144,7],[2279,8]]},"380":{"position":[[245,8]]},"382":{"position":[[1910,7],[2079,7],[3204,8]]},"390":{"position":[[143,5]]},"392":{"position":[[436,6]]},"402":{"position":[[453,6],[534,6],[618,6],[709,6]]},"406":{"position":[[7667,7],[7841,7],[8971,8]]},"410":{"position":[[761,7],[935,7],[2065,8]]},"426":{"position":[[3033,6]]},"448":{"position":[[865,7],[1044,7],[2179,8],[6702,7],[6881,7],[8017,8]]},"452":{"position":[[1207,6]]},"460":{"position":[[1061,5],[3331,7]]},"462":{"position":[[600,5],[3384,6]]},"466":{"position":[[18,5],[364,5]]},"472":{"position":[[88,8],[182,7]]},"482":{"position":[[931,7],[1106,7],[2237,8],[6565,7],[6739,7],[7869,8],[11738,5]]},"486":{"position":[[891,7],[1067,7],[2199,8],[6690,7],[6865,7],[7997,8]]},"498":{"position":[[267,5]]},"500":{"position":[[3,5],[134,5]]},"502":{"position":[[3,5]]},"508":{"position":[[938,7],[1117,7],[2252,8]]},"512":{"position":[[156,6]]},"524":{"position":[[121,10],[1070,7],[1245,7],[2376,8]]},"544":{"position":[[998,7],[1179,7],[2316,8]]},"548":{"position":[[219,6]]},"564":{"position":[[771,7],[931,7],[2047,8],[6285,7],[6445,7],[7561,8]]},"566":{"position":[[6345,7],[6505,7],[7622,8]]},"581":{"position":[[930,7],[1100,7],[2226,8]]},"617":{"position":[[114,5]]},"621":{"position":[[872,7],[1054,7],[2192,8]]},"623":{"position":[[105,5]]},"625":{"position":[[1067,6],[1969,6]]},"629":{"position":[[801,7],[975,7],[2105,8],[5749,7]]},"631":{"position":[[6840,7],[7014,7],[8145,8],[12473,7],[12651,7],[13785,8]]},"637":{"position":[[1049,5]]},"641":{"position":[[680,5]]},"645":{"position":[[1293,5],[1334,6],[1455,6]]},"649":{"position":[[1344,11],[2061,7],[2232,7],[3359,8],[7108,7],[7516,11],[8233,7],[8404,7],[9531,8],[13297,7],[14337,11],[15054,7],[15228,7],[16358,8],[20194,7],[21174,11],[21891,7],[22062,7],[23189,8],[27410,11],[28127,7],[28299,7],[29427,8]]},"651":{"position":[[1316,11],[2034,7],[2205,7],[3333,8],[7104,7],[7565,11],[8283,7],[8457,7],[9588,8],[13381,7],[13909,11],[14627,7],[14799,7],[15928,8],[19769,7],[20233,11],[20950,7],[21123,7],[22252,8]]},"659":{"position":[[887,8]]},"667":{"position":[[295,7],[460,7],[773,8],[2126,7],[2293,7],[2608,8],[3985,7],[4150,7],[4463,8],[5821,7],[5988,7],[6304,8],[7678,7],[7843,7],[8157,8],[9521,7],[9688,7],[10004,8]]},"669":{"position":[[2873,7],[3038,7],[3352,8],[10763,7],[10928,7],[11241,8]]},"671":{"position":[[7317,7],[7581,7],[8011,8],[9988,7],[10252,7],[10683,8],[12607,7]]},"677":{"position":[[276,6],[1139,6]]},"679":{"position":[[1659,7]]},"683":{"position":[[719,7]]},"689":{"position":[[585,5]]},"691":{"position":[[6862,7],[7601,7],[7773,7],[8901,8],[12827,7],[13596,7],[13767,7],[14895,8],[18535,7],[19282,7],[19456,7],[20586,8],[24908,7],[25081,7],[26210,8]]},"701":{"position":[[1748,7],[1921,7],[3050,8],[7366,7],[7538,7],[8666,8]]},"703":{"position":[[6756,7],[6932,7],[8064,8]]},"705":{"position":[[19688,7],[19861,7],[20990,8],[25351,7],[25521,7],[26648,8]]},"726":{"position":[[28940,7],[29112,7],[30240,8],[34699,7],[34871,7],[36000,8],[40316,7],[40492,7],[41624,8],[45958,7],[46135,7],[47268,8]]},"728":{"position":[[982,7],[1150,7],[2279,8],[6813,6],[7086,6],[8901,7],[9069,7],[10194,8],[14818,7],[14995,7],[16129,8],[22177,5],[25260,7],[25437,7],[26570,8],[33508,7],[33676,7],[34800,8],[38623,8],[43068,7],[43236,7],[44360,8]]},"734":{"position":[[354,5]]},"745":{"position":[[8197,7],[8371,7],[9501,8],[19528,7],[19702,7],[20832,8],[25154,7],[25328,7],[26459,8],[32888,7],[33062,7],[34192,8],[38514,7],[38688,7],[39818,8]]},"747":{"position":[[10356,7],[10532,7],[11664,8]]},"749":{"position":[[6214,6],[13119,7],[13293,7],[14423,8]]},"751":{"position":[[10568,7],[10741,7],[11875,8]]},"759":{"position":[[889,8]]},"767":{"position":[[1117,7],[1286,7],[2411,8],[6805,7],[6978,7],[8107,8],[18440,7],[18609,7],[19735,8]]},"769":{"position":[[2723,7],[5232,7],[5396,7],[6517,8],[18772,7],[26519,7],[26688,7],[27813,8]]},"771":{"position":[[461,5],[8439,7],[9214,7],[9552,7],[10865,8],[16140,7],[16478,7],[17792,8]]},"781":{"position":[[505,5]]},"795":{"position":[[19765,7],[19938,7],[21067,8],[25464,7],[25634,7],[26761,8]]},"797":{"position":[[553,6],[11093,7],[11269,7],[12401,8]]},"799":{"position":[[18277,7],[18447,7],[19573,8]]},"801":{"position":[[10969,7],[11143,7],[12274,8]]},"809":{"position":[[505,5]]},"815":{"position":[[1246,7]]},"821":{"position":[[8733,7],[8912,7],[10047,8],[20401,7],[20580,7],[21715,8],[26144,7],[26329,7],[27471,8],[40105,7],[40284,7],[41419,8]]},"823":{"position":[[817,7],[990,7],[2120,8],[8099,7],[8272,7],[9401,8]]},"825":{"position":[[46750,7],[46920,7],[48047,8],[52421,7],[52607,7],[53749,8]]},"833":{"position":[[354,5]]},"844":{"position":[[8222,7],[8399,7],[9532,8],[19568,7],[19741,7],[20870,8],[25186,7],[25360,7],[26491,8],[32408,7],[32581,7],[33710,8],[38026,7],[38200,7],[39330,8]]},"846":{"position":[[13,6],[350,5],[11030,7],[11207,7],[12340,8]]},"848":{"position":[[9943,7],[10118,7],[11254,8]]},"850":{"position":[[33,6],[483,5],[11613,7],[11794,7],[12931,8],[17371,7],[17553,7],[18692,8],[23068,7],[23253,7],[24394,8],[28860,7],[29042,7],[30181,8],[34557,7],[34739,7],[35878,8]]}}}],["allowed\":fals",{"_index":1518,"t":{"238":{"position":[[10642,17],[11192,17]]},"267":{"position":[[10558,17],[11097,17]]},"273":{"position":[[1317,17],[6173,17],[6717,17],[12938,17],[23467,17],[24017,17]]},"284":{"position":[[4936,17],[5485,17]]},"359":{"position":[[11327,17],[11876,17]]},"448":{"position":[[10843,17],[11400,17]]},"486":{"position":[[10811,17],[11364,17]]},"566":{"position":[[10391,17],[10929,17]]},"631":{"position":[[10956,17],[11508,17]]},"651":{"position":[[6135,17],[6684,17],[12399,17],[12951,17],[18733,17],[19283,17]]},"667":{"position":[[6963,17],[7330,17],[8810,17],[9175,17],[10663,17],[11030,17]]},"669":{"position":[[4005,17],[4370,17]]},"671":{"position":[[9903,18],[11637,17],[12115,17]]},"691":{"position":[[17697,17],[18246,17]]},"705":{"position":[[29447,17],[29995,17]]},"726":{"position":[[38805,17],[39355,17]]},"728":{"position":[[12987,17],[13533,17],[18949,17],[19504,17]]},"745":{"position":[[29270,17],[29822,17]]},"767":{"position":[[22531,17],[23078,17]]},"769":{"position":[[9298,17],[9840,17]]},"771":{"position":[[15423,18],[21075,17],[21803,17]]},"795":{"position":[[29560,17],[30108,17]]},"801":{"position":[[15085,17],[15637,17]]},"821":{"position":[[30315,17],[30878,17]]},"823":{"position":[[4928,17],[5479,17]]},"825":{"position":[[50846,17],[51394,17]]},"844":{"position":[[29302,17],[29854,17]]},"850":{"position":[[21527,17],[22087,17],[33016,17],[33576,17],[38713,17],[39273,17]]}}}],["allowed\":tru",{"_index":865,"t":{"99":{"position":[[1257,16],[1620,16]]},"169":{"position":[[17063,16],[17614,16],[23257,16],[23808,16]]},"238":{"position":[[4889,16],[5437,16]]},"265":{"position":[[5139,16],[5677,16]]},"273":{"position":[[12826,16],[17856,16],[18404,16]]},"353":{"position":[[96,16],[5033,16],[5582,16],[10638,16],[11186,16]]},"359":{"position":[[17142,16],[17691,16]]},"375":{"position":[[5102,16],[5658,16]]},"382":{"position":[[5997,16],[6543,16]]},"406":{"position":[[11779,16],[12330,16]]},"410":{"position":[[4873,16],[5424,16]]},"448":{"position":[[5002,16],[5558,16]]},"482":{"position":[[96,16],[5048,16],[5600,16],[10677,16],[11228,16]]},"486":{"position":[[5013,16],[5566,16]]},"508":{"position":[[5075,16],[5631,16]]},"524":{"position":[[5187,16],[5739,16]]},"544":{"position":[[5145,16],[5703,16]]},"564":{"position":[[4813,16],[5350,16],[10327,16],[10864,16]]},"581":{"position":[[5022,16],[5569,16]]},"621":{"position":[[5024,16],[5583,16]]},"629":{"position":[[4913,16],[5464,16]]},"631":{"position":[[16605,16],[17160,16]]},"649":{"position":[[6158,16],[6706,16],[12330,16],[12878,16],[19166,16],[19717,16],[25988,16],[26536,16],[32229,16],[32778,16]]},"651":{"position":[[25057,16],[25607,16]]},"667":{"position":[[1423,16],[1787,16],[3264,16],[3630,16],[5113,16],[5477,16]]},"669":{"position":[[11891,16],[12255,16]]},"671":{"position":[[7233,17],[8962,16],[9439,16]]},"691":{"position":[[11703,16],[12252,16],[23394,16],[23945,16],[29015,16],[29565,16]]},"701":{"position":[[5855,16],[6405,16],[11468,16],[12017,16]]},"703":{"position":[[10878,16],[11431,16]]},"705":{"position":[[23795,16],[24345,16]]},"726":{"position":[[33042,16],[33591,16],[44438,16],[44991,16],[50085,16],[50639,16]]},"728":{"position":[[29387,16],[29941,16],[37590,16],[38135,16],[47150,16],[47695,16]]},"745":{"position":[[12309,16],[12860,16],[23640,16],[24191,16],[37000,16],[37551,16],[42626,16],[43177,16]]},"747":{"position":[[14478,16],[15031,16]]},"749":{"position":[[17231,16],[17782,16]]},"767":{"position":[[5204,16],[5750,16],[10912,16],[11462,16]]},"769":{"position":[[30606,16],[31152,16]]},"771":{"position":[[8498,17],[14145,16],[14872,16]]},"795":{"position":[[23872,16],[24422,16]]},"797":{"position":[[15215,16],[15768,16]]},"799":{"position":[[22369,16],[22916,16]]},"821":{"position":[[12870,16],[13426,16],[24538,16],[25094,16],[44242,16],[44798,16]]},"823":{"position":[[12206,16],[12756,16]]},"825":{"position":[[56593,16],[57156,16]]},"844":{"position":[[12349,16],[12903,16],[23675,16],[24225,16],[36515,16],[37065,16],[42138,16],[42689,16]]},"846":{"position":[[15157,16],[15711,16]]},"850":{"position":[[15760,16],[16318,16],[27235,16],[27797,16]]}}}],["allowed\":undefin",{"_index":2470,"t":{"728":{"position":[[5084,21],[5634,21]]},"751":{"position":[[14695,21],[15250,21]]},"848":{"position":[[14080,21],[14637,21]]}}}],["allowed:fals",{"_index":136,"t":{"3":{"position":[[2970,13]]}}}],["allowed:tru",{"_index":132,"t":{"3":{"position":[[2810,12],[2891,12]]}}}],["alongsid",{"_index":758,"t":{"69":{"position":[[221,9]]},"169":{"position":[[31161,9]]},"671":{"position":[[666,9]]},"771":{"position":[[8274,9]]}}}],["alpha",{"_index":2388,"t":{"721":{"position":[[132,5],[149,8],[347,5]]},"726":{"position":[[12222,5],[13720,5],[15712,5],[17280,5],[19060,5],[20379,5],[21807,5],[23729,5],[25227,5],[26907,5]]}}}],["alphanumer",{"_index":1838,"t":{"424":{"position":[[2526,12]]}}}],["alpin",{"_index":838,"t":{"77":{"position":[[1607,6]]},"81":{"position":[[181,6]]}}}],["alreadi",{"_index":1135,"t":{"141":{"position":[[101,7]]},"345":{"position":[[168,7]]},"347":{"position":[[1129,8]]},"353":{"position":[[11599,8],[11662,7]]},"365":{"position":[[925,8]]},"474":{"position":[[1573,8]]},"671":{"position":[[725,7]]},"728":{"position":[[19789,7]]},"771":{"position":[[8333,7]]},"823":{"position":[[5948,7]]},"825":{"position":[[1469,7]]}}}],["altern",{"_index":1311,"t":{"159":{"position":[[260,11]]}}}],["although",{"_index":33,"t":{"3":{"position":[[470,8]]},"486":{"position":[[5893,8]]},"590":{"position":[[472,8],[5904,8]]},"651":{"position":[[19562,9]]}}}],["alway",{"_index":131,"t":{"3":{"position":[[2799,6]]},"205":{"position":[[139,6]]},"420":{"position":[[572,6]]},"458":{"position":[[247,6]]}}}],["ami",{"_index":2812,"t":{"817":{"position":[[136,3],[281,3],[937,3]]},"819":{"position":[[615,3]]},"821":{"position":[[252,3],[1978,3],[2770,3],[3948,3],[5502,3],[6730,3],[7774,3],[7990,3],[45146,3],[45187,3],[45345,3],[45379,3],[45516,3],[45551,3]]},"823":{"position":[[5794,3],[5921,4],[7360,3],[13104,3],[13145,3],[13303,3],[13337,3],[13474,3],[13509,3]]},"825":{"position":[[842,4],[1200,3],[20915,3],[57522,3],[57563,3],[57620,3],[57655,3],[57706,3],[57749,3],[57808,3],[57838,3],[57884,3],[57914,3],[57960,3],[58001,3],[58057,3],[58098,3]]}}}],["amount",{"_index":61,"t":{"3":{"position":[[889,6]]},"5":{"position":[[413,7]]},"161":{"position":[[820,6]]}}}],["ancestor",{"_index":1873,"t":{"426":{"position":[[5640,10]]}}}],["and.statu",{"_index":239,"t":{"9":{"position":[[1106,10]]}}}],["and/or",{"_index":1739,"t":{"392":{"position":[[245,6]]},"394":{"position":[[99,6]]},"440":{"position":[[263,6]]},"679":{"position":[[275,6]]},"685":{"position":[[117,6]]},"687":{"position":[[253,6]]},"825":{"position":[[1418,6]]}}}],["andr",{"_index":365,"t":{"27":{"position":[[313,6]]}}}],["ann",{"_index":662,"t":{"49":{"position":[[1859,4],[1956,4],[2386,4]]},"51":{"position":[[1346,4],[1447,4],[1494,4],[1624,4],[1670,4],[1799,4],[1868,4],[1919,4],[1966,4]]},"53":{"position":[[2023,4],[2257,4],[2376,4],[2448,4]]},"55":{"position":[[674,4],[799,4],[1287,4]]},"57":{"position":[[711,4],[843,4],[1223,4],[1274,5],[1463,4],[1545,4],[1695,4]]},"59":{"position":[[692,4],[855,4],[1319,4],[1498,4],[1580,4],[1759,4]]},"95":{"position":[[43,4]]},"121":{"position":[[68,4]]},"169":{"position":[[5877,4],[10510,4],[10946,4],[18382,4],[24755,4]]},"236":{"position":[[40,4]]},"238":{"position":[[44,4]]},"265":{"position":[[39,4],[132,4],[285,4],[340,4]]},"267":{"position":[[30,4],[5649,4]]},"273":{"position":[[1366,4],[2139,7],[3226,7],[4592,7],[6131,4],[6749,7],[6778,6],[6983,4],[7749,4],[8899,4],[10425,4],[11625,4],[12613,4],[12874,4]]},"282":{"position":[[103,4],[313,4]]},"284":{"position":[[62,4]]},"331":{"position":[[125,4],[232,4],[358,4]]},"382":{"position":[[835,4],[999,4],[1079,4]]},"402":{"position":[[916,4]]},"406":{"position":[[55,4],[70,4],[927,4],[2205,4],[3918,4],[5256,4],[6590,4]]},"428":{"position":[[1602,4],[1834,4],[1939,4],[2569,4],[2607,4],[2656,4],[2705,4],[2753,4],[3390,4],[3498,4],[3557,4],[3616,4],[3664,4]]},"556":{"position":[[105,4]]},"627":{"position":[[801,4],[2129,4],[3892,4],[5280,4],[6700,4]]},"629":{"position":[[5741,4]]},"631":{"position":[[6023,4]]},"649":{"position":[[1121,4],[1281,4],[7028,4]]},"661":{"position":[[2856,4],[3238,4],[3370,4],[3502,4],[4348,4],[4539,4],[4730,4],[5946,4],[6088,4],[6230,4],[7071,4],[7212,4],[7353,4],[9707,4],[9843,4],[9979,4]]},"663":{"position":[[54,4],[158,4],[268,4]]},"665":{"position":[[183,4],[379,4]]},"667":{"position":[[120,4],[205,4],[2034,4],[11323,4],[11361,4]]},"669":{"position":[[2476,4],[2646,4],[2698,4],[4632,4],[5447,4],[6628,4],[8185,4],[9416,4],[10459,4]]},"671":{"position":[[213,4],[815,4],[1069,4],[1866,4],[3075,4],[4660,4],[5920,4],[6955,4],[7158,4],[9828,4],[12615,4],[12644,4],[12673,4],[12702,4],[12733,4],[12763,4]]},"673":{"position":[[2777,4],[2909,4],[3041,4],[3887,4],[4078,4],[4269,4],[5485,4],[5627,4],[5769,4],[6610,4],[6751,4],[6892,4],[9246,4],[9382,4],[9518,4]]},"705":{"position":[[18904,4]]},"721":{"position":[[331,5],[520,4],[562,4],[616,4]]},"726":{"position":[[20355,4],[21783,4],[23705,4],[25203,4],[26883,4],[27754,4],[28078,4]]},"728":{"position":[[84,4],[242,4],[8154,4],[13969,4],[22475,7],[22555,4],[22605,4],[30569,4],[32768,4],[40146,4],[41923,4],[41965,4],[42019,4],[48069,4],[48099,4],[48145,4],[48178,4],[48226,4],[48253,4]]},"742":{"position":[[35,4],[503,4]]},"745":{"position":[[1728,4],[7448,4]]},"761":{"position":[[2195,4],[3304,4],[4943,4],[7135,4],[8854,4],[11001,4]]},"763":{"position":[[60,4],[103,4],[148,4],[221,4],[270,4]]},"767":{"position":[[315,4],[23375,4]]},"769":{"position":[[4223,4],[4373,4],[4425,4],[5274,7],[6359,7],[7723,7],[9258,4],[9872,7],[9901,6],[18869,4],[19594,4],[19741,4],[20896,4],[21102,4],[22633,4],[22790,4],[23995,4],[24151,4],[25351,4],[25502,4],[25737,4],[25803,4]]},"771":{"position":[[304,4],[974,4],[1042,4],[1819,4],[1993,4],[3176,4],[3409,4],[4968,4],[5152,4],[6386,4],[6569,4],[7723,4],[7901,4],[8412,4],[15340,4]]},"773":{"position":[[4032,4],[6927,4],[10847,4],[13902,4],[19151,4]]},"789":{"position":[[136,4],[215,4]]},"795":{"position":[[22,4],[411,4],[462,4],[6107,4],[18909,4],[18986,4],[19012,4],[24704,4],[30407,4],[30459,4],[30494,4],[30631,4],[30670,4],[30819,4],[30851,4]]},"797":{"position":[[30,4],[980,5],[2489,4],[16071,5],[16140,4],[16175,4],[16312,4],[16351,4],[16500,4],[16532,4]]},"799":{"position":[[23326,4],[23361,4],[23496,4],[23535,4],[23682,4],[23714,4]]},"801":{"position":[[39,4],[161,4],[304,4],[2393,4],[2709,4]]},"841":{"position":[[35,5],[250,5],[456,5]]},"844":{"position":[[13197,4],[30194,4]]},"846":{"position":[[2816,5],[4256,5],[6249,5],[7769,5],[9635,5]]},"850":{"position":[[170,4],[2676,4],[3517,4],[5009,4],[6995,4],[8557,4],[10371,4],[10882,4]]}}}],["anne'",{"_index":1653,"t":{"329":{"position":[[12298,6],[13572,6],[15297,6],[16658,6],[17586,6]]},"669":{"position":[[4674,6]]},"671":{"position":[[429,6]]}}}],["anoth",{"_index":601,"t":{"45":{"position":[[207,8]]},"51":{"position":[[893,7]]},"53":{"position":[[0,7],[219,7],[3068,7]]},"169":{"position":[[734,7],[3927,7]]},"173":{"position":[[83,7]]},"273":{"position":[[7022,7],[12988,7]]},"320":{"position":[[270,7]]},"359":{"position":[[12296,7]]},"363":{"position":[[311,7]]},"371":{"position":[[313,7]]},"386":{"position":[[483,7],[687,7]]},"402":{"position":[[348,7]]},"420":{"position":[[1773,7],[1988,7]]},"422":{"position":[[815,7],[1030,7],[2655,7],[2870,7]]},"424":{"position":[[1145,7],[1360,7]]},"426":{"position":[[4282,7],[7034,7]]},"466":{"position":[[343,7]]},"490":{"position":[[154,8],[454,7]]},"548":{"position":[[107,7],[182,7]]},"558":{"position":[[0,7]]},"619":{"position":[[1096,7],[2325,7],[3930,7],[5209,7],[6310,7]]},"653":{"position":[[170,7]]},"713":{"position":[[761,7]]},"728":{"position":[[21952,7],[22329,7]]},"730":{"position":[[367,7]]},"732":{"position":[[509,7],[1103,7]]},"777":{"position":[[137,7]]},"781":{"position":[[804,7]]},"807":{"position":[[403,7]]},"831":{"position":[[399,7],[1185,7]]},"848":{"position":[[430,7]]},"850":{"position":[[351,7]]}}}],["answer",{"_index":1337,"t":{"169":{"position":[[20,7],[3454,6]]},"177":{"position":[[65,6]]},"416":{"position":[[472,7],[1098,6],[1194,6]]},"418":{"position":[[54,6]]},"426":{"position":[[153,7]]},"428":{"position":[[239,6]]},"583":{"position":[[21,6],[113,6]]},"625":{"position":[[1982,6]]},"728":{"position":[[54,6]]},"771":{"position":[[696,7]]},"797":{"position":[[1097,7]]},"825":{"position":[[342,7],[511,7],[674,7]]}}}],["anyon",{"_index":2010,"t":{"502":{"position":[[1121,6]]},"512":{"position":[[414,6],[465,6],[525,6]]},"649":{"position":[[33140,6]]},"797":{"position":[[665,6],[792,6]]},"815":{"position":[[1216,6]]},"823":{"position":[[6016,6]]},"825":{"position":[[2954,6]]}}}],["anyth",{"_index":1297,"t":{"155":{"position":[[1025,8]]},"426":{"position":[[869,8]]}}}],["api",{"_index":202,"t":{"9":{"position":[[73,3]]},"15":{"position":[[249,3]]},"31":{"position":[[1237,5]]},"37":{"position":[[704,4],[8256,3],[8322,3],[8411,3]]},"45":{"position":[[127,3],[468,3],[496,3],[641,4],[757,3]]},"49":{"position":[[1000,3]]},"61":{"position":[[40,3]]},"67":{"position":[[88,4]]},"75":{"position":[[218,3],[293,4]]},"89":{"position":[[48,4],[214,3]]},"97":{"position":[[25,4],[61,3]]},"101":{"position":[[114,3],[133,3]]},"113":{"position":[[752,3],[1129,3],[2624,4],[2668,3]]},"123":{"position":[[25,4],[61,3]]},"127":{"position":[[121,3],[147,3]]},"135":{"position":[[96,3],[171,4]]},"141":{"position":[[383,4],[419,4]]},"155":{"position":[[723,3],[1121,3]]},"169":{"position":[[3028,3],[3267,3],[3313,4],[24159,3],[30791,3],[31420,3]]},"209":{"position":[[209,3]]},"223":{"position":[[720,5]]},"238":{"position":[[25,3]]},"248":{"position":[[25,4],[61,3]]},"250":{"position":[[56,4]]},"252":{"position":[[55,4]]},"254":{"position":[[347,3]]},"265":{"position":[[326,3]]},"267":{"position":[[5768,3]]},"288":{"position":[[54,3],[176,3]]},"292":{"position":[[139,4]]},"294":{"position":[[37,3]]},"296":{"position":[[3098,3],[3287,3],[3478,3],[3496,3],[3670,3]]},"306":{"position":[[145,4]]},"308":{"position":[[27,3],[173,4]]},"310":{"position":[[1179,3],[1272,3],[1582,3]]},"329":{"position":[[88,4],[11337,3],[11504,3]]},"331":{"position":[[656,3]]},"333":{"position":[[164,3],[189,3]]},"382":{"position":[[980,3]]},"384":{"position":[[795,4]]},"386":{"position":[[844,3],[1423,3]]},"426":{"position":[[10275,3]]},"452":{"position":[[383,5]]},"456":{"position":[[3338,4]]},"462":{"position":[[2124,3]]},"468":{"position":[[175,3]]},"570":{"position":[[102,3]]},"579":{"position":[[10,3],[20,3]]},"581":{"position":[[5838,3]]},"586":{"position":[[9,3],[19,3]]},"590":{"position":[[9,3],[274,3],[5994,3]]},"593":{"position":[[11,3]]},"598":{"position":[[16,3],[26,3]]},"600":{"position":[[20,3],[6828,4]]},"606":{"position":[[92,3],[145,3],[159,3],[211,3],[227,3],[281,3],[302,3],[361,3]]},"655":{"position":[[480,3]]},"673":{"position":[[10290,3],[10319,3],[10427,3]]},"675":{"position":[[356,3],[381,3]]},"679":{"position":[[1785,3],[1807,3]]},"683":{"position":[[845,3],[867,3]]},"703":{"position":[[6016,3]]},"705":{"position":[[110,3]]},"707":{"position":[[555,3]]},"755":{"position":[[507,3]]},"771":{"position":[[596,4]]},"773":{"position":[[21192,3],[21221,3],[21329,3],[21491,3]]},"777":{"position":[[346,3],[371,3]]}}}],["api'",{"_index":557,"t":{"37":{"position":[[8369,5]]}}}],["api.fga.exampl",{"_index":467,"t":{"37":{"position":[[1191,15],[2382,15],[4238,15],[5703,15]]},"43":{"position":[[802,15],[1776,15]]},"97":{"position":[[464,15],[1016,15],[1927,15],[2639,15]]},"113":{"position":[[4775,15]]},"123":{"position":[[464,15],[1016,15],[1927,15],[2639,15]]},"169":{"position":[[12746,15],[13601,15],[14926,15],[16017,15],[18940,15],[19795,15],[21120,15],[22211,15],[25294,15],[26170,15],[27549,15],[28682,15]]},"215":{"position":[[413,15],[1041,15],[1862,15],[2570,15]]},"217":{"position":[[761,15],[1530,15],[2590,15],[3672,15]]},"219":{"position":[[637,15],[1555,15],[2753,15],[4233,15]]},"236":{"position":[[577,15],[1387,15],[2822,15],[3937,15]]},"238":{"position":[[587,15],[1439,15],[2761,15],[3849,15],[6331,15],[7185,15],[8509,15],[9599,15]]},"248":{"position":[[464,15],[1016,15],[1927,15],[2639,15]]},"265":{"position":[[887,15],[1729,15],[3041,15],[4119,15]]},"267":{"position":[[598,15],[1403,15],[2833,15],[3943,15],[6302,15],[7145,15],[8458,15],[9537,15]]},"273":{"position":[[1892,15],[2740,15],[4058,15],[5142,15],[7530,15],[8377,15],[9849,15],[11001,15],[13554,15],[14406,15],[15728,15],[16816,15],[19156,15],[20010,15],[21334,15],[22424,15]]},"282":{"position":[[839,15],[1648,15],[3082,15],[4196,15]]},"284":{"position":[[630,15],[1483,15],[2806,15],[3895,15]]},"294":{"position":[[436,15],[988,15],[1899,15],[2611,15]]},"329":{"position":[[684,15],[1485,15],[2911,15],[4017,15],[6265,15],[7067,15],[8494,15],[9601,15],[12079,15],[13050,15],[14721,15],[16034,15]]},"353":{"position":[[726,15],[1579,15],[2902,15],[3991,15],[6336,15],[7188,15],[8510,15],[9598,15]]},"359":{"position":[[845,15],[1714,15],[3208,15],[4382,15],[7021,15],[7874,15],[9197,15],[10286,15],[12835,15],[13688,15],[15011,15],[16100,15]]},"375":{"position":[[760,15],[1620,15],[2950,15],[4046,15]]},"382":{"position":[[1705,15],[2555,15],[3875,15],[4961,15]]},"406":{"position":[[708,15],[1683,15],[3342,15],[4632,15],[7462,15],[8317,15],[9642,15],[10733,15]]},"408":{"position":[[610,15],[1695,15],[3464,15],[4864,15]]},"410":{"position":[[556,15],[1411,15],[2736,15],[3827,15]]},"446":{"position":[[639,15],[1461,15],[2908,15],[4035,15]]},"448":{"position":[[660,15],[1520,15],[2850,15],[3946,15],[6497,15],[7358,15],[8689,15],[9786,15]]},"482":{"position":[[726,15],[1582,15],[2908,15],[4000,15],[6360,15],[7215,15],[8540,15],[9631,15]]},"486":{"position":[[686,15],[1543,15],[2870,15],[3963,15],[6485,15],[7342,15],[8669,15],[9762,15]]},"504":{"position":[[614,15],[1422,15],[2855,15],[3968,15]]},"506":{"position":[[616,15],[1504,15],[3017,15],[4210,15]]},"508":{"position":[[733,15],[1593,15],[2923,15],[4019,15]]},"522":{"position":[[800,15],[1660,15],[3145,15],[4310,15]]},"524":{"position":[[865,15],[1721,15],[3047,15],[4139,15]]},"540":{"position":[[623,15],[1433,15],[2868,15],[3983,15]]},"542":{"position":[[956,15],[1843,15],[3355,15],[4547,15]]},"544":{"position":[[793,15],[1655,15],[2987,15],[4085,15]]},"556":{"position":[[702,15],[1563,15],[3108,15],[4284,15]]},"560":{"position":[[709,15],[1566,15],[3107,15],[4279,15]]},"562":{"position":[[720,15],[1529,15],[2963,15],[4077,15]]},"564":{"position":[[566,15],[1407,15],[2718,15],[3795,15],[6080,15],[6921,15],[8232,15],[9309,15]]},"566":{"position":[[603,15],[1404,15],[2830,15],[3936,15],[6140,15],[6982,15],[8294,15],[9372,15]]},"581":{"position":[[725,15],[1576,15],[2897,15],[3984,15]]},"588":{"position":[[975,15],[1871,15],[3289,15],[4429,15],[7131,15],[8008,15],[9387,15],[10506,15],[13112,15],[13999,15],[15388,15],[16517,15]]},"590":{"position":[[1178,15],[1956,15],[3256,15],[4278,15]]},"595":{"position":[[716,15],[1606,15],[2993,15],[4142,15],[6628,15],[7518,15],[8905,15],[10054,15]]},"600":{"position":[[637,15],[1620,15],[3108,15],[4362,15]]},"619":{"position":[[852,15],[1778,15],[3329,15],[4560,15]]},"621":{"position":[[667,15],[1530,15],[2863,15],[3962,15]]},"627":{"position":[[577,15],[1602,15],[3311,15],[4651,15]]},"629":{"position":[[596,15],[1451,15],[2776,15],[3867,15]]},"631":{"position":[[577,15],[1458,15],[2964,15],[4150,15],[6635,15],[7491,15],[8817,15],[9909,15],[12268,15],[13127,15],[14456,15],[15551,15]]},"649":{"position":[[1856,15],[2708,15],[4030,15],[5118,15],[8028,15],[8880,15],[10202,15],[11290,15],[14849,15],[15704,15],[17029,15],[18120,15],[21686,15],[22538,15],[23860,15],[24948,15],[27922,15],[28775,15],[30098,15],[31187,15]]},"651":{"position":[[1829,15],[2682,15],[4005,15],[5094,15],[8078,15],[8934,15],[10260,15],[11352,15],[14422,15],[15276,15],[16600,15],[17690,15],[20745,15],[21599,15],[22923,15],[24013,15]]},"669":{"position":[[5228,15],[6106,15],[7609,15],[8792,15]]},"671":{"position":[[1619,15],[2525,15],[4056,15],[5267,15]]},"691":{"position":[[848,15],[1793,15],[3422,15],[4682,15],[7396,15],[8249,15],[9572,15],[10661,15],[13391,15],[14244,15],[15567,15],[16656,15],[19077,15],[19932,15],[21257,15],[22348,15],[24703,15],[25557,15],[26881,15],[27971,15]]},"701":{"position":[[1543,15],[2397,15],[3721,15],[4811,15],[7161,15],[8014,15],[9337,15],[10426,15]]},"703":{"position":[[667,15],[1528,15],[3014,15],[4180,15],[6551,15],[7408,15],[8735,15],[9828,15]]},"705":{"position":[[642,15],[1606,15],[3032,15],[4234,15],[6919,15],[7805,15],[9375,15],[10576,15],[13181,15],[14068,15],[15639,15],[16841,15],[19483,15],[20337,15],[21661,15],[22751,15],[25146,15],[25998,15],[27320,15],[28408,15]]},"726":{"position":[[681,15],[2336,15],[4911,15],[6921,15],[11999,15],[13194,15],[15132,15],[16652,15],[20136,15],[21261,15],[23129,15],[24579,15],[28735,15],[29588,15],[30911,15],[32000,15],[34494,15],[35348,15],[36672,15],[37762,15],[40111,15],[40968,15],[42295,15],[43388,15],[45753,15],[46611,15],[47939,15],[49033,15]]},"728":{"position":[[777,15],[1631,15],[2955,15],[4045,15],[8696,15],[9546,15],[10866,15],[11952,15],[14613,15],[15472,15],[16801,15],[17896,15],[25055,15],[25913,15],[27241,15],[28335,15],[33303,15],[34152,15],[35471,15],[36556,15],[42863,15],[43712,15],[45031,15],[46116,15]]},"745":{"position":[[2308,15],[3125,15],[4567,15],[5689,15],[7992,15],[8847,15],[10172,15],[11263,15],[13682,15],[14499,15],[15941,15],[17063,15],[19323,15],[20178,15],[21503,15],[22594,15],[24949,15],[25805,15],[27131,15],[28223,15],[32683,15],[33538,15],[34863,15],[35954,15],[38309,15],[39164,15],[40489,15],[41580,15]]},"747":{"position":[[2837,15],[3883,15],[5613,15],[6974,15],[10151,15],[11008,15],[12335,15],[13428,15]]},"749":{"position":[[782,15],[1623,15],[3089,15],[4235,15],[7023,15],[7896,15],[9394,15],[10572,15],[12914,15],[13769,15],[15094,15],[16185,15]]},"751":{"position":[[3479,15],[4380,15],[5965,15],[7181,15],[10363,15],[11222,15],[12551,15],[13646,15],[17797,15],[18636,15],[20100,15],[21244,15]]},"761":{"position":[[3085,15],[4421,15],[6559,15],[8230,15]]},"767":{"position":[[912,15],[1762,15],[3082,15],[4168,15],[6600,15],[7454,15],[8778,15],[9868,15],[12325,15],[13201,15],[14702,15],[15883,15],[18235,15],[19086,15],[20407,15],[21494,15]]},"769":{"position":[[5027,15],[5873,15],[7189,15],[8271,15],[10832,15],[12076,15],[14063,15],[15632,15],[19375,15],[20374,15],[22057,15],[23371,15],[26314,15],[27164,15],[28484,15],[29570,15]]},"771":{"position":[[1572,15],[2626,15],[4364,15],[5733,15],[9009,15],[10028,15],[11536,15],[12823,15],[15935,15],[16955,15],[18464,15],[19752,15]]},"773":{"position":[[3813,15],[6405,15],[10271,15],[13278,15]]},"795":{"position":[[994,15],[1810,15],[3251,15],[4372,15],[6642,15],[7462,15],[8907,15],[10032,15],[12326,15],[13289,15],[14995,15],[16283,15],[19560,15],[20414,15],[21738,15],[22828,15],[25259,15],[26111,15],[27433,15],[28521,15]]},"797":{"position":[[3412,15],[4428,15],[6246,15],[7597,15],[10888,15],[11745,15],[13072,15],[14165,15]]},"799":{"position":[[3317,15],[4221,15],[5809,15],[7028,15],[9842,15],[10941,15],[12842,15],[14276,15],[18072,15],[18923,15],[20244,15],[21331,15]]},"801":{"position":[[3512,15],[4478,15],[6187,15],[7478,15],[10764,15],[11620,15],[12946,15],[14038,15]]},"821":{"position":[[2551,15],[3426,15],[4926,15],[6106,15],[8528,15],[9388,15],[10718,15],[11814,15],[14262,15],[15137,15],[16637,15],[17817,15],[20196,15],[21056,15],[22386,15],[23482,15],[25939,15],[26806,15],[28143,15],[29246,15],[32100,15],[33225,15],[35093,15],[36543,15],[39900,15],[40760,15],[42090,15],[43186,15]]},"823":{"position":[[612,15],[1467,15],[2792,15],[3883,15],[7894,15],[8748,15],[10072,15],[11162,15]]},"825":{"position":[[7380,15],[8420,15],[10203,15],[11568,15],[14996,15],[15940,15],[17509,15],[18758,15],[21439,15],[22427,15],[24099,15],[25402,15],[28273,15],[29176,15],[30763,15],[31981,15],[34757,15],[35603,15],[37074,15],[38225,15],[40644,15],[41473,15],[42927,15],[44061,15],[46545,15],[47397,15],[48719,15],[49807,15],[52216,15],[53083,15],[54420,15],[55523,15]]},"844":{"position":[[2309,15],[3129,15],[4574,15],[5699,15],[8017,15],[8875,15],[10203,15],[11297,15],[13729,15],[14545,15],[15986,15],[17107,15],[19363,15],[20217,15],[21541,15],[22631,15],[24981,15],[25837,15],[27163,15],[28255,15],[32203,15],[33057,15],[34381,15],[35471,15],[37821,15],[38676,15],[40001,15],[41092,15]]},"846":{"position":[[2592,15],[3729,15],[5668,15],[7140,15],[10825,15],[11683,15],[13011,15],[14105,15]]},"848":{"position":[[2425,15],[3441,15],[5141,15],[6472,15],[9738,15],[10599,15],[11930,15],[13027,15]]},"850":{"position":[[3298,15],[4487,15],[6419,15],[7933,15],[11408,15],[12270,15],[13602,15],[14700,15],[17166,15],[18030,15],[19364,15],[20464,15],[22863,15],[23729,15],[25065,15],[26167,15],[28655,15],[29519,15],[30853,15],[31953,15],[34352,15],[35216,15],[36550,15],[37650,15]]}}}],["api.openfga.exampl",{"_index":566,"t":{"43":{"position":[[322,19]]},"77":{"position":[[641,19]]}}}],["api_audi",{"_index":1472,"t":{"219":{"position":[[3848,13]]}}}],["api_host",{"_index":529,"t":{"37":{"position":[[5616,8]]},"43":{"position":[[2527,8]]},"97":{"position":[[2552,8]]},"123":{"position":[[2552,8]]},"169":{"position":[[15930,8],[22124,8],[28595,8]]},"215":{"position":[[2483,8]]},"217":{"position":[[3585,8]]},"219":{"position":[[4146,8]]},"236":{"position":[[3850,8]]},"238":{"position":[[3762,8],[9512,8]]},"248":{"position":[[2552,8]]},"265":{"position":[[4032,8]]},"267":{"position":[[3856,8],[9450,8]]},"273":{"position":[[5055,8],[10914,8],[16729,8],[22337,8]]},"282":{"position":[[4109,8]]},"284":{"position":[[3808,8]]},"294":{"position":[[2524,8]]},"329":{"position":[[3930,8],[9514,8],[15947,8]]},"353":{"position":[[3904,8],[9511,8]]},"359":{"position":[[4295,8],[10199,8],[16013,8]]},"375":{"position":[[3959,8]]},"382":{"position":[[4874,8]]},"406":{"position":[[4545,8],[10646,8]]},"408":{"position":[[4777,8]]},"410":{"position":[[3740,8]]},"446":{"position":[[3948,8]]},"448":{"position":[[3859,8],[9699,8]]},"482":{"position":[[3913,8],[9544,8]]},"486":{"position":[[3876,8],[9675,8]]},"504":{"position":[[3881,8]]},"506":{"position":[[4123,8]]},"508":{"position":[[3932,8]]},"522":{"position":[[4223,8]]},"524":{"position":[[4052,8]]},"540":{"position":[[3896,8]]},"542":{"position":[[4460,8]]},"544":{"position":[[3998,8]]},"556":{"position":[[4197,8]]},"560":{"position":[[4192,8]]},"562":{"position":[[3990,8]]},"564":{"position":[[3708,8],[9222,8]]},"566":{"position":[[3849,8],[9285,8]]},"581":{"position":[[3897,8]]},"588":{"position":[[4342,8],[10419,8],[16430,8]]},"590":{"position":[[4191,8]]},"595":{"position":[[4055,8],[9967,8]]},"600":{"position":[[4275,8]]},"619":{"position":[[4473,8]]},"621":{"position":[[3875,8]]},"627":{"position":[[4564,8]]},"629":{"position":[[3780,8]]},"631":{"position":[[4063,8],[9822,8],[15464,8]]},"649":{"position":[[5031,8],[11203,8],[18033,8],[24861,8],[31100,8]]},"651":{"position":[[5007,8],[11265,8],[17603,8],[23926,8]]},"669":{"position":[[8705,8]]},"671":{"position":[[5180,8]]},"691":{"position":[[4595,8],[10574,8],[16569,8],[22261,8],[27884,8]]},"701":{"position":[[4724,8],[10339,8]]},"703":{"position":[[4093,8],[9741,8]]},"705":{"position":[[4147,8],[10489,8],[16754,8],[22664,8],[28321,8]]},"726":{"position":[[6834,8],[16565,8],[24492,8],[31913,8],[37675,8],[43301,8],[48946,8]]},"728":{"position":[[3958,8],[11865,8],[17809,8],[28248,8],[36469,8],[46029,8]]},"745":{"position":[[5602,8],[11176,8],[16976,8],[22507,8],[28136,8],[35867,8],[41493,8]]},"747":{"position":[[6887,8],[13341,8]]},"749":{"position":[[4148,8],[10485,8],[16098,8]]},"751":{"position":[[7094,8],[13559,8],[21157,8]]},"761":{"position":[[8143,8]]},"767":{"position":[[4081,8],[9781,8],[15796,8],[21407,8]]},"769":{"position":[[8184,8],[15545,8],[23284,8],[29483,8]]},"771":{"position":[[5646,8],[12736,8],[19665,8]]},"773":{"position":[[13191,8]]},"795":{"position":[[4285,8],[9945,8],[16196,8],[22741,8],[28434,8]]},"797":{"position":[[7510,8],[14078,8]]},"799":{"position":[[6941,8],[14189,8],[21244,8]]},"801":{"position":[[7391,8],[13951,8]]},"821":{"position":[[6019,8],[11727,8],[17730,8],[23395,8],[29159,8],[36456,8],[43099,8]]},"823":{"position":[[3796,8],[11075,8]]},"825":{"position":[[11481,8],[18671,8],[25315,8],[31894,8],[38138,8],[43974,8],[49720,8],[55436,8]]},"844":{"position":[[5612,8],[11210,8],[17020,8],[22544,8],[28168,8],[35384,8],[41005,8]]},"846":{"position":[[7053,8],[14018,8]]},"848":{"position":[[6385,8],[12940,8]]},"850":{"position":[[7846,8],[14613,8],[20377,8],[26080,8],[31866,8],[37563,8]]}}}],["api_issu",{"_index":1470,"t":{"219":{"position":[[3796,11]]}}}],["api_respons",{"_index":536,"t":{"37":{"position":[[6114,12]]},"43":{"position":[[2824,12]]},"97":{"position":[[3050,12]]},"123":{"position":[[3050,12]]},"169":{"position":[[16428,12],[22622,12],[29093,12]]},"215":{"position":[[2916,12]]},"217":{"position":[[4045,12]]},"219":{"position":[[4606,12]]},"236":{"position":[[4348,12]]},"238":{"position":[[4260,12],[10010,12]]},"248":{"position":[[3050,12]]},"265":{"position":[[4530,12]]},"267":{"position":[[4354,12],[9948,12]]},"273":{"position":[[5553,12],[11412,12],[17227,12],[22835,12]]},"282":{"position":[[4607,12]]},"284":{"position":[[4306,12]]},"294":{"position":[[3022,12]]},"329":{"position":[[4428,12],[10012,12],[16445,12]]},"353":{"position":[[4402,12],[10009,12]]},"359":{"position":[[4793,12],[10697,12],[16511,12]]},"375":{"position":[[4457,12]]},"382":{"position":[[5372,12]]},"406":{"position":[[5043,12],[11144,12]]},"408":{"position":[[5275,12]]},"410":{"position":[[4238,12]]},"446":{"position":[[4446,12]]},"448":{"position":[[4357,12],[10197,12]]},"482":{"position":[[4411,12],[10042,12]]},"486":{"position":[[4374,12],[10173,12]]},"504":{"position":[[4379,12]]},"506":{"position":[[4621,12]]},"508":{"position":[[4430,12]]},"522":{"position":[[4721,12]]},"524":{"position":[[4550,12]]},"540":{"position":[[4394,12]]},"542":{"position":[[4958,12]]},"544":{"position":[[4496,12]]},"556":{"position":[[4695,12]]},"560":{"position":[[4690,12]]},"562":{"position":[[4488,12]]},"564":{"position":[[4206,12],[9720,12]]},"566":{"position":[[4347,12],[9783,12]]},"581":{"position":[[4395,12]]},"588":{"position":[[4840,12],[10917,12],[16928,12]]},"590":{"position":[[4689,12]]},"595":{"position":[[4553,12],[10465,12]]},"600":{"position":[[4773,12]]},"619":{"position":[[4971,12]]},"621":{"position":[[4373,12]]},"627":{"position":[[5062,12]]},"629":{"position":[[4278,12]]},"631":{"position":[[4561,12],[10320,12],[15962,12]]},"649":{"position":[[5529,12],[11701,12],[18531,12],[25359,12],[31598,12]]},"651":{"position":[[5505,12],[11763,12],[18101,12],[24424,12]]},"669":{"position":[[9203,12]]},"671":{"position":[[5678,12]]},"691":{"position":[[5093,12],[11072,12],[17067,12],[22759,12],[28382,12]]},"701":{"position":[[5222,12],[10837,12]]},"703":{"position":[[4591,12],[10239,12]]},"705":{"position":[[4645,12],[10987,12],[17252,12],[23162,12],[28819,12]]},"726":{"position":[[7332,12],[17063,12],[24990,12],[32411,12],[38173,12],[43799,12],[49444,12]]},"728":{"position":[[4456,12],[12363,12],[18307,12],[28746,12],[36967,12],[46527,12]]},"745":{"position":[[6100,12],[11674,12],[17474,12],[23005,12],[28634,12],[36365,12],[41991,12]]},"747":{"position":[[7385,12],[13839,12]]},"749":{"position":[[4646,12],[10983,12],[16596,12]]},"751":{"position":[[7592,12],[14057,12],[21655,12]]},"761":{"position":[[8641,12]]},"767":{"position":[[4579,12],[10279,12],[16294,12],[21905,12]]},"769":{"position":[[8682,12],[16043,12],[23782,12],[29981,12]]},"771":{"position":[[6144,12],[13234,12],[20163,12]]},"773":{"position":[[13689,12]]},"795":{"position":[[4783,12],[10443,12],[16694,12],[23239,12],[28932,12]]},"797":{"position":[[8008,12],[14576,12]]},"799":{"position":[[7439,12],[14687,12],[21742,12]]},"801":{"position":[[7889,12],[14449,12]]},"821":{"position":[[6517,12],[12225,12],[18228,12],[23893,12],[29657,12],[36954,12],[43597,12]]},"823":{"position":[[4294,12],[11573,12]]},"825":{"position":[[11979,12],[19169,12],[25813,12],[32392,12],[38636,12],[44472,12],[50218,12],[55934,12]]},"844":{"position":[[6110,12],[11708,12],[17518,12],[23042,12],[28666,12],[35882,12],[41503,12]]},"846":{"position":[[7551,12],[14516,12]]},"848":{"position":[[6883,12],[13438,12]]},"850":{"position":[[8344,12],[15111,12],[20875,12],[26578,12],[32364,12],[38061,12]]}}}],["api_schem",{"_index":527,"t":{"37":{"position":[[5521,10]]},"97":{"position":[[2457,10]]},"123":{"position":[[2457,10]]},"169":{"position":[[15835,10],[22029,10],[28500,10]]},"215":{"position":[[2378,10]]},"217":{"position":[[3480,10]]},"219":{"position":[[4041,10]]},"236":{"position":[[3755,10]]},"238":{"position":[[3667,10],[9417,10]]},"248":{"position":[[2457,10]]},"265":{"position":[[3937,10]]},"267":{"position":[[3761,10],[9355,10]]},"273":{"position":[[4960,10],[10819,10],[16634,10],[22242,10]]},"282":{"position":[[4014,10]]},"284":{"position":[[3713,10]]},"294":{"position":[[2429,10]]},"329":{"position":[[3835,10],[9419,10],[15852,10]]},"353":{"position":[[3809,10],[9416,10]]},"359":{"position":[[4200,10],[10104,10],[15918,10]]},"375":{"position":[[3864,10]]},"382":{"position":[[4779,10]]},"406":{"position":[[4450,10],[10551,10]]},"408":{"position":[[4682,10]]},"410":{"position":[[3645,10]]},"446":{"position":[[3853,10]]},"448":{"position":[[3764,10],[9604,10]]},"482":{"position":[[3818,10],[9449,10]]},"486":{"position":[[3781,10],[9580,10]]},"504":{"position":[[3786,10]]},"506":{"position":[[4028,10]]},"508":{"position":[[3837,10]]},"522":{"position":[[4128,10]]},"524":{"position":[[3957,10]]},"540":{"position":[[3801,10]]},"542":{"position":[[4365,10]]},"544":{"position":[[3903,10]]},"556":{"position":[[4102,10]]},"560":{"position":[[4097,10]]},"562":{"position":[[3895,10]]},"564":{"position":[[3613,10],[9127,10]]},"566":{"position":[[3754,10],[9190,10]]},"581":{"position":[[3802,10]]},"588":{"position":[[4247,10],[10324,10],[16335,10]]},"590":{"position":[[4096,10]]},"595":{"position":[[3960,10],[9872,10]]},"600":{"position":[[4180,10]]},"619":{"position":[[4378,10]]},"621":{"position":[[3780,10]]},"627":{"position":[[4469,10]]},"629":{"position":[[3685,10]]},"631":{"position":[[3968,10],[9727,10],[15369,10]]},"649":{"position":[[4936,10],[11108,10],[17938,10],[24766,10],[31005,10]]},"651":{"position":[[4912,10],[11170,10],[17508,10],[23831,10]]},"669":{"position":[[8610,10]]},"671":{"position":[[5085,10]]},"691":{"position":[[4500,10],[10479,10],[16474,10],[22166,10],[27789,10]]},"701":{"position":[[4629,10],[10244,10]]},"703":{"position":[[3998,10],[9646,10]]},"705":{"position":[[4052,10],[10394,10],[16659,10],[22569,10],[28226,10]]},"726":{"position":[[6739,10],[16470,10],[24397,10],[31818,10],[37580,10],[43206,10],[48851,10]]},"728":{"position":[[3863,10],[11770,10],[17714,10],[28153,10],[36374,10],[45934,10]]},"745":{"position":[[5507,10],[11081,10],[16881,10],[22412,10],[28041,10],[35772,10],[41398,10]]},"747":{"position":[[6792,10],[13246,10]]},"749":{"position":[[4053,10],[10390,10],[16003,10]]},"751":{"position":[[6999,10],[13464,10],[21062,10]]},"761":{"position":[[8048,10]]},"767":{"position":[[3986,10],[9686,10],[15701,10],[21312,10]]},"769":{"position":[[8089,10],[15450,10],[23189,10],[29388,10]]},"771":{"position":[[5551,10],[12641,10],[19570,10]]},"773":{"position":[[13096,10]]},"795":{"position":[[4190,10],[9850,10],[16101,10],[22646,10],[28339,10]]},"797":{"position":[[7415,10],[13983,10]]},"799":{"position":[[6846,10],[14094,10],[21149,10]]},"801":{"position":[[7296,10],[13856,10]]},"821":{"position":[[5924,10],[11632,10],[17635,10],[23300,10],[29064,10],[36361,10],[43004,10]]},"823":{"position":[[3701,10],[10980,10]]},"825":{"position":[[11386,10],[18576,10],[25220,10],[31799,10],[38043,10],[43879,10],[49625,10],[55341,10]]},"844":{"position":[[5517,10],[11115,10],[16925,10],[22449,10],[28073,10],[35289,10],[40910,10]]},"846":{"position":[[6958,10],[13923,10]]},"848":{"position":[[6290,10],[12845,10]]},"850":{"position":[[7751,10],[14518,10],[20282,10],[25985,10],[31771,10],[37468,10]]}}}],["apiaudi",{"_index":450,"t":{"37":{"position":[[779,12],[1959,12],[3621,12],[5333,12]]},"169":{"position":[[12334,12],[13178,12],[14309,12],[15647,12],[18528,12],[19372,12],[20503,12],[21841,12],[24882,12],[25747,12],[26932,12],[28312,12]]},"219":{"position":[[1045,12],[3287,11]]},"236":{"position":[[165,12],[964,12],[2205,12],[3567,12]]},"238":{"position":[[175,12],[1016,12],[2144,12],[3479,12],[5919,12],[6762,12],[7892,12],[9229,12]]},"265":{"position":[[475,12],[1306,12],[2424,12],[3749,12]]},"267":{"position":[[186,12],[980,12],[2216,12],[3573,12],[5890,12],[6722,12],[7841,12],[9167,12]]},"273":{"position":[[1480,12],[2317,12],[3441,12],[4772,12],[7118,12],[7954,12],[9232,12],[10631,12],[13142,12],[13983,12],[15111,12],[16446,12],[18744,12],[19587,12],[20717,12],[22054,12]]},"282":{"position":[[427,12],[1225,12],[2465,12],[3826,12]]},"284":{"position":[[218,12],[1060,12],[2189,12],[3525,12]]},"329":{"position":[[272,12],[1062,12],[2294,12],[3647,12],[5853,12],[6644,12],[7877,12],[9231,12],[11667,12],[12627,12],[14104,12],[15664,12]]},"353":{"position":[[314,12],[1156,12],[2285,12],[3621,12],[5924,12],[6765,12],[7893,12],[9228,12]]},"359":{"position":[[433,12],[1291,12],[2591,12],[4012,12],[6609,12],[7451,12],[8580,12],[9916,12],[12423,12],[13265,12],[14394,12],[15730,12]]},"375":{"position":[[348,12],[1197,12],[2333,12],[3676,12]]},"382":{"position":[[1293,12],[2132,12],[3258,12],[4591,12]]},"406":{"position":[[296,12],[1260,12],[2725,12],[4262,12],[7050,12],[7894,12],[9025,12],[10363,12]]},"408":{"position":[[198,12],[1272,12],[2847,12],[4494,12]]},"410":{"position":[[144,12],[988,12],[2119,12],[3457,12]]},"446":{"position":[[227,12],[1038,12],[2291,12],[3665,12]]},"448":{"position":[[248,12],[1097,12],[2233,12],[3576,12],[6085,12],[6935,12],[8072,12],[9416,12]]},"482":{"position":[[314,12],[1159,12],[2291,12],[3630,12],[5948,12],[6792,12],[7923,12],[9261,12]]},"486":{"position":[[274,12],[1120,12],[2253,12],[3593,12],[6073,12],[6919,12],[8052,12],[9392,12]]},"504":{"position":[[202,12],[999,12],[2238,12],[3598,12]]},"506":{"position":[[204,12],[1081,12],[2400,12],[3840,12]]},"508":{"position":[[321,12],[1170,12],[2306,12],[3649,12]]},"522":{"position":[[388,12],[1237,12],[2528,12],[3940,12]]},"524":{"position":[[453,12],[1298,12],[2430,12],[3769,12]]},"540":{"position":[[211,12],[1010,12],[2251,12],[3613,12]]},"542":{"position":[[544,12],[1420,12],[2738,12],[4177,12]]},"544":{"position":[[381,12],[1232,12],[2370,12],[3715,12]]},"556":{"position":[[290,12],[1140,12],[2491,12],[3914,12]]},"560":{"position":[[297,12],[1143,12],[2490,12],[3909,12]]},"562":{"position":[[308,12],[1106,12],[2346,12],[3707,12]]},"564":{"position":[[154,12],[984,12],[2101,12],[3425,12],[5668,12],[6498,12],[7615,12],[8939,12]]},"566":{"position":[[191,12],[981,12],[2213,12],[3566,12],[5728,12],[6559,12],[7677,12],[9002,12]]},"581":{"position":[[313,12],[1153,12],[2280,12],[3614,12]]},"588":{"position":[[563,12],[1448,12],[2672,12],[4059,12],[6719,12],[7585,12],[8770,12],[10136,12],[12700,12],[13576,12],[14771,12],[16147,12]]},"590":{"position":[[766,12],[1533,12],[2639,12],[3908,12]]},"595":{"position":[[304,12],[1183,12],[2376,12],[3772,12],[6216,12],[7095,12],[8288,12],[9684,12]]},"600":{"position":[[225,12],[1197,12],[2491,12],[3992,12]]},"619":{"position":[[440,12],[1355,12],[2712,12],[4190,12]]},"621":{"position":[[255,12],[1107,12],[2246,12],[3592,12]]},"627":{"position":[[165,12],[1179,12],[2694,12],[4281,12]]},"629":{"position":[[184,12],[1028,12],[2159,12],[3497,12]]},"631":{"position":[[165,12],[1035,12],[2347,12],[3780,12],[6223,12],[7068,12],[8200,12],[9539,12],[11856,12],[12704,12],[13839,12],[15181,12]]},"649":{"position":[[1444,12],[2285,12],[3413,12],[4748,12],[7616,12],[8457,12],[9585,12],[10920,12],[14437,12],[15281,12],[16412,12],[17750,12],[21274,12],[22115,12],[23243,12],[24578,12],[27510,12],[28352,12],[29481,12],[30817,12]]},"651":{"position":[[1417,12],[2259,12],[3388,12],[4724,12],[7666,12],[8511,12],[9643,12],[10982,12],[14010,12],[14853,12],[15983,12],[17320,12],[20333,12],[21176,12],[22306,12],[23643,12]]},"669":{"position":[[4816,12],[5683,12],[6992,12],[8422,12]]},"671":{"position":[[1207,12],[2102,12],[3439,12],[4897,12]]},"691":{"position":[[436,12],[1370,12],[2805,12],[4312,12],[6984,12],[7826,12],[8955,12],[10291,12],[12979,12],[13821,12],[14950,12],[16286,12],[18665,12],[19509,12],[20640,12],[21978,12],[24291,12],[25134,12],[26264,12],[27601,12]]},"701":{"position":[[1131,12],[1974,12],[3104,12],[4441,12],[6749,12],[7591,12],[8720,12],[10056,12]]},"703":{"position":[[255,12],[1105,12],[2397,12],[3810,12],[6139,12],[6985,12],[8118,12],[9458,12]]},"705":{"position":[[230,12],[1183,12],[2415,12],[3864,12],[6507,12],[7382,12],[8758,12],[10206,12],[12769,12],[13645,12],[15022,12],[16471,12],[19071,12],[19914,12],[21044,12],[22381,12],[24734,12],[25575,12],[26703,12],[28038,12]]},"726":{"position":[[269,12],[1913,12],[4294,12],[6551,12],[11587,12],[12771,12],[14515,12],[16282,12],[19724,12],[20838,12],[22512,12],[24209,12],[28323,12],[29165,12],[30294,12],[31630,12],[34082,12],[34925,12],[36055,12],[37392,12],[39699,12],[40545,12],[41678,12],[43018,12],[45341,12],[46188,12],[47322,12],[48663,12]]},"728":{"position":[[365,12],[1208,12],[2338,12],[3675,12],[8284,12],[9123,12],[10249,12],[11582,12],[14201,12],[15049,12],[16184,12],[17526,12],[24643,12],[25490,12],[26624,12],[27965,12],[32891,12],[33729,12],[34854,12],[36186,12],[42451,12],[43289,12],[44414,12],[45746,12]]},"745":{"position":[[1896,12],[2702,12],[3950,12],[5319,12],[7580,12],[8424,12],[9555,12],[10893,12],[13270,12],[14076,12],[15324,12],[16693,12],[18911,12],[19755,12],[20886,12],[22224,12],[24537,12],[25382,12],[26514,12],[27853,12],[32271,12],[33115,12],[34246,12],[35584,12],[37897,12],[38741,12],[39872,12],[41210,12]]},"747":{"position":[[2425,12],[3460,12],[4996,12],[6604,12],[9739,12],[10585,12],[11718,12],[13058,12]]},"749":{"position":[[370,12],[1200,12],[2472,12],[3865,12],[6611,12],[7473,12],[8777,12],[10202,12],[12502,12],[13346,12],[14477,12],[15815,12]]},"751":{"position":[[3067,12],[3957,12],[5348,12],[6811,12],[9951,12],[10799,12],[11934,12],[13276,12],[17385,12],[18213,12],[19483,12],[20874,12]]},"761":{"position":[[2673,12],[3998,12],[5942,12],[7860,12]]},"767":{"position":[[500,12],[1339,12],[2465,12],[3798,12],[6188,12],[7031,12],[8161,12],[9498,12],[11913,12],[12778,12],[14085,12],[15513,12],[17823,12],[18663,12],[19790,12],[21124,12]]},"769":{"position":[[4615,12],[5450,12],[6572,12],[7901,12],[10420,12],[11653,12],[13446,12],[15262,12],[18963,12],[19951,12],[21440,12],[23001,12],[25902,12],[26741,12],[27867,12],[29200,12]]},"771":{"position":[[1160,12],[2203,12],[3747,12],[5363,12],[8597,12],[9605,12],[10919,12],[12453,12],[15523,12],[16532,12],[17847,12],[19382,12]]},"773":{"position":[[3401,12],[5982,12],[9654,12],[12908,12]]},"795":{"position":[[582,12],[1387,12],[2634,12],[4002,12],[6230,12],[7039,12],[8290,12],[9662,12],[11914,12],[12866,12],[14378,12],[15913,12],[19148,12],[19991,12],[21121,12],[22458,12],[24847,12],[25688,12],[26816,12],[28151,12]]},"797":{"position":[[3000,12],[4005,12],[5629,12],[7227,12],[10476,12],[11322,12],[12455,12],[13795,12]]},"799":{"position":[[2905,12],[3798,12],[5192,12],[6658,12],[9430,12],[10518,12],[12225,12],[13906,12],[17660,12],[18500,12],[19627,12],[20961,12]]},"801":{"position":[[3100,12],[4055,12],[5570,12],[7108,12],[10352,12],[11197,12],[12329,12],[13668,12]]},"821":{"position":[[2139,12],[3003,12],[4309,12],[5736,12],[8116,12],[8965,12],[10101,12],[11444,12],[13850,12],[14714,12],[16020,12],[17447,12],[19784,12],[20633,12],[21769,12],[23112,12],[25527,12],[26383,12],[27526,12],[28876,12],[31688,12],[32802,12],[34476,12],[36173,12],[39488,12],[40337,12],[41473,12],[42816,12]]},"823":{"position":[[200,12],[1044,12],[2175,12],[3513,12],[7482,12],[8325,12],[9455,12],[10792,12]]},"825":{"position":[[6968,12],[7997,12],[9586,12],[11198,12],[14584,12],[15517,12],[16892,12],[18388,12],[21027,12],[22004,12],[23482,12],[25032,12],[27861,12],[28753,12],[30146,12],[31611,12],[34345,12],[35180,12],[36457,12],[37855,12],[40232,12],[41050,12],[42310,12],[43691,12],[46133,12],[46974,12],[48102,12],[49437,12],[51804,12],[52660,12],[53803,12],[55153,12]]},"844":{"position":[[1897,12],[2706,12],[3957,12],[5329,12],[7605,12],[8452,12],[9586,12],[10927,12],[13317,12],[14122,12],[15369,12],[16737,12],[18951,12],[19794,12],[20924,12],[22261,12],[24569,12],[25414,12],[26546,12],[27885,12],[31791,12],[32634,12],[33764,12],[35101,12],[37409,12],[38253,12],[39384,12],[40722,12]]},"846":{"position":[[2180,12],[3306,12],[5051,12],[6770,12],[10413,12],[11260,12],[12394,12],[13735,12]]},"848":{"position":[[2013,12],[3018,12],[4524,12],[6102,12],[9326,12],[10176,12],[11313,12],[12657,12]]},"850":{"position":[[2886,12],[4064,12],[5802,12],[7563,12],[10996,12],[11847,12],[12985,12],[14330,12],[16754,12],[17607,12],[18747,12],[20094,12],[22451,12],[23306,12],[24448,12],[25797,12],[28243,12],[29096,12],[30236,12],[31583,12],[33940,12],[34793,12],[35933,12],[37280,12]]}}}],["apihost",{"_index":463,"t":{"37":{"position":[[1111,8],[2301,8],[4131,7]]},"43":{"position":[[243,8],[721,8],[1669,7]]},"77":{"position":[[560,8]]},"97":{"position":[[384,8],[935,8],[1820,7]]},"113":{"position":[[1276,8],[4694,8]]},"123":{"position":[[384,8],[935,8],[1820,7]]},"169":{"position":[[12666,8],[13520,8],[14819,7],[18860,8],[19714,8],[21013,7],[25214,8],[26089,8],[27442,7]]},"215":{"position":[[333,8],[960,8],[1755,7]]},"217":{"position":[[681,8],[1449,8],[2483,7]]},"219":{"position":[[557,8],[1474,8],[2646,7]]},"236":{"position":[[497,8],[1306,8],[2715,7]]},"238":{"position":[[507,8],[1358,8],[2654,7],[6251,8],[7104,8],[8402,7]]},"248":{"position":[[384,8],[935,8],[1820,7]]},"265":{"position":[[807,8],[1648,8],[2934,7]]},"267":{"position":[[518,8],[1322,8],[2726,7],[6222,8],[7064,8],[8351,7]]},"273":{"position":[[1812,8],[2659,8],[3951,7],[7450,8],[8296,8],[9742,7],[13474,8],[14325,8],[15621,7],[19076,8],[19929,8],[21227,7]]},"282":{"position":[[759,8],[1567,8],[2975,7]]},"284":{"position":[[550,8],[1402,8],[2699,7]]},"294":{"position":[[356,8],[907,8],[1792,7]]},"329":{"position":[[604,8],[1404,8],[2804,7],[6185,8],[6986,8],[8387,7],[11999,8],[12969,8],[14614,7]]},"353":{"position":[[646,8],[1498,8],[2795,7],[6256,8],[7107,8],[8403,7]]},"359":{"position":[[765,8],[1633,8],[3101,7],[6941,8],[7793,8],[9090,7],[12755,8],[13607,8],[14904,7]]},"375":{"position":[[680,8],[1539,8],[2843,7]]},"382":{"position":[[1625,8],[2474,8],[3768,7]]},"406":{"position":[[628,8],[1602,8],[3235,7],[7382,8],[8236,8],[9535,7]]},"408":{"position":[[530,8],[1614,8],[3357,7]]},"410":{"position":[[476,8],[1330,8],[2629,7]]},"446":{"position":[[559,8],[1380,8],[2801,7]]},"448":{"position":[[580,8],[1439,8],[2743,7],[6417,8],[7277,8],[8582,7]]},"482":{"position":[[646,8],[1501,8],[2801,7],[6280,8],[7134,8],[8433,7]]},"486":{"position":[[606,8],[1462,8],[2763,7],[6405,8],[7261,8],[8562,7]]},"504":{"position":[[534,8],[1341,8],[2748,7]]},"506":{"position":[[536,8],[1423,8],[2910,7]]},"508":{"position":[[653,8],[1512,8],[2816,7]]},"522":{"position":[[720,8],[1579,8],[3038,7]]},"524":{"position":[[785,8],[1640,8],[2940,7]]},"540":{"position":[[543,8],[1352,8],[2761,7]]},"542":{"position":[[876,8],[1762,8],[3248,7]]},"544":{"position":[[713,8],[1574,8],[2880,7]]},"556":{"position":[[622,8],[1482,8],[3001,7]]},"560":{"position":[[629,8],[1485,8],[3000,7]]},"562":{"position":[[640,8],[1448,8],[2856,7]]},"564":{"position":[[486,8],[1326,8],[2611,7],[6000,8],[6840,8],[8125,7]]},"566":{"position":[[523,8],[1323,8],[2723,7],[6060,8],[6901,8],[8187,7]]},"581":{"position":[[645,8],[1495,8],[2790,7]]},"588":{"position":[[895,8],[1790,8],[3182,7],[7051,8],[7927,8],[9280,7],[13032,8],[13918,8],[15281,7]]},"590":{"position":[[1098,8],[1875,8],[3149,7]]},"595":{"position":[[636,8],[1525,8],[2886,7],[6548,8],[7437,8],[8798,7]]},"600":{"position":[[557,8],[1539,8],[3001,7]]},"619":{"position":[[772,8],[1697,8],[3222,7]]},"621":{"position":[[587,8],[1449,8],[2756,7]]},"627":{"position":[[497,8],[1521,8],[3204,7]]},"629":{"position":[[516,8],[1370,8],[2669,7]]},"631":{"position":[[497,8],[1377,8],[2857,7],[6555,8],[7410,8],[8710,7],[12188,8],[13046,8],[14349,7]]},"649":{"position":[[1776,8],[2627,8],[3923,7],[7948,8],[8799,8],[10095,7],[14769,8],[15623,8],[16922,7],[21606,8],[22457,8],[23753,7],[27842,8],[28694,8],[29991,7]]},"651":{"position":[[1749,8],[2601,8],[3898,7],[7998,8],[8853,8],[10153,7],[14342,8],[15195,8],[16493,7],[20665,8],[21518,8],[22816,7]]},"669":{"position":[[5148,8],[6025,8],[7502,7]]},"671":{"position":[[1539,8],[2444,8],[3949,7]]},"691":{"position":[[768,8],[1712,8],[3315,7],[7316,8],[8168,8],[9465,7],[13311,8],[14163,8],[15460,7],[18997,8],[19851,8],[21150,7],[24623,8],[25476,8],[26774,7]]},"701":{"position":[[1463,8],[2316,8],[3614,7],[7081,8],[7933,8],[9230,7]]},"703":{"position":[[587,8],[1447,8],[2907,7],[6471,8],[7327,8],[8628,7]]},"705":{"position":[[562,8],[1525,8],[2925,7],[6839,8],[7724,8],[9268,7],[13101,8],[13987,8],[15532,7],[19403,8],[20256,8],[21554,7],[25066,8],[25917,8],[27213,7]]},"726":{"position":[[601,8],[2255,8],[4804,7],[11919,8],[13113,8],[15025,7],[20056,8],[21180,8],[23022,7],[28655,8],[29507,8],[30804,7],[34414,8],[35267,8],[36565,7],[40031,8],[40887,8],[42188,7],[45673,8],[46530,8],[47832,7]]},"728":{"position":[[697,8],[1550,8],[2848,7],[8616,8],[9465,8],[10759,7],[14533,8],[15391,8],[16694,7],[24975,8],[25832,8],[27134,7],[33223,8],[34071,8],[35364,7],[42783,8],[43631,8],[44924,7]]},"745":{"position":[[2228,8],[3044,8],[4460,7],[7912,8],[8766,8],[10065,7],[13602,8],[14418,8],[15834,7],[19243,8],[20097,8],[21396,7],[24869,8],[25724,8],[27024,7],[32603,8],[33457,8],[34756,7],[38229,8],[39083,8],[40382,7]]},"747":{"position":[[2757,8],[3802,8],[5506,7],[10071,8],[10927,8],[12228,7]]},"749":{"position":[[702,8],[1542,8],[2982,7],[6943,8],[7815,8],[9287,7],[12834,8],[13688,8],[14987,7]]},"751":{"position":[[3399,8],[4299,8],[5858,7],[10283,8],[11141,8],[12444,7],[17717,8],[18555,8],[19993,7]]},"761":{"position":[[3005,8],[4340,8],[6452,7]]},"767":{"position":[[832,8],[1681,8],[2975,7],[6520,8],[7373,8],[8671,7],[12245,8],[13120,8],[14595,7],[18155,8],[19005,8],[20300,7]]},"769":{"position":[[4947,8],[5792,8],[7082,7],[10752,8],[11995,8],[13956,7],[19295,8],[20293,8],[21950,7],[26234,8],[27083,8],[28377,7]]},"771":{"position":[[1492,8],[2545,8],[4257,7],[8929,8],[9947,8],[11429,7],[15855,8],[16874,8],[18357,7]]},"773":{"position":[[3733,8],[6324,8],[10164,7]]},"795":{"position":[[914,8],[1729,8],[3144,7],[6562,8],[7381,8],[8800,7],[12246,8],[13208,8],[14888,7],[19480,8],[20333,8],[21631,7],[25179,8],[26030,8],[27326,7]]},"797":{"position":[[3332,8],[4347,8],[6139,7],[10808,8],[11664,8],[12965,7]]},"799":{"position":[[3237,8],[4140,8],[5702,7],[9762,8],[10860,8],[12735,7],[17992,8],[18842,8],[20137,7]]},"801":{"position":[[3432,8],[4397,8],[6080,7],[10684,8],[11539,8],[12839,7]]},"821":{"position":[[2471,8],[3345,8],[4819,7],[8448,8],[9307,8],[10611,7],[14182,8],[15056,8],[16530,7],[20116,8],[20975,8],[22279,7],[25859,8],[26725,8],[28036,7],[32020,8],[33144,8],[34986,7],[39820,8],[40679,8],[41983,7]]},"823":{"position":[[532,8],[1386,8],[2685,7],[7814,8],[8667,8],[9965,7]]},"825":{"position":[[7300,8],[8339,8],[10096,7],[14916,8],[15859,8],[17402,7],[21359,8],[22346,8],[23992,7],[28193,8],[29095,8],[30656,7],[34677,8],[35522,8],[36967,7],[40564,8],[41392,8],[42820,7],[46465,8],[47316,8],[48612,7],[52136,8],[53002,8],[54313,7]]},"844":{"position":[[2229,8],[3048,8],[4467,7],[7937,8],[8794,8],[10096,7],[13649,8],[14464,8],[15879,7],[19283,8],[20136,8],[21434,7],[24901,8],[25756,8],[27056,7],[32123,8],[32976,8],[34274,7],[37741,8],[38595,8],[39894,7]]},"846":{"position":[[2512,8],[3648,8],[5561,7],[10745,8],[11602,8],[12904,7]]},"848":{"position":[[2345,8],[3360,8],[5034,7],[9658,8],[10518,8],[11823,7]]},"850":{"position":[[3218,8],[4406,8],[6312,7],[11328,8],[12189,8],[13495,7],[17086,8],[17949,8],[19257,7],[22783,8],[23648,8],[24958,7],[28575,8],[29438,8],[30746,7],[34272,8],[35135,8],[36443,7]]}}}],["apischem",{"_index":460,"t":{"37":{"position":[[1023,10],[2216,10],[4016,9]]},"43":{"position":[[171,10],[622,10],[1544,9]]},"77":{"position":[[487,10]]},"97":{"position":[[296,10],[850,10],[1705,9]]},"113":{"position":[[1178,10],[4595,10]]},"123":{"position":[[296,10],[850,10],[1705,9]]},"169":{"position":[[12578,10],[13435,10],[14704,9],[18772,10],[19629,10],[20898,9],[25126,10],[26004,10],[27327,9]]},"215":{"position":[[235,10],[861,10],[1630,9]]},"217":{"position":[[583,10],[1350,10],[2358,9]]},"219":{"position":[[459,10],[1375,10],[2521,9]]},"236":{"position":[[409,10],[1221,10],[2600,9]]},"238":{"position":[[419,10],[1273,10],[2539,9],[6163,10],[7019,10],[8287,9]]},"248":{"position":[[296,10],[850,10],[1705,9]]},"265":{"position":[[719,10],[1563,10],[2819,9]]},"267":{"position":[[430,10],[1237,10],[2611,9],[6134,10],[6979,10],[8236,9]]},"273":{"position":[[1724,10],[2574,10],[3836,9],[7362,10],[8211,10],[9627,9],[13386,10],[14240,10],[15506,9],[18988,10],[19844,10],[21112,9]]},"282":{"position":[[671,10],[1482,10],[2860,9]]},"284":{"position":[[462,10],[1317,10],[2584,9]]},"294":{"position":[[268,10],[822,10],[1677,9]]},"329":{"position":[[516,10],[1319,10],[2689,9],[6097,10],[6901,10],[8272,9],[11911,10],[12884,10],[14499,9]]},"353":{"position":[[558,10],[1413,10],[2680,9],[6168,10],[7022,10],[8288,9]]},"359":{"position":[[677,10],[1548,10],[2986,9],[6853,10],[7708,10],[8975,9],[12667,10],[13522,10],[14789,9]]},"375":{"position":[[592,10],[1454,10],[2728,9]]},"382":{"position":[[1537,10],[2389,10],[3653,9]]},"406":{"position":[[540,10],[1517,10],[3120,9],[7294,10],[8151,10],[9420,9]]},"408":{"position":[[442,10],[1529,10],[3242,9]]},"410":{"position":[[388,10],[1245,10],[2514,9]]},"446":{"position":[[471,10],[1295,10],[2686,9]]},"448":{"position":[[492,10],[1354,10],[2628,9],[6329,10],[7192,10],[8467,9]]},"482":{"position":[[558,10],[1416,10],[2686,9],[6192,10],[7049,10],[8318,9]]},"486":{"position":[[518,10],[1377,10],[2648,9],[6317,10],[7176,10],[8447,9]]},"504":{"position":[[446,10],[1256,10],[2633,9]]},"506":{"position":[[448,10],[1338,10],[2795,9]]},"508":{"position":[[565,10],[1427,10],[2701,9]]},"522":{"position":[[632,10],[1494,10],[2923,9]]},"524":{"position":[[697,10],[1555,10],[2825,9]]},"540":{"position":[[455,10],[1267,10],[2646,9]]},"542":{"position":[[788,10],[1677,10],[3133,9]]},"544":{"position":[[625,10],[1489,10],[2765,9]]},"556":{"position":[[534,10],[1397,10],[2886,9]]},"560":{"position":[[541,10],[1400,10],[2885,9]]},"562":{"position":[[552,10],[1363,10],[2741,9]]},"564":{"position":[[398,10],[1241,10],[2496,9],[5912,10],[6755,10],[8010,9]]},"566":{"position":[[435,10],[1238,10],[2608,9],[5972,10],[6816,10],[8072,9]]},"581":{"position":[[557,10],[1410,10],[2675,9]]},"588":{"position":[[807,10],[1705,10],[3067,9],[6963,10],[7842,10],[9165,9],[12944,10],[13833,10],[15166,9]]},"590":{"position":[[1010,10],[1790,10],[3034,9]]},"595":{"position":[[548,10],[1440,10],[2771,9],[6460,10],[7352,10],[8683,9]]},"600":{"position":[[469,10],[1454,10],[2886,9]]},"619":{"position":[[684,10],[1612,10],[3107,9]]},"621":{"position":[[499,10],[1364,10],[2641,9]]},"627":{"position":[[409,10],[1436,10],[3089,9]]},"629":{"position":[[428,10],[1285,10],[2554,9]]},"631":{"position":[[409,10],[1292,10],[2742,9],[6467,10],[7325,10],[8595,9],[12100,10],[12961,10],[14234,9]]},"649":{"position":[[1688,10],[2542,10],[3808,9],[7860,10],[8714,10],[9980,9],[14681,10],[15538,10],[16807,9],[21518,10],[22372,10],[23638,9],[27754,10],[28609,10],[29876,9]]},"651":{"position":[[1661,10],[2516,10],[3783,9],[7910,10],[8768,10],[10038,9],[14254,10],[15110,10],[16378,9],[20577,10],[21433,10],[22701,9]]},"669":{"position":[[5060,10],[5940,10],[7387,9]]},"671":{"position":[[1451,10],[2359,10],[3834,9]]},"691":{"position":[[680,10],[1627,10],[3200,9],[7228,10],[8083,10],[9350,9],[13223,10],[14078,10],[15345,9],[18909,10],[19766,10],[21035,9],[24535,10],[25391,10],[26659,9]]},"701":{"position":[[1375,10],[2231,10],[3499,9],[6993,10],[7848,10],[9115,9]]},"703":{"position":[[499,10],[1362,10],[2792,9],[6383,10],[7242,10],[8513,9]]},"705":{"position":[[474,10],[1440,10],[2810,9],[6751,10],[7639,10],[9153,9],[13013,10],[13902,10],[15417,9],[19315,10],[20171,10],[21439,9],[24978,10],[25832,10],[27098,9]]},"726":{"position":[[513,10],[2170,10],[4689,9],[11831,10],[13028,10],[14910,9],[19968,10],[21095,10],[22907,9],[28567,10],[29422,10],[30689,9],[34326,10],[35182,10],[36450,9],[39943,10],[40802,10],[42073,9],[45585,10],[46445,10],[47717,9]]},"728":{"position":[[609,10],[1465,10],[2733,9],[8528,10],[9380,10],[10644,9],[14445,10],[15306,10],[16579,9],[24887,10],[25747,10],[27019,9],[33135,10],[33986,10],[35249,9],[42695,10],[43546,10],[44809,9]]},"745":{"position":[[2140,10],[2959,10],[4345,9],[7824,10],[8681,10],[9950,9],[13514,10],[14333,10],[15719,9],[19155,10],[20012,10],[21281,9],[24781,10],[25639,10],[26909,9],[32515,10],[33372,10],[34641,9],[38141,10],[38998,10],[40267,9]]},"747":{"position":[[2669,10],[3717,10],[5391,9],[9983,10],[10842,10],[12113,9]]},"749":{"position":[[614,10],[1457,10],[2867,9],[6855,10],[7730,10],[9172,9],[12746,10],[13603,10],[14872,9]]},"751":{"position":[[3311,10],[4214,10],[5743,9],[10195,10],[11056,10],[12329,9],[17629,10],[18470,10],[19878,9]]},"761":{"position":[[2917,10],[4255,10],[6337,9]]},"767":{"position":[[744,10],[1596,10],[2860,9],[6432,10],[7288,10],[8556,9],[12157,10],[13035,10],[14480,9],[18067,10],[18920,10],[20185,9]]},"769":{"position":[[4859,10],[5707,10],[6967,9],[10664,10],[11910,10],[13841,9],[19207,10],[20208,10],[21835,9],[26146,10],[26998,10],[28262,9]]},"771":{"position":[[1404,10],[2460,10],[4142,9],[8841,10],[9862,10],[11314,9],[15767,10],[16789,10],[18242,9]]},"773":{"position":[[3645,10],[6239,10],[10049,9]]},"795":{"position":[[826,10],[1644,10],[3029,9],[6474,10],[7296,10],[8685,9],[12158,10],[13123,10],[14773,9],[19392,10],[20248,10],[21516,9],[25091,10],[25945,10],[27211,9]]},"797":{"position":[[3244,10],[4262,10],[6024,9],[10720,10],[11579,10],[12850,9]]},"799":{"position":[[3149,10],[4055,10],[5587,9],[9674,10],[10775,10],[12620,9],[17904,10],[18757,10],[20022,9]]},"801":{"position":[[3344,10],[4312,10],[5965,9],[10596,10],[11454,10],[12724,9]]},"821":{"position":[[2383,10],[3260,10],[4704,9],[8360,10],[9222,10],[10496,9],[14094,10],[14971,10],[16415,9],[20028,10],[20890,10],[22164,9],[25771,10],[26640,10],[27921,9],[31932,10],[33059,10],[34871,9],[39732,10],[40594,10],[41868,9]]},"823":{"position":[[444,10],[1301,10],[2570,9],[7726,10],[8582,10],[9850,9]]},"825":{"position":[[7212,10],[8254,10],[9981,9],[14828,10],[15774,10],[17287,9],[21271,10],[22261,10],[23877,9],[28105,10],[29010,10],[30541,9],[34589,10],[35437,10],[36852,9],[40476,10],[41307,10],[42705,9],[46377,10],[47231,10],[48497,9],[52048,10],[52917,10],[54198,9]]},"844":{"position":[[2141,10],[2963,10],[4352,9],[7849,10],[8709,10],[9981,9],[13561,10],[14379,10],[15764,9],[19195,10],[20051,10],[21319,9],[24813,10],[25671,10],[26941,9],[32035,10],[32891,10],[34159,9],[37653,10],[38510,10],[39779,9]]},"846":{"position":[[2424,10],[3563,10],[5446,9],[10657,10],[11517,10],[12789,9]]},"848":{"position":[[2257,10],[3275,10],[4919,9],[9570,10],[10433,10],[11708,9]]},"850":{"position":[[3130,10],[4321,10],[6197,9],[11240,10],[12104,10],[13380,9],[16998,10],[17864,10],[19142,9],[22695,10],[23563,10],[24843,9],[28487,10],[29353,10],[30631,9],[34184,10],[35050,10],[36328,9]]}}}],["apitoken",{"_index":1438,"t":{"217":{"position":[[1954,9],[2044,12],[3038,8]]}}}],["apitokenissu",{"_index":449,"t":{"37":{"position":[[763,15],[1943,15],[3605,15],[5317,15]]},"169":{"position":[[12318,15],[13162,15],[14293,15],[15631,15],[18512,15],[19356,15],[20487,15],[21825,15],[24866,15],[25731,15],[26916,15],[28296,15]]},"219":{"position":[[995,15],[3210,14]]},"236":{"position":[[149,15],[948,15],[2189,15],[3551,15]]},"238":{"position":[[159,15],[1000,15],[2128,15],[3463,15],[5903,15],[6746,15],[7876,15],[9213,15]]},"265":{"position":[[459,15],[1290,15],[2408,15],[3733,15]]},"267":{"position":[[170,15],[964,15],[2200,15],[3557,15],[5874,15],[6706,15],[7825,15],[9151,15]]},"273":{"position":[[1464,15],[2301,15],[3425,15],[4756,15],[7102,15],[7938,15],[9216,15],[10615,15],[13126,15],[13967,15],[15095,15],[16430,15],[18728,15],[19571,15],[20701,15],[22038,15]]},"282":{"position":[[411,15],[1209,15],[2449,15],[3810,15]]},"284":{"position":[[202,15],[1044,15],[2173,15],[3509,15]]},"329":{"position":[[256,15],[1046,15],[2278,15],[3631,15],[5837,15],[6628,15],[7861,15],[9215,15],[11651,15],[12611,15],[14088,15],[15648,15]]},"353":{"position":[[298,15],[1140,15],[2269,15],[3605,15],[5908,15],[6749,15],[7877,15],[9212,15]]},"359":{"position":[[417,15],[1275,15],[2575,15],[3996,15],[6593,15],[7435,15],[8564,15],[9900,15],[12407,15],[13249,15],[14378,15],[15714,15]]},"375":{"position":[[332,15],[1181,15],[2317,15],[3660,15]]},"382":{"position":[[1277,15],[2116,15],[3242,15],[4575,15]]},"406":{"position":[[280,15],[1244,15],[2709,15],[4246,15],[7034,15],[7878,15],[9009,15],[10347,15]]},"408":{"position":[[182,15],[1256,15],[2831,15],[4478,15]]},"410":{"position":[[128,15],[972,15],[2103,15],[3441,15]]},"446":{"position":[[211,15],[1022,15],[2275,15],[3649,15]]},"448":{"position":[[232,15],[1081,15],[2217,15],[3560,15],[6069,15],[6919,15],[8056,15],[9400,15]]},"482":{"position":[[298,15],[1143,15],[2275,15],[3614,15],[5932,15],[6776,15],[7907,15],[9245,15]]},"486":{"position":[[258,15],[1104,15],[2237,15],[3577,15],[6057,15],[6903,15],[8036,15],[9376,15]]},"504":{"position":[[186,15],[983,15],[2222,15],[3582,15]]},"506":{"position":[[188,15],[1065,15],[2384,15],[3824,15]]},"508":{"position":[[305,15],[1154,15],[2290,15],[3633,15]]},"522":{"position":[[372,15],[1221,15],[2512,15],[3924,15]]},"524":{"position":[[437,15],[1282,15],[2414,15],[3753,15]]},"540":{"position":[[195,15],[994,15],[2235,15],[3597,15]]},"542":{"position":[[528,15],[1404,15],[2722,15],[4161,15]]},"544":{"position":[[365,15],[1216,15],[2354,15],[3699,15]]},"556":{"position":[[274,15],[1124,15],[2475,15],[3898,15]]},"560":{"position":[[281,15],[1127,15],[2474,15],[3893,15]]},"562":{"position":[[292,15],[1090,15],[2330,15],[3691,15]]},"564":{"position":[[138,15],[968,15],[2085,15],[3409,15],[5652,15],[6482,15],[7599,15],[8923,15]]},"566":{"position":[[175,15],[965,15],[2197,15],[3550,15],[5712,15],[6543,15],[7661,15],[8986,15]]},"581":{"position":[[297,15],[1137,15],[2264,15],[3598,15]]},"588":{"position":[[547,15],[1432,15],[2656,15],[4043,15],[6703,15],[7569,15],[8754,15],[10120,15],[12684,15],[13560,15],[14755,15],[16131,15]]},"590":{"position":[[750,15],[1517,15],[2623,15],[3892,15]]},"595":{"position":[[288,15],[1167,15],[2360,15],[3756,15],[6200,15],[7079,15],[8272,15],[9668,15]]},"600":{"position":[[209,15],[1181,15],[2475,15],[3976,15]]},"619":{"position":[[424,15],[1339,15],[2696,15],[4174,15]]},"621":{"position":[[239,15],[1091,15],[2230,15],[3576,15]]},"627":{"position":[[149,15],[1163,15],[2678,15],[4265,15]]},"629":{"position":[[168,15],[1012,15],[2143,15],[3481,15]]},"631":{"position":[[149,15],[1019,15],[2331,15],[3764,15],[6207,15],[7052,15],[8184,15],[9523,15],[11840,15],[12688,15],[13823,15],[15165,15]]},"649":{"position":[[1428,15],[2269,15],[3397,15],[4732,15],[7600,15],[8441,15],[9569,15],[10904,15],[14421,15],[15265,15],[16396,15],[17734,15],[21258,15],[22099,15],[23227,15],[24562,15],[27494,15],[28336,15],[29465,15],[30801,15]]},"651":{"position":[[1401,15],[2243,15],[3372,15],[4708,15],[7650,15],[8495,15],[9627,15],[10966,15],[13994,15],[14837,15],[15967,15],[17304,15],[20317,15],[21160,15],[22290,15],[23627,15]]},"669":{"position":[[4800,15],[5667,15],[6976,15],[8406,15]]},"671":{"position":[[1191,15],[2086,15],[3423,15],[4881,15]]},"691":{"position":[[420,15],[1354,15],[2789,15],[4296,15],[6968,15],[7810,15],[8939,15],[10275,15],[12963,15],[13805,15],[14934,15],[16270,15],[18649,15],[19493,15],[20624,15],[21962,15],[24275,15],[25118,15],[26248,15],[27585,15]]},"701":{"position":[[1115,15],[1958,15],[3088,15],[4425,15],[6733,15],[7575,15],[8704,15],[10040,15]]},"703":{"position":[[239,15],[1089,15],[2381,15],[3794,15],[6123,15],[6969,15],[8102,15],[9442,15]]},"705":{"position":[[214,15],[1167,15],[2399,15],[3848,15],[6491,15],[7366,15],[8742,15],[10190,15],[12753,15],[13629,15],[15006,15],[16455,15],[19055,15],[19898,15],[21028,15],[22365,15],[24718,15],[25559,15],[26687,15],[28022,15]]},"726":{"position":[[253,15],[1897,15],[4278,15],[6535,15],[11571,15],[12755,15],[14499,15],[16266,15],[19708,15],[20822,15],[22496,15],[24193,15],[28307,15],[29149,15],[30278,15],[31614,15],[34066,15],[34909,15],[36039,15],[37376,15],[39683,15],[40529,15],[41662,15],[43002,15],[45325,15],[46172,15],[47306,15],[48647,15]]},"728":{"position":[[349,15],[1192,15],[2322,15],[3659,15],[8268,15],[9107,15],[10233,15],[11566,15],[14185,15],[15033,15],[16168,15],[17510,15],[24627,15],[25474,15],[26608,15],[27949,15],[32875,15],[33713,15],[34838,15],[36170,15],[42435,15],[43273,15],[44398,15],[45730,15]]},"745":{"position":[[1880,15],[2686,15],[3934,15],[5303,15],[7564,15],[8408,15],[9539,15],[10877,15],[13254,15],[14060,15],[15308,15],[16677,15],[18895,15],[19739,15],[20870,15],[22208,15],[24521,15],[25366,15],[26498,15],[27837,15],[32255,15],[33099,15],[34230,15],[35568,15],[37881,15],[38725,15],[39856,15],[41194,15]]},"747":{"position":[[2409,15],[3444,15],[4980,15],[6588,15],[9723,15],[10569,15],[11702,15],[13042,15]]},"749":{"position":[[354,15],[1184,15],[2456,15],[3849,15],[6595,15],[7457,15],[8761,15],[10186,15],[12486,15],[13330,15],[14461,15],[15799,15]]},"751":{"position":[[3051,15],[3941,15],[5332,15],[6795,15],[9935,15],[10783,15],[11918,15],[13260,15],[17369,15],[18197,15],[19467,15],[20858,15]]},"761":{"position":[[2657,15],[3982,15],[5926,15],[7844,15]]},"767":{"position":[[484,15],[1323,15],[2449,15],[3782,15],[6172,15],[7015,15],[8145,15],[9482,15],[11897,15],[12762,15],[14069,15],[15497,15],[17807,15],[18647,15],[19774,15],[21108,15]]},"769":{"position":[[4599,15],[5434,15],[6556,15],[7885,15],[10404,15],[11637,15],[13430,15],[15246,15],[18947,15],[19935,15],[21424,15],[22985,15],[25886,15],[26725,15],[27851,15],[29184,15]]},"771":{"position":[[1144,15],[2187,15],[3731,15],[5347,15],[8581,15],[9589,15],[10903,15],[12437,15],[15507,15],[16516,15],[17831,15],[19366,15]]},"773":{"position":[[3385,15],[5966,15],[9638,15],[12892,15]]},"795":{"position":[[566,15],[1371,15],[2618,15],[3986,15],[6214,15],[7023,15],[8274,15],[9646,15],[11898,15],[12850,15],[14362,15],[15897,15],[19132,15],[19975,15],[21105,15],[22442,15],[24831,15],[25672,15],[26800,15],[28135,15]]},"797":{"position":[[2984,15],[3989,15],[5613,15],[7211,15],[10460,15],[11306,15],[12439,15],[13779,15]]},"799":{"position":[[2889,15],[3782,15],[5176,15],[6642,15],[9414,15],[10502,15],[12209,15],[13890,15],[17644,15],[18484,15],[19611,15],[20945,15]]},"801":{"position":[[3084,15],[4039,15],[5554,15],[7092,15],[10336,15],[11181,15],[12313,15],[13652,15]]},"821":{"position":[[2123,15],[2987,15],[4293,15],[5720,15],[8100,15],[8949,15],[10085,15],[11428,15],[13834,15],[14698,15],[16004,15],[17431,15],[19768,15],[20617,15],[21753,15],[23096,15],[25511,15],[26367,15],[27510,15],[28860,15],[31672,15],[32786,15],[34460,15],[36157,15],[39472,15],[40321,15],[41457,15],[42800,15]]},"823":{"position":[[184,15],[1028,15],[2159,15],[3497,15],[7466,15],[8309,15],[9439,15],[10776,15]]},"825":{"position":[[6952,15],[7981,15],[9570,15],[11182,15],[14568,15],[15501,15],[16876,15],[18372,15],[21011,15],[21988,15],[23466,15],[25016,15],[27845,15],[28737,15],[30130,15],[31595,15],[34329,15],[35164,15],[36441,15],[37839,15],[40216,15],[41034,15],[42294,15],[43675,15],[46117,15],[46958,15],[48086,15],[49421,15],[51788,15],[52644,15],[53787,15],[55137,15]]},"844":{"position":[[1881,15],[2690,15],[3941,15],[5313,15],[7589,15],[8436,15],[9570,15],[10911,15],[13301,15],[14106,15],[15353,15],[16721,15],[18935,15],[19778,15],[20908,15],[22245,15],[24553,15],[25398,15],[26530,15],[27869,15],[31775,15],[32618,15],[33748,15],[35085,15],[37393,15],[38237,15],[39368,15],[40706,15]]},"846":{"position":[[2164,15],[3290,15],[5035,15],[6754,15],[10397,15],[11244,15],[12378,15],[13719,15]]},"848":{"position":[[1997,15],[3002,15],[4508,15],[6086,15],[9310,15],[10160,15],[11297,15],[12641,15]]},"850":{"position":[[2870,15],[4048,15],[5786,15],[7547,15],[10980,15],[11831,15],[12969,15],[14314,15],[16738,15],[17591,15],[18731,15],[20078,15],[22435,15],[23290,15],[24432,15],[25781,15],[28227,15],[29080,15],[30220,15],[31567,15],[33924,15],[34777,15],[35917,15],[37264,15]]}}}],["apk",{"_index":827,"t":{"77":{"position":[[1411,4],[1453,4],[1626,3]]},"81":{"position":[[27,4],[200,3]]}}}],["app",{"_index":902,"t":{"109":{"position":[[1449,3]]},"111":{"position":[[1960,3]]},"113":{"position":[[3201,3]]},"402":{"position":[[294,3]]},"677":{"position":[[1401,3]]},"728":{"position":[[22812,3],[39998,3]]},"753":{"position":[[113,5]]},"813":{"position":[[21,3]]}}}],["app.get(\"/read/:docu",{"_index":904,"t":{"109":{"position":[[1468,26]]},"111":{"position":[[2300,26]]},"113":{"position":[[3610,26]]}}}],["app.j",{"_index":884,"t":{"109":{"position":[[541,7]]},"111":{"position":[[1113,6]]},"113":{"position":[[2003,7]]}}}],["app.listen(\":3000",{"_index":905,"t":{"109":{"position":[[1501,19]]},"111":{"position":[[2333,19]]},"113":{"position":[[3643,19]]}}}],["app.use(\"/read/:docu",{"_index":993,"t":{"113":{"position":[[3541,26]]}}}],["app.use(checkauthor",{"_index":994,"t":{"113":{"position":[[3582,27]]}}}],["app.use(jwtware.new(jwtware.config",{"_index":963,"t":{"111":{"position":[[2203,35]]},"113":{"position":[[3444,35]]}}}],["appdevelopercon",{"_index":367,"t":{"27":{"position":[[349,15]]}}}],["appear",{"_index":1815,"t":{"422":{"position":[[371,11],[2036,6]]}}}],["appli",{"_index":260,"t":{"15":{"position":[[70,7]]},"329":{"position":[[11411,7]]},"508":{"position":[[6098,8]]},"649":{"position":[[13569,6]]},"651":{"position":[[13471,7]]},"751":{"position":[[46,5]]},"848":{"position":[[124,7]]}}}],["applic",{"_index":371,"t":{"27":{"position":[[414,12]]},"69":{"position":[[448,13]]},"89":{"position":[[187,11]]},"131":{"position":[[135,13]]},"147":{"position":[[272,11]]},"265":{"position":[[8,12]]},"343":{"position":[[199,12],[281,11],[395,11]]},"345":{"position":[[241,13]]},"359":{"position":[[18195,11]]},"375":{"position":[[6049,11]]},"390":{"position":[[125,11],[199,11],[450,11],[656,11],[814,12]]},"392":{"position":[[178,11]]},"394":{"position":[[32,11]]},"426":{"position":[[3524,11]]},"444":{"position":[[8,12]]},"448":{"position":[[11802,11]]},"456":{"position":[[3247,11]]},"504":{"position":[[5743,11]]},"512":{"position":[[168,11]]},"514":{"position":[[1660,11]]},"536":{"position":[[18,12]]},"544":{"position":[[6287,11]]},"608":{"position":[[45,11]]},"621":{"position":[[6399,11]]},"677":{"position":[[1151,11],[1355,11],[1692,12]]},"691":{"position":[[30295,11]]},"728":{"position":[[22688,11],[22937,11]]},"815":{"position":[[788,13]]}}}],["application'",{"_index":1249,"t":{"149":{"position":[[89,13]]}}}],["application/json",{"_index":554,"t":{"37":{"position":[[7866,17]]},"43":{"position":[[3239,17]]},"99":{"position":[[1449,17]]},"125":{"position":[[1691,17]]},"169":{"position":[[17433,17],[23627,17],[30178,17]]},"236":{"position":[[5034,17]]},"238":{"position":[[5259,17],[11013,17]]},"250":{"position":[[1527,17]]},"252":{"position":[[1650,17]]},"265":{"position":[[5509,17]]},"267":{"position":[[5037,17],[10929,17]]},"273":{"position":[[6544,17],[12134,17],[18226,17],[23838,17]]},"282":{"position":[[5294,17]]},"284":{"position":[[5307,17]]},"296":{"position":[[1007,17],[2885,17]]},"298":{"position":[[2052,17],[3795,17]]},"329":{"position":[[5105,17],[10692,17],[17302,17]]},"353":{"position":[[5403,17],[11008,17]]},"359":{"position":[[5537,17],[11698,17],[17512,17]]},"375":{"position":[[5472,17]]},"382":{"position":[[6367,17]]},"406":{"position":[[5902,17],[12149,17]]},"408":{"position":[[6244,17]]},"410":{"position":[[5243,17]]},"446":{"position":[[5144,17]]},"448":{"position":[[5372,17],[11214,17]]},"466":{"position":[[2609,17]]},"482":{"position":[[5418,17],[11047,17]]},"486":{"position":[[5383,17],[11182,17]]},"504":{"position":[[5063,17]]},"506":{"position":[[5384,17]]},"508":{"position":[[5445,17]]},"522":{"position":[[5456,17]]},"524":{"position":[[5557,17]]},"540":{"position":[[5080,17]]},"542":{"position":[[5720,17]]},"544":{"position":[[5515,17]]},"556":{"position":[[5442,17]]},"560":{"position":[[5433,17]]},"562":{"position":[[5173,17]]},"564":{"position":[[5183,17],[10697,17]]},"566":{"position":[[5026,17],[10762,17]]},"581":{"position":[[5392,17]]},"588":{"position":[[5845,17],[11885,17],[17916,17]]},"590":{"position":[[5576,17]]},"595":{"position":[[5545,17],[11457,17]]},"600":{"position":[[6014,17]]},"619":{"position":[[5772,17]]},"621":{"position":[[5394,17]]},"627":{"position":[[5971,17]]},"629":{"position":[[5283,17]]},"631":{"position":[[5319,17],[11327,17],[16975,17]]},"649":{"position":[[6528,17],[12700,17],[19536,17],[26358,17],[32599,17]]},"651":{"position":[[6506,17],[12770,17],[19104,17],[25427,17]]},"661":{"position":[[8224,17]]},"667":{"position":[[1615,17],[3456,17],[5305,17],[7156,17],[9003,17],[10856,17]]},"669":{"position":[[4198,17],[9956,17],[12083,17]]},"671":{"position":[[6461,17],[9154,17],[11830,17]]},"673":{"position":[[7763,17]]},"691":{"position":[[5922,17],[12073,17],[18068,17],[23764,17],[29385,17]]},"701":{"position":[[6225,17],[11838,17]]},"703":{"position":[[5327,17],[11248,17]]},"705":{"position":[[5665,17],[11759,17],[18027,17],[24165,17],[29818,17]]},"726":{"position":[[8907,17],[18151,17],[26008,17],[33412,17],[39176,17],[44808,17],[50455,17]]},"728":{"position":[[5459,17],[13358,17],[19320,17],[29757,17],[37960,17],[47520,17]]},"745":{"position":[[6793,17],[12679,17],[18167,17],[24010,17],[29641,17],[37370,17],[42996,17]]},"747":{"position":[[8315,17],[14848,17]]},"749":{"position":[[5363,17],[11731,17],[17601,17]]},"751":{"position":[[8379,17],[15070,17],[22370,17]]},"761":{"position":[[9879,17]]},"767":{"position":[[5574,17],[11282,17],[17045,17],[22902,17]]},"769":{"position":[[9669,17],[17180,17],[24665,17],[30976,17]]},"771":{"position":[[7084,17],[14515,17],[21446,17]]},"773":{"position":[[16255,17]]},"795":{"position":[[5475,17],[11139,17],[17553,17],[24242,17],[29931,17]]},"797":{"position":[[8930,17],[15585,17]]},"799":{"position":[[8229,17],[15692,17],[22739,17]]},"801":{"position":[[8751,17],[15456,17]]},"821":{"position":[[7267,17],[13240,17],[18978,17],[24908,17],[30686,17],[37972,17],[44612,17]]},"823":{"position":[[5299,17],[12576,17]]},"825":{"position":[[12915,17],[19988,17],[26686,17],[33181,17],[39358,17],[45177,17],[51217,17],[56963,17]]},"844":{"position":[[6806,17],[12719,17],[18210,17],[24045,17],[29673,17],[36885,17],[42508,17]]},"846":{"position":[[8592,17],[15527,17]]},"848":{"position":[[7783,17],[14455,17]]},"850":{"position":[[9426,17],[16130,17],[21898,17],[27605,17],[33387,17],[39084,17]]}}}],["application:ifft",{"_index":1371,"t":{"169":{"position":[[5989,16]]}}}],["approach",{"_index":2396,"t":{"724":{"position":[[51,8]]},"749":{"position":[[6401,8]]}}}],["appropri",{"_index":752,"t":{"67":{"position":[[317,11]]},"113":{"position":[[137,11]]},"131":{"position":[[320,11]]},"310":{"position":[[3718,12]]},"462":{"position":[[3361,11],[3425,13]]},"769":{"position":[[108,11]]}}}],["approv",{"_index":2005,"t":{"490":{"position":[[680,7]]},"665":{"position":[[393,8]]},"669":{"position":[[2490,8]]},"769":{"position":[[860,8],[995,8],[1232,8],[4237,8],[4452,8],[10135,8],[11407,8],[13072,8],[15015,8],[16630,8],[18543,8]]},"773":{"position":[[5736,8],[9280,8],[12661,8],[15705,8],[20899,8]]}}}],["approved_context",{"_index":2633,"t":{"769":{"position":[[1057,18],[1449,17],[1687,19],[2461,18],[2972,16],[3580,18]]},"773":{"position":[[251,17],[511,16],[1021,19],[2182,18]]},"775":{"position":[[464,17],[724,16],[1421,19],[2649,18]]}}}],["approved_ip_address_rang",{"_index":2632,"t":{"769":{"position":[[922,27],[1168,27],[1359,26],[1509,25],[1605,28],[1946,27],[2153,28],[11491,28],[15107,28],[18125,25]]},"773":{"position":[[161,26],[311,25],[939,28],[1280,27],[1487,28],[5820,28],[12753,28],[19097,25]]},"775":{"position":[[374,26],[524,25],[1339,28],[1680,27],[1954,28]]}}}],["approved_timeslot",{"_index":2631,"t":{"769":{"position":[[796,19],[1136,17],[1412,18],[1477,17],[1650,20],[1800,19],[2253,20],[11151,20],[11303,20],[14747,20],[14909,20],[17847,17],[17979,17]]},"773":{"position":[[214,18],[279,17],[984,20],[1134,19],[1587,20],[4721,20],[4872,20],[5025,20],[5178,20],[5330,20],[5481,20],[5632,20],[11584,20],[11745,20],[11908,20],[12071,20],[12233,20],[12394,20],[12555,20],[18160,17],[18291,17],[18423,17],[18555,17],[18687,17],[18819,17],[18951,17]]},"775":{"position":[[427,18],[492,17],[1384,20],[1534,19],[2054,20]]}}}],["apt",{"_index":833,"t":{"77":{"position":[[1504,3]]},"81":{"position":[[78,3]]}}}],["arbitrari",{"_index":1733,"t":{"390":{"position":[[481,9]]},"426":{"position":[[775,9],[5546,9]]}}}],["archiv",{"_index":2809,"t":{"815":{"position":[[696,9],[953,7]]}}}],["around",{"_index":1075,"t":{"131":{"position":[[1775,6]]}}}],["array",{"_index":1377,"t":{"169":{"position":[[7593,5]]},"187":{"position":[[35,5]]},"296":{"position":[[1077,5]]}}}],["articl",{"_index":427,"t":{"33":{"position":[[5,7]]},"41":{"position":[[183,7]]},"139":{"position":[[5,7]]},"213":{"position":[[5,7]]},"416":{"position":[[1054,8]]},"726":{"position":[[27656,7]]},"732":{"position":[[95,7],[147,8]]},"789":{"position":[[624,7]]},"817":{"position":[[1075,7]]}}}],["articul",{"_index":70,"t":{"3":{"position":[[999,12]]}}}],["artifact",{"_index":1131,"t":{"137":{"position":[[139,8]]}}}],["asid",{"_index":2723,"t":{"793":{"position":[[286,5]]},"819":{"position":[[446,5]]}}}],["ask",{"_index":1563,"t":{"273":{"position":[[12962,3]]},"426":{"position":[[180,5]]},"448":{"position":[[95,6]]},"588":{"position":[[478,3]]},"621":{"position":[[95,6]]},"629":{"position":[[85,3]]},"717":{"position":[[280,7]]},"726":{"position":[[28001,3]]},"728":{"position":[[5987,6],[8126,3],[20228,5],[24475,3],[30562,3],[32740,3]]},"745":{"position":[[7432,3],[18799,3]]},"785":{"position":[[218,3]]},"793":{"position":[[186,3]]},"795":{"position":[[18807,3]]},"799":{"position":[[17414,6],[17439,6],[17523,3]]},"819":{"position":[[39,3]]},"821":{"position":[[7974,3],[19688,6]]},"844":{"position":[[7454,3],[18839,3]]}}}],["assert",{"_index":206,"t":{"9":{"position":[[250,11]]},"288":{"position":[[343,11]]},"428":{"position":[[813,11],[836,9],[984,10],[1039,10],[1140,10],[2423,11],[2529,10],[3754,11],[3770,11],[3790,11],[3996,10]]},"430":{"position":[[105,10]]},"468":{"position":[[385,10]]}}}],["asset",{"_index":1737,"t":{"392":{"position":[[209,5],[267,6],[405,5],[526,5],[684,6]]},"394":{"position":[[63,5],[121,6]]},"402":{"position":[[200,5],[313,5],[474,6],[494,5],[559,6],[579,5],[643,6],[670,5],[734,6],[761,5]]},"404":{"position":[[306,5],[538,6]]},"408":{"position":[[889,6],[972,6],[1061,6],[1143,6],[2277,6],[2508,6],[4100,6],[4192,6],[4282,6],[4373,6],[5548,6],[5729,6],[6835,5],[6972,5],[7064,6],[7240,6]]},"410":{"position":[[844,6],[1938,6],[3313,6],[4840,5],[5559,6],[5602,6]]}}}],["assign",{"_index":133,"t":{"3":{"position":[[2833,8]]},"21":{"position":[[46,8]]},"51":{"position":[[1104,8],[1162,10]]},"53":{"position":[[1343,8]]},"55":{"position":[[1119,8]]},"59":{"position":[[700,8],[1592,8]]},"169":{"position":[[7782,8]]},"207":{"position":[[88,6]]},"343":{"position":[[73,8],[410,9]]},"365":{"position":[[344,8]]},"373":{"position":[[757,8]]},"380":{"position":[[180,6]]},"402":{"position":[[909,6]]},"404":{"position":[[1219,8]]},"406":{"position":[[39,6],[78,8],[124,8],[935,8],[1052,8],[2213,8],[2389,8],[3926,8],[4053,8],[5264,8],[5390,8],[6598,8],[6719,8]]},"408":{"position":[[835,8],[1006,8],[2223,8],[2453,8],[4046,8],[4227,8],[5494,8],[5674,8],[7010,8],[7185,8]]},"426":{"position":[[1663,8],[4012,10],[4696,10],[7550,10]]},"456":{"position":[[1378,10],[3197,6]]},"460":{"position":[[381,6],[628,6],[732,6],[824,8]]},"462":{"position":[[447,10]]},"474":{"position":[[2239,6]]},"502":{"position":[[992,8]]},"508":{"position":[[6632,9]]},"536":{"position":[[363,6]]},"540":{"position":[[11,6]]},"542":{"position":[[281,6]]},"635":{"position":[[77,8],[396,8]]},"677":{"position":[[149,8],[673,8],[691,6]]},"687":{"position":[[111,8]]},"689":{"position":[[1601,8]]},"691":{"position":[[138,6]]},"699":{"position":[[93,6]]},"703":{"position":[[894,8],[2058,8],[3598,8],[4812,8],[5830,8]]},"781":{"position":[[954,8]]},"801":{"position":[[263,11]]},"846":{"position":[[376,8]]}}}],["assigne",{"_index":1746,"t":{"404":{"position":[[211,8],[442,9],[828,10],[941,10],[998,11],[1057,11]]},"406":{"position":[[998,11],[1114,11],[3997,11],[4123,11],[6432,8],[6552,8],[7732,11],[8826,11],[10200,11],[11739,8],[12418,11],[12440,10]]}}}],["associ",{"_index":1745,"t":{"402":{"position":[[1251,9]]},"625":{"position":[[1074,11],[1480,10],[1873,10]]},"627":{"position":[[947,10],[2334,10],[4048,10],[5435,10],[6850,10]]},"635":{"position":[[437,11]]},"699":{"position":[[715,10]]},"724":{"position":[[446,10]]},"726":{"position":[[921,10],[1060,10],[1199,10],[1360,10],[1511,10],[1678,10],[2879,10],[3077,10],[3275,10],[3495,10],[3705,10],[3931,10],[5508,10],[5657,10],[5806,10],[5977,10],[6138,10],[6315,10],[7566,10],[7714,10],[7862,10],[8032,10],[8192,10],[8368,10],[10468,10],[10611,10],[10754,10],[10919,10],[11074,10],[11245,10]]},"728":{"position":[[21573,10],[21673,10]]}}}],["associated_plan",{"_index":2180,"t":{"625":{"position":[[142,16],[214,15],[388,18],[521,17],[639,18],[1014,15],[1051,15],[1578,15]]},"627":{"position":[[1023,18],[4132,18],[6647,15]]},"631":{"position":[[879,18],[3631,18],[5757,15]]},"724":{"position":[[501,15],[669,16],[902,18],[968,18]]},"726":{"position":[[990,18],[1129,18],[1281,18],[1435,18],[1599,18],[1766,18],[5585,18],[5734,18],[5896,18],[6060,18],[6234,18],[6411,18],[9769,15],[9892,15],[10015,15],[10147,15],[10276,15],[10408,15],[46023,18],[47120,18],[48497,18],[50042,15],[50727,18],[50756,17]]},"728":{"position":[[6145,16],[6227,18],[6319,18],[7209,16],[7460,18],[7552,18],[20869,16],[20934,15],[20986,18],[21119,17],[21230,18],[21528,15],[21980,16],[22101,18],[22357,16],[23420,16],[23485,15],[23710,18],[23843,17],[23954,18],[30330,15],[31141,16],[31213,15],[31487,18],[31620,17],[31738,18],[38991,16],[39063,15],[39115,18],[39248,17],[39366,18],[39565,16],[39627,15],[39679,18],[39772,17],[39884,18],[40482,18],[40669,16],[40731,15],[41005,18],[41098,17],[41210,18]]}}}],["assum",{"_index":438,"t":{"37":{"position":[[0,6]]},"95":{"position":[[0,6]]},"107":{"position":[[0,6],[290,6]]},"121":{"position":[[0,6]]},"145":{"position":[[476,6]]},"169":{"position":[[11295,8],[11796,8]]},"227":{"position":[[152,6]]},"246":{"position":[[0,6]]},"252":{"position":[[60,6]]},"258":{"position":[[152,6]]},"273":{"position":[[152,6],[873,6]]},"320":{"position":[[152,6]]},"347":{"position":[[316,6]]},"365":{"position":[[275,6]]},"382":{"position":[[635,6]]},"440":{"position":[[152,6]]},"474":{"position":[[459,6]]},"492":{"position":[[152,6]]},"514":{"position":[[152,6]]},"530":{"position":[[152,6]]},"550":{"position":[[152,6]]},"572":{"position":[[152,6]]},"600":{"position":[[6628,8]]},"649":{"position":[[1080,6],[7183,6],[13609,6],[27122,6]]},"651":{"position":[[1052,6],[7283,6],[13492,6],[19942,6]]},"671":{"position":[[9647,8],[12324,8]]},"679":{"position":[[152,6]]},"697":{"position":[[11,7]]},"771":{"position":[[15088,8],[22020,8]]},"775":{"position":[[40,7]]},"817":{"position":[[229,6]]},"850":{"position":[[158,6]]}}}],["async",{"_index":512,"t":{"37":{"position":[[3864,5],[6059,5],[6297,5]]},"43":{"position":[[1476,5],[2572,5],[2728,5]]},"97":{"position":[[1553,5],[2995,5]]},"109":{"position":[[699,5],[805,5]]},"111":{"position":[[616,5],[867,5],[976,5],[1404,5]]},"113":{"position":[[341,5],[1064,5],[1689,5],[1839,5],[2392,5]]},"123":{"position":[[1553,5],[2995,5]]},"169":{"position":[[14552,5],[16373,5],[20746,5],[22567,5],[27175,5],[29038,5]]},"215":{"position":[[1562,5],[2861,5]]},"217":{"position":[[2290,5],[3990,5]]},"219":{"position":[[2453,5],[4551,5]]},"236":{"position":[[2448,5],[4293,5]]},"238":{"position":[[2387,5],[4205,5],[8135,5],[9955,5]]},"248":{"position":[[1553,5],[2995,5]]},"265":{"position":[[2667,5],[4475,5]]},"267":{"position":[[2459,5],[4299,5],[8084,5],[9893,5]]},"273":{"position":[[3684,5],[5498,5],[9475,5],[11357,5],[15354,5],[17172,5],[20960,5],[22780,5]]},"282":{"position":[[2708,5],[4552,5]]},"284":{"position":[[2432,5],[4251,5]]},"294":{"position":[[1525,5],[2967,5]]},"329":{"position":[[2537,5],[4373,5],[8120,5],[9957,5],[14347,5],[16390,5]]},"353":{"position":[[2528,5],[4347,5],[8136,5],[9954,5]]},"359":{"position":[[2834,5],[4738,5],[8823,5],[10642,5],[14637,5],[16456,5]]},"375":{"position":[[2576,5],[4402,5]]},"382":{"position":[[3501,5],[5317,5]]},"406":{"position":[[2968,5],[4988,5],[9268,5],[11089,5]]},"408":{"position":[[3090,5],[5220,5]]},"410":{"position":[[2362,5],[4183,5]]},"446":{"position":[[2534,5],[4391,5]]},"448":{"position":[[2476,5],[4302,5],[8315,5],[10142,5]]},"482":{"position":[[2534,5],[4356,5],[8166,5],[9987,5]]},"486":{"position":[[2496,5],[4319,5],[8295,5],[10118,5]]},"504":{"position":[[2481,5],[4324,5]]},"506":{"position":[[2643,5],[4566,5]]},"508":{"position":[[2549,5],[4375,5]]},"522":{"position":[[2771,5],[4666,5]]},"524":{"position":[[2673,5],[4495,5]]},"540":{"position":[[2494,5],[4339,5]]},"542":{"position":[[2981,5],[4903,5]]},"544":{"position":[[2613,5],[4441,5]]},"556":{"position":[[2734,5],[4640,5]]},"560":{"position":[[2733,5],[4635,5]]},"562":{"position":[[2589,5],[4433,5]]},"564":{"position":[[2344,5],[4151,5],[7858,5],[9665,5]]},"566":{"position":[[2456,5],[4292,5],[7920,5],[9728,5]]},"581":{"position":[[2523,5],[4340,5]]},"588":{"position":[[2915,5],[4785,5],[9013,5],[10862,5],[15014,5],[16873,5]]},"590":{"position":[[2882,5],[4634,5]]},"595":{"position":[[2619,5],[4498,5],[8531,5],[10410,5]]},"600":{"position":[[2734,5],[4718,5]]},"619":{"position":[[2955,5],[4916,5]]},"621":{"position":[[2489,5],[4318,5]]},"627":{"position":[[2937,5],[5007,5]]},"629":{"position":[[2402,5],[4223,5]]},"631":{"position":[[2590,5],[4506,5],[8443,5],[10265,5],[14082,5],[15907,5]]},"649":{"position":[[3656,5],[5474,5],[9828,5],[11646,5],[16655,5],[18476,5],[23486,5],[25304,5],[29724,5],[31543,5]]},"651":{"position":[[3631,5],[5450,5],[9886,5],[11708,5],[16226,5],[18046,5],[22549,5],[24369,5]]},"669":{"position":[[7235,5],[9148,5]]},"671":{"position":[[3682,5],[5623,5]]},"691":{"position":[[3048,5],[5038,5],[9198,5],[11017,5],[15193,5],[17012,5],[20883,5],[22704,5],[26507,5],[28327,5]]},"701":{"position":[[3347,5],[5167,5],[8963,5],[10782,5]]},"703":{"position":[[2640,5],[4536,5],[8361,5],[10184,5]]},"705":{"position":[[2658,5],[4590,5],[9001,5],[10932,5],[15265,5],[17197,5],[21287,5],[23107,5],[26946,5],[28764,5]]},"726":{"position":[[4537,5],[7277,5],[14758,5],[17008,5],[22755,5],[24935,5],[30537,5],[32356,5],[36298,5],[38118,5],[41921,5],[43744,5],[47565,5],[49389,5]]},"728":{"position":[[2581,5],[4401,5],[10492,5],[12308,5],[16427,5],[18252,5],[26867,5],[28691,5],[35097,5],[36912,5],[44657,5],[46472,5]]},"745":{"position":[[4193,5],[6045,5],[9798,5],[11619,5],[15567,5],[17419,5],[21129,5],[22950,5],[26757,5],[28579,5],[34489,5],[36310,5],[40115,5],[41936,5]]},"747":{"position":[[5239,5],[7330,5],[11961,5],[13784,5]]},"749":{"position":[[2715,5],[4591,5],[9020,5],[10928,5],[14720,5],[16541,5]]},"751":{"position":[[5591,5],[7537,5],[12177,5],[14002,5],[19726,5],[21600,5]]},"761":{"position":[[6185,5],[8586,5]]},"767":{"position":[[2708,5],[4524,5],[8404,5],[10224,5],[14328,5],[16239,5],[20033,5],[21850,5]]},"769":{"position":[[6815,5],[8627,5],[13689,5],[15988,5],[21683,5],[23727,5],[28110,5],[29926,5]]},"771":{"position":[[3990,5],[6089,5],[11162,5],[13179,5],[18090,5],[20108,5]]},"773":{"position":[[9897,5],[13634,5]]},"795":{"position":[[2877,5],[4728,5],[8533,5],[10388,5],[14621,5],[16639,5],[21364,5],[23184,5],[27059,5],[28877,5]]},"797":{"position":[[5872,5],[7953,5],[12698,5],[14521,5]]},"799":{"position":[[5435,5],[7384,5],[12468,5],[14632,5],[19870,5],[21687,5]]},"801":{"position":[[5813,5],[7834,5],[12572,5],[14394,5]]},"821":{"position":[[4552,5],[6462,5],[10344,5],[12170,5],[16263,5],[18173,5],[22012,5],[23838,5],[27769,5],[29602,5],[34719,5],[36899,5],[41716,5],[43542,5]]},"823":{"position":[[2418,5],[4239,5],[9698,5],[11518,5]]},"825":{"position":[[9829,5],[11924,5],[17135,5],[19114,5],[23725,5],[25758,5],[30389,5],[32337,5],[36700,5],[38581,5],[42553,5],[44417,5],[48345,5],[50163,5],[54046,5],[55879,5]]},"844":{"position":[[4200,5],[6055,5],[9829,5],[11653,5],[15612,5],[17463,5],[21167,5],[22987,5],[26789,5],[28611,5],[34007,5],[35827,5],[39627,5],[41448,5]]},"846":{"position":[[5294,5],[7496,5],[12637,5],[14461,5]]},"848":{"position":[[4767,5],[6828,5],[11556,5],[13383,5]]},"850":{"position":[[6045,5],[8289,5],[13228,5],[15056,5],[18990,5],[20820,5],[24691,5],[26523,5],[30479,5],[32309,5],[36176,5],[38006,5]]}}}],["attempt",{"_index":701,"t":{"53":{"position":[[3261,10]]},"331":{"position":[[598,7]]},"466":{"position":[[1089,10]]},"801":{"position":[[2935,7]]}}}],["attribut",{"_index":42,"t":{"3":{"position":[[608,10],[669,10],[813,10]]},"5":{"position":[[280,11]]},"21":{"position":[[154,9],[274,10],[354,10],[421,10]]}}}],["audienc",{"_index":1240,"t":{"147":{"position":[[1804,8],[2125,9],[2141,9],[2484,8],[3129,9]]}}}],["audience=\"oidc",{"_index":1246,"t":{"147":{"position":[[3114,14]]}}}],["auth",{"_index":458,"t":{"37":{"position":[[931,4],[2109,4],[3914,4]]},"97":{"position":[[204,4],[743,4],[1603,4]]},"123":{"position":[[204,4],[743,4],[1603,4]]},"169":{"position":[[12486,4],[13328,4],[14602,4],[18680,4],[19522,4],[20796,4],[25034,4],[25897,4],[27225,4]]},"236":{"position":[[317,4],[1114,4],[2498,4]]},"238":{"position":[[327,4],[1166,4],[2437,4],[6071,4],[6912,4],[8185,4]]},"248":{"position":[[204,4],[743,4],[1603,4]]},"265":{"position":[[627,4],[1456,4],[2717,4]]},"267":{"position":[[338,4],[1130,4],[2509,4],[6042,4],[6872,4],[8134,4]]},"273":{"position":[[1632,4],[2467,4],[3734,4],[7270,4],[8104,4],[9525,4],[13294,4],[14133,4],[15404,4],[18896,4],[19737,4],[21010,4]]},"282":{"position":[[579,4],[1375,4],[2758,4]]},"284":{"position":[[370,4],[1210,4],[2482,4]]},"294":{"position":[[176,4],[715,4],[1575,4]]},"329":{"position":[[424,4],[1212,4],[2587,4],[6005,4],[6794,4],[8170,4],[11819,4],[12777,4],[14397,4]]},"353":{"position":[[466,4],[1306,4],[2578,4],[6076,4],[6915,4],[8186,4]]},"359":{"position":[[585,4],[1441,4],[2884,4],[6761,4],[7601,4],[8873,4],[12575,4],[13415,4],[14687,4]]},"375":{"position":[[500,4],[1347,4],[2626,4]]},"382":{"position":[[1445,4],[2282,4],[3551,4]]},"406":{"position":[[448,4],[1410,4],[3018,4],[7202,4],[8044,4],[9318,4]]},"408":{"position":[[350,4],[1422,4],[3140,4]]},"410":{"position":[[296,4],[1138,4],[2412,4]]},"446":{"position":[[379,4],[1188,4],[2584,4]]},"448":{"position":[[400,4],[1247,4],[2526,4],[6237,4],[7085,4],[8365,4]]},"482":{"position":[[466,4],[1309,4],[2584,4],[6100,4],[6942,4],[8216,4]]},"486":{"position":[[426,4],[1270,4],[2546,4],[6225,4],[7069,4],[8345,4]]},"504":{"position":[[354,4],[1149,4],[2531,4]]},"506":{"position":[[356,4],[1231,4],[2693,4]]},"508":{"position":[[473,4],[1320,4],[2599,4]]},"522":{"position":[[540,4],[1387,4],[2821,4]]},"524":{"position":[[605,4],[1448,4],[2723,4]]},"540":{"position":[[363,4],[1160,4],[2544,4]]},"542":{"position":[[696,4],[1570,4],[3031,4]]},"544":{"position":[[533,4],[1382,4],[2663,4]]},"556":{"position":[[442,4],[1290,4],[2784,4]]},"560":{"position":[[449,4],[1293,4],[2783,4]]},"562":{"position":[[460,4],[1256,4],[2639,4]]},"564":{"position":[[306,4],[1134,4],[2394,4],[5820,4],[6648,4],[7908,4]]},"566":{"position":[[343,4],[1131,4],[2506,4],[5880,4],[6709,4],[7970,4]]},"581":{"position":[[465,4],[1303,4],[2573,4]]},"588":{"position":[[715,4],[1598,4],[2965,4],[6871,4],[7735,4],[9063,4],[12852,4],[13726,4],[15064,4]]},"590":{"position":[[918,4],[1683,4],[2932,4]]},"595":{"position":[[456,4],[1333,4],[2669,4],[6368,4],[7245,4],[8581,4]]},"600":{"position":[[377,4],[1347,4],[2784,4]]},"619":{"position":[[592,4],[1505,4],[3005,4]]},"621":{"position":[[407,4],[1257,4],[2539,4]]},"627":{"position":[[317,4],[1329,4],[2987,4]]},"629":{"position":[[336,4],[1178,4],[2452,4]]},"631":{"position":[[317,4],[1185,4],[2640,4],[6375,4],[7218,4],[8493,4],[12008,4],[12854,4],[14132,4]]},"649":{"position":[[1596,4],[2435,4],[3706,4],[7768,4],[8607,4],[9878,4],[14589,4],[15431,4],[16705,4],[21426,4],[22265,4],[23536,4],[27662,4],[28502,4],[29774,4]]},"651":{"position":[[1569,4],[2409,4],[3681,4],[7818,4],[8661,4],[9936,4],[14162,4],[15003,4],[16276,4],[20485,4],[21326,4],[22599,4]]},"669":{"position":[[4968,4],[5833,4],[7285,4]]},"671":{"position":[[1359,4],[2252,4],[3732,4]]},"679":{"position":[[1511,4]]},"683":{"position":[[571,4]]},"691":{"position":[[588,4],[1520,4],[3098,4],[7136,4],[7976,4],[9248,4],[13131,4],[13971,4],[15243,4],[18817,4],[19659,4],[20933,4],[24443,4],[25284,4],[26557,4]]},"701":{"position":[[1283,4],[2124,4],[3397,4],[6901,4],[7741,4],[9013,4]]},"703":{"position":[[407,4],[1255,4],[2690,4],[6291,4],[7135,4],[8411,4]]},"705":{"position":[[382,4],[1333,4],[2708,4],[6659,4],[7532,4],[9051,4],[12921,4],[13795,4],[15315,4],[19223,4],[20064,4],[21337,4],[24886,4],[25725,4],[26996,4]]},"726":{"position":[[421,4],[2063,4],[4587,4],[11739,4],[12921,4],[14808,4],[19876,4],[20988,4],[22805,4],[28475,4],[29315,4],[30587,4],[34234,4],[35075,4],[36348,4],[39851,4],[40695,4],[41971,4],[45493,4],[46338,4],[47615,4]]},"728":{"position":[[517,4],[1358,4],[2631,4],[8436,4],[9273,4],[10542,4],[14353,4],[15199,4],[16477,4],[24795,4],[25640,4],[26917,4],[33043,4],[33879,4],[35147,4],[42603,4],[43439,4],[44707,4]]},"745":{"position":[[2048,4],[2852,4],[4243,4],[7732,4],[8574,4],[9848,4],[13422,4],[14226,4],[15617,4],[19063,4],[19905,4],[21179,4],[24689,4],[25532,4],[26807,4],[32423,4],[33265,4],[34539,4],[38049,4],[38891,4],[40165,4]]},"747":{"position":[[2577,4],[3610,4],[5289,4],[9891,4],[10735,4],[12011,4]]},"749":{"position":[[522,4],[1350,4],[2765,4],[6763,4],[7623,4],[9070,4],[12654,4],[13496,4],[14770,4]]},"751":{"position":[[3219,4],[4107,4],[5641,4],[10103,4],[10949,4],[12227,4],[17537,4],[18363,4],[19776,4]]},"761":{"position":[[2825,4],[4148,4],[6235,4]]},"767":{"position":[[652,4],[1489,4],[2758,4],[6340,4],[7181,4],[8454,4],[12065,4],[12928,4],[14378,4],[17975,4],[18813,4],[20083,4]]},"769":{"position":[[4767,4],[5600,4],[6865,4],[10572,4],[11803,4],[13739,4],[19115,4],[20101,4],[21733,4],[26054,4],[26891,4],[28160,4]]},"771":{"position":[[1312,4],[2353,4],[4040,4],[8749,4],[9755,4],[11212,4],[15675,4],[16682,4],[18140,4]]},"773":{"position":[[3553,4],[6132,4],[9947,4]]},"795":{"position":[[734,4],[1537,4],[2927,4],[6382,4],[7189,4],[8583,4],[12066,4],[13016,4],[14671,4],[19300,4],[20141,4],[21414,4],[24999,4],[25838,4],[27109,4]]},"797":{"position":[[3152,4],[4155,4],[5922,4],[10628,4],[11472,4],[12748,4]]},"799":{"position":[[3057,4],[3948,4],[5485,4],[9582,4],[10668,4],[12518,4],[17812,4],[18650,4],[19920,4]]},"801":{"position":[[3252,4],[4205,4],[5863,4],[10504,4],[11347,4],[12622,4]]},"821":{"position":[[2291,4],[3153,4],[4602,4],[8268,4],[9115,4],[10394,4],[14002,4],[14864,4],[16313,4],[19936,4],[20783,4],[22062,4],[25679,4],[26533,4],[27819,4],[31840,4],[32952,4],[34769,4],[39640,4],[40487,4],[41766,4]]},"823":{"position":[[352,4],[1194,4],[2468,4],[7634,4],[8475,4],[9748,4]]},"825":{"position":[[7120,4],[8147,4],[9879,4],[14736,4],[15667,4],[17185,4],[21179,4],[22154,4],[23775,4],[28013,4],[28903,4],[30439,4],[34497,4],[35330,4],[36750,4],[40384,4],[41200,4],[42603,4],[46285,4],[47124,4],[48395,4],[51956,4],[52810,4],[54096,4]]},"844":{"position":[[2049,4],[2856,4],[4250,4],[7757,4],[8602,4],[9879,4],[13469,4],[14272,4],[15662,4],[19103,4],[19944,4],[21217,4],[24721,4],[25564,4],[26839,4],[31943,4],[32784,4],[34057,4],[37561,4],[38403,4],[39677,4]]},"846":{"position":[[2332,4],[3456,4],[5344,4],[10565,4],[11410,4],[12687,4]]},"848":{"position":[[2165,4],[3168,4],[4817,4],[9478,4],[10326,4],[11606,4]]},"850":{"position":[[3038,4],[4214,4],[6095,4],[11148,4],[11997,4],[13278,4],[16906,4],[17757,4],[19040,4],[22603,4],[23456,4],[24741,4],[28395,4],[29246,4],[30529,4],[34092,4],[34943,4],[36226,4]]}}}],["authent",{"_index":281,"t":{"17":{"position":[[0,14],[306,15]]},"107":{"position":[[119,12],[396,13]]},"109":{"position":[[1139,14]]},"111":{"position":[[1248,15],[1554,12]]},"113":{"position":[[1512,16],[2104,15]]},"129":{"position":[[122,14]]},"143":{"position":[[354,15]]},"147":{"position":[[18,14],[74,14],[119,14],[162,15],[202,15],[810,14],[899,14],[1266,14],[1738,15],[2259,14],[2343,14],[2423,14],[2791,14]]},"213":{"position":[[179,14]]},"217":{"position":[[30,15]]},"803":{"position":[[48,14]]},"827":{"position":[[212,14]]}}}],["authenticate.j",{"_index":911,"t":{"111":{"position":[[229,16]]}}}],["authn",{"_index":282,"t":{"17":{"position":[[19,6],[430,5]]},"143":{"position":[[454,6]]},"147":{"position":[[643,6],[1526,5],[1553,5],[2077,6],[3045,5],[3067,5],[3103,5]]}}}],["author",{"_index":14,"t":{"3":{"position":[[166,13],[217,13],[321,13],[1031,13],[1217,13]]},"13":{"position":[[22,14],[50,14]]},"15":{"position":[[51,13]]},"17":{"position":[[71,13],[399,14]]},"19":{"position":[[13,13]]},"25":{"position":[[41,13],[105,10]]},"27":{"position":[[242,13],[383,13]]},"31":{"position":[[205,13],[364,13],[411,13],[521,13],[623,13],[849,13],[916,13],[996,13]]},"33":{"position":[[42,13]]},"37":{"position":[[638,13],[683,13],[7752,15],[7834,13],[8281,13],[8342,13]]},"39":{"position":[[79,13],[247,13]]},"41":{"position":[[47,13],[127,13]]},"45":{"position":[[85,13]]},"47":{"position":[[18,13],[3698,13]]},"53":{"position":[[258,13],[1256,13],[1890,13]]},"55":{"position":[[941,13]]},"57":{"position":[[1005,13]]},"59":{"position":[[1104,13]]},"63":{"position":[[91,14]]},"65":{"position":[[0,13],[139,13]]},"67":{"position":[[21,13]]},"69":{"position":[[198,13]]},"71":{"position":[[82,13],[162,13],[333,13],[420,13]]},"73":{"position":[[46,13],[748,13],[788,13]]},"89":{"position":[[26,13]]},"93":{"position":[[226,13],[549,13],[872,13],[1195,13],[1490,13],[1751,13]]},"99":{"position":[[1335,15],[1417,13]]},"101":{"position":[[64,13]]},"105":{"position":[[213,13],[577,13]]},"113":{"position":[[704,10],[2174,9],[4466,10],[5509,15]]},"115":{"position":[[186,13],[268,13]]},"119":{"position":[[226,13],[549,13],[872,13],[1195,13],[1490,13],[1751,13]]},"125":{"position":[[1577,15],[1659,13]]},"127":{"position":[[64,13]]},"147":{"position":[[320,14]]},"149":{"position":[[103,13]]},"169":{"position":[[28,13],[160,13],[374,13],[1430,13],[1455,13],[1621,13],[2769,13],[2969,13],[3461,13],[3530,13],[3618,13],[3780,13],[3844,13],[4160,13],[5292,13],[6620,13],[9117,13],[9585,13],[9962,13],[10269,13],[17319,15],[17401,13],[23513,15],[23595,13],[30064,15],[30146,13],[30629,13],[31352,14],[31367,13]]},"175":{"position":[[3,13]]},"177":{"position":[[72,13]]},"179":{"position":[[140,13]]},"183":{"position":[[60,13]]},"193":{"position":[[136,13],[443,13]]},"205":{"position":[[154,13]]},"209":{"position":[[32,13],[183,13],[340,13]]},"217":{"position":[[2021,15]]},"221":{"position":[[116,13],[213,13],[269,13]]},"227":{"position":[[187,13],[1265,13],[1539,13]]},"231":{"position":[[187,13],[461,13]]},"236":{"position":[[4920,15],[5002,13]]},"238":{"position":[[5145,15],[5227,13],[10899,15],[10981,13]]},"244":{"position":[[226,13],[513,13],[800,13],[1087,13],[1346,13],[1607,13]]},"250":{"position":[[1413,15],[1495,13]]},"252":{"position":[[1536,15],[1618,13]]},"254":{"position":[[59,13]]},"256":{"position":[[231,13]]},"258":{"position":[[187,13],[677,13],[984,13],[1258,13]]},"260":{"position":[[34,13]]},"262":{"position":[[187,13],[461,13]]},"265":{"position":[[5395,15],[5477,13]]},"267":{"position":[[4923,15],[5005,13],[10815,15],[10897,13]]},"273":{"position":[[187,13],[1246,13],[6430,15],[6512,13],[12020,15],[12102,13],[18112,15],[18194,13],[23724,15],[23806,13],[24696,13],[24970,13]]},"279":{"position":[[187,13],[461,13]]},"282":{"position":[[5180,15],[5262,13]]},"284":{"position":[[5193,15],[5275,13]]},"288":{"position":[[308,13]]},"290":{"position":[[222,13],[544,13],[866,13],[1153,13],[1412,13]]},"296":{"position":[[893,15],[975,13],[2771,15],[2853,13]]},"298":{"position":[[31,13],[1938,15],[2020,13],[3681,15],[3763,13]]},"300":{"position":[[32,13],[693,10]]},"306":{"position":[[169,13],[645,13]]},"314":{"position":[[71,13],[240,13],[299,13]]},"316":{"position":[[33,13],[162,13],[1039,13],[1072,9],[1183,13],[1245,9],[1500,13]]},"320":{"position":[[187,13],[1184,13],[1586,13],[1860,13]]},"322":{"position":[[34,13]]},"326":{"position":[[187,13],[461,13]]},"329":{"position":[[4991,15],[5073,13],[10578,15],[10660,13],[17188,15],[17270,13]]},"335":{"position":[[62,13],[219,13]]},"337":{"position":[[30,13],[140,13],[247,13],[356,13]]},"339":{"position":[[30,13]]},"341":{"position":[[55,13]]},"347":{"position":[[155,13],[1895,13],[2169,13]]},"351":{"position":[[187,13],[461,13]]},"353":{"position":[[15,13],[5289,15],[5371,13],[10894,15],[10976,13]]},"355":{"position":[[177,13]]},"359":{"position":[[259,13],[5423,15],[5505,13],[6289,13],[11584,15],[11666,13],[17398,15],[17480,13]]},"365":{"position":[[156,13],[1397,13],[1671,13]]},"369":{"position":[[187,13],[461,13]]},"373":{"position":[[123,13],[825,13]]},"375":{"position":[[5358,15],[5440,13]]},"382":{"position":[[22,13],[6253,15],[6335,13]]},"384":{"position":[[22,13]]},"386":{"position":[[34,13],[940,13]]},"390":{"position":[[617,13],[717,13]]},"392":{"position":[[360,13]]},"402":{"position":[[18,13],[1131,13],[1304,13]]},"404":{"position":[[231,13]]},"406":{"position":[[5788,15],[5870,13],[12035,15],[12117,13]]},"408":{"position":[[6130,15],[6212,13]]},"410":{"position":[[5129,15],[5211,13]]},"414":{"position":[[53,13],[129,13],[354,13]]},"416":{"position":[[201,13],[340,13],[429,13],[551,13],[633,13],[812,13],[914,13],[1289,13]]},"418":{"position":[[12,13],[368,13]]},"420":{"position":[[343,13],[486,13],[665,13]]},"422":{"position":[[4290,13]]},"424":{"position":[[3412,13]]},"426":{"position":[[3499,13],[10255,13]]},"428":{"position":[[418,13],[471,13],[550,13],[663,13],[1106,13],[3930,13]]},"430":{"position":[[216,13],[293,13]]},"434":{"position":[[171,13]]},"438":{"position":[[241,13]]},"440":{"position":[[187,13],[976,13],[1250,13]]},"442":{"position":[[187,13],[461,13]]},"446":{"position":[[5030,15],[5112,13]]},"448":{"position":[[5258,15],[5340,13],[11100,15],[11182,13]]},"452":{"position":[[1080,13]]},"466":{"position":[[2495,15],[2577,13]]},"468":{"position":[[909,13],[939,13]]},"472":{"position":[[66,14],[590,13]]},"474":{"position":[[176,13],[2883,13],[3157,13]]},"480":{"position":[[187,13],[461,13]]},"482":{"position":[[15,13],[5304,15],[5386,13],[10933,15],[11015,13]]},"486":{"position":[[5269,15],[5351,13],[11068,15],[11150,13]]},"490":{"position":[[333,13]]},"492":{"position":[[187,13],[961,13],[1268,13],[1542,13]]},"494":{"position":[[34,13]]},"496":{"position":[[187,13],[461,13]]},"498":{"position":[[244,13]]},"500":{"position":[[82,13]]},"502":{"position":[[76,13]]},"504":{"position":[[4949,15],[5031,13]]},"506":{"position":[[5270,15],[5352,13]]},"508":{"position":[[41,13],[5331,15],[5413,13]]},"514":{"position":[[187,13],[731,13],[1038,13],[1312,13]]},"516":{"position":[[34,13]]},"518":{"position":[[187,13],[461,13]]},"522":{"position":[[5342,15],[5424,13]]},"524":{"position":[[5443,15],[5525,13]]},"530":{"position":[[187,13],[708,13],[1015,13],[1289,13]]},"532":{"position":[[34,13]]},"534":{"position":[[187,13],[461,13]]},"536":{"position":[[310,13]]},"538":{"position":[[41,13],[144,13]]},"540":{"position":[[4966,15],[5048,13]]},"542":{"position":[[5606,15],[5688,13]]},"544":{"position":[[5401,15],[5483,13]]},"550":{"position":[[187,13],[661,13],[968,13],[1242,13]]},"552":{"position":[[34,13]]},"554":{"position":[[187,13],[461,13]]},"556":{"position":[[5328,15],[5410,13]]},"558":{"position":[[43,13]]},"560":{"position":[[5319,15],[5401,13]]},"562":{"position":[[5059,15],[5141,13]]},"564":{"position":[[5069,15],[5151,13],[10583,15],[10665,13]]},"566":{"position":[[4912,15],[4994,13],[10648,15],[10730,13]]},"572":{"position":[[187,13],[1132,13],[1439,13],[1713,13]]},"574":{"position":[[34,13]]},"576":{"position":[[187,13],[461,13]]},"581":{"position":[[5278,15],[5360,13]]},"588":{"position":[[5731,15],[5813,13],[11771,15],[11853,13],[17802,15],[17884,13]]},"590":{"position":[[150,13],[244,13],[5462,15],[5544,13]]},"595":{"position":[[5431,15],[5513,13],[11343,15],[11425,13]]},"600":{"position":[[5900,15],[5982,13],[6580,13]]},"608":{"position":[[340,13]]},"610":{"position":[[155,13],[1212,13],[1486,13]]},"614":{"position":[[187,13],[461,13]]},"619":{"position":[[5658,15],[5740,13]]},"621":{"position":[[5280,15],[5362,13],[5905,13]]},"625":{"position":[[16,13]]},"627":{"position":[[5857,15],[5939,13]]},"629":{"position":[[21,13],[5169,15],[5251,13]]},"631":{"position":[[5205,15],[5287,13],[11213,15],[11295,13],[16861,15],[16943,13]]},"637":{"position":[[249,13],[556,13],[830,13]]},"639":{"position":[[34,13]]},"641":{"position":[[187,13],[461,13]]},"645":{"position":[[1144,13]]},"649":{"position":[[22,13],[6414,15],[6496,13],[12586,15],[12668,13],[19422,15],[19504,13],[26244,15],[26326,13],[27087,13],[32485,15],[32567,13],[33105,13],[33394,13]]},"651":{"position":[[816,13],[6392,15],[6474,13],[12656,15],[12738,13],[18990,15],[19072,13],[25313,15],[25395,13]]},"659":{"position":[[61,13],[865,14]]},"661":{"position":[[108,13],[844,13],[8110,15],[8192,13]]},"665":{"position":[[295,13]]},"667":{"position":[[9,13],[1501,15],[1583,13],[3342,15],[3424,13],[5191,15],[5273,13],[7042,15],[7124,13],[8889,15],[8971,13],[10742,15],[10824,13]]},"669":{"position":[[11,13],[275,11],[2537,13],[2706,11],[4084,15],[4166,13],[4643,11],[5455,11],[6636,11],[8193,11],[9424,11],[9842,15],[9924,13],[10467,11],[11969,15],[12051,13]]},"671":{"position":[[24,9],[967,13],[1874,11],[3083,11],[4668,11],[5928,11],[6347,15],[6429,13],[6963,11],[9040,15],[9122,13],[11716,15],[11798,13]]},"673":{"position":[[21,13],[7649,15],[7731,13]]},"675":{"position":[[175,10],[245,13],[272,9]]},"677":{"position":[[95,13]]},"679":{"position":[[187,13],[820,13],[1127,13],[1401,13]]},"681":{"position":[[34,13]]},"683":{"position":[[187,13],[461,13]]},"685":{"position":[[391,13]]},"687":{"position":[[145,13]]},"689":{"position":[[242,13]]},"691":{"position":[[5808,15],[5890,13],[11959,15],[12041,13],[17954,15],[18036,13],[23650,15],[23732,13],[29271,15],[29353,13]]},"695":{"position":[[90,13],[183,13]]},"697":{"position":[[260,13],[534,13]]},"699":{"position":[[49,13],[923,13]]},"701":{"position":[[6111,15],[6193,13],[11724,15],[11806,13]]},"703":{"position":[[5213,15],[5295,13],[11134,15],[11216,13]]},"705":{"position":[[5551,15],[5633,13],[11645,15],[11727,13],[17913,15],[17995,13],[24051,15],[24133,13],[29704,15],[29786,13]]},"707":{"position":[[63,13]]},"717":{"position":[[103,13]]},"726":{"position":[[8793,15],[8875,13],[18037,15],[18119,13],[25894,15],[25976,13],[27471,13],[33298,15],[33380,13],[39062,15],[39144,13],[44694,15],[44776,13],[50341,15],[50423,13]]},"728":{"position":[[5345,15],[5427,13],[6775,13],[7066,13],[13244,15],[13326,13],[19206,15],[19288,13],[23310,13],[29643,15],[29725,13],[30392,13],[37846,15],[37928,13],[38446,13],[40561,13],[47406,15],[47488,13]]},"730":{"position":[[158,13],[580,13]]},"734":{"position":[[331,13]]},"745":{"position":[[261,13],[6679,15],[6761,13],[12565,15],[12647,13],[18053,15],[18135,13],[23896,15],[23978,13],[29527,15],[29609,13],[37256,15],[37338,13],[42882,15],[42964,13]]},"747":{"position":[[320,13],[8201,15],[8283,13],[14734,15],[14816,13]]},"749":{"position":[[5249,15],[5331,13],[11617,15],[11699,13],[17487,15],[17569,13]]},"751":{"position":[[8265,15],[8347,13],[14956,15],[15038,13],[22256,15],[22338,13],[23076,13]]},"755":{"position":[[96,13]]},"759":{"position":[[61,13],[867,14]]},"761":{"position":[[108,13],[502,13],[9765,15],[9847,13]]},"765":{"position":[[321,13]]},"767":{"position":[[9,13],[5460,15],[5542,13],[11168,15],[11250,13],[16931,15],[17013,13],[22788,15],[22870,13]]},"769":{"position":[[11,13],[75,13],[1104,14],[2647,14],[4284,13],[9555,15],[9637,13],[17066,15],[17148,13],[24551,15],[24633,13],[30862,15],[30944,13]]},"771":{"position":[[24,9],[249,9],[6970,15],[7052,13],[14401,15],[14483,13],[21332,15],[21414,13]]},"773":{"position":[[21,13],[16141,15],[16223,13]]},"777":{"position":[[294,10]]},"779":{"position":[[167,13]]},"781":{"position":[[310,13],[482,13]]},"785":{"position":[[36,13]]},"791":{"position":[[147,13]]},"793":{"position":[[597,13]]},"795":{"position":[[5361,15],[5443,13],[11025,15],[11107,13],[17439,15],[17521,13],[24128,15],[24210,13],[29817,15],[29899,13]]},"797":{"position":[[284,13],[1125,13],[8816,15],[8898,13],[15471,15],[15553,13]]},"799":{"position":[[745,13],[8115,15],[8197,13],[15578,15],[15660,13],[22625,15],[22707,13]]},"801":{"position":[[140,13],[8637,15],[8719,13],[15342,15],[15424,13]]},"805":{"position":[[340,13]]},"809":{"position":[[310,13],[482,13]]},"819":{"position":[[416,13],[856,13]]},"821":{"position":[[547,13],[7153,15],[7235,13],[13126,15],[13208,13],[18864,15],[18946,13],[24794,15],[24876,13],[30572,15],[30654,13],[37858,15],[37940,13],[44498,15],[44580,13]]},"823":{"position":[[5185,15],[5267,13],[6190,13],[12462,15],[12544,13]]},"825":{"position":[[1449,13],[3018,13],[4451,13],[12801,15],[12883,13],[19874,15],[19956,13],[26572,15],[26654,13],[33067,15],[33149,13],[39244,15],[39326,13],[45063,15],[45145,13],[51103,15],[51185,13],[56849,15],[56931,13]]},"827":{"position":[[30,13],[90,13],[281,13],[609,13],[685,13]]},"829":{"position":[[126,13]]},"833":{"position":[[331,13]]},"844":{"position":[[346,13],[6692,15],[6774,13],[12605,15],[12687,13],[18096,15],[18178,13],[23931,15],[24013,13],[29559,15],[29641,13],[36771,15],[36853,13],[42394,15],[42476,13]]},"846":{"position":[[296,13],[8478,15],[8560,13],[15413,15],[15495,13]]},"848":{"position":[[7669,15],[7751,13],[14341,15],[14423,13],[16460,13]]},"850":{"position":[[9312,15],[9394,13],[16016,15],[16098,13],[21784,15],[21866,13],[27491,15],[27573,13],[33273,15],[33355,13],[38970,15],[39052,13]]}}}],["authorization_id",{"_index":1404,"t":{"169":{"position":[[17815,16],[24009,16]]},"238":{"position":[[5632,16],[11390,16]]},"265":{"position":[[5852,16]]},"267":{"position":[[11273,16]]},"273":{"position":[[6903,16],[18599,16],[24215,16]]},"284":{"position":[[5681,16]]},"353":{"position":[[5779,16],[11381,16]]},"359":{"position":[[12072,16],[17888,16]]},"375":{"position":[[5869,16]]},"382":{"position":[[6734,16]]},"406":{"position":[[12531,16]]},"410":{"position":[[5625,16]]},"448":{"position":[[5769,16],[11612,16]]},"482":{"position":[[5803,16],[11429,16]]},"486":{"position":[[5771,16],[11568,16]]},"508":{"position":[[5842,16]]},"524":{"position":[[5942,16]]},"544":{"position":[[5918,16]]},"564":{"position":[[5523,16],[11037,16]]},"566":{"position":[[11103,16]]},"581":{"position":[[5762,16]]},"621":{"position":[[5800,16]]},"629":{"position":[[5665,16]]},"631":{"position":[[11710,16],[17369,16]]},"649":{"position":[[6901,16],[13073,16],[19918,16],[26731,16],[32975,16]]},"651":{"position":[[6880,16],[13153,16],[19481,16],[25806,16]]},"667":{"position":[[1970,16],[3817,16],[5660,16],[7518,16],[9359,16],[11218,16]]},"669":{"position":[[4554,16],[12438,16]]},"671":{"position":[[9759,16],[12436,16]]},"691":{"position":[[12449,16],[18442,16],[24146,16],[29764,16]]},"701":{"position":[[6604,16],[12214,16]]},"703":{"position":[[11636,16]]},"705":{"position":[[24544,16],[30189,16]]},"726":{"position":[[33788,16],[39553,16],[45196,16],[50846,16]]},"728":{"position":[[5828,16],[13723,16],[19712,16],[30148,16],[38324,16],[47884,16]]},"745":{"position":[[13061,16],[24392,16],[30024,16],[37752,16],[43378,16]]},"747":{"position":[[15236,16]]},"749":{"position":[[17983,16]]},"751":{"position":[[15454,16]]},"767":{"position":[[5941,16],[11661,16],[23270,16]]},"769":{"position":[[10022,16],[31343,16]]},"771":{"position":[[15271,16],[22203,16]]},"795":{"position":[[24621,16],[30302,16]]},"797":{"position":[[15973,16]]},"799":{"position":[[23109,16]]},"801":{"position":[[15839,16]]},"821":{"position":[[13637,16],[25305,16],[31102,16],[45009,16]]},"823":{"position":[[5679,16],[12955,16]]},"825":{"position":[[51588,16],[57381,16]]},"844":{"position":[[13110,16],[24424,16],[30056,16],[37264,16],[42890,16]]},"846":{"position":[[15918,16]]},"848":{"position":[[14845,16]]},"850":{"position":[[16533,16],[22305,16],[28020,16],[33794,16],[39491,16]]}}}],["authorization_model_id",{"_index":475,"t":{"37":{"position":[[1381,23],[5902,22]]},"69":{"position":[[80,23]]},"97":{"position":[[2838,22]]},"99":{"position":[[236,23],[917,25],[1472,27]]},"123":{"position":[[2838,22]]},"125":{"position":[[215,23],[1059,25],[1717,25]]},"169":{"position":[[13063,23],[16216,22],[16525,25],[17456,27],[19257,23],[22410,22],[22719,25],[23650,27],[25585,23],[28881,22],[29190,25],[30204,25],[30550,22]]},"236":{"position":[[868,23],[4136,22],[4445,25],[5157,25]]},"238":{"position":[[901,23],[4048,22],[4357,25],[5282,27],[6646,23],[9798,22],[10107,25],[11036,27]]},"248":{"position":[[2838,22]]},"250":{"position":[[199,23],[1009,25],[1647,25]]},"252":{"position":[[355,23],[1167,25],[1771,25]]},"265":{"position":[[1191,23],[4318,22],[4627,25],[5532,27]]},"267":{"position":[[884,23],[4142,22],[4451,25],[5155,25],[6606,23],[9736,22],[10045,25],[10952,27]]},"273":{"position":[[2201,23],[5341,22],[5650,25],[6567,27],[7858,23],[11200,22],[11509,25],[12255,25],[13868,23],[17015,22],[17324,25],[18249,27],[19471,23],[22623,22],[22932,25],[23861,27]]},"282":{"position":[[1129,23],[4395,22],[4704,25],[5416,25]]},"284":{"position":[[944,23],[4094,22],[4403,25],[5330,27]]},"294":{"position":[[2810,22]]},"329":{"position":[[966,23],[4216,22],[4525,25],[5219,25],[6548,23],[9800,22],[10109,25],[10807,25],[12531,23],[16233,22],[16542,25],[17517,25]]},"353":{"position":[[1041,23],[4190,22],[4499,25],[5426,27],[6650,23],[9797,22],[10106,25],[11031,27]]},"359":{"position":[[1195,23],[4581,22],[4890,25],[5665,25],[7335,23],[10485,22],[10794,25],[11721,27],[13150,23],[16299,22],[16608,25],[17535,27]]},"375":{"position":[[1082,23],[4245,22],[4554,25],[5495,27]]},"382":{"position":[[2017,23],[5160,22],[5469,25],[6390,27]]},"406":{"position":[[1164,23],[4831,22],[5140,25],[6104,25],[7779,23],[10932,22],[11241,25],[12172,27]]},"408":{"position":[[1176,23],[5063,22],[5372,25],[6482,25]]},"410":{"position":[[873,23],[4026,22],[4335,25],[5266,27]]},"446":{"position":[[942,23],[4234,22],[4543,25],[5279,25]]},"448":{"position":[[982,23],[4145,22],[4454,25],[5395,27],[6819,23],[9985,22],[10294,25],[11237,27]]},"466":{"position":[[1340,23],[2184,25],[2746,25]]},"482":{"position":[[1044,23],[4199,22],[4508,25],[5441,27],[6677,23],[9830,22],[10139,25],[11070,27]]},"486":{"position":[[1005,23],[4162,22],[4471,25],[5406,27],[6803,23],[9961,22],[10270,25],[11205,27]]},"504":{"position":[[903,23],[4167,22],[4476,25],[5184,25]]},"506":{"position":[[985,23],[4409,22],[4718,25],[5523,25]]},"508":{"position":[[1055,23],[4218,22],[4527,25],[5468,27]]},"522":{"position":[[1141,23],[4509,22],[4818,25],[5585,25]]},"524":{"position":[[1183,23],[4338,22],[4647,25],[5580,27]]},"540":{"position":[[914,23],[4182,22],[4491,25],[5203,25]]},"542":{"position":[[1324,23],[4746,22],[5055,25],[5866,25]]},"544":{"position":[[1117,23],[4284,22],[4593,25],[5538,27]]},"556":{"position":[[1044,23],[4483,22],[4792,25],[5615,25]]},"560":{"position":[[1047,23],[4478,22],[4787,25],[5602,25]]},"562":{"position":[[1010,23],[4276,22],[4585,25],[5295,25]]},"564":{"position":[[869,23],[3994,22],[4303,25],[5206,27],[6383,23],[9508,22],[9817,25],[10720,27]]},"566":{"position":[[885,23],[4135,22],[4444,25],[5140,25],[6443,23],[9571,22],[9880,25],[10785,27]]},"581":{"position":[[1038,23],[4183,22],[4492,25],[5415,27]]},"588":{"position":[[4628,22],[10705,22],[16716,22]]},"590":{"position":[[4477,22]]},"595":{"position":[[1073,23],[4341,22],[4650,25],[5634,25],[6985,23],[10253,22],[10562,25],[11546,25]]},"600":{"position":[[1035,23],[4561,22],[4870,25],[6040,25],[6501,22]]},"619":{"position":[[1259,23],[4759,22],[5068,25],[5910,25]]},"621":{"position":[[992,23],[4161,22],[4470,25],[5417,27]]},"627":{"position":[[1083,23],[4850,22],[5159,25],[6191,25]]},"629":{"position":[[913,23],[4066,22],[4375,25],[5306,27]]},"631":{"position":[[939,23],[4349,22],[4658,25],[5463,25],[6952,23],[10108,22],[10417,25],[11350,27],[12589,23],[15750,22],[16059,25],[16998,27]]},"649":{"position":[[2170,23],[5317,22],[5626,25],[6551,27],[8342,23],[11489,22],[11798,25],[12723,27],[15166,23],[18319,22],[18628,25],[19559,27],[22000,23],[25147,22],[25456,25],[26381,27],[28237,23],[31386,22],[31695,25],[32622,27]]},"651":{"position":[[2143,23],[5293,22],[5602,25],[6529,27],[8395,23],[11551,22],[11860,25],[12793,27],[14737,23],[17889,22],[18198,25],[19127,27],[21061,23],[24212,22],[24521,25],[25450,27]]},"661":{"position":[[4115,23],[6955,25],[8795,25]]},"667":{"position":[[398,23],[1081,25],[1638,27],[2231,23],[2918,25],[3479,27],[4088,23],[4771,25],[5328,27],[5926,23],[6616,25],[7179,27],[7781,23],[8467,25],[9026,27],[9626,23],[10316,25],[10879,27]]},"669":{"position":[[2976,23],[3662,25],[4221,27],[5587,23],[8991,22],[9300,25],[10089,25],[10866,23],[11549,25],[12106,27]]},"671":{"position":[[2006,23],[5466,22],[5775,25],[6595,25],[7519,23],[8448,25],[9177,27],[10190,23],[11122,25],[11853,27]]},"673":{"position":[[3654,23],[6494,25],[8334,25]]},"691":{"position":[[1274,23],[4881,22],[5190,25],[6106,25],[7711,23],[10860,22],[11169,25],[12096,27],[13705,23],[16855,22],[17164,25],[18091,27],[19394,23],[22547,22],[22856,25],[23787,27],[25019,23],[28170,22],[28479,25],[29408,27]]},"701":{"position":[[1859,23],[5010,22],[5319,25],[6248,27],[7476,23],[10625,22],[10934,25],[11861,27]]},"703":{"position":[[1009,23],[4379,22],[4688,25],[5456,25],[6870,23],[10027,22],[10336,25],[11271,27]]},"705":{"position":[[4433,22],[7286,23],[10775,22],[11084,25],[11957,25],[13549,23],[17040,22],[17349,25],[18226,25],[19799,23],[22950,22],[23259,25],[24188,27],[25459,23],[28607,22],[28916,25],[29841,27]]},"726":{"position":[[1817,23],[7120,22],[7429,25],[9441,25],[12675,23],[16851,22],[17160,25],[18438,25],[20742,23],[24778,22],[25087,25],[26280,25],[29050,23],[32199,22],[32508,25],[33435,27],[34809,23],[37961,22],[38270,25],[39199,27],[40430,23],[43587,22],[43896,25],[44831,27],[46073,23],[49232,22],[49541,25],[50478,27]]},"728":{"position":[[1088,23],[4244,22],[4553,25],[5482,27],[9007,23],[12151,22],[12460,25],[13381,27],[14933,23],[18095,22],[18404,25],[19343,27],[25375,23],[28534,22],[28843,25],[29780,27],[33614,23],[36755,22],[37064,25],[37983,27],[43174,23],[46315,22],[46624,25],[47543,27]]},"745":{"position":[[2606,23],[5888,22],[6197,25],[6923,25],[8309,23],[11462,22],[11771,25],[12702,27],[13980,23],[17262,22],[17571,25],[18297,25],[19640,23],[22793,22],[23102,25],[24033,27],[25266,23],[28422,22],[28731,25],[29664,27],[33000,23],[36153,22],[36462,25],[37393,27],[38626,23],[41779,22],[42088,25],[43019,27]]},"747":{"position":[[3364,23],[7173,22],[7482,25],[8546,25],[10470,23],[13627,22],[13936,25],[14871,27]]},"749":{"position":[[1104,23],[4434,22],[4743,25],[5517,25],[7377,23],[10771,22],[11080,25],[11864,25],[13231,23],[16384,22],[16693,25],[17624,27]]},"751":{"position":[[3861,23],[7380,22],[7689,25],[8592,25],[10679,23],[13845,22],[14154,25],[15093,27],[18117,23],[21443,22],[21752,25],[22522,25]]},"761":{"position":[[3902,23],[8429,22],[8738,25],[10251,25]]},"767":{"position":[[1224,23],[4367,22],[4676,25],[5597,27],[6916,23],[10067,22],[10376,25],[11305,27],[12682,23],[16082,22],[16391,25],[17180,25],[18547,23],[21693,22],[22002,25],[22925,27]]},"769":{"position":[[5334,23],[8470,22],[8779,25],[9692,27],[11557,23],[15831,22],[16140,25],[17514,25],[19855,23],[23570,22],[23879,25],[24866,25],[26626,23],[29769,22],[30078,25],[30999,27]]},"771":{"position":[[2107,23],[5932,22],[6241,25],[7286,25],[9490,23],[13022,22],[13331,25],[14538,27],[16416,23],[19951,22],[20260,25],[21469,27]]},"773":{"position":[[5886,23],[13477,22],[13786,25],[17326,25]]},"795":{"position":[[1291,23],[4571,22],[4880,25],[5604,25],[6943,23],[10231,22],[10540,25],[11272,25],[12770,23],[16482,22],[16791,25],[17827,25],[19876,23],[23027,22],[23336,25],[24265,27],[25572,23],[28720,22],[29029,25],[29954,27]]},"797":{"position":[[3909,23],[7796,22],[8105,25],[9256,25],[11207,23],[14364,22],[14673,25],[15608,27]]},"799":{"position":[[3702,23],[7227,22],[7536,25],[8445,25],[10422,23],[14475,22],[14784,25],[16101,25],[18385,23],[21530,22],[21839,25],[22762,27]]},"801":{"position":[[3959,23],[7677,22],[7986,25],[9028,25],[11081,23],[14237,22],[14546,25],[15479,27]]},"821":{"position":[[2907,23],[6305,22],[6614,25],[7402,25],[8850,23],[12013,22],[12322,25],[13263,27],[14618,23],[18016,22],[18325,25],[19113,25],[20518,23],[23681,22],[23990,25],[24931,27],[26267,23],[29445,22],[29754,25],[30709,27],[32706,23],[36742,22],[37051,25],[38256,25],[40222,23],[43385,22],[43694,25],[44635,27]]},"823":{"position":[[928,23],[4082,22],[4391,25],[5322,27],[8210,23],[11361,22],[11670,25],[12599,27]]},"825":{"position":[[7901,23],[11767,22],[12076,25],[13266,25],[15421,23],[18957,22],[19266,25],[20131,25],[21908,23],[25601,22],[25910,25],[26879,25],[28657,23],[32180,22],[32489,25],[33396,25],[35084,23],[38424,22],[38733,25],[39517,25],[40954,23],[44260,22],[44569,25],[45319,25],[46858,23],[50006,22],[50315,25],[51240,27],[52545,23],[55722,22],[56031,25],[56986,27]]},"844":{"position":[[2610,23],[5898,22],[6207,25],[6939,25],[8337,23],[11496,22],[11805,25],[12742,27],[14026,23],[17306,22],[17615,25],[18339,25],[19679,23],[22830,22],[23139,25],[24068,27],[25298,23],[28454,22],[28763,25],[29696,27],[32519,23],[35670,22],[35979,25],[36908,27],[38138,23],[41291,22],[41600,25],[42531,27]]},"846":{"position":[[3210,23],[7339,22],[7648,25],[8922,25],[11145,23],[14304,22],[14613,25],[15550,27]]},"848":{"position":[[2922,23],[6671,22],[6980,25],[8002,25],[10056,23],[13226,22],[13535,25],[14478,27]]},"850":{"position":[[3968,23],[8132,22],[8441,25],[9733,25],[11732,23],[14899,22],[15208,25],[16153,27],[17491,23],[20663,22],[20972,25],[21921,27],[23191,23],[26366,22],[26675,25],[27628,27],[28980,23],[32152,22],[32461,25],[33410,27],[34677,23],[37849,22],[38158,25],[39107,27]]}}}],["authorization_model_id=\"1uhxcsutp0vkpysnkq1pbb1jezw",{"_index":1512,"t":{"236":{"position":[[5587,53]]},"267":{"position":[[5536,53]]},"273":{"position":[[12720,53]]},"282":{"position":[[5805,53]]},"329":{"position":[[5631,53],[11182,53],[17696,54],[17873,53]]},"359":{"position":[[6159,53]]},"406":{"position":[[6829,53]]},"408":{"position":[[7353,53]]},"446":{"position":[[5733,53]]},"466":{"position":[[3026,53]]},"504":{"position":[[5610,53]]},"506":{"position":[[6047,53]]},"522":{"position":[[6071,53]]},"540":{"position":[[5633,53]]},"542":{"position":[[6396,53]]},"556":{"position":[[6197,53]]},"560":{"position":[[6176,53]]},"562":{"position":[[5723,53]]},"566":{"position":[[5513,53]]},"595":{"position":[[5836,52],[11748,52]]},"619":{"position":[[6471,53]]},"627":{"position":[[6984,53]]},"631":{"position":[[5946,53]]},"661":{"position":[[10606,53]]},"669":{"position":[[10597,53]]},"671":{"position":[[7093,53]]},"673":{"position":[[10145,53]]},"691":{"position":[[6783,53]]},"703":{"position":[[5943,53]]},"705":{"position":[[12589,53],[18783,53]]},"726":{"position":[[11382,53],[19519,53],[27276,53]]},"745":{"position":[[7367,53],[18741,53]]},"747":{"position":[[9371,53]]},"749":{"position":[[6009,53],[12367,53]]},"751":{"position":[[9254,53],[23010,53]]},"761":{"position":[[11609,53]]},"767":{"position":[[17688,53]]},"769":{"position":[[18691,53],[25614,53]]},"771":{"position":[[8013,53]]},"773":{"position":[[21047,53]]},"795":{"position":[[6046,53],[11722,53],[18663,53]]},"797":{"position":[[10248,53]]},"799":{"position":[[9113,53],[17259,53]]},"801":{"position":[[9870,53]]},"821":{"position":[[7909,53],[19620,53],[39264,53]]},"825":{"position":[[14256,53],[20715,53],[27608,53],[34062,53],[40019,53],[45787,53]]},"844":{"position":[[7389,53],[18781,53]]},"846":{"position":[[10039,53]]},"848":{"position":[[8785,53]]},"850":{"position":[[10828,53]]}}}],["authorizationmodelid",{"_index":471,"t":{"37":{"position":[[1278,21],[2576,21],[4458,20]]},"43":{"position":[[1000,21],[2000,20]]},"97":{"position":[[551,21],[1210,21],[2147,20]]},"99":{"position":[[344,21],[665,20]]},"113":{"position":[[4973,21]]},"123":{"position":[[551,21],[1210,21],[2147,20]]},"125":{"position":[[376,21],[761,20]]},"169":{"position":[[12833,21],[13795,21],[13979,21],[15146,20],[15360,20],[19027,21],[19989,21],[20173,21],[21340,20],[21554,20],[25381,21],[26364,21],[26554,21],[27769,20],[27989,20]]},"215":{"position":[[610,21],[1239,21],[2086,20]]},"217":{"position":[[958,21],[1728,21],[2814,20]]},"219":{"position":[[834,21],[1753,21],[2977,20]]},"236":{"position":[[664,21],[1581,21],[1765,21],[3042,20],[3262,20]]},"238":{"position":[[674,21],[1633,21],[1817,21],[2981,20],[3195,20],[6418,21],[7379,21],[7563,21],[8729,20],[8943,20]]},"248":{"position":[[551,21],[1210,21],[2147,20]]},"250":{"position":[[288,21],[732,20]]},"252":{"position":[[444,21],[889,20]]},"265":{"position":[[974,21],[1923,21],[2107,21],[3261,20],[3475,20]]},"267":{"position":[[685,21],[1597,21],[1781,21],[3053,20],[3273,20],[6389,21],[7339,21],[7523,21],[8678,20],[8892,20]]},"273":{"position":[[1979,21],[2934,21],[3118,21],[4278,20],[4492,20],[7617,21],[8571,21],[8755,21],[10069,20],[10289,20],[13641,21],[14600,21],[14784,21],[15948,20],[16162,20],[19243,21],[20204,21],[20388,21],[21554,20],[21768,20]]},"282":{"position":[[926,21],[1842,21],[2026,21],[3302,20],[3522,20]]},"284":{"position":[[717,21],[1677,21],[1861,21],[3026,20],[3240,20]]},"294":{"position":[[523,21],[1182,21],[2119,20]]},"329":{"position":[[771,21],[1679,21],[1863,21],[3131,20],[3351,20],[6352,21],[7261,21],[7445,21],[8714,20],[8934,20],[12166,21],[13244,21],[13428,21],[14941,20],[15161,20]]},"353":{"position":[[813,21],[1773,21],[1957,21],[3122,20],[3336,20],[6423,21],[7382,21],[7566,21],[8730,20],[8944,20]]},"359":{"position":[[932,21],[1908,21],[2092,21],[3428,20],[3648,20],[7108,21],[8068,21],[8252,21],[9417,20],[9631,20],[12922,21],[13882,21],[14066,21],[15231,20],[15445,20]]},"375":{"position":[[847,21],[1814,21],[1998,21],[3170,20],[3384,20]]},"382":{"position":[[1792,21],[2749,21],[2933,21],[4095,20],[4309,20]]},"406":{"position":[[795,21],[1877,21],[2061,21],[3562,20],[3782,20],[7549,21],[8511,21],[8695,21],[9862,20],[10076,20]]},"408":{"position":[[697,21],[1889,21],[2073,21],[3684,20],[3904,20]]},"410":{"position":[[643,21],[1605,21],[1789,21],[2956,20],[3170,20]]},"446":{"position":[[726,21],[1655,21],[1839,21],[3128,20],[3348,20]]},"448":{"position":[[747,21],[1714,21],[1898,21],[3070,20],[3284,20],[6584,21],[7552,21],[7736,21],[8909,20],[9123,20]]},"466":{"position":[[1429,21],[1890,20]]},"482":{"position":[[813,21],[1776,21],[1960,21],[3128,20],[3342,20],[6447,21],[7409,21],[7593,21],[8760,20],[8974,20]]},"486":{"position":[[773,21],[1737,21],[1921,21],[3090,20],[3304,20],[6572,21],[7536,21],[7720,21],[8889,20],[9103,20]]},"504":{"position":[[701,21],[1616,21],[1800,21],[3075,20],[3295,20]]},"506":{"position":[[703,21],[1698,21],[1882,21],[3237,20],[3457,20]]},"508":{"position":[[820,21],[1787,21],[1971,21],[3143,20],[3357,20]]},"522":{"position":[[887,21],[1854,21],[2038,21],[3365,20],[3585,20]]},"524":{"position":[[952,21],[1915,21],[2099,21],[3267,20],[3481,20]]},"540":{"position":[[710,21],[1627,21],[1811,21],[3088,20],[3308,20]]},"542":{"position":[[1043,21],[2037,21],[2221,21],[3575,20],[3795,20]]},"544":{"position":[[880,21],[1849,21],[2033,21],[3207,20],[3421,20]]},"556":{"position":[[789,21],[1757,21],[1941,21],[3328,20],[3548,20]]},"560":{"position":[[796,21],[1760,21],[1944,21],[3327,20],[3547,20]]},"562":{"position":[[807,21],[1723,21],[1907,21],[3183,20],[3403,20]]},"564":{"position":[[653,21],[1601,21],[1785,21],[2938,20],[3152,20],[6167,21],[7115,21],[7299,21],[8452,20],[8666,20]]},"566":{"position":[[690,21],[1598,21],[1782,21],[3050,20],[3270,20],[6227,21],[7176,21],[7360,21],[8514,20],[8728,20]]},"581":{"position":[[812,21],[1770,21],[1954,21],[3117,20],[3331,20]]},"588":{"position":[[1062,21],[2065,21],[3509,20],[7218,21],[8202,21],[9607,20],[13199,21],[14193,21],[15608,20]]},"590":{"position":[[1265,21],[2150,21],[3476,20]]},"595":{"position":[[803,21],[1800,21],[1985,21],[3213,20],[3427,20],[6715,21],[7712,21],[7897,21],[9125,20],[9339,20]]},"600":{"position":[[724,21],[1814,21],[2004,21],[3328,20],[3548,20]]},"619":{"position":[[939,21],[1972,21],[2156,21],[3549,20],[3769,20]]},"621":{"position":[[754,21],[1724,21],[1908,21],[3083,20],[3297,20]]},"627":{"position":[[664,21],[1796,21],[1980,21],[3531,20],[3751,20]]},"629":{"position":[[683,21],[1645,21],[1829,21],[2996,20],[3210,20]]},"631":{"position":[[664,21],[1652,21],[1836,21],[3184,20],[3404,20],[6722,21],[7685,21],[7869,21],[9037,20],[9251,20],[12355,21],[13321,21],[13505,21],[14676,20],[14890,20]]},"649":{"position":[[1943,21],[2902,21],[3086,21],[4250,20],[4464,20],[8115,21],[9074,21],[9258,21],[10422,20],[10636,20],[14936,21],[15898,21],[16082,21],[17249,20],[17463,20],[21773,21],[22732,21],[22916,21],[24080,20],[24294,20],[28009,21],[28969,21],[29153,21],[30318,20],[30532,20]]},"651":{"position":[[1916,21],[2876,21],[3060,21],[4225,20],[4439,20],[8165,21],[9128,21],[9312,21],[10480,20],[10694,20],[14509,21],[15470,21],[15654,21],[16820,20],[17034,20],[20832,21],[21793,21],[21977,21],[23143,20],[23357,20]]},"661":{"position":[[4204,21],[5810,20]]},"667":{"position":[[506,21],[828,20],[2339,21],[2663,20],[4196,21],[4518,20],[6035,21],[6360,20],[7890,21],[8213,20],[9735,21],[10060,20]]},"669":{"position":[[3085,21],[3408,20],[5315,21],[6300,21],[6484,21],[7829,20],[8049,20],[10974,21],[11296,20]]},"671":{"position":[[1706,21],[2719,21],[2903,21],[4276,20],[4496,20],[7627,21],[8066,20],[10299,21],[10739,20]]},"673":{"position":[[3743,21],[5349,20]]},"691":{"position":[[935,21],[1987,21],[2171,21],[3642,20],[3862,20],[7483,21],[8443,21],[8627,21],[9792,20],[10006,20],[13478,21],[14438,21],[14622,21],[15787,20],[16001,20],[19164,21],[20126,21],[20310,21],[21477,20],[21691,20],[24790,21],[25751,21],[25935,21],[27101,20],[27315,20]]},"701":{"position":[[1630,21],[2591,21],[2775,21],[3941,20],[4155,20],[7248,21],[8208,21],[8392,21],[9557,20],[9771,20]]},"703":{"position":[[754,21],[1722,21],[1906,21],[3234,20],[3454,20],[6638,21],[7602,21],[7786,21],[8955,20],[9169,20]]},"705":{"position":[[729,21],[1800,21],[3252,20],[7006,21],[7999,21],[8183,21],[9595,20],[9815,20],[13268,21],[14262,21],[14446,21],[15859,20],[16079,20],[19570,21],[20531,21],[20715,21],[21881,20],[22095,20],[25233,21],[26192,21],[26376,21],[27540,20],[27754,20]]},"726":{"position":[[768,21],[2530,21],[2714,21],[5131,20],[5351,20],[12086,21],[13388,21],[13572,21],[15352,20],[15572,20],[20223,21],[21455,21],[21639,21],[23349,20],[23569,20],[28822,21],[29782,21],[29966,21],[31131,20],[31345,20],[34581,21],[35542,21],[35726,21],[36892,20],[37106,20],[40198,21],[41162,21],[41346,21],[42515,20],[42729,20],[45840,21],[46805,21],[46989,21],[48159,20],[48373,20]]},"728":{"position":[[864,21],[1825,21],[2009,21],[3175,20],[3389,20],[8783,21],[9740,21],[9924,21],[11086,20],[11300,20],[14700,21],[15666,21],[15850,21],[17021,20],[17235,20],[25142,21],[26107,21],[26291,21],[27461,20],[27675,20],[33390,21],[34346,21],[34530,21],[35691,20],[35905,20],[42950,21],[43906,21],[44090,21],[45251,20],[45465,20]]},"745":{"position":[[2395,21],[3319,21],[3503,21],[4787,20],[5007,20],[8079,21],[9041,21],[9225,21],[10392,20],[10606,20],[13769,21],[14693,21],[14877,21],[16161,20],[16381,20],[19410,21],[20372,21],[20556,21],[21723,20],[21937,20],[25036,21],[25999,21],[26183,21],[27351,20],[27565,20],[32770,21],[33732,21],[33916,21],[35083,20],[35297,20],[38396,21],[39358,21],[39542,21],[40709,20],[40923,20]]},"747":{"position":[[2924,21],[4077,21],[4261,21],[5833,20],[6053,20],[10238,21],[11202,21],[11386,21],[12555,20],[12769,20]]},"749":{"position":[[869,21],[1817,21],[2001,21],[3309,20],[3529,20],[7110,21],[8090,21],[8274,21],[9614,20],[9834,20],[13001,21],[13963,21],[14147,21],[15314,20],[15528,20]]},"751":{"position":[[3566,21],[4574,21],[4758,21],[6185,20],[6405,20],[10450,21],[11416,21],[11600,21],[12771,20],[12985,20],[17884,21],[18830,21],[19014,21],[20320,20],[20540,20]]},"761":{"position":[[3172,21],[4615,21],[4799,21],[6779,20],[6999,20]]},"767":{"position":[[999,21],[1956,21],[2140,21],[3302,20],[3516,20],[6687,21],[7648,21],[7832,21],[8998,20],[9212,20],[12412,21],[13395,21],[13579,21],[14922,20],[15142,20],[18322,21],[19280,21],[19464,21],[20627,20],[20841,20]]},"769":{"position":[[5114,21],[6067,21],[6251,21],[7409,20],[7623,20],[10919,21],[12270,21],[12454,21],[14283,20],[14503,20],[19462,21],[20568,21],[20752,21],[22277,20],[22497,20],[26401,21],[27358,21],[27542,21],[28704,20],[28918,20]]},"771":{"position":[[1659,21],[2820,21],[3004,21],[4584,20],[4804,20],[9096,21],[10222,21],[10406,21],[11756,20],[11970,20],[16022,21],[17149,21],[17333,21],[18684,20],[18898,20]]},"773":{"position":[[3900,21],[6599,21],[6783,21],[10491,20],[10711,20]]},"795":{"position":[[1081,21],[2004,21],[2188,21],[3471,20],[3691,20],[6729,21],[7656,21],[7840,21],[9127,20],[9347,20],[12413,21],[13483,21],[13667,21],[15215,20],[15435,20],[19647,21],[20608,21],[20792,21],[21958,20],[22172,20],[25346,21],[26305,21],[26489,21],[27653,20],[27867,20]]},"797":{"position":[[3499,21],[4622,21],[4806,21],[6466,20],[6686,20],[10975,21],[11939,21],[12123,21],[13292,20],[13506,20]]},"799":{"position":[[3404,21],[4415,21],[4599,21],[6029,20],[6249,20],[9929,21],[11135,21],[11319,21],[13062,20],[13282,20],[18159,21],[19117,21],[19301,21],[20464,20],[20678,20]]},"801":{"position":[[3599,21],[4672,21],[4856,21],[6407,20],[6627,20],[10851,21],[11814,21],[11998,21],[13166,20],[13380,20]]},"821":{"position":[[2638,21],[3620,21],[3804,21],[5146,20],[5366,20],[8615,21],[9582,21],[9766,21],[10938,20],[11152,20],[14349,21],[15331,21],[15515,21],[16857,20],[17077,20],[20283,21],[21250,21],[21434,21],[22606,20],[22820,20],[26026,21],[27000,21],[27184,21],[28363,20],[28577,20],[32187,21],[33419,21],[33603,21],[35313,20],[35533,20],[39987,21],[40954,21],[41138,21],[42310,20],[42524,20]]},"823":{"position":[[699,21],[1661,21],[1845,21],[3012,20],[3226,20],[7981,21],[8942,21],[9126,21],[10292,20],[10506,20]]},"825":{"position":[[7467,21],[8614,21],[8798,21],[10423,20],[10643,20],[15083,21],[16134,21],[16318,21],[17729,20],[17949,20],[21526,21],[22621,21],[22805,21],[24319,20],[24539,20],[28360,21],[29370,21],[29554,21],[30983,20],[31203,20],[34844,21],[35797,21],[35981,21],[37294,20],[37514,20],[40731,21],[41667,21],[41851,21],[43147,20],[43367,20],[46632,21],[47591,21],[47775,21],[48939,20],[49153,20],[52303,21],[53277,21],[53461,21],[54640,20],[54854,20]]},"844":{"position":[[2396,21],[3323,21],[3507,21],[4794,20],[5014,20],[8104,21],[9069,21],[9253,21],[10423,20],[10637,20],[13816,21],[14739,21],[14923,21],[16206,20],[16426,20],[19450,21],[20411,21],[20595,21],[21761,20],[21975,20],[25068,21],[26031,21],[26215,21],[27383,20],[27597,20],[32290,21],[33251,21],[33435,21],[34601,20],[34815,20],[37908,21],[38870,21],[39054,21],[40221,20],[40435,20]]},"846":{"position":[[2679,21],[3923,21],[4107,21],[5888,20],[6108,20],[10912,21],[11877,21],[12061,21],[13231,20],[13445,20]]},"848":{"position":[[2512,21],[3635,21],[3819,21],[5361,20],[5581,20],[9825,21],[10793,21],[10977,21],[12150,20],[12364,20]]},"850":{"position":[[3385,21],[4681,21],[4865,21],[6639,20],[6859,20],[11495,21],[12464,21],[12648,21],[13822,20],[14036,20],[17253,21],[18224,21],[18408,21],[19584,20],[19798,20],[22950,21],[23923,21],[24107,21],[25285,20],[25499,20],[28742,21],[29713,21],[29897,21],[31073,20],[31287,20],[34439,21],[35410,21],[35594,21],[36770,20],[36984,20]]}}}],["authorize.j",{"_index":982,"t":{"113":{"position":[[826,13]]}}}],["authorized_us",{"_index":711,"t":{"57":{"position":[[226,15],[390,17],[854,15],[932,18],[1143,17],[1312,17],[1710,15],[1814,18]]}}}],["authz",{"_index":287,"t":{"17":{"position":[[89,6],[439,6]]}}}],["autom",{"_index":1886,"t":{"428":{"position":[[964,9]]}}}],["automat",{"_index":1704,"t":{"371":{"position":[[112,13]]},"426":{"position":[[2316,13]]},"490":{"position":[[807,13]]},"677":{"position":[[1734,13]]},"747":{"position":[[9583,13]]},"801":{"position":[[2573,13]]},"846":{"position":[[10257,13]]}}}],["avail",{"_index":809,"t":{"77":{"position":[[847,9],[1185,9],[1323,9]]},"466":{"position":[[549,10]]},"600":{"position":[[7029,10]]},"755":{"position":[[35,9]]},"813":{"position":[[418,9]]},"833":{"position":[[836,10]]},"841":{"position":[[462,9]]}}}],["avoid",{"_index":1040,"t":{"131":{"position":[[200,8],[445,5],[1345,5]]},"420":{"position":[[716,5]]},"689":{"position":[[167,5]]},"701":{"position":[[3,5]]}}}],["await",{"_index":477,"t":{"37":{"position":[[1412,5],[5184,5],[6129,5],[6174,5],[6780,5]]},"43":{"position":[[410,5],[2183,5],[2692,5],[2839,5]]},"97":{"position":[[3065,5],[3110,5]]},"99":{"position":[[146,5],[840,5],[1073,5]]},"109":{"position":[[825,5]]},"111":{"position":[[656,5],[1424,5]]},"113":{"position":[[1370,5],[2412,5]]},"123":{"position":[[3065,5],[3110,5]]},"125":{"position":[[123,5],[938,5],[1217,5]]},"169":{"position":[[12963,5],[15545,5],[16443,5],[16488,5],[16691,5],[19157,5],[21739,5],[22637,5],[22682,5],[22885,5],[25493,5],[28166,5],[29108,5],[29153,5],[29348,5]]},"215":{"position":[[2931,5],[2993,5]]},"217":{"position":[[4060,5],[4122,5]]},"219":{"position":[[4621,5],[4683,5]]},"236":{"position":[[759,5],[3492,5],[4363,5],[4408,5],[4643,5]]},"238":{"position":[[804,5],[3377,5],[4275,5],[4320,5],[4520,5],[6548,5],[9126,5],[10025,5],[10070,5],[10271,5]]},"248":{"position":[[3065,5],[3110,5]]},"250":{"position":[[93,5],[959,5],[1204,5]]},"252":{"position":[[248,5],[1117,5],[1365,5]]},"265":{"position":[[1104,5],[3647,5],[4545,5],[4590,5],[4780,5]]},"267":{"position":[[780,5],[3498,5],[4369,5],[4414,5],[4646,5],[6519,5],[9064,5],[9963,5],[10008,5],[10198,5]]},"273":{"position":[[2109,5],[4669,5],[5568,5],[5613,5],[5808,5],[7712,5],[10556,5],[11427,5],[11472,5],[11743,5],[13771,5],[16344,5],[17242,5],[17287,5],[17487,5],[19373,5],[21951,5],[22850,5],[22895,5],[23096,5]]},"282":{"position":[[1021,5],[3751,5],[4622,5],[4667,5],[4903,5]]},"284":{"position":[[847,5],[3422,5],[4321,5],[4366,5],[4566,5]]},"294":{"position":[[3037,5],[3082,5]]},"296":{"position":[[158,5],[592,5],[740,5],[1658,5],[2350,5],[2618,5]]},"298":{"position":[[1149,5],[1615,5],[1771,5],[2514,5],[3238,5],[3514,5]]},"329":{"position":[[866,5],[3572,5],[4443,5],[4488,5],[4714,5],[6447,5],[9156,5],[10027,5],[10072,5],[10301,5],[12261,5],[15589,5],[16460,5],[16505,5],[16911,5]]},"353":{"position":[[943,5],[3519,5],[4417,5],[4462,5],[4663,5],[6553,5],[9126,5],[10024,5],[10069,5],[10269,5]]},"359":{"position":[[1027,5],[3937,5],[4808,5],[4853,5],[5146,5],[7238,5],[9813,5],[10712,5],[10757,5],[10957,5],[13052,5],[15628,5],[16526,5],[16571,5],[16772,5]]},"375":{"position":[[977,5],[3574,5],[4472,5],[4517,5],[4725,5]]},"382":{"position":[[1922,5],[4489,5],[5387,5],[5432,5],[5630,5]]},"406":{"position":[[890,5],[4187,5],[5058,5],[5103,5],[5511,5],[7679,5],[10261,5],[11159,5],[11204,5],[11407,5]]},"408":{"position":[[792,5],[4419,5],[5290,5],[5335,5],[5853,5]]},"410":{"position":[[773,5],[3355,5],[4253,5],[4298,5],[4501,5]]},"446":{"position":[[821,5],[3590,5],[4461,5],[4506,5],[4753,5]]},"448":{"position":[[877,5],[3474,5],[4372,5],[4417,5],[4625,5],[6714,5],[9313,5],[10212,5],[10257,5],[10465,5]]},"466":{"position":[[1217,5],[2134,5],[2396,5]]},"482":{"position":[[943,5],[3528,5],[4426,5],[4471,5],[4675,5],[6577,5],[9159,5],[10057,5],[10102,5],[10305,5]]},"486":{"position":[[903,5],[3491,5],[4389,5],[4434,5],[4639,5],[6702,5],[9289,5],[10188,5],[10233,5],[10437,5]]},"504":{"position":[[796,5],[3523,5],[4394,5],[4439,5],[4672,5]]},"506":{"position":[[798,5],[3765,5],[4636,5],[4681,5],[4993,5]]},"508":{"position":[[950,5],[3547,5],[4445,5],[4490,5],[4698,5]]},"522":{"position":[[982,5],[3865,5],[4736,5],[4781,5],[5065,5]]},"524":{"position":[[1082,5],[3667,5],[4565,5],[4610,5],[4814,5]]},"540":{"position":[[805,5],[3538,5],[4409,5],[4454,5],[4689,5]]},"542":{"position":[[1138,5],[4102,5],[4973,5],[5018,5],[5329,5]]},"544":{"position":[[1010,5],[3613,5],[4511,5],[4556,5],[4766,5]]},"556":{"position":[[884,5],[3839,5],[4710,5],[4755,5],[5051,5]]},"560":{"position":[[891,5],[3834,5],[4705,5],[4750,5],[5042,5]]},"562":{"position":[[902,5],[3632,5],[4503,5],[4548,5],[4782,5]]},"564":{"position":[[783,5],[3323,5],[4221,5],[4266,5],[4455,5],[6297,5],[8837,5],[9735,5],[9780,5],[9969,5]]},"566":{"position":[[785,5],[3491,5],[4362,5],[4407,5],[4635,5],[6357,5],[8899,5],[9798,5],[9843,5],[10032,5]]},"581":{"position":[[942,5],[3512,5],[4410,5],[4455,5],[4654,5]]},"588":{"position":[[1194,5],[3840,5],[4855,5],[4900,5],[5024,5],[7350,5],[9917,5],[10932,5],[10977,5],[11082,5],[13331,5],[15928,5],[16943,5],[16988,5],[17103,5]]},"590":{"position":[[1397,5],[3807,5],[4704,5],[4749,5],[4873,5]]},"595":{"position":[[915,5],[3668,5],[4568,5],[4613,5],[4798,5],[6827,5],[9580,5],[10480,5],[10525,5],[10710,5]]},"600":{"position":[[836,5],[3846,5],[4788,5],[4833,5],[5129,5]]},"619":{"position":[[1034,5],[4115,5],[4986,5],[5031,5],[5381,5]]},"621":{"position":[[884,5],[3490,5],[4388,5],[4433,5],[4644,5]]},"627":{"position":[[759,5],[4206,5],[5077,5],[5122,5],[5580,5]]},"629":{"position":[[813,5],[3395,5],[4293,5],[4338,5],[4541,5]]},"631":{"position":[[759,5],[3705,5],[4576,5],[4621,5],[4928,5],[6852,5],[9436,5],[10335,5],[10380,5],[10583,5],[12485,5],[15079,5],[15977,5],[16022,5],[16229,5]]},"649":{"position":[[2073,5],[4646,5],[5544,5],[5589,5],[5789,5],[8245,5],[10818,5],[11716,5],[11761,5],[11961,5],[15066,5],[17648,5],[18546,5],[18591,5],[18794,5],[21903,5],[24476,5],[25374,5],[25419,5],[25619,5],[28139,5],[30715,5],[31613,5],[31658,5],[31859,5]]},"651":{"position":[[2046,5],[4621,5],[5520,5],[5565,5],[5765,5],[8295,5],[10879,5],[11778,5],[11823,5],[12026,5],[14639,5],[17217,5],[18116,5],[18161,5],[18362,5],[20962,5],[23541,5],[24439,5],[24484,5],[24686,5]]},"661":{"position":[[3201,5],[6905,5],[8011,5]]},"667":{"position":[[307,5],[1004,5],[1238,5],[2138,5],[2841,5],[3077,5],[3997,5],[4694,5],[4928,5],[5833,5],[6538,5],[6775,5],[7690,5],[8389,5],[8624,5],[9533,5],[10238,5],[10475,5]]},"669":{"position":[[2885,5],[3584,5],[3819,5],[5410,5],[8347,5],[9218,5],[9263,5],[9565,5],[10775,5],[11472,5],[11706,5]]},"671":{"position":[[1801,5],[4822,5],[5693,5],[5738,5],[6070,5],[7329,5],[8371,5],[8714,5],[10000,5],[11044,5],[11388,5]]},"673":{"position":[[2740,5],[6444,5],[7550,5]]},"691":{"position":[[1030,5],[4237,5],[5108,5],[5153,5],[5531,5],[7613,5],[10189,5],[11087,5],[11132,5],[11333,5],[13608,5],[16183,5],[17082,5],[17127,5],[17327,5],[19294,5],[21876,5],[22774,5],[22819,5],[23022,5],[24920,5],[27499,5],[28397,5],[28442,5],[28644,5]]},"701":{"position":[[1760,5],[4339,5],[5237,5],[5282,5],[5484,5],[7378,5],[9954,5],[10852,5],[10897,5],[11098,5]]},"703":{"position":[[849,5],[3735,5],[4606,5],[4651,5],[4936,5],[6768,5],[9356,5],[10254,5],[10299,5],[10504,5]]},"705":{"position":[[861,5],[3521,5],[4660,5],[4705,5],[4773,5],[7101,5],[10131,5],[11002,5],[11047,5],[11368,5],[13363,5],[16396,5],[17267,5],[17312,5],[17636,5],[19700,5],[22279,5],[23177,5],[23222,5],[23424,5],[25363,5],[27935,5],[28834,5],[28879,5],[29078,5]]},"726":{"position":[[863,5],[6476,5],[7347,5],[7392,5],[8516,5],[12181,5],[16207,5],[17078,5],[17123,5],[17760,5],[20318,5],[24134,5],[25005,5],[25050,5],[25617,5],[28952,5],[31528,5],[32426,5],[32471,5],[32672,5],[34711,5],[37289,5],[38188,5],[38233,5],[38434,5],[40328,5],[42916,5],[43814,5],[43859,5],[44064,5],[45970,5],[48561,5],[49459,5],[49504,5],[49710,5]]},"728":{"position":[[994,5],[3568,5],[4471,5],[4516,5],[4713,5],[8913,5],[11479,5],[12378,5],[12423,5],[12620,5],[14830,5],[17423,5],[18322,5],[18367,5],[18573,5],[25272,5],[27863,5],[28761,5],[28806,5],[29012,5],[33520,5],[36084,5],[36982,5],[37027,5],[37224,5],[43080,5],[45644,5],[46542,5],[46587,5],[46784,5]]},"745":{"position":[[2490,5],[5244,5],[6115,5],[6160,5],[6402,5],[8209,5],[10791,5],[11689,5],[11734,5],[11937,5],[13864,5],[16618,5],[17489,5],[17534,5],[17776,5],[19540,5],[22122,5],[23020,5],[23065,5],[23268,5],[25166,5],[27750,5],[28649,5],[28694,5],[28897,5],[32900,5],[35482,5],[36380,5],[36425,5],[36628,5],[38526,5],[41108,5],[42006,5],[42051,5],[42254,5]]},"747":{"position":[[3019,5],[6529,5],[7400,5],[7445,5],[7924,5],[10368,5],[12956,5],[13854,5],[13899,5],[14104,5]]},"749":{"position":[[964,5],[3790,5],[4661,5],[4706,5],[4972,5],[7205,5],[10127,5],[10998,5],[11043,5],[11340,5],[13131,5],[15713,5],[16611,5],[16656,5],[16859,5]]},"751":{"position":[[3661,5],[6736,5],[7607,5],[7652,5],[7988,5],[10580,5],[13169,5],[14072,5],[14117,5],[14319,5],[17979,5],[20799,5],[21670,5],[21715,5],[21979,5]]},"761":{"position":[[3267,5],[7785,5],[8656,5],[8701,5],[9488,5]]},"767":{"position":[[1129,5],[3696,5],[4594,5],[4639,5],[4837,5],[6817,5],[9396,5],[10294,5],[10339,5],[10541,5],[12507,5],[15438,5],[16309,5],[16354,5],[16654,5],[18452,5],[21021,5],[21920,5],[21965,5],[22163,5]]},"769":{"position":[[5244,5],[7798,5],[8697,5],[8742,5],[8935,5],[11014,5],[15187,5],[16058,5],[16103,5],[16789,5],[19557,5],[22926,5],[23797,5],[23842,5],[24274,5],[26531,5],[29098,5],[29996,5],[30041,5],[30239,5]]},"771":{"position":[[1754,5],[5288,5],[6159,5],[6204,5],[6693,5],[9226,5],[12351,5],[13249,5],[13294,5],[13680,5],[16152,5],[19279,5],[20178,5],[20223,5],[20609,5]]},"773":{"position":[[3995,5],[12833,5],[13704,5],[13749,5],[15864,5]]},"795":{"position":[[1176,5],[3927,5],[4798,5],[4843,5],[5084,5],[6824,5],[9587,5],[10458,5],[10503,5],[10748,5],[12508,5],[15838,5],[16709,5],[16754,5],[17162,5],[19777,5],[22356,5],[23254,5],[23299,5],[23501,5],[25476,5],[28048,5],[28947,5],[28992,5],[29191,5]]},"797":{"position":[[3594,5],[7152,5],[8023,5],[8068,5],[8539,5],[11105,5],[13693,5],[14591,5],[14636,5],[14841,5]]},"799":{"position":[[3499,5],[6583,5],[7454,5],[7499,5],[7838,5],[10024,5],[13831,5],[14702,5],[14747,5],[15301,5],[18289,5],[20859,5],[21757,5],[21802,5],[22001,5]]},"801":{"position":[[3694,5],[7033,5],[7904,5],[7949,5],[8360,5],[10981,5],[13565,5],[14464,5],[14509,5],[14712,5]]},"821":{"position":[[2733,5],[5661,5],[6532,5],[6577,5],[6876,5],[8745,5],[11342,5],[12240,5],[12285,5],[12493,5],[14444,5],[17372,5],[18243,5],[18288,5],[18587,5],[20413,5],[23010,5],[23908,5],[23953,5],[24161,5],[26156,5],[28773,5],[29672,5],[29717,5],[29931,5],[32282,5],[36098,5],[36969,5],[37014,5],[37581,5],[40117,5],[42714,5],[43612,5],[43657,5],[43865,5]]},"823":{"position":[[829,5],[3410,5],[4309,5],[4354,5],[4556,5],[8111,5],[10690,5],[11588,5],[11633,5],[11835,5]]},"825":{"position":[[7562,5],[11123,5],[11994,5],[12039,5],[12524,5],[15178,5],[18313,5],[19184,5],[19229,5],[19597,5],[21621,5],[24957,5],[25828,5],[25873,5],[26295,5],[28455,5],[31536,5],[32407,5],[32452,5],[32790,5],[34939,5],[37780,5],[38651,5],[38696,5],[38967,5],[40826,5],[43616,5],[44487,5],[44532,5],[44786,5],[46762,5],[49334,5],[50233,5],[50278,5],[50477,5],[52433,5],[55051,5],[55949,5],[55994,5],[56209,5]]},"844":{"position":[[2491,5],[5254,5],[6125,5],[6170,5],[6415,5],[8234,5],[10825,5],[11723,5],[11768,5],[11974,5],[13911,5],[16662,5],[17533,5],[17578,5],[17819,5],[19580,5],[22159,5],[23057,5],[23102,5],[23304,5],[25198,5],[27782,5],[28681,5],[28726,5],[28929,5],[32420,5],[34999,5],[35897,5],[35942,5],[36144,5],[38038,5],[40620,5],[41518,5],[41563,5],[41766,5]]},"846":{"position":[[2774,5],[6695,5],[7566,5],[7611,5],[8201,5],[11042,5],[13633,5],[14531,5],[14576,5],[14782,5]]},"848":{"position":[[2607,5],[6027,5],[6898,5],[6943,5],[7392,5],[9955,5],[12550,5],[13453,5],[13498,5],[13702,5]]},"850":{"position":[[3480,5],[7488,5],[8359,5],[8404,5],[9035,5],[11625,5],[14228,5],[15126,5],[15171,5],[15381,5],[17383,5],[19991,5],[20890,5],[20935,5],[21146,5],[23080,5],[25695,5],[26593,5],[26638,5],[26852,5],[28872,5],[31480,5],[32379,5],[32424,5],[32635,5],[34569,5],[37177,5],[38076,5],[38121,5],[38332,5]]}}}],["awar",{"_index":2144,"t":{"598":{"position":[[241,5]]},"673":{"position":[[10462,5]]},"745":{"position":[[30274,5]]},"773":{"position":[[21364,5],[21526,5]]},"844":{"position":[[30314,5]]}}}],["b",{"_index":692,"t":{"53":{"position":[[2729,1],[2755,1]]},"310":{"position":[[541,2]]},"312":{"position":[[213,1]]},"353":{"position":[[12016,2]]},"359":{"position":[[6213,2]]},"426":{"position":[[2543,3]]},"661":{"position":[[2908,1],[2964,1],[3091,1],[3420,1],[3684,1],[4036,1],[4589,1],[4971,1],[5500,1],[6138,1],[6422,1],[6804,1],[7262,1],[7544,1],[7923,1],[9893,1],[10165,1],[10529,1]]},"663":{"position":[[155,2],[373,2]]},"671":{"position":[[12662,1],[12751,1],[12811,1],[12840,1]]},"673":{"position":[[2959,1],[3223,1],[3575,1],[4128,1],[4510,1],[5039,1],[5677,1],[5961,1],[6343,1],[6801,1],[7083,1],[7462,1],[9432,1],[9704,1],[10068,1]]}}}],["b2b",{"_index":1731,"t":{"390":{"position":[[119,5]]}}}],["b78a",{"_index":2460,"t":{"726":{"position":[[27914,4]]}}}],["back",{"_index":1780,"t":{"410":{"position":[[5705,4]]},"452":{"position":[[970,5]]},"797":{"position":[[1105,5]]}}}],["backward",{"_index":2350,"t":{"701":{"position":[[47,9],[79,9]]},"703":{"position":[[20,9]]}}}],["bank",{"_index":62,"t":{"3":{"position":[[902,4]]},"5":{"position":[[373,4]]},"775":{"position":[[79,5],[145,4],[258,4],[323,5],[329,6],[1092,7],[1280,7],[1809,7],[1862,6]]}}}],["base",{"_index":20,"t":{"3":{"position":[[279,5],[599,5]]},"5":{"position":[[193,5],[241,5],[326,5],[387,5]]},"21":{"position":[[8,5],[64,5],[164,5],[223,5],[256,5]]},"23":{"position":[[30,5]]},"59":{"position":[[144,4],[405,7]]},"73":{"position":[[731,5]]},"107":{"position":[[234,5]]},"133":{"position":[[988,5]]},"161":{"position":[[807,5]]},"169":{"position":[[31346,5]]},"316":{"position":[[512,5],[1033,5]]},"357":{"position":[[635,7]]},"414":{"position":[[24,5]]},"422":{"position":[[383,5]]},"424":{"position":[[150,5]]},"428":{"position":[[404,5],[1428,5]]},"474":{"position":[[340,5],[2449,5]]},"476":{"position":[[37,5]]},"600":{"position":[[59,5]]},"669":{"position":[[62,5]]},"671":{"position":[[34,5]]},"675":{"position":[[239,5]]},"677":{"position":[[315,5]]},"685":{"position":[[488,5]]},"751":{"position":[[24,4],[292,4],[9738,4],[16998,4],[17098,4]]},"771":{"position":[[34,5],[259,5]]},"791":{"position":[[23,5],[57,5]]},"795":{"position":[[291,5],[345,5]]},"801":{"position":[[2764,5]]},"815":{"position":[[263,4]]},"819":{"position":[[295,5],[325,5]]},"823":{"position":[[5856,5]]}}}],["base_project_editor",{"_index":2296,"t":{"669":{"position":[[808,21],[978,21],[1202,20],[1272,19],[1554,22],[1793,21],[2111,22]]},"673":{"position":[[209,20],[279,19],[914,22],[1153,21],[1471,22]]}}}],["basic",{"_index":406,"t":{"29":{"position":[[141,5]]},"39":{"position":[[228,6]]},"316":{"position":[[143,6]]},"444":{"position":[[180,5]]},"724":{"position":[[377,5]]},"815":{"position":[[349,5],[560,5]]},"827":{"position":[[7,5]]}}}],["bayer",{"_index":2390,"t":{"721":{"position":[[188,5],[209,8],[380,5]]},"726":{"position":[[12368,5],[13925,5],[15868,5],[17435,5],[19210,5],[20508,5],[21995,5],[23868,5],[25365,5],[27040,5]]}}}],["bc574cf98b54",{"_index":2461,"t":{"726":{"position":[[27919,12]]}}}],["be",{"_index":300,"t":{"19":{"position":[[30,5],[139,5],[322,5]]},"21":{"position":[[209,5]]},"27":{"position":[[582,5]]},"45":{"position":[[617,5]]},"49":{"position":[[1578,5]]},"73":{"position":[[0,5]]},"131":{"position":[[1478,5]]},"133":{"position":[[414,5]]},"169":{"position":[[3295,5]]},"310":{"position":[[1527,5]]},"347":{"position":[[1109,5],[2375,5]]},"351":{"position":[[667,5]]},"365":{"position":[[905,5]]},"386":{"position":[[394,5],[558,5]]},"426":{"position":[[7756,5],[7787,5],[7819,5]]},"462":{"position":[[1371,5]]},"474":{"position":[[1553,5]]},"492":{"position":[[1754,5]]},"496":{"position":[[673,5]]},"566":{"position":[[47,5]]},"669":{"position":[[470,5]]},"728":{"position":[[22864,5]]},"769":{"position":[[2617,5]]},"829":{"position":[[74,5]]}}}],["bearer",{"_index":552,"t":{"37":{"position":[[7768,6]]},"99":{"position":[[1351,6]]},"125":{"position":[[1593,6]]},"147":{"position":[[335,6]]},"169":{"position":[[17335,6],[23529,6],[30080,6]]},"217":{"position":[[2037,6]]},"236":{"position":[[4936,6]]},"238":{"position":[[5161,6],[10915,6]]},"250":{"position":[[1429,6]]},"252":{"position":[[1552,6]]},"265":{"position":[[5411,6]]},"267":{"position":[[4939,6],[10831,6]]},"273":{"position":[[6446,6],[12036,6],[18128,6],[23740,6]]},"282":{"position":[[5196,6]]},"284":{"position":[[5209,6]]},"296":{"position":[[909,6],[2787,6]]},"298":{"position":[[1954,6],[3697,6]]},"329":{"position":[[5007,6],[10594,6],[17204,6]]},"353":{"position":[[5305,6],[10910,6]]},"359":{"position":[[5439,6],[11600,6],[17414,6]]},"375":{"position":[[5374,6]]},"382":{"position":[[6269,6]]},"406":{"position":[[5804,6],[12051,6]]},"408":{"position":[[6146,6]]},"410":{"position":[[5145,6]]},"446":{"position":[[5046,6]]},"448":{"position":[[5274,6],[11116,6]]},"466":{"position":[[2511,6]]},"482":{"position":[[5320,6],[10949,6]]},"486":{"position":[[5285,6],[11084,6]]},"504":{"position":[[4965,6]]},"506":{"position":[[5286,6]]},"508":{"position":[[5347,6]]},"522":{"position":[[5358,6]]},"524":{"position":[[5459,6]]},"540":{"position":[[4982,6]]},"542":{"position":[[5622,6]]},"544":{"position":[[5417,6]]},"556":{"position":[[5344,6]]},"560":{"position":[[5335,6]]},"562":{"position":[[5075,6]]},"564":{"position":[[5085,6],[10599,6]]},"566":{"position":[[4928,6],[10664,6]]},"581":{"position":[[5294,6]]},"588":{"position":[[5747,6],[11787,6],[17818,6]]},"590":{"position":[[5478,6]]},"595":{"position":[[5447,6],[11359,6]]},"600":{"position":[[5916,6]]},"619":{"position":[[5674,6]]},"621":{"position":[[5296,6]]},"627":{"position":[[5873,6]]},"629":{"position":[[5185,6]]},"631":{"position":[[5221,6],[11229,6],[16877,6]]},"649":{"position":[[6430,6],[12602,6],[19438,6],[26260,6],[32501,6]]},"651":{"position":[[6408,6],[12672,6],[19006,6],[25329,6]]},"661":{"position":[[8126,6]]},"667":{"position":[[1517,6],[3358,6],[5207,6],[7058,6],[8905,6],[10758,6]]},"669":{"position":[[4100,6],[9858,6],[11985,6]]},"671":{"position":[[6363,6],[9056,6],[11732,6]]},"673":{"position":[[7665,6]]},"691":{"position":[[5824,6],[11975,6],[17970,6],[23666,6],[29287,6]]},"701":{"position":[[6127,6],[11740,6]]},"703":{"position":[[5229,6],[11150,6]]},"705":{"position":[[5567,6],[11661,6],[17929,6],[24067,6],[29720,6]]},"726":{"position":[[8809,6],[18053,6],[25910,6],[33314,6],[39078,6],[44710,6],[50357,6]]},"728":{"position":[[5361,6],[13260,6],[19222,6],[29659,6],[37862,6],[47422,6]]},"745":{"position":[[6695,6],[12581,6],[18069,6],[23912,6],[29543,6],[37272,6],[42898,6]]},"747":{"position":[[8217,6],[14750,6]]},"749":{"position":[[5265,6],[11633,6],[17503,6]]},"751":{"position":[[8281,6],[14972,6],[22272,6]]},"761":{"position":[[9781,6]]},"767":{"position":[[5476,6],[11184,6],[16947,6],[22804,6]]},"769":{"position":[[9571,6],[17082,6],[24567,6],[30878,6]]},"771":{"position":[[6986,6],[14417,6],[21348,6]]},"773":{"position":[[16157,6]]},"795":{"position":[[5377,6],[11041,6],[17455,6],[24144,6],[29833,6]]},"797":{"position":[[8832,6],[15487,6]]},"799":{"position":[[8131,6],[15594,6],[22641,6]]},"801":{"position":[[8653,6],[15358,6]]},"821":{"position":[[7169,6],[13142,6],[18880,6],[24810,6],[30588,6],[37874,6],[44514,6]]},"823":{"position":[[5201,6],[12478,6]]},"825":{"position":[[12817,6],[19890,6],[26588,6],[33083,6],[39260,6],[45079,6],[51119,6],[56865,6]]},"844":{"position":[[6708,6],[12621,6],[18112,6],[23947,6],[29575,6],[36787,6],[42410,6]]},"846":{"position":[[8494,6],[15429,6]]},"848":{"position":[[7685,6],[14357,6]]},"850":{"position":[[9328,6],[16032,6],[21800,6],[27507,6],[33289,6],[38986,6]]}}}],["becam",{"_index":1287,"t":{"155":{"position":[[665,6],[747,6]]}}}],["becki",{"_index":1515,"t":{"238":{"position":[[5732,6],[5775,5]]},"273":{"position":[[13008,6]]},"331":{"position":[[147,6],[254,5],[337,5]]},"347":{"position":[[423,5],[1294,5]]},"353":{"position":[[153,5],[12073,5]]},"359":{"position":[[12203,5],[12244,5],[12323,5]]},"474":{"position":[[540,5],[625,5],[1726,5],[1976,5]]},"482":{"position":[[152,5],[11570,5]]},"486":{"position":[[57,5]]},"562":{"position":[[32,6],[60,5],[184,5]]},"564":{"position":[[23,5]]},"566":{"position":[[5608,5]]}}}],["becom",{"_index":734,"t":{"61":{"position":[[867,7],[1051,7]]},"143":{"position":[[846,7]]},"300":{"position":[[80,7]]},"306":{"position":[[294,7]]},"310":{"position":[[1421,7]]},"355":{"position":[[197,7]]},"373":{"position":[[143,7]]},"404":{"position":[[251,7]]},"424":{"position":[[2689,6]]},"428":{"position":[[1859,7],[2128,7]]},"508":{"position":[[6131,8]]},"544":{"position":[[6006,8]]},"600":{"position":[[7022,6]]},"669":{"position":[[1076,8]]},"728":{"position":[[39518,7]]},"769":{"position":[[1281,8],[2780,8]]},"793":{"position":[[515,7]]},"799":{"position":[[765,8]]}}}],["befor",{"_index":135,"t":{"3":{"position":[[2927,6]]},"37":{"position":[[2539,6],[4421,6],[5865,6]]},"41":{"position":[[110,6]]},"43":{"position":[[963,6],[1963,6]]},"45":{"position":[[610,6]]},"73":{"position":[[665,6]]},"97":{"position":[[0,6],[1173,6],[2110,6],[2801,6]]},"111":{"position":[[0,6]]},"113":{"position":[[4936,6]]},"123":{"position":[[0,6],[1173,6],[2110,6],[2801,6]]},"133":{"position":[[5,6]]},"169":{"position":[[3288,6],[13758,6],[15109,6],[16179,6],[19952,6],[21303,6],[22373,6],[26327,6],[27732,6],[28844,6]]},"215":{"position":[[573,6],[1202,6],[2049,6],[2737,6]]},"217":{"position":[[921,6],[1691,6],[2777,6],[3839,6]]},"219":{"position":[[797,6],[1716,6],[2940,6],[4400,6]]},"236":{"position":[[1544,6],[3005,6],[4099,6]]},"238":{"position":[[1596,6],[2944,6],[4011,6],[7342,6],[8692,6],[9761,6]]},"248":{"position":[[0,6],[1173,6],[2110,6],[2801,6]]},"265":{"position":[[1886,6],[3224,6],[4281,6]]},"267":{"position":[[1560,6],[3016,6],[4105,6],[7302,6],[8641,6],[9699,6]]},"273":{"position":[[2897,6],[4241,6],[5304,6],[8534,6],[10032,6],[11163,6],[14563,6],[15911,6],[16978,6],[20167,6],[21517,6],[22586,6]]},"282":{"position":[[1805,6],[3265,6],[4358,6]]},"284":{"position":[[1640,6],[2989,6],[4057,6]]},"294":{"position":[[1145,6],[2082,6],[2773,6]]},"300":{"position":[[179,6]]},"306":{"position":[[553,6]]},"310":{"position":[[1520,6],[2577,6]]},"316":{"position":[[885,6]]},"329":{"position":[[1642,6],[3094,6],[4179,6],[7224,6],[8677,6],[9763,6],[13207,6],[14904,6],[16196,6]]},"347":{"position":[[0,6]]},"353":{"position":[[1736,6],[3085,6],[4153,6],[7345,6],[8693,6],[9760,6]]},"359":{"position":[[1871,6],[3391,6],[4544,6],[8031,6],[9380,6],[10448,6],[13845,6],[15194,6],[16262,6]]},"375":{"position":[[1777,6],[3133,6],[4208,6]]},"382":{"position":[[2712,6],[4058,6],[5123,6]]},"392":{"position":[[0,6]]},"406":{"position":[[1840,6],[3525,6],[4794,6],[8474,6],[9825,6],[10895,6]]},"408":{"position":[[1852,6],[3647,6],[5026,6]]},"410":{"position":[[1568,6],[2919,6],[3989,6]]},"446":{"position":[[1618,6],[3091,6],[4197,6]]},"448":{"position":[[1677,6],[3033,6],[4108,6],[7515,6],[8872,6],[9948,6]]},"452":{"position":[[981,6]]},"454":{"position":[[402,6]]},"472":{"position":[[81,6],[610,6]]},"482":{"position":[[1739,6],[3091,6],[4162,6],[7372,6],[8723,6],[9793,6]]},"486":{"position":[[1700,6],[3053,6],[4125,6],[7499,6],[8852,6],[9924,6]]},"504":{"position":[[1579,6],[3038,6],[4130,6]]},"506":{"position":[[1661,6],[3200,6],[4372,6]]},"508":{"position":[[1750,6],[3106,6],[4181,6]]},"522":{"position":[[1817,6],[3328,6],[4472,6]]},"524":{"position":[[1878,6],[3230,6],[4301,6]]},"540":{"position":[[1590,6],[3051,6],[4145,6]]},"542":{"position":[[2000,6],[3538,6],[4709,6]]},"544":{"position":[[1812,6],[3170,6],[4247,6]]},"556":{"position":[[1720,6],[3291,6],[4446,6]]},"560":{"position":[[1723,6],[3290,6],[4441,6]]},"562":{"position":[[1686,6],[3146,6],[4239,6]]},"564":{"position":[[1564,6],[2901,6],[3957,6],[7078,6],[8415,6],[9471,6]]},"566":{"position":[[1561,6],[3013,6],[4098,6],[7139,6],[8477,6],[9534,6]]},"581":{"position":[[1733,6],[3080,6],[4146,6]]},"588":{"position":[[2028,6],[3472,6],[4591,6],[8165,6],[9570,6],[10668,6],[14156,6],[15571,6],[16679,6]]},"590":{"position":[[2113,6],[3439,6],[4440,6]]},"595":{"position":[[1763,6],[3176,6],[4304,6],[7675,6],[9088,6],[10216,6]]},"600":{"position":[[1777,6],[3291,6],[4524,6]]},"619":{"position":[[1935,6],[3512,6],[4722,6]]},"621":{"position":[[1687,6],[3046,6],[4124,6]]},"627":{"position":[[1759,6],[3494,6],[4813,6]]},"629":{"position":[[1608,6],[2959,6],[4029,6]]},"631":{"position":[[1615,6],[3147,6],[4312,6],[7648,6],[9000,6],[10071,6],[13284,6],[14639,6],[15713,6]]},"649":{"position":[[2865,6],[4213,6],[5280,6],[9037,6],[10385,6],[11452,6],[15861,6],[17212,6],[18282,6],[22695,6],[24043,6],[25110,6],[28932,6],[30281,6],[31349,6]]},"651":{"position":[[2839,6],[4188,6],[5256,6],[9091,6],[10443,6],[11514,6],[15433,6],[16783,6],[17852,6],[21756,6],[23106,6],[24175,6]]},"659":{"position":[[880,6]]},"669":{"position":[[6263,6],[7792,6],[8954,6]]},"671":{"position":[[2682,6],[4239,6],[5429,6]]},"675":{"position":[[158,6]]},"691":{"position":[[1950,6],[3605,6],[4844,6],[8406,6],[9755,6],[10823,6],[14401,6],[15750,6],[16818,6],[20089,6],[21440,6],[22510,6],[25714,6],[27064,6],[28133,6]]},"701":{"position":[[2554,6],[3904,6],[4973,6],[8171,6],[9520,6],[10588,6]]},"703":{"position":[[1685,6],[3197,6],[4342,6],[7565,6],[8918,6],[9990,6]]},"705":{"position":[[1763,6],[3215,6],[4396,6],[7962,6],[9558,6],[10738,6],[14225,6],[15822,6],[17003,6],[18868,6],[20494,6],[21844,6],[22913,6],[26155,6],[27503,6],[28570,6]]},"713":{"position":[[243,6]]},"715":{"position":[[73,6]]},"726":{"position":[[2493,6],[5094,6],[7083,6],[13351,6],[15315,6],[16814,6],[21418,6],[23312,6],[24741,6],[29745,6],[31094,6],[32162,6],[33942,6],[35505,6],[36855,6],[37924,6],[41125,6],[42478,6],[43550,6],[46768,6],[48122,6],[49195,6]]},"728":{"position":[[1788,6],[3138,6],[4207,6],[9703,6],[11049,6],[12114,6],[15629,6],[16984,6],[18058,6],[26070,6],[27424,6],[28497,6],[34309,6],[35654,6],[36718,6],[43869,6],[45214,6],[46278,6]]},"734":{"position":[[243,6]]},"736":{"position":[[73,6]]},"745":{"position":[[3282,6],[4750,6],[5851,6],[9004,6],[10355,6],[11425,6],[14656,6],[16124,6],[17225,6],[20335,6],[21686,6],[22756,6],[25962,6],[27314,6],[28385,6],[33695,6],[35046,6],[36116,6],[39321,6],[40672,6],[41742,6]]},"747":{"position":[[4040,6],[5796,6],[7136,6],[11165,6],[12518,6],[13590,6]]},"749":{"position":[[1780,6],[3272,6],[4397,6],[8053,6],[9577,6],[10734,6],[13926,6],[15277,6],[16347,6]]},"751":{"position":[[629,6],[4537,6],[6148,6],[7343,6],[11379,6],[12734,6],[13808,6],[18793,6],[20283,6],[21406,6]]},"759":{"position":[[882,6]]},"761":{"position":[[4578,6],[6742,6],[8392,6]]},"767":{"position":[[1919,6],[3265,6],[4330,6],[7611,6],[8961,6],[10030,6],[13358,6],[14885,6],[16045,6],[19243,6],[20590,6],[21656,6]]},"769":{"position":[[6030,6],[7372,6],[8433,6],[12233,6],[14246,6],[15794,6],[20531,6],[22240,6],[23533,6],[27321,6],[28667,6],[29732,6]]},"771":{"position":[[2783,6],[4547,6],[5895,6],[10185,6],[11719,6],[12985,6],[17112,6],[18647,6],[19914,6]]},"773":{"position":[[6562,6],[10454,6],[13440,6]]},"777":{"position":[[277,6]]},"781":{"position":[[243,6]]},"783":{"position":[[73,6]]},"795":{"position":[[236,6],[1967,6],[3434,6],[4534,6],[7619,6],[9090,6],[10194,6],[13446,6],[15178,6],[16445,6],[20571,6],[21921,6],[22990,6],[26268,6],[27616,6],[28683,6]]},"797":{"position":[[4585,6],[6429,6],[7759,6],[11902,6],[13255,6],[14327,6]]},"799":{"position":[[4378,6],[5992,6],[7190,6],[11098,6],[13025,6],[14438,6],[19080,6],[20427,6],[21493,6]]},"801":{"position":[[4635,6],[6370,6],[7640,6],[11777,6],[13129,6],[14200,6]]},"809":{"position":[[243,6]]},"811":{"position":[[73,6]]},"821":{"position":[[3583,6],[5109,6],[6268,6],[9545,6],[10901,6],[11976,6],[15294,6],[16820,6],[17979,6],[21213,6],[22569,6],[23644,6],[26963,6],[28326,6],[29408,6],[33382,6],[35276,6],[36705,6],[40917,6],[42273,6],[43348,6]]},"823":{"position":[[1624,6],[2975,6],[4045,6],[5755,7],[8905,6],[10255,6],[11324,6]]},"825":{"position":[[8577,6],[10386,6],[11730,6],[16097,6],[17692,6],[18920,6],[22584,6],[24282,6],[25564,6],[29333,6],[30946,6],[32143,6],[35760,6],[37257,6],[38387,6],[41630,6],[43110,6],[44223,6],[47554,6],[48902,6],[49969,6],[53240,6],[54603,6],[55685,6]]},"833":{"position":[[243,6]]},"835":{"position":[[73,6]]},"844":{"position":[[3286,6],[4757,6],[5861,6],[9032,6],[10386,6],[11459,6],[14702,6],[16169,6],[17269,6],[20374,6],[21724,6],[22793,6],[25994,6],[27346,6],[28417,6],[33214,6],[34564,6],[35633,6],[38833,6],[40184,6],[41254,6]]},"846":{"position":[[3886,6],[5851,6],[7302,6],[11840,6],[13194,6],[14267,6]]},"848":{"position":[[3598,6],[5324,6],[6634,6],[10756,6],[12113,6],[13189,6]]},"850":{"position":[[4644,6],[6602,6],[8095,6],[12427,6],[13785,6],[14862,6],[18187,6],[19547,6],[20626,6],[23886,6],[25248,6],[26329,6],[29676,6],[31036,6],[32115,6],[35373,6],[36733,6],[37812,6]]}}}],["beforehand",{"_index":1736,"t":{"390":{"position":[[590,10]]},"671":{"position":[[613,10]]},"771":{"position":[[8221,10]]}}}],["begin",{"_index":640,"t":{"49":{"position":[[43,9]]},"426":{"position":[[193,9]]},"728":{"position":[[41896,9]]}}}],["behavior",{"_index":1116,"t":{"133":{"position":[[1770,8]]},"209":{"position":[[382,8]]},"452":{"position":[[688,8],[1225,8]]},"677":{"position":[[1367,9]]},"823":{"position":[[6089,9]]}}}],["behaviour",{"_index":2235,"t":{"651":{"position":[[7201,9]]}}}],["behind",{"_index":2378,"t":{"717":{"position":[[44,6]]}}}],["believ",{"_index":735,"t":{"61":{"position":[[1732,7]]},"169":{"position":[[3154,7]]},"452":{"position":[[212,7]]}}}],["belong",{"_index":1549,"t":{"271":{"position":[[697,7]]},"316":{"position":[[1267,7]]},"655":{"position":[[623,7]]},"745":{"position":[[1643,6]]},"755":{"position":[[650,7]]},"821":{"position":[[1795,6]]},"844":{"position":[[1556,6],[31470,6]]},"846":{"position":[[1873,6]]}}}],["below",{"_index":119,"t":{"3":{"position":[[2005,6],[2460,6]]},"47":{"position":[[0,5]]},"53":{"position":[[278,6],[1235,5]]},"145":{"position":[[1526,5],[4173,5]]},"167":{"position":[[18,5]]},"169":{"position":[[797,5],[1595,5]]},"227":{"position":[[145,6]]},"258":{"position":[[145,6]]},"273":{"position":[[145,6]]},"320":{"position":[[145,6]]},"347":{"position":[[124,6],[175,6]]},"365":{"position":[[125,6],[176,6]]},"392":{"position":[[124,6]]},"440":{"position":[[145,6]]},"460":{"position":[[344,5]]},"462":{"position":[[2684,6]]},"466":{"position":[[767,6],[1133,6]]},"474":{"position":[[145,6],[196,6]]},"492":{"position":[[145,6]]},"514":{"position":[[145,6]]},"522":{"position":[[6390,5],[6739,5]]},"530":{"position":[[145,6]]},"550":{"position":[[145,6]]},"572":{"position":[[145,6]]},"610":{"position":[[124,6],[175,6]]},"637":{"position":[[125,6]]},"679":{"position":[[145,6]]},"699":{"position":[[13,5]]},"701":{"position":[[178,6]]},"713":{"position":[[145,6]]},"717":{"position":[[171,6],[761,5]]},"728":{"position":[[23339,5],[40597,5],[48025,6]]},"734":{"position":[[145,6]]},"738":{"position":[[138,6],[340,5]]},"781":{"position":[[145,6]]},"785":{"position":[[106,6]]},"799":{"position":[[2801,5]]},"809":{"position":[[145,6]]},"813":{"position":[[307,6],[719,6]]},"833":{"position":[[145,6]]},"837":{"position":[[176,6],[384,5]]}}}],["best",{"_index":423,"t":{"31":{"position":[[1058,4],[1073,4],[1167,4],[1182,4]]},"75":{"position":[[222,4],[247,4]]},"129":{"position":[[48,4]]},"135":{"position":[[100,4],[125,4]]},"165":{"position":[[72,4],[97,4]]},"205":{"position":[[48,4]]},"470":{"position":[[139,4],[164,4]]},"687":{"position":[[37,4]]},"689":{"position":[[34,4]]},"695":{"position":[[141,4]]},"709":{"position":[[261,4],[286,4]]}}}],["beta",{"_index":184,"t":{"7":{"position":[[467,4]]},"721":{"position":[[138,4],[353,4]]},"726":{"position":[[12228,4],[13726,4],[15718,4],[17286,4],[19066,4],[20385,4],[21813,4],[23735,4],[25233,4],[26913,4]]}}}],["beth",{"_index":1744,"t":{"402":{"position":[[948,4]]},"406":{"position":[[64,5],[116,4],[1044,4],[2381,4],[4045,4],[5382,4],[6711,4]]},"428":{"position":[[1719,4],[2100,4],[2208,4],[2812,4],[2922,4],[2981,4],[3030,4],[3078,4],[3147,4],[3185,4],[3234,4],[3283,4],[3331,4]]},"649":{"position":[[7453,4],[13465,7]]},"661":{"position":[[2916,4],[3634,4],[4921,4],[6372,4],[7494,4],[10115,4]]},"663":{"position":[[376,4]]},"667":{"position":[[3895,4],[5726,4]]},"671":{"position":[[12793,4],[12822,4]]},"673":{"position":[[3173,4],[4460,4],[5911,4],[7033,4],[9654,4]]},"721":{"position":[[364,5],[665,4],[707,4],[762,4]]},"726":{"position":[[20484,4],[21971,4],[23844,4],[25341,4],[27016,4]]},"728":{"position":[[42068,4],[42110,4],[42165,4],[48295,4],[48325,4],[48371,4],[48404,4],[48453,4],[48480,4]]},"742":{"position":[[40,4],[482,4]]},"745":{"position":[[13148,4],[30162,4]]},"789":{"position":[[141,4],[269,4]]},"795":{"position":[[76,4],[30416,5],[30545,4],[30580,4],[30725,4],[30764,4],[30898,4],[30930,4]]},"797":{"position":[[39,4],[986,5],[2547,4],[16077,5],[16226,4],[16261,4],[16406,4],[16445,4],[16579,4],[16611,4]]},"799":{"position":[[23411,4],[23446,4],[23589,4],[23628,4],[23761,4],[23793,4]]},"801":{"position":[[48,4]]},"841":{"position":[[66,5],[283,4]]},"844":{"position":[[1737,4],[7470,4]]},"846":{"position":[[2822,5],[4262,5],[6255,5],[7775,5],[9641,5]]},"850":{"position":[[16597,4]]}}}],["beth'",{"_index":2726,"t":{"795":{"position":[[420,6],[11798,6]]}}}],["bethani",{"_index":2356,"t":{"703":{"position":[[138,7],[886,7],[2050,7],[3590,7],[4804,7],[5822,7],[6024,7]]}}}],["better",{"_index":620,"t":{"45":{"position":[[957,7]]},"209":{"position":[[250,6]]},"365":{"position":[[3,6]]},"420":{"position":[[1013,6]]},"452":{"position":[[270,6]]},"456":{"position":[[1236,6]]},"466":{"position":[[55,6]]},"610":{"position":[[3,6]]},"637":{"position":[[3,6]]},"767":{"position":[[23454,7]]}}}],["between",{"_index":50,"t":{"3":{"position":[[782,7]]},"25":{"position":[[337,7]]},"37":{"position":[[8399,7]]},"45":{"position":[[901,7]]},"145":{"position":[[151,7],[620,7]]},"169":{"position":[[94,7],[2878,7],[5359,7],[5753,7],[9230,7],[9552,7],[9698,7],[9850,7],[10130,7],[11977,7],[12192,7]]},"183":{"position":[[127,7]]},"191":{"position":[[48,7]]},"193":{"position":[[24,7],[304,7]]},"223":{"position":[[363,7]]},"227":{"position":[[1332,7]]},"231":{"position":[[254,7]]},"256":{"position":[[292,7],[404,7]]},"258":{"position":[[1051,7]]},"262":{"position":[[254,7]]},"265":{"position":[[277,7]]},"267":{"position":[[5641,7]]},"273":{"position":[[24763,7]]},"279":{"position":[[254,7]]},"296":{"position":[[1296,7],[3381,7]]},"306":{"position":[[407,7]]},"320":{"position":[[1653,7]]},"326":{"position":[[254,7]]},"347":{"position":[[1962,7]]},"351":{"position":[[254,7]]},"365":{"position":[[1464,7]]},"369":{"position":[[254,7]]},"392":{"position":[[1287,7]]},"398":{"position":[[45,7]]},"426":{"position":[[2736,7],[3715,7],[4400,7],[5766,7],[6046,7],[6902,7]]},"438":{"position":[[302,7],[413,7]]},"440":{"position":[[1043,7]]},"442":{"position":[[254,7]]},"474":{"position":[[2950,7]]},"480":{"position":[[254,7]]},"490":{"position":[[59,7],[545,7]]},"492":{"position":[[1335,7]]},"496":{"position":[[254,7]]},"498":{"position":[[295,7]]},"500":{"position":[[27,7],[202,7]]},"502":{"position":[[29,7]]},"508":{"position":[[6001,7]]},"514":{"position":[[1105,7]]},"518":{"position":[[254,7]]},"530":{"position":[[1082,7]]},"534":{"position":[[254,7]]},"550":{"position":[[1035,7]]},"554":{"position":[[254,7]]},"568":{"position":[[68,7]]},"572":{"position":[[1506,7]]},"576":{"position":[[254,7]]},"608":{"position":[[246,7],[421,7]]},"610":{"position":[[1279,7]]},"614":{"position":[[254,7]]},"619":{"position":[[72,7]]},"637":{"position":[[623,7]]},"641":{"position":[[254,7]]},"649":{"position":[[33266,7]]},"659":{"position":[[128,7],[688,7]]},"679":{"position":[[1194,7],[1599,7],[1751,7],[1854,7]]},"683":{"position":[[254,7],[659,7],[811,7],[914,7]]},"697":{"position":[[327,7]]},"709":{"position":[[199,7]]},"713":{"position":[[347,7]]},"724":{"position":[[488,7]]},"726":{"position":[[141,7],[11450,7],[19587,7]]},"728":{"position":[[6663,7],[6929,7],[13961,7],[22431,7],[38657,7]]},"730":{"position":[[488,7]]},"732":{"position":[[246,7]]},"734":{"position":[[516,7]]},"759":{"position":[[128,7],[690,7]]},"769":{"position":[[19760,7],[21121,7],[22809,7],[24170,7],[25521,7]]},"771":{"position":[[1058,7],[2012,7],[3428,7],[5171,7],[6588,7],[7920,7]]},"781":{"position":[[1108,7]]},"807":{"position":[[153,7]]},"825":{"position":[[563,7],[6717,7]]},"831":{"position":[[128,7]]},"833":{"position":[[516,7]]},"848":{"position":[[31,7]]}}}],["beyond",{"_index":1812,"t":{"420":{"position":[[2646,6]]},"422":{"position":[[1686,6],[3528,6]]},"424":{"position":[[2018,6]]},"426":{"position":[[1003,6]]}}}],["bill",{"_index":2564,"t":{"753":{"position":[[64,7]]}}}],["binari",{"_index":846,"t":{"77":{"position":[[1866,8]]},"87":{"position":[[26,8]]}}}],["bit",{"_index":721,"t":{"61":{"position":[[113,3]]},"145":{"position":[[641,3]]}}}],["block",{"_index":623,"t":{"47":{"position":[[87,6]]},"49":{"position":[[2549,7]]},"51":{"position":[[2149,7]]},"55":{"position":[[1538,7]]},"59":{"position":[[232,5],[308,7],[476,9],[867,7],[991,10],[1306,9],[1356,8],[1767,7],[1837,10]]},"145":{"position":[[1537,5],[4184,5]]},"169":{"position":[[4415,6],[5131,6],[7439,6]]},"316":{"position":[[596,5],[667,7],[1329,6],[1375,6]]},"341":{"position":[[45,6],[191,6]]},"345":{"position":[[106,8],[397,5],[541,10],[581,8]]},"353":{"position":[[11630,8],[11802,7],[11884,7],[11981,7],[12029,8]]},"355":{"position":[[21,9],[134,7],[278,8],[477,10],[561,10],[985,7]]},"357":{"position":[[30,7],[128,8],[263,7],[365,8],[424,7],[580,10],[706,9],[756,10]]},"359":{"position":[[77,7],[205,7],[309,7],[1072,7],[1146,10],[2244,7],[3792,7],[3874,10],[5014,7],[5993,7],[6038,7],[6226,8],[6364,8],[18074,8]]},"488":{"position":[[182,5]]},"526":{"position":[[255,5]]},"730":{"position":[[612,5]]}}}],["block_list",{"_index":1485,"t":{"225":{"position":[[360,10]]},"528":{"position":[[378,10]]}}}],["blocklist",{"_index":719,"t":{"59":{"position":[[1077,11]]},"488":{"position":[[148,10]]},"526":{"position":[[226,10]]}}}],["blog",{"_index":1743,"t":{"402":{"position":[[596,4],[687,4]]},"512":{"position":[[438,4]]},"753":{"position":[[181,4]]}}}],["blue",{"_index":1816,"t":{"422":{"position":[[472,5]]}}}],["bob",{"_index":1701,"t":{"365":{"position":[[337,3]]},"375":{"position":[[54,3],[113,3],[195,3]]},"446":{"position":[[49,3]]},"448":{"position":[[121,3],[5872,3]]},"456":{"position":[[378,3]]},"458":{"position":[[109,5],[158,6],[284,6]]},"498":{"position":[[452,3],[507,3],[607,3],[759,3]]},"504":{"position":[[88,3]]},"506":{"position":[[9,3]]},"508":{"position":[[195,3],[6009,3],[6140,3],[6331,3]]},"522":{"position":[[6449,3]]},"524":{"position":[[60,3],[181,3]]},"572":{"position":[[300,3],[902,3]]},"581":{"position":[[178,3],[5933,3]]},"588":{"position":[[434,3],[6544,3]]},"590":{"position":[[544,3],[617,3],[5913,3],[6084,3]]},"595":{"position":[[143,3],[12101,3]]},"691":{"position":[[263,3],[1071,3],[2319,3],[4002,3],[5310,3],[6578,3],[6858,3],[12513,3],[12583,3],[12816,3]]},"817":{"position":[[140,3],[331,3],[734,3]]},"819":{"position":[[665,3]]},"821":{"position":[[290,3],[31222,3],[32319,3],[33747,3],[35669,3],[37167,3],[38871,3]]},"825":{"position":[[622,3],[706,3],[847,4],[1100,3],[27734,3]]}}}],["bodi",{"_index":497,"t":{"37":{"position":[[3195,4],[3302,7],[5073,4]]},"43":{"position":[[2627,4],[2776,4]]},"99":{"position":[[418,4],[726,4],[975,4]]},"113":{"position":[[5193,4]]},"125":{"position":[[450,4],[822,4],[1117,4]]},"169":{"position":[[14053,4],[15421,4],[16583,4],[20247,4],[21615,4],[22777,4],[26628,4],[28050,4],[29248,4]]},"236":{"position":[[1839,4],[3323,4],[4503,4],[4510,4]]},"238":{"position":[[1891,4],[3256,4],[4415,4],[7637,4],[9004,4],[10165,4]]},"250":{"position":[[362,4],[793,4],[1067,4],[1074,4]]},"252":{"position":[[518,4],[950,4],[1225,4],[1232,4]]},"265":{"position":[[2181,4],[3536,4],[4685,4]]},"267":{"position":[[1855,4],[3334,4],[4509,4],[4516,4],[7597,4],[8953,4],[10103,4]]},"273":{"position":[[3192,4],[4553,4],[5708,4],[8829,4],[10350,4],[11567,4],[11574,4],[14858,4],[16223,4],[17382,4],[20462,4],[21829,4],[22990,4]]},"282":{"position":[[2100,4],[3583,4],[4762,4],[4769,4]]},"284":{"position":[[1935,4],[3301,4],[4461,4]]},"296":{"position":[[301,4],[473,4],[636,4],[1939,4],[2111,4],[2394,4]]},"298":{"position":[[1292,4],[1480,4],[1659,4],[2795,4],[2983,4],[3282,4]]},"329":{"position":[[1937,4],[3412,4],[4583,4],[4590,4],[7519,4],[8995,4],[10167,4],[10174,4],[13502,4],[15222,4],[16600,4],[16607,4]]},"353":{"position":[[2031,4],[3397,4],[4557,4],[7640,4],[9005,4],[10164,4]]},"359":{"position":[[2166,4],[3709,4],[4948,4],[4955,4],[8326,4],[9692,4],[10852,4],[14140,4],[15506,4],[16666,4]]},"375":{"position":[[2072,4],[3445,4],[4612,4]]},"382":{"position":[[3007,4],[4370,4],[5527,4]]},"406":{"position":[[2135,4],[3843,4],[5198,4],[5205,4],[8769,4],[10137,4],[11299,4]]},"408":{"position":[[2147,4],[3965,4],[5430,4],[5437,4]]},"410":{"position":[[1863,4],[3231,4],[4393,4]]},"446":{"position":[[1913,4],[3409,4],[4601,4],[4608,4]]},"448":{"position":[[1972,4],[3345,4],[4512,4],[7810,4],[9184,4],[10352,4]]},"466":{"position":[[1503,4],[1951,4],[2242,4],[2249,4]]},"482":{"position":[[2034,4],[3403,4],[4566,4],[7667,4],[9035,4],[10197,4]]},"486":{"position":[[1995,4],[3365,4],[4529,4],[7794,4],[9164,4],[10328,4]]},"504":{"position":[[1874,4],[3356,4],[4534,4],[4541,4]]},"506":{"position":[[1956,4],[3518,4],[4776,4],[4783,4]]},"508":{"position":[[2045,4],[3418,4],[4585,4]]},"522":{"position":[[2112,4],[3646,4],[4876,4],[4883,4]]},"524":{"position":[[2173,4],[3542,4],[4705,4]]},"540":{"position":[[1885,4],[3369,4],[4549,4],[4556,4]]},"542":{"position":[[2295,4],[3856,4],[5113,4],[5120,4]]},"544":{"position":[[2107,4],[3482,4],[4651,4]]},"556":{"position":[[2015,4],[3609,4],[4850,4],[4857,4]]},"560":{"position":[[2018,4],[3608,4],[4845,4],[4852,4]]},"562":{"position":[[1981,4],[3464,4],[4643,4],[4650,4]]},"564":{"position":[[1859,4],[3213,4],[4361,4],[7373,4],[8727,4],[9875,4]]},"566":{"position":[[1856,4],[3331,4],[4502,4],[4509,4],[7434,4],[8789,4],[9938,4]]},"581":{"position":[[2028,4],[3392,4],[4550,4]]},"588":{"position":[[2249,4],[3727,4],[4938,4],[8386,4],[9825,4],[11015,4],[14377,4],[15826,4],[17026,4]]},"590":{"position":[[2334,4],[3694,4],[4787,4]]},"595":{"position":[[2059,4],[3488,4],[4708,4],[7971,4],[9400,4],[10620,4]]},"600":{"position":[[2078,4],[3609,4],[4928,4]]},"619":{"position":[[2230,4],[3830,4],[5126,4],[5133,4]]},"621":{"position":[[1982,4],[3358,4],[4528,4]]},"627":{"position":[[2054,4],[3812,4],[5217,4],[5224,4]]},"629":{"position":[[1903,4],[3271,4],[4433,4]]},"631":{"position":[[1910,4],[3465,4],[4716,4],[4723,4],[7943,4],[9312,4],[10475,4],[13579,4],[14951,4],[16117,4]]},"649":{"position":[[3160,4],[4525,4],[5684,4],[9332,4],[10697,4],[11856,4],[16156,4],[17524,4],[18686,4],[22990,4],[24355,4],[25514,4],[29227,4],[30593,4],[31753,4]]},"651":{"position":[[3134,4],[4500,4],[5660,4],[9386,4],[10755,4],[11918,4],[15728,4],[17095,4],[18256,4],[22051,4],[23418,4],[24579,4]]},"661":{"position":[[4278,4],[5871,4],[7013,4],[7020,4]]},"667":{"position":[[580,4],[889,4],[1139,4],[2413,4],[2724,4],[2976,4],[4270,4],[4579,4],[4829,4],[6109,4],[6421,4],[6674,4],[7964,4],[8274,4],[8525,4],[9809,4],[10121,4],[10374,4]]},"669":{"position":[[3159,4],[3469,4],[3720,4],[6558,4],[8110,4],[9358,4],[9365,4],[11048,4],[11357,4],[11607,4]]},"671":{"position":[[2977,4],[4557,4],[5833,4],[5840,4],[7701,4],[8127,4],[8506,4],[10373,4],[10800,4],[11180,4]]},"673":{"position":[[3817,4],[5410,4],[6552,4],[6559,4]]},"691":{"position":[[2245,4],[3923,4],[5248,4],[5255,4],[8701,4],[10067,4],[11227,4],[14696,4],[16062,4],[17222,4],[20384,4],[21752,4],[22914,4],[26009,4],[27376,4],[28537,4]]},"701":{"position":[[2849,4],[4216,4],[5377,4],[8466,4],[9832,4],[10992,4]]},"703":{"position":[[1980,4],[3515,4],[4746,4],[4753,4],[7860,4],[9230,4],[10394,4]]},"705":{"position":[[1984,4],[3470,4],[4743,4],[8257,4],[9876,4],[11142,4],[11149,4],[14520,4],[16140,4],[17407,4],[17414,4],[20789,4],[22156,4],[23317,4],[26450,4],[27815,4],[28974,4]]},"726":{"position":[[2788,4],[5412,4],[7487,4],[7494,4],[13646,4],[15633,4],[17218,4],[17225,4],[21713,4],[23630,4],[25145,4],[25152,4],[30040,4],[31406,4],[32566,4],[35800,4],[37167,4],[38328,4],[41420,4],[42790,4],[43954,4],[47063,4],[48434,4],[49599,4]]},"728":{"position":[[2083,4],[3450,4],[4611,4],[9998,4],[11361,4],[12518,4],[15924,4],[17296,4],[18462,4],[26365,4],[27736,4],[28901,4],[34604,4],[35966,4],[37122,4],[44164,4],[45526,4],[46682,4]]},"745":{"position":[[3577,4],[5068,4],[6255,4],[6262,4],[9299,4],[10667,4],[11829,4],[14951,4],[16442,4],[17629,4],[17636,4],[20630,4],[21998,4],[23160,4],[26257,4],[27626,4],[28789,4],[33990,4],[35358,4],[36520,4],[39616,4],[40984,4],[42146,4]]},"747":{"position":[[4335,4],[6114,4],[7540,4],[7547,4],[11460,4],[12830,4],[13994,4]]},"749":{"position":[[2075,4],[3590,4],[4801,4],[4808,4],[8348,4],[9895,4],[11138,4],[11145,4],[14221,4],[15589,4],[16751,4]]},"751":{"position":[[4832,4],[6466,4],[7747,4],[7754,4],[11674,4],[13046,4],[14212,4],[19088,4],[20601,4],[21810,4],[21817,4]]},"761":{"position":[[4873,4],[7060,4],[8796,4],[8803,4]]},"767":{"position":[[2214,4],[3577,4],[4734,4],[7906,4],[9273,4],[10434,4],[13653,4],[15203,4],[16449,4],[16456,4],[19538,4],[20902,4],[22060,4]]},"769":{"position":[[6325,4],[7684,4],[8837,4],[12528,4],[14564,4],[16198,4],[16205,4],[20826,4],[22558,4],[23937,4],[23944,4],[27616,4],[28979,4],[30136,4]]},"771":{"position":[[3078,4],[4865,4],[6299,4],[6306,4],[10480,4],[12031,4],[13389,4],[17407,4],[18959,4],[20318,4]]},"773":{"position":[[6857,4],[10772,4],[13844,4],[13851,4]]},"795":{"position":[[2262,4],[3752,4],[4938,4],[4945,4],[7914,4],[9408,4],[10598,4],[10605,4],[13741,4],[15496,4],[16849,4],[16856,4],[20866,4],[22233,4],[23394,4],[26563,4],[27928,4],[29087,4]]},"797":{"position":[[4880,4],[6747,4],[8163,4],[8170,4],[12197,4],[13567,4],[14731,4]]},"799":{"position":[[4673,4],[6310,4],[7594,4],[7601,4],[11393,4],[13343,4],[14842,4],[14849,4],[19375,4],[20739,4],[21897,4]]},"801":{"position":[[4930,4],[6688,4],[8044,4],[8051,4],[12072,4],[13441,4],[14604,4]]},"821":{"position":[[3878,4],[5427,4],[6672,4],[6679,4],[9840,4],[11213,4],[12380,4],[15589,4],[17138,4],[18383,4],[18390,4],[21508,4],[22881,4],[24048,4],[27258,4],[28638,4],[29812,4],[33677,4],[35594,4],[37109,4],[37116,4],[41212,4],[42585,4],[43752,4]]},"823":{"position":[[1919,4],[3287,4],[4449,4],[9200,4],[10567,4],[11728,4]]},"825":{"position":[[8872,4],[10704,4],[12134,4],[12141,4],[16392,4],[18010,4],[19324,4],[19331,4],[22879,4],[24600,4],[25968,4],[25975,4],[29628,4],[31264,4],[32547,4],[32554,4],[36055,4],[37575,4],[38791,4],[38798,4],[41925,4],[43428,4],[44627,4],[44634,4],[47849,4],[49214,4],[50373,4],[53535,4],[54915,4],[56089,4]]},"844":{"position":[[3581,4],[5075,4],[6265,4],[6272,4],[9327,4],[10698,4],[11863,4],[14997,4],[16487,4],[17673,4],[17680,4],[20669,4],[22036,4],[23197,4],[26289,4],[27658,4],[28821,4],[33509,4],[34876,4],[36037,4],[39128,4],[40496,4],[41658,4]]},"846":{"position":[[4181,4],[6169,4],[7706,4],[7713,4],[12135,4],[13506,4],[14671,4]]},"848":{"position":[[3893,4],[5642,4],[7038,4],[7045,4],[11051,4],[12425,4],[13593,4]]},"850":{"position":[[4939,4],[6920,4],[8499,4],[8506,4],[12722,4],[14097,4],[15266,4],[18482,4],[19859,4],[21030,4],[24181,4],[25560,4],[26733,4],[29971,4],[31348,4],[32519,4],[35668,4],[37045,4],[38216,4]]}}}],["body(requestbodi",{"_index":1022,"t":{"125":{"position":[[601,18]]},"169":{"position":[[26779,18]]},"600":{"position":[[2338,18]]}}}],["body_str",{"_index":542,"t":{"37":{"position":[[6336,11]]}}}],["book",{"_index":2165,"t":{"608":{"position":[[582,5],[603,8]]},"677":{"position":[[456,8],[517,8],[1594,8]]},"685":{"position":[[76,7],[187,8],[217,8],[339,7],[437,8]]},"689":{"position":[[432,9],[637,8],[689,9]]},"691":{"position":[[72,8],[6878,8],[12842,8],[18559,8]]}}}],["booking_add",{"_index":2322,"t":{"677":{"position":[[1462,16]]},"689":{"position":[[848,14],[1061,16],[1489,13]]},"691":{"position":[[13660,16],[14752,16],[16124,16],[17659,13],[18333,16],[18360,15],[24974,16],[26067,16],[27440,16],[28977,13],[29655,16],[29682,15],[29858,13],[30112,13],[30188,14]]}}}],["booking_view",{"_index":2327,"t":{"689":{"position":[[876,15],[1126,17],[1470,14]]},"691":{"position":[[7665,17],[8757,17],[10129,17],[11664,14],[12338,17],[12366,16],[12522,14],[12689,14],[12784,15],[19348,17],[20442,17],[21816,17],[23355,14],[24035,17],[24063,16],[29839,14],[30024,14],[30168,15]]}}}],["bookshelf",{"_index":2164,"t":{"608":{"position":[[563,9]]}}}],["bootstrap",{"_index":1041,"t":{"131":{"position":[[240,12]]}}}],["both",{"_index":324,"t":{"21":{"position":[[327,4]]},"51":{"position":[[859,4],[1243,4]]},"57":{"position":[[1290,4]]},"59":{"position":[[1334,4]]},"73":{"position":[[263,4]]},"129":{"position":[[168,4]]},"329":{"position":[[11433,4]]},"371":{"position":[[210,4]]},"426":{"position":[[7933,4]]},"472":{"position":[[214,4]]},"474":{"position":[[640,4]]},"484":{"position":[[96,4]]},"608":{"position":[[298,4]]},"645":{"position":[[1278,4]]},"669":{"position":[[213,4],[969,4]]},"689":{"position":[[1465,4]]},"781":{"position":[[608,4]]},"801":{"position":[[192,4]]},"805":{"position":[[290,4]]}}}],["bound",{"_index":658,"t":{"49":{"position":[[1712,5]]},"53":{"position":[[3119,5]]},"133":{"position":[[2086,5],[2474,5]]},"169":{"position":[[31460,5],[31499,5]]},"201":{"position":[[17,5]]},"466":{"position":[[395,5]]},"508":{"position":[[6712,5]]},"512":{"position":[[109,5],[280,5]]},"514":{"position":[[1437,5]]},"518":{"position":[[586,5]]},"522":{"position":[[65,5],[95,5],[6169,5]]},"643":{"position":[[408,5]]},"649":{"position":[[1030,5],[7206,5]]},"831":{"position":[[857,5]]},"850":{"position":[[381,5]]}}}],["branch",{"_index":1989,"t":{"468":{"position":[[1181,9]]},"761":{"position":[[309,6],[563,6],[641,7],[649,8],[703,6],[970,9],[1181,9],[1288,8],[1683,9],[1738,8],[2240,6],[2318,6],[2332,6],[3349,6],[3592,6],[3606,6],[3708,9],[4988,6],[5349,6],[5363,6],[7180,6],[7443,6],[7457,6],[7567,9],[8899,6],[9160,6],[9174,6],[10837,6],[11046,6],[11297,6],[11311,6]]},"763":{"position":[[75,7]]},"765":{"position":[[303,6]]},"767":{"position":[[262,6],[411,7],[11798,6],[12588,6],[13767,6],[15322,6],[16551,6],[17596,6]]},"769":{"position":[[777,8],[911,6],[1046,6],[1253,6],[1304,6],[1545,9],[2498,6],[2716,6],[2828,7],[2836,8],[2890,6],[2994,6],[3111,9],[3218,8],[3521,8],[3902,9],[3957,8],[11108,6],[11260,6],[11434,6],[12655,6],[12866,6],[13099,6],[14696,6],[14858,6],[15042,6],[16313,6],[16474,6],[16657,6],[18236,6],[18392,6],[18570,6]]},"773":{"position":[[106,6],[367,7],[375,8],[429,6],[533,6],[879,9],[1713,9],[1820,8],[2123,8],[2504,9],[2559,8],[4077,6],[4320,6],[4334,6],[4436,9],[4680,6],[4830,6],[4982,6],[5135,6],[5287,6],[5438,6],[5589,6],[5763,6],[6972,6],[7333,6],[7347,6],[7811,6],[8020,6],[8231,6],[8443,6],[8654,6],[8864,6],[9074,6],[9307,6],[10892,6],[11155,6],[11169,6],[11279,9],[11535,6],[11695,6],[11857,6],[12020,6],[12182,6],[12343,6],[12504,6],[12688,6],[13947,6],[14208,6],[14222,6],[14586,6],[14745,6],[14906,6],[15068,6],[15229,6],[15389,6],[15549,6],[15732,6],[17912,6],[19196,6],[19447,6],[19461,6],[19815,6],[19969,6],[20125,6],[20282,6],[20438,6],[20593,6],[20748,6],[20926,6]]},"775":{"position":[[299,6],[580,7],[588,8],[642,6],[746,6],[1255,9],[2180,9],[2287,8],[2590,8],[2971,9],[3026,8]]}}}],["branch'",{"_index":2569,"t":{"761":{"position":[[360,8],[401,8],[447,8]]}}}],["branch:east",{"_index":2621,"t":{"767":{"position":[[12653,12],[15396,12],[17524,11]]}}}],["branch:west",{"_index":2575,"t":{"761":{"position":[[3414,12],[3678,12],[7254,12],[7536,12],[10595,11],[10820,11]]},"769":{"position":[[11180,12],[11332,12],[11528,12],[14777,12],[14939,12],[15145,12],[17865,11],[17997,11],[18151,11]]},"773":{"position":[[4142,12],[4406,12],[4750,12],[4901,12],[5054,12],[5207,12],[5359,12],[5510,12],[5661,12],[5857,12],[10966,12],[11248,12],[11614,12],[11775,12],[11938,12],[12101,12],[12263,12],[12424,12],[12585,12],[12791,12],[17670,11],[17895,11],[18178,11],[18309,11],[18441,11],[18573,11],[18705,11],[18837,11],[18969,11],[19123,11]]}}}],["branch’",{"_index":2574,"t":{"761":{"position":[[2485,8]]}}}],["breadth",{"_index":1100,"t":{"133":{"position":[[859,7],[1827,8],[2448,8]]}}}],["break",{"_index":763,"t":{"71":{"position":[[71,5]]},"113":{"position":[[448,6],[497,6],[556,6]]},"665":{"position":[[54,5]]},"677":{"position":[[1066,8]]},"765":{"position":[[54,5]]}}}],["breviti",{"_index":1844,"t":{"424":{"position":[[2755,8]]},"717":{"position":[[633,8]]},"738":{"position":[[211,8]]},"813":{"position":[[595,8]]},"837":{"position":[[249,8]]}}}],["brew",{"_index":822,"t":{"77":{"position":[[1356,5],[1362,4]]},"79":{"position":[[0,4]]}}}],["bring",{"_index":2481,"t":{"728":{"position":[[22149,6]]},"813":{"position":[[94,8]]}}}],["broader",{"_index":71,"t":{"3":{"position":[[1014,7]]}}}],["browser",{"_index":2302,"t":{"671":{"position":[[274,7]]}}}],["budget",{"_index":1717,"t":{"382":{"position":[[734,6]]},"619":{"position":[[1159,9],[2388,9],[3993,9],[5272,9],[6373,9]]},"841":{"position":[[224,6],[399,6]]},"844":{"position":[[1774,6],[2592,9],[3769,9],[5223,7],[6383,8],[6926,9],[7291,6],[7376,7],[7515,8],[8323,8],[9420,8],[10798,8],[11952,8],[12330,6],[12880,10],[13059,8],[13102,7],[14008,9],[15181,9],[16631,7],[17787,8],[18326,9],[18687,6],[18768,7],[19665,8],[20758,8],[22132,8],[23282,8],[23656,6],[24202,10],[24373,8],[24416,7],[25284,8],[26379,8],[27755,8],[28907,8],[29283,6],[29831,10],[30005,8],[30048,7],[32505,8],[33598,8],[34972,8],[36122,8],[36496,6],[37042,10],[37213,8],[37256,7],[38124,8],[39218,8],[40593,8],[41744,8],[42119,6],[42666,10],[42839,8],[42882,7]]},"846":{"position":[[2091,7],[3113,6],[3192,9],[4730,6],[4863,9],[6576,6],[6664,7],[8095,6],[8169,8],[8909,9],[9612,6],[9944,6],[10026,7],[11131,8],[12228,8],[13606,8],[14760,8],[15138,6],[15688,10],[15867,8],[15910,7]]},"848":{"position":[[2820,6],[2904,9],[4198,6],[4336,9],[5903,6],[5996,7],[7281,6],[7360,8],[7989,9],[8487,6],[8685,6],[8772,7],[10042,8],[11142,8],[12523,8],[13680,8],[14061,6],[14614,10],[14794,8],[14837,7],[16070,6],[16130,8]]}}}],["build",{"_index":597,"t":{"45":{"position":[[48,5]]},"47":{"position":[[78,8]]},"49":{"position":[[2540,8]]},"51":{"position":[[2140,8]]},"55":{"position":[[1529,8]]},"113":{"position":[[5168,5]]},"169":{"position":[[4406,8],[5122,8],[7430,8]]},"213":{"position":[[29,5],[246,5]]},"217":{"position":[[130,8],[171,8]]},"306":{"position":[[384,5]]},"316":{"position":[[1320,8],[1402,5]]},"335":{"position":[[210,5]]},"341":{"position":[[36,8],[182,8],[218,5]]},"345":{"position":[[232,8]]},"386":{"position":[[998,8]]},"390":{"position":[[704,8]]},"422":{"position":[[4223,8]]},"424":{"position":[[3345,8]]},"593":{"position":[[177,5]]},"608":{"position":[[645,9]]},"661":{"position":[[95,8]]},"673":{"position":[[10443,5]]},"717":{"position":[[94,5]]},"738":{"position":[[82,5]]},"761":{"position":[[95,8]]},"773":{"position":[[21345,5],[21507,5]]},"785":{"position":[[27,5]]},"813":{"position":[[252,5]]},"827":{"position":[[255,5]]},"837":{"position":[[114,5]]}}}],["built",{"_index":1788,"t":{"414":{"position":[[260,5]]},"730":{"position":[[760,5]]},"803":{"position":[[178,5]]},"827":{"position":[[449,5]]}}}],["bulk",{"_index":1711,"t":{"380":{"position":[[379,5]]}}}],["bullet",{"_index":1061,"t":{"131":{"position":[[1275,6]]}}}],["busi",{"_index":1730,"t":{"390":{"position":[[98,8],[110,8]]},"813":{"position":[[29,10]]}}}],["c",{"_index":693,"t":{"53":{"position":[[2778,1],[2824,1]]},"310":{"position":[[987,2]]},"312":{"position":[[302,1]]},"353":{"position":[[12070,2]]},"359":{"position":[[12200,2]]},"661":{"position":[[2914,1],[3014,1],[3552,1],[3816,1],[4780,1],[5162,1],[6280,1],[6564,1],[7403,1],[7685,1],[10029,1],[10301,1]]},"663":{"position":[[265,2]]},"667":{"position":[[11413,2]]},"671":{"position":[[9880,2],[12691,1],[12781,1],[12870,1],[12898,1]]},"673":{"position":[[3091,1],[3355,1],[4319,1],[4701,1],[5819,1],[6103,1],[6942,1],[7224,1],[9568,1],[9840,1]]}}}],["c.locals(\"object",{"_index":1000,"t":{"113":{"position":[[4354,18]]}}}],["c.locals(\"object\").(str",{"_index":1007,"t":{"113":{"position":[[5307,28]]}}}],["c.locals(\"rel",{"_index":998,"t":{"113":{"position":[[4131,20],[4175,20],[4221,20],[4260,20]]}}}],["c.locals(\"relation\").(str",{"_index":1006,"t":{"113":{"position":[[5268,30]]}}}],["c.locals(\"user\").(*jwt.token",{"_index":967,"t":{"111":{"position":[[2395,29]]},"113":{"position":[[3705,29],[3945,29]]}}}],["c.locals(\"usernam",{"_index":996,"t":{"113":{"position":[[4045,20]]}}}],["c.locals(\"username\").(str",{"_index":1005,"t":{"113":{"position":[[5227,30]]}}}],["c.method",{"_index":997,"t":{"113":{"position":[[4104,12]]}}}],["c.next",{"_index":1001,"t":{"113":{"position":[[4416,8],[5670,8]]}}}],["c.params(\"docu",{"_index":972,"t":{"111":{"position":[[2533,21]]},"113":{"position":[[3843,21],[4387,21]]}}}],["c.sendstring(c.params(\"docu",{"_index":908,"t":{"109":{"position":[[1562,34]]}}}],["c.sendstring(nam",{"_index":971,"t":{"111":{"position":[[2502,17]]},"113":{"position":[[3812,17]]}}}],["c571",{"_index":2458,"t":{"726":{"position":[[27904,4]]}}}],["cab",{"_index":2037,"t":{"524":{"position":[[64,3]]}}}],["cach",{"_index":1290,"t":{"155":{"position":[[784,5],[798,7]]}}}],["calendar",{"_index":401,"t":{"27":{"position":[[991,9]]}}}],["call",{"_index":215,"t":{"9":{"position":[[393,6]]},"37":{"position":[[2546,7],[4428,7],[5872,7]]},"43":{"position":[[970,7],[1970,7],[2944,7]]},"45":{"position":[[745,7]]},"47":{"position":[[3835,6]]},"53":{"position":[[3029,6],[3275,4]]},"97":{"position":[[7,7],[1180,7],[2117,7],[2808,7]]},"111":{"position":[[14,4]]},"113":{"position":[[182,4],[697,6],[2613,4],[2653,4],[4943,7]]},"123":{"position":[[7,7],[1180,7],[2117,7],[2808,7]]},"147":{"position":[[284,7]]},"169":{"position":[[4901,6],[13765,7],[15116,7],[16186,7],[17926,4],[18141,7],[19959,7],[21310,7],[22380,7],[24235,4],[24482,7],[26334,7],[27739,7],[28851,7]]},"195":{"position":[[21,4]]},"197":{"position":[[28,4]]},"209":{"position":[[213,5]]},"215":{"position":[[580,7],[1209,7],[2056,7],[2744,7],[2979,4],[3182,5]]},"217":{"position":[[928,7],[1698,7],[2784,7],[3846,7],[4108,4],[4311,5]]},"219":{"position":[[804,7],[1723,7],[2947,7],[4407,7],[4669,4],[4872,5]]},"236":{"position":[[1551,7],[3012,7],[4106,7]]},"238":{"position":[[7,4],[1603,7],[2951,7],[4018,7],[7349,7],[8699,7],[9768,7]]},"248":{"position":[[7,7],[1180,7],[2117,7],[2808,7]]},"254":{"position":[[351,5]]},"258":{"position":[[224,6]]},"265":{"position":[[311,4],[1893,7],[3231,7],[4288,7]]},"267":{"position":[[1567,7],[3023,7],[4112,7],[5750,4],[7309,7],[8648,7],[9706,7]]},"273":{"position":[[900,6],[932,6],[1349,6],[2904,7],[4248,7],[5311,7],[8541,7],[10039,7],[11170,7],[12857,6],[13001,6],[14570,7],[15918,7],[16985,7],[20174,7],[21524,7],[22593,7]]},"282":{"position":[[1812,7],[3272,7],[4365,7]]},"284":{"position":[[1647,7],[2996,7],[4064,7]]},"288":{"position":[[32,4]]},"292":{"position":[[114,7]]},"294":{"position":[[1152,7],[2089,7],[2780,7]]},"296":{"position":[[1304,5]]},"298":{"position":[[1033,4],[2174,6]]},"304":{"position":[[17,4],[80,4]]},"306":{"position":[[120,4],[503,4]]},"308":{"position":[[0,4],[143,4]]},"320":{"position":[[224,6],[283,6]]},"329":{"position":[[70,7],[1649,7],[3101,7],[4186,7],[7231,7],[8684,7],[9770,7],[11508,4],[13214,7],[14911,7],[16203,7]]},"331":{"position":[[462,6],[660,4]]},"347":{"position":[[347,6]]},"353":{"position":[[127,6],[1743,7],[3092,7],[4160,7],[7352,7],[8700,7],[9767,7]]},"359":{"position":[[1878,7],[3398,7],[4551,7],[8038,7],[9387,7],[10455,7],[13852,7],[15201,7],[16269,7]]},"365":{"position":[[306,6]]},"375":{"position":[[1784,7],[3140,7],[4215,7]]},"382":{"position":[[965,4],[2719,7],[4065,7],[5130,7]]},"384":{"position":[[779,4]]},"392":{"position":[[202,6]]},"394":{"position":[[56,6]]},"402":{"position":[[328,6],[356,6]]},"404":{"position":[[168,6]]},"406":{"position":[[1847,7],[3532,7],[4801,7],[8481,7],[9832,7],[10902,7]]},"408":{"position":[[1859,7],[3654,7],[5033,7]]},"410":{"position":[[1575,7],[2926,7],[3996,7]]},"416":{"position":[[266,5]]},"440":{"position":[[224,6]]},"446":{"position":[[1625,7],[3098,7],[4204,7]]},"448":{"position":[[1684,7],[3040,7],[4115,7],[7522,7],[8879,7],[9955,7]]},"460":{"position":[[647,5]]},"462":{"position":[[2109,4]]},"466":{"position":[[264,6],[633,6]]},"474":{"position":[[491,6]]},"482":{"position":[[126,6],[1746,7],[3098,7],[4169,7],[7379,7],[8730,7],[9800,7]]},"486":{"position":[[1707,7],[3060,7],[4132,7],[7506,7],[8859,7],[9931,7]]},"504":{"position":[[1586,7],[3045,7],[4137,7]]},"506":{"position":[[1668,7],[3207,7],[4379,7]]},"508":{"position":[[1757,7],[3113,7],[4188,7],[6476,6]]},"514":{"position":[[224,6]]},"522":{"position":[[1824,7],[3335,7],[4479,7]]},"524":{"position":[[1885,7],[3237,7],[4308,7]]},"530":{"position":[[227,6]]},"540":{"position":[[1597,7],[3058,7],[4152,7]]},"542":{"position":[[2007,7],[3545,7],[4716,7]]},"544":{"position":[[1819,7],[3177,7],[4254,7]]},"556":{"position":[[1727,7],[3298,7],[4453,7]]},"560":{"position":[[1730,7],[3297,7],[4448,7]]},"562":{"position":[[1693,7],[3153,7],[4246,7]]},"564":{"position":[[1571,7],[2908,7],[3964,7],[7085,7],[8422,7],[9478,7]]},"566":{"position":[[1568,7],[3020,7],[4105,7],[7146,7],[8484,7],[9541,7]]},"572":{"position":[[224,6]]},"581":{"position":[[13,6],[146,4],[1740,7],[3087,7],[4153,7]]},"588":{"position":[[12,6],[2035,7],[3479,7],[4598,7],[6632,5],[8172,7],[9577,7],[10675,7],[12613,5],[14163,7],[15578,7],[16686,7]]},"590":{"position":[[2120,7],[3446,7],[4447,7]]},"593":{"position":[[239,4],[299,5]]},"595":{"position":[[218,4],[1770,7],[3183,7],[4311,7],[5929,4],[6130,4],[7682,7],[9095,7],[10223,7],[11841,4]]},"600":{"position":[[1784,7],[3298,7],[4531,7]]},"619":{"position":[[1942,7],[3519,7],[4729,7]]},"621":{"position":[[1694,7],[3053,7],[4131,7]]},"627":{"position":[[1766,7],[3501,7],[4820,7]]},"629":{"position":[[1615,7],[2966,7],[4036,7]]},"631":{"position":[[1622,7],[3154,7],[4319,7],[7655,7],[9007,7],[10078,7],[13291,7],[14646,7],[15720,7]]},"649":{"position":[[2872,7],[4220,7],[5287,7],[9044,7],[10392,7],[11459,7],[15868,7],[17219,7],[18289,7],[22702,7],[24050,7],[25117,7],[28939,7],[30288,7],[31356,7]]},"651":{"position":[[2846,7],[4195,7],[5263,7],[9098,7],[10450,7],[11521,7],[15440,7],[16790,7],[17859,7],[21763,7],[23113,7],[24182,7]]},"655":{"position":[[484,4]]},"659":{"position":[[233,4]]},"669":{"position":[[6270,7],[7799,7],[8961,7]]},"671":{"position":[[469,6],[498,6],[793,5],[2689,7],[4246,7],[5436,7]]},"679":{"position":[[224,6],[1556,6]]},"683":{"position":[[616,6]]},"691":{"position":[[1957,7],[3612,7],[4851,7],[8413,7],[9762,7],[10830,7],[14408,7],[15757,7],[16825,7],[20096,7],[21447,7],[22517,7],[25721,7],[27071,7],[28140,7]]},"701":{"position":[[2561,7],[3911,7],[4980,7],[8178,7],[9527,7],[10595,7]]},"703":{"position":[[1692,7],[3204,7],[4349,7],[7572,7],[8925,7],[9997,7]]},"705":{"position":[[1770,7],[3222,7],[4403,7],[7969,7],[9565,7],[10745,7],[14232,7],[15829,7],[17010,7],[20501,7],[21851,7],[22920,7],[26162,7],[27510,7],[28577,7]]},"717":{"position":[[378,6]]},"724":{"position":[[470,4]]},"726":{"position":[[2500,7],[5101,7],[7090,7],[13358,7],[15322,7],[16821,7],[21425,7],[23319,7],[24748,7],[29752,7],[31101,7],[32169,7],[35512,7],[36862,7],[37931,7],[41132,7],[42485,7],[43557,7],[46775,7],[48129,7],[49202,7]]},"728":{"position":[[1795,7],[3145,7],[4214,7],[9710,7],[11056,7],[12121,7],[15636,7],[16991,7],[18065,7],[26077,7],[27431,7],[28504,7],[34316,7],[35661,7],[36725,7],[43876,7],[45221,7],[46285,7]]},"745":{"position":[[3289,7],[4757,7],[5858,7],[9011,7],[10362,7],[11432,7],[14663,7],[16131,7],[17232,7],[20342,7],[21693,7],[22763,7],[25969,7],[27321,7],[28392,7],[33702,7],[35053,7],[36123,7],[39328,7],[40679,7],[41749,7]]},"747":{"position":[[4047,7],[5803,7],[7143,7],[11172,7],[12525,7],[13597,7]]},"749":{"position":[[1787,7],[3279,7],[4404,7],[8060,7],[9584,7],[10741,7],[13933,7],[15284,7],[16354,7]]},"751":{"position":[[616,7],[4544,7],[6155,7],[7350,7],[11386,7],[12741,7],[13815,7],[18800,7],[20290,7],[21413,7]]},"755":{"position":[[511,4]]},"759":{"position":[[234,4]]},"761":{"position":[[2449,4],[4585,7],[6749,7],[8399,7]]},"767":{"position":[[1926,7],[3272,7],[4337,7],[7618,7],[8968,7],[10037,7],[13365,7],[14892,7],[16052,7],[19250,7],[20597,7],[21663,7]]},"769":{"position":[[6037,7],[7379,7],[8440,7],[12240,7],[14253,7],[15801,7],[20538,7],[22247,7],[23540,7],[27328,7],[28674,7],[29739,7]]},"771":{"position":[[528,4],[581,4],[2790,7],[4554,7],[5902,7],[8077,6],[8106,6],[8401,5],[10192,7],[11726,7],[12992,7],[17119,7],[18654,7],[19921,7]]},"773":{"position":[[6569,7],[10461,7],[13447,7]]},"795":{"position":[[1974,7],[3441,7],[4541,7],[7626,7],[9097,7],[10201,7],[13453,7],[15185,7],[16452,7],[20578,7],[21928,7],[22997,7],[26275,7],[27623,7],[28690,7]]},"797":{"position":[[4592,7],[6436,7],[7766,7],[11909,7],[13262,7],[14334,7]]},"799":{"position":[[4385,7],[5999,7],[7197,7],[11105,7],[13032,7],[14445,7],[19087,7],[20434,7],[21500,7]]},"801":{"position":[[4642,7],[6377,7],[7647,7],[11784,7],[13136,7],[14207,7]]},"805":{"position":[[253,6]]},"817":{"position":[[263,6]]},"819":{"position":[[893,6]]},"821":{"position":[[3590,7],[5116,7],[6275,7],[9552,7],[10908,7],[11983,7],[15301,7],[16827,7],[17986,7],[21220,7],[22576,7],[23651,7],[26970,7],[28333,7],[29415,7],[33389,7],[35283,7],[36712,7],[40924,7],[42280,7],[43355,7]]},"823":{"position":[[1631,7],[2982,7],[4052,7],[8912,7],[10262,7],[11331,7]]},"825":{"position":[[8584,7],[10393,7],[11737,7],[16104,7],[17699,7],[18927,7],[22591,7],[24289,7],[25571,7],[29340,7],[30953,7],[32150,7],[35767,7],[37264,7],[38394,7],[41637,7],[43117,7],[44230,7],[47561,7],[48909,7],[49976,7],[53247,7],[54610,7],[55692,7]]},"844":{"position":[[3293,7],[4764,7],[5868,7],[9039,7],[10393,7],[11466,7],[14709,7],[16176,7],[17276,7],[20381,7],[21731,7],[22800,7],[26001,7],[27353,7],[28424,7],[33221,7],[34571,7],[35640,7],[38840,7],[40191,7],[41261,7]]},"846":{"position":[[3893,7],[5858,7],[7309,7],[11847,7],[13201,7],[14274,7]]},"848":{"position":[[3605,7],[5331,7],[6641,7],[10763,7],[12120,7],[13196,7]]},"850":{"position":[[4651,7],[6609,7],[8102,7],[12434,7],[13792,7],[14869,7],[18194,7],[19554,7],[20633,7],[23893,7],[25255,7],[26336,7],[29683,7],[31043,7],[32122,7],[35380,7],[36740,7],[37819,7]]}}}],["camelcas",{"_index":725,"t":{"61":{"position":[[170,10]]}}}],["camera",{"_index":1013,"t":{"115":{"position":[[220,6]]},"779":{"position":[[219,6]]},"785":{"position":[[82,6]]}}}],["campaign",{"_index":2817,"t":{"817":{"position":[[669,9]]},"825":{"position":[[428,9],[597,8],[999,8],[1083,8],[6868,8],[34132,8],[34170,8],[40142,8]]}}}],["can't",{"_index":228,"t":{"9":{"position":[[875,5]]},"225":{"position":[[386,5]]},"331":{"position":[[691,5]]},"528":{"position":[[404,5]]}}}],["can_access",{"_index":218,"t":{"9":{"position":[[584,11]]}}}],["can_change_own",{"_index":1835,"t":{"424":{"position":[[2324,16],[3021,17]]},"426":{"position":[[8825,17],[9621,17],[10214,17]]},"428":{"position":[[2771,16],[3106,16],[3349,16],[3692,16]]}}}],["can_create_docu",{"_index":1836,"t":{"424":{"position":[[2348,19],[2441,19],[2696,21],[3138,20],[3261,20]]}}}],["can_create_fold",{"_index":1837,"t":{"424":{"position":[[2374,17],[2467,17],[3112,18],[3289,18]]}}}],["can_delet",{"_index":1999,"t":{"482":{"position":[[11710,10]]},"484":{"position":[[53,10],[318,11],[642,13]]},"486":{"position":[[957,13],[2053,13],[3429,13],[4972,10],[5656,13],[5680,12],[6755,13],[7851,13],[9227,13],[10770,10],[11453,13],[11477,12]]},"661":{"position":[[1228,11],[2400,13]]},"667":{"position":[[2191,13],[2470,13],[2787,13],[3231,10],[3718,13],[3742,12],[5886,13],[6166,13],[6484,13],[6930,10],[7419,13],[7443,12],[9586,13],[9866,13],[10184,13],[10630,10],[11119,13],[11143,12]]},"673":{"position":[[566,11],[2275,13]]}}}],["can_edit",{"_index":2257,"t":{"661":{"position":[[1255,9],[2478,11]]},"673":{"position":[[593,9],[2353,11]]},"699":{"position":[[333,9],[472,11]]},"701":{"position":[[392,9],[712,11],[994,8],[7431,11],[8523,11],[9895,11],[11430,8],[12105,11],[12127,10]]}}}],["can_read",{"_index":1922,"t":{"456":{"position":[[332,8],[1758,9],[2581,11],[2994,11]]},"460":{"position":[[1606,9],[2435,11],[2891,11]]}}}],["can_renam",{"_index":671,"t":{"51":{"position":[[207,11],[394,13],[796,11],[823,10],[944,10],[1810,10]]}}}],["can_shar",{"_index":626,"t":{"47":{"position":[[249,10],[544,10],[1079,12],[2401,12],[3996,10]]},"424":{"position":[[2275,9],[2968,10]]},"426":{"position":[[6929,10],[7427,9],[8309,9],[8692,9],[8999,9],[9403,10],[9996,10]]},"428":{"position":[[2625,9],[2950,9],[3203,9],[3526,9]]}}}],["can_view",{"_index":1834,"t":{"424":{"position":[[2308,8],[2392,8],[2986,9],[3166,9]]},"426":{"position":[[8056,9],[9458,9],[10051,9]]},"428":{"position":[[2723,8],[3048,8],[3301,8],[3634,8]]},"661":{"position":[[1279,9],[2553,11]]},"667":{"position":[[360,11],[637,11],[952,11],[1392,8],[1875,11],[1897,10],[4050,11],[4327,11],[4642,11],[5082,8],[5565,11],[5587,10],[7743,11],[8021,11],[8337,11],[8779,8],[9264,11],[9286,10]]},"669":{"position":[[2938,11],[3216,11],[3532,11],[3974,8],[4459,11],[4481,10],[10828,11],[11105,11],[11420,11],[11860,8],[12343,11],[12365,10]]},"671":{"position":[[7382,11],[7758,11],[8190,11],[8868,8],[9527,11],[9549,10],[10053,11],[10430,11],[10863,11],[11543,8],[12204,11],[12226,10]]},"673":{"position":[[617,9],[2428,11]]},"761":{"position":[[784,9],[861,9],[1577,11],[1898,11]]},"767":{"position":[[1182,11],[2271,11],[3640,11],[5169,8],[5838,11],[5860,10],[6874,11],[7967,11],[9340,11],[10877,8],[11558,11],[11580,10],[18505,11],[19595,11],[20965,11],[22496,8],[23167,11],[23189,10]]},"769":{"position":[[3058,9],[3796,11],[5292,11],[6377,11],[7742,11],[9263,8],[9919,11],[9941,10],[26584,11],[27673,11],[29042,11],[30571,8],[31240,11],[31262,10]]},"771":{"position":[[9279,11],[10537,11],[12094,11],[14012,8],[14960,11],[14982,10],[16205,11],[17464,11],[19022,11],[20942,8],[21892,11],[21914,10]]},"773":{"position":[[597,9],[674,9],[2398,11],[2719,11]]},"775":{"position":[[810,9],[887,9],[2865,11],[3186,11]]}}}],["can_writ",{"_index":1833,"t":{"424":{"position":[[2298,9],[3003,10]]},"426":{"position":[[8442,10],[9566,10],[10159,10]]},"428":{"position":[[2674,9],[2999,9],[3252,9],[3585,9]]},"474":{"position":[[318,9],[810,10],[1035,12]]},"482":{"position":[[997,12],[2092,12],[3467,12],[5008,9],[5690,12],[5713,11],[6630,12],[7724,12],[9098,12],[10637,9],[11316,12],[11339,11]]},"484":{"position":[[293,10],[566,12]]},"699":{"position":[[1056,10],[1196,12]]},"701":{"position":[[367,10],[636,12],[1813,12],[2906,12],[4279,12],[5816,9],[6493,12],[6516,11]]},"703":{"position":[[6824,12],[7920,12],[9296,12],[10839,9],[11525,12],[11548,11]]},"705":{"position":[[19753,12],[20846,12],[22219,12],[23756,9],[24433,12],[24456,11]]},"707":{"position":[[195,10],[335,12]]}}}],["can’t",{"_index":1939,"t":{"460":{"position":[[375,5]]}}}],["capac",{"_index":69,"t":{"3":{"position":[[986,8]]}}}],["captur",{"_index":1303,"t":{"157":{"position":[[109,8]]}}}],["carl",{"_index":1676,"t":{"347":{"position":[[433,6],[1410,4]]},"353":{"position":[[144,4],[11639,4],[11973,4],[12019,4]]},"359":{"position":[[69,4],[129,4],[197,4],[301,4],[1064,4],[2236,4],[3784,4],[5006,4],[6030,4],[6216,4],[6356,4],[6437,4],[6510,4]]},"474":{"position":[[583,4],[635,4],[1852,4],[2100,4]]},"482":{"position":[[143,4],[11580,5]]},"486":{"position":[[5844,4],[5918,4]]},"661":{"position":[[2966,4],[3766,4],[5112,4],[6514,4],[7635,4],[10251,4]]},"663":{"position":[[432,4]]},"667":{"position":[[7585,4],[9426,4]]},"671":{"position":[[12852,4],[12880,4]]},"673":{"position":[[3305,4],[4651,4],[6053,4],[7174,4],[9790,4]]}}}],["carolin",{"_index":2572,"t":{"761":{"position":[[2247,8],[3438,8],[5136,8],[7279,8],[8997,8],[11139,8]]},"767":{"position":[[6005,8]]},"773":{"position":[[4166,8],[7120,8],[10991,8],[14045,8],[19289,8]]}}}],["cascad",{"_index":2008,"t":{"498":{"position":[[393,9]]},"502":{"position":[[9,9]]},"504":{"position":[[16,9]]},"508":{"position":[[6079,9]]},"568":{"position":[[134,7]]}}}],["case",{"_index":150,"t":{"5":{"position":[[157,4]]},"49":{"position":[[1477,4]]},"51":{"position":[[753,4]]},"113":{"position":[[407,4],[455,4],[504,4],[4119,4],[4162,4],[4206,4]]},"133":{"position":[[210,6]]},"169":{"position":[[6366,5],[11954,5],[31786,4]]},"225":{"position":[[196,5]]},"234":{"position":[[130,4]]},"271":{"position":[[480,5]]},"310":{"position":[[447,5],[790,5],[1170,5],[1803,5],[2163,4],[2364,5],[2753,5],[3130,4],[3470,5]]},"312":{"position":[[13,4]]},"316":{"position":[[1450,5],[1477,5]]},"331":{"position":[[482,4]]},"335":{"position":[[39,5],[256,4]]},"390":{"position":[[253,6],[367,6]]},"418":{"position":[[144,5]]},"420":{"position":[[417,6]]},"422":{"position":[[4350,5],[4581,5]]},"426":{"position":[[3053,5],[3067,4],[3103,4],[3246,5],[5935,5]]},"462":{"position":[[2846,5]]},"464":{"position":[[132,5],[420,6]]},"466":{"position":[[762,4]]},"490":{"position":[[500,5]]},"520":{"position":[[104,6]]},"528":{"position":[[214,5]]},"536":{"position":[[54,5]]},"538":{"position":[[73,5]]},"546":{"position":[[260,5],[342,5]]},"590":{"position":[[466,5]]},"598":{"position":[[225,4]]},"608":{"position":[[211,4]]},"619":{"position":[[1088,4],[2317,4],[3922,4],[5201,4],[6302,4]]},"623":{"position":[[51,5],[94,4]]},"625":{"position":[[1162,5]]},"631":{"position":[[6017,5]]},"635":{"position":[[221,5]]},"649":{"position":[[33221,5]]},"653":{"position":[[182,5],[380,5]]},"655":{"position":[[21,5],[287,5]]},"661":{"position":[[2845,4]]},"671":{"position":[[201,5]]},"705":{"position":[[6330,5]]},"711":{"position":[[143,4]]},"717":{"position":[[340,4]]},"726":{"position":[[28236,5]]},"749":{"position":[[6208,5],[6383,5]]},"751":{"position":[[9524,4]]},"753":{"position":[[235,5]]},"755":{"position":[[71,5],[319,5]]},"761":{"position":[[2184,4]]},"771":{"position":[[200,4]]},"775":{"position":[[178,5]]},"825":{"position":[[964,5]]}}}],["catch",{"_index":891,"t":{"109":{"position":[[855,5]]},"111":{"position":[[685,5],[1454,5]]},"113":{"position":[[623,5],[1533,5],[2442,5]]}}}],["categori",{"_index":1738,"t":{"392":{"position":[[215,9],[282,9],[411,8],[532,8],[691,10]]},"394":{"position":[[69,9],[136,9]]},"402":{"position":[[206,9],[319,8],[500,8],[585,8],[676,8],[767,8]]},"404":{"position":[[312,8],[545,10]]},"408":{"position":[[896,8],[1068,8],[2284,8],[2515,8],[4107,8],[4289,8],[5555,8],[5736,8],[7071,8],[7247,8]]}}}],["category:logo",{"_index":1766,"t":{"408":{"position":[[979,17],[1150,17],[2421,17],[2651,17],[4199,15],[4380,15],[5633,16],[5813,16],[6461,17],[6841,14],[6978,14],[7157,15],[7332,15]]},"410":{"position":[[851,16],[1945,16],[3320,16],[4471,16],[4846,14],[5393,18],[5566,16],[5609,15]]}}}],["category:logos\"},{\"user\":\"role:media",{"_index":1774,"t":{"408":{"position":[[6371,36]]}}}],["catherin",{"_index":2813,"t":{"817":{"position":[[144,9],[447,9]]},"819":{"position":[[717,9]]},"821":{"position":[[330,9],[13722,9],[14481,9],[15659,9],[17213,9],[18441,9],[19485,9],[25369,10]]},"825":{"position":[[852,9]]}}}],["caus",{"_index":1900,"t":{"428":{"position":[[3887,7]]},"462":{"position":[[3509,5]]},"771":{"position":[[634,6]]}}}],["caution",{"_index":694,"t":{"53":{"position":[[2937,7]]},"359":{"position":[[18083,7]]},"422":{"position":[[4186,7]]},"424":{"position":[[3308,7]]},"448":{"position":[[11677,7]]},"504":{"position":[[5664,7]]},"508":{"position":[[6378,7]]},"514":{"position":[[1587,7]]},"544":{"position":[[6162,7]]},"621":{"position":[[6274,7]]},"691":{"position":[[30216,7]]},"726":{"position":[[27547,7]]},"789":{"position":[[515,7]]},"817":{"position":[[966,7]]}}}],["cert",{"_index":1225,"t":{"147":{"position":[[727,5],[2176,5]]}}}],["cert=\"/users/myuser/key/server.crt",{"_index":1237,"t":{"147":{"position":[[1625,35],[3178,35]]}}}],["certain",{"_index":90,"t":{"3":{"position":[[1460,7]]},"17":{"position":[[138,7],[382,7]]},"45":{"position":[[270,7]]},"53":{"position":[[2714,7]]},"61":{"position":[[2356,7]]},"91":{"position":[[94,7]]},"169":{"position":[[17997,7],[31826,7]]},"195":{"position":[[92,7]]},"225":{"position":[[594,7]]},"300":{"position":[[537,7]]},"310":{"position":[[178,7],[571,7],[1017,7],[1998,7],[2983,7]]},"345":{"position":[[818,7]]},"347":{"position":[[2353,7]]},"351":{"position":[[645,7]]},"353":{"position":[[11529,7]]},"355":{"position":[[969,7]]},"371":{"position":[[86,7],[161,7],[231,7]]},"373":{"position":[[890,7]]},"380":{"position":[[127,7]]},"386":{"position":[[146,7],[281,7],[427,7],[591,7],[667,7],[742,7]]},"402":{"position":[[263,7]]},"404":{"position":[[1203,7],[1230,7]]},"408":{"position":[[67,7]]},"438":{"position":[[80,7]]},"472":{"position":[[461,7]]},"512":{"position":[[80,7]]},"528":{"position":[[612,7]]},"536":{"position":[[90,7],[157,7],[205,7]]},"542":{"position":[[132,7]]},"579":{"position":[[69,7]]},"604":{"position":[[85,7]]},"635":{"position":[[165,7]]},"651":{"position":[[19924,7]]},"659":{"position":[[304,7],[913,7]]},"671":{"position":[[189,7]]},"675":{"position":[[197,7]]},"677":{"position":[[299,7],[1203,7]]},"730":{"position":[[317,7]]},"732":{"position":[[473,7],[768,7],[1053,7]]},"745":{"position":[[31914,7]]},"751":{"position":[[16218,7]]},"755":{"position":[[130,7]]},"759":{"position":[[305,7],[915,7]]},"769":{"position":[[840,7]]},"777":{"position":[[316,7]]},"781":{"position":[[1208,7]]},"807":{"position":[[268,7],[367,7],[668,7]]},"825":{"position":[[251,7]]},"831":{"position":[[363,7],[637,7],[946,7],[1135,7]]},"839":{"position":[[322,7]]},"848":{"position":[[15612,7]]}}}],["certif",{"_index":1224,"t":{"147":{"position":[[543,11],[1063,11],[1335,11],[1977,11],[2588,11],[2860,11]]}}}],["certs')}/private.key",{"_index":921,"t":{"111":{"position":[[436,23]]}}}],["certs')}/public.key",{"_index":923,"t":{"111":{"position":[[514,22]]}}}],["chain",{"_index":2019,"t":{"508":{"position":[[6111,5]]},"544":{"position":[[5986,5]]},"691":{"position":[[12562,5],[29897,5]]}}}],["chang",{"_index":304,"t":{"19":{"position":[[242,6],[510,7]]},"73":{"position":[[110,8],[171,7]]},"155":{"position":[[1158,7]]},"161":{"position":[[264,6]]},"267":{"position":[[10,6]]},"288":{"position":[[46,7],[96,7],[278,8]]},"292":{"position":[[131,7]]},"296":{"position":[[27,7],[795,7],[1459,8],[2673,7],[3073,7],[3324,7],[3470,7],[3662,7]]},"298":{"position":[[925,7],[1826,7],[3569,7]]},"306":{"position":[[16,8],[137,7],[248,7]]},"310":{"position":[[1759,7],[2195,7],[3154,7]]},"331":{"position":[[625,7],[735,7],[777,8]]},"359":{"position":[[17995,6]]},"373":{"position":[[845,7]]},"404":{"position":[[52,6],[1147,6]]},"420":{"position":[[2404,6],[2484,6]]},"422":{"position":[[1444,6],[1524,6],[3286,6],[3366,6]]},"424":{"position":[[1776,6],[1856,6]]},"426":{"position":[[8915,6]]},"428":{"position":[[1083,6]]},"434":{"position":[[146,7]]},"452":{"position":[[196,7],[660,7]]},"454":{"position":[[10,7],[414,6]]},"456":{"position":[[71,7],[3098,8]]},"462":{"position":[[1621,6],[1656,6],[2882,7]]},"464":{"position":[[325,7],[376,6],[560,7]]},"502":{"position":[[1113,7]]},"508":{"position":[[26,7]]},"538":{"position":[[129,7]]},"566":{"position":[[5577,7]]},"602":{"position":[[236,6]]},"621":{"position":[[6200,7]]},"673":{"position":[[10419,7]]},"677":{"position":[[1676,7],[1758,7]]},"695":{"position":[[75,7],[160,8]]},"728":{"position":[[22906,7],[23189,7],[30970,6],[39977,7]]},"751":{"position":[[17234,8]]},"773":{"position":[[21483,7]]},"797":{"position":[[304,8],[408,6],[465,8]]},"799":{"position":[[728,7]]},"801":{"position":[[2385,7]]},"815":{"position":[[425,6],[512,8],[647,7]]},"823":{"position":[[6077,6]]}}}],["channel",{"_index":2162,"t":{"608":{"position":[[472,8],[481,8],[508,8]]},"807":{"position":[[276,8],[527,8]]},"813":{"position":[[557,7]]},"815":{"position":[[233,9],[686,9],[706,9],[897,8],[961,9],[978,9],[1003,9],[1032,8],[1054,9],[1064,7]]},"817":{"position":[[382,8],[540,9],[561,8],[697,8],[765,7],[919,8]]},"819":{"position":[[105,7],[674,8],[1801,8]]},"821":{"position":[[31231,8],[32328,8],[33756,8],[35678,8],[37176,8],[38880,8]]},"825":{"position":[[150,9],[259,8],[946,9],[1092,7],[1192,7],[1266,7],[1300,8],[1337,8],[1437,7],[1548,8],[1648,7],[1927,10],[2750,7],[2980,7],[3075,7],[3364,10],[4236,7],[4692,7],[5758,10],[6754,9],[6877,9],[14319,8],[14341,7],[14361,7],[27682,8],[34141,8]]},"829":{"position":[[65,8]]}}}],["channel:gener",{"_index":2857,"t":{"825":{"position":[[305,15],[637,15],[7666,19],[10855,17],[13622,15],[15296,17],[15393,19],[16543,17],[18166,17],[18272,17],[19463,17],[20484,15],[20592,17],[20868,15],[21810,19],[21880,19],[24836,17],[24916,17],[27213,15],[27329,15],[46025,15],[46834,18],[47925,18],[49297,18],[50818,15],[51532,18],[51570,17],[57812,15],[57853,15],[57888,15],[57929,15],[58541,15],[58584,15]]}}}],["channel:market",{"_index":1391,"t":{"169":{"position":[[9096,17]]}}}],["channel:marketing_intern",{"_index":2863,"t":{"825":{"position":[[7756,30],[10955,28],[13758,26],[28537,30],[28618,30],[31393,28],[31484,28],[33730,26],[33857,26],[57964,26],[58016,26],[58061,26],[58113,26],[58160,26],[58214,26],[58262,26],[58316,26],[58620,26],[58674,26]]}}}],["channel:proj_marketing_campaign",{"_index":2858,"t":{"825":{"position":[[458,31],[7857,35],[11066,33],[13905,31],[35040,35],[37723,33],[39870,31],[40910,35],[43559,33],[45655,31],[51680,31],[52505,34],[53611,34],[54998,34],[56549,31],[57293,34],[57347,33],[58721,31],[58780,31]]}}}],["channel_archiv",{"_index":2311,"t":{"677":{"position":[[362,17]]}}}],["channels_admin",{"_index":2819,"t":{"819":{"position":[[963,15],[1092,15],[1297,17],[1488,17],[1816,16]]},"821":{"position":[[118,15],[294,14],[664,15],[869,17],[1060,17],[31302,17],[32401,17],[35759,17],[38583,14]]},"823":{"position":[[5971,14],[6319,14],[6445,15],[6509,14],[6700,17],[6904,16],[7118,17]]},"825":{"position":[[2309,16],[2579,16],[3825,16],[4095,16],[4571,15],[4635,14],[5110,17],[5314,16],[5528,17],[6219,16],[6489,16],[57731,14],[57788,15]]}}}],["charact",{"_index":1205,"t":{"145":{"position":[[3171,10],[3223,10],[3270,10]]},"424":{"position":[[2539,11]]},"452":{"position":[[887,9]]}}}],["characterist",{"_index":1340,"t":{"169":{"position":[[544,16]]},"171":{"position":[[69,16]]},"227":{"position":[[1123,15]]},"231":{"position":[[45,15]]},"258":{"position":[[842,15]]},"262":{"position":[[45,15]]},"273":{"position":[[24554,15]]},"279":{"position":[[45,15]]},"320":{"position":[[1444,15]]},"326":{"position":[[45,15]]},"347":{"position":[[1753,15]]},"351":{"position":[[45,15]]},"365":{"position":[[1255,15]]},"369":{"position":[[45,15]]},"440":{"position":[[834,15]]},"442":{"position":[[45,15]]},"474":{"position":[[2741,15]]},"480":{"position":[[45,15]]},"492":{"position":[[1126,15]]},"496":{"position":[[45,15]]},"514":{"position":[[896,15]]},"518":{"position":[[45,15]]},"530":{"position":[[873,15]]},"534":{"position":[[45,15]]},"550":{"position":[[826,15]]},"554":{"position":[[45,15]]},"572":{"position":[[1297,15]]},"576":{"position":[[45,15]]},"610":{"position":[[1070,15]]},"614":{"position":[[45,15]]},"637":{"position":[[414,15]]},"641":{"position":[[45,15]]},"679":{"position":[[985,15]]},"683":{"position":[[45,15]]},"697":{"position":[[118,15]]}}}],["charl",{"_index":2395,"t":{"721":{"position":[[401,8],[811,7],[856,7],[914,7]]},"726":{"position":[[20604,7],[22150,7],[23974,7],[25470,7],[27140,7]]},"728":{"position":[[42214,7],[42259,7],[42317,7],[48522,7],[48555,7],[48604,7],[48640,7],[48692,7],[48722,7]]},"742":{"position":[[45,8]]},"747":{"position":[[3061,7],[4410,7],[6194,7],[7603,7],[9066,7]]},"789":{"position":[[146,7],[318,7]]},"797":{"position":[[992,8],[2498,7],[10342,7],[16083,7],[16659,7],[16697,7],[16841,7],[16883,7],[17039,7],[17074,7]]},"799":{"position":[[2707,7],[23840,7],[23878,7],[24022,7],[24064,7],[24220,7],[24255,7]]},"805":{"position":[[60,7]]},"841":{"position":[[97,8]]},"846":{"position":[[2828,7],[4268,7],[6261,7],[7781,7],[9647,7]]}}}],["charli",{"_index":2216,"t":{"649":{"position":[[13650,7],[14271,7],[19999,7],[26888,8]]}}}],["chart",{"_index":1130,"t":{"137":{"position":[[86,6],[165,5]]}}}],["chat",{"_index":2891,"t":{"827":{"position":[[712,4]]}}}],["check",{"_index":117,"t":{"3":{"position":[[1988,5],[3053,5]]},"17":{"position":[[337,8]]},"25":{"position":[[308,5]]},"31":{"position":[[589,5],[637,5],[863,6]]},"53":{"position":[[3411,7]]},"55":{"position":[[1368,5]]},"57":{"position":[[1347,5]]},"59":{"position":[[1382,5]]},"63":{"position":[[0,5]]},"69":{"position":[[34,7]]},"71":{"position":[[96,6],[234,5]]},"73":{"position":[[217,6],[248,6],[621,5]]},"91":{"position":[[46,5]]},"95":{"position":[[24,5]]},"97":{"position":[[19,5]]},"99":{"position":[[3,5],[120,5],[1147,5]]},"101":{"position":[[78,6],[108,5],[127,5]]},"105":{"position":[[296,6],[660,6]]},"113":{"position":[[187,5],[746,5],[1626,5],[2618,5],[2662,5],[4444,5],[5499,5]]},"123":{"position":[[19,5]]},"127":{"position":[[78,6]]},"133":{"position":[[140,5],[707,5],[1432,5]]},"135":{"position":[[0,5]]},"153":{"position":[[42,5],[84,5]]},"155":{"position":[[772,5],[809,5]]},"165":{"position":[[0,5]]},"169":{"position":[[42,6],[124,6],[3475,7],[12149,5],[12937,5],[16943,5],[17631,6],[17661,5],[17889,5],[17907,5],[17946,5],[18061,5],[18153,5],[18201,5],[18368,5],[19131,5],[23137,5],[23825,6],[23855,5],[24153,5],[30785,5],[30887,5],[31173,5],[31222,5],[31414,5]]},"177":{"position":[[86,7]]},"195":{"position":[[2,5],[41,5]]},"199":{"position":[[52,5]]},"203":{"position":[[0,5]]},"209":{"position":[[106,5]]},"211":{"position":[[0,5]]},"223":{"position":[[684,6]]},"238":{"position":[[19,5],[778,5],[4772,5],[5454,6],[5484,5],[5705,5],[6522,5],[10524,5],[11210,6],[11241,5]]},"240":{"position":[[0,5]]},"254":{"position":[[0,5]]},"256":{"position":[[198,5]]},"265":{"position":[[320,5],[1078,5],[5032,5],[5694,6],[5724,5]]},"267":{"position":[[5762,5],[6493,5],[10451,5],[11115,6],[11145,5]]},"269":{"position":[[0,5]]},"273":{"position":[[1340,5],[2083,5],[6061,5],[6735,6],[6760,5],[12848,5],[13745,5],[17739,5],[18421,6],[18451,5],[19347,5],[23349,5],[24035,6],[24066,5]]},"284":{"position":[[53,5],[821,5],[4819,5],[5503,6],[5533,5]]},"286":{"position":[[0,5]]},"304":{"position":[[30,5],[85,6]]},"306":{"position":[[508,6]]},"310":{"position":[[408,5],[716,5],[1789,5],[2225,6],[2627,5],[2688,8],[3184,5],[3435,5],[3666,6]]},"333":{"position":[[0,5]]},"353":{"position":[[118,5],[217,5],[917,5],[4915,5],[5599,6],[5630,5],[6527,5],[10521,5],[11203,6],[11233,5]]},"359":{"position":[[3,5],[6428,5],[6491,5],[7212,5],[11210,5],[11894,6],[11924,5],[12235,5],[12304,5],[13026,5],[17024,5],[17708,6],[17739,5]]},"361":{"position":[[0,5]]},"375":{"position":[[185,6],[951,5],[4977,5],[5675,6],[5704,5]]},"377":{"position":[[0,5]]},"382":{"position":[[974,5],[1065,5],[1896,5],[5882,5],[6560,6],[6590,5]]},"386":{"position":[[838,5],[1369,5]]},"402":{"position":[[1044,5]]},"406":{"position":[[6953,5],[7653,5],[11659,5],[12347,6],[12377,5]]},"410":{"position":[[747,5],[4753,5],[5441,6],[5471,5],[5693,6]]},"412":{"position":[[0,5]]},"416":{"position":[[354,6],[565,5],[647,5],[826,5],[928,5]]},"428":{"position":[[341,8],[485,5],[564,5]]},"430":{"position":[[147,5]]},"432":{"position":[[0,5]]},"438":{"position":[[207,6]]},"448":{"position":[[57,5],[851,5],[4877,5],[5575,6],[5604,5],[5847,5],[6688,5],[10718,5],[11418,6],[11447,5]]},"450":{"position":[[0,5]]},"452":{"position":[[1128,6]]},"464":{"position":[[498,7]]},"466":{"position":[[627,5]]},"468":{"position":[[435,7]]},"482":{"position":[[217,5],[917,5],[4927,5],[5617,6],[5648,5],[6551,5],[10557,5],[11245,6],[11275,5]]},"486":{"position":[[46,5],[877,5],[4891,5],[5583,6],[5614,5],[6676,5],[10690,5],[11382,6],[11412,5]]},"488":{"position":[[0,5]]},"498":{"position":[[743,5]]},"508":{"position":[[185,6],[924,5],[4950,5],[5648,6],[5677,5],[6049,5]]},"510":{"position":[[0,5]]},"524":{"position":[[51,5],[1056,5],[5066,5],[5756,6],[5785,5]]},"526":{"position":[[0,5]]},"536":{"position":[[411,8]]},"544":{"position":[[984,5],[5018,5],[5720,6],[5751,5]]},"546":{"position":[[0,5]]},"564":{"position":[[757,5],[4707,5],[5367,6],[5398,5],[6271,5],[10221,5],[10881,6],[10912,5]]},"566":{"position":[[6331,5],[10285,5],[10947,6],[10978,5]]},"568":{"position":[[0,5]]},"570":{"position":[[65,6]]},"579":{"position":[[4,5]]},"581":{"position":[[0,5],[151,5],[916,5],[4906,5],[5586,6],[5615,5]]},"583":{"position":[[0,5]]},"604":{"position":[[0,5],[38,5]]},"606":{"position":[[0,5],[86,5],[139,5]]},"621":{"position":[[57,5],[858,5],[4896,5],[5600,6],[5635,5]]},"629":{"position":[[787,5],[4793,5],[5481,6],[5511,5]]},"631":{"position":[[6826,5],[10836,5],[11526,6],[11556,5],[12459,5],[16481,5],[17177,6],[17207,5]]},"633":{"position":[[0,5]]},"643":{"position":[[165,8]]},"649":{"position":[[1257,5],[2047,5],[6041,5],[6723,6],[6753,5],[7429,5],[8219,5],[12213,5],[12895,6],[12925,5],[14247,5],[15040,5],[19046,5],[19734,6],[19767,5],[21082,5],[21877,5],[25871,5],[26553,6],[26583,5],[27317,5],[28113,5],[32111,5],[32795,6],[32826,5]]},"651":{"position":[[1229,5],[2020,5],[6018,5],[6702,6],[6732,5],[7475,5],[8269,5],[12279,5],[12969,6],[13002,5],[13821,5],[14613,5],[18615,5],[19301,6],[19332,5],[20139,5],[20936,5],[24938,5],[25624,6],[25656,5]]},"653":{"position":[[0,5]]},"659":{"position":[[213,5],[253,5],[490,5]]},"665":{"position":[[453,7]]},"667":{"position":[[197,7],[281,5],[1312,5],[1804,6],[1834,5],[2112,5],[3151,5],[3647,6],[3677,5],[3886,6],[3971,5],[5002,5],[5494,6],[5524,5],[5807,5],[6850,5],[7348,6],[7378,5],[7664,5],[8699,5],[9193,6],[9223,5],[9507,5],[10550,5],[11048,6],[11078,5]]},"669":{"position":[[2800,6],[2859,5],[3894,5],[4388,6],[4418,5],[10683,5],[10749,5],[11780,5],[12272,6],[12302,5]]},"671":{"position":[[463,5],[680,5],[787,5],[7303,5],[8788,5],[9456,6],[9486,5],[9974,5],[11463,5],[12133,6],[12163,5],[12521,5]]},"673":{"position":[[10284,5]]},"675":{"position":[[0,5],[350,5],[375,5]]},"677":{"position":[[1166,5],[1247,5],[1413,6]]},"679":{"position":[[1566,5],[1779,5],[1801,5],[1830,5]]},"683":{"position":[[626,5],[839,5],[861,5],[890,5]]},"685":{"position":[[446,8]]},"691":{"position":[[169,5],[6848,6],[7587,5],[11585,5],[12269,6],[12298,5],[12891,6],[13582,5],[17580,5],[18264,6],[18293,5],[18519,6],[19268,5],[23274,5],[23962,6],[23993,5],[24894,5],[28896,5],[29582,6],[29613,5]]},"693":{"position":[[0,5]]},"701":{"position":[[1734,5],[5736,5],[6422,6],[6452,5],[7352,5],[11350,5],[12034,6],[12064,5]]},"703":{"position":[[6003,5],[6742,5],[10756,5],[11448,6],[11481,5]]},"705":{"position":[[18971,5],[19674,5],[23676,5],[24362,6],[24392,5],[25337,5],[29331,5],[30013,6],[30043,5]]},"709":{"position":[[207,6]]},"726":{"position":[[28069,5],[28926,5],[32924,5],[33608,6],[33638,5],[34685,5],[38687,5],[39373,6],[39403,5],[40302,5],[44316,5],[45008,6],[45047,5],[45944,5],[49962,5],[50656,6],[50686,5]]},"728":{"position":[[968,5],[4970,5],[5656,6],[5686,5],[8887,5],[12873,5],[13551,6],[13581,5],[14804,5],[18826,5],[19522,6],[19561,5],[20237,5],[22838,6],[25246,5],[29264,5],[29958,6],[29997,5],[33494,5],[37476,5],[38152,6],[38182,5],[40133,5],[41850,6],[43054,5],[47036,5],[47712,6],[47742,5]]},"730":{"position":[[188,6]]},"745":{"position":[[1145,8],[8183,5],[12189,5],[12877,6],[12907,5],[19514,5],[23520,5],[24208,6],[24238,5],[25140,5],[29150,5],[29840,6],[29870,5],[32874,5],[36880,5],[37568,6],[37598,5],[38500,5],[42506,5],[43194,6],[43224,5]]},"747":{"position":[[10342,5],[14356,5],[15048,6],[15081,5]]},"749":{"position":[[6476,5],[13105,5],[17111,5],[17799,6],[17830,5]]},"751":{"position":[[9859,5],[10554,5],[14576,5],[15272,6],[15302,5]]},"755":{"position":[[110,5]]},"759":{"position":[[214,5],[254,5],[491,5]]},"761":{"position":[[2276,8],[2348,8],[2396,8],[3467,8],[3622,8],[3754,8],[5165,8],[5379,8],[5570,8],[7308,8],[7473,8],[7615,8],[9026,8],[9190,8],[9331,8],[11168,8],[11327,8],[11463,8]]},"765":{"position":[[430,7]]},"767":{"position":[[308,6],[1103,5],[5089,5],[5767,6],[5797,5],[6791,5],[10793,5],[11479,6],[11513,5],[11747,5],[18426,5],[22416,5],[23096,6],[23126,5]]},"769":{"position":[[4527,6],[5218,5],[9188,5],[9858,6],[9883,5],[25720,8],[26505,5],[30491,5],[31169,6],[31199,5]]},"771":{"position":[[522,5],[590,5],[8071,5],[8288,5],[8395,5],[9200,5],[13932,5],[14889,6],[14919,5],[16126,5],[20862,5],[21821,6],[21851,5]]},"773":{"position":[[4195,8],[4350,8],[4482,8],[7149,8],[7363,8],[7554,8],[11020,8],[11185,8],[11327,8],[14074,8],[14238,8],[14379,8],[19318,8],[19477,8],[19613,8],[21186,5]]},"777":{"position":[[0,5],[365,5]]},"791":{"position":[[161,7]]},"795":{"position":[[19751,5],[23753,5],[24439,6],[24469,5],[25450,5],[29444,5],[30126,6],[30156,5],[30372,5]]},"797":{"position":[[968,8],[11079,5],[15093,5],[15785,6],[15818,5],[16037,5]]},"799":{"position":[[18263,5],[22253,5],[22933,6],[22960,5]]},"801":{"position":[[10955,5],[14965,5],[15655,6],[15686,5]]},"819":{"position":[[430,7]]},"821":{"position":[[1351,8],[8719,5],[12745,5],[13443,6],[13472,5],[20387,5],[24413,5],[25111,6],[25146,5],[26130,5],[30184,5],[30896,6],[30931,5],[39356,5],[40091,5],[44117,5],[44815,6],[44844,5]]},"823":{"position":[[803,5],[4809,5],[5497,6],[5526,5],[8085,5],[12087,5],[12773,6],[12802,5],[13026,5]]},"825":{"position":[[207,5],[45923,5],[46736,5],[50730,5],[51412,6],[51443,5],[52407,5],[56461,5],[57173,6],[57204,5]]},"827":{"position":[[653,5]]},"844":{"position":[[1115,8],[8208,5],[12226,5],[12920,6],[12950,5],[19554,5],[23556,5],[24242,6],[24272,5],[25172,5],[29182,5],[29872,6],[29902,5],[32394,5],[36396,5],[37082,6],[37112,5],[38012,5],[42018,5],[42706,6],[42736,5]]},"846":{"position":[[11016,5],[15034,5],[15728,6],[15761,5]]},"848":{"position":[[9234,5],[9929,5],[13959,5],[14659,6],[14690,5]]},"850":{"position":[[11599,5],[15633,5],[16335,6],[16365,5],[17357,5],[21399,5],[22105,6],[22135,5],[23054,5],[27104,5],[27814,6],[27844,5],[28846,5],[32888,5],[33594,6],[33624,5],[34543,5],[38585,5],[39291,6],[39321,5]]}}}],["check('bob",{"_index":2321,"t":{"677":{"position":[[1449,12],[1505,12]]}}}],["check(us",{"_index":1727,"t":{"386":{"position":[[860,11]]}}}],["check*i",{"_index":2058,"t":{"544":{"position":[[215,9]]}}}],["checkauthor",{"_index":992,"t":{"113":{"position":[[2629,18]]}}}],["checkauthorization(c",{"_index":1002,"t":{"113":{"position":[[4501,20]]}}}],["checki",{"_index":1995,"t":{"482":{"position":[[118,7]]}}}],["checklist",{"_index":1429,"t":{"217":{"position":[[368,10]]}}}],["chicago",{"_index":347,"t":{"27":{"position":[[64,8],[1012,8]]}}}],["child",{"_index":631,"t":{"47":{"position":[[1177,8],[1409,8],[1672,8],[2499,8],[2731,8],[2994,8]]},"51":{"position":[[312,8]]},"53":{"position":[[859,8],[1597,8],[3476,5]]},"55":{"position":[[309,8]]},"57":{"position":[[344,8]]},"61":{"position":[[494,5],[513,5],[618,5],[637,5],[687,5],[1188,8],[1292,8],[1998,8]]},"169":{"position":[[11506,8]]},"223":{"position":[[466,5]]},"316":{"position":[[476,5],[528,5]]},"373":{"position":[[409,8]]},"384":{"position":[[336,8]]},"392":{"position":[[740,8]]},"404":{"position":[[594,8]]},"426":{"position":[[5913,5]]},"456":{"position":[[2145,8],[2606,8]]},"460":{"position":[[1956,8],[2460,8]]},"474":{"position":[[2397,5],[2465,5]]},"476":{"position":[[53,5]]},"484":{"position":[[676,8]]},"502":{"position":[[608,8]]},"510":{"position":[[69,5]]},"558":{"position":[[366,8]]},"568":{"position":[[101,5],[178,5]]},"572":{"position":[[623,8]]},"625":{"position":[[446,8]]},"633":{"position":[[199,5],[249,5]]},"645":{"position":[[564,8]]},"649":{"position":[[375,8]]},"661":{"position":[[2029,8]]},"669":{"position":[[1449,8],[1590,8],[1733,8]]},"673":{"position":[[809,8],[950,8],[1093,8],[1904,8]]},"689":{"position":[[1157,8]]},"701":{"position":[[554,8]]},"728":{"position":[[8100,5],[19893,5],[21044,8],[23768,8],[31545,8],[39173,8]]},"730":{"position":[[244,5]]},"732":{"position":[[986,5]]},"745":{"position":[[30692,8],[30799,8],[30904,8],[31017,8],[31679,8]]},"747":{"position":[[1179,8],[1286,8],[1391,8],[1504,8]]},"749":{"position":[[44,6],[59,5]]},"751":{"position":[[1686,8],[1793,8],[1898,8],[2011,8],[15598,5],[15826,8],[23829,8],[23996,8],[24100,8],[24318,8],[24423,8]]},"761":{"position":[[1423,8]]},"769":{"position":[[1727,8],[3376,8],[3635,8]]},"773":{"position":[[1061,8],[1978,8],[2237,8]]},"775":{"position":[[1461,8],[2445,8],[2704,8]]},"797":{"position":[[1603,8],[1782,8],[1954,8]]},"799":{"position":[[1392,8],[1571,8],[1743,8]]},"801":{"position":[[1218,8],[1381,8],[1537,8]]},"823":{"position":[[6731,8],[6842,8]]},"825":{"position":[[3475,8],[5141,8],[5252,8],[5869,8]]},"831":{"position":[[1068,5]]},"844":{"position":[[30729,8],[30836,8],[30941,8]]},"846":{"position":[[838,8],[945,8],[1050,8]]},"848":{"position":[[920,8],[1027,8],[1132,8],[14989,5],[15218,8],[17027,8],[17191,8],[17407,8],[17624,8]]},"850":{"position":[[1081,8],[1245,8],[1461,8],[1678,8]]}}}],["children",{"_index":2923,"t":{"848":{"position":[[8913,9]]}}}],["choic",{"_index":413,"t":{"31":{"position":[[124,7]]}}}],["choos",{"_index":1605,"t":{"310":{"position":[[16,6]]},"625":{"position":[[1691,6]]},"649":{"position":[[950,6]]},"651":{"position":[[938,6]]}}}],["chronolog",{"_index":746,"t":{"67":{"position":[[145,13]]},"292":{"position":[[9,15]]}}}],["claim",{"_index":968,"t":{"111":{"position":[[2425,6]]},"113":{"position":[[3735,6],[3975,6]]}}}],["claims[\"name\"].(str",{"_index":970,"t":{"111":{"position":[[2471,23]]},"113":{"position":[[3781,23],[4021,23]]}}}],["clariti",{"_index":1800,"t":{"420":{"position":[[446,7]]}}}],["class",{"_index":509,"t":{"37":{"position":[[3834,5]]},"43":{"position":[[1451,5]]},"97":{"position":[[1523,5]]},"123":{"position":[[1523,5]]},"169":{"position":[[514,5],[14522,5],[20716,5],[27145,5]]},"171":{"position":[[39,5]]},"215":{"position":[[1537,5]]},"217":{"position":[[2265,5]]},"219":{"position":[[2428,5]]},"227":{"position":[[1088,5]]},"231":{"position":[[10,5]]},"236":{"position":[[2418,5]]},"238":{"position":[[2357,5],[8105,5]]},"248":{"position":[[1523,5]]},"258":{"position":[[807,5]]},"262":{"position":[[10,5]]},"265":{"position":[[2637,5]]},"267":{"position":[[2429,5],[8054,5]]},"273":{"position":[[3654,5],[9445,5],[15324,5],[20930,5],[24519,5]]},"279":{"position":[[10,5]]},"282":{"position":[[2678,5]]},"284":{"position":[[2402,5]]},"294":{"position":[[1495,5]]},"320":{"position":[[1409,5]]},"326":{"position":[[10,5]]},"329":{"position":[[2507,5],[8090,5],[14317,5]]},"347":{"position":[[1718,5]]},"351":{"position":[[10,5]]},"353":{"position":[[2498,5],[8106,5]]},"359":{"position":[[2804,5],[8793,5],[14607,5]]},"365":{"position":[[1220,5]]},"369":{"position":[[10,5]]},"375":{"position":[[2546,5]]},"382":{"position":[[3471,5]]},"406":{"position":[[2938,5],[9238,5]]},"408":{"position":[[3060,5]]},"410":{"position":[[2332,5]]},"440":{"position":[[799,5]]},"442":{"position":[[10,5]]},"446":{"position":[[2504,5]]},"448":{"position":[[2446,5],[8285,5]]},"474":{"position":[[2706,5]]},"480":{"position":[[10,5]]},"482":{"position":[[2504,5],[8136,5]]},"486":{"position":[[2466,5],[8265,5]]},"492":{"position":[[1091,5]]},"496":{"position":[[10,5]]},"504":{"position":[[2451,5]]},"506":{"position":[[2613,5]]},"508":{"position":[[2519,5]]},"514":{"position":[[861,5]]},"518":{"position":[[10,5]]},"522":{"position":[[2741,5]]},"524":{"position":[[2643,5]]},"530":{"position":[[838,5]]},"534":{"position":[[10,5]]},"540":{"position":[[2464,5]]},"542":{"position":[[2951,5]]},"544":{"position":[[2583,5]]},"550":{"position":[[791,5]]},"554":{"position":[[10,5]]},"556":{"position":[[2704,5]]},"560":{"position":[[2703,5]]},"562":{"position":[[2559,5]]},"564":{"position":[[2314,5],[7828,5]]},"566":{"position":[[2426,5],[7890,5]]},"572":{"position":[[1262,5]]},"576":{"position":[[10,5]]},"581":{"position":[[2493,5]]},"588":{"position":[[2885,5],[8983,5],[14984,5]]},"590":{"position":[[2852,5]]},"595":{"position":[[2589,5],[8501,5]]},"600":{"position":[[2704,5]]},"610":{"position":[[1035,5]]},"614":{"position":[[10,5]]},"619":{"position":[[2925,5]]},"621":{"position":[[2459,5]]},"627":{"position":[[2907,5]]},"629":{"position":[[2372,5]]},"631":{"position":[[2560,5],[8413,5],[14052,5]]},"637":{"position":[[379,5]]},"641":{"position":[[10,5]]},"649":{"position":[[3626,5],[9798,5],[16625,5],[23456,5],[29694,5]]},"651":{"position":[[3601,5],[9856,5],[16196,5],[22519,5]]},"669":{"position":[[7205,5]]},"671":{"position":[[3652,5]]},"679":{"position":[[950,5]]},"683":{"position":[[10,5]]},"691":{"position":[[3018,5],[9168,5],[15163,5],[20853,5],[26477,5]]},"697":{"position":[[83,5]]},"701":{"position":[[3317,5],[8933,5]]},"703":{"position":[[2610,5],[8331,5]]},"705":{"position":[[2628,5],[8971,5],[15235,5],[21257,5],[26916,5]]},"726":{"position":[[4507,5],[14728,5],[22725,5],[30507,5],[36268,5],[41891,5],[47535,5]]},"728":{"position":[[2551,5],[10462,5],[16397,5],[26837,5],[35067,5],[44627,5]]},"745":{"position":[[4163,5],[9768,5],[15537,5],[21099,5],[26727,5],[34459,5],[40085,5]]},"747":{"position":[[5209,5],[11931,5]]},"749":{"position":[[2685,5],[8990,5],[14690,5]]},"751":{"position":[[5561,5],[12147,5],[19696,5]]},"761":{"position":[[6155,5]]},"767":{"position":[[2678,5],[8374,5],[14298,5],[20003,5]]},"769":{"position":[[6785,5],[13659,5],[21653,5],[28080,5]]},"771":{"position":[[3960,5],[11132,5],[18060,5]]},"773":{"position":[[9867,5]]},"795":{"position":[[2847,5],[8503,5],[14591,5],[21334,5],[27029,5]]},"797":{"position":[[5842,5],[12668,5]]},"799":{"position":[[5405,5],[12438,5],[19840,5]]},"801":{"position":[[5783,5],[12542,5]]},"821":{"position":[[4522,5],[10314,5],[16233,5],[21982,5],[27739,5],[34689,5],[41686,5]]},"823":{"position":[[2388,5],[9668,5]]},"825":{"position":[[9799,5],[17105,5],[23695,5],[30359,5],[36670,5],[42523,5],[48315,5],[54016,5]]},"844":{"position":[[4170,5],[9799,5],[15582,5],[21137,5],[26759,5],[33977,5],[39597,5]]},"846":{"position":[[5264,5],[12607,5]]},"848":{"position":[[4737,5],[11526,5]]},"850":{"position":[[6015,5],[13198,5],[18960,5],[24661,5],[30449,5],[36146,5]]}}}],["classifi",{"_index":1393,"t":{"169":{"position":[[9749,10]]}}}],["claus",{"_index":2075,"t":{"558":{"position":[[1172,7]]}}}],["clean",{"_index":2675,"t":{"771":{"position":[[606,5]]}}}],["cli",{"_index":189,"t":{"7":{"position":[[577,3]]},"9":{"position":[[309,3]]},"27":{"position":[[633,4]]},"35":{"position":[[23,3],[1341,4]]},"37":{"position":[[732,3],[8464,4]]},"43":{"position":[[23,3]]},"77":{"position":[[73,3],[904,4],[1316,3],[1785,3]]},"85":{"position":[[36,3]]},"93":{"position":[[23,3]]},"97":{"position":[[96,3]]},"99":{"position":[[102,3]]},"119":{"position":[[23,3]]},"123":{"position":[[96,3]]},"125":{"position":[[97,3]]},"169":{"position":[[12276,3],[18470,3],[24824,3]]},"215":{"position":[[92,3]]},"217":{"position":[[402,3]]},"219":{"position":[[278,3]]},"236":{"position":[[112,3]]},"238":{"position":[[117,3],[5861,3]]},"244":{"position":[[23,3]]},"248":{"position":[[96,3]]},"250":{"position":[[84,3]]},"252":{"position":[[239,3]]},"265":{"position":[[417,3]]},"267":{"position":[[133,3],[5832,3]]},"273":{"position":[[1422,3],[7065,3],[13084,3],[18686,3]]},"282":{"position":[[374,3]]},"284":{"position":[[160,3]]},"296":{"position":[[87,3],[1491,3]]},"298":{"position":[[1072,3],[2341,3]]},"329":{"position":[[219,3],[5800,3]]},"353":{"position":[[256,3],[5866,3]]},"359":{"position":[[380,3],[6551,3],[12365,3]]},"375":{"position":[[290,3]]},"382":{"position":[[1235,3]]},"406":{"position":[[243,3],[6992,3]]},"408":{"position":[[145,3]]},"410":{"position":[[86,3]]},"426":{"position":[[10368,3]]},"446":{"position":[[174,3]]},"448":{"position":[[190,3],[6027,3]]},"466":{"position":[[1202,3]]},"482":{"position":[[256,3],[5890,3]]},"486":{"position":[[216,3],[6015,3]]},"504":{"position":[[149,3]]},"506":{"position":[[151,3]]},"508":{"position":[[263,3]]},"522":{"position":[[335,3]]},"524":{"position":[[395,3]]},"540":{"position":[[158,3]]},"542":{"position":[[491,3]]},"544":{"position":[[323,3]]},"556":{"position":[[237,3]]},"560":{"position":[[244,3]]},"562":{"position":[[255,3]]},"564":{"position":[[96,3],[5610,3]]},"566":{"position":[[138,3],[5670,3]]},"581":{"position":[[255,3]]},"588":{"position":[[505,3],[6661,3],[12642,3]]},"590":{"position":[[708,3]]},"595":{"position":[[246,3],[6158,3]]},"600":{"position":[[167,3]]},"619":{"position":[[387,3]]},"621":{"position":[[197,3]]},"627":{"position":[[112,3]]},"629":{"position":[[126,3]]},"631":{"position":[[112,3],[6165,3],[11798,3]]},"649":{"position":[[1386,3],[7558,3],[14379,3],[21216,3],[27452,3]]},"651":{"position":[[1359,3],[7608,3],[13952,3],[20275,3]]},"661":{"position":[[3186,3]]},"667":{"position":[[252,3],[2083,3],[3942,3],[5778,3],[7635,3],[9478,3]]},"669":{"position":[[2830,3],[4763,3],[10720,3]]},"671":{"position":[[1154,3],[7274,3],[9945,3]]},"673":{"position":[[2725,3]]},"691":{"position":[[383,3],[6926,3],[12921,3],[18607,3],[24233,3]]},"701":{"position":[[1073,3],[6691,3]]},"703":{"position":[[202,3],[6081,3]]},"705":{"position":[[172,3],[6454,3],[12716,3],[19013,3],[24676,3]]},"726":{"position":[[216,3],[11534,3],[19671,3],[28265,3],[34024,3],[39641,3],[45283,3]]},"728":{"position":[[307,3],[8226,3],[14143,3],[24585,3],[32833,3],[42393,3]]},"745":{"position":[[1843,3],[7522,3],[13217,3],[18853,3],[24479,3],[32213,3],[37839,3]]},"747":{"position":[[2372,3],[9681,3]]},"749":{"position":[[317,3],[6558,3],[12444,3]]},"751":{"position":[[3014,3],[9893,3],[17332,3]]},"761":{"position":[[2620,3]]},"767":{"position":[[442,3],[6130,3],[11860,3],[17765,3]]},"769":{"position":[[4557,3],[10367,3],[18910,3],[25844,3]]},"771":{"position":[[1107,3],[8539,3],[15465,3]]},"773":{"position":[[3348,3]]},"795":{"position":[[529,3],[6177,3],[11861,3],[19090,3],[24789,3]]},"797":{"position":[[2947,3],[10418,3]]},"799":{"position":[[2852,3],[9377,3],[17602,3]]},"801":{"position":[[3047,3],[10294,3]]},"821":{"position":[[2086,3],[8058,3],[13797,3],[19726,3],[25469,3],[31635,3],[39430,3]]},"823":{"position":[[142,3],[7424,3]]},"825":{"position":[[6915,3],[14531,3],[20974,3],[27808,3],[34292,3],[40179,3],[46075,3],[51746,3]]},"844":{"position":[[1844,3],[7547,3],[13264,3],[18893,3],[24511,3],[31733,3],[37351,3]]},"846":{"position":[[2127,3],[10355,3]]},"848":{"position":[[1960,3],[9268,3]]},"850":{"position":[[2833,3],[10938,3],[16696,3],[22393,3],[28185,3],[33882,3]]}}}],["click",{"_index":409,"t":{"31":{"position":[[46,5],[132,5],[250,5],[336,5],[453,5],[561,5],[669,5],[792,5],[888,5],[1029,5],[1134,5],[1243,5]]},"167":{"position":[[115,5],[204,5]]},"223":{"position":[[85,5],[207,5],[324,5],[482,5],[615,5],[726,5],[802,5]]},"316":{"position":[[101,5],[206,5],[321,5],[451,5],[578,5],[682,5],[800,5],[909,5],[995,5],[1165,5],[1302,5],[1419,5],[1537,5],[1632,5]]},"337":{"position":[[98,5],[208,5],[315,5],[424,5]]},"339":{"position":[[98,5]]},"343":{"position":[[112,5],[212,5],[348,5],[454,5]]},"436":{"position":[[76,5],[157,5]]}}}],["client",{"_index":412,"t":{"31":{"position":[[76,6],[278,6],[313,6]]},"35":{"position":[[238,7],[524,7],[810,7],[1096,7]]},"37":{"position":[[960,7],[2138,7],[3943,7]]},"97":{"position":[[65,7],[233,7],[772,7],[1632,7]]},"113":{"position":[[1133,6],[5182,8]]},"123":{"position":[[65,7],[233,7],[772,7],[1632,7]]},"169":{"position":[[12515,7],[13357,7],[14631,7],[18709,7],[19551,7],[20825,7],[25063,7],[25926,7],[27254,7]]},"213":{"position":[[46,6],[256,7]]},"217":{"position":[[184,7]]},"219":{"position":[[45,6],[129,6],[213,6]]},"236":{"position":[[346,7],[1143,7],[2527,7]]},"238":{"position":[[356,7],[1195,7],[2466,7],[6100,7],[6941,7],[8214,7]]},"248":{"position":[[65,7],[233,7],[772,7],[1632,7]]},"265":{"position":[[656,7],[1485,7],[2746,7]]},"267":{"position":[[367,7],[1159,7],[2538,7],[6071,7],[6901,7],[8163,7]]},"273":{"position":[[1661,7],[2496,7],[3763,7],[7299,7],[8133,7],[9554,7],[13323,7],[14162,7],[15433,7],[18925,7],[19766,7],[21039,7]]},"282":{"position":[[608,7],[1404,7],[2787,7]]},"284":{"position":[[399,7],[1239,7],[2511,7]]},"294":{"position":[[41,7],[205,7],[744,7],[1604,7]]},"329":{"position":[[453,7],[1241,7],[2616,7],[6034,7],[6823,7],[8199,7],[11848,7],[12806,7],[14426,7]]},"353":{"position":[[495,7],[1335,7],[2607,7],[6105,7],[6944,7],[8215,7]]},"359":{"position":[[614,7],[1470,7],[2913,7],[6790,7],[7630,7],[8902,7],[12604,7],[13444,7],[14716,7]]},"375":{"position":[[529,7],[1376,7],[2655,7]]},"382":{"position":[[1474,7],[2311,7],[3580,7]]},"406":{"position":[[477,7],[1439,7],[3047,7],[7231,7],[8073,7],[9347,7]]},"408":{"position":[[379,7],[1451,7],[3169,7]]},"410":{"position":[[325,7],[1167,7],[2441,7]]},"446":{"position":[[408,7],[1217,7],[2613,7]]},"448":{"position":[[429,7],[1276,7],[2555,7],[6266,7],[7114,7],[8394,7]]},"482":{"position":[[495,7],[1338,7],[2613,7],[6129,7],[6971,7],[8245,7]]},"486":{"position":[[455,7],[1299,7],[2575,7],[6254,7],[7098,7],[8374,7]]},"504":{"position":[[383,7],[1178,7],[2560,7]]},"506":{"position":[[385,7],[1260,7],[2722,7]]},"508":{"position":[[502,7],[1349,7],[2628,7]]},"522":{"position":[[569,7],[1416,7],[2850,7]]},"524":{"position":[[634,7],[1477,7],[2752,7]]},"540":{"position":[[392,7],[1189,7],[2573,7]]},"542":{"position":[[725,7],[1599,7],[3060,7]]},"544":{"position":[[562,7],[1411,7],[2692,7]]},"556":{"position":[[471,7],[1319,7],[2813,7]]},"560":{"position":[[478,7],[1322,7],[2812,7]]},"562":{"position":[[489,7],[1285,7],[2668,7]]},"564":{"position":[[335,7],[1163,7],[2423,7],[5849,7],[6677,7],[7937,7]]},"566":{"position":[[372,7],[1160,7],[2535,7],[5909,7],[6738,7],[7999,7]]},"581":{"position":[[494,7],[1332,7],[2602,7]]},"588":{"position":[[744,7],[1627,7],[2994,7],[6900,7],[7764,7],[9092,7],[12881,7],[13755,7],[15093,7]]},"590":{"position":[[947,7],[1712,7],[2961,7]]},"595":{"position":[[485,7],[1362,7],[2698,7],[6397,7],[7274,7],[8610,7]]},"600":{"position":[[406,7],[1376,7],[2813,7]]},"619":{"position":[[621,7],[1534,7],[3034,7]]},"621":{"position":[[436,7],[1286,7],[2568,7]]},"627":{"position":[[346,7],[1358,7],[3016,7]]},"629":{"position":[[365,7],[1207,7],[2481,7]]},"631":{"position":[[346,7],[1214,7],[2669,7],[6404,7],[7247,7],[8522,7],[12037,7],[12883,7],[14161,7]]},"649":{"position":[[1625,7],[2464,7],[3735,7],[7797,7],[8636,7],[9907,7],[14618,7],[15460,7],[16734,7],[21455,7],[22294,7],[23565,7],[27691,7],[28531,7],[29803,7]]},"651":{"position":[[1598,7],[2438,7],[3710,7],[7847,7],[8690,7],[9965,7],[14191,7],[15032,7],[16305,7],[20514,7],[21355,7],[22628,7]]},"669":{"position":[[4997,7],[5862,7],[7314,7]]},"671":{"position":[[1388,7],[2281,7],[3761,7]]},"691":{"position":[[617,7],[1549,7],[3127,7],[7165,7],[8005,7],[9277,7],[13160,7],[14000,7],[15272,7],[18846,7],[19688,7],[20962,7],[24472,7],[25313,7],[26586,7]]},"701":{"position":[[1312,7],[2153,7],[3426,7],[6930,7],[7770,7],[9042,7]]},"703":{"position":[[436,7],[1284,7],[2719,7],[6320,7],[7164,7],[8440,7]]},"705":{"position":[[411,7],[1362,7],[2737,7],[6688,7],[7561,7],[9080,7],[12950,7],[13824,7],[15344,7],[19252,7],[20093,7],[21366,7],[24915,7],[25754,7],[27025,7]]},"726":{"position":[[450,7],[2092,7],[4616,7],[11768,7],[12950,7],[14837,7],[19905,7],[21017,7],[22834,7],[28504,7],[29344,7],[30616,7],[34263,7],[35104,7],[36377,7],[39880,7],[40724,7],[42000,7],[45522,7],[46367,7],[47644,7]]},"728":{"position":[[546,7],[1387,7],[2660,7],[8465,7],[9302,7],[10571,7],[14382,7],[15228,7],[16506,7],[24824,7],[25669,7],[26946,7],[33072,7],[33908,7],[35176,7],[42632,7],[43468,7],[44736,7]]},"745":{"position":[[2077,7],[2881,7],[4272,7],[7761,7],[8603,7],[9877,7],[13451,7],[14255,7],[15646,7],[19092,7],[19934,7],[21208,7],[24718,7],[25561,7],[26836,7],[32452,7],[33294,7],[34568,7],[38078,7],[38920,7],[40194,7]]},"747":{"position":[[2606,7],[3639,7],[5318,7],[9920,7],[10764,7],[12040,7]]},"749":{"position":[[551,7],[1379,7],[2794,7],[6792,7],[7652,7],[9099,7],[12683,7],[13525,7],[14799,7]]},"751":{"position":[[3248,7],[4136,7],[5670,7],[10132,7],[10978,7],[12256,7],[17566,7],[18392,7],[19805,7]]},"761":{"position":[[2854,7],[4177,7],[6264,7]]},"767":{"position":[[681,7],[1518,7],[2787,7],[6369,7],[7210,7],[8483,7],[12094,7],[12957,7],[14407,7],[18004,7],[18842,7],[20112,7]]},"769":{"position":[[4796,7],[5629,7],[6894,7],[10601,7],[11832,7],[13768,7],[19144,7],[20130,7],[21762,7],[26083,7],[26920,7],[28189,7]]},"771":{"position":[[1341,7],[2382,7],[4069,7],[8778,7],[9784,7],[11241,7],[15704,7],[16711,7],[18169,7]]},"773":{"position":[[3582,7],[6161,7],[9976,7]]},"795":{"position":[[763,7],[1566,7],[2956,7],[6411,7],[7218,7],[8612,7],[12095,7],[13045,7],[14700,7],[19329,7],[20170,7],[21443,7],[25028,7],[25867,7],[27138,7]]},"797":{"position":[[3181,7],[4184,7],[5951,7],[10657,7],[11501,7],[12777,7]]},"799":{"position":[[3086,7],[3977,7],[5514,7],[9611,7],[10697,7],[12547,7],[17841,7],[18679,7],[19949,7]]},"801":{"position":[[3281,7],[4234,7],[5892,7],[10533,7],[11376,7],[12651,7]]},"821":{"position":[[2320,7],[3182,7],[4631,7],[8297,7],[9144,7],[10423,7],[14031,7],[14893,7],[16342,7],[19965,7],[20812,7],[22091,7],[25708,7],[26562,7],[27848,7],[31869,7],[32981,7],[34798,7],[39669,7],[40516,7],[41795,7]]},"823":{"position":[[381,7],[1223,7],[2497,7],[7663,7],[8504,7],[9777,7]]},"825":{"position":[[7149,7],[8176,7],[9908,7],[14765,7],[15696,7],[17214,7],[21208,7],[22183,7],[23804,7],[28042,7],[28932,7],[30468,7],[34526,7],[35359,7],[36779,7],[40413,7],[41229,7],[42632,7],[46314,7],[47153,7],[48424,7],[51985,7],[52839,7],[54125,7]]},"844":{"position":[[2078,7],[2885,7],[4279,7],[7786,7],[8631,7],[9908,7],[13498,7],[14301,7],[15691,7],[19132,7],[19973,7],[21246,7],[24750,7],[25593,7],[26868,7],[31972,7],[32813,7],[34086,7],[37590,7],[38432,7],[39706,7]]},"846":{"position":[[2361,7],[3485,7],[5373,7],[10594,7],[11439,7],[12716,7]]},"848":{"position":[[2194,7],[3197,7],[4846,7],[9507,7],[10355,7],[11635,7]]},"850":{"position":[[3067,7],[4243,7],[6124,7],[11177,7],[12026,7],[13307,7],[16935,7],[17786,7],[19069,7],[22632,7],[23485,7],[24770,7],[28424,7],[29275,7],[30558,7],[34121,7],[34972,7],[36255,7]]}}}],["client_id",{"_index":1474,"t":{"219":{"position":[[3898,10]]}}}],["client_secret",{"_index":1476,"t":{"219":{"position":[[3942,14]]}}}],["clientcheckopt",{"_index":853,"t":{"99":{"position":[[324,19],[644,18]]},"169":{"position":[[13959,19],[15339,18],[20153,19],[21533,18]]},"238":{"position":[[1797,19],[3174,18],[7543,19],[8922,18]]},"265":{"position":[[2087,19],[3454,18]]},"267":{"position":[[7503,19],[8871,18]]},"273":{"position":[[3098,19],[4471,18],[14764,19],[16141,18],[20368,19],[21747,18]]},"284":{"position":[[1841,19],[3219,18]]},"353":{"position":[[1937,19],[3315,18],[7546,19],[8923,18]]},"359":{"position":[[8232,19],[9610,18],[14046,19],[15424,18]]},"375":{"position":[[1978,19],[3363,18]]},"382":{"position":[[2913,19],[4288,18]]},"406":{"position":[[8675,19],[10055,18]]},"410":{"position":[[1769,19],[3149,18]]},"448":{"position":[[1878,19],[3263,18],[7716,19],[9102,18]]},"482":{"position":[[1940,19],[3321,18],[7573,19],[8953,18]]},"486":{"position":[[1901,19],[3283,18],[7700,19],[9082,18]]},"508":{"position":[[1951,19],[3336,18]]},"524":{"position":[[2079,19],[3460,18]]},"544":{"position":[[2013,19],[3400,18]]},"564":{"position":[[1765,19],[3131,18],[7279,19],[8645,18]]},"566":{"position":[[7340,19],[8707,18]]},"581":{"position":[[1934,19],[3310,18]]},"595":{"position":[[3406,18],[9318,18]]},"621":{"position":[[1888,19],[3276,18]]},"629":{"position":[[1809,19],[3189,18]]},"631":{"position":[[7849,19],[9230,18],[13485,19],[14869,18]]},"649":{"position":[[3066,19],[4443,18],[9238,19],[10615,18],[16062,19],[17442,18],[22896,19],[24273,18],[29133,19],[30511,18]]},"651":{"position":[[3040,19],[4418,18],[9292,19],[10673,18],[15634,19],[17013,18],[21957,19],[23336,18]]},"667":{"position":[[486,19],[807,18],[2319,19],[2642,18],[4176,19],[4497,18],[6015,19],[6339,18],[7870,19],[8192,18],[9715,19],[10039,18]]},"669":{"position":[[3065,19],[3387,18],[10954,19],[11275,18]]},"671":{"position":[[7607,19],[8045,18],[10279,19],[10718,18]]},"691":{"position":[[8607,19],[9985,18],[14602,19],[15980,18],[20290,19],[21670,18],[25915,19],[27294,18]]},"701":{"position":[[2755,19],[4134,18],[8372,19],[9750,18]]},"703":{"position":[[7766,19],[9148,18]]},"705":{"position":[[20695,19],[22074,18],[26356,19],[27733,18]]},"726":{"position":[[29946,19],[31324,18],[35706,19],[37085,18],[41326,19],[42708,18],[46969,19],[48352,18]]},"728":{"position":[[1989,19],[3368,18],[9904,19],[11279,18],[15830,19],[17214,18],[26271,19],[27654,18],[34510,19],[35884,18],[44070,19],[45444,18]]},"745":{"position":[[9205,19],[10585,18],[20536,19],[21916,18],[26163,19],[27544,18],[33896,19],[35276,18],[39522,19],[40902,18]]},"747":{"position":[[11366,19],[12748,18]]},"749":{"position":[[14127,19],[15507,18]]},"751":{"position":[[11580,19],[12964,18]]},"767":{"position":[[2120,19],[3495,18],[7812,19],[9191,18],[19444,19],[20820,18]]},"769":{"position":[[6231,19],[7602,18],[27522,19],[28897,18]]},"771":{"position":[[10386,19],[11949,18],[17313,19],[18877,18]]},"795":{"position":[[20772,19],[22151,18],[26469,19],[27846,18]]},"797":{"position":[[12103,19],[13485,18]]},"799":{"position":[[19281,19],[20657,18]]},"801":{"position":[[11978,19],[13359,18]]},"821":{"position":[[9746,19],[11131,18],[21414,19],[22799,18],[27164,19],[28556,18],[41118,19],[42503,18]]},"823":{"position":[[1825,19],[3205,18],[9106,19],[10485,18]]},"825":{"position":[[47755,19],[49132,18],[53441,19],[54833,18]]},"844":{"position":[[9233,19],[10616,18],[20575,19],[21954,18],[26195,19],[27576,18],[33415,19],[34794,18],[39034,19],[40414,18]]},"846":{"position":[[12041,19],[13424,18]]},"848":{"position":[[10957,19],[12343,18]]},"850":{"position":[[12628,19],[14015,18],[18388,19],[19777,18],[24087,19],[25478,18],[29877,19],[31266,18],[35574,19],[36963,18]]}}}],["clientcheckrequest",{"_index":855,"t":{"99":{"position":[[426,19],[737,18],[982,19]]},"113":{"position":[[5201,19]]},"169":{"position":[[14061,19],[15432,18],[16590,19],[20255,19],[21626,18],[22784,19]]},"238":{"position":[[1899,19],[3267,18],[4422,19],[7645,19],[9015,18],[10172,19]]},"265":{"position":[[2189,19],[3547,18],[4692,19]]},"267":{"position":[[7605,19],[8964,18],[10110,19]]},"273":{"position":[[3200,19],[4564,18],[5715,19],[14866,19],[16234,18],[17389,19],[20470,19],[21840,18],[22997,19]]},"284":{"position":[[1943,19],[3312,18],[4468,19]]},"353":{"position":[[2039,19],[3408,18],[4564,19],[7648,19],[9016,18],[10171,19]]},"359":{"position":[[8334,19],[9703,18],[10859,19],[14148,19],[15517,18],[16673,19]]},"375":{"position":[[2080,19],[3456,18],[4619,19]]},"382":{"position":[[3015,19],[4381,18],[5534,19]]},"406":{"position":[[8777,19],[10148,18],[11306,19]]},"410":{"position":[[1871,19],[3242,18],[4400,19]]},"448":{"position":[[1980,19],[3356,18],[4519,19],[7818,19],[9195,18],[10359,19]]},"482":{"position":[[2042,19],[3414,18],[4573,19],[7675,19],[9046,18],[10204,19]]},"486":{"position":[[2003,19],[3376,18],[4536,19],[7802,19],[9175,18],[10335,19]]},"508":{"position":[[2053,19],[3429,18],[4592,19]]},"524":{"position":[[2181,19],[3553,18],[4712,19]]},"544":{"position":[[2115,19],[3493,18],[4658,19]]},"564":{"position":[[1867,19],[3224,18],[4368,19],[7381,19],[8738,18],[9882,19]]},"566":{"position":[[7442,19],[8800,18],[9945,19]]},"581":{"position":[[2036,19],[3403,18],[4557,19]]},"621":{"position":[[1990,19],[3369,18],[4535,19]]},"629":{"position":[[1911,19],[3282,18],[4440,19]]},"631":{"position":[[7951,19],[9323,18],[10482,19],[13587,19],[14962,18],[16124,19]]},"649":{"position":[[3168,19],[4536,18],[5691,19],[9340,19],[10708,18],[11863,19],[16164,19],[17535,18],[18693,19],[22998,19],[24366,18],[25521,19],[29235,19],[30604,18],[31760,19]]},"651":{"position":[[3142,19],[4511,18],[5667,19],[9394,19],[10766,18],[11925,19],[15736,19],[17106,18],[18263,19],[22059,19],[23429,18],[24586,19]]},"667":{"position":[[588,19],[900,18],[1146,19],[2421,19],[2735,18],[2983,19],[4278,19],[4590,18],[4836,19],[6117,19],[6432,18],[6681,19],[7972,19],[8285,18],[8532,19],[9817,19],[10132,18],[10381,19]]},"669":{"position":[[3167,19],[3480,18],[3727,19],[11056,19],[11368,18],[11614,19]]},"671":{"position":[[7709,19],[8138,18],[8513,19],[10381,19],[10811,18],[11187,19]]},"691":{"position":[[8709,19],[10078,18],[11234,19],[14704,19],[16073,18],[17229,19],[20392,19],[21763,18],[22921,19],[26017,19],[27387,18],[28544,19]]},"701":{"position":[[2857,19],[4227,18],[5384,19],[8474,19],[9843,18],[10999,19]]},"703":{"position":[[7868,19],[9241,18],[10401,19]]},"705":{"position":[[20797,19],[22167,18],[23324,19],[26458,19],[27826,18],[28981,19]]},"726":{"position":[[30048,19],[31417,18],[32573,19],[35808,19],[37178,18],[38335,19],[41428,19],[42801,18],[43961,19],[47071,19],[48445,18],[49606,19]]},"728":{"position":[[2091,19],[3461,18],[4618,19],[10006,19],[11372,18],[12525,19],[15932,19],[17307,18],[18469,19],[26373,19],[27747,18],[28908,19],[34612,19],[35977,18],[37129,19],[44172,19],[45537,18],[46689,19]]},"745":{"position":[[9307,19],[10678,18],[11836,19],[20638,19],[22009,18],[23167,19],[26265,19],[27637,18],[28796,19],[33998,19],[35369,18],[36527,19],[39624,19],[40995,18],[42153,19]]},"747":{"position":[[11468,19],[12841,18],[14001,19]]},"749":{"position":[[14229,19],[15600,18],[16758,19]]},"751":{"position":[[11682,19],[13057,18],[14219,19]]},"767":{"position":[[2222,19],[3588,18],[4741,19],[7914,19],[9284,18],[10441,19],[19546,19],[20913,18],[22067,19]]},"769":{"position":[[6333,19],[7695,18],[8844,19],[27624,19],[28990,18],[30143,19]]},"771":{"position":[[10488,19],[12042,18],[13396,19],[17415,19],[18970,18],[20325,19]]},"795":{"position":[[20874,19],[22244,18],[23401,19],[26571,19],[27939,18],[29094,19]]},"797":{"position":[[12205,19],[13578,18],[14738,19]]},"799":{"position":[[19383,19],[20750,18],[21904,19]]},"801":{"position":[[12080,19],[13452,18],[14611,19]]},"821":{"position":[[9848,19],[11224,18],[12387,19],[21516,19],[22892,18],[24055,19],[27266,19],[28649,18],[29819,19],[41220,19],[42596,18],[43759,19]]},"823":{"position":[[1927,19],[3298,18],[4456,19],[9208,19],[10578,18],[11735,19]]},"825":{"position":[[47857,19],[49225,18],[50380,19],[53543,19],[54926,18],[56096,19]]},"844":{"position":[[9335,19],[10709,18],[11870,19],[20677,19],[22047,18],[23204,19],[26297,19],[27669,18],[28828,19],[33517,19],[34887,18],[36044,19],[39136,19],[40507,18],[41665,19]]},"846":{"position":[[12143,19],[13517,18],[14678,19]]},"848":{"position":[[11059,19],[12436,18],[13600,19]]},"850":{"position":[[12730,19],[14108,18],[15273,19],[18490,19],[19870,18],[21037,19],[24189,19],[25571,18],[26740,19],[29979,19],[31359,18],[32526,19],[35676,19],[37056,18],[38223,19]]}}}],["clientconfigur",{"_index":514,"t":{"37":{"position":[[3992,21]]},"43":{"position":[[1520,21]]},"97":{"position":[[1681,21]]},"123":{"position":[[1681,21]]},"169":{"position":[[14680,21],[20874,21],[27303,21]]},"215":{"position":[[1606,21]]},"217":{"position":[[2334,21]]},"219":{"position":[[2497,21]]},"236":{"position":[[2576,21]]},"238":{"position":[[2515,21],[8263,21]]},"248":{"position":[[1681,21]]},"265":{"position":[[2795,21]]},"267":{"position":[[2587,21],[8212,21]]},"273":{"position":[[3812,21],[9603,21],[15482,21],[21088,21]]},"282":{"position":[[2836,21]]},"284":{"position":[[2560,21]]},"294":{"position":[[1653,21]]},"329":{"position":[[2665,21],[8248,21],[14475,21]]},"353":{"position":[[2656,21],[8264,21]]},"359":{"position":[[2962,21],[8951,21],[14765,21]]},"375":{"position":[[2704,21]]},"382":{"position":[[3629,21]]},"406":{"position":[[3096,21],[9396,21]]},"408":{"position":[[3218,21]]},"410":{"position":[[2490,21]]},"446":{"position":[[2662,21]]},"448":{"position":[[2604,21],[8443,21]]},"482":{"position":[[2662,21],[8294,21]]},"486":{"position":[[2624,21],[8423,21]]},"504":{"position":[[2609,21]]},"506":{"position":[[2771,21]]},"508":{"position":[[2677,21]]},"522":{"position":[[2899,21]]},"524":{"position":[[2801,21]]},"540":{"position":[[2622,21]]},"542":{"position":[[3109,21]]},"544":{"position":[[2741,21]]},"556":{"position":[[2862,21]]},"560":{"position":[[2861,21]]},"562":{"position":[[2717,21]]},"564":{"position":[[2472,21],[7986,21]]},"566":{"position":[[2584,21],[8048,21]]},"581":{"position":[[2651,21]]},"588":{"position":[[3043,21],[9141,21],[15142,21]]},"590":{"position":[[3010,21]]},"595":{"position":[[2747,21],[8659,21]]},"600":{"position":[[2862,21]]},"619":{"position":[[3083,21]]},"621":{"position":[[2617,21]]},"627":{"position":[[3065,21]]},"629":{"position":[[2530,21]]},"631":{"position":[[2718,21],[8571,21],[14210,21]]},"649":{"position":[[3784,21],[9956,21],[16783,21],[23614,21],[29852,21]]},"651":{"position":[[3759,21],[10014,21],[16354,21],[22677,21]]},"669":{"position":[[7363,21]]},"671":{"position":[[3810,21]]},"691":{"position":[[3176,21],[9326,21],[15321,21],[21011,21],[26635,21]]},"701":{"position":[[3475,21],[9091,21]]},"703":{"position":[[2768,21],[8489,21]]},"705":{"position":[[2786,21],[9129,21],[15393,21],[21415,21],[27074,21]]},"726":{"position":[[4665,21],[14886,21],[22883,21],[30665,21],[36426,21],[42049,21],[47693,21]]},"728":{"position":[[2709,21],[10620,21],[16555,21],[26995,21],[35225,21],[44785,21]]},"745":{"position":[[4321,21],[9926,21],[15695,21],[21257,21],[26885,21],[34617,21],[40243,21]]},"747":{"position":[[5367,21],[12089,21]]},"749":{"position":[[2843,21],[9148,21],[14848,21]]},"751":{"position":[[5719,21],[12305,21],[19854,21]]},"761":{"position":[[6313,21]]},"767":{"position":[[2836,21],[8532,21],[14456,21],[20161,21]]},"769":{"position":[[6943,21],[13817,21],[21811,21],[28238,21]]},"771":{"position":[[4118,21],[11290,21],[18218,21]]},"773":{"position":[[10025,21]]},"795":{"position":[[3005,21],[8661,21],[14749,21],[21492,21],[27187,21]]},"797":{"position":[[6000,21],[12826,21]]},"799":{"position":[[5563,21],[12596,21],[19998,21]]},"801":{"position":[[5941,21],[12700,21]]},"821":{"position":[[4680,21],[10472,21],[16391,21],[22140,21],[27897,21],[34847,21],[41844,21]]},"823":{"position":[[2546,21],[9826,21]]},"825":{"position":[[9957,21],[17263,21],[23853,21],[30517,21],[36828,21],[42681,21],[48473,21],[54174,21]]},"844":{"position":[[4328,21],[9957,21],[15740,21],[21295,21],[26917,21],[34135,21],[39755,21]]},"846":{"position":[[5422,21],[12765,21]]},"848":{"position":[[4895,21],[11684,21]]},"850":{"position":[[6173,21],[13356,21],[19118,21],[24819,21],[30607,21],[36304,21]]}}}],["clientcreatestorerequest(){nam",{"_index":576,"t":{"43":{"position":[[2215,31]]}}}],["clientcredentialsapiaudi",{"_index":1460,"t":{"219":{"position":[[2106,29]]}}}],["clientcredentialsapitokenissu",{"_index":1462,"t":{"219":{"position":[[2167,32]]}}}],["clientcredentialsclientid",{"_index":1456,"t":{"219":{"position":[[1988,26]]}}}],["clientcredentialsclientsecret",{"_index":1458,"t":{"219":{"position":[[2043,30]]}}}],["clientexpandopt",{"_index":2133,"t":{"595":{"position":[[1964,20],[7876,20]]}}}],["clientexpandrequest",{"_index":2134,"t":{"595":{"position":[[2067,20],[3499,19],[4715,20],[7979,20],[9411,19],[10627,20]]}}}],["clientid",{"_index":451,"t":{"37":{"position":[[792,8],[1972,8],[3634,8],[5346,8]]},"169":{"position":[[12347,8],[13191,8],[14322,8],[15660,8],[18541,8],[19385,8],[20516,8],[21854,8],[24895,8],[25760,8],[26945,8],[28325,8]]},"219":{"position":[[1088,9],[3357,8]]},"236":{"position":[[178,8],[977,8],[2218,8],[3580,8]]},"238":{"position":[[188,8],[1029,8],[2157,8],[3492,8],[5932,8],[6775,8],[7905,8],[9242,8]]},"265":{"position":[[488,8],[1319,8],[2437,8],[3762,8]]},"267":{"position":[[199,8],[993,8],[2229,8],[3586,8],[5903,8],[6735,8],[7854,8],[9180,8]]},"273":{"position":[[1493,8],[2330,8],[3454,8],[4785,8],[7131,8],[7967,8],[9245,8],[10644,8],[13155,8],[13996,8],[15124,8],[16459,8],[18757,8],[19600,8],[20730,8],[22067,8]]},"282":{"position":[[440,8],[1238,8],[2478,8],[3839,8]]},"284":{"position":[[231,8],[1073,8],[2202,8],[3538,8]]},"329":{"position":[[285,8],[1075,8],[2307,8],[3660,8],[5866,8],[6657,8],[7890,8],[9244,8],[11680,8],[12640,8],[14117,8],[15677,8]]},"353":{"position":[[327,8],[1169,8],[2298,8],[3634,8],[5937,8],[6778,8],[7906,8],[9241,8]]},"359":{"position":[[446,8],[1304,8],[2604,8],[4025,8],[6622,8],[7464,8],[8593,8],[9929,8],[12436,8],[13278,8],[14407,8],[15743,8]]},"375":{"position":[[361,8],[1210,8],[2346,8],[3689,8]]},"382":{"position":[[1306,8],[2145,8],[3271,8],[4604,8]]},"406":{"position":[[309,8],[1273,8],[2738,8],[4275,8],[7063,8],[7907,8],[9038,8],[10376,8]]},"408":{"position":[[211,8],[1285,8],[2860,8],[4507,8]]},"410":{"position":[[157,8],[1001,8],[2132,8],[3470,8]]},"446":{"position":[[240,8],[1051,8],[2304,8],[3678,8]]},"448":{"position":[[261,8],[1110,8],[2246,8],[3589,8],[6098,8],[6948,8],[8085,8],[9429,8]]},"482":{"position":[[327,8],[1172,8],[2304,8],[3643,8],[5961,8],[6805,8],[7936,8],[9274,8]]},"486":{"position":[[287,8],[1133,8],[2266,8],[3606,8],[6086,8],[6932,8],[8065,8],[9405,8]]},"504":{"position":[[215,8],[1012,8],[2251,8],[3611,8]]},"506":{"position":[[217,8],[1094,8],[2413,8],[3853,8]]},"508":{"position":[[334,8],[1183,8],[2319,8],[3662,8]]},"522":{"position":[[401,8],[1250,8],[2541,8],[3953,8]]},"524":{"position":[[466,8],[1311,8],[2443,8],[3782,8]]},"540":{"position":[[224,8],[1023,8],[2264,8],[3626,8]]},"542":{"position":[[557,8],[1433,8],[2751,8],[4190,8]]},"544":{"position":[[394,8],[1245,8],[2383,8],[3728,8]]},"556":{"position":[[303,8],[1153,8],[2504,8],[3927,8]]},"560":{"position":[[310,8],[1156,8],[2503,8],[3922,8]]},"562":{"position":[[321,8],[1119,8],[2359,8],[3720,8]]},"564":{"position":[[167,8],[997,8],[2114,8],[3438,8],[5681,8],[6511,8],[7628,8],[8952,8]]},"566":{"position":[[204,8],[994,8],[2226,8],[3579,8],[5741,8],[6572,8],[7690,8],[9015,8]]},"581":{"position":[[326,8],[1166,8],[2293,8],[3627,8]]},"588":{"position":[[576,8],[1461,8],[2685,8],[4072,8],[6732,8],[7598,8],[8783,8],[10149,8],[12713,8],[13589,8],[14784,8],[16160,8]]},"590":{"position":[[779,8],[1546,8],[2652,8],[3921,8]]},"595":{"position":[[317,8],[1196,8],[2389,8],[3785,8],[6229,8],[7108,8],[8301,8],[9697,8]]},"600":{"position":[[238,8],[1210,8],[2504,8],[4005,8]]},"619":{"position":[[453,8],[1368,8],[2725,8],[4203,8]]},"621":{"position":[[268,8],[1120,8],[2259,8],[3605,8]]},"627":{"position":[[178,8],[1192,8],[2707,8],[4294,8]]},"629":{"position":[[197,8],[1041,8],[2172,8],[3510,8]]},"631":{"position":[[178,8],[1048,8],[2360,8],[3793,8],[6236,8],[7081,8],[8213,8],[9552,8],[11869,8],[12717,8],[13852,8],[15194,8]]},"649":{"position":[[1457,8],[2298,8],[3426,8],[4761,8],[7629,8],[8470,8],[9598,8],[10933,8],[14450,8],[15294,8],[16425,8],[17763,8],[21287,8],[22128,8],[23256,8],[24591,8],[27523,8],[28365,8],[29494,8],[30830,8]]},"651":{"position":[[1430,8],[2272,8],[3401,8],[4737,8],[7679,8],[8524,8],[9656,8],[10995,8],[14023,8],[14866,8],[15996,8],[17333,8],[20346,8],[21189,8],[22319,8],[23656,8]]},"669":{"position":[[4829,8],[5696,8],[7005,8],[8435,8]]},"671":{"position":[[1220,8],[2115,8],[3452,8],[4910,8]]},"691":{"position":[[449,8],[1383,8],[2818,8],[4325,8],[6997,8],[7839,8],[8968,8],[10304,8],[12992,8],[13834,8],[14963,8],[16299,8],[18678,8],[19522,8],[20653,8],[21991,8],[24304,8],[25147,8],[26277,8],[27614,8]]},"701":{"position":[[1144,8],[1987,8],[3117,8],[4454,8],[6762,8],[7604,8],[8733,8],[10069,8]]},"703":{"position":[[268,8],[1118,8],[2410,8],[3823,8],[6152,8],[6998,8],[8131,8],[9471,8]]},"705":{"position":[[243,8],[1196,8],[2428,8],[3877,8],[6520,8],[7395,8],[8771,8],[10219,8],[12782,8],[13658,8],[15035,8],[16484,8],[19084,8],[19927,8],[21057,8],[22394,8],[24747,8],[25588,8],[26716,8],[28051,8]]},"726":{"position":[[282,8],[1926,8],[4307,8],[6564,8],[11600,8],[12784,8],[14528,8],[16295,8],[19737,8],[20851,8],[22525,8],[24222,8],[28336,8],[29178,8],[30307,8],[31643,8],[34095,8],[34938,8],[36068,8],[37405,8],[39712,8],[40558,8],[41691,8],[43031,8],[45354,8],[46201,8],[47335,8],[48676,8]]},"728":{"position":[[378,8],[1221,8],[2351,8],[3688,8],[8297,8],[9136,8],[10262,8],[11595,8],[14214,8],[15062,8],[16197,8],[17539,8],[24656,8],[25503,8],[26637,8],[27978,8],[32904,8],[33742,8],[34867,8],[36199,8],[42464,8],[43302,8],[44427,8],[45759,8]]},"745":{"position":[[1909,8],[2715,8],[3963,8],[5332,8],[7593,8],[8437,8],[9568,8],[10906,8],[13283,8],[14089,8],[15337,8],[16706,8],[18924,8],[19768,8],[20899,8],[22237,8],[24550,8],[25395,8],[26527,8],[27866,8],[32284,8],[33128,8],[34259,8],[35597,8],[37910,8],[38754,8],[39885,8],[41223,8]]},"747":{"position":[[2438,8],[3473,8],[5009,8],[6617,8],[9752,8],[10598,8],[11731,8],[13071,8]]},"749":{"position":[[383,8],[1213,8],[2485,8],[3878,8],[6624,8],[7486,8],[8790,8],[10215,8],[12515,8],[13359,8],[14490,8],[15828,8]]},"751":{"position":[[3080,8],[3970,8],[5361,8],[6824,8],[9964,8],[10812,8],[11947,8],[13289,8],[17398,8],[18226,8],[19496,8],[20887,8]]},"761":{"position":[[2686,8],[4011,8],[5955,8],[7873,8]]},"767":{"position":[[513,8],[1352,8],[2478,8],[3811,8],[6201,8],[7044,8],[8174,8],[9511,8],[11926,8],[12791,8],[14098,8],[15526,8],[17836,8],[18676,8],[19803,8],[21137,8]]},"769":{"position":[[4628,8],[5463,8],[6585,8],[7914,8],[10433,8],[11666,8],[13459,8],[15275,8],[18976,8],[19964,8],[21453,8],[23014,8],[25915,8],[26754,8],[27880,8],[29213,8]]},"771":{"position":[[1173,8],[2216,8],[3760,8],[5376,8],[8610,8],[9618,8],[10932,8],[12466,8],[15536,8],[16545,8],[17860,8],[19395,8]]},"773":{"position":[[3414,8],[5995,8],[9667,8],[12921,8]]},"795":{"position":[[595,8],[1400,8],[2647,8],[4015,8],[6243,8],[7052,8],[8303,8],[9675,8],[11927,8],[12879,8],[14391,8],[15926,8],[19161,8],[20004,8],[21134,8],[22471,8],[24860,8],[25701,8],[26829,8],[28164,8]]},"797":{"position":[[3013,8],[4018,8],[5642,8],[7240,8],[10489,8],[11335,8],[12468,8],[13808,8]]},"799":{"position":[[2918,8],[3811,8],[5205,8],[6671,8],[9443,8],[10531,8],[12238,8],[13919,8],[17673,8],[18513,8],[19640,8],[20974,8]]},"801":{"position":[[3113,8],[4068,8],[5583,8],[7121,8],[10365,8],[11210,8],[12342,8],[13681,8]]},"821":{"position":[[2152,8],[3016,8],[4322,8],[5749,8],[8129,8],[8978,8],[10114,8],[11457,8],[13863,8],[14727,8],[16033,8],[17460,8],[19797,8],[20646,8],[21782,8],[23125,8],[25540,8],[26396,8],[27539,8],[28889,8],[31701,8],[32815,8],[34489,8],[36186,8],[39501,8],[40350,8],[41486,8],[42829,8]]},"823":{"position":[[213,8],[1057,8],[2188,8],[3526,8],[7495,8],[8338,8],[9468,8],[10805,8]]},"825":{"position":[[6981,8],[8010,8],[9599,8],[11211,8],[14597,8],[15530,8],[16905,8],[18401,8],[21040,8],[22017,8],[23495,8],[25045,8],[27874,8],[28766,8],[30159,8],[31624,8],[34358,8],[35193,8],[36470,8],[37868,8],[40245,8],[41063,8],[42323,8],[43704,8],[46146,8],[46987,8],[48115,8],[49450,8],[51817,8],[52673,8],[53816,8],[55166,8]]},"844":{"position":[[1910,8],[2719,8],[3970,8],[5342,8],[7618,8],[8465,8],[9599,8],[10940,8],[13330,8],[14135,8],[15382,8],[16750,8],[18964,8],[19807,8],[20937,8],[22274,8],[24582,8],[25427,8],[26559,8],[27898,8],[31804,8],[32647,8],[33777,8],[35114,8],[37422,8],[38266,8],[39397,8],[40735,8]]},"846":{"position":[[2193,8],[3319,8],[5064,8],[6783,8],[10426,8],[11273,8],[12407,8],[13748,8]]},"848":{"position":[[2026,8],[3031,8],[4537,8],[6115,8],[9339,8],[10189,8],[11326,8],[12670,8]]},"850":{"position":[[2899,8],[4077,8],[5815,8],[7576,8],[11009,8],[11860,8],[12998,8],[14343,8],[16767,8],[17620,8],[18760,8],[20107,8],[22464,8],[23319,8],[24461,8],[25810,8],[28256,8],[29109,8],[30249,8],[31596,8],[33953,8],[34806,8],[35946,8],[37293,8]]}}}],["clientlistobjectsopt",{"_index":1019,"t":{"125":{"position":[[350,25],[734,24]]},"169":{"position":[[26528,25],[27962,24]]},"236":{"position":[[3235,24]]},"250":{"position":[[705,24]]},"252":{"position":[[862,24]]},"267":{"position":[[3246,24]]},"273":{"position":[[10262,24]]},"282":{"position":[[3495,24]]},"329":{"position":[[3324,24],[8907,24],[15134,24]]},"359":{"position":[[3621,24]]},"406":{"position":[[3755,24]]},"408":{"position":[[3877,24]]},"446":{"position":[[3321,24]]},"466":{"position":[[1863,24]]},"504":{"position":[[3268,24]]},"506":{"position":[[3430,24]]},"522":{"position":[[3558,24]]},"540":{"position":[[3281,24]]},"542":{"position":[[3768,24]]},"556":{"position":[[3521,24]]},"560":{"position":[[3520,24]]},"562":{"position":[[3376,24]]},"566":{"position":[[3243,24]]},"600":{"position":[[1978,25],[3521,24]]},"619":{"position":[[3742,24]]},"627":{"position":[[3724,24]]},"631":{"position":[[3377,24]]},"661":{"position":[[5783,24]]},"669":{"position":[[8022,24]]},"671":{"position":[[4469,24]]},"673":{"position":[[5322,24]]},"691":{"position":[[3835,24]]},"703":{"position":[[3427,24]]},"705":{"position":[[9788,24],[16052,24]]},"726":{"position":[[5324,24],[15545,24],[23542,24]]},"745":{"position":[[4980,24],[16354,24]]},"747":{"position":[[6026,24]]},"749":{"position":[[3502,24],[9807,24]]},"751":{"position":[[6378,24],[20513,24]]},"761":{"position":[[6972,24]]},"767":{"position":[[15115,24]]},"769":{"position":[[14476,24],[22470,24]]},"771":{"position":[[4777,24]]},"773":{"position":[[10684,24]]},"795":{"position":[[3664,24],[9320,24],[15408,24]]},"797":{"position":[[6659,24]]},"799":{"position":[[6222,24],[13255,24]]},"801":{"position":[[6600,24]]},"821":{"position":[[5339,24],[17050,24],[35506,24]]},"825":{"position":[[10616,24],[17922,24],[24512,24],[31176,24],[37487,24],[43340,24]]},"844":{"position":[[4987,24],[16399,24]]},"846":{"position":[[6081,24]]},"848":{"position":[[5554,24]]},"850":{"position":[[6832,24]]}}}],["clientlistobjectsrequest",{"_index":1020,"t":{"125":{"position":[[458,25],[833,24],[1124,25]]},"169":{"position":[[26636,25],[28061,24],[29255,25]]},"600":{"position":[[2086,25],[3620,24],[4935,25]]}}}],["clientreadchangesopt",{"_index":1573,"t":{"296":{"position":[[241,25],[532,24],[684,24],[1741,25],[2170,24],[2442,24]]},"298":{"position":[[1232,25],[1555,24],[1715,24],[2597,25],[3058,24],[3338,24]]}}}],["clientreadchangesrequest",{"_index":1575,"t":{"296":{"position":[[309,25],[484,24],[643,26],[1947,25],[2122,24],[2401,26]]},"298":{"position":[[1300,25],[1491,24],[2803,25],[2994,24]]}}}],["clientreadchangesrequest(\"fold",{"_index":1594,"t":{"298":{"position":[[1666,34],[3289,34]]}}}],["clientreadopt",{"_index":2106,"t":{"588":{"position":[[2229,19],[3702,17],[8366,19],[9800,17],[14357,19],[15801,17]]},"590":{"position":[[2314,19],[3669,17]]},"705":{"position":[[1964,19],[3445,17]]}}}],["clientreadrequest",{"_index":2107,"t":{"588":{"position":[[2257,18],[3738,19],[8394,18],[9836,19],[14385,18],[15837,19]]},"590":{"position":[[2342,18],[3705,19]]},"705":{"position":[[1992,18],[3481,19]]}}}],["clientsecret",{"_index":452,"t":{"37":{"position":[[805,12],[1985,12],[3647,12],[5359,12]]},"169":{"position":[[12360,12],[13204,12],[14335,12],[15673,12],[18554,12],[19398,12],[20529,12],[21867,12],[24908,12],[25773,12],[26958,12],[28338,12]]},"219":{"position":[[1125,13],[3421,12]]},"236":{"position":[[191,12],[990,12],[2231,12],[3593,12]]},"238":{"position":[[201,12],[1042,12],[2170,12],[3505,12],[5945,12],[6788,12],[7918,12],[9255,12]]},"265":{"position":[[501,12],[1332,12],[2450,12],[3775,12]]},"267":{"position":[[212,12],[1006,12],[2242,12],[3599,12],[5916,12],[6748,12],[7867,12],[9193,12]]},"273":{"position":[[1506,12],[2343,12],[3467,12],[4798,12],[7144,12],[7980,12],[9258,12],[10657,12],[13168,12],[14009,12],[15137,12],[16472,12],[18770,12],[19613,12],[20743,12],[22080,12]]},"282":{"position":[[453,12],[1251,12],[2491,12],[3852,12]]},"284":{"position":[[244,12],[1086,12],[2215,12],[3551,12]]},"329":{"position":[[298,12],[1088,12],[2320,12],[3673,12],[5879,12],[6670,12],[7903,12],[9257,12],[11693,12],[12653,12],[14130,12],[15690,12]]},"353":{"position":[[340,12],[1182,12],[2311,12],[3647,12],[5950,12],[6791,12],[7919,12],[9254,12]]},"359":{"position":[[459,12],[1317,12],[2617,12],[4038,12],[6635,12],[7477,12],[8606,12],[9942,12],[12449,12],[13291,12],[14420,12],[15756,12]]},"375":{"position":[[374,12],[1223,12],[2359,12],[3702,12]]},"382":{"position":[[1319,12],[2158,12],[3284,12],[4617,12]]},"406":{"position":[[322,12],[1286,12],[2751,12],[4288,12],[7076,12],[7920,12],[9051,12],[10389,12]]},"408":{"position":[[224,12],[1298,12],[2873,12],[4520,12]]},"410":{"position":[[170,12],[1014,12],[2145,12],[3483,12]]},"446":{"position":[[253,12],[1064,12],[2317,12],[3691,12]]},"448":{"position":[[274,12],[1123,12],[2259,12],[3602,12],[6111,12],[6961,12],[8098,12],[9442,12]]},"482":{"position":[[340,12],[1185,12],[2317,12],[3656,12],[5974,12],[6818,12],[7949,12],[9287,12]]},"486":{"position":[[300,12],[1146,12],[2279,12],[3619,12],[6099,12],[6945,12],[8078,12],[9418,12]]},"504":{"position":[[228,12],[1025,12],[2264,12],[3624,12]]},"506":{"position":[[230,12],[1107,12],[2426,12],[3866,12]]},"508":{"position":[[347,12],[1196,12],[2332,12],[3675,12]]},"522":{"position":[[414,12],[1263,12],[2554,12],[3966,12]]},"524":{"position":[[479,12],[1324,12],[2456,12],[3795,12]]},"540":{"position":[[237,12],[1036,12],[2277,12],[3639,12]]},"542":{"position":[[570,12],[1446,12],[2764,12],[4203,12]]},"544":{"position":[[407,12],[1258,12],[2396,12],[3741,12]]},"556":{"position":[[316,12],[1166,12],[2517,12],[3940,12]]},"560":{"position":[[323,12],[1169,12],[2516,12],[3935,12]]},"562":{"position":[[334,12],[1132,12],[2372,12],[3733,12]]},"564":{"position":[[180,12],[1010,12],[2127,12],[3451,12],[5694,12],[6524,12],[7641,12],[8965,12]]},"566":{"position":[[217,12],[1007,12],[2239,12],[3592,12],[5754,12],[6585,12],[7703,12],[9028,12]]},"581":{"position":[[339,12],[1179,12],[2306,12],[3640,12]]},"588":{"position":[[589,12],[1474,12],[2698,12],[4085,12],[6745,12],[7611,12],[8796,12],[10162,12],[12726,12],[13602,12],[14797,12],[16173,12]]},"590":{"position":[[792,12],[1559,12],[2665,12],[3934,12]]},"595":{"position":[[330,12],[1209,12],[2402,12],[3798,12],[6242,12],[7121,12],[8314,12],[9710,12]]},"600":{"position":[[251,12],[1223,12],[2517,12],[4018,12]]},"619":{"position":[[466,12],[1381,12],[2738,12],[4216,12]]},"621":{"position":[[281,12],[1133,12],[2272,12],[3618,12]]},"627":{"position":[[191,12],[1205,12],[2720,12],[4307,12]]},"629":{"position":[[210,12],[1054,12],[2185,12],[3523,12]]},"631":{"position":[[191,12],[1061,12],[2373,12],[3806,12],[6249,12],[7094,12],[8226,12],[9565,12],[11882,12],[12730,12],[13865,12],[15207,12]]},"649":{"position":[[1470,12],[2311,12],[3439,12],[4774,12],[7642,12],[8483,12],[9611,12],[10946,12],[14463,12],[15307,12],[16438,12],[17776,12],[21300,12],[22141,12],[23269,12],[24604,12],[27536,12],[28378,12],[29507,12],[30843,12]]},"651":{"position":[[1443,12],[2285,12],[3414,12],[4750,12],[7692,12],[8537,12],[9669,12],[11008,12],[14036,12],[14879,12],[16009,12],[17346,12],[20359,12],[21202,12],[22332,12],[23669,12]]},"669":{"position":[[4842,12],[5709,12],[7018,12],[8448,12]]},"671":{"position":[[1233,12],[2128,12],[3465,12],[4923,12]]},"691":{"position":[[462,12],[1396,12],[2831,12],[4338,12],[7010,12],[7852,12],[8981,12],[10317,12],[13005,12],[13847,12],[14976,12],[16312,12],[18691,12],[19535,12],[20666,12],[22004,12],[24317,12],[25160,12],[26290,12],[27627,12]]},"701":{"position":[[1157,12],[2000,12],[3130,12],[4467,12],[6775,12],[7617,12],[8746,12],[10082,12]]},"703":{"position":[[281,12],[1131,12],[2423,12],[3836,12],[6165,12],[7011,12],[8144,12],[9484,12]]},"705":{"position":[[256,12],[1209,12],[2441,12],[3890,12],[6533,12],[7408,12],[8784,12],[10232,12],[12795,12],[13671,12],[15048,12],[16497,12],[19097,12],[19940,12],[21070,12],[22407,12],[24760,12],[25601,12],[26729,12],[28064,12]]},"726":{"position":[[295,12],[1939,12],[4320,12],[6577,12],[11613,12],[12797,12],[14541,12],[16308,12],[19750,12],[20864,12],[22538,12],[24235,12],[28349,12],[29191,12],[30320,12],[31656,12],[34108,12],[34951,12],[36081,12],[37418,12],[39725,12],[40571,12],[41704,12],[43044,12],[45367,12],[46214,12],[47348,12],[48689,12]]},"728":{"position":[[391,12],[1234,12],[2364,12],[3701,12],[8310,12],[9149,12],[10275,12],[11608,12],[14227,12],[15075,12],[16210,12],[17552,12],[24669,12],[25516,12],[26650,12],[27991,12],[32917,12],[33755,12],[34880,12],[36212,12],[42477,12],[43315,12],[44440,12],[45772,12]]},"745":{"position":[[1922,12],[2728,12],[3976,12],[5345,12],[7606,12],[8450,12],[9581,12],[10919,12],[13296,12],[14102,12],[15350,12],[16719,12],[18937,12],[19781,12],[20912,12],[22250,12],[24563,12],[25408,12],[26540,12],[27879,12],[32297,12],[33141,12],[34272,12],[35610,12],[37923,12],[38767,12],[39898,12],[41236,12]]},"747":{"position":[[2451,12],[3486,12],[5022,12],[6630,12],[9765,12],[10611,12],[11744,12],[13084,12]]},"749":{"position":[[396,12],[1226,12],[2498,12],[3891,12],[6637,12],[7499,12],[8803,12],[10228,12],[12528,12],[13372,12],[14503,12],[15841,12]]},"751":{"position":[[3093,12],[3983,12],[5374,12],[6837,12],[9977,12],[10825,12],[11960,12],[13302,12],[17411,12],[18239,12],[19509,12],[20900,12]]},"761":{"position":[[2699,12],[4024,12],[5968,12],[7886,12]]},"767":{"position":[[526,12],[1365,12],[2491,12],[3824,12],[6214,12],[7057,12],[8187,12],[9524,12],[11939,12],[12804,12],[14111,12],[15539,12],[17849,12],[18689,12],[19816,12],[21150,12]]},"769":{"position":[[4641,12],[5476,12],[6598,12],[7927,12],[10446,12],[11679,12],[13472,12],[15288,12],[18989,12],[19977,12],[21466,12],[23027,12],[25928,12],[26767,12],[27893,12],[29226,12]]},"771":{"position":[[1186,12],[2229,12],[3773,12],[5389,12],[8623,12],[9631,12],[10945,12],[12479,12],[15549,12],[16558,12],[17873,12],[19408,12]]},"773":{"position":[[3427,12],[6008,12],[9680,12],[12934,12]]},"795":{"position":[[608,12],[1413,12],[2660,12],[4028,12],[6256,12],[7065,12],[8316,12],[9688,12],[11940,12],[12892,12],[14404,12],[15939,12],[19174,12],[20017,12],[21147,12],[22484,12],[24873,12],[25714,12],[26842,12],[28177,12]]},"797":{"position":[[3026,12],[4031,12],[5655,12],[7253,12],[10502,12],[11348,12],[12481,12],[13821,12]]},"799":{"position":[[2931,12],[3824,12],[5218,12],[6684,12],[9456,12],[10544,12],[12251,12],[13932,12],[17686,12],[18526,12],[19653,12],[20987,12]]},"801":{"position":[[3126,12],[4081,12],[5596,12],[7134,12],[10378,12],[11223,12],[12355,12],[13694,12]]},"821":{"position":[[2165,12],[3029,12],[4335,12],[5762,12],[8142,12],[8991,12],[10127,12],[11470,12],[13876,12],[14740,12],[16046,12],[17473,12],[19810,12],[20659,12],[21795,12],[23138,12],[25553,12],[26409,12],[27552,12],[28902,12],[31714,12],[32828,12],[34502,12],[36199,12],[39514,12],[40363,12],[41499,12],[42842,12]]},"823":{"position":[[226,12],[1070,12],[2201,12],[3539,12],[7508,12],[8351,12],[9481,12],[10818,12]]},"825":{"position":[[6994,12],[8023,12],[9612,12],[11224,12],[14610,12],[15543,12],[16918,12],[18414,12],[21053,12],[22030,12],[23508,12],[25058,12],[27887,12],[28779,12],[30172,12],[31637,12],[34371,12],[35206,12],[36483,12],[37881,12],[40258,12],[41076,12],[42336,12],[43717,12],[46159,12],[47000,12],[48128,12],[49463,12],[51830,12],[52686,12],[53829,12],[55179,12]]},"844":{"position":[[1923,12],[2732,12],[3983,12],[5355,12],[7631,12],[8478,12],[9612,12],[10953,12],[13343,12],[14148,12],[15395,12],[16763,12],[18977,12],[19820,12],[20950,12],[22287,12],[24595,12],[25440,12],[26572,12],[27911,12],[31817,12],[32660,12],[33790,12],[35127,12],[37435,12],[38279,12],[39410,12],[40748,12]]},"846":{"position":[[2206,12],[3332,12],[5077,12],[6796,12],[10439,12],[11286,12],[12420,12],[13761,12]]},"848":{"position":[[2039,12],[3044,12],[4550,12],[6128,12],[9352,12],[10202,12],[11339,12],[12683,12]]},"850":{"position":[[2912,12],[4090,12],[5828,12],[7589,12],[11022,12],[11873,12],[13011,12],[14356,12],[16780,12],[17633,12],[18773,12],[20120,12],[22477,12],[23332,12],[24474,12],[25823,12],[28269,12],[29122,12],[30262,12],[31609,12],[33966,12],[34819,12],[35959,12],[37306,12]]}}}],["clienttupl",{"_index":1503,"t":{"236":{"position":[[4546,12]]},"250":{"position":[[1110,12]]},"252":{"position":[[1270,12]]},"267":{"position":[[4554,12]]},"273":{"position":[[11610,12]]},"282":{"position":[[4807,12]]},"329":{"position":[[4626,12],[10212,12],[16643,12],[16774,12]]},"359":{"position":[[4991,12]]},"406":{"position":[[5241,12],[5367,12]]},"408":{"position":[[5473,12],[5653,12]]},"446":{"position":[[4644,12]]},"466":{"position":[[2285,12]]},"504":{"position":[[4577,12]]},"506":{"position":[[4819,12]]},"522":{"position":[[4919,12]]},"540":{"position":[[4592,12]]},"542":{"position":[[5156,12]]},"556":{"position":[[4893,12],[4962,12]]},"560":{"position":[[4888,12],[4955,12]]},"562":{"position":[[4686,12]]},"566":{"position":[[4547,12]]},"619":{"position":[[5169,12]]},"627":{"position":[[5260,12],[5399,12]]},"631":{"position":[[4761,12]]},"661":{"position":[[7056,12],[7197,12],[7338,12],[7479,12],[7620,12],[7761,12],[7870,12]]},"669":{"position":[[9401,12]]},"671":{"position":[[5878,12]]},"673":{"position":[[6595,12],[6736,12],[6877,12],[7018,12],[7159,12],[7300,12],[7409,12]]},"691":{"position":[[5291,12],[5400,12]]},"703":{"position":[[4789,12]]},"705":{"position":[[11185,12],[11265,12],[17452,12],[17532,12]]},"726":{"position":[[7530,12],[7678,12],[7826,12],[7990,12],[8150,12],[8326,12],[17261,12],[17416,12],[17575,12],[25188,12],[25326,12],[25455,12]]},"745":{"position":[[6298,12],[17672,12]]},"747":{"position":[[7583,12],[7730,12]]},"749":{"position":[[4844,12],[11181,12]]},"751":{"position":[[7790,12],[7874,12],[21853,12]]},"761":{"position":[[8839,12],[8982,12],[9131,12],[9316,12]]},"767":{"position":[[16492,12]]},"769":{"position":[[16241,12],[16403,12],[16564,12],[23980,12],[24136,12]]},"771":{"position":[[6344,12],[6527,12]]},"773":{"position":[[13887,12],[14030,12],[14179,12],[14364,12],[14516,12],[14674,12],[14834,12],[14996,12],[15158,12],[15319,12],[15479,12],[15639,12]]},"795":{"position":[[4981,12],[10641,12],[16892,12],[16975,12],[17062,12]]},"797":{"position":[[8206,12],[8286,12],[8360,12],[8443,12]]},"799":{"position":[[7637,12],[7731,12],[14885,12],[14990,12],[15095,12],[15188,12]]},"801":{"position":[[8087,12],[8171,12],[8259,12]]},"821":{"position":[[6715,12],[18426,12],[37152,12],[37297,12],[37428,12]]},"825":{"position":[[12177,12],[12277,12],[12388,12],[19367,12],[26011,12],[26195,12],[32590,12],[32679,12],[38834,12],[44670,12]]},"844":{"position":[[6308,12],[17716,12]]},"846":{"position":[[7749,12],[7877,12],[7951,12],[8028,12]]},"848":{"position":[[7081,12],[7214,12]]},"850":{"position":[[8542,12],[8685,12],[8860,12]]}}}],["clienttuplekey",{"_index":1495,"t":{"236":{"position":[[1885,18]]},"250":{"position":[[408,18]]},"252":{"position":[[565,18]]},"267":{"position":[[1902,18]]},"273":{"position":[[8875,18]]},"282":{"position":[[2147,18]]},"329":{"position":[[1983,18],[7566,18],[13548,18],[13744,18]]},"359":{"position":[[2212,18]]},"406":{"position":[[2181,18]]},"408":{"position":[[2193,18]]},"446":{"position":[[1959,18]]},"466":{"position":[[1549,18]]},"504":{"position":[[1920,18]]},"506":{"position":[[2002,18]]},"522":{"position":[[2158,18]]},"540":{"position":[[1931,18]]},"542":{"position":[[2341,18]]},"556":{"position":[[2061,18]]},"560":{"position":[[2064,18]]},"562":{"position":[[2027,18]]},"566":{"position":[[1903,18]]},"600":{"position":[[2186,18]]},"619":{"position":[[2276,18]]},"627":{"position":[[2100,18]]},"631":{"position":[[1957,18]]},"661":{"position":[[4324,18]]},"669":{"position":[[6604,18]]},"671":{"position":[[3024,18],[7809,18],[10481,18]]},"673":{"position":[[3863,18]]},"691":{"position":[[2291,18]]},"703":{"position":[[2026,18]]},"705":{"position":[[8303,18],[14567,18]]},"726":{"position":[[2834,18],[13692,18],[21759,18]]},"745":{"position":[[3623,18],[14997,18]]},"747":{"position":[[4381,18]]},"749":{"position":[[2121,18],[8394,18]]},"751":{"position":[[4878,18],[19134,18]]},"761":{"position":[[4919,18]]},"767":{"position":[[13699,18]]},"769":{"position":[[12574,18],[20872,18]]},"771":{"position":[[3125,18],[10592,18],[17519,18]]},"773":{"position":[[6903,18]]},"795":{"position":[[2308,18],[7960,18],[13787,18]]},"797":{"position":[[4926,18]]},"799":{"position":[[4719,18],[11439,18]]},"801":{"position":[[4976,18]]},"821":{"position":[[3924,18],[15635,18],[33723,18]]},"825":{"position":[[8918,18],[16438,18],[22925,18],[29674,18],[36101,18],[41971,18]]},"844":{"position":[[3627,18],[15043,18]]},"846":{"position":[[4227,18]]},"848":{"position":[[3939,18]]},"850":{"position":[[4985,18]]}}}],["clienttuplekey(user=\"user:ann",{"_index":2306,"t":{"671":{"position":[[8612,32],[11286,32]]},"771":{"position":[[13499,32],[13589,32],[20428,32],[20518,32]]}}}],["clienttuplekey(user=\"user:bob",{"_index":2149,"t":{"600":{"position":[[5034,31]]}}}],["clientwriteopt",{"_index":1493,"t":{"236":{"position":[[1745,19]]},"250":{"position":[[268,19]]},"252":{"position":[[424,19]]},"267":{"position":[[1761,19]]},"273":{"position":[[8735,19]]},"282":{"position":[[2006,19]]},"329":{"position":[[1843,19],[7425,19],[13408,19]]},"359":{"position":[[2072,19]]},"406":{"position":[[2041,19]]},"408":{"position":[[2053,19]]},"446":{"position":[[1819,19]]},"466":{"position":[[1409,19]]},"504":{"position":[[1780,19]]},"506":{"position":[[1862,19]]},"522":{"position":[[2018,19]]},"540":{"position":[[1791,19]]},"542":{"position":[[2201,19]]},"556":{"position":[[1921,19]]},"560":{"position":[[1924,19]]},"562":{"position":[[1887,19]]},"566":{"position":[[1762,19]]},"619":{"position":[[2136,19]]},"627":{"position":[[1960,19]]},"631":{"position":[[1816,19]]},"661":{"position":[[4184,19]]},"669":{"position":[[6464,19]]},"671":{"position":[[2883,19]]},"673":{"position":[[3723,19]]},"691":{"position":[[2151,19]]},"703":{"position":[[1886,19]]},"705":{"position":[[8163,19],[14426,19]]},"726":{"position":[[2694,19],[13552,19],[21619,19]]},"745":{"position":[[3483,19],[14857,19]]},"747":{"position":[[4241,19]]},"749":{"position":[[1981,19],[8254,19]]},"751":{"position":[[4738,19],[18994,19]]},"761":{"position":[[4779,19]]},"767":{"position":[[13559,19]]},"769":{"position":[[12434,19],[20732,19]]},"771":{"position":[[2984,19]]},"773":{"position":[[6763,19]]},"795":{"position":[[2168,19],[7820,19],[13647,19]]},"797":{"position":[[4786,19]]},"799":{"position":[[4579,19],[11299,19]]},"801":{"position":[[4836,19]]},"821":{"position":[[3784,19],[15495,19],[33583,19]]},"825":{"position":[[8778,19],[16298,19],[22785,19],[29534,19],[35961,19],[41831,19]]},"844":{"position":[[3487,19],[14903,19]]},"846":{"position":[[4087,19]]},"848":{"position":[[3799,19]]},"850":{"position":[[4845,19]]}}}],["clientwriterequest",{"_index":1500,"t":{"236":{"position":[[3334,20],[4517,19]]},"250":{"position":[[804,20],[1081,19]]},"252":{"position":[[961,20],[1239,19]]},"267":{"position":[[3345,20],[4523,19]]},"273":{"position":[[10361,20],[11581,19]]},"282":{"position":[[3594,20],[4776,19]]},"329":{"position":[[3423,20],[4597,19],[9006,20],[10181,19],[15233,20],[16614,19]]},"359":{"position":[[3720,20],[4962,19]]},"406":{"position":[[3854,20],[5212,19]]},"408":{"position":[[3976,20],[5444,19]]},"446":{"position":[[3420,20],[4615,19]]},"466":{"position":[[1962,20],[2256,19]]},"504":{"position":[[3367,20],[4548,19]]},"506":{"position":[[3529,20],[4790,19]]},"522":{"position":[[3657,20],[4890,19]]},"540":{"position":[[3380,20],[4563,19]]},"542":{"position":[[3867,20],[5127,19]]},"556":{"position":[[3620,20],[4864,19]]},"560":{"position":[[3619,20],[4859,19]]},"562":{"position":[[3475,20],[4657,19]]},"566":{"position":[[3342,20],[4516,19]]},"619":{"position":[[3841,20],[5140,19]]},"627":{"position":[[3823,20],[5231,19]]},"631":{"position":[[3476,20],[4730,19]]},"661":{"position":[[5882,20],[7027,19]]},"669":{"position":[[8121,20],[9372,19]]},"671":{"position":[[4568,20],[5847,19]]},"673":{"position":[[5421,20],[6566,19]]},"691":{"position":[[3934,20],[5262,19]]},"703":{"position":[[3526,20],[4760,19]]},"705":{"position":[[9887,20],[11156,19],[16151,20],[17421,19]]},"726":{"position":[[5423,20],[7501,19],[15644,20],[17232,19],[23641,20],[25159,19]]},"745":{"position":[[5079,20],[6269,19],[16453,20],[17643,19]]},"747":{"position":[[6125,20],[7554,19]]},"749":{"position":[[3601,20],[4815,19],[9906,20],[11152,19]]},"751":{"position":[[6477,20],[7761,19],[20612,20],[21824,19]]},"761":{"position":[[7071,20],[8810,19]]},"767":{"position":[[15214,20],[16463,19]]},"769":{"position":[[14575,20],[16212,19],[22569,20],[23951,19]]},"771":{"position":[[4876,20],[6313,19]]},"773":{"position":[[10783,20],[13858,19]]},"795":{"position":[[3763,20],[4952,19],[9419,20],[10612,19],[15507,20],[16863,19]]},"797":{"position":[[6758,20],[8177,19]]},"799":{"position":[[6321,20],[7608,19],[13354,20],[14856,19]]},"801":{"position":[[6699,20],[8058,19]]},"821":{"position":[[5438,20],[6686,19],[17149,20],[18397,19],[35605,20],[37123,19]]},"825":{"position":[[10715,20],[12148,19],[18021,20],[19338,19],[24611,20],[25982,19],[31275,20],[32561,19],[37586,20],[38805,19],[43439,20],[44641,19]]},"844":{"position":[[5086,20],[6279,19],[16498,20],[17687,19]]},"846":{"position":[[6180,20],[7720,19]]},"848":{"position":[[5653,20],[7052,19]]},"850":{"position":[[6931,20],[8513,19]]}}}],["close",{"_index":604,"t":{"45":{"position":[[476,7]]},"61":{"position":[[44,7]]},"131":{"position":[[1484,6]]},"169":{"position":[[3045,7]]},"215":{"position":[[3021,5]]},"217":{"position":[[4150,5]]},"219":{"position":[[4711,5]]},"728":{"position":[[22160,6]]}}}],["closer",{"_index":655,"t":{"49":{"position":[[1038,6]]}}}],["cloud",{"_index":369,"t":{"27":{"position":[[401,5]]}}}],["cmd",{"_index":1184,"t":{"145":{"position":[[1815,4],[4450,7]]}}}],["cncf",{"_index":385,"t":{"27":{"position":[[730,4]]}}}],["code",{"_index":179,"t":{"7":{"position":[[377,4]]},"9":{"position":[[125,4],[284,4]]},"27":{"position":[[645,4]]},"77":{"position":[[320,5],[1249,5]]},"145":{"position":[[1532,4],[4179,4]]},"169":{"position":[[784,4],[1582,4],[18191,5],[24539,5]]},"462":{"position":[[1668,4]]},"468":{"position":[[1033,4],[1164,4]]},"677":{"position":[[1671,4]]},"728":{"position":[[23269,4]]},"738":{"position":[[49,5]]}}}],["codifi",{"_index":1797,"t":{"416":{"position":[[1269,6]]},"418":{"position":[[41,9]]}}}],["collabor",{"_index":1864,"t":{"426":{"position":[[3148,11]]},"738":{"position":[[34,11]]},"837":{"position":[[46,11]]}}}],["collect",{"_index":1302,"t":{"157":{"position":[[26,9],[228,7]]},"159":{"position":[[20,9]]},"161":{"position":[[22,9]]},"380":{"position":[[30,10]]},"598":{"position":[[273,12]]}}}],["collector",{"_index":1305,"t":{"157":{"position":[[315,10]]}}}],["combin",{"_index":1344,"t":{"169":{"position":[[1480,11],[4196,11],[4595,11]]},"175":{"position":[[28,11]]},"426":{"position":[[9645,9]]},"490":{"position":[[306,8]]},"728":{"position":[[48002,12]]},"769":{"position":[[1088,7],[2406,7]]}}}],["come",{"_index":1779,"t":{"410":{"position":[[5700,4]]},"749":{"position":[[6287,4]]},"850":{"position":[[425,4]]}}}],["command",{"_index":842,"t":{"77":{"position":[[1763,7]]},"85":{"position":[[14,7]]},"131":{"position":[[290,8]]},"145":{"position":[[1016,7],[2003,8],[2474,8],[3703,7],[4674,8],[5105,8]]},"147":{"position":[[1410,8],[2930,7]]},"209":{"position":[[146,8]]}}}],["comment",{"_index":1343,"t":{"169":{"position":[[901,10],[1025,12],[1205,12],[1736,10],[2008,12],[2232,12],[6711,10],[6869,12],[7049,12],[7367,10]]},"377":{"position":[[142,10]]},"422":{"position":[[4498,7]]},"693":{"position":[[257,10]]},"831":{"position":[[541,10],[831,10]]},"839":{"position":[[188,10]]},"841":{"position":[[267,10],[498,7]]},"844":{"position":[[126,10],[477,10],[674,12],[897,12],[1747,9],[2556,12],[5186,12],[7267,9],[7477,9],[8287,12],[9384,12],[10761,12],[12306,9],[12991,12],[13014,11],[30512,10],[30565,9],[30810,12],[31003,11],[31194,12],[31630,11]]},"846":{"position":[[88,9],[547,10],[630,9],[919,12],[1112,11],[1391,12]]},"848":{"position":[[647,10],[730,9],[1001,12],[1194,11],[1546,12],[15102,9],[15280,11],[15749,13],[15813,11],[16689,10],[16735,9],[16797,9],[17381,12],[17538,11],[17686,11],[18173,12]]},"850":{"position":[[243,9],[735,10],[781,9],[851,9],[1435,12],[1592,11],[1740,11],[2227,12],[2717,10],[3681,7],[3760,12],[5232,7],[7169,7],[7256,12],[8730,7],[10196,9],[10539,7],[16648,7],[23133,12],[24238,12],[25623,12],[27184,9],[27885,12],[27908,11]]}}}],["common",{"_index":1663,"t":{"335":{"position":[[245,6]]},"426":{"position":[[1513,7],[7442,6]]}}}],["commonli",{"_index":1671,"t":{"345":{"position":[[590,8]]}}}],["commun",{"_index":388,"t":{"27":{"position":[[798,9]]},"145":{"position":[[606,13]]},"608":{"position":[[448,11]]},"807":{"position":[[54,13]]},"813":{"position":[[187,12]]},"827":{"position":[[110,13],[307,13]]}}}],["compani",{"_index":315,"t":{"19":{"position":[[603,7]]},"169":{"position":[[6429,7]]},"227":{"position":[[228,7],[353,7],[532,10],[843,10]]},"234":{"position":[[44,7],[214,7]]},"271":{"position":[[158,7]]},"402":{"position":[[383,7]]},"522":{"position":[[6830,7]]},"661":{"position":[[235,9],[278,9],[576,9]]},"755":{"position":[[488,7]]}}}],["company#employe",{"_index":1489,"t":{"227":{"position":[[434,18]]}}}],["company'",{"_index":1538,"t":{"271":{"position":[[202,9],[277,9]]}}}],["company:xyz",{"_index":1491,"t":{"236":{"position":[[62,12],[844,15],[3455,13],[5494,11]]},"238":{"position":[[5825,12]]},"380":{"position":[[593,11]]}}}],["company:xyz#employe",{"_index":1490,"t":{"234":{"position":[[259,23]]},"380":{"position":[[531,20]]}}}],["compar",{"_index":1203,"t":{"145":{"position":[[3092,8]]}}}],["compat",{"_index":1299,"t":{"155":{"position":[[1125,13]]},"701":{"position":[[57,10],[89,10]]},"703":{"position":[[30,10]]}}}],["compil",{"_index":610,"t":{"45":{"position":[[590,8]]},"77":{"position":[[1857,8]]},"87":{"position":[[17,8]]}}}],["complet",{"_index":1350,"t":{"169":{"position":[[3824,10]]},"300":{"position":[[469,10]]},"422":{"position":[[1958,8]]},"426":{"position":[[2753,8],[2783,8],[9122,8],[9152,8]]},"430":{"position":[[161,8]]},"728":{"position":[[19797,9],[23142,11]]}}}],["complex",{"_index":1595,"t":{"300":{"position":[[95,7]]},"420":{"position":[[250,7]]},"803":{"position":[[209,7]]},"821":{"position":[[61,11]]},"844":{"position":[[76,10]]}}}],["compon",{"_index":1825,"t":{"424":{"position":[[88,9]]}}}],["compos",{"_index":1168,"t":{"145":{"position":[[462,7],[2735,7],[3311,7],[5366,7]]},"169":{"position":[[31018,8]]}}}],["compose.yaml",{"_index":1179,"t":{"145":{"position":[[1575,12],[4222,12]]},"157":{"position":[[186,12]]}}}],["compris",{"_index":1675,"t":{"347":{"position":[[409,10]]}}}],["comput",{"_index":1397,"t":{"169":{"position":[[10098,9]]},"193":{"position":[[272,9]]},"384":{"position":[[1121,11]]},"595":{"position":[[6011,12]]},"671":{"position":[[421,7]]},"728":{"position":[[22731,9]]},"730":{"position":[[514,8]]}}}],["computed_userset",{"_index":732,"t":{"61":{"position":[[521,16],[645,16],[746,16]]}}}],["computeduserset",{"_index":629,"t":{"47":{"position":[[1094,18],[1285,18],[1438,18],[1580,18],[1701,18],[1842,18],[2416,18],[2607,18],[2760,18],[2902,18],[3023,18],[3164,18]]},"51":{"position":[[341,18],[410,18]]},"53":{"position":[[967,18],[1705,18]]},"55":{"position":[[338,18]]},"57":{"position":[[357,18],[415,18]]},"59":{"position":[[443,18]]},"61":{"position":[[1217,18],[1321,18],[1428,18],[2027,18],[2134,18]]},"169":{"position":[[11535,18]]},"357":{"position":[[673,18]]},"373":{"position":[[438,18]]},"384":{"position":[[365,18]]},"392":{"position":[[769,18]]},"404":{"position":[[623,18]]},"456":{"position":[[2246,18],[2619,18],[2754,18]]},"460":{"position":[[2057,18],[2473,18],[2608,18]]},"474":{"position":[[1050,18]]},"484":{"position":[[581,18],[689,18],[823,18]]},"502":{"position":[[695,18]]},"558":{"position":[[466,18]]},"572":{"position":[[652,18]]},"625":{"position":[[542,18]]},"645":{"position":[[593,18]]},"649":{"position":[[404,18]]},"651":{"position":[[394,18]]},"661":{"position":[[1934,18],[2113,18],[2259,18],[2332,18],[2416,18],[2492,18],[2567,18]]},"669":{"position":[[1478,18],[1619,18],[1746,18],[1822,18]]},"673":{"position":[[838,18],[979,18],[1106,18],[1182,18],[1809,18],[1917,18],[2052,18],[2198,18],[2291,18],[2367,18],[2442,18]]},"689":{"position":[[1080,18],[1170,18],[1219,18]]},"699":{"position":[[486,18],[1211,18]]},"701":{"position":[[583,18],[651,18],[726,18]]},"707":{"position":[[350,18]]},"728":{"position":[[20139,18],[21140,18],[23864,18],[31641,18],[32039,18],[39269,18],[39793,18],[41119,18],[41442,18]]},"745":{"position":[[30721,18],[30828,18],[30933,18],[31046,18],[31708,18]]},"747":{"position":[[1208,18],[1315,18],[1420,18],[1533,18]]},"751":{"position":[[1715,18],[1822,18],[1927,18],[2040,18],[15912,18],[23878,18],[24025,18],[24129,18],[24202,18],[24347,18],[24452,18],[24522,18]]},"761":{"position":[[1300,18],[1436,18],[1501,18],[1591,18],[1985,18]]},"769":{"position":[[1823,18],[1977,18],[3230,18],[3389,18],[3533,18],[3648,18],[3713,18],[3810,18]]},"773":{"position":[[1157,18],[1311,18],[1832,18],[1991,18],[2135,18],[2250,18],[2315,18],[2412,18],[2806,18]]},"775":{"position":[[1557,18],[1711,18],[2299,18],[2458,18],[2602,18],[2717,18],[2782,18],[2879,18],[3273,18]]},"797":{"position":[[1632,18],[1683,18],[1811,18],[1862,18],[1983,18]]},"799":{"position":[[1421,18],[1472,18],[1600,18],[1651,18],[1772,18]]},"801":{"position":[[1231,18],[1282,18],[1394,18],[1445,18],[1550,18]]},"823":{"position":[[6760,18],[6871,18],[6928,18]]},"825":{"position":[[3504,18],[5170,18],[5281,18],[5338,18],[5898,18]]},"844":{"position":[[30758,18],[30865,18],[30970,18]]},"846":{"position":[[867,18],[974,18],[1079,18]]},"848":{"position":[[949,18],[1056,18],[1161,18],[15247,18],[15357,18],[17076,18],[17220,18],[17288,18],[17436,18],[17505,18],[17653,18],[17725,18]]},"850":{"position":[[1130,18],[1274,18],[1342,18],[1490,18],[1559,18],[1707,18],[1779,18]]}}}],["concentr",{"_index":680,"t":{"51":{"position":[[2157,10]]},"55":{"position":[[1546,10]]},"343":{"position":[[130,10]]},"363":{"position":[[53,10],[184,10]]},"373":{"position":[[61,10]]},"377":{"position":[[45,10]]},"386":{"position":[[519,10]]},"693":{"position":[[100,10],[156,10]]},"732":{"position":[[439,10],[569,10]]},"734":{"position":[[270,10]]},"745":{"position":[[30288,12]]},"781":{"position":[[421,10]]},"797":{"position":[[522,10]]},"807":{"position":[[333,10],[556,10]]},"809":{"position":[[421,10]]},"823":{"position":[[6132,10]]},"831":{"position":[[329,10],[459,10]]},"833":{"position":[[270,10]]},"844":{"position":[[30328,12]]}}}],["concept",{"_index":19,"t":{"3":{"position":[[252,8]]},"15":{"position":[[82,7]]},"29":{"position":[[147,8]]},"45":{"position":[[1006,8]]},"63":{"position":[[114,8],[147,9]]},"169":{"position":[[343,9],[3130,9]]},"203":{"position":[[97,8],[130,8]]},"227":{"position":[[83,8],[1068,9]]},"258":{"position":[[83,8],[787,9]]},"273":{"position":[[83,8],[24499,9]]},"314":{"position":[[25,8]]},"320":{"position":[[83,8],[1389,9]]},"347":{"position":[[73,8],[1698,9]]},"365":{"position":[[74,8],[1200,9]]},"392":{"position":[[73,8],[1383,8],[1426,8]]},"400":{"position":[[8,8]]},"412":{"position":[[196,9]]},"432":{"position":[[76,8],[109,9]]},"440":{"position":[[83,8],[779,9]]},"450":{"position":[[76,8],[109,9]]},"474":{"position":[[83,8],[2686,9]]},"492":{"position":[[83,8],[1071,9]]},"500":{"position":[[249,9]]},"510":{"position":[[93,9]]},"514":{"position":[[83,8],[841,9],[1479,7]]},"518":{"position":[[628,7]]},"530":{"position":[[83,8],[818,9]]},"536":{"position":[[285,7]]},"550":{"position":[[83,8],[771,9]]},"572":{"position":[[83,8],[1242,9]]},"610":{"position":[[73,8],[1015,9]]},"637":{"position":[[74,8],[191,8],[359,9]]},"657":{"position":[[63,9]]},"671":{"position":[[490,7]]},"679":{"position":[[83,8],[930,9]]},"693":{"position":[[90,9]]},"697":{"position":[[63,9]]},"713":{"position":[[83,8],[160,9],[223,8],[1018,8],[1066,8]]},"715":{"position":[[53,8]]},"717":{"position":[[370,7]]},"730":{"position":[[716,8]]},"732":{"position":[[559,9]]},"734":{"position":[[83,8],[160,9],[223,8],[758,8],[806,8]]},"736":{"position":[[53,8]]},"747":{"position":[[9478,8]]},"757":{"position":[[63,9]]},"771":{"position":[[8098,7]]},"781":{"position":[[83,8],[160,9],[223,8],[1269,8],[1317,8]]},"783":{"position":[[53,8]]},"803":{"position":[[134,8]]},"809":{"position":[[83,8],[160,9],[223,8],[581,8],[629,8]]},"811":{"position":[[53,8]]},"827":{"position":[[56,9],[405,8]]},"831":{"position":[[449,9]]},"833":{"position":[[83,8],[160,9],[223,8],[860,8],[907,8]]},"835":{"position":[[53,8]]},"846":{"position":[[10146,8]]}}}],["concepts/build",{"_index":1637,"t":{"316":{"position":[[1357,17]]}}}],["conceptu",{"_index":49,"t":{"3":{"position":[[750,14]]},"460":{"position":[[948,12]]}}}],["concern",{"_index":2856,"t":{"825":{"position":[[135,10]]}}}],["concis",{"_index":2714,"t":{"775":{"position":[[28,8]]}}}],["concret",{"_index":697,"t":{"53":{"position":[[3098,8]]},"466":{"position":[[374,8]]},"508":{"position":[[6556,8]]}}}],["concurr",{"_index":1037,"t":{"129":{"position":[[258,11]]},"133":{"position":[[22,11],[364,11],[514,11],[567,10],[686,10],[2624,10],[2771,10]]}}}],["condit",{"_index":74,"t":{"3":{"position":[[1074,11],[1144,10],[1287,11],[1583,9],[1787,9],[2318,9],[2660,9]]},"5":{"position":[[460,11]]},"7":{"position":[[0,11],[330,11],[455,11],[632,11]]},"9":{"position":[[95,11],[179,11],[629,9]]},"27":{"position":[[661,11]]},"45":{"position":[[297,10]]},"55":{"position":[[608,10]]},"57":{"position":[[685,10]]},"145":{"position":[[1922,10],[2211,10],[4593,10],[4862,10]]},"169":{"position":[[5622,10]]},"185":{"position":[[32,10]]},"420":{"position":[[1276,12]]},"422":{"position":[[291,12],[2046,10]]},"472":{"position":[[228,10]]},"730":{"position":[[423,9]]},"732":{"position":[[721,9]]},"807":{"position":[[621,9]]},"831":{"position":[[590,9]]}}}],["confid",{"_index":782,"t":{"73":{"position":[[521,9]]}}}],["config",{"_index":1092,"t":{"133":{"position":[[554,6]]},"143":{"position":[[581,6]]},"155":{"position":[[138,7]]},"217":{"position":[[1100,7],[1925,7],[3003,6]]},"219":{"position":[[985,7],[1959,7],[3175,6]]}}}],["config.yaml",{"_index":1143,"t":{"143":{"position":[[44,11],[66,11]]},"147":{"position":[[623,11],[2057,11]]}}}],["configur",{"_index":415,"t":{"31":{"position":[[295,9],[354,9],[401,9]]},"33":{"position":[[29,9]]},"37":{"position":[[24,9],[628,9],[3972,13],[5472,13]]},"39":{"position":[[69,9]]},"43":{"position":[[1500,13],[2441,13]]},"45":{"position":[[14,13],[409,13]]},"47":{"position":[[116,13]]},"63":{"position":[[56,13]]},"69":{"position":[[252,13]]},"75":{"position":[[59,13],[106,13]]},"77":{"position":[[417,14]]},"93":{"position":[[211,10],[534,10],[857,10],[1180,10],[1475,10],[1736,10]]},"97":{"position":[[47,9],[1661,13],[2408,13]]},"105":{"position":[[198,10],[562,10]]},"113":{"position":[[1107,9]]},"119":{"position":[[211,10],[534,10],[857,10],[1180,10],[1475,10],[1736,10]]},"123":{"position":[[47,9],[1661,13],[2408,13]]},"129":{"position":[[112,9]]},"139":{"position":[[84,9]]},"141":{"position":[[324,13]]},"143":{"position":[[8,9],[214,13],[270,13],[526,14],[667,14],[720,13]]},"145":{"position":[[2808,9],[5436,9]]},"147":{"position":[[8,9],[227,9],[374,9],[525,9],[564,13],[796,9],[885,9],[988,14],[1040,9],[1143,9],[1240,9],[1718,9],[1959,9],[1998,13],[2245,9],[2329,9],[2409,9],[2513,14],[2565,9],[2668,9],[2765,9]]},"149":{"position":[[403,11]]},"153":{"position":[[11,10]]},"163":{"position":[[60,10]]},"169":{"position":[[674,13],[3347,13],[7299,13],[14660,13],[15786,13],[20854,13],[21980,13],[27283,13],[28451,13]]},"173":{"position":[[23,13]]},"215":{"position":[[1586,13],[2335,13]]},"217":{"position":[[2314,13],[3437,13]]},"219":{"position":[[2477,13],[3998,13]]},"236":{"position":[[2556,13],[3706,13]]},"238":{"position":[[2495,13],[3618,13],[8243,13],[9368,13]]},"244":{"position":[[211,10],[498,10],[785,10],[1072,10],[1331,10],[1592,10]]},"248":{"position":[[47,9],[1661,13],[2408,13]]},"265":{"position":[[2775,13],[3888,13]]},"267":{"position":[[2567,13],[3712,13],[8192,13],[9306,13]]},"273":{"position":[[3792,13],[4911,13],[9583,13],[10770,13],[15462,13],[16585,13],[21068,13],[22193,13]]},"282":{"position":[[2816,13],[3965,13]]},"284":{"position":[[2540,13],[3664,13]]},"290":{"position":[[207,10],[529,10],[851,10],[1138,10],[1397,10]]},"294":{"position":[[23,9],[1633,13],[2380,13]]},"329":{"position":[[2645,13],[3786,13],[8228,13],[9370,13],[14455,13],[15803,13]]},"353":{"position":[[2636,13],[3760,13],[8244,13],[9367,13]]},"359":{"position":[[2942,13],[4151,13],[8931,13],[10055,13],[14745,13],[15869,13]]},"361":{"position":[[145,13],[188,13]]},"375":{"position":[[2684,13],[3815,13]]},"382":{"position":[[3609,13],[4730,13]]},"392":{"position":[[1394,13],[1435,13]]},"400":{"position":[[17,13]]},"406":{"position":[[3076,13],[4401,13],[9376,13],[10502,13]]},"408":{"position":[[3198,13],[4633,13]]},"410":{"position":[[2470,13],[3596,13]]},"422":{"position":[[4080,13]]},"424":{"position":[[2782,13]]},"426":{"position":[[24,13],[7276,13],[8393,13],[8776,13],[9083,13]]},"432":{"position":[[124,13],[167,13]]},"446":{"position":[[2642,13],[3804,13]]},"448":{"position":[[2584,13],[3715,13],[8423,13],[9555,13]]},"450":{"position":[[201,13],[244,13]]},"482":{"position":[[2642,13],[3769,13],[8274,13],[9400,13]]},"486":{"position":[[2604,13],[3732,13],[8403,13],[9531,13]]},"490":{"position":[[322,10]]},"504":{"position":[[2589,13],[3737,13]]},"506":{"position":[[2751,13],[3979,13]]},"508":{"position":[[135,13],[2657,13],[3788,13]]},"522":{"position":[[2879,13],[4079,13]]},"524":{"position":[[2781,13],[3908,13]]},"526":{"position":[[145,13],[188,13]]},"540":{"position":[[2602,13],[3752,13]]},"542":{"position":[[3089,13],[4316,13]]},"544":{"position":[[2721,13],[3854,13]]},"556":{"position":[[2842,13],[4053,13]]},"560":{"position":[[2841,13],[4048,13]]},"562":{"position":[[2697,13],[3846,13]]},"564":{"position":[[2452,13],[3564,13],[7966,13],[9078,13]]},"566":{"position":[[2564,13],[3705,13],[8028,13],[9141,13]]},"581":{"position":[[2631,13],[3753,13]]},"588":{"position":[[3023,13],[4198,13],[9121,13],[10275,13],[15122,13],[16286,13]]},"590":{"position":[[2990,13],[4047,13]]},"595":{"position":[[2727,13],[3911,13],[8639,13],[9823,13]]},"600":{"position":[[2842,13],[4131,13]]},"602":{"position":[[138,10],[193,11],[255,14]]},"619":{"position":[[3063,13],[4329,13]]},"621":{"position":[[2597,13],[3731,13],[6186,13]]},"627":{"position":[[3045,13],[4420,13]]},"629":{"position":[[2510,13],[3636,13]]},"631":{"position":[[2698,13],[3919,13],[8551,13],[9678,13],[14190,13],[15320,13]]},"649":{"position":[[3764,13],[4887,13],[9936,13],[11059,13],[16763,13],[17889,13],[23594,13],[24717,13],[29832,13],[30956,13]]},"651":{"position":[[3739,13],[4863,13],[9994,13],[11121,13],[16334,13],[17459,13],[22657,13],[23782,13]]},"669":{"position":[[133,13],[7343,13],[8561,13]]},"671":{"position":[[3790,13],[5036,13]]},"691":{"position":[[3156,13],[4451,13],[9306,13],[10430,13],[15301,13],[16425,13],[20991,13],[22117,13],[26615,13],[27740,13]]},"701":{"position":[[3455,13],[4580,13],[9071,13],[10195,13]]},"703":{"position":[[2748,13],[3949,13],[8469,13],[9597,13]]},"705":{"position":[[2766,13],[4003,13],[9109,13],[10345,13],[15373,13],[16610,13],[21395,13],[22520,13],[27054,13],[28177,13]]},"713":{"position":[[1029,13],[1075,13]]},"726":{"position":[[4645,13],[6690,13],[14866,13],[16421,13],[22863,13],[24348,13],[30645,13],[31769,13],[36406,13],[37531,13],[42029,13],[43157,13],[47673,13],[48802,13]]},"728":{"position":[[170,13],[2689,13],[3814,13],[6050,13],[6509,13],[7119,13],[10600,13],[11721,13],[13902,13],[16535,13],[17665,13],[26975,13],[28104,13],[35205,13],[36325,13],[38542,10],[41814,13],[44765,13],[45885,13]]},"734":{"position":[[769,13],[815,13]]},"745":{"position":[[4301,13],[5458,13],[9906,13],[11032,13],[15675,13],[16832,13],[21237,13],[22363,13],[26865,13],[27992,13],[34597,13],[35723,13],[40223,13],[41349,13]]},"747":{"position":[[5347,13],[6743,13],[12069,13],[13197,13]]},"749":{"position":[[2823,13],[4004,13],[9128,13],[10341,13],[14828,13],[15954,13]]},"751":{"position":[[281,10],[5699,13],[6950,13],[9704,10],[12285,13],[13415,13],[19834,13],[21013,13]]},"761":{"position":[[6293,13],[7999,13]]},"767":{"position":[[2816,13],[3937,13],[8512,13],[9637,13],[14436,13],[15652,13],[20141,13],[21263,13]]},"769":{"position":[[6923,13],[8040,13],[13797,13],[15401,13],[21791,13],[23140,13],[28218,13],[29339,13]]},"771":{"position":[[4098,13],[5502,13],[11270,13],[12592,13],[18198,13],[19521,13]]},"773":{"position":[[10005,13],[13047,13]]},"781":{"position":[[1280,13],[1326,13]]},"795":{"position":[[2985,13],[4141,13],[8641,13],[9801,13],[14729,13],[16052,13],[21472,13],[22597,13],[27167,13],[28290,13]]},"797":{"position":[[478,14],[5980,13],[7366,13],[12806,13],[13934,13]]},"799":{"position":[[5543,13],[6797,13],[12576,13],[14045,13],[19978,13],[21100,13]]},"801":{"position":[[5921,13],[7247,13],[10256,14],[12680,13],[13807,13]]},"809":{"position":[[592,13],[638,13]]},"821":{"position":[[4660,13],[5875,13],[10452,13],[11583,13],[16371,13],[17586,13],[22120,13],[23251,13],[27877,13],[29015,13],[34827,13],[36312,13],[41824,13],[42955,13]]},"823":{"position":[[2526,13],[3652,13],[9806,13],[10931,13]]},"825":{"position":[[1613,13],[2710,13],[9937,13],[11337,13],[17243,13],[18527,13],[21669,13],[22960,13],[23833,13],[24686,13],[25171,13],[26037,13],[27367,13],[30497,13],[31750,13],[36808,13],[37994,13],[42661,13],[43830,13],[45952,13],[48453,13],[49576,13],[54154,13],[55292,13]]},"829":{"position":[[172,13],[331,14]]},"833":{"position":[[871,13],[916,13]]},"844":{"position":[[4308,13],[5468,13],[9937,13],[11066,13],[15720,13],[16876,13],[21275,13],[22400,13],[26897,13],[28024,13],[34115,13],[35240,13],[39735,13],[40861,13]]},"846":{"position":[[5402,13],[6909,13],[12745,13],[13874,13]]},"848":{"position":[[1837,13],[4875,13],[6241,13],[11664,13],[12796,13]]},"850":{"position":[[6153,13],[7702,13],[13336,13],[14469,13],[19098,13],[20233,13],[24799,13],[25936,13],[30587,13],[31722,13],[36284,13],[37419,13]]}}}],["configuration=credentialconfigur",{"_index":1469,"t":{"219":{"position":[[3757,38]]}}}],["configuration=credentialconfiguration(api_token=os.environ.get(fga_api_token",{"_index":1445,"t":{"217":{"position":[[3357,79]]}}}],["confirm",{"_index":2338,"t":{"691":{"position":[[12803,7]]},"705":{"position":[[18927,7]]},"785":{"position":[[332,12]]},"801":{"position":[[10083,8]]},"819":{"position":[[154,12]]}}}],["connect",{"_index":847,"t":{"89":{"position":[[171,7],[240,7],[322,7]]},"107":{"position":[[256,7]]},"131":{"position":[[422,10],[483,11],[529,11],[643,10],[765,12],[1254,11],[1370,11],[1466,11],[1581,12],[1602,11],[1763,11]]},"145":{"position":[[387,10]]},"161":{"position":[[546,11]]},"655":{"position":[[439,9]]},"671":{"position":[[225,9],[7166,10],[9836,10]]},"755":{"position":[[471,9]]},"761":{"position":[[342,9],[414,9]]},"763":{"position":[[156,10],[199,9],[278,10],[305,9]]},"769":{"position":[[4433,10],[19602,10],[19749,10],[20904,10],[21110,10],[22641,10],[22798,10],[24003,10],[24159,10],[25359,10],[25510,10]]},"771":{"position":[[323,7],[400,9],[982,10],[1047,10],[1827,10],[2001,10],[3184,10],[3417,10],[4976,10],[5160,10],[6394,10],[6577,10],[7731,10],[7909,10],[8420,10],[15348,10]]},"813":{"position":[[45,8]]}}}],["consid",{"_index":12,"t":{"3":{"position":[[143,10],[1238,8]]},"9":{"position":[[86,8],[435,8]]},"73":{"position":[[149,8]]},"131":{"position":[[1534,8],[1650,8]]},"133":{"position":[[342,8],[1338,8],[1544,8],[1713,8],[1959,8]]},"155":{"position":[[1102,10]]},"310":{"position":[[283,8]]},"462":{"position":[[2483,10]]},"464":{"position":[[444,8]]},"508":{"position":[[6547,8]]},"649":{"position":[[13487,10],[20293,10],[26921,10]]},"661":{"position":[[45,8],[78,8],[2829,11]]},"669":{"position":[[665,11]]},"751":{"position":[[9413,10],[9771,8]]},"761":{"position":[[45,8],[78,8],[2168,11]]},"825":{"position":[[1346,8]]},"848":{"position":[[9150,8]]}}}],["consider",{"_index":1338,"t":{"169":{"position":[[142,13]]},"665":{"position":[[252,14]]},"669":{"position":[[2610,14]]},"765":{"position":[[374,13]]},"769":{"position":[[4337,14]]}}}],["consist",{"_index":333,"t":{"25":{"position":[[22,11]]},"69":{"position":[[418,10]]},"169":{"position":[[8786,10],[8868,8]]},"189":{"position":[[32,10]]},"209":{"position":[[371,10]]},"227":{"position":[[1592,10]]},"231":{"position":[[514,10]]},"258":{"position":[[1311,10]]},"262":{"position":[[514,10]]},"273":{"position":[[25023,10]]},"279":{"position":[[514,10]]},"318":{"position":[[178,11]]},"320":{"position":[[1913,10]]},"326":{"position":[[514,10]]},"331":{"position":[[96,12]]},"347":{"position":[[2222,10]]},"351":{"position":[[514,10]]},"365":{"position":[[1724,10]]},"369":{"position":[[514,10]]},"440":{"position":[[1303,10]]},"442":{"position":[[514,10]]},"452":{"position":[[1214,10]]},"474":{"position":[[3210,10]]},"480":{"position":[[514,10]]},"492":{"position":[[1595,10]]},"496":{"position":[[514,10]]},"514":{"position":[[1365,10]]},"518":{"position":[[514,10]]},"530":{"position":[[1342,10]]},"534":{"position":[[514,10]]},"550":{"position":[[1295,10]]},"554":{"position":[[514,10]]},"572":{"position":[[1766,10]]},"576":{"position":[[514,10]]},"610":{"position":[[1539,10]]},"614":{"position":[[514,10]]},"637":{"position":[[883,10]]},"641":{"position":[[514,10]]},"659":{"position":[[374,10]]},"679":{"position":[[1454,10]]},"683":{"position":[[514,10]]},"697":{"position":[[587,10]]},"759":{"position":[[375,10]]}}}],["consol",{"_index":813,"t":{"77":{"position":[[960,7]]}}}],["consolid",{"_index":2320,"t":{"677":{"position":[[1314,11]]}}}],["const",{"_index":455,"t":{"37":{"position":[[850,5],[985,5],[1373,5]]},"43":{"position":[[32,5],[135,5],[386,5]]},"73":{"position":[[1018,5]]},"97":{"position":[[123,5],[258,5]]},"99":{"position":[[126,5]]},"109":{"position":[[593,5],[791,5]]},"111":{"position":[[246,5],[1155,5],[1209,5],[1264,5],[1390,5]]},"113":{"position":[[217,5],[840,5],[878,5],[1140,5],[1350,5],[2011,5],[2065,5],[2120,5],[2168,5],[2210,5],[2378,5]]},"123":{"position":[[123,5],[258,5]]},"125":{"position":[[106,5]]},"169":{"position":[[12405,5],[12540,5],[12943,5],[18599,5],[18734,5],[19137,5],[24953,5],[25088,5],[25476,5]]},"215":{"position":[[96,5],[199,5]]},"217":{"position":[[406,5],[547,5]]},"219":{"position":[[282,5],[423,5]]},"236":{"position":[[236,5],[371,5]]},"238":{"position":[[246,5],[381,5],[784,5],[5990,5],[6125,5],[6528,5]]},"248":{"position":[[123,5],[258,5]]},"265":{"position":[[546,5],[681,5],[1084,5]]},"267":{"position":[[257,5],[392,5],[5961,5],[6096,5],[6499,5]]},"273":{"position":[[1551,5],[1686,5],[2089,5],[7189,5],[7324,5],[13213,5],[13348,5],[13751,5],[18815,5],[18950,5],[19353,5]]},"282":{"position":[[498,5],[633,5]]},"284":{"position":[[289,5],[424,5],[827,5]]},"294":{"position":[[95,5],[230,5]]},"329":{"position":[[343,5],[478,5],[5924,5],[6059,5],[11738,5],[11873,5]]},"353":{"position":[[385,5],[520,5],[923,5],[5995,5],[6130,5],[6533,5]]},"359":{"position":[[504,5],[639,5],[6680,5],[6815,5],[7218,5],[12494,5],[12629,5],[13032,5]]},"375":{"position":[[419,5],[554,5],[957,5]]},"382":{"position":[[1364,5],[1499,5],[1902,5]]},"406":{"position":[[367,5],[502,5],[7121,5],[7256,5],[7659,5]]},"408":{"position":[[269,5],[404,5]]},"410":{"position":[[215,5],[350,5],[753,5]]},"446":{"position":[[298,5],[433,5]]},"448":{"position":[[319,5],[454,5],[857,5],[6156,5],[6291,5],[6694,5]]},"482":{"position":[[385,5],[520,5],[923,5],[6019,5],[6154,5],[6557,5]]},"486":{"position":[[345,5],[480,5],[883,5],[6144,5],[6279,5],[6682,5]]},"504":{"position":[[273,5],[408,5]]},"506":{"position":[[275,5],[410,5]]},"508":{"position":[[392,5],[527,5],[930,5]]},"522":{"position":[[459,5],[594,5]]},"524":{"position":[[524,5],[659,5],[1062,5]]},"540":{"position":[[282,5],[417,5]]},"542":{"position":[[615,5],[750,5]]},"544":{"position":[[452,5],[587,5],[990,5]]},"556":{"position":[[361,5],[496,5]]},"560":{"position":[[368,5],[503,5]]},"562":{"position":[[379,5],[514,5]]},"564":{"position":[[225,5],[360,5],[763,5],[5739,5],[5874,5],[6277,5]]},"566":{"position":[[262,5],[397,5],[5799,5],[5934,5],[6337,5]]},"581":{"position":[[384,5],[519,5],[922,5]]},"588":{"position":[[634,5],[769,5],[1175,5],[6790,5],[6925,5],[7331,5],[12771,5],[12906,5],[13312,5]]},"590":{"position":[[837,5],[972,5],[1378,5]]},"595":{"position":[[375,5],[510,5],[898,5],[6287,5],[6422,5],[6810,5]]},"600":{"position":[[296,5],[431,5],[819,5]]},"619":{"position":[[511,5],[646,5]]},"621":{"position":[[326,5],[461,5],[864,5]]},"627":{"position":[[236,5],[371,5]]},"629":{"position":[[255,5],[390,5],[793,5]]},"631":{"position":[[236,5],[371,5],[6294,5],[6429,5],[6832,5],[11927,5],[12062,5],[12465,5]]},"649":{"position":[[1515,5],[1650,5],[2053,5],[7687,5],[7822,5],[8225,5],[14508,5],[14643,5],[15046,5],[21345,5],[21480,5],[21883,5],[27581,5],[27716,5],[28119,5]]},"651":{"position":[[1488,5],[1623,5],[2026,5],[7737,5],[7872,5],[8275,5],[14081,5],[14216,5],[14619,5],[20404,5],[20539,5],[20942,5]]},"667":{"position":[[287,5],[2118,5],[3977,5],[5813,5],[7670,5],[9513,5]]},"669":{"position":[[2865,5],[4887,5],[5022,5],[10755,5]]},"671":{"position":[[1278,5],[1413,5],[7309,5],[9980,5]]},"691":{"position":[[507,5],[642,5],[7055,5],[7190,5],[7593,5],[13050,5],[13185,5],[13588,5],[18736,5],[18871,5],[19274,5],[24362,5],[24497,5],[24900,5]]},"701":{"position":[[1202,5],[1337,5],[1740,5],[6820,5],[6955,5],[7358,5]]},"703":{"position":[[326,5],[461,5],[6210,5],[6345,5],[6748,5]]},"705":{"position":[[301,5],[436,5],[842,5],[6578,5],[6713,5],[12840,5],[12975,5],[19142,5],[19277,5],[19680,5],[24805,5],[24940,5],[25343,5]]},"726":{"position":[[340,5],[475,5],[11658,5],[11793,5],[19795,5],[19930,5],[28394,5],[28529,5],[28932,5],[34153,5],[34288,5],[34691,5],[39770,5],[39905,5],[40308,5],[45412,5],[45547,5],[45950,5]]},"728":{"position":[[436,5],[571,5],[974,5],[8355,5],[8490,5],[8893,5],[14272,5],[14407,5],[14810,5],[24714,5],[24849,5],[25252,5],[32962,5],[33097,5],[33500,5],[42522,5],[42657,5],[43060,5]]},"745":{"position":[[1967,5],[2102,5],[7651,5],[7786,5],[8189,5],[13341,5],[13476,5],[18982,5],[19117,5],[19520,5],[24608,5],[24743,5],[25146,5],[32342,5],[32477,5],[32880,5],[37968,5],[38103,5],[38506,5]]},"747":{"position":[[2496,5],[2631,5],[9810,5],[9945,5],[10348,5]]},"749":{"position":[[441,5],[576,5],[6682,5],[6817,5],[12573,5],[12708,5],[13111,5]]},"751":{"position":[[3138,5],[3273,5],[10022,5],[10157,5],[10560,5],[17456,5],[17591,5]]},"761":{"position":[[2744,5],[2879,5]]},"767":{"position":[[571,5],[706,5],[1109,5],[6259,5],[6394,5],[6797,5],[11984,5],[12119,5],[17894,5],[18029,5],[18432,5]]},"769":{"position":[[4686,5],[4821,5],[5224,5],[10491,5],[10626,5],[19034,5],[19169,5],[25973,5],[26108,5],[26511,5]]},"771":{"position":[[1231,5],[1366,5],[8668,5],[8803,5],[9206,5],[15594,5],[15729,5],[16132,5]]},"773":{"position":[[3472,5],[3607,5]]},"795":{"position":[[653,5],[788,5],[6301,5],[6436,5],[11985,5],[12120,5],[19219,5],[19354,5],[19757,5],[24918,5],[25053,5],[25456,5]]},"797":{"position":[[3071,5],[3206,5],[10547,5],[10682,5],[11085,5]]},"799":{"position":[[2976,5],[3111,5],[9501,5],[9636,5],[17731,5],[17866,5],[18269,5]]},"801":{"position":[[3171,5],[3306,5],[10423,5],[10558,5],[10961,5]]},"821":{"position":[[2210,5],[2345,5],[8187,5],[8322,5],[8725,5],[13921,5],[14056,5],[19855,5],[19990,5],[20393,5],[25598,5],[25733,5],[26136,5],[31759,5],[31894,5],[39559,5],[39694,5],[40097,5]]},"823":{"position":[[271,5],[406,5],[809,5],[7553,5],[7688,5],[8091,5]]},"825":{"position":[[7039,5],[7174,5],[14655,5],[14790,5],[21098,5],[21233,5],[27932,5],[28067,5],[34416,5],[34551,5],[40303,5],[40438,5],[46204,5],[46339,5],[46742,5],[51875,5],[52010,5],[52413,5]]},"844":{"position":[[1968,5],[2103,5],[7676,5],[7811,5],[8214,5],[13388,5],[13523,5],[19022,5],[19157,5],[19560,5],[24640,5],[24775,5],[25178,5],[31862,5],[31997,5],[32400,5],[37480,5],[37615,5],[38018,5]]},"846":{"position":[[2251,5],[2386,5],[10484,5],[10619,5],[11022,5]]},"848":{"position":[[2084,5],[2219,5],[9397,5],[9532,5],[9935,5]]},"850":{"position":[[2957,5],[3092,5],[11067,5],[11202,5],[11605,5],[16825,5],[16960,5],[17363,5],[22522,5],[22657,5],[23060,5],[28314,5],[28449,5],[28852,5],[34011,5],[34146,5],[34549,5]]}}}],["constantli",{"_index":308,"t":{"19":{"position":[[311,10]]}}}],["constrain",{"_index":89,"t":{"3":{"position":[[1443,11]]}}}],["consum",{"_index":1084,"t":{"133":{"position":[[256,9]]},"306":{"position":[[0,7]]}}}],["contain",{"_index":564,"t":{"41":{"position":[[33,8]]},"107":{"position":[[160,7]]},"141":{"position":[[47,10]]},"145":{"position":[[523,11],[628,10],[891,9],[1064,10],[3574,9],[3751,10]]},"147":{"position":[[1376,10],[2901,10]]},"169":{"position":[[3494,8],[3558,7]]},"296":{"position":[[1066,7],[1216,7]]},"384":{"position":[[818,7]]},"426":{"position":[[5625,11],[7600,8]]},"498":{"position":[[36,7],[200,10]]},"595":{"position":[[6096,7]]},"608":{"position":[[464,7],[494,7],[521,7],[549,7],[624,7]]},"643":{"position":[[459,8]]},"669":{"position":[[848,7]]},"839":{"position":[[287,7]]},"841":{"position":[[381,8]]}}}],["container_nam",{"_index":1181,"t":{"145":{"position":[[1661,15],[1979,15],[2283,15],[4301,15],[4650,15],[4934,15]]}}}],["content",{"_index":553,"t":{"37":{"position":[[7851,8]]},"43":{"position":[[3224,8]]},"99":{"position":[[1434,8]]},"125":{"position":[[1676,8]]},"131":{"position":[[209,10]]},"133":{"position":[[317,11]]},"169":{"position":[[17418,8],[23612,8],[30163,8]]},"236":{"position":[[5019,8]]},"238":{"position":[[5244,8],[10998,8]]},"250":{"position":[[1512,8]]},"252":{"position":[[1635,8]]},"265":{"position":[[5494,8]]},"267":{"position":[[5022,8],[10914,8]]},"273":{"position":[[6529,8],[12119,8],[18211,8],[23823,8]]},"282":{"position":[[5279,8]]},"284":{"position":[[5292,8]]},"296":{"position":[[992,8],[2870,8]]},"298":{"position":[[2037,8],[3780,8]]},"314":{"position":[[108,7]]},"329":{"position":[[5090,8],[10677,8],[17287,8]]},"335":{"position":[[115,7]]},"341":{"position":[[92,7]]},"353":{"position":[[5388,8],[10993,8]]},"359":{"position":[[5522,8],[11683,8],[17497,8]]},"375":{"position":[[5457,8]]},"382":{"position":[[6352,8]]},"402":{"position":[[369,9],[662,7],[753,7]]},"406":{"position":[[5887,8],[12134,8]]},"408":{"position":[[6229,8]]},"410":{"position":[[5228,8]]},"434":{"position":[[86,7]]},"446":{"position":[[5129,8]]},"448":{"position":[[5357,8],[11199,8]]},"466":{"position":[[2594,8]]},"482":{"position":[[5403,8],[11032,8]]},"486":{"position":[[5368,8],[11167,8]]},"504":{"position":[[5048,8]]},"506":{"position":[[5369,8]]},"508":{"position":[[5430,8]]},"522":{"position":[[5441,8]]},"524":{"position":[[5542,8]]},"540":{"position":[[5065,8]]},"542":{"position":[[5705,8]]},"544":{"position":[[5500,8]]},"556":{"position":[[5427,8]]},"560":{"position":[[5418,8]]},"562":{"position":[[5158,8]]},"564":{"position":[[5168,8],[10682,8]]},"566":{"position":[[5011,8],[10747,8]]},"581":{"position":[[5377,8]]},"588":{"position":[[5830,8],[11870,8],[17901,8]]},"590":{"position":[[5561,8]]},"595":{"position":[[5530,8],[11442,8]]},"600":{"position":[[5999,8]]},"606":{"position":[[26,7]]},"619":{"position":[[5757,8]]},"621":{"position":[[5379,8]]},"627":{"position":[[5956,8]]},"629":{"position":[[5268,8]]},"631":{"position":[[5304,8],[11312,8],[16960,8]]},"649":{"position":[[6513,8],[12685,8],[19521,8],[26343,8],[32584,8]]},"651":{"position":[[6491,8],[12755,8],[19089,8],[25412,8]]},"661":{"position":[[8209,8]]},"667":{"position":[[1600,8],[3441,8],[5290,8],[7141,8],[8988,8],[10841,8]]},"669":{"position":[[4183,8],[9941,8],[12068,8]]},"671":{"position":[[6446,8],[9139,8],[11815,8]]},"673":{"position":[[7748,8]]},"691":{"position":[[5907,8],[12058,8],[18053,8],[23749,8],[29370,8]]},"701":{"position":[[6210,8],[11823,8]]},"703":{"position":[[5312,8],[11233,8]]},"705":{"position":[[5650,8],[11744,8],[18012,8],[24150,8],[29803,8]]},"726":{"position":[[8892,8],[18136,8],[25993,8],[33397,8],[39161,8],[44793,8],[50440,8]]},"728":{"position":[[5444,8],[13343,8],[19305,8],[29742,8],[37945,8],[47505,8]]},"745":{"position":[[6778,8],[12664,8],[18152,8],[23995,8],[29626,8],[37355,8],[42981,8]]},"747":{"position":[[8300,8],[14833,8]]},"749":{"position":[[5348,8],[11716,8],[17586,8]]},"751":{"position":[[8364,8],[15055,8],[22355,8]]},"761":{"position":[[9864,8]]},"767":{"position":[[5559,8],[11267,8],[17030,8],[22887,8]]},"769":{"position":[[9654,8],[17165,8],[24650,8],[30961,8]]},"771":{"position":[[7069,8],[14500,8],[21431,8]]},"773":{"position":[[16240,8]]},"795":{"position":[[5460,8],[11124,8],[17538,8],[24227,8],[29916,8]]},"797":{"position":[[8915,8],[15570,8]]},"799":{"position":[[8214,8],[15677,8],[22724,8]]},"801":{"position":[[8736,8],[15441,8]]},"821":{"position":[[7252,8],[13225,8],[18963,8],[24893,8],[30671,8],[37957,8],[44597,8]]},"823":{"position":[[5284,8],[12561,8]]},"825":{"position":[[12900,8],[19973,8],[26671,8],[33166,8],[39343,8],[45162,8],[51202,8],[56948,8]]},"844":{"position":[[6791,8],[12704,8],[18195,8],[24030,8],[29658,8],[36870,8],[42493,8]]},"846":{"position":[[8577,8],[15512,8]]},"848":{"position":[[7768,8],[14440,8]]},"850":{"position":[[9411,8],[16115,8],[21883,8],[27590,8],[33372,8],[39069,8]]}}}],["context",{"_index":110,"t":{"3":{"position":[[1878,7],[2033,7],[2349,7],[2488,7],[2738,7],[3040,8]]},"9":{"position":[[227,7],[413,8]]},"37":{"position":[[6013,7]]},"97":{"position":[[2949,7]]},"109":{"position":[[63,7],[932,7]]},"113":{"position":[[2761,9]]},"123":{"position":[[2949,7]]},"169":{"position":[[16327,7],[22521,7],[28992,7],[30928,7],[31195,7],[31402,7]]},"199":{"position":[[93,7]]},"236":{"position":[[4247,7]]},"238":{"position":[[4159,7],[9909,7]]},"248":{"position":[[2949,7]]},"265":{"position":[[4429,7]]},"267":{"position":[[4253,7],[9847,7]]},"273":{"position":[[5452,7],[11311,7],[17126,7],[22734,7]]},"282":{"position":[[4506,7]]},"284":{"position":[[4205,7]]},"294":{"position":[[2921,7]]},"316":{"position":[[1218,7]]},"329":{"position":[[4327,7],[9911,7],[16344,7]]},"353":{"position":[[4301,7],[9908,7]]},"359":{"position":[[4692,7],[10596,7],[16410,7]]},"375":{"position":[[4356,7]]},"382":{"position":[[5271,7]]},"406":{"position":[[4942,7],[11043,7]]},"408":{"position":[[5174,7]]},"410":{"position":[[4137,7]]},"420":{"position":[[18,7]]},"446":{"position":[[4345,7]]},"448":{"position":[[4256,7],[10096,7]]},"482":{"position":[[4310,7],[9941,7]]},"486":{"position":[[4273,7],[10072,7]]},"504":{"position":[[4278,7]]},"506":{"position":[[4520,7]]},"508":{"position":[[4329,7]]},"522":{"position":[[4620,7]]},"524":{"position":[[4449,7]]},"540":{"position":[[4293,7]]},"542":{"position":[[4857,7]]},"544":{"position":[[4395,7]]},"556":{"position":[[4594,7]]},"560":{"position":[[4589,7]]},"562":{"position":[[4387,7]]},"564":{"position":[[4105,7],[9619,7]]},"566":{"position":[[4246,7],[9682,7]]},"581":{"position":[[4294,7]]},"588":{"position":[[4739,7],[10816,7],[16827,7]]},"590":{"position":[[4588,7]]},"595":{"position":[[4452,7],[10364,7]]},"600":{"position":[[4672,7]]},"619":{"position":[[4870,7]]},"621":{"position":[[4272,7]]},"627":{"position":[[4961,7]]},"629":{"position":[[4177,7]]},"631":{"position":[[4460,7],[10219,7],[15861,7]]},"637":{"position":[[999,7]]},"641":{"position":[[630,7]]},"649":{"position":[[5428,7],[11600,7],[18430,7],[25258,7],[31497,7]]},"651":{"position":[[5404,7],[11662,7],[18000,7],[24323,7]]},"655":{"position":[[198,7],[343,7],[751,8]]},"659":{"position":[[531,7]]},"661":{"position":[[782,7]]},"663":{"position":[[27,7],[131,7],[241,7],[349,7]]},"665":{"position":[[239,7],[402,8],[437,7]]},"667":{"position":[[11389,7]]},"669":{"position":[[96,8],[252,7],[509,7],[598,7],[2499,8],[2597,7],[2727,7],[4702,7],[5476,7],[6657,7],[8214,7],[9102,7],[9445,7],[10488,7]]},"671":{"position":[[252,8],[332,7],[760,7],[894,8],[1895,7],[3104,7],[4689,7],[5577,7],[5949,7],[6984,7],[7186,7],[9856,7],[12592,7]]},"691":{"position":[[4992,7],[10971,7],[16966,7],[22658,7],[28281,7]]},"701":{"position":[[5121,7],[10736,7]]},"703":{"position":[[4490,7],[10138,7]]},"705":{"position":[[4544,7],[10886,7],[17151,7],[23061,7],[28718,7]]},"726":{"position":[[7231,7],[16962,7],[24889,7],[32310,7],[38072,7],[43698,7],[49343,7]]},"728":{"position":[[4355,7],[12262,7],[18206,7],[28645,7],[36866,7],[46426,7]]},"745":{"position":[[5999,7],[11573,7],[17373,7],[22904,7],[28533,7],[36264,7],[41890,7]]},"747":{"position":[[7284,7],[13738,7]]},"749":{"position":[[4545,7],[10882,7],[16495,7]]},"751":{"position":[[7491,7],[13956,7],[21554,7]]},"755":{"position":[[375,7],[778,8]]},"759":{"position":[[533,7]]},"761":{"position":[[8540,7]]},"765":{"position":[[414,7]]},"767":{"position":[[4478,7],[10178,7],[16193,7],[21804,7]]},"769":{"position":[[1241,7],[2731,7],[4246,8],[8581,7],[15942,7],[23681,7],[29880,7]]},"771":{"position":[[272,7],[850,7],[6043,7],[8368,7],[13133,7],[20062,7]]},"773":{"position":[[13588,7]]},"795":{"position":[[4682,7],[10342,7],[16593,7],[23138,7],[28831,7]]},"797":{"position":[[7907,7],[14475,7]]},"799":{"position":[[7338,7],[14586,7],[21641,7]]},"801":{"position":[[7788,7],[14348,7]]},"821":{"position":[[6416,7],[12124,7],[18127,7],[23792,7],[29556,7],[36853,7],[43496,7]]},"823":{"position":[[4193,7],[11472,7]]},"825":{"position":[[11878,7],[19068,7],[25712,7],[32291,7],[38535,7],[44371,7],[50117,7],[55833,7]]},"844":{"position":[[6009,7],[11607,7],[17417,7],[22941,7],[28565,7],[35781,7],[41402,7]]},"846":{"position":[[7450,7],[14415,7]]},"848":{"position":[[6782,7],[13337,7]]},"850":{"position":[[8243,7],[15010,7],[20774,7],[26477,7],[32263,7],[37960,7]]}}}],["contextu",{"_index":1409,"t":{"169":{"position":[[30815,10],[30835,10],[30996,10],[31134,10],[31326,10]]},"199":{"position":[[0,10]]},"316":{"position":[[1013,10],[1127,10]]},"655":{"position":[[240,10]]},"659":{"position":[[441,10]]},"665":{"position":[[128,10],[415,10]]},"671":{"position":[[505,11],[526,10]]},"673":{"position":[[10207,10],[10523,10]]},"675":{"position":[[219,10],[316,10]]},"755":{"position":[[149,10],[272,10]]},"759":{"position":[[442,10]]},"765":{"position":[[126,10],[392,10]]},"769":{"position":[[2636,10]]},"771":{"position":[[8113,11],[8134,10]]},"773":{"position":[[21109,10],[21425,10],[21587,10]]}}}],["contextual_tupl",{"_index":2145,"t":{"600":{"position":[[922,18],[5014,19],[5532,17],[6158,20],[6603,17]]},"671":{"position":[[7415,18],[8592,19],[8889,17],[9622,17],[10086,18],[11266,19],[11564,17],[12299,17]]},"771":{"position":[[9316,18],[13479,19],[14037,17],[15063,17],[16242,18],[20408,19],[20967,17],[21995,17]]}}}],["contextualtupl",{"_index":2146,"t":{"600":{"position":[[2168,17],[3707,16]]},"671":{"position":[[7791,17],[8225,16],[10463,17],[10898,16]]},"771":{"position":[[10574,17],[12133,16],[17501,17],[19061,16]]}}}],["continu",{"_index":1252,"t":{"151":{"position":[[8,10]]},"296":{"position":[[1226,12],[1255,12]]},"298":{"position":[[2140,12],[2243,12]]},"426":{"position":[[2965,8]]},"428":{"position":[[4031,8]]},"430":{"position":[[267,8]]},"468":{"position":[[707,8]]}}}],["continuation_token",{"_index":753,"t":{"67":{"position":[[329,19]]},"296":{"position":[[2484,19],[2908,23]]},"298":{"position":[[3380,19],[3837,21]]}}}],["continuationtoken",{"_index":1569,"t":{"296":{"position":[[115,17],[208,17],[1519,17],[1708,17],[1799,18],[2212,17]]},"298":{"position":[[1106,17],[1199,17],[2375,17],[2564,17],[2655,18],[3100,17]]}}}],["contoso",{"_index":666,"t":{"49":{"position":[[2254,7],[2410,7]]},"273":{"position":[[907,9],[1098,7],[7773,7],[8923,7],[10449,7],[11649,7],[12637,7]]},"428":{"position":[[1626,7],[2255,7]]},"649":{"position":[[20642,7],[20671,7]]},"742":{"position":[[163,7],[296,7],[457,7]]},"751":{"position":[[220,7],[232,7],[269,7],[2940,7],[2957,7],[17022,7],[17122,7]]}}}],["contoso/engin",{"_index":2494,"t":{"742":{"position":[[70,19],[256,19],[539,19]]},"747":{"position":[[3085,19],[3210,19],[4434,19],[4618,19],[6218,19],[6353,19],[7627,19],[7761,19],[9090,19],[9219,19]]}}}],["contoso/protocol",{"_index":2496,"t":{"742":{"position":[[118,17],[214,17]]},"749":{"position":[[7269,17],[8445,17],[9997,17],[11223,17],[12261,17]]}}}],["contoso/tool",{"_index":2498,"t":{"742":{"position":[[416,15]]},"747":{"position":[[3245,15],[4653,15],[6388,15],[7796,15],[9254,15]]},"751":{"position":[[2969,16]]}}}],["control",{"_index":21,"t":{"3":{"position":[[292,7]]},"21":{"position":[[21,8],[177,8]]},"133":{"position":[[1849,10]]},"414":{"position":[[37,7]]},"424":{"position":[[163,7]]},"791":{"position":[[70,7]]},"819":{"position":[[338,7]]}}}],["convert",{"_index":558,"t":{"37":{"position":[[8391,7]]},"61":{"position":[[135,10]]},"329":{"position":[[5704,7],[11518,8]]},"426":{"position":[[10322,7]]},"815":{"position":[[1017,7]]}}}],["copi",{"_index":1178,"t":{"145":{"position":[[1517,4],[4164,4]]},"147":{"position":[[1326,4],[2851,4]]}}}],["core",{"_index":1525,"t":{"256":{"position":[[139,4]]},"426":{"position":[[3237,4]]},"438":{"position":[[167,4]]},"717":{"position":[[253,5]]}}}],["correct",{"_index":296,"t":{"17":{"position":[[295,7]]},"508":{"position":[[152,7]]},"629":{"position":[[69,8]]},"669":{"position":[[244,7],[590,7]]},"671":{"position":[[959,7]]},"703":{"position":[[6042,7]]},"705":{"position":[[18950,7]]},"721":{"position":[[92,8]]},"728":{"position":[[46,7],[38577,7],[41831,7]]},"771":{"position":[[560,7]]},"789":{"position":[[92,8]]},"797":{"position":[[1089,7]]},"817":{"position":[[92,8]]},"823":{"position":[[62,7],[5848,7]]}}}],["correctli",{"_index":1487,"t":{"227":{"position":[[34,9]]},"258":{"position":[[34,9]]},"273":{"position":[[34,9],[12803,9]]},"320":{"position":[[34,9]]},"353":{"position":[[73,9]]},"410":{"position":[[5748,10]]},"440":{"position":[[34,9]]},"474":{"position":[[34,9]]},"482":{"position":[[73,9]]},"492":{"position":[[34,9]]},"514":{"position":[[34,9]]},"530":{"position":[[34,9]]},"550":{"position":[[34,9]]},"572":{"position":[[34,9]]},"671":{"position":[[920,9]]},"679":{"position":[[34,9]]},"713":{"position":[[34,9]]},"734":{"position":[[34,9]]},"781":{"position":[[34,9]]},"809":{"position":[[34,9]]},"833":{"position":[[34,9]]}}}],["correspond",{"_index":1763,"t":{"408":{"position":[[88,13]]},"462":{"position":[[2528,13]]}}}],["could_n",{"_index":357,"t":{"27":{"position":[[178,12]]}}}],["countri",{"_index":48,"t":{"3":{"position":[[733,9]]}}}],["cover",{"_index":2226,"t":{"649":{"position":[[26968,5]]}}}],["cpu",{"_index":1082,"t":{"133":{"position":[[188,3],[275,3]]}}}],["creat",{"_index":261,"t":{"15":{"position":[[107,7]]},"19":{"position":[[539,7]]},"31":{"position":[[150,6],[165,8]]},"35":{"position":[[202,7],[488,7],[774,7],[1060,7],[1346,7],[1627,7]]},"41":{"position":[[84,6]]},"43":{"position":[[2761,6],[3002,6],[3038,6],[3141,6]]},"65":{"position":[[56,7],[177,8]]},"71":{"position":[[412,7]]},"73":{"position":[[845,8]]},"113":{"position":[[26,6],[678,6],[2518,6]]},"131":{"position":[[353,8]]},"133":{"position":[[282,8]]},"145":{"position":[[567,6],[669,6],[718,7],[1027,6],[2888,6],[3359,6],[3411,7],[3714,6],[5516,6]]},"169":{"position":[[3976,6]]},"213":{"position":[[114,7]]},"215":{"position":[[3203,9]]},"217":{"position":[[4332,9]]},"219":{"position":[[4893,9]]},"225":{"position":[[351,6]]},"258":{"position":[[667,6],[701,6]]},"260":{"position":[[24,6],[58,6]]},"306":{"position":[[37,6],[481,8]]},"316":{"position":[[23,6],[977,7]]},"320":{"position":[[1174,6],[1208,6]]},"322":{"position":[[24,6],[58,6]]},"337":{"position":[[20,6],[130,6],[237,6],[346,6]]},"339":{"position":[[20,6]]},"359":{"position":[[18102,8]]},"363":{"position":[[455,6],[502,8]]},"371":{"position":[[284,7]]},"373":{"position":[[11,8]]},"375":{"position":[[5943,8]]},"386":{"position":[[1350,6]]},"390":{"position":[[162,6],[474,6]]},"392":{"position":[[1266,6]]},"398":{"position":[[24,6]]},"402":{"position":[[82,6],[302,7],[419,7]]},"404":{"position":[[152,6]]},"414":{"position":[[0,8]]},"420":{"position":[[1352,6],[1428,6],[1502,6],[1622,6]]},"422":{"position":[[489,6],[565,6],[639,6],[717,6],[2233,6],[2309,6],[2383,6],[2503,6]]},"424":{"position":[[724,6],[800,6],[874,6],[994,6],[2666,6]]},"426":{"position":[[50,6],[341,6],[3124,7],[3628,8],[4026,8],[4710,8],[5960,7]]},"428":{"position":[[1839,7],[2105,7],[2388,6],[2416,6],[3747,6]]},"430":{"position":[[424,8]]},"448":{"position":[[11696,8]]},"462":{"position":[[3281,7]]},"492":{"position":[[951,6],[985,6]]},"494":{"position":[[24,6],[58,6]]},"498":{"position":[[558,6],[639,6]]},"500":{"position":[[140,8]]},"504":{"position":[[47,6],[5767,8]]},"512":{"position":[[389,7]]},"514":{"position":[[721,6],[755,6],[1684,8]]},"516":{"position":[[24,6],[58,6]]},"522":{"position":[[22,6],[223,6]]},"528":{"position":[[369,6]]},"530":{"position":[[698,6],[732,6]]},"532":{"position":[[24,6],[58,6]]},"540":{"position":[[51,6]]},"542":{"position":[[339,6]]},"544":{"position":[[6181,8]]},"550":{"position":[[651,6],[685,6]]},"552":{"position":[[24,6],[58,6]]},"572":{"position":[[1122,6],[1156,6]]},"574":{"position":[[24,6],[58,6]]},"619":{"position":[[48,6],[136,6]]},"621":{"position":[[6293,8]]},"637":{"position":[[239,6],[273,6]]},"639":{"position":[[24,6],[58,6]]},"659":{"position":[[667,6]]},"677":{"position":[[564,6],[617,6],[633,8],[713,8]]},"679":{"position":[[810,6],[844,6]]},"681":{"position":[[24,6],[58,6]]},"691":{"position":[[108,6],[220,6],[30319,8]]},"701":{"position":[[38,6]]},"703":{"position":[[56,6]]},"713":{"position":[[326,6]]},"734":{"position":[[495,6]]},"745":{"position":[[240,6],[1783,6]]},"747":{"position":[[21,8],[2220,6]]},"751":{"position":[[9345,6],[17286,6]]},"759":{"position":[[669,6]]},"761":{"position":[[2385,7],[3659,7],[5416,7],[7510,7],[9227,7],[11364,7]]},"773":{"position":[[4387,7],[7400,7],[11222,7],[14275,7],[19514,7]]},"781":{"position":[[300,6],[334,6],[1087,6]]},"809":{"position":[[300,6],[334,6]]},"815":{"position":[[988,6]]},"821":{"position":[[526,6],[2027,6]]},"833":{"position":[[495,6]]},"844":{"position":[[325,6],[1784,6]]},"846":{"position":[[2010,6]]},"850":{"position":[[179,7]]}}}],["create_docu",{"_index":1843,"t":{"424":{"position":[[2721,17]]}}}],["create_stor",{"_index":581,"t":{"43":{"position":[[2738,15],[2966,14]]}}}],["createstor",{"_index":490,"t":{"37":{"position":[[2498,13],[4380,13],[5824,13]]},"43":{"position":[[918,15],[1918,15]]},"97":{"position":[[1132,13],[2069,13],[2760,13]]},"113":{"position":[[4891,15]]},"123":{"position":[[1132,13],[2069,13],[2760,13]]},"169":{"position":[[13717,13],[15068,13],[16138,13],[19911,13],[21262,13],[22332,13],[26286,13],[27691,13],[28803,13]]},"215":{"position":[[528,15],[1157,15],[2004,15],[2692,15]]},"217":{"position":[[876,15],[1646,15],[2732,15],[3794,15]]},"219":{"position":[[752,15],[1671,15],[2895,15],[4355,15]]},"236":{"position":[[1503,13],[2964,13],[4058,13]]},"238":{"position":[[1555,13],[2903,13],[3970,13],[7301,13],[8651,13],[9720,13]]},"248":{"position":[[1132,13],[2069,13],[2760,13]]},"265":{"position":[[1845,13],[3183,13],[4240,13]]},"267":{"position":[[1519,13],[2975,13],[4064,13],[7261,13],[8600,13],[9658,13]]},"273":{"position":[[2856,13],[4200,13],[5263,13],[8493,13],[9991,13],[11122,13],[14522,13],[15870,13],[16937,13],[20126,13],[21476,13],[22545,13]]},"282":{"position":[[1764,13],[3224,13],[4317,13]]},"284":{"position":[[1599,13],[2948,13],[4016,13]]},"294":{"position":[[1104,13],[2041,13],[2732,13]]},"329":{"position":[[1601,13],[3053,13],[4138,13],[7183,13],[8636,13],[9722,13],[13166,13],[14863,13],[16155,13]]},"353":{"position":[[1695,13],[3044,13],[4112,13],[7304,13],[8652,13],[9719,13]]},"359":{"position":[[1830,13],[3350,13],[4503,13],[7990,13],[9339,13],[10407,13],[13804,13],[15153,13],[16221,13]]},"375":{"position":[[1736,13],[3092,13],[4167,13]]},"382":{"position":[[2671,13],[4017,13],[5082,13]]},"406":{"position":[[1799,13],[3484,13],[4753,13],[8433,13],[9784,13],[10854,13]]},"408":{"position":[[1811,13],[3606,13],[4985,13]]},"410":{"position":[[1527,13],[2878,13],[3948,13]]},"446":{"position":[[1577,13],[3050,13],[4156,13]]},"448":{"position":[[1636,13],[2992,13],[4067,13],[7474,13],[8831,13],[9907,13]]},"482":{"position":[[1698,13],[3050,13],[4121,13],[7331,13],[8682,13],[9752,13]]},"486":{"position":[[1659,13],[3012,13],[4084,13],[7458,13],[8811,13],[9883,13]]},"504":{"position":[[1538,13],[2997,13],[4089,13]]},"506":{"position":[[1620,13],[3159,13],[4331,13]]},"508":{"position":[[1709,13],[3065,13],[4140,13]]},"522":{"position":[[1776,13],[3287,13],[4431,13]]},"524":{"position":[[1837,13],[3189,13],[4260,13]]},"540":{"position":[[1549,13],[3010,13],[4104,13]]},"542":{"position":[[1959,13],[3497,13],[4668,13]]},"544":{"position":[[1771,13],[3129,13],[4206,13]]},"556":{"position":[[1679,13],[3250,13],[4405,13]]},"560":{"position":[[1682,13],[3249,13],[4400,13]]},"562":{"position":[[1645,13],[3105,13],[4198,13]]},"564":{"position":[[1523,13],[2860,13],[3916,13],[7037,13],[8374,13],[9430,13]]},"566":{"position":[[1520,13],[2972,13],[4057,13],[7098,13],[8436,13],[9493,13]]},"581":{"position":[[1692,13],[3039,13],[4105,13]]},"588":{"position":[[1987,13],[3431,13],[4550,13],[8124,13],[9529,13],[10627,13],[14115,13],[15530,13],[16638,13]]},"590":{"position":[[2072,13],[3398,13],[4399,13]]},"595":{"position":[[1722,13],[3135,13],[4263,13],[7634,13],[9047,13],[10175,13]]},"600":{"position":[[1736,13],[3250,13],[4483,13]]},"619":{"position":[[1894,13],[3471,13],[4681,13]]},"621":{"position":[[1646,13],[3005,13],[4083,13]]},"627":{"position":[[1718,13],[3453,13],[4772,13]]},"629":{"position":[[1567,13],[2918,13],[3988,13]]},"631":{"position":[[1574,13],[3106,13],[4271,13],[7607,13],[8959,13],[10030,13],[13243,13],[14598,13],[15672,13]]},"649":{"position":[[2824,13],[4172,13],[5239,13],[8996,13],[10344,13],[11411,13],[15820,13],[17171,13],[18241,13],[22654,13],[24002,13],[25069,13],[28891,13],[30240,13],[31308,13]]},"651":{"position":[[2798,13],[4147,13],[5215,13],[9050,13],[10402,13],[11473,13],[15392,13],[16742,13],[17811,13],[21715,13],[23065,13],[24134,13]]},"669":{"position":[[6222,13],[7751,13],[8913,13]]},"671":{"position":[[2641,13],[4198,13],[5388,13]]},"691":{"position":[[1909,13],[3564,13],[4803,13],[8365,13],[9714,13],[10782,13],[14360,13],[15709,13],[16777,13],[20048,13],[21399,13],[22469,13],[25673,13],[27023,13],[28092,13]]},"701":{"position":[[2513,13],[3863,13],[4932,13],[8130,13],[9479,13],[10547,13]]},"703":{"position":[[1644,13],[3156,13],[4301,13],[7524,13],[8877,13],[9949,13]]},"705":{"position":[[1722,13],[3174,13],[4355,13],[7921,13],[9517,13],[10697,13],[14184,13],[15781,13],[16962,13],[20453,13],[21803,13],[22872,13],[26114,13],[27462,13],[28529,13]]},"726":{"position":[[2452,13],[5053,13],[7042,13],[13310,13],[15274,13],[16773,13],[21377,13],[23271,13],[24700,13],[29704,13],[31053,13],[32121,13],[35464,13],[36814,13],[37883,13],[41084,13],[42437,13],[43509,13],[46727,13],[48081,13],[49154,13]]},"728":{"position":[[1747,13],[3097,13],[4166,13],[9662,13],[11008,13],[12073,13],[15588,13],[16943,13],[18017,13],[26029,13],[27383,13],[28456,13],[34268,13],[35613,13],[36677,13],[43828,13],[45173,13],[46237,13]]},"745":{"position":[[3241,13],[4709,13],[5810,13],[8963,13],[10314,13],[11384,13],[14615,13],[16083,13],[17184,13],[20294,13],[21645,13],[22715,13],[25921,13],[27273,13],[28344,13],[33654,13],[35005,13],[36075,13],[39280,13],[40631,13],[41701,13]]},"747":{"position":[[3999,13],[5755,13],[7095,13],[11124,13],[12477,13],[13549,13]]},"749":{"position":[[1739,13],[3231,13],[4356,13],[8012,13],[9536,13],[10693,13],[13885,13],[15236,13],[16306,13]]},"751":{"position":[[4496,13],[6107,13],[7302,13],[11338,13],[12693,13],[13767,13],[18752,13],[20242,13],[21365,13]]},"761":{"position":[[4537,13],[6701,13],[8351,13]]},"767":{"position":[[1878,13],[3224,13],[4289,13],[7570,13],[8920,13],[9989,13],[13317,13],[14844,13],[16004,13],[19202,13],[20549,13],[21615,13]]},"769":{"position":[[5989,13],[7331,13],[8392,13],[12192,13],[14205,13],[15753,13],[20490,13],[22199,13],[23492,13],[27280,13],[28626,13],[29691,13]]},"771":{"position":[[2742,13],[4506,13],[5854,13],[10144,13],[11678,13],[12944,13],[17071,13],[18606,13],[19873,13]]},"773":{"position":[[6521,13],[10413,13],[13399,13]]},"795":{"position":[[1926,13],[3393,13],[4493,13],[7578,13],[9049,13],[10153,13],[13405,13],[15137,13],[16404,13],[20530,13],[21880,13],[22949,13],[26227,13],[27575,13],[28642,13]]},"797":{"position":[[4544,13],[6388,13],[7718,13],[11861,13],[13214,13],[14286,13]]},"799":{"position":[[4337,13],[5951,13],[7149,13],[11057,13],[12984,13],[14397,13],[19039,13],[20386,13],[21452,13]]},"801":{"position":[[4594,13],[6329,13],[7599,13],[11736,13],[13088,13],[14159,13]]},"821":{"position":[[3542,13],[5068,13],[6227,13],[9504,13],[10860,13],[11935,13],[15253,13],[16779,13],[17938,13],[21172,13],[22528,13],[23603,13],[26922,13],[28285,13],[29367,13],[33341,13],[35235,13],[36664,13],[40876,13],[42232,13],[43307,13]]},"823":{"position":[[1583,13],[2934,13],[4004,13],[8864,13],[10214,13],[11283,13]]},"825":{"position":[[8536,13],[10345,13],[11689,13],[16056,13],[17651,13],[18879,13],[22543,13],[24241,13],[25523,13],[29292,13],[30905,13],[32102,13],[35719,13],[37216,13],[38346,13],[41589,13],[43069,13],[44182,13],[47513,13],[48861,13],[49928,13],[53199,13],[54562,13],[55644,13]]},"844":{"position":[[3245,13],[4716,13],[5820,13],[8991,13],[10345,13],[11418,13],[14661,13],[16128,13],[17228,13],[20333,13],[21683,13],[22752,13],[25953,13],[27305,13],[28376,13],[33173,13],[34523,13],[35592,13],[38792,13],[40143,13],[41213,13]]},"846":{"position":[[3845,13],[5810,13],[7261,13],[11799,13],[13153,13],[14226,13]]},"848":{"position":[[3557,13],[5283,13],[6593,13],[10715,13],[12072,13],[13148,13]]},"850":{"position":[[4603,13],[6561,13],[8054,13],[12386,13],[13744,13],[14821,13],[18146,13],[19506,13],[20585,13],[23845,13],[25207,13],[26288,13],[29635,13],[30995,13],[32074,13],[35332,13],[36692,13],[37771,13]]}}}],["createstorerequest",{"_index":578,"t":{"43":{"position":[[2422,18],[2634,19],[2783,19]]}}}],["creation",{"_index":790,"t":{"73":{"position":[[770,8],[874,8]]},"300":{"position":[[414,8]]},"390":{"position":[[637,9]]}}}],["credenti",{"_index":1431,"t":{"217":{"position":[[1049,12],[1839,12],[2932,11],[2950,13],[3274,12],[3311,11],[3961,11],[3975,12]]},"219":{"position":[[52,11],[136,11],[925,12],[1864,12],[3095,11],[3113,13],[3664,12],[3701,11],[3715,12],[4522,11],[4536,12]]}}}],["credentialconfigur",{"_index":1443,"t":{"217":{"position":[[3287,23]]},"219":{"position":[[3677,23]]}}}],["credentials(method='api_token",{"_index":1444,"t":{"217":{"position":[[3325,31]]}}}],["credentials.config",{"_index":1437,"t":{"217":{"position":[[1933,20]]},"219":{"position":[[1967,20]]}}}],["credentials.credenti",{"_index":1435,"t":{"217":{"position":[[1852,25]]},"219":{"position":[[1877,25]]}}}],["credentials.credentialsmethodapitoken",{"_index":1436,"t":{"217":{"position":[[1886,38]]}}}],["credentials.credentialsmethodclientcredenti",{"_index":1455,"t":{"219":{"position":[[1911,47]]}}}],["credentialsconfig",{"_index":1440,"t":{"217":{"position":[[3016,19]]},"219":{"position":[[3188,19]]}}}],["credentialsmethod",{"_index":1430,"t":{"217":{"position":[[414,18],[491,18]]},"219":{"position":[[290,18],[367,18]]}}}],["credentialsmethod.apitoken",{"_index":1432,"t":{"217":{"position":[[1072,27],[2975,27]]}}}],["credentialsmethod.clientcredenti",{"_index":1450,"t":{"219":{"position":[[948,36],[3138,36]]}}}],["criteria",{"_index":1598,"t":{"300":{"position":[[545,8]]},"310":{"position":[[77,9]]},"312":{"position":[[164,8]]},"675":{"position":[[327,9]]},"732":{"position":[[825,8]]},"807":{"position":[[725,8]]},"831":{"position":[[694,8]]}}}],["crypto/rand",{"_index":947,"t":{"111":{"position":[[1608,13]]},"113":{"position":[[2771,13]]}}}],["crypto/rsa",{"_index":948,"t":{"111":{"position":[[1622,12]]},"113":{"position":[[2785,12]]}}}],["cup",{"_index":2393,"t":{"721":{"position":[[248,4],[264,7],[420,4]]},"726":{"position":[[12518,4],[14134,4],[16028,4],[17594,4],[19364,4],[20631,4],[22177,4],[24001,4],[25497,4],[27167,4]]}}}],["curl",{"_index":429,"t":{"35":{"position":[[27,4]]},"37":{"position":[[736,4],[7676,4]]},"43":{"position":[[27,4],[3185,4]]},"93":{"position":[[27,4]]},"97":{"position":[[100,4]]},"99":{"position":[[106,4],[1274,4]]},"119":{"position":[[27,4]]},"123":{"position":[[100,4]]},"125":{"position":[[101,4],[1509,4]]},"153":{"position":[[229,4],[239,4]]},"169":{"position":[[12280,4],[17258,4],[18174,5],[18474,4],[23452,4],[24522,5],[24828,4],[29996,4]]},"236":{"position":[[107,4],[4859,4]]},"238":{"position":[[121,4],[5084,4],[5865,4],[10838,4]]},"244":{"position":[[27,4]]},"248":{"position":[[100,4]]},"250":{"position":[[88,4],[1352,4]]},"252":{"position":[[243,4],[1475,4]]},"265":{"position":[[421,4],[5334,4]]},"267":{"position":[[128,4],[4862,4],[5836,4],[10754,4]]},"273":{"position":[[1426,4],[6369,4],[7060,4],[11959,4],[13088,4],[18051,4],[18690,4],[23663,4]]},"282":{"position":[[369,4],[5119,4]]},"284":{"position":[[164,4],[5132,4]]},"290":{"position":[[23,4]]},"294":{"position":[[72,4]]},"296":{"position":[[91,4],[830,4],[1495,4],[2708,4]]},"298":{"position":[[1076,4],[1875,4],[2345,4],[3618,4]]},"329":{"position":[[214,4],[4930,4],[5795,4],[10517,4],[11613,4],[17127,4]]},"353":{"position":[[260,4],[5228,4],[5870,4],[10833,4]]},"359":{"position":[[375,4],[5362,4],[6555,4],[11523,4],[12369,4],[17337,4]]},"375":{"position":[[294,4],[5297,4]]},"382":{"position":[[1239,4],[6192,4]]},"406":{"position":[[238,4],[5727,4],[6996,4],[11974,4]]},"408":{"position":[[140,4],[6069,4]]},"410":{"position":[[90,4],[5068,4]]},"446":{"position":[[169,4],[4969,4]]},"448":{"position":[[194,4],[5197,4],[6031,4],[11039,4]]},"466":{"position":[[1197,4],[2434,4]]},"482":{"position":[[260,4],[5243,4],[5894,4],[10872,4]]},"486":{"position":[[220,4],[5208,4],[6019,4],[11007,4]]},"504":{"position":[[144,4],[4888,4]]},"506":{"position":[[146,4],[5209,4]]},"508":{"position":[[267,4],[5270,4]]},"522":{"position":[[330,4],[5281,4]]},"524":{"position":[[399,4],[5382,4]]},"540":{"position":[[153,4],[4905,4]]},"542":{"position":[[486,4],[5545,4]]},"544":{"position":[[327,4],[5340,4]]},"556":{"position":[[232,4],[5267,4]]},"560":{"position":[[239,4],[5258,4]]},"562":{"position":[[250,4],[4998,4]]},"564":{"position":[[100,4],[5008,4],[5614,4],[10522,4]]},"566":{"position":[[133,4],[4851,4],[5674,4],[10587,4]]},"581":{"position":[[259,4],[5217,4]]},"588":{"position":[[509,4],[5671,4],[6665,4],[11711,4],[12646,4],[17742,4]]},"590":{"position":[[712,4],[5402,4]]},"595":{"position":[[250,4],[5369,4],[6162,4],[11281,4]]},"600":{"position":[[171,4],[5832,4]]},"619":{"position":[[382,4],[5597,4]]},"621":{"position":[[201,4],[5219,4]]},"627":{"position":[[107,4],[5796,4]]},"629":{"position":[[130,4],[5108,4]]},"631":{"position":[[107,4],[5144,4],[6169,4],[11152,4],[11802,4],[16800,4]]},"649":{"position":[[1390,4],[6353,4],[7562,4],[12525,4],[14383,4],[19361,4],[21220,4],[26183,4],[27456,4],[32424,4]]},"651":{"position":[[1363,4],[6331,4],[7612,4],[12595,4],[13956,4],[18929,4],[20279,4],[25252,4]]},"661":{"position":[[3181,4],[8049,4]]},"667":{"position":[[256,4],[1440,4],[2087,4],[3281,4],[3946,4],[5130,4],[5782,4],[6981,4],[7639,4],[8828,4],[9482,4],[10681,4]]},"669":{"position":[[2834,4],[4023,4],[4758,4],[9781,4],[10724,4],[11908,4]]},"671":{"position":[[1149,4],[6286,4],[7278,4],[8979,4],[9949,4],[11655,4]]},"673":{"position":[[2720,4],[7588,4]]},"691":{"position":[[378,4],[5747,4],[6930,4],[11898,4],[12925,4],[17893,4],[18611,4],[23589,4],[24237,4],[29210,4]]},"701":{"position":[[1077,4],[6050,4],[6695,4],[11663,4]]},"703":{"position":[[197,4],[5152,4],[6085,4],[11073,4]]},"705":{"position":[[176,4],[5491,4],[6449,4],[11584,4],[12711,4],[17852,4],[19017,4],[23990,4],[24680,4],[29643,4]]},"726":{"position":[[211,4],[8732,4],[11529,4],[17976,4],[19666,4],[25833,4],[28269,4],[33237,4],[34028,4],[39001,4],[39645,4],[44633,4],[45287,4],[50280,4]]},"728":{"position":[[311,4],[5284,4],[8230,4],[13183,4],[14147,4],[19145,4],[24589,4],[29582,4],[32837,4],[37785,4],[42397,4],[47345,4]]},"745":{"position":[[1838,4],[6618,4],[7526,4],[12504,4],[13212,4],[17992,4],[18857,4],[23835,4],[24483,4],[29466,4],[32217,4],[37195,4],[37843,4],[42821,4]]},"747":{"position":[[2367,4],[8140,4],[9685,4],[14673,4]]},"749":{"position":[[312,4],[5188,4],[6553,4],[11556,4],[12448,4],[17426,4]]},"751":{"position":[[3009,4],[8204,4],[9897,4],[14895,4],[17327,4],[22195,4]]},"761":{"position":[[2615,4],[9704,4]]},"767":{"position":[[446,4],[5399,4],[6134,4],[11107,4],[11855,4],[16870,4],[17769,4],[22727,4]]},"769":{"position":[[4561,4],[9494,4],[10362,4],[17005,4],[18905,4],[24490,4],[25848,4],[30801,4]]},"771":{"position":[[1102,4],[6909,4],[8543,4],[14340,4],[15469,4],[21271,4]]},"773":{"position":[[3343,4],[16080,4]]},"795":{"position":[[524,4],[5300,4],[6172,4],[10964,4],[11856,4],[17378,4],[19094,4],[24067,4],[24793,4],[29756,4]]},"797":{"position":[[2942,4],[8755,4],[10422,4],[15410,4]]},"799":{"position":[[2847,4],[8054,4],[9372,4],[15517,4],[17606,4],[22564,4]]},"801":{"position":[[3042,4],[8576,4],[10298,4],[15281,4]]},"821":{"position":[[2081,4],[7092,4],[8062,4],[13065,4],[13792,4],[18803,4],[19730,4],[24733,4],[25473,4],[30511,4],[31630,4],[37797,4],[39434,4],[44437,4]]},"823":{"position":[[146,4],[5124,4],[7428,4],[12401,4]]},"825":{"position":[[6910,4],[12740,4],[14526,4],[19813,4],[20969,4],[26511,4],[27803,4],[33006,4],[34287,4],[39183,4],[40174,4],[45002,4],[46079,4],[51042,4],[51750,4],[56788,4]]},"844":{"position":[[1839,4],[6631,4],[7551,4],[12544,4],[13259,4],[18035,4],[18897,4],[23870,4],[24515,4],[29498,4],[31737,4],[36710,4],[37355,4],[42333,4]]},"846":{"position":[[2122,4],[8417,4],[10359,4],[15352,4]]},"848":{"position":[[1955,4],[7608,4],[9272,4],[14280,4]]},"850":{"position":[[2828,4],[9251,4],[10942,4],[15955,4],[16700,4],[21723,4],[22397,4],[27430,4],[28189,4],[33212,4],[33886,4],[38909,4]]}}}],["current",{"_index":200,"t":{"9":{"position":[[38,7]]},"53":{"position":[[176,7]]},"143":{"position":[[147,7]]},"155":{"position":[[844,9]]},"169":{"position":[[31734,9]]},"201":{"position":[[252,9]]},"347":{"position":[[1029,7]]},"365":{"position":[[825,7]]},"371":{"position":[[9,7]]},"426":{"position":[[3421,7]]},"428":{"position":[[655,7]]},"452":{"position":[[1072,7]]},"474":{"position":[[1473,7]]},"556":{"position":[[8,7]]},"621":{"position":[[5897,7]]},"655":{"position":[[743,7]]},"669":{"position":[[75,7],[2569,7],[4681,7]]},"717":{"position":[[565,7]]},"726":{"position":[[27384,7]]},"749":{"position":[[6167,7]]},"755":{"position":[[770,7]]}}}],["current_tim",{"_index":103,"t":{"3":{"position":[[1687,12],[2118,12],[2197,12],[2379,16],[2531,12],[2757,16],[2911,12],[3020,12]]}}}],["custom",{"_index":1634,"t":{"316":{"position":[[927,6],[955,6]]},"390":{"position":[[40,6],[149,9],[179,6],[407,6]]},"402":{"position":[[99,6]]},"761":{"position":[[717,9],[749,8],[1372,11],[1483,10],[1754,11],[2263,8],[3454,8],[3530,11],[5152,8],[7295,8],[7379,11],[9013,8],[10708,8],[11155,8]]},"765":{"position":[[177,8]]},"767":{"position":[[124,8],[6054,8]]},"769":{"position":[[2548,8],[2589,10],[2904,9],[3016,8],[3302,11],[3695,10],[3973,11]]},"773":{"position":[[443,9],[555,8],[1904,11],[2297,10],[2575,11],[4182,8],[4258,11],[7136,8],[11007,8],[11091,11],[14061,8],[17783,8],[19305,8]]},"775":{"position":[[656,9],[768,8],[2371,11],[2764,10],[3042,11]]}}}],["customer'",{"_index":2568,"t":{"761":{"position":[[214,10],[323,10]]}}}],["d",{"_index":555,"t":{"37":{"position":[[7887,1]]},"43":{"position":[[3260,1]]},"99":{"position":[[1470,1]]},"125":{"position":[[1712,1]]},"145":{"position":[[745,1],[3438,1]]},"169":{"position":[[17454,1],[23648,1],[30199,1]]},"236":{"position":[[5055,1]]},"238":{"position":[[5280,1],[11034,1]]},"250":{"position":[[1548,1]]},"252":{"position":[[1671,1]]},"265":{"position":[[5530,1]]},"267":{"position":[[5058,1],[10950,1]]},"273":{"position":[[6565,1],[12155,1],[18247,1],[23859,1]]},"282":{"position":[[5315,1]]},"284":{"position":[[5328,1]]},"296":{"position":[[1028,1],[2906,1]]},"298":{"position":[[2073,1],[3816,1]]},"310":{"position":[[1968,2]]},"312":{"position":[[499,1]]},"329":{"position":[[5126,1],[10713,1],[17323,1]]},"353":{"position":[[5424,1],[11029,1]]},"359":{"position":[[5558,1],[11719,1],[17533,1]]},"375":{"position":[[5493,1]]},"382":{"position":[[6388,1]]},"406":{"position":[[5923,1],[12170,1]]},"408":{"position":[[6265,1]]},"410":{"position":[[5264,1]]},"446":{"position":[[5165,1]]},"448":{"position":[[5393,1],[11235,1]]},"466":{"position":[[2630,1]]},"482":{"position":[[5439,1],[11068,1]]},"486":{"position":[[5404,1],[11203,1]]},"504":{"position":[[5084,1]]},"506":{"position":[[5405,1]]},"508":{"position":[[5466,1]]},"522":{"position":[[5477,1]]},"524":{"position":[[5578,1]]},"540":{"position":[[5101,1]]},"542":{"position":[[5741,1]]},"544":{"position":[[5536,1]]},"556":{"position":[[5463,1]]},"560":{"position":[[5454,1]]},"562":{"position":[[5194,1]]},"564":{"position":[[5204,1],[10718,1]]},"566":{"position":[[5047,1],[10783,1]]},"581":{"position":[[5413,1]]},"588":{"position":[[5866,1],[11906,1],[17937,1]]},"590":{"position":[[5597,1]]},"595":{"position":[[5566,1],[11478,1]]},"600":{"position":[[6035,1]]},"619":{"position":[[5793,1]]},"621":{"position":[[5415,1]]},"627":{"position":[[5992,1]]},"629":{"position":[[5304,1]]},"631":{"position":[[5340,1],[11348,1],[16996,1]]},"649":{"position":[[6549,1],[12721,1],[19557,1],[26379,1],[32620,1]]},"651":{"position":[[6527,1],[12791,1],[19125,1],[25448,1]]},"661":{"position":[[8245,1]]},"667":{"position":[[1636,1],[3477,1],[5326,1],[7177,1],[9024,1],[10877,1]]},"669":{"position":[[4219,1],[9977,1],[12104,1]]},"671":{"position":[[6482,1],[9175,1],[11851,1]]},"673":{"position":[[7784,1]]},"691":{"position":[[5943,1],[12094,1],[18089,1],[23785,1],[29406,1]]},"701":{"position":[[6246,1],[11859,1]]},"703":{"position":[[5348,1],[11269,1]]},"705":{"position":[[11780,1],[18048,1],[24186,1],[29839,1]]},"726":{"position":[[8928,1],[18172,1],[26029,1],[33433,1],[39197,1],[44829,1],[50476,1]]},"728":{"position":[[5480,1],[13379,1],[19341,1],[29778,1],[37981,1],[47541,1]]},"745":{"position":[[6814,1],[12700,1],[18188,1],[24031,1],[29662,1],[37391,1],[43017,1]]},"747":{"position":[[8336,1],[14869,1]]},"749":{"position":[[5384,1],[11752,1],[17622,1]]},"751":{"position":[[8400,1],[15091,1],[22391,1]]},"761":{"position":[[9900,1]]},"767":{"position":[[5595,1],[11303,1],[17066,1],[22923,1]]},"769":{"position":[[9690,1],[17201,1],[24686,1],[30997,1]]},"771":{"position":[[7105,1],[14536,1],[21467,1]]},"773":{"position":[[16276,1]]},"795":{"position":[[5496,1],[11160,1],[17574,1],[24263,1],[29952,1]]},"797":{"position":[[8951,1],[15606,1]]},"799":{"position":[[8250,1],[15713,1],[22760,1]]},"801":{"position":[[8772,1],[15477,1]]},"821":{"position":[[7288,1],[13261,1],[18999,1],[24929,1],[30707,1],[37993,1],[44633,1]]},"823":{"position":[[5320,1],[12597,1]]},"825":{"position":[[12936,1],[20009,1],[26707,1],[33202,1],[39379,1],[45198,1],[51238,1],[56984,1]]},"844":{"position":[[6827,1],[12740,1],[18231,1],[24066,1],[29694,1],[36906,1],[42529,1]]},"846":{"position":[[8613,1],[15548,1]]},"848":{"position":[[7804,1],[14476,1]]},"850":{"position":[[9447,1],[16151,1],[21919,1],[27626,1],[33408,1],[39105,1]]}}}],["d3233a67938f",{"_index":1359,"t":{"169":{"position":[[4284,12],[4798,13]]}}}],["dani",{"_index":2221,"t":{"649":{"position":[[20484,4],[21106,4],[26900,6]]}}}],["data",{"_index":158,"t":{"5":{"position":[[421,4]]},"25":{"position":[[270,4]]},"31":{"position":[[535,4]]},"37":{"position":[[3371,5]]},"41":{"position":[[61,5]]},"75":{"position":[[209,4],[275,4]]},"99":{"position":[[509,5],[601,4]]},"113":{"position":[[5338,5]]},"125":{"position":[[543,5],[651,4]]},"135":{"position":[[87,4],[153,4]]},"145":{"position":[[137,5]]},"157":{"position":[[18,4]]},"159":{"position":[[50,4]]},"161":{"position":[[46,4]]},"169":{"position":[[3439,4],[3601,4],[3735,4],[3895,4],[14154,5],[14246,4],[20348,5],[20440,4],[26721,5],[26829,4]]},"177":{"position":[[50,4]]},"207":{"position":[[129,4],[157,5],[171,4]]},"221":{"position":[[138,4],[283,4]]},"236":{"position":[[2034,5]]},"238":{"position":[[1989,5],[2081,4],[7736,5],[7828,4]]},"250":{"position":[[554,5]]},"252":{"position":[[711,5]]},"254":{"position":[[73,4]]},"265":{"position":[[2269,5],[2361,4]]},"267":{"position":[[2045,5],[7685,5],[7777,4]]},"273":{"position":[[3285,5],[3377,4],[9061,5],[14956,5],[15048,4],[20561,5],[20653,4]]},"282":{"position":[[2294,5]]},"284":{"position":[[2033,5],[2125,4]]},"296":{"position":[[337,5],[1975,5]]},"298":{"position":[[1344,5],[2847,5]]},"300":{"position":[[567,4]]},"306":{"position":[[659,4]]},"329":{"position":[[2123,5],[7706,5],[13933,5]]},"353":{"position":[[2130,5],[2222,4],[7738,5],[7830,4]]},"359":{"position":[[2420,5],[8424,5],[8516,4],[14239,5],[14331,4]]},"375":{"position":[[2178,5],[2270,4]]},"382":{"position":[[3103,5],[3195,4]]},"406":{"position":[[2554,5],[8870,5],[8962,4]]},"408":{"position":[[2676,5]]},"410":{"position":[[1964,5],[2056,4]]},"426":{"position":[[6830,4]]},"428":{"position":[[1333,5]]},"446":{"position":[[2120,5]]},"448":{"position":[[2078,5],[2170,4],[7916,5],[8008,4]]},"466":{"position":[[1712,5]]},"482":{"position":[[2136,5],[2228,4],[7768,5],[7860,4]]},"486":{"position":[[2098,5],[2190,4],[7896,5],[7988,4]]},"504":{"position":[[2067,5]]},"506":{"position":[[2229,5]]},"508":{"position":[[2151,5],[2243,4]]},"522":{"position":[[2357,5]]},"524":{"position":[[2275,5],[2367,4]]},"540":{"position":[[2080,5]]},"542":{"position":[[2567,5]]},"544":{"position":[[2215,5],[2307,4]]},"556":{"position":[[2320,5]]},"560":{"position":[[2319,5]]},"562":{"position":[[2175,5]]},"564":{"position":[[1946,5],[2038,4],[7460,5],[7552,4]]},"566":{"position":[[2042,5],[7521,5],[7613,4]]},"581":{"position":[[2125,5],[2217,4]]},"588":{"position":[[2394,5],[2492,4],[3880,4],[8492,5],[8590,4],[9957,4],[14493,5],[14591,4],[15968,4]]},"590":{"position":[[2479,5],[2577,4],[3847,4]]},"595":{"position":[[2218,5],[2318,4],[8130,5],[8230,4]]},"600":{"position":[[2280,5],[2388,4]]},"619":{"position":[[2541,5]]},"621":{"position":[[2091,5],[2183,4]]},"627":{"position":[[967,4],[2354,4],[2523,5],[4068,4],[5455,4],[6870,4]]},"629":{"position":[[2004,5],[2096,4]]},"631":{"position":[[823,4],[2007,4],[2176,5],[3567,4],[4802,4],[5832,4],[8044,5],[8136,4],[13684,5],[13776,4]]},"649":{"position":[[3258,5],[3350,4],[9430,5],[9522,4],[16257,5],[16349,4],[23088,5],[23180,4],[29326,5],[29418,4]]},"651":{"position":[[3232,5],[3324,4],[9487,5],[9579,4],[15827,5],[15919,4],[22151,5],[22243,4]]},"661":{"position":[[5632,5]]},"667":{"position":[[672,5],[764,4],[2507,5],[2599,4],[4362,5],[4454,4],[6203,5],[6295,4],[8056,5],[8148,4],[9903,5],[9995,4]]},"669":{"position":[[3251,5],[3343,4],[6821,5],[11140,5],[11232,4]]},"671":{"position":[[3268,5],[7910,5],[8002,4],[10582,5],[10674,4]]},"673":{"position":[[5171,5]]},"691":{"position":[[2634,5],[8800,5],[8892,4],[14794,5],[14886,4],[20485,5],[20577,4],[26109,5],[26201,4]]},"701":{"position":[[2949,5],[3041,4],[8565,5],[8657,4]]},"703":{"position":[[2226,5],[7963,5],[8055,4]]},"705":{"position":[[2013,5],[2111,4],[3561,4],[8587,5],[14851,5],[20889,5],[20981,4],[26547,5],[26639,4]]},"726":{"position":[[4123,5],[14344,5],[22341,5],[27969,5],[30139,5],[30231,4],[35899,5],[35991,4],[41523,5],[41615,4],[47167,5],[47259,4]]},"728":{"position":[[2178,5],[2270,4],[10093,5],[10185,4],[16028,5],[16120,4],[26469,5],[26561,4],[34699,5],[34791,4],[44259,5],[44351,4]]},"745":{"position":[[3779,5],[9400,5],[9492,4],[15153,5],[20731,5],[20823,4],[26358,5],[26450,4],[34091,5],[34183,4],[39717,5],[39809,4]]},"747":{"position":[[4825,5],[11563,5],[11655,4]]},"749":{"position":[[2301,5],[8606,5],[14322,5],[14414,4]]},"751":{"position":[[5177,5],[11774,5],[11866,4],[19312,5]]},"755":{"position":[[160,4]]},"761":{"position":[[5771,5]]},"767":{"position":[[2310,5],[2402,4],[8006,5],[8098,4],[13914,5],[19634,5],[19726,4]]},"769":{"position":[[6416,5],[6508,4],[13275,5],[21269,5],[27712,5],[27804,4]]},"771":{"position":[[484,4],[3576,5],[10764,5],[10856,4],[17691,5],[17783,4]]},"773":{"position":[[9483,5]]},"795":{"position":[[2463,5],[8119,5],[14207,5],[20966,5],[21058,4],[26660,5],[26752,4]]},"797":{"position":[[5458,5],[12300,5],[12392,4]]},"799":{"position":[[5021,5],[12054,5],[19472,5],[19564,4]]},"801":{"position":[[5399,5],[12173,5],[12265,4]]},"821":{"position":[[4138,5],[9946,5],[10038,4],[15849,5],[21614,5],[21706,4],[27370,5],[27462,4],[34305,5],[41318,5],[41410,4]]},"823":{"position":[[2019,5],[2111,4],[5869,4],[9300,5],[9392,4]]},"825":{"position":[[9415,5],[16721,5],[23311,5],[29975,5],[36286,5],[42139,5],[47946,5],[48038,4],[53648,5],[53740,4]]},"844":{"position":[[3786,5],[9431,5],[9523,4],[15198,5],[20769,5],[20861,4],[26390,5],[26482,4],[33609,5],[33701,4],[39229,5],[39321,4]]},"846":{"position":[[4880,5],[12239,5],[12331,4]]},"848":{"position":[[4353,5],[11153,5],[11245,4]]},"850":{"position":[[5631,5],[12830,5],[12922,4],[18591,5],[18683,4],[24293,5],[24385,4],[30080,5],[30172,4],[35777,5],[35869,4]]}}}],["data.allow",{"_index":1009,"t":{"113":{"position":[[5530,16]]}}}],["data.authorizationmodelid",{"_index":503,"t":{"37":{"position":[[3525,25]]}}}],["databas",{"_index":1038,"t":{"131":{"position":[[67,8],[173,8],[230,9],[332,8],[413,8],[474,8],[520,8],[634,8],[1424,8],[1457,8]]},"133":{"position":[[91,8],[175,8],[308,8],[1053,8],[2235,8],[2373,8],[2680,8],[2845,8]]},"143":{"position":[[315,8]]},"145":{"position":[[2775,9],[2822,8],[5403,9],[5450,8]]},"209":{"position":[[307,8]]},"300":{"position":[[582,9],[664,8],[684,8]]},"304":{"position":[[70,9],[138,9]]},"306":{"position":[[435,8]]},"308":{"position":[[267,8]]},"310":{"position":[[115,8],[379,8],[2482,8]]},"312":{"position":[[45,8]]},"424":{"position":[[501,9]]}}}],["database'",{"_index":1052,"t":{"131":{"position":[[750,10],[1018,10]]}}}],["datastor",{"_index":1149,"t":{"143":{"position":[[370,10]]},"145":{"position":[[1158,9],[1188,9],[1403,9],[1433,9],[3017,9],[3110,9],[3845,9],[3872,9],[4070,9],[4097,9]]},"153":{"position":[[137,9]]}}}],["date",{"_index":791,"t":{"73":{"position":[[779,4],[840,4],[883,4]]},"300":{"position":[[423,6]]},"695":{"position":[[306,5]]}}}],["david",{"_index":2814,"t":{"817":{"position":[[154,5],[596,5]]},"819":{"position":[[244,5],[786,5]]},"821":{"position":[[368,5],[31360,5],[32455,5],[33942,5],[35815,5],[37312,5],[39011,5],[45244,5],[45287,5],[45428,5],[45464,5],[45601,5],[45638,5]]},"823":{"position":[[13202,5],[13245,5],[13386,5],[13422,5],[13560,5],[13597,5]]},"825":{"position":[[288,5],[366,5],[441,5],[571,5],[1008,6],[40073,5],[46001,5],[51653,5],[58358,5],[58394,5],[58446,5],[58483,5],[58535,5],[58567,5],[58614,5],[58657,5],[58715,5],[58763,5]]}}}],["day",{"_index":56,"t":{"3":{"position":[[852,5]]}}}],["deb",{"_index":825,"t":{"77":{"position":[[1397,5],[1439,5]]},"81":{"position":[[13,5]]}}}],["debian",{"_index":831,"t":{"77":{"position":[[1491,7]]},"81":{"position":[[65,7]]}}}],["debug",{"_index":2131,"t":{"595":{"position":[[19,9]]}}}],["decid",{"_index":1916,"t":{"454":{"position":[[54,7]]},"677":{"position":[[1562,6]]},"805":{"position":[[165,7]]}}}],["decis",{"_index":15,"t":{"3":{"position":[[180,9]]},"169":{"position":[[276,9]]},"416":{"position":[[443,9]]},"671":{"position":[[981,9]]}}}],["declar",{"_index":26,"t":{"3":{"position":[[369,7]]},"109":{"position":[[650,7]]},"462":{"position":[[565,7]]}}}],["decor",{"_index":973,"t":{"113":{"position":[[35,9],[687,9],[720,9]]}}}],["decreas",{"_index":1321,"t":{"161":{"position":[[387,8]]}}}],["deduc",{"_index":2486,"t":{"728":{"position":[[30439,7]]}}}],["deep",{"_index":1120,"t":{"133":{"position":[[2099,4]]}}}],["deeper",{"_index":2491,"t":{"730":{"position":[[683,6]]},"803":{"position":[[101,6]]},"827":{"position":[[372,6]]}}}],["def",{"_index":540,"t":{"37":{"position":[[6303,3]]},"43":{"position":[[2734,3]]}}}],["default",{"_index":462,"t":{"37":{"position":[[1091,8],[2281,8],[4111,8],[5596,8]]},"43":{"position":[[223,8],[701,8],[1649,8]]},"67":{"position":[[224,8]]},"77":{"position":[[540,8]]},"97":{"position":[[364,8],[915,8],[1800,8],[2532,8]]},"113":{"position":[[519,8],[1256,8],[4251,8],[4674,8]]},"123":{"position":[[364,8],[915,8],[1800,8],[2532,8]]},"141":{"position":[[316,7]]},"143":{"position":[[551,7]]},"145":{"position":[[103,8]]},"147":{"position":[[94,9]]},"149":{"position":[[240,7]]},"151":{"position":[[467,7]]},"155":{"position":[[672,7],[754,7]]},"157":{"position":[[39,7]]},"159":{"position":[[130,8]]},"161":{"position":[[82,8],[223,7],[522,7]]},"163":{"position":[[37,8],[211,9]]},"169":{"position":[[12646,8],[13500,8],[14799,8],[15910,8],[18840,8],[19694,8],[20993,8],[22104,8],[25194,8],[26069,8],[27422,8],[28575,8]]},"215":{"position":[[313,8],[940,8],[1735,8],[2463,8],[3095,8]]},"217":{"position":[[661,8],[1429,8],[2463,8],[3565,8],[4224,8]]},"219":{"position":[[537,8],[1454,8],[2626,8],[4126,8],[4785,8]]},"236":{"position":[[477,8],[1286,8],[2695,8],[3830,8]]},"238":{"position":[[487,8],[1338,8],[2634,8],[3742,8],[6231,8],[7084,8],[8382,8],[9492,8]]},"248":{"position":[[364,8],[915,8],[1800,8],[2532,8]]},"265":{"position":[[787,8],[1628,8],[2914,8],[4012,8]]},"267":{"position":[[498,8],[1302,8],[2706,8],[3836,8],[6202,8],[7044,8],[8331,8],[9430,8]]},"273":{"position":[[1792,8],[2639,8],[3931,8],[5035,8],[7430,8],[8276,8],[9722,8],[10894,8],[13454,8],[14305,8],[15601,8],[16709,8],[19056,8],[19909,8],[21207,8],[22317,8]]},"282":{"position":[[739,8],[1547,8],[2955,8],[4089,8]]},"284":{"position":[[530,8],[1382,8],[2679,8],[3788,8]]},"294":{"position":[[336,8],[887,8],[1772,8],[2504,8]]},"296":{"position":[[3220,7]]},"329":{"position":[[584,8],[1384,8],[2784,8],[3910,8],[6165,8],[6966,8],[8367,8],[9494,8],[11979,8],[12949,8],[14594,8],[15927,8]]},"353":{"position":[[626,8],[1478,8],[2775,8],[3884,8],[6236,8],[7087,8],[8383,8],[9491,8]]},"359":{"position":[[745,8],[1613,8],[3081,8],[4275,8],[6921,8],[7773,8],[9070,8],[10179,8],[12735,8],[13587,8],[14884,8],[15993,8]]},"375":{"position":[[660,8],[1519,8],[2823,8],[3939,8]]},"382":{"position":[[1605,8],[2454,8],[3748,8],[4854,8]]},"406":{"position":[[608,8],[1582,8],[3215,8],[4525,8],[7362,8],[8216,8],[9515,8],[10626,8]]},"408":{"position":[[510,8],[1594,8],[3337,8],[4757,8]]},"410":{"position":[[456,8],[1310,8],[2609,8],[3720,8]]},"446":{"position":[[539,8],[1360,8],[2781,8],[3928,8]]},"448":{"position":[[560,8],[1419,8],[2723,8],[3839,8],[6397,8],[7257,8],[8562,8],[9679,8]]},"468":{"position":[[519,8],[777,7]]},"482":{"position":[[626,8],[1481,8],[2781,8],[3893,8],[6260,8],[7114,8],[8413,8],[9524,8]]},"486":{"position":[[586,8],[1442,8],[2743,8],[3856,8],[6385,8],[7241,8],[8542,8],[9655,8]]},"504":{"position":[[514,8],[1321,8],[2728,8],[3861,8]]},"506":{"position":[[516,8],[1403,8],[2890,8],[4103,8]]},"508":{"position":[[633,8],[1492,8],[2796,8],[3912,8]]},"522":{"position":[[700,8],[1559,8],[3018,8],[4203,8]]},"524":{"position":[[765,8],[1620,8],[2920,8],[4032,8]]},"540":{"position":[[523,8],[1332,8],[2741,8],[3876,8]]},"542":{"position":[[856,8],[1742,8],[3228,8],[4440,8]]},"544":{"position":[[693,8],[1554,8],[2860,8],[3978,8]]},"556":{"position":[[602,8],[1462,8],[2981,8],[4177,8]]},"560":{"position":[[609,8],[1465,8],[2980,8],[4172,8]]},"562":{"position":[[620,8],[1428,8],[2836,8],[3970,8]]},"564":{"position":[[466,8],[1306,8],[2591,8],[3688,8],[5980,8],[6820,8],[8105,8],[9202,8]]},"566":{"position":[[503,8],[1303,8],[2703,8],[3829,8],[6040,8],[6881,8],[8167,8],[9265,8]]},"581":{"position":[[625,8],[1475,8],[2770,8],[3877,8]]},"588":{"position":[[875,8],[1770,8],[3162,8],[4322,8],[7031,8],[7907,8],[9260,8],[10399,8],[13012,8],[13898,8],[15261,8],[16410,8]]},"590":{"position":[[1078,8],[1855,8],[3129,8],[4171,8]]},"595":{"position":[[616,8],[1505,8],[2866,8],[4035,8],[6528,8],[7417,8],[8778,8],[9947,8]]},"600":{"position":[[537,8],[1519,8],[2981,8],[4255,8]]},"602":{"position":[[89,8],[173,8],[247,7]]},"619":{"position":[[752,8],[1677,8],[3202,8],[4453,8]]},"621":{"position":[[567,8],[1429,8],[2736,8],[3855,8]]},"627":{"position":[[477,8],[1501,8],[3184,8],[4544,8]]},"629":{"position":[[496,8],[1350,8],[2649,8],[3760,8]]},"631":{"position":[[477,8],[1357,8],[2837,8],[4043,8],[6535,8],[7390,8],[8690,8],[9802,8],[12168,8],[13026,8],[14329,8],[15444,8]]},"649":{"position":[[1756,8],[2607,8],[3903,8],[5011,8],[7928,8],[8779,8],[10075,8],[11183,8],[14749,8],[15603,8],[16902,8],[18013,8],[21586,8],[22437,8],[23733,8],[24841,8],[27822,8],[28674,8],[29971,8],[31080,8]]},"651":{"position":[[1729,8],[2581,8],[3878,8],[4987,8],[7978,8],[8833,8],[10133,8],[11245,8],[14322,8],[15175,8],[16473,8],[17583,8],[20645,8],[21498,8],[22796,8],[23906,8]]},"669":{"position":[[5128,8],[6005,8],[7482,8],[8685,8]]},"671":{"position":[[1519,8],[2424,8],[3929,8],[5160,8]]},"691":{"position":[[748,8],[1692,8],[3295,8],[4575,8],[7296,8],[8148,8],[9445,8],[10554,8],[13291,8],[14143,8],[15440,8],[16549,8],[18977,8],[19831,8],[21130,8],[22241,8],[24603,8],[25456,8],[26754,8],[27864,8]]},"701":{"position":[[1443,8],[2296,8],[3594,8],[4704,8],[7061,8],[7913,8],[9210,8],[10319,8]]},"703":{"position":[[567,8],[1427,8],[2887,8],[4073,8],[6451,8],[7307,8],[8608,8],[9721,8]]},"705":{"position":[[542,8],[1505,8],[2905,8],[4127,8],[6819,8],[7704,8],[9248,8],[10469,8],[13081,8],[13967,8],[15512,8],[16734,8],[19383,8],[20236,8],[21534,8],[22644,8],[25046,8],[25897,8],[27193,8],[28301,8]]},"726":{"position":[[581,8],[2235,8],[4784,8],[6814,8],[11899,8],[13093,8],[15005,8],[16545,8],[20036,8],[21160,8],[23002,8],[24472,8],[28635,8],[29487,8],[30784,8],[31893,8],[34394,8],[35247,8],[36545,8],[37655,8],[40011,8],[40867,8],[42168,8],[43281,8],[45653,8],[46510,8],[47812,8],[48926,8]]},"728":{"position":[[677,8],[1530,8],[2828,8],[3938,8],[8596,8],[9445,8],[10739,8],[11845,8],[14513,8],[15371,8],[16674,8],[17789,8],[24955,8],[25812,8],[27114,8],[28228,8],[33203,8],[34051,8],[35344,8],[36449,8],[42763,8],[43611,8],[44904,8],[46009,8]]},"745":{"position":[[2208,8],[3024,8],[4440,8],[5582,8],[7892,8],[8746,8],[10045,8],[11156,8],[13582,8],[14398,8],[15814,8],[16956,8],[19223,8],[20077,8],[21376,8],[22487,8],[24849,8],[25704,8],[27004,8],[28116,8],[32583,8],[33437,8],[34736,8],[35847,8],[38209,8],[39063,8],[40362,8],[41473,8]]},"747":{"position":[[2737,8],[3782,8],[5486,8],[6867,8],[10051,8],[10907,8],[12208,8],[13321,8]]},"749":{"position":[[682,8],[1522,8],[2962,8],[4128,8],[6923,8],[7795,8],[9267,8],[10465,8],[12814,8],[13668,8],[14967,8],[16078,8]]},"751":{"position":[[3379,8],[4279,8],[5838,8],[7074,8],[9352,8],[10263,8],[11121,8],[12424,8],[13539,8],[17697,8],[18535,8],[19973,8],[21137,8]]},"761":{"position":[[2985,8],[4320,8],[6432,8],[8123,8]]},"767":{"position":[[812,8],[1661,8],[2955,8],[4061,8],[6500,8],[7353,8],[8651,8],[9761,8],[12225,8],[13100,8],[14575,8],[15776,8],[18135,8],[18985,8],[20280,8],[21387,8]]},"769":{"position":[[4927,8],[5772,8],[7062,8],[8164,8],[10732,8],[11975,8],[13936,8],[15525,8],[19275,8],[20273,8],[21930,8],[23264,8],[26214,8],[27063,8],[28357,8],[29463,8]]},"771":{"position":[[1472,8],[2525,8],[4237,8],[5626,8],[8909,8],[9927,8],[11409,8],[12716,8],[15835,8],[16854,8],[18337,8],[19645,8]]},"773":{"position":[[3713,8],[6304,8],[10144,8],[13171,8]]},"795":{"position":[[894,8],[1709,8],[3124,8],[4265,8],[6542,8],[7361,8],[8780,8],[9925,8],[12226,8],[13188,8],[14868,8],[16176,8],[19460,8],[20313,8],[21611,8],[22721,8],[25159,8],[26010,8],[27306,8],[28414,8]]},"797":{"position":[[3312,8],[4327,8],[6119,8],[7490,8],[10788,8],[11644,8],[12945,8],[14058,8]]},"799":{"position":[[3217,8],[4120,8],[5682,8],[6921,8],[9742,8],[10840,8],[12715,8],[14169,8],[17972,8],[18822,8],[20117,8],[21224,8]]},"801":{"position":[[3412,8],[4377,8],[6060,8],[7371,8],[10664,8],[11519,8],[12819,8],[13931,8]]},"821":{"position":[[2451,8],[3325,8],[4799,8],[5999,8],[8428,8],[9287,8],[10591,8],[11707,8],[14162,8],[15036,8],[16510,8],[17710,8],[20096,8],[20955,8],[22259,8],[23375,8],[25839,8],[26705,8],[28016,8],[29139,8],[32000,8],[33124,8],[34966,8],[36436,8],[39800,8],[40659,8],[41963,8],[43079,8]]},"823":{"position":[[512,8],[1366,8],[2665,8],[3776,8],[7794,8],[8647,8],[9945,8],[11055,8]]},"825":{"position":[[7280,8],[8319,8],[10076,8],[11461,8],[14896,8],[15839,8],[17382,8],[18651,8],[21339,8],[22326,8],[23972,8],[25295,8],[28173,8],[29075,8],[30636,8],[31874,8],[34657,8],[35502,8],[36947,8],[38118,8],[40544,8],[41372,8],[42800,8],[43954,8],[46445,8],[47296,8],[48592,8],[49700,8],[52116,8],[52982,8],[54293,8],[55416,8]]},"844":{"position":[[2209,8],[3028,8],[4447,8],[5592,8],[7917,8],[8774,8],[10076,8],[11190,8],[13629,8],[14444,8],[15859,8],[17000,8],[19263,8],[20116,8],[21414,8],[22524,8],[24881,8],[25736,8],[27036,8],[28148,8],[32103,8],[32956,8],[34254,8],[35364,8],[37721,8],[38575,8],[39874,8],[40985,8]]},"846":{"position":[[2492,8],[3628,8],[5541,8],[7033,8],[10725,8],[11582,8],[12884,8],[13998,8]]},"848":{"position":[[2325,8],[3340,8],[5014,8],[6365,8],[9638,8],[10498,8],[11803,8],[12920,8]]},"850":{"position":[[3198,8],[4386,8],[6292,8],[7826,8],[11308,8],[12169,8],[13475,8],[14593,8],[17066,8],[17929,8],[19237,8],[20357,8],[22763,8],[23628,8],[24938,8],[26060,8],[28555,8],[29418,8],[30726,8],[31846,8],[34252,8],[35115,8],[36423,8],[37543,8]]}}}],["defin",{"_index":41,"t":{"3":{"position":[[578,8],[1532,6]]},"7":{"position":[[731,7]]},"9":{"position":[[577,6]]},"37":{"position":[[131,6],[153,6],[175,6],[1159,6],[2350,6],[4206,6],[5671,6]]},"43":{"position":[[290,6],[770,6],[1744,6]]},"47":{"position":[[198,6],[242,6],[267,6],[331,6],[362,6],[438,6],[537,6],[562,6],[626,6],[657,6],[733,6]]},"49":{"position":[[1097,6],[1394,7]]},"51":{"position":[[146,6],[168,6],[200,6],[666,7]]},"53":{"position":[[343,6],[404,6],[435,6],[1462,6],[2644,8]]},"55":{"position":[[193,6]]},"57":{"position":[[211,6]]},"59":{"position":[[278,6]]},"61":{"position":[[911,6],[932,6],[963,6],[1840,6]]},"77":{"position":[[609,6]]},"97":{"position":[[432,6],[984,6],[1895,6],[2607,6]]},"113":{"position":[[4743,6]]},"123":{"position":[[432,6],[984,6],[1895,6],[2607,6]]},"143":{"position":[[570,7]]},"169":{"position":[[505,6],[693,7],[872,6],[894,6],[919,6],[941,6],[1541,6],[1692,6],[1729,6],[1769,6],[1806,6],[1864,6],[2958,6],[4073,6],[5255,7],[5317,7],[6605,7],[6682,6],[6704,6],[6729,6],[6751,6],[7837,6],[11368,6],[11400,6],[12714,6],[13569,6],[14894,6],[15985,6],[18908,6],[19763,6],[21088,6],[22179,6],[25262,6],[26138,6],[27517,6],[28650,6]]},"171":{"position":[[30,6]]},"173":{"position":[[42,7]]},"175":{"position":[[89,6]]},"179":{"position":[[53,6]]},"183":{"position":[[23,7],[85,7]]},"215":{"position":[[381,6],[1009,6],[1830,6],[2538,6]]},"217":{"position":[[729,6],[1498,6],[2558,6],[3640,6]]},"219":{"position":[[605,6],[1523,6],[2721,6],[4201,6]]},"221":{"position":[[202,7]]},"227":{"position":[[371,6],[419,6],[1228,7],[1290,7],[1496,6]]},"231":{"position":[[150,7],[212,7],[418,6]]},"236":{"position":[[545,6],[1355,6],[2790,6],[3905,6]]},"238":{"position":[[555,6],[1407,6],[2729,6],[3817,6],[6299,6],[7153,6],[8477,6],[9567,6]]},"248":{"position":[[432,6],[984,6],[1895,6],[2607,6]]},"258":{"position":[[318,6],[947,7],[1009,7],[1215,6]]},"262":{"position":[[150,7],[212,7],[418,6]]},"265":{"position":[[855,6],[1697,6],[3009,6],[4087,6]]},"267":{"position":[[566,6],[1371,6],[2801,6],[3911,6],[6270,6],[7113,6],[8426,6],[9505,6]]},"273":{"position":[[361,6],[407,6],[1860,6],[2708,6],[4026,6],[5110,6],[7498,6],[8345,6],[9817,6],[10969,6],[13522,6],[14374,6],[15696,6],[16784,6],[19124,6],[19978,6],[21302,6],[22392,6],[24659,7],[24721,7],[24927,6]]},"279":{"position":[[150,7],[212,7],[418,6]]},"282":{"position":[[807,6],[1616,6],[3050,6],[4164,6]]},"284":{"position":[[598,6],[1451,6],[2774,6],[3863,6]]},"294":{"position":[[404,6],[956,6],[1867,6],[2579,6]]},"298":{"position":[[109,6],[153,6],[207,6]]},"314":{"position":[[61,6],[334,8]]},"320":{"position":[[397,6],[462,6],[486,6],[1549,7],[1611,7],[1817,6]]},"326":{"position":[[150,7],[212,7],[418,6]]},"329":{"position":[[652,6],[1453,6],[2879,6],[3985,6],[6233,6],[7035,6],[8462,6],[9569,6],[12047,6],[13018,6],[14689,6],[16002,6]]},"347":{"position":[[500,6],[555,6],[1858,7],[1920,7],[2126,6]]},"351":{"position":[[150,7],[212,7],[418,6]]},"353":{"position":[[694,6],[1547,6],[2870,6],[3959,6],[6304,6],[7156,6],[8478,6],[9566,6]]},"355":{"position":[[271,6],[294,6],[349,6]]},"357":{"position":[[358,6],[381,6],[452,6]]},"359":{"position":[[813,6],[1682,6],[3176,6],[4350,6],[6989,6],[7842,6],[9165,6],[10254,6],[12803,6],[13656,6],[14979,6],[16068,6]]},"365":{"position":[[441,6],[463,6],[1360,7],[1422,7],[1628,6]]},"369":{"position":[[150,7],[212,7],[418,6]]},"373":{"position":[[89,8],[226,6],[258,6]]},"375":{"position":[[728,6],[1588,6],[2918,6],[4014,6]]},"382":{"position":[[98,6],[144,6],[1673,6],[2523,6],[3843,6],[4929,6]]},"384":{"position":[[103,6],[137,6]]},"390":{"position":[[781,8]]},"392":{"position":[[551,6],[583,6]]},"404":{"position":[[331,6],[378,6],[435,6]]},"406":{"position":[[676,6],[1651,6],[3310,6],[4600,6],[7430,6],[8285,6],[9610,6],[10701,6]]},"408":{"position":[[578,6],[1663,6],[3432,6],[4832,6]]},"410":{"position":[[524,6],[1379,6],[2704,6],[3795,6]]},"414":{"position":[[340,8]]},"416":{"position":[[3,6],[746,7]]},"418":{"position":[[0,8],[354,8],[474,6]]},"420":{"position":[[474,8]]},"422":{"position":[[4048,8]]},"424":{"position":[[23,7],[2902,6],[2917,6],[2931,6],[2946,6],[2961,6],[2979,6],[2996,6],[3014,6],[3061,6],[3075,6],[3090,6],[3105,6],[3131,6],[3159,6],[3204,6],[3240,6],[3254,6],[3282,6]]},"426":{"position":[[514,6],[1132,6],[1453,7],[2866,6],[2931,8],[3174,8],[3860,6],[4547,6],[5305,7],[5348,6],[6139,6],[7494,7],[9244,6],[9286,6],[9329,6],[9372,6],[9396,6],[9451,6],[9559,6],[9614,6],[9770,6],[9837,6],[9879,6],[9922,6],[9965,6],[9989,6],[10044,6],[10152,6],[10207,6]]},"428":{"position":[[14,7],[1365,7]]},"430":{"position":[[28,8],[203,8]]},"440":{"position":[[341,6],[363,6],[939,7],[1001,7],[1207,6]]},"442":{"position":[[150,7],[212,7],[418,6]]},"446":{"position":[[607,6],[1429,6],[2876,6],[4003,6]]},"448":{"position":[[628,6],[1488,6],[2818,6],[3914,6],[6465,6],[7326,6],[8657,6],[9754,6]]},"452":{"position":[[911,7]]},"456":{"position":[[147,6],[191,6],[213,6],[281,6],[303,6],[325,6],[1405,7],[1569,6],[1613,6],[1637,6],[1705,6],[1729,6],[1751,6]]},"458":{"position":[[368,7]]},"460":{"position":[[1267,6],[1389,6],[1433,6],[1457,6],[1539,6],[1563,6],[1599,6]]},"462":{"position":[[752,6],[823,6],[2389,7],[2585,8],[2794,7]]},"466":{"position":[[930,6],[968,6]]},"474":{"position":[[752,6],[781,6],[803,6],[856,6],[2846,7],[2908,7],[3114,6]]},"480":{"position":[[150,7],[212,7],[418,6]]},"482":{"position":[[694,6],[1550,6],[2876,6],[3968,6],[6328,6],[7183,6],[8508,6],[9599,6]]},"484":{"position":[[235,6],[264,6],[286,6],[311,6],[387,6]]},"486":{"position":[[654,6],[1511,6],[2838,6],[3931,6],[6453,6],[7310,6],[8637,6],[9730,6]]},"492":{"position":[[386,6],[432,6],[1231,7],[1293,7],[1499,6]]},"496":{"position":[[150,7],[212,7],[418,6]]},"500":{"position":[[368,6],[414,6],[438,6]]},"502":{"position":[[172,6],[218,6],[242,6]]},"504":{"position":[[582,6],[1390,6],[2823,6],[3936,6]]},"506":{"position":[[584,6],[1472,6],[2985,6],[4178,6]]},"508":{"position":[[701,6],[1561,6],[2891,6],[3987,6]]},"514":{"position":[[331,6],[1001,7],[1063,7],[1269,6]]},"518":{"position":[[150,7],[212,7],[418,6]]},"522":{"position":[[768,6],[1628,6],[3113,6],[4278,6]]},"524":{"position":[[833,6],[1689,6],[3015,6],[4107,6]]},"530":{"position":[[346,6],[978,7],[1040,7],[1246,6]]},"534":{"position":[[150,7],[212,7],[418,6]]},"538":{"position":[[11,6],[225,6],[274,6]]},"540":{"position":[[591,6],[1401,6],[2836,6],[3951,6]]},"542":{"position":[[924,6],[1811,6],[3323,6],[4515,6]]},"544":{"position":[[761,6],[1623,6],[2955,6],[4053,6]]},"550":{"position":[[306,6],[931,7],[993,7],[1199,6]]},"554":{"position":[[150,7],[212,7],[418,6]]},"556":{"position":[[670,6],[1531,6],[3076,6],[4252,6]]},"558":{"position":[[131,6],[177,6],[216,6],[1031,7],[1082,7]]},"560":{"position":[[677,6],[1534,6],[3075,6],[4247,6]]},"562":{"position":[[688,6],[1497,6],[2931,6],[4045,6]]},"564":{"position":[[534,6],[1375,6],[2686,6],[3763,6],[6048,6],[6889,6],[8200,6],[9277,6]]},"566":{"position":[[571,6],[1372,6],[2798,6],[3904,6],[6108,6],[6950,6],[8262,6],[9340,6]]},"572":{"position":[[414,6],[436,6],[1402,7],[1464,7],[1670,6]]},"576":{"position":[[150,7],[212,7],[418,6]]},"581":{"position":[[693,6],[1544,6],[2865,6],[3952,6]]},"588":{"position":[[943,6],[1839,6],[3257,6],[4397,6],[7099,6],[7976,6],[9355,6],[10474,6],[13080,6],[13967,6],[15356,6],[16485,6]]},"590":{"position":[[1146,6],[1924,6],[3224,6],[4246,6]]},"595":{"position":[[684,6],[1574,6],[2961,6],[4110,6],[6596,6],[7486,6],[8873,6],[10022,6]]},"600":{"position":[[605,6],[1588,6],[3076,6],[4330,6]]},"608":{"position":[[325,7]]},"610":{"position":[[366,6],[410,6],[1175,7],[1237,7],[1443,6]]},"614":{"position":[[150,7],[212,7],[418,6]]},"617":{"position":[[199,6],[223,6],[267,6]]},"619":{"position":[[820,6],[1746,6],[3297,6],[4528,6]]},"621":{"position":[[635,6],[1498,6],[2831,6],[3930,6]]},"625":{"position":[[135,6],[166,6],[250,6],[1119,7],[1518,6],[1606,8]]},"627":{"position":[[545,6],[1570,6],[3279,6],[4619,6]]},"629":{"position":[[564,6],[1419,6],[2744,6],[3835,6]]},"631":{"position":[[545,6],[1426,6],[2932,6],[4118,6],[6603,6],[7459,6],[8785,6],[9877,6],[12236,6],[13095,6],[14424,6],[15519,6]]},"637":{"position":[[519,7],[581,7],[787,6]]},"641":{"position":[[150,7],[212,7],[418,6]]},"645":{"position":[[305,6],[358,6],[413,6]]},"649":{"position":[[116,6],[169,6],[224,6],[1824,6],[2676,6],[3998,6],[5086,6],[7996,6],[8848,6],[10170,6],[11258,6],[14817,6],[15672,6],[16997,6],[18088,6],[21654,6],[22506,6],[23828,6],[24916,6],[27890,6],[28743,6],[30066,6],[31155,6]]},"651":{"position":[[177,6],[199,6],[254,6],[1797,6],[2650,6],[3973,6],[5062,6],[8046,6],[8902,6],[10228,6],[11320,6],[14390,6],[15244,6],[16568,6],[17658,6],[20713,6],[21567,6],[22891,6],[23981,6]]},"659":{"position":[[24,7],[86,7]]},"661":{"position":[[929,6],[951,6],[982,6],[1035,6],[1064,6],[1095,6],[1138,6],[1221,6],[1248,6],[1272,6]]},"669":{"position":[[1122,6],[1144,6],[1195,6],[1249,6],[1312,6],[5196,6],[6074,6],[7577,6],[8760,6]]},"671":{"position":[[1587,6],[2493,6],[4024,6],[5235,6]]},"673":{"position":[[129,6],[151,6],[202,6],[256,6],[319,6],[373,6],[402,6],[433,6],[476,6],[559,6],[586,6],[610,6]]},"679":{"position":[[348,6],[369,6],[1090,7],[1152,7],[1358,6]]},"683":{"position":[[150,7],[212,7],[418,6]]},"685":{"position":[[414,6]]},"687":{"position":[[326,6],[347,6]]},"689":{"position":[[275,6],[798,6],[819,6],[841,6],[869,6]]},"691":{"position":[[816,6],[1761,6],[3390,6],[4650,6],[7364,6],[8217,6],[9540,6],[10629,6],[13359,6],[14212,6],[15535,6],[16624,6],[19045,6],[19900,6],[21225,6],[22316,6],[24671,6],[25525,6],[26849,6],[27939,6]]},"697":{"position":[[223,7],[285,7],[491,6]]},"699":{"position":[[304,6],[326,6],[1027,6],[1049,6]]},"701":{"position":[[306,6],[328,6],[360,6],[385,6],[1511,6],[2365,6],[3689,6],[4779,6],[7129,6],[7982,6],[9305,6],[10394,6]]},"703":{"position":[[635,6],[1496,6],[2982,6],[4148,6],[6519,6],[7376,6],[8703,6],[9796,6]]},"705":{"position":[[610,6],[1574,6],[3000,6],[4202,6],[6887,6],[7773,6],[9343,6],[10544,6],[13149,6],[14036,6],[15607,6],[16809,6],[19451,6],[20305,6],[21629,6],[22719,6],[25114,6],[25966,6],[27288,6],[28376,6]]},"707":{"position":[[166,6],[188,6]]},"724":{"position":[[662,6],[713,6],[775,6]]},"726":{"position":[[649,6],[2304,6],[4879,6],[6889,6],[11967,6],[13162,6],[15100,6],[16620,6],[20104,6],[21229,6],[23097,6],[24547,6],[28703,6],[29556,6],[30879,6],[31968,6],[34462,6],[35316,6],[36640,6],[37730,6],[40079,6],[40936,6],[42263,6],[43356,6],[45721,6],[46579,6],[47907,6],[49001,6]]},"728":{"position":[[745,6],[1599,6],[2923,6],[4013,6],[6138,6],[6169,6],[7202,6],[7233,6],[7275,6],[7337,6],[8664,6],[9514,6],[10834,6],[11920,6],[14581,6],[15440,6],[16769,6],[17864,6],[19964,6],[20862,6],[20893,6],[23413,6],[23444,6],[23521,6],[23583,6],[25023,6],[25881,6],[27209,6],[28303,6],[31134,6],[31165,6],[31249,6],[31283,6],[31360,6],[33271,6],[34120,6],[35439,6],[36524,6],[38984,6],[39015,6],[39558,6],[39589,6],[40662,6],[40693,6],[40767,6],[40801,6],[40878,6],[42831,6],[43680,6],[44999,6],[46084,6]]},"745":{"position":[[338,6],[360,6],[383,6],[405,6],[431,6],[1302,6],[2276,6],[3093,6],[4535,6],[5657,6],[7960,6],[8815,6],[10140,6],[11231,6],[13650,6],[14467,6],[15909,6],[17031,6],[19291,6],[20146,6],[21471,6],[22562,6],[24917,6],[25773,6],[27099,6],[28191,6],[30409,6],[30442,6],[30475,6],[30511,6],[30546,6],[31590,6],[32651,6],[33506,6],[34831,6],[35922,6],[38277,6],[39132,6],[40457,6],[41548,6]]},"747":{"position":[[387,6],[831,6],[877,6],[923,6],[972,6],[1020,6],[2805,6],[3851,6],[5581,6],[6942,6],[10119,6],[10976,6],[12303,6],[13396,6]]},"749":{"position":[[750,6],[1591,6],[3057,6],[4203,6],[6991,6],[7864,6],[9362,6],[10540,6],[12882,6],[13737,6],[15062,6],[16153,6]]},"751":{"position":[[992,6],[1329,6],[1375,6],[1421,6],[1470,6],[1518,6],[1552,6],[3447,6],[4348,6],[5933,6],[7149,6],[10331,6],[11190,6],[12519,6],[13614,6],[15667,6],[17765,6],[18604,6],[20068,6],[21212,6],[23169,6],[23244,6],[23313,6],[23404,6],[23471,6],[23559,6],[23616,6],[23645,6]]},"759":{"position":[[24,7],[86,7]]},"761":{"position":[[580,6],[634,6],[658,6],[710,6],[734,6],[777,6],[828,6],[854,6],[3053,6],[4389,6],[6527,6],[8198,6]]},"767":{"position":[[880,6],[1730,6],[3050,6],[4136,6],[6568,6],[7422,6],[8746,6],[9836,6],[12293,6],[13169,6],[14670,6],[15851,6],[18203,6],[19054,6],[20375,6],[21462,6]]},"769":{"position":[[280,6],[505,6],[1321,6],[1352,6],[1405,6],[1442,6],[2821,6],[2845,6],[2897,6],[2921,6],[3001,6],[3051,6],[4995,6],[5841,6],[7157,6],[8239,6],[10800,6],[12044,6],[14031,6],[15600,6],[19343,6],[20342,6],[22025,6],[23339,6],[26282,6],[27132,6],[28452,6],[29538,6]]},"771":{"position":[[1540,6],[2594,6],[4332,6],[5701,6],[8977,6],[9996,6],[11504,6],[12791,6],[15903,6],[16923,6],[18432,6],[19720,6]]},"773":{"position":[[123,6],[154,6],[207,6],[244,6],[360,6],[384,6],[436,6],[460,6],[540,6],[590,6],[641,6],[667,6],[728,6],[780,6],[3781,6],[6373,6],[10239,6],[13246,6]]},"775":{"position":[[273,6],[316,6],[336,6],[367,6],[420,6],[457,6],[573,6],[597,6],[649,6],[673,6],[753,6],[803,6],[854,6],[880,6],[941,6],[993,6]]},"793":{"position":[[700,6],[733,6],[770,6]]},"795":{"position":[[962,6],[1778,6],[3219,6],[4340,6],[6610,6],[7430,6],[8875,6],[10000,6],[12294,6],[13257,6],[14963,6],[16251,6],[19528,6],[20382,6],[21706,6],[22796,6],[25227,6],[26079,6],[27401,6],[28489,6]]},"797":{"position":[[1197,6],[1221,6],[1251,6],[1314,6],[1381,6],[3380,6],[4396,6],[6214,6],[7565,6],[10856,6],[11713,6],[13040,6],[14133,6]]},"799":{"position":[[377,6],[401,6],[832,6],[879,6],[938,6],[1001,6],[1068,6],[1138,6],[1162,6],[3285,6],[4189,6],[5777,6],[6996,6],[9810,6],[10909,6],[12810,6],[14244,6],[18040,6],[18891,6],[20212,6],[21299,6]]},"801":{"position":[[688,6],[735,6],[794,6],[847,6],[904,6],[964,6],[988,6],[3480,6],[4446,6],[6155,6],[7446,6],[10732,6],[11588,6],[12914,6],[14006,6]]},"819":{"position":[[1057,6],[1085,6],[1115,6],[1137,6]]},"821":{"position":[[629,6],[657,6],[687,6],[709,6],[1486,6],[2519,6],[3394,6],[4894,6],[6074,6],[8496,6],[9356,6],[10686,6],[11782,6],[14230,6],[15105,6],[16605,6],[17785,6],[20164,6],[21024,6],[22354,6],[23450,6],[25907,6],[26774,6],[28111,6],[29214,6],[32068,6],[33193,6],[35061,6],[36511,6],[39868,6],[40728,6],[42058,6],[43154,6]]},"823":{"position":[[580,6],[1435,6],[2760,6],[3851,6],[6410,6],[6438,6],[6484,6],[6540,6],[7862,6],[8716,6],[10040,6],[11130,6]]},"825":{"position":[[1666,6],[1703,6],[1810,6],[3093,6],[3130,6],[3237,6],[4536,6],[4564,6],[4610,6],[4666,6],[4710,6],[4747,6],[4854,6],[7348,6],[8388,6],[10171,6],[11536,6],[14964,6],[15908,6],[17477,6],[18726,6],[21407,6],[22395,6],[24067,6],[25370,6],[28241,6],[29144,6],[30731,6],[31949,6],[34725,6],[35571,6],[37042,6],[38193,6],[40612,6],[41441,6],[42895,6],[44029,6],[46513,6],[47365,6],[48687,6],[49775,6],[52184,6],[53051,6],[54388,6],[55491,6]]},"844":{"position":[[427,6],[448,6],[470,6],[495,6],[1249,6],[2277,6],[3097,6],[4542,6],[5667,6],[7985,6],[8843,6],[10171,6],[11265,6],[13697,6],[14513,6],[15954,6],[17075,6],[19331,6],[20185,6],[21509,6],[22599,6],[24949,6],[25805,6],[27131,6],[28223,6],[30453,6],[30474,6],[30505,6],[30540,6],[32171,6],[33025,6],[34349,6],[35439,6],[37789,6],[38644,6],[39969,6],[41060,6]]},"846":{"position":[[458,6],[494,6],[540,6],[590,6],[662,6],[2560,6],[3697,6],[5636,6],[7108,6],[10793,6],[11651,6],[12979,6],[14073,6]]},"848":{"position":[[532,6],[558,6],[594,6],[640,6],[690,6],[2393,6],[3409,6],[5109,6],[6440,6],[9706,6],[10567,6],[11898,6],[12995,6],[15062,6],[16557,6],[16614,6],[16682,6],[16757,6],[16829,6],[16877,6]]},"850":{"position":[[603,6],[660,6],[728,6],[803,6],[883,6],[931,6],[3266,6],[4455,6],[6387,6],[7901,6],[11376,6],[12238,6],[13570,6],[14668,6],[17134,6],[17998,6],[19332,6],[20432,6],[22831,6],[23697,6],[25033,6],[26135,6],[28623,6],[29487,6],[30821,6],[31921,6],[34320,6],[35184,6],[36518,6],[37618,6]]}}}],["definit",{"_index":636,"t":{"47":{"position":[[3802,10],[3917,11]]},"49":{"position":[[67,10],[1383,10],[1833,10]]},"51":{"position":[[101,11],[655,10],[843,11],[1320,10]]},"55":{"position":[[512,10]]},"57":{"position":[[589,10]]},"59":{"position":[[616,10]]},"169":{"position":[[638,12],[658,10],[827,11],[1512,12],[5275,10],[5406,10],[5577,12],[5601,10],[7621,10],[8711,11],[10384,10],[11185,10],[11323,11]]},"173":{"position":[[7,10]]},"175":{"position":[[60,12]]},"183":{"position":[[43,10],[174,10]]},"185":{"position":[[11,10]]},"187":{"position":[[63,10]]},"227":{"position":[[1248,10],[1379,10]]},"231":{"position":[[170,10],[301,10]]},"258":{"position":[[967,10],[1098,10]]},"262":{"position":[[170,10],[301,10]]},"267":{"position":[[5688,10]]},"273":{"position":[[24679,10],[24810,10]]},"279":{"position":[[170,10],[301,10]]},"320":{"position":[[1569,10],[1700,10]]},"326":{"position":[[170,10],[301,10]]},"347":{"position":[[1878,10],[2009,10]]},"351":{"position":[[170,10],[301,10]]},"357":{"position":[[174,10]]},"365":{"position":[[1380,10],[1511,10]]},"369":{"position":[[170,10],[301,10]]},"371":{"position":[[22,11]]},"386":{"position":[[15,11],[1046,10]]},"426":{"position":[[68,10],[350,10],[1082,10],[1194,10],[1429,11],[2767,11],[2797,10],[3284,11],[3809,10],[3921,10],[4496,10],[4609,10],[6088,10],[6189,10],[6989,11],[7251,10],[7415,11],[7589,10],[8115,11],[8368,10],[8502,11],[8751,10],[8892,11],[9058,10],[9136,11],[9166,10],[9664,11]]},"440":{"position":[[959,10],[1090,10]]},"442":{"position":[[170,10],[301,10]]},"460":{"position":[[79,12]]},"474":{"position":[[2866,10],[2997,10]]},"480":{"position":[[170,10],[301,10]]},"484":{"position":[[38,10]]},"492":{"position":[[1251,10],[1382,10]]},"496":{"position":[[170,10],[301,10]]},"498":{"position":[[371,10]]},"514":{"position":[[1021,10],[1152,10]]},"518":{"position":[[170,10],[301,10]]},"530":{"position":[[998,10],[1129,10]]},"534":{"position":[[170,10],[301,10]]},"550":{"position":[[951,10],[1082,10]]},"554":{"position":[[170,10],[301,10]]},"572":{"position":[[1422,10],[1553,10]]},"576":{"position":[[170,10],[301,10]]},"610":{"position":[[1195,10],[1326,10]]},"614":{"position":[[170,10],[301,10]]},"617":{"position":[[100,10]]},"619":{"position":[[14,10]]},"637":{"position":[[539,10],[670,10],[1023,10]]},"641":{"position":[[170,10],[301,10],[654,10]]},"645":{"position":[[147,11],[1229,10],[1399,11]]},"649":{"position":[[7139,10],[7171,11],[13328,10],[13360,11],[20225,10],[20257,11]]},"651":{"position":[[922,11],[7135,10],[7167,11],[13412,10],[13444,11],[19800,10],[19832,11]]},"659":{"position":[[44,10],[175,10]]},"669":{"position":[[367,12],[653,11],[755,11],[878,10],[1060,10],[2407,11]]},"679":{"position":[[1110,10],[1241,10]]},"683":{"position":[[170,10],[301,10]]},"691":{"position":[[18,11]]},"697":{"position":[[243,10],[374,10]]},"701":{"position":[[1003,11]]},"705":{"position":[[76,10]]},"745":{"position":[[30340,12],[32169,11]]},"759":{"position":[[44,10],[175,10]]},"769":{"position":[[1265,10],[2534,10],[2764,10],[4160,10]]},"799":{"position":[[307,10]]},"825":{"position":[[4249,10]]},"844":{"position":[[30380,12],[31689,11]]}}}],["degre",{"_index":1085,"t":{"133":{"position":[[298,6]]}}}],["delay",{"_index":1589,"t":{"296":{"position":[[3361,5]]}}}],["deleg",{"_index":2807,"t":{"815":{"position":[[223,9]]}}}],["delet",{"_index":328,"t":{"21":{"position":[[386,6]]},"65":{"position":[[95,7]]},"113":{"position":[[509,9],[4211,9]]},"252":{"position":[[3,6],[84,6],[272,8],[556,8],[984,7],[1259,10],[1413,6],[1673,12]]},"267":{"position":[[85,8],[804,8],[1893,8],[3368,7],[4543,10],[5060,12],[5401,6],[5460,8]]},"271":{"position":[[720,6]]},"282":{"position":[[265,6],[1045,8],[2138,8],[3617,7],[4796,10],[5317,12],[5662,6],[5725,8]]},"284":{"position":[[37,8]]},"292":{"position":[[74,7]]},"296":{"position":[[1132,8],[3414,6]]},"329":{"position":[[24,6],[5753,6],[6471,8],[7557,8],[9029,7],[10201,10],[10715,12],[11053,6],[11109,8],[11449,7],[12405,8],[13735,8],[15413,7],[16763,10],[17425,12],[17751,8]]},"452":{"position":[[949,7]]},"462":{"position":[[3321,6],[3487,6]]},"464":{"position":[[593,6]]},"472":{"position":[[193,6],[395,8],[486,8]]},"486":{"position":[[67,6],[5856,6]]},"566":{"position":[[92,6],[809,8],[1894,8],[3365,7],[4536,10],[5049,12],[5386,6],[5441,8]]},"631":{"position":[[783,8],[1948,8],[3499,7],[4750,10],[5342,12],[5709,6],[5794,8]]},"661":{"position":[[654,9]]},"663":{"position":[[86,6],[195,7],[304,6],[413,7],[468,6]]},"665":{"position":[[201,6]]},"667":{"position":[[138,6],[2043,6],[5738,6],[9438,6]]},"671":{"position":[[1825,8],[1839,6],[3015,8],[3048,6],[4591,7],[4633,6],[5867,10],[5893,6],[6484,12],[6841,6],[6916,8],[6928,6],[12722,6],[12753,6],[12783,6],[12842,6],[12900,6]]},"689":{"position":[[558,7]]},"705":{"position":[[13387,8],[14558,8],[16174,7],[17441,10],[18050,12],[18472,6],[18550,6],[18621,8],[18877,6]]},"751":{"position":[[17243,6]]},"771":{"position":[[1778,8],[3116,8],[4899,7],[6333,10],[7107,12],[7532,6],[7620,6],[7684,8]]}}}],["demo",{"_index":382,"t":{"27":{"position":[[594,4]]},"43":{"position":[[449,4],[2254,7],[2276,4],[2666,4],[2815,6],[3021,4],[3160,4],[3277,4]]},"111":{"position":[[1992,5]]},"113":{"position":[[3233,5]]}}}],["demo\"}).execut",{"_index":572,"t":{"43":{"position":[[1249,17]]}}}],["deni",{"_index":1632,"t":{"316":{"position":[[623,7]]},"353":{"position":[[11524,4]]},"357":{"position":[[81,7]]},"359":{"position":[[18024,4]]},"380":{"position":[[361,7]]},"771":{"position":[[448,4],[15366,6]]},"801":{"position":[[508,6],[2682,7]]}}}],["denot",{"_index":2029,"t":{"522":{"position":[[1026,7],[2189,7],[3728,7],[4941,7],[5958,7]]},"689":{"position":[[491,8]]}}}],["depart",{"_index":46,"t":{"3":{"position":[[705,13]]}}}],["depend",{"_index":881,"t":{"107":{"position":[[371,9]]},"213":{"position":[[162,9]]},"310":{"position":[[52,7]]},"643":{"position":[[96,9]]},"655":{"position":[[328,7]]},"675":{"position":[[294,7]]},"755":{"position":[[120,6],[360,7]]}}}],["depends_on",{"_index":1192,"t":{"145":{"position":[[1900,11],[2190,11],[4574,11],[4841,11]]}}}],["deploy",{"_index":198,"t":{"7":{"position":[[784,6]]},"35":{"position":[[32,6],[318,6],[604,6],[890,6],[1176,6],[1476,6]]},"93":{"position":[[32,6],[355,6],[678,6],[1001,6],[1324,6],[1585,6]]},"105":{"position":[[11,6],[375,6]]},"119":{"position":[[32,6],[355,6],[678,6],[1001,6],[1324,6],[1585,6]]},"133":{"position":[[1071,10]]},"137":{"position":[[3,6]]},"151":{"position":[[55,12]]},"157":{"position":[[400,10]]},"159":{"position":[[475,11]]},"161":{"position":[[843,10]]},"244":{"position":[[32,6],[319,6],[606,6],[893,6],[1180,6],[1441,6]]},"290":{"position":[[28,6],[350,6],[672,6],[959,6],[1246,6]]}}}],["deprec",{"_index":703,"t":{"53":{"position":[[3318,10]]},"452":{"position":[[36,11]]},"468":{"position":[[23,11],[47,11]]}}}],["depth",{"_index":1117,"t":{"133":{"position":[[1806,5],[2035,5]]}}}],["describ",{"_index":602,"t":{"45":{"position":[[219,9],[500,9]]},"47":{"position":[[3718,9]]},"169":{"position":[[5718,10]]},"420":{"position":[[652,8],[1309,9]]},"426":{"position":[[1308,9],[6313,9]]},"462":{"position":[[2674,9]]},"619":{"position":[[173,10]]},"625":{"position":[[1728,8]]},"645":{"position":[[1164,9]]},"687":{"position":[[42,9]]},"689":{"position":[[39,9]]},"825":{"position":[[1491,10],[1533,10],[2738,9]]}}}],["descript",{"_index":1281,"t":{"155":{"position":[[442,11],[530,11]]},"420":{"position":[[1075,11]]}}}],["design",{"_index":265,"t":{"15":{"position":[[173,8]]},"456":{"position":[[926,9]]},"583":{"position":[[9,8],[101,8]]},"608":{"position":[[178,6]]},"793":{"position":[[324,12]]}}}],["despit",{"_index":1112,"t":{"133":{"position":[[1659,7]]},"801":{"position":[[12,7]]}}}],["detail",{"_index":1660,"t":{"333":{"position":[[168,7]]},"416":{"position":[[1020,8]]},"675":{"position":[[360,7]]},"717":{"position":[[161,9]]},"732":{"position":[[320,8]]},"738":{"position":[[128,9]]},"745":{"position":[[1238,7],[31553,7]]},"751":{"position":[[15528,7]]},"777":{"position":[[350,7]]},"785":{"position":[[96,9]]},"813":{"position":[[297,9]]},"821":{"position":[[1444,7]]},"837":{"position":[[166,9]]},"844":{"position":[[1208,7],[31389,7]]},"848":{"position":[[14919,7]]}}}],["detect",{"_index":778,"t":{"73":{"position":[[368,6]]},"726":{"position":[[28210,6]]}}}],["determin",{"_index":5,"t":{"3":{"position":[[64,9]]},"5":{"position":[[342,9]]},"17":{"position":[[102,11]]},"25":{"position":[[67,12]]},"91":{"position":[[63,9]]},"117":{"position":[[70,9]]},"133":{"position":[[932,11]]},"169":{"position":[[52,11],[2831,13],[9183,13],[9651,13]]},"416":{"position":[[375,9]]},"422":{"position":[[4383,11]]},"581":{"position":[[160,9]]},"745":{"position":[[1097,10]]},"749":{"position":[[6221,11]]},"751":{"position":[[9429,11]]},"821":{"position":[[1303,10]]},"844":{"position":[[1067,10]]}}}],["develop",{"_index":174,"t":{"7":{"position":[[270,9]]},"149":{"position":[[33,11]]},"227":{"position":[[108,7]]},"258":{"position":[[108,7]]},"273":{"position":[[108,7]]},"320":{"position":[[108,7]]},"347":{"position":[[98,7]]},"365":{"position":[[99,7]]},"392":{"position":[[98,7]]},"440":{"position":[[108,7]]},"474":{"position":[[108,7]]},"492":{"position":[[108,7]]},"514":{"position":[[108,7]]},"530":{"position":[[108,7]]},"536":{"position":[[6,7]]},"550":{"position":[[108,7]]},"572":{"position":[[108,7]]},"610":{"position":[[98,7]]},"637":{"position":[[99,7]]},"679":{"position":[[108,7]]},"695":{"position":[[29,12]]},"713":{"position":[[108,7]]},"734":{"position":[[108,7]]},"738":{"position":[[22,7]]},"781":{"position":[[108,7]]},"809":{"position":[[108,7]]},"833":{"position":[[108,7]]}}}],["development/prod",{"_index":1353,"t":{"169":{"position":[[3941,18]]}}}],["devic",{"_index":2316,"t":{"677":{"position":[[914,6]]},"781":{"position":[[915,7],[1247,6]]},"785":{"position":[[284,6]]},"787":{"position":[[93,8],[165,8],[208,7],[236,6],[286,6],[339,6]]},"789":{"position":[[260,6],[309,6],[361,6],[388,6],[413,6],[426,6],[473,6],[500,6]]},"791":{"position":[[183,8]]},"793":{"position":[[90,8],[162,8],[253,6],[411,6],[474,8],[625,6],[683,6],[879,9]]},"795":{"position":[[67,6],[116,6],[228,7],[284,6],[445,6],[18873,7]]},"797":{"position":[[100,6],[695,6],[821,6],[1064,7],[1180,6],[1482,9],[2538,6],[2589,6],[2701,7]]},"799":{"position":[[27,8],[50,6],[92,6],[112,7],[140,6],[189,6],[241,7],[260,6],[326,6],[815,6],[1271,9],[9253,7],[17486,6],[17506,6]]},"801":{"position":[[671,6],[1097,9]]},"805":{"position":[[34,7]]}}}],["device:1",{"_index":2727,"t":{"795":{"position":[[491,9],[1270,12],[3893,10],[5950,8],[6140,8],[6922,12],[9553,10],[11622,8],[11823,9],[12602,12],[12679,12],[12749,12],[15637,10],[15724,10],[15804,10],[18173,8],[18296,8],[18412,8],[18955,9],[19002,9],[19057,9],[19859,11],[20952,11],[22326,11],[23851,8],[24579,11],[24610,10],[24756,9],[25555,11],[26646,11],[28018,11],[29539,8],[30260,11],[30291,10],[30464,8],[30510,8],[30550,8],[30596,8],[30636,8],[30686,8],[30730,8],[30780,8],[30824,8],[30867,8],[30903,8],[30946,8]]},"797":{"position":[[3685,12],[3749,12],[3822,12],[3888,12],[6885,10],[6959,10],[7042,10],[7118,10],[9599,8],[9709,8],[9828,8],[9940,8],[10364,8],[11190,11],[12286,11],[13663,11],[15194,8],[15931,11],[15962,10],[16145,8],[16191,8],[16231,8],[16277,8],[16317,8],[16367,8],[16411,8],[16461,8],[16505,8],[16548,8],[16584,8],[16627,8],[16667,8],[16716,8],[16758,8],[16806,8],[16849,8],[16902,8],[16948,8],[17000,8],[17047,8],[17093,8],[17131,8],[17176,8]]},"801":{"position":[[117,9],[397,9],[2452,8],[2748,8],[2807,9],[3789,12],[3867,12],[3938,12],[6830,10],[6918,10],[6999,10],[9375,8],[9499,8],[9616,8],[9961,8],[10047,8],[11064,11],[12159,11],[13535,11],[15064,8],[15797,11],[15828,10],[15998,8],[16049,8],[16093,8],[16137,8]]}}}],["device:2",{"_index":2771,"t":{"799":{"position":[[10140,12],[10318,12],[13506,10],[13704,10],[16469,8],[16739,8],[17548,8],[18368,11],[19458,11],[20829,11],[22348,8],[23067,11],[23098,10],[23331,8],[23377,8],[23416,8],[23462,8],[23501,8],[23551,8],[23594,8],[23644,8],[23687,8],[23730,8],[23766,8],[23809,8],[23848,8],[23897,8],[23939,8],[23987,8],[24030,8],[24083,8],[24129,8],[24181,8],[24228,8],[24274,8],[24312,8],[24357,8]]}}}],["device:3",{"_index":2772,"t":{"799":{"position":[[10235,12],[10401,12],[13611,10],[13797,10],[16610,8],[16868,8]]}}}],["device_group",{"_index":2761,"t":{"799":{"position":[[354,12],[441,15],[1115,12],[1935,15],[2064,15],[2373,15]]},"801":{"position":[[941,12],[1713,15],[1842,15],[1910,15]]}}}],["device_group#it_admin",{"_index":2762,"t":{"799":{"position":[[856,22]]},"801":{"position":[[712,22]]}}}],["device_group#security_guard",{"_index":2763,"t":{"799":{"position":[[909,28]]},"801":{"position":[[765,28]]}}}],["device_group:group1",{"_index":2764,"t":{"799":{"position":[[3593,23],[3670,23],[6451,21],[6538,21],[8791,19],[8914,19]]}}}],["device_group:group1#it_admin",{"_index":2773,"t":{"799":{"position":[[10256,31],[10339,31],[13640,31],[13733,31],[16701,28],[16830,28]]}}}],["device_group:group1#security_guard",{"_index":2770,"t":{"799":{"position":[[10066,37],[10161,37],[13430,37],[13535,37],[16419,34],[16560,34]]}}}],["device_manag",{"_index":1697,"t":{"363":{"position":[[395,15]]}}}],["device_renam",{"_index":1698,"t":{"363":{"position":[[415,15]]},"677":{"position":[[345,16]]},"793":{"position":[[565,15],[777,15],[982,17],[1211,17]]},"795":{"position":[[12723,17],[15777,17],[18397,14],[24723,14],[25529,17],[26620,17],[27991,17],[29524,14],[30197,17],[30225,16],[30833,14],[30879,15],[30912,14],[30958,15]]},"797":{"position":[[914,15],[1388,15],[1923,17],[2381,17],[16514,14],[16560,15],[16593,14],[16639,15],[17056,14],[17105,15],[17140,14],[17188,15]]},"799":{"position":[[1075,15],[1712,17],[2280,17],[23696,14],[23742,15],[23775,14],[23821,15],[24237,14],[24286,15],[24321,14],[24369,15]]},"801":{"position":[[487,15],[580,14],[911,15],[1506,17],[3912,17],[6972,17],[9601,14],[16102,14],[16149,15]]}}}],["dian",{"_index":2495,"t":{"742":{"position":[[95,6]]},"749":{"position":[[7247,5],[8423,5],[9975,5],[11201,5],[12239,5]]},"841":{"position":[[131,6],[371,5]]},"848":{"position":[[2644,5],[3963,5],[5717,5],[7096,5],[8505,5]]}}}],["diann",{"_index":2720,"t":{"789":{"position":[[154,6],[436,6]]},"797":{"position":[[1004,6],[2556,6],[16095,7],[16751,6],[16788,6],[16941,6],[16982,6],[17124,6],[17158,6]]},"799":{"position":[[2740,6],[17530,6],[18319,9],[19409,9],[20778,9],[22323,6],[22947,9],[22978,8],[23932,6],[23969,6],[24122,6],[24163,6],[24305,6],[24339,6]]},"805":{"position":[[72,6]]}}}],["dictat",{"_index":2018,"t":{"508":{"position":[[5973,7]]}}}],["didn't",{"_index":1822,"t":{"422":{"position":[[3770,6]]}}}],["differ",{"_index":715,"t":{"59":{"position":[[44,10],[389,13]]},"61":{"position":[[298,10]]},"151":{"position":[[443,9]]},"169":{"position":[[2936,9]]},"213":{"position":[[228,9]]},"238":{"position":[[5717,9]]},"357":{"position":[[619,13]]},"390":{"position":[[510,9],[740,9]]},"426":{"position":[[5699,9]]},"452":{"position":[[365,9]]},"462":{"position":[[1846,9],[2980,9]]},"608":{"position":[[254,9]]},"623":{"position":[[141,9]]},"649":{"position":[[27039,6]]},"671":{"position":[[68,9],[242,9],[264,9],[322,9],[837,9],[871,9]]},"689":{"position":[[382,9]]},"709":{"position":[[187,11]]},"724":{"position":[[41,9]]},"730":{"position":[[786,9]]},"745":{"position":[[13,9]]},"749":{"position":[[6391,9]]},"767":{"position":[[11788,9]]},"771":{"position":[[68,9]]},"797":{"position":[[2727,9]]},"827":{"position":[[475,9]]}}}],["difficulti",{"_index":40,"t":{"3":{"position":[[560,12]]}}}],["digit",{"_index":336,"t":{"25":{"position":[[126,7]]}}}],["direct",{"_index":563,"t":{"39":{"position":[[198,6]]},"47":{"position":[[3866,6]]},"49":{"position":[[85,6],[722,6],[879,7],[1518,6],[1622,6],[2557,6]]},"51":{"position":[[978,6],[1035,6],[1248,6]]},"53":{"position":[[2421,7]]},"55":{"position":[[649,6],[1130,6]]},"59":{"position":[[711,6],[1601,6]]},"63":{"position":[[273,6]]},"169":{"position":[[4480,6],[5196,6],[7504,6],[8655,6],[9464,6],[9763,6],[9791,6],[9828,6],[10012,6],[10043,6],[10207,6],[10316,6],[10413,6],[12052,6]]},"193":{"position":[[2,6],[186,6],[217,6],[381,6]]},"203":{"position":[[144,6]]},"258":{"position":[[628,6]]},"265":{"position":[[257,6]]},"267":{"position":[[5621,6]]},"269":{"position":[[68,6]]},"316":{"position":[[119,6]]},"320":{"position":[[1135,6]]},"343":{"position":[[0,6]]},"386":{"position":[[242,6],[1150,6],[1317,6]]},"412":{"position":[[123,6]]},"426":{"position":[[1752,6],[1857,6],[6508,6],[7363,6]]},"432":{"position":[[196,6]]},"492":{"position":[[912,6]]},"508":{"position":[[5985,6]]},"514":{"position":[[682,6]]},"530":{"position":[[659,6]]},"550":{"position":[[612,6]]},"572":{"position":[[1083,6]]},"625":{"position":[[1207,6],[1231,7],[1304,6]]},"629":{"position":[[5806,6]]},"635":{"position":[[138,6]]},"637":{"position":[[169,6],[200,6],[948,6],[1055,6]]},"641":{"position":[[579,6],[686,6]]},"643":{"position":[[0,6],[196,6]]},"645":{"position":[[0,6],[88,6],[206,6],[1301,6],[1462,6]]},"647":{"position":[[47,6]]},"649":{"position":[[1013,6],[7083,6],[13272,6],[13500,6],[13548,6],[20169,6],[20306,6],[26934,6],[27051,6],[33239,6]]},"651":{"position":[[61,6],[841,6],[1001,6],[7075,6],[13352,6],[19740,6],[19899,6]]},"653":{"position":[[46,6],[243,6],[499,6]]},"679":{"position":[[771,6],[1667,6],[1730,6]]},"683":{"position":[[727,6],[790,6]]},"685":{"position":[[309,6],[523,6]]},"689":{"position":[[182,6],[1514,6]]},"713":{"position":[[621,6],[685,6]]},"728":{"position":[[6593,6],[6641,6],[6825,6],[6856,6],[7004,6],[21473,6],[21624,6],[21804,6],[22408,6],[23119,6],[38397,6],[38634,6],[38847,6],[38891,6]]},"730":{"position":[[529,6],[618,6]]},"749":{"position":[[6248,6]]},"751":{"position":[[9815,6]]},"781":{"position":[[261,6],[664,6],[728,6]]},"797":{"position":[[47,6],[2762,6]]},"801":{"position":[[64,6],[243,6],[515,6],[2229,6],[2326,6],[2659,6],[2957,6],[10097,6],[10189,6]]},"809":{"position":[[261,6]]},"819":{"position":[[1863,6],[1933,6]]},"825":{"position":[[4342,6]]},"846":{"position":[[1972,6]]},"848":{"position":[[9188,6]]}}}],["directli",{"_index":389,"t":{"27":{"position":[[816,8]]},"43":{"position":[[3059,8]]},"45":{"position":[[761,8]]},"49":{"position":[[1964,8],[2112,8]]},"51":{"position":[[1095,8]]},"53":{"position":[[1334,8]]},"61":{"position":[[2405,8]]},"169":{"position":[[7529,8],[7560,8],[7671,8],[8625,8],[10531,8],[10684,8],[10813,8]]},"187":{"position":[[2,8],[113,8]]},"343":{"position":[[82,8]]},"373":{"position":[[748,8]]},"426":{"position":[[2259,8],[2268,8],[7541,8]]},"462":{"position":[[438,8]]},"502":{"position":[[983,8]]},"508":{"position":[[6623,8]]},"558":{"position":[[1102,9]]},"635":{"position":[[86,8],[405,8]]},"677":{"position":[[664,8]]},"687":{"position":[[102,8]]},"689":{"position":[[1635,9]]},"713":{"position":[[896,8]]},"745":{"position":[[31996,8]]},"747":{"position":[[746,8]]},"751":{"position":[[9634,9],[16299,8]]},"781":{"position":[[963,9]]},"795":{"position":[[378,9]]},"821":{"position":[[1898,8]]},"844":{"position":[[1658,8]]},"848":{"position":[[9026,9],[15698,8]]}}}],["directly_related_user_typ",{"_index":447,"t":{"37":{"position":[[422,30],[491,30],[559,30],[1678,30],[1747,30],[1815,30]]},"47":{"position":[[981,30],[1953,30],[2073,30],[2144,30],[2257,30],[3275,30],[3395,30],[3466,30],[3579,30]]},"49":{"position":[[1242,30]]},"51":{"position":[[500,30],[569,30]]},"53":{"position":[[659,30],[1086,30],[1157,30],[1817,30]]},"55":{"position":[[434,30]]},"57":{"position":[[511,30]]},"59":{"position":[[538,30]]},"61":{"position":[[1525,30],[1594,30],[1663,30],[2232,30]]},"169":{"position":[[1148,30],[1220,30],[1289,30],[1357,30],[2131,30],[2247,30],[2360,30],[2472,30],[2683,30],[6992,30],[7064,30],[7133,30],[7201,30],[7989,30],[11657,30],[11726,30]]},"227":{"position":[[631,30],[800,30]]},"258":{"position":[[512,30]]},"273":{"position":[[605,30],[774,30]]},"298":{"position":[[414,30],[579,30],[784,30]]},"320":{"position":[[665,30],[945,30],[1019,30]]},"347":{"position":[[752,30],[959,30]]},"355":{"position":[[574,30],[643,30],[850,30]]},"357":{"position":[[769,30],[838,30],[1045,30]]},"365":{"position":[[686,30],[755,30]]},"373":{"position":[[560,30],[629,30]]},"382":{"position":[[348,30],[517,30]]},"384":{"position":[[461,30],[571,30]]},"392":{"position":[[891,30],[960,30]]},"404":{"position":[[745,30],[858,30],[1071,30]]},"440":{"position":[[586,30],[655,30]]},"456":{"position":[[1998,30],[2358,30],[2429,30],[2866,30],[2937,30],[3008,30]]},"460":{"position":[[1809,30],[2169,30],[2240,30],[2720,30],[2791,30],[2905,30]]},"462":{"position":[[1020,30]]},"474":{"position":[[1153,30],[1230,30],[1403,30]]},"484":{"position":[[934,30],[1011,30],[1184,30]]},"492":{"position":[[627,30],[796,30]]},"500":{"position":[[633,30],[828,30],[899,30]]},"502":{"position":[[459,30],[793,30],[864,30]]},"514":{"position":[[530,30]]},"530":{"position":[[543,30]]},"538":{"position":[[471,30],[658,30]]},"550":{"position":[[496,30]]},"558":{"position":[[606,30],[673,30],[845,30]]},"572":{"position":[[762,30],[831,30]]},"610":{"position":[[607,30],[774,30]]},"617":{"position":[[490,30],[561,30],[728,30]]},"625":{"position":[[660,30],[729,30],[916,30]]},"645":{"position":[[715,30],[862,30],[1069,30]]},"649":{"position":[[526,30],[673,30],[880,30]]},"651":{"position":[[510,30],[717,30]]},"661":{"position":[[1544,30],[1622,30],[1699,30],[2670,30],[2748,30]]},"669":{"position":[[1976,30],[2054,30],[2136,30],[2214,30]]},"673":{"position":[[1336,30],[1414,30],[1496,30],[1574,30],[2545,30],[2623,30]]},"679":{"position":[[586,30],[655,30]]},"687":{"position":[[564,30],[633,30]]},"689":{"position":[[1313,30],[1382,30]]},"699":{"position":[[590,30],[1315,30]]},"701":{"position":[[830,30],[899,30]]},"707":{"position":[[454,30]]},"724":{"position":[[989,30],[1162,30],[1343,30]]},"728":{"position":[[6340,30],[6409,30],[7573,30],[7642,30],[7815,30],[8000,30],[21251,30],[21320,30],[23975,30],[24044,30],[24217,30],[24398,30],[31759,30],[31828,30],[32135,30],[32316,30],[39387,30],[39456,30],[39905,30],[41231,30],[41538,30],[41719,30]]},"745":{"position":[[731,30],[801,30],[870,30],[943,30],[1011,30],[1495,30],[31166,30],[31236,30],[31305,30],[31378,30],[31446,30],[31805,30]]},"747":{"position":[[573,30],[1653,30],[1765,30],[1876,30],[1991,30],[2101,30]]},"751":{"position":[[1173,30],[2185,30],[2297,30],[2408,30],[2523,30],[2633,30],[2743,30],[16013,30],[24682,30],[24844,30],[25005,30],[25170,30],[25330,30],[25490,30],[25699,30],[25780,30]]},"761":{"position":[[1082,30],[1695,30],[1768,30],[2092,30]]},"769":{"position":[[402,30],[635,30],[2096,30],[2184,30],[2276,30],[3914,30],[3987,30]]},"773":{"position":[[1430,30],[1518,30],[1610,30],[2516,30],[2589,30],[2913,30],[3081,30],[3254,30]]},"775":{"position":[[1182,30],[1819,30],[1897,30],[1985,30],[2077,30],[2983,30],[3056,30],[3380,30],[3548,30],[3721,30]]},"793":{"position":[[1070,30],[1154,30],[1231,30]]},"797":{"position":[[2083,30],[2160,30],[2240,30],[2324,30],[2401,30]]},"799":{"position":[[579,30],[656,30],[1872,30],[2001,30],[2139,30],[2223,30],[2300,30],[2511,30],[2588,30]]},"801":{"position":[[1650,30],[1779,30],[2048,30],[2125,30]]},"819":{"position":[[1431,30],[1508,30],[1577,30],[1645,30]]},"821":{"position":[[1003,30],[1080,30],[1149,30],[1217,30],[1615,30]]},"823":{"position":[[7061,30],[7138,30],[7207,30],[7275,30]]},"825":{"position":[[2094,30],[2168,30],[2438,30],[3610,30],[3684,30],[3954,30],[5471,30],[5548,30],[5617,30],[5685,30],[6004,30],[6078,30],[6348,30]]},"844":{"position":[[771,30],[840,30],[912,30],[981,30],[1377,30],[31068,30],[31137,30],[31209,30],[31278,30]]},"846":{"position":[[1177,30],[1290,30],[1406,30],[1519,30],[1730,30]]},"848":{"position":[[1260,30],[1332,30],[1445,30],[1561,30],[1674,30],[15455,30],[17887,30],[17959,30],[18072,30],[18188,30],[18301,30],[18512,30]]},"850":{"position":[[1941,30],[2013,30],[2126,30],[2242,30],[2355,30],[2602,30]]}}}],["directori",{"_index":1147,"t":{"143":{"position":[[163,11]]},"145":{"position":[[2709,9],[5340,9]]}}}],["disabl",{"_index":1036,"t":{"129":{"position":[[230,7]]},"149":{"position":[[375,7]]},"151":{"position":[[85,9]]},"159":{"position":[[151,7]]},"161":{"position":[[70,8]]},"386":{"position":[[232,9]]},"635":{"position":[[128,9]]},"645":{"position":[[181,8]]},"647":{"position":[[37,9]]},"651":{"position":[[51,9],[19887,9]]}}}],["disadvantag",{"_index":2746,"t":{"797":{"position":[[261,14]]}}}],["disallow",{"_index":650,"t":{"49":{"position":[[905,12]]},"452":{"position":[[507,11]]},"468":{"position":[[97,8]]},"713":{"position":[[667,8]]},"728":{"position":[[38388,8],[38836,8]]},"781":{"position":[[710,8]]}}}],["disappear",{"_index":1804,"t":{"420":{"position":[[808,11]]}}}],["disassoci",{"_index":2205,"t":{"631":{"position":[[43,13]]}}}],["discard",{"_index":1622,"t":{"310":{"position":[[2724,10]]}}}],["discord",{"_index":248,"t":{"11":{"position":[[95,7]]},"430":{"position":[[457,8]]},"454":{"position":[[382,7]]}}}],["discov",{"_index":1807,"t":{"420":{"position":[[1023,8]]},"422":{"position":[[4667,8]]}}}],["discrep",{"_index":780,"t":{"73":{"position":[[402,13]]}}}],["discuss",{"_index":1347,"t":{"169":{"position":[[3073,9]]},"728":{"position":[[38690,10]]}}}],["dish",{"_index":2394,"t":{"721":{"position":[[257,6],[429,6]]},"726":{"position":[[12527,6],[14143,6],[16037,6],[17603,6],[19373,6],[20640,6],[22186,6],[24010,6],[25506,6],[27176,6]]}}}],["disrupt",{"_index":2349,"t":{"701":{"position":[[17,11]]}}}],["dive",{"_index":2490,"t":{"730":{"position":[[678,4]]},"803":{"position":[[96,4]]},"827":{"position":[[367,4]]}}}],["divid",{"_index":1058,"t":{"131":{"position":[[948,6]]}}}],["dnf",{"_index":836,"t":{"77":{"position":[[1562,3]]},"81":{"position":[[136,3]]}}}],["do",{"_index":771,"t":{"73":{"position":[[158,5]]},"131":{"position":[[1822,5]]},"751":{"position":[[16551,5]]},"848":{"position":[[16006,5]]}}}],["doc",{"_index":729,"t":{"61":{"position":[[409,5],[897,3],[1118,6],[1826,3],[1953,6],[2364,3],[2432,3],[2487,3],[2614,3]]},"298":{"position":[[193,3],[695,6]]},"468":{"position":[[837,4]]},"732":{"position":[[119,4]]},"751":{"position":[[16437,3]]},"813":{"position":[[428,5]]},"848":{"position":[[15895,3]]}}}],["doc'",{"_index":738,"t":{"61":{"position":[[2650,5]]}}}],["doc:budget",{"_index":1593,"t":{"296":{"position":[[3638,14]]}}}],["doc:plan",{"_index":1602,"t":{"306":{"position":[[281,12],[333,12],[369,14]]}}}],["docker",{"_index":166,"t":{"7":{"position":[[109,7],[117,6],[156,6]]},"77":{"position":[[1685,7],[1693,6],[1718,6]]},"83":{"position":[[0,6],[25,6]]},"139":{"position":[[65,7]]},"141":{"position":[[40,6],[86,6],[125,6],[171,6],[189,6]]},"145":{"position":[[448,6],[455,6],[654,6],[733,6],[1096,6],[1296,6],[1568,6],[2728,6],[3297,6],[3304,6],[3344,6],[3426,6],[3783,6],[3963,6],[4215,6],[5359,6]]},"147":{"position":[[605,6],[1318,7],[1369,6],[1419,6],[2039,6],[2843,7],[2894,6],[2938,6]]},"149":{"position":[[309,7]]},"151":{"position":[[294,7],[302,6],[548,6]]},"155":{"position":[[146,6],[282,6]]},"157":{"position":[[179,6],[272,6]]},"167":{"position":[[52,6],[107,7]]}}}],["docs_in_draft_statu",{"_index":219,"t":{"9":{"position":[[607,21]]}}}],["docs_in_draft_status(statu",{"_index":220,"t":{"9":{"position":[[639,28]]}}}],["document",{"_index":29,"t":{"3":{"position":[[410,8],[1513,8]]},"9":{"position":[[492,9],[558,8],[726,9],[800,10],[836,9],[998,9],[1164,10]]},"19":{"position":[[415,10],[525,9]]},"23":{"position":[[151,8]]},"37":{"position":[[112,8],[275,11],[1531,11]]},"45":{"position":[[872,13]]},"47":{"position":[[518,8],[2374,11],[3776,9],[3903,8]]},"51":{"position":[[87,8],[127,8],[236,11],[641,8],[735,9],[1531,8],[1706,8],[1909,9],[2004,8]]},"53":{"position":[[385,8],[776,11],[1311,8],[1443,8],[1547,11],[2080,8],[2150,8],[2412,8],[2484,8],[2911,9]]},"55":{"position":[[174,8],[259,11]]},"57":{"position":[[192,8],[287,11]]},"59":{"position":[[259,8],[350,11]]},"101":{"position":[[137,13]]},"107":{"position":[[47,9],[275,14],[361,9]]},"113":{"position":[[115,9],[813,9],[2729,9],[4342,11],[4373,11],[4487,8],[5621,10]]},"121":{"position":[[49,8]]},"125":{"position":[[14,9],[198,11],[529,11],[908,11],[1432,8],[1782,11],[1965,8]]},"127":{"position":[[151,13]]},"137":{"position":[[122,13]]},"169":{"position":[[614,8],[853,8],[972,11],[1673,8],[1955,11],[5491,8],[5789,8],[6387,8],[6580,9],[6663,8],[6816,11],[7320,8],[7794,9],[7818,8],[7893,11],[8176,8],[8405,9],[9275,14],[10555,8],[10708,8],[10838,8],[11349,8],[11456,11],[12108,9],[24731,8],[25568,11],[26707,11],[28136,11],[29741,8],[30269,11],[30503,11],[30539,10],[31432,14],[31834,8]]},"207":{"position":[[239,13]]},"223":{"position":[[472,9]]},"225":{"position":[[401,8],[420,8]]},"227":{"position":[[270,8],[400,8],[704,11]]},"234":{"position":[[112,8]]},"273":{"position":[[264,8],[388,8],[678,11],[923,8],[991,9],[1132,8]]},"282":{"position":[[75,10],[191,10]]},"310":{"position":[[2804,9],[2926,9]]},"312":{"position":[[543,10]]},"316":{"position":[[567,10]]},"345":{"position":[[138,9],[476,9]]},"347":{"position":[[198,8],[338,8],[481,8],[656,11],[1193,8]]},"353":{"position":[[173,9],[11464,8],[11573,8],[11704,9],[11827,8],[11915,8],[12007,8],[12061,8]]},"355":{"position":[[48,9],[158,8],[252,8],[450,11],[1008,9]]},"357":{"position":[[51,10],[339,8],[553,11]]},"359":{"position":[[170,9],[231,9],[1106,8],[2278,8],[3826,8],[5048,8],[6072,8],[6258,9],[6466,9],[12274,9]]},"363":{"position":[[129,8],[162,9]]},"365":{"position":[[199,8],[297,8],[371,9],[422,8],[564,11]]},"371":{"position":[[94,8],[142,9],[239,9]]},"373":{"position":[[207,8],[359,11],[712,8],[806,8],[898,8],[959,9]]},"382":{"position":[[125,8],[421,11],[741,8]]},"384":{"position":[[84,8],[260,11]]},"420":{"position":[[34,9],[1361,8],[1511,8],[1601,9],[1759,8],[1868,8],[1947,9],[2086,8],[2141,8],[2229,9],[2257,8],[2304,8],[2383,9],[2426,8],[2463,9]]},"422":{"position":[[407,8],[498,8],[648,8],[801,8],[910,8],[989,9],[1128,8],[1183,8],[1269,9],[1297,8],[1344,8],[1423,9],[1466,8],[1503,9],[2242,8],[2392,8],[2482,9],[2641,8],[2750,8],[2829,9],[2968,8],[3023,8],[3111,9],[3139,8],[3186,8],[3265,9],[3308,8],[3345,9],[3960,8],[4136,8]]},"424":{"position":[[733,8],[883,8],[973,9],[1131,8],[1240,8],[1319,9],[1458,8],[1513,8],[1601,9],[1629,8],[1676,8],[1755,9],[1798,8],[1835,9],[2259,8],[2675,9],[2883,8]]},"426":{"position":[[210,10],[2194,9],[2915,9],[3072,11],[3163,10],[3394,9],[3616,8],[3733,9],[3841,8],[3950,8],[3999,8],[4237,9],[4268,8],[4419,9],[4528,8],[4638,8],[4683,8],[4898,9],[5049,8],[5329,8],[5496,9],[5835,10],[5948,8],[6065,9],[6120,8],[6213,9],[6260,8],[7020,8],[7129,8],[7202,9],[7731,10],[7778,8],[7810,8],[7855,9],[8145,8],[8198,8],[8284,9],[8533,8],[8578,8],[8667,9],[8937,8],[8974,9],[9185,8],[9225,8],[9680,8],[9818,8]]},"428":{"position":[[1485,10]]},"438":{"position":[[88,9]]},"440":{"position":[[231,8],[322,8],[464,11]]},"444":{"position":[[61,8]]},"456":{"position":[[262,8],[502,8],[786,8],[1038,8],[1098,8],[1686,8],[2502,11],[3206,8]]},"460":{"position":[[1013,8],[1322,9],[1520,8],[2356,11]]},"462":{"position":[[188,8],[367,9],[717,9],[804,8],[924,11],[1285,8],[1486,9],[1560,9],[2230,8]]},"472":{"position":[[202,8],[300,8],[345,8],[409,9],[516,9]]},"474":{"position":[[219,8],[381,9],[482,8],[682,9],[733,8],[957,11],[1629,8],[1760,8],[1885,8],[2321,9],[2504,10]]},"476":{"position":[[92,10]]},"482":{"position":[[173,9],[11543,8],[11658,8]]},"484":{"position":[[216,8],[488,11]]},"486":{"position":[[87,8],[183,9],[5876,8],[5982,9]]},"490":{"position":[[225,9]]},"492":{"position":[[277,8],[413,8],[700,11]]},"498":{"position":[[44,9],[131,9],[211,9],[314,8],[357,8]]},"500":{"position":[[50,9],[221,9],[395,8],[706,11],[986,8],[1075,9]]},"502":{"position":[[48,9],[199,8],[532,11],[947,8],[1057,8],[1170,8],[1218,9]]},"506":{"position":[[885,8],[2076,8],[3643,8],[4884,8],[5949,8]]},"508":{"position":[[6311,8]]},"510":{"position":[[264,10],[328,9]]},"512":{"position":[[88,9],[316,8]]},"514":{"position":[[231,8],[312,8],[438,11]]},"520":{"position":[[204,8]]},"522":{"position":[[6466,10],[6529,13],[6842,9]]},"524":{"position":[[192,8],[344,9]]},"528":{"position":[[419,8],[438,8]]},"530":{"position":[[234,8],[327,8],[447,11]]},"536":{"position":[[213,9]]},"538":{"position":[[206,8],[375,11]]},"542":{"position":[[322,9]]},"546":{"position":[[210,9]]},"548":{"position":[[339,9]]},"572":{"position":[[231,8],[395,8],[547,11],[944,8]]},"588":{"position":[[3809,12],[5483,9],[6224,12],[6254,11],[6578,8],[9886,12],[11523,9],[12222,12],[12252,11]]},"590":{"position":[[523,8],[3776,12],[5214,9],[5837,12],[5867,11]]},"595":{"position":[[12082,8]]},"600":{"position":[[910,11],[2156,11],[3694,12],[5521,8],[6105,11],[6454,11],[6490,10]]},"608":{"position":[[151,9]]},"610":{"position":[[198,8],[347,8],[511,11]]},"617":{"position":[[48,9],[86,8],[180,8],[368,11]]},"619":{"position":[[106,9]]},"621":{"position":[[6090,9]]},"645":{"position":[[286,8],[514,11],[1192,8],[1215,8]]},"649":{"position":[[97,8],[325,11],[1308,9],[7157,8],[7314,8],[7480,9],[13346,8],[13747,9],[14301,9],[20243,8],[20712,9],[21133,8],[27369,8],[33091,9],[33169,8],[33203,9],[33297,9]]},"651":{"position":[[158,8],[355,11],[1280,9],[7153,8],[7529,9],[13430,8],[13628,9],[13873,9],[19818,8],[20192,8]]},"655":{"position":[[416,8]]},"677":{"position":[[837,8]]},"699":{"position":[[4,8],[285,8],[419,11],[1008,8],[1143,11]]},"701":{"position":[[287,8],[478,11]]},"705":{"position":[[6336,8]]},"707":{"position":[[147,8],[282,11]]},"732":{"position":[[193,9]]},"740":{"position":[[50,14]]},"745":{"position":[[30244,13]]},"755":{"position":[[448,8]]},"831":{"position":[[269,8],[289,8],[769,9],[1035,9],[1282,9]]},"833":{"position":[[702,9]]},"839":{"position":[[56,14],[214,9],[224,9],[295,9],[384,8],[408,9]]},"841":{"position":[[231,9],[406,8],[437,9]]},"844":{"position":[[293,8],[408,8],[596,11],[1230,8],[1281,11],[1493,8],[1606,8],[1708,10],[13226,9],[30284,13],[30434,8],[30654,11],[31413,8],[31557,8],[31618,8]]},"846":{"position":[[388,9],[439,8],[763,11]]},"848":{"position":[[108,10],[179,9],[317,8],[400,8],[438,9],[513,8],[547,10],[819,11],[1303,10],[8967,8],[9124,8],[9210,8],[15043,8],[15168,11],[15635,10],[15722,8],[16538,8],[16844,10],[16978,11],[17930,10]]},"850":{"position":[[193,9],[584,8],[898,10],[1032,11],[1984,10],[10906,8],[28153,8]]}}}],["document'",{"_index":688,"t":{"53":{"position":[[1403,10]]},"426":{"position":[[5266,10],[6544,10]]},"474":{"position":[[307,10]]},"649":{"position":[[33433,10],[33459,10]]},"651":{"position":[[89,10],[895,10]]}}}],["document.id",{"_index":235,"t":{"9":{"position":[[1034,12],[1087,12]]}}}],["document.statu",{"_index":237,"t":{"9":{"position":[[1057,15]]}}}],["document:${request.params.docu",{"_index":981,"t":{"113":{"position":[[582,38]]}}}],["document:0001",{"_index":1872,"t":{"426":{"position":[[5133,16]]}}}],["document:1",{"_index":107,"t":{"3":{"position":[[1813,10],[1841,10],[2064,10],[2107,10],[2186,10],[2266,10],[2520,10],[2578,13],[2609,10]]},"428":{"position":[[1847,11],[1925,13],[1951,10],[2086,13],[2590,11],[2640,10],[2689,10],[2737,10],[2793,10],[2905,11],[2965,10],[3014,10],[3062,10],[3128,10]]}}}],["document:1#viewer@user:ann",{"_index":129,"t":{"3":{"position":[[2697,29]]}}}],["document:2",{"_index":1898,"t":{"428":{"position":[[2113,10],[2194,13],[2220,10],[2352,13],[3168,11],[3218,10],[3267,10],[3315,10],[3371,10],[3481,11],[3541,10],[3600,10],[3648,10],[3714,10]]}}}],["document:2021",{"_index":2893,"t":{"844":{"position":[[1760,13],[2577,14],[5208,14],[7277,13],[7501,13],[8308,14],[9405,14],[10783,14],[12316,13],[13044,14],[13087,14],[13993,14],[16616,14],[18673,13],[19650,14],[20743,14],[22117,14],[23642,13],[24358,14],[24401,14],[25269,14],[26364,14],[27740,14],[29269,13],[29990,14],[30033,14],[32490,14],[33583,14],[34957,14],[36482,13],[37198,14],[37241,14],[38109,14],[39203,14],[40578,14],[42105,13],[42824,14],[42867,14]]},"846":{"position":[[2077,13],[3099,13],[3177,14],[4716,13],[6562,13],[6649,14],[8081,13],[9598,13],[9930,13],[11116,14],[12213,14],[13591,14],[15124,13],[15852,14],[15895,14]]},"848":{"position":[[2665,13],[2738,14],[2768,13],[2806,13],[2835,14],[2889,14],[3984,13],[4146,13],[4184,13],[5738,13],[5820,14],[5851,13],[5889,13],[5925,14],[5981,14],[7117,13],[7229,13],[7267,13],[8338,13],[8443,13],[8473,13],[8526,13],[8633,13],[8671,13],[10027,14],[11127,14],[12508,14],[14047,13],[14779,14],[14822,14],[16056,13],[16115,14],[16169,14],[16316,14],[16389,14]]},"850":{"position":[[3538,13],[3615,14],[3692,13],[3781,14],[3852,13],[3927,14],[5030,13],[5243,13],[5462,13],[7016,13],[7102,14],[7180,13],[7278,14],[7350,13],[7434,14],[8578,13],[8741,13],[8910,13],[10067,13],[10206,13],[10331,13],[10392,13],[10550,13],[10714,13],[11695,14],[12796,14],[14178,14],[15719,13],[16451,14],[16502,14],[17454,14],[18557,14],[19941,14],[21486,13],[22223,14],[22274,14],[23154,14],[24259,14],[25645,14],[27194,13],[27938,14],[27989,14],[28943,14],[30046,14],[31430,14],[32975,13],[33712,14],[33763,14],[34640,14],[35743,14],[37127,14],[38672,13],[39409,14],[39460,14]]}}}],["document:budget",{"_index":1719,"t":{"382":{"position":[[810,18],[1035,16],[1993,18],[3082,18],[4452,18],[5969,15],[6678,18],[6716,17]]},"384":{"position":[[755,16]]}}}],["document:budget#read",{"_index":1725,"t":{"384":{"position":[[941,25],[999,25],[1085,25]]}}}],["document:budget#writ",{"_index":1726,"t":{"384":{"position":[[1146,24]]}}}],["document:compani",{"_index":2027,"t":{"522":{"position":[[282,16],[1104,17],[3815,17],[5915,16],[6908,17]]},"524":{"position":[[73,16],[1150,17],[2245,17],[3621,17],[5150,16],[5868,17],[5915,17]]}}}],["document:may_budget.doc",{"_index":2169,"t":{"619":{"position":[[214,24],[1223,27],[4066,25],[6250,23]]},"621":{"position":[[148,25],[960,26],[2062,26],[3445,26],[4988,23],[5728,26],[5774,25],[6010,24],[6153,24]]}}}],["document:meeting_not",{"_index":2060,"t":{"544":{"position":[[6086,22],[6139,22]]}}}],["document:meeting_notes.doc",{"_index":1702,"t":{"365":{"position":[[990,29]]},"375":{"position":[[74,27],[147,27],[211,27],[1047,29],[2146,29],[3526,29],[5063,26],[5791,29],[5840,28]]},"446":{"position":[[73,27],[903,30],[3538,28],[5613,26]]},"448":{"position":[[138,28],[947,29],[2046,29],[3426,29],[4963,26],[5691,29],[5740,28],[5888,28],[6784,29],[7884,29],[9265,29],[10804,26],[11534,29],[11583,28]]},"498":{"position":[[472,26],[716,26],[779,26]]},"506":{"position":[[96,26],[946,30],[3713,28],[5861,26]]},"508":{"position":[[212,27],[1020,29],[2119,29],[3499,29],[5036,26],[5764,29],[5813,28],[6017,27],[6201,26],[6260,26],[6351,26]]},"542":{"position":[[435,27],[1285,30],[4050,28],[6211,26]]},"544":{"position":[[166,26],[244,27],[1082,29],[2183,29],[3565,29],[5106,26],[5840,29],[5889,28]]}}}],["document:new",{"_index":677,"t":{"51":{"position":[[1366,12],[1468,12],[1595,13],[1644,12],[1770,13],[1839,12],[1940,12],[2068,13]]},"53":{"position":[[1942,12],[2227,13],[2548,13]]},"55":{"position":[[563,12],[692,12],[770,13],[819,12],[897,13],[1431,13]]},"57":{"position":[[640,12],[732,12],[810,13],[873,12],[961,13],[1410,13],[1488,12],[1570,12],[1671,13],[1733,12],[1843,13]]},"59":{"position":[[667,12],[744,12],[822,13],[878,12],[1012,13],[1445,13],[1523,12],[1634,12],[1735,13],[1782,12],[1858,13]]},"169":{"position":[[4351,12],[9402,13],[10341,12],[10619,13],[10764,13],[10912,13],[11142,12],[11917,13],[11999,12],[12214,12],[13034,13],[14128,13],[15503,13],[17030,12],[17749,13],[17792,13],[18425,12],[19228,13],[20322,13],[21697,13],[23224,12],[23943,13],[23986,13],[31843,12],[32032,13]]}}}],["document:otherdoc",{"_index":1017,"t":{"125":{"position":[[296,21],[671,21],[1004,21],[1283,21],[1465,21],[1862,21],[1917,17]]},"169":{"position":[[25666,21],[26849,21],[28232,21],[29414,21],[29774,21],[30349,21],[30662,21]]},"600":{"position":[[1004,19],[1116,21],[2253,20],[2408,21],[3804,20],[3912,21],[5195,21],[5567,18],[5610,21],[6208,20],[6302,21],[6709,20],[6742,21]]}}}],["document:plan",{"_index":1018,"t":{"125":{"position":[[318,20],[693,20],[1026,20],[1305,20],[1487,21],[1884,21],[1939,17]]},"169":{"position":[[25688,20],[26871,20],[28254,20],[29436,20],[29796,21],[30371,21],[30684,20]]},"234":{"position":[[135,19],[231,17],[315,20]]},"238":{"position":[[58,17],[875,20],[1966,20],[3338,20],[4859,17],[5572,20],[5612,19],[6620,20],[7713,20],[9087,20],[10612,17],[11330,20],[11370,19]]},"273":{"position":[[1205,20],[1380,18],[2175,20],[3262,20],[4630,20],[6143,17],[6843,20],[6883,19],[12888,18],[13842,20],[14933,20],[16305,20],[17826,17],[18539,20],[18579,19],[19445,20],[20538,20],[21912,20],[23437,17],[24155,20],[24195,19]]},"282":{"position":[[212,18]]},"284":{"position":[[76,18],[918,20],[2010,20],[3383,20],[4906,17],[5621,20],[5661,19]]},"347":{"position":[[1267,20]]},"353":{"position":[[1015,20],[2107,20],[3480,20],[5003,17],[5719,20],[5759,19],[6624,20],[7715,20],[9087,20],[10608,17],[11321,20],[11361,19]]},"359":{"position":[[90,17],[1165,21],[3894,19],[6001,17],[7309,20],[8401,20],[9774,20],[11297,17],[12012,20],[12052,19],[13124,20],[14216,20],[15589,20],[17112,17],[17828,20],[17868,19]]},"474":{"position":[[1699,20],[1825,20],[1949,20]]},"482":{"position":[[1018,20],[2113,20],[3489,20],[5018,17],[5743,20],[5783,19],[6651,20],[7745,20],[9120,20],[10647,17],[11369,20],[11409,19]]},"486":{"position":[[979,20],[2075,20],[3452,20],[4983,17],[5711,20],[5751,19],[6777,20],[7873,20],[9250,20],[10781,17],[11508,20],[11548,19]]},"572":{"position":[[335,18],[1007,20]]},"581":{"position":[[213,18],[1012,20],[2102,20],[3473,20],[4992,17],[5702,20],[5742,19],[5953,17]]},"588":{"position":[[12554,17],[15889,20],[17546,17],[18236,20],[18276,19]]},"590":{"position":[[564,18],[666,18],[5932,17],[6091,17]]},"595":{"position":[[183,18],[1008,20],[1048,19],[2156,20],[2196,19],[3591,19],[3630,19],[4764,20],[5147,17],[5776,20],[5816,19],[6920,20],[6960,19],[8068,20],[8108,19],[9503,19],[9542,19],[10676,20],[11059,17],[11688,20],[11728,19],[12016,17],[12119,17]]},"600":{"position":[[1138,20],[2430,20],[3934,20],[5217,20],[5632,21],[6324,21],[6764,20]]},"649":{"position":[[1141,17],[1216,20],[2144,20],[3235,20],[4607,20],[6128,17],[6841,20],[6881,19],[7064,18],[7275,17],[7388,20],[8316,20],[9407,20],[10779,20],[12300,17],[13013,20],[13053,19],[13253,18],[13901,20],[14077,18],[15140,20],[16234,20],[17609,20],[19136,17],[19858,20],[19898,19],[20150,18],[21043,20],[21974,20],[23065,20],[24437,20],[25958,17],[26671,20],[26711,19],[27201,18],[27278,20],[28211,20],[29303,20],[30676,20],[32199,17],[32915,20],[32955,19]]},"651":{"position":[[1113,17],[1188,20],[2117,20],[3209,20],[4582,20],[6105,17],[6820,20],[6860,19],[7056,18],[7361,18],[7434,20],[8369,20],[9464,20],[10840,20],[12369,17],[13093,20],[13133,19],[13333,18],[13780,20],[14711,20],[15804,20],[17178,20],[18703,17],[19421,20],[19461,19],[19721,18],[20022,18],[20100,20],[21035,20],[22128,20],[23502,20],[25027,17],[25746,20],[25786,19]]}}}],["document:pr",{"_index":1927,"t":{"456":{"position":[[590,19],[850,19],[1150,19]]},"460":{"position":[[224,19],[302,19]]},"462":{"position":[[244,19],[1346,19],[2291,19]]}}}],["document:pricing#view",{"_index":1941,"t":{"460":{"position":[[896,23]]}}}],["document:roadmap",{"_index":1370,"t":{"169":{"position":[[5920,16],[6031,16],[6146,16],[6295,16],[6507,16]]},"699":{"position":[[805,19],[886,19]]},"701":{"position":[[229,16],[1834,19],[2927,19],[4301,19],[5826,16],[6546,19],[6585,18],[7451,19],[8543,19],[9916,19],[11439,16],[12156,19],[12195,18]]},"703":{"position":[[980,20],[3693,18],[5794,16],[6845,19],[7941,19],[9318,19],[10849,16],[11578,19],[11617,18]]},"705":{"position":[[7184,20],[7257,20],[10006,18],[10089,18],[12292,16],[12411,16],[13447,20],[13520,20],[16271,18],[16354,18],[18523,16],[18604,16],[19774,19],[20867,19],[22241,19],[23766,16],[24486,19],[24525,18],[25434,19],[26525,19],[27897,19],[29418,16],[30131,19],[30170,18]]}}}],["document:z",{"_index":849,"t":{"95":{"position":[[84,10]]},"99":{"position":[[68,10],[217,13],[493,13],[808,13],[1234,10]]},"246":{"position":[[83,10],[143,13]]},"250":{"position":[[176,14],[923,12],[1341,10]]},"252":{"position":[[140,10],[200,13],[332,14],[1081,12],[1464,10]]}}}],["document:{id",{"_index":1868,"t":{"426":{"position":[[4105,15],[4787,15],[6411,15],[6479,15]]}}}],["document’",{"_index":1943,"t":{"460":{"position":[[1221,10]]}}}],["doesn't",{"_index":1799,"t":{"420":{"position":[[222,7]]},"556":{"position":[[6361,7]]}}}],["domain",{"_index":624,"t":{"47":{"position":[[181,6],[887,9],[2016,9],[2207,9],[2320,9],[3338,9],[3529,9],[3642,9],[3757,7],[3790,6]]},"169":{"position":[[1847,6],[2174,9],[2290,9],[2403,9],[2515,9],[2589,9]]},"359":{"position":[[18207,7]]},"363":{"position":[[235,6]]},"375":{"position":[[6061,7]]},"448":{"position":[[11814,7]]},"504":{"position":[[5755,6]]},"514":{"position":[[1672,6]]},"544":{"position":[[6299,7]]},"546":{"position":[[229,6]]},"621":{"position":[[6411,7]]},"691":{"position":[[30307,6]]},"831":{"position":[[249,6]]},"839":{"position":[[268,6]]},"841":{"position":[[59,6],[90,6],[124,6],[160,6],[195,6],[327,7],[488,6]]},"846":{"position":[[224,7],[356,6],[645,6],[1240,9],[1353,9],[1469,9],[1582,9],[1636,9],[1817,8],[1923,6],[1992,7],[2019,7],[2856,6],[3081,6],[4296,6],[4698,6],[6289,6],[6544,6],[7809,6],[8063,6],[9675,6],[9912,6]]},"848":{"position":[[1395,9],[1508,9],[1624,9],[1737,9],[9047,6],[15518,9],[16860,6],[18022,9],[18135,9],[18251,9],[18364,9],[18418,9]]},"850":{"position":[[914,6],[2076,9],[2189,9],[2305,9],[2454,9],[2508,9],[2699,6],[16629,7],[28120,7]]}}}],["domain#memb",{"_index":627,"t":{"47":{"position":[[288,14],[384,14],[460,14],[583,14],[679,14],[755,14]]},"169":{"position":[[1707,15],[1747,15],[1784,15],[1820,15]]},"846":{"position":[[479,14],[516,14],[565,14],[612,14]]},"848":{"position":[[579,14],[616,14],[665,14],[712,14],[15084,14],[16578,14],[16636,14],[16707,14],[16779,14]]},"850":{"position":[[624,14],[682,14],[753,14],[833,14]]}}}],["domain/databas",{"_index":1813,"t":{"422":{"position":[[133,15]]}}}],["domain:auth0.com",{"_index":1390,"t":{"169":{"position":[[9076,16]]}}}],["domain:xyz",{"_index":2906,"t":{"846":{"position":[[2912,14],[2976,14],[3043,14],[6354,12],[6428,12],[6505,12],[9257,10],[9367,10],[9480,10]]},"850":{"position":[[3666,10],[5217,10],[7154,10],[8715,10],[10524,10]]}}}],["domain:xyz#memb",{"_index":2907,"t":{"846":{"position":[[3128,20],[6598,20],[9573,17]]},"850":{"position":[[3729,20],[7224,20],[10178,17]]}}}],["don't",{"_index":138,"t":{"3":{"position":[[3002,5]]},"9":{"position":[[821,5]]},"71":{"position":[[52,5]]},"416":{"position":[[299,5]]},"420":{"position":[[802,5]]},"426":{"position":[[7351,5]]},"428":{"position":[[3832,5]]},"460":{"position":[[807,5]]},"689":{"position":[[1503,5]]}}}],["done",{"_index":1405,"t":{"169":{"position":[[18046,4],[24381,4]]},"215":{"position":[[3032,4]]},"217":{"position":[[4161,4]]},"219":{"position":[[4722,4]]},"508":{"position":[[17,4]]},"669":{"position":[[2322,5]]},"751":{"position":[[9595,6]]},"769":{"position":[[4105,5]]},"799":{"position":[[17,4]]},"825":{"position":[[1569,4]]},"848":{"position":[[8987,6]]}}}],["don’t",{"_index":1938,"t":{"458":{"position":[[331,5]]},"462":{"position":[[2515,5]]}}}],["door",{"_index":2167,"t":{"608":{"position":[[664,5]]}}}],["dotnet",{"_index":811,"t":{"77":{"position":[[897,6],[909,6]]}}}],["doubt",{"_index":1072,"t":{"131":{"position":[[1737,6]]}}}],["down",{"_index":611,"t":{"45":{"position":[[599,4]]},"145":{"position":[[3182,5],[3234,5],[3281,5]]},"312":{"position":[[190,4],[318,4]]},"420":{"position":[[978,4],[2697,5]]},"422":{"position":[[1737,5],[3579,5]]},"424":{"position":[[2069,5]]},"428":{"position":[[2460,4]]},"665":{"position":[[72,4]]},"677":{"position":[[1075,4]]},"765":{"position":[[72,4]]}}}],["download",{"_index":828,"t":{"77":{"position":[[1426,8],[1840,8]]},"81":{"position":[[0,8]]},"87":{"position":[[0,8]]}}}],["downsid",{"_index":2483,"t":{"728":{"position":[[22664,9]]}}}],["downtim",{"_index":2345,"t":{"695":{"position":[[250,8]]}}}],["draft",{"_index":222,"t":{"9":{"position":[[688,7],[1075,8],[1119,6]]},"717":{"position":[[385,6],[502,6],[601,5]]},"719":{"position":[[408,5]]},"721":{"position":[[581,5],[726,5],[878,5]]},"726":{"position":[[1222,5],[1534,5],[3298,5],[3728,5],[5829,5],[6161,5],[7885,5],[8215,5],[10777,5],[11097,5]]},"728":{"position":[[41984,5],[42129,5],[42281,5]]}}}],["drastic",{"_index":1077,"t":{"131":{"position":[[1836,11]]}}}],["drive",{"_index":311,"t":{"19":{"position":[[370,6]]},"25":{"position":[[173,6]]},"51":{"position":[[2245,6]]},"53":{"position":[[3517,6]]},"169":{"position":[[32313,6]]},"310":{"position":[[2779,6],[2946,6]]},"312":{"position":[[508,6]]},"337":{"position":[[7,5]]},"345":{"position":[[496,6]]},"377":{"position":[[99,5],[175,6]]},"418":{"position":[[311,5]]},"420":{"position":[[1375,5],[1410,6],[1449,5],[1484,6],[2843,5]]},"422":{"position":[[512,5],[547,6],[586,5],[621,6],[1883,5],[2256,5],[2291,6],[2330,5],[2365,6],[3725,5],[3809,8],[3989,5],[4180,5]]},"424":{"position":[[747,5],[782,6],[821,5],[856,6],[2215,5],[2435,5],[3224,5]]},"426":{"position":[[2214,6],[5469,5],[5803,5],[6163,6],[6306,6],[6599,5],[7889,5]]},"428":{"position":[[1377,5]]},"430":{"position":[[41,5]]},"510":{"position":[[223,5]]},"546":{"position":[[163,5],[250,5]]},"693":{"position":[[214,5],[290,6]]},"831":{"position":[[47,5]]},"837":{"position":[[7,5],[143,5]]},"844":{"position":[[70,5],[30255,5]]},"846":{"position":[[7,5]]},"850":{"position":[[7,5]]}}}],["drive'",{"_index":2892,"t":{"837":{"position":[[301,7]]},"839":{"position":[[7,7]]}}}],["drive:{id",{"_index":1877,"t":{"426":{"position":[[6437,13]]}}}],["drop",{"_index":1903,"t":{"430":{"position":[[445,4]]}}}],["dropdown",{"_index":2559,"t":{"751":{"position":[[17225,8]]}}}],["dsl",{"_index":439,"t":{"37":{"position":[[71,3],[8439,4]]},"45":{"position":[[355,3],[537,3],[650,3],[799,3]]},"47":{"position":[[140,3]]},"49":{"position":[[962,3],[1068,3]]},"51":{"position":[[113,3]]},"53":{"position":[[285,3],[1429,3]]},"55":{"position":[[30,4],[160,3]]},"57":{"position":[[38,4],[178,3]]},"59":{"position":[[39,4],[245,3]]},"61":{"position":[[211,3],[853,4],[1795,3]]},"169":{"position":[[839,3],[1642,3],[3142,3],[6649,3],[7804,3],[11335,3]]},"227":{"position":[[312,3]]},"258":{"position":[[261,3]]},"273":{"position":[[306,3]]},"298":{"position":[[52,3]]},"320":{"position":[[350,3]]},"347":{"position":[[440,3]]},"355":{"position":[[211,3]]},"357":{"position":[[298,3]]},"365":{"position":[[381,3]]},"373":{"position":[[166,3]]},"382":{"position":[[43,3]]},"384":{"position":[[43,3]]},"392":{"position":[[485,3]]},"404":{"position":[[265,3]]},"426":{"position":[[10335,3]]},"440":{"position":[[281,3]]},"452":{"position":[[144,3],[755,3]]},"454":{"position":[[25,3],[93,4]]},"456":{"position":[[1512,3]]},"458":{"position":[[469,3]]},"460":{"position":[[1332,3]]},"462":{"position":[[580,3],[763,3]]},"474":{"position":[[692,3]]},"484":{"position":[[175,3]]},"492":{"position":[[328,3]]},"500":{"position":[[310,3]]},"502":{"position":[[114,3]]},"514":{"position":[[271,3]]},"530":{"position":[[286,3]]},"538":{"position":[[165,3]]},"550":{"position":[[250,3]]},"558":{"position":[[75,3]]},"572":{"position":[[354,3]]},"610":{"position":[[306,3]]},"617":{"position":[[139,3]]},"625":{"position":[[76,3]]},"645":{"position":[[245,3]]},"649":{"position":[[56,3]]},"651":{"position":[[117,3]]},"661":{"position":[[865,3]]},"669":{"position":[[1085,3]]},"673":{"position":[[65,3]]},"679":{"position":[[292,3]]},"687":{"position":[[270,3]]},"689":{"position":[[742,3]]},"699":{"position":[[254,3],[977,3]]},"701":{"position":[[256,3]]},"707":{"position":[[116,3]]},"724":{"position":[[603,3]]},"728":{"position":[[6106,3],[7143,3],[19933,3],[20830,3],[23354,3],[31075,3],[38952,3],[39526,3],[40603,3]]},"745":{"position":[[282,3],[1246,3],[30353,3],[31561,3]]},"747":{"position":[[341,3],[775,3]]},"751":{"position":[[938,3],[1283,3],[15638,3],[23113,3]]},"761":{"position":[[522,3]]},"769":{"position":[[247,3],[464,3],[1290,3],[2789,3]]},"773":{"position":[[65,3]]},"775":{"position":[[217,3]]},"793":{"position":[[642,3]]},"797":{"position":[[1149,3]]},"799":{"position":[[340,3],[774,3]]},"801":{"position":[[630,3]]},"819":{"position":[[996,3]]},"821":{"position":[[568,3],[1452,3]]},"823":{"position":[[6349,3]]},"825":{"position":[[1634,3],[3061,3],[4475,3]]},"844":{"position":[[367,3],[1216,3],[30393,3]]},"846":{"position":[[398,3]]},"848":{"position":[[472,3],[15029,3],[16497,3]]},"850":{"position":[[543,3]]}}}],["dsl’",{"_index":1917,"t":{"454":{"position":[[126,5]]}}}],["due",{"_index":657,"t":{"49":{"position":[[1507,3]]},"825":{"position":[[21658,3],[22949,3],[24675,3],[26026,3],[27356,3]]}}}],["durat",{"_index":86,"t":{"3":{"position":[[1355,9],[1675,9]]}}}],["dure",{"_index":148,"t":{"5":{"position":[[115,6]]},"27":{"position":[[752,6]]},"466":{"position":[[709,7]]},"655":{"position":[[592,6]]},"755":{"position":[[619,6]]},"761":{"position":[[424,6]]}}}],["dynam",{"_index":1635,"t":{"316":{"position":[[1115,7]]},"404":{"position":[[34,7]]},"675":{"position":[[305,7]]},"755":{"position":[[138,7]]}}}],["e",{"_index":586,"t":{"43":{"position":[[2919,2],[2989,2]]},"145":{"position":[[782,1],[808,1],[3472,1],[3502,1]]},"155":{"position":[[336,1]]},"310":{"position":[[2953,2]]},"312":{"position":[[600,1]]}}}],["e.g",{"_index":318,"t":{"21":{"position":[[96,5],[307,5]]},"37":{"position":[[1185,5],[2376,5],[4232,5],[5697,5],[6974,5],[7063,5],[7556,5],[7645,5]]},"43":{"position":[[316,5],[796,5],[1770,5]]},"49":{"position":[[273,5],[431,5],[628,5],[1794,5]]},"61":{"position":[[2628,5]]},"77":{"position":[[635,5]]},"97":{"position":[[458,5],[1010,5],[1921,5],[2633,5],[3193,5],[3310,5]]},"113":{"position":[[4769,5]]},"123":{"position":[[458,5],[1010,5],[1921,5],[2633,5],[3193,5],[3310,5]]},"143":{"position":[[826,4]]},"161":{"position":[[732,5]]},"169":{"position":[[3935,5],[4687,4],[4759,4],[4920,4],[8889,4],[9000,4],[9048,3],[10989,5],[12740,5],[13595,5],[14920,5],[16011,5],[16813,5],[16902,5],[17138,5],[17227,5],[18934,5],[19789,5],[21114,5],[22205,5],[23007,5],[23096,5],[23332,5],[23421,5],[25288,5],[26164,5],[27543,5],[28676,5],[29515,5],[29604,5],[29876,5],[29965,5]]},"215":{"position":[[407,5],[1035,5],[1856,5],[2564,5]]},"217":{"position":[[755,5],[1524,5],[2584,5],[3666,5]]},"219":{"position":[[631,5],[1549,5],[2747,5],[4227,5]]},"223":{"position":[[443,4]]},"236":{"position":[[571,5],[1381,5],[2816,5],[3931,5],[4739,5],[4828,5],[5273,5],[5362,5]]},"238":{"position":[[581,5],[1433,5],[2755,5],[3843,5],[4642,5],[4731,5],[4964,5],[5053,5],[6325,5],[7179,5],[8503,5],[9593,5],[10394,5],[10483,5],[10718,5],[10807,5]]},"248":{"position":[[458,5],[1010,5],[1921,5],[2633,5],[3193,5],[3310,5]]},"265":{"position":[[881,5],[1723,5],[3035,5],[4113,5],[4902,5],[4991,5],[5214,5],[5303,5]]},"267":{"position":[[592,5],[1397,5],[2827,5],[3937,5],[4742,5],[4831,5],[5271,5],[5360,5],[6296,5],[7139,5],[8452,5],[9531,5],[10321,5],[10410,5],[10634,5],[10723,5]]},"273":{"position":[[1886,5],[2734,5],[4052,5],[5136,5],[5931,5],[6020,5],[6249,5],[6338,5],[7524,5],[8371,5],[9843,5],[10995,5],[11839,5],[11928,5],[12371,5],[12460,5],[13548,5],[14400,5],[15722,5],[16810,5],[17609,5],[17698,5],[17931,5],[18020,5],[19150,5],[20004,5],[21328,5],[22418,5],[23219,5],[23308,5],[23543,5],[23632,5]]},"282":{"position":[[833,5],[1642,5],[3076,5],[4190,5],[4999,5],[5088,5],[5532,5],[5621,5]]},"284":{"position":[[624,5],[1477,5],[2800,5],[3889,5],[4689,5],[4778,5],[5012,5],[5101,5]]},"294":{"position":[[430,5],[982,5],[1893,5],[2605,5],[3193,5]]},"306":{"position":[[256,5]]},"316":{"position":[[549,5],[775,5]]},"329":{"position":[[678,5],[1479,5],[2905,5],[4011,5],[4810,5],[4899,5],[5335,5],[5424,5],[6259,5],[7061,5],[8488,5],[9595,5],[10397,5],[10486,5],[10923,5],[11012,5],[12073,5],[13044,5],[14715,5],[16028,5],[17007,5],[17096,5]]},"345":{"position":[[633,5],[725,5]]},"353":{"position":[[720,5],[1573,5],[2896,5],[3985,5],[4785,5],[4874,5],[5108,5],[5197,5],[6330,5],[7182,5],[8504,5],[9592,5],[10391,5],[10480,5],[10713,5],[10802,5]]},"359":{"position":[[839,5],[1708,5],[3202,5],[4376,5],[5242,5],[5331,5],[5781,5],[5870,5],[7015,5],[7868,5],[9191,5],[10280,5],[11080,5],[11169,5],[11403,5],[11492,5],[12829,5],[13682,5],[15005,5],[16094,5],[16894,5],[16983,5],[17217,5],[17306,5]]},"375":{"position":[[754,5],[1614,5],[2944,5],[4040,5],[4847,5],[4936,5],[5177,5],[5266,5]]},"382":{"position":[[1699,5],[2549,5],[3869,5],[4955,5],[5752,5],[5841,5],[6072,5],[6161,5]]},"406":{"position":[[702,5],[1677,5],[3336,5],[4626,5],[5607,5],[5696,5],[6220,5],[6309,5],[7456,5],[8311,5],[9636,5],[10727,5],[11529,5],[11618,5],[11854,5],[11943,5]]},"408":{"position":[[604,5],[1689,5],[3458,5],[4858,5],[5949,5],[6038,5],[6598,5],[6687,5]]},"410":{"position":[[550,5],[1405,5],[2730,5],[3821,5],[4623,5],[4712,5],[4948,5],[5037,5]]},"424":{"position":[[2655,5]]},"426":{"position":[[1600,5]]},"446":{"position":[[633,5],[1455,5],[2902,5],[4029,5],[4849,5],[4938,5],[5395,5],[5484,5]]},"448":{"position":[[654,5],[1514,5],[2844,5],[3940,5],[4747,5],[4836,5],[5077,5],[5166,5],[6491,5],[7352,5],[8683,5],[9780,5],[10588,5],[10677,5],[10919,5],[11008,5]]},"456":{"position":[[1389,5]]},"462":{"position":[[138,5],[1981,5],[2164,4],[3069,5]]},"466":{"position":[[619,5]]},"474":{"position":[[2486,5]]},"476":{"position":[[74,5]]},"482":{"position":[[720,5],[1576,5],[2902,5],[3994,5],[4797,5],[4886,5],[5123,5],[5212,5],[6354,5],[7209,5],[8534,5],[9625,5],[10427,5],[10516,5],[10752,5],[10841,5]]},"486":{"position":[[680,5],[1537,5],[2864,5],[3957,5],[4761,5],[4850,5],[5088,5],[5177,5],[6479,5],[7336,5],[8663,5],[9756,5],[10560,5],[10649,5],[10887,5],[10976,5]]},"504":{"position":[[608,5],[1416,5],[2849,5],[3962,5],[4768,5],[4857,5],[5300,5],[5389,5]]},"506":{"position":[[610,5],[1498,5],[3011,5],[4204,5],[5089,5],[5178,5],[5639,5],[5728,5]]},"508":{"position":[[727,5],[1587,5],[2917,5],[4013,5],[4820,5],[4909,5],[5150,5],[5239,5]]},"522":{"position":[[794,5],[1654,5],[3139,5],[4304,5],[5161,5],[5250,5],[5701,5],[5790,5]]},"524":{"position":[[859,5],[1715,5],[3041,5],[4133,5],[4936,5],[5025,5],[5262,5],[5351,5]]},"540":{"position":[[617,5],[1427,5],[2862,5],[3977,5],[4785,5],[4874,5],[5319,5],[5408,5]]},"542":{"position":[[950,5],[1837,5],[3349,5],[4541,5],[5425,5],[5514,5],[5982,5],[6071,5]]},"544":{"position":[[787,5],[1649,5],[2981,5],[4079,5],[4888,5],[4977,5],[5220,5],[5309,5]]},"556":{"position":[[696,5],[1557,5],[3102,5],[4278,5],[5147,5],[5236,5],[5731,5],[5820,5]]},"560":{"position":[[703,5],[1560,5],[3101,5],[4273,5],[5138,5],[5227,5],[5718,5],[5807,5]]},"562":{"position":[[714,5],[1523,5],[2957,5],[4071,5],[4878,5],[4967,5],[5411,5],[5500,5]]},"564":{"position":[[560,5],[1401,5],[2712,5],[3789,5],[4577,5],[4666,5],[4888,5],[4977,5],[6074,5],[6915,5],[8226,5],[9303,5],[10091,5],[10180,5],[10402,5],[10491,5]]},"566":{"position":[[597,5],[1398,5],[2824,5],[3930,5],[4731,5],[4820,5],[5256,5],[5345,5],[6134,5],[6976,5],[8288,5],[9366,5],[10155,5],[10244,5],[10467,5],[10556,5]]},"581":{"position":[[719,5],[1570,5],[2891,5],[3978,5],[4776,5],[4865,5],[5097,5],[5186,5]]},"588":{"position":[[969,5],[1865,5],[3283,5],[4423,5],[5278,5],[5367,5],[5551,5],[5640,5],[7125,5],[8002,5],[9381,5],[10500,5],[11336,5],[11425,5],[11591,5],[11680,5],[13106,5],[13993,5],[15382,5],[16511,5],[17357,5],[17446,5],[17622,5],[17711,5]]},"590":{"position":[[1172,5],[1950,5],[3250,5],[4272,5],[5009,5],[5098,5],[5282,5],[5371,5]]},"595":{"position":[[710,5],[1600,5],[2987,5],[4136,5],[4937,5],[5026,5],[5249,5],[5338,5],[6622,5],[7512,5],[8899,5],[10048,5],[10849,5],[10938,5],[11161,5],[11250,5]]},"600":{"position":[[631,5],[1614,5],[3102,5],[4356,5],[5296,5],[5385,5],[5712,5],[5801,5]]},"619":{"position":[[846,5],[1772,5],[3323,5],[4554,5],[5477,5],[5566,5],[6026,5],[6115,5]]},"621":{"position":[[661,5],[1524,5],[2857,5],[3956,5],[4766,5],[4855,5],[5099,5],[5188,5]]},"627":{"position":[[571,5],[1596,5],[3305,5],[4645,5],[5676,5],[5765,5],[6307,5],[6396,5]]},"629":{"position":[[590,5],[1445,5],[2770,5],[3861,5],[4663,5],[4752,5],[4988,5],[5077,5]]},"631":{"position":[[571,5],[1452,5],[2958,5],[4144,5],[5024,5],[5113,5],[5579,5],[5668,5],[6629,5],[7485,5],[8811,5],[9903,5],[10706,5],[10795,5],[11032,5],[11121,5],[12262,5],[13121,5],[14450,5],[15545,5],[16351,5],[16440,5],[16680,5],[16769,5]]},"649":{"position":[[1850,5],[2702,5],[4024,5],[5112,5],[5911,5],[6000,5],[6233,5],[6322,5],[8022,5],[8874,5],[10196,5],[11284,5],[12083,5],[12172,5],[12405,5],[12494,5],[14843,5],[15698,5],[17023,5],[18114,5],[18916,5],[19005,5],[19241,5],[19330,5],[21680,5],[22532,5],[23854,5],[24942,5],[25741,5],[25830,5],[26063,5],[26152,5],[27916,5],[28769,5],[30092,5],[31181,5],[31981,5],[32070,5],[32304,5],[32393,5]]},"651":{"position":[[1823,5],[2676,5],[3999,5],[5088,5],[5888,5],[5977,5],[6211,5],[6300,5],[8072,5],[8928,5],[10254,5],[11346,5],[12149,5],[12238,5],[12475,5],[12564,5],[14416,5],[15270,5],[16594,5],[17684,5],[18485,5],[18574,5],[18809,5],[18898,5],[20739,5],[21593,5],[22917,5],[24007,5],[24808,5],[24897,5],[25132,5],[25221,5]]},"669":{"position":[[5222,5],[6100,5],[7603,5],[8786,5],[9661,5],[9750,5],[10205,5],[10294,5]]},"671":{"position":[[1613,5],[2519,5],[4050,5],[5261,5],[6166,5],[6255,5],[6711,5],[6800,5]]},"691":{"position":[[842,5],[1787,5],[3416,5],[4676,5],[5627,5],[5716,5],[6222,5],[6311,5],[7390,5],[8243,5],[9566,5],[10655,5],[11455,5],[11544,5],[11778,5],[11867,5],[13385,5],[14238,5],[15561,5],[16650,5],[17450,5],[17539,5],[17773,5],[17862,5],[19071,5],[19926,5],[21251,5],[22342,5],[23144,5],[23233,5],[23469,5],[23558,5],[24697,5],[25551,5],[26875,5],[27965,5],[28766,5],[28855,5],[29090,5],[29179,5]]},"701":{"position":[[1537,5],[2391,5],[3715,5],[4805,5],[5606,5],[5695,5],[5930,5],[6019,5],[7155,5],[8008,5],[9331,5],[10420,5],[11220,5],[11309,5],[11543,5],[11632,5]]},"703":{"position":[[661,5],[1522,5],[3008,5],[4174,5],[5032,5],[5121,5],[5572,5],[5661,5],[6545,5],[7402,5],[8729,5],[9822,5],[10626,5],[10715,5],[10953,5],[11042,5]]},"705":{"position":[[636,5],[1600,5],[3026,5],[4228,5],[5151,5],[5240,5],[5371,5],[5460,5],[6913,5],[7799,5],[9369,5],[10570,5],[11464,5],[11553,5],[12073,5],[12162,5],[13175,5],[14062,5],[15633,5],[16835,5],[17732,5],[17821,5],[18342,5],[18431,5],[19477,5],[20331,5],[21655,5],[22745,5],[23546,5],[23635,5],[23870,5],[23959,5],[25140,5],[25992,5],[27314,5],[28402,5],[29201,5],[29290,5],[29523,5],[29612,5]]},"726":{"position":[[675,5],[2330,5],[4905,5],[6915,5],[8612,5],[8701,5],[9557,5],[9646,5],[11993,5],[13188,5],[15126,5],[16646,5],[17856,5],[17945,5],[18554,5],[18643,5],[20130,5],[21255,5],[23123,5],[24573,5],[25713,5],[25802,5],[26396,5],[26485,5],[28729,5],[29582,5],[30905,5],[31994,5],[32794,5],[32883,5],[33117,5],[33206,5],[34488,5],[35342,5],[36666,5],[37756,5],[38557,5],[38646,5],[38881,5],[38970,5],[40105,5],[40962,5],[42289,5],[43382,5],[44186,5],[44275,5],[44513,5],[44602,5],[45747,5],[46605,5],[47933,5],[49027,5],[49832,5],[49921,5],[50160,5],[50249,5]]},"728":{"position":[[771,5],[1625,5],[2949,5],[4039,5],[4840,5],[4929,5],[5164,5],[5253,5],[8690,5],[9540,5],[10860,5],[11946,5],[12743,5],[12832,5],[13063,5],[13152,5],[14607,5],[15466,5],[16795,5],[17890,5],[18696,5],[18785,5],[19025,5],[19114,5],[21850,4],[21997,4],[22460,4],[25049,5],[25907,5],[27235,5],[28329,5],[29134,5],[29223,5],[29462,5],[29551,5],[33297,5],[34146,5],[35465,5],[36550,5],[37346,5],[37435,5],[37665,5],[37754,5],[38701,4],[42857,5],[43706,5],[45025,5],[46110,5],[46906,5],[46995,5],[47225,5],[47314,5]]},"740":{"position":[[291,4]]},"745":{"position":[[2302,5],[3119,5],[4561,5],[5683,5],[6498,5],[6587,5],[7039,5],[7128,5],[7986,5],[8841,5],[10166,5],[11257,5],[12059,5],[12148,5],[12384,5],[12473,5],[13676,5],[14493,5],[15935,5],[17057,5],[17872,5],[17961,5],[18413,5],[18502,5],[19317,5],[20172,5],[21497,5],[22588,5],[23390,5],[23479,5],[23715,5],[23804,5],[24943,5],[25799,5],[27125,5],[28217,5],[29020,5],[29109,5],[29346,5],[29435,5],[32677,5],[33532,5],[34857,5],[35948,5],[36750,5],[36839,5],[37075,5],[37164,5],[38303,5],[39158,5],[40483,5],[41574,5],[42376,5],[42465,5],[42701,5],[42790,5]]},"747":{"position":[[2831,5],[3877,5],[5607,5],[6968,5],[8020,5],[8109,5],[8662,5],[8751,5],[10145,5],[11002,5],[12329,5],[13422,5],[14226,5],[14315,5],[14553,5],[14642,5]]},"749":{"position":[[776,5],[1617,5],[3083,5],[4229,5],[5068,5],[5157,5],[5633,5],[5722,5],[7017,5],[7890,5],[9388,5],[10566,5],[11436,5],[11525,5],[11980,5],[12069,5],[12908,5],[13763,5],[15088,5],[16179,5],[16981,5],[17070,5],[17306,5],[17395,5]]},"751":{"position":[[3473,5],[4374,5],[5959,5],[7175,5],[8084,5],[8173,5],[8708,5],[8797,5],[10357,5],[11216,5],[12545,5],[13640,5],[14446,5],[14535,5],[14775,5],[14864,5],[17791,5],[18630,5],[20094,5],[21238,5],[22075,5],[22164,5],[22638,5],[22727,5]]},"761":{"position":[[3079,5],[4415,5],[6553,5],[8224,5],[9584,5],[9673,5],[10367,5],[10456,5]]},"767":{"position":[[906,5],[1756,5],[3076,5],[4162,5],[4959,5],[5048,5],[5279,5],[5368,5],[6594,5],[7448,5],[8772,5],[9862,5],[10663,5],[10752,5],[10987,5],[11076,5],[12319,5],[13195,5],[14696,5],[15877,5],[16750,5],[16839,5],[17296,5],[17385,5],[18229,5],[19080,5],[20401,5],[21488,5],[22286,5],[22375,5],[22607,5],[22696,5]]},"769":{"position":[[5021,5],[5867,5],[7183,5],[8265,5],[9058,5],[9147,5],[9374,5],[9463,5],[10826,5],[12070,5],[14057,5],[15626,5],[16885,5],[16974,5],[17630,5],[17719,5],[19369,5],[20368,5],[22051,5],[23365,5],[24370,5],[24459,5],[24982,5],[25071,5],[26308,5],[27158,5],[28478,5],[29564,5],[30361,5],[30450,5],[30681,5],[30770,5]]},"771":{"position":[[296,4],[1566,5],[2620,5],[4358,5],[5727,5],[6789,5],[6878,5],[7402,5],[7491,5],[9003,5],[10022,5],[11530,5],[12817,5],[13802,5],[13891,5],[14220,5],[14309,5],[15929,5],[16949,5],[18458,5],[19746,5],[20732,5],[20821,5],[21151,5],[21240,5]]},"773":{"position":[[3807,5],[6399,5],[10265,5],[13272,5],[15960,5],[16049,5],[17442,5],[17531,5]]},"795":{"position":[[988,5],[1804,5],[3245,5],[4366,5],[5180,5],[5269,5],[5720,5],[5809,5],[6636,5],[7456,5],[8901,5],[10026,5],[10844,5],[10933,5],[11388,5],[11477,5],[12320,5],[13283,5],[14989,5],[16277,5],[17258,5],[17347,5],[17943,5],[18032,5],[18827,5],[19554,5],[20408,5],[21732,5],[22822,5],[23623,5],[23712,5],[23947,5],[24036,5],[25253,5],[26105,5],[27427,5],[28515,5],[29314,5],[29403,5],[29636,5],[29725,5]]},"797":{"position":[[313,4],[3406,5],[4422,5],[6240,5],[7591,5],[8635,5],[8724,5],[9372,5],[9461,5],[10882,5],[11739,5],[13066,5],[14159,5],[14963,5],[15052,5],[15290,5],[15379,5]]},"799":{"position":[[3311,5],[4215,5],[5803,5],[7022,5],[7934,5],[8023,5],[8561,5],[8650,5],[9836,5],[10935,5],[12836,5],[14270,5],[15397,5],[15486,5],[16217,5],[16306,5],[18066,5],[18917,5],[20238,5],[21325,5],[22123,5],[22212,5],[22444,5],[22533,5]]},"801":{"position":[[3506,5],[4472,5],[6181,5],[7472,5],[8456,5],[8545,5],[9144,5],[9233,5],[10758,5],[11614,5],[12940,5],[14032,5],[14835,5],[14924,5],[15161,5],[15250,5]]},"819":{"position":[[234,4]]},"821":{"position":[[2545,5],[3420,5],[4920,5],[6100,5],[6972,5],[7061,5],[7518,5],[7607,5],[8522,5],[9382,5],[10712,5],[11808,5],[12615,5],[12704,5],[12945,5],[13034,5],[14256,5],[15131,5],[16631,5],[17811,5],[18683,5],[18772,5],[19229,5],[19318,5],[20190,5],[21050,5],[22380,5],[23476,5],[24283,5],[24372,5],[24613,5],[24702,5],[25933,5],[26800,5],[28137,5],[29240,5],[30054,5],[30143,5],[30391,5],[30480,5],[32094,5],[33219,5],[35087,5],[36537,5],[37677,5],[37766,5],[38372,5],[38461,5],[39894,5],[40754,5],[42084,5],[43180,5],[43987,5],[44076,5],[44317,5],[44406,5]]},"823":{"position":[[606,5],[1461,5],[2786,5],[3877,5],[4679,5],[4768,5],[5004,5],[5093,5],[7888,5],[8742,5],[10066,5],[11156,5],[11957,5],[12046,5],[12281,5],[12370,5]]},"825":{"position":[[7374,5],[8414,5],[10197,5],[11562,5],[12620,5],[12709,5],[13382,5],[13471,5],[14990,5],[15934,5],[17503,5],[18752,5],[19693,5],[19782,5],[20247,5],[20336,5],[21433,5],[22421,5],[24093,5],[25396,5],[26391,5],[26480,5],[26995,5],[27084,5],[28267,5],[29170,5],[30757,5],[31975,5],[32886,5],[32975,5],[33512,5],[33601,5],[34751,5],[35597,5],[37068,5],[38219,5],[39063,5],[39152,5],[39633,5],[39722,5],[40638,5],[41467,5],[42921,5],[44055,5],[44882,5],[44971,5],[45435,5],[45524,5],[46539,5],[47391,5],[48713,5],[49801,5],[50600,5],[50689,5],[50922,5],[51011,5],[52210,5],[53077,5],[54414,5],[55517,5],[56331,5],[56420,5],[56668,5],[56757,5]]},"844":{"position":[[2303,5],[3123,5],[4568,5],[5693,5],[6511,5],[6600,5],[7055,5],[7144,5],[8011,5],[8869,5],[10197,5],[11291,5],[12096,5],[12185,5],[12424,5],[12513,5],[13723,5],[14539,5],[15980,5],[17101,5],[17915,5],[18004,5],[18455,5],[18544,5],[19357,5],[20211,5],[21535,5],[22625,5],[23426,5],[23515,5],[23750,5],[23839,5],[24975,5],[25831,5],[27157,5],[28249,5],[29052,5],[29141,5],[29378,5],[29467,5],[32197,5],[33051,5],[34375,5],[35465,5],[36266,5],[36355,5],[36590,5],[36679,5],[37815,5],[38670,5],[39995,5],[41086,5],[41888,5],[41977,5],[42213,5],[42302,5]]},"846":{"position":[[2586,5],[3723,5],[5662,5],[7134,5],[8297,5],[8386,5],[9038,5],[9127,5],[10819,5],[11677,5],[13005,5],[14099,5],[14904,5],[14993,5],[15232,5],[15321,5]]},"848":{"position":[[2419,5],[3435,5],[5135,5],[6466,5],[7488,5],[7577,5],[8118,5],[8207,5],[9732,5],[10593,5],[11924,5],[13021,5],[13829,5],[13918,5],[14160,5],[14249,5]]},"850":{"position":[[3292,5],[4481,5],[6413,5],[7927,5],[9131,5],[9220,5],[9849,5],[9938,5],[11402,5],[12264,5],[13596,5],[14694,5],[15503,5],[15592,5],[15835,5],[15924,5],[17160,5],[18024,5],[19358,5],[20458,5],[21269,5],[21358,5],[21603,5],[21692,5],[22857,5],[23723,5],[25059,5],[26161,5],[26974,5],[27063,5],[27310,5],[27399,5],[28649,5],[29513,5],[30847,5],[31947,5],[32758,5],[32847,5],[33092,5],[33181,5],[34346,5],[35210,5],[36544,5],[37644,5],[38455,5],[38544,5],[38789,5],[38878,5]]}}}],["each",{"_index":638,"t":{"47":{"position":[[3929,4]]},"65":{"position":[[116,4]]},"77":{"position":[[1113,4]]},"111":{"position":[[2040,4]]},"113":{"position":[[3281,4]]},"131":{"position":[[1144,4],[1385,4]]},"143":{"position":[[740,4]]},"155":{"position":[[1185,4]]},"169":{"position":[[3483,4]]},"300":{"position":[[141,4]]},"304":{"position":[[107,4]]},"306":{"position":[[518,4]]},"331":{"position":[[519,4]]},"359":{"position":[[18162,4]]},"363":{"position":[[537,4]]},"375":{"position":[[6016,4]]},"424":{"position":[[0,4],[2840,4]]},"426":{"position":[[83,4],[301,4],[315,4],[3945,4],[4633,4]]},"444":{"position":[[146,4]]},"448":{"position":[[11769,4]]},"462":{"position":[[2132,4]]},"504":{"position":[[5710,4]]},"514":{"position":[[1627,4]]},"544":{"position":[[6254,4]]},"621":{"position":[[6366,4]]},"671":{"position":[[311,4],[857,4],[941,4]]},"691":{"position":[[30262,4]]},"719":{"position":[[145,4]]},"728":{"position":[[20398,4]]},"740":{"position":[[231,5]]},"751":{"position":[[16742,4]]},"769":{"position":[[202,4]]},"771":{"position":[[764,4]]},"775":{"position":[[140,4]]},"787":{"position":[[334,4]]},"848":{"position":[[16201,4]]}}}],["earlier",{"_index":1982,"t":{"468":{"position":[[360,7]]},"726":{"position":[[33911,7]]},"728":{"position":[[38595,7]]},"799":{"position":[[17471,7]]},"823":{"position":[[33,8]]},"825":{"position":[[21700,8],[22991,8],[24717,8],[26068,8],[27398,8]]}}}],["easi",{"_index":1420,"t":{"207":{"position":[[311,4]]},"375":{"position":[[6130,4]]},"426":{"position":[[506,4]]},"448":{"position":[[11883,4]]},"504":{"position":[[5866,4]]},"514":{"position":[[1788,4]]},"544":{"position":[[6368,4]]},"621":{"position":[[6481,4]]},"691":{"position":[[30423,4]]}}}],["easier",{"_index":614,"t":{"45":{"position":[[680,6]]},"61":{"position":[[1755,6]]},"169":{"position":[[3165,6]]},"359":{"position":[[18289,6]]},"426":{"position":[[3296,7]]},"452":{"position":[[237,6]]},"726":{"position":[[27675,6]]},"787":{"position":[[200,7]]},"789":{"position":[[643,6]]},"817":{"position":[[1094,6]]}}}],["easili",{"_index":43,"t":{"3":{"position":[[632,6],[927,6]]},"89":{"position":[[164,6]]}}}],["east",{"_index":2619,"t":{"767":{"position":[[12578,4],[13757,4],[15312,4],[16541,4],[17586,4]]}}}],["ecosystem",{"_index":173,"t":{"7":{"position":[[257,9]]}}}],["edit",{"_index":320,"t":{"21":{"position":[[138,4]]},"169":{"position":[[6571,8]]},"347":{"position":[[377,7],[1175,4]]},"353":{"position":[[163,4],[11674,4],[11692,7],[11906,4],[12052,4],[12089,4]]},"355":{"position":[[998,7]]},"357":{"position":[[43,7]]},"359":{"position":[[1085,7],[2257,7],[3805,7],[5027,7],[6051,7],[6249,4],[12219,4]]},"371":{"position":[[215,4]]},"392":{"position":[[252,4],[309,4],[466,4]]},"394":{"position":[[106,4],[163,4]]},"402":{"position":[[469,4],[634,4]]},"408":{"position":[[871,4],[2259,4],[4082,4],[5530,4],[7046,4]]},"420":{"position":[[2250,4]]},"422":{"position":[[1290,4],[3132,4]]},"424":{"position":[[1622,4]]},"661":{"position":[[610,4]]},"677":{"position":[[821,4]]},"689":{"position":[[552,5]]}}}],["editor",{"_index":319,"t":{"21":{"position":[[123,6]]},"51":{"position":[[153,7],[193,6],[219,6],[263,9],[374,8],[443,8],[488,9],[777,7],[876,7],[1180,6],[1458,6],[1505,6],[1575,9],[1880,6],[1930,6],[1977,6],[2048,9]]},"55":{"position":[[218,6],[371,8],[682,6],[750,9],[1203,9],[1246,6],[1343,6]]},"57":{"position":[[246,6],[448,8],[722,6],[790,9],[1211,8],[1298,6],[1560,6],[1651,9]]},"61":{"position":[[459,8],[674,8],[939,7],[988,6],[1165,9],[1354,8],[1582,9],[1865,6],[2060,8],[2494,6]]},"169":{"position":[[926,7],[1054,9],[1277,9],[1776,7],[2037,9],[2348,9],[5711,6],[5940,6],[6051,6],[6166,6],[6315,7],[6527,6],[6736,7],[6898,9],[7121,9],[7378,6],[9005,7],[9382,9],[11393,6],[11407,7],[11568,8],[11588,9],[11645,9],[11897,9],[12059,6],[31923,8],[32012,9]]},"347":{"position":[[243,7],[507,7],[683,9],[740,9],[1247,9]]},"353":{"position":[[997,9],[2089,9],[3461,9],[4996,6],[5672,9],[5692,8],[6606,9],[7697,9],[9068,9],[10601,6],[11274,9],[11294,8]]},"355":{"position":[[301,7],[504,9],[631,9]]},"357":{"position":[[93,6],[188,7],[388,7],[607,9],[826,9]]},"359":{"position":[[148,6],[7291,9],[8383,9],[9755,9],[11290,6],[11965,9],[11985,8],[13106,9],[14198,9],[15570,9],[17105,6],[17781,9],[17801,8]]},"363":{"position":[[116,7],[346,7]]},"365":{"position":[[244,6],[356,6],[470,7],[617,9],[743,9],[970,9]]},"371":{"position":[[73,7],[301,7]]},"373":{"position":[[98,7],[251,6],[265,7],[471,8],[491,9],[617,9],[792,6],[863,6]]},"375":{"position":[[64,6]]},"377":{"position":[[130,7]]},"392":{"position":[[576,6],[590,7],[802,8],[822,9],[879,9]]},"402":{"position":[[601,6]]},"404":{"position":[[371,6],[385,7],[656,8],[676,9],[846,9]]},"408":{"position":[[954,9],[4173,9],[6828,6]]},"410":{"position":[[826,9],[1920,9],[3294,9],[4833,6],[5512,9],[5532,8]]},"420":{"position":[[1815,6],[1856,6],[2127,6],[2290,6]]},"422":{"position":[[857,6],[898,6],[1169,6],[1330,6],[2697,6],[2738,6],[3009,6],[3172,6]]},"424":{"position":[[1187,6],[1228,6],[1499,6],[1662,6],[2291,6],[2938,7]]},"426":{"position":[[4154,7],[4166,6],[4222,7],[4314,7],[4408,6],[4554,7],[4656,7],[4769,9],[4883,7],[5038,7],[5113,9],[5277,6],[7076,6],[7117,6],[7796,6],[8186,6],[8566,6],[8614,6],[9293,7],[9423,6],[9478,6],[9519,6],[9577,6],[9886,7],[10016,6],[10071,6],[10112,6],[10170,6]]},"428":{"position":[[2011,7],[2068,9]]},"440":{"position":[[273,7],[370,7],[517,9],[643,9]]},"446":{"position":[[63,6],[885,9],[3519,9],[5606,6]]},"448":{"position":[[128,6],[929,9],[2028,9],[3407,9],[4956,6],[5644,9],[5664,8]]},"466":{"position":[[975,7],[993,6]]},"490":{"position":[[182,6],[211,6]]},"492":{"position":[[270,6],[321,6],[393,7],[439,7],[558,9],[615,9],[727,9],[784,9]]},"498":{"position":[[77,6],[110,6],[161,7],[187,7],[334,6],[462,6],[517,6],[616,6],[769,6]]},"500":{"position":[[375,7],[445,7],[564,9],[621,9],[759,9],[887,9]]},"502":{"position":[[179,7],[249,7],[267,6],[390,9],[447,9],[585,9],[728,8],[852,9],[935,6],[1004,7],[1069,6],[1076,8],[1185,6],[1203,6]]},"504":{"position":[[98,6],[860,9],[3466,9],[5511,6]]},"506":{"position":[[19,6]]},"508":{"position":[[202,6],[1002,9],[2101,9],[3480,9],[5029,6],[5717,9],[5737,8],[6150,6],[6228,7],[6296,7],[6341,6]]},"510":{"position":[[287,7],[317,7]]},"530":{"position":[[278,7],[353,7],[474,9],[531,9]]},"536":{"position":[[184,6]]},"538":{"position":[[232,7],[402,9],[459,9]]},"542":{"position":[[424,7],[1267,9],[4031,9],[6204,6]]},"544":{"position":[[155,7],[234,6],[1064,9],[2165,9],[3546,9],[5099,6],[5793,9],[5813,8],[6075,7],[6129,6]]},"610":{"position":[[243,7],[373,7],[538,9],[595,9]]},"617":{"position":[[230,7],[421,9],[549,9]]},"621":{"position":[[6059,6],[6108,7],[6142,7]]},"645":{"position":[[351,6],[365,7],[626,8],[646,9],[850,9],[1259,6],[1374,7]]},"649":{"position":[[162,6],[176,7],[437,8],[457,9],[661,9],[27191,6],[27258,9],[33068,6],[33157,6],[33379,6],[33444,6]]},"651":{"position":[[192,6],[206,7],[427,8],[441,9],[498,9],[20012,6],[20080,9]]},"661":{"position":[[1145,7],[1265,6],[1289,6],[2006,9],[2539,8],[2614,8]]},"669":{"position":[[830,6]]},"673":{"position":[[483,7],[603,6],[627,6],[1881,9],[2414,8],[2489,8]]},"677":{"position":[[231,8]]},"693":{"position":[[245,7]]},"699":{"position":[[113,6],[134,6],[311,7],[343,6],[446,9],[533,8],[578,9],[731,6],[785,9],[866,9]]},"701":{"position":[[313,7],[353,6],[505,9],[616,8],[818,9]]},"703":{"position":[[921,6],[2085,6],[3625,6],[4839,6],[5857,6]]},"705":{"position":[[6349,6],[13429,9],[13502,9],[16252,9],[16335,9],[18516,6],[18597,6],[25416,9],[26507,9],[27878,9],[29411,6],[30084,9],[30104,8]]},"839":{"position":[[179,8]]}}}],["editor(",{"_index":1869,"t":{"426":{"position":[[4668,9]]}}}],["effect",{"_index":2211,"t":{"647":{"position":[[18,6]]},"651":{"position":[[41,6]]},"801":{"position":[[610,7],[10122,6]]}}}],["effort",{"_index":66,"t":{"3":{"position":[[958,7]]}}}],["emili",{"_index":2227,"t":{"649":{"position":[[27179,5],[27341,5],[33056,5],[33274,5],[33367,5]]},"801":{"position":[[2869,6],[2876,5],[9944,5],[10023,5],[15992,5],[16032,5],[16087,5],[16120,5]]},"817":{"position":[[160,5],[461,5],[742,5],[945,5]]},"819":{"position":[[731,5]]},"821":{"position":[[401,5],[31484,5],[32577,5],[34123,5],[35947,5],[37443,5],[39137,5]]},"825":{"position":[[866,6],[1108,5],[1208,5],[20923,5],[27742,6],[58154,5],[58197,5],[58256,5],[58299,5]]}}}],["employ",{"_index":18,"t":{"3":{"position":[[244,7]]}}}],["employe",{"_index":1488,"t":{"227":{"position":[[252,8],[378,9],[558,11],[617,11],[866,10]]},"234":{"position":[[25,8],[198,8]]},"236":{"position":[[50,8],[824,11],[3434,11],[5485,8]]},"238":{"position":[[5798,8]]},"271":{"position":[[135,8],[226,8]]},"380":{"position":[[608,8]]},"462":{"position":[[1463,9],[2340,11],[2358,8]]},"490":{"position":[[656,8],[701,8]]}}}],["employee’",{"_index":2248,"t":{"655":{"position":[[385,10]]},"755":{"position":[[417,10]]}}}],["empti",{"_index":1427,"t":{"215":{"position":[[3354,5]]},"217":{"position":[[4483,5]]},"219":{"position":[[5044,5]]},"590":{"position":[[6013,5]]},"751":{"position":[[17167,5]]}}}],["enabl",{"_index":216,"t":{"9":{"position":[[469,7]]},"73":{"position":[[66,7]]},"129":{"position":[[137,6]]},"145":{"position":[[2646,6],[5277,6]]},"147":{"position":[[468,6],[713,8],[968,6],[1285,8],[1902,6],[2162,8],[2493,6],[2810,8]]},"149":{"position":[[216,7]]},"151":{"position":[[206,7],[264,7],[396,7],[642,7]]},"155":{"position":[[71,7],[578,7],[703,7],[790,7],[992,6],[1272,7]]},"159":{"position":[[517,6]]},"161":{"position":[[103,6],[566,6]]},"217":{"position":[[307,6]]},"402":{"position":[[66,6]]},"452":{"position":[[263,6]]},"462":{"position":[[1211,6]]},"645":{"position":[[28,7]]},"647":{"position":[[25,8]]}}}],["enabled=fals",{"_index":1309,"t":{"159":{"position":[[179,13]]}}}],["enabled=tru",{"_index":1236,"t":{"147":{"position":[[1599,12],[3152,12]]},"161":{"position":[[132,12],[603,12]]}}}],["encod",{"_index":1846,"t":{"426":{"position":[[142,6]]},"462":{"position":[[2965,6]]}}}],["encompass",{"_index":1483,"t":{"225":{"position":[[220,9]]},"528":{"position":[[238,9]]}}}],["encount",{"_index":39,"t":{"3":{"position":[[549,10]]},"45":{"position":[[714,9]]},"169":{"position":[[9299,9]]},"508":{"position":[[6672,10]]},"536":{"position":[[40,9]]},"728":{"position":[[19850,11]]}}}],["end",{"_index":1661,"t":{"335":{"position":[[180,3],[187,3]]},"402":{"position":[[983,4]]},"721":{"position":[[443,3]]},"745":{"position":[[66,3],[97,3]]},"747":{"position":[[145,3],[176,3]]},"749":{"position":[[18054,3],[18074,5]]},"751":{"position":[[392,3],[423,3]]},"763":{"position":[[7,3]]},"785":{"position":[[195,3]]},"797":{"position":[[937,3]]},"819":{"position":[[16,3]]},"821":{"position":[[157,3]]},"825":{"position":[[167,3]]},"844":{"position":[[160,3]]},"846":{"position":[[123,3],[154,3]]},"848":{"position":[[196,3],[227,3]]}}}],["endpoint",{"_index":743,"t":{"67":{"position":[[98,8]]},"69":{"position":[[5,9]]},"133":{"position":[[1274,9],[1480,9]]},"153":{"position":[[48,8]]},"159":{"position":[[450,8]]},"161":{"position":[[306,8]]},"169":{"position":[[17952,8],[18159,8],[18207,8],[24268,8],[24507,8],[24562,8]]},"195":{"position":[[47,8]]},"197":{"position":[[61,8]]},"304":{"position":[[36,9]]},"306":{"position":[[25,8]]},"310":{"position":[[1767,9],[1880,8],[2203,9],[3162,9]]},"462":{"position":[[2042,9]]},"570":{"position":[[106,10]]},"579":{"position":[[24,8]]},"586":{"position":[[23,8]]},"598":{"position":[[30,8]]},"659":{"position":[[259,8]]},"673":{"position":[[10294,8],[10323,9],[10382,10],[10431,8]]},"759":{"position":[[260,8]]},"773":{"position":[[21196,8],[21225,9],[21284,10],[21333,8],[21495,8]]}}}],["enforc",{"_index":1915,"t":{"452":{"position":[[547,9]]}}}],["engin",{"_index":1150,"t":{"143":{"position":[[381,7]]},"145":{"position":[[34,6],[89,6],[209,6],[306,6],[1168,6],[1413,6],[3120,8],[3855,6],[4080,6]]},"225":{"position":[[312,9]]},"528":{"position":[[330,9]]},"655":{"position":[[543,8]]},"749":{"position":[[177,12],[6115,12]]},"755":{"position":[[570,8]]},"827":{"position":[[732,11]]}}}],["enough",{"_index":1063,"t":{"131":{"position":[[1335,6]]},"310":{"position":[[1593,7],[1844,7]]},"312":{"position":[[173,6],[451,6]]},"390":{"position":[[399,7]]},"749":{"position":[[6142,6]]},"825":{"position":[[21728,6],[23019,6],[24745,6],[26096,6],[27426,6]]}}}],["ensur",{"_index":284,"t":{"17":{"position":[[44,7]]},"69":{"position":[[373,6]]},"71":{"position":[[36,6]]},"73":{"position":[[444,6]]},"131":{"position":[[3,6],[309,6]]},"213":{"position":[[93,6]]},"402":{"position":[[1014,8]]},"410":{"position":[[3,6]]},"426":{"position":[[6535,6]]},"428":{"position":[[101,6],[633,6],[1160,6]]},"452":{"position":[[1107,6]]},"665":{"position":[[171,6]]},"667":{"position":[[108,6]]},"689":{"position":[[1564,6]]},"695":{"position":[[263,6]]},"701":{"position":[[106,7]]},"703":{"position":[[6035,6]]},"705":{"position":[[18897,6]]},"728":{"position":[[40544,6]]},"765":{"position":[[161,6]]},"767":{"position":[[108,6],[178,6]]},"825":{"position":[[45994,6]]}}}],["enter",{"_index":534,"t":{"37":{"position":[[6005,5]]},"97":{"position":[[2941,5]]},"123":{"position":[[2941,5]]},"169":{"position":[[16319,5],[22513,5],[28984,5]]},"236":{"position":[[4239,5]]},"238":{"position":[[4151,5],[9901,5]]},"248":{"position":[[2941,5]]},"265":{"position":[[4421,5]]},"267":{"position":[[4245,5],[9839,5]]},"273":{"position":[[5444,5],[11303,5],[17118,5],[22726,5]]},"282":{"position":[[4498,5]]},"284":{"position":[[4197,5]]},"294":{"position":[[2913,5]]},"329":{"position":[[4319,5],[9903,5],[16336,5]]},"353":{"position":[[4293,5],[9900,5]]},"359":{"position":[[4684,5],[10588,5],[16402,5]]},"375":{"position":[[4348,5]]},"382":{"position":[[5263,5]]},"406":{"position":[[4934,5],[11035,5]]},"408":{"position":[[5166,5]]},"410":{"position":[[4129,5]]},"446":{"position":[[4337,5]]},"448":{"position":[[4248,5],[10088,5]]},"482":{"position":[[4302,5],[9933,5]]},"486":{"position":[[4265,5],[10064,5]]},"504":{"position":[[4270,5]]},"506":{"position":[[4512,5]]},"508":{"position":[[4321,5]]},"522":{"position":[[4612,5]]},"524":{"position":[[4441,5]]},"540":{"position":[[4285,5]]},"542":{"position":[[4849,5]]},"544":{"position":[[4387,5]]},"556":{"position":[[4586,5]]},"560":{"position":[[4581,5]]},"562":{"position":[[4379,5]]},"564":{"position":[[4097,5],[9611,5]]},"566":{"position":[[4238,5],[9674,5]]},"581":{"position":[[4286,5]]},"588":{"position":[[4731,5],[10808,5],[16819,5]]},"590":{"position":[[4580,5]]},"595":{"position":[[4444,5],[10356,5]]},"600":{"position":[[4664,5]]},"619":{"position":[[4862,5]]},"621":{"position":[[4264,5]]},"627":{"position":[[4953,5]]},"629":{"position":[[4169,5]]},"631":{"position":[[4452,5],[10211,5],[15853,5]]},"649":{"position":[[5420,5],[11592,5],[18422,5],[25250,5],[31489,5]]},"651":{"position":[[5396,5],[11654,5],[17992,5],[24315,5]]},"669":{"position":[[9094,5]]},"671":{"position":[[5569,5]]},"691":{"position":[[4984,5],[10963,5],[16958,5],[22650,5],[28273,5]]},"701":{"position":[[5113,5],[10728,5]]},"703":{"position":[[4482,5],[10130,5]]},"705":{"position":[[4536,5],[10878,5],[17143,5],[23053,5],[28710,5]]},"726":{"position":[[7223,5],[16954,5],[24881,5],[32302,5],[38064,5],[43690,5],[49335,5]]},"728":{"position":[[4347,5],[12254,5],[18198,5],[28637,5],[36858,5],[46418,5]]},"745":{"position":[[5991,5],[11565,5],[17365,5],[22896,5],[28525,5],[36256,5],[41882,5]]},"747":{"position":[[7276,5],[13730,5]]},"749":{"position":[[4537,5],[10874,5],[16487,5]]},"751":{"position":[[7483,5],[13948,5],[21546,5]]},"761":{"position":[[8532,5]]},"767":{"position":[[4470,5],[10170,5],[16185,5],[21796,5]]},"769":{"position":[[8573,5],[15934,5],[23673,5],[29872,5]]},"771":{"position":[[6035,5],[13125,5],[20054,5]]},"773":{"position":[[13580,5]]},"795":{"position":[[4674,5],[10334,5],[16585,5],[23130,5],[28823,5]]},"797":{"position":[[7899,5],[14467,5]]},"799":{"position":[[2771,5],[7330,5],[14578,5],[21633,5],[23246,5]]},"801":{"position":[[7780,5],[14340,5]]},"821":{"position":[[6408,5],[12116,5],[18119,5],[23784,5],[29548,5],[36845,5],[43488,5]]},"823":{"position":[[4185,5],[11464,5]]},"825":{"position":[[11870,5],[19060,5],[25704,5],[32283,5],[38527,5],[44363,5],[50109,5],[55825,5]]},"844":{"position":[[6001,5],[11599,5],[17409,5],[22933,5],[28557,5],[35773,5],[41394,5]]},"846":{"position":[[7442,5],[14407,5]]},"848":{"position":[[6774,5],[13329,5]]},"850":{"position":[[8235,5],[15002,5],[20766,5],[26469,5],[32255,5],[37952,5]]}}}],["enterpris",{"_index":2385,"t":{"719":{"position":[[126,13],[428,10]]},"721":{"position":[[292,10]]},"726":{"position":[[1337,10],[1488,10],[1655,10],[3472,10],[3682,10],[3908,10],[5954,10],[6115,10],[6292,10],[8009,10],[8169,10],[8345,10],[10896,10],[11051,10],[11222,10],[12570,10],[14186,10],[16080,10],[17646,10],[19416,10]]},"813":{"position":[[534,10]]}}}],["entir",{"_index":1613,"t":{"310":{"position":[[1508,6],[2435,6],[2912,6]]},"420":{"position":[[914,6]]},"751":{"position":[[687,6]]}}}],["entiti",{"_index":52,"t":{"3":{"position":[[794,9]]},"31":{"position":[[185,6]]},"41":{"position":[[21,6]]},"169":{"position":[[3412,6],[4044,6],[4525,6]]},"177":{"position":[[23,6]]},"179":{"position":[[24,6]]},"181":{"position":[[13,6]]},"227":{"position":[[1150,6],[1440,6]]},"231":{"position":[[72,6],[362,6]]},"258":{"position":[[869,6],[1159,6]]},"262":{"position":[[72,6],[362,6]]},"273":{"position":[[24581,6],[24871,6]]},"279":{"position":[[72,6],[362,6]]},"320":{"position":[[1471,6],[1761,6]]},"326":{"position":[[72,6],[362,6]]},"347":{"position":[[1780,6],[2070,6]]},"351":{"position":[[72,6],[362,6]]},"365":{"position":[[1282,6],[1572,6]]},"369":{"position":[[72,6],[362,6]]},"440":{"position":[[861,6],[1151,6]]},"442":{"position":[[72,6],[362,6]]},"474":{"position":[[2768,6],[3058,6]]},"480":{"position":[[72,6],[362,6]]},"492":{"position":[[1153,6],[1443,6]]},"496":{"position":[[72,6],[362,6]]},"514":{"position":[[923,6],[1213,6]]},"518":{"position":[[72,6],[362,6]]},"530":{"position":[[900,6],[1190,6]]},"534":{"position":[[72,6],[362,6]]},"550":{"position":[[853,6],[1143,6]]},"554":{"position":[[72,6],[362,6]]},"572":{"position":[[1324,6],[1614,6]]},"576":{"position":[[72,6],[362,6]]},"610":{"position":[[1097,6],[1387,6]]},"614":{"position":[[72,6],[362,6]]},"637":{"position":[[441,6],[731,6]]},"641":{"position":[[72,6],[362,6]]},"679":{"position":[[1012,6],[1302,6]]},"683":{"position":[[72,6],[362,6]]},"697":{"position":[[145,6],[435,6]]}}}],["entitl",{"_index":706,"t":{"53":{"position":[[3574,13]]},"115":{"position":[[95,12],[117,12]]},"339":{"position":[[0,12]]},"623":{"position":[[65,13],[129,8]]},"633":{"position":[[117,12],[149,11]]},"653":{"position":[[153,12],[400,12]]},"711":{"position":[[36,12],[127,11]]},"717":{"position":[[148,12],[259,12],[685,13]]},"719":{"position":[[18,11],[341,11]]},"730":{"position":[[40,12]]}}}],["enumer",{"_index":1089,"t":{"133":{"position":[[490,10]]},"155":{"position":[[405,10]]},"424":{"position":[[2812,9]]}}}],["env",{"_index":590,"t":{"43":{"position":[[3093,3]]},"133":{"position":[[550,3]]},"161":{"position":[[496,3]]}}}],["environ",{"_index":425,"t":{"31":{"position":[[1121,12]]},"35":{"position":[[295,11],[581,11],[867,11],[1153,11],[1379,11],[1453,11],[1694,11]]},"37":{"position":[[3781,11]]},"43":{"position":[[1395,11]]},"75":{"position":[[312,11]]},"93":{"position":[[332,11],[655,11],[978,11],[1301,11],[1562,11],[1857,11]]},"97":{"position":[[1470,11]]},"105":{"position":[[352,11],[716,11]]},"119":{"position":[[332,11],[655,11],[978,11],[1301,11],[1562,11],[1857,11]]},"123":{"position":[[1470,11]]},"129":{"position":[[99,12]]},"135":{"position":[[74,12],[190,11],[274,11]]},"137":{"position":[[36,11]]},"143":{"position":[[641,11]]},"145":{"position":[[1727,12],[2020,12],[2307,12],[4364,12],[4691,12],[4958,12]]},"147":{"position":[[583,11],[2017,11]]},"155":{"position":[[259,11]]},"157":{"position":[[279,11]]},"159":{"position":[[227,11],[343,11],[583,11]]},"161":{"position":[[173,11],[349,11],[628,11]]},"165":{"position":[[147,11]]},"169":{"position":[[3876,12],[14469,11],[20663,11],[27092,11]]},"211":{"position":[[103,12],[183,11]]},"215":{"position":[[1481,11]]},"217":{"position":[[202,11],[2209,11]]},"219":{"position":[[2372,11]]},"236":{"position":[[2365,11]]},"238":{"position":[[2304,11],[8052,11]]},"244":{"position":[[296,11],[583,11],[870,11],[1157,11],[1418,11],[1677,11]]},"248":{"position":[[1470,11]]},"265":{"position":[[2584,11]]},"267":{"position":[[2376,11],[8001,11]]},"273":{"position":[[3601,11],[9392,11],[15271,11],[20877,11]]},"282":{"position":[[2625,11]]},"284":{"position":[[2349,11]]},"290":{"position":[[327,11],[649,11],[936,11],[1223,11],[1517,11]]},"294":{"position":[[1442,11]]},"316":{"position":[[1619,12]]},"329":{"position":[[2454,11],[8037,11],[14264,11]]},"353":{"position":[[2445,11],[8053,11]]},"359":{"position":[[2751,11],[8740,11],[14554,11]]},"375":{"position":[[2493,11]]},"382":{"position":[[3418,11]]},"406":{"position":[[2885,11],[9185,11]]},"408":{"position":[[3007,11]]},"410":{"position":[[2279,11]]},"436":{"position":[[63,12]]},"446":{"position":[[2451,11]]},"448":{"position":[[2393,11],[8232,11]]},"470":{"position":[[214,11]]},"482":{"position":[[2451,11],[8083,11]]},"486":{"position":[[2413,11],[8212,11]]},"504":{"position":[[2398,11]]},"506":{"position":[[2560,11]]},"508":{"position":[[2466,11]]},"522":{"position":[[2688,11]]},"524":{"position":[[2590,11]]},"540":{"position":[[2411,11]]},"542":{"position":[[2898,11]]},"544":{"position":[[2530,11]]},"556":{"position":[[2651,11]]},"560":{"position":[[2650,11]]},"562":{"position":[[2506,11]]},"564":{"position":[[2261,11],[7775,11]]},"566":{"position":[[2373,11],[7837,11]]},"581":{"position":[[2440,11]]},"588":{"position":[[2832,11],[8930,11],[14931,11]]},"590":{"position":[[2799,11]]},"595":{"position":[[2536,11],[8448,11]]},"600":{"position":[[2651,11]]},"619":{"position":[[2872,11]]},"621":{"position":[[2406,11]]},"627":{"position":[[2854,11]]},"629":{"position":[[2319,11]]},"631":{"position":[[2507,11],[8360,11],[13999,11]]},"649":{"position":[[3573,11],[9745,11],[16572,11],[23403,11],[29641,11]]},"651":{"position":[[3548,11],[9803,11],[16143,11],[22466,11]]},"669":{"position":[[7152,11]]},"671":{"position":[[3599,11]]},"691":{"position":[[2965,11],[9115,11],[15110,11],[20800,11],[26424,11]]},"701":{"position":[[3264,11],[8880,11]]},"703":{"position":[[2557,11],[8278,11]]},"705":{"position":[[2575,11],[8918,11],[15182,11],[21204,11],[26863,11]]},"709":{"position":[[336,11]]},"726":{"position":[[4454,11],[14675,11],[22672,11],[30454,11],[36215,11],[41838,11],[47482,11]]},"728":{"position":[[2498,11],[10409,11],[16344,11],[26784,11],[35014,11],[44574,11]]},"745":{"position":[[4110,11],[9715,11],[15484,11],[21046,11],[26674,11],[34406,11],[40032,11]]},"747":{"position":[[5156,11],[11878,11]]},"749":{"position":[[2632,11],[8937,11],[14637,11]]},"751":{"position":[[5508,11],[12094,11],[19643,11]]},"761":{"position":[[6102,11]]},"767":{"position":[[2625,11],[8321,11],[14245,11],[19950,11]]},"769":{"position":[[6732,11],[13606,11],[21600,11],[28027,11]]},"771":{"position":[[3907,11],[11079,11],[18007,11]]},"773":{"position":[[9814,11]]},"795":{"position":[[2794,11],[8450,11],[14538,11],[21281,11],[26976,11]]},"797":{"position":[[5789,11],[12615,11]]},"799":{"position":[[5352,11],[12385,11],[19787,11]]},"801":{"position":[[5730,11],[12489,11]]},"821":{"position":[[4469,11],[10261,11],[16180,11],[21929,11],[27686,11],[34636,11],[41633,11]]},"823":{"position":[[2335,11],[9615,11]]},"825":{"position":[[9746,11],[17052,11],[23642,11],[30306,11],[36617,11],[42470,11],[48262,11],[53963,11]]},"844":{"position":[[4117,11],[9746,11],[15529,11],[21084,11],[26706,11],[33924,11],[39544,11]]},"846":{"position":[[5211,11],[12554,11]]},"848":{"position":[[4684,11],[11473,11]]},"850":{"position":[[5962,11],[13145,11],[18907,11],[24608,11],[30396,11],[36093,11]]}}}],["environment.getenvironmentvariable(\"fga_api_audi",{"_index":1465,"t":{"219":{"position":[[3301,55]]}}}],["environment.getenvironmentvariable(\"fga_api_host",{"_index":516,"t":{"37":{"position":[[4141,51]]},"43":{"position":[[1679,51]]},"97":{"position":[[1830,51]]},"123":{"position":[[1830,51]]},"169":{"position":[[14829,51],[21023,51],[27452,51]]},"215":{"position":[[1765,51]]},"217":{"position":[[2493,51]]},"219":{"position":[[2656,51]]},"236":{"position":[[2725,51]]},"238":{"position":[[2664,51],[8412,51]]},"248":{"position":[[1830,51]]},"265":{"position":[[2944,51]]},"267":{"position":[[2736,51],[8361,51]]},"273":{"position":[[3961,51],[9752,51],[15631,51],[21237,51]]},"282":{"position":[[2985,51]]},"284":{"position":[[2709,51]]},"294":{"position":[[1802,51]]},"329":{"position":[[2814,51],[8397,51],[14624,51]]},"353":{"position":[[2805,51],[8413,51]]},"359":{"position":[[3111,51],[9100,51],[14914,51]]},"375":{"position":[[2853,51]]},"382":{"position":[[3778,51]]},"406":{"position":[[3245,51],[9545,51]]},"408":{"position":[[3367,51]]},"410":{"position":[[2639,51]]},"446":{"position":[[2811,51]]},"448":{"position":[[2753,51],[8592,51]]},"482":{"position":[[2811,51],[8443,51]]},"486":{"position":[[2773,51],[8572,51]]},"504":{"position":[[2758,51]]},"506":{"position":[[2920,51]]},"508":{"position":[[2826,51]]},"522":{"position":[[3048,51]]},"524":{"position":[[2950,51]]},"540":{"position":[[2771,51]]},"542":{"position":[[3258,51]]},"544":{"position":[[2890,51]]},"556":{"position":[[3011,51]]},"560":{"position":[[3010,51]]},"562":{"position":[[2866,51]]},"564":{"position":[[2621,51],[8135,51]]},"566":{"position":[[2733,51],[8197,51]]},"581":{"position":[[2800,51]]},"588":{"position":[[3192,51],[9290,51],[15291,51]]},"590":{"position":[[3159,51]]},"595":{"position":[[2896,51],[8808,51]]},"600":{"position":[[3011,51]]},"619":{"position":[[3232,51]]},"621":{"position":[[2766,51]]},"627":{"position":[[3214,51]]},"629":{"position":[[2679,51]]},"631":{"position":[[2867,51],[8720,51],[14359,51]]},"649":{"position":[[3933,51],[10105,51],[16932,51],[23763,51],[30001,51]]},"651":{"position":[[3908,51],[10163,51],[16503,51],[22826,51]]},"669":{"position":[[7512,51]]},"671":{"position":[[3959,51]]},"691":{"position":[[3325,51],[9475,51],[15470,51],[21160,51],[26784,51]]},"701":{"position":[[3624,51],[9240,51]]},"703":{"position":[[2917,51],[8638,51]]},"705":{"position":[[2935,51],[9278,51],[15542,51],[21564,51],[27223,51]]},"726":{"position":[[4814,51],[15035,51],[23032,51],[30814,51],[36575,51],[42198,51],[47842,51]]},"728":{"position":[[2858,51],[10769,51],[16704,51],[27144,51],[35374,51],[44934,51]]},"745":{"position":[[4470,51],[10075,51],[15844,51],[21406,51],[27034,51],[34766,51],[40392,51]]},"747":{"position":[[5516,51],[12238,51]]},"749":{"position":[[2992,51],[9297,51],[14997,51]]},"751":{"position":[[5868,51],[12454,51],[20003,51]]},"761":{"position":[[6462,51]]},"767":{"position":[[2985,51],[8681,51],[14605,51],[20310,51]]},"769":{"position":[[7092,51],[13966,51],[21960,51],[28387,51]]},"771":{"position":[[4267,51],[11439,51],[18367,51]]},"773":{"position":[[10174,51]]},"795":{"position":[[3154,51],[8810,51],[14898,51],[21641,51],[27336,51]]},"797":{"position":[[6149,51],[12975,51]]},"799":{"position":[[5712,51],[12745,51],[20147,51]]},"801":{"position":[[6090,51],[12849,51]]},"821":{"position":[[4829,51],[10621,51],[16540,51],[22289,51],[28046,51],[34996,51],[41993,51]]},"823":{"position":[[2695,51],[9975,51]]},"825":{"position":[[10106,51],[17412,51],[24002,51],[30666,51],[36977,51],[42830,51],[48622,51],[54323,51]]},"844":{"position":[[4477,51],[10106,51],[15889,51],[21444,51],[27066,51],[34284,51],[39904,51]]},"846":{"position":[[5571,51],[12914,51]]},"848":{"position":[[5044,51],[11833,51]]},"850":{"position":[[6322,51],[13505,51],[19267,51],[24968,51],[30756,51],[36453,51]]}}}],["environment.getenvironmentvariable(\"fga_api_schem",{"_index":515,"t":{"37":{"position":[[4028,53]]},"43":{"position":[[1556,53]]},"97":{"position":[[1717,53]]},"123":{"position":[[1717,53]]},"169":{"position":[[14716,53],[20910,53],[27339,53]]},"215":{"position":[[1642,53]]},"217":{"position":[[2370,53]]},"219":{"position":[[2533,53]]},"236":{"position":[[2612,53]]},"238":{"position":[[2551,53],[8299,53]]},"248":{"position":[[1717,53]]},"265":{"position":[[2831,53]]},"267":{"position":[[2623,53],[8248,53]]},"273":{"position":[[3848,53],[9639,53],[15518,53],[21124,53]]},"282":{"position":[[2872,53]]},"284":{"position":[[2596,53]]},"294":{"position":[[1689,53]]},"329":{"position":[[2701,53],[8284,53],[14511,53]]},"353":{"position":[[2692,53],[8300,53]]},"359":{"position":[[2998,53],[8987,53],[14801,53]]},"375":{"position":[[2740,53]]},"382":{"position":[[3665,53]]},"406":{"position":[[3132,53],[9432,53]]},"408":{"position":[[3254,53]]},"410":{"position":[[2526,53]]},"446":{"position":[[2698,53]]},"448":{"position":[[2640,53],[8479,53]]},"482":{"position":[[2698,53],[8330,53]]},"486":{"position":[[2660,53],[8459,53]]},"504":{"position":[[2645,53]]},"506":{"position":[[2807,53]]},"508":{"position":[[2713,53]]},"522":{"position":[[2935,53]]},"524":{"position":[[2837,53]]},"540":{"position":[[2658,53]]},"542":{"position":[[3145,53]]},"544":{"position":[[2777,53]]},"556":{"position":[[2898,53]]},"560":{"position":[[2897,53]]},"562":{"position":[[2753,53]]},"564":{"position":[[2508,53],[8022,53]]},"566":{"position":[[2620,53],[8084,53]]},"581":{"position":[[2687,53]]},"588":{"position":[[3079,53],[9177,53],[15178,53]]},"590":{"position":[[3046,53]]},"595":{"position":[[2783,53],[8695,53]]},"600":{"position":[[2898,53]]},"619":{"position":[[3119,53]]},"621":{"position":[[2653,53]]},"627":{"position":[[3101,53]]},"629":{"position":[[2566,53]]},"631":{"position":[[2754,53],[8607,53],[14246,53]]},"649":{"position":[[3820,53],[9992,53],[16819,53],[23650,53],[29888,53]]},"651":{"position":[[3795,53],[10050,53],[16390,53],[22713,53]]},"669":{"position":[[7399,53]]},"671":{"position":[[3846,53]]},"691":{"position":[[3212,53],[9362,53],[15357,53],[21047,53],[26671,53]]},"701":{"position":[[3511,53],[9127,53]]},"703":{"position":[[2804,53],[8525,53]]},"705":{"position":[[2822,53],[9165,53],[15429,53],[21451,53],[27110,53]]},"726":{"position":[[4701,53],[14922,53],[22919,53],[30701,53],[36462,53],[42085,53],[47729,53]]},"728":{"position":[[2745,53],[10656,53],[16591,53],[27031,53],[35261,53],[44821,53]]},"745":{"position":[[4357,53],[9962,53],[15731,53],[21293,53],[26921,53],[34653,53],[40279,53]]},"747":{"position":[[5403,53],[12125,53]]},"749":{"position":[[2879,53],[9184,53],[14884,53]]},"751":{"position":[[5755,53],[12341,53],[19890,53]]},"761":{"position":[[6349,53]]},"767":{"position":[[2872,53],[8568,53],[14492,53],[20197,53]]},"769":{"position":[[6979,53],[13853,53],[21847,53],[28274,53]]},"771":{"position":[[4154,53],[11326,53],[18254,53]]},"773":{"position":[[10061,53]]},"795":{"position":[[3041,53],[8697,53],[14785,53],[21528,53],[27223,53]]},"797":{"position":[[6036,53],[12862,53]]},"799":{"position":[[5599,53],[12632,53],[20034,53]]},"801":{"position":[[5977,53],[12736,53]]},"821":{"position":[[4716,53],[10508,53],[16427,53],[22176,53],[27933,53],[34883,53],[41880,53]]},"823":{"position":[[2582,53],[9862,53]]},"825":{"position":[[9993,53],[17299,53],[23889,53],[30553,53],[36864,53],[42717,53],[48509,53],[54210,53]]},"844":{"position":[[4364,53],[9993,53],[15776,53],[21331,53],[26953,53],[34171,53],[39791,53]]},"846":{"position":[[5458,53],[12801,53]]},"848":{"position":[[4931,53],[11720,53]]},"850":{"position":[[6209,53],[13392,53],[19154,53],[24855,53],[30643,53],[36340,53]]}}}],["environment.getenvironmentvariable(\"fga_api_token",{"_index":1441,"t":{"217":{"position":[[3049,51]]}}}],["environment.getenvironmentvariable(\"fga_api_token_issu",{"_index":1464,"t":{"219":{"position":[[3227,59]]}}}],["environment.getenvironmentvariable(\"fga_client_id",{"_index":1466,"t":{"219":{"position":[[3368,52]]}}}],["environment.getenvironmentvariable(\"fga_client_secret",{"_index":1467,"t":{"219":{"position":[[3436,56]]}}}],["environment.getenvironmentvariable(\"fga_model_id",{"_index":518,"t":{"37":{"position":[[4481,51]]},"43":{"position":[[2023,51]]},"97":{"position":[[2170,51]]},"123":{"position":[[2170,51]]},"169":{"position":[[15169,51],[21363,51],[27792,51]]},"215":{"position":[[2109,51]]},"217":{"position":[[2837,51]]},"219":{"position":[[3000,51]]},"236":{"position":[[3065,51]]},"238":{"position":[[3004,51],[8752,51]]},"248":{"position":[[2170,51]]},"265":{"position":[[3284,51]]},"267":{"position":[[3076,51],[8701,51]]},"273":{"position":[[4301,51],[10092,51],[15971,51],[21577,51]]},"282":{"position":[[3325,51]]},"284":{"position":[[3049,51]]},"294":{"position":[[2142,51]]},"329":{"position":[[3154,51],[8737,51],[14964,51]]},"353":{"position":[[3145,51],[8753,51]]},"359":{"position":[[3451,51],[9440,51],[15254,51]]},"375":{"position":[[3193,51]]},"382":{"position":[[4118,51]]},"406":{"position":[[3585,51],[9885,51]]},"408":{"position":[[3707,51]]},"410":{"position":[[2979,51]]},"446":{"position":[[3151,51]]},"448":{"position":[[3093,51],[8932,51]]},"482":{"position":[[3151,51],[8783,51]]},"486":{"position":[[3113,51],[8912,51]]},"504":{"position":[[3098,51]]},"506":{"position":[[3260,51]]},"508":{"position":[[3166,51]]},"522":{"position":[[3388,51]]},"524":{"position":[[3290,51]]},"540":{"position":[[3111,51]]},"542":{"position":[[3598,51]]},"544":{"position":[[3230,51]]},"556":{"position":[[3351,51]]},"560":{"position":[[3350,51]]},"562":{"position":[[3206,51]]},"564":{"position":[[2961,51],[8475,51]]},"566":{"position":[[3073,51],[8537,51]]},"581":{"position":[[3140,51]]},"588":{"position":[[3532,51],[9630,51],[15631,51]]},"590":{"position":[[3499,51]]},"595":{"position":[[3236,51],[9148,51]]},"600":{"position":[[3351,51]]},"619":{"position":[[3572,51]]},"621":{"position":[[3106,51]]},"627":{"position":[[3554,51]]},"629":{"position":[[3019,51]]},"631":{"position":[[3207,51],[9060,51],[14699,51]]},"649":{"position":[[4273,51],[10445,51],[17272,51],[24103,51],[30341,51]]},"651":{"position":[[4248,51],[10503,51],[16843,51],[23166,51]]},"669":{"position":[[7852,51]]},"671":{"position":[[4299,51]]},"691":{"position":[[3665,51],[9815,51],[15810,51],[21500,51],[27124,51]]},"701":{"position":[[3964,51],[9580,51]]},"703":{"position":[[3257,51],[8978,51]]},"705":{"position":[[3275,51],[9618,51],[15882,51],[21904,51],[27563,51]]},"726":{"position":[[5154,51],[15375,51],[23372,51],[31154,51],[36915,51],[42538,51],[48182,51]]},"728":{"position":[[3198,51],[11109,51],[17044,51],[27484,51],[35714,51],[45274,51]]},"745":{"position":[[4810,51],[10415,51],[16184,51],[21746,51],[27374,51],[35106,51],[40732,51]]},"747":{"position":[[5856,51],[12578,51]]},"749":{"position":[[3332,51],[9637,51],[15337,51]]},"751":{"position":[[6208,51],[12794,51],[20343,51]]},"761":{"position":[[6802,51]]},"767":{"position":[[3325,51],[9021,51],[14945,51],[20650,51]]},"769":{"position":[[7432,51],[14306,51],[22300,51],[28727,51]]},"771":{"position":[[4607,51],[11779,51],[18707,51]]},"773":{"position":[[10514,51]]},"795":{"position":[[3494,51],[9150,51],[15238,51],[21981,51],[27676,51]]},"797":{"position":[[6489,51],[13315,51]]},"799":{"position":[[6052,51],[13085,51],[20487,51]]},"801":{"position":[[6430,51],[13189,51]]},"821":{"position":[[5169,51],[10961,51],[16880,51],[22629,51],[28386,51],[35336,51],[42333,51]]},"823":{"position":[[3035,51],[10315,51]]},"825":{"position":[[10446,51],[17752,51],[24342,51],[31006,51],[37317,51],[43170,51],[48962,51],[54663,51]]},"844":{"position":[[4817,51],[10446,51],[16229,51],[21784,51],[27406,51],[34624,51],[40244,51]]},"846":{"position":[[5911,51],[13254,51]]},"848":{"position":[[5384,51],[12173,51]]},"850":{"position":[[6662,51],[13845,51],[19607,51],[25308,51],[31096,51],[36793,51]]}}}],["environment.getenvironmentvariable(\"fga_store_id",{"_index":517,"t":{"37":{"position":[[4300,51]]},"43":{"position":[[1838,51]]},"97":{"position":[[1989,51]]},"123":{"position":[[1989,51]]},"169":{"position":[[14988,51],[21182,51],[27611,51]]},"215":{"position":[[1924,51]]},"217":{"position":[[2652,51]]},"219":{"position":[[2815,51]]},"236":{"position":[[2884,51]]},"238":{"position":[[2823,51],[8571,51]]},"248":{"position":[[1989,51]]},"265":{"position":[[3103,51]]},"267":{"position":[[2895,51],[8520,51]]},"273":{"position":[[4120,51],[9911,51],[15790,51],[21396,51]]},"282":{"position":[[3144,51]]},"284":{"position":[[2868,51]]},"294":{"position":[[1961,51]]},"329":{"position":[[2973,51],[8556,51],[14783,51]]},"353":{"position":[[2964,51],[8572,51]]},"359":{"position":[[3270,51],[9259,51],[15073,51]]},"375":{"position":[[3012,51]]},"382":{"position":[[3937,51]]},"406":{"position":[[3404,51],[9704,51]]},"408":{"position":[[3526,51]]},"410":{"position":[[2798,51]]},"446":{"position":[[2970,51]]},"448":{"position":[[2912,51],[8751,51]]},"482":{"position":[[2970,51],[8602,51]]},"486":{"position":[[2932,51],[8731,51]]},"504":{"position":[[2917,51]]},"506":{"position":[[3079,51]]},"508":{"position":[[2985,51]]},"522":{"position":[[3207,51]]},"524":{"position":[[3109,51]]},"540":{"position":[[2930,51]]},"542":{"position":[[3417,51]]},"544":{"position":[[3049,51]]},"556":{"position":[[3170,51]]},"560":{"position":[[3169,51]]},"562":{"position":[[3025,51]]},"564":{"position":[[2780,51],[8294,51]]},"566":{"position":[[2892,51],[8356,51]]},"581":{"position":[[2959,51]]},"588":{"position":[[3351,51],[9449,51],[15450,51]]},"590":{"position":[[3318,51]]},"595":{"position":[[3055,51],[8967,51]]},"600":{"position":[[3170,51]]},"619":{"position":[[3391,51]]},"621":{"position":[[2925,51]]},"627":{"position":[[3373,51]]},"629":{"position":[[2838,51]]},"631":{"position":[[3026,51],[8879,51],[14518,51]]},"649":{"position":[[4092,51],[10264,51],[17091,51],[23922,51],[30160,51]]},"651":{"position":[[4067,51],[10322,51],[16662,51],[22985,51]]},"669":{"position":[[7671,51]]},"671":{"position":[[4118,51]]},"691":{"position":[[3484,51],[9634,51],[15629,51],[21319,51],[26943,51]]},"701":{"position":[[3783,51],[9399,51]]},"703":{"position":[[3076,51],[8797,51]]},"705":{"position":[[3094,51],[9437,51],[15701,51],[21723,51],[27382,51]]},"726":{"position":[[4973,51],[15194,51],[23191,51],[30973,51],[36734,51],[42357,51],[48001,51]]},"728":{"position":[[3017,51],[10928,51],[16863,51],[27303,51],[35533,51],[45093,51]]},"745":{"position":[[4629,51],[10234,51],[16003,51],[21565,51],[27193,51],[34925,51],[40551,51]]},"747":{"position":[[5675,51],[12397,51]]},"749":{"position":[[3151,51],[9456,51],[15156,51]]},"751":{"position":[[6027,51],[12613,51],[20162,51]]},"761":{"position":[[6621,51]]},"767":{"position":[[3144,51],[8840,51],[14764,51],[20469,51]]},"769":{"position":[[7251,51],[14125,51],[22119,51],[28546,51]]},"771":{"position":[[4426,51],[11598,51],[18526,51]]},"773":{"position":[[10333,51]]},"795":{"position":[[3313,51],[8969,51],[15057,51],[21800,51],[27495,51]]},"797":{"position":[[6308,51],[13134,51]]},"799":{"position":[[5871,51],[12904,51],[20306,51]]},"801":{"position":[[6249,51],[13008,51]]},"821":{"position":[[4988,51],[10780,51],[16699,51],[22448,51],[28205,51],[35155,51],[42152,51]]},"823":{"position":[[2854,51],[10134,51]]},"825":{"position":[[10265,51],[17571,51],[24161,51],[30825,51],[37136,51],[42989,51],[48781,51],[54482,51]]},"844":{"position":[[4636,51],[10265,51],[16048,51],[21603,51],[27225,51],[34443,51],[40063,51]]},"846":{"position":[[5730,51],[13073,51]]},"848":{"position":[[5203,51],[11992,51]]},"850":{"position":[[6481,51],[13664,51],[19426,51],[25127,51],[30915,51],[36612,51]]}}}],["equal",{"_index":1051,"t":{"131":{"position":[[736,5],[968,7]]}}}],["equival",{"_index":1348,"t":{"169":{"position":[[3110,10]]}}}],["erik",{"_index":2497,"t":{"742":{"position":[[141,5]]},"751":{"position":[[184,4],[327,4],[2923,4]]},"841":{"position":[[167,5]]},"850":{"position":[[28084,4]]}}}],["err",{"_index":485,"t":{"37":{"position":[[2174,3],[2693,3],[3234,3],[3310,3],[3338,4],[3387,3],[3488,3]]},"43":{"position":[[580,3],[1117,3],[1157,3],[1270,3]]},"77":{"position":[[432,3],[707,3]]},"97":{"position":[[808,3],[1327,3]]},"99":{"position":[[515,3]]},"109":{"position":[[861,5]]},"111":{"position":[[691,5],[1460,5],[2073,3],[2095,3],[2131,3],[2178,4]]},"113":{"position":[[629,5],[1539,5],[2448,5],[3314,3],[3336,3],[3372,3],[3419,4],[4553,3],[5090,3],[5344,3],[5421,3]]},"123":{"position":[[808,3],[1327,3]]},"125":{"position":[[549,3]]},"169":{"position":[[13393,3],[13912,3],[14160,3],[19587,3],[20106,3],[20354,3],[25962,3],[26481,3],[26727,3]]},"215":{"position":[[819,3],[1356,3]]},"217":{"position":[[1308,3],[2084,3]]},"219":{"position":[[1333,3],[2247,3]]},"236":{"position":[[1179,3],[1698,3],[2040,3],[2133,3]]},"238":{"position":[[1231,3],[1750,3],[1995,3],[6977,3],[7496,3],[7742,3]]},"248":{"position":[[808,3],[1327,3]]},"250":{"position":[[560,3],[653,3]]},"252":{"position":[[717,3],[810,3]]},"265":{"position":[[1521,3],[2040,3],[2275,3]]},"267":{"position":[[1195,3],[1714,3],[2051,3],[2144,3],[6937,3],[7456,3],[7691,3]]},"273":{"position":[[2532,3],[3051,3],[3291,3],[8169,3],[8688,3],[9067,3],[9160,3],[14198,3],[14717,3],[14962,3],[19802,3],[20321,3],[20567,3]]},"282":{"position":[[1440,3],[1959,3],[2300,3],[2393,3]]},"284":{"position":[[1275,3],[1794,3],[2039,3]]},"294":{"position":[[780,3],[1299,3]]},"296":{"position":[[343,3],[435,3],[1981,3],[2073,3]]},"298":{"position":[[1350,3],[1442,3],[2853,3],[2945,3]]},"329":{"position":[[1277,3],[1796,3],[2129,3],[2222,3],[6859,3],[7378,3],[7712,3],[7805,3],[12842,3],[13361,3],[13939,3],[14032,3]]},"353":{"position":[[1371,3],[1890,3],[2136,3],[6980,3],[7499,3],[7744,3]]},"359":{"position":[[1506,3],[2025,3],[2426,3],[2519,3],[7666,3],[8185,3],[8430,3],[13480,3],[13999,3],[14245,3]]},"375":{"position":[[1412,3],[1931,3],[2184,3]]},"382":{"position":[[2347,3],[2866,3],[3109,3]]},"406":{"position":[[1475,3],[1994,3],[2560,3],[2653,3],[8109,3],[8628,3],[8876,3]]},"408":{"position":[[1487,3],[2006,3],[2682,3],[2775,3]]},"410":{"position":[[1203,3],[1722,3],[1970,3]]},"446":{"position":[[1253,3],[1772,3],[2126,3],[2219,3]]},"448":{"position":[[1312,3],[1831,3],[2084,3],[7150,3],[7669,3],[7922,3]]},"466":{"position":[[1718,3],[1811,3]]},"482":{"position":[[1374,3],[1893,3],[2142,3],[7007,3],[7526,3],[7774,3]]},"486":{"position":[[1335,3],[1854,3],[2104,3],[7134,3],[7653,3],[7902,3]]},"504":{"position":[[1214,3],[1733,3],[2073,3],[2166,3]]},"506":{"position":[[1296,3],[1815,3],[2235,3],[2328,3]]},"508":{"position":[[1385,3],[1904,3],[2157,3]]},"522":{"position":[[1452,3],[1971,3],[2363,3],[2456,3]]},"524":{"position":[[1513,3],[2032,3],[2281,3]]},"540":{"position":[[1225,3],[1744,3],[2086,3],[2179,3]]},"542":{"position":[[1635,3],[2154,3],[2573,3],[2666,3]]},"544":{"position":[[1447,3],[1966,3],[2221,3]]},"556":{"position":[[1355,3],[1874,3],[2326,3],[2419,3]]},"560":{"position":[[1358,3],[1877,3],[2325,3],[2418,3]]},"562":{"position":[[1321,3],[1840,3],[2181,3],[2274,3]]},"564":{"position":[[1199,3],[1718,3],[1952,3],[6713,3],[7232,3],[7466,3]]},"566":{"position":[[1196,3],[1715,3],[2048,3],[2141,3],[6774,3],[7293,3],[7527,3]]},"581":{"position":[[1368,3],[1887,3],[2131,3]]},"588":{"position":[[1663,3],[2182,3],[2400,3],[7800,3],[8319,3],[8498,3],[13791,3],[14310,3],[14499,3]]},"590":{"position":[[1748,3],[2267,3],[2485,3]]},"595":{"position":[[1398,3],[1917,3],[2224,3],[7310,3],[7829,3],[8136,3]]},"600":{"position":[[1412,3],[1931,3],[2286,3]]},"619":{"position":[[1570,3],[2089,3],[2547,3],[2640,3]]},"621":{"position":[[1322,3],[1841,3],[2097,3]]},"627":{"position":[[1394,3],[1913,3],[2529,3],[2622,3]]},"629":{"position":[[1243,3],[1762,3],[2010,3]]},"631":{"position":[[1250,3],[1769,3],[2182,3],[2275,3],[7283,3],[7802,3],[8050,3],[12919,3],[13438,3],[13690,3]]},"649":{"position":[[2500,3],[3019,3],[3264,3],[8672,3],[9191,3],[9436,3],[15496,3],[16015,3],[16263,3],[22330,3],[22849,3],[23094,3],[28567,3],[29086,3],[29332,3]]},"651":{"position":[[2474,3],[2993,3],[3238,3],[8726,3],[9245,3],[9493,3],[15068,3],[15587,3],[15833,3],[21391,3],[21910,3],[22157,3]]},"661":{"position":[[5638,3],[5731,3]]},"667":{"position":[[678,3],[2513,3],[4368,3],[6209,3],[8062,3],[9909,3]]},"669":{"position":[[3257,3],[5898,3],[6417,3],[6827,3],[6920,3],[11146,3]]},"671":{"position":[[2317,3],[2836,3],[3274,3],[3367,3],[7916,3],[10588,3]]},"673":{"position":[[5177,3],[5270,3]]},"691":{"position":[[1585,3],[2104,3],[2640,3],[2733,3],[8041,3],[8560,3],[8806,3],[14036,3],[14555,3],[14800,3],[19724,3],[20243,3],[20491,3],[25349,3],[25868,3],[26115,3]]},"701":{"position":[[2189,3],[2708,3],[2955,3],[7806,3],[8325,3],[8571,3]]},"703":{"position":[[1320,3],[1839,3],[2232,3],[2325,3],[7200,3],[7719,3],[7969,3]]},"705":{"position":[[1398,3],[1917,3],[2019,3],[7597,3],[8116,3],[8593,3],[8686,3],[13860,3],[14379,3],[14857,3],[14950,3],[20129,3],[20648,3],[20895,3],[25790,3],[26309,3],[26553,3]]},"726":{"position":[[2128,3],[2647,3],[4129,3],[4222,3],[12986,3],[13505,3],[14350,3],[14443,3],[21053,3],[21572,3],[22347,3],[22440,3],[29380,3],[29899,3],[30145,3],[35140,3],[35659,3],[35905,3],[40760,3],[41279,3],[41529,3],[46403,3],[46922,3],[47173,3]]},"728":{"position":[[1423,3],[1942,3],[2184,3],[9338,3],[9857,3],[10099,3],[15264,3],[15783,3],[16034,3],[25705,3],[26224,3],[26475,3],[33944,3],[34463,3],[34705,3],[43504,3],[44023,3],[44265,3]]},"745":{"position":[[2917,3],[3436,3],[3785,3],[3878,3],[8639,3],[9158,3],[9406,3],[14291,3],[14810,3],[15159,3],[15252,3],[19970,3],[20489,3],[20737,3],[25597,3],[26116,3],[26364,3],[33330,3],[33849,3],[34097,3],[38956,3],[39475,3],[39723,3]]},"747":{"position":[[3675,3],[4194,3],[4831,3],[4924,3],[10800,3],[11319,3],[11569,3]]},"749":{"position":[[1415,3],[1934,3],[2307,3],[2400,3],[7688,3],[8207,3],[8612,3],[8705,3],[13561,3],[14080,3],[14328,3]]},"751":{"position":[[4172,3],[4691,3],[5183,3],[5276,3],[11014,3],[11533,3],[11780,3],[18428,3],[18947,3],[19318,3],[19411,3]]},"761":{"position":[[4213,3],[4732,3],[5777,3],[5870,3]]},"767":{"position":[[1554,3],[2073,3],[2316,3],[7246,3],[7765,3],[8012,3],[12993,3],[13512,3],[13920,3],[14013,3],[18878,3],[19397,3],[19640,3]]},"769":{"position":[[5665,3],[6184,3],[6422,3],[11868,3],[12387,3],[13281,3],[13374,3],[20166,3],[20685,3],[21275,3],[21368,3],[26956,3],[27475,3],[27718,3]]},"771":{"position":[[2418,3],[2937,3],[3582,3],[3675,3],[9820,3],[10339,3],[10770,3],[16747,3],[17266,3],[17697,3]]},"773":{"position":[[6197,3],[6716,3],[9489,3],[9582,3]]},"795":{"position":[[1602,3],[2121,3],[2469,3],[2562,3],[7254,3],[7773,3],[8125,3],[8218,3],[13081,3],[13600,3],[14213,3],[14306,3],[20206,3],[20725,3],[20972,3],[25903,3],[26422,3],[26666,3]]},"797":{"position":[[4220,3],[4739,3],[5464,3],[5557,3],[11537,3],[12056,3],[12306,3]]},"799":{"position":[[4013,3],[4532,3],[5027,3],[5120,3],[10733,3],[11252,3],[12060,3],[12153,3],[18715,3],[19234,3],[19478,3]]},"801":{"position":[[4270,3],[4789,3],[5405,3],[5498,3],[11412,3],[11931,3],[12179,3]]},"821":{"position":[[3218,3],[3737,3],[4144,3],[4237,3],[9180,3],[9699,3],[9952,3],[14929,3],[15448,3],[15855,3],[15948,3],[20848,3],[21367,3],[21620,3],[26598,3],[27117,3],[27376,3],[33017,3],[33536,3],[34311,3],[34404,3],[40552,3],[41071,3],[41324,3]]},"823":{"position":[[1259,3],[1778,3],[2025,3],[8540,3],[9059,3],[9306,3]]},"825":{"position":[[8212,3],[8731,3],[9421,3],[9514,3],[15732,3],[16251,3],[16727,3],[16820,3],[22219,3],[22738,3],[23317,3],[23410,3],[28968,3],[29487,3],[29981,3],[30074,3],[35395,3],[35914,3],[36292,3],[36385,3],[41265,3],[41784,3],[42145,3],[42238,3],[47189,3],[47708,3],[47952,3],[52875,3],[53394,3],[53654,3]]},"844":{"position":[[2921,3],[3440,3],[3792,3],[3885,3],[8667,3],[9186,3],[9437,3],[14337,3],[14856,3],[15204,3],[15297,3],[20009,3],[20528,3],[20775,3],[25629,3],[26148,3],[26396,3],[32849,3],[33368,3],[33615,3],[38468,3],[38987,3],[39235,3]]},"846":{"position":[[3521,3],[4040,3],[4886,3],[4979,3],[11475,3],[11994,3],[12245,3]]},"848":{"position":[[3233,3],[3752,3],[4359,3],[4452,3],[10391,3],[10910,3],[11159,3]]},"850":{"position":[[4279,3],[4798,3],[5637,3],[5730,3],[12062,3],[12581,3],[12836,3],[17822,3],[18341,3],[18597,3],[23521,3],[24040,3],[24299,3],[29311,3],[29830,3],[30086,3],[35008,3],[35527,3],[35783,3]]}}}],["error",{"_index":124,"t":{"3":{"position":[[2277,5],[2620,6]]},"37":{"position":[[2719,5],[3356,5],[3514,5]]},"43":{"position":[[1143,5],[1296,5]]},"53":{"position":[[3250,5],[3364,5]]},"77":{"position":[[733,5]]},"97":{"position":[[1353,5]]},"109":{"position":[[1547,5]]},"111":{"position":[[2077,5],[2379,5]]},"113":{"position":[[3318,5],[3689,5],[3899,5],[4534,5]]},"123":{"position":[[1353,5]]},"133":{"position":[[1321,5],[1527,5]]},"169":{"position":[[13938,5],[20132,5],[26507,5]]},"215":{"position":[[1382,5]]},"217":{"position":[[2110,5]]},"219":{"position":[[2273,5]]},"236":{"position":[[1724,5],[2159,5]]},"238":{"position":[[1776,5],[7522,5]]},"248":{"position":[[1353,5]]},"250":{"position":[[679,5]]},"252":{"position":[[836,5]]},"265":{"position":[[2066,5]]},"267":{"position":[[1740,5],[2170,5],[7482,5]]},"273":{"position":[[3077,5],[8714,5],[9186,5],[14743,5],[20347,5]]},"282":{"position":[[1985,5],[2419,5]]},"284":{"position":[[1820,5]]},"294":{"position":[[1325,5]]},"296":{"position":[[461,5],[1401,6],[2099,5]]},"298":{"position":[[1468,5],[2310,7],[2971,5]]},"329":{"position":[[1822,5],[2248,5],[7404,5],[7831,5],[13387,5],[14058,5]]},"353":{"position":[[1916,5],[7525,5]]},"359":{"position":[[2051,5],[2545,5],[8211,5],[14025,5]]},"375":{"position":[[1957,5]]},"382":{"position":[[2892,5]]},"406":{"position":[[2020,5],[2679,5],[8654,5]]},"408":{"position":[[2032,5],[2801,5]]},"410":{"position":[[1748,5]]},"446":{"position":[[1798,5],[2245,5]]},"448":{"position":[[1857,5],[7695,5]]},"456":{"position":[[3307,6]]},"466":{"position":[[575,5],[665,5],[1167,6],[1837,5]]},"482":{"position":[[1919,5],[7552,5]]},"486":{"position":[[1880,5],[7679,5]]},"504":{"position":[[1759,5],[2192,5]]},"506":{"position":[[1841,5],[2354,5]]},"508":{"position":[[1930,5],[6660,5]]},"522":{"position":[[1997,5],[2482,5]]},"524":{"position":[[2058,5]]},"540":{"position":[[1770,5],[2205,5]]},"542":{"position":[[2180,5],[2692,5]]},"544":{"position":[[1992,5]]},"556":{"position":[[1900,5],[2445,5]]},"560":{"position":[[1903,5],[2444,5]]},"562":{"position":[[1866,5],[2300,5]]},"564":{"position":[[1744,5],[7258,5]]},"566":{"position":[[1741,5],[2167,5],[7319,5]]},"581":{"position":[[1913,5]]},"588":{"position":[[2208,5],[8345,5],[14336,5]]},"590":{"position":[[2293,5]]},"595":{"position":[[1943,5],[7855,5]]},"600":{"position":[[1957,5]]},"619":{"position":[[2115,5],[2666,5]]},"621":{"position":[[1867,5]]},"627":{"position":[[1939,5],[2648,5]]},"629":{"position":[[1788,5]]},"631":{"position":[[1795,5],[2301,5],[7828,5],[13464,5]]},"649":{"position":[[3045,5],[9217,5],[16041,5],[22875,5],[29112,5]]},"651":{"position":[[3019,5],[9271,5],[15613,5],[21936,5]]},"661":{"position":[[5757,5]]},"669":{"position":[[6443,5],[6946,5]]},"671":{"position":[[2862,5],[3393,5]]},"673":{"position":[[5296,5]]},"691":{"position":[[2130,5],[2759,5],[8586,5],[14581,5],[20269,5],[25894,5]]},"701":{"position":[[2734,5],[8351,5]]},"703":{"position":[[1865,5],[2351,5],[7745,5]]},"705":{"position":[[1943,5],[8142,5],[8712,5],[14405,5],[14976,5],[20674,5],[26335,5]]},"726":{"position":[[2673,5],[4248,5],[13531,5],[14469,5],[21598,5],[22466,5],[29925,5],[35685,5],[41305,5],[46948,5]]},"728":{"position":[[1968,5],[9883,5],[15809,5],[26250,5],[34489,5],[44049,5]]},"745":{"position":[[3462,5],[3904,5],[9184,5],[14836,5],[15278,5],[20515,5],[26142,5],[33875,5],[39501,5]]},"747":{"position":[[4220,5],[4950,5],[11345,5]]},"749":{"position":[[1960,5],[2426,5],[8233,5],[8731,5],[14106,5]]},"751":{"position":[[4717,5],[5302,5],[11559,5],[18973,5],[19437,5]]},"761":{"position":[[4758,5],[5896,5]]},"767":{"position":[[2099,5],[7791,5],[13538,5],[14039,5],[19423,5]]},"769":{"position":[[6210,5],[12413,5],[13400,5],[20711,5],[21394,5],[27501,5]]},"771":{"position":[[2963,5],[3701,5],[10365,5],[17292,5]]},"773":{"position":[[6742,5],[9608,5]]},"795":{"position":[[2147,5],[2588,5],[7799,5],[8244,5],[13626,5],[14332,5],[20751,5],[26448,5]]},"797":{"position":[[4765,5],[5583,5],[12082,5]]},"799":{"position":[[4558,5],[5146,5],[11278,5],[12179,5],[19260,5]]},"801":{"position":[[4815,5],[5524,5],[11957,5]]},"821":{"position":[[3763,5],[4263,5],[9725,5],[15474,5],[15974,5],[21393,5],[27143,5],[33562,5],[34430,5],[41097,5]]},"823":{"position":[[1804,5],[9085,5]]},"825":{"position":[[8757,5],[9540,5],[16277,5],[16846,5],[22764,5],[23436,5],[29513,5],[30100,5],[35940,5],[36411,5],[41810,5],[42264,5],[47734,5],[53420,5]]},"844":{"position":[[3466,5],[3911,5],[9212,5],[14882,5],[15323,5],[20554,5],[26174,5],[33394,5],[39013,5]]},"846":{"position":[[4066,5],[5005,5],[12020,5]]},"848":{"position":[[3778,5],[4478,5],[10936,5]]},"850":{"position":[[4824,5],[5756,5],[12607,5],[18367,5],[24066,5],[29856,5],[35553,5]]}}}],["especi",{"_index":756,"t":{"69":{"position":[[141,10]]},"635":{"position":[[207,10]]}}}],["essenti",{"_index":1888,"t":{"428":{"position":[[1127,12]]}}}],["est",{"_index":396,"t":{"27":{"position":[[879,5]]}}}],["establish",{"_index":23,"t":{"3":{"position":[[311,9]]},"131":{"position":[[464,9],[507,12]]},"422":{"position":[[3897,11],[3934,9]]},"579":{"position":[[161,9]]},"581":{"position":[[35,9]]}}}],["etc",{"_index":340,"t":{"25":{"position":[[204,7]]},"53":{"position":[[3419,7]]},"300":{"position":[[451,5]]},"426":{"position":[[630,4]]},"464":{"position":[[528,5]]},"677":{"position":[[247,7],[380,7]]},"689":{"position":[[574,7]]},"753":{"position":[[119,4]]}}}],["etc/openfga",{"_index":1144,"t":{"143":{"position":[[106,12]]}}}],["europ",{"_index":2330,"t":{"691":{"position":[[295,7],[347,7],[6895,7],[12608,6],[12859,7],[18576,7],[29944,6]]}}}],["evalu",{"_index":4,"t":{"3":{"position":[[51,9],[1203,10],[2296,8],[2638,8]]},"53":{"position":[[3400,10]]},"71":{"position":[[275,10]]},"133":{"position":[[2635,11]]},"452":{"position":[[677,10]]},"464":{"position":[[479,10]]},"466":{"position":[[128,11],[295,9],[608,10]]},"468":{"position":[[118,10],[415,10],[1195,10]]},"508":{"position":[[6522,10]]},"669":{"position":[[476,9]]},"671":{"position":[[159,8]]},"771":{"position":[[159,8]]}}}],["even",{"_index":1667,"t":{"345":{"position":[[148,4]]},"353":{"position":[[11551,4]]},"386":{"position":[[177,4]]},"524":{"position":[[139,4]]},"621":{"position":[[5968,4]]},"631":{"position":[[6079,4]]},"649":{"position":[[13383,4],[26806,4]]},"651":{"position":[[6962,4],[13235,4]]},"667":{"position":[[11353,4]]},"728":{"position":[[39985,4]]},"848":{"position":[[132,4]]}}}],["event",{"_index":397,"t":{"27":{"position":[[936,7]]}}}],["eventu",{"_index":1918,"t":{"454":{"position":[[295,10]]}}}],["everyon",{"_index":665,"t":{"49":{"position":[[2094,8]]},"169":{"position":[[5050,9],[6447,8],[6480,8],[10653,8],[31895,8]]},"316":{"position":[[736,8],[781,8]]},"329":{"position":[[151,8],[12452,8],[13801,8],[15488,8],[16822,8],[17796,8]]},"512":{"position":[[351,8]]},"520":{"position":[[143,8]]},"649":{"position":[[7238,8],[13200,8]]},"651":{"position":[[1013,8],[7248,8],[7324,8],[13293,8]]},"728":{"position":[[21607,8]]},"831":{"position":[[931,8]]},"846":{"position":[[45,8]]},"850":{"position":[[408,10],[3817,8],[5427,8],[7315,8],[8875,8],[10679,8]]}}}],["everyth",{"_index":1882,"t":{"428":{"position":[[108,10]]},"719":{"position":[[378,10],[439,10]]},"726":{"position":[[33973,10]]},"789":{"position":[[374,10],[486,10]]}}}],["exact",{"_index":1568,"t":{"288":{"position":[[140,5]]},"296":{"position":[[3691,5]]},"643":{"position":[[281,5]]}}}],["examin",{"_index":2499,"t":{"745":{"position":[[1204,7],[31519,7]]},"821":{"position":[[1410,7]]},"844":{"position":[[1174,7],[31355,7]]}}}],["exampl",{"_index":81,"t":{"3":{"position":[[1261,8]]},"5":{"position":[[49,8]]},"9":{"position":[[426,8]]},"17":{"position":[[183,8]]},"19":{"position":[[344,7]]},"23":{"position":[[124,8]]},"37":{"position":[[3825,8],[3840,7]]},"49":{"position":[[1016,8],[2508,9]]},"51":{"position":[[2106,9]]},"53":{"position":[[3436,9]]},"55":{"position":[[1495,9]]},"57":{"position":[[1876,9]]},"61":{"position":[[394,8]]},"73":{"position":[[938,8]]},"97":{"position":[[1514,8],[1529,7]]},"109":{"position":[[79,8],[948,8]]},"115":{"position":[[42,8]]},"123":{"position":[[1514,8],[1529,7]]},"131":{"position":[[782,8],[1001,8]]},"151":{"position":[[282,8],[539,8]]},"157":{"position":[[210,7],[354,7]]},"159":{"position":[[370,8]]},"169":{"position":[[561,8],[809,7],[1607,7],[4241,8],[4662,8],[5443,8],[5702,8],[8419,7],[11286,8],[14513,8],[14528,7],[18340,8],[20707,8],[20722,7],[24675,8],[27136,8],[27151,7],[31660,8],[31772,8]]},"201":{"position":[[178,8]]},"207":{"position":[[326,9]]},"225":{"position":[[286,8]]},"236":{"position":[[2409,8],[2424,7]]},"238":{"position":[[2348,8],[2363,7],[8096,8],[8111,7]]},"248":{"position":[[1514,8],[1529,7]]},"265":{"position":[[2628,8],[2643,7]]},"267":{"position":[[2420,8],[2435,7],[8045,8],[8060,7]]},"273":{"position":[[3645,8],[3660,7],[9436,8],[9451,7],[15315,8],[15330,7],[20921,8],[20936,7]]},"282":{"position":[[2669,8],[2684,7]]},"284":{"position":[[2393,8],[2408,7]]},"294":{"position":[[1486,8],[1501,7]]},"314":{"position":[[38,8]]},"329":{"position":[[97,8],[2498,8],[2513,7],[8081,8],[8096,7],[14308,8],[14323,7]]},"331":{"position":[[113,8],[702,8]]},"345":{"position":[[97,8]]},"353":{"position":[[2489,8],[2504,7],[8097,8],[8112,7]]},"359":{"position":[[2795,8],[2810,7],[8784,8],[8799,7],[14598,8],[14613,7]]},"363":{"position":[[83,8],[333,8]]},"375":{"position":[[2537,8],[2552,7],[6145,8]]},"380":{"position":[[522,8]]},"382":{"position":[[3462,8],[3477,7]]},"384":{"position":[[902,8]]},"390":{"position":[[87,8]]},"406":{"position":[[2929,8],[2944,7],[9229,8],[9244,7]]},"408":{"position":[[3051,8],[3066,7]]},"410":{"position":[[2323,8],[2338,7]]},"416":{"position":[[714,8],[795,8],[1029,8]]},"418":{"position":[[335,8]]},"420":{"position":[[141,7]]},"422":{"position":[[4470,7]]},"426":{"position":[[560,8],[1990,8],[3754,7],[4440,7],[7449,7]]},"428":{"position":[[1297,8],[1513,7]]},"430":{"position":[[170,7]]},"446":{"position":[[2495,8],[2510,7]]},"448":{"position":[[2437,8],[2452,7],[8276,8],[8291,7],[11898,8]]},"456":{"position":[[1011,8],[3167,8]]},"458":{"position":[[95,8],[460,8]]},"460":{"position":[[861,8]]},"472":{"position":[[163,8]]},"482":{"position":[[2495,8],[2510,7],[8127,8],[8142,7]]},"486":{"position":[[2457,8],[2472,7],[8256,8],[8271,7]]},"490":{"position":[[167,8]]},"504":{"position":[[2442,8],[2457,7],[5881,8]]},"506":{"position":[[2604,8],[2619,7]]},"508":{"position":[[2510,8],[2525,7]]},"514":{"position":[[1803,8]]},"520":{"position":[[181,7]]},"522":{"position":[[2732,8],[2747,7]]},"524":{"position":[[2634,8],[2649,7]]},"528":{"position":[[304,8]]},"536":{"position":[[135,8]]},"540":{"position":[[2455,8],[2470,7]]},"542":{"position":[[154,8],[2942,8],[2957,7]]},"544":{"position":[[2574,8],[2589,7],[6383,8]]},"548":{"position":[[269,8]]},"556":{"position":[[2695,8],[2710,7]]},"558":{"position":[[1200,8]]},"560":{"position":[[2694,8],[2709,7]]},"562":{"position":[[2550,8],[2565,7]]},"564":{"position":[[2305,8],[2320,7],[7819,8],[7834,7]]},"566":{"position":[[2417,8],[2432,7],[7881,8],[7896,7]]},"568":{"position":[[344,7]]},"581":{"position":[[129,8],[2484,8],[2499,7]]},"588":{"position":[[381,8],[2876,8],[2891,7],[6482,8],[8974,8],[8989,7],[12469,8],[14975,8],[14990,7]]},"590":{"position":[[188,8],[2843,8],[2858,7]]},"595":{"position":[[116,8],[2580,8],[2595,7],[8492,8],[8507,7]]},"600":{"position":[[2695,8],[2710,7]]},"608":{"position":[[116,8],[439,8]]},"619":{"position":[[2916,8],[2931,7]]},"621":{"position":[[2450,8],[2465,7],[6496,8]]},"623":{"position":[[82,7]]},"627":{"position":[[2898,8],[2913,7]]},"629":{"position":[[2363,8],[2378,7]]},"631":{"position":[[2551,8],[2566,7],[8404,8],[8419,7],[14043,8],[14058,7]]},"649":{"position":[[3617,8],[3632,7],[9789,8],[9804,7],[16616,8],[16631,7],[20408,8],[23447,8],[23462,7],[26978,7],[29685,8],[29700,7]]},"651":{"position":[[3592,8],[3607,7],[9847,8],[9862,7],[16187,8],[16202,7],[22510,8],[22525,7]]},"653":{"position":[[475,7]]},"655":{"position":[[373,8]]},"665":{"position":[[151,8]]},"669":{"position":[[7196,8],[7211,7]]},"671":{"position":[[3643,8],[3658,7]]},"677":{"position":[[392,8],[775,8],[1381,8]]},"691":{"position":[[3009,8],[3024,7],[9159,8],[9174,7],[15154,8],[15169,7],[20844,8],[20859,7],[26468,8],[26483,7],[30438,8]]},"699":{"position":[[25,7]]},"701":{"position":[[170,7],[3308,8],[3323,7],[8924,8],[8939,7]]},"703":{"position":[[116,8],[2601,8],[2616,7],[8322,8],[8337,7]]},"705":{"position":[[2619,8],[2634,7],[8962,8],[8977,7],[15226,8],[15241,7],[21248,8],[21263,7],[26907,8],[26922,7]]},"717":{"position":[[349,8]]},"724":{"position":[[349,7]]},"726":{"position":[[4498,8],[4513,7],[14719,8],[14734,7],[22716,8],[22731,7],[27706,8],[30498,8],[30513,7],[36259,8],[36274,7],[41882,8],[41897,7],[47526,8],[47541,7]]},"728":{"position":[[2542,8],[2557,7],[10453,8],[10468,7],[16388,8],[16403,7],[26828,8],[26843,7],[35058,8],[35073,7],[44618,8],[44633,7]]},"745":{"position":[[4154,8],[4169,7],[9759,8],[9774,7],[15528,8],[15543,7],[21090,8],[21105,7],[26718,8],[26733,7],[34450,8],[34465,7],[40076,8],[40091,7]]},"747":{"position":[[5200,8],[5215,7],[11922,8],[11937,7]]},"749":{"position":[[2676,8],[2691,7],[8981,8],[8996,7],[14681,8],[14696,7]]},"751":{"position":[[5552,8],[5567,7],[12138,8],[12153,7],[19687,8],[19702,7]]},"755":{"position":[[405,8]]},"761":{"position":[[6146,8],[6161,7]]},"767":{"position":[[2669,8],[2684,7],[8365,8],[8380,7],[14289,8],[14304,7],[19994,8],[20009,7]]},"769":{"position":[[6776,8],[6791,7],[13650,8],[13665,7],[21644,8],[21659,7],[28071,8],[28086,7]]},"771":{"position":[[3951,8],[3966,7],[11123,8],[11138,7],[18051,8],[18066,7]]},"773":{"position":[[9858,8],[9873,7]]},"795":{"position":[[2838,8],[2853,7],[8494,8],[8509,7],[14582,8],[14597,7],[21325,8],[21340,7],[27020,8],[27035,7]]},"797":{"position":[[656,8],[5833,8],[5848,7],[12659,8],[12674,7]]},"799":{"position":[[5396,8],[5411,7],[12429,8],[12444,7],[19831,8],[19846,7]]},"801":{"position":[[5774,8],[5789,7],[12533,8],[12548,7]]},"821":{"position":[[4513,8],[4528,7],[10305,8],[10320,7],[16224,8],[16239,7],[21973,8],[21988,7],[27730,8],[27745,7],[34680,8],[34695,7],[41677,8],[41692,7]]},"823":{"position":[[2379,8],[2394,7],[9659,8],[9674,7]]},"825":{"position":[[9790,8],[9805,7],[17096,8],[17111,7],[23686,8],[23701,7],[30350,8],[30365,7],[36661,8],[36676,7],[42514,8],[42529,7],[48306,8],[48321,7],[54007,8],[54022,7]]},"844":{"position":[[4161,8],[4176,7],[9790,8],[9805,7],[15573,8],[15588,7],[21128,8],[21143,7],[26750,8],[26765,7],[33968,8],[33983,7],[39588,8],[39603,7]]},"846":{"position":[[5255,8],[5270,7],[12598,8],[12613,7]]},"848":{"position":[[4728,8],[4743,7],[11517,8],[11532,7]]},"850":{"position":[[6006,8],[6021,7],[13189,8],[13204,7],[18951,8],[18966,7],[24652,8],[24667,7],[30440,8],[30455,7],[36137,8],[36152,7]]}}}],["exampleapp",{"_index":573,"t":{"43":{"position":[[1439,11]]},"215":{"position":[[1525,11]]},"217":{"position":[[2253,11]]},"219":{"position":[[2416,11]]}}}],["except",{"_index":584,"t":{"43":{"position":[[2884,6]]},"215":{"position":[[3188,6]]},"217":{"position":[[4317,6]]},"219":{"position":[[4878,6]]},"468":{"position":[[1233,6]]},"801":{"position":[[2461,6]]}}}],["exchang",{"_index":1449,"t":{"219":{"position":[[237,8]]}}}],["exclud",{"_index":716,"t":{"59":{"position":[[173,8]]},"345":{"position":[[335,9]]},"347":{"position":[[2345,7]]},"351":{"position":[[637,7]]},"357":{"position":[[244,7]]}}}],["exclus",{"_index":714,"t":{"59":{"position":[[4,9],[219,9]]},"61":{"position":[[288,9]]},"131":{"position":[[85,11]]},"345":{"position":[[206,9]]},"347":{"position":[[2287,9],[2311,9]]},"351":{"position":[[579,9],[603,9]]},"357":{"position":[[222,9]]},"384":{"position":[[1317,11]]},"386":{"position":[[359,9],[1097,10]]}}}],["execut",{"_index":1024,"t":{"125":{"position":[[638,9]]},"169":{"position":[[26816,9]]},"386":{"position":[[824,9]]},"588":{"position":[[1160,7],[7316,7],[13297,7]]},"590":{"position":[[1363,7]]},"600":{"position":[[2375,9]]},"705":{"position":[[827,7]]}}}],["exercis",{"_index":1826,"t":{"424":{"position":[[257,8]]},"430":{"position":[[16,8]]}}}],["exist",{"_index":664,"t":{"49":{"position":[[1944,6]]},"51":{"position":[[1439,7]]},"53":{"position":[[2015,7]]},"55":{"position":[[101,6],[640,6]]},"57":{"position":[[116,6]]},"59":{"position":[[115,6],[947,6]]},"73":{"position":[[273,8]]},"99":{"position":[[1701,6],[1747,6]]},"169":{"position":[[87,6],[2871,6],[9223,6],[9691,6],[9938,7],[10123,6],[10498,6],[11275,6],[11838,6],[12185,6],[18268,7],[30911,5]]},"193":{"position":[[112,7],[297,6]]},"199":{"position":[[76,5]]},"386":{"position":[[206,6]]},"414":{"position":[[232,8]]},"416":{"position":[[64,8]]},"420":{"position":[[1691,8]]},"422":{"position":[[124,8],[2572,8]]},"424":{"position":[[1063,8]]},"434":{"position":[[162,8]]},"448":{"position":[[5978,5]]},"462":{"position":[[1743,8]]},"464":{"position":[[48,8]]},"474":{"position":[[3363,6]]},"480":{"position":[[667,6]]},"579":{"position":[[194,7]]},"590":{"position":[[427,6]]},"643":{"position":[[216,6]]},"649":{"position":[[33341,6]]},"659":{"position":[[514,5]]},"669":{"position":[[349,8]]},"671":{"position":[[567,5],[733,5]]},"677":{"position":[[1080,8]]},"685":{"position":[[382,8]]},"695":{"position":[[174,8]]},"697":{"position":[[740,6]]},"699":{"position":[[686,8]]},"701":{"position":[[118,8]]},"705":{"position":[[18,8],[24645,7]]},"728":{"position":[[6751,7],[6922,6],[13861,7],[23260,8],[40245,5]]},"759":{"position":[[515,6]]},"771":{"position":[[8175,5],[8341,5]]}}}],["expand",{"_index":67,"t":{"3":{"position":[[969,6]]},"9":{"position":[[66,6]]},"69":{"position":[[55,7]]},"223":{"position":[[697,7]]},"296":{"position":[[3518,6]]},"384":{"position":[[788,6]]},"386":{"position":[[1164,6],[1484,6]]},"452":{"position":[[1142,6]]},"464":{"position":[[506,7]]},"468":{"position":[[443,7]]},"570":{"position":[[78,7]]},"590":{"position":[[107,6]]},"593":{"position":[[4,6],[244,6],[292,6]]},"595":{"position":[[0,6],[963,6],[2111,6],[3545,6],[5067,6],[5718,7],[5739,6],[6875,6],[8023,6],[9457,6],[10979,6],[11630,7],[11651,6]]},"604":{"position":[[11,6],[155,6]]},"606":{"position":[[220,6],[274,6]]},"673":{"position":[[10365,6]]},"709":{"position":[[220,6]]},"747":{"position":[[9597,6]]},"773":{"position":[[21267,6]]},"825":{"position":[[93,6]]},"846":{"position":[[10271,6]]}}}],["expandresponse({\"tre",{"_index":2138,"t":{"595":{"position":[[4850,28],[10762,28]]}}}],["expect",{"_index":344,"t":{"27":{"position":[[9,7]]},"359":{"position":[[6415,9],[12190,9]]},"402":{"position":[[1070,8]]},"410":{"position":[[49,13],[5716,7]]},"428":{"position":[[133,9],[731,8],[1188,6]]},"721":{"position":[[546,10],[601,10],[650,10],[691,10],[746,10],[796,10],[840,10],[898,10],[951,10]]},"724":{"position":[[249,7]]},"726":{"position":[[27539,7]]},"728":{"position":[[41949,10],[42004,10],[42053,10],[42094,10],[42149,10],[42199,10],[42243,10],[42301,10],[42354,10]]},"730":{"position":[[205,8]]},"755":{"position":[[87,8]]},"821":{"position":[[39397,9]]},"825":{"position":[[332,9],[501,9],[664,9]]}}}],["experiment",{"_index":1276,"t":{"155":{"position":[[37,12],[98,13],[124,13],[420,12],[854,12],[875,12],[999,12],[1045,16],[1062,12],[1233,12]]}}}],["experimentals=\"feature1",{"_index":1277,"t":{"155":{"position":[[205,24]]}}}],["explain",{"_index":151,"t":{"5":{"position":[[162,9]]},"13":{"position":[[13,8]]},"33":{"position":[[13,8]]},"41":{"position":[[191,8]]},"139":{"position":[[13,8]]},"213":{"position":[[13,8]]},"711":{"position":[[14,8]]},"732":{"position":[[14,8]]},"745":{"position":[[30221,8]]},"779":{"position":[[14,8]]},"807":{"position":[[14,8]]},"831":{"position":[[14,8]]},"844":{"position":[[30261,8]]}}}],["explicit",{"_index":1945,"t":{"462":{"position":[[506,8],[1377,8]]}}}],["explicitli",{"_index":1946,"t":{"462":{"position":[[741,10]]},"677":{"position":[[1236,10]]},"848":{"position":[[154,10]]}}}],["explor",{"_index":1339,"t":{"169":{"position":[[419,7]]},"316":{"position":[[1456,7]]},"732":{"position":[[175,9]]},"753":{"position":[[133,7]]},"755":{"position":[[13,8]]}}}],["export",{"_index":591,"t":{"43":{"position":[[3109,6]]},"147":{"position":[[846,6],[920,6],[1003,6],[1085,6],[1180,6],[2295,6],[2364,6],[2444,6],[2528,6],[2610,6],[2705,6]]},"161":{"position":[[211,8]]},"215":{"position":[[3037,6],[3129,6],[3251,6]]},"217":{"position":[[4166,6],[4258,6],[4380,6],[4489,6]]},"219":{"position":[[4727,6],[4819,6],[4941,6],[5050,6],[5100,6],[5142,6],[5178,6]]}}}],["expos",{"_index":1251,"t":{"149":{"position":[[340,7]]},"155":{"position":[[598,8]]},"159":{"position":[[66,7],[119,7]]}}}],["express",{"_index":203,"t":{"9":{"position":[[164,11]]},"23":{"position":[[13,10]]},"384":{"position":[[1248,7],[1291,7]]},"422":{"position":[[2068,11],[2200,11],[4724,11]]},"424":{"position":[[447,11],[620,11]]},"426":{"position":[[1538,7],[2475,7],[6951,7],[8077,7],[8464,7],[8854,7]]},"460":{"position":[[653,11]]},"522":{"position":[[6218,11]]},"751":{"position":[[15616,7]]},"791":{"position":[[214,7]]},"797":{"position":[[567,7]]},"819":{"position":[[516,7],[830,7]]},"848":{"position":[[15007,7]]}}}],["extend",{"_index":359,"t":{"27":{"position":[[235,6]]},"665":{"position":[[281,9]]},"669":{"position":[[0,6]]},"765":{"position":[[310,6]]},"769":{"position":[[0,6]]},"775":{"position":[[191,6]]}}}],["extens",{"_index":208,"t":{"9":{"position":[[289,9]]},"27":{"position":[[650,10]]}}}],["extern",{"_index":1947,"t":{"462":{"position":[[1508,8]]}}}],["extract",{"_index":793,"t":{"73":{"position":[[862,7]]}}}],["eyjwayi6ikxbvevtvf9ou0nptkzjr19hdxromhn0b3jliiwic2sioiixem1qbxf3mwzlzextcuoyn01mdtdqtjh0cwgifq",{"_index":1584,"t":{"296":{"position":[[1539,99],[2232,99],[2504,99],[2932,99]]},"298":{"position":[[2395,99],[3120,99],[3400,99],[3859,99]]}}}],["f0c0",{"_index":1363,"t":{"169":{"position":[[4719,4]]}}}],["fabrikam",{"_index":1894,"t":{"428":{"position":[[1739,8],[1986,8]]}}}],["facil",{"_index":1545,"t":{"271":{"position":[[458,11]]}}}],["facilit",{"_index":1247,"t":{"149":{"position":[[15,11]]},"452":{"position":[[723,10]]}}}],["fact",{"_index":2,"t":{"3":{"position":[[28,5]]},"256":{"position":[[374,5]]},"438":{"position":[[383,5]]},"745":{"position":[[30208,5]]},"823":{"position":[[6011,4]]},"844":{"position":[[30242,5]]}}}],["factor",{"_index":1105,"t":{"133":{"position":[[1010,7]]}}}],["fail",{"_index":125,"t":{"3":{"position":[[2285,7],[2627,7],[3091,5]]},"169":{"position":[[8578,5]]},"223":{"position":[[609,5]]},"256":{"position":[[209,5]]},"331":{"position":[[743,7]]},"428":{"position":[[3903,5]]},"438":{"position":[[219,5]]},"466":{"position":[[797,4]]},"671":{"position":[[180,5]]}}}],["failur",{"_index":1956,"t":{"462":{"position":[[3476,7]]}}}],["fairli",{"_index":1856,"t":{"426":{"position":[[1506,6]]}}}],["fake",{"_index":1890,"t":{"428":{"position":[[1328,4]]}}}],["fals",{"_index":123,"t":{"3":{"position":[[2243,5]]},"99":{"position":[[1712,5]]},"169":{"position":[[18298,5]]},"238":{"position":[[5760,6],[6718,5],[7846,5],[9186,5],[10330,5],[11449,5]]},"267":{"position":[[6678,5],[7795,5],[9124,5],[10257,5],[11332,5]]},"273":{"position":[[2273,5],[3395,5],[4729,5],[5867,5],[6962,5],[19543,5],[20671,5],[22011,5],[23155,5],[24274,5]]},"284":{"position":[[128,5],[1016,5],[2143,5],[3482,5],[4625,5],[5740,5]]},"359":{"position":[[7407,5],[8534,5],[9873,5],[11016,5],[12131,5],[12153,6]]},"448":{"position":[[5933,5],[6891,5],[8026,5],[9373,5],[10524,5],[11671,5]]},"486":{"position":[[6875,5],[8006,5],[9349,5],[10496,5],[11627,5]]},"566":{"position":[[6515,5],[7631,5],[8959,5],[10091,5],[11162,5]]},"631":{"position":[[7024,5],[8154,5],[9496,5],[10642,5],[11769,5]]},"651":{"position":[[1328,7],[2215,5],[3342,5],[4681,5],[5824,5],[6939,5],[7577,7],[8467,5],[9597,5],[10939,5],[12085,5],[13212,5],[13921,7],[14809,5],[15937,5],[17277,5],[18421,5],[19540,5]]},"667":{"position":[[5998,5],[6313,5],[6598,5],[6834,5],[7577,5],[7853,5],[8166,5],[8449,5],[8683,5],[9418,5],[9698,5],[10013,5],[10298,5],[10534,5],[11277,5]]},"669":{"position":[[3048,5],[3361,5],[3644,5],[3878,5],[4613,5]]},"671":{"position":[[10262,5],[10692,5],[11104,5],[11447,5],[12495,5]]},"691":{"position":[[13777,5],[14904,5],[16243,5],[17386,5],[18501,5]]},"705":{"position":[[25531,5],[26657,5],[27995,5],[29137,5],[30248,5]]},"726":{"position":[[34881,5],[36009,5],[37349,5],[38493,5],[39612,5]]},"728":{"position":[[9079,5],[10203,5],[11539,5],[12679,5],[13782,5],[15005,5],[16138,5],[17483,5],[18632,5],[19771,5]]},"745":{"position":[[25338,5],[26468,5],[27810,5],[28956,5],[30083,5]]},"767":{"position":[[18619,5],[19744,5],[21081,5],[22222,5],[23329,5]]},"769":{"position":[[5406,5],[6526,5],[7858,5],[8994,5],[10081,5]]},"771":{"position":[[16488,5],[17801,5],[19339,5],[20668,5],[22262,5]]},"795":{"position":[[25644,5],[26770,5],[28108,5],[29250,5],[30361,5]]},"801":{"position":[[11153,5],[12283,5],[13625,5],[14771,5],[15898,5]]},"821":{"position":[[26339,5],[27480,5],[28833,5],[29990,5],[31161,5]]},"823":{"position":[[1000,5],[2129,5],[3470,5],[4615,5],[5738,5]]},"825":{"position":[[46930,5],[48056,5],[49394,5],[50536,5],[51647,5]]},"844":{"position":[[25370,5],[26500,5],[27842,5],[28988,5],[30115,5]]},"850":{"position":[[17563,5],[18701,5],[20051,5],[21205,5],[22364,5],[29052,5],[30190,5],[31540,5],[32694,5],[33853,5],[34749,5],[35887,5],[37237,5],[38391,5],[39550,5]]}}}],["familiar",{"_index":621,"t":{"45":{"position":[[979,8]]},"227":{"position":[[56,8]]},"258":{"position":[[56,8]]},"273":{"position":[[56,8]]},"320":{"position":[[56,8]]},"347":{"position":[[46,8]]},"365":{"position":[[47,8]]},"392":{"position":[[46,8]]},"420":{"position":[[325,8]]},"440":{"position":[[56,8]]},"474":{"position":[[56,8]]},"492":{"position":[[56,8]]},"514":{"position":[[56,8]]},"530":{"position":[[56,8]]},"550":{"position":[[56,8]]},"572":{"position":[[56,8]]},"610":{"position":[[46,8]]},"637":{"position":[[47,8]]},"657":{"position":[[36,8]]},"659":{"position":[[587,8]]},"679":{"position":[[56,8]]},"697":{"position":[[27,8]]},"713":{"position":[[56,8]]},"734":{"position":[[56,8]]},"751":{"position":[[921,8]]},"757":{"position":[[36,8]]},"759":{"position":[[589,8]]},"781":{"position":[[56,8]]},"809":{"position":[[56,8]]},"833":{"position":[[56,8]]}}}],["far",{"_index":1874,"t":{"426":{"position":[[5741,4]]},"667":{"position":[[11296,4]]},"726":{"position":[[27333,3]]},"728":{"position":[[13791,3],[13928,4],[23227,3],[38421,4]]},"767":{"position":[[23348,4]]},"823":{"position":[[5900,4]]},"825":{"position":[[3,4]]}}}],["fastifi",{"_index":869,"t":{"103":{"position":[[82,7]]},"109":{"position":[[104,7],[179,7],[234,7],[294,7],[306,7],[375,7],[383,7],[398,7],[431,7],[439,7],[454,7],[599,7]]},"111":{"position":[[117,7],[319,9],[882,9],[1161,7]]},"113":{"position":[[290,9],[1016,9],[1704,9],[2017,7]]}}}],["fastify.authent",{"_index":935,"t":{"111":{"position":[[949,23]]},"113":{"position":[[1771,22]]}}}],["fastify.author",{"_index":986,"t":{"113":{"position":[[1816,19]]}}}],["fastify.decorate('authent",{"_index":927,"t":{"111":{"position":[[583,32]]}}}],["fastify.decorate('author",{"_index":983,"t":{"113":{"position":[[1034,29]]}}}],["fastify.decorate('preauthor",{"_index":977,"t":{"113":{"position":[[308,32]]}}}],["fastify.get",{"_index":933,"t":{"111":{"position":[[900,12]]},"113":{"position":[[1722,12]]}}}],["fastify.get('/read/:docu",{"_index":888,"t":{"109":{"position":[[668,30]]}}}],["fastify.listen(3000",{"_index":890,"t":{"109":{"position":[[831,21]]},"111":{"position":[[1430,21]]},"113":{"position":[[2418,21]]}}}],["fastify.log.error(err",{"_index":892,"t":{"109":{"position":[[869,23]]},"111":{"position":[[1468,23]]},"113":{"position":[[2456,23]]}}}],["fastify.preauthor",{"_index":985,"t":{"113":{"position":[[1794,21]]}}}],["fastify.register(author",{"_index":990,"t":{"113":{"position":[[2320,28]]}}}],["fastify.register(jwtauthent",{"_index":944,"t":{"111":{"position":[[1307,34]]},"113":{"position":[[2253,34]]}}}],["fastify.register(preauthor",{"_index":989,"t":{"113":{"position":[[2288,31]]}}}],["fastify.register(require('fastifi",{"_index":917,"t":{"111":{"position":[[337,33]]}}}],["fastify.register(routeread",{"_index":945,"t":{"111":{"position":[[1342,28]]},"113":{"position":[[2349,28]]}}}],["featur",{"_index":147,"t":{"5":{"position":[[90,8],[317,8]]},"7":{"position":[[683,8]]},"11":{"position":[[34,7]]},"27":{"position":[[611,8]]},"155":{"position":[[50,8],[888,8],[1012,8],[1075,7],[1246,7]]},"345":{"position":[[552,8]]},"418":{"position":[[413,7]]},"420":{"position":[[2,8],[149,7],[210,8],[379,7],[524,7],[643,8],[1067,7],[1294,7],[2670,7]]},"422":{"position":[[1710,7],[3552,7]]},"424":{"position":[[2042,7]]},"426":{"position":[[471,8],[1028,9],[2391,7],[3011,8]]},"428":{"position":[[81,7]]},"430":{"position":[[327,7]]},"490":{"position":[[955,8]]},"625":{"position":[[58,7],[117,7],[362,10],[987,7],[1097,8],[1146,8],[1500,8],[1552,7],[1615,7],[1668,8],[1801,7],[1894,8],[1956,8],[2031,7]]},"627":{"position":[[980,7],[2367,7],[4081,7],[5468,7],[6883,7]]},"631":{"position":[[836,7],[2020,7],[3580,7],[4815,7],[5845,7]]},"653":{"position":[[128,7],[455,7]]},"713":{"position":[[611,9],[878,7],[1009,8]]},"717":{"position":[[31,8],[317,7],[593,7]]},"719":{"position":[[175,9],[225,8],[301,8]]},"724":{"position":[[324,9],[427,7],[644,7],[876,10]]},"726":{"position":[[153,8],[951,7],[1090,7],[1242,7],[1390,7],[1554,7],[1721,7],[2909,7],[3107,7],[3318,7],[3525,7],[3748,7],[3974,7],[5538,7],[5687,7],[5849,7],[6007,7],[6181,7],[6358,7],[7596,7],[7744,7],[7905,7],[8062,7],[8235,7],[8411,7],[10498,7],[10641,7],[10797,7],[10949,7],[11117,7],[11288,7]]},"728":{"position":[[6071,7],[6120,7],[6201,10],[6530,7],[7184,7],[7434,10],[20798,8],[20844,7],[20960,10],[21404,7],[21765,7],[22224,7],[22452,7],[23030,8],[23395,7],[23684,10],[30737,8],[31116,7],[31461,10],[32478,7],[38678,7],[38966,7],[39089,10],[39540,7],[39653,10],[40644,7],[40979,10]]},"844":{"position":[[42,8]]},"850":{"position":[[19,7],[367,8]]}}}],["feature'",{"_index":2478,"t":{"728":{"position":[[21563,9]]}}}],["feature2",{"_index":1278,"t":{"155":{"position":[[230,9],[371,9]]}}}],["feature:data_preview",{"_index":2187,"t":{"627":{"position":[[1050,24],[4160,22],[6663,20]]},"629":{"position":[[884,23],[1978,23],[3353,23],[4880,20],[5599,23],[5642,22],[5767,20]]},"631":{"position":[[62,21],[906,24],[3659,22],[5773,20],[6058,20],[6923,23],[8018,23],[9394,23],[10923,20],[11644,23],[11687,22]]}}}],["feature:draft_pr",{"_index":2401,"t":{"726":{"position":[[1308,21],[1626,21],[5924,19],[6262,19],[10031,17],[10292,17]]},"728":{"position":[[48150,17],[48194,17],[48376,17],[48420,17],[48612,17],[48659,17]]}}}],["feature:i",{"_index":2479,"t":{"728":{"position":[[21907,11],[22130,11],[22515,11],[38794,11]]}}}],["feature:issu",{"_index":2399,"t":{"726":{"position":[[1017,18],[1156,18],[1462,18],[5613,16],[5762,16],[6088,16],[9785,14],[9908,14],[10163,14],[46050,17],[47147,17],[48525,17],[50058,14],[50792,17],[50829,16]]},"728":{"position":[[103,15],[258,14],[1065,17],[2158,17],[3532,17],[5057,14],[5774,17],[5811,16],[8170,14],[8984,17],[10073,17],[11443,17],[12960,14],[13669,17],[13706,16],[13978,15],[14052,14],[14910,17],[16008,17],[17387,17],[18922,14],[19658,17],[19695,16],[24529,14],[25352,17],[26449,17],[27827,17],[29360,14],[30094,17],[30131,16],[30358,15],[30505,15],[30585,14],[30649,14],[32784,14],[33591,17],[34679,17],[36048,17],[37563,14],[38270,17],[38307,16],[40103,14],[40162,14],[40511,16],[43151,17],[44239,17],[45608,17],[47123,14],[47830,17],[47867,16],[48074,14],[48115,14],[48300,14],[48341,14],[48530,14],[48574,14]]}}}],["feature:sso",{"_index":2403,"t":{"726":{"position":[[1793,15],[6439,13],[10424,11]]},"728":{"position":[[48231,11],[48269,11],[48458,11],[48496,11],[48700,11],[48741,11]]}}}],["februari",{"_index":1975,"t":{"468":{"position":[[3,8]]}}}],["fed",{"_index":2464,"t":{"726":{"position":[[33894,3]]}}}],["fedora",{"_index":835,"t":{"77":{"position":[[1549,7]]},"81":{"position":[[123,7]]}}}],["feed",{"_index":2722,"t":{"791":{"position":[[269,4]]},"819":{"position":[[571,4]]}}}],["feedback",{"_index":251,"t":{"11":{"position":[[135,9]]}}}],["feel",{"_index":1782,"t":{"414":{"position":[[79,4]]},"751":{"position":[[915,5]]}}}],["few",{"_index":1626,"t":{"312":{"position":[[215,3]]},"422":{"position":[[4346,3]]},"426":{"position":[[7327,3]]},"719":{"position":[[72,3]]},"726":{"position":[[33938,3]]}}}],["fga",{"_index":209,"t":{"9":{"position":[[305,3]]},"15":{"position":[[127,3]]},"19":{"position":[[120,3]]},"37":{"position":[[7094,3],[8460,3]]},"43":{"position":[[444,4],[1244,4],[2249,4],[2271,4],[2661,4],[2810,4],[2992,3],[3016,4],[3155,4],[3272,4]]},"69":{"position":[[353,4]]},"99":{"position":[[1137,3]]},"125":{"position":[[1326,3]]},"133":{"position":[[1096,3]]},"169":{"position":[[339,3],[442,3],[3203,3],[16933,3],[23127,3],[29635,3]]},"236":{"position":[[5393,3]]},"238":{"position":[[4762,3],[10514,3]]},"250":{"position":[[1242,3]]},"252":{"position":[[1403,3]]},"265":{"position":[[5022,3]]},"267":{"position":[[5391,3],[10441,3]]},"273":{"position":[[6051,3],[12491,3],[17729,3],[23339,3]]},"282":{"position":[[5652,3]]},"284":{"position":[[4809,3]]},"296":{"position":[[785,3],[2663,3]]},"298":{"position":[[1816,3],[3559,3]]},"329":{"position":[[5455,3],[11043,3]]},"353":{"position":[[4905,3],[10511,3]]},"359":{"position":[[5901,3],[11200,3],[17014,3]]},"375":{"position":[[4967,3]]},"382":{"position":[[5872,3]]},"406":{"position":[[6340,3],[6460,3],[11649,3]]},"408":{"position":[[6718,3],[6856,3]]},"410":{"position":[[4743,3]]},"426":{"position":[[10364,3],[10379,3]]},"446":{"position":[[5515,3]]},"448":{"position":[[4867,3],[10708,3]]},"466":{"position":[[2804,3]]},"482":{"position":[[4917,3],[10547,3]]},"486":{"position":[[4881,3],[10680,3]]},"504":{"position":[[5420,3]]},"506":{"position":[[5759,3]]},"508":{"position":[[4940,3]]},"522":{"position":[[5821,3]]},"524":{"position":[[5056,3]]},"540":{"position":[[5439,3]]},"542":{"position":[[6102,3]]},"544":{"position":[[5008,3]]},"556":{"position":[[5851,3],[5956,3]]},"560":{"position":[[5838,3],[5941,3]]},"562":{"position":[[5531,3]]},"564":{"position":[[4697,3],[10211,3]]},"566":{"position":[[5376,3],[10275,3]]},"581":{"position":[[4896,3]]},"588":{"position":[[5398,3],[11456,3],[17477,3]]},"590":{"position":[[5129,3]]},"595":{"position":[[5057,3],[10969,3]]},"600":{"position":[[5416,3]]},"619":{"position":[[6146,3]]},"621":{"position":[[4886,3]]},"627":{"position":[[6427,3],[6551,3]]},"629":{"position":[[4783,3]]},"631":{"position":[[5699,3],[10826,3],[16471,3]]},"649":{"position":[[6031,3],[12203,3],[19036,3],[25861,3],[32101,3]]},"651":{"position":[[6008,3],[12269,3],[18605,3],[24928,3]]},"661":{"position":[[8853,3],[8976,3],[9099,3],[9222,3],[9345,3],[9468,3],[9581,3]]},"667":{"position":[[1302,3],[3141,3],[4992,3],[6840,3],[8689,3],[10540,3]]},"669":{"position":[[3884,3],[10325,3],[11770,3]]},"671":{"position":[[6831,3],[8778,3],[11453,3]]},"673":{"position":[[8392,3],[8515,3],[8638,3],[8761,3],[8884,3],[9007,3],[9120,3]]},"691":{"position":[[6342,3],[6452,3],[11575,3],[17570,3],[23264,3],[28886,3]]},"701":{"position":[[5726,3],[11340,3]]},"703":{"position":[[5692,3],[10746,3]]},"705":{"position":[[5271,3],[12193,3],[12309,3],[18462,3],[18540,3],[23666,3],[29321,3]]},"726":{"position":[[9677,3],[9800,3],[9923,3],[10049,3],[10178,3],[10310,3],[18674,3],[18796,3],[18918,3],[26516,3],[26634,3],[26752,3],[32914,3],[38677,3],[44306,3],[49952,3]]},"728":{"position":[[4960,3],[12863,3],[18816,3],[29254,3],[37466,3],[47026,3]]},"745":{"position":[[7159,3],[12179,3],[18533,3],[23510,3],[29140,3],[36870,3],[42496,3]]},"747":{"position":[[8782,3],[8909,3],[14346,3]]},"749":{"position":[[5753,3],[12100,3],[17101,3]]},"751":{"position":[[8828,3],[8948,3],[14566,3],[22758,3]]},"761":{"position":[[10487,3],[10612,3],[10738,3],[10865,3]]},"767":{"position":[[5079,3],[10783,3],[17416,3],[22406,3]]},"769":{"position":[[9178,3],[17750,3],[17882,3],[18014,3],[25102,3],[25228,3],[30481,3]]},"771":{"position":[[7522,3],[7610,3],[13922,3],[20852,3]]},"773":{"position":[[17562,3],[17687,3],[17813,3],[17940,3],[18065,3],[18195,3],[18326,3],[18458,3],[18590,3],[18722,3],[18854,3],[18986,3]]},"795":{"position":[[5840,3],[11508,3],[18063,3],[18182,3],[18305,3],[23743,3],[29434,3]]},"797":{"position":[[9492,3],[9608,3],[9718,3],[9837,3],[15083,3]]},"799":{"position":[[8681,3],[8811,3],[16337,3],[16478,3],[16619,3],[16748,3],[22243,3]]},"801":{"position":[[9264,3],[9384,3],[9508,3],[14955,3]]},"821":{"position":[[7638,3],[12735,3],[19349,3],[24403,3],[30174,3],[38492,3],[38619,3],[38739,3],[44107,3]]},"823":{"position":[[4799,3],[12077,3]]},"825":{"position":[[13502,3],[13638,3],[13785,3],[20367,3],[27115,3],[27229,3],[33632,3],[33757,3],[39753,3],[45555,3],[50720,3],[56451,3]]},"827":{"position":[[699,5]]},"844":{"position":[[7175,3],[12216,3],[18575,3],[23546,3],[29172,3],[36386,3],[42008,3]]},"846":{"position":[[9158,3],[9268,3],[9378,3],[9491,3],[15024,3]]},"848":{"position":[[8238,3],[8361,3],[13949,3]]},"850":{"position":[[9969,3],[10096,3],[10235,3],[15623,3],[21389,3],[27094,3],[32878,3],[38575,3]]}}}],["fga.yaml",{"_index":193,"t":{"7":{"position":[[709,11]]}}}],["fga__linux_.apk",{"_index":840,"t":{"77":{"position":[[1652,32]]},"81":{"position":[[226,32]]}}}],["fga__linux_.deb",{"_index":834,"t":{"77":{"position":[[1516,32]]},"81":{"position":[[90,32]]}}}],["fga__linux_.rpm",{"_index":837,"t":{"77":{"position":[[1574,32]]},"81":{"position":[[148,32]]}}}],["fga_api_audience=your_api_audi",{"_index":1479,"t":{"219":{"position":[[5107,34]]}}}],["fga_api_host",{"_index":433,"t":{"35":{"position":[[130,12],[279,12],[416,12],[565,12],[702,12],[851,12],[988,12],[1137,12],[1274,12],[1574,12],[1678,12]]},"93":{"position":[[130,12],[316,12],[453,12],[639,12],[776,12],[962,12],[1099,12],[1285,12],[1422,12],[1683,12],[1841,12]]},"105":{"position":[[109,12],[319,12],[473,12],[683,12]]},"119":{"position":[[130,12],[316,12],[453,12],[639,12],[776,12],[962,12],[1099,12],[1285,12],[1422,12],[1683,12],[1841,12]]},"153":{"position":[[374,13]]},"244":{"position":[[130,12],[280,12],[417,12],[567,12],[704,12],[854,12],[991,12],[1141,12],[1278,12],[1539,12],[1661,12]]},"290":{"position":[[126,12],[311,12],[448,12],[633,12],[770,12],[920,12],[1057,12],[1207,12],[1344,12],[1501,12]]}}}],["fga_api_host/healthz",{"_index":1270,"t":{"153":{"position":[[251,21]]}}}],["fga_api_host/stor",{"_index":595,"t":{"43":{"position":[[3198,20]]}}}],["fga_api_token",{"_index":434,"t":{"35":{"position":[[159,14],[445,14],[731,14],[1017,14],[1303,14],[1603,14]]},"37":{"position":[[7775,15]]},"93":{"position":[[159,14],[482,14],[805,14],[1128,14],[1451,14],[1712,14]]},"99":{"position":[[1358,15]]},"105":{"position":[[138,14],[502,14]]},"119":{"position":[[159,14],[482,14],[805,14],[1128,14],[1451,14],[1712,14]]},"125":{"position":[[1600,15]]},"169":{"position":[[17342,15],[23536,15],[30087,15]]},"217":{"position":[[223,14]]},"236":{"position":[[4943,15]]},"238":{"position":[[5168,15],[10922,15]]},"244":{"position":[[159,14],[446,14],[733,14],[1020,14],[1307,14],[1568,14]]},"250":{"position":[[1436,15]]},"252":{"position":[[1559,15]]},"265":{"position":[[5418,15]]},"267":{"position":[[4946,15],[10838,15]]},"273":{"position":[[6453,15],[12043,15],[18135,15],[23747,15]]},"282":{"position":[[5203,15]]},"284":{"position":[[5216,15]]},"290":{"position":[[155,14],[477,14],[799,14],[1086,14],[1373,14]]},"296":{"position":[[916,15],[2794,15]]},"298":{"position":[[1961,15],[3704,15]]},"329":{"position":[[5014,15],[10601,15],[17211,15]]},"353":{"position":[[5312,15],[10917,15]]},"359":{"position":[[5446,15],[11607,15],[17421,15]]},"375":{"position":[[5381,15]]},"382":{"position":[[6276,15]]},"406":{"position":[[5811,15],[12058,15]]},"408":{"position":[[6153,15]]},"410":{"position":[[5152,15]]},"446":{"position":[[5053,15]]},"448":{"position":[[5281,15],[11123,15]]},"466":{"position":[[2518,15]]},"482":{"position":[[5327,15],[10956,15]]},"486":{"position":[[5292,15],[11091,15]]},"504":{"position":[[4972,15]]},"506":{"position":[[5293,15]]},"508":{"position":[[5354,15]]},"522":{"position":[[5365,15]]},"524":{"position":[[5466,15]]},"540":{"position":[[4989,15]]},"542":{"position":[[5629,15]]},"544":{"position":[[5424,15]]},"556":{"position":[[5351,15]]},"560":{"position":[[5342,15]]},"562":{"position":[[5082,15]]},"564":{"position":[[5092,15],[10606,15]]},"566":{"position":[[4935,15],[10671,15]]},"581":{"position":[[5301,15]]},"588":{"position":[[5754,15],[11794,15],[17825,15]]},"590":{"position":[[5485,15]]},"595":{"position":[[5454,15],[11366,15]]},"600":{"position":[[5923,15]]},"619":{"position":[[5681,15]]},"621":{"position":[[5303,15]]},"627":{"position":[[5880,15]]},"629":{"position":[[5192,15]]},"631":{"position":[[5228,15],[11236,15],[16884,15]]},"649":{"position":[[6437,15],[12609,15],[19445,15],[26267,15],[32508,15]]},"651":{"position":[[6415,15],[12679,15],[19013,15],[25336,15]]},"661":{"position":[[8133,15]]},"667":{"position":[[1524,15],[3365,15],[5214,15],[7065,15],[8912,15],[10765,15]]},"669":{"position":[[4107,15],[9865,15],[11992,15]]},"671":{"position":[[6370,15],[9063,15],[11739,15]]},"673":{"position":[[7672,15]]},"691":{"position":[[5831,15],[11982,15],[17977,15],[23673,15],[29294,15]]},"701":{"position":[[6134,15],[11747,15]]},"703":{"position":[[5236,15],[11157,15]]},"705":{"position":[[5574,15],[11668,15],[17936,15],[24074,15],[29727,15]]},"726":{"position":[[8816,15],[18060,15],[25917,15],[33321,15],[39085,15],[44717,15],[50364,15]]},"728":{"position":[[5368,15],[13267,15],[19229,15],[29666,15],[37869,15],[47429,15]]},"745":{"position":[[6702,15],[12588,15],[18076,15],[23919,15],[29550,15],[37279,15],[42905,15]]},"747":{"position":[[8224,15],[14757,15]]},"749":{"position":[[5272,15],[11640,15],[17510,15]]},"751":{"position":[[8288,15],[14979,15],[22279,15]]},"761":{"position":[[9788,15]]},"767":{"position":[[5483,15],[11191,15],[16954,15],[22811,15]]},"769":{"position":[[9578,15],[17089,15],[24574,15],[30885,15]]},"771":{"position":[[6993,15],[14424,15],[21355,15]]},"773":{"position":[[16164,15]]},"795":{"position":[[5384,15],[11048,15],[17462,15],[24151,15],[29840,15]]},"797":{"position":[[8839,15],[15494,15]]},"799":{"position":[[8138,15],[15601,15],[22648,15]]},"801":{"position":[[8660,15],[15365,15]]},"821":{"position":[[7176,15],[13149,15],[18887,15],[24817,15],[30595,15],[37881,15],[44521,15]]},"823":{"position":[[5208,15],[12485,15]]},"825":{"position":[[12824,15],[19897,15],[26595,15],[33090,15],[39267,15],[45086,15],[51126,15],[56872,15]]},"844":{"position":[[6715,15],[12628,15],[18119,15],[23954,15],[29582,15],[36794,15],[42417,15]]},"846":{"position":[[8501,15],[15436,15]]},"848":{"position":[[7692,15],[14364,15]]},"850":{"position":[[9335,15],[16039,15],[21807,15],[27514,15],[33296,15],[38993,15]]}}}],["fga_api_token=your_api_token",{"_index":1446,"t":{"217":{"position":[[4496,28]]}}}],["fga_api_token_issuer=your_api_token_issu",{"_index":1478,"t":{"219":{"position":[[5057,42]]}}}],["fga_client",{"_index":535,"t":{"37":{"position":[[6102,11]]},"43":{"position":[[2615,11]]},"97":{"position":[[3038,11]]},"123":{"position":[[3038,11]]},"169":{"position":[[16416,11],[22610,11],[29081,11]]},"215":{"position":[[2904,11]]},"217":{"position":[[4033,11]]},"219":{"position":[[4594,11]]},"236":{"position":[[4336,11]]},"238":{"position":[[4248,11],[9998,11]]},"248":{"position":[[3038,11]]},"265":{"position":[[4518,11]]},"267":{"position":[[4342,11],[9936,11]]},"273":{"position":[[5541,11],[11400,11],[17215,11],[22823,11]]},"282":{"position":[[4595,11]]},"284":{"position":[[4294,11]]},"294":{"position":[[3010,11]]},"329":{"position":[[4416,11],[10000,11],[16433,11]]},"353":{"position":[[4390,11],[9997,11]]},"359":{"position":[[4781,11],[10685,11],[16499,11]]},"375":{"position":[[4445,11]]},"382":{"position":[[5360,11]]},"406":{"position":[[5031,11],[11132,11]]},"408":{"position":[[5263,11]]},"410":{"position":[[4226,11]]},"446":{"position":[[4434,11]]},"448":{"position":[[4345,11],[10185,11]]},"482":{"position":[[4399,11],[10030,11]]},"486":{"position":[[4362,11],[10161,11]]},"504":{"position":[[4367,11]]},"506":{"position":[[4609,11]]},"508":{"position":[[4418,11]]},"522":{"position":[[4709,11]]},"524":{"position":[[4538,11]]},"540":{"position":[[4382,11]]},"542":{"position":[[4946,11]]},"544":{"position":[[4484,11]]},"556":{"position":[[4683,11]]},"560":{"position":[[4678,11]]},"562":{"position":[[4476,11]]},"564":{"position":[[4194,11],[9708,11]]},"566":{"position":[[4335,11],[9771,11]]},"581":{"position":[[4383,11]]},"588":{"position":[[4828,11],[10905,11],[16916,11]]},"590":{"position":[[4677,11]]},"595":{"position":[[4541,11],[10453,11]]},"600":{"position":[[4761,11]]},"619":{"position":[[4959,11]]},"621":{"position":[[4361,11]]},"627":{"position":[[5050,11]]},"629":{"position":[[4266,11]]},"631":{"position":[[4549,11],[10308,11],[15950,11]]},"649":{"position":[[5517,11],[11689,11],[18519,11],[25347,11],[31586,11]]},"651":{"position":[[5493,11],[11751,11],[18089,11],[24412,11]]},"669":{"position":[[9191,11]]},"671":{"position":[[5666,11]]},"691":{"position":[[5081,11],[11060,11],[17055,11],[22747,11],[28370,11]]},"701":{"position":[[5210,11],[10825,11]]},"703":{"position":[[4579,11],[10227,11]]},"705":{"position":[[4633,11],[10975,11],[17240,11],[23150,11],[28807,11]]},"726":{"position":[[7320,11],[17051,11],[24978,11],[32399,11],[38161,11],[43787,11],[49432,11]]},"728":{"position":[[4444,11],[12351,11],[18295,11],[28734,11],[36955,11],[46515,11]]},"745":{"position":[[6088,11],[11662,11],[17462,11],[22993,11],[28622,11],[36353,11],[41979,11]]},"747":{"position":[[7373,11],[13827,11]]},"749":{"position":[[4634,11],[10971,11],[16584,11]]},"751":{"position":[[7580,11],[14045,11],[21643,11]]},"761":{"position":[[8629,11]]},"767":{"position":[[4567,11],[10267,11],[16282,11],[21893,11]]},"769":{"position":[[8670,11],[16031,11],[23770,11],[29969,11]]},"771":{"position":[[6132,11],[13222,11],[20151,11]]},"773":{"position":[[13677,11]]},"795":{"position":[[4771,11],[10431,11],[16682,11],[23227,11],[28920,11]]},"797":{"position":[[7996,11],[14564,11]]},"799":{"position":[[7427,11],[14675,11],[21730,11]]},"801":{"position":[[7877,11],[14437,11]]},"821":{"position":[[6505,11],[12213,11],[18216,11],[23881,11],[29645,11],[36942,11],[43585,11]]},"823":{"position":[[4282,11],[11561,11]]},"825":{"position":[[11967,11],[19157,11],[25801,11],[32380,11],[38624,11],[44460,11],[50206,11],[55922,11]]},"844":{"position":[[6098,11],[11696,11],[17506,11],[23030,11],[28654,11],[35870,11],[41491,11]]},"846":{"position":[[7539,11],[14504,11]]},"848":{"position":[[6871,11],[13426,11]]},"850":{"position":[[8332,11],[15099,11],[20863,11],[26566,11],[32352,11],[38049,11]]}}}],["fga_client.check(bodi",{"_index":862,"t":{"99":{"position":[[1079,22]]},"169":{"position":[[16697,22],[22891,22]]},"238":{"position":[[4526,22],[10277,22]]},"265":{"position":[[4786,22]]},"267":{"position":[[10204,22]]},"273":{"position":[[5814,22],[17493,22],[23102,22]]},"284":{"position":[[4572,22]]},"353":{"position":[[4669,22],[10275,22]]},"359":{"position":[[10963,22],[16778,22]]},"375":{"position":[[4731,22]]},"382":{"position":[[5636,22]]},"406":{"position":[[11413,22]]},"410":{"position":[[4507,22]]},"448":{"position":[[4631,22],[10471,22]]},"482":{"position":[[4681,22],[10311,22]]},"486":{"position":[[4645,22],[10443,22]]},"508":{"position":[[4704,22]]},"524":{"position":[[4820,22]]},"544":{"position":[[4772,22]]},"564":{"position":[[4461,22],[9975,22]]},"566":{"position":[[10038,22]]},"581":{"position":[[4660,22]]},"621":{"position":[[4650,22]]},"629":{"position":[[4547,22]]},"631":{"position":[[10589,22],[16235,22]]},"649":{"position":[[5795,22],[11967,22],[18800,22],[25625,22],[31865,22]]},"651":{"position":[[5771,22],[12032,22],[18368,22],[24692,22]]},"667":{"position":[[1244,22],[3083,22],[4934,22],[6781,22],[8630,22],[10481,22]]},"669":{"position":[[3825,22],[11712,22]]},"671":{"position":[[8720,22],[11394,22]]},"691":{"position":[[11339,22],[17333,22],[23028,22],[28650,22]]},"701":{"position":[[5490,22],[11104,22]]},"703":{"position":[[10510,22]]},"705":{"position":[[23430,22],[29084,22]]},"726":{"position":[[32678,22],[38440,22],[44070,22],[49716,22]]},"728":{"position":[[4719,22],[12626,22],[18579,22],[29018,22],[37230,22],[46790,22]]},"745":{"position":[[11943,22],[23274,22],[28903,22],[36634,22],[42260,22]]},"747":{"position":[[14110,22]]},"749":{"position":[[16865,22]]},"751":{"position":[[14325,22]]},"767":{"position":[[4843,22],[10547,22],[22169,22]]},"769":{"position":[[8941,22],[30245,22]]},"771":{"position":[[13686,22],[20615,22]]},"795":{"position":[[23507,22],[29197,22]]},"797":{"position":[[14847,22]]},"799":{"position":[[22007,22]]},"801":{"position":[[14718,22]]},"821":{"position":[[12499,22],[24167,22],[29937,22],[43871,22]]},"823":{"position":[[4562,22],[11841,22]]},"825":{"position":[[50483,22],[56215,22]]},"844":{"position":[[11980,22],[23310,22],[28935,22],[36150,22],[41772,22]]},"846":{"position":[[14788,22]]},"848":{"position":[[13708,22]]},"850":{"position":[[15387,22],[21152,22],[26858,22],[32641,22],[38338,22]]}}}],["fga_client.clos",{"_index":538,"t":{"37":{"position":[[6180,18]]},"97":{"position":[[3116,18]]},"123":{"position":[[3116,18]]},"169":{"position":[[16494,18],[22688,18],[29159,18]]},"215":{"position":[[2999,18]]},"217":{"position":[[4128,18]]},"219":{"position":[[4689,18]]},"236":{"position":[[4414,18]]},"238":{"position":[[4326,18],[10076,18]]},"248":{"position":[[3116,18]]},"265":{"position":[[4596,18]]},"267":{"position":[[4420,18],[10014,18]]},"273":{"position":[[5619,18],[11478,18],[17293,18],[22901,18]]},"282":{"position":[[4673,18]]},"284":{"position":[[4372,18]]},"294":{"position":[[3088,18]]},"329":{"position":[[4494,18],[10078,18],[16511,18]]},"353":{"position":[[4468,18],[10075,18]]},"359":{"position":[[4859,18],[10763,18],[16577,18]]},"375":{"position":[[4523,18]]},"382":{"position":[[5438,18]]},"406":{"position":[[5109,18],[11210,18]]},"408":{"position":[[5341,18]]},"410":{"position":[[4304,18]]},"446":{"position":[[4512,18]]},"448":{"position":[[4423,18],[10263,18]]},"482":{"position":[[4477,18],[10108,18]]},"486":{"position":[[4440,18],[10239,18]]},"504":{"position":[[4445,18]]},"506":{"position":[[4687,18]]},"508":{"position":[[4496,18]]},"522":{"position":[[4787,18]]},"524":{"position":[[4616,18]]},"540":{"position":[[4460,18]]},"542":{"position":[[5024,18]]},"544":{"position":[[4562,18]]},"556":{"position":[[4761,18]]},"560":{"position":[[4756,18]]},"562":{"position":[[4554,18]]},"564":{"position":[[4272,18],[9786,18]]},"566":{"position":[[4413,18],[9849,18]]},"581":{"position":[[4461,18]]},"588":{"position":[[4906,18],[10983,18],[16994,18]]},"590":{"position":[[4755,18]]},"595":{"position":[[4619,18],[10531,18]]},"600":{"position":[[4839,18]]},"619":{"position":[[5037,18]]},"621":{"position":[[4439,18]]},"627":{"position":[[5128,18]]},"629":{"position":[[4344,18]]},"631":{"position":[[4627,18],[10386,18],[16028,18]]},"649":{"position":[[5595,18],[11767,18],[18597,18],[25425,18],[31664,18]]},"651":{"position":[[5571,18],[11829,18],[18167,18],[24490,18]]},"669":{"position":[[9269,18]]},"671":{"position":[[5744,18]]},"691":{"position":[[5159,18],[11138,18],[17133,18],[22825,18],[28448,18]]},"701":{"position":[[5288,18],[10903,18]]},"703":{"position":[[4657,18],[10305,18]]},"705":{"position":[[4711,18],[11053,18],[17318,18],[23228,18],[28885,18]]},"726":{"position":[[7398,18],[17129,18],[25056,18],[32477,18],[38239,18],[43865,18],[49510,18]]},"728":{"position":[[4522,18],[12429,18],[18373,18],[28812,18],[37033,18],[46593,18]]},"745":{"position":[[6166,18],[11740,18],[17540,18],[23071,18],[28700,18],[36431,18],[42057,18]]},"747":{"position":[[7451,18],[13905,18]]},"749":{"position":[[4712,18],[11049,18],[16662,18]]},"751":{"position":[[7658,18],[14123,18],[21721,18]]},"761":{"position":[[8707,18]]},"767":{"position":[[4645,18],[10345,18],[16360,18],[21971,18]]},"769":{"position":[[8748,18],[16109,18],[23848,18],[30047,18]]},"771":{"position":[[6210,18],[13300,18],[20229,18]]},"773":{"position":[[13755,18]]},"795":{"position":[[4849,18],[10509,18],[16760,18],[23305,18],[28998,18]]},"797":{"position":[[8074,18],[14642,18]]},"799":{"position":[[7505,18],[14753,18],[21808,18]]},"801":{"position":[[7955,18],[14515,18]]},"821":{"position":[[6583,18],[12291,18],[18294,18],[23959,18],[29723,18],[37020,18],[43663,18]]},"823":{"position":[[4360,18],[11639,18]]},"825":{"position":[[12045,18],[19235,18],[25879,18],[32458,18],[38702,18],[44538,18],[50284,18],[56000,18]]},"844":{"position":[[6176,18],[11774,18],[17584,18],[23108,18],[28732,18],[35948,18],[41569,18]]},"846":{"position":[[7617,18],[14582,18]]},"848":{"position":[[6949,18],[13504,18]]},"850":{"position":[[8410,18],[15177,18],[20941,18],[26644,18],[32430,18],[38127,18]]}}}],["fga_client.create_store(bodi",{"_index":580,"t":{"43":{"position":[[2698,29]]}}}],["fga_client.expand(bodi",{"_index":2137,"t":{"595":{"position":[[4804,23],[10716,23]]}}}],["fga_client.list_objects(bodi",{"_index":1027,"t":{"125":{"position":[[1223,29]]},"169":{"position":[[29354,29]]},"600":{"position":[[5135,29]]}}}],["fga_client.read(bodi",{"_index":2115,"t":{"588":{"position":[[5030,21],[11088,21],[17109,21]]},"590":{"position":[[4879,21]]},"705":{"position":[[4779,21]]}}}],["fga_client.read_authorization_model",{"_index":537,"t":{"37":{"position":[[6135,38]]},"97":{"position":[[3071,38]]},"123":{"position":[[3071,38]]},"169":{"position":[[16449,38],[22643,38],[29114,38]]},"215":{"position":[[2937,38]]},"217":{"position":[[4066,38]]},"219":{"position":[[4627,38]]},"236":{"position":[[4369,38]]},"238":{"position":[[4281,38],[10031,38]]},"248":{"position":[[3071,38]]},"265":{"position":[[4551,38]]},"267":{"position":[[4375,38],[9969,38]]},"273":{"position":[[5574,38],[11433,38],[17248,38],[22856,38]]},"282":{"position":[[4628,38]]},"284":{"position":[[4327,38]]},"294":{"position":[[3043,38]]},"329":{"position":[[4449,38],[10033,38],[16466,38]]},"353":{"position":[[4423,38],[10030,38]]},"359":{"position":[[4814,38],[10718,38],[16532,38]]},"375":{"position":[[4478,38]]},"382":{"position":[[5393,38]]},"406":{"position":[[5064,38],[11165,38]]},"408":{"position":[[5296,38]]},"410":{"position":[[4259,38]]},"446":{"position":[[4467,38]]},"448":{"position":[[4378,38],[10218,38]]},"482":{"position":[[4432,38],[10063,38]]},"486":{"position":[[4395,38],[10194,38]]},"504":{"position":[[4400,38]]},"506":{"position":[[4642,38]]},"508":{"position":[[4451,38]]},"522":{"position":[[4742,38]]},"524":{"position":[[4571,38]]},"540":{"position":[[4415,38]]},"542":{"position":[[4979,38]]},"544":{"position":[[4517,38]]},"556":{"position":[[4716,38]]},"560":{"position":[[4711,38]]},"562":{"position":[[4509,38]]},"564":{"position":[[4227,38],[9741,38]]},"566":{"position":[[4368,38],[9804,38]]},"581":{"position":[[4416,38]]},"588":{"position":[[4861,38],[10938,38],[16949,38]]},"590":{"position":[[4710,38]]},"595":{"position":[[4574,38],[10486,38]]},"600":{"position":[[4794,38]]},"619":{"position":[[4992,38]]},"621":{"position":[[4394,38]]},"627":{"position":[[5083,38]]},"629":{"position":[[4299,38]]},"631":{"position":[[4582,38],[10341,38],[15983,38]]},"649":{"position":[[5550,38],[11722,38],[18552,38],[25380,38],[31619,38]]},"651":{"position":[[5526,38],[11784,38],[18122,38],[24445,38]]},"669":{"position":[[9224,38]]},"671":{"position":[[5699,38]]},"691":{"position":[[5114,38],[11093,38],[17088,38],[22780,38],[28403,38]]},"701":{"position":[[5243,38],[10858,38]]},"703":{"position":[[4612,38],[10260,38]]},"705":{"position":[[4666,38],[11008,38],[17273,38],[23183,38],[28840,38]]},"726":{"position":[[7353,38],[17084,38],[25011,38],[32432,38],[38194,38],[43820,38],[49465,38]]},"728":{"position":[[4477,38],[12384,38],[18328,38],[28767,38],[36988,38],[46548,38]]},"745":{"position":[[6121,38],[11695,38],[17495,38],[23026,38],[28655,38],[36386,38],[42012,38]]},"747":{"position":[[7406,38],[13860,38]]},"749":{"position":[[4667,38],[11004,38],[16617,38]]},"751":{"position":[[7613,38],[14078,38],[21676,38]]},"761":{"position":[[8662,38]]},"767":{"position":[[4600,38],[10300,38],[16315,38],[21926,38]]},"769":{"position":[[8703,38],[16064,38],[23803,38],[30002,38]]},"771":{"position":[[6165,38],[13255,38],[20184,38]]},"773":{"position":[[13710,38]]},"795":{"position":[[4804,38],[10464,38],[16715,38],[23260,38],[28953,38]]},"797":{"position":[[8029,38],[14597,38]]},"799":{"position":[[7460,38],[14708,38],[21763,38]]},"801":{"position":[[7910,38],[14470,38]]},"821":{"position":[[6538,38],[12246,38],[18249,38],[23914,38],[29678,38],[36975,38],[43618,38]]},"823":{"position":[[4315,38],[11594,38]]},"825":{"position":[[12000,38],[19190,38],[25834,38],[32413,38],[38657,38],[44493,38],[50239,38],[55955,38]]},"844":{"position":[[6131,38],[11729,38],[17539,38],[23063,38],[28687,38],[35903,38],[41524,38]]},"846":{"position":[[7572,38],[14537,38]]},"848":{"position":[[6904,38],[13459,38]]},"850":{"position":[[8365,38],[15132,38],[20896,38],[26599,38],[32385,38],[38082,38]]}}}],["fga_client.read_changes(bodi",{"_index":1579,"t":{"296":{"position":[[746,29],[2624,29]]},"298":{"position":[[1777,29],[3520,29]]}}}],["fga_client.write(bodi",{"_index":1506,"t":{"236":{"position":[[4649,22]]},"250":{"position":[[1210,22]]},"252":{"position":[[1371,22]]},"267":{"position":[[4652,22]]},"273":{"position":[[11749,22]]},"282":{"position":[[4909,22]]},"329":{"position":[[4720,22],[10307,22],[16917,22]]},"359":{"position":[[5152,22]]},"406":{"position":[[5517,22]]},"408":{"position":[[5859,22]]},"446":{"position":[[4759,22]]},"466":{"position":[[2402,22]]},"504":{"position":[[4678,22]]},"506":{"position":[[4999,22]]},"522":{"position":[[5071,22]]},"540":{"position":[[4695,22]]},"542":{"position":[[5335,22]]},"556":{"position":[[5057,22]]},"560":{"position":[[5048,22]]},"562":{"position":[[4788,22]]},"566":{"position":[[4641,22]]},"619":{"position":[[5387,22]]},"627":{"position":[[5586,22]]},"631":{"position":[[4934,22]]},"661":{"position":[[8017,22]]},"669":{"position":[[9571,22]]},"671":{"position":[[6076,22]]},"673":{"position":[[7556,22]]},"691":{"position":[[5537,22]]},"703":{"position":[[4942,22]]},"705":{"position":[[11374,22],[17642,22]]},"726":{"position":[[8522,22],[17766,22],[25623,22]]},"745":{"position":[[6408,22],[17782,22]]},"747":{"position":[[7930,22]]},"749":{"position":[[4978,22],[11346,22]]},"751":{"position":[[7994,22],[21985,22]]},"761":{"position":[[9494,22]]},"767":{"position":[[16660,22]]},"769":{"position":[[16795,22],[24280,22]]},"771":{"position":[[6699,22]]},"773":{"position":[[15870,22]]},"795":{"position":[[5090,22],[10754,22],[17168,22]]},"797":{"position":[[8545,22]]},"799":{"position":[[7844,22],[15307,22]]},"801":{"position":[[8366,22]]},"821":{"position":[[6882,22],[18593,22],[37587,22]]},"825":{"position":[[12530,22],[19603,22],[26301,22],[32796,22],[38973,22],[44792,22]]},"844":{"position":[[6421,22],[17825,22]]},"846":{"position":[[8207,22]]},"848":{"position":[[7398,22]]},"850":{"position":[[9041,22]]}}}],["fga_client_id=your_client_id",{"_index":1480,"t":{"219":{"position":[[5149,28]]}}}],["fga_client_instance.create_store(bodi",{"_index":583,"t":{"43":{"position":[[2845,38]]}}}],["fga_client_instance.write_authorization_model(json.loads(bodi",{"_index":543,"t":{"37":{"position":[[6786,63]]}}}],["fga_client_secret=your_client_secret",{"_index":1481,"t":{"219":{"position":[[5185,36]]}}}],["fga_model_id=your_model_id",{"_index":1426,"t":{"215":{"position":[[3258,26]]},"217":{"position":[[4387,26]]},"219":{"position":[[4948,26]]}}}],["fga_server_url",{"_index":437,"t":{"35":{"position":[[1435,14]]},"37":{"position":[[6920,14],[7009,14],[7502,14],[7591,14]]},"93":{"position":[[1544,14]]},"97":{"position":[[3139,14],[3256,14]]},"119":{"position":[[1544,14]]},"123":{"position":[[3139,14],[3256,14]]},"169":{"position":[[16759,14],[16848,14],[17084,14],[17173,14],[22953,14],[23042,14],[23278,14],[23367,14],[29461,14],[29550,14],[29822,14],[29911,14]]},"236":{"position":[[4685,14],[4774,14],[5219,14],[5308,14]]},"238":{"position":[[4588,14],[4677,14],[4910,14],[4999,14],[10340,14],[10429,14],[10664,14],[10753,14]]},"244":{"position":[[1400,14]]},"248":{"position":[[3139,14],[3256,14]]},"265":{"position":[[4848,14],[4937,14],[5160,14],[5249,14]]},"267":{"position":[[4688,14],[4777,14],[5217,14],[5306,14],[10267,14],[10356,14],[10580,14],[10669,14]]},"273":{"position":[[5877,14],[5966,14],[6195,14],[6284,14],[11785,14],[11874,14],[12317,14],[12406,14],[17555,14],[17644,14],[17877,14],[17966,14],[23165,14],[23254,14],[23489,14],[23578,14]]},"282":{"position":[[4945,14],[5034,14],[5478,14],[5567,14]]},"284":{"position":[[4635,14],[4724,14],[4958,14],[5047,14]]},"294":{"position":[[3139,14]]},"329":{"position":[[4756,14],[4845,14],[5281,14],[5370,14],[10343,14],[10432,14],[10869,14],[10958,14],[16953,14],[17042,14]]},"353":{"position":[[4731,14],[4820,14],[5054,14],[5143,14],[10337,14],[10426,14],[10659,14],[10748,14]]},"359":{"position":[[5188,14],[5277,14],[5727,14],[5816,14],[11026,14],[11115,14],[11349,14],[11438,14],[16840,14],[16929,14],[17163,14],[17252,14]]},"375":{"position":[[4793,14],[4882,14],[5123,14],[5212,14]]},"382":{"position":[[5698,14],[5787,14],[6018,14],[6107,14]]},"406":{"position":[[5553,14],[5642,14],[6166,14],[6255,14],[11475,14],[11564,14],[11800,14],[11889,14]]},"408":{"position":[[5895,14],[5984,14],[6544,14],[6633,14]]},"410":{"position":[[4569,14],[4658,14],[4894,14],[4983,14]]},"446":{"position":[[4795,14],[4884,14],[5341,14],[5430,14]]},"448":{"position":[[4693,14],[4782,14],[5023,14],[5112,14],[10534,14],[10623,14],[10865,14],[10954,14]]},"482":{"position":[[4743,14],[4832,14],[5069,14],[5158,14],[10373,14],[10462,14],[10698,14],[10787,14]]},"486":{"position":[[4707,14],[4796,14],[5034,14],[5123,14],[10506,14],[10595,14],[10833,14],[10922,14]]},"504":{"position":[[4714,14],[4803,14],[5246,14],[5335,14]]},"506":{"position":[[5035,14],[5124,14],[5585,14],[5674,14]]},"508":{"position":[[4766,14],[4855,14],[5096,14],[5185,14]]},"522":{"position":[[5107,14],[5196,14],[5647,14],[5736,14]]},"524":{"position":[[4882,14],[4971,14],[5208,14],[5297,14]]},"540":{"position":[[4731,14],[4820,14],[5265,14],[5354,14]]},"542":{"position":[[5371,14],[5460,14],[5928,14],[6017,14]]},"544":{"position":[[4834,14],[4923,14],[5166,14],[5255,14]]},"556":{"position":[[5093,14],[5182,14],[5677,14],[5766,14]]},"560":{"position":[[5084,14],[5173,14],[5664,14],[5753,14]]},"562":{"position":[[4824,14],[4913,14],[5357,14],[5446,14]]},"564":{"position":[[4523,14],[4612,14],[4834,14],[4923,14],[10037,14],[10126,14],[10348,14],[10437,14]]},"566":{"position":[[4677,14],[4766,14],[5202,14],[5291,14],[10101,14],[10190,14],[10413,14],[10502,14]]},"581":{"position":[[4722,14],[4811,14],[5043,14],[5132,14]]},"588":{"position":[[5224,14],[5313,14],[5497,14],[5586,14],[11282,14],[11371,14],[11537,14],[11626,14],[17303,14],[17392,14],[17568,14],[17657,14]]},"590":{"position":[[4955,14],[5044,14],[5228,14],[5317,14]]},"595":{"position":[[4883,14],[4972,14],[5195,14],[5284,14],[10795,14],[10884,14],[11107,14],[11196,14]]},"600":{"position":[[5242,14],[5331,14],[5658,14],[5747,14]]},"619":{"position":[[5423,14],[5512,14],[5972,14],[6061,14]]},"621":{"position":[[4712,14],[4801,14],[5045,14],[5134,14]]},"627":{"position":[[5622,14],[5711,14],[6253,14],[6342,14]]},"629":{"position":[[4609,14],[4698,14],[4934,14],[5023,14]]},"631":{"position":[[4970,14],[5059,14],[5525,14],[5614,14],[10652,14],[10741,14],[10978,14],[11067,14],[16297,14],[16386,14],[16626,14],[16715,14]]},"649":{"position":[[5857,14],[5946,14],[6179,14],[6268,14],[12029,14],[12118,14],[12351,14],[12440,14],[18862,14],[18951,14],[19187,14],[19276,14],[25687,14],[25776,14],[26009,14],[26098,14],[31927,14],[32016,14],[32250,14],[32339,14]]},"651":{"position":[[5834,14],[5923,14],[6157,14],[6246,14],[12095,14],[12184,14],[12421,14],[12510,14],[18431,14],[18520,14],[18755,14],[18844,14],[24754,14],[24843,14],[25078,14],[25167,14]]},"669":{"position":[[9607,14],[9696,14],[10151,14],[10240,14]]},"671":{"position":[[6112,14],[6201,14],[6657,14],[6746,14]]},"691":{"position":[[5573,14],[5662,14],[6168,14],[6257,14],[11401,14],[11490,14],[11724,14],[11813,14],[17396,14],[17485,14],[17719,14],[17808,14],[23090,14],[23179,14],[23415,14],[23504,14],[28712,14],[28801,14],[29036,14],[29125,14]]},"701":{"position":[[5552,14],[5641,14],[5876,14],[5965,14],[11166,14],[11255,14],[11489,14],[11578,14]]},"703":{"position":[[4978,14],[5067,14],[5518,14],[5607,14],[10572,14],[10661,14],[10899,14],[10988,14]]},"705":{"position":[[5097,14],[5186,14],[5317,14],[5406,14],[11410,14],[11499,14],[12019,14],[12108,14],[17678,14],[17767,14],[18288,14],[18377,14],[23492,14],[23581,14],[23816,14],[23905,14],[29147,14],[29236,14],[29469,14],[29558,14]]},"726":{"position":[[8558,14],[8647,14],[9503,14],[9592,14],[17802,14],[17891,14],[18500,14],[18589,14],[25659,14],[25748,14],[26342,14],[26431,14],[32740,14],[32829,14],[33063,14],[33152,14],[38503,14],[38592,14],[38827,14],[38916,14],[44132,14],[44221,14],[44459,14],[44548,14],[49778,14],[49867,14],[50106,14],[50195,14]]},"728":{"position":[[4786,14],[4875,14],[5110,14],[5199,14],[12689,14],[12778,14],[13009,14],[13098,14],[18642,14],[18731,14],[18971,14],[19060,14],[29080,14],[29169,14],[29408,14],[29497,14],[37292,14],[37381,14],[37611,14],[37700,14],[46852,14],[46941,14],[47171,14],[47260,14]]},"745":{"position":[[6444,14],[6533,14],[6985,14],[7074,14],[12005,14],[12094,14],[12330,14],[12419,14],[17818,14],[17907,14],[18359,14],[18448,14],[23336,14],[23425,14],[23661,14],[23750,14],[28966,14],[29055,14],[29292,14],[29381,14],[36696,14],[36785,14],[37021,14],[37110,14],[42322,14],[42411,14],[42647,14],[42736,14]]},"747":{"position":[[7966,14],[8055,14],[8608,14],[8697,14],[14172,14],[14261,14],[14499,14],[14588,14]]},"749":{"position":[[5014,14],[5103,14],[5579,14],[5668,14],[11382,14],[11471,14],[11926,14],[12015,14],[16927,14],[17016,14],[17252,14],[17341,14]]},"751":{"position":[[8030,14],[8119,14],[8654,14],[8743,14],[14392,14],[14481,14],[14721,14],[14810,14],[22021,14],[22110,14],[22584,14],[22673,14]]},"761":{"position":[[9530,14],[9619,14],[10313,14],[10402,14]]},"767":{"position":[[4905,14],[4994,14],[5225,14],[5314,14],[10609,14],[10698,14],[10933,14],[11022,14],[16696,14],[16785,14],[17242,14],[17331,14],[22232,14],[22321,14],[22553,14],[22642,14]]},"769":{"position":[[9004,14],[9093,14],[9320,14],[9409,14],[16831,14],[16920,14],[17576,14],[17665,14],[24316,14],[24405,14],[24928,14],[25017,14],[30307,14],[30396,14],[30627,14],[30716,14]]},"771":{"position":[[6735,14],[6824,14],[7348,14],[7437,14],[13748,14],[13837,14],[14166,14],[14255,14],[20678,14],[20767,14],[21097,14],[21186,14]]},"773":{"position":[[15906,14],[15995,14],[17388,14],[17477,14]]},"795":{"position":[[5126,14],[5215,14],[5666,14],[5755,14],[10790,14],[10879,14],[11334,14],[11423,14],[17204,14],[17293,14],[17889,14],[17978,14],[23569,14],[23658,14],[23893,14],[23982,14],[29260,14],[29349,14],[29582,14],[29671,14]]},"797":{"position":[[8581,14],[8670,14],[9318,14],[9407,14],[14909,14],[14998,14],[15236,14],[15325,14]]},"799":{"position":[[7880,14],[7969,14],[8507,14],[8596,14],[15343,14],[15432,14],[16163,14],[16252,14],[22069,14],[22158,14],[22390,14],[22479,14]]},"801":{"position":[[8402,14],[8491,14],[9090,14],[9179,14],[14781,14],[14870,14],[15107,14],[15196,14]]},"821":{"position":[[6918,14],[7007,14],[7464,14],[7553,14],[12561,14],[12650,14],[12891,14],[12980,14],[18629,14],[18718,14],[19175,14],[19264,14],[24229,14],[24318,14],[24559,14],[24648,14],[30000,14],[30089,14],[30337,14],[30426,14],[37623,14],[37712,14],[38318,14],[38407,14],[43933,14],[44022,14],[44263,14],[44352,14]]},"823":{"position":[[4625,14],[4714,14],[4950,14],[5039,14],[11903,14],[11992,14],[12227,14],[12316,14]]},"825":{"position":[[12566,14],[12655,14],[13328,14],[13417,14],[19639,14],[19728,14],[20193,14],[20282,14],[26337,14],[26426,14],[26941,14],[27030,14],[32832,14],[32921,14],[33458,14],[33547,14],[39009,14],[39098,14],[39579,14],[39668,14],[44828,14],[44917,14],[45381,14],[45470,14],[50546,14],[50635,14],[50868,14],[50957,14],[56277,14],[56366,14],[56614,14],[56703,14]]},"844":{"position":[[6457,14],[6546,14],[7001,14],[7090,14],[12042,14],[12131,14],[12370,14],[12459,14],[17861,14],[17950,14],[18401,14],[18490,14],[23372,14],[23461,14],[23696,14],[23785,14],[28998,14],[29087,14],[29324,14],[29413,14],[36212,14],[36301,14],[36536,14],[36625,14],[41834,14],[41923,14],[42159,14],[42248,14]]},"846":{"position":[[8243,14],[8332,14],[8984,14],[9073,14],[14850,14],[14939,14],[15178,14],[15267,14]]},"848":{"position":[[7434,14],[7523,14],[8064,14],[8153,14],[13775,14],[13864,14],[14106,14],[14195,14]]},"850":{"position":[[9077,14],[9166,14],[9795,14],[9884,14],[15449,14],[15538,14],[15781,14],[15870,14],[21215,14],[21304,14],[21549,14],[21638,14],[26920,14],[27009,14],[27256,14],[27345,14],[32704,14],[32793,14],[33038,14],[33127,14],[38401,14],[38490,14],[38735,14],[38824,14]]}}}],["fga_server_url/stores/$fga_store_id/author",{"_index":550,"t":{"37":{"position":[[7689,50]]}}}],["fga_server_url/stores/$fga_store_id/chang",{"_index":1580,"t":{"296":{"position":[[843,44],[2721,44]]},"298":{"position":[[1888,44],[3631,44]]}}}],["fga_server_url/stores/$fga_store_id/check",{"_index":866,"t":{"99":{"position":[[1287,42]]},"169":{"position":[[17271,42],[23465,42]]},"238":{"position":[[5097,42],[10851,42]]},"265":{"position":[[5347,42]]},"267":{"position":[[10767,42]]},"273":{"position":[[6382,42],[18064,42],[23676,42]]},"284":{"position":[[5145,42]]},"353":{"position":[[5241,42],[10846,42]]},"359":{"position":[[11536,42],[17350,42]]},"375":{"position":[[5310,42]]},"382":{"position":[[6205,42]]},"406":{"position":[[11987,42]]},"410":{"position":[[5081,42]]},"448":{"position":[[5210,42],[11052,42]]},"482":{"position":[[5256,42],[10885,42]]},"486":{"position":[[5221,42],[11020,42]]},"508":{"position":[[5283,42]]},"524":{"position":[[5395,42]]},"544":{"position":[[5353,42]]},"564":{"position":[[5021,42],[10535,42]]},"566":{"position":[[10600,42]]},"581":{"position":[[5230,42]]},"621":{"position":[[5232,42]]},"629":{"position":[[5121,42]]},"631":{"position":[[11165,42],[16813,42]]},"649":{"position":[[6366,42],[12538,42],[19374,42],[26196,42],[32437,42]]},"651":{"position":[[6344,42],[12608,42],[18942,42],[25265,42]]},"667":{"position":[[1453,42],[3294,42],[5143,42],[6994,42],[8841,42],[10694,42]]},"669":{"position":[[4036,42],[11921,42]]},"671":{"position":[[8992,42],[11668,42]]},"691":{"position":[[11911,42],[17906,42],[23602,42],[29223,42]]},"701":{"position":[[6063,42],[11676,42]]},"703":{"position":[[11086,42]]},"705":{"position":[[24003,42],[29656,42]]},"726":{"position":[[33250,42],[39014,42],[44646,42],[50293,42]]},"728":{"position":[[5297,42],[13196,42],[19158,42],[29595,42],[37798,42],[47358,42]]},"745":{"position":[[12517,42],[23848,42],[29479,42],[37208,42],[42834,42]]},"747":{"position":[[14686,42]]},"749":{"position":[[17439,42]]},"751":{"position":[[14908,42]]},"767":{"position":[[5412,42],[11120,42],[22740,42]]},"769":{"position":[[9507,42],[30814,42]]},"771":{"position":[[14353,42],[21284,42]]},"795":{"position":[[24080,42],[29769,42]]},"797":{"position":[[15423,42]]},"799":{"position":[[22577,42]]},"801":{"position":[[15294,42]]},"821":{"position":[[13078,42],[24746,42],[30524,42],[44450,42]]},"823":{"position":[[5137,42],[12414,42]]},"825":{"position":[[51055,42],[56801,42]]},"844":{"position":[[12557,42],[23883,42],[29511,42],[36723,42],[42346,42]]},"846":{"position":[[15365,42]]},"848":{"position":[[14293,42]]},"850":{"position":[[15968,42],[21736,42],[27443,42],[33225,42],[38922,42]]}}}],["fga_server_url/stores/$fga_store_id/expand",{"_index":2139,"t":{"595":{"position":[[5382,43],[11294,43]]}}}],["fga_server_url/stores/$fga_store_id/list",{"_index":1028,"t":{"125":{"position":[[1522,41]]},"169":{"position":[[30009,41]]},"600":{"position":[[5845,41]]}}}],["fga_server_url/stores/$fga_store_id/read",{"_index":2117,"t":{"588":{"position":[[5684,41],[11724,41],[17755,41]]},"590":{"position":[[5415,41]]},"705":{"position":[[5504,41]]}}}],["fga_server_url/stores/$fga_store_id/writ",{"_index":1507,"t":{"236":{"position":[[4872,42]]},"250":{"position":[[1365,42]]},"252":{"position":[[1488,42]]},"267":{"position":[[4875,42]]},"273":{"position":[[11972,42]]},"282":{"position":[[5132,42]]},"329":{"position":[[4943,42],[10530,42],[17140,42]]},"359":{"position":[[5375,42]]},"406":{"position":[[5740,42]]},"408":{"position":[[6082,42]]},"446":{"position":[[4982,42]]},"466":{"position":[[2447,42]]},"504":{"position":[[4901,42]]},"506":{"position":[[5222,42]]},"522":{"position":[[5294,42]]},"540":{"position":[[4918,42]]},"542":{"position":[[5558,42]]},"556":{"position":[[5280,42]]},"560":{"position":[[5271,42]]},"562":{"position":[[5011,42]]},"566":{"position":[[4864,42]]},"619":{"position":[[5610,42]]},"627":{"position":[[5809,42]]},"631":{"position":[[5157,42]]},"661":{"position":[[8062,42]]},"669":{"position":[[9794,42]]},"671":{"position":[[6299,42]]},"673":{"position":[[7601,42]]},"691":{"position":[[5760,42]]},"703":{"position":[[5165,42]]},"705":{"position":[[11597,42],[17865,42]]},"726":{"position":[[8745,42],[17989,42],[25846,42]]},"745":{"position":[[6631,42],[18005,42]]},"747":{"position":[[8153,42]]},"749":{"position":[[5201,42],[11569,42]]},"751":{"position":[[8217,42],[22208,42]]},"761":{"position":[[9717,42]]},"767":{"position":[[16883,42]]},"769":{"position":[[17018,42],[24503,42]]},"771":{"position":[[6922,42]]},"773":{"position":[[16093,42]]},"795":{"position":[[5313,42],[10977,42],[17391,42]]},"797":{"position":[[8768,42]]},"799":{"position":[[8067,42],[15530,42]]},"801":{"position":[[8589,42]]},"821":{"position":[[7105,42],[18816,42],[37810,42]]},"825":{"position":[[12753,42],[19826,42],[26524,42],[33019,42],[39196,42],[45015,42]]},"844":{"position":[[6644,42],[18048,42]]},"846":{"position":[[8430,42]]},"848":{"position":[[7621,42]]},"850":{"position":[[9264,42]]}}}],["fga_server_url=https://api.fga.exampl",{"_index":1423,"t":{"215":{"position":[[3044,38]]},"217":{"position":[[4173,38]]},"219":{"position":[[4734,38]]}}}],["fga_store_id",{"_index":432,"t":{"35":{"position":[[116,13],[262,12],[402,13],[548,12],[688,13],[834,12],[974,13],[1120,12],[1260,13],[1418,12],[1560,13],[1661,12]]},"93":{"position":[[116,13],[299,12],[439,13],[622,12],[762,13],[945,12],[1085,13],[1268,12],[1408,13],[1527,12],[1669,13],[1824,12]]},"105":{"position":[[95,13],[336,12],[459,13],[700,12]]},"119":{"position":[[116,13],[299,12],[439,13],[622,12],[762,13],[945,12],[1085,13],[1268,12],[1408,13],[1527,12],[1669,13],[1824,12]]},"244":{"position":[[116,13],[263,12],[403,13],[550,12],[690,13],[837,12],[977,13],[1124,12],[1264,13],[1383,12],[1525,13],[1644,12]]},"290":{"position":[[112,13],[294,12],[434,13],[616,12],[756,13],[903,12],[1043,13],[1190,12],[1330,13],[1484,12]]}}}],["fga_store_id=$(fga",{"_index":592,"t":{"43":{"position":[[3116,18]]}}}],["fga_store_id=your_store_id",{"_index":1425,"t":{"215":{"position":[[3136,26]]},"217":{"position":[[4265,26]]},"219":{"position":[[4826,26]]}}}],["fgaclient",{"_index":459,"t":{"37":{"position":[[991,9],[2163,10],[4583,9]]},"43":{"position":[[569,10],[2125,9]]},"97":{"position":[[264,9],[797,10],[2272,9]]},"113":{"position":[[1146,9],[4542,10]]},"123":{"position":[[264,9],[797,10],[2272,9]]},"169":{"position":[[12546,9],[13382,10],[15271,9],[18740,9],[19576,10],[21465,9],[25094,9],[25951,10],[27894,9]]},"215":{"position":[[808,10],[2211,9]]},"217":{"position":[[1297,10],[3114,9]]},"219":{"position":[[1322,10],[3504,9]]},"236":{"position":[[377,9],[1168,10],[3167,9]]},"238":{"position":[[387,9],[1220,10],[3106,9],[6131,9],[6966,10],[8854,9]]},"248":{"position":[[264,9],[797,10],[2272,9]]},"265":{"position":[[687,9],[1510,10],[3386,9]]},"267":{"position":[[398,9],[1184,10],[3178,9],[6102,9],[6926,10],[8803,9]]},"273":{"position":[[1692,9],[2521,10],[4403,9],[7330,9],[8158,10],[10194,9],[13354,9],[14187,10],[16073,9],[18956,9],[19791,10],[21679,9]]},"282":{"position":[[639,9],[1429,10],[3427,9]]},"284":{"position":[[430,9],[1264,10],[3151,9]]},"294":{"position":[[236,9],[769,10],[2244,9]]},"329":{"position":[[484,9],[1266,10],[3256,9],[6065,9],[6848,10],[8839,9],[11879,9],[12831,10],[15066,9]]},"353":{"position":[[526,9],[1360,10],[3247,9],[6136,9],[6969,10],[8855,9]]},"359":{"position":[[645,9],[1495,10],[3553,9],[6821,9],[7655,10],[9542,9],[12635,9],[13469,10],[15356,9]]},"375":{"position":[[560,9],[1401,10],[3295,9]]},"382":{"position":[[1505,9],[2336,10],[4220,9]]},"406":{"position":[[508,9],[1464,10],[3687,9],[7262,9],[8098,10],[9987,9]]},"408":{"position":[[410,9],[1476,10],[3809,9]]},"410":{"position":[[356,9],[1192,10],[3081,9]]},"446":{"position":[[439,9],[1242,10],[3253,9]]},"448":{"position":[[460,9],[1301,10],[3195,9],[6297,9],[7139,10],[9034,9]]},"482":{"position":[[526,9],[1363,10],[3253,9],[6160,9],[6996,10],[8885,9]]},"486":{"position":[[486,9],[1324,10],[3215,9],[6285,9],[7123,10],[9014,9]]},"504":{"position":[[414,9],[1203,10],[3200,9]]},"506":{"position":[[416,9],[1285,10],[3362,9]]},"508":{"position":[[533,9],[1374,10],[3268,9]]},"522":{"position":[[600,9],[1441,10],[3490,9]]},"524":{"position":[[665,9],[1502,10],[3392,9]]},"540":{"position":[[423,9],[1214,10],[3213,9]]},"542":{"position":[[756,9],[1624,10],[3700,9]]},"544":{"position":[[593,9],[1436,10],[3332,9]]},"556":{"position":[[502,9],[1344,10],[3453,9]]},"560":{"position":[[509,9],[1347,10],[3452,9]]},"562":{"position":[[520,9],[1310,10],[3308,9]]},"564":{"position":[[366,9],[1188,10],[3063,9],[5880,9],[6702,10],[8577,9]]},"566":{"position":[[403,9],[1185,10],[3175,9],[5940,9],[6763,10],[8639,9]]},"581":{"position":[[525,9],[1357,10],[3242,9]]},"588":{"position":[[775,9],[1652,10],[3634,9],[6931,9],[7789,10],[9732,9],[12912,9],[13780,10],[15733,9]]},"590":{"position":[[978,9],[1737,10],[3601,9]]},"595":{"position":[[516,9],[1387,10],[3338,9],[6428,9],[7299,10],[9250,9]]},"600":{"position":[[437,9],[1401,10],[3453,9]]},"619":{"position":[[652,9],[1559,10],[3674,9]]},"621":{"position":[[467,9],[1311,10],[3208,9]]},"627":{"position":[[377,9],[1383,10],[3656,9]]},"629":{"position":[[396,9],[1232,10],[3121,9]]},"631":{"position":[[377,9],[1239,10],[3309,9],[6435,9],[7272,10],[9162,9],[12068,9],[12908,10],[14801,9]]},"649":{"position":[[1656,9],[2489,10],[4375,9],[7828,9],[8661,10],[10547,9],[14649,9],[15485,10],[17374,9],[21486,9],[22319,10],[24205,9],[27722,9],[28556,10],[30443,9]]},"651":{"position":[[1629,9],[2463,10],[4350,9],[7878,9],[8715,10],[10605,9],[14222,9],[15057,10],[16945,9],[20545,9],[21380,10],[23268,9]]},"669":{"position":[[5028,9],[5887,10],[7954,9]]},"671":{"position":[[1419,9],[2306,10],[4401,9]]},"691":{"position":[[648,9],[1574,10],[3767,9],[7196,9],[8030,10],[9917,9],[13191,9],[14025,10],[15912,9],[18877,9],[19713,10],[21602,9],[24503,9],[25338,10],[27226,9]]},"701":{"position":[[1343,9],[2178,10],[4066,9],[6961,9],[7795,10],[9682,9]]},"703":{"position":[[467,9],[1309,10],[3359,9],[6351,9],[7189,10],[9080,9]]},"705":{"position":[[442,9],[1387,10],[3377,9],[6719,9],[7586,10],[9720,9],[12981,9],[13849,10],[15984,9],[19283,9],[20118,10],[22006,9],[24946,9],[25779,10],[27665,9]]},"726":{"position":[[481,9],[2117,10],[5256,9],[11799,9],[12975,10],[15477,9],[19936,9],[21042,10],[23474,9],[28535,9],[29369,10],[31256,9],[34294,9],[35129,10],[37017,9],[39911,9],[40749,10],[42640,9],[45553,9],[46392,10],[48284,9]]},"728":{"position":[[577,9],[1412,10],[3300,9],[8496,9],[9327,10],[11211,9],[14413,9],[15253,10],[17146,9],[24855,9],[25694,10],[27586,9],[33103,9],[33933,10],[35816,9],[42663,9],[43493,10],[45376,9]]},"745":{"position":[[2108,9],[2906,10],[4912,9],[7792,9],[8628,10],[10517,9],[13482,9],[14280,10],[16286,9],[19123,9],[19959,10],[21848,9],[24749,9],[25586,10],[27476,9],[32483,9],[33319,10],[35208,9],[38109,9],[38945,10],[40834,9]]},"747":{"position":[[2637,9],[3664,10],[5958,9],[9951,9],[10789,10],[12680,9]]},"749":{"position":[[582,9],[1404,10],[3434,9],[6823,9],[7677,10],[9739,9],[12714,9],[13550,10],[15439,9]]},"751":{"position":[[3279,9],[4161,10],[6310,9],[10163,9],[11003,10],[12896,9],[17597,9],[18417,10],[20445,9]]},"761":{"position":[[2885,9],[4202,10],[6904,9]]},"767":{"position":[[712,9],[1543,10],[3427,9],[6400,9],[7235,10],[9123,9],[12125,9],[12982,10],[15047,9],[18035,9],[18867,10],[20752,9]]},"769":{"position":[[4827,9],[5654,10],[7534,9],[10632,9],[11857,10],[14408,9],[19175,9],[20155,10],[22402,9],[26114,9],[26945,10],[28829,9]]},"771":{"position":[[1372,9],[2407,10],[4709,9],[8809,9],[9809,10],[11881,9],[15735,9],[16736,10],[18809,9]]},"773":{"position":[[3613,9],[6186,10],[10616,9]]},"795":{"position":[[794,9],[1591,10],[3596,9],[6442,9],[7243,10],[9252,9],[12126,9],[13070,10],[15340,9],[19360,9],[20195,10],[22083,9],[25059,9],[25892,10],[27778,9]]},"797":{"position":[[3212,9],[4209,10],[6591,9],[10688,9],[11526,10],[13417,9]]},"799":{"position":[[3117,9],[4002,10],[6154,9],[9642,9],[10722,10],[13187,9],[17872,9],[18704,10],[20589,9]]},"801":{"position":[[3312,9],[4259,10],[6532,9],[10564,9],[11401,10],[13291,9]]},"821":{"position":[[2351,9],[3207,10],[5271,9],[8328,9],[9169,10],[11063,9],[14062,9],[14918,10],[16982,9],[19996,9],[20837,10],[22731,9],[25739,9],[26587,10],[28488,9],[31900,9],[33006,10],[35438,9],[39700,9],[40541,10],[42435,9]]},"823":{"position":[[412,9],[1248,10],[3137,9],[7694,9],[8529,10],[10417,9]]},"825":{"position":[[7180,9],[8201,10],[10548,9],[14796,9],[15721,10],[17854,9],[21239,9],[22208,10],[24444,9],[28073,9],[28957,10],[31108,9],[34557,9],[35384,10],[37419,9],[40444,9],[41254,10],[43272,9],[46345,9],[47178,10],[49064,9],[52016,9],[52864,10],[54765,9]]},"844":{"position":[[2109,9],[2910,10],[4919,9],[7817,9],[8656,10],[10548,9],[13529,9],[14326,10],[16331,9],[19163,9],[19998,10],[21886,9],[24781,9],[25618,10],[27508,9],[32003,9],[32838,10],[34726,9],[37621,9],[38457,10],[40346,9]]},"846":{"position":[[2392,9],[3510,10],[6013,9],[10625,9],[11464,10],[13356,9]]},"848":{"position":[[2225,9],[3222,10],[5486,9],[9538,9],[10380,10],[12275,9]]},"850":{"position":[[3098,9],[4268,10],[6764,9],[11208,9],[12051,10],[13947,9],[16966,9],[17811,10],[19709,9],[22663,9],[23510,10],[25410,9],[28455,9],[29300,10],[31198,9],[34152,9],[34997,10],[36895,9]]}}}],["fgaclient.check",{"_index":852,"t":{"99":{"position":[[152,17]]},"113":{"position":[[1376,17]]},"169":{"position":[[12969,17],[19163,17]]},"238":{"position":[[810,17],[6554,17]]},"265":{"position":[[1110,17]]},"267":{"position":[[6525,17]]},"273":{"position":[[2115,17],[13777,17],[19379,17]]},"284":{"position":[[853,17]]},"353":{"position":[[949,17],[6559,17]]},"359":{"position":[[7244,17],[13058,17]]},"375":{"position":[[983,17]]},"382":{"position":[[1928,17]]},"406":{"position":[[7685,17]]},"410":{"position":[[779,17]]},"448":{"position":[[883,17],[6720,17]]},"482":{"position":[[949,17],[6583,17]]},"486":{"position":[[909,17],[6708,17]]},"508":{"position":[[956,17]]},"524":{"position":[[1088,17]]},"544":{"position":[[1016,17]]},"564":{"position":[[789,17],[6303,17]]},"566":{"position":[[6363,17]]},"581":{"position":[[948,17]]},"621":{"position":[[890,17]]},"629":{"position":[[819,17]]},"631":{"position":[[6858,17],[12491,17]]},"649":{"position":[[2079,17],[8251,17],[15072,17],[21909,17],[28145,17]]},"651":{"position":[[2052,17],[8301,17],[14645,17],[20968,17]]},"667":{"position":[[313,17],[2144,17],[4003,17],[5839,17],[7696,17],[9539,17]]},"669":{"position":[[2891,17],[10781,17]]},"671":{"position":[[7335,17],[10006,17]]},"691":{"position":[[7619,17],[13614,17],[19300,17],[24926,17]]},"701":{"position":[[1766,17],[7384,17]]},"703":{"position":[[6774,17]]},"705":{"position":[[19706,17],[25369,17]]},"726":{"position":[[28958,17],[34717,17],[40334,17],[45976,17]]},"728":{"position":[[1000,17],[8919,17],[14836,17],[25278,17],[33526,17],[43086,17]]},"745":{"position":[[8215,17],[19546,17],[25172,17],[32906,17],[38532,17]]},"747":{"position":[[10374,17]]},"749":{"position":[[13137,17]]},"751":{"position":[[10586,17]]},"767":{"position":[[1135,17],[6823,17],[18458,17]]},"769":{"position":[[5250,17],[26537,17]]},"771":{"position":[[9232,17],[16158,17]]},"795":{"position":[[19783,17],[25482,17]]},"797":{"position":[[11111,17]]},"799":{"position":[[18295,17]]},"801":{"position":[[10987,17]]},"821":{"position":[[8751,17],[20419,17],[26162,17],[40123,17]]},"823":{"position":[[835,17],[8117,17]]},"825":{"position":[[46768,17],[52439,17]]},"844":{"position":[[8240,17],[19586,17],[25204,17],[32426,17],[38044,17]]},"846":{"position":[[11048,17]]},"848":{"position":[[9961,17]]},"850":{"position":[[11631,17],[17389,17],[23086,17],[28878,17],[34575,17]]}}}],["fgaclient.check(bodi",{"_index":857,"t":{"99":{"position":[[846,21]]},"169":{"position":[[15551,21],[21745,21]]},"238":{"position":[[3383,21],[9132,21]]},"265":{"position":[[3653,21]]},"267":{"position":[[9070,21]]},"273":{"position":[[4675,21],[16350,21],[21957,21]]},"284":{"position":[[3428,21]]},"353":{"position":[[3525,21],[9132,21]]},"359":{"position":[[9819,21],[15634,21]]},"375":{"position":[[3580,21]]},"382":{"position":[[4495,21]]},"406":{"position":[[10267,21]]},"410":{"position":[[3361,21]]},"448":{"position":[[3480,21],[9319,21]]},"482":{"position":[[3534,21],[9165,21]]},"486":{"position":[[3497,21],[9295,21]]},"508":{"position":[[3553,21]]},"524":{"position":[[3673,21]]},"544":{"position":[[3619,21]]},"564":{"position":[[3329,21],[8843,21]]},"566":{"position":[[8905,21]]},"581":{"position":[[3518,21]]},"621":{"position":[[3496,21]]},"629":{"position":[[3401,21]]},"631":{"position":[[9442,21],[15085,21]]},"649":{"position":[[4652,21],[10824,21],[17654,21],[24482,21],[30721,21]]},"651":{"position":[[4627,21],[10885,21],[17223,21],[23547,21]]},"667":{"position":[[1010,21],[2847,21],[4700,21],[6544,21],[8395,21],[10244,21]]},"669":{"position":[[3590,21],[11478,21]]},"671":{"position":[[8377,21],[11050,21]]},"691":{"position":[[10195,21],[16189,21],[21882,21],[27505,21]]},"701":{"position":[[4345,21],[9960,21]]},"703":{"position":[[9362,21]]},"705":{"position":[[22285,21],[27941,21]]},"726":{"position":[[31534,21],[37295,21],[42922,21],[48567,21]]},"728":{"position":[[3574,21],[11485,21],[17429,21],[27869,21],[36090,21],[45650,21]]},"745":{"position":[[10797,21],[22128,21],[27756,21],[35488,21],[41114,21]]},"747":{"position":[[12962,21]]},"749":{"position":[[15719,21]]},"751":{"position":[[13175,21]]},"767":{"position":[[3702,21],[9402,21],[21027,21]]},"769":{"position":[[7804,21],[29104,21]]},"771":{"position":[[12357,21],[19285,21]]},"795":{"position":[[22362,21],[28054,21]]},"797":{"position":[[13699,21]]},"799":{"position":[[20865,21]]},"801":{"position":[[13571,21]]},"821":{"position":[[11348,21],[23016,21],[28779,21],[42720,21]]},"823":{"position":[[3416,21],[10696,21]]},"825":{"position":[[49340,21],[55057,21]]},"844":{"position":[[10831,21],[22165,21],[27788,21],[35005,21],[40626,21]]},"846":{"position":[[13639,21]]},"848":{"position":[[12556,21]]},"850":{"position":[[14234,21],[19997,21],[25701,21],[31486,21],[37183,21]]}}}],["fgaclient.check(context.background()).body(body).options(options).execut",{"_index":856,"t":{"99":{"position":[[522,75]]},"169":{"position":[[14167,75],[20361,75]]},"238":{"position":[[2002,75],[7749,75]]},"265":{"position":[[2282,75]]},"267":{"position":[[7698,75]]},"273":{"position":[[3298,75],[14969,75],[20574,75]]},"284":{"position":[[2046,75]]},"353":{"position":[[2143,75],[7751,75]]},"359":{"position":[[8437,75],[14252,75]]},"375":{"position":[[2191,75]]},"382":{"position":[[3116,75]]},"406":{"position":[[8883,75]]},"410":{"position":[[1977,75]]},"448":{"position":[[2091,75],[7929,75]]},"482":{"position":[[2149,75],[7781,75]]},"486":{"position":[[2111,75],[7909,75]]},"508":{"position":[[2164,75]]},"524":{"position":[[2288,75]]},"544":{"position":[[2228,75]]},"564":{"position":[[1959,75],[7473,75]]},"566":{"position":[[7534,75]]},"581":{"position":[[2138,75]]},"621":{"position":[[2104,75]]},"629":{"position":[[2017,75]]},"631":{"position":[[8057,75],[13697,75]]},"649":{"position":[[3271,75],[9443,75],[16270,75],[23101,75],[29339,75]]},"651":{"position":[[3245,75],[9500,75],[15840,75],[22164,75]]},"667":{"position":[[685,75],[2520,75],[4375,75],[6216,75],[8069,75],[9916,75]]},"669":{"position":[[3264,75],[11153,75]]},"671":{"position":[[7923,75],[10595,75]]},"691":{"position":[[8813,75],[14807,75],[20498,75],[26122,75]]},"701":{"position":[[2962,75],[8578,75]]},"703":{"position":[[7976,75]]},"705":{"position":[[20902,75],[26560,75]]},"726":{"position":[[30152,75],[35912,75],[41536,75],[47180,75]]},"728":{"position":[[2191,75],[10106,75],[16041,75],[26482,75],[34712,75],[44272,75]]},"745":{"position":[[9413,75],[20744,75],[26371,75],[34104,75],[39730,75]]},"747":{"position":[[11576,75]]},"749":{"position":[[14335,75]]},"751":{"position":[[11787,75]]},"767":{"position":[[2323,75],[8019,75],[19647,75]]},"769":{"position":[[6429,75],[27725,75]]},"771":{"position":[[10777,75],[17704,75]]},"795":{"position":[[20979,75],[26673,75]]},"797":{"position":[[12313,75]]},"799":{"position":[[19485,75]]},"801":{"position":[[12186,75]]},"821":{"position":[[9959,75],[21627,75],[27383,75],[41331,75]]},"823":{"position":[[2032,75],[9313,75]]},"825":{"position":[[47959,75],[53661,75]]},"844":{"position":[[9444,75],[20782,75],[26403,75],[33622,75],[39242,75]]},"846":{"position":[[12252,75]]},"848":{"position":[[11166,75]]},"850":{"position":[[12843,75],[18604,75],[24306,75],[30093,75],[35790,75]]}}}],["fgaclient.clientwriterequest",{"_index":1494,"t":{"236":{"position":[[1847,29]]},"250":{"position":[[370,29]]},"252":{"position":[[526,29]]},"267":{"position":[[1863,29]]},"273":{"position":[[8837,29]]},"282":{"position":[[2108,29]]},"329":{"position":[[1945,29],[7527,29],[13510,29]]},"359":{"position":[[2174,29]]},"406":{"position":[[2143,29]]},"408":{"position":[[2155,29]]},"446":{"position":[[1921,29]]},"466":{"position":[[1511,29]]},"504":{"position":[[1882,29]]},"506":{"position":[[1964,29]]},"522":{"position":[[2120,29]]},"540":{"position":[[1893,29]]},"542":{"position":[[2303,29]]},"556":{"position":[[2023,29]]},"560":{"position":[[2026,29]]},"562":{"position":[[1989,29]]},"566":{"position":[[1864,29]]},"619":{"position":[[2238,29]]},"627":{"position":[[2062,29]]},"631":{"position":[[1918,29]]},"661":{"position":[[4286,29]]},"669":{"position":[[6566,29]]},"671":{"position":[[2985,29]]},"673":{"position":[[3825,29]]},"691":{"position":[[2253,29]]},"703":{"position":[[1988,29]]},"705":{"position":[[8265,29],[14528,29]]},"726":{"position":[[2796,29],[13654,29],[21721,29]]},"745":{"position":[[3585,29],[14959,29]]},"747":{"position":[[4343,29]]},"749":{"position":[[2083,29],[8356,29]]},"751":{"position":[[4840,29],[19096,29]]},"761":{"position":[[4881,29]]},"767":{"position":[[13661,29]]},"769":{"position":[[12536,29],[20834,29]]},"771":{"position":[[3086,29]]},"773":{"position":[[6865,29]]},"795":{"position":[[2270,29],[7922,29],[13749,29]]},"797":{"position":[[4888,29]]},"799":{"position":[[4681,29],[11401,29]]},"801":{"position":[[4938,29]]},"821":{"position":[[3886,29],[15597,29],[33685,29]]},"825":{"position":[[8880,29],[16400,29],[22887,29],[29636,29],[36063,29],[41933,29]]},"844":{"position":[[3589,29],[15005,29]]},"846":{"position":[[4189,29]]},"848":{"position":[[3901,29]]},"850":{"position":[[4947,29]]}}}],["fgaclient.createstore(context.background()).body(clientcreatestorerequest{nam",{"_index":571,"t":{"43":{"position":[[1164,79]]}}}],["fgaclient.createstore(new",{"_index":575,"t":{"43":{"position":[[2189,25]]}}}],["fgaclient.expand",{"_index":2132,"t":{"595":{"position":[[921,18],[6833,18]]}}}],["fgaclient.expand(bodi",{"_index":2136,"t":{"595":{"position":[[3674,22],[9586,22]]}}}],["fgaclient.expand(context.background()).body(requestbody).options(options).execut",{"_index":2135,"t":{"595":{"position":[[2231,83],[8143,83]]}}}],["fgaclient.listobject",{"_index":1015,"t":{"125":{"position":[[129,23]]},"169":{"position":[[25499,23]]},"600":{"position":[[842,23]]}}}],["fgaclient.listobjects(bodi",{"_index":1025,"t":{"125":{"position":[[944,27]]},"169":{"position":[[28172,27]]},"600":{"position":[[3852,27]]}}}],["fgaclient.listobjects(context.background",{"_index":1021,"t":{"125":{"position":[[556,44]]},"169":{"position":[[26734,44]]},"600":{"position":[[2293,44]]}}}],["fgaclient.openfga.check(context.background()).body(body).execut",{"_index":1008,"t":{"113":{"position":[[5351,66]]}}}],["fgaclient.openfgaclient.writeauthorizationmodel(context.background()).body(body).execut",{"_index":502,"t":{"37":{"position":[[3394,90]]}}}],["fgaclient.read",{"_index":2099,"t":{"588":{"position":[[1200,16],[7356,16],[13337,16]]},"590":{"position":[[1403,16]]},"705":{"position":[[867,16]]}}}],["fgaclient.read(bodi",{"_index":2111,"t":{"588":{"position":[[3846,20],[9923,20],[15934,20]]},"590":{"position":[[3813,20]]},"705":{"position":[[3527,20]]}}}],["fgaclient.read(context.background()).body(requestbody).options(options).execut",{"_index":2110,"t":{"588":{"position":[[2407,81],[8505,81],[14506,81]]},"590":{"position":[[2492,81]]},"705":{"position":[[2026,81]]}}}],["fgaclient.readchang",{"_index":1572,"t":{"296":{"position":[[164,23],[1664,23]]},"298":{"position":[[1155,23],[2520,23]]}}}],["fgaclient.readchanges(bodi",{"_index":1577,"t":{"296":{"position":[[598,27],[2356,27]]},"298":{"position":[[1621,27],[3244,27]]}}}],["fgaclient.readchanges(context.background()).body(body).options(options).execut",{"_index":1576,"t":{"296":{"position":[[350,81],[1988,81]]},"298":{"position":[[1357,81],[2860,81]]}}}],["fgaclient.writ",{"_index":1492,"t":{"236":{"position":[[765,17]]},"250":{"position":[[99,17]]},"252":{"position":[[254,17]]},"267":{"position":[[786,17]]},"273":{"position":[[7718,17]]},"282":{"position":[[1027,17]]},"329":{"position":[[872,17],[6453,17],[12267,17]]},"359":{"position":[[1033,17]]},"406":{"position":[[896,17]]},"408":{"position":[[798,17]]},"446":{"position":[[827,17]]},"466":{"position":[[1223,17]]},"504":{"position":[[802,17]]},"506":{"position":[[804,17]]},"522":{"position":[[988,17]]},"540":{"position":[[811,17]]},"542":{"position":[[1144,17]]},"556":{"position":[[890,17]]},"560":{"position":[[897,17]]},"562":{"position":[[908,17]]},"566":{"position":[[791,17]]},"619":{"position":[[1040,17]]},"627":{"position":[[765,17]]},"631":{"position":[[765,17]]},"661":{"position":[[3207,17]]},"669":{"position":[[5416,17]]},"671":{"position":[[1807,17]]},"673":{"position":[[2746,17]]},"691":{"position":[[1036,17]]},"703":{"position":[[855,17]]},"705":{"position":[[7107,17],[13369,17]]},"726":{"position":[[869,17],[12187,17],[20324,17]]},"745":{"position":[[2496,17],[13870,17]]},"747":{"position":[[3025,17]]},"749":{"position":[[970,17],[7211,17]]},"751":{"position":[[3667,17],[17985,17]]},"761":{"position":[[3273,17]]},"767":{"position":[[12513,17]]},"769":{"position":[[11020,17],[19563,17]]},"771":{"position":[[1760,17]]},"773":{"position":[[4001,17]]},"795":{"position":[[1182,17],[6830,17],[12514,17]]},"797":{"position":[[3600,17]]},"799":{"position":[[3505,17],[10030,17]]},"801":{"position":[[3700,17]]},"821":{"position":[[2739,17],[14450,17],[32288,17]]},"825":{"position":[[7568,17],[15184,17],[21627,17],[28461,17],[34945,17],[40832,17]]},"844":{"position":[[2497,17],[13917,17]]},"846":{"position":[[2780,17]]},"848":{"position":[[2613,17]]},"850":{"position":[[3486,17]]}}}],["fgaclient.write(bodi",{"_index":1502,"t":{"236":{"position":[[3498,21]]},"250":{"position":[[965,21]]},"252":{"position":[[1123,21]]},"267":{"position":[[3504,21]]},"273":{"position":[[10562,21]]},"282":{"position":[[3757,21]]},"329":{"position":[[3578,21],[9162,21],[15595,21]]},"359":{"position":[[3943,21]]},"406":{"position":[[4193,21]]},"408":{"position":[[4425,21]]},"446":{"position":[[3596,21]]},"466":{"position":[[2140,21]]},"504":{"position":[[3529,21]]},"506":{"position":[[3771,21]]},"522":{"position":[[3871,21]]},"540":{"position":[[3544,21]]},"542":{"position":[[4108,21]]},"556":{"position":[[3845,21]]},"560":{"position":[[3840,21]]},"562":{"position":[[3638,21]]},"566":{"position":[[3497,21]]},"619":{"position":[[4121,21]]},"627":{"position":[[4212,21]]},"631":{"position":[[3711,21]]},"661":{"position":[[6911,21]]},"669":{"position":[[8353,21]]},"671":{"position":[[4828,21]]},"673":{"position":[[6450,21]]},"691":{"position":[[4243,21]]},"703":{"position":[[3741,21]]},"705":{"position":[[10137,21],[16402,21]]},"726":{"position":[[6482,21],[16213,21],[24140,21]]},"745":{"position":[[5250,21],[16624,21]]},"747":{"position":[[6535,21]]},"749":{"position":[[3796,21],[10133,21]]},"751":{"position":[[6742,21],[20805,21]]},"761":{"position":[[7791,21]]},"767":{"position":[[15444,21]]},"769":{"position":[[15193,21],[22932,21]]},"771":{"position":[[5294,21]]},"773":{"position":[[12839,21]]},"795":{"position":[[3933,21],[9593,21],[15844,21]]},"797":{"position":[[7158,21]]},"799":{"position":[[6589,21],[13837,21]]},"801":{"position":[[7039,21]]},"821":{"position":[[5667,21],[17378,21],[36104,21]]},"825":{"position":[[11129,21],[18319,21],[24963,21],[31542,21],[37786,21],[43622,21]]},"844":{"position":[[5260,21],[16668,21]]},"846":{"position":[[6701,21]]},"848":{"position":[[6033,21]]},"850":{"position":[[7494,21]]}}}],["fgaclient.write(context.background()).body(requestbody).options(options).execut",{"_index":1499,"t":{"236":{"position":[[2047,82]]},"250":{"position":[[567,82]]},"252":{"position":[[724,82]]},"267":{"position":[[2058,82]]},"273":{"position":[[9074,82]]},"282":{"position":[[2307,82]]},"329":{"position":[[2136,82],[7719,82],[13946,82]]},"359":{"position":[[2433,82]]},"406":{"position":[[2567,82]]},"408":{"position":[[2689,82]]},"446":{"position":[[2133,82]]},"466":{"position":[[1725,82]]},"504":{"position":[[2080,82]]},"506":{"position":[[2242,82]]},"522":{"position":[[2370,82]]},"540":{"position":[[2093,82]]},"542":{"position":[[2580,82]]},"556":{"position":[[2333,82]]},"560":{"position":[[2332,82]]},"562":{"position":[[2188,82]]},"566":{"position":[[2055,82]]},"619":{"position":[[2554,82]]},"627":{"position":[[2536,82]]},"631":{"position":[[2189,82]]},"661":{"position":[[5645,82]]},"669":{"position":[[6834,82]]},"671":{"position":[[3281,82]]},"673":{"position":[[5184,82]]},"691":{"position":[[2647,82]]},"703":{"position":[[2239,82]]},"705":{"position":[[8600,82],[14864,82]]},"726":{"position":[[4136,82],[14357,82],[22354,82]]},"745":{"position":[[3792,82],[15166,82]]},"747":{"position":[[4838,82]]},"749":{"position":[[2314,82],[8619,82]]},"751":{"position":[[5190,82],[19325,82]]},"761":{"position":[[5784,82]]},"767":{"position":[[13927,82]]},"769":{"position":[[13288,82],[21282,82]]},"771":{"position":[[3589,82]]},"773":{"position":[[9496,82]]},"795":{"position":[[2476,82],[8132,82],[14220,82]]},"797":{"position":[[5471,82]]},"799":{"position":[[5034,82],[12067,82]]},"801":{"position":[[5412,82]]},"821":{"position":[[4151,82],[15862,82],[34318,82]]},"825":{"position":[[9428,82],[16734,82],[23324,82],[29988,82],[36299,82],[42152,82]]},"844":{"position":[[3799,82],[15211,82]]},"846":{"position":[[4893,82]]},"848":{"position":[[4366,82]]},"850":{"position":[[5644,82]]}}}],["fgaclient.writeauthorizationmodel",{"_index":478,"t":{"37":{"position":[[1418,35]]}}}],["fgaclient.writeauthorizationmodel(bodi",{"_index":522,"t":{"37":{"position":[[5190,40]]}}}],["fiber",{"_index":870,"t":{"103":{"position":[[93,6]]},"109":{"position":[[973,5],[1089,5]]}}}],["fiber.ctx",{"_index":907,"t":{"109":{"position":[[1535,11]]},"111":{"position":[[2367,11]]},"113":{"position":[[3677,11],[3887,11],[4522,11]]}}}],["fiber.new",{"_index":903,"t":{"109":{"position":[[1456,11]]},"111":{"position":[[1967,11]]},"113":{"position":[[3208,11]]}}}],["fiber.newerror(fiber.statusserviceunavail",{"_index":1003,"t":{"113":{"position":[[5110,46],[5441,46]]}}}],["fiber.newerror(fiber.statusunauthor",{"_index":1010,"t":{"113":{"position":[[5556,40]]}}}],["field",{"_index":766,"t":{"71":{"position":[[258,5],[365,5]]},"99":{"position":[[1658,5]]},"145":{"position":[[3074,6]]},"169":{"position":[[32211,6]]},"452":{"position":[[439,5],[861,5]]},"522":{"position":[[6287,6],[6379,6],[6635,6]]},"831":{"position":[[908,5]]}}}],["figur",{"_index":1857,"t":{"426":{"position":[[1890,6]]},"728":{"position":[[22787,6]]}}}],["file",{"_index":194,"t":{"7":{"position":[[721,4]]},"109":{"position":[[536,4]]},"143":{"position":[[56,5],[228,4],[734,5]]},"145":{"position":[[1556,4],[4203,4]]},"147":{"position":[[578,4],[635,4],[1355,5],[2012,4],[2069,4],[2880,5]]},"157":{"position":[[199,4]]},"225":{"position":[[502,4]]},"300":{"position":[[407,6]]},"528":{"position":[[520,4]]},"837":{"position":[[61,5]]},"846":{"position":[[35,4]]},"848":{"position":[[51,6]]},"850":{"position":[[50,4]]}}}],["filter",{"_index":232,"t":{"9":{"position":[[991,6]]},"300":{"position":[[286,6],[502,9],[651,7]]},"304":{"position":[[4,7],[46,6],[148,6],[212,8]]},"306":{"position":[[586,6]]},"308":{"position":[[96,6],[314,8]]},"310":{"position":[[1336,6]]},"462":{"position":[[2052,6]]},"598":{"position":[[247,9]]},"604":{"position":[[435,6]]},"705":{"position":[[6253,6]]}}}],["final",{"_index":937,"t":{"111":{"position":[[1097,8]]},"113":{"position":[[1960,8]]},"145":{"position":[[1272,8],[2835,7],[3939,8],[5463,7]]},"310":{"position":[[748,5]]},"386":{"position":[[770,5]]},"402":{"position":[[873,8]]},"673":{"position":[[0,5]]},"705":{"position":[[12643,8]]},"773":{"position":[[0,5]]},"799":{"position":[[17345,9]]}}}],["find",{"_index":798,"t":{"77":{"position":[[85,4],[213,4]]},"386":{"position":[[1248,7],[1427,5]]},"422":{"position":[[156,4]]},"460":{"position":[[3254,4]]},"602":{"position":[[347,7]]},"728":{"position":[[6576,4],[30249,4]]},"795":{"position":[[18897,4]]},"801":{"position":[[2823,4]]}}}],["fine",{"_index":253,"t":{"13":{"position":[[37,4]]},"15":{"position":[[38,4]]},"19":{"position":[[0,4]]},"115":{"position":[[173,4]]},"131":{"position":[[391,4]]},"300":{"position":[[19,4]]},"677":{"position":[[1108,4],[1432,4]]},"803":{"position":[[37,4]]},"827":{"position":[[201,4],[672,4]]}}}],["finish",{"_index":1817,"t":{"422":{"position":[[1945,9]]},"430":{"position":[[137,9]]}}}],["first",{"_index":747,"t":{"67":{"position":[[176,5]]},"109":{"position":[[4,5]]},"113":{"position":[[11,6]]},"145":{"position":[[539,5],[3322,5]]},"147":{"position":[[1763,5]]},"207":{"position":[[270,5]]},"213":{"position":[[76,5]]},"294":{"position":[[0,5]]},"310":{"position":[[3647,5]]},"355":{"position":[[61,5]]},"359":{"position":[[18228,5]]},"375":{"position":[[6081,5]]},"414":{"position":[[91,6]]},"422":{"position":[[2096,7],[2142,6]]},"448":{"position":[[11834,5]]},"484":{"position":[[4,5]]},"504":{"position":[[5822,5]]},"514":{"position":[[1739,5]]},"544":{"position":[[6319,5]]},"595":{"position":[[212,5]]},"617":{"position":[[61,5]]},"621":{"position":[[6432,5]]},"671":{"position":[[991,6]]},"691":{"position":[[30374,5]]},"713":{"position":[[813,5]]},"726":{"position":[[28053,6]]},"745":{"position":[[30093,5]]},"771":{"position":[[544,5],[902,6]]},"781":{"position":[[856,5]]},"795":{"position":[[396,5],[18881,6]]},"801":{"position":[[2517,6]]},"825":{"position":[[45976,6]]},"844":{"position":[[30125,5]]},"850":{"position":[[440,6]]}}}],["fit",{"_index":1628,"t":{"312":{"position":[[461,3]]},"390":{"position":[[272,3]]}}}],["five",{"_index":639,"t":{"47":{"position":[[3939,4]]}}}],["flag",{"_index":1091,"t":{"133":{"position":[[545,4]]},"151":{"position":[[272,5],[529,5]]},"155":{"position":[[112,4],[433,6],[503,4],[1083,5],[1254,5]]},"159":{"position":[[316,4],[539,4]]},"161":{"position":[[315,4],[463,4],[616,4]]},"163":{"position":[[90,6]]},"468":{"position":[[302,4],[597,4],[1146,5]]}}}],["flatten",{"_index":722,"t":{"61":{"position":[[120,10]]}}}],["flatten/expand",{"_index":1601,"t":{"306":{"position":[[229,14]]}}}],["flattened/expand",{"_index":1603,"t":{"306":{"position":[[452,18]]}}}],["flexibl",{"_index":36,"t":{"3":{"position":[[501,8]]},"380":{"position":[[334,11]]}}}],["flight",{"_index":1125,"t":{"133":{"position":[[2500,6]]}}}],["flow",{"_index":1447,"t":{"219":{"position":[[64,5]]},"625":{"position":[[1923,4]]}}}],["focu",{"_index":1866,"t":{"426":{"position":[[3223,5]]},"434":{"position":[[29,5]]},"717":{"position":[[716,5]]},"738":{"position":[[295,5]]},"793":{"position":[[341,5]]},"795":{"position":[[402,5]]},"813":{"position":[[678,5]]},"815":{"position":[[19,5]]},"821":{"position":[[26,5]]},"837":{"position":[[339,5]]},"844":{"position":[[25,5]]}}}],["focus",{"_index":2383,"t":{"719":{"position":[[58,8],[273,8]]},"740":{"position":[[95,8]]},"839":{"position":[[101,8]]}}}],["folder",{"_index":32,"t":{"3":{"position":[[462,7],[696,8]]},"19":{"position":[[429,8]]},"23":{"position":[[188,7]]},"47":{"position":[[225,6],[353,8],[648,8],[1054,9],[2116,8],[3438,8],[3765,6],[3892,6]]},"53":{"position":[[326,6],[426,8],[565,9],[722,9],[1129,8],[1421,7],[2054,6],[2103,6],[2124,6],[2290,6],[2884,7],[2929,7]]},"61":{"position":[[804,6],[2663,7],[2688,6]]},"223":{"position":[[455,6]]},"298":{"position":[[136,6],[487,9],[1012,7],[1092,9],[1332,9],[1525,8],[1868,6],[2085,8],[2361,9],[2835,9],[3028,8],[3611,6],[3828,8]]},"310":{"position":[[2818,7]]},"316":{"position":[[555,7]]},"420":{"position":[[1437,6],[1525,6],[1561,7],[1573,6],[1631,6],[1643,6],[1679,7],[1700,6],[1732,7],[1976,6],[2060,7],[2506,6],[2541,7],[2721,6],[2757,7],[2807,6],[2821,7],[2856,7]]},"422":{"position":[[416,6],[574,6],[662,6],[698,7],[726,6],[738,6],[774,7],[1018,6],[1102,7],[1546,6],[1581,7],[1761,6],[1797,7],[1847,6],[1861,7],[1896,7],[2318,6],[2406,6],[2442,7],[2454,6],[2512,6],[2524,6],[2560,7],[2581,6],[2613,6],[2858,6],[2942,7],[3388,6],[3423,7],[3603,6],[3639,7],[3689,6],[3703,7],[3738,7],[3969,6],[4150,6]]},"424":{"position":[[809,6],[897,6],[933,7],[945,6],[1003,6],[1015,6],[1051,7],[1072,6],[1104,7],[1348,6],[1432,7],[1878,6],[1913,7],[2093,6],[2129,7],[2179,6],[2193,7],[2228,7],[2341,6],[3044,6]]},"426":{"position":[[2204,6],[5459,6],[5673,8],[5789,6],[6154,8],[6294,6],[6608,7],[7169,6],[7900,6],[9387,8],[9980,8]]},"428":{"position":[[1386,6]]},"430":{"position":[[51,6]]},"456":{"position":[[174,6],[525,6],[665,6],[1596,6],[1628,8],[1720,8],[2071,9],[2401,8],[2909,8]]},"460":{"position":[[439,7],[849,7],[938,6],[1049,8],[1416,6],[1448,8],[1554,8],[1882,9],[2212,8],[2763,8],[3155,6],[3369,6]]},"466":{"position":[[913,6]]},"474":{"position":[[2492,7]]},"476":{"position":[[80,7]]},"490":{"position":[[194,6],[239,6]]},"492":{"position":[[228,6],[369,6],[533,9]]},"498":{"position":[[23,7],[98,7],[149,7],[174,6],[303,6],[408,6]]},"500":{"position":[[37,6],[210,6],[351,6],[429,8],[539,9],[871,8]]},"502":{"position":[[37,6],[155,6],[233,8],[365,9],[836,8],[1141,6]]},"506":{"position":[[845,6],[2036,6],[3603,6],[4844,6],[5909,6]]},"508":{"position":[[6250,6]]},"510":{"position":[[245,7],[309,7]]},"608":{"position":[[127,6]]},"610":{"position":[[255,6],[393,6],[680,9]]},"617":{"position":[[20,6],[214,8],[250,6],[533,8],[634,9]]},"619":{"position":[[82,6],[1129,8],[2358,8],[3963,8],[5242,8],[6343,8]]},"831":{"position":[[1256,6],[1304,7]]},"833":{"position":[[671,6]]},"837":{"position":[[71,8]]},"839":{"position":[[275,7],[346,6],[401,6],[422,7]]},"841":{"position":[[351,7]]},"848":{"position":[[39,7],[83,7],[290,6]]},"850":{"position":[[58,6]]}}}],["folder#view",{"_index":685,"t":{"53":{"position":[[365,14]]}}}],["folder,folder#par",{"_index":1963,"t":{"466":{"position":[[945,22]]}}}],["folder/dr",{"_index":1811,"t":{"420":{"position":[[1908,12],[2190,12],[2344,12]]},"422":{"position":[[950,12],[1230,12],[1384,12],[2790,12],[3072,12],[3226,12]]},"424":{"position":[[1280,12],[1562,12],[1716,12]]},"426":{"position":[[8245,12],[8628,12]]}}}],["folder:budget",{"_index":2168,"t":{"619":{"position":[[184,14],[1177,17],[4018,17],[6228,14]]},"621":{"position":[[121,14],[914,17],[2016,17],[3397,17],[4966,14],[5614,17],[5653,16],[5980,14],[6119,14]]}}}],["folder:not",{"_index":2009,"t":{"498":{"position":[[527,13],[626,12],[688,12]]},"504":{"position":[[108,12],[878,16],[3485,14],[5518,12]]},"506":{"position":[[29,13],[68,12],[902,15],[3667,15],[5841,12]]},"508":{"position":[[6160,12],[6173,12]]}}}],["folder:plan",{"_index":689,"t":{"53":{"position":[[2169,18],[2352,18]]},"466":{"position":[[1312,19],[2093,17],[2915,15]]}}}],["folder:planning#editor",{"_index":1386,"t":{"169":{"position":[[8446,22],[8967,22]]}}}],["folder:product\",\"relation\":\"viewer\",\"object\":\"document:roadmap",{"_index":1387,"t":{"169":{"position":[[8507,65]]}}}],["folder:product#par",{"_index":1964,"t":{"466":{"position":[[1259,24],[2038,24],[2886,21]]}}}],["folder:sal",{"_index":1926,"t":{"456":{"position":[[542,15],[736,15]]},"460":{"position":[[176,15],[513,15],[3226,15]]}}}],["folder:{id",{"_index":1876,"t":{"426":{"position":[[6368,14]]}}}],["folder’",{"_index":1942,"t":{"460":{"position":[[1152,8]]}}}],["follow",{"_index":80,"t":{"3":{"position":[[1251,9],[1748,9],[1962,9],[2411,9]]},"7":{"position":[[291,9]]},"9":{"position":[[448,9]]},"29":{"position":[[4,9]]},"37":{"position":[[54,9]]},"39":{"position":[[19,9]]},"49":{"position":[[1910,9]]},"51":{"position":[[1405,9]]},"53":{"position":[[1981,9]]},"55":{"position":[[598,9]]},"57":{"position":[[675,9],[1526,9]]},"59":{"position":[[913,9],[1561,9]]},"61":{"position":[[1784,10]]},"63":{"position":[[10,9]]},"73":{"position":[[976,10]]},"101":{"position":[[19,9]]},"109":{"position":[[155,9],[1022,9]]},"115":{"position":[[19,9]]},"127":{"position":[[19,9]]},"129":{"position":[[4,9]]},"133":{"position":[[65,8],[474,9]]},"135":{"position":[[10,9]]},"141":{"position":[[58,6]]},"143":{"position":[[789,8]]},"147":{"position":[[1400,9],[2920,9]]},"155":{"position":[[389,9]]},"163":{"position":[[80,9]]},"165":{"position":[[10,9]]},"167":{"position":[[0,6]]},"169":{"position":[[3037,7],[5814,10],[7714,9],[10468,9],[11308,9],[11809,9],[12128,9],[18353,9],[24688,9],[31948,9]]},"203":{"position":[[10,9]]},"205":{"position":[[4,9]]},"207":{"position":[[319,6]]},"209":{"position":[[228,9]]},"211":{"position":[[10,9]]},"213":{"position":[[133,9]]},"219":{"position":[[164,6]]},"225":{"position":[[478,9]]},"227":{"position":[[177,9],[932,10]]},"240":{"position":[[10,9]]},"254":{"position":[[10,9]]},"258":{"position":[[177,9],[617,10]]},"265":{"position":[[118,8]]},"269":{"position":[[10,9]]},"273":{"position":[[177,9],[1035,9]]},"286":{"position":[[10,9]]},"298":{"position":[[21,9]]},"310":{"position":[[67,9],[296,9]]},"320":{"position":[[177,9],[311,8],[469,9],[784,10],[841,11],[931,11],[1124,10]]},"329":{"position":[[11579,10],[12305,9],[13579,9],[15304,9],[16665,9],[17593,9]]},"331":{"position":[[137,9],[185,9],[242,8],[295,11],[346,8]]},"333":{"position":[[10,9]]},"335":{"position":[[170,6]]},"345":{"position":[[415,9]]},"347":{"position":[[1079,9],[1562,10]]},"361":{"position":[[10,9]]},"365":{"position":[[875,9],[1064,10]]},"373":{"position":[[155,10]]},"375":{"position":[[256,10],[6138,6]]},"377":{"position":[[10,9]]},"382":{"position":[[12,9],[665,9]]},"384":{"position":[[12,9]]},"386":{"position":[[916,9]]},"388":{"position":[[8,9]]},"392":{"position":[[350,9],[1063,10]]},"402":{"position":[[1027,9]]},"406":{"position":[[206,8],[6943,9]]},"412":{"position":[[10,9]]},"422":{"position":[[4623,9]]},"426":{"position":[[2458,9],[4978,9],[6963,9],[7241,9],[8089,9],[8358,9],[8476,9],[8741,9],[8866,9],[9048,9]]},"428":{"position":[[2366,6],[3725,6]]},"432":{"position":[[10,9]]},"440":{"position":[[177,9],[760,10]]},"446":{"position":[[135,10]]},"448":{"position":[[106,10],[5857,10],[11891,6]]},"450":{"position":[[10,9]]},"454":{"position":[[225,9]]},"456":{"position":[[14,9]]},"460":{"position":[[26,9],[3073,9]]},"470":{"position":[[11,9]]},"474":{"position":[[1523,9],[2370,10]]},"488":{"position":[[10,9]]},"492":{"position":[[177,9],[901,10]]},"500":{"position":[[112,9]]},"502":{"position":[[103,10]]},"504":{"position":[[5874,6]]},"508":{"position":[[175,9]]},"510":{"position":[[10,9]]},"514":{"position":[[177,9],[671,10],[1796,6]]},"522":{"position":[[6298,9],[6646,9]]},"526":{"position":[[10,9]]},"528":{"position":[[496,9]]},"530":{"position":[[177,9],[648,10]]},"538":{"position":[[119,9]]},"542":{"position":[[350,9]]},"544":{"position":[[289,10],[6376,6]]},"546":{"position":[[10,9]]},"550":{"position":[[177,9],[601,10]]},"558":{"position":[[66,8]]},"560":{"position":[[94,9]]},"568":{"position":[[10,9]]},"572":{"position":[[177,9],[1072,10]]},"583":{"position":[[124,9]]},"588":{"position":[[6622,9],[12603,9]]},"590":{"position":[[456,9]]},"600":{"position":[[6641,9]]},"610":{"position":[[10,6],[879,10]]},"621":{"position":[[106,10],[6489,6]]},"625":{"position":[[1755,9]]},"627":{"position":[[53,9]]},"633":{"position":[[10,9]]},"637":{"position":[[158,10]]},"649":{"position":[[20453,9]]},"653":{"position":[[10,9]]},"657":{"position":[[3,6]]},"661":{"position":[[58,9],[834,9],[3127,9]]},"667":{"position":[[187,9]]},"669":{"position":[[2790,9]]},"671":{"position":[[9660,9],[12337,9],[12536,9]]},"675":{"position":[[10,9]]},"679":{"position":[[177,9],[760,10]]},"687":{"position":[[59,10]]},"689":{"position":[[56,10],[731,10]]},"691":{"position":[[12552,9],[12881,9],[29887,9],[30431,6]]},"693":{"position":[[10,9]]},"697":{"position":[[45,9]]},"699":{"position":[[237,9]]},"709":{"position":[[11,9]]},"721":{"position":[[8,9]]},"726":{"position":[[179,8],[11497,8],[19634,8],[27694,7]]},"728":{"position":[[8134,9],[24479,9],[32748,9],[38933,9],[40018,9],[40261,9]]},"742":{"position":[[18,9]]},"745":{"position":[[113,9],[251,9]]},"747":{"position":[[192,9],[2313,9]]},"749":{"position":[[6366,8],[18089,9]]},"751":{"position":[[439,9],[16807,10]]},"757":{"position":[[3,6]]},"761":{"position":[[58,9],[492,9],[2561,9]]},"767":{"position":[[298,9]]},"769":{"position":[[4517,9],[18831,9]]},"771":{"position":[[15101,9],[22033,9]]},"777":{"position":[[10,9]]},"789":{"position":[[8,9],[119,9],[182,9],[662,7]]},"799":{"position":[[9307,9],[23189,9]]},"801":{"position":[[20,9],[2988,9]]},"815":{"position":[[32,9]]},"817":{"position":[[8,9],[119,9],[199,9],[1113,7]]},"821":{"position":[[197,9],[537,9],[45097,11]]},"823":{"position":[[6172,9]]},"825":{"position":[[1588,9],[2776,9],[14473,9],[57465,9]]},"841":{"position":[[18,9]]},"844":{"position":[[200,9],[336,9],[31506,10]]},"846":{"position":[[170,9]]},"848":{"position":[[243,9],[1902,9],[16266,10]]},"850":{"position":[[2774,9]]},"852":{"position":[[19,9]]}}}],["followed_bi",{"_index":1639,"t":{"320":{"position":[[324,11],[493,12],[869,14],[1002,14]]},"331":{"position":[[399,14]]}}}],["fore",{"_index":2745,"t":{"795":{"position":[[30402,4]]}}}],["foreign",{"_index":1829,"t":{"424":{"position":[[483,7]]}}}],["forget",{"_index":1789,"t":{"416":{"position":[[81,6]]}}}],["form",{"_index":682,"t":{"53":{"position":[[8,4]]},"386":{"position":[[855,4]]},"426":{"position":[[1335,5],[1448,4]]},"428":{"position":[[865,6]]},"508":{"position":[[6581,4]]},"619":{"position":[[335,4]]},"825":{"position":[[14461,4]]}}}],["format",{"_index":642,"t":{"49":{"position":[[177,8]]},"159":{"position":[[55,6]]},"161":{"position":[[51,7]]},"163":{"position":[[103,7],[124,7],[163,7]]},"422":{"position":[[2088,7]]},"426":{"position":[[4050,6]]},"462":{"position":[[1774,7],[2462,7]]},"542":{"position":[[55,7]]},"747":{"position":[[9526,9]]},"846":{"position":[[10194,9]]}}}],["former",{"_index":2184,"t":{"625":{"position":[[1702,6]]}}}],["forth",{"_index":2493,"t":{"740":{"position":[[336,6]]}}}],["forward",{"_index":2482,"t":{"728":{"position":[[22382,7]]}}}],["found",{"_index":2155,"t":{"602":{"position":[[36,5]]},"649":{"position":[[20397,6]]},"751":{"position":[[15561,5]]},"848":{"position":[[14952,5]]}}}],["four",{"_index":635,"t":{"47":{"position":[[3728,4]]},"169":{"position":[[7343,4]]},"821":{"position":[[92,4]]},"844":{"position":[[106,4]]}}}],["fp",{"_index":912,"t":{"111":{"position":[[252,2]]},"113":{"position":[[223,2],[846,2]]}}}],["fp(async",{"_index":914,"t":{"111":{"position":[[301,8]]},"113":{"position":[[272,8],[998,8]]}}}],["framework",{"_index":420,"t":{"31":{"position":[[829,9],[877,10]]},"103":{"position":[[63,10]]},"107":{"position":[[74,10]]},"109":{"position":[[33,10],[112,10],[213,9],[564,9],[979,10],[1095,9]]}}}],["fred",{"_index":2231,"t":{"651":{"position":[[1093,4],[1253,4],[7020,4]]}}}],["free",{"_index":2384,"t":{"719":{"position":[[107,7],[361,4],[398,4]]},"721":{"position":[[178,4]]},"726":{"position":[[904,4],[2862,4],[5491,4],[7549,4],[10451,4],[12275,4],[13773,4],[15765,4],[17333,4],[19113,4]]}}}],["frequent",{"_index":1046,"t":{"131":{"position":[[495,11],[1633,11]]},"404":{"position":[[59,11]]}}}],["friend",{"_index":1824,"t":{"422":{"position":[[4533,6],[4736,7]]}}}],["friendli",{"_index":559,"t":{"37":{"position":[[8430,8]]}}}],["frontend",{"_index":2382,"t":{"717":{"position":[[455,8]]}}}],["full",{"_index":2130,"t":{"593":{"position":[[187,4]]},"799":{"position":[[740,4]]}}}],["func",{"_index":483,"t":{"37":{"position":[[2065,4]]},"43":{"position":[[555,4]]},"77":{"position":[[403,4]]},"97":{"position":[[699,4]]},"109":{"position":[[1435,4],[1523,4]]},"111":{"position":[[1946,4],[2355,4]]},"113":{"position":[[3187,4],[3665,4],[3867,4],[4496,4]]},"123":{"position":[[699,4]]},"169":{"position":[[13284,4],[19478,4],[25853,4]]},"215":{"position":[[794,4]]},"217":{"position":[[1283,4]]},"219":{"position":[[1308,4]]},"236":{"position":[[1070,4]]},"238":{"position":[[1122,4],[6868,4]]},"248":{"position":[[699,4]]},"265":{"position":[[1412,4]]},"267":{"position":[[1086,4],[6828,4]]},"273":{"position":[[2423,4],[8060,4],[14089,4],[19693,4]]},"282":{"position":[[1331,4]]},"284":{"position":[[1166,4]]},"294":{"position":[[671,4]]},"329":{"position":[[1168,4],[6750,4],[12733,4]]},"353":{"position":[[1262,4],[6871,4]]},"359":{"position":[[1397,4],[7557,4],[13371,4]]},"375":{"position":[[1303,4]]},"382":{"position":[[2238,4]]},"406":{"position":[[1366,4],[8000,4]]},"408":{"position":[[1378,4]]},"410":{"position":[[1094,4]]},"446":{"position":[[1144,4]]},"448":{"position":[[1203,4],[7041,4]]},"482":{"position":[[1265,4],[6898,4]]},"486":{"position":[[1226,4],[7025,4]]},"504":{"position":[[1105,4]]},"506":{"position":[[1187,4]]},"508":{"position":[[1276,4]]},"522":{"position":[[1343,4]]},"524":{"position":[[1404,4]]},"540":{"position":[[1116,4]]},"542":{"position":[[1526,4]]},"544":{"position":[[1338,4]]},"556":{"position":[[1246,4]]},"560":{"position":[[1249,4]]},"562":{"position":[[1212,4]]},"564":{"position":[[1090,4],[6604,4]]},"566":{"position":[[1087,4],[6665,4]]},"581":{"position":[[1259,4]]},"588":{"position":[[1554,4],[7691,4],[13682,4]]},"590":{"position":[[1639,4]]},"595":{"position":[[1289,4],[7201,4]]},"600":{"position":[[1303,4]]},"619":{"position":[[1461,4]]},"621":{"position":[[1213,4]]},"627":{"position":[[1285,4]]},"629":{"position":[[1134,4]]},"631":{"position":[[1141,4],[7174,4],[12810,4]]},"649":{"position":[[2391,4],[8563,4],[15387,4],[22221,4],[28458,4]]},"651":{"position":[[2365,4],[8617,4],[14959,4],[21282,4]]},"669":{"position":[[5789,4]]},"671":{"position":[[2208,4]]},"691":{"position":[[1476,4],[7932,4],[13927,4],[19615,4],[25240,4]]},"701":{"position":[[2080,4],[7697,4]]},"703":{"position":[[1211,4],[7091,4]]},"705":{"position":[[1289,4],[7488,4],[13751,4],[20020,4],[25681,4]]},"726":{"position":[[2019,4],[12877,4],[20944,4],[29271,4],[35031,4],[40651,4],[46294,4]]},"728":{"position":[[1314,4],[9229,4],[15155,4],[25596,4],[33835,4],[43395,4]]},"745":{"position":[[2808,4],[8530,4],[14182,4],[19861,4],[25488,4],[33221,4],[38847,4]]},"747":{"position":[[3566,4],[10691,4]]},"749":{"position":[[1306,4],[7579,4],[13452,4]]},"751":{"position":[[4063,4],[10905,4],[18319,4]]},"761":{"position":[[4104,4]]},"767":{"position":[[1445,4],[7137,4],[12884,4],[18769,4]]},"769":{"position":[[5556,4],[11759,4],[20057,4],[26847,4]]},"771":{"position":[[2309,4],[9711,4],[16638,4]]},"773":{"position":[[6088,4]]},"795":{"position":[[1493,4],[7145,4],[12972,4],[20097,4],[25794,4]]},"797":{"position":[[4111,4],[11428,4]]},"799":{"position":[[3904,4],[10624,4],[18606,4]]},"801":{"position":[[4161,4],[11303,4]]},"821":{"position":[[3109,4],[9071,4],[14820,4],[20739,4],[26489,4],[32908,4],[40443,4]]},"823":{"position":[[1150,4],[8431,4]]},"825":{"position":[[8103,4],[15623,4],[22110,4],[28859,4],[35286,4],[41156,4],[47080,4],[52766,4]]},"844":{"position":[[2812,4],[8558,4],[14228,4],[19900,4],[25520,4],[32740,4],[38359,4]]},"846":{"position":[[3412,4],[11366,4]]},"848":{"position":[[3124,4],[10282,4]]},"850":{"position":[[4170,4],[11953,4],[17713,4],[23412,4],[29202,4],[34899,4]]}}}],["function",{"_index":915,"t":{"111":{"position":[[310,8],[622,8],[873,8],[982,8]]},"113":{"position":[[281,8],[347,8],[1007,8],[1070,8],[1695,8],[1845,8]]},"310":{"position":[[1343,8]]}}}],["fundament",{"_index":1801,"t":{"420":{"position":[[457,11]]}}}],["further",{"_index":1863,"t":{"426":{"position":[[2666,7]]},"621":{"position":[[6178,7]]}}}],["futur",{"_index":280,"t":{"15":{"position":[[407,7]]},"416":{"position":[[178,7]]},"753":{"position":[[154,7]]}}}],["gabriel",{"_index":2236,"t":{"651":{"position":[[7499,7]]}}}],["gain",{"_index":1537,"t":{"271":{"position":[[175,5],[337,5]]}}}],["gamma",{"_index":2389,"t":{"721":{"position":[[143,5],[358,5]]},"726":{"position":[[12233,5],[13731,5],[15723,5],[17291,5],[19071,5],[20390,5],[21818,5],[23740,5],[25238,5],[26918,5]]}}}],["garden",{"_index":380,"t":{"27":{"position":[[539,6]]}}}],["gener",{"_index":951,"t":{"111":{"position":[[1848,9],[1998,8]]},"113":{"position":[[3089,9],[3239,8]]},"163":{"position":[[8,9]]},"217":{"position":[[58,8]]},"416":{"position":[[543,7],[804,7],[1112,7]]},"428":{"position":[[463,7]]},"556":{"position":[[6254,8]]},"817":{"position":[[911,7]]},"819":{"position":[[270,9]]},"825":{"position":[[810,9],[970,8],[1257,8],[6818,9],[14310,8],[14332,8]]}}}],["get",{"_index":562,"t":{"39":{"position":[[114,7]]},"63":{"position":[[172,7]]},"73":{"position":[[737,7]]},"75":{"position":[[135,7]]},"131":{"position":[[1618,7]]},"316":{"position":[[0,7]]},"361":{"position":[[78,7]]},"450":{"position":[[134,7]]},"456":{"position":[[3299,7]]},"526":{"position":[[78,7]]},"751":{"position":[[9849,7]]},"848":{"position":[[9224,7]]}}}],["github",{"_index":249,"t":{"11":{"position":[[106,6]]},"53":{"position":[[3543,7]]},"77":{"position":[[236,6],[1336,7]]},"111":{"position":[[1904,6]]},"113":{"position":[[3145,6]]},"271":{"position":[[313,6]]},"337":{"position":[[116,6]]},"377":{"position":[[196,6],[273,7]]},"454":{"position":[[374,7]]},"510":{"position":[[366,6]]},"546":{"position":[[280,6],[331,6]]},"568":{"position":[[334,6]]},"693":{"position":[[311,6],[388,7]]},"711":{"position":[[69,6]]},"717":{"position":[[678,6]]},"719":{"position":[[87,6]]},"732":{"position":[[112,6],[1181,6]]},"738":{"position":[[0,6],[104,6]]},"745":{"position":[[0,6],[30214,6]]},"747":{"position":[[0,6]]},"749":{"position":[[0,6]]},"751":{"position":[[3,7],[694,6]]},"753":{"position":[[0,6]]}}}],["github'",{"_index":2381,"t":{"717":{"position":[[139,8],[331,8]]},"719":{"position":[[48,9],[332,8]]},"732":{"position":[[36,8]]},"738":{"position":[[256,8]]},"740":{"position":[[0,8]]}}}],["github.com/gofiber/fiber/v2",{"_index":898,"t":{"109":{"position":[[1234,27],[1405,29]]},"111":{"position":[[1641,29]]},"113":{"position":[[2809,29]]}}}],["github.com/gofiber/jwt/v3",{"_index":899,"t":{"109":{"position":[[1262,25]]},"111":{"position":[[1679,27]]},"113":{"position":[[2847,27]]}}}],["github.com/golang",{"_index":900,"t":{"109":{"position":[[1288,17]]},"111":{"position":[[1707,18]]},"113":{"position":[[2875,18]]}}}],["github.com/openfga/cli@latest",{"_index":843,"t":{"77":{"position":[[1800,29]]},"85":{"position":[[51,29]]}}}],["github.com/openfga/go",{"_index":480,"t":{"37":{"position":[[2023,22]]},"43":{"position":[[483,22],[513,22]]},"77":{"position":[[286,21],[373,22]]},"97":{"position":[[657,22]]},"113":{"position":[[2914,22],[2944,22]]},"123":{"position":[[657,22]]},"169":{"position":[[13242,22],[19436,22],[25811,22]]},"215":{"position":[[727,22],[757,22]]},"217":{"position":[[1176,22],[1206,22],[1241,22]]},"219":{"position":[[1201,22],[1231,22],[1266,22]]},"236":{"position":[[1028,22]]},"238":{"position":[[1080,22],[6826,22]]},"248":{"position":[[657,22]]},"265":{"position":[[1370,22]]},"267":{"position":[[1044,22],[6786,22]]},"273":{"position":[[2381,22],[8018,22],[14047,22],[19651,22]]},"282":{"position":[[1289,22]]},"284":{"position":[[1124,22]]},"294":{"position":[[629,22]]},"329":{"position":[[1126,22],[6708,22],[12691,22]]},"353":{"position":[[1220,22],[6829,22]]},"359":{"position":[[1355,22],[7515,22],[13329,22]]},"375":{"position":[[1261,22]]},"382":{"position":[[2196,22]]},"406":{"position":[[1324,22],[7958,22]]},"408":{"position":[[1336,22]]},"410":{"position":[[1052,22]]},"446":{"position":[[1102,22]]},"448":{"position":[[1161,22],[6999,22]]},"482":{"position":[[1223,22],[6856,22]]},"486":{"position":[[1184,22],[6983,22]]},"504":{"position":[[1063,22]]},"506":{"position":[[1145,22]]},"508":{"position":[[1234,22]]},"522":{"position":[[1301,22]]},"524":{"position":[[1362,22]]},"540":{"position":[[1074,22]]},"542":{"position":[[1484,22]]},"544":{"position":[[1296,22]]},"556":{"position":[[1204,22]]},"560":{"position":[[1207,22]]},"562":{"position":[[1170,22]]},"564":{"position":[[1048,22],[6562,22]]},"566":{"position":[[1045,22],[6623,22]]},"581":{"position":[[1217,22]]},"588":{"position":[[1512,22],[7649,22],[13640,22]]},"590":{"position":[[1597,22]]},"595":{"position":[[1247,22],[7159,22]]},"600":{"position":[[1261,22]]},"619":{"position":[[1419,22]]},"621":{"position":[[1171,22]]},"627":{"position":[[1243,22]]},"629":{"position":[[1092,22]]},"631":{"position":[[1099,22],[7132,22],[12768,22]]},"649":{"position":[[2349,22],[8521,22],[15345,22],[22179,22],[28416,22]]},"651":{"position":[[2323,22],[8575,22],[14917,22],[21240,22]]},"669":{"position":[[5747,22]]},"671":{"position":[[2166,22]]},"691":{"position":[[1434,22],[7890,22],[13885,22],[19573,22],[25198,22]]},"701":{"position":[[2038,22],[7655,22]]},"703":{"position":[[1169,22],[7049,22]]},"705":{"position":[[1247,22],[7446,22],[13709,22],[19978,22],[25639,22]]},"726":{"position":[[1977,22],[12835,22],[20902,22],[29229,22],[34989,22],[40609,22],[46252,22]]},"728":{"position":[[1272,22],[9187,22],[15113,22],[25554,22],[33793,22],[43353,22]]},"745":{"position":[[2766,22],[8488,22],[14140,22],[19819,22],[25446,22],[33179,22],[38805,22]]},"747":{"position":[[3524,22],[10649,22]]},"749":{"position":[[1264,22],[7537,22],[13410,22]]},"751":{"position":[[4021,22],[10863,22],[18277,22]]},"761":{"position":[[4062,22]]},"767":{"position":[[1403,22],[7095,22],[12842,22],[18727,22]]},"769":{"position":[[5514,22],[11717,22],[20015,22],[26805,22]]},"771":{"position":[[2267,22],[9669,22],[16596,22]]},"773":{"position":[[6046,22]]},"795":{"position":[[1451,22],[7103,22],[12930,22],[20055,22],[25752,22]]},"797":{"position":[[4069,22],[11386,22]]},"799":{"position":[[3862,22],[10582,22],[18564,22]]},"801":{"position":[[4119,22],[11261,22]]},"821":{"position":[[3067,22],[9029,22],[14778,22],[20697,22],[26447,22],[32866,22],[40401,22]]},"823":{"position":[[1108,22],[8389,22]]},"825":{"position":[[8061,22],[15581,22],[22068,22],[28817,22],[35244,22],[41114,22],[47038,22],[52724,22]]},"844":{"position":[[2770,22],[8516,22],[14186,22],[19858,22],[25478,22],[32698,22],[38317,22]]},"846":{"position":[[3370,22],[11324,22]]},"848":{"position":[[3082,22],[10240,22]]},"850":{"position":[[4128,22],[11911,22],[17671,22],[23370,22],[29160,22],[34857,22]]}}}],["give",{"_index":1524,"t":{"254":{"position":[[118,4],[207,4]]},"265":{"position":[[29,4]]},"316":{"position":[[729,6]]},"548":{"position":[[135,6]]},"625":{"position":[[1913,4]]},"691":{"position":[[257,5],[308,5]]},"728":{"position":[[20755,4],[30994,4],[38564,4]]},"769":{"position":[[18864,4]]},"799":{"position":[[9185,4]]},"852":{"position":[[84,4]]}}}],["given",{"_index":227,"t":{"9":{"position":[[811,5]]},"117":{"position":[[101,5]]},"169":{"position":[[24311,5],[24609,5]]},"197":{"position":[[104,5]]},"300":{"position":[[259,6]]},"420":{"position":[[884,5]]},"428":{"position":[[645,5]]},"460":{"position":[[555,5]]},"691":{"position":[[12769,5],[30153,5]]},"711":{"position":[[179,5]]},"726":{"position":[[27346,5]]},"823":{"position":[[5883,5]]}}}],["global",{"_index":334,"t":{"25":{"position":[[34,6]]}}}],["go",{"_index":187,"t":{"7":{"position":[[511,2]]},"35":{"position":[[8,2]]},"37":{"position":[[717,2]]},"43":{"position":[[8,2]]},"47":{"position":[[66,2]]},"73":{"position":[[676,2]]},"77":{"position":[[58,2],[222,2],[276,2],[760,2],[1745,3],[1789,2]]},"85":{"position":[[40,2]]},"89":{"position":[[139,2],[154,2],[184,2]]},"93":{"position":[[8,2]]},"97":{"position":[[81,2]]},"99":{"position":[[87,2]]},"105":{"position":[[8,2]]},"109":{"position":[[52,2],[1032,2],[1205,2],[1224,2]]},"111":{"position":[[110,2]]},"113":{"position":[[8,2],[5637,2]]},"119":{"position":[[8,2]]},"123":{"position":[[81,2]]},"125":{"position":[[82,2]]},"147":{"position":[[418,5],[1852,5]]},"169":{"position":[[12261,2],[18455,2],[24809,2]]},"215":{"position":[[77,2]]},"217":{"position":[[257,5],[387,2]]},"219":{"position":[[263,2]]},"236":{"position":[[92,2]]},"238":{"position":[[102,2],[5846,2]]},"244":{"position":[[8,2]]},"248":{"position":[[81,2]]},"250":{"position":[[69,2]]},"252":{"position":[[224,2]]},"265":{"position":[[402,2]]},"267":{"position":[[113,2],[5817,2]]},"273":{"position":[[1407,2],[7045,2],[13069,2],[18671,2]]},"282":{"position":[[354,2]]},"284":{"position":[[145,2]]},"290":{"position":[[8,2]]},"294":{"position":[[57,2]]},"296":{"position":[[72,2],[1476,2]]},"298":{"position":[[1057,2],[2326,2]]},"329":{"position":[[199,2],[5780,2],[11598,2]]},"353":{"position":[[241,2],[5851,2]]},"359":{"position":[[360,2],[6536,2],[12350,2]]},"375":{"position":[[275,2]]},"382":{"position":[[1220,2]]},"404":{"position":[[22,5]]},"406":{"position":[[223,2],[6977,2]]},"408":{"position":[[125,2]]},"410":{"position":[[71,2]]},"418":{"position":[[244,2]]},"426":{"position":[[284,5],[293,2]]},"446":{"position":[[154,2]]},"448":{"position":[[175,2],[6012,2]]},"466":{"position":[[1182,2]]},"472":{"position":[[21,5]]},"482":{"position":[[241,2],[5875,2]]},"486":{"position":[[201,2],[6000,2]]},"504":{"position":[[129,2]]},"506":{"position":[[131,2]]},"508":{"position":[[248,2]]},"522":{"position":[[315,2]]},"524":{"position":[[380,2]]},"540":{"position":[[138,2]]},"542":{"position":[[471,2]]},"544":{"position":[[308,2]]},"556":{"position":[[217,2]]},"560":{"position":[[224,2]]},"562":{"position":[[235,2]]},"564":{"position":[[81,2],[5595,2]]},"566":{"position":[[118,2],[5655,2]]},"581":{"position":[[240,2]]},"588":{"position":[[490,2],[6646,2],[12627,2]]},"590":{"position":[[693,2]]},"595":{"position":[[231,2],[6143,2]]},"600":{"position":[[152,2]]},"619":{"position":[[367,2]]},"621":{"position":[[182,2]]},"627":{"position":[[92,2]]},"629":{"position":[[111,2]]},"631":{"position":[[92,2],[6150,2],[11783,2]]},"649":{"position":[[1371,2],[7543,2],[14364,2],[21201,2],[27437,2]]},"651":{"position":[[1344,2],[7593,2],[13937,2],[20260,2]]},"661":{"position":[[36,5],[3166,2]]},"667":{"position":[[237,2],[2068,2],[3927,2],[5763,2],[7620,2],[9463,2]]},"669":{"position":[[2815,2],[4743,2],[10705,2]]},"671":{"position":[[1134,2],[7259,2],[9930,2]]},"673":{"position":[[2705,2]]},"691":{"position":[[363,2],[6911,2],[12906,2],[18592,2],[24218,2]]},"701":{"position":[[1058,2],[6676,2]]},"703":{"position":[[182,2],[6066,2]]},"705":{"position":[[157,2],[6434,2],[12696,2],[18998,2],[24661,2]]},"724":{"position":[[25,5]]},"726":{"position":[[196,2],[11514,2],[19651,2],[28250,2],[34009,2],[39626,2],[45268,2]]},"728":{"position":[[292,2],[8211,2],[14128,2],[24570,2],[32818,2],[42378,2]]},"732":{"position":[[163,5]]},"745":{"position":[[1823,2],[7507,2],[13197,2],[18838,2],[24464,2],[32198,2],[37824,2]]},"747":{"position":[[2352,2],[9666,2]]},"749":{"position":[[297,2],[6538,2],[12429,2]]},"751":{"position":[[2994,2],[9878,2],[17312,2]]},"761":{"position":[[36,5],[2600,2]]},"767":{"position":[[427,2],[6115,2],[11840,2],[17750,2]]},"769":{"position":[[4542,2],[10347,2],[18890,2],[25829,2]]},"771":{"position":[[1087,2],[8524,2],[15450,2]]},"773":{"position":[[3328,2]]},"795":{"position":[[509,2],[6157,2],[11841,2],[19075,2],[24774,2]]},"797":{"position":[[2927,2],[10403,2]]},"799":{"position":[[2832,2],[9357,2],[17587,2]]},"801":{"position":[[3027,2],[10279,2]]},"821":{"position":[[2066,2],[8043,2],[13777,2],[19711,2],[25454,2],[31615,2],[39415,2]]},"823":{"position":[[127,2],[7409,2]]},"825":{"position":[[6895,2],[14511,2],[20954,2],[27788,2],[34272,2],[40159,2],[46060,2],[51731,2]]},"844":{"position":[[1824,2],[7532,2],[13244,2],[18878,2],[24496,2],[31718,2],[37336,2]]},"846":{"position":[[2107,2],[10340,2]]},"848":{"position":[[1940,2],[9253,2]]},"850":{"position":[[2813,2],[10923,2],[16681,2],[22378,2],[28170,2],[33867,2]]}}}],["go.mod",{"_index":807,"t":{"77":{"position":[[782,6]]}}}],["go.sum",{"_index":808,"t":{"77":{"position":[[793,6]]}}}],["goal",{"_index":230,"t":{"9":{"position":[[941,4]]},"728":{"position":[[198,5]]},"785":{"position":[[183,4]]},"793":{"position":[[175,4]]},"819":{"position":[[4,4]]}}}],["gofiber/fib",{"_index":894,"t":{"109":{"position":[[1049,13]]}}}],["gofiber/jwt",{"_index":895,"t":{"109":{"position":[[1116,11]]}}}],["golang",{"_index":274,"t":{"15":{"position":[[322,7]]},"109":{"position":[[1172,6]]}}}],["good",{"_index":309,"t":{"19":{"position":[[339,4]]},"73":{"position":[[486,4]]},"131":{"position":[[10,4]]},"157":{"position":[[349,4]]},"728":{"position":[[13798,5],[30529,5]]}}}],["googl",{"_index":310,"t":{"19":{"position":[[363,6]]},"25":{"position":[[165,7],[189,6]]},"51":{"position":[[2238,6]]},"53":{"position":[[3510,6]]},"169":{"position":[[32306,6]]},"310":{"position":[[2772,6],[2939,6]]},"312":{"position":[[501,6]]},"337":{"position":[[0,6]]},"345":{"position":[[489,6]]},"377":{"position":[[92,6],[168,6]]},"418":{"position":[[304,6]]},"510":{"position":[[216,6]]},"546":{"position":[[156,6],[243,6]]},"693":{"position":[[207,6],[283,6]]},"831":{"position":[[40,6]]},"837":{"position":[[0,6],[136,6],[294,6]]},"839":{"position":[[0,6]]},"844":{"position":[[63,6],[30248,6]]},"846":{"position":[[0,6]]},"850":{"position":[[0,6]]}}}],["google'",{"_index":332,"t":{"25":{"position":[[12,9]]}}}],["govern",{"_index":1734,"t":{"390":{"position":[[537,6]]},"661":{"position":[[306,8]]}}}],["gradual",{"_index":783,"t":{"73":{"position":[[568,7]]}}}],["graduat",{"_index":1542,"t":{"271":{"position":[[403,9]]}}}],["grain",{"_index":254,"t":{"13":{"position":[[42,7]]},"15":{"position":[[43,7]]},"19":{"position":[[5,7]]},"115":{"position":[[178,7]]},"300":{"position":[[24,7]]},"677":{"position":[[1113,7]]},"803":{"position":[[42,5]]},"827":{"position":[[206,5],[677,7]]}}}],["grant",{"_index":83,"t":{"3":{"position":[[1309,5],[1397,7]]},"5":{"position":[[99,8],[225,8]]},"19":{"position":[[44,5],[397,7],[448,7]]},"21":{"position":[[215,7],[248,7]]},"39":{"position":[[265,8]]},"225":{"position":[[36,5],[295,5],[441,8]]},"227":{"position":[[1013,5]]},"229":{"position":[[48,5]]},"256":{"position":[[36,5],[92,8]]},"258":{"position":[[732,5]]},"260":{"position":[[89,5]]},"269":{"position":[[107,8],[195,8]]},"273":{"position":[[24350,5]]},"275":{"position":[[48,5]]},"316":{"position":[[180,8],[281,5],[892,8]]},"320":{"position":[[1239,5],[1334,5]]},"322":{"position":[[89,5]]},"324":{"position":[[24,5]]},"345":{"position":[[300,8]]},"347":{"position":[[1643,5]]},"349":{"position":[[48,5]]},"365":{"position":[[1145,5]]},"367":{"position":[[48,5]]},"380":{"position":[[322,8],[349,8]]},"390":{"position":[[214,5]]},"392":{"position":[[1154,5]]},"396":{"position":[[48,5]]},"438":{"position":[[36,5],[122,8]]},"462":{"position":[[315,7]]},"472":{"position":[[617,8]]},"492":{"position":[[1016,5]]},"494":{"position":[[89,5]]},"510":{"position":[[384,5]]},"512":{"position":[[36,5],[183,5]]},"514":{"position":[[786,5]]},"516":{"position":[[89,5]]},"528":{"position":[[60,5],[313,5],[459,8]]},"530":{"position":[[763,5]]},"532":{"position":[[89,5]]},"546":{"position":[[287,8]]},"548":{"position":[[36,5]]},"550":{"position":[[716,5]]},"552":{"position":[[89,5]]},"572":{"position":[[1187,5]]},"574":{"position":[[89,5]]},"610":{"position":[[960,5]]},"612":{"position":[[48,5]]},"635":{"position":[[295,7]]},"637":{"position":[[304,5]]},"639":{"position":[[89,5]]},"661":{"position":[[713,6]]},"677":{"position":[[784,5],[846,5],[921,5]]},"679":{"position":[[875,5]]},"681":{"position":[[89,5]]},"689":{"position":[[352,7]]},"713":{"position":[[676,8],[905,7]]},"728":{"position":[[22190,5]]},"747":{"position":[[85,8]]},"781":{"position":[[365,5],[719,8],[989,7]]},"795":{"position":[[327,5]]},"809":{"position":[[365,5]]}}}],["grant_dur",{"_index":101,"t":{"3":{"position":[[1659,15],[1715,14],[1925,14],[2951,14]]}}}],["grant_tim",{"_index":100,"t":{"3":{"position":[[1636,11],[1702,10],[1890,10],[2938,10]]}}}],["granular",{"_index":2325,"t":{"685":{"position":[[151,8]]},"807":{"position":[[518,8]]}}}],["graph",{"_index":2124,"t":{"590":{"position":[[130,5]]},"593":{"position":[[192,5]]}}}],["greater",{"_index":1060,"t":{"131":{"position":[[1224,7]]}}}],["green",{"_index":1821,"t":{"422":{"position":[[2215,6]]},"424":{"position":[[536,6]]}}}],["grid",{"_index":2806,"t":{"813":{"position":[[545,4]]}}}],["group",{"_index":154,"t":{"5":{"position":[[250,5]]},"19":{"position":[[486,6]]},"49":{"position":[[313,5]]},"169":{"position":[[4871,5]]},"223":{"position":[[110,5],[200,6],[232,5],[317,6]]},"225":{"position":[[44,5],[148,5],[303,5]]},"227":{"position":[[957,7],[1002,6],[1019,6],[1583,8]]},"229":{"position":[[37,6],[54,6]]},"231":{"position":[[505,8]]},"240":{"position":[[54,6],[75,6],[117,7],[139,5],[177,5]]},"254":{"position":[[175,5],[214,5]]},"258":{"position":[[1302,8]]},"262":{"position":[[505,8]]},"271":{"position":[[68,5],[498,5],[710,6],[784,6]]},"273":{"position":[[13042,5],[24294,7],[24339,6],[24356,6],[24406,5],[24451,5],[25014,8]]},"275":{"position":[[37,6],[54,6]]},"277":{"position":[[31,5]]},"279":{"position":[[505,8]]},"286":{"position":[[54,6],[75,6],[117,7],[139,5],[173,5]]},"298":{"position":[[93,5],[321,8],[622,8],[827,8]]},"316":{"position":[[229,6],[256,5],[314,6]]},"320":{"position":[[1904,8]]},"326":{"position":[[505,8]]},"343":{"position":[[437,6]]},"345":{"position":[[364,7],[719,5]]},"347":{"position":[[1587,7],[1632,6],[1649,6],[2213,8]]},"349":{"position":[[37,6],[54,6]]},"351":{"position":[[505,8]]},"365":{"position":[[1089,7],[1134,6],[1151,6],[1715,8]]},"367":{"position":[[37,6],[54,6]]},"369":{"position":[[505,8]]},"380":{"position":[[91,5],[202,6]]},"384":{"position":[[1271,7]]},"388":{"position":[[58,5],[119,5]]},"392":{"position":[[1143,6],[1160,6]]},"396":{"position":[[37,6],[54,6]]},"420":{"position":[[1125,6]]},"426":{"position":[[605,8],[1797,5],[1841,7],[2702,6],[2945,7],[4918,5],[5202,7]]},"428":{"position":[[27,5]]},"440":{"position":[[1294,8]]},"442":{"position":[[505,8]]},"456":{"position":[[131,5],[407,5],[1072,6],[1134,5],[1553,5],[1905,8],[3232,6]]},"458":{"position":[[142,5],[660,5]]},"460":{"position":[[1296,5],[1373,5],[1716,8],[2303,8],[2854,8],[3122,5]]},"474":{"position":[[3201,8]]},"480":{"position":[[505,8]]},"488":{"position":[[88,6],[118,5]]},"490":{"position":[[572,7]]},"492":{"position":[[1586,8]]},"496":{"position":[[505,8]]},"514":{"position":[[1356,8]]},"518":{"position":[[505,8]]},"528":{"position":[[49,6],[66,6],[166,5],[321,5]]},"530":{"position":[[1333,8]]},"534":{"position":[[505,8]]},"536":{"position":[[68,5]]},"542":{"position":[[13,6]]},"546":{"position":[[50,6],[79,5],[135,6],[182,6]]},"550":{"position":[[1286,8]]},"554":{"position":[[505,8]]},"572":{"position":[[1757,8]]},"576":{"position":[[505,8]]},"610":{"position":[[904,7],[949,6],[966,6],[1530,8]]},"612":{"position":[[37,6],[54,6]]},"614":{"position":[[505,8]]},"633":{"position":[[289,6],[320,7]]},"637":{"position":[[874,8]]},"641":{"position":[[505,8]]},"659":{"position":[[365,8]]},"675":{"position":[[50,6]]},"677":{"position":[[172,5]]},"679":{"position":[[1445,8]]},"683":{"position":[[505,8]]},"697":{"position":[[578,8]]},"732":{"position":[[256,5],[304,6]]},"759":{"position":[[366,8]]},"777":{"position":[[50,6]]},"781":{"position":[[1031,7],[1076,6],[1116,6],[1216,5],[1262,6]]},"787":{"position":[[223,7],[243,7],[293,5],[353,6]]},"789":{"position":[[395,5],[507,5]]},"799":{"position":[[57,7],[99,6],[127,7],[147,6],[196,5],[267,6],[333,6],[2762,5]]},"805":{"position":[[20,5],[87,6]]},"807":{"position":[[163,5],[303,6]]},"831":{"position":[[138,5],[186,6]]}}}],["group#memb",{"_index":649,"t":{"49":{"position":[[673,12]]},"298":{"position":[[167,14],[221,14]]},"460":{"position":[[1115,12],[1479,13],[1585,13],[3297,12]]}}}],["group'",{"_index":1547,"t":{"271":{"position":[[576,7]]}}}],["group1",{"_index":2769,"t":{"799":{"position":[[9217,6]]}}}],["group:abc#memb",{"_index":1592,"t":{"296":{"position":[[3597,19]]}}}],["group:market",{"_index":645,"t":{"49":{"position":[[279,15]]}}}],["group:marketing#memb",{"_index":648,"t":{"49":{"position":[[634,22]]}}}],["group:sal",{"_index":1924,"t":{"456":{"position":[[467,14],[1202,14]]},"458":{"position":[[197,14],[720,14]]},"460":{"position":[[148,14]]}}}],["group:sales#memb",{"_index":1928,"t":{"456":{"position":[[682,21]]},"460":{"position":[[388,18],[459,21],[561,18],[670,18],[3172,21]]}}}],["groups/contain",{"_index":1847,"t":{"426":{"position":[[439,17]]}}}],["grow",{"_index":2061,"t":{"548":{"position":[[258,6]]},"556":{"position":[[6406,6]]}}}],["grpc",{"_index":1033,"t":{"129":{"position":[[156,4]]},"141":{"position":[[295,4],[414,4]]},"143":{"position":[[833,4]]},"145":{"position":[[2574,4],[5205,4]]},"153":{"position":[[72,4],[234,4]]}}}],["grpc.health.v1.health/check",{"_index":1265,"t":{"153":{"position":[[90,28],[388,27]]}}}],["grpcurl",{"_index":1273,"t":{"153":{"position":[[355,7]]}}}],["guarante",{"_index":1293,"t":{"155":{"position":[[905,10]]}}}],["guard",{"_index":2715,"t":{"781":{"position":[[636,6],[1196,6],[1235,6]]},"787":{"position":[[37,6],[260,6],[312,6]]},"789":{"position":[[234,5],[340,5]]},"793":{"position":[[34,6],[305,5]]},"795":{"position":[[41,5],[134,6]]},"797":{"position":[[167,5],[335,6],[2519,6],[2607,6]]},"799":{"position":[[163,6],[215,6],[2729,6],[9207,6]]},"805":{"position":[[187,6]]}}}],["guest",{"_index":1674,"t":{"345":{"position":[[774,7]]},"815":{"position":[[111,6]]},"817":{"position":[[607,5]]},"819":{"position":[[797,5],[990,5],[1144,6],[1357,8],[1634,8],[1849,5],[1855,7]]},"821":{"position":[[142,7],[374,5],[716,6],[929,8],[1206,8],[31371,5],[31435,8],[32466,5],[32532,8],[33953,5],[35826,5],[35900,8],[37323,5],[38712,5],[39022,5],[45370,5],[45418,6],[45455,5],[45505,6]]},"823":{"position":[[6037,6],[6547,6],[6987,8],[7264,8],[13328,5],[13376,6],[13413,5],[13463,6]]},"825":{"position":[[377,5],[1017,5],[2411,7],[2681,7],[3927,7],[4197,7],[4673,6],[5397,8],[5674,8],[6321,7],[6591,7],[40084,5],[58385,5],[58435,6]]}}}],["guid",{"_index":16,"t":{"3":{"position":[[204,6]]},"29":{"position":[[42,5]]},"45":{"position":[[951,5]]},"167":{"position":[[11,6],[65,5],[150,5]]},"169":{"position":[[294,5]]},"225":{"position":[[8,5]]},"227":{"position":[[28,5]]},"256":{"position":[[8,5]]},"258":{"position":[[28,5]]},"271":{"position":[[8,5]]},"273":{"position":[[28,5]]},"314":{"position":[[17,7]]},"318":{"position":[[8,5]]},"320":{"position":[[28,5]]},"333":{"position":[[218,6]]},"341":{"position":[[17,6]]},"345":{"position":[[8,5]]},"347":{"position":[[22,6]]},"363":{"position":[[14,6]]},"365":{"position":[[26,6]]},"390":{"position":[[8,5]]},"392":{"position":[[22,6]]},"402":{"position":[[225,6]]},"414":{"position":[[311,5]]},"416":{"position":[[318,5]]},"418":{"position":[[231,6]]},"434":{"position":[[17,6]]},"438":{"position":[[8,5]]},"440":{"position":[[28,5]]},"472":{"position":[[8,5]]},"474":{"position":[[28,5]]},"490":{"position":[[8,5]]},"492":{"position":[[28,5]]},"512":{"position":[[8,5]]},"514":{"position":[[28,5]]},"520":{"position":[[12,7]]},"528":{"position":[[8,5]]},"530":{"position":[[28,5]]},"548":{"position":[[8,5]]},"550":{"position":[[28,5]]},"570":{"position":[[8,5]]},"572":{"position":[[28,5]]},"606":{"position":[[125,5],[192,5],[260,5],[335,5]]},"608":{"position":[[8,5]]},"610":{"position":[[22,6]]},"621":{"position":[[6267,6]]},"635":{"position":[[8,5]]},"637":{"position":[[26,6]]},"657":{"position":[[15,6]]},"661":{"position":[[22,6]]},"675":{"position":[[410,6]]},"677":{"position":[[8,5]]},"679":{"position":[[28,5]]},"695":{"position":[[119,6]]},"697":{"position":[[5,5]]},"713":{"position":[[28,5]]},"734":{"position":[[28,5]]},"757":{"position":[[15,6]]},"761":{"position":[[22,6]]},"763":{"position":[[19,5]]},"769":{"position":[[10324,5]]},"775":{"position":[[22,5]]},"777":{"position":[[400,6]]},"781":{"position":[[28,5]]},"809":{"position":[[28,5]]},"833":{"position":[[28,5]]}}}],["guidanc",{"_index":1080,"t":{"133":{"position":[[78,8],[1671,8]]},"600":{"position":[[134,9]]}}}],["guidelin",{"_index":1031,"t":{"129":{"position":[[33,10]]},"131":{"position":[[610,10]]},"133":{"position":[[1196,11],[1974,11]]},"205":{"position":[[33,10]]}}}],["h",{"_index":551,"t":{"37":{"position":[[7750,1],[7849,1]]},"43":{"position":[[3222,1]]},"99":{"position":[[1333,1],[1432,1]]},"125":{"position":[[1575,1],[1674,1]]},"145":{"position":[[4482,3]]},"169":{"position":[[17317,1],[17416,1],[23511,1],[23610,1],[30062,1],[30161,1]]},"236":{"position":[[4918,1],[5017,1]]},"238":{"position":[[5143,1],[5242,1],[10897,1],[10996,1]]},"250":{"position":[[1411,1],[1510,1]]},"252":{"position":[[1534,1],[1633,1]]},"265":{"position":[[5393,1],[5492,1]]},"267":{"position":[[4921,1],[5020,1],[10813,1],[10912,1]]},"273":{"position":[[6428,1],[6527,1],[12018,1],[12117,1],[18110,1],[18209,1],[23722,1],[23821,1]]},"282":{"position":[[5178,1],[5277,1]]},"284":{"position":[[5191,1],[5290,1]]},"296":{"position":[[891,1],[990,1],[2769,1],[2868,1]]},"298":{"position":[[1936,1],[2035,1],[3679,1],[3778,1]]},"329":{"position":[[4989,1],[5088,1],[10576,1],[10675,1],[17186,1],[17285,1]]},"353":{"position":[[5287,1],[5386,1],[10892,1],[10991,1]]},"359":{"position":[[5421,1],[5520,1],[11582,1],[11681,1],[17396,1],[17495,1]]},"375":{"position":[[5356,1],[5455,1]]},"382":{"position":[[6251,1],[6350,1]]},"406":{"position":[[5786,1],[5885,1],[12033,1],[12132,1]]},"408":{"position":[[6128,1],[6227,1]]},"410":{"position":[[5127,1],[5226,1]]},"446":{"position":[[5028,1],[5127,1]]},"448":{"position":[[5256,1],[5355,1],[11098,1],[11197,1]]},"466":{"position":[[2493,1],[2592,1]]},"482":{"position":[[5302,1],[5401,1],[10931,1],[11030,1]]},"486":{"position":[[5267,1],[5366,1],[11066,1],[11165,1]]},"504":{"position":[[4947,1],[5046,1]]},"506":{"position":[[5268,1],[5367,1]]},"508":{"position":[[5329,1],[5428,1]]},"522":{"position":[[5340,1],[5439,1]]},"524":{"position":[[5441,1],[5540,1]]},"540":{"position":[[4964,1],[5063,1]]},"542":{"position":[[5604,1],[5703,1]]},"544":{"position":[[5399,1],[5498,1]]},"556":{"position":[[5326,1],[5425,1]]},"560":{"position":[[5317,1],[5416,1]]},"562":{"position":[[5057,1],[5156,1]]},"564":{"position":[[5067,1],[5166,1],[10581,1],[10680,1]]},"566":{"position":[[4910,1],[5009,1],[10646,1],[10745,1]]},"581":{"position":[[5276,1],[5375,1]]},"588":{"position":[[5729,1],[5828,1],[11769,1],[11868,1],[17800,1],[17899,1]]},"590":{"position":[[5460,1],[5559,1]]},"595":{"position":[[5429,1],[5528,1],[11341,1],[11440,1]]},"600":{"position":[[5898,1],[5997,1]]},"619":{"position":[[5656,1],[5755,1]]},"621":{"position":[[5278,1],[5377,1]]},"627":{"position":[[5855,1],[5954,1]]},"629":{"position":[[5167,1],[5266,1]]},"631":{"position":[[5203,1],[5302,1],[11211,1],[11310,1],[16859,1],[16958,1]]},"649":{"position":[[6412,1],[6511,1],[12584,1],[12683,1],[19420,1],[19519,1],[26242,1],[26341,1],[32483,1],[32582,1]]},"651":{"position":[[6390,1],[6489,1],[12654,1],[12753,1],[18988,1],[19087,1],[25311,1],[25410,1]]},"661":{"position":[[8108,1],[8207,1]]},"667":{"position":[[1499,1],[1598,1],[3340,1],[3439,1],[5189,1],[5288,1],[7040,1],[7139,1],[8887,1],[8986,1],[10740,1],[10839,1]]},"669":{"position":[[4082,1],[4181,1],[9840,1],[9939,1],[11967,1],[12066,1]]},"671":{"position":[[6345,1],[6444,1],[9038,1],[9137,1],[11714,1],[11813,1]]},"673":{"position":[[7647,1],[7746,1]]},"691":{"position":[[5806,1],[5905,1],[11957,1],[12056,1],[17952,1],[18051,1],[23648,1],[23747,1],[29269,1],[29368,1]]},"701":{"position":[[6109,1],[6208,1],[11722,1],[11821,1]]},"703":{"position":[[5211,1],[5310,1],[11132,1],[11231,1]]},"705":{"position":[[5549,1],[5648,1],[11643,1],[11742,1],[17911,1],[18010,1],[24049,1],[24148,1],[29702,1],[29801,1]]},"726":{"position":[[8791,1],[8890,1],[18035,1],[18134,1],[25892,1],[25991,1],[33296,1],[33395,1],[39060,1],[39159,1],[44692,1],[44791,1],[50339,1],[50438,1]]},"728":{"position":[[5343,1],[5442,1],[13242,1],[13341,1],[19204,1],[19303,1],[29641,1],[29740,1],[37844,1],[37943,1],[47404,1],[47503,1]]},"745":{"position":[[6677,1],[6776,1],[12563,1],[12662,1],[18051,1],[18150,1],[23894,1],[23993,1],[29525,1],[29624,1],[37254,1],[37353,1],[42880,1],[42979,1]]},"747":{"position":[[8199,1],[8298,1],[14732,1],[14831,1]]},"749":{"position":[[5247,1],[5346,1],[11615,1],[11714,1],[17485,1],[17584,1]]},"751":{"position":[[8263,1],[8362,1],[14954,1],[15053,1],[22254,1],[22353,1]]},"761":{"position":[[9763,1],[9862,1]]},"767":{"position":[[5458,1],[5557,1],[11166,1],[11265,1],[16929,1],[17028,1],[22786,1],[22885,1]]},"769":{"position":[[9553,1],[9652,1],[17064,1],[17163,1],[24549,1],[24648,1],[30860,1],[30959,1]]},"771":{"position":[[6968,1],[7067,1],[14399,1],[14498,1],[21330,1],[21429,1]]},"773":{"position":[[16139,1],[16238,1]]},"795":{"position":[[5359,1],[5458,1],[11023,1],[11122,1],[17437,1],[17536,1],[24126,1],[24225,1],[29815,1],[29914,1]]},"797":{"position":[[8814,1],[8913,1],[15469,1],[15568,1]]},"799":{"position":[[8113,1],[8212,1],[15576,1],[15675,1],[22623,1],[22722,1]]},"801":{"position":[[8635,1],[8734,1],[15340,1],[15439,1]]},"821":{"position":[[7151,1],[7250,1],[13124,1],[13223,1],[18862,1],[18961,1],[24792,1],[24891,1],[30570,1],[30669,1],[37856,1],[37955,1],[44496,1],[44595,1]]},"823":{"position":[[5183,1],[5282,1],[12460,1],[12559,1]]},"825":{"position":[[12799,1],[12898,1],[19872,1],[19971,1],[26570,1],[26669,1],[33065,1],[33164,1],[39242,1],[39341,1],[45061,1],[45160,1],[51101,1],[51200,1],[56847,1],[56946,1]]},"844":{"position":[[6690,1],[6789,1],[12603,1],[12702,1],[18094,1],[18193,1],[23929,1],[24028,1],[29557,1],[29656,1],[36769,1],[36868,1],[42392,1],[42491,1]]},"846":{"position":[[8476,1],[8575,1],[15411,1],[15510,1]]},"848":{"position":[[7667,1],[7766,1],[14339,1],[14438,1]]},"850":{"position":[[9310,1],[9409,1],[16014,1],[16113,1],[21782,1],[21881,1],[27489,1],[27588,1],[33271,1],[33370,1],[38968,1],[39067,1]]}}}],["hand",{"_index":675,"t":{"51":{"position":[[1231,4]]},"795":{"position":[[24698,5]]},"821":{"position":[[25393,5]]}}}],["handi",{"_index":2928,"t":{"850":{"position":[[433,6]]}}}],["handl",{"_index":64,"t":{"3":{"position":[[934,8]]},"37":{"position":[[2712,6],[3349,6],[3507,6]]},"43":{"position":[[1136,6],[1289,6]]},"77":{"position":[[726,6]]},"97":{"position":[[1346,6]]},"123":{"position":[[1346,6]]},"169":{"position":[[13931,6],[20125,6],[26500,6]]},"215":{"position":[[1375,6]]},"217":{"position":[[2103,6]]},"219":{"position":[[220,6],[2266,6]]},"236":{"position":[[1717,6],[2152,6]]},"238":{"position":[[1769,6],[7515,6]]},"248":{"position":[[1346,6]]},"250":{"position":[[672,6]]},"252":{"position":[[829,6]]},"265":{"position":[[2059,6]]},"267":{"position":[[1733,6],[2163,6],[7475,6]]},"273":{"position":[[3070,6],[8707,6],[9179,6],[14736,6],[20340,6]]},"282":{"position":[[1978,6],[2412,6]]},"284":{"position":[[1813,6]]},"294":{"position":[[1318,6]]},"296":{"position":[[454,6],[2092,6]]},"298":{"position":[[1461,6],[2964,6]]},"329":{"position":[[1815,6],[2241,6],[7397,6],[7824,6],[13380,6],[14051,6]]},"353":{"position":[[1909,6],[7518,6]]},"359":{"position":[[2044,6],[2538,6],[8204,6],[14018,6]]},"375":{"position":[[1950,6]]},"382":{"position":[[2885,6]]},"406":{"position":[[2013,6],[2672,6],[8647,6]]},"408":{"position":[[2025,6],[2794,6]]},"410":{"position":[[1741,6]]},"446":{"position":[[1791,6],[2238,6]]},"448":{"position":[[1850,6],[7688,6]]},"466":{"position":[[1830,6]]},"482":{"position":[[1912,6],[7545,6]]},"486":{"position":[[1873,6],[7672,6]]},"504":{"position":[[1752,6],[2185,6]]},"506":{"position":[[1834,6],[2347,6]]},"508":{"position":[[1923,6]]},"522":{"position":[[1990,6],[2475,6]]},"524":{"position":[[2051,6]]},"540":{"position":[[1763,6],[2198,6]]},"542":{"position":[[2173,6],[2685,6]]},"544":{"position":[[1985,6]]},"556":{"position":[[1893,6],[2438,6]]},"560":{"position":[[1896,6],[2437,6]]},"562":{"position":[[1859,6],[2293,6]]},"564":{"position":[[1737,6],[7251,6]]},"566":{"position":[[1734,6],[2160,6],[7312,6]]},"581":{"position":[[1906,6]]},"588":{"position":[[2201,6],[8338,6],[14329,6]]},"590":{"position":[[2286,6]]},"595":{"position":[[1936,6],[7848,6]]},"600":{"position":[[1950,6]]},"619":{"position":[[2108,6],[2659,6]]},"621":{"position":[[1860,6]]},"627":{"position":[[1932,6],[2641,6]]},"629":{"position":[[1781,6]]},"631":{"position":[[1788,6],[2294,6],[7821,6],[13457,6]]},"649":{"position":[[3038,6],[9210,6],[16034,6],[22868,6],[29105,6]]},"651":{"position":[[3012,6],[9264,6],[15606,6],[21929,6]]},"661":{"position":[[5750,6]]},"669":{"position":[[6436,6],[6939,6]]},"671":{"position":[[2855,6],[3386,6]]},"673":{"position":[[5289,6]]},"691":{"position":[[2123,6],[2752,6],[8579,6],[14574,6],[20262,6],[25887,6]]},"701":{"position":[[2727,6],[8344,6]]},"703":{"position":[[1858,6],[2344,6],[7738,6]]},"705":{"position":[[1936,6],[8135,6],[8705,6],[14398,6],[14969,6],[20667,6],[26328,6]]},"726":{"position":[[2666,6],[4241,6],[13524,6],[14462,6],[21591,6],[22459,6],[29918,6],[35678,6],[41298,6],[46941,6]]},"728":{"position":[[1961,6],[9876,6],[15802,6],[26243,6],[34482,6],[44042,6]]},"745":{"position":[[3455,6],[3897,6],[9177,6],[14829,6],[15271,6],[20508,6],[26135,6],[33868,6],[39494,6]]},"747":{"position":[[4213,6],[4943,6],[11338,6]]},"749":{"position":[[1953,6],[2419,6],[8226,6],[8724,6],[14099,6]]},"751":{"position":[[4710,6],[5295,6],[11552,6],[18966,6],[19430,6]]},"761":{"position":[[4751,6],[5889,6]]},"767":{"position":[[2092,6],[7784,6],[13531,6],[14032,6],[19416,6]]},"769":{"position":[[6203,6],[12406,6],[13393,6],[20704,6],[21387,6],[27494,6]]},"771":{"position":[[2956,6],[3694,6],[10358,6],[17285,6]]},"773":{"position":[[6735,6],[9601,6]]},"795":{"position":[[2140,6],[2581,6],[7792,6],[8237,6],[13619,6],[14325,6],[20744,6],[26441,6]]},"797":{"position":[[4758,6],[5576,6],[12075,6]]},"799":{"position":[[4551,6],[5139,6],[11271,6],[12172,6],[19253,6]]},"801":{"position":[[4808,6],[5517,6],[11950,6]]},"821":{"position":[[3756,6],[4256,6],[9718,6],[15467,6],[15967,6],[21386,6],[27136,6],[33555,6],[34423,6],[41090,6]]},"823":{"position":[[1797,6],[9078,6]]},"825":{"position":[[8750,6],[9533,6],[16270,6],[16839,6],[22757,6],[23429,6],[29506,6],[30093,6],[35933,6],[36404,6],[41803,6],[42257,6],[47727,6],[53413,6]]},"844":{"position":[[3459,6],[3904,6],[9205,6],[14875,6],[15316,6],[20547,6],[26167,6],[33387,6],[39006,6]]},"846":{"position":[[4059,6],[4998,6],[12013,6]]},"848":{"position":[[3771,6],[4471,6],[10929,6]]},"850":{"position":[[4817,6],[5749,6],[12600,6],[18360,6],[24059,6],[29849,6],[35546,6]]}}}],["happen",{"_index":767,"t":{"71":{"position":[[306,6]]},"288":{"position":[[109,8],[162,9]]},"296":{"position":[[40,8]]},"298":{"position":[[938,8]]},"464":{"position":[[153,6],[574,7]]},"771":{"position":[[717,9]]},"848":{"position":[[23,7]]}}}],["hard",{"_index":1791,"t":{"416":{"position":[[293,5]]}}}],["have",{"_index":197,"t":{"7":{"position":[[774,6]]},"73":{"position":[[644,6]]},"131":{"position":[[451,6],[1351,6]]},"273":{"position":[[1024,6]]},"331":{"position":[[0,6]]},"363":{"position":[[280,6],[304,6]]},"373":{"position":[[853,6],[915,6]]},"386":{"position":[[137,6],[418,6],[476,6],[582,6],[658,6]]},"464":{"position":[[616,6]]},"498":{"position":[[70,6]]},"562":{"position":[[100,6]]},"677":{"position":[[1226,6]]},"728":{"position":[[23110,6]]},"730":{"position":[[288,6],[340,6]]},"732":{"position":[[1024,6],[1076,6]]},"734":{"position":[[360,6]]},"751":{"position":[[1268,6]]},"781":{"position":[[511,6]]},"797":{"position":[[190,6]]},"801":{"position":[[600,6],[2476,6]]},"809":{"position":[[511,6]]},"831":{"position":[[1106,6],[1158,6]]},"833":{"position":[[360,6]]}}}],["haven't",{"_index":1891,"t":{"428":{"position":[[1357,7]]}}}],["header",{"_index":1222,"t":{"147":{"position":[[358,7]]},"217":{"position":[[2065,6]]}}}],["health",{"_index":1263,"t":{"153":{"position":[[35,6],[77,6]]}}}],["healthcheck",{"_index":1183,"t":{"145":{"position":[[1794,12],[4431,12]]}}}],["healthz",{"_index":1264,"t":{"153":{"position":[[57,8]]}}}],["helm",{"_index":1129,"t":{"137":{"position":[[81,4],[160,4]]}}}],["help",{"_index":717,"t":{"59":{"position":[[199,7]]},"69":{"position":[[363,5]]},"73":{"position":[[359,4]]},"169":{"position":[[3221,4]]},"221":{"position":[[13,5]]},"225":{"position":[[185,7]]},"271":{"position":[[522,7]]},"314":{"position":[[52,4]]},"426":{"position":[[525,4]]},"428":{"position":[[1151,4]]},"430":{"position":[[419,4]]},"528":{"position":[[203,7]]},"548":{"position":[[200,7]]},"608":{"position":[[196,7]]},"713":{"position":[[182,7]]},"715":{"position":[[12,7]]},"734":{"position":[[182,7]]},"736":{"position":[[12,7]]},"781":{"position":[[182,7]]},"783":{"position":[[12,7]]},"809":{"position":[[182,7]]},"811":{"position":[[12,7]]},"833":{"position":[[182,7]]},"835":{"position":[[12,7]]}}}],["henri",{"_index":2240,"t":{"651":{"position":[[13533,5],[13845,5],[19572,5]]}}}],["here",{"_index":361,"t":{"27":{"position":[[282,5],[453,5]]},"131":{"position":[[596,4]]},"133":{"position":[[1171,4]]},"143":{"position":[[253,4]]},"147":{"position":[[352,5]]},"219":{"position":[[188,4]]},"357":{"position":[[292,5]]},"426":{"position":[[7342,5]]},"625":{"position":[[1509,5]]},"649":{"position":[[26955,4]]},"713":{"position":[[448,4],[842,4]]},"732":{"position":[[334,4],[609,4],[850,4],[1135,4]]},"734":{"position":[[617,4]]},"769":{"position":[[10182,4]]},"781":{"position":[[586,4],[885,4],[1165,4]]},"807":{"position":[[198,4],[445,4]]},"817":{"position":[[441,5]]},"819":{"position":[[808,4]]},"831":{"position":[[208,4],[499,4],[719,4],[1021,4],[1217,4]]},"833":{"position":[[617,4]]}}}],["here'",{"_index":2927,"t":{"850":{"position":[[338,6]]}}}],["hierarch",{"_index":1122,"t":{"133":{"position":[[2192,12],[2297,12]]}}}],["hierarchi",{"_index":1121,"t":{"133":{"position":[[2119,9]]}}}],["high",{"_index":269,"t":{"15":{"position":[[219,4]]},"19":{"position":[[237,4]]},"131":{"position":[[1330,4]]},"133":{"position":[[293,4],[1185,4],[1636,4],[2139,4],[2571,4]]},"310":{"position":[[698,5],[869,4],[1839,4],[2044,5],[2864,5],[3029,5],[3116,5],[3282,4]]},"312":{"position":[[263,4],[295,4],[344,4],[479,4],[584,4],[589,4],[673,4],[678,4],[683,4]]},"602":{"position":[[490,5],[513,4],[620,5],[643,4]]}}}],["higher",{"_index":1329,"t":{"161":{"position":[[864,6],[937,6]]},"719":{"position":[[189,6]]}}}],["highli",{"_index":35,"t":{"3":{"position":[[494,6]]},"169":{"position":[[3703,6]]},"726":{"position":[[27576,6]]},"789":{"position":[[544,6]]},"817":{"position":[[995,6]]}}}],["highlight",{"_index":182,"t":{"7":{"position":[[416,12]]},"422":{"position":[[442,9],[2184,9]]},"424":{"position":[[517,9],[686,9]]}}}],["hilton",{"_index":379,"t":{"27":{"position":[[532,6]]}}}],["hire",{"_index":1536,"t":{"271":{"position":[[147,5]]}}}],["histogram",{"_index":1315,"t":{"159":{"position":[[528,10]]}}}],["home/.openfga",{"_index":1145,"t":{"143":{"position":[[119,14]]}}}],["honor",{"_index":2324,"t":{"677":{"position":[[1748,5]]}}}],["hook",{"_index":931,"t":{"111":{"position":[[754,4],[1148,6]]},"113":{"position":[[1994,5]]}}}],["hope",{"_index":775,"t":{"73":{"position":[[323,6]]}}}],["hopefulli",{"_index":2543,"t":{"751":{"position":[[900,9]]},"753":{"position":[[166,9]]}}}],["host",{"_index":372,"t":{"27":{"position":[[465,4],[781,4]]}}}],["hour",{"_index":2251,"t":{"655":{"position":[[606,6]]},"755":{"position":[[633,6]]},"761":{"position":[[463,5],[2501,5]]},"767":{"position":[[23424,6]]},"769":{"position":[[10230,4],[10305,5],[11085,5],[11237,5],[12632,5],[12843,5],[14673,5],[14835,5],[16290,5],[16451,5],[18213,5],[18369,5]]},"773":{"position":[[4657,5],[4807,5],[4959,5],[5112,5],[5264,5],[5415,5],[5566,5],[7788,5],[7997,5],[8208,5],[8420,5],[8631,5],[8841,5],[9051,5],[11512,5],[11672,5],[11834,5],[11997,5],[12159,5],[12320,5],[12481,5],[14563,5],[14722,5],[14883,5],[15045,5],[15206,5],[15366,5],[15526,5],[19792,5],[19946,5],[20102,5],[20259,5],[20415,5],[20570,5],[20725,5]]}}}],["http",{"_index":270,"t":{"15":{"position":[[244,4]]},"37":{"position":[[1072,6],[1082,8],[1103,7],[2262,6],[2272,8],[2293,7],[4092,6],[4102,8],[4123,7],[5577,6],[5587,8],[5608,7]]},"43":{"position":[[235,7],[682,6],[692,8],[713,7],[1630,6],[1640,8],[1661,7]]},"77":{"position":[[552,7]]},"97":{"position":[[345,6],[355,8],[376,7],[896,6],[906,8],[927,7],[1781,6],[1791,8],[1812,7],[2513,6],[2523,8],[2544,7]]},"113":{"position":[[80,4],[1237,6],[1247,8],[1268,7],[4085,4],[4655,6],[4665,8],[4686,7]]},"123":{"position":[[345,6],[355,8],[376,7],[896,6],[906,8],[927,7],[1781,6],[1791,8],[1812,7],[2513,6],[2523,8],[2544,7]]},"129":{"position":[[144,4]]},"141":{"position":[[279,4],[378,4]]},"145":{"position":[[2531,4],[5162,4]]},"147":{"position":[[475,4],[702,5],[979,4],[1054,4],[1157,4],[1301,4],[1590,4],[1616,4],[1665,4],[1909,4],[2151,5],[2504,4],[2579,4],[2682,4],[2826,4],[3143,4],[3169,4],[3218,4]]},"153":{"position":[[30,4]]},"169":{"position":[[12627,6],[12637,8],[12658,7],[13481,6],[13491,8],[13512,7],[14780,6],[14790,8],[14811,7],[15891,6],[15901,8],[15922,7],[18821,6],[18831,8],[18852,7],[19675,6],[19685,8],[19706,7],[20974,6],[20984,8],[21005,7],[22085,6],[22095,8],[22116,7],[25175,6],[25185,8],[25206,7],[26050,6],[26060,8],[26081,7],[27403,6],[27413,8],[27434,7],[28556,6],[28566,8],[28587,7]]},"215":{"position":[[294,6],[304,8],[325,7],[921,6],[931,8],[952,7],[1716,6],[1726,8],[1747,7],[2444,6],[2454,8],[2475,7]]},"217":{"position":[[642,6],[652,8],[673,7],[1410,6],[1420,8],[1441,7],[2444,6],[2454,8],[2475,7],[3546,6],[3556,8],[3577,7]]},"219":{"position":[[518,6],[528,8],[549,7],[1435,6],[1445,8],[1466,7],[2607,6],[2617,8],[2638,7],[4107,6],[4117,8],[4138,7]]},"236":{"position":[[458,6],[468,8],[489,7],[1267,6],[1277,8],[1298,7],[2676,6],[2686,8],[2707,7],[3811,6],[3821,8],[3842,7]]},"238":{"position":[[468,6],[478,8],[499,7],[1319,6],[1329,8],[1350,7],[2615,6],[2625,8],[2646,7],[3723,6],[3733,8],[3754,7],[6212,6],[6222,8],[6243,7],[7065,6],[7075,8],[7096,7],[8363,6],[8373,8],[8394,7],[9473,6],[9483,8],[9504,7]]},"248":{"position":[[345,6],[355,8],[376,7],[896,6],[906,8],[927,7],[1781,6],[1791,8],[1812,7],[2513,6],[2523,8],[2544,7]]},"265":{"position":[[768,6],[778,8],[799,7],[1609,6],[1619,8],[1640,7],[2895,6],[2905,8],[2926,7],[3993,6],[4003,8],[4024,7]]},"267":{"position":[[479,6],[489,8],[510,7],[1283,6],[1293,8],[1314,7],[2687,6],[2697,8],[2718,7],[3817,6],[3827,8],[3848,7],[6183,6],[6193,8],[6214,7],[7025,6],[7035,8],[7056,7],[8312,6],[8322,8],[8343,7],[9411,6],[9421,8],[9442,7]]},"273":{"position":[[1773,6],[1783,8],[1804,7],[2620,6],[2630,8],[2651,7],[3912,6],[3922,8],[3943,7],[5016,6],[5026,8],[5047,7],[7411,6],[7421,8],[7442,7],[8257,6],[8267,8],[8288,7],[9703,6],[9713,8],[9734,7],[10875,6],[10885,8],[10906,7],[13435,6],[13445,8],[13466,7],[14286,6],[14296,8],[14317,7],[15582,6],[15592,8],[15613,7],[16690,6],[16700,8],[16721,7],[19037,6],[19047,8],[19068,7],[19890,6],[19900,8],[19921,7],[21188,6],[21198,8],[21219,7],[22298,6],[22308,8],[22329,7]]},"282":{"position":[[720,6],[730,8],[751,7],[1528,6],[1538,8],[1559,7],[2936,6],[2946,8],[2967,7],[4070,6],[4080,8],[4101,7]]},"284":{"position":[[511,6],[521,8],[542,7],[1363,6],[1373,8],[1394,7],[2660,6],[2670,8],[2691,7],[3769,6],[3779,8],[3800,7]]},"294":{"position":[[317,6],[327,8],[348,7],[868,6],[878,8],[899,7],[1753,6],[1763,8],[1784,7],[2485,6],[2495,8],[2516,7]]},"329":{"position":[[565,6],[575,8],[596,7],[1365,6],[1375,8],[1396,7],[2765,6],[2775,8],[2796,7],[3891,6],[3901,8],[3922,7],[6146,6],[6156,8],[6177,7],[6947,6],[6957,8],[6978,7],[8348,6],[8358,8],[8379,7],[9475,6],[9485,8],[9506,7],[11960,6],[11970,8],[11991,7],[12930,6],[12940,8],[12961,7],[14575,6],[14585,8],[14606,7],[15908,6],[15918,8],[15939,7]]},"353":{"position":[[607,6],[617,8],[638,7],[1459,6],[1469,8],[1490,7],[2756,6],[2766,8],[2787,7],[3865,6],[3875,8],[3896,7],[6217,6],[6227,8],[6248,7],[7068,6],[7078,8],[7099,7],[8364,6],[8374,8],[8395,7],[9472,6],[9482,8],[9503,7]]},"359":{"position":[[726,6],[736,8],[757,7],[1594,6],[1604,8],[1625,7],[3062,6],[3072,8],[3093,7],[4256,6],[4266,8],[4287,7],[6902,6],[6912,8],[6933,7],[7754,6],[7764,8],[7785,7],[9051,6],[9061,8],[9082,7],[10160,6],[10170,8],[10191,7],[12716,6],[12726,8],[12747,7],[13568,6],[13578,8],[13599,7],[14865,6],[14875,8],[14896,7],[15974,6],[15984,8],[16005,7]]},"375":{"position":[[641,6],[651,8],[672,7],[1500,6],[1510,8],[1531,7],[2804,6],[2814,8],[2835,7],[3920,6],[3930,8],[3951,7]]},"382":{"position":[[1586,6],[1596,8],[1617,7],[2435,6],[2445,8],[2466,7],[3729,6],[3739,8],[3760,7],[4835,6],[4845,8],[4866,7]]},"406":{"position":[[589,6],[599,8],[620,7],[1563,6],[1573,8],[1594,7],[3196,6],[3206,8],[3227,7],[4506,6],[4516,8],[4537,7],[7343,6],[7353,8],[7374,7],[8197,6],[8207,8],[8228,7],[9496,6],[9506,8],[9527,7],[10607,6],[10617,8],[10638,7]]},"408":{"position":[[491,6],[501,8],[522,7],[1575,6],[1585,8],[1606,7],[3318,6],[3328,8],[3349,7],[4738,6],[4748,8],[4769,7]]},"410":{"position":[[437,6],[447,8],[468,7],[1291,6],[1301,8],[1322,7],[2590,6],[2600,8],[2621,7],[3701,6],[3711,8],[3732,7]]},"446":{"position":[[520,6],[530,8],[551,7],[1341,6],[1351,8],[1372,7],[2762,6],[2772,8],[2793,7],[3909,6],[3919,8],[3940,7]]},"448":{"position":[[541,6],[551,8],[572,7],[1400,6],[1410,8],[1431,7],[2704,6],[2714,8],[2735,7],[3820,6],[3830,8],[3851,7],[6378,6],[6388,8],[6409,7],[7238,6],[7248,8],[7269,7],[8543,6],[8553,8],[8574,7],[9660,6],[9670,8],[9691,7]]},"482":{"position":[[607,6],[617,8],[638,7],[1462,6],[1472,8],[1493,7],[2762,6],[2772,8],[2793,7],[3874,6],[3884,8],[3905,7],[6241,6],[6251,8],[6272,7],[7095,6],[7105,8],[7126,7],[8394,6],[8404,8],[8425,7],[9505,6],[9515,8],[9536,7]]},"486":{"position":[[567,6],[577,8],[598,7],[1423,6],[1433,8],[1454,7],[2724,6],[2734,8],[2755,7],[3837,6],[3847,8],[3868,7],[6366,6],[6376,8],[6397,7],[7222,6],[7232,8],[7253,7],[8523,6],[8533,8],[8554,7],[9636,6],[9646,8],[9667,7]]},"504":{"position":[[495,6],[505,8],[526,7],[1302,6],[1312,8],[1333,7],[2709,6],[2719,8],[2740,7],[3842,6],[3852,8],[3873,7]]},"506":{"position":[[497,6],[507,8],[528,7],[1384,6],[1394,8],[1415,7],[2871,6],[2881,8],[2902,7],[4084,6],[4094,8],[4115,7]]},"508":{"position":[[614,6],[624,8],[645,7],[1473,6],[1483,8],[1504,7],[2777,6],[2787,8],[2808,7],[3893,6],[3903,8],[3924,7]]},"522":{"position":[[681,6],[691,8],[712,7],[1540,6],[1550,8],[1571,7],[2999,6],[3009,8],[3030,7],[4184,6],[4194,8],[4215,7]]},"524":{"position":[[746,6],[756,8],[777,7],[1601,6],[1611,8],[1632,7],[2901,6],[2911,8],[2932,7],[4013,6],[4023,8],[4044,7]]},"540":{"position":[[504,6],[514,8],[535,7],[1313,6],[1323,8],[1344,7],[2722,6],[2732,8],[2753,7],[3857,6],[3867,8],[3888,7]]},"542":{"position":[[837,6],[847,8],[868,7],[1723,6],[1733,8],[1754,7],[3209,6],[3219,8],[3240,7],[4421,6],[4431,8],[4452,7]]},"544":{"position":[[674,6],[684,8],[705,7],[1535,6],[1545,8],[1566,7],[2841,6],[2851,8],[2872,7],[3959,6],[3969,8],[3990,7]]},"556":{"position":[[583,6],[593,8],[614,7],[1443,6],[1453,8],[1474,7],[2962,6],[2972,8],[2993,7],[4158,6],[4168,8],[4189,7]]},"560":{"position":[[590,6],[600,8],[621,7],[1446,6],[1456,8],[1477,7],[2961,6],[2971,8],[2992,7],[4153,6],[4163,8],[4184,7]]},"562":{"position":[[601,6],[611,8],[632,7],[1409,6],[1419,8],[1440,7],[2817,6],[2827,8],[2848,7],[3951,6],[3961,8],[3982,7]]},"564":{"position":[[447,6],[457,8],[478,7],[1287,6],[1297,8],[1318,7],[2572,6],[2582,8],[2603,7],[3669,6],[3679,8],[3700,7],[5961,6],[5971,8],[5992,7],[6801,6],[6811,8],[6832,7],[8086,6],[8096,8],[8117,7],[9183,6],[9193,8],[9214,7]]},"566":{"position":[[484,6],[494,8],[515,7],[1284,6],[1294,8],[1315,7],[2684,6],[2694,8],[2715,7],[3810,6],[3820,8],[3841,7],[6021,6],[6031,8],[6052,7],[6862,6],[6872,8],[6893,7],[8148,6],[8158,8],[8179,7],[9246,6],[9256,8],[9277,7]]},"581":{"position":[[606,6],[616,8],[637,7],[1456,6],[1466,8],[1487,7],[2751,6],[2761,8],[2782,7],[3858,6],[3868,8],[3889,7]]},"588":{"position":[[856,6],[866,8],[887,7],[1751,6],[1761,8],[1782,7],[3143,6],[3153,8],[3174,7],[4303,6],[4313,8],[4334,7],[7012,6],[7022,8],[7043,7],[7888,6],[7898,8],[7919,7],[9241,6],[9251,8],[9272,7],[10380,6],[10390,8],[10411,7],[12993,6],[13003,8],[13024,7],[13879,6],[13889,8],[13910,7],[15242,6],[15252,8],[15273,7],[16391,6],[16401,8],[16422,7]]},"590":{"position":[[1059,6],[1069,8],[1090,7],[1836,6],[1846,8],[1867,7],[3110,6],[3120,8],[3141,7],[4152,6],[4162,8],[4183,7]]},"595":{"position":[[597,6],[607,8],[628,7],[1486,6],[1496,8],[1517,7],[2847,6],[2857,8],[2878,7],[4016,6],[4026,8],[4047,7],[6509,6],[6519,8],[6540,7],[7398,6],[7408,8],[7429,7],[8759,6],[8769,8],[8790,7],[9928,6],[9938,8],[9959,7]]},"600":{"position":[[518,6],[528,8],[549,7],[1500,6],[1510,8],[1531,7],[2962,6],[2972,8],[2993,7],[4236,6],[4246,8],[4267,7]]},"619":{"position":[[733,6],[743,8],[764,7],[1658,6],[1668,8],[1689,7],[3183,6],[3193,8],[3214,7],[4434,6],[4444,8],[4465,7]]},"621":{"position":[[548,6],[558,8],[579,7],[1410,6],[1420,8],[1441,7],[2717,6],[2727,8],[2748,7],[3836,6],[3846,8],[3867,7]]},"627":{"position":[[458,6],[468,8],[489,7],[1482,6],[1492,8],[1513,7],[3165,6],[3175,8],[3196,7],[4525,6],[4535,8],[4556,7]]},"629":{"position":[[477,6],[487,8],[508,7],[1331,6],[1341,8],[1362,7],[2630,6],[2640,8],[2661,7],[3741,6],[3751,8],[3772,7]]},"631":{"position":[[458,6],[468,8],[489,7],[1338,6],[1348,8],[1369,7],[2818,6],[2828,8],[2849,7],[4024,6],[4034,8],[4055,7],[6516,6],[6526,8],[6547,7],[7371,6],[7381,8],[7402,7],[8671,6],[8681,8],[8702,7],[9783,6],[9793,8],[9814,7],[12149,6],[12159,8],[12180,7],[13007,6],[13017,8],[13038,7],[14310,6],[14320,8],[14341,7],[15425,6],[15435,8],[15456,7]]},"649":{"position":[[1737,6],[1747,8],[1768,7],[2588,6],[2598,8],[2619,7],[3884,6],[3894,8],[3915,7],[4992,6],[5002,8],[5023,7],[7909,6],[7919,8],[7940,7],[8760,6],[8770,8],[8791,7],[10056,6],[10066,8],[10087,7],[11164,6],[11174,8],[11195,7],[14730,6],[14740,8],[14761,7],[15584,6],[15594,8],[15615,7],[16883,6],[16893,8],[16914,7],[17994,6],[18004,8],[18025,7],[21567,6],[21577,8],[21598,7],[22418,6],[22428,8],[22449,7],[23714,6],[23724,8],[23745,7],[24822,6],[24832,8],[24853,7],[27803,6],[27813,8],[27834,7],[28655,6],[28665,8],[28686,7],[29952,6],[29962,8],[29983,7],[31061,6],[31071,8],[31092,7]]},"651":{"position":[[1710,6],[1720,8],[1741,7],[2562,6],[2572,8],[2593,7],[3859,6],[3869,8],[3890,7],[4968,6],[4978,8],[4999,7],[7959,6],[7969,8],[7990,7],[8814,6],[8824,8],[8845,7],[10114,6],[10124,8],[10145,7],[11226,6],[11236,8],[11257,7],[14303,6],[14313,8],[14334,7],[15156,6],[15166,8],[15187,7],[16454,6],[16464,8],[16485,7],[17564,6],[17574,8],[17595,7],[20626,6],[20636,8],[20657,7],[21479,6],[21489,8],[21510,7],[22777,6],[22787,8],[22808,7],[23887,6],[23897,8],[23918,7]]},"669":{"position":[[5109,6],[5119,8],[5140,7],[5986,6],[5996,8],[6017,7],[7463,6],[7473,8],[7494,7],[8666,6],[8676,8],[8697,7]]},"671":{"position":[[1500,6],[1510,8],[1531,7],[2405,6],[2415,8],[2436,7],[3910,6],[3920,8],[3941,7],[5141,6],[5151,8],[5172,7]]},"691":{"position":[[729,6],[739,8],[760,7],[1673,6],[1683,8],[1704,7],[3276,6],[3286,8],[3307,7],[4556,6],[4566,8],[4587,7],[7277,6],[7287,8],[7308,7],[8129,6],[8139,8],[8160,7],[9426,6],[9436,8],[9457,7],[10535,6],[10545,8],[10566,7],[13272,6],[13282,8],[13303,7],[14124,6],[14134,8],[14155,7],[15421,6],[15431,8],[15452,7],[16530,6],[16540,8],[16561,7],[18958,6],[18968,8],[18989,7],[19812,6],[19822,8],[19843,7],[21111,6],[21121,8],[21142,7],[22222,6],[22232,8],[22253,7],[24584,6],[24594,8],[24615,7],[25437,6],[25447,8],[25468,7],[26735,6],[26745,8],[26766,7],[27845,6],[27855,8],[27876,7]]},"701":{"position":[[1424,6],[1434,8],[1455,7],[2277,6],[2287,8],[2308,7],[3575,6],[3585,8],[3606,7],[4685,6],[4695,8],[4716,7],[7042,6],[7052,8],[7073,7],[7894,6],[7904,8],[7925,7],[9191,6],[9201,8],[9222,7],[10300,6],[10310,8],[10331,7]]},"703":{"position":[[548,6],[558,8],[579,7],[1408,6],[1418,8],[1439,7],[2868,6],[2878,8],[2899,7],[4054,6],[4064,8],[4085,7],[6432,6],[6442,8],[6463,7],[7288,6],[7298,8],[7319,7],[8589,6],[8599,8],[8620,7],[9702,6],[9712,8],[9733,7]]},"705":{"position":[[523,6],[533,8],[554,7],[1486,6],[1496,8],[1517,7],[2886,6],[2896,8],[2917,7],[4108,6],[4118,8],[4139,7],[6800,6],[6810,8],[6831,7],[7685,6],[7695,8],[7716,7],[9229,6],[9239,8],[9260,7],[10450,6],[10460,8],[10481,7],[13062,6],[13072,8],[13093,7],[13948,6],[13958,8],[13979,7],[15493,6],[15503,8],[15524,7],[16715,6],[16725,8],[16746,7],[19364,6],[19374,8],[19395,7],[20217,6],[20227,8],[20248,7],[21515,6],[21525,8],[21546,7],[22625,6],[22635,8],[22656,7],[25027,6],[25037,8],[25058,7],[25878,6],[25888,8],[25909,7],[27174,6],[27184,8],[27205,7],[28282,6],[28292,8],[28313,7]]},"726":{"position":[[562,6],[572,8],[593,7],[2216,6],[2226,8],[2247,7],[4765,6],[4775,8],[4796,7],[6795,6],[6805,8],[6826,7],[11880,6],[11890,8],[11911,7],[13074,6],[13084,8],[13105,7],[14986,6],[14996,8],[15017,7],[16526,6],[16536,8],[16557,7],[20017,6],[20027,8],[20048,7],[21141,6],[21151,8],[21172,7],[22983,6],[22993,8],[23014,7],[24453,6],[24463,8],[24484,7],[28616,6],[28626,8],[28647,7],[29468,6],[29478,8],[29499,7],[30765,6],[30775,8],[30796,7],[31874,6],[31884,8],[31905,7],[34375,6],[34385,8],[34406,7],[35228,6],[35238,8],[35259,7],[36526,6],[36536,8],[36557,7],[37636,6],[37646,8],[37667,7],[39992,6],[40002,8],[40023,7],[40848,6],[40858,8],[40879,7],[42149,6],[42159,8],[42180,7],[43262,6],[43272,8],[43293,7],[45634,6],[45644,8],[45665,7],[46491,6],[46501,8],[46522,7],[47793,6],[47803,8],[47824,7],[48907,6],[48917,8],[48938,7]]},"728":{"position":[[658,6],[668,8],[689,7],[1511,6],[1521,8],[1542,7],[2809,6],[2819,8],[2840,7],[3919,6],[3929,8],[3950,7],[8577,6],[8587,8],[8608,7],[9426,6],[9436,8],[9457,7],[10720,6],[10730,8],[10751,7],[11826,6],[11836,8],[11857,7],[14494,6],[14504,8],[14525,7],[15352,6],[15362,8],[15383,7],[16655,6],[16665,8],[16686,7],[17770,6],[17780,8],[17801,7],[24936,6],[24946,8],[24967,7],[25793,6],[25803,8],[25824,7],[27095,6],[27105,8],[27126,7],[28209,6],[28219,8],[28240,7],[33184,6],[33194,8],[33215,7],[34032,6],[34042,8],[34063,7],[35325,6],[35335,8],[35356,7],[36430,6],[36440,8],[36461,7],[42744,6],[42754,8],[42775,7],[43592,6],[43602,8],[43623,7],[44885,6],[44895,8],[44916,7],[45990,6],[46000,8],[46021,7]]},"745":{"position":[[2189,6],[2199,8],[2220,7],[3005,6],[3015,8],[3036,7],[4421,6],[4431,8],[4452,7],[5563,6],[5573,8],[5594,7],[7873,6],[7883,8],[7904,7],[8727,6],[8737,8],[8758,7],[10026,6],[10036,8],[10057,7],[11137,6],[11147,8],[11168,7],[13563,6],[13573,8],[13594,7],[14379,6],[14389,8],[14410,7],[15795,6],[15805,8],[15826,7],[16937,6],[16947,8],[16968,7],[19204,6],[19214,8],[19235,7],[20058,6],[20068,8],[20089,7],[21357,6],[21367,8],[21388,7],[22468,6],[22478,8],[22499,7],[24830,6],[24840,8],[24861,7],[25685,6],[25695,8],[25716,7],[26985,6],[26995,8],[27016,7],[28097,6],[28107,8],[28128,7],[32564,6],[32574,8],[32595,7],[33418,6],[33428,8],[33449,7],[34717,6],[34727,8],[34748,7],[35828,6],[35838,8],[35859,7],[38190,6],[38200,8],[38221,7],[39044,6],[39054,8],[39075,7],[40343,6],[40353,8],[40374,7],[41454,6],[41464,8],[41485,7]]},"747":{"position":[[2718,6],[2728,8],[2749,7],[3763,6],[3773,8],[3794,7],[5467,6],[5477,8],[5498,7],[6848,6],[6858,8],[6879,7],[10032,6],[10042,8],[10063,7],[10888,6],[10898,8],[10919,7],[12189,6],[12199,8],[12220,7],[13302,6],[13312,8],[13333,7]]},"749":{"position":[[663,6],[673,8],[694,7],[1503,6],[1513,8],[1534,7],[2943,6],[2953,8],[2974,7],[4109,6],[4119,8],[4140,7],[6904,6],[6914,8],[6935,7],[7776,6],[7786,8],[7807,7],[9248,6],[9258,8],[9279,7],[10446,6],[10456,8],[10477,7],[12795,6],[12805,8],[12826,7],[13649,6],[13659,8],[13680,7],[14948,6],[14958,8],[14979,7],[16059,6],[16069,8],[16090,7]]},"751":{"position":[[3360,6],[3370,8],[3391,7],[4260,6],[4270,8],[4291,7],[5819,6],[5829,8],[5850,7],[7055,6],[7065,8],[7086,7],[10244,6],[10254,8],[10275,7],[11102,6],[11112,8],[11133,7],[12405,6],[12415,8],[12436,7],[13520,6],[13530,8],[13551,7],[17678,6],[17688,8],[17709,7],[18516,6],[18526,8],[18547,7],[19954,6],[19964,8],[19985,7],[21118,6],[21128,8],[21149,7]]},"761":{"position":[[2966,6],[2976,8],[2997,7],[4301,6],[4311,8],[4332,7],[6413,6],[6423,8],[6444,7],[8104,6],[8114,8],[8135,7]]},"767":{"position":[[793,6],[803,8],[824,7],[1642,6],[1652,8],[1673,7],[2936,6],[2946,8],[2967,7],[4042,6],[4052,8],[4073,7],[6481,6],[6491,8],[6512,7],[7334,6],[7344,8],[7365,7],[8632,6],[8642,8],[8663,7],[9742,6],[9752,8],[9773,7],[12206,6],[12216,8],[12237,7],[13081,6],[13091,8],[13112,7],[14556,6],[14566,8],[14587,7],[15757,6],[15767,8],[15788,7],[18116,6],[18126,8],[18147,7],[18966,6],[18976,8],[18997,7],[20261,6],[20271,8],[20292,7],[21368,6],[21378,8],[21399,7]]},"769":{"position":[[4908,6],[4918,8],[4939,7],[5753,6],[5763,8],[5784,7],[7043,6],[7053,8],[7074,7],[8145,6],[8155,8],[8176,7],[10713,6],[10723,8],[10744,7],[11956,6],[11966,8],[11987,7],[13917,6],[13927,8],[13948,7],[15506,6],[15516,8],[15537,7],[19256,6],[19266,8],[19287,7],[20254,6],[20264,8],[20285,7],[21911,6],[21921,8],[21942,7],[23245,6],[23255,8],[23276,7],[26195,6],[26205,8],[26226,7],[27044,6],[27054,8],[27075,7],[28338,6],[28348,8],[28369,7],[29444,6],[29454,8],[29475,7]]},"771":{"position":[[1453,6],[1463,8],[1484,7],[2506,6],[2516,8],[2537,7],[4218,6],[4228,8],[4249,7],[5607,6],[5617,8],[5638,7],[8890,6],[8900,8],[8921,7],[9908,6],[9918,8],[9939,7],[11390,6],[11400,8],[11421,7],[12697,6],[12707,8],[12728,7],[15816,6],[15826,8],[15847,7],[16835,6],[16845,8],[16866,7],[18318,6],[18328,8],[18349,7],[19626,6],[19636,8],[19657,7]]},"773":{"position":[[3694,6],[3704,8],[3725,7],[6285,6],[6295,8],[6316,7],[10125,6],[10135,8],[10156,7],[13152,6],[13162,8],[13183,7]]},"795":{"position":[[875,6],[885,8],[906,7],[1690,6],[1700,8],[1721,7],[3105,6],[3115,8],[3136,7],[4246,6],[4256,8],[4277,7],[6523,6],[6533,8],[6554,7],[7342,6],[7352,8],[7373,7],[8761,6],[8771,8],[8792,7],[9906,6],[9916,8],[9937,7],[12207,6],[12217,8],[12238,7],[13169,6],[13179,8],[13200,7],[14849,6],[14859,8],[14880,7],[16157,6],[16167,8],[16188,7],[19441,6],[19451,8],[19472,7],[20294,6],[20304,8],[20325,7],[21592,6],[21602,8],[21623,7],[22702,6],[22712,8],[22733,7],[25140,6],[25150,8],[25171,7],[25991,6],[26001,8],[26022,7],[27287,6],[27297,8],[27318,7],[28395,6],[28405,8],[28426,7]]},"797":{"position":[[3293,6],[3303,8],[3324,7],[4308,6],[4318,8],[4339,7],[6100,6],[6110,8],[6131,7],[7471,6],[7481,8],[7502,7],[10769,6],[10779,8],[10800,7],[11625,6],[11635,8],[11656,7],[12926,6],[12936,8],[12957,7],[14039,6],[14049,8],[14070,7]]},"799":{"position":[[3198,6],[3208,8],[3229,7],[4101,6],[4111,8],[4132,7],[5663,6],[5673,8],[5694,7],[6902,6],[6912,8],[6933,7],[9723,6],[9733,8],[9754,7],[10821,6],[10831,8],[10852,7],[12696,6],[12706,8],[12727,7],[14150,6],[14160,8],[14181,7],[17953,6],[17963,8],[17984,7],[18803,6],[18813,8],[18834,7],[20098,6],[20108,8],[20129,7],[21205,6],[21215,8],[21236,7]]},"801":{"position":[[3393,6],[3403,8],[3424,7],[4358,6],[4368,8],[4389,7],[6041,6],[6051,8],[6072,7],[7352,6],[7362,8],[7383,7],[10645,6],[10655,8],[10676,7],[11500,6],[11510,8],[11531,7],[12800,6],[12810,8],[12831,7],[13912,6],[13922,8],[13943,7]]},"821":{"position":[[2432,6],[2442,8],[2463,7],[3306,6],[3316,8],[3337,7],[4780,6],[4790,8],[4811,7],[5980,6],[5990,8],[6011,7],[8409,6],[8419,8],[8440,7],[9268,6],[9278,8],[9299,7],[10572,6],[10582,8],[10603,7],[11688,6],[11698,8],[11719,7],[14143,6],[14153,8],[14174,7],[15017,6],[15027,8],[15048,7],[16491,6],[16501,8],[16522,7],[17691,6],[17701,8],[17722,7],[20077,6],[20087,8],[20108,7],[20936,6],[20946,8],[20967,7],[22240,6],[22250,8],[22271,7],[23356,6],[23366,8],[23387,7],[25820,6],[25830,8],[25851,7],[26686,6],[26696,8],[26717,7],[27997,6],[28007,8],[28028,7],[29120,6],[29130,8],[29151,7],[31981,6],[31991,8],[32012,7],[33105,6],[33115,8],[33136,7],[34947,6],[34957,8],[34978,7],[36417,6],[36427,8],[36448,7],[39781,6],[39791,8],[39812,7],[40640,6],[40650,8],[40671,7],[41944,6],[41954,8],[41975,7],[43060,6],[43070,8],[43091,7]]},"823":{"position":[[493,6],[503,8],[524,7],[1347,6],[1357,8],[1378,7],[2646,6],[2656,8],[2677,7],[3757,6],[3767,8],[3788,7],[7775,6],[7785,8],[7806,7],[8628,6],[8638,8],[8659,7],[9926,6],[9936,8],[9957,7],[11036,6],[11046,8],[11067,7]]},"825":{"position":[[7261,6],[7271,8],[7292,7],[8300,6],[8310,8],[8331,7],[10057,6],[10067,8],[10088,7],[11442,6],[11452,8],[11473,7],[14877,6],[14887,8],[14908,7],[15820,6],[15830,8],[15851,7],[17363,6],[17373,8],[17394,7],[18632,6],[18642,8],[18663,7],[21320,6],[21330,8],[21351,7],[22307,6],[22317,8],[22338,7],[23953,6],[23963,8],[23984,7],[25276,6],[25286,8],[25307,7],[28154,6],[28164,8],[28185,7],[29056,6],[29066,8],[29087,7],[30617,6],[30627,8],[30648,7],[31855,6],[31865,8],[31886,7],[34638,6],[34648,8],[34669,7],[35483,6],[35493,8],[35514,7],[36928,6],[36938,8],[36959,7],[38099,6],[38109,8],[38130,7],[40525,6],[40535,8],[40556,7],[41353,6],[41363,8],[41384,7],[42781,6],[42791,8],[42812,7],[43935,6],[43945,8],[43966,7],[46426,6],[46436,8],[46457,7],[47277,6],[47287,8],[47308,7],[48573,6],[48583,8],[48604,7],[49681,6],[49691,8],[49712,7],[52097,6],[52107,8],[52128,7],[52963,6],[52973,8],[52994,7],[54274,6],[54284,8],[54305,7],[55397,6],[55407,8],[55428,7]]},"844":{"position":[[2190,6],[2200,8],[2221,7],[3009,6],[3019,8],[3040,7],[4428,6],[4438,8],[4459,7],[5573,6],[5583,8],[5604,7],[7898,6],[7908,8],[7929,7],[8755,6],[8765,8],[8786,7],[10057,6],[10067,8],[10088,7],[11171,6],[11181,8],[11202,7],[13610,6],[13620,8],[13641,7],[14425,6],[14435,8],[14456,7],[15840,6],[15850,8],[15871,7],[16981,6],[16991,8],[17012,7],[19244,6],[19254,8],[19275,7],[20097,6],[20107,8],[20128,7],[21395,6],[21405,8],[21426,7],[22505,6],[22515,8],[22536,7],[24862,6],[24872,8],[24893,7],[25717,6],[25727,8],[25748,7],[27017,6],[27027,8],[27048,7],[28129,6],[28139,8],[28160,7],[32084,6],[32094,8],[32115,7],[32937,6],[32947,8],[32968,7],[34235,6],[34245,8],[34266,7],[35345,6],[35355,8],[35376,7],[37702,6],[37712,8],[37733,7],[38556,6],[38566,8],[38587,7],[39855,6],[39865,8],[39886,7],[40966,6],[40976,8],[40997,7]]},"846":{"position":[[2473,6],[2483,8],[2504,7],[3609,6],[3619,8],[3640,7],[5522,6],[5532,8],[5553,7],[7014,6],[7024,8],[7045,7],[10706,6],[10716,8],[10737,7],[11563,6],[11573,8],[11594,7],[12865,6],[12875,8],[12896,7],[13979,6],[13989,8],[14010,7]]},"848":{"position":[[2306,6],[2316,8],[2337,7],[3321,6],[3331,8],[3352,7],[4995,6],[5005,8],[5026,7],[6346,6],[6356,8],[6377,7],[9619,6],[9629,8],[9650,7],[10479,6],[10489,8],[10510,7],[11784,6],[11794,8],[11815,7],[12901,6],[12911,8],[12932,7]]},"850":{"position":[[3179,6],[3189,8],[3210,7],[4367,6],[4377,8],[4398,7],[6273,6],[6283,8],[6304,7],[7807,6],[7817,8],[7838,7],[11289,6],[11299,8],[11320,7],[12150,6],[12160,8],[12181,7],[13456,6],[13466,8],[13487,7],[14574,6],[14584,8],[14605,7],[17047,6],[17057,8],[17078,7],[17910,6],[17920,8],[17941,7],[19218,6],[19228,8],[19249,7],[20338,6],[20348,8],[20369,7],[22744,6],[22754,8],[22775,7],[23609,6],[23619,8],[23640,7],[24919,6],[24929,8],[24950,7],[26041,6],[26051,8],[26072,7],[28536,6],[28546,8],[28567,7],[29399,6],[29409,8],[29430,7],[30707,6],[30717,8],[30738,7],[31827,6],[31837,8],[31858,7],[34233,6],[34243,8],[34264,7],[35096,6],[35106,8],[35127,7],[36404,6],[36414,8],[36435,7],[37524,6],[37534,8],[37555,7]]}}}],["http://localhost:3000/playground",{"_index":1250,"t":{"149":{"position":[[266,32]]}}}],["http://localhost:8080",{"_index":1424,"t":{"215":{"position":[[3107,21]]},"217":{"position":[[4236,21]]},"219":{"position":[[4797,21]]}}}],["https://api.fga.exampl",{"_index":468,"t":{"37":{"position":[[1218,24],[2409,24],[4265,24],[5730,24],[6980,24],[7069,24],[7562,24],[7651,24]]},"43":{"position":[[829,24],[1803,24]]},"97":{"position":[[491,24],[1043,24],[1954,24],[2666,24],[3199,24],[3316,24]]},"113":{"position":[[4802,24]]},"123":{"position":[[491,24],[1043,24],[1954,24],[2666,24],[3199,24],[3316,24]]},"169":{"position":[[12773,24],[13628,24],[14953,24],[16044,24],[16819,24],[16908,24],[17144,24],[17233,24],[18967,24],[19822,24],[21147,24],[22238,24],[23013,24],[23102,24],[23338,24],[23427,24],[25321,24],[26197,24],[27576,24],[28709,24],[29521,24],[29610,24],[29882,24],[29971,24]]},"215":{"position":[[440,24],[1068,24],[1889,24],[2597,24]]},"217":{"position":[[788,24],[1557,24],[2617,24],[3699,24]]},"219":{"position":[[664,24],[1582,24],[2780,24],[4260,24]]},"236":{"position":[[604,24],[1414,24],[2849,24],[3964,24],[4745,24],[4834,24],[5279,24],[5368,24]]},"238":{"position":[[614,24],[1466,24],[2788,24],[3876,24],[4648,24],[4737,24],[4970,24],[5059,24],[6358,24],[7212,24],[8536,24],[9626,24],[10400,24],[10489,24],[10724,24],[10813,24]]},"248":{"position":[[491,24],[1043,24],[1954,24],[2666,24],[3199,24],[3316,24]]},"265":{"position":[[914,24],[1756,24],[3068,24],[4146,24],[4908,24],[4997,24],[5220,24],[5309,24]]},"267":{"position":[[625,24],[1430,24],[2860,24],[3970,24],[4748,24],[4837,24],[5277,24],[5366,24],[6329,24],[7172,24],[8485,24],[9564,24],[10327,24],[10416,24],[10640,24],[10729,24]]},"273":{"position":[[1919,24],[2767,24],[4085,24],[5169,24],[5937,24],[6026,24],[6255,24],[6344,24],[7557,24],[8404,24],[9876,24],[11028,24],[11845,24],[11934,24],[12377,24],[12466,24],[13581,24],[14433,24],[15755,24],[16843,24],[17615,24],[17704,24],[17937,24],[18026,24],[19183,24],[20037,24],[21361,24],[22451,24],[23225,24],[23314,24],[23549,24],[23638,24]]},"282":{"position":[[866,24],[1675,24],[3109,24],[4223,24],[5005,24],[5094,24],[5538,24],[5627,24]]},"284":{"position":[[657,24],[1510,24],[2833,24],[3922,24],[4695,24],[4784,24],[5018,24],[5107,24]]},"294":{"position":[[463,24],[1015,24],[1926,24],[2638,24],[3199,24]]},"329":{"position":[[711,24],[1512,24],[2938,24],[4044,24],[4816,24],[4905,24],[5341,24],[5430,24],[6292,24],[7094,24],[8521,24],[9628,24],[10403,24],[10492,24],[10929,24],[11018,24],[12106,24],[13077,24],[14748,24],[16061,24],[17013,24],[17102,24]]},"353":{"position":[[753,24],[1606,24],[2929,24],[4018,24],[4791,24],[4880,24],[5114,24],[5203,24],[6363,24],[7215,24],[8537,24],[9625,24],[10397,24],[10486,24],[10719,24],[10808,24]]},"359":{"position":[[872,24],[1741,24],[3235,24],[4409,24],[5248,24],[5337,24],[5787,24],[5876,24],[7048,24],[7901,24],[9224,24],[10313,24],[11086,24],[11175,24],[11409,24],[11498,24],[12862,24],[13715,24],[15038,24],[16127,24],[16900,24],[16989,24],[17223,24],[17312,24]]},"375":{"position":[[787,24],[1647,24],[2977,24],[4073,24],[4853,24],[4942,24],[5183,24],[5272,24]]},"382":{"position":[[1732,24],[2582,24],[3902,24],[4988,24],[5758,24],[5847,24],[6078,24],[6167,24]]},"406":{"position":[[735,24],[1710,24],[3369,24],[4659,24],[5613,24],[5702,24],[6226,24],[6315,24],[7489,24],[8344,24],[9669,24],[10760,24],[11535,24],[11624,24],[11860,24],[11949,24]]},"408":{"position":[[637,24],[1722,24],[3491,24],[4891,24],[5955,24],[6044,24],[6604,24],[6693,24]]},"410":{"position":[[583,24],[1438,24],[2763,24],[3854,24],[4629,24],[4718,24],[4954,24],[5043,24]]},"446":{"position":[[666,24],[1488,24],[2935,24],[4062,24],[4855,24],[4944,24],[5401,24],[5490,24]]},"448":{"position":[[687,24],[1547,24],[2877,24],[3973,24],[4753,24],[4842,24],[5083,24],[5172,24],[6524,24],[7385,24],[8716,24],[9813,24],[10594,24],[10683,24],[10925,24],[11014,24]]},"482":{"position":[[753,24],[1609,24],[2935,24],[4027,24],[4803,24],[4892,24],[5129,24],[5218,24],[6387,24],[7242,24],[8567,24],[9658,24],[10433,24],[10522,24],[10758,24],[10847,24]]},"486":{"position":[[713,24],[1570,24],[2897,24],[3990,24],[4767,24],[4856,24],[5094,24],[5183,24],[6512,24],[7369,24],[8696,24],[9789,24],[10566,24],[10655,24],[10893,24],[10982,24]]},"504":{"position":[[641,24],[1449,24],[2882,24],[3995,24],[4774,24],[4863,24],[5306,24],[5395,24]]},"506":{"position":[[643,24],[1531,24],[3044,24],[4237,24],[5095,24],[5184,24],[5645,24],[5734,24]]},"508":{"position":[[760,24],[1620,24],[2950,24],[4046,24],[4826,24],[4915,24],[5156,24],[5245,24]]},"522":{"position":[[827,24],[1687,24],[3172,24],[4337,24],[5167,24],[5256,24],[5707,24],[5796,24]]},"524":{"position":[[892,24],[1748,24],[3074,24],[4166,24],[4942,24],[5031,24],[5268,24],[5357,24]]},"540":{"position":[[650,24],[1460,24],[2895,24],[4010,24],[4791,24],[4880,24],[5325,24],[5414,24]]},"542":{"position":[[983,24],[1870,24],[3382,24],[4574,24],[5431,24],[5520,24],[5988,24],[6077,24]]},"544":{"position":[[820,24],[1682,24],[3014,24],[4112,24],[4894,24],[4983,24],[5226,24],[5315,24]]},"556":{"position":[[729,24],[1590,24],[3135,24],[4311,24],[5153,24],[5242,24],[5737,24],[5826,24]]},"560":{"position":[[736,24],[1593,24],[3134,24],[4306,24],[5144,24],[5233,24],[5724,24],[5813,24]]},"562":{"position":[[747,24],[1556,24],[2990,24],[4104,24],[4884,24],[4973,24],[5417,24],[5506,24]]},"564":{"position":[[593,24],[1434,24],[2745,24],[3822,24],[4583,24],[4672,24],[4894,24],[4983,24],[6107,24],[6948,24],[8259,24],[9336,24],[10097,24],[10186,24],[10408,24],[10497,24]]},"566":{"position":[[630,24],[1431,24],[2857,24],[3963,24],[4737,24],[4826,24],[5262,24],[5351,24],[6167,24],[7009,24],[8321,24],[9399,24],[10161,24],[10250,24],[10473,24],[10562,24]]},"581":{"position":[[752,24],[1603,24],[2924,24],[4011,24],[4782,24],[4871,24],[5103,24],[5192,24]]},"588":{"position":[[1002,24],[1898,24],[3316,24],[4456,24],[5284,24],[5373,24],[5557,24],[5646,24],[7158,24],[8035,24],[9414,24],[10533,24],[11342,24],[11431,24],[11597,24],[11686,24],[13139,24],[14026,24],[15415,24],[16544,24],[17363,24],[17452,24],[17628,24],[17717,24]]},"590":{"position":[[1205,24],[1983,24],[3283,24],[4305,24],[5015,24],[5104,24],[5288,24],[5377,24]]},"595":{"position":[[743,24],[1633,24],[3020,24],[4169,24],[4943,24],[5032,24],[5255,24],[5344,24],[6655,24],[7545,24],[8932,24],[10081,24],[10855,24],[10944,24],[11167,24],[11256,24]]},"600":{"position":[[664,24],[1647,24],[3135,24],[4389,24],[5302,24],[5391,24],[5718,24],[5807,24]]},"619":{"position":[[879,24],[1805,24],[3356,24],[4587,24],[5483,24],[5572,24],[6032,24],[6121,24]]},"621":{"position":[[694,24],[1557,24],[2890,24],[3989,24],[4772,24],[4861,24],[5105,24],[5194,24]]},"627":{"position":[[604,24],[1629,24],[3338,24],[4678,24],[5682,24],[5771,24],[6313,24],[6402,24]]},"629":{"position":[[623,24],[1478,24],[2803,24],[3894,24],[4669,24],[4758,24],[4994,24],[5083,24]]},"631":{"position":[[604,24],[1485,24],[2991,24],[4177,24],[5030,24],[5119,24],[5585,24],[5674,24],[6662,24],[7518,24],[8844,24],[9936,24],[10712,24],[10801,24],[11038,24],[11127,24],[12295,24],[13154,24],[14483,24],[15578,24],[16357,24],[16446,24],[16686,24],[16775,24]]},"649":{"position":[[1883,24],[2735,24],[4057,24],[5145,24],[5917,24],[6006,24],[6239,24],[6328,24],[8055,24],[8907,24],[10229,24],[11317,24],[12089,24],[12178,24],[12411,24],[12500,24],[14876,24],[15731,24],[17056,24],[18147,24],[18922,24],[19011,24],[19247,24],[19336,24],[21713,24],[22565,24],[23887,24],[24975,24],[25747,24],[25836,24],[26069,24],[26158,24],[27949,24],[28802,24],[30125,24],[31214,24],[31987,24],[32076,24],[32310,24],[32399,24]]},"651":{"position":[[1856,24],[2709,24],[4032,24],[5121,24],[5894,24],[5983,24],[6217,24],[6306,24],[8105,24],[8961,24],[10287,24],[11379,24],[12155,24],[12244,24],[12481,24],[12570,24],[14449,24],[15303,24],[16627,24],[17717,24],[18491,24],[18580,24],[18815,24],[18904,24],[20772,24],[21626,24],[22950,24],[24040,24],[24814,24],[24903,24],[25138,24],[25227,24]]},"669":{"position":[[5255,24],[6133,24],[7636,24],[8819,24],[9667,24],[9756,24],[10211,24],[10300,24]]},"671":{"position":[[1646,24],[2552,24],[4083,24],[5294,24],[6172,24],[6261,24],[6717,24],[6806,24]]},"691":{"position":[[875,24],[1820,24],[3449,24],[4709,24],[5633,24],[5722,24],[6228,24],[6317,24],[7423,24],[8276,24],[9599,24],[10688,24],[11461,24],[11550,24],[11784,24],[11873,24],[13418,24],[14271,24],[15594,24],[16683,24],[17456,24],[17545,24],[17779,24],[17868,24],[19104,24],[19959,24],[21284,24],[22375,24],[23150,24],[23239,24],[23475,24],[23564,24],[24730,24],[25584,24],[26908,24],[27998,24],[28772,24],[28861,24],[29096,24],[29185,24]]},"701":{"position":[[1570,24],[2424,24],[3748,24],[4838,24],[5612,24],[5701,24],[5936,24],[6025,24],[7188,24],[8041,24],[9364,24],[10453,24],[11226,24],[11315,24],[11549,24],[11638,24]]},"703":{"position":[[694,24],[1555,24],[3041,24],[4207,24],[5038,24],[5127,24],[5578,24],[5667,24],[6578,24],[7435,24],[8762,24],[9855,24],[10632,24],[10721,24],[10959,24],[11048,24]]},"705":{"position":[[669,24],[1633,24],[3059,24],[4261,24],[5157,24],[5246,24],[5377,24],[5466,24],[6946,24],[7832,24],[9402,24],[10603,24],[11470,24],[11559,24],[12079,24],[12168,24],[13208,24],[14095,24],[15666,24],[16868,24],[17738,24],[17827,24],[18348,24],[18437,24],[19510,24],[20364,24],[21688,24],[22778,24],[23552,24],[23641,24],[23876,24],[23965,24],[25173,24],[26025,24],[27347,24],[28435,24],[29207,24],[29296,24],[29529,24],[29618,24]]},"726":{"position":[[708,24],[2363,24],[4938,24],[6948,24],[8618,24],[8707,24],[9563,24],[9652,24],[12026,24],[13221,24],[15159,24],[16679,24],[17862,24],[17951,24],[18560,24],[18649,24],[20163,24],[21288,24],[23156,24],[24606,24],[25719,24],[25808,24],[26402,24],[26491,24],[28762,24],[29615,24],[30938,24],[32027,24],[32800,24],[32889,24],[33123,24],[33212,24],[34521,24],[35375,24],[36699,24],[37789,24],[38563,24],[38652,24],[38887,24],[38976,24],[40138,24],[40995,24],[42322,24],[43415,24],[44192,24],[44281,24],[44519,24],[44608,24],[45780,24],[46638,24],[47966,24],[49060,24],[49838,24],[49927,24],[50166,24],[50255,24]]},"728":{"position":[[804,24],[1658,24],[2982,24],[4072,24],[4846,24],[4935,24],[5170,24],[5259,24],[8723,24],[9573,24],[10893,24],[11979,24],[12749,24],[12838,24],[13069,24],[13158,24],[14640,24],[15499,24],[16828,24],[17923,24],[18702,24],[18791,24],[19031,24],[19120,24],[25082,24],[25940,24],[27268,24],[28362,24],[29140,24],[29229,24],[29468,24],[29557,24],[33330,24],[34179,24],[35498,24],[36583,24],[37352,24],[37441,24],[37671,24],[37760,24],[42890,24],[43739,24],[45058,24],[46143,24],[46912,24],[47001,24],[47231,24],[47320,24]]},"745":{"position":[[2335,24],[3152,24],[4594,24],[5716,24],[6504,24],[6593,24],[7045,24],[7134,24],[8019,24],[8874,24],[10199,24],[11290,24],[12065,24],[12154,24],[12390,24],[12479,24],[13709,24],[14526,24],[15968,24],[17090,24],[17878,24],[17967,24],[18419,24],[18508,24],[19350,24],[20205,24],[21530,24],[22621,24],[23396,24],[23485,24],[23721,24],[23810,24],[24976,24],[25832,24],[27158,24],[28250,24],[29026,24],[29115,24],[29352,24],[29441,24],[32710,24],[33565,24],[34890,24],[35981,24],[36756,24],[36845,24],[37081,24],[37170,24],[38336,24],[39191,24],[40516,24],[41607,24],[42382,24],[42471,24],[42707,24],[42796,24]]},"747":{"position":[[2864,24],[3910,24],[5640,24],[7001,24],[8026,24],[8115,24],[8668,24],[8757,24],[10178,24],[11035,24],[12362,24],[13455,24],[14232,24],[14321,24],[14559,24],[14648,24]]},"749":{"position":[[809,24],[1650,24],[3116,24],[4262,24],[5074,24],[5163,24],[5639,24],[5728,24],[7050,24],[7923,24],[9421,24],[10599,24],[11442,24],[11531,24],[11986,24],[12075,24],[12941,24],[13796,24],[15121,24],[16212,24],[16987,24],[17076,24],[17312,24],[17401,24]]},"751":{"position":[[3506,24],[4407,24],[5992,24],[7208,24],[8090,24],[8179,24],[8714,24],[8803,24],[10390,24],[11249,24],[12578,24],[13673,24],[14452,24],[14541,24],[14781,24],[14870,24],[17824,24],[18663,24],[20127,24],[21271,24],[22081,24],[22170,24],[22644,24],[22733,24]]},"761":{"position":[[3112,24],[4448,24],[6586,24],[8257,24],[9590,24],[9679,24],[10373,24],[10462,24]]},"767":{"position":[[939,24],[1789,24],[3109,24],[4195,24],[4965,24],[5054,24],[5285,24],[5374,24],[6627,24],[7481,24],[8805,24],[9895,24],[10669,24],[10758,24],[10993,24],[11082,24],[12352,24],[13228,24],[14729,24],[15910,24],[16756,24],[16845,24],[17302,24],[17391,24],[18262,24],[19113,24],[20434,24],[21521,24],[22292,24],[22381,24],[22613,24],[22702,24]]},"769":{"position":[[5054,24],[5900,24],[7216,24],[8298,24],[9064,24],[9153,24],[9380,24],[9469,24],[10859,24],[12103,24],[14090,24],[15659,24],[16891,24],[16980,24],[17636,24],[17725,24],[19402,24],[20401,24],[22084,24],[23398,24],[24376,24],[24465,24],[24988,24],[25077,24],[26341,24],[27191,24],[28511,24],[29597,24],[30367,24],[30456,24],[30687,24],[30776,24]]},"771":{"position":[[1599,24],[2653,24],[4391,24],[5760,24],[6795,24],[6884,24],[7408,24],[7497,24],[9036,24],[10055,24],[11563,24],[12850,24],[13808,24],[13897,24],[14226,24],[14315,24],[15962,24],[16982,24],[18491,24],[19779,24],[20738,24],[20827,24],[21157,24],[21246,24]]},"773":{"position":[[3840,24],[6432,24],[10298,24],[13305,24],[15966,24],[16055,24],[17448,24],[17537,24]]},"795":{"position":[[1021,24],[1837,24],[3278,24],[4399,24],[5186,24],[5275,24],[5726,24],[5815,24],[6669,24],[7489,24],[8934,24],[10059,24],[10850,24],[10939,24],[11394,24],[11483,24],[12353,24],[13316,24],[15022,24],[16310,24],[17264,24],[17353,24],[17949,24],[18038,24],[19587,24],[20441,24],[21765,24],[22855,24],[23629,24],[23718,24],[23953,24],[24042,24],[25286,24],[26138,24],[27460,24],[28548,24],[29320,24],[29409,24],[29642,24],[29731,24]]},"797":{"position":[[3439,24],[4455,24],[6273,24],[7624,24],[8641,24],[8730,24],[9378,24],[9467,24],[10915,24],[11772,24],[13099,24],[14192,24],[14969,24],[15058,24],[15296,24],[15385,24]]},"799":{"position":[[3344,24],[4248,24],[5836,24],[7055,24],[7940,24],[8029,24],[8567,24],[8656,24],[9869,24],[10968,24],[12869,24],[14303,24],[15403,24],[15492,24],[16223,24],[16312,24],[18099,24],[18950,24],[20271,24],[21358,24],[22129,24],[22218,24],[22450,24],[22539,24]]},"801":{"position":[[3539,24],[4505,24],[6214,24],[7505,24],[8462,24],[8551,24],[9150,24],[9239,24],[10791,24],[11647,24],[12973,24],[14065,24],[14841,24],[14930,24],[15167,24],[15256,24]]},"821":{"position":[[2578,24],[3453,24],[4953,24],[6133,24],[6978,24],[7067,24],[7524,24],[7613,24],[8555,24],[9415,24],[10745,24],[11841,24],[12621,24],[12710,24],[12951,24],[13040,24],[14289,24],[15164,24],[16664,24],[17844,24],[18689,24],[18778,24],[19235,24],[19324,24],[20223,24],[21083,24],[22413,24],[23509,24],[24289,24],[24378,24],[24619,24],[24708,24],[25966,24],[26833,24],[28170,24],[29273,24],[30060,24],[30149,24],[30397,24],[30486,24],[32127,24],[33252,24],[35120,24],[36570,24],[37683,24],[37772,24],[38378,24],[38467,24],[39927,24],[40787,24],[42117,24],[43213,24],[43993,24],[44082,24],[44323,24],[44412,24]]},"823":{"position":[[639,24],[1494,24],[2819,24],[3910,24],[4685,24],[4774,24],[5010,24],[5099,24],[7921,24],[8775,24],[10099,24],[11189,24],[11963,24],[12052,24],[12287,24],[12376,24]]},"825":{"position":[[7407,24],[8447,24],[10230,24],[11595,24],[12626,24],[12715,24],[13388,24],[13477,24],[15023,24],[15967,24],[17536,24],[18785,24],[19699,24],[19788,24],[20253,24],[20342,24],[21466,24],[22454,24],[24126,24],[25429,24],[26397,24],[26486,24],[27001,24],[27090,24],[28300,24],[29203,24],[30790,24],[32008,24],[32892,24],[32981,24],[33518,24],[33607,24],[34784,24],[35630,24],[37101,24],[38252,24],[39069,24],[39158,24],[39639,24],[39728,24],[40671,24],[41500,24],[42954,24],[44088,24],[44888,24],[44977,24],[45441,24],[45530,24],[46572,24],[47424,24],[48746,24],[49834,24],[50606,24],[50695,24],[50928,24],[51017,24],[52243,24],[53110,24],[54447,24],[55550,24],[56337,24],[56426,24],[56674,24],[56763,24]]},"844":{"position":[[2336,24],[3156,24],[4601,24],[5726,24],[6517,24],[6606,24],[7061,24],[7150,24],[8044,24],[8902,24],[10230,24],[11324,24],[12102,24],[12191,24],[12430,24],[12519,24],[13756,24],[14572,24],[16013,24],[17134,24],[17921,24],[18010,24],[18461,24],[18550,24],[19390,24],[20244,24],[21568,24],[22658,24],[23432,24],[23521,24],[23756,24],[23845,24],[25008,24],[25864,24],[27190,24],[28282,24],[29058,24],[29147,24],[29384,24],[29473,24],[32230,24],[33084,24],[34408,24],[35498,24],[36272,24],[36361,24],[36596,24],[36685,24],[37848,24],[38703,24],[40028,24],[41119,24],[41894,24],[41983,24],[42219,24],[42308,24]]},"846":{"position":[[2619,24],[3756,24],[5695,24],[7167,24],[8303,24],[8392,24],[9044,24],[9133,24],[10852,24],[11710,24],[13038,24],[14132,24],[14910,24],[14999,24],[15238,24],[15327,24]]},"848":{"position":[[2452,24],[3468,24],[5168,24],[6499,24],[7494,24],[7583,24],[8124,24],[8213,24],[9765,24],[10626,24],[11957,24],[13054,24],[13835,24],[13924,24],[14166,24],[14255,24]]},"850":{"position":[[3325,24],[4514,24],[6446,24],[7960,24],[9137,24],[9226,24],[9855,24],[9944,24],[11435,24],[12297,24],[13629,24],[14727,24],[15509,24],[15598,24],[15841,24],[15930,24],[17193,24],[18057,24],[19391,24],[20491,24],[21275,24],[21364,24],[21609,24],[21698,24],[22890,24],[23756,24],[25092,24],[26194,24],[26980,24],[27069,24],[27316,24],[27405,24],[28682,24],[29546,24],[30880,24],[31980,24],[32764,24],[32853,24],[33098,24],[33187,24],[34379,24],[35243,24],[36577,24],[37677,24],[38461,24],[38550,24],[38795,24],[38884,24]]}}}],["https://api.openfga.exampl",{"_index":567,"t":{"43":{"position":[[353,28]]},"77":{"position":[[672,28]]}}}],["https://github.com/fullstorydev/grpcurl#instal",{"_index":1272,"t":{"153":{"position":[[302,52]]}}}],["hub",{"_index":1132,"t":{"137":{"position":[[148,3]]}}}],["hudson",{"_index":377,"t":{"27":{"position":[[513,6]]}}}],["human",{"_index":1693,"t":{"359":{"position":[[18244,5]]}}}],["hyphen",{"_index":1840,"t":{"424":{"position":[[2567,8]]}}}],["i.",{"_index":1146,"t":{"143":{"position":[[136,6]]},"169":{"position":[[31885,5]]},"426":{"position":[[2081,6]]},"462":{"position":[[3251,6]]},"691":{"position":[[12704,4]]}}}],["id",{"_index":476,"t":{"37":{"position":[[1405,2],[1886,2],[8301,3]]},"43":{"position":[[394,3],[3082,2],[3180,4]]},"69":{"position":[[218,2],[241,2],[429,2]]},"71":{"position":[[27,2],[353,3]]},"73":{"position":[[808,2]]},"107":{"position":[[177,3]]},"111":{"position":[[1024,2]]},"113":{"position":[[1887,2]]},"145":{"position":[[3205,2]]},"169":{"position":[[5874,2],[30649,2]]},"205":{"position":[[174,2]]},"207":{"position":[[293,3]]},"209":{"position":[[52,2],[203,2],[360,3]]},"308":{"position":[[55,3],[129,3],[256,3]]},"310":{"position":[[1300,3],[1324,3],[1662,3],[1916,4],[2240,3]]},"359":{"position":[[18154,3]]},"375":{"position":[[6008,3],[6104,3]]},"384":{"position":[[880,3]]},"426":{"position":[[1286,2],[1289,4],[1355,4],[6274,2],[6277,4]]},"448":{"position":[[11761,3],[11857,3]]},"452":{"position":[[1100,2],[1198,3]]},"458":{"position":[[64,2]]},"462":{"position":[[2940,2]]},"504":{"position":[[5702,3],[5845,3]]},"514":{"position":[[1619,3],[1762,3]]},"544":{"position":[[6246,3],[6342,3]]},"560":{"position":[[203,3]]},"600":{"position":[[6600,2]]},"619":{"position":[[300,4]]},"621":{"position":[[6358,3],[6455,3]]},"643":{"position":[[379,2],[477,2]]},"691":{"position":[[30254,3],[30397,3]]}}}],["id=$fga_store_id",{"_index":863,"t":{"99":{"position":[[1161,16]]},"169":{"position":[[16957,16],[23151,16]]},"238":{"position":[[4786,16],[10538,16]]},"265":{"position":[[5046,16]]},"267":{"position":[[10465,16]]},"273":{"position":[[6075,16],[17753,16],[23363,16]]},"284":{"position":[[4833,16]]},"353":{"position":[[4929,16],[10535,16]]},"359":{"position":[[11224,16],[17038,16]]},"375":{"position":[[4991,16]]},"382":{"position":[[5896,16]]},"406":{"position":[[11673,16]]},"410":{"position":[[4767,16]]},"448":{"position":[[4891,16],[10732,16]]},"482":{"position":[[4941,16],[10571,16]]},"486":{"position":[[4905,16],[10704,16]]},"508":{"position":[[4964,16]]},"524":{"position":[[5080,16]]},"544":{"position":[[5032,16]]},"564":{"position":[[4721,16],[10235,16]]},"566":{"position":[[10299,16]]},"581":{"position":[[4920,16]]},"621":{"position":[[4910,16]]},"629":{"position":[[4807,16]]},"631":{"position":[[10850,16],[16495,16]]},"649":{"position":[[6055,16],[12227,16],[19060,16],[25885,16],[32125,16]]},"651":{"position":[[6032,16],[12293,16],[18629,16],[24952,16]]},"667":{"position":[[1326,16],[3165,16],[5016,16],[6864,16],[8713,16],[10564,16]]},"669":{"position":[[3908,16],[11794,16]]},"671":{"position":[[8802,16],[11477,16]]},"691":{"position":[[11599,16],[17594,16],[23288,16],[28910,16]]},"701":{"position":[[5750,16],[11364,16]]},"703":{"position":[[10770,16]]},"705":{"position":[[23690,16],[29345,16]]},"726":{"position":[[32938,16],[38701,16],[44330,16],[49976,16]]},"728":{"position":[[4984,16],[12887,16],[18840,16],[29278,16],[37490,16],[47050,16]]},"745":{"position":[[12203,16],[23534,16],[29164,16],[36894,16],[42520,16]]},"747":{"position":[[14370,16]]},"749":{"position":[[17125,16]]},"751":{"position":[[14590,16]]},"767":{"position":[[5103,16],[10807,16],[22430,16]]},"769":{"position":[[9202,16],[30505,16]]},"771":{"position":[[13946,16],[20876,16]]},"795":{"position":[[23767,16],[29458,16]]},"797":{"position":[[15107,16]]},"799":{"position":[[22267,16]]},"801":{"position":[[14979,16]]},"821":{"position":[[12759,16],[24427,16],[30198,16],[44131,16]]},"823":{"position":[[4823,16],[12101,16]]},"825":{"position":[[50744,16],[56475,16]]},"844":{"position":[[12240,16],[23570,16],[29196,16],[36410,16],[42032,16]]},"846":{"position":[[15048,16]]},"848":{"position":[[13973,16]]},"850":{"position":[[15647,16],[21413,16],[27118,16],[32902,16],[38599,16]]}}}],["id=${fga_store_id",{"_index":547,"t":{"37":{"position":[[7118,18]]},"125":{"position":[[1357,18]]},"169":{"position":[[29666,18]]},"236":{"position":[[5417,18]]},"250":{"position":[[1266,18]]},"252":{"position":[[1428,18]]},"267":{"position":[[5416,18]]},"273":{"position":[[12515,18]]},"282":{"position":[[5677,18]]},"296":{"position":[[811,18],[2689,18]]},"298":{"position":[[1842,18],[3585,18]]},"329":{"position":[[5479,18],[11068,18]]},"359":{"position":[[5925,18]]},"406":{"position":[[6364,18],[6484,18]]},"408":{"position":[[6742,18],[6880,18]]},"446":{"position":[[5539,18]]},"466":{"position":[[2828,18]]},"504":{"position":[[5444,18]]},"506":{"position":[[5783,18]]},"522":{"position":[[5845,18]]},"540":{"position":[[5463,18]]},"542":{"position":[[6126,18]]},"556":{"position":[[5875,18],[5980,18]]},"560":{"position":[[5862,18],[5965,18]]},"562":{"position":[[5555,18]]},"566":{"position":[[5401,18]]},"588":{"position":[[5421,18],[11479,18],[17500,18]]},"590":{"position":[[5152,18]]},"595":{"position":[[5082,18],[10994,18]]},"600":{"position":[[5447,18]]},"619":{"position":[[6170,18]]},"627":{"position":[[6451,18],[6575,18]]},"631":{"position":[[5724,18]]},"661":{"position":[[8877,18],[9000,18],[9123,18],[9246,18],[9369,18],[9492,18],[9605,18]]},"669":{"position":[[10349,18]]},"671":{"position":[[6856,18]]},"673":{"position":[[8416,18],[8539,18],[8662,18],[8785,18],[8908,18],[9031,18],[9144,18]]},"691":{"position":[[6366,18],[6476,18]]},"703":{"position":[[5716,18]]},"705":{"position":[[5294,18],[12217,18],[12333,18],[18487,18],[18565,18]]},"726":{"position":[[9701,18],[9824,18],[9947,18],[10073,18],[10202,18],[10334,18],[18698,18],[18820,18],[18942,18],[26540,18],[26658,18],[26776,18]]},"745":{"position":[[7183,18],[18557,18]]},"747":{"position":[[8806,18],[8933,18]]},"749":{"position":[[5777,18],[12124,18]]},"751":{"position":[[8852,18],[8972,18],[22782,18]]},"761":{"position":[[10511,18],[10636,18],[10762,18],[10889,18]]},"767":{"position":[[17440,18]]},"769":{"position":[[17774,18],[17906,18],[18038,18],[25126,18],[25252,18]]},"771":{"position":[[7547,18],[7635,18]]},"773":{"position":[[17586,18],[17711,18],[17837,18],[17964,18],[18089,18],[18219,18],[18350,18],[18482,18],[18614,18],[18746,18],[18878,18],[19010,18]]},"795":{"position":[[5864,18],[11532,18],[18087,18],[18206,18],[18329,18]]},"797":{"position":[[9516,18],[9632,18],[9742,18],[9861,18]]},"799":{"position":[[8705,18],[8835,18],[16361,18],[16502,18],[16643,18],[16772,18]]},"801":{"position":[[9288,18],[9408,18],[9532,18]]},"821":{"position":[[7662,18],[19373,18],[38516,18],[38643,18],[38763,18]]},"825":{"position":[[13526,18],[13662,18],[13809,18],[20391,18],[27139,18],[27253,18],[33656,18],[33781,18],[39777,18],[45579,18]]},"844":{"position":[[7199,18],[18599,18]]},"846":{"position":[[9182,18],[9292,18],[9402,18],[9515,18]]},"848":{"position":[[8262,18],[8385,18]]},"850":{"position":[[9993,18],[10120,18],[10259,18]]}}}],["id=1uhxcsutp0vkpysnkq1pbb1jezw",{"_index":864,"t":{"99":{"position":[[1186,30]]},"125":{"position":[[1384,30]]},"169":{"position":[[16982,30],[23176,30],[29693,30]]},"236":{"position":[[5444,30]]},"238":{"position":[[4811,30],[10563,30]]},"250":{"position":[[1293,30]]},"265":{"position":[[5071,30]]},"267":{"position":[[10490,30]]},"273":{"position":[[6100,30],[12542,30],[17778,30],[23388,30]]},"284":{"position":[[4858,30]]},"329":{"position":[[5506,30]]},"353":{"position":[[4954,30],[10560,30]]},"359":{"position":[[5952,30],[11249,30],[17063,30]]},"375":{"position":[[5016,30]]},"382":{"position":[[5921,30]]},"406":{"position":[[6391,30],[6511,30],[11698,30]]},"408":{"position":[[6769,30],[6907,30]]},"410":{"position":[[4792,30]]},"446":{"position":[[5566,30]]},"448":{"position":[[4916,30],[10757,30]]},"466":{"position":[[2855,30]]},"482":{"position":[[4966,30],[10596,30]]},"486":{"position":[[4930,30],[10729,30]]},"504":{"position":[[5471,30]]},"506":{"position":[[5810,30]]},"508":{"position":[[4989,30]]},"522":{"position":[[5872,30]]},"524":{"position":[[5105,30]]},"540":{"position":[[5490,30]]},"542":{"position":[[6153,30]]},"544":{"position":[[5057,30]]},"556":{"position":[[5902,30],[6007,30]]},"560":{"position":[[5889,30],[5992,30]]},"562":{"position":[[5582,30]]},"564":{"position":[[4746,30],[10260,30]]},"566":{"position":[[10324,30]]},"581":{"position":[[4945,30]]},"595":{"position":[[5109,30],[11021,30]]},"600":{"position":[[5474,30]]},"619":{"position":[[6197,30]]},"621":{"position":[[4935,30]]},"627":{"position":[[6478,30],[6602,30]]},"629":{"position":[[4832,30]]},"631":{"position":[[10875,30],[16520,30]]},"649":{"position":[[6080,30],[12252,30],[19085,30],[25910,30],[32150,30]]},"651":{"position":[[6057,30],[12318,30],[18654,30],[24977,30]]},"661":{"position":[[8904,30],[9027,30],[9150,30],[9273,30],[9396,30],[9519,30],[9632,30]]},"667":{"position":[[1351,30],[3190,30],[5041,30],[6889,30],[8738,30],[10589,30]]},"669":{"position":[[3933,30],[10376,30],[11819,30]]},"671":{"position":[[8827,30],[11502,30]]},"673":{"position":[[8443,30],[8566,30],[8689,30],[8812,30],[8935,30],[9058,30],[9171,30]]},"691":{"position":[[6393,30],[6503,30],[11624,30],[17619,30],[23313,30],[28935,30]]},"701":{"position":[[5775,30],[11389,30]]},"703":{"position":[[5743,30],[10795,30]]},"705":{"position":[[12244,30],[12360,30],[23715,30],[29370,30]]},"726":{"position":[[9728,30],[9851,30],[9974,30],[10100,30],[10229,30],[10361,30],[18725,30],[18847,30],[18969,30],[26567,30],[26685,30],[26803,30],[32963,30],[38726,30],[44355,30],[50001,30]]},"728":{"position":[[5009,30],[12912,30],[18865,30],[29303,30],[37515,30],[47075,30]]},"745":{"position":[[7210,30],[12228,30],[18584,30],[23559,30],[29189,30],[36919,30],[42545,30]]},"747":{"position":[[8833,30],[8960,30],[14395,30]]},"749":{"position":[[5804,30],[12151,30],[17150,30]]},"751":{"position":[[8879,30],[8999,30],[14615,30],[22809,30]]},"761":{"position":[[10538,30],[10663,30],[10789,30],[10916,30]]},"767":{"position":[[5128,30],[10832,30],[17467,30],[22455,30]]},"769":{"position":[[9227,30],[17801,30],[17933,30],[18065,30],[25153,30],[25279,30],[30530,30]]},"771":{"position":[[13971,30],[20901,30]]},"773":{"position":[[17613,30],[17738,30],[17864,30],[17991,30],[18116,30],[18246,30],[18377,30],[18509,30],[18641,30],[18773,30],[18905,30],[19037,30]]},"795":{"position":[[5891,30],[11559,30],[18114,30],[18233,30],[18356,30],[23792,30],[29483,30]]},"797":{"position":[[9543,30],[9659,30],[9769,30],[9888,30],[15132,30]]},"799":{"position":[[8732,30],[8862,30],[16388,30],[16529,30],[16670,30],[16799,30],[22292,30]]},"801":{"position":[[9315,30],[9435,30],[9559,30],[15004,30]]},"821":{"position":[[7689,30],[12784,30],[19400,30],[24452,30],[30223,30],[38543,30],[38670,30],[38790,30],[44156,30]]},"823":{"position":[[4848,30],[12126,30]]},"825":{"position":[[13553,30],[13689,30],[13836,30],[20418,30],[27166,30],[27280,30],[33683,30],[33808,30],[39804,30],[45606,30],[50769,30],[56500,30]]},"844":{"position":[[7226,30],[12265,30],[18626,30],[23595,30],[29221,30],[36435,30],[42057,30]]},"846":{"position":[[9209,30],[9319,30],[9429,30],[9542,30],[15073,30]]},"848":{"position":[[8289,30],[8412,30],[13998,30]]},"850":{"position":[[10020,30],[10147,30],[10286,30],[15672,30],[21438,30],[27143,30],[32927,30],[38624,30]]}}}],["idea",{"_index":2487,"t":{"728":{"position":[[38611,4]]}}}],["ideal",{"_index":1620,"t":{"310":{"position":[[2651,6]]}}}],["ident",{"_index":286,"t":{"17":{"position":[[61,9]]},"111":{"position":[[212,9]]}}}],["identifi",{"_index":1354,"t":{"169":{"position":[[4225,11],[4621,10],[4675,11],[5830,10]]},"205":{"position":[[104,12]]},"207":{"position":[[43,12],[95,11]]},"359":{"position":[[18259,11]]},"380":{"position":[[506,11]]},"422":{"position":[[78,8]]},"424":{"position":[[190,8]]},"426":{"position":[[108,11]]},"458":{"position":[[312,11]]},"460":{"position":[[2984,8]]},"726":{"position":[[27620,12]]},"747":{"position":[[9645,12]]},"751":{"position":[[772,11]]},"789":{"position":[[588,12]]},"817":{"position":[[1039,12]]},"846":{"position":[[10319,12]]}}}],["idl",{"_index":1069,"t":{"131":{"position":[[1576,4],[1597,4]]}}}],["ignor",{"_index":2125,"t":{"590":{"position":[[283,6]]}}}],["il",{"_index":348,"t":{"27":{"position":[[73,3]]}}}],["illustr",{"_index":848,"t":{"91":{"position":[[18,10]]},"103":{"position":[[18,10]]},"117":{"position":[[18,10]]},"207":{"position":[[300,10]]},"242":{"position":[[18,10]]},"288":{"position":[[13,11]]},"375":{"position":[[6116,10]]},"448":{"position":[[11869,10]]},"456":{"position":[[56,10]]},"504":{"position":[[5852,10]]},"514":{"position":[[1774,10]]},"544":{"position":[[6354,10]]},"621":{"position":[[6467,10]]},"647":{"position":[[3,10]]},"685":{"position":[[3,10]]},"691":{"position":[[30409,10]]}}}],["imag",{"_index":1137,"t":{"141":{"position":[[178,6]]},"145":{"position":[[1642,6],[1949,6],[2253,6],[4286,6],[4620,6],[4904,6]]}}}],["imagin",{"_index":1564,"t":{"282":{"position":[[0,7],[90,7]]},"298":{"position":[[0,7]]},"382":{"position":[[0,7]]},"384":{"position":[[0,7]]},"402":{"position":[[776,7]]},"428":{"position":[[1502,7]]},"562":{"position":[[5,7]]},"801":{"position":[[296,7]]}}}],["immedi",{"_index":1588,"t":{"296":{"position":[[3332,12]]},"386":{"position":[[1459,11]]}}}],["immut",{"_index":421,"t":{"31":{"position":[[906,9],[972,9]]},"65":{"position":[[36,10]]},"726":{"position":[[27610,9]]},"789":{"position":[[578,9]]},"817":{"position":[[1029,9]]}}}],["impact",{"_index":1049,"t":{"131":{"position":[[569,6]]},"133":{"position":[[431,8],[1252,9],[1458,9]]}}}],["implement",{"_index":201,"t":{"9":{"position":[[46,15]]},"31":{"position":[[1152,14]]},"73":{"position":[[558,9]]},"219":{"position":[[115,11]]},"223":{"position":[[768,12]]},"300":{"position":[[9,9]]},"310":{"position":[[1866,10]]},"345":{"position":[[524,12]]},"677":{"position":[[1006,12]]}}}],["impli",{"_index":691,"t":{"53":{"position":[[2666,7]]},"169":{"position":[[9773,8],[9802,7],[10086,7],[10217,7],[11116,7],[12035,7]]},"193":{"position":[[260,7],[391,7]]},"363":{"position":[[296,7]]},"373":{"position":[[907,7]]},"386":{"position":[[707,5]]},"416":{"position":[[759,7]]},"462":{"position":[[1628,7]]},"581":{"position":[[5879,7]]},"621":{"position":[[5934,5]]},"649":{"position":[[33351,7]]},"685":{"position":[[361,7],[534,7]]},"689":{"position":[[367,7]]},"713":{"position":[[787,5],[931,7]]},"728":{"position":[[6617,7],[6899,7],[7014,7],[30478,7],[30999,7]]},"730":{"position":[[332,7]]},"732":{"position":[[503,5],[948,7],[1068,7]]},"781":{"position":[[830,5]]},"797":{"position":[[219,8]]},"807":{"position":[[397,5]]},"823":{"position":[[5963,7]]},"825":{"position":[[2902,7],[2932,7],[21738,5],[23029,5],[24755,5],[26106,5],[27436,5]]},"831":{"position":[[393,5],[815,7],[1150,7]]}}}],["implicitli",{"_index":708,"t":{"55":{"position":[[1261,10]]},"375":{"position":[[124,10]]}}}],["import",{"_index":454,"t":{"37":{"position":[[835,6],[2012,6],[3677,6],[5386,6],[5396,6],[5408,6],[5451,6],[6259,6]]},"43":{"position":[[89,6],[466,6],[2296,6],[2306,6],[2349,6],[2415,6]]},"73":{"position":[[987,6]]},"77":{"position":[[326,6],[356,6],[1255,6],[1285,6]]},"97":{"position":[[108,6],[646,6],[1366,6],[2322,6],[2332,6],[2344,6],[2387,6]]},"109":{"position":[[1398,6]]},"111":{"position":[[1599,6]]},"113":{"position":[[935,6],[2752,6]]},"123":{"position":[[108,6],[646,6],[1366,6],[2322,6],[2332,6],[2344,6],[2387,6]]},"169":{"position":[[12390,6],[13231,6],[14365,6],[15700,6],[15710,6],[15722,6],[15765,6],[18584,6],[19425,6],[20559,6],[21894,6],[21904,6],[21916,6],[21959,6],[24938,6],[25800,6],[26988,6],[28365,6],[28375,6],[28387,6],[28430,6]]},"215":{"position":[[153,6],[705,6],[2261,6],[2271,6],[2314,6]]},"217":{"position":[[482,6],[1154,6],[3164,6],[3174,6],[3217,6],[3267,6]]},"219":{"position":[[358,6],[1179,6],[3554,6],[3564,6],[3607,6],[3657,6]]},"236":{"position":[[221,6],[1017,6],[2261,6],[3620,6],[3630,6],[3642,6],[3685,6]]},"238":{"position":[[231,6],[1069,6],[2200,6],[3532,6],[3542,6],[3554,6],[3597,6],[5975,6],[6815,6],[7948,6],[9282,6],[9292,6],[9304,6],[9347,6]]},"248":{"position":[[108,6],[646,6],[1366,6],[2322,6],[2332,6],[2344,6],[2387,6]]},"265":{"position":[[531,6],[1359,6],[2480,6],[3802,6],[3812,6],[3824,6],[3867,6]]},"267":{"position":[[242,6],[1033,6],[2272,6],[3626,6],[3636,6],[3648,6],[3691,6],[5946,6],[6775,6],[7897,6],[9220,6],[9230,6],[9242,6],[9285,6]]},"273":{"position":[[1536,6],[2370,6],[3497,6],[4825,6],[4835,6],[4847,6],[4890,6],[7174,6],[8007,6],[9288,6],[10684,6],[10694,6],[10706,6],[10749,6],[13198,6],[14036,6],[15167,6],[16499,6],[16509,6],[16521,6],[16564,6],[18800,6],[19640,6],[20773,6],[22107,6],[22117,6],[22129,6],[22172,6]]},"282":{"position":[[483,6],[1278,6],[2521,6],[3879,6],[3889,6],[3901,6],[3944,6]]},"284":{"position":[[274,6],[1113,6],[2245,6],[3578,6],[3588,6],[3600,6],[3643,6]]},"294":{"position":[[80,6],[618,6],[1338,6],[2294,6],[2304,6],[2316,6],[2359,6]]},"329":{"position":[[328,6],[1115,6],[2350,6],[3700,6],[3710,6],[3722,6],[3765,6],[5909,6],[6697,6],[7933,6],[9284,6],[9294,6],[9306,6],[9349,6],[11723,6],[12680,6],[14160,6],[15717,6],[15727,6],[15739,6],[15782,6]]},"353":{"position":[[370,6],[1209,6],[2341,6],[3674,6],[3684,6],[3696,6],[3739,6],[5980,6],[6818,6],[7949,6],[9281,6],[9291,6],[9303,6],[9346,6]]},"359":{"position":[[489,6],[1344,6],[2647,6],[4065,6],[4075,6],[4087,6],[4130,6],[6665,6],[7504,6],[8636,6],[9969,6],[9979,6],[9991,6],[10034,6],[12479,6],[13318,6],[14450,6],[15783,6],[15793,6],[15805,6],[15848,6]]},"375":{"position":[[404,6],[1250,6],[2389,6],[3729,6],[3739,6],[3751,6],[3794,6]]},"382":{"position":[[1349,6],[2185,6],[3314,6],[4644,6],[4654,6],[4666,6],[4709,6]]},"406":{"position":[[352,6],[1313,6],[2781,6],[4315,6],[4325,6],[4337,6],[4380,6],[7106,6],[7947,6],[9081,6],[10416,6],[10426,6],[10438,6],[10481,6]]},"408":{"position":[[254,6],[1325,6],[2903,6],[4547,6],[4557,6],[4569,6],[4612,6]]},"410":{"position":[[200,6],[1041,6],[2175,6],[3510,6],[3520,6],[3532,6],[3575,6]]},"418":{"position":[[403,9]]},"420":{"position":[[200,9],[289,9],[403,9],[424,9],[539,9]]},"422":{"position":[[4331,9]]},"424":{"position":[[78,9]]},"426":{"position":[[735,9],[1410,9],[2988,9],[3404,9],[5506,9],[7914,10]]},"428":{"position":[[57,9]]},"446":{"position":[[283,6],[1091,6],[2347,6],[3718,6],[3728,6],[3740,6],[3783,6]]},"448":{"position":[[304,6],[1150,6],[2289,6],[3629,6],[3639,6],[3651,6],[3694,6],[6141,6],[6988,6],[8128,6],[9469,6],[9479,6],[9491,6],[9534,6]]},"482":{"position":[[370,6],[1212,6],[2347,6],[3683,6],[3693,6],[3705,6],[3748,6],[6004,6],[6845,6],[7979,6],[9314,6],[9324,6],[9336,6],[9379,6]]},"486":{"position":[[330,6],[1173,6],[2309,6],[3646,6],[3656,6],[3668,6],[3711,6],[6129,6],[6972,6],[8108,6],[9445,6],[9455,6],[9467,6],[9510,6]]},"504":{"position":[[258,6],[1052,6],[2294,6],[3651,6],[3661,6],[3673,6],[3716,6]]},"506":{"position":[[260,6],[1134,6],[2456,6],[3893,6],[3903,6],[3915,6],[3958,6]]},"508":{"position":[[377,6],[1223,6],[2362,6],[3702,6],[3712,6],[3724,6],[3767,6]]},"522":{"position":[[444,6],[1290,6],[2584,6],[3993,6],[4003,6],[4015,6],[4058,6]]},"524":{"position":[[509,6],[1351,6],[2486,6],[3822,6],[3832,6],[3844,6],[3887,6]]},"540":{"position":[[267,6],[1063,6],[2307,6],[3666,6],[3676,6],[3688,6],[3731,6]]},"542":{"position":[[600,6],[1473,6],[2794,6],[4230,6],[4240,6],[4252,6],[4295,6]]},"544":{"position":[[437,6],[1285,6],[2426,6],[3768,6],[3778,6],[3790,6],[3833,6]]},"556":{"position":[[346,6],[1193,6],[2547,6],[3967,6],[3977,6],[3989,6],[4032,6]]},"560":{"position":[[353,6],[1196,6],[2546,6],[3962,6],[3972,6],[3984,6],[4027,6]]},"562":{"position":[[364,6],[1159,6],[2402,6],[3760,6],[3770,6],[3782,6],[3825,6]]},"564":{"position":[[210,6],[1037,6],[2157,6],[3478,6],[3488,6],[3500,6],[3543,6],[5724,6],[6551,6],[7671,6],[8992,6],[9002,6],[9014,6],[9057,6]]},"566":{"position":[[247,6],[1034,6],[2269,6],[3619,6],[3629,6],[3641,6],[3684,6],[5784,6],[6612,6],[7733,6],[9055,6],[9065,6],[9077,6],[9120,6]]},"581":{"position":[[369,6],[1206,6],[2336,6],[3667,6],[3677,6],[3689,6],[3732,6]]},"588":{"position":[[619,6],[1501,6],[2728,6],[4112,6],[4122,6],[4134,6],[4177,6],[6775,6],[7638,6],[8826,6],[10189,6],[10199,6],[10211,6],[10254,6],[12756,6],[13629,6],[14827,6],[16200,6],[16210,6],[16222,6],[16265,6]]},"590":{"position":[[822,6],[1586,6],[2695,6],[3961,6],[3971,6],[3983,6],[4026,6]]},"595":{"position":[[360,6],[1236,6],[2432,6],[3825,6],[3835,6],[3847,6],[3890,6],[6272,6],[7148,6],[8344,6],[9737,6],[9747,6],[9759,6],[9802,6]]},"600":{"position":[[281,6],[1250,6],[2547,6],[4045,6],[4055,6],[4067,6],[4110,6]]},"619":{"position":[[496,6],[1408,6],[2768,6],[4243,6],[4253,6],[4265,6],[4308,6]]},"621":{"position":[[311,6],[1160,6],[2302,6],[3645,6],[3655,6],[3667,6],[3710,6],[5870,9]]},"627":{"position":[[221,6],[1232,6],[2750,6],[4334,6],[4344,6],[4356,6],[4399,6]]},"629":{"position":[[240,6],[1081,6],[2215,6],[3550,6],[3560,6],[3572,6],[3615,6]]},"631":{"position":[[221,6],[1088,6],[2403,6],[3833,6],[3843,6],[3855,6],[3898,6],[6279,6],[7121,6],[8256,6],[9592,6],[9602,6],[9614,6],[9657,6],[11912,6],[12757,6],[13895,6],[15234,6],[15244,6],[15256,6],[15299,6]]},"649":{"position":[[1500,6],[2338,6],[3469,6],[4801,6],[4811,6],[4823,6],[4866,6],[7672,6],[8510,6],[9641,6],[10973,6],[10983,6],[10995,6],[11038,6],[14493,6],[15334,6],[16468,6],[17803,6],[17813,6],[17825,6],[17868,6],[21330,6],[22168,6],[23299,6],[24631,6],[24641,6],[24653,6],[24696,6],[27566,6],[28405,6],[29537,6],[30870,6],[30880,6],[30892,6],[30935,6]]},"651":{"position":[[1473,6],[2312,6],[3444,6],[4777,6],[4787,6],[4799,6],[4842,6],[7722,6],[8564,6],[9699,6],[11035,6],[11045,6],[11057,6],[11100,6],[14066,6],[14906,6],[16039,6],[17373,6],[17383,6],[17395,6],[17438,6],[20389,6],[21229,6],[22362,6],[23696,6],[23706,6],[23718,6],[23761,6]]},"669":{"position":[[4872,6],[5736,6],[7048,6],[8475,6],[8485,6],[8497,6],[8540,6]]},"671":{"position":[[1263,6],[2155,6],[3495,6],[4950,6],[4960,6],[4972,6],[5015,6]]},"691":{"position":[[492,6],[1423,6],[2861,6],[4365,6],[4375,6],[4387,6],[4430,6],[7040,6],[7879,6],[9011,6],[10344,6],[10354,6],[10366,6],[10409,6],[13035,6],[13874,6],[15006,6],[16339,6],[16349,6],[16361,6],[16404,6],[18721,6],[19562,6],[20696,6],[22031,6],[22041,6],[22053,6],[22096,6],[24347,6],[25187,6],[26320,6],[27654,6],[27664,6],[27676,6],[27719,6]]},"701":{"position":[[1187,6],[2027,6],[3160,6],[4494,6],[4504,6],[4516,6],[4559,6],[6805,6],[7644,6],[8776,6],[10109,6],[10119,6],[10131,6],[10174,6]]},"703":{"position":[[311,6],[1158,6],[2453,6],[3863,6],[3873,6],[3885,6],[3928,6],[6195,6],[7038,6],[8174,6],[9511,6],[9521,6],[9533,6],[9576,6]]},"705":{"position":[[286,6],[1236,6],[2471,6],[3917,6],[3927,6],[3939,6],[3982,6],[6563,6],[7435,6],[8814,6],[10259,6],[10269,6],[10281,6],[10324,6],[12825,6],[13698,6],[15078,6],[16524,6],[16534,6],[16546,6],[16589,6],[19127,6],[19967,6],[21100,6],[22434,6],[22444,6],[22456,6],[22499,6],[24790,6],[25628,6],[26759,6],[28091,6],[28101,6],[28113,6],[28156,6]]},"726":{"position":[[325,6],[1966,6],[4350,6],[6604,6],[6614,6],[6626,6],[6669,6],[11643,6],[12824,6],[14571,6],[16335,6],[16345,6],[16357,6],[16400,6],[19780,6],[20891,6],[22568,6],[24262,6],[24272,6],[24284,6],[24327,6],[28379,6],[29218,6],[30350,6],[31683,6],[31693,6],[31705,6],[31748,6],[34138,6],[34978,6],[36111,6],[37445,6],[37455,6],[37467,6],[37510,6],[39755,6],[40598,6],[41734,6],[43071,6],[43081,6],[43093,6],[43136,6],[45397,6],[46241,6],[47378,6],[48716,6],[48726,6],[48738,6],[48781,6]]},"728":{"position":[[421,6],[1261,6],[2394,6],[3728,6],[3738,6],[3750,6],[3793,6],[8340,6],[9176,6],[10305,6],[11635,6],[11645,6],[11657,6],[11700,6],[14257,6],[15102,6],[16240,6],[17579,6],[17589,6],[17601,6],[17644,6],[24699,6],[25543,6],[26680,6],[28018,6],[28028,6],[28040,6],[28083,6],[32947,6],[33782,6],[34910,6],[36239,6],[36249,6],[36261,6],[36304,6],[42507,6],[43342,6],[44470,6],[45799,6],[45809,6],[45821,6],[45864,6]]},"745":{"position":[[1952,6],[2755,6],[4006,6],[5372,6],[5382,6],[5394,6],[5437,6],[7636,6],[8477,6],[9611,6],[10946,6],[10956,6],[10968,6],[11011,6],[13326,6],[14129,6],[15380,6],[16746,6],[16756,6],[16768,6],[16811,6],[18967,6],[19808,6],[20942,6],[22277,6],[22287,6],[22299,6],[22342,6],[24593,6],[25435,6],[26570,6],[27906,6],[27916,6],[27928,6],[27971,6],[32327,6],[33168,6],[34302,6],[35637,6],[35647,6],[35659,6],[35702,6],[37953,6],[38794,6],[39928,6],[41263,6],[41273,6],[41285,6],[41328,6]]},"747":{"position":[[2481,6],[3513,6],[5052,6],[6657,6],[6667,6],[6679,6],[6722,6],[9795,6],[10638,6],[11774,6],[13111,6],[13121,6],[13133,6],[13176,6]]},"749":{"position":[[426,6],[1253,6],[2528,6],[3918,6],[3928,6],[3940,6],[3983,6],[6667,6],[7526,6],[8833,6],[10255,6],[10265,6],[10277,6],[10320,6],[12558,6],[13399,6],[14533,6],[15868,6],[15878,6],[15890,6],[15933,6]]},"751":{"position":[[3123,6],[4010,6],[5404,6],[6864,6],[6874,6],[6886,6],[6929,6],[10007,6],[10852,6],[11990,6],[13329,6],[13339,6],[13351,6],[13394,6],[17441,6],[18266,6],[19539,6],[20927,6],[20937,6],[20949,6],[20992,6]]},"761":{"position":[[2729,6],[4051,6],[5998,6],[7913,6],[7923,6],[7935,6],[7978,6]]},"767":{"position":[[556,6],[1392,6],[2521,6],[3851,6],[3861,6],[3873,6],[3916,6],[6244,6],[7084,6],[8217,6],[9551,6],[9561,6],[9573,6],[9616,6],[11969,6],[12831,6],[14141,6],[15566,6],[15576,6],[15588,6],[15631,6],[17879,6],[18716,6],[19846,6],[21177,6],[21187,6],[21199,6],[21242,6]]},"769":{"position":[[4671,6],[5503,6],[6628,6],[7954,6],[7964,6],[7976,6],[8019,6],[10476,6],[11706,6],[13502,6],[15315,6],[15325,6],[15337,6],[15380,6],[19019,6],[20004,6],[21496,6],[23054,6],[23064,6],[23076,6],[23119,6],[25958,6],[26794,6],[27923,6],[29253,6],[29263,6],[29275,6],[29318,6]]},"771":{"position":[[1216,6],[2256,6],[3803,6],[5416,6],[5426,6],[5438,6],[5481,6],[8653,6],[9658,6],[10975,6],[12506,6],[12516,6],[12528,6],[12571,6],[15579,6],[16585,6],[17903,6],[19435,6],[19445,6],[19457,6],[19500,6]]},"773":{"position":[[3457,6],[6035,6],[9710,6],[12961,6],[12971,6],[12983,6],[13026,6]]},"795":{"position":[[638,6],[1440,6],[2690,6],[4055,6],[4065,6],[4077,6],[4120,6],[6286,6],[7092,6],[8346,6],[9715,6],[9725,6],[9737,6],[9780,6],[11970,6],[12919,6],[14434,6],[15966,6],[15976,6],[15988,6],[16031,6],[19204,6],[20044,6],[21177,6],[22511,6],[22521,6],[22533,6],[22576,6],[24903,6],[25741,6],[26872,6],[28204,6],[28214,6],[28226,6],[28269,6]]},"797":{"position":[[3056,6],[4058,6],[5685,6],[7280,6],[7290,6],[7302,6],[7345,6],[10532,6],[11375,6],[12511,6],[13848,6],[13858,6],[13870,6],[13913,6]]},"799":{"position":[[2961,6],[3851,6],[5248,6],[6711,6],[6721,6],[6733,6],[6776,6],[9486,6],[10571,6],[12281,6],[13959,6],[13969,6],[13981,6],[14024,6],[17716,6],[18553,6],[19683,6],[21014,6],[21024,6],[21036,6],[21079,6]]},"801":{"position":[[3156,6],[4108,6],[5626,6],[7161,6],[7171,6],[7183,6],[7226,6],[10408,6],[11250,6],[12385,6],[13721,6],[13731,6],[13743,6],[13786,6]]},"821":{"position":[[2195,6],[3056,6],[4365,6],[5789,6],[5799,6],[5811,6],[5854,6],[8172,6],[9018,6],[10157,6],[11497,6],[11507,6],[11519,6],[11562,6],[13906,6],[14767,6],[16076,6],[17500,6],[17510,6],[17522,6],[17565,6],[19840,6],[20686,6],[21825,6],[23165,6],[23175,6],[23187,6],[23230,6],[25583,6],[26436,6],[27582,6],[28929,6],[28939,6],[28951,6],[28994,6],[31744,6],[32855,6],[34532,6],[36226,6],[36236,6],[36248,6],[36291,6],[39544,6],[40390,6],[41529,6],[42869,6],[42879,6],[42891,6],[42934,6]]},"823":{"position":[[256,6],[1097,6],[2231,6],[3566,6],[3576,6],[3588,6],[3631,6],[7538,6],[8378,6],[9511,6],[10845,6],[10855,6],[10867,6],[10910,6]]},"825":{"position":[[7024,6],[8050,6],[9642,6],[11251,6],[11261,6],[11273,6],[11316,6],[14640,6],[15570,6],[16948,6],[18441,6],[18451,6],[18463,6],[18506,6],[21083,6],[22057,6],[23538,6],[25085,6],[25095,6],[25107,6],[25150,6],[27917,6],[28806,6],[30202,6],[31664,6],[31674,6],[31686,6],[31729,6],[34401,6],[35233,6],[36513,6],[37908,6],[37918,6],[37930,6],[37973,6],[40288,6],[41103,6],[42366,6],[43744,6],[43754,6],[43766,6],[43809,6],[46189,6],[47027,6],[48158,6],[49490,6],[49500,6],[49512,6],[49555,6],[51860,6],[52713,6],[53859,6],[55206,6],[55216,6],[55228,6],[55271,6]]},"844":{"position":[[1953,6],[2759,6],[4013,6],[5382,6],[5392,6],[5404,6],[5447,6],[7661,6],[8505,6],[9642,6],[10980,6],[10990,6],[11002,6],[11045,6],[13373,6],[14175,6],[15425,6],[16790,6],[16800,6],[16812,6],[16855,6],[19007,6],[19847,6],[20980,6],[22314,6],[22324,6],[22336,6],[22379,6],[24625,6],[25467,6],[26602,6],[27938,6],[27948,6],[27960,6],[28003,6],[31847,6],[32687,6],[33820,6],[35154,6],[35164,6],[35176,6],[35219,6],[37465,6],[38306,6],[39440,6],[40775,6],[40785,6],[40797,6],[40840,6]]},"846":{"position":[[2236,6],[3359,6],[5107,6],[6823,6],[6833,6],[6845,6],[6888,6],[10469,6],[11313,6],[12450,6],[13788,6],[13798,6],[13810,6],[13853,6]]},"848":{"position":[[2069,6],[3071,6],[4580,6],[6155,6],[6165,6],[6177,6],[6220,6],[9382,6],[10229,6],[11369,6],[12710,6],[12720,6],[12732,6],[12775,6]]},"850":{"position":[[2942,6],[4117,6],[5858,6],[7616,6],[7626,6],[7638,6],[7681,6],[11052,6],[11900,6],[13041,6],[14383,6],[14393,6],[14405,6],[14448,6],[16810,6],[17660,6],[18803,6],[20147,6],[20157,6],[20169,6],[20212,6],[22507,6],[23359,6],[24504,6],[25850,6],[25860,6],[25872,6],[25915,6],[28299,6],[29149,6],[30292,6],[31636,6],[31646,6],[31658,6],[31701,6],[33996,6],[34846,6],[35989,6],[37333,6],[37343,6],[37355,6],[37398,6]]}}}],["impract",{"_index":1612,"t":{"310":{"position":[[1429,12]]}}}],["improv",{"_index":212,"t":{"9":{"position":[[353,7]]},"11":{"position":[[57,7]]},"71":{"position":[[206,7]]},"131":{"position":[[1848,7]]},"730":{"position":[[735,7]]},"803":{"position":[[153,7]]},"827":{"position":[[424,7]]}}}],["in",{"_index":363,"t":{"27":{"position":[[294,4]]}}}],["inadvert",{"_index":1692,"t":{"359":{"position":[[18010,13]]}}}],["inc",{"_index":2567,"t":{"761":{"position":[[139,4],[186,4]]}}}],["includ",{"_index":160,"t":{"7":{"position":[[36,8]]},"15":{"position":[[292,9]]},"73":{"position":[[827,8]]},"133":{"position":[[1018,10]]},"145":{"position":[[50,10]]},"157":{"position":[[118,8]]},"169":{"position":[[31713,10]]},"201":{"position":[[231,10]]},"207":{"position":[[112,7]]},"267":{"position":[[5719,7]]},"282":{"position":[[202,9]]},"288":{"position":[[189,8],[264,7]]},"296":{"position":[[3563,8]]},"298":{"position":[[2130,7],[2193,7]]},"420":{"position":[[1094,7]]},"464":{"position":[[160,8],[315,9]]},"593":{"position":[[33,10]]},"665":{"position":[[272,8]]},"719":{"position":[[209,7]]},"825":{"position":[[113,7],[1324,8]]},"848":{"position":[[16366,10]]}}}],["incom",{"_index":946,"t":{"111":{"position":[[1571,8]]},"113":{"position":[[71,8]]}}}],["incompat",{"_index":1959,"t":{"464":{"position":[[89,17]]}}}],["incorrect",{"_index":2677,"t":{"771":{"position":[[686,9]]}}}],["incorrectli",{"_index":1957,"t":{"462":{"position":[[3549,12]]}}}],["increas",{"_index":787,"t":{"73":{"position":[[689,8]]},"131":{"position":[[1543,10],[1659,10]]},"133":{"position":[[1287,10],[1493,10]]},"161":{"position":[[375,8]]},"310":{"position":[[1396,10]]},"771":{"position":[[655,8]]}}}],["increment",{"_index":2637,"t":{"769":{"position":[[10214,10]]}}}],["inde",{"_index":2717,"t":{"785":{"position":[[363,6]]},"819":{"position":[[185,6]]}}}],["independ",{"_index":1039,"t":{"131":{"position":[[182,13]]}}}],["index",{"_index":1043,"t":{"131":{"position":[[341,7]]},"306":{"position":[[52,5],[690,5]]},"310":{"position":[[1748,5],[1927,5],[2184,5],[3143,5],[3246,6]]},"673":{"position":[[10475,6]]},"773":{"position":[[21377,6],[21539,6]]}}}],["indic",{"_index":643,"t":{"49":{"position":[[194,10],[358,10],[515,10]]},"51":{"position":[[1017,10]]},"53":{"position":[[2857,8]]},"55":{"position":[[72,8],[961,9],[1089,10],[1213,10]]},"57":{"position":[[87,8],[1025,9]]},"59":{"position":[[86,8],[1124,9]]},"169":{"position":[[6173,10],[7635,8],[31815,8]]},"187":{"position":[[77,8]]},"271":{"position":[[674,10],[738,8]]},"353":{"position":[[11773,10],[11856,8],[11959,8]]},"355":{"position":[[951,10]]},"359":{"position":[[183,8],[287,8],[6342,8],[17974,10]]},"371":{"position":[[55,8],[187,8]]},"375":{"position":[[39,9]]},"377":{"position":[[116,8],[214,8]]},"380":{"position":[[75,8]]},"404":{"position":[[1185,10]]},"412":{"position":[[146,8]]},"446":{"position":[[35,8]]},"462":{"position":[[32,8]]},"474":{"position":[[3339,8]]},"480":{"position":[[643,8]]},"490":{"position":[[36,8],[368,8],[627,8],[722,8],[883,8]]},"492":{"position":[[1710,8]]},"496":{"position":[[629,8]]},"498":{"position":[[427,8],[593,8],[674,8]]},"500":{"position":[[178,8],[1027,10]]},"506":{"position":[[54,8]]},"512":{"position":[[337,8],[400,8]]},"520":{"position":[[41,8],[129,8]]},"522":{"position":[[133,8]]},"544":{"position":[[39,10],[111,10]]},"560":{"position":[[132,10]]},"608":{"position":[[397,8]]},"621":{"position":[[6222,8]]},"653":{"position":[[266,8]]},"669":{"position":[[2683,9],[4663,10]]},"679":{"position":[[1629,10],[1721,8]]},"683":{"position":[[689,10],[781,8]]},"689":{"position":[[319,8]]},"693":{"position":[[231,8],[329,8]]},"697":{"position":[[716,8]]},"713":{"position":[[456,8],[850,8]]},"726":{"position":[[27738,10]]},"728":{"position":[[30836,9],[38503,10]]},"730":{"position":[[267,8],[436,8]]},"732":{"position":[[223,8],[342,8],[617,8],[734,8],[834,10],[858,8],[1003,8],[1143,8]]},"734":{"position":[[625,8]]},"751":{"position":[[2855,10]]},"769":{"position":[[1200,8],[4410,9]]},"781":{"position":[[594,8],[893,8],[1173,8]]},"801":{"position":[[2290,9]]},"807":{"position":[[130,8],[206,8],[453,8],[634,8],[734,10]]},"819":{"position":[[1901,8]]},"821":{"position":[[1700,9]]},"825":{"position":[[4280,8],[6695,8],[20779,9],[20901,8]]},"831":{"position":[[105,8],[216,8],[510,8],[603,8],[703,10],[727,8],[917,8],[1085,8],[1228,8]]},"833":{"position":[[625,8],[799,8]]},"844":{"position":[[1462,9]]},"848":{"position":[[1865,8]]}}}],["indirect",{"_index":676,"t":{"51":{"position":[[1259,8]]},"53":{"position":[[16,8]]},"645":{"position":[[1344,8]]},"649":{"position":[[1058,8],[26992,8]]},"651":{"position":[[1030,8],[19844,8]]}}}],["individu",{"_index":301,"t":{"19":{"position":[[50,10],[465,12]]},"343":{"position":[[94,10]]},"426":{"position":[[4127,10],[4809,10]]},"536":{"position":[[423,10]]},"600":{"position":[[6987,10]]},"635":{"position":[[98,10],[303,12],[417,11]]},"747":{"position":[[125,12],[9629,10]]},"846":{"position":[[10303,10]]}}}],["influenc",{"_index":2004,"t":{"490":{"position":[[420,9]]}}}],["info",{"_index":634,"t":{"47":{"position":[[3689,4]]},"49":{"position":[[918,4]]},"51":{"position":[[928,4]]},"55":{"position":[[926,4]]},"57":{"position":[[990,4]]},"59":{"position":[[1089,4]]},"129":{"position":[[223,6]]},"145":{"position":[[2992,4]]},"163":{"position":[[224,6]]},"169":{"position":[[7287,4]]},"331":{"position":[[442,4]]},"373":{"position":[[695,4]]},"420":{"position":[[791,4]]},"424":{"position":[[2485,4]]},"452":{"position":[[0,4],[976,4]]},"454":{"position":[[277,4]]},"474":{"position":[[2221,4]]},"500":{"position":[[965,4]]},"502":{"position":[[930,4]]},"590":{"position":[[5899,4]]},"645":{"position":[[1135,4]]},"649":{"position":[[13372,4],[13927,4],[26795,4]]},"651":{"position":[[783,4]]},"705":{"position":[[18837,4]]},"728":{"position":[[6471,4],[20207,4],[21382,4],[32382,4]]},"745":{"position":[[1561,4],[31867,4]]},"751":{"position":[[2817,4],[16171,4]]},"801":{"position":[[2191,4]]},"819":{"position":[[1711,4]]},"821":{"position":[[1677,4]]},"825":{"position":[[2701,4],[4217,4],[20769,4]]},"844":{"position":[[1439,4],[31344,4]]},"846":{"position":[[1796,4]]},"848":{"position":[[1784,4],[15565,4]]}}}],["inform",{"_index":561,"t":{"39":{"position":[[47,11]]},"45":{"position":[[109,7]]},"59":{"position":[[1050,12]]},"111":{"position":[[804,11]]},"143":{"position":[[601,11]]},"157":{"position":[[89,11]]},"169":{"position":[[4456,12],[5172,12],[7480,12],[9440,12],[24082,12],[30714,12],[31302,12],[32227,12]]},"205":{"position":[[117,11]]},"388":{"position":[[36,12]]},"444":{"position":[[105,11]]},"470":{"position":[[39,11]]},"606":{"position":[[43,11]]},"667":{"position":[[86,11]]},"709":{"position":[[39,11]]},"767":{"position":[[86,11]]},"813":{"position":[[68,11]]},"823":{"position":[[6219,9]]},"852":{"position":[[47,12]]}}}],["ingr",{"_index":2244,"t":{"651":{"position":[[19999,6],[20163,6]]}}}],["inherit",{"_index":674,"t":{"51":{"position":[[1141,9]]},"621":{"position":[[5940,11],[6047,7]]},"669":{"position":[[2339,7]]},"740":{"position":[[243,8],[303,7]]},"749":{"position":[[71,7]]},"769":{"position":[[4122,7]]}}}],["initi",{"_index":448,"t":{"37":{"position":[[741,10],[904,10],[1921,10],[2082,10],[3583,10],[3887,10],[5296,10]]},"97":{"position":[[177,10],[716,10],[1576,10]]},"123":{"position":[[177,10],[716,10],[1576,10]]},"169":{"position":[[12296,10],[12459,10],[13140,10],[13301,10],[14271,10],[14575,10],[15610,10],[18490,10],[18653,10],[19334,10],[19495,10],[20465,10],[20769,10],[21804,10],[24844,10],[25007,10],[25709,10],[25870,10],[26894,10],[27198,10],[28275,10]]},"236":{"position":[[127,10],[290,10],[926,10],[1087,10],[2167,10],[2471,10],[3530,10]]},"238":{"position":[[137,10],[300,10],[978,10],[1139,10],[2106,10],[2410,10],[3442,10],[5881,10],[6044,10],[6724,10],[6885,10],[7854,10],[8158,10],[9192,10]]},"248":{"position":[[177,10],[716,10],[1576,10]]},"265":{"position":[[437,10],[600,10],[1268,10],[1429,10],[2386,10],[2690,10],[3712,10]]},"267":{"position":[[148,10],[311,10],[942,10],[1103,10],[2178,10],[2482,10],[3536,10],[5852,10],[6015,10],[6684,10],[6845,10],[7803,10],[8107,10],[9130,10]]},"273":{"position":[[1442,10],[1605,10],[2279,10],[2440,10],[3403,10],[3707,10],[4735,10],[7080,10],[7243,10],[7916,10],[8077,10],[9194,10],[9498,10],[10594,10],[13104,10],[13267,10],[13945,10],[14106,10],[15073,10],[15377,10],[16409,10],[18706,10],[18869,10],[19549,10],[19710,10],[20679,10],[20983,10],[22017,10]]},"282":{"position":[[389,10],[552,10],[1187,10],[1348,10],[2427,10],[2731,10],[3789,10]]},"284":{"position":[[180,10],[343,10],[1022,10],[1183,10],[2151,10],[2455,10],[3488,10]]},"294":{"position":[[149,10],[688,10],[1548,10]]},"329":{"position":[[234,10],[397,10],[1024,10],[1185,10],[2256,10],[2560,10],[3610,10],[5815,10],[5978,10],[6606,10],[6767,10],[7839,10],[8143,10],[9194,10],[11629,10],[11792,10],[12589,10],[12750,10],[14066,10],[14370,10],[15627,10]]},"353":{"position":[[276,10],[439,10],[1118,10],[1279,10],[2247,10],[2551,10],[3584,10],[5886,10],[6049,10],[6727,10],[6888,10],[7855,10],[8159,10],[9191,10]]},"359":{"position":[[395,10],[558,10],[1253,10],[1414,10],[2553,10],[2857,10],[3975,10],[6571,10],[6734,10],[7413,10],[7574,10],[8542,10],[8846,10],[9879,10],[12385,10],[12548,10],[13227,10],[13388,10],[14356,10],[14660,10],[15693,10]]},"375":{"position":[[310,10],[473,10],[1159,10],[1320,10],[2295,10],[2599,10],[3639,10]]},"382":{"position":[[1255,10],[1418,10],[2094,10],[2255,10],[3220,10],[3524,10],[4554,10]]},"392":{"position":[[131,7]]},"406":{"position":[[258,10],[421,10],[1222,10],[1383,10],[2687,10],[2991,10],[4225,10],[7012,10],[7175,10],[7856,10],[8017,10],[8987,10],[9291,10],[10326,10]]},"408":{"position":[[160,10],[323,10],[1234,10],[1395,10],[2809,10],[3113,10],[4457,10]]},"410":{"position":[[106,10],[269,10],[950,10],[1111,10],[2081,10],[2385,10],[3420,10]]},"446":{"position":[[189,10],[352,10],[1000,10],[1161,10],[2253,10],[2557,10],[3628,10]]},"448":{"position":[[210,10],[373,10],[1059,10],[1220,10],[2195,10],[2499,10],[3539,10],[6047,10],[6210,10],[6897,10],[7058,10],[8034,10],[8338,10],[9379,10]]},"482":{"position":[[276,10],[439,10],[1121,10],[1282,10],[2253,10],[2557,10],[3593,10],[5910,10],[6073,10],[6754,10],[6915,10],[7885,10],[8189,10],[9224,10]]},"486":{"position":[[236,10],[399,10],[1082,10],[1243,10],[2215,10],[2519,10],[3556,10],[6035,10],[6198,10],[6881,10],[7042,10],[8014,10],[8318,10],[9355,10]]},"504":{"position":[[164,10],[327,10],[961,10],[1122,10],[2200,10],[2504,10],[3561,10]]},"506":{"position":[[166,10],[329,10],[1043,10],[1204,10],[2362,10],[2666,10],[3803,10]]},"508":{"position":[[283,10],[446,10],[1132,10],[1293,10],[2268,10],[2572,10],[3612,10]]},"522":{"position":[[350,10],[513,10],[1199,10],[1360,10],[2490,10],[2794,10],[3903,10]]},"524":{"position":[[415,10],[578,10],[1260,10],[1421,10],[2392,10],[2696,10],[3732,10]]},"540":{"position":[[173,10],[336,10],[972,10],[1133,10],[2213,10],[2517,10],[3576,10]]},"542":{"position":[[506,10],[669,10],[1382,10],[1543,10],[2700,10],[3004,10],[4140,10]]},"544":{"position":[[343,10],[506,10],[1194,10],[1355,10],[2332,10],[2636,10],[3678,10]]},"556":{"position":[[252,10],[415,10],[1102,10],[1263,10],[2453,10],[2757,10],[3877,10]]},"560":{"position":[[259,10],[422,10],[1105,10],[1266,10],[2452,10],[2756,10],[3872,10]]},"562":{"position":[[270,10],[433,10],[1068,10],[1229,10],[2308,10],[2612,10],[3670,10]]},"564":{"position":[[116,10],[279,10],[946,10],[1107,10],[2063,10],[2367,10],[3388,10],[5630,10],[5793,10],[6460,10],[6621,10],[7577,10],[7881,10],[8902,10]]},"566":{"position":[[153,10],[316,10],[943,10],[1104,10],[2175,10],[2479,10],[3529,10],[5690,10],[5853,10],[6521,10],[6682,10],[7639,10],[7943,10],[8965,10]]},"581":{"position":[[275,10],[438,10],[1115,10],[1276,10],[2242,10],[2546,10],[3577,10]]},"588":{"position":[[525,10],[688,10],[1410,10],[1571,10],[2634,10],[2938,10],[4022,10],[6681,10],[6844,10],[7547,10],[7708,10],[8732,10],[9036,10],[10099,10],[12662,10],[12825,10],[13538,10],[13699,10],[14733,10],[15037,10],[16110,10]]},"590":{"position":[[728,10],[891,10],[1495,10],[1656,10],[2601,10],[2905,10],[3871,10]]},"595":{"position":[[266,10],[429,10],[1145,10],[1306,10],[2338,10],[2642,10],[3735,10],[6178,10],[6341,10],[7057,10],[7218,10],[8250,10],[8554,10],[9647,10]]},"600":{"position":[[187,10],[350,10],[1159,10],[1320,10],[2453,10],[2757,10],[3955,10]]},"619":{"position":[[402,10],[565,10],[1317,10],[1478,10],[2674,10],[2978,10],[4153,10]]},"621":{"position":[[217,10],[380,10],[1069,10],[1230,10],[2208,10],[2512,10],[3555,10]]},"627":{"position":[[127,10],[290,10],[1141,10],[1302,10],[2656,10],[2960,10],[4244,10]]},"629":{"position":[[146,10],[309,10],[990,10],[1151,10],[2121,10],[2425,10],[3460,10]]},"631":{"position":[[127,10],[290,10],[997,10],[1158,10],[2309,10],[2613,10],[3743,10],[6185,10],[6348,10],[7030,10],[7191,10],[8162,10],[8466,10],[9502,10],[11818,10],[11981,10],[12666,10],[12827,10],[13801,10],[14105,10],[15144,10]]},"649":{"position":[[1406,10],[1569,10],[2247,10],[2408,10],[3375,10],[3679,10],[4711,10],[7578,10],[7741,10],[8419,10],[8580,10],[9547,10],[9851,10],[10883,10],[14399,10],[14562,10],[15243,10],[15404,10],[16374,10],[16678,10],[17713,10],[21236,10],[21399,10],[22077,10],[22238,10],[23205,10],[23509,10],[24541,10],[27472,10],[27635,10],[28314,10],[28475,10],[29443,10],[29747,10],[30780,10]]},"651":{"position":[[1379,10],[1542,10],[2221,10],[2382,10],[3350,10],[3654,10],[4687,10],[7628,10],[7791,10],[8473,10],[8634,10],[9605,10],[9909,10],[10945,10],[13972,10],[14135,10],[14815,10],[14976,10],[15945,10],[16249,10],[17283,10],[20295,10],[20458,10],[21138,10],[21299,10],[22268,10],[22572,10],[23606,10]]},"669":{"position":[[4778,10],[4941,10],[5645,10],[5806,10],[6954,10],[7258,10],[8385,10]]},"671":{"position":[[1169,10],[1332,10],[2064,10],[2225,10],[3401,10],[3705,10],[4860,10]]},"691":{"position":[[398,10],[561,10],[1332,10],[1493,10],[2767,10],[3071,10],[4275,10],[6946,10],[7109,10],[7788,10],[7949,10],[8917,10],[9221,10],[10254,10],[12941,10],[13104,10],[13783,10],[13944,10],[14912,10],[15216,10],[16249,10],[18627,10],[18790,10],[19471,10],[19632,10],[20602,10],[20906,10],[21941,10],[24253,10],[24416,10],[25096,10],[25257,10],[26226,10],[26530,10],[27564,10]]},"701":{"position":[[1093,10],[1256,10],[1936,10],[2097,10],[3066,10],[3370,10],[4404,10],[6711,10],[6874,10],[7553,10],[7714,10],[8682,10],[8986,10],[10019,10]]},"703":{"position":[[217,10],[380,10],[1067,10],[1228,10],[2359,10],[2663,10],[3773,10],[6101,10],[6264,10],[6947,10],[7108,10],[8080,10],[8384,10],[9421,10]]},"705":{"position":[[192,10],[355,10],[1145,10],[1306,10],[2377,10],[2681,10],[3827,10],[6469,10],[6632,10],[7344,10],[7505,10],[8720,10],[9024,10],[10169,10],[12731,10],[12894,10],[13607,10],[13768,10],[14984,10],[15288,10],[16434,10],[19033,10],[19196,10],[19876,10],[20037,10],[21006,10],[21310,10],[22344,10],[24696,10],[24859,10],[25537,10],[25698,10],[26665,10],[26969,10],[28001,10]]},"726":{"position":[[231,10],[394,10],[1875,10],[2036,10],[4256,10],[4560,10],[6514,10],[11549,10],[11712,10],[12733,10],[12894,10],[14477,10],[14781,10],[16245,10],[19686,10],[19849,10],[20800,10],[20961,10],[22474,10],[22778,10],[24172,10],[28285,10],[28448,10],[29127,10],[29288,10],[30256,10],[30560,10],[31593,10],[34044,10],[34207,10],[34887,10],[35048,10],[36017,10],[36321,10],[37355,10],[39661,10],[39824,10],[40507,10],[40668,10],[41640,10],[41944,10],[42981,10],[45303,10],[45466,10],[46150,10],[46311,10],[47284,10],[47588,10],[48626,10]]},"728":{"position":[[327,10],[490,10],[1170,10],[1331,10],[2300,10],[2604,10],[3638,10],[8246,10],[8409,10],[9085,10],[9246,10],[10211,10],[10515,10],[11545,10],[14163,10],[14326,10],[15011,10],[15172,10],[16146,10],[16450,10],[17489,10],[24605,10],[24768,10],[25452,10],[25613,10],[26586,10],[26890,10],[27928,10],[32853,10],[33016,10],[33691,10],[33852,10],[34816,10],[35120,10],[36149,10],[38475,7],[42413,10],[42576,10],[43251,10],[43412,10],[44376,10],[44680,10],[45709,10]]},"745":{"position":[[1858,10],[2021,10],[2664,10],[2825,10],[3912,10],[4216,10],[5282,10],[7542,10],[7705,10],[8386,10],[8547,10],[9517,10],[9821,10],[10856,10],[13232,10],[13395,10],[14038,10],[14199,10],[15286,10],[15590,10],[16656,10],[18873,10],[19036,10],[19717,10],[19878,10],[20848,10],[21152,10],[22187,10],[24499,10],[24662,10],[25344,10],[25505,10],[26476,10],[26780,10],[27816,10],[32233,10],[32396,10],[33077,10],[33238,10],[34208,10],[34512,10],[35547,10],[37859,10],[38022,10],[38703,10],[38864,10],[39834,10],[40138,10],[41173,10]]},"747":{"position":[[2387,10],[2550,10],[3422,10],[3583,10],[4958,10],[5262,10],[6567,10],[9701,10],[9864,10],[10547,10],[10708,10],[11680,10],[11984,10],[13021,10]]},"749":{"position":[[332,10],[495,10],[1162,10],[1323,10],[2434,10],[2738,10],[3828,10],[6573,10],[6736,10],[7435,10],[7596,10],[8739,10],[9043,10],[10165,10],[12464,10],[12627,10],[13308,10],[13469,10],[14439,10],[14743,10],[15778,10]]},"751":{"position":[[3029,10],[3192,10],[3919,10],[4080,10],[5310,10],[5614,10],[6774,10],[9913,10],[10076,10],[10761,10],[10922,10],[11896,10],[12200,10],[13239,10],[17347,10],[17510,10],[18175,10],[18336,10],[19445,10],[19749,10],[20837,10]]},"761":{"position":[[2635,10],[2798,10],[3960,10],[4121,10],[5904,10],[6208,10],[7823,10]]},"767":{"position":[[462,10],[625,10],[1301,10],[1462,10],[2427,10],[2731,10],[3761,10],[6150,10],[6313,10],[6993,10],[7154,10],[8123,10],[8427,10],[9461,10],[11875,10],[12038,10],[12740,10],[12901,10],[14047,10],[14351,10],[15476,10],[17785,10],[17948,10],[18625,10],[18786,10],[19752,10],[20056,10],[21087,10]]},"769":{"position":[[4577,10],[4740,10],[5412,10],[5573,10],[6534,10],[6838,10],[7864,10],[10382,10],[10545,10],[11615,10],[11776,10],[13408,10],[13712,10],[15225,10],[18925,10],[19088,10],[19913,10],[20074,10],[21402,10],[21706,10],[22964,10],[25864,10],[26027,10],[26703,10],[26864,10],[27829,10],[28133,10],[29163,10]]},"771":{"position":[[1122,10],[1285,10],[2165,10],[2326,10],[3709,10],[4013,10],[5326,10],[8559,10],[8722,10],[9567,10],[9728,10],[10881,10],[11185,10],[12416,10],[15485,10],[15648,10],[16494,10],[16655,10],[17809,10],[18113,10],[19345,10]]},"773":{"position":[[3363,10],[3526,10],[5944,10],[6105,10],[9616,10],[9920,10],[12871,10]]},"795":{"position":[[544,10],[707,10],[1349,10],[1510,10],[2596,10],[2900,10],[3965,10],[6192,10],[6355,10],[7001,10],[7162,10],[8252,10],[8556,10],[9625,10],[11876,10],[12039,10],[12828,10],[12989,10],[14340,10],[14644,10],[15876,10],[19110,10],[19273,10],[19953,10],[20114,10],[21083,10],[21387,10],[22421,10],[24809,10],[24972,10],[25650,10],[25811,10],[26778,10],[27082,10],[28114,10]]},"797":{"position":[[2962,10],[3125,10],[3967,10],[4128,10],[5591,10],[5895,10],[7190,10],[10438,10],[10601,10],[11284,10],[11445,10],[12417,10],[12721,10],[13758,10]]},"799":{"position":[[2867,10],[3030,10],[3760,10],[3921,10],[5154,10],[5458,10],[6621,10],[9392,10],[9555,10],[10480,10],[10641,10],[12187,10],[12491,10],[13869,10],[17622,10],[17785,10],[18462,10],[18623,10],[19589,10],[19893,10],[20924,10]]},"801":{"position":[[3062,10],[3225,10],[4017,10],[4178,10],[5532,10],[5836,10],[7071,10],[10314,10],[10477,10],[11159,10],[11320,10],[12291,10],[12595,10],[13631,10]]},"821":{"position":[[2101,10],[2264,10],[2965,10],[3126,10],[4271,10],[4575,10],[5699,10],[8078,10],[8241,10],[8927,10],[9088,10],[10063,10],[10367,10],[11407,10],[13812,10],[13975,10],[14676,10],[14837,10],[15982,10],[16286,10],[17410,10],[19746,10],[19909,10],[20595,10],[20756,10],[21731,10],[22035,10],[23075,10],[25489,10],[25652,10],[26345,10],[26506,10],[27488,10],[27792,10],[28839,10],[31650,10],[31813,10],[32764,10],[32925,10],[34438,10],[34742,10],[36136,10],[39450,10],[39613,10],[40299,10],[40460,10],[41435,10],[41739,10],[42779,10]]},"823":{"position":[[162,10],[325,10],[1006,10],[1167,10],[2137,10],[2441,10],[3476,10],[7444,10],[7607,10],[8287,10],[8448,10],[9417,10],[9721,10],[10755,10]]},"825":{"position":[[6930,10],[7093,10],[7959,10],[8120,10],[9548,10],[9852,10],[11161,10],[14546,10],[14709,10],[15479,10],[15640,10],[16854,10],[17158,10],[18351,10],[20989,10],[21152,10],[21966,10],[22127,10],[23444,10],[23748,10],[24995,10],[27823,10],[27986,10],[28715,10],[28876,10],[30108,10],[30412,10],[31574,10],[34307,10],[34470,10],[35142,10],[35303,10],[36419,10],[36723,10],[37818,10],[40194,10],[40357,10],[41012,10],[41173,10],[42272,10],[42576,10],[43654,10],[46095,10],[46258,10],[46936,10],[47097,10],[48064,10],[48368,10],[49400,10],[51766,10],[51929,10],[52622,10],[52783,10],[53765,10],[54069,10],[55116,10]]},"844":{"position":[[1859,10],[2022,10],[2668,10],[2829,10],[3919,10],[4223,10],[5292,10],[7567,10],[7730,10],[8414,10],[8575,10],[9548,10],[9852,10],[10890,10],[13279,10],[13442,10],[14084,10],[14245,10],[15331,10],[15635,10],[16700,10],[18913,10],[19076,10],[19756,10],[19917,10],[20886,10],[21190,10],[22224,10],[24531,10],[24694,10],[25376,10],[25537,10],[26508,10],[26812,10],[27848,10],[31753,10],[31916,10],[32596,10],[32757,10],[33726,10],[34030,10],[35064,10],[37371,10],[37534,10],[38215,10],[38376,10],[39346,10],[39650,10],[40685,10]]},"846":{"position":[[2142,10],[2305,10],[3268,10],[3429,10],[5013,10],[5317,10],[6733,10],[10375,10],[10538,10],[11222,10],[11383,10],[12356,10],[12660,10],[13698,10]]},"848":{"position":[[1975,10],[2138,10],[2980,10],[3141,10],[4486,10],[4790,10],[6065,10],[9288,10],[9451,10],[10138,10],[10299,10],[11275,10],[11579,10],[12620,10]]},"850":{"position":[[2848,10],[3011,10],[4026,10],[4187,10],[5764,10],[6068,10],[7526,10],[10958,10],[11121,10],[11809,10],[11970,10],[12947,10],[13251,10],[14293,10],[16716,10],[16879,10],[17569,10],[17730,10],[18709,10],[19013,10],[20057,10],[22413,10],[22576,10],[23268,10],[23429,10],[24410,10],[24714,10],[25760,10],[28205,10],[28368,10],[29058,10],[29219,10],[30198,10],[30502,10],[31546,10],[33902,10],[34065,10],[34755,10],[34916,10],[35895,10],[36199,10],[37243,10]]}}}],["inn",{"_index":381,"t":{"27":{"position":[[546,4]]}}}],["input",{"_index":1416,"t":{"207":{"position":[[79,5]]},"426":{"position":[[10312,6]]}}}],["insecur",{"_index":1324,"t":{"161":{"position":[[537,8]]}}}],["insid",{"_index":313,"t":{"19":{"position":[[587,6]]},"77":{"position":[[968,6]]},"111":{"position":[[816,6]]},"510":{"position":[[338,6]]},"831":{"position":[[1292,6]]},"833":{"position":[[712,6]]}}}],["inspir",{"_index":263,"t":{"15":{"position":[[144,8]]}}}],["instabl",{"_index":1296,"t":{"155":{"position":[[952,14]]}}}],["instagram",{"_index":1673,"t":{"345":{"position":[[639,9]]}}}],["instal",{"_index":411,"t":{"31":{"position":[[64,7],[83,7]]},"35":{"position":[[183,9],[469,9],[755,9],[1041,9],[1327,9]]},"77":{"position":[[16,7],[150,7],[267,8],[875,7],[990,7],[1090,7],[1207,8],[1221,7],[1347,8],[1367,7],[1508,7],[1566,7],[1792,7]]},"79":{"position":[[5,7]]},"81":{"position":[[82,7],[140,7]]},"85":{"position":[[43,7]]},"89":{"position":[[73,7]]},"93":{"position":[[183,9],[506,9],[829,9],[1152,9]]},"105":{"position":[[162,9],[526,9]]},"109":{"position":[[21,7],[143,7],[367,7],[1010,7]]},"119":{"position":[[183,9],[506,9],[829,9],[1152,9]]},"141":{"position":[[78,7],[109,11]]},"244":{"position":[[183,9],[470,9],[757,9],[1044,9]]},"290":{"position":[[179,9],[501,9],[823,9],[1110,9]]},"815":{"position":[[777,10]]}}}],["instanc",{"_index":25,"t":{"3":{"position":[[349,9]]},"35":{"position":[[42,8],[328,8],[614,8],[900,8],[1186,8],[1486,8]]},"37":{"position":[[6029,8]]},"93":{"position":[[42,8],[365,8],[688,8],[1011,8],[1334,8],[1595,8]]},"97":{"position":[[2965,8]]},"105":{"position":[[21,8],[385,8]]},"119":{"position":[[42,8],[365,8],[688,8],[1011,8],[1334,8],[1595,8]]},"123":{"position":[[2965,8]]},"131":{"position":[[904,9],[986,10],[1076,10],[1149,9]]},"145":{"position":[[236,8],[330,8]]},"149":{"position":[[188,9]]},"169":{"position":[[16343,8],[22537,8],[29008,8]]},"236":{"position":[[4263,8]]},"238":{"position":[[4175,8],[9925,8]]},"244":{"position":[[42,8],[329,8],[616,8],[903,8],[1190,8],[1451,8]]},"248":{"position":[[2965,8]]},"265":{"position":[[4445,8]]},"267":{"position":[[4269,8],[9863,8]]},"273":{"position":[[5468,8],[11327,8],[17142,8],[22750,8]]},"282":{"position":[[4522,8]]},"284":{"position":[[4221,8]]},"290":{"position":[[38,8],[360,8],[682,8],[969,8],[1256,8]]},"294":{"position":[[2937,8]]},"329":{"position":[[4343,8],[9927,8],[16360,8]]},"353":{"position":[[4317,8],[9924,8]]},"359":{"position":[[4708,8],[10612,8],[16426,8]]},"375":{"position":[[4372,8]]},"382":{"position":[[5287,8]]},"406":{"position":[[4958,8],[11059,8]]},"408":{"position":[[5190,8]]},"410":{"position":[[4153,8]]},"446":{"position":[[4361,8]]},"448":{"position":[[4272,8],[10112,8]]},"482":{"position":[[4326,8],[9957,8]]},"486":{"position":[[4289,8],[10088,8]]},"504":{"position":[[4294,8]]},"506":{"position":[[4536,8]]},"508":{"position":[[4345,8]]},"522":{"position":[[4636,8]]},"524":{"position":[[4465,8]]},"540":{"position":[[4309,8]]},"542":{"position":[[4873,8]]},"544":{"position":[[4411,8]]},"556":{"position":[[4610,8]]},"560":{"position":[[4605,8]]},"562":{"position":[[4403,8]]},"564":{"position":[[4121,8],[9635,8]]},"566":{"position":[[4262,8],[9698,8]]},"581":{"position":[[4310,8]]},"588":{"position":[[4755,8],[10832,8],[16843,8]]},"590":{"position":[[4604,8]]},"595":{"position":[[4468,8],[10380,8]]},"600":{"position":[[4688,8]]},"619":{"position":[[4886,8]]},"621":{"position":[[4288,8]]},"627":{"position":[[4977,8]]},"629":{"position":[[4193,8]]},"631":{"position":[[4476,8],[10235,8],[15877,8]]},"649":{"position":[[5444,8],[11616,8],[18446,8],[25274,8],[31513,8]]},"651":{"position":[[5420,8],[11678,8],[18016,8],[24339,8]]},"669":{"position":[[9118,8]]},"671":{"position":[[5593,8]]},"691":{"position":[[5008,8],[10987,8],[16982,8],[22674,8],[28297,8]]},"701":{"position":[[5137,8],[10752,8]]},"703":{"position":[[4506,8],[10154,8]]},"705":{"position":[[4560,8],[10902,8],[17167,8],[23077,8],[28734,8]]},"726":{"position":[[7247,8],[16978,8],[24905,8],[32326,8],[38088,8],[43714,8],[49359,8]]},"728":{"position":[[4371,8],[12278,8],[18222,8],[28661,8],[36882,8],[46442,8]]},"745":{"position":[[6015,8],[11589,8],[17389,8],[22920,8],[28549,8],[36280,8],[41906,8]]},"747":{"position":[[7300,8],[13754,8]]},"749":{"position":[[4561,8],[10898,8],[16511,8]]},"751":{"position":[[7507,8],[13972,8],[21570,8]]},"761":{"position":[[8556,8]]},"767":{"position":[[4494,8],[10194,8],[16209,8],[21820,8]]},"769":{"position":[[8597,8],[15958,8],[23697,8],[29896,8]]},"771":{"position":[[6059,8],[13149,8],[20078,8]]},"773":{"position":[[13604,8]]},"795":{"position":[[4698,8],[10358,8],[16609,8],[23154,8],[28847,8]]},"797":{"position":[[7923,8],[14491,8]]},"799":{"position":[[7354,8],[14602,8],[21657,8]]},"801":{"position":[[7804,8],[14364,8]]},"821":{"position":[[6432,8],[12140,8],[18143,8],[23808,8],[29572,8],[36869,8],[43512,8]]},"823":{"position":[[4209,8],[11488,8]]},"825":{"position":[[11894,8],[19084,8],[25728,8],[32307,8],[38551,8],[44387,8],[50133,8],[55849,8]]},"844":{"position":[[6025,8],[11623,8],[17433,8],[22957,8],[28581,8],[35797,8],[41418,8]]},"846":{"position":[[7466,8],[14431,8]]},"848":{"position":[[6798,8],[13353,8]]},"850":{"position":[[8259,8],[15026,8],[20790,8],[26493,8],[32279,8],[37976,8]]}}}],["instanti",{"_index":885,"t":{"109":{"position":[[578,11]]}}}],["instead",{"_index":322,"t":{"21":{"position":[[186,7]]},"37":{"position":[[1207,7],[2398,7],[4254,7],[5719,7]]},"43":{"position":[[342,7],[818,7],[1792,7]]},"77":{"position":[[661,7]]},"97":{"position":[[480,7],[1032,7],[1943,7],[2655,7]]},"113":{"position":[[4791,7]]},"123":{"position":[[480,7],[1032,7],[1943,7],[2655,7]]},"169":{"position":[[12762,7],[13617,7],[14942,7],[16033,7],[18956,7],[19811,7],[21136,7],[22227,7],[25310,7],[26186,7],[27565,7],[28698,7]]},"215":{"position":[[429,7],[1057,7],[1878,7],[2586,7]]},"217":{"position":[[777,7],[1546,7],[2606,7],[3688,7]]},"219":{"position":[[653,7],[1571,7],[2769,7],[4249,7]]},"236":{"position":[[593,7],[1403,7],[2838,7],[3953,7]]},"238":{"position":[[603,7],[1455,7],[2777,7],[3865,7],[6347,7],[7201,7],[8525,7],[9615,7]]},"248":{"position":[[480,7],[1032,7],[1943,7],[2655,7]]},"265":{"position":[[903,7],[1745,7],[3057,7],[4135,7]]},"267":{"position":[[614,7],[1419,7],[2849,7],[3959,7],[6318,7],[7161,7],[8474,7],[9553,7]]},"273":{"position":[[1908,7],[2756,7],[4074,7],[5158,7],[7546,7],[8393,7],[9865,7],[11017,7],[13570,7],[14422,7],[15744,7],[16832,7],[19172,7],[20026,7],[21350,7],[22440,7]]},"282":{"position":[[855,7],[1664,7],[3098,7],[4212,7]]},"284":{"position":[[646,7],[1499,7],[2822,7],[3911,7]]},"294":{"position":[[452,7],[1004,7],[1915,7],[2627,7]]},"329":{"position":[[700,7],[1501,7],[2927,7],[4033,7],[6281,7],[7083,7],[8510,7],[9617,7],[12095,7],[13066,7],[14737,7],[16050,7]]},"353":{"position":[[742,7],[1595,7],[2918,7],[4007,7],[6352,7],[7204,7],[8526,7],[9614,7]]},"359":{"position":[[861,7],[1730,7],[3224,7],[4398,7],[7037,7],[7890,7],[9213,7],[10302,7],[12851,7],[13704,7],[15027,7],[16116,7]]},"373":{"position":[[0,7]]},"375":{"position":[[776,7],[1636,7],[2966,7],[4062,7]]},"382":{"position":[[1721,7],[2571,7],[3891,7],[4977,7]]},"404":{"position":[[103,7]]},"406":{"position":[[724,7],[1699,7],[3358,7],[4648,7],[7478,7],[8333,7],[9658,7],[10749,7]]},"408":{"position":[[626,7],[1711,7],[3480,7],[4880,7]]},"410":{"position":[[572,7],[1427,7],[2752,7],[3843,7]]},"420":{"position":[[999,7]]},"446":{"position":[[655,7],[1477,7],[2924,7],[4051,7]]},"448":{"position":[[676,7],[1536,7],[2866,7],[3962,7],[6513,7],[7374,7],[8705,7],[9802,7]]},"462":{"position":[[2994,7]]},"466":{"position":[[96,7]]},"482":{"position":[[742,7],[1598,7],[2924,7],[4016,7],[6376,7],[7231,7],[8556,7],[9647,7]]},"486":{"position":[[702,7],[1559,7],[2886,7],[3979,7],[6501,7],[7358,7],[8685,7],[9778,7]]},"504":{"position":[[630,7],[1438,7],[2871,7],[3984,7]]},"506":{"position":[[632,7],[1520,7],[3033,7],[4226,7]]},"508":{"position":[[749,7],[1609,7],[2939,7],[4035,7]]},"522":{"position":[[816,7],[1676,7],[3161,7],[4326,7]]},"524":{"position":[[881,7],[1737,7],[3063,7],[4155,7]]},"540":{"position":[[639,7],[1449,7],[2884,7],[3999,7]]},"542":{"position":[[972,7],[1859,7],[3371,7],[4563,7]]},"544":{"position":[[809,7],[1671,7],[3003,7],[4101,7]]},"556":{"position":[[718,7],[1579,7],[3124,7],[4300,7]]},"560":{"position":[[725,7],[1582,7],[3123,7],[4295,7]]},"562":{"position":[[736,7],[1545,7],[2979,7],[4093,7]]},"564":{"position":[[582,7],[1423,7],[2734,7],[3811,7],[6096,7],[6937,7],[8248,7],[9325,7]]},"566":{"position":[[619,7],[1420,7],[2846,7],[3952,7],[6156,7],[6998,7],[8310,7],[9388,7]]},"581":{"position":[[741,7],[1592,7],[2913,7],[4000,7]]},"588":{"position":[[991,7],[1887,7],[3305,7],[4445,7],[7147,7],[8024,7],[9403,7],[10522,7],[13128,7],[14015,7],[15404,7],[16533,7]]},"590":{"position":[[1194,7],[1972,7],[3272,7],[4294,7]]},"595":{"position":[[732,7],[1622,7],[3009,7],[4158,7],[6644,7],[7534,7],[8921,7],[10070,7]]},"600":{"position":[[653,7],[1636,7],[3124,7],[4378,7]]},"619":{"position":[[868,7],[1794,7],[3345,7],[4576,7]]},"621":{"position":[[683,7],[1546,7],[2879,7],[3978,7]]},"627":{"position":[[593,7],[1618,7],[3327,7],[4667,7]]},"629":{"position":[[612,7],[1467,7],[2792,7],[3883,7]]},"631":{"position":[[593,7],[1474,7],[2980,7],[4166,7],[6651,7],[7507,7],[8833,7],[9925,7],[12284,7],[13143,7],[14472,7],[15567,7]]},"649":{"position":[[1872,7],[2724,7],[4046,7],[5134,7],[8044,7],[8896,7],[10218,7],[11306,7],[14865,7],[15720,7],[17045,7],[18136,7],[21702,7],[22554,7],[23876,7],[24964,7],[27938,7],[28791,7],[30114,7],[31203,7]]},"651":{"position":[[1845,7],[2698,7],[4021,7],[5110,7],[8094,7],[8950,7],[10276,7],[11368,7],[14438,7],[15292,7],[16616,7],[17706,7],[20761,7],[21615,7],[22939,7],[24029,7]]},"669":{"position":[[5244,7],[6122,7],[7625,7],[8808,7]]},"671":{"position":[[1635,7],[2541,7],[4072,7],[5283,7]]},"677":{"position":[[1494,7]]},"689":{"position":[[263,8]]},"691":{"position":[[864,7],[1809,7],[3438,7],[4698,7],[7412,7],[8265,7],[9588,7],[10677,7],[13407,7],[14260,7],[15583,7],[16672,7],[19093,7],[19948,7],[21273,7],[22364,7],[24719,7],[25573,7],[26897,7],[27987,7]]},"701":{"position":[[1559,7],[2413,7],[3737,7],[4827,7],[7177,7],[8030,7],[9353,7],[10442,7]]},"703":{"position":[[683,7],[910,7],[1544,7],[2074,7],[3030,7],[3614,7],[4196,7],[4828,7],[5846,7],[6567,7],[7424,7],[8751,7],[9844,7]]},"705":{"position":[[658,7],[1622,7],[3048,7],[4250,7],[6935,7],[7821,7],[9391,7],[10592,7],[13197,7],[14084,7],[15655,7],[16857,7],[19499,7],[20353,7],[21677,7],[22767,7],[25162,7],[26014,7],[27336,7],[28424,7]]},"717":{"position":[[699,8]]},"726":{"position":[[697,7],[2352,7],[4927,7],[6937,7],[12015,7],[13210,7],[15148,7],[16668,7],[20152,7],[21277,7],[23145,7],[24595,7],[28751,7],[29604,7],[30927,7],[32016,7],[34510,7],[35364,7],[36688,7],[37778,7],[40127,7],[40984,7],[42311,7],[43404,7],[45769,7],[46627,7],[47955,7],[49049,7]]},"728":{"position":[[793,7],[1647,7],[2971,7],[4061,7],[8712,7],[9562,7],[10882,7],[11968,7],[14629,7],[15488,7],[16817,7],[17912,7],[22760,7],[25071,7],[25929,7],[27257,7],[28351,7],[31039,7],[33319,7],[34168,7],[35487,7],[36572,7],[42879,7],[43728,7],[45047,7],[46132,7]]},"738":{"position":[[278,8]]},"745":{"position":[[2324,7],[3141,7],[4583,7],[5705,7],[8008,7],[8863,7],[10188,7],[11279,7],[13698,7],[14515,7],[15957,7],[17079,7],[19339,7],[20194,7],[21519,7],[22610,7],[24965,7],[25821,7],[27147,7],[28239,7],[32699,7],[33554,7],[34879,7],[35970,7],[38325,7],[39180,7],[40505,7],[41596,7]]},"747":{"position":[[2853,7],[3899,7],[5629,7],[6990,7],[10167,7],[11024,7],[12351,7],[13444,7]]},"749":{"position":[[798,7],[1639,7],[3105,7],[4251,7],[7039,7],[7912,7],[9410,7],[10588,7],[12930,7],[13785,7],[15110,7],[16201,7]]},"751":{"position":[[3495,7],[4396,7],[5981,7],[7197,7],[10379,7],[11238,7],[12567,7],[13662,7],[17813,7],[18652,7],[20116,7],[21260,7]]},"761":{"position":[[3101,7],[4437,7],[6575,7],[8246,7]]},"767":{"position":[[928,7],[1778,7],[3098,7],[4184,7],[6616,7],[7470,7],[8794,7],[9884,7],[12341,7],[13217,7],[14718,7],[15899,7],[18251,7],[19102,7],[20423,7],[21510,7]]},"769":{"position":[[5043,7],[5889,7],[7205,7],[8287,7],[10848,7],[12092,7],[14079,7],[15648,7],[19391,7],[20390,7],[22073,7],[23387,7],[26330,7],[27180,7],[28500,7],[29586,7]]},"771":{"position":[[873,7],[1588,7],[2642,7],[4380,7],[5749,7],[9025,7],[10044,7],[11552,7],[12839,7],[15951,7],[16971,7],[18480,7],[19768,7]]},"773":{"position":[[3829,7],[6421,7],[10287,7],[13294,7]]},"795":{"position":[[1010,7],[1826,7],[3267,7],[4388,7],[6658,7],[7478,7],[8923,7],[10048,7],[12342,7],[13305,7],[15011,7],[16299,7],[19576,7],[20430,7],[21754,7],[22844,7],[25275,7],[26127,7],[27449,7],[28537,7]]},"797":{"position":[[109,7],[449,7],[2709,7],[3428,7],[4444,7],[6262,7],[7613,7],[10904,7],[11761,7],[13088,7],[14181,7]]},"799":{"position":[[3333,7],[4237,7],[5825,7],[7044,7],[9858,7],[10957,7],[12858,7],[14292,7],[17495,7],[18088,7],[18939,7],[20260,7],[21347,7]]},"801":{"position":[[3528,7],[4494,7],[6203,7],[7494,7],[10780,7],[11636,7],[12962,7],[14054,7]]},"813":{"position":[[661,8]]},"821":{"position":[[2567,7],[3442,7],[4942,7],[6122,7],[8544,7],[9404,7],[10734,7],[11830,7],[14278,7],[15153,7],[16653,7],[17833,7],[20212,7],[21072,7],[22402,7],[23498,7],[25955,7],[26822,7],[28159,7],[29262,7],[32116,7],[33241,7],[35109,7],[36559,7],[39916,7],[40776,7],[42106,7],[43202,7]]},"823":{"position":[[628,7],[1483,7],[2808,7],[3899,7],[7910,7],[8764,7],[10088,7],[11178,7]]},"825":{"position":[[7396,7],[8436,7],[10219,7],[11584,7],[15012,7],[15956,7],[17525,7],[18774,7],[21455,7],[22443,7],[24115,7],[25418,7],[28289,7],[29192,7],[30779,7],[31997,7],[34773,7],[35619,7],[37090,7],[38241,7],[40660,7],[41489,7],[42943,7],[44077,7],[46561,7],[47413,7],[48735,7],[49823,7],[52232,7],[53099,7],[54436,7],[55539,7]]},"837":{"position":[[322,8]]},"844":{"position":[[2325,7],[3145,7],[4590,7],[5715,7],[8033,7],[8891,7],[10219,7],[11313,7],[13745,7],[14561,7],[16002,7],[17123,7],[19379,7],[20233,7],[21557,7],[22647,7],[24997,7],[25853,7],[27179,7],[28271,7],[32219,7],[33073,7],[34397,7],[35487,7],[37837,7],[38692,7],[40017,7],[41108,7]]},"846":{"position":[[2608,7],[3745,7],[5684,7],[7156,7],[10841,7],[11699,7],[13027,7],[14121,7]]},"848":{"position":[[2441,7],[3457,7],[5157,7],[6488,7],[9754,7],[10615,7],[11946,7],[13043,7]]},"850":{"position":[[3314,7],[4503,7],[6435,7],[7949,7],[11424,7],[12286,7],[13618,7],[14716,7],[17182,7],[18046,7],[19380,7],[20480,7],[22879,7],[23745,7],[25081,7],[26183,7],[28671,7],[29535,7],[30869,7],[31969,7],[34368,7],[35232,7],[36566,7],[37666,7]]}}}],["institut",{"_index":2801,"t":{"805":{"position":[[227,10]]}}}],["instruct",{"_index":1133,"t":{"137":{"position":[[180,13]]},"219":{"position":[[175,12]]}}}],["integr",{"_index":180,"t":{"7":{"position":[[382,11]]},"9":{"position":[[130,11]]},"15":{"position":[[361,12]]},"31":{"position":[[810,9],[839,9]]},"103":{"position":[[36,9]]},"109":{"position":[[269,11]]},"115":{"position":[[73,11]]},"221":{"position":[[23,9]]}}}],["intellij",{"_index":815,"t":{"77":{"position":[[1059,8]]}}}],["intend",{"_index":1953,"t":{"462":{"position":[[2902,9],[3021,8]]}}}],["intens",{"_index":1083,"t":{"133":{"position":[[192,9]]}}}],["intent",{"_index":1931,"t":{"456":{"position":[[898,6]]}}}],["interact",{"_index":617,"t":{"45":{"position":[[808,11]]},"817":{"position":[[183,8]]}}}],["interest",{"_index":330,"t":{"21":{"position":[[460,10]]},"827":{"position":[[575,10]]}}}],["intern",{"_index":1375,"t":{"169":{"position":[[6396,10]]},"655":{"position":[[512,8]]},"755":{"position":[[539,8]]},"761":{"position":[[369,8]]},"817":{"position":[[784,8]]},"825":{"position":[[1183,8],[6839,8],[27673,8],[27706,8]]}}}],["interpret",{"_index":1954,"t":{"462":{"position":[[3149,9],[3402,9],[3526,9]]}}}],["intersect",{"_index":710,"t":{"57":{"position":[[4,12],[43,12],[163,14],[326,15],[1245,12]]},"61":{"position":[[258,12],[271,12]]},"300":{"position":[[802,12]]},"306":{"position":[[79,12],[394,12]]},"384":{"position":[[1299,13]]},"386":{"position":[[343,12],[1111,12]]},"474":{"position":[[3275,12],[3302,12]]},"480":{"position":[[579,12],[606,12]]},"484":{"position":[[658,15]]},"669":{"position":[[170,12],[1431,15],[1715,15]]},"673":{"position":[[791,15],[1075,15]]},"697":{"position":[[652,12],[679,12]]},"769":{"position":[[1709,15],[3358,15]]},"773":{"position":[[1043,15],[1960,15]]},"775":{"position":[[1443,15],[2427,15]]}}}],["interv",{"_index":1187,"t":{"145":{"position":[[1855,9]]}}}],["introduc",{"_index":73,"t":{"3":{"position":[[1062,11]]},"73":{"position":[[427,12]]},"420":{"position":[[128,9]]},"434":{"position":[[136,9]]},"452":{"position":[[172,10]]},"464":{"position":[[18,9],[363,10]]},"536":{"position":[[271,9]]},"669":{"position":[[305,11]]},"677":{"position":[[1279,9]]},"730":{"position":[[704,11]]},"747":{"position":[[9453,10]]},"751":{"position":[[485,9]]},"769":{"position":[[716,9]]},"803":{"position":[[23,10],[122,11]]},"827":{"position":[[187,10],[393,11]]},"846":{"position":[[10121,10]]}}}],["introduct",{"_index":1883,"t":{"428":{"position":[[196,12]]}}}],["intuit",{"_index":615,"t":{"45":{"position":[[696,10]]},"745":{"position":[[30146,12]]},"844":{"position":[[30178,12]]}}}],["invalid",{"_index":1936,"t":{"456":{"position":[[3270,7]]},"462":{"position":[[2494,7]]},"464":{"position":[[402,8],[459,7],[641,7]]},"522":{"position":[[6318,8],[6338,7],[6418,7],[6666,8],[6686,7],[6767,7]]},"728":{"position":[[5954,8]]}}}],["investig",{"_index":2212,"t":{"647":{"position":[[102,11]]},"651":{"position":[[25,11]]}}}],["invit",{"_index":2810,"t":{"815":{"position":[[753,8],[1173,7]]},"817":{"position":[[585,7]]}}}],["invok",{"_index":426,"t":{"31":{"position":[[1220,8]]},"37":{"position":[[666,6]]},"75":{"position":[[284,8]]},"113":{"position":[[735,6]]},"135":{"position":[[162,8]]},"250":{"position":[[39,6]]},"252":{"position":[[38,6]]},"456":{"position":[[3319,8]]}}}],["involv",{"_index":1108,"t":{"133":{"position":[[1109,9],[2179,7],[2611,7]]},"316":{"position":[[1155,9]]},"386":{"position":[[1188,8]]},"452":{"position":[[867,8]]}}}],["iot",{"_index":709,"t":{"55":{"position":[[1639,4]]},"115":{"position":[[160,3],[207,3]]},"337":{"position":[[226,3]]},"653":{"position":[[320,3],[372,3]]},"779":{"position":[[55,3],[206,3]]},"785":{"position":[[69,3]]}}}],["ip",{"_index":53,"t":{"3":{"position":[[829,3]]},"5":{"position":[[213,2]]},"316":{"position":[[1087,2]]},"655":{"position":[[521,2]]},"755":{"position":[[190,2],[548,2]]},"765":{"position":[[358,2]]},"769":{"position":[[57,2],[169,3],[478,2],[535,3],[975,2],[1386,3],[2227,3],[4321,2],[4461,2],[10158,2],[11449,3],[15064,3],[18096,2],[18794,2],[19641,2],[19705,3],[20943,2],[22680,2],[22753,3],[24042,2],[25199,2],[25398,2]]},"771":{"position":[[212,2],[1021,2],[1866,2],[1930,3],[3223,2],[5015,2],[5088,3],[6433,2],[7581,2],[7770,2],[8447,2],[9384,3],[10658,3],[12229,3],[14071,2],[15168,3],[15373,2],[16310,3],[17585,3],[19157,3],[21001,2],[22100,3]]},"773":{"position":[[188,3],[753,2],[1561,3],[3154,3],[5778,3],[12710,3],[19068,2]]},"775":{"position":[[401,3],[966,2],[2028,3],[3621,3]]}}}],["isn't",{"_index":1703,"t":{"371":{"position":[[40,5]]}}}],["isol",{"_index":1352,"t":{"169":{"position":[[3867,8]]}}}],["issu",{"_index":785,"t":{"73":{"position":[[658,6]]},"298":{"position":[[1023,7]]},"353":{"position":[[205,7]]},"359":{"position":[[6483,5],[12290,5]]},"406":{"position":[[6931,7]]},"460":{"position":[[750,5]]},"482":{"position":[[205,7]]},"588":{"position":[[6612,5],[12593,5]]},"669":{"position":[[2778,7]]},"719":{"position":[[366,6]]},"721":{"position":[[539,6],[684,6],[833,6]]},"726":{"position":[[944,6],[1083,6],[1383,6],[2902,6],[3100,6],[3518,6],[5531,6],[5680,6],[6000,6],[7589,6],[7737,6],[8055,6],[10491,6],[10634,6],[10942,6]]},"728":{"position":[[41942,6],[42087,6],[42236,6]]},"769":{"position":[[4505,7]]},"821":{"position":[[39350,5]]}}}],["issuer",{"_index":1239,"t":{"147":{"position":[[1793,6],[2103,7],[2117,7],[2402,6],[3091,7]]}}}],["issuer=\"oidc",{"_index":1245,"t":{"147":{"position":[[3078,12]]}}}],["it'",{"_index":214,"t":{"9":{"position":[[388,4]]},"131":{"position":[[362,4]]},"408":{"position":[[83,4]]}}}],["it_admin",{"_index":2747,"t":{"797":{"position":[[834,8],[1204,9],[1287,8],[1354,8],[1414,8],[1507,11],[1665,10],[1844,10],[2016,10],[2069,11],[2891,8],[3729,11],[3868,11],[6938,11],[7097,11],[9700,8],[9931,8]]},"799":{"position":[[384,9],[472,11],[565,11],[839,9],[974,8],[1041,8],[1101,8],[1145,9],[1296,11],[1454,10],[1633,10],[1805,10],[1858,11],[1963,10],[2404,11],[2497,11],[3650,11],[6517,11],[8905,8],[10298,11],[10381,11],[13683,11],[13776,11],[16730,8],[16859,8]]},"801":{"position":[[695,9],[820,8],[877,8],[927,8],[971,9],[1122,11],[1264,10],[1427,10],[1583,10],[1636,11],[1741,10],[1941,11],[2034,11],[2503,8],[2913,9]]}}}],["item",{"_index":1621,"t":{"310":{"position":[[2714,5]]},"426":{"position":[[8005,5]]}}}],["iter",{"_index":1546,"t":{"271":{"position":[[552,7]]},"314":{"position":[[283,9]]},"418":{"position":[[188,9],[259,9],[506,7]]},"420":{"position":[[579,7]]},"428":{"position":[[1215,8],[4044,9]]},"430":{"position":[[276,9]]},"462":{"position":[[2408,9],[2813,9]]},"711":{"position":[[223,7]]},"724":{"position":[[196,7]]},"726":{"position":[[27444,9]]},"730":{"position":[[135,7]]}}}],["itself",{"_index":882,"t":{"109":{"position":[[223,6],[1105,6]]},"649":{"position":[[14224,7]]},"728":{"position":[[30765,7]]},"825":{"position":[[63,7]]}}}],["jane",{"_index":1795,"t":{"416":{"position":[[842,4],[944,4]]}}}],["java",{"_index":384,"t":{"27":{"position":[[692,4]]}}}],["javascript",{"_index":185,"t":{"7":{"position":[[488,10]]},"73":{"position":[[950,10]]},"89":{"position":[[95,10]]},"169":{"position":[[18095,11],[24436,11]]}}}],["job",{"_index":1884,"t":{"428":{"position":[[229,3]]}}}],["john",{"_index":1929,"t":{"456":{"position":[[758,4]]}}}],["join",{"_index":1540,"t":{"271":{"position":[[305,5]]},"815":{"position":[[1137,4]]}}}],["jonathan",{"_index":352,"t":{"27":{"position":[[118,8]]}}}],["jq",{"_index":593,"t":{"43":{"position":[[3174,2]]}}}],["json",{"_index":440,"t":{"37":{"position":[[75,4],[5403,4],[8375,4]]},"45":{"position":[[367,4],[437,4],[574,4],[728,4]]},"47":{"position":[[144,4]]},"49":{"position":[[1072,4]]},"51":{"position":[[117,4]]},"53":{"position":[[289,4],[1433,4]]},"55":{"position":[[48,4],[164,4]]},"57":{"position":[[63,4],[182,4]]},"59":{"position":[[62,4],[249,4]]},"61":{"position":[[4,4],[198,4],[1036,5],[1799,4]]},"97":{"position":[[2339,4]]},"123":{"position":[[2339,4]]},"129":{"position":[[195,6]]},"163":{"position":[[158,4]]},"169":{"position":[[843,4],[1646,4],[2992,4],[6653,4],[7808,4],[11339,4],[15717,4],[21911,4],[28382,4]]},"227":{"position":[[316,4]]},"236":{"position":[[3637,4]]},"238":{"position":[[3549,4],[9299,4]]},"248":{"position":[[2339,4]]},"258":{"position":[[265,4]]},"265":{"position":[[3819,4]]},"267":{"position":[[3643,4],[9237,4]]},"273":{"position":[[310,4],[4842,4],[10701,4],[16516,4],[22124,4]]},"282":{"position":[[3896,4]]},"284":{"position":[[3595,4]]},"294":{"position":[[2311,4]]},"298":{"position":[[56,4]]},"320":{"position":[[354,4]]},"329":{"position":[[3717,4],[9301,4],[15734,4]]},"347":{"position":[[444,4]]},"353":{"position":[[3691,4],[9298,4]]},"355":{"position":[[215,4]]},"357":{"position":[[302,4]]},"359":{"position":[[4082,4],[9986,4],[15800,4]]},"365":{"position":[[385,4]]},"373":{"position":[[170,4]]},"375":{"position":[[3746,4]]},"382":{"position":[[47,4],[4661,4]]},"384":{"position":[[47,4]]},"392":{"position":[[489,4]]},"404":{"position":[[269,4]]},"406":{"position":[[4332,4],[10433,4]]},"408":{"position":[[4564,4]]},"410":{"position":[[3527,4]]},"426":{"position":[[10300,4],[10342,5]]},"440":{"position":[[285,4]]},"446":{"position":[[3735,4]]},"448":{"position":[[3646,4],[9486,4]]},"456":{"position":[[1516,4]]},"458":{"position":[[473,4]]},"460":{"position":[[1336,4]]},"462":{"position":[[767,4]]},"474":{"position":[[696,4]]},"482":{"position":[[3700,4],[9331,4]]},"484":{"position":[[179,4]]},"486":{"position":[[3663,4],[9462,4]]},"492":{"position":[[332,4]]},"500":{"position":[[314,4]]},"502":{"position":[[118,4]]},"504":{"position":[[3668,4]]},"506":{"position":[[3910,4]]},"508":{"position":[[3719,4]]},"514":{"position":[[275,4]]},"522":{"position":[[4010,4]]},"524":{"position":[[3839,4]]},"530":{"position":[[290,4]]},"538":{"position":[[169,4]]},"540":{"position":[[3683,4]]},"542":{"position":[[4247,4]]},"544":{"position":[[3785,4]]},"550":{"position":[[254,4]]},"556":{"position":[[3984,4]]},"558":{"position":[[79,4]]},"560":{"position":[[3979,4]]},"562":{"position":[[3777,4]]},"564":{"position":[[3495,4],[9009,4]]},"566":{"position":[[3636,4],[9072,4]]},"572":{"position":[[358,4]]},"581":{"position":[[3684,4]]},"588":{"position":[[4129,4],[10206,4],[16217,4]]},"590":{"position":[[3978,4]]},"595":{"position":[[3842,4],[9754,4]]},"600":{"position":[[4062,4]]},"610":{"position":[[310,4]]},"617":{"position":[[143,4]]},"619":{"position":[[4260,4]]},"621":{"position":[[3662,4]]},"625":{"position":[[80,4]]},"627":{"position":[[4351,4]]},"629":{"position":[[3567,4]]},"631":{"position":[[3850,4],[9609,4],[15251,4]]},"645":{"position":[[249,4]]},"649":{"position":[[60,4],[4818,4],[10990,4],[17820,4],[24648,4],[30887,4]]},"651":{"position":[[121,4],[4794,4],[11052,4],[17390,4],[23713,4]]},"661":{"position":[[869,4]]},"669":{"position":[[1089,4],[8492,4]]},"671":{"position":[[4967,4]]},"673":{"position":[[69,4]]},"679":{"position":[[296,4]]},"687":{"position":[[274,4]]},"689":{"position":[[746,4]]},"691":{"position":[[4382,4],[10361,4],[16356,4],[22048,4],[27671,4]]},"699":{"position":[[258,4],[981,4]]},"701":{"position":[[260,4],[4511,4],[10126,4]]},"703":{"position":[[3880,4],[9528,4]]},"705":{"position":[[3934,4],[10276,4],[16541,4],[22451,4],[28108,4]]},"707":{"position":[[120,4]]},"724":{"position":[[607,4]]},"726":{"position":[[6621,4],[16352,4],[24279,4],[31700,4],[37462,4],[43088,4],[48733,4]]},"728":{"position":[[3745,4],[6110,4],[7147,4],[11652,4],[17596,4],[19937,4],[20834,4],[23358,4],[28035,4],[31079,4],[36256,4],[38956,4],[39530,4],[40607,4],[45816,4]]},"745":{"position":[[286,4],[1250,4],[5389,4],[10963,4],[16763,4],[22294,4],[27923,4],[30357,4],[31565,4],[35654,4],[41280,4]]},"747":{"position":[[345,4],[779,4],[6674,4],[13128,4]]},"749":{"position":[[3935,4],[10272,4],[15885,4]]},"751":{"position":[[942,4],[1287,4],[6881,4],[13346,4],[15642,4],[20944,4],[23117,4]]},"761":{"position":[[526,4],[7930,4]]},"767":{"position":[[3868,4],[9568,4],[15583,4],[21194,4]]},"769":{"position":[[251,4],[468,4],[1294,4],[2793,4],[7971,4],[15332,4],[23071,4],[29270,4]]},"771":{"position":[[5433,4],[12523,4],[19452,4]]},"773":{"position":[[69,4],[12978,4]]},"775":{"position":[[221,4]]},"793":{"position":[[646,4]]},"795":{"position":[[4072,4],[9732,4],[15983,4],[22528,4],[28221,4]]},"797":{"position":[[1153,4],[7297,4],[13865,4]]},"799":{"position":[[344,4],[778,4],[6728,4],[13976,4],[21031,4]]},"801":{"position":[[634,4],[7178,4],[13738,4]]},"819":{"position":[[1000,4]]},"821":{"position":[[572,4],[1456,4],[5806,4],[11514,4],[17517,4],[23182,4],[28946,4],[36243,4],[42886,4]]},"823":{"position":[[3583,4],[6353,4],[10862,4]]},"825":{"position":[[1638,4],[3065,4],[4479,4],[11268,4],[18458,4],[25102,4],[31681,4],[37925,4],[43761,4],[49507,4],[55223,4]]},"844":{"position":[[371,4],[1220,4],[5399,4],[10997,4],[16807,4],[22331,4],[27955,4],[30397,4],[35171,4],[40792,4]]},"846":{"position":[[402,4],[6840,4],[13805,4]]},"848":{"position":[[476,4],[6172,4],[12727,4],[15033,4],[16501,4]]},"850":{"position":[[547,4],[7633,4],[14400,4],[20164,4],[25867,4],[31653,4],[37350,4]]}}}],["json.unmarshal([]byte(writeauthorizationmodelrequeststr",{"_index":499,"t":{"37":{"position":[[3241,60]]}}}],["jsonserializer.deserialize(modeljson",{"_index":521,"t":{"37":{"position":[[5080,88]]}}}],["jwt",{"_index":874,"t":{"107":{"position":[[142,3]]},"109":{"position":[[314,3],[341,3],[406,3],[462,3],[1164,3],[1179,3],[1220,3]]},"111":{"position":[[97,4],[125,3],[158,3],[225,3],[371,6],[827,4],[1580,5],[2188,3]]},"113":{"position":[[2577,3],[3429,3],[3933,3]]},"169":{"position":[[4322,3],[4837,3]]}}}],["jwt/jwt/v4",{"_index":901,"t":{"109":{"position":[[1306,10]]},"111":{"position":[[1726,11]]},"113":{"position":[[2894,11]]}}}],["jwtauthent",{"_index":940,"t":{"111":{"position":[[1215,15]]},"113":{"position":[[2071,15]]}}}],["jwtware",{"_index":949,"t":{"111":{"position":[[1671,7]]},"113":{"position":[[2839,7]]}}}],["keep",{"_index":1074,"t":{"131":{"position":[[1755,7]]},"318":{"position":[[160,4]]},"468":{"position":[[401,4]]},"726":{"position":[[27439,4]]},"728":{"position":[[151,4]]},"769":{"position":[[10314,4]]},"775":{"position":[[12,4]]},"821":{"position":[[3,4]]},"844":{"position":[[3,4]]}}}],["key",{"_index":723,"t":{"61":{"position":[[146,4]]},"111":{"position":[[1824,3],[1839,3],[1893,3],[2028,3]]},"113":{"position":[[3065,3],[3080,3],[3134,3],[3269,3]]},"143":{"position":[[346,3],[490,5],[842,3]]},"147":{"position":[[115,3],[158,3],[198,3],[259,3],[348,3],[393,5],[559,4],[679,5],[762,4],[914,5],[1166,3],[1351,3],[1993,4],[2211,4],[2358,5],[2438,5],[2691,3],[2876,3]]},"217":{"position":[[26,3],[121,3]]},"424":{"position":[[491,4]]},"426":{"position":[[7331,3]]},"588":{"position":[[1289,8],[2511,8],[3899,8],[5967,9],[7426,8],[8609,8],[9976,8],[11987,9],[13417,8],[14610,8],[15987,8],[18028,9]]},"705":{"position":[[900,8],[2130,8],[3580,8],[5707,9]]}}}],["key1",{"_index":1153,"t":{"143":{"position":[[496,8]]},"147":{"position":[[685,8]]}}}],["key2",{"_index":1154,"t":{"143":{"position":[[505,7]]},"147":{"position":[[694,7]]}}}],["key=\"/users/myuser/key/server.key",{"_index":1238,"t":{"147":{"position":[[1674,34],[3227,34]]}}}],["keyboard",{"_index":2790,"t":{"799":{"position":[[23260,8]]}}}],["keys=\"key1,key2",{"_index":1235,"t":{"147":{"position":[[1569,16]]}}}],["keyword",{"_index":1932,"t":{"456":{"position":[[1461,8]]},"484":{"position":[[162,7]]},"651":{"position":[[861,7]]}}}],["kind",{"_index":1944,"t":{"462":{"position":[[397,5],[1799,5]]}}}],["know",{"_index":225,"t":{"9":{"position":[[768,4],[827,4]]},"105":{"position":[[274,4],[638,4]]},"227":{"position":[[96,4],[923,4],[977,4]]},"229":{"position":[[12,4]]},"258":{"position":[[96,4],[608,4],[655,4]]},"260":{"position":[[12,4]]},"273":{"position":[[96,4],[24314,4],[24432,4]]},"275":{"position":[[12,4]]},"277":{"position":[[12,4]]},"320":{"position":[[96,4],[1115,4],[1162,4],[1322,4]]},"322":{"position":[[12,4]]},"324":{"position":[[12,4]]},"347":{"position":[[86,4],[1553,4],[1607,4]]},"349":{"position":[[12,4]]},"365":{"position":[[87,4],[1055,4],[1109,4]]},"367":{"position":[[12,4]]},"392":{"position":[[86,4],[1054,4],[1118,4],[1254,4]]},"396":{"position":[[12,4]]},"398":{"position":[[12,4]]},"440":{"position":[[96,4],[751,4]]},"474":{"position":[[96,4],[2361,4],[2424,4],[2572,4]]},"476":{"position":[[12,4]]},"478":{"position":[[12,4]]},"492":{"position":[[96,4],[892,4],[939,4]]},"494":{"position":[[12,4]]},"514":{"position":[[96,4],[662,4],[709,4]]},"516":{"position":[[12,4]]},"530":{"position":[[96,4],[639,4],[686,4]]},"532":{"position":[[12,4]]},"550":{"position":[[96,4],[592,4],[639,4]]},"552":{"position":[[12,4]]},"572":{"position":[[96,4],[1063,4],[1110,4]]},"574":{"position":[[12,4]]},"610":{"position":[[86,4],[870,4],[924,4]]},"612":{"position":[[12,4]]},"637":{"position":[[87,4],[149,4],[227,4]]},"639":{"position":[[12,4]]},"659":{"position":[[655,4],[828,4]]},"671":{"position":[[12,4]]},"679":{"position":[[96,4],[751,4],[798,4]]},"681":{"position":[[12,4]]},"713":{"position":[[96,4],[314,4],[655,4]]},"717":{"position":[[473,4],[549,5]]},"728":{"position":[[38532,5]]},"734":{"position":[[96,4],[308,4],[483,4]]},"759":{"position":[[657,4],[830,4]]},"771":{"position":[[12,4],[440,4]]},"781":{"position":[[96,4],[288,4],[459,4],[698,4],[1051,4]]},"809":{"position":[[96,4],[288,4],[459,4]]},"833":{"position":[[96,4],[308,4],[483,4],[759,4]]},"848":{"position":[[451,4]]}}}],["known",{"_index":1735,"t":{"390":{"position":[[584,5]]},"426":{"position":[[5854,5]]},"749":{"position":[[35,5]]}}}],["kubecon",{"_index":345,"t":{"27":{"position":[[45,7],[830,7]]}}}],["kubernet",{"_index":360,"t":{"27":{"position":[[259,11]]},"137":{"position":[[25,10]]},"167":{"position":[[133,10],[192,11]]}}}],["käldström",{"_index":355,"t":{"27":{"position":[[146,9]]}}}],["lack",{"_index":2554,"t":{"751":{"position":[[9322,4]]},"848":{"position":[[8853,4]]}}}],["languag",{"_index":272,"t":{"15":{"position":[[282,9]]},"31":{"position":[[107,8]]},"45":{"position":[[28,8],[423,9]]},"47":{"position":[[130,9]]},"63":{"position":[[70,8]]},"73":{"position":[[924,9]]},"75":{"position":[[73,8],[120,9]]},"169":{"position":[[3361,9]]},"361":{"position":[[159,8],[202,9]]},"392":{"position":[[1408,9],[1449,8]]},"400":{"position":[[31,8]]},"420":{"position":[[612,9],[706,9]]},"422":{"position":[[4094,9]]},"424":{"position":[[2796,8]]},"426":{"position":[[38,8],[7290,9],[8407,9],[8790,9],[9097,9]]},"428":{"position":[[1016,10]]},"432":{"position":[[138,8],[181,9]]},"450":{"position":[[215,8],[258,9]]},"526":{"position":[[159,8],[202,9]]},"625":{"position":[[1771,9]]},"713":{"position":[[1043,9],[1089,8]]},"734":{"position":[[783,9],[829,8]]},"781":{"position":[[1294,9],[1340,8]]},"809":{"position":[[606,9],[652,8]]},"833":{"position":[[885,9],[930,8]]}}}],["language#th",{"_index":2183,"t":{"625":{"position":[[1291,12]]}}}],["language'",{"_index":2293,"t":{"669":{"position":[[147,10]]}}}],["larg",{"_index":242,"t":{"9":{"position":[[1148,5]]},"131":{"position":[[1716,5]]},"464":{"position":[[625,5]]},"850":{"position":[[331,6]]}}}],["last",{"_index":748,"t":{"67":{"position":[[242,4]]},"71":{"position":[[407,4]]},"300":{"position":[[438,4]]},"422":{"position":[[4637,4]]},"747":{"position":[[9429,4]]},"846":{"position":[[10097,4]]}}}],["latenc",{"_index":268,"t":{"15":{"position":[[206,7]]},"71":{"position":[[218,7]]},"133":{"position":[[1304,7],[1510,7],[1649,9]]},"159":{"position":[[438,7]]},"771":{"position":[[667,7]]}}}],["later",{"_index":1587,"t":{"296":{"position":[[3199,5]]},"420":{"position":[[157,5],[587,6]]},"621":{"position":[[6261,5]]},"677":{"position":[[1556,5]]},"728":{"position":[[23051,5]]}}}],["latest",{"_index":383,"t":{"27":{"position":[[603,7]]},"67":{"position":[[207,6]]},"141":{"position":[[164,6]]},"209":{"position":[[333,6]]},"215":{"position":[[3328,6]]},"217":{"position":[[4457,6]]},"219":{"position":[[5018,6]]}}}],["latter",{"_index":2529,"t":{"749":{"position":[[6280,6]]}}}],["layer",{"_index":897,"t":{"109":{"position":[[1154,5]]},"728":{"position":[[22700,5],[22816,5],[22949,5],[40002,5]]}}}],["lead",{"_index":1295,"t":{"155":{"position":[[937,4]]},"420":{"position":[[969,4]]},"649":{"position":[[20516,5],[20551,5],[20793,7]]}}}],["leads#memb",{"_index":2223,"t":{"649":{"position":[[20828,14]]}}}],["leaf",{"_index":1724,"t":{"384":{"position":[[851,4],[1025,7],[1111,7]]},"386":{"position":[[1357,4],[1393,4]]},"595":{"position":[[6002,8],[11914,8]]}}}],["learn",{"_index":244,"t":{"11":{"position":[[11,5]]},"25":{"position":[[367,5]]},"27":{"position":[[271,5],[442,5]]},"29":{"position":[[180,5]]},"31":{"position":[[937,5]]},"61":{"position":[[2705,5]]},"63":{"position":[[123,5],[188,5],[287,5]]},"75":{"position":[[0,5],[82,5],[237,5]]},"135":{"position":[[115,5],[227,5],[312,5]]},"165":{"position":[[87,5]]},"169":{"position":[[309,5],[3318,5]]},"203":{"position":[[106,5]]},"211":{"position":[[136,5],[221,5]]},"221":{"position":[[80,5]]},"225":{"position":[[23,5]]},"227":{"position":[[1047,5]]},"229":{"position":[[82,5]]},"240":{"position":[[82,5],[156,5]]},"254":{"position":[[99,5],[188,5],[286,5]]},"256":{"position":[[23,5]]},"258":{"position":[[766,5]]},"260":{"position":[[123,5]]},"269":{"position":[[82,5],[170,5],[258,5]]},"271":{"position":[[23,5]]},"273":{"position":[[24384,5],[24478,5]]},"275":{"position":[[82,5]]},"277":{"position":[[58,5]]},"286":{"position":[[82,5],[152,5]]},"314":{"position":[[188,5]]},"316":{"position":[[133,5],[236,5],[361,5],[490,5],[608,5],[714,5],[840,5],[940,5],[1053,5],[1226,5],[1336,5],[1565,5]]},"318":{"position":[[23,5]]},"320":{"position":[[1273,5],[1368,5]]},"322":{"position":[[123,5]]},"324":{"position":[[58,5]]},"333":{"position":[[97,5]]},"341":{"position":[[172,5]]},"343":{"position":[[21,5],[155,5],[261,5],[375,5]]},"347":{"position":[[1677,5]]},"349":{"position":[[82,5]]},"361":{"position":[[94,5],[168,5],[231,5]]},"363":{"position":[[28,5]]},"365":{"position":[[1179,5]]},"367":{"position":[[82,5]]},"390":{"position":[[21,5]]},"392":{"position":[[1188,5],[1370,5]]},"396":{"position":[[82,5]]},"398":{"position":[[128,5]]},"412":{"position":[[99,5],[237,5]]},"426":{"position":[[2641,5],[5163,5]]},"432":{"position":[[85,5],[147,5],[210,5]]},"436":{"position":[[20,5],[118,5]]},"438":{"position":[[23,5]]},"450":{"position":[[85,5],[150,5],[224,5]]},"470":{"position":[[92,5],[154,5]]},"474":{"position":[[2515,5],[2665,5]]},"476":{"position":[[103,5]]},"478":{"position":[[105,5]]},"488":{"position":[[95,5],[159,5],[224,5]]},"490":{"position":[[23,5]]},"492":{"position":[[1050,5]]},"494":{"position":[[123,5]]},"510":{"position":[[134,5]]},"512":{"position":[[23,5]]},"514":{"position":[[820,5]]},"516":{"position":[[123,5]]},"526":{"position":[[94,5],[168,5],[237,5]]},"528":{"position":[[23,5]]},"530":{"position":[[797,5]]},"532":{"position":[[123,5]]},"546":{"position":[[96,5]]},"548":{"position":[[23,5]]},"550":{"position":[[750,5]]},"552":{"position":[[123,5]]},"568":{"position":[[115,5],[237,5]]},"570":{"position":[[23,5]]},"572":{"position":[[1221,5]]},"574":{"position":[[123,5]]},"595":{"position":[[11988,5]]},"608":{"position":[[21,5]]},"610":{"position":[[994,5]]},"612":{"position":[[82,5]]},"633":{"position":[[130,5],[219,5],[296,5]]},"635":{"position":[[21,5]]},"637":{"position":[[338,5]]},"639":{"position":[[123,5]]},"653":{"position":[[219,5]]},"659":{"position":[[771,5],[930,5]]},"675":{"position":[[106,5],[259,5]]},"677":{"position":[[23,5]]},"679":{"position":[[909,5]]},"681":{"position":[[123,5]]},"693":{"position":[[125,5]]},"695":{"position":[[135,5]]},"709":{"position":[[105,5],[276,5]]},"711":{"position":[[105,5]]},"713":{"position":[[430,5],[824,5]]},"730":{"position":[[22,8]]},"732":{"position":[[217,5]]},"734":{"position":[[417,5],[599,5]]},"759":{"position":[[773,5],[932,5]]},"777":{"position":[[101,5],[225,5]]},"779":{"position":[[95,5]]},"781":{"position":[[399,5],[568,5],[867,5],[1147,5]]},"791":{"position":[[201,5]]},"807":{"position":[[117,5]]},"809":{"position":[[399,5],[568,5]]},"819":{"position":[[503,5]]},"827":{"position":[[240,7],[589,8]]},"831":{"position":[[99,5]]},"833":{"position":[[417,5],[599,5],[847,5]]}}}],["leav",{"_index":1902,"t":{"430":{"position":[[6,5]]},"593":{"position":[[258,6]]}}}],["left",{"_index":2794,"t":{"801":{"position":[[309,4]]}}}],["legaci",{"_index":2802,"t":{"807":{"position":[[467,6]]},"815":{"position":[[521,6]]},"817":{"position":[[290,6]]},"819":{"position":[[624,6],[1773,6]]},"821":{"position":[[2779,6],[3957,6],[5511,6],[6739,6],[7783,6]]}}}],["legacy_admin",{"_index":2818,"t":{"819":{"position":[[949,13],[1064,13],[1265,15],[1413,15],[1786,14]]},"821":{"position":[[103,14],[256,12],[636,13],[837,15],[985,15],[1987,12],[2850,15],[5590,15],[7729,12],[7996,12],[8797,15],[9896,15],[11275,15],[12824,12],[13512,15],[13538,14],[25408,12],[26214,15],[27320,15],[28706,15],[30269,12],[30977,15],[31003,14],[40169,15],[41268,15],[42647,15],[44196,12],[44884,15],[44910,14],[45171,12],[45226,13],[45271,12],[45328,13]]},"823":{"position":[[5935,12],[6284,13],[6417,13],[6471,12],[6527,12],[6668,15],[6793,14],[6961,14],[7043,15],[13129,12],[13184,13],[13229,12],[13286,13]]},"825":{"position":[[2256,14],[2526,14],[3772,14],[4042,14],[4543,13],[4597,12],[4653,12],[5078,15],[5203,14],[5371,14],[5453,15],[6166,14],[6436,14],[57547,12],[57602,13]]}}}],["length",{"_index":1202,"t":{"145":{"position":[[3059,6]]}}}],["less",{"_index":1330,"t":{"161":{"position":[[892,4]]},"380":{"position":[[306,4]]},"420":{"position":[[398,4]]}}}],["let",{"_index":1865,"t":{"426":{"position":[[3211,4]]},"462":{"position":[[1428,4]]},"728":{"position":[[22771,7]]}}}],["let'",{"_index":654,"t":{"49":{"position":[[1025,5]]},"145":{"position":[[470,5]]},"267":{"position":[[4,5]]},"273":{"position":[[6972,5]]},"359":{"position":[[6377,5]]},"392":{"position":[[156,5]]},"394":{"position":[[10,5]]},"416":{"position":[[1310,5]]},"422":{"position":[[436,5],[2178,5]]},"428":{"position":[[1496,5]]},"540":{"position":[[45,5]]},"691":{"position":[[102,5]]},"749":{"position":[[122,5]]},"751":{"position":[[9494,5]]},"767":{"position":[[23431,5]]},"801":{"position":[[2817,5]]},"821":{"position":[[45073,5]]},"844":{"position":[[31349,5]]},"846":{"position":[[2000,5]]}}}],["level",{"_index":1109,"t":{"133":{"position":[[1190,5]]},"163":{"position":[[177,6],[205,5]]},"316":{"position":[[406,5]]},"474":{"position":[[2620,5]]},"478":{"position":[[60,5]]},"740":{"position":[[237,5],[270,5]]},"745":{"position":[[34,6]]}}}],["leverag",{"_index":1705,"t":{"373":{"position":[[52,8]]},"504":{"position":[[3,8]]}}}],["librari",{"_index":794,"t":{"73":{"position":[[896,7]]}}}],["lifecycl",{"_index":2343,"t":{"695":{"position":[[7,9]]}}}],["likewis",{"_index":2210,"t":{"645":{"position":[[159,9]]},"795":{"position":[[11776,9]]}}}],["limit",{"_index":59,"t":{"3":{"position":[[869,7]]},"9":{"position":[[19,11]]},"129":{"position":[[270,6]]},"133":{"position":[[34,6],[376,6],[794,5],[867,5],[1037,7],[1739,6],[1782,8],[2013,6],[2426,6]]},"145":{"position":[[3040,6]]},"308":{"position":[[285,5]]},"310":{"position":[[1355,5]]},"329":{"position":[[11405,5]]},"426":{"position":[[3541,5]]},"472":{"position":[[452,8]]},"570":{"position":[[45,11]]},"815":{"position":[[139,7],[1232,8]]}}}],["link",{"_index":2039,"t":{"524":{"position":[[173,7]]},"732":{"position":[[128,5]]}}}],["linux",{"_index":824,"t":{"77":{"position":[[1391,5],[1614,6]]},"81":{"position":[[188,6]]}}}],["list",{"_index":223,"t":{"9":{"position":[[713,4]]},"31":{"position":[[697,4],[745,4]]},"45":{"position":[[287,5]]},"59":{"position":[[238,6]]},"67":{"position":[[8,4],[195,4]]},"117":{"position":[[46,4]]},"121":{"position":[[24,4]]},"125":{"position":[[1336,4]]},"127":{"position":[[108,4],[134,4]]},"129":{"position":[[14,4]]},"133":{"position":[[588,4]]},"155":{"position":[[690,4],[1221,4]]},"169":{"position":[[5612,5],[24184,4],[24209,4],[24255,4],[24494,4],[24549,4],[24587,4],[29645,4],[30422,4]]},"185":{"position":[[22,5]]},"197":{"position":[[2,4],[48,4]]},"205":{"position":[[14,4]]},"215":{"position":[[3221,6]]},"217":{"position":[[4350,6]]},"219":{"position":[[4911,6]]},"227":{"position":[[140,4]]},"258":{"position":[[140,4]]},"273":{"position":[[140,4]]},"288":{"position":[[69,4]]},"292":{"position":[[33,4]]},"296":{"position":[[19,4]]},"298":{"position":[[917,4]]},"308":{"position":[[13,5],[40,4],[160,4],[189,4]]},"310":{"position":[[39,6],[754,4],[1197,4],[1285,4],[1515,4],[1568,4],[1654,4],[1901,4],[2232,4],[2796,4]]},"316":{"position":[[602,5],[659,4]]},"320":{"position":[[140,4]]},"347":{"position":[[117,6]]},"365":{"position":[[118,6]]},"392":{"position":[[117,6]]},"418":{"position":[[421,4],[443,4]]},"422":{"position":[[12,4],[1917,4],[1971,4],[3801,4],[3841,5],[3886,4],[4014,4]]},"424":{"position":[[295,4],[2250,4]]},"426":{"position":[[7639,4]]},"440":{"position":[[140,4]]},"452":{"position":[[1153,4]]},"460":{"position":[[3317,4]]},"464":{"position":[[273,4],[514,4]]},"474":{"position":[[140,4]]},"488":{"position":[[188,6]]},"492":{"position":[[140,4]]},"514":{"position":[[140,4]]},"526":{"position":[[261,6]]},"530":{"position":[[140,4]]},"550":{"position":[[140,4]]},"556":{"position":[[6382,4]]},"572":{"position":[[140,4]]},"590":{"position":[[6019,4]]},"598":{"position":[[56,4]]},"600":{"position":[[5426,4],[6374,4],[6815,4]]},"604":{"position":[[211,4],[351,4]]},"610":{"position":[[117,6]]},"637":{"position":[[118,6]]},"679":{"position":[[140,4]]},"709":{"position":[[231,4]]},"713":{"position":[[140,4]]},"724":{"position":[[383,7]]},"728":{"position":[[48018,6]]},"734":{"position":[[140,4]]},"781":{"position":[[140,4]]},"809":{"position":[[140,4]]},"815":{"position":[[70,4]]},"833":{"position":[[140,4]]}}}],["list#::#,#(modelJson); var response = await fgaClient.WriteAuthorizationModel(body); // response.AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() # from openfga_sdk.models.write_authorization_model_request import WriteAuthorizationModelRequest async def write_authorization_model(): body_string = \"{\\\"schema_version\\\":\\\"1.1\\\",\\\"type_definitions\\\":[{\\\"type\\\":\\\"user\\\"},{\\\"type\\\":\\\"document\\\",\\\"relations\\\":{\\\"reader\\\":{\\\"this\\\":{}},\\\"writer\\\":{\\\"this\\\":{}},\\\"owner\\\":{\\\"this\\\":{}}},\\\"metadata\\\":{\\\"relations\\\":{\\\"reader\\\":{\\\"directly_related_user_types\\\":[{\\\"type\\\":\\\"user\\\"}]},\\\"writer\\\":{\\\"directly_related_user_types\\\":[{\\\"type\\\":\\\"user\\\"}]},\\\"owner\\\":{\\\"directly_related_user_types\\\":[{\\\"type\\\":\\\"user\\\"}]}}}}]}\" response = await fga_client_instance.write_authorization_model(json.loads(body)) # response.authorization_model_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga model write --store-id=${FGA_STORE_ID} {\"schema_version\":\"1.1\",\"type_definitions\":[{\"type\":\"user\"},{\"type\":\"document\",\"relations\":{\"reader\":{\"this\":{}},\"writer\":{\"this\":{}},\"owner\":{\"this\":{}}},\"metadata\":{\"relations\":{\"reader\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"writer\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"owner\":{\"directly_related_user_types\":[{\"type\":\"user\"}]}}}}]} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/authorization-models \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"schema_version\":\"1.1\",\"type_definitions\":[{\"type\":\"user\"},{\"type\":\"document\",\"relations\":{\"reader\":{\"this\":{}},\"writer\":{\"this\":{}},\"owner\":{\"this\":{}}},\"metadata\":{\"relations\":{\"reader\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"writer\":{\"directly_related_user_types\":[{\"type\":\"user\"}]},\"owner\":{\"directly_related_user_types\":[{\"type\":\"user\"}]}}}}]}' The API will then return the authorization model ID. Note The OpenFGA API only accepts an authorization model in the API's JSON syntax. To convert between the API Syntax and the friendly DSL, you can use the FGA CLI.","s":"Step By Step","u":"/docs/getting-started/configure-model","h":"#step-by-step","p":30},{"i":37,"t":"Take a look at the following sections for more information on how to configure authorization model in your store. Getting Started with Modeling Read how to get started with modeling. More Modeling: Direct Relationships Read the basics of modeling authorization and granting access to users. More","s":"Related Sections","u":"/docs/getting-started/configure-model","h":"#related-sections","p":30},{"i":39,"t":"As you'd expect, the OpenFGA team will be at KubeCon NA 2023 in Chicago, IL! We'll have a packed agenda for the week: Jonathan Whitaker and Lucas Käldström will be presenting in Could_Native Rejects on how to use OpenFGA to manage and extend authorization in Kubernetes. Learn more here. Maria Ines Parnisari and Andres Aguiar will be presenting in AppDeveloperCon about modernizing authorization for cloud native applications using OpenFGA. Learn more here. We'll host a Project Meeting on Monday 9.30 AM in the Hudson room at the Hilton Garden Inn. We'll share how the product is being used, demo the latests features like our new CLI, the VS Code Extension, Conditional Relationships, the Java SDK... and more! We'll be in the CNCF Project Pavilion during the afternoons. We'll host our OpenFGA community meeting directly from KubeCon on Thursday 9th at 3PM UTC (8AM PST/11AM EST). If you want to meet with the team outside of these events, please pick any spot that works for you in our calendar. See you in Chicago!","s":"Join the OpenFGA team at KubeCon NA 2023","u":"/blog/kubecon-na-2023","h":"","p":38},{"i":41,"t":"A store is a OpenFGA entity that contains your authorization data. You will need to create a store in OpenFGA before adding an authorization model and relationship tuples to it. This article explains how to setup an OpenFGA store.","s":"Create a Store","u":"/docs/getting-started/create-store","h":"","p":40},{"i":43,"t":"Node.js Go .NET Python CLI curl const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk'; const openFga = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // optional, defaults to \"https\" apiHost: process.env.FGA_API_HOST // required, define without the scheme (e.g. api.openfga.example instead of https://api.openfga.example) }); const { id: storeId } = await openFga.createStore({ name: \"FGA Demo Store\", }); import ( openfga \"github.com/openfga/go-sdk\" . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // optional, can be overridden per request }) if err != nil { // .. Handle error } resp, err := fgaClient.CreateStore(context.Background()).Body(ClientCreateStoreRequest{Name: \"FGA Demo\"}).Execute() if err != nil { // .. Handle error } } using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace ExampleApp; class MyProgram { static async Task Main() { var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); var store = await fgaClient.CreateStore(new ClientCreateStoreRequest(){Name = \"FGA Demo\"}) { Name = \"FGA Demo Store\" }); } } import os import openfga_sdk from openfga_sdk.client import OpenFgaClient from openfga_sdk.models.create_store_request import CreateStoreRequest configuration = openfga_sdk.Configuration( scheme = os.environ.get('FGA_API_SCHEME'), api_host = os.environ.get('FGA_API_HOST'), ) async with OpenFgaClient(configuration) as fga_client: body = CreateStoreRequest( name = \"FGA Demo Store\", ) response = await fga_client.create_store(body) async def create_store(): try: # Create a store body = CreateStoreRequest( name = \"FGA Demo\", ) api_response = await fga_client_instance.create_store(body) except openfga_sdk.ApiException as e: print(\"Exception when calling OpenFgaClient->create_store: %s\\n\" % e) fga store create --name \"FGA Demo Store\" # To create the store and directly put the Store ID into an env variable: # export FGA_STORE_ID=$(fga store create --name \"FGA Demo Store\" | jq -r .id) curl -X POST $FGA_API_HOST/stores \\ -H \"content-type: application/json\" \\ -d '{\"name\": \"FGA Demo Store\"}'","s":"Step By Step","u":"/docs/getting-started/create-store","h":"#step-by-step","p":40},{"i":45,"t":"The OpenFGA service answers authorization checks by determining whether a relationship exists between an object and a user. Checks takes into consideration the authorization model of the system and the relationship tuples present in the system at that time in order to make a decision. In this guide you will learn about the most relevant FGA concepts, such as a type or an authorization model, and you will be able to explore them using the FGA playground. What Is A Type?​ A type is a string. It should define a class of objects with similar characteristics. Examples of types: workspace repository organization document What Is A Type Definition?​ A type definition is a configuration that defines all possible relations a user or another object can have in relation to this type. Code snippet below is an example of a type definition: DSL JSON type document relations define viewer: [user] define commenter: [user] define editor: [user] define owner: [user] { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} }, \"commenter\": { \"this\": {} }, \"editor\": { \"this\": {} }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } What Is An Authorization Model?​ An authorization model is a combination of one or more type definitions. This is used to define the permission model of a system. Code snippet below is an example of an authorization model: DSL JSON model schema 1.1 type document relations define viewer: [domain#member, user] define commenter: [domain#member, user] define editor: [domain#member, user] define owner: [domain#member, user] type domain relations define member: [user] type user { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} }, \"commenter\": { \"this\": {} }, \"editor\": { \"this\": {} }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"domain\", \"relation\": \"member\" }, { \"type\": \"user\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"domain\", \"relation\": \"member\" }, { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"domain\", \"relation\": \"member\" }, { \"type\": \"user\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"domain\", \"relation\": \"member\" }, { \"type\": \"user\" } ] } } } }, { \"type\": \"domain\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"user\" } ] } Authorization model, together with relationship tuples, allow determination of whether a relationship exists between a user and an object. The OpenFGA service has two different syntaxes to define the authorization model: A JSON syntax accepted by the OpenFGA API that follows closely the original syntax discussed in the Zanzibar Paper. See Equivalent Zanzibar Concepts. A DSL that we believe is easier to use and is used in the Okta FGA Playground to help with modeling. This is translated to the API-supported syntax before being sent to the API. Learn more about the OpenFGA Configuration Language. What Is A Store?​ A \"store\" is a OpenFGA entity used for organizing data needed to answer authorization checks. Each store contains one or more versions of an authorization model and may contain various relationship tuples. Store data such as the authorization model and relationship tuples cannot be shared across stores, so it is highly recommended to store all data that may be related and may affect your authorization result in a single store. For completely separate authorization needs or isolated environments where data from one should not affect another (e.g. development/prod), you may want to create separate stores. What Is An Object?​ An object represents an entity in the system. We can define how various users have a relationship to it through relationship tuples and the authorization model. An object is a combination of a type and an identifier. For example: workspace:fb83c013-3060-41f4-9590-d3233a67938f repository:auth0/express-jwt organization:org_ajUc9kJ document:new-roadmap User, relation and object are the building blocks for relationship tuples. For more information, please see Direct Access. What Is A User?​ A user is an entity in the system that can be related to an object. A user is is a combination of a type, an identifier and an optional relation. For example, any identifier: e.g. user:anne or user:4179af14-f0c0-4930-88fd-5570c7bf6f59 any object: e.g. workspace:fb83c013-3060-41f4-9590-d3233a67938f, repository:auth0/express-jwt or organization:org_ajUc9kJ a group or a set of users (also called a userset): e.g. organization:org_ajUc9kJ#members, which represents the set of users related to the object organization:org_ajUc9kJ as member everyone, using the special syntax: * User, relation and object are the building blocks for relationship tuples. For more information, please see Direct Access. What Is A Relation?​ A relation is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system. Examples of relation: User can be a reader of a document Team can administer a repo User can be a member of a team What Is A Relation Definition?​ A relation definition lists the conditions or requirements under which this relationship would be possible. For example: editor describing a possible relationship between a user and an object in the document type allows the following: user identifier to object relationship: the user id anne of type user is related to the object document:roadmap as editor object to object relationship: the object application:ifft is related to the object document:roadmap as editor userset to object relationship: the userset organization:auth0.com#member is related to document:roadmap as editor indicating that the set of users who are related to the object organization:auth0.com as member are related to the object document:roadmap as editors this allows for potential solutions to use-cases like sharing a document internally with all members of a company or a team everyone to object relationship: everyone (*) is related to document:roadmap as editor this is how one could model publicly editable documents These would be defined in the authorization model as such: DSL JSON type document relations define viewer: [user] define commenter: [user] define editor: [user] define owner: [user] type user { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} }, \"commenter\": { \"this\": {} }, \"editor\": { \"this\": {} }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"user\" } ] } info In the configuration of the document type, we have four relations: viewer, commenter, editor and owner. User, relation and object are the building blocks for relationship tuples. For more information, please see Direct Access. What Is A Directly Related User Type?​ A directly related user type is an array specified in the type definition to indicate what types of users can be directly related to that relation. For the following model, only relationship tuple with user type user may be assigned to document. DSL JSON type document relations define viewer: [user] { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Relationship tuple with user user:anne or user:3f7768e0-4fa7-4e93-8417-4da68ce1846c may be written for objects with type document and relation viewer, so writing {\"user\": \"user:anne\",\"relation\":\"viewer\",\"object\":\"document:roadmap\"} will succeed. Relationship tuple writes with user type that is not allowed for the viewer relation on objects of type document, for example workspace:auth0 or folder:planning#editor will be rejected, so writing {\"user\": \"folder:product\",\"relation\":\"viewer\",\"object\":\"document:roadmap\"} will fail. This will affect only relations that are directly related and have the direct relationship type restrictions in their relation definition. What Is A Relationship Tuple?​ A relationship tuple is a tuple consisting of a user, relation and object stored in OpenFGA. A relationship tuple consists of a: user, e.g. user:anne, user:3f7768e0-4fa7-4e93-8417-4da68ce1846c, workspace:auth0 or folder:planning#editor relation, e.g. editor, member or parent_workspace object, e.g repo:auth0/express_jwt, domain:auth0.com or channel:marketing An authorization model, together with relationship tuples, allow the determination of whether a relationship exists between a user and an object. Throughout the documentation, you will encounter relationship tuples represented as: [ { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] For more information, please see Direct Access. What Is A Relationship?​ A relationship is the realization of a relation between a user and an object. An authorization model, together with relationship tuples, allow the determination of whether a relationship exists between a user and an object. Relationships may be classified as direct or implied. What Are Direct And Implied Relationships?​ A direct relationship R between user X and object Y means the relationship tuple (user=X, relation=R, object=Y) exists, and the OpenFGA authorization model for that relation allows this direct relationship (by use of direct relationship type restrictions). An implied (or computed) relationship R exists between user X and object Y if user X is related to an object Z that is in a direct or implied relationship with object Y, and the OpenFGA authorization model allows it. user:anne has a direct relationship with document:new-roadmap as viewer if the type definition allows it (allows direct relationship type restrictions), and one of the following relationship tuples exist: [ // Anne of type user is directly related to the document { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, ] [ // Everyone (`*`) of type user is directly related to the document { \"user\": \"*\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, ] [ // The userset is directly related to this document { \"user\": \"team:product#member\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, // AND Anne of type user is a member of a userset (e.g. team:product#member) { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"team:product#member\", }, ] user:anne has an implied relationship with document:new-roadmap as viewer if the type definition allows it, and the presence of relationship tuples satisfying the relationship exist. For example, assuming the following type definition: DSL JSON type document relations define viewer: [user] or editor define editor: [user] { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } And assuming the following relationship tuple exists in the system: [ { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] In this case, the relationship between user:anne and document:new-roadmap as a viewer is implied from the direct editor relationship user:anne has with that same document. Thus, the following request to check whether a viewer relationship exists between user:anne and document:new-roadmap will return true. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'viewer', object: 'document:new-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"viewer\", Object: \"document:new-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"viewer\", Object = \"document:new-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"viewer\", object=\"document:new-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne viewer document:new-roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"viewer\",\"object\":\"document:new-roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"viewer\", // has an `viewer` relation object = \"document:new-roadmap\", // with the object `document:new-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true What Is A Check Request?​ A check request is a call to the OpenFGA check endpoint that returns whether the user has a certain relationship with an object. This can be done using the check methods in the OpenFGA SDKs (JavaScript SDK/Go SDK/.NET SDK), by manually calling the check endpoint using curl, or in your code. The check endpoint responds with { \"allowed\": true } if a relationship exists, and with { \"allowed\": false } if the relationship does not. For example, the following will check whether anne of type user has a viewer relation to document:new-roadmap: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'viewer', object: 'document:new-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"viewer\", Object: \"document:new-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"viewer\", Object = \"document:new-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"viewer\", object=\"document:new-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne viewer document:new-roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"viewer\",\"object\":\"document:new-roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"viewer\", // has an `viewer` relation object = \"document:new-roadmap\", // with the object `document:new-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true For more information, please see the Relationship Queries page and the official Check API Reference. What Is A List Objects Request?​ A list objects request is a call to the OpenFGA list objects endpoint that returns all the objects of a given type that a user has a specified relationship with. This can be done using the listobjects methods in the OpenFGA SDKs (JavaScript SDK/Go SDK/.NET SDK), by manually calling the list objects endpoint using curl, or in your code. The list objects endpoint responds with a list of objects for a given type that the user has the specified relationship with. For example, the following will return all the objects with document type for which anne of type user has a viewer relation with: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); const response = await fgaClient.listObjects({ user: \"user:anne\", relation: \"viewer\", type: \"document\", }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }); // response.objects = [\"document:otherdoc\", \"document:planning\"] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientListObjectsOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientListObjectsRequest{ User: \"user:anne\", Relation: \"viewer\", Type: \"document\", } data, err := fgaClient.ListObjects(context.Background()). Body(requestBody). Options(options). Execute() // data = { \"objects\": [\"document:otherdoc\", \"document:planning\"] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientListObjectsRequest { User = \"user:anne\", Relation = \"viewer\", Type = \"document\", }; var response = await fgaClient.ListObjects(body, options); // response.Objects = [\"document:otherdoc\", \"document:planning\"] Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientListObjectsRequest( user=\"user:anne\", relation=\"viewer\", type=\"document\", ) response = await fga_client.list_objects(body, options) # response.objects = [\"document:otherdoc\", \"document:planning\"] Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query list-objects --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne viewer document # Response: {\"objects\": [\"document:otherdoc\", \"document:planning\"]} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/list-objects \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{ \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"type\": \"document\", \"relation\": \"viewer\", \"user\":\"user:anne\" }' # Response: {\"objects\": [\"document:otherdoc\", \"document:planning\"]} listObjects( \"user:anne\", // list the objects that the user `user:anne` \"viewer\", // has an `viewer` relation \"document\", // and that are of type `document` authorization_model_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", // for this particular authorization model id ); Reply: [\"document:otherdoc\", \"document:planning\"] For more information, please see the Relationship Queries page and the official Check API Reference. What Are Contextual Tuples?​ Contextual tuples are tuples that can be added to a check request, and only exist within the context of that particular request. Similar to relationship tuples, contextual tuples are composed of a user, relation and object. Unlike relationship tuples, they are not written to the store. However, if contextual tuples are sent alongside a check request, in the context of this particular check request, they are treated if they had been written in the store. For more information, please see Contextual and Time-Based Authorization, Authorization Through Organization Context and Check API Request Documentation. What Is Type Bound Public Access?​ In OpenFGA, type bound public access (represented by :*) is a special OpenFGA syntax meaning every object of that type when used as a user within a relationship tuple. For example, user:* represents every object of type user (including those not currently present in the system). For example, in a case where you would like to indicate a certain document document:new-roadmap is publicly writable (i.e. has everyone of type user as an editor), you can add the following relationship tuple: [ { \"user\": \"user:*\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] Note that you cannot use :* in the relation or object properties. In addition, you cannot use :* as part of a userset in the tuple's user field. For more information, please see Modeling Public Access and Advanced Modeling: Modeling Google Drive.","s":"Concepts","u":"/docs/concepts","h":"","p":44},{"i":47,"t":"A type is a string. It should define a class of objects with similar characteristics.","s":"What Is A Type?","u":"/docs/concepts","h":"#what-is-a-type","p":44},{"i":49,"t":"A type definition is a configuration that defines all possible relations a user or another object can have in relation to this type.","s":"What Is A Type Definition?","u":"/docs/concepts","h":"#what-is-a-type-definition","p":44},{"i":51,"t":"An authorization model is a combination of one or more type definitions. This is used to define the permission model of a system.","s":"What Is An Authorization Model?","u":"/docs/concepts","h":"#what-is-an-authorization-model","p":44},{"i":53,"t":"A \"store\" is a OpenFGA entity used for organizing data needed to answer authorization checks.","s":"What Is A Store?","u":"/docs/concepts","h":"#what-is-a-store","p":44},{"i":55,"t":"An object represents an entity in the system. We can define how various users have a relationship to it through relationship tuples and the authorization model.","s":"What Is An Object?","u":"/docs/concepts","h":"#what-is-an-object","p":44},{"i":57,"t":"A user is an entity in the system that can be related to an object.","s":"What Is A User?","u":"/docs/concepts","h":"#what-is-a-user","p":44},{"i":59,"t":"A relation is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system.","s":"What Is A Relation?","u":"/docs/concepts","h":"#what-is-a-relation","p":44},{"i":61,"t":"A relation definition lists the conditions or requirements under which this relationship would be possible.","s":"What Is A Relation Definition?","u":"/docs/concepts","h":"#what-is-a-relation-definition","p":44},{"i":63,"t":"A directly related user type is an array specified in the type definition to indicate what types of users can be directly related to that relation.","s":"What Is A Directly Related User Type?","u":"/docs/concepts","h":"#what-is-a-directly-related-user-type","p":44},{"i":65,"t":"A relationship tuple is a tuple consisting of a user, relation and object stored in OpenFGA.","s":"What Is A Relationship Tuple?","u":"/docs/concepts","h":"#what-is-a-relationship-tuple","p":44},{"i":67,"t":"A relationship is the realization of a relation between a user and an object.","s":"What Is A Relationship?","u":"/docs/concepts","h":"#what-is-a-relationship","p":44},{"i":69,"t":"A direct relationship R between user X and object Y means the relationship tuple (user=X, relation=R, object=Y) exists, and the OpenFGA authorization model for that relation allows this direct relationship (by use of direct relationship type restrictions). An implied (or computed) relationship R exists between user X and object Y if user X is related to an object Z that is in a direct or implied relationship with object Y, and the OpenFGA authorization model allows it.","s":"What Are Direct And Implied Relationships?","u":"/docs/concepts","h":"#what-are-direct-and-implied-relationships","p":44},{"i":71,"t":"A check request is a call to the OpenFGA check endpoint that returns whether the user has a certain relationship with an object.","s":"What Is A Check Request?","u":"/docs/concepts","h":"#what-is-a-check-request","p":44},{"i":73,"t":"A list objects request is a call to the OpenFGA list objects endpoint that returns all the objects of a given type that a user has a specified relationship with.","s":"What Is A List Objects Request?","u":"/docs/concepts","h":"#what-is-a-list-objects-request","p":44},{"i":75,"t":"Contextual tuples are tuples that can be added to a check request, and only exist within the context of that particular request.","s":"What Are Contextual Tuples?","u":"/docs/concepts","h":"#what-are-contextual-tuples","p":44},{"i":77,"t":"In OpenFGA, type bound public access (represented by :*) is a special OpenFGA syntax meaning every object of that type when used as a user within a relationship tuple. For example, user:* represents every object of type user (including those not currently present in the system).","s":"What Is Type Bound Public Access?","u":"/docs/concepts","h":"#what-is-type-bound-public-access","p":44},{"i":79,"t":"Check the following sections for more on how object-to-object relationships can be used. OpenFGA Concepts Learn about the OpenFGA Concepts More Direct access Get started with modeling your permission system in OpenFGA More","s":"Related Sections","u":"/docs/concepts","h":"#related-sections","p":44},{"i":81,"t":"The OpenFGA's Configuration Language is used to build a representation of a system's authorization model. It informs OpenFGA's API on what the object types in the system are and how they could relate to one another. It describes the relations possible on an object of a certain type and lists the conditions under which one is related to that object. The DSL and the JSON syntax are two presentations of that configuration language. The JSON syntax is accepted by the API and closely matches the API described in the Zanzibar paper. The DSL is syntactic sugar on top of the JSON syntax and compiles down to it before being sent to OpenFGA's API. The DSL is meant to make modeling easier and more intuitive. You'll encounter the JSON syntax when calling the API directly or through the SDKs, and the DSL when interacting with OpenFGA through the Playground. Throughout the documentation you can switch between the two presentations. To understand this guide better, you should be familiar with some OpenFGA Concepts and How to get started on modeling.","s":"Configuration Language","u":"/docs/configuration-language","h":"","p":80},{"i":83,"t":"Below is a sample authorization model. In the next sections we'll go over the building blocks that make the OpenFGA configuration language. DSL JSON model schema 1.1 type user type domain relations define member: [user] type folder relations define can_share: writer define owner: [user, domain#member] or owner from parent_folder define parent_folder: [folder] define viewer: [user, domain#member] or writer or viewer from parent_folder define writer: [user, domain#member] or owner or writer from parent_folder type document relations define can_share: writer define owner: [user, domain#member] or owner from parent_folder define parent_folder: [folder] define viewer: [user, domain#member] or writer or viewer from parent_folder define writer: [user, domain#member] or owner or writer from parent_folder { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"folder\", \"relations\": { \"can_share\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, \"owner\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"owner\" } } } ] } }, \"parent_folder\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"owner\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"parent_folder\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"can_share\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, \"owner\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"owner\" } } } ] } }, \"parent_folder\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"owner\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"parent_folder\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } } ] } info The authorization model describes four types of objects: user, domain, folder and document. The domain type definition has a single relation called member that only allows direct relationships. The folder and document type definitions each have five relations: parent_folder, owner, writer, viewer and can_share.","s":"What Does The Configuration Language Look Like?","u":"/docs/configuration-language","h":"#what-does-the-configuration-language-look-like","p":80},{"i":85,"t":"[, ...], when used at the beginning of a relation definition allows direct relationships from the objects of these specified types. The strings can be of three formats: : indicating that tuples relating objects of those types as users can be written (e.g. group:marketing can be related if group is in the type restrictions) : indicating that a tuple relating all objects of that type can be written (e.g. user:* can be added if user:* is in the type restrictions) #: indicating that tuples with sets of users that are related to an object of that type by that particular relation (e.g. group:marketing#member can be added if group#member is in the type restrictions) If the direct relationship type restrictions are missing, then no tuple can be written relating other objects as this particular relation with objects of this type (direct relationships are disallowed). info [, , ...] in the OpenFGA DSL translates to this in the OpenFGA API syntax. For example, let's take a closer look at the team type. DSL JSON type team relations define member: [user, user:*, team#member] { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user:*\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } } This team type definition defines all the relations that users can have with an object of type team. In this case the relation is: member. Due to the direct relationship type restrictions ([user, team#member]) being used, a user in the system can have a direct relationship with the team type as a member for objects of type user the user type bound public access (user:*) usersets that have a team type and a member relation (e.g. team:product#member) In the type definition snippet above, anne is a member of team:product if any one of the following relationship tuple sets exist: [ // Anne is directly related to the product team as a member { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"team:product\", }, ] [ // Everyone (`*`) is directly related to the product team as a member { \"user\": \"user:*\", \"relation\": \"member\", \"object\": \"team:product\", }, ] [ // Members of the contoso team are members of the product team { \"user\": \"team:contoso#member\", \"relation\": \"member\", \"object\": \"team:product\", }, // Anne is a member of the contoso team { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"team:contoso\", }, ] For more examples, take look at Modeling Building Blocks: Direct Relationships.","s":"The Direct Relationship Type Restrictions","u":"/docs/configuration-language","h":"#the-direct-relationship-type-restrictions","p":80},{"i":87,"t":"You can also reference other relations on the same object. Let us look at a simplified document type definition. DSL JSON type document relations define editor: [user] define viewer: [user] or editor define can_rename: editor { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"can_rename\": { \"computedUserset\": { \"relation\": \"editor\" } } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } The above document type definition defines all the relations that users can have with an object of type document. In this case the relations are: editor, viewer and can_rename. The viewer and can_rename relation definitions are both referencing editor, which is another relation on the same type. info Notice how can_rename does not reference the direct relationship type restrictions, indicating that a direct relationship is not possible (as in a user cannot be directly assigned this relation, it has to be inherited through an assignment of the editor relation). The viewer relation on the other hand allows both direct and indirect relationships using the Union Operator. In the type definition snippet above, anne is a viewer of document:new-roadmap if any one of the following relationship tuple sets exists: anne is an editor of document:new-roadmap [ // Anne is an editor of the new-roadmap document { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] anne is a viewer of document:new-roadmap [ // Anne is a viewer of the new-roadmap document { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, ] anne has a can_rename relationship with document:new-roadmap only if anne has an editor relationship with the document: anne is an editor of document:new-roadmap [ // Anne is an editor of thew new-roadmap document { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] For more examples, take a look at Modeling Building Blocks: Concentric Relationships, Modeling: Roles and Permissions and Advanced Modeling: Google Drive.","s":"Referencing Other Relations On The Same Object","u":"/docs/configuration-language","h":"#referencing-other-relations-on-the-same-object","p":80},{"i":89,"t":"Another form of indirect relationships is made possible by referencing relations on other objects. The syntax is X from Y. It requires that: the other object is related to the current object as Y the user is related to another object as X Take a look at the authorization model below. DSL JSON model schema 1.1 type user type folder relations define viewer: [user, folder#viewer] type document relations define parent_folder: [folder] define viewer: [user] or viewer from parent_folder { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"folder\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"folder\", \"relation\": \"viewer\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"parent_folder\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"parent_folder\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The snippet below taken from the authorization model above is stating that viewers of a document are all users directly assigned the viewer relation and all users who can view the document's parent folder. DSL JSON type document relations define viewer: [user] or viewer from parent_folder { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent_folder\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In the authorization model above, user:anne is a viewer of document:new-roadmap if any one of the following relationship tuple sets exists: Anne is a viewer of the parent folder of the new-roadmap document [ // planning folder is the parent folder of the new-roadmap document { \"user\": \"folder:planning\", \"relation\": \"parent_folder\", \"object\": \"document:new-roadmap\", }, // anne is a viewer of the planning folder { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"folder:planning\", }, ] Anne is a viewer of the new-roadmap document (direct relationship) [ // anne is a viewer of the new-roadmap document { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, ] This particular use of referencing relations on related objects is defining a transitive implied relationship. If user A is related to a certain object B as a viewer, and object B is related to object C as parent, then user A is related to object C as viewer. This can be used to indicate that viewers of a folders are viewers of all documents in that folder. caution Note that OpenFGA does not allow the referenced relation (the word after from, also called the tupleset) to be referencing another relation or allow non-concrete types (type bound public access (:*) or usersets (#)) in its type restrictions and will throw a validation error when attempting to call WriteAuthorizationModel. Note: In the deprecated 1.0 schema version, the validation error will be thrown at the time of evaluation (Check, etc..). For more examples, take look at Modeling: Parent-Child Objects, Advanced Modeling: Google Drive, Advanced Modeling: GitHub, and Advanced Modeling: Entitlements.","s":"Referencing Relations On Related Objects","u":"/docs/configuration-language","h":"#referencing-relations-on-related-objects","p":80},{"i":91,"t":"The union operator (or in the DSL, union in the JSON syntax) is used to indicate that a relationship exists if the user is in any of the sets of users (union). DSL JSON type document relations define viewer: [user] or editor { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In the type definition snippet above, user:anne is a viewer of document:new-roadmap if any of the following conditions are satisfied: there exists a direct relationship with anne as editor of document:new-roadmap [ { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] anne is a viewer of document:new-roadmap [ { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, ] info The above authorization model indicates that a user is related as a viewer if they are in any of: the userset of all users related to the object as \"viewer\"; indicating that a user can be assigned a direct viewer relation the userset of all users related to the object as \"editor\"; indicating that a user who is an editor is also implicitly a viewer So if anne is in at least one of those usersets (is either an editor or a viewer), the check on {\"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\"} will return {\"allowed\": true}. For more examples, take a look at Modeling Building Blocks: Concentric Relationships, Modeling Roles and Permissions and Advanced Modeling: Modeling for IoT.","s":"The Union Operator","u":"/docs/configuration-language","h":"#the-union-operator","p":80},{"i":93,"t":"The intersection operator (and in the DSL, intersection in the JSON syntax) is used to indicate that a relationship exists if the user is in all the sets of users (intersection) DSL JSON type document relations define viewer: authorized_user and editor { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"relation\": \"authorized_user\" } }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In the type definition snippet above, user:anne is a viewer of document:new-roadmap if all of the following conditions are satisfied: anne is an editor of document:new-roadmap [ { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\", }, ] AND anne is an authorized_user of document:new-roadmap: [ { \"user\": \"user:anne\", \"relation\": \"authorized_user\", \"object\": \"document:new-roadmap\", }, ] info The above authorization model indicates that a user is related as a viewer if they are in all of: the userset of all users related to the object as \"authorized_user\" the userset of all users related to the object as \"editor\" So anne has to be in the intersection of the usersets (anne has to be both an editor AND an authorized_user), in order for the check on {\"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\"} to return {\"allowed\": true}. anne is not a viewer for document:new-roadmap if either of the following is true: anne is not an editor to document:new-roadmap: no relationship tuple of {\"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:new-roadmap\"} anne is not an authorized_user on the document:new-roadmap: no relationship tuple of {\"user\": \"user:anne\", \"relation\": \"authorized_user\", \"object\": \"document:new-roadmap\"} For more examples, take look at Modeling with Multiple Restrictions.","s":"The Intersection Operator","u":"/docs/configuration-language","h":"#the-intersection-operator","p":80},{"i":95,"t":"The exclusion operator (but not in the DSL, difference in the JSON syntax) is used to indicate that a relationship exists if the user is in the base userset, but not in the excluded userset. This is helpful in modeling exclusion or block lists. DSL JSON type document relations define viewer: [user] but not blocked { \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"viewer\": { \"difference\": { \"base\": { \"this\": {} }, \"subtract\": { \"computedUserset\": { \"relation\": \"blocked\" } } } } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In the type definition snippet above, user:anne is a viewer of document:new-roadmap if: anne is assigned a direct relationship as viewer to document:new-roadmap [ { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\", }, ] AND anne is not blocked to document:new-roadmap. That is, the following relation tuple does not exists [ { \"user\": \"user:anne\", \"relation\": \"blocked\", \"object\": \"document:new-roadmap\", }, ] For more information, see Modeling: Blocklists. info The above authorization model indicates that a user is related as a viewer if they are in: the userset of all users related to the object as \"viewer\" but not in: the userset of all users related to the object as \"blocked\" So anne has to be both a viewer AND NOT blocked, in order for the check on {\"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\"} to return {\"allowed\": true}. anne is not a viewer for document:new-roadmap if either of the following is true: anne is not assigned direct relationship as viewer to document:new-roadmap: no relationship tuple of {\"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:new-roadmap\"} anne is blocked on the document:new-roadmap {\"user\": \"user:anne\", \"relation\": \"blocked\", \"object\": \"document:new-roadmap\"}","s":"The Exclusion Operator","u":"/docs/configuration-language","h":"#the-exclusion-operator","p":80},{"i":97,"t":"The JSON syntax accepted by the OpenFGA API closely mirrors the syntax represented in the Zanzibar paper, with a bit of flattening and converting keys from snake_case to camelCase. Zanzibar OpenFGA JSON OpenFGA DSL this this [,] union union or intersection intersection and exclusion difference but not tuple_to_userset tupleToUserset x from y In the Zanzibar paper, there's this example: name: \"doc\" relation { name: \"owner\" } relation { name: \"editor\" userset_rewrite { union { child { _this {} } child { computed_userset { relation: \"owner\" } } }}} relation { name: \"viewer\" userset_rewrite { union { child { _this {} } child { computed_userset { relation: \"editor\" } } child { tuple_to_userset { tupleset { relation: \"parent\" } computed_userset { object: $TUPLE_USERSET_OBJECT # parent folder relation: \"viewer\" }}} }}} In the OpenFGA DSL, it would become: model schema 1.1 type doc relations define owner: [user] define editor: [user] or owner define viewer: [user] or editor or viewer from parent And in the OpenFGA JSON, it would become: { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"doc\", \"relations\": { \"owner\": { \"this\": {} }, \"editor\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"owner\" } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"parent\" }, \"computedUserset\": { \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } We believe this syntax is easier to read/write. So the following: DSL JSON model schema 1.1 type doc relations define viewer: [user] or editor or viewer from parent { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"doc\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"parent\" }, \"computedUserset\": { \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Can be read as: The users with a viewer relationship to a certain doc are any of: the set of users who are directly related with this doc as viewer the set of users who are related to this doc as editor the set of users who are related to any object OBJ_1 as viewer, where object OBJ_1 is any object related to this doc as parent (e.g. viewers of this doc's parent folder, where the parent folder is OBJ_1) Learn more about Zanzibar at the Zanzibar Academy.","s":"Equivalent Zanzibar Concepts","u":"/docs/configuration-language","h":"#equivalent-zanzibar-concepts","p":80},{"i":99,"t":"Check the following sections for more on how to use the configuration language in modeling authorization. OpenFGA Concepts Learn about the OpenFGA Concepts. More Modeling: Getting Started Learn about how to get started with modeling your permission system in OpenFGA. More Direct Access Learn about modeling user access to an object. More","s":"Related Sections","u":"/docs/configuration-language","h":"#related-sections","p":80},{"i":101,"t":"Authorization Models in OpenFGA are immutable, they are created once and then can no longer be deleted or modified. Each time you write an authorization model, a new version is created.","s":"Immutable Authorization Models","u":"/docs/getting-started/immutable-models","h":"","p":100},{"i":103,"t":"You can list all the authorization models for a store using the ReadAuthorizationModels API. This endpoint returns the results sorted in reverse chronological order, as in the first model in the list is the latest model. By default, only the last 50 models are returned, but you can paginate across by passing in the appropriate continuation_token.","s":"Viewing All the Authorization Models","u":"/docs/getting-started/immutable-models","h":"#viewing-all-the-authorization-models","p":100},{"i":105,"t":"Some endpoints relating to tuples (Check, ListObjects, Expand, Write) accept an authorization_model_id, which we strongly recommend passing, especially in production. In practice, you would pin the authorization model ID alongside the store ID in your configuration management system. Your services would read this value and use it in their requests to FGA. This helps you ensure that your services are using the same consistent ID across all your applications, and that rollouts can be seemless.","s":"How to Target a Particular Model","u":"/docs/getting-started/immutable-models","h":"#how-to-target-a-particular-model","p":100},{"i":107,"t":"Targeting a specific model ID would ensure that you don't accidentally break your authorization checks in production because a mistake was made when updating the authorization model. It would also slightly improve the latency on your check requests. If that field is passed, evaluation and validation will happen for that particular authorization model ID. If this field is not passed, OpenFGA will use the last created Authorization Model for that store.","s":"Benefits of Passing in an Authorization Model ID","u":"/docs/getting-started/immutable-models","h":"#benefits-of-passing-in-an-authorization-model-id","p":100},{"i":109,"t":"Being able to target multiple versions of the authorization model enables you to progressively roll out model changes, which is something you should consider doing if the changes are significant. You could: Do shadow checks where you would perform checks against both your existing model and the new upcoming model you are hoping to replace it with.This will help you detect and resolve any accidental discrepancies you may be introducing, and ensure that your new model is at least as good as your old one. When you are confident with your model, you could implement gradual rollouts that would allow you to monitor and check if any users are having access issues before you go ahead and increase the rollout to 100% of your user base. Getting an Authorization Model's Creation Date The Authorization Model ID is a ULID which includes the date created. You can extract the creation date using a library for your particular language. For example, in JavaScript you can do the following: import ulid = require('ulid'); const time = ulid.decodeTime(id);","s":"Potential Use-cases","u":"/docs/getting-started/immutable-models","h":"#potential-use-cases","p":100},{"i":111,"t":"Learn more about modeling and production usage in OpenFGA. Configuration Language Learn about the OpenFGA Configuration Language. More Getting Started with Modeling Read how to get started with modeling. More Data and API Best Practices Learn the best practices for managing data and invoking APIs in production environment More","s":"Related Sections","u":"/docs/getting-started/immutable-models","h":"#related-sections","p":100},{"i":113,"t":"To get started, install the OpenFGA SDK packages. Node.js Go .NET Python CLI You can find the Node.js package on npm at: @openfga/sdk. Using npm: npm install @openfga/sdk Using yarn: yarn add @openfga/sdk You can find the Go package on GitHub at: @openfga/go-sdk. To install: go get -u github.com/openfga/go-sdk In your code, import the module and use it: import ( openfga \"github.com/openfga/go-sdk\" ) func main() { configuration, err := openfga.NewConfiguration(openfga.Configuration{ ApiScheme: os.Getenv(\"FGA_API_SCHEME\"), // optional, defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.openfga.example instead of https://api.openfga.example) }) if err != nil { // .. Handle error } } You can then run go mod tidy to update go.mod and go.sum if you are using them. The OpenFGA .NET SDK is available on NuGet. You can install it using: The dotnet CLI: dotnet add package OpenFGA.Sdk The Package Manager Console inside Visual Studio: Install-Package OpenFGA.Sdk Visual Studio, Visual Studio for Mac and IntelliJ Rider: Search for and install OpenFGA.Sdk in each of their respective package manager UIs. The OpenFGA Python SDK is available on PyPI. To install: pip3 install openfga_sdk In your code, import the module and use it: import openfga_sdk The OpenFGA CLI is available on GitHub. To install: Brew​ brew install openfga/tap/fga Linux (deb, rpm and apk) packages​ Download the .deb, .rpm or .apk packages from the releases page. Debian: sudo apt install ./fga__linux_.deb Fedora: sudo dnf install ./fga__linux_.rpm Alpine Linux: sudo apk add --allow-untrusted ./fga__linux_.apk Docker​ docker pull openfga/cli; docker run -it openfga/cli Go​ note that the command will be named cli go install github.com/openfga/cli@latest Manually​ Download the pre-compiled binaries from the releases page.","s":"Install SDK Client","u":"/docs/getting-started/install-sdk","h":"","p":112},{"i":115,"t":"brew install openfga/tap/fga","s":"Brew","u":"/docs/getting-started/install-sdk","h":"#brew","p":112},{"i":117,"t":"Download the .deb, .rpm or .apk packages from the releases page. Debian: sudo apt install ./fga__linux_.deb Fedora: sudo dnf install ./fga__linux_.rpm Alpine Linux: sudo apk add --allow-untrusted ./fga__linux_.apk","s":"Linux (deb, rpm and apk) packages","u":"/docs/getting-started/install-sdk","h":"#linux-deb-rpm-and-apk-packages","p":112},{"i":119,"t":"docker pull openfga/cli; docker run -it openfga/cli","s":"Docker","u":"/docs/getting-started/install-sdk","h":"#docker","p":112},{"i":121,"t":"note that the command will be named cli go install github.com/openfga/cli@latest","s":"Go","u":"/docs/getting-started/install-sdk","h":"#go","p":112},{"i":123,"t":"Download the pre-compiled binaries from the releases page.","s":"Manually","u":"/docs/getting-started/install-sdk","h":"#manually","p":112},{"i":125,"t":"Get OpenFGA's SDKs to add authorization to your API. OpenFGA Node.js SDK Install our Node.js & JavaScript SDK to get started. More OpenFGA Go SDK Use our Go SDK to easily connect your Go application to the OpenFGA API More OpenFGA .NET SDK Connect your .NET service with OpenFGA using our .NET SDK More OpenFGA Python SDK Connect your Python service with OpenFGA using our Python SDK More","s":"Related Sections","u":"/docs/getting-started/install-sdk","h":"#related-sections","p":112},{"i":127,"t":"This section will illustrate how to perform a check request to determine whether a user has a certain relationship with an object.","s":"Perform a Check","u":"/docs/getting-started/perform-check","h":"","p":126},{"i":129,"t":"Node.js Go .NET Python CLI curl Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_SERVER_URL as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables.","s":"Before You Start","u":"/docs/getting-started/perform-check","h":"#before-you-start","p":126},{"i":131,"t":"Assume that you want to check whether user anne has relationship reader with object document:Z","s":"Step By Step","u":"/docs/getting-started/perform-check","h":"#step-by-step","p":126},{"i":133,"t":"Before calling the check API, you will need to configure the API client. Node.js Go .NET Python CLI curl // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) To obtain the access token: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)","s":"01. Configure the OpenFGA API Client","u":"/docs/getting-started/perform-check","h":"#01-configure-the--api-client","p":126},{"i":135,"t":"To check whether user user:anne has relationship reader with object document:Z Node.js Go .NET Python CLI curl // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'document:Z', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"document:Z\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"document:Z\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"document:Z\", ) response = await fga_client.check(body, options) # response.allowed = true fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:Z # Response: {\"allowed\":true} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:Z\"}}' # Response: {\"allowed\":true} The result's allowed field will return true if the relationship exists and false if the relationship does not exist.","s":"02. Calling Check API","u":"/docs/getting-started/perform-check","h":"#02-calling-check-api","p":126},{"i":137,"t":"Take a look at the following section for more on how to perform authorization checks in your system OpenFGA Check API Read the Check API documentation and see how it works. More","s":"Related Sections","u":"/docs/getting-started/perform-check","h":"#related-sections","p":126},{"i":139,"t":"This section will illustrate how to perform a list objects request to determine all the objects of a given type a user has a specified relationship with.","s":"Perform a List Objects call","u":"/docs/getting-started/perform-list-objects","h":"","p":138},{"i":141,"t":"Node.js Go .NET Python CLI curl Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_SERVER_URL as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model and updated the relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables.","s":"Before You Start","u":"/docs/getting-started/perform-list-objects","h":"#before-you-start","p":138},{"i":143,"t":"Assume that you want to list all objects of type document that user anne has reader relationship with:","s":"Step By Step","u":"/docs/getting-started/perform-list-objects","h":"#step-by-step","p":138},{"i":145,"t":"Before calling the check API, you will need to configure the API client. Node.js Go .NET Python CLI curl // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) To obtain the access token: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)","s":"01. Configure the OpenFGA API Client","u":"/docs/getting-started/perform-list-objects","h":"#01-configure-the--api-client","p":138},{"i":147,"t":"To return all documents that user user:anne has relationship reader with: Node.js Go .NET Python CLI curl const response = await fgaClient.listObjects({ user: \"user:anne\", relation: \"reader\", type: \"document\", }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }); // response.objects = [\"document:otherdoc\", \"document:planning\"] options := ClientListObjectsOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientListObjectsRequest{ User: \"user:anne\", Relation: \"reader\", Type: \"document\", } data, err := fgaClient.ListObjects(context.Background()). Body(requestBody). Options(options). Execute() // data = { \"objects\": [\"document:otherdoc\", \"document:planning\"] } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientListObjectsRequest { User = \"user:anne\", Relation = \"reader\", Type = \"document\", }; var response = await fgaClient.ListObjects(body, options); // response.Objects = [\"document:otherdoc\", \"document:planning\"] options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientListObjectsRequest( user=\"user:anne\", relation=\"reader\", type=\"document\", ) response = await fga_client.list_objects(body, options) # response.objects = [\"document:otherdoc\", \"document:planning\"] fga query list-objects --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document # Response: {\"objects\": [\"document:otherdoc\", \"document:planning\"]} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/list-objects \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{ \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"type\": \"document\", \"relation\": \"reader\", \"user\":\"user:anne\" }' # Response: {\"objects\": [\"document:otherdoc\", \"document:planning\"]} The result document:otherdoc and document:planning are the document objects that user:anne has reader relationship with.","s":"02. Calling List Objects API","u":"/docs/getting-started/perform-list-objects","h":"#02-calling-list-objects-api","p":138},{"i":149,"t":"Take a look at the following section for more on how to perform authorization checks in your system OpenFGA List Objects API Read the List Objects API documentation and see how it works. More","s":"Related Sections","u":"/docs/getting-started/perform-list-objects","h":"#related-sections","p":138},{"i":151,"t":"The following list outlines some guidelines and best practices for running OpenFGA in a production environment: Configure Authentication Enable HTTP TLS or gRPC TLS or both Set the log.format to \"json\" Set the log.level to \"info\" Disable the Playground. Set Concurrency Limits","s":"Running OpenFGA in Production","u":"/docs/getting-started/running-in-production","h":"","p":150},{"i":153,"t":"To ensure good performance for OpenFGA, it is recommended that the database be: Used exclusively for OpenFGA and not shared with other applications. This allows scaling the database independently and avoiding contention with your database. Bootstrapped and managed with the openfga migrate command. This will ensure the appropriate database indexes are created. It's strongly recommended to fine-tune your server database connection settings to avoid having to re-establish database connections frequently. Establishing database connections is slow and will negatively impact performance, and so here are some guidelines for managing database connection settings: The server setting OPENFGA_DATASTORE_MAX_OPEN_CONNS should be set to be equal to your database's max connections. For example, in Postgres, you can see this value via running the SQL query SHOW max_connections;. If you are running multiple instances of the OpenFGA server, you should divide this setting equally among the instances. For example, if your database's max_connections is 100, and you have 2 OpenFGA instances, OPENFGA_DATASTORE_MAX_OPEN_CONNS should be set to 50 for each instance. The OPENFGA_DATASTORE_MAX_IDLE_CONNS should be set to a value no greater than the maximum open connections (see the bullet point above), but it should be set sufficiently high enough to avoid having to recreate connections on each request. If, when monitoring your database stats, you see a lot of database connections being closed and subsequently reopened, then you should consider increasing the maximum number of idle connections. If idle connections are getting reaped frequently, then consider increasing the OPENFGA_DATASTORE_CONN_MAX_IDLE_TIME to a large value. When in doubt, prioritize keeping connections around for longer rather than shorter, because doing so will drastically improve performance.","s":"Database Recommendations","u":"/docs/getting-started/running-in-production","h":"#database-recommendations","p":150},{"i":155,"t":"note Before modifying concurrency limits please make sure you've followed the guidance for Database Recommendations OpenFGA queries such as Check and ListObjects can be quite database and CPU intensive in some cases. If you notice that a single request is consuming a lot of CPU or creating a high degree of database contention, then you may consider setting some concurrency limits to protect other requests from being negatively impacted by overly aggressive queries. The following table enumerates the server's concurrency specific settings: flag env config --max-concurrent-reads-for-list-objects OPENFGA_MAX_CONCURRENT_READS_FOR_LIST_OBJECTS maxConcurrentReadsForListObjects --max-concurrent-reads-for-check OPENFGA_MAX_CONCURRENT_READS_FOR_CHECK maxConcurrentReadsForCheck --resolve-node-limit OPENFGA_RESOLVE_NODE_LIMIT resolveNodeLimit --resolve-node-breadth-limit OPENFGA_RESOLVE_NODE_BREADTH_LIMIT resolveNodeBreadthLimit Determining the right values for these settings will be based on a variety of factors including, but not limited to, the database specific deployment topology, the FGA model(s) involved, and the relationship tuples in the system. However, here are some high-level guidelines: If a single ListObjects query is negatively impacting other query endpoints by increasing their latency or their error rate, then consider setting a lower value for OPENFGA_MAX_CONCURRENT_READS_FOR_LIST_OBJECTS. If a single Check query is negatively impacting other query endpoints by increasing their latency or their error rate, then consider setting a lower value for OPENFGA_MAX_CONCURRENT_READS_FOR_CHECK. If you still see high request latencies despite the guidance above, then you may additionally consider setting stricter limits on the query resolution behavior by limiting the resolution depth and resolution breadth. These can be controlled with the OPENFGA_RESOLVE_NODE_LIMIT and OPENFGA_RESOLVE_NODE_BREADTH_LIMIT settings, respectively. Consider these guidelines: OPENFGA_RESOLVE_NODE_LIMIT limits the resolution depth of a single query, and thus it sets an upper bound on how deep a relationship hierarchy may be. A high value will allow a single query to involve more hierarchical resolution and therefore more database queries, while a low value will reduce the number of hierarchical resolutions that will be allowed and thus reduce the number of database queries. OPENFGA_RESOLVE_NODE_BREADTH_LIMIT limits the resolution breadth. It sets an upper bound on the number of in-flight resolutions that can be taking place on one or more usersets. A high value will allow a single query to involve more concurrent evaluations to take place and therefore more database queries and server processes, while a low value will reduce the overall number of concurrent resolutions that will be allowed and thus reduce the number of database queries and server processes.","s":"Concurrency Limits","u":"/docs/getting-started/running-in-production","h":"#concurrency-limits","p":150},{"i":157,"t":"Check the following sections for more on how to run OpenFGA in production environment. Data and API Best Practices Learn the best practices for managing data and invoking APIs in production environment More Migrating Relations Learn how to migrate relations in a production environment More Migrating Schema 1.1 Learn how to migrate to model schema 1.1 More","s":"Related Sections","u":"/docs/getting-started/running-in-production","h":"#related-sections","p":150},{"i":159,"t":"To deploy OpenFGA into a Kubernetes environment you can use the official OpenFGA Helm chart. Please refer to the official documentation on Artifact Hub for the Helm chart for more instructions.","s":"☸️ Setup OpenFGA with Kubernetes","u":"/docs/getting-started/setup-openfga/kubernetes","h":"","p":158},{"i":161,"t":"Follow the guides below to setup an OpenFGA server. Docker Setup Guide How to setup an OpenFGA server with Docker. Click to navigate Kubernetes Setup Guide How to setup an OpenFGA server with Kubernetes. Click to navigate","s":"Setup OpenFGA","u":"/docs/getting-started/setup-openfga/overview","h":"","p":160},{"i":163,"t":"This section will illustrate how to integrate OpenFGA within a framework, such as Fastify or Fiber.","s":"Integrate Within a Framework","u":"/docs/getting-started/framework","h":"","p":162},{"i":165,"t":"Node.js Go Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the OpenFGA SDK. You have configured the authorization model and updated the relationship tuples. You know how to perform a Check. You have loaded FGA_API_HOST and FGA_STORE_ID as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the OpenFGA SDK. You have configured the authorization model and updated the relationship tuples. You know how to perform a Check. You have loaded FGA_API_HOST and FGA_STORE_ID as environment variables.","s":"Before You Start","u":"/docs/getting-started/framework","h":"#before-you-start","p":162},{"i":167,"t":"Assume that you want to have a web service for documents using one of the frameworks mentioned above. The service will authenticate users via JWT tokens, which contain the user ID. Note The reader should set up their own login method based on their OpenID connect provider's documentation. Assume that you want to provide a route GET /read/{document} to return documents depending on whether the authenticated user has access to it.","s":"Step By Step","u":"/docs/getting-started/framework","h":"#step-by-step","p":162},{"i":169,"t":"The first step is to install the framework. Node.js Go For the context of this example, we will use the Fastify framework. For that we need to install the following packages: the fastify package that provides the framework itself the fastify-plugin package that allows integrating plugins with Fastify the fastify-jwt package for processing JWT tokens Using npm: npm install fastify fastify-plugin fastify-jwt Using yarn: yarn add fastify fastify-plugin fastify-jwt Next, we setup the web service with the GET /read/{document} route in file app.js. // Require the framework and instantiate it const fastify = require('fastify')({ logger: true }); // Declare the route fastify.get('/read/:document', async (request, reply) => { return { read: request.params.document }; }); // Run the server const start = async () => { try { await fastify.listen(3000); } catch (err) { fastify.log.error(err); process.exit(1); } }; start(); For the context of this example, we will use the Fiber framework. For that we need to install the following Go packages: the gofiber/fiber package that provides the Fiber framework itself the gofiber/jwt middleware authentication layer for JWT the golang-jwt package that provides Go support for JWT go get -u github.com/gofiber/fiber/v2 github.com/gofiber/jwt/v3 github.com/golang-jwt/jwt/v4 Next, we setup the web service with the GET /read/{document} route. package main import \"github.com/gofiber/fiber/v2\" func main() { app := fiber.New() app.Get(\"/read/:document\", read) app.Listen(\":3000\") } func read(c *fiber.Ctx) error { return c.SendString(c.Params(\"document\")) }","s":"01. Install And Setup Framework","u":"/docs/getting-started/framework","h":"#01-install-and-setup-framework","p":162},{"i":171,"t":"Before we can call OpenFGA to protect the /read/{document} route, we need to validate the user's JWT. Node.js Go The fastify-jwt package allows validation of JWT tokens, as well as providing access to the user's identity. In jwt-authenticate.js: const fp = require('fastify-plugin'); module.exports = fp(async function (fastify, opts) { fastify.register(require('fastify-jwt'), { secret: { private: readFileSync(`${path.join(__dirname, 'certs')}/private.key`, 'utf8'), public: readFileSync(`${path.join(__dirname, 'certs')}/public.key`, 'utf8'), }, sign: { algorithm: 'RS256' }, }); fastify.decorate('authenticate', async function (request, reply) { try { await request.jwtVerify(); } catch (err) { reply.send(err); } }); }); Then, use the preValidation hook of a route to protect it and access the user information inside the JWT: In route-read.js: module.exports = async function (fastify, opts) { fastify.get( '/read/:document', { preValidation: [fastify.authenticate], }, async function (request, reply) { // the user's id is in request.user return { read: request.params.document }; }, ); }; Finally, update app.js to register the newly added hooks. const fastify = require('fastify')({ logger: true }); const jwtAuthenticate = require('./jwt-authenticate'); const routeread = require('./route-read'); fastify.register(jwtAuthenticate); fastify.register(routeread); // Run the server! const start = async () => { try { await fastify.listen(3000); } catch (err) { fastify.log.error(err); process.exit(1); } } start(); We will now setup middleware to authenticate the incoming JWTs. package main import ( \"crypto/rand\" \"crypto/rsa\" \"log\" \"github.com/gofiber/fiber/v2\" jwtware \"github.com/gofiber/jwt/v3\" \"github.com/golang-jwt/jwt/v4\" ) var ( // Do not do this in production. // In production, you would have the private key and public key pair generated // in advance. NEVER add a private key to any GitHub repo. privateKey *rsa.PrivateKey ) func main() { app := fiber.New() // Just as a demo, generate a new private/public key pair on each run. rng := rand.Reader var err error privateKey, err = rsa.GenerateKey(rng, 2048) if err != nil { log.Fatalf(\"rsa.GenerateKey: %v\", err) } // JWT Middleware app.Use(jwtware.New(jwtware.Config{ SigningMethod: \"RS256\", SigningKey: privateKey.Public(), })) app.Get(\"/read/:document\", read) app.Listen(\":3000\") } func read(c *fiber.Ctx) error { user := c.Locals(\"user\").(*jwt.Token) claims := user.Claims.(jwt.MapClaims) name := claims[\"name\"].(string) return c.SendString(name + \" read \" + c.Params(\"document\")) }","s":"02. Authenticate And Get User ID","u":"/docs/getting-started/framework","h":"#02-authenticate-and-get-user-id","p":162},{"i":173,"t":"Node.js Go First, we will create a decorator preauthorize to parse the incoming HTTP method as well as name of the document, and set the appropriate relation and object that we will call Check on. In preauthorize.js: const fp = require('fastify-plugin'); module.exports = fp(async function (fastify, opts) { fastify.decorate('preauthorize', async function (request, reply) { try { switch (request.method) { case 'GET': request.relation = 'reader'; break; case 'POST': request.relation = 'writer'; break; case 'DELETE': default: request.relation = 'owner'; break; } request.object = `document:${request.params.document}`; } catch (err) { reply.send(err); } }); }); Next, we will create a decorator called authorize. This decorator will invoke the Check API to see if the user has a relationship with the specified document. In authorize.js: const fp = require('fastify-plugin'); const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk'; module.exports = fp(async function (fastify, opts) { fastify.decorate('authorize', async function (request, reply) { try { // configure the openfga api client const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Optional. Can be \"http\" or \"https\". Defaults to \"https\" apiHost: process.env.FGA_API_HOST, storeId: process.env.FGA_STORE_ID, }); const { allowed } = await fgaClient.check({ user: request.user, relation: request.relation, object: request.object, }); if (!allowed) { reply.code(401).send(`Not authenticated`); } } catch (err) { reply.send(err); } }); }); We can now update the GET /read/{document} route to check for user permissions. In route-read.js: module.exports = async function (fastify, opts) { fastify.get( '/read/:document', { preValidation: [fastify.authenticate, fastify.preauthorize, fastify.authorize], }, async function (request, reply) { // the user's id is in request.user return { read: request.params.document }; }, ); }; Finally, we will register the new hooks in app.js: const fastify = require('fastify')({ logger: true }); const jwtAuthenticate = require('./jwt-authenticate'); const preauthorize = require('./preauthorize'); const authorize = require('./authorize'); const routeread = require('./route-read'); fastify.register(jwtAuthenticate); fastify.register(preauthorize); fastify.register(authorize); fastify.register(routeread); const start = async () => { try { await fastify.listen(3000); } catch (err) { fastify.log.error(err); process.exit(1); } } start(); We will create two middlewares: preauthorize will parse the user's JWT and prepare variables needed to call Check API. checkAuthorization will call the Check API to see if the user has a relationship with the specified document. package main import ( \"context\" \"crypto/rand\" \"crypto/rsa\" \"log\" \"os\" \"github.com/gofiber/fiber/v2\" jwtware \"github.com/gofiber/jwt/v3\" \"github.com/golang-jwt/jwt/v4\" openfga \"github.com/openfga/go-sdk\" . \"github.com/openfga/go-sdk/client\" ) var ( // Do not do this in production. // In production, you would have the private key and public key pair generated // in advance. NEVER add a private key to any GitHub repo. privateKey *rsa.PrivateKey ) func main() { app := fiber.New() // Just as a demo, generate a new private/public key pair on each run. rng := rand.Reader var err error privateKey, err = rsa.GenerateKey(rng, 2048) if err != nil { log.Fatalf(\"rsa.GenerateKey: %v\", err) } // JWT Middleware app.Use(jwtware.New(jwtware.Config{ SigningMethod: \"RS256\", SigningKey: privateKey.Public(), })) app.Use(\"/read/:document\", preauthorize) app.Use(checkAuthorization) app.Get(\"/read/:document\", read) app.Listen(\":3000\") } func read(c *fiber.Ctx) error { user := c.Locals(\"user\").(*jwt.Token) claims := user.Claims.(jwt.MapClaims) name := claims[\"name\"].(string) return c.SendString(name + \" read \" + c.Params(\"document\")) } func preauthorize(c *fiber.Ctx) error { // get the user name from JWT user := c.Locals(\"user\").(*jwt.Token) claims := user.Claims.(jwt.MapClaims) name := claims[\"name\"].(string) c.Locals(\"username\", name) // parse the HTTP method switch (c.Method()) { case \"GET\": c.Locals(\"relation\", \"reader\") case \"POST\": c.Locals(\"relation\", \"writer\") case \"DELETE\": c.Locals(\"relation\", \"owner\") default: c.Locals(\"relation\", \"owner\") } // get the object name and prepend with type name \"document:\" c.Locals(\"object\", \"document:\" + c.Params(\"document\")) return c.Next() } // Middleware to check whether user is authorized to access document func checkAuthorization(c *fiber.Ctx) error { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // optional, can be overridden per request }) if err != nil { return fiber.NewError(fiber.StatusServiceUnavailable, \"Unable to build OpenFGA client\") } body := ClientCheckRequest{ User: c.Locals(\"username\").(string), Relation: c.Locals(\"relation\").(string), Object: c.Locals(\"object\").(string), } data, err := fgaClient.OpenFga.Check(context.Background()).Body(body).Execute() if err != nil { return fiber.NewError(fiber.StatusServiceUnavailable, \"Unable to check for authorization\") } if !(*data.Allowed) { return fiber.NewError(fiber.StatusUnauthorized, \"Unauthorized to access document\") } // Go to the next middleware return c.Next() }","s":"03. Integrate The OpenFGA Check API Into The Service","u":"/docs/getting-started/framework","h":"#03-integrate-the--check-api-into-the-service","p":162},{"i":175,"t":"Take a look at the following sections for examples that you can try when integrating with SDK. Entitlements Modeling Entitlements for a System in OpenFGA. More IoT Modeling Fine Grained Authorization for an IoT Security Camera System with OpenFGA. More Slack Modeling Authorization for Slack with OpenFGA. More","s":"Related Sections","u":"/docs/getting-started/framework","h":"#related-sections","p":162},{"i":177,"t":"This section helps you integrate OpenFGA with your system. To do this, you will learn how to programmatically write authorization related data to OpenFGA. When to use This section is useful if you have defined an authorization model and want to understand how to write authorization data to OpenFGA to represent the state of your system.","s":"Interacting with the API","u":"/docs/interacting","h":"","p":176},{"i":179,"t":"Manage User Access Write relationship tuples to manage a user's access to an object. Click to navigate Manage Group Access Write relationship tuples to manage access to an object for all members of a group. Click to navigate Manage Group Membership Write relationship tuples to manage the users that are members of a group. Click to navigate Manage Relationships Between Object Write relationship tuples to manage how two objects are related. E.g. parent folder and child document. Click to navigate Transactional Writes Write multiple relationship tuples in a single request, so all writes either succeed or fail. Click to navigate Relationship Queries An overview of how to use the Check, Read, Expand, and ListObject APIs. Click to navigate Search with Permissions Implementing search with OpenFGA. Click to navigate","s":"Content","u":"/docs/interacting","h":"","p":176},{"i":181,"t":"This article explains how to build an OpenFGA client by using the SDKs. The first step is to ensure that you have created a store by following these steps. Next, depending on the authentication scheme you want to use, there are different ways to build the client.","s":"Setup SDK Client for Store","u":"/docs/getting-started/setup-sdk-client","h":"","p":180},{"i":183,"t":"This is a simple setup but it is not recommended for production use. Node.js Go .NET Python CLI const { OpenFgaClient } = require('@openfga/sdk'); // OR import { OpenFgaClient } from '@openfga/sdk'; const openFga = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // optional. Can be \"http\" or \"https\". Defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods authorizationModelId: process.env.FGA_MODEL_ID, // optional, can be overridden per request }); import ( \"os\" openfga \"github.com/openfga/go-sdk\" . \"github.com/openfga/go-sdk/client\" ) func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // optional, can be overridden per request }) if err != nil { // .. Handle error } } using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace ExampleApp; class MyProgram { static async Task Main() { var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } import os import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.Configuration( api_scheme = os.environ.get('FGA_API_SCHEME'), # optional. Can be \"http\" or \"https\". Defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID'), # optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods model_id = os.environ.get('FGA_MODEL_ID'), # optional, can be overridden per request ) async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() // call requests await fga_client.close() // close when done export FGA_SERVER_URL=https://api.fga.example # optional. Defaults to http://localhost:8080 export FGA_STORE_ID=YOUR_STORE_ID # required for all calls except \\`store create\\`, \\`store list\\` and \\`model validate\\` export FGA_MODEL_ID=YOUR_MODEL_ID # optional, can be overridden per request, latest is used if this is empty","s":"Using No Authentication","u":"/docs/getting-started/setup-sdk-client","h":"#using-no-authentication","p":180},{"i":185,"t":"If you want to use shared key authentication, you need to generate a random string that will work as secret and set that key when building your OpenFGA server. Then, when building the client, set it as environment variable FGA_API_TOKEN. Warning If you are going to use this setup in production, you should enable TLS in your OpenFGA server. Please see the Production Checklist. Node.js Go .NET Python CLI const { CredentialsMethod, OpenFgaClient } = require('@openfga/sdk'); // OR import { CredentialsMethod, OpenFgaClient } from '@openfga/sdk'; const openFga = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // optional. Can be \"http\" or \"https\". Defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods authorizationModelId: process.env.FGA_MODEL_ID, // optional, can be overridden per request credentials: { method: CredentialsMethod.ApiToken, config: { token: process.env.$FGA_API_TOKEN, }, } }); import ( \"os\" openfga \"github.com/openfga/go-sdk\" . \"github.com/openfga/go-sdk/client\" \"github.com/openfga/go-sdk/credentials\" ) func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // optional, can be overridden per request Credentials: &credentials.Credentials{ Method: credentials.CredentialsMethodApiToken, Config: &credentials.Config{ ApiToken: os.Getenv(\"OPENFGA_API_TOKEN\"), // will be passed as the \"Authorization: Bearer ${ApiToken}\" request header }, }, }) if err != nil { // .. Handle error } } using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace ExampleApp; class MyProgram { static async Task Main() { var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // optional, can be overridden per request Credentials = new Credentials() { Method = CredentialsMethod.ApiToken, Config = new CredentialsConfig() { ApiToken = Environment.GetEnvironmentVariable(\"FGA_API_TOKEN\") }, }, }; var fgaClient = new OpenFgaClient(configuration); } } import os import openfga_sdk from openfga_sdk.client import OpenFgaClient from openfga_sdk.credentials import Credentials, CredentialConfiguration credentials = Credentials(method='api_token', configuration=CredentialConfiguration(api_token=os.environ.get(FGA_API_TOKEN))) configuration = openfga_sdk.Configuration( api_scheme = os.environ.get('FGA_API_SCHEME'), # optional. Can be \"http\" or \"https\". Defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID'), # optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods model_id = os.environ.get('FGA_MODEL_ID'), # optional, can be overridden per request credentials = credentials, ) async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() // call requests await fga_client.close() // close when done export FGA_SERVER_URL=https://api.fga.example # optional. Defaults to http://localhost:8080 export FGA_STORE_ID=YOUR_STORE_ID # required for all calls except \\`store create\\`, \\`store list\\` and \\`model validate\\` export FGA_MODEL_ID=YOUR_MODEL_ID # optional, can be overridden per request, latest is used if this is empty export FGA_API_TOKEN=YOUR_API_TOKEN","s":"Using Shared Key Authentication","u":"/docs/getting-started/setup-sdk-client","h":"#using-shared-key-authentication","p":180},{"i":187,"t":"Note The OpenFGA server does not support the client credentials flow, however if you or your OpenFGA provider have implemented a client credentials wrapper on top, follow the instructions here to have the OpenFGA client handle the token exchange for you. Node.js Go .NET Python CLI const { CredentialsMethod, OpenFgaClient } = require('@openfga/sdk'); // OR import { CredentialsMethod, OpenFgaClient } from '@openfga/sdk'; const openFga = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // optional. Can be \"http\" or \"https\". Defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods authorizationModelId: process.env.FGA_MODEL_ID, // optional, can be overridden per request credentials: { method: CredentialsMethod.ClientCredentials, config: { apiTokenIssuer: process.env.FGA_API_TOKEN_ISSUER, apiAudience: process.env.FGA_API_AUDIENCE, clientId: process.env.FGA_CLIENT_ID, clientSecret: process.env.FGA_CLIENT_SECRET, }, } }); import ( \"os\" openfga \"github.com/openfga/go-sdk\" . \"github.com/openfga/go-sdk/client\" \"github.com/openfga/go-sdk/credentials\" ) func main() { fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // optional, can be overridden per request Credentials: &credentials.Credentials{ Method: credentials.CredentialsMethodClientCredentials, Config: &credentials.Config{ ClientCredentialsClientId: os.Getenv(\"FGA_CLIENT_ID\"), ClientCredentialsClientSecret: os.Getenv(\"FGA_CLIENT_SECRET\"), ClientCredentialsApiAudience: os.Getenv(\"FGA_API_AUDIENCE\"), ClientCredentialsApiTokenIssuer: os.Getenv(\"FGA_API_TOKEN_ISSUER\"), }, }, }) if err != nil { // .. Handle error } } using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace ExampleApp; class MyProgram { static async Task Main() { var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // optional. Can be \"http\" or \"https\". Defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // optional, can be overridden per request Credentials = new Credentials() { Method = CredentialsMethod.ClientCredentials, Config = new CredentialsConfig() { ApiTokenIssuer = Environment.GetEnvironmentVariable(\"FGA_API_TOKEN_ISSUER\"), ApiAudience = Environment.GetEnvironmentVariable(\"FGA_API_AUDIENCE\"), ClientId = Environment.GetEnvironmentVariable(\"FGA_CLIENT_ID\"), ClientSecret = Environment.GetEnvironmentVariable(\"FGA_CLIENT_SECRET\"), } } }; var fgaClient = new OpenFgaClient(configuration); } } import os import openfga_sdk from openfga_sdk.client import OpenFgaClient from openfga_sdk.credentials import Credentials, CredentialConfiguration credentials = Credentials( method='client_credentials', configuration=CredentialConfiguration( api_issuer= os.environ.get('FGA_API_TOKEN_ISSUER'), api_audience= os.environ.get('FGA_API_AUDIENCE'), client_id= os.environ.get('FGA_CLIENT_ID'), client_secret= os.environ.get('FGA_CLIENT_SECRET'), ) ) configuration = openfga_sdk.Configuration( api_scheme = os.environ.get('FGA_API_SCHEME'), # optional. Can be \"http\" or \"https\". Defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID'), # optional, not needed for \\`CreateStore\\` and \\`ListStores\\`, required before calling for all other methods model_id = os.environ.get('FGA_MODEL_ID'), # optional, can be overridden per request credentials = credentials, ) async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() // call requests await fga_client.close() // close when done export FGA_SERVER_URL=https://api.fga.example # optional. Defaults to http://localhost:8080 export FGA_STORE_ID=YOUR_STORE_ID # required for all calls except \\`store create\\`, \\`store list\\` and \\`model validate\\` export FGA_MODEL_ID=YOUR_MODEL_ID # optional, can be overridden per request, latest is used if this is empty export FGA_API_TOKEN_ISSUER=YOUR_API_TOKEN_ISSUER export FGA_API_AUDIENCE=YOUR_API_AUDIENCE export FGA_CLIENT_ID=YOUR_CLIENT_ID export FGA_CLIENT_SECRET=YOUR_CLIENT_SECRET","s":"Using Client Credentials Flow","u":"/docs/getting-started/setup-sdk-client","h":"#using-client-credentials-flow","p":180},{"i":189,"t":"In this guide you will learn how to grant a group of users access to a particular object. When to use Adding a relationship tuple specifying that a group has a relation to an object is helpful in cases where you want to encompass a set of users with the same relation to an object. For example: Grant a group of engineers viewer access to roadmap.doc Create a block_list of members who can't access a document Sharing a document with a team Granting viewer access to a photo to followers only Making a file viewable for all users within an organization Restricting access from or to users in a certain locale","s":"Managing Group Access","u":"/docs/interacting/managing-group-access","h":"","p":188},{"i":191,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have two types: company that can have a employee relation document that can have a reader relation. DSL JSON model schema 1.1 type user type company relations define employee: [user] type document relations define reader: [company#employee] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"company\", \"relations\": { \"employee\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"employee\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"reader\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"company\", \"relation\": \"employee\" } ] } } } } ] } In addition, you will need to know the following: Modeling User Groups​ You need to know how to add users to groups and grant groups access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/interacting/managing-group-access","h":"#before-you-start","p":188},{"i":193,"t":"You need to know how to add users to groups and grant groups access to an object. Learn more →","s":"Modeling User Groups","u":"/docs/interacting/managing-group-access","h":"#modeling-user-groups","p":188},{"i":195,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/interacting/managing-group-access","h":"#-concepts","p":188},{"i":198,"t":"If we want to have every employee of a type company have a reader relationship with a particular object of type document (in this case document:planning), we need to add a tuple like so: [ // Every employee in the company can read document:planning { \"user\": \"company:xyz#employee\", \"relation\": \"reader\", \"object\": \"document:planning\", }, ]","s":"01. Adding Company To The Document","u":"/docs/interacting/managing-group-access","h":"#01-adding-company-to-the-document","p":188},{"i":200,"t":"If we also write a tuple that says that Anne is a employee of company:xyz, like so: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'employee', object: 'company:xyz'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"employee\"), Object: openfga.PtrString(\"company:xyz\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"employee\", Object = \"company:xyz\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"employee\", object=\"company:xyz\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"employee\",\"object\":\"company:xyz\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne employee company:xyz write([ { \"user\":\"user:anne\", \"relation\":\"employee\", \"object\":\"company:xyz\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"02. Adding Employee To The Company","u":"/docs/interacting/managing-group-access","h":"#02-adding-employee-to-the-company","p":188},{"i":202,"t":"Then a call to the Check API to see whether Anne can read document:planning will return true: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true The same check for a different user Becky, however, will return false, because Becky does not have an employee relationship with company:xyz: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky reader document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:becky\", // check if the user `user:becky` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"03. Checking An Individual Member's Access To An Object","u":"/docs/interacting/managing-group-access","h":"#03-checking-an-individual-members-access-to-an-object","p":188},{"i":204,"t":"Check the following sections for more on how to model group. Modeling User Groups Learn about how to model users and groups. More Managing Group Membership Learn about managing group membership. More","s":"Related Sections","u":"/docs/interacting/managing-group-access","h":"#related-sections","p":188},{"i":206,"t":"This article explains how to start your own OpenFGA server using Docker, and how to configure it.","s":"🐳 Setup OpenFGA with Docker","u":"/docs/getting-started/setup-openfga/docker","h":"","p":205},{"i":208,"t":"If you want to run OpenFGA locally as a Docker container, follow these steps: Install Docker (if not already installed). Run docker pull openfga/openfga to get the latest docker image. Run docker run -p 8080:8080 -p 8081:8081 -p 3000:3000 openfga/openfga run. This will start an HTTP server and gRPC server with the default configuration options. Port 8080 is used to serve the HTTP API, 8081 is used to serve the gRPC API, and 3000 is used for the Playground.","s":"Step By Step","u":"/docs/getting-started/setup-openfga/docker","h":"#step-by-step","p":205},{"i":210,"t":"You may configure the OpenFGA server with a config.yaml file. The config.yaml can be specified in either: /etc/openfga $HOME/.openfga . (i.e., the current working directory). The OpenFGA server will search for the configuration file in the above order. Here is a sample configuration to run OpenFGA with a Postgres database and using a preshared key for authentication: datastore: engine: postgres uri: postgres://user:password@localhost:5432/mydatabase authn: method: preshared preshared: keys: [\"key1\", \"key2\"] All possible configurations and their default values are defined in config-schema.json. Information The OpenFGA server supports environment variables for configuration, and they will take priority over your configuration file. Each variable must be prefixed with OPENFGA_ and followed by your option in uppercase (e.g --grpc-tls-key becomes OPENFGA_GRPC_TLS_KEY).","s":"Configuring The Server","u":"/docs/getting-started/setup-openfga/docker","h":"#configuring-the-server","p":205},{"i":212,"t":"OpenFGA supports multiple storage engine options, including: memory - The memory storage engine is the default, but it is not persistent (data is lost between server restarts). postgres - The Postgres storage engine requires a Postgres instance that the OpenFGA server can reach. mysql - The MySQL storage engine requires a MySQL instance that the OpenFGA server can reach, and that the connection URI specifies the query parseTime=true. Postgres​ Docker Docker Compose Let's assume you want to run OpenFGA and Postgres in containers. The first thing we should do is create a new network as this will make communication between containers a bit simpler: docker network create openfga Start Postgres in the network you created above: docker run -d --name postgres --network=openfga -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password postgres:14 You should now have Postgres running in a container in the openfga network. However, it will not have the tables required for running OpenFGA. You can use the migrate command to create the tables. Using the OpenFGA container, this will look like: docker run --rm --network=openfga openfga/openfga migrate \\ --datastore-engine postgres \\ --datastore-uri \"postgres://postgres:password@postgres:5432/postgres?sslmode=disable\" Finally, start OpenFGA: docker run --name openfga --network=openfga -p 3000:3000 -p 8080:8080 -p 8081:8081 openfga/openfga run \\ --datastore-engine postgres \\ --datastore-uri 'postgres://postgres:password@postgres:5432/postgres?sslmode=disable' Copy the below code block into a local file named: docker-compose.yaml version: '3.8' networks: openfga: services: postgres: image: postgres:14 container_name: postgres networks: - openfga ports: - \"5432:5432\" environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=password healthcheck: test: [ \"CMD-SHELL\", \"pg_isready -U postgres\" ] interval: 5s timeout: 5s retries: 5 migrate: depends_on: postgres: condition: service_healthy image: openfga/openfga:latest container_name: migrate command: migrate environment: - OPENFGA_DATASTORE_ENGINE=postgres - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable networks: - openfga openfga: depends_on: migrate: condition: service_completed_successfully image: openfga/openfga:latest container_name: openfga environment: - OPENFGA_DATASTORE_ENGINE=postgres - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable - OPENFGA_LOG_FORMAT=json command: run networks: - openfga ports: # Needed for the http server - \"8080:8080\" # Needed for the grpc server (if used) - \"8081:8081\" # Needed for the playground (Do not enable in prod!) - \"3000:3000\" In a terminal, navigate to that directory and run: docker-compose up This will start the Postgres database, run openfga migrate to configure the database and finally start the OpenFGA server. Now you can try to Create a Store. MySQL​ Setting up MySQL and OpenFGA is very similar to setting up Postgres and OpenFGA. info Note that the MySQL datastore has stricter limits for the max length of some fields for tuples compared to other datastore engines, in particular: object type is at most 128 characters (down from 256) object id is at most 128 characters (down from 256) user is at most 256 characters (down from 512) Docker Docker Compose We first make a network: docker network create openfga Then, start MySQL in the network you created above: docker run -d --name mysql --network=openfga -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=openfga mysql:8 You should now have MySQL running in a container in the openfga network. But we still have to migrate all the tables to be able to run OpenFGA. You can use the migrate command to create the tables. Using the OpenFGA container, this will look like: docker run --rm --network=openfga openfga/openfga migrate \\ --datastore-engine mysql \\ --datastore-uri 'root:secret@tcp(mysql:3306)/openfga?parseTime=true' Finally, start OpenFGA: docker run --name openfga --network=openfga -p 3000:3000 -p 8080:8080 -p 8081:8081 openfga/openfga run \\ --datastore-engine mysql \\ --datastore-uri 'root:secret@tcp(mysql:3306)/openfga?parseTime=true' Copy the below code block into a local file named: docker-compose.yaml version: '3.8' networks: openfga: services: mysql: image: mysql:8 container_name: mysql networks: - openfga ports: - \"3306:3306\" environment: - MYSQL_ROOT_PASSWORD=secret - MYSQL_DATABASE=openfga healthcheck: test: [\"CMD\", 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p$$MYSQL_ROOT_PASSWORD' ] timeout: 20s retries: 5 migrate: depends_on: mysql: condition: service_healthy image: openfga/openfga:latest container_name: migrate command: migrate environment: - OPENFGA_DATASTORE_ENGINE=mysql - OPENFGA_DATASTORE_URI=root:secret@tcp(mysql:3306)/openfga?parseTime=true networks: - openfga openfga: depends_on: migrate: condition: service_completed_successfully image: openfga/openfga:latest container_name: openfga environment: - OPENFGA_DATASTORE_ENGINE=mysql - OPENFGA_DATASTORE_URI=root:secret@tcp(mysql:3306)/openfga?parseTime=true - OPENFGA_LOG_FORMAT=json command: run networks: - openfga ports: # Needed for the http server - \"8080:8080\" # Needed for the grpc server (if used) - \"8081:8081\" # Needed for the playground (Do not enable in prod!) - \"3000:3000\" In a terminal, navigate to that directory and run: docker-compose up This will start the MySQL database, run openfga migrate to configure the database and finally start the OpenFGA server. Now you can try to Create a Store.","s":"Configuring Data Storage","u":"/docs/getting-started/setup-openfga/docker","h":"#configuring-data-storage","p":205},{"i":214,"t":"You can configure authentication in your OpenFGA server in three ways: no authentication (the default), pre-shared key authentication or via OIDC. Pre-shared Key Authentication​ If using Pre-shared key authentication, you will configure OpenFGA with a secret key and your application calling OpenFGA will have to set an Authorization: Bearer header. You can configure multiple keys. Warning If you are going to use this setup in production, you should enable HTTP TLS in your OpenFGA server. You will need to configure the TLS certificate and key. Configuration File Environment Variables Docker Update the config.yaml file to authn: method: preshared preshared: keys: [\"key1\", \"key2\"] http: tls: enabled: true cert: /Users/myuser/key/server.crt key: /Users/myuser/key/server.key Configure the authentication method to preshared: export OPENFGA_AUTHN_METHOD=preshared. Configure the authentication keys: export OPENFGA_AUTHN_PRESHARED_KEYS=\"key1,key2\" Enable the HTTP TLS configuration: export OPENFGA_HTTP_TLS_ENABLED=true Configure the HTTP TLS certificate location: export OPENFGA_HTTP_TLS_CERT=/Users/myuser/key/server.crt Configure the HTTP TLS key location: export OPENFGA_HTTP_TLS_KEY=/Users/myuser/key/server.key To configure with pre-shared authentication and enabling TLS in http server with Docker. Copy the certificate and key files to your Docker container. Run with the following command: docker run --name openfga --network=openfga -p 3000:3000 -p 8080:8080 -p 8081:8081 openfga/openfga run \\ --authn-method=preshared \\ --authn-preshared-keys=\"key1,key2\" \\ --http-tls-enabled=true \\ --http-tls-cert=\"/Users/myuser/key/server.crt\" \\ --http-tls-key=\"/Users/myuser/key/server.key\" OIDC​ To configure with OIDC authentication, you will first need to obtain the OIDC issuer and audience from your provider. Warning If you are going to use this setup in production, you should enable HTTP TLS in your OpenFGA server. You will need to configure the TLS certificate and key. Configuration File Environment Variables Docker Update the config.yaml file to authn: method: oidc oidc: issuer: \"oidc-issuer\" audience: \"oidc-audience\" http: tls: enabled: true cert: /Users/myuser/key/server.crt key: /Users/myuser/key/server.key Configure the authentication method to preshared: export OPENFGA_AUTHN_METHOD=oidc. Configure the authentication keys: export OPENFGA_AUTHN_OIDC_ISSUER=oidc-issuer Configure the authentication keys: export OPENFGA_AUTHN_OIDC_audience=oidc-audience Enable the HTTP TLS configuration: export OPENFGA_HTTP_TLS_ENABLED=true Configure the HTTP TLS certificate location: export OPENFGA_HTTP_TLS_CERT=/Users/myuser/key/server.crt Configure the HTTP TLS key location: export OPENFGA_HTTP_TLS_KEY=/Users/myuser/key/server.key To configure with pre-shared authentication and enabling TLS in http server with Docker. Copy the certificate and key files to your docker container. Run the following command docker run --name openfga --network=openfga -p 3000:3000 -p 8080:8080 -p 8081:8081 openfga/openfga run \\ --authn-method=oidc \\ --authn-oidc-issuer=\"oidc-issuer\" \\ --authn-oidc-audience=\"oidc-audience\" \\ --http-tls-enabled=true \\ --http-tls-cert=\"/Users/myuser/key/server.crt\" \\ --http-tls-key=\"/Users/myuser/key/server.key\"","s":"Configuring Authentication","u":"/docs/getting-started/setup-openfga/docker","h":"#configuring-authentication","p":205},{"i":216,"t":"The Playground facilitates rapid development by allowing you to visualize and model your application's authorization model(s) and manage relationship tuples with a locally running OpenFGA instance. The Playground is enabled on port 3000 by default and accessible at http://localhost:3000/playground (if using Docker, make sure port 3000 is exposed to your local network). To disable the Playground, see Configuring the Server.","s":"Playground","u":"/docs/getting-started/setup-openfga/docker","h":"#playground","p":205},{"i":218,"t":"Warning Continuous profiling can be used in production deployments, but we recommend disabling it unless it is needed to troubleshoot specific performance or memory problems. Profiling through pprof can be enabled on the OpenFGA server by providing the --profiler-enabled flag. For example, in Docker: docker run -p 8080:8080 -p 8081:8081 -p 3000:3000 -p 3001:3001 openfga/openfga run --profiler-enabled If you need to serve the profiler on a different port than the default 3001, you can do so by specifying the --profiler-addr flag. For example: docker run -p 8080:8080 -p 8081:8081 -p 3000:3000 -p 3002:3002 openfga/openfga run --profiler-enabled --profiler-addr :3002","s":"Profiler (pprof)","u":"/docs/getting-started/setup-openfga/docker","h":"#profiler-pprof","p":205},{"i":220,"t":"OpenFGA is configured with an HTTP health check endpoint /healthz and a gRPC health check grpc.health.v1.Health/Check, which is wired to datastore testing. Possible response values are UNKNOWN SERVING NOT_SERVING SERVICE_UNKNOWN cURL gRPC curl -X GET $FGA_API_HOST/healthz # {\"status\":\"SERVING\"} # See https://github.com/fullstorydev/grpcurl#installation grpcurl -plaintext $FGA_API_HOST grpc.health.v1.Health/Check # {\"status\":\"SERVING\"}","s":"Health Check","u":"/docs/getting-started/setup-openfga/docker","h":"#health-check","p":205},{"i":222,"t":"Various releases of OpenFGA may have experimental features that can be enabled by providing the --experimentals flag or the experimentals config. docker run -p 8080:8080 -p 8081:8081 openfga/openfga run --experimentals=\"feature1, feature2\" or if you're using environment variables, docker run -p 8080:8080 -p 8081:8081 openfga/openfga -e OPENFGA_EXPERIMENTALS=\"feature1, feature2\" run The following table enumerates the experimental flags, a description of what they do, and the versions of OpenFGA the flag is supported in: Name Description OpenFGA Version Status otel-metrics Enables support for exposing OpenFGA metrics through OpenTelemetry 0.3.2 <= v < v0.3.5 became default in v0.3.5 list-objects Enables ListObjects API 0.2.0 <= v < v0.3.3 became default in v0.3.3 check-query-cache Enables caching of check subproblem result 1.3.1 <= v currently experimental Warning Experimental features are not guaranteed to be stable and may lead to server instabilities. It is not recommended to enable experimental features for anything other than experimentation. Experimental feature flags are also not considered part of API compatibility and are subject to change, so please refer to each OpenFGA specific release for a list of the experimental feature flags that can be enabled for that release.","s":"Experimental Features","u":"/docs/getting-started/setup-openfga/docker","h":"#experimental-features","p":205},{"i":224,"t":"OpenFGA telemetry data is collected by default starting on version v0.3.5. The telemetry information that is captured includes Metrics, Traces, and Logs. note Please refer to the docker-compose.yaml file as an example of how to collect Metrics and Tracing in OpenFGA in a Docker environment using the OpenTelemetry Collector. This should serve as a good example that you can adjust for your specific deployment scenario.","s":"Telemetry","u":"/docs/getting-started/setup-openfga/docker","h":"#telemetry","p":205},{"i":226,"t":"OpenFGA metrics are collected with the Prometheus data format and exposed on address 0.0.0.0:2112/metrics. Metrics are exposed by default, but you can disable this with --metrics-enabled=false (or OPENFGA_METRICS_ENABLED=false environment variable). To set an alternative address, you can provide the --metrics-addr flag (OPENFGA_METRICS_ADDR environment variable). For example: openfga run --metrics-addr=0.0.0.0:2114 To see the request latency per endpoint of your OpenFGA deployment, you can provide the --metrics-enable-rpc-histograms flag (OPENFGA_METRICS_ENABLE_RPC_HISTOGRAMS environment variable).","s":"Metrics","u":"/docs/getting-started/setup-openfga/docker","h":"#metrics","p":205},{"i":228,"t":"OpenFGA traces can be collected with the OTLP data format. Tracing is disabled by default, but you can enable this with the --trace-enabled=true (OPENFGA_TRACE_ENABLED=true environment variable). Traces will be exported by default to address 0.0.0.0:4317. You can change this address with the --trace-otlp-endpoint flag (OPENFGA_TRACE_OTLP_ENDPOINT environment variable). To increase or decrease the trace sampling ratio, you can provide the --trace-sample-ratio flag (OPENFGA_TRACE_SAMPLE_RATIO env variable). Tracing by default uses a insecure connection. You can enable TLS by using --trace-otlp-tls-enabled=true flag or the environment variable OPENFGA_TRACE_OTLP_TLS_ENABLED. Warning It is not recommended to sample all traces (e.g. --trace-sample-ratio=1). You will need to adjust your sampling ratio based on the amount of traffic your deployment receives. Higher traffic will require less sampling and lower traffic can tolerate higher sampling ratios.","s":"Tracing","u":"/docs/getting-started/setup-openfga/docker","h":"#tracing","p":205},{"i":230,"t":"OpenFGA generates structured logs by default, and it can be configured with the following flags: --log-format: sets the log format. Today we support text and json format. --log-level: sets the minimum log level (defaults to info). It can be set to none to turn off logging.","s":"Logging","u":"/docs/getting-started/setup-openfga/docker","h":"#logging","p":205},{"i":232,"t":"Check the following sections for more on how to use OpenFGA. Production Best Practices Learn the best practices of running OpenFGA in a production environment More","s":"Related Sections","u":"/docs/getting-started/setup-openfga/docker","h":"#related-sections","p":205},{"i":234,"t":"The following list outlines some guidelines and best practices for using OpenFGA: Do not store Personal Identifiable Information in tuples Always specify authorization model ID whenever possible","s":"Best Practices of Managing Tuples and Invoking APIs","u":"/docs/getting-started/tuples-api-best-practices","h":"","p":233},{"i":236,"t":"You can use any string for user and object identifiers, however you should not input or assign identifiers that include Personal Data or any other sensitive data, such as data that may be restricted under regulatory requirements. Note The documentation and samples uses first names and simple ids to illustrate easy-to-follow examples.","s":"Do Not Store Personal Identifiable Information in Tuples","u":"/docs/getting-started/tuples-api-best-practices","h":"#do-not-store-personal-identifiable-information-in-tuples","p":233},{"i":238,"t":"It is strongly recommended that authorization model ID be specified in your Relationship Queries (such as Check and ListObjects) and Relationship Commands (such as Write). Specifying authorization model ID in API calls have the following advantages: Better performance as OpenFGA will not need to perform a database query to get the latest authorization model ID. Allows consistent behavior in your production system until until you are ready to switch to the new model.","s":"Always Specify Authorization Model ID Whenever Possible","u":"/docs/getting-started/tuples-api-best-practices","h":"#always-specify-authorization-model-id-whenever-possible","p":233},{"i":240,"t":"Check the following sections for more on recommendation for managing relations and model in production environment. Migrating Relations Learn how to migrate relations in a production environment More Migrating Schema 1.1 Learn how to migrate to model schema 1.1 More","s":"Related Sections","u":"/docs/getting-started/tuples-api-best-practices","h":"#related-sections","p":233},{"i":242,"t":"This section will illustrate how to update relationship tuples.","s":"Update Relationship Tuples","u":"/docs/getting-started/update-tuples","h":"","p":241},{"i":244,"t":"Node.js Go .NET Python CLI curl Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_SERVER_URL as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables.","s":"Before You Start","u":"/docs/getting-started/update-tuples","h":"#before-you-start","p":241},{"i":246,"t":"Assume that you want to add user user:anne to have relationship reader with object document:Z { user: 'user:anne', relation: 'reader', object: 'document:Z', }","s":"Step By Step","u":"/docs/getting-started/update-tuples","h":"#step-by-step","p":241},{"i":248,"t":"Before calling the write API, you will need to configure the API client. Node.js Go .NET Python CLI curl // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) To obtain the access token: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)","s":"01. Configure The OpenFGA API Client","u":"/docs/getting-started/update-tuples","h":"#01-configure-the--api-client","p":241},{"i":250,"t":"To add the relationship tuples, we can invoke the write API. Node.js Go .NET Python CLI curl await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'reader', object: 'document:Z'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"reader\"), Object: openfga.PtrString(\"document:Z\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"reader\", Object = \"document:Z\" } }, }; var response = await fgaClient.Write(body, options); options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"reader\", object=\"document:Z\", ),, ), \", ) response = await fga_client.write(body, options) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:Z curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:Z\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}'","s":"02. Calling Write API To Add New Relationship Tuples","u":"/docs/getting-started/update-tuples","h":"#02-calling-write-api-to-add-new-relationship-tuples","p":241},{"i":252,"t":"To delete relationship tuples, we can invoke the write API. Assume that you want to delete user user:anne's reader relationship with object document:Z { user: 'user:anne', relation: 'reader', object: 'document:Z', } Node.js Go .NET Python CLI curl await fgaClient.write({ deletes: [ { user: 'user:anne', relation: 'reader', object: 'document:Z'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"reader\"), Object: openfga.PtrString(\"document:Z\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { new() { User = \"user:anne\", Relation = \"reader\", Object = \"document:Z\" } }, }; var response = await fgaClient.Write(body, options); options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( user=\"user:anne\", relation=\"reader\", object=\"document:Z\", ),], ), \", ) response = await fga_client.write(body, options) fga tuple delete --store-id=${FGA_STORE_ID} user:anne reader document:Z curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:Z\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}'","s":"03. Calling Write API To Delete Relationship Tuples","u":"/docs/getting-started/update-tuples","h":"#03-calling-write-api-to-delete-relationship-tuples","p":241},{"i":254,"t":"Check the following sections for more on how to write your authorization data Managing User Access Learn about how to give a user access to a particular object. More Managing Group Access Learn about how to give a group of users access to a particular object. More Transactional Writes Learn about how to update multiple relations within the same API call. More","s":"Related Sections","u":"/docs/getting-started/update-tuples","h":"#related-sections","p":241},{"i":256,"t":"In this guide you will learn how to grant a user access to a particular object. When to use Granting access with a relationship tuple is a core part of OpenFGA. Without any relationship tuples, any check will fail. You should use: authorization model to represent what relations are possible between the users and objects in your system relationship tuples to represent the facts about the relationships between users and objects in your system.","s":"Managing User Access","u":"/docs/interacting/managing-user-access","h":"","p":255},{"i":258,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have a type called tweet that can have a reader. DSL JSON model schema 1.1 type user type tweet relations define reader: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"tweet\", \"relations\": { \"reader\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/interacting/managing-user-access","h":"#before-you-start","p":255},{"i":260,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/interacting/managing-user-access","h":"#direct-access","p":255},{"i":262,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/interacting/managing-user-access","h":"#-concepts","p":255},{"i":265,"t":"For our application, we will give user Anne the reader relationship to a particular tweet. To do so we add a tuple as follows: [ // Anne can read tweet:1 { \"user\": \"user:anne\", \"relation\": \"reader\", \"object\": \"tweet:1\", }, ] With the above, we have added a direct relationship between Anne and tweet:1. When we call the Check API to see if Anne has a reader relationship, OpenFGA will say yes. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'tweet:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"tweet:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"tweet:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"tweet:1\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader tweet:1 # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"tweet:1\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"tweet:1\", // with the object `tweet:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"01. Adding Direct Relationship","u":"/docs/interacting/managing-user-access","h":"#01-adding-direct-relationship","p":255},{"i":267,"t":"Now let's change this so that Anne no longer has a reader relationship to tweet:1 by deleting the tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ { user: 'user:anne', relation: 'reader', object: 'tweet:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"reader\"), Object: openfga.PtrString(\"tweet:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { new() { User = \"user:anne\", Relation = \"reader\", Object = \"tweet:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( user=\"user:anne\", relation=\"reader\", object=\"tweet:1\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"tweet:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} user:anne reader tweet:1 delete([ { \"user\":\"user:anne\", \"relation\":\"reader\", \"object\":\"tweet:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") With this, we have removed the direct relationship between Anne and tweet:1. And because our type definition for reader does not include any other relations, a call to the Check API will now return a negative response. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'tweet:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"tweet:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"tweet:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"tweet:1\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader tweet:1 # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"tweet:1\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"tweet:1\", // with the object `tweet:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"02. Removing Direct Relationship","u":"/docs/interacting/managing-user-access","h":"#02-removing-direct-relationship","p":255},{"i":269,"t":"Check the following sections for more on how to manage user access. Direct Access Learn about how to model granting user access to an object. More Modeling Public Access Learn about how to model granting public access. More How to update relationship tuples Learn about how to update relationship tuples in SDK. More","s":"Related Sections","u":"/docs/interacting/managing-user-access","h":"#related-sections","p":255},{"i":271,"t":"This section illustrates how to call the Read Changes API to get the list of relationship tuple changes that happened in your store, in the exact order that they happened. The API response includes tuples that have been added or removed in your store. It does not include other changes, like updates to your authorization model and adding new assertions.","s":"How to get tuple changes","u":"/docs/interacting/read-tuple-changes","h":"","p":270},{"i":273,"t":"Node.js Go .NET Python curl Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and added some relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model and added some relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have installed the SDK. You have configured the authorization model. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables. Deploy an instance of the OpenFGA server, and have ready the values for your setup: FGA_STORE_ID, FGA_API_HOST and, if needed, FGA_API_TOKEN. You have configured the authorization model and added some relationship tuples. You have loaded FGA_STORE_ID and FGA_API_HOST as environment variables.","s":"Before you start","u":"/docs/interacting/read-tuple-changes","h":"#before-you-start","p":270},{"i":275,"t":"To get a chronologically ordered list of tuples that have been written or deleted in your store, you can do so by calling the Read Changes API.","s":"Step By Step","u":"/docs/interacting/read-tuple-changes","h":"#step-by-step","p":270},{"i":277,"t":"First you will need to configure the API client. Node.js Go .NET Python curl // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() To obtain the access token: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example)","s":"01. Configure The OpenFGA API Client","u":"/docs/interacting/read-tuple-changes","h":"#01-configure-the--api-client","p":270},{"i":279,"t":"To get a paginated list of changes that happened in your store: Node.js Go .NET Python CLI curl var type = \"\"; var continuationToken = \"\"; var pageSize = 25; await fgaClient.readChanges({ type }, { pageSize, continuationToken }); options := ClientReadChangesOptions{ PageSize: openfga.PtrInt32(25), } body := ClientReadChangesRequest{ } data, err := fgaClient.ReadChanges(context.Background()).Body(body).Options(options).Execute() if err != nil { // .. Handle error } var body = new ClientReadChangesRequest { }; var options = new ClientReadChangesOptions { PageSize = 25, }; var response = await fgaClient.ReadChanges(body, options); body = ClientReadChangesRequest() options = new ClientReadChangesOptions { page_size: 25, }; response = await fga_client.read_changes(body, options) fga tuple changes --store-id=${FGA_STORE_ID} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/changes \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"page_size\": 25}' The result will contain an array of up to 25 tuples, with the operation (write or delete), and the timestamp in which that operation took place. The result will also contain a continuation token. Save the continuation token in persistent storage between calls so that it is not lost and you do not have to restart from scratch on system restart or on error. You can then use this token to get the next set of changes: Node.js Go .NET Python CLI curl var type = \"\"; var continuationToken = \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\"; var pageSize = 25; await fgaClient.readChanges({ type }, { pageSize, continuationToken }); options := ClientReadChangesOptions{ PageSize: openfga.PtrInt32(25), ContinuationToken: openfga.PtrString(\"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\"), } body := ClientReadChangesRequest{ } data, err := fgaClient.ReadChanges(context.Background()).Body(body).Options(options).Execute() if err != nil { // .. Handle error } var body = new ClientReadChangesRequest { }; var options = new ClientReadChangesOptions { PageSize = 25, ContinuationToken = \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\", }; var response = await fgaClient.ReadChanges(body, options); body = ClientReadChangesRequest() options = new ClientReadChangesOptions { page_size: 25, continuation_token: \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\", }; response = await fga_client.read_changes(body, options) fga tuple changes --store-id=${FGA_STORE_ID} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/changes \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\", \"page_size\": 25}' Once there are no more changes to retrieve, the API will return the same token as the one you sent. Save the token in persistent storage to use at a later time. note The default page size is 50. The maximum page size allowed is 100. The API response will not return all the changes immediately. There will be a delay of one minute between the time that you add or delete a tuple and the time that you see it in the Read Changes API response. The API response does not expand the tuples. If you wrote a tuple that includes a userset, like {\"user\": \"group:abc#member\", \"relation\": \"owner\": \"doc:budget\"}, the Read Changes API will return that exact tuple.","s":"02. Get Changes For All Object Types","u":"/docs/interacting/read-tuple-changes","h":"#02-get-changes-for-all-object-types","p":270},{"i":281,"t":"Imagine you have the following authorization model: DSL JSON model schema 1.1 type user type group relations define member: [user] type folder relations define owner: [group#member, user] type doc relations define owner: [group#member, user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"group\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"folder\", \"relations\": { \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"group\", \"relation\": \"member\" }, { \"type\": \"user\" } ] } } } }, { \"type\": \"doc\", \"relations\": { \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"group\", \"relation\": \"member\" }, { \"type\": \"user\" } ] } } } } ] } It is possible to get a list of changes that happened in your store that relate only to one specific object type, like folder, by issuing a call like this: Node.js Go .NET Python CLI curl var type = \"folder\"; var continuationToken = \"\"; var pageSize = 25; await fgaClient.readChanges({ type }, { pageSize, continuationToken }); options := ClientReadChangesOptions{ PageSize: openfga.PtrInt32(25), } body := ClientReadChangesRequest{ Type: \"folder\", } data, err := fgaClient.ReadChanges(context.Background()).Body(body).Options(options).Execute() if err != nil { // .. Handle error } var body = new ClientReadChangesRequest { Type = \"folder\" }; var options = new ClientReadChangesOptions { PageSize = 25, }; var response = await fgaClient.ReadChanges(body, options); body = ClientReadChangesRequest(\"folder\") options = new ClientReadChangesOptions { page_size: 25, }; response = await fga_client.read_changes(body, options) fga tuple changes --store-id=${FGA_STORE_ID} --type folder curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/changes \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"type\": folder\", \"page_size\": 25}' The response will include a continuation token. In subsequent calls, you have to include the token and the type. (If you send this continuation token without the type parameter set, you will get an error). Node.js Go .NET Python CLI curl var type = \"folder\"; var continuationToken = \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\"; var pageSize = 25; await fgaClient.readChanges({ type }, { pageSize, continuationToken }); options := ClientReadChangesOptions{ PageSize: openfga.PtrInt32(25), ContinuationToken: openfga.PtrString(\"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\"), } body := ClientReadChangesRequest{ Type: \"folder\", } data, err := fgaClient.ReadChanges(context.Background()).Body(body).Options(options).Execute() if err != nil { // .. Handle error } var body = new ClientReadChangesRequest { Type = \"folder\" }; var options = new ClientReadChangesOptions { PageSize = 25, ContinuationToken = \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\", }; var response = await fgaClient.ReadChanges(body, options); body = ClientReadChangesRequest(\"folder\") options = new ClientReadChangesOptions { page_size: 25, continuation_token: \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\", }; response = await fga_client.read_changes(body, options) fga tuple changes --store-id=${FGA_STORE_ID} --type folder curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/changes \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"type\": folder\", \"continuation_token\": \"eyJwayI6IkxBVEVTVF9OU0NPTkZJR19hdXRoMHN0b3JlIiwic2siOiIxem1qbXF3MWZLZExTcUoyN01MdTdqTjh0cWgifQ==\", \"page_size\": 25}'","s":"03. Get Changes For A Specific Object Type","u":"/docs/interacting/read-tuple-changes","h":"#03-get-changes-for-a-specific-object-type","p":270},{"i":283,"t":"In this guide you will learn how to update a user's membership to a group by adding and removing them from it. When to use Suppose: An employee is hired at a company and thus gains access to all of the company's resources. An employee quits and thus loses access to all of the company's resources. A user joins a GitHub organization and gains access to the organizations private repositories. A student graduates from school and loses access to the school's facilities. These are cases where using group membership can be helpful as you do not need to iterate over all of the group's resources to add or revoke access to particular objects. You can add a relationship tuple indicating that a user belongs to a group, or delete a tuple to indicate that a user is no longer part of the group.","s":"Managing Group Membership","u":"/docs/interacting/managing-group-membership","h":"","p":282},{"i":285,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have two types: org that can have a member relation document that can have a reader relation. DSL JSON model schema 1.1 type user type org relations define member: [user] type document relations define reader: [org#member] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"org\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"reader\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"org\", \"relation\": \"member\" } ] } } } } ] } Let us also assume that we have an org called \"contoso\" and a document called planning, and every member of that org can read the document. That is represented by having the following relationship tuple in the store: [ // Members of the contoso org can read the planning document { \"user\": \"org:contoso#member\", \"relation\": \"reader\", \"object\": \"document:planning\", }, ] With the above authorization model and relationship tuples, OpenFGA will respond with {\"allowed\":false} when check is called to see if Anne can read document:planning. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'anne', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"anne\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"anne\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"anne\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw anne reader document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"anne\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"anne\", // check if the user `anne` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Now let's make Anne a member of org:contoso by adding another tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is a member of the contoso org { user: 'user:anne', relation: 'member', object: 'org:contoso'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is a member of the contoso org User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"org:contoso\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is a member of the contoso org new() { User = \"user:anne\", Relation = \"member\", Object = \"org:contoso\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is a member of the contoso org user=\"user:anne\", relation=\"member\", object=\"org:contoso\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"member\",\"object\":\"org:contoso\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member org:contoso write([ // Anne is a member of the contoso org { \"user\":\"user:anne\", \"relation\":\"member\", \"object\":\"org:contoso\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") The OpenFGA service will now correctly respond with {\"allowed\":true} when check is called to see if Anne can read document:planning, but it will still respond with {\"allowed\":false} if we ask the same question for another user called Becky, who is not a member of the group org:contoso. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky reader document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:becky\", // check if the user `user:becky` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Modeling User Groups​ You need to know how to add users to groups and grant groups access to an object. Learn more → Managing Group Access​ You need to know how to manage group access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/interacting/managing-group-membership","h":"#before-you-start","p":282},{"i":287,"t":"You need to know how to add users to groups and grant groups access to an object. Learn more →","s":"Modeling User Groups","u":"/docs/interacting/managing-group-membership","h":"#modeling-user-groups","p":282},{"i":289,"t":"You need to know how to manage group access to an object. Learn more →","s":"Managing Group Access","u":"/docs/interacting/managing-group-membership","h":"#managing-group-access","p":282},{"i":291,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/interacting/managing-group-membership","h":"#-concepts","p":282},{"i":294,"t":"Imagine that every member of org:contoso has a reader relationship to 1000 documents. Now imagine that anne is no longer a member of org:contoso, so we want to revoke her access to all those documents, including document:planning. To accomplish this, we can simply delete the tuple in OpenFGA that specifies that Anne is a member of org:contoso. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ { user: 'user:anne', relation: 'member', object: 'org:contoso'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"org:contoso\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { new() { User = \"user:anne\", Relation = \"member\", Object = \"org:contoso\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( user=\"user:anne\", relation=\"member\", object=\"org:contoso\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"member\",\"object\":\"org:contoso\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} user:anne member org:contoso delete([ { \"user\":\"user:anne\", \"relation\":\"member\", \"object\":\"org:contoso\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"01. Revoking Group Membership","u":"/docs/interacting/managing-group-membership","h":"#01-revoking-group-membership","p":282},{"i":296,"t":"Once the above relationship tuple is deleted, we can check if Anne can read document:planning. OpenFGA will return { \"allowed\": false }. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"02. Validating revoked member no longer has access","u":"/docs/interacting/managing-group-membership","h":"#02-validating-revoked-member-no-longer-has-access","p":282},{"i":298,"t":"Check the following sections for more on how to model group. Modeling User Groups Learn about how to model users and groups. More Managing Group Access Learn about managing group access. More","s":"Related Sections","u":"/docs/interacting/managing-group-membership","h":"#related-sections","p":282},{"i":300,"t":"In this guide you will learn how to update multiple relationship tuples in a single transaction. When to use Updating multiple relationship tuples is useful to keep system state consistent.","s":"Transactional Writes","u":"/docs/interacting/transactional-writes","h":"","p":299},{"i":302,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have a type called tweet that can have a reader. You have another type called user that can have a follower and followed_by relationship. DSL JSON model schema 1.1 type tweet relations define viewer: [user, user:*, user#follower] type user relations define follower: [user] define followed_by: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"tweet\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user\", \"wildcard\": {} }, { \"type\": \"user\", \"relation\": \"follower\" } ] } } } }, { \"type\": \"user\", \"relations\": { \"follower\": { \"this\": {} }, \"followed_by\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"follower\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"followed_by\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → Modeling Public Access​ You need to know how to grant public access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/interacting/transactional-writes","h":"#before-you-start","p":299},{"i":304,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/interacting/transactional-writes","h":"#direct-access","p":299},{"i":306,"t":"You need to know how to grant public access to an object. Learn more →","s":"Modeling Public Access","u":"/docs/interacting/transactional-writes","h":"#modeling-public-access","p":299},{"i":308,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/interacting/transactional-writes","h":"#-concepts","p":299},{"i":311,"t":"When you need to add or delete tuples in your store, you can do so by calling the Write API. For example, if you want to make tweet:1 public by making everyone a viewer, you write one tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:*', relation: 'viewer', object: 'tweet:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:*\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"tweet:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:*\", Relation = \"viewer\", Object = \"tweet:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:*\", relation=\"viewer\", object=\"tweet:1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:*\",\"relation\":\"viewer\",\"object\":\"tweet:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:* viewer tweet:1 write([ { \"user\":\"user:*\", \"relation\":\"viewer\", \"object\":\"tweet:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") And if you want to convert this tweet to private, you would need to delete that tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ { user: 'user:*', relation: 'viewer', object: 'tweet:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:*\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"tweet:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { new() { User = \"user:*\", Relation = \"viewer\", Object = \"tweet:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( user=\"user:*\", relation=\"viewer\", object=\"tweet:1\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:*\",\"relation\":\"viewer\",\"object\":\"tweet:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} user:* viewer tweet:1 delete([ { \"user\":\"user:*\", \"relation\":\"viewer\", \"object\":\"tweet:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") By removing the tuple, we made the tweet visible to no-one, which may not be what we want. The Write API allows you to send up to 10 unique tuples in the request. (This limit applies to the sum of both writes and deletes in that request). This means we can submit one API call that converts the tweet from public to visible to only the user's followers. Node.js Go .NET Python curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne's followers can view tweet:1 { user: 'user:anne#follower', relation: 'viewer', object: 'tweet:1'}] }, deletes: [ // tweet:1 is no longer viewable by everyone (*) { user: 'user:*', relation: 'viewer', object: 'tweet:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne's followers can view tweet:1 User: openfga.PtrString(\"user:anne#follower\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"tweet:1\"), }, } Deletes: &[]ClientTupleKey{ { // tweet:1 is no longer viewable by everyone (*) User: openfga.PtrString(\"user:*\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"tweet:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne's followers can view tweet:1 new() { User = \"user:anne#follower\", Relation = \"viewer\", Object = \"tweet:1\" } }, Deletes = new List() { // tweet:1 is no longer viewable by everyone (*) new() { User = \"user:*\", Relation = \"viewer\", Object = \"tweet:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne's followers can view tweet:1 user=\"user:anne#follower\", relation=\"viewer\", object=\"tweet:1\", ),, ), deletes==[ ClientTuple( # tweet:1 is no longer viewable by everyone (*) user=\"user:*\", relation=\"viewer\", object=\"tweet:1\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne#follower\",\"relation\":\"viewer\",\"object\":\"tweet:1\"}] },\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:*\",\"relation\":\"viewer\",\"object\":\"tweet:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' write([ // Anne's followers can view tweet:1 { \"user\":\"user:anne#follower\", \"relation\":\"viewer\", \"object\":\"tweet:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), delete([ // tweet:1 is no longer viewable by everyone (*) { \"user\":\"user:*\", \"relation\":\"viewer\", \"object\":\"tweet:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"01. Adding And Removing Relationship Tuples In The Same Transaction","u":"/docs/interacting/transactional-writes","h":"#01-adding-and-removing-relationship-tuples-in-the-same-transaction","p":299},{"i":313,"t":"Having the ability to send multiple tuples per request is also useful when you want to maintain consistency. For example, if anne starts following becky, we want to be able to save the following two tuples, or neither of them: [ // Anne is a follower of Becky { \"user\": \"user:anne\", \"relation\": \"follower\", \"object\": \"user:becky\", }, // Becky is followed by Anne { \"user\": \"user:becky\", \"relation\": \"followed_by\", \"object\": \"user:anne\", }, ] info We have a type called user in this case because users can be related to each other, so the users now are a type in the system The OpenFGA service will attempt to perform all the changes sent in a single Write API call in one transaction. If it can't (for example, if any of the requested changes fails), it will reject all of the changes.","s":"02. Adding Multiple Related Relationship Tuples In The Same Transaction","u":"/docs/interacting/transactional-writes","h":"#02-adding-multiple-related-relationship-tuples-in-the-same-transaction","p":299},{"i":315,"t":"Check the following sections for more on how to update tuples. Update relationship tuples in SDK Learn about how to update relationship tuples in SDK. More OpenFGA API Details on the write API in the OpenFGA reference guide. More","s":"Related Sections","u":"/docs/interacting/transactional-writes","h":"#related-sections","p":299},{"i":317,"t":"Once you implement fine-grained authorization to protect your resources, search becomes a more complex problem, because the user's access to each resource now has to be validated before the resource can be shown. The search problem can then be summarized as: \"Given a particular search filter and a sort order, what objects can the user access\"? The OpenFGA service does not store object metadata (names of files, creation dates, time of last update, etc), which means completing any search request by filtering and sorting according to certain criteria will require data from your database. The services responsible for performing these actions are: Filter: Your database Sort: Your database Authorize: OpenFGA To return the set of results that match the user's search query, you will need to get the intersection of the results from the services above.","s":"Search With Permissions","u":"/docs/interacting/search-with-permissions","h":"","p":316},{"i":319,"t":"There are three possible ways to do this:","s":"Possible Options","u":"/docs/interacting/search-with-permissions","h":"#possible-options","p":316},{"i":321,"t":"Pre-filter, then call OpenFGA Check endpoint. Filter and sort on your database. Call /check in parallel on each object returned from your database. Filter out objects the user does not have access to. Return the filtered result to the user.","s":"Option 1: Search, Then Check","u":"/docs/interacting/search-with-permissions","h":"#option-1-search-then-check","p":316},{"i":323,"t":"Consume the GET /changes endpoint to create a local index you can use to do an intersection on the two sets of results. Call the OpenFGA changes API. For the particular authorization model version(s) you are using in production, flatten/expand the changes (e.g. user:anne, writer, doc:planning becomes two tuples: user:anne, writer, doc:planning and user:anne, reader, doc:planning). Build the intersection between the objects in your database and the flattened/expanded state you created. You can then call /check on each resource in the resulting set before returning the response to filter out any resource with permissions revoked but whose authorization data has not made it into your index yet.","s":"Option 2: Build A Local Index From Changes Endpoint, Search, Then Check","u":"/docs/interacting/search-with-permissions","h":"#option-2-build-a-local-index-from-changes-endpoint-search-then-check","p":316},{"i":325,"t":"Call the GET /list-objects API to get a list of object IDs the user has access to, then run the filter restricting by the object IDs returned. Call the OpenFGA List Objects API. to get the list of all resources a user can access. Pass in the set of object IDs to the database query to limit the search. Return the filtered result to the user.","s":"Option 3: Build A List Of IDs, Then Search","u":"/docs/interacting/search-with-permissions","h":"#option-3-build-a-list-of-ids-then-search","p":316},{"i":327,"t":"Which option to choose among the three listed above depends on the following criteria: Number of objects that your database can return from a search query Number of objects of a certain type the user could have access to Percentage of objects in a type the user could have access to Consider the following scenarios: A. The number of objects a search query could return from the database is low. Search then Check is the recommended solution. Use-case: Situations where the search query can be optimized to return a small number of results. B. The number of objects of a certain type the user could have access to is low, and the percentage of objects in a namespace a user could have access to is high. Search then Check is recommended to get the final list of results. Note that this use case, because the user has access to a low number of objects which are still a high percentage of the total objects in the system, that means that the total number of objects in the system is low. C. The number of objects of a certain type the user could have access to is low (~ 100), and the percentage of the total objects that the user can have access to is also low. In this case, an API to return the list of all objects a user can access would make sense. You can query this API to get a list of object IDs and then pass these IDs to your filter function to limit the search to them. As this number increases, this solution becomes impractical, because you would need to paginate over multiple pages to get the entire list before being able to search and sort. A partial list from the API is not enough, because you won't be able to sort using it. So while List of IDs then Search would be useful for this in some situations, we would recommend Local Index from Changes Endpoint, Search then Check for the cases when the number of objects is high enough. Until OpenFGA implements an endpoint to return a list of object IDs, local index is recommended for all situations. D. The number of objects of a certain type the user could have access to is high, and the percentage of the total objects that the user can have access to is low. The recommended option for this case is to use Local Index from Changes Endpoint, Search then Check. List of IDs then Search would not work because you would have to get and paginate across thousands or tens of thousands (or in some cases more) of results from OpenFGA, only after you have retrieved the entire set can you start searching within your database for matching results. This would mean that your user could be waiting for a long time before they can start seeing results. Search then Check would also not be ideal, as you will be retrieving and checking against a lot of items and discarding most of them. Use case: Searching in Google Drive, where the list of documents and folders that a user has access to can be very high, but it still is a small percentage of the entire set of documents in Google Drive. E. The number of objects of a certain type the user could have access to is high, and the percentage of the total objects that the user can have access to is also high. In this case a Local Index from Changes Endpoint, Search then Check would be useful. If you do not want to maintain a local index, and if the user can access a high percentage of the total, meaning that the user is more likely than not to have access to the results returned by the search query, then Search then Check would work just as well. Use-case: Searching on Twitter. Most Twitter users have their profiles set to public, so the user is more likely to have access to the tweets when performing a search. So searching first then running checks against the set of returned results would be appropriate.","s":"Choosing The Best Option","u":"/docs/interacting/search-with-permissions","h":"#choosing-the-best-option","p":316},{"i":329,"t":"Scenario Use Case # of objects returned from database query # of objects user can access in a type % of objects user can access in a type Preferred Option A Search criteria enough to narrow down results Low - - 1 B Few objects the user has access to, but still a high % of total objects Low Low High 1 C Cannot narrow down search results, very high probability search returns objects user cannot access, total number of objects user can access is low enough to fit in a response High Low Low 3 or 2 D Google Drive: User has access to a lot of documents, but low percentage from total High High Low 2 E Twitter Search: Most profiles are public, and the user can access them High High High 1 or 2","s":"Summary","u":"/docs/interacting/search-with-permissions","h":"#summary","p":316},{"i":331,"t":"This section has guides, concepts and examples that help you define an authorization model. When to use The content in this section is useful: If you are starting with OpenFGA and want to learn how to represent your organization's/system's authorization needs. If you are working on iterating on an authorization model you previously defined.","s":"Modeling Guides","u":"/docs/modeling","h":"","p":330},{"i":333,"t":"Getting Started How to create an authorization model for your system starting from the requirements. Click to navigate Direct Access Learn the basics of modeling authorization and granting access to users. Click to navigate User Groups Learn to model user group membership, and to grant access to all members of a group. Click to navigate Roles and Permissions Learn to model roles for users at the object level and model permissions for those roles. Click to navigate Parent-Child objects Learn to model access based on parent-child relationships, e.g.: folders and documents. Click to navigate Block Lists Learn to model denying access if users are part of list of blocked users. Click to navigate Public Access Learn to model giving everyone specific access to an object, e.g.: everyone can read. Click to navigate Multiple Restrictions Learn to model requiring multiple privileges before granting access. Click to navigate Custom Roles Learn to model custom roles that are created by users. Click to navigate Contextual and Time-Based Authorization Learn to model and authorize when IP Address, time, and other dynamic and contextual restrictions are involved. Click to navigate Authorization Through Organization Context Learn to model and authorize when a user belongs to multiple organizations. Click to navigate Building Blocks Learn the underlying concepts/building blocks that can be used to build any model. Click to navigate Advanced Use-Cases Explore advanced use cases and patterns for authorization modeling with OpenFGA. Click to navigate Migrating Learn to migrate relations and models in a production environment. Click to navigate","s":"Content","u":"/docs/modeling","h":"","p":330},{"i":335,"t":"This section will present advanced use cases and patterns for authorization modeling with OpenFGA. When to use The content in this section is useful if you would like to follow an end-to-end tutorial on how to build an authorization model for a common use-case or pattern.","s":"Advanced Use-Cases","u":"/docs/modeling/advanced","h":"","p":334},{"i":337,"t":"Google Drive How to create an authorization model for your system starting from the requirements. Click to navigate GitHub How to create an authorization model for your system starting from the requirements. Click to navigate IoT How to create an authorization model for your system starting from the requirements. Click to navigate Slack How to create an authorization model for your system starting from the requirements. Click to navigate","s":"Use-cases","u":"/docs/modeling/advanced","h":"#use-cases","p":334},{"i":339,"t":"Entitlements How to create an authorization model for your system starting from the requirements. Click to navigate","s":"Patterns","u":"/docs/modeling/advanced","h":"#patterns","p":334},{"i":341,"t":"This section has guides that on the building blocks of authorization model. When to use The content in this section is useful: If you are starting with OpenFGA and want to learn the building blocks that can be used to build any model.","s":"Building Blocks","u":"/docs/modeling/building-blocks","h":"","p":340},{"i":343,"t":"Direct Relationships Learn to model relationships that may or may not be assigned directly to individual users. Click to navigate Concentric Relationships Learn to model nested relationships in your application. Click to navigate Object to Object Relationships Learn to model your application with objects that are not specifically tied to a user. Click to navigate Usersets Learn to model your application by assigning relationships to groups of users. Click to navigate","s":"Content","u":"/docs/modeling/building-blocks","h":"","p":340},{"i":345,"t":"In this short guide, you'll learn how to represent a concentric relationships. For example, if you want to have all editors of a document also be viewers of said document. When to use Concentric relations make the most sense when your domain logic has nested relations, where one having relation implies having another relation. For example: all editors are viewers all managers are members all device_managers are device_renamers This allows you to only create a single relationship tuple rather than creating n relationship tuples for each relation.","s":"Concentric Relationships","u":"/docs/modeling/building-blocks/concentric-relationships","h":"","p":344},{"i":347,"t":"To better understand this guide, you should be familiar with some OpenFGA Concepts and know how to develop the things listed below. You will start with the authorization model below, it represents a document type that can have users related as editor and viewer. Let us also assume that we have a document called \"meeting_notes.doc\" and bob is assigned as editor to this document. DSL JSON model schema 1.1 type user type document relations define viewer: [user] define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The current state of the system is represented by the following relationship tuples being in the system already: [ { \"user\": \"user:bob\", \"relation\": \"editor\", \"object\": \"document:meeting_notes.doc\", }, ] In addition, you will need to know the following: Modeling User Groups​ You need to know how to add users to groups and grant groups access to resources. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#before-you-start","p":344},{"i":349,"t":"You need to know how to add users to groups and grant groups access to resources. Learn more →","s":"Modeling User Groups","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#modeling-user-groups","p":344},{"i":351,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#-concepts","p":344},{"i":353,"t":"With the current type definition, there isn't a way to indicate that all editors of a certain document are also automatically viewers of that document. So for a certain user, in order to indicate that they can both edit and view a certain document, two relationship tuples need to be created (one for editor, and another for viewer).","s":"Step By Step","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#step-by-step","p":344},{"i":355,"t":"Instead of creating two relationship tuples, we can leverage concentric relationships by defining editors are viewers. Our authorization model becomes the following: DSL JSON model schema 1.1 type user type document relations define viewer: [user] or editor define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info viewer of a document are any of: users that are directly assigned as viewer users that have editor of the document With this authorization model change, having an editor relationship with a certain document implies having a viewer relationship with that same document.","s":"01. Modify Our Model To Imply Editor As Viewer","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#01-modify-our-model-to-imply-editor-as-viewer","p":344},{"i":357,"t":"Since we had a relationship tuple that indicates that bob is an editor of document:meeting_notes.doc, this means bob is now implicitly a viewer of document:meeting_notes.doc. If we now check: is bob a viewer of document:meeting_notes.doc? we would get the following: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'viewer', object: 'document:meeting_notes.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"viewer\", Object: \"document:meeting_notes.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"viewer\", Object = \"document:meeting_notes.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"viewer\", object=\"document:meeting_notes.doc\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob viewer document:meeting_notes.doc # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"viewer\",\"object\":\"document:meeting_notes.doc\"}}' # Response: {\"allowed\":true} check( user = \"user:bob\", // check if the user `user:bob` relation = \"viewer\", // has an `viewer` relation object = \"document:meeting_notes.doc\", // with the object `document:meeting_notes.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Note When creating relationship tuples for OpenFGA make sure to use unique ids for each object and user within your application domain. We're using first names and simple ids to just illustrate an easy-to-follow example.","s":"02. Check That Editors Are Viewers","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#02-check-that-editors-are-viewers","p":344},{"i":359,"t":"Check the following sections for more on how concentric relationships can be used. Modeling Google Drive See how to indicate that editors are commenters and viewers in Google Drive. More Modeling GitHub See how to indicate that repository admins are writers and readers in GitHub. More","s":"Related Sections","u":"/docs/modeling/building-blocks/concentric-relationships","h":"#related-sections","p":344},{"i":361,"t":"In this guide you'll see how to model preventing users from accessing objects using OpenFGA. For example, blocking users from accessing a document, even if it has been already shared with them. When to use Exclusion is useful while building applications. You may need to support access patterns like granting access to some users, but excluding specific people or groups, similar to how users can block others from following them on social media, or prevent them from sharing documents on Google Drive. This is useful when: Implementing the \"blocking\" feature, such as the profile blocking commonly present on social media platforms (e.g. Instagram and Twitter). Reduce a user's access if they are part of a particular group (e.g. restricting access to members who are also guests, or restricting access to users in a certain locality).","s":"Blocklists","u":"/docs/modeling/blocklists","h":"","p":360},{"i":363,"t":"Before you start this guide, make sure you're familiar with some OpenFGA Concepts and know how to develop the things listed below. You will start with the authorization model below, it represents a document type that can have users related as editor, and team type that can have users related as member. Let us also assume that we have a document called \"planning\", shared for editing within the product team (comprised of becky and carl). DSL JSON model schema 1.1 type user type document relations define editor: [user, team#member] type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The current state of the system is represented by the following relationship tuples being in the system already: [ // Members of the product team can edit the planning document { \"user\": \"team:product#member\", \"relation\": \"editor\", \"object\": \"document:planning\", }, // Becky is a member of the product team { \"user\": \"user:becky\", \"relation\": \"member\", \"object\": \"team:product\", }, // Carl is a member of the product team { \"user\": \"user:carl\", \"relation\": \"member\", \"object\": \"team:product\", }, ] In addition, you will need to know the following: Modeling User Groups​ You need to know how to add users to groups and grant groups access to resources. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Exclusion Operator: the exclusion operator can be used to exclude certain usersets from being related to an object","s":"Before You Start","u":"/docs/modeling/blocklists","h":"#before-you-start","p":360},{"i":365,"t":"You need to know how to add users to groups and grant groups access to resources. Learn more →","s":"Modeling User Groups","u":"/docs/modeling/blocklists","h":"#modeling-user-groups","p":360},{"i":367,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Exclusion Operator: the exclusion operator can be used to exclude certain usersets from being related to an object","s":"OpenFGA Concepts","u":"/docs/modeling/blocklists","h":"#-concepts","p":360},{"i":369,"t":"With the above authorization model and relationship tuples, OpenFGA will correctly respond with {\"allowed\":true} when check is called to see if Carl and Becky can edit this document. We can verify that by issuing two check requests: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'editor', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"editor\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"editor\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"editor\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky editor document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"editor\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:becky\", // check if the user `user:becky` relation = \"editor\", // has an `editor` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:carl', relation: 'editor', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:carl\", Relation: \"editor\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:carl\", Relation = \"editor\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:carl\", relation=\"editor\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl editor document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:carl\",\"relation\":\"editor\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:carl\", // check if the user `user:carl` relation = \"editor\", // has an `editor` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true We want to share a document with the product team and also have the ability to deny certain users access, even if they have the document shared with them already. We can verify this by blocking Carl (who we have seen already has edit access) from editing the document. In order to do that, we need to: Modify our model to allow indicating that users can be blocked from accessing a document Modify our model to indicate that users who are blocked can no longer edit the document Verify that our solution works: a. Indicate that Carl is blocked from the planning document b. Carl (now blocked) can no longer edit the document c. Becky still has edit access","s":"Step By Step","u":"/docs/modeling/blocklists","h":"#step-by-step","p":360},{"i":371,"t":"To allow users to be \"blocked\" from accessing a document, we first need to allow this relation. We'll update our store model to add a blocked relation to the document type. The authorization model becomes this: DSL JSON model schema 1.1 type user type document relations define blocked: [user] define editor: [user, team#member] type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"blocked\": { \"this\": {} }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"blocked\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Now we can add relationship tuples indicating that a certain user is blocked from editing a document.","s":"01. Modify Our Model So Users Can Be Blocked From Accessing A Document","u":"/docs/modeling/blocklists","h":"#01-modify-our-model-so-users-can-be-blocked-from-accessing-a-document","p":360},{"i":373,"t":"Now that we can mark users as blocked from editing documents, we need to support denying the editor relationship when a user is blocked. We do that by modifying the relation definition of editor, and making use of the the exclusion operator to exclude the set of blocked users, as we can see here: DSL JSON model schema 1.1 type user type document relations define blocked: [user] define editor: [user, team#member] but not blocked type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"blocked\": { \"this\": {} }, \"editor\": { \"difference\": { \"base\": { \"this\": {} }, \"subtract\": { \"computedUserset\": { \"relation\": \"blocked\" } } } } }, \"metadata\": { \"relations\": { \"blocked\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"02. Modify Our Model So Users Who Are Blocked Can No Longer Edit The Document","u":"/docs/modeling/blocklists","h":"#02-modify-our-model-so-users-who-are-blocked-can-no-longer-edit-the-document","p":360},{"i":375,"t":"To check if our new model works, we'll add a relationship tuple with Carl as blocked from document:planning and then verify that Carl no longer has editor access to that document. a. Indicate That Carl Is Blocked From The Planning Document​ With our modified authorization model, we can indicate that Carl is blocked by adding this relationship tuple. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Carl is blocked from editing the planning document { user: 'user:carl', relation: 'blocked', object: 'document:planning'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Carl is blocked from editing the planning document User: openfga.PtrString(\"user:carl\"), Relation: openfga.PtrString(\"blocked\"), Object: openfga.PtrString(\"document:planning\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Carl is blocked from editing the planning document new() { User = \"user:carl\", Relation = \"blocked\", Object = \"document:planning\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Carl is blocked from editing the planning document user=\"user:carl\", relation=\"blocked\", object=\"document:planning\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:carl\",\"relation\":\"blocked\",\"object\":\"document:planning\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl blocked document:planning write([ // Carl is blocked from editing the planning document { \"user\":\"user:carl\", \"relation\":\"blocked\", \"object\":\"document:planning\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") b. Carl (now blocked) Can No Longer Edit The Document​ We have modified the authorization model and added relationship tuples to indicate that Carl is blocked. Now let's make sure our solution works as expected. To check if Carl still has access to the document, we can issue a check request with Carl as the user. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:carl', relation: 'editor', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:carl\", Relation: \"editor\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:carl\", Relation = \"editor\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:carl\", relation=\"editor\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl editor document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:carl\",\"relation\":\"editor\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:carl\", // check if the user `user:carl` relation = \"editor\", // has an `editor` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false The response is false, so our solution is working as expected. c. Becky Still Has Edit Access​ To check if Becky still has access to the document, we'll issue another check request with Becky as the user. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'editor', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"editor\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"editor\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"editor\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky editor document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"editor\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:becky\", // check if the user `user:becky` relation = \"editor\", // has an `editor` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true The response is true, indicating our model change did not inadvertently deny access for users who have access but are not blocked. caution Note: When creating tuples for OpenFGA make sure to use unique ids for each object and user within your application domain. We are using first names and human-readable identifiers to make this task easier to read.","s":"03. Verify Our Solution Works","u":"/docs/modeling/blocklists","h":"#03-verify-our-solution-works","p":360},{"i":377,"t":"Check the following sections for more on how to model with OpenFGA. Modeling: Getting Started Learn about how to get started with modeling. More Configuration Language Learn about OpenFGA Configuration Language. More Public Access Learn about model public access. More","s":"Related Sections","u":"/docs/modeling/blocklists","h":"#related-sections","p":360},{"i":380,"t":"A userset represents a set or collection of users. Usersets can be used to indicate that a group of users in the system have a certain relation with an object. This can be used to assign permissions to groups of users rather than specific ones, allowing us to represent the permissions in our system using less tuples and granting us flexibility in granting or denying access in bulk. In OpenFGA, usersets are represented via this notation: object#relation, where object is made up of a type and an object identifier. For example: company:xyz#employee represents all users that are related to company:xyz as employee tweet:12345#viewer represents all users that are related to tweet:12345 as viewer","s":"What Is A Userset?","u":"/docs/modeling/building-blocks/usersets","h":"#what-is-a-userset","p":378},{"i":382,"t":"Imagine the following authorization model: DSL JSON model schema 1.1 type user type org relations define member: [user] type document relations define reader: [user, org#member] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"org\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"reader\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"org\", \"relation\": \"member\" } ] } } } } ] } Now let us assume that the store has the following tuples: [ // Userset \"Members of the xyz org\" can read the budget document { \"user\": \"org:xyz#member\", \"relation\": \"reader\", \"object\": \"document:budget\", }, // Anne is part of the userset \"Members of the xyz org\" { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"org:xyz\", }, ] If we call the check API to see if user anne has a reader relationship with document:budget, OpenFGA will check whether anne is part of the userset that does have a reader relationship. Because she is part of that userset, the request will return true: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'document:budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"document:budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"document:budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"document:budget\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader document:budget # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"document:budget\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"document:budget\", // with the object `document:budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"How Do Check Requests Work With Usersets?","u":"/docs/modeling/building-blocks/usersets","h":"#how-do-check-requests-work-with-usersets","p":378},{"i":384,"t":"Imagine the following authorization model: DSL JSON model schema 1.1 type user type document relations define writer: [user, org#member] define reader: [user, org#member] or writer { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"writer\": { \"this\": {} }, \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"org\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"org\", \"relation\": \"member\" } ] } } } } ] } If we wanted to see which users and usersets have a reader relationship with document:budget, we can call the Expand API. The response will contain a userset tree where the leaf nodes are specific user IDs and usersets. For example: { \"tree\": { \"root\": { \"type\": \"document:budget#reader\", \"union\": { \"nodes\": [ { \"type\": \"document:budget#reader\", \"leaf\": { \"users\": { \"users\": [\"user:bob\"] } } }, { \"type\": \"document:budget#reader\", \"leaf\": { \"computed\": { \"userset\": \"document:budget#writer\" } } } ] } } } } As you can see from the response above, with usersets we can express unions of user groups. We can also express intersections and exclusions.","s":"How Do Expand Requests Work With Usersets?","u":"/docs/modeling/building-blocks/usersets","h":"#how-do-expand-requests-work-with-usersets","p":378},{"i":386,"t":"Using the type definitions in the authorization model, some of the situations we can represent are: that a user is not in a set of users having a certain relation to an object, even if a relationship tuple exists in the system. See Disabling Direct Relationships that a user has a certain relationship with an object if they are in the union, intersection or exclusion of usersets. that a user being in a set of users having a certain relation to an object can result in them having another relation to the object. See Concentric Relationships that the user being in a set of users having a certain relation to an object and that object is in a set of users having a certain relation to another object, can imply that the original user has a certain relationship to the final object. See Object-to-Object Relationships When executing the Check API of the form check(user, relation, object), OpenFGA will perform the following steps: In the authorization model, look up type and its relation. Start building a tree where the root node will be the definition of that relation, which can be a union, exclusion, or intersection of usersets, or it can be direct users. Expand all the usersets involved into new nodes in the tree. This means recursively finding all the users that are members of the usersets. If there are direct relationships with users, create leaf nodes. Check whether user is a leaf node in the tree. If the API finds one match, it will return immediately and will not expand the remaining nodes.","s":"Internals","u":"/docs/modeling/building-blocks/usersets","h":"#internals","p":378},{"i":388,"t":"See the following sections for more information: Managing Group Membership How to add users to a userset More Managing Group Access How to add permissions to a userset More","s":"Related Sections","u":"/docs/modeling/building-blocks/usersets","h":"#related-sections","p":378},{"i":390,"t":"This section has guides that focus on migrating models and relations. When to use The content in this section is useful: If you want to introduce changes to your existing authorization model or upgrade it to the new schema version.","s":"Migrating","u":"/docs/modeling/migrating","h":"","p":389},{"i":392,"t":"Migrating Relations Learn to migrate relations in a production environment. Click to navigate Migrating To Schema 1.1 Learn to migrate models to schema 1.1. Click to navigate","s":"Content","u":"/docs/modeling/migrating","h":"","p":389},{"i":394,"t":"In this guide you will learn how to grant a user access to an object (such as a certain document) in OpenFGA. When to use Granting access with relationship tuple is a core part of OpenFGA. Without them, any checks will fail. You should use: authorization model to represent what relations are possible between the users and objects in the system relationship tuples to represent the facts about the relationships between users and objects in your system.","s":"Direct Access","u":"/docs/modeling/direct-access","h":"","p":393},{"i":396,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have a type called document that can have a viewer and/or an editor. DSL JSON model schema 1.1 type user type document relations define viewer: [user] define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before you start","u":"/docs/modeling/direct-access","h":"#before-you-start","p":393},{"i":398,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/modeling/direct-access","h":"#-concepts","p":393},{"i":400,"t":"For our applications to understand that user x has access to document y, we need to provide OpenFGA that information through relationship tuples. Each relationship tuple has three basic parameters, a user, a relation and an object.","s":"Step By Step","u":"/docs/modeling/direct-access","h":"#step-by-step","p":393},{"i":402,"t":"Let us add a relationship tuple to indicate that bob who is an editor of document:meeting_notes.doc. This is represented by adding the following: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:bob', relation: 'editor', object: 'document:meeting_notes.doc'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"editor\"), Object: openfga.PtrString(\"document:meeting_notes.doc\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:bob\", Relation = \"editor\", Object = \"document:meeting_notes.doc\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:bob\", relation=\"editor\", object=\"document:meeting_notes.doc\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:bob\",\"relation\":\"editor\",\"object\":\"document:meeting_notes.doc\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob editor document:meeting_notes.doc write([ { \"user\":\"user:bob\", \"relation\":\"editor\", \"object\":\"document:meeting_notes.doc\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"01. Create A Relationship Tuple","u":"/docs/modeling/direct-access","h":"#01-create-a-relationship-tuple","p":393},{"i":404,"t":"Once that relationship tuple is added to OpenFGA, we can check if the relationship is valid by asking the following: \"is bob an editor of document:meeting_notes.doc?\" Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'editor', object: 'document:meeting_notes.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"editor\", Object: \"document:meeting_notes.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"editor\", Object = \"document:meeting_notes.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"editor\", object=\"document:meeting_notes.doc\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob editor document:meeting_notes.doc # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"editor\",\"object\":\"document:meeting_notes.doc\"}}' # Response: {\"allowed\":true} check( user = \"user:bob\", // check if the user `user:bob` relation = \"editor\", // has an `editor` relation object = \"document:meeting_notes.doc\", // with the object `document:meeting_notes.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true If we were to check the following: \"is bob a viewer of document:meeting_notes.doc?\" it would return false since that relationship tuple does not exist within OpenFGA yet. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'viewer', object: 'document:meeting_notes.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"viewer\", Object: \"document:meeting_notes.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"viewer\", Object = \"document:meeting_notes.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"viewer\", object=\"document:meeting_notes.doc\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob viewer document:meeting_notes.doc # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"viewer\",\"object\":\"document:meeting_notes.doc\"}}' # Response: {\"allowed\":false} check( user = \"user:bob\", // check if the user `user:bob` relation = \"viewer\", // has an `viewer` relation object = \"document:meeting_notes.doc\", // with the object `document:meeting_notes.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false caution Note: When creating relationship tuples for OpenFGA make sure to use unique ids for each object and user within your application domain. We're using first names and simple ids to just illustrate an easy-to-follow example.","s":"02. Check That The Relationship Exists","u":"/docs/modeling/direct-access","h":"#02-check-that-the-relationship-exists","p":393},{"i":406,"t":"Check the following sections for more on how to model with OpenFGA. OpenFGA Concepts Learn about the OpenFGA Concepts. More Modeling: Getting Started Learn about how to get started with modeling. More Configuration Language Learn about OpenFGA Configuration Language. More","s":"Related Sections","u":"/docs/modeling/direct-access","h":"#related-sections","p":393},{"i":408,"t":"info The model schema v1.0 has been deprecated. Migrate to schema v1.1 in order to be able to write tuples and run queries on your store. A new DSL schema version has been introduced with several changes that we believe will make models easier to read and write, enable better tuple and model validations, and provide more options for optimizing the performance of different OpenFGA APIs. In short, we will be: Adding model schema version field Adding type restrictions and removing need to specify as self Disallowing string literals in user_ids Enforcing type restrictions Requiring you to specify for which relations you can write tuples with public access Changes in query evaluation behavior with type restrictions To facilitate migration to the new DSL schema, you will need to update tuples that are no longer valid. In particular, all tuples whose user field involves a wildcard character (* or user:*) defined with model schema 1.0 MUST be deleted and re-added back. info Before starting to migrate to the new model schema, it is recommended that you obtain your current authorization model ID and ensure that all your check, write, expand and list object are performed against that model id. This allows consistent behavior in your production system until you are ready to switch to the new model.","s":"Migrating Models To Schema 1.1","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"","p":407},{"i":410,"t":"Since the changes in the DSL are significant, we have decided to add a schema version to the DSL. The previous version of the DSL’s schema was 1.0, and the new schema version will be 1.1. To use the new syntax please add the following to the top of the model: model schema 1.1 info OpenFGA will eventually stop supporting schema version 1.0. Notifications will be posted in GitHub, Discord and Twitter before this change occurs.","s":"OpenFGA Model Schema Versions","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#-model-schema-versions","p":407},{"i":412,"t":"We’ll use the following version 1.0 model and tuples to illustrate the changes we’ll need to make: model schema 1.0 type user type group relations define member as self type folder relations define parent as self define viewer as self or viewer from parent type document relations define parent as self define viewer as self define can_read as viewer or viewer from parent [ // Bob is a member of the Sales group { \"user\": \"user:bob\", \"relation\": \"member\", \"object\": \"group:sales\", }, // The \"pricing\" document is in \"sales\" folder { \"user\": \"folder:sales\", \"relation\": \"parent\", \"object\": \"document:pricing\", }, // Members of the \"sales\" team can view the \"sales\" folder { \"user\": \"group:sales#member\", \"relation\": \"viewer\", \"object\": \"folder:sales\", }, // John can view the \"pricing\" document { \"user\": \"user:john\", \"relation\": \"viewer\", \"object\": \"document:pricing\", }, ] Those tuples match the intent of how the model was designed, but without type restrictions we can also write tuples that would not. For example, we can say that a document is a member of the sales group: [ // The \"pricing\" document is a member of the \"sales\" group { \"user\": \"document:pricing\", \"relation\": \"member\", \"object\": \"group:sales\", }, ] To be able to better validate tuples and make the model more readable, version 1.1 requires you to specify types for all the relations that were previously assignable (e.g. relations defined as self in any way), and it removes the as self keyword. The model above needs to be rewritten as: DSL JSON model schema 1.1 type user type group relations define member: [user] type folder relations define parent: [folder] define viewer: [user] or viewer from parent type document relations define parent: [folder] define viewer: [user] define can_read: viewer or viewer from parent { \"mode\": { \"schema_version\": \"1.1\" }, \"type_definitions\": [ { \"type\": \"user\", \"relations\": {} }, { \"type\": \"group\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"folder\", \"relations\": { \"parent\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"parent\": { \"this\": {} }, \"viewer\": { \"this\": {} }, \"can_read\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"can_read\": { \"directly_related_user_types\": [] } } } } ], \"schema_version\": \"1.1\" } After making these changes, OpenFGA will start validating the tuples more strictly, for example, you won’t be able to assign a document as a member of a group. If your application is writing invalid tuples, you’ll start getting errors when invoking the Write API.","s":"Type Restrictions & Removing as self","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#type-restrictions--removing-as-self","p":407},{"i":414,"t":"With version 1.0 models, you could write a tuple where the user id did not specify a type, for example: [ // \"bob\" is a member of the \"sales\" group { \"user\": \"bob\", \"relation\": \"member\", \"object\": \"group:sales\", }, ] However, with version 1.1 you always need to specify an object, so “bob’” is no longer a valid identifier. If you don’t have a type in your model that defines relations for users, you can add a ‘user’ type with no relations to your model, for example: DSL JSON model schema 1.1 type user { \"type_definitions\": [ { \"type\": \"user\", \"relations\": {} } ] } You can then use that type when writing tuples: [ // \"user:bob\" is a member of the \"sales\" group { \"user\": \"user:bob\", \"relation\": \"member\", \"object\": \"group:sales\", }, ]","s":"Disallowing String Literals in user_ids","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#disallowing-string-literals-in-user_ids","p":407},{"i":416,"t":"With the model above, the following tuples will be valid according to the type definitions: [ { \"user\": \"user:bob\", \"relation\": \"member\", \"object\": \"group:sales\", }, { \"user\": \"folder:sales\", \"relation\": \"parent\", \"object\": \"document:pricing\", }, { \"user\": \"user:john\", \"relation\": \"viewer\", \"object\": \"document:pricing\", }, ] However, the one below will not be valid, as we can’t assign group:sales#member to the viewer relationship of a folder. [ { \"user\": \"group:sales#member\", \"relation\": \"viewer\", \"object\": \"folder:sales\", }, ] You might think that given group:sales#member are actually users, you should still be able to assign it. OpenFGA calls expressions like group:sales#member \"usersets\", and with our model we can only assign users. The issue is that there are a lot of other usersets that you don't want to be assigned as viewers of a folder. For example, you would not want to add document:pricing#viewer as viewers of the folder as conceptually it does not make sense to say “every viewer of this document should be a viewer of this folder”. To allow these tuples to be written, you need to specify group#member as a valid type for the folder’s viewer relationship. You would want to do the same with the document’s viewer relationship if you want to define that the members of a group can be viewers of a document: DSL JSON model schema 1.1 type user type group relations define member: [user] type folder relations define parent: [folder] define viewer: [user, group#member] or viewer from parent type document relations define parent: [folder] define viewer: [user, group#member] define can_read: viewer or viewer from parent { \"type_definitions\": [ { \"type\": \"user\", \"relations\": {} }, { \"type\": \"group\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"folder\", \"relations\": { \"parent\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"group\", \"relation\": \"member\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"parent\": { \"this\": {} }, \"viewer\": { \"this\": {} }, \"can_read\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"parent\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"group\", \"relation\": \"member\" } ] }, \"can_read\": { \"directly_related_user_types\": [] } } } } ], \"schema_version\": \"1.1\" } You can identify which usersets you need to add by looking at tuples in your store that have the following structure: [ // Members of the \"sales\" group are viewers of the \"sales\" folder { \"user\": \"group:sales#member\", \"relation\": \"viewer\", \"object\": \"folder:sales\", }, ] If you find a tuple like that, you’ll need to add group#member in the list of types allowed in the viewer relation of the folder type.","s":"Enforcing Type Restrictions","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#enforcing-type-restrictions","p":407},{"i":418,"t":"When using version 1.0, you can indicate public access to specific objects by specifying a wildcard user in a relationship to any object, e.g.: [ // All users are viewers of the \"pricing\" document { \"user\": \"*\", \"relation\": \"viewer\", \"object\": \"document:pricing\", }, ] When you write the tuple above, all users are granted the “viewer” relationship for the “pricing\" document. You can write those kinds of tuples for any relation that is directly assignable in the model. In version 1.1 we want to be more explicit about the tuples you can write, so you’ll need to declare in the DSL which relations allow wildcards and for which object types. If we want to let any object of type “user” to be a viewer of a specific document, we’ll need to explicitly define it. DSL JSON model schema 1.1 type user type document relations define viewer: [user, user:*] { \"type_definitions\": [ { \"type\": \"user\", \"relations\": {} }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user\", \"wildcard\": {} } ] } } } } ], \"schema_version\": \"1.1\" } You’ll need to specify user:* as the user value in the tuple to enable this: [ // All objects of type \"user\" are viewers of the \"pricing\" document { \"user\": \"user:*\", \"relation\": \"viewer\", \"object\": \"document:pricing\", }, ] Being explicit about the wildcard type restrictions also lets you model scenarios like “all employees can see this document, but not all external users”, “all user accounts can access this document, but not service/machine-to-machine accounts”. This change implies that you’ll need to change your code to write tuples with this new syntax, and that you’ll need to migrate existing tuples to use the new format. You might have 3 kinds of tuples in your model that use *, with different migration strategies: Tuples that have user = * You would need to retrieve those tuples and write them using the proper type (e.g. user:*). To retrieve them, you’ll need to use the Read endpoint, filter on your side the tuples that have user = “*”, and call the Write API for each one, with the proper type, e.g: [ // All objects of type \"user\" are viewers of the \"pricing\" document { \"user\": \"user:*\", \"relation\": \"viewer\", \"object\": \"document:pricing\", }, ] Tuples that have user = employee:*, where employee is NOT a type that is defined in the new iteration of your model. If you have tuples with this format, they will be considered invalid because they don’t have a corresponding type in the model. If you need such a type defined, you’ll need to add it to the model, and the scenario will be similar to the one described below. Tuples that have user = user:*, which would mean the user with user_id = *, where user is type that is defined in the new iteration of your model. In this case, the meaning of the tuple will change. If you were intending to specify a user with user id = *, you will need to encode it in a different way instead of using *. If you intended to specify public access to the object (e.g. \"every user has this relationship with this object\"), 1.0 models will not interpret the user:* value as a wildcard but 1.1 models will. Warning If you have any wildcard tuples (i.e., * or user:*) that were created with model schema 1.0, you must delete and re-add these tuples with the appropriate type. This allows OpenFGA to interpret these tuples appropriately with the model schema 1.1 semantics. Failure to delete and re-add may cause OpenFGA to interpret these tuples incorrectly.","s":"Public Access","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#public-access","p":407},{"i":420,"t":"It is possible to introduce new models and have existing tuples (from prior models) with incompatibilities with the new model. Some cases where this can happen include: If you rename/delete a type. If you rename/delete a relation. If you remove a type restriction from the list of type restrictions for a relation, including changes for public access. If OpenFGA introduces a change that makes a tuple invalid. In these cases, OpenFGA will not consider those invalid tuples when evaluating queries (Check, Expand, List-objects, etc). However, after any of the changes above happen, you should delete those tuples as having a large number of invalid tuples will negatively affect performance.","s":"Query Evaluation Behavior with Type Restrictions","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#query-evaluation-behavior-with-type-restrictions","p":407},{"i":422,"t":"Type restrictions allow OpenFGA to validate the schema better at the time of writing the schema instead of at the time of query evaluation. In OpenFGA, when referencing relations on related objects the relation tying the related objects (the word after from, also called the tupleset) cannot be evaluated - that means it cannot be referencing another relation, or allow non-concrete types (type bound public access (:*) or usersets (#)) in its type restrictions. In schema 1.0, because type restrictions were not available, the validation error would occur at the time of evaluation (e.g. a Check call), while in schema 1.1, the error will be thrown when writing the model (during the WriteAuthorizationModel request). In the case below, the write request will fail in the new schema 1.1 version, but would have succeeded in schema version 1.0: model schema 1.1 type user type folder relations define parent: [folder,folder#parent] define editor: [user] or editor from parent /> In schema 1.0, the WriteAuthorizationModel would have succeeded, but when attempting to write a tuple such as the one below, you would have received an error: Node.js Go .NET Python curl CLI Pseudocode await fgaClient.write({ writes: [ { user: 'folder:product#parent', relation: 'parent', object: 'folder:planning'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"folder:product#parent\"), Relation: openfga.PtrString(\"parent\"), Object: openfga.PtrString(\"folder:planning\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"folder:product#parent\", Relation = \"parent\", Object = \"folder:planning\" } }, }; var response = await fgaClient.Write(body, options); options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"folder:product#parent\", relation=\"parent\", object=\"folder:planning\", ),, ), \", ) response = await fga_client.write(body, options) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"folder:product#parent\",\"relation\":\"parent\",\"object\":\"folder:planning\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw folder:product#parent parent folder:planning write([ { \"user\":\"folder:product#parent\", \"relation\":\"parent\", \"object\":\"folder:planning\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"Improved Schema Validation","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#improved-schema-validation","p":407},{"i":424,"t":"1- February 13th 2023: Deprecation Notice This deprecation notice is posted. 2- March 15th 2023: Disallow writing and evaluating new 1.0 models with OpenFGA version 0.4.0 The API will no longer accept writing new 1.0 models (affects WriteAuthorizationModel) unless the OPENFGA_ALLOW_WRITING_1_0_MODELS flag is used to override the setting. Note: reading those earlier models and their assertions will keep working. Evaluation requests (Check, Expand, ListObjects), WriteAssertions and Write against 1.0 models will, by default, no longer be accepted unless the OPENFGA_ALLOW_EVALUATING_1_0_MODELS flag is used to override the setting. ReadAuthorizationModel, ReadAuthorizationModels and ReadAssertions will continue to serve results for 1.0 and 1.1 models. 3- March 31st 2023: Default model version in Syntax Transformer, Playground and Docs switch to 1.1 The model schema version will be required in all new authorization models, and new authorization models without the version will be rejected. model schema 1.1 4- May 15th 2023: Code Removed with OpenFGA version 0.5.0 OPENFGA_ALLOW_WRITING_1_0_MODELS and OPENFGA_ALLOW_EVALUATING_1_0_MODELS flags removed The code relating to branching and evaluating 1.0 models will be removed except for ReadAuthorizationModel, ReadAuthorizationModels and ReadAssertions.","s":"Deprecation Timeline","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#deprecation-timeline","p":407},{"i":426,"t":"Review the following sections for more information on migrating tuples. Migrating Relations Learn how to migrate relations More Production Best Practices Learn the best practices of running OpenFGA in a production environment More","s":"Related Sections","u":"/docs/modeling/migrating/migrating-schema-1-1","h":"#related-sections","p":407},{"i":428,"t":"In this guide you'll learn how to model custom roles in your system using OpenFGA. For example, a Business-to-Business (B2B) application could allow customers to create their own custom roles on the application to grant their users. When to use In many cases, roles would fit in well as relations on an object type, as seen in Modeling Roles and Permissions. In some cases, however, they may not be enough. Custom roles are useful when: Users of the application are able to create arbitrary sets of roles with different permissions that govern the users' access to objects. It is not known beforehand (at the time of Authorization Model creation) what the application roles are. The team responsible for building the authorization model is different from the teams responsible for defining roles and access to the application.","s":"Custom Roles","u":"/docs/modeling/custom-roles","h":"","p":427},{"i":430,"t":"Before you start this guide, make sure you're familiar with some OpenFGA Concepts and know how to develop the things listed below. Initial Model​ To start, let's say there is an application with a type called asset-category. Users can have view and/or edit access to assets in that category. Any user who can edit can also view. We'll start with the following authorization model showing a system with an asset-category type. This type allows users to have view and edit access to it. DSL JSON model schema 1.1 type user type asset-category relations define viewer: [user] or editor define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"asset-category\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you'll need to know the following: Modeling Roles and Permissions​ You need to know how to add users to groups and grant groups access to resources. Learn more → Modeling Object-to-Object Relationships​ You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more → Concepts & Configuration Language​ OpenFGA Concepts Configuration Language","s":"Before you start","u":"/docs/modeling/custom-roles","h":"#before-you-start","p":427},{"i":432,"t":"To start, let's say there is an application with a type called asset-category. Users can have view and/or edit access to assets in that category. Any user who can edit can also view.","s":"Initial Model","u":"/docs/modeling/custom-roles","h":"#initial-model","p":427},{"i":434,"t":"You need to know how to add users to groups and grant groups access to resources. Learn more →","s":"Modeling Roles and Permissions","u":"/docs/modeling/custom-roles","h":"#modeling-roles-and-permissions","p":427},{"i":436,"t":"You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more →","s":"Modeling Object-to-Object Relationships","u":"/docs/modeling/custom-roles","h":"#modeling-object-to-object-relationships","p":427},{"i":438,"t":"OpenFGA Concepts Configuration Language","s":"Concepts & Configuration Language","u":"/docs/modeling/custom-roles","h":"#concepts--configuration-language","p":427},{"i":440,"t":"Starting with the authorization model mentioned above, we want to enable users to create their own custom roles, and tie permissions to those roles to our two users and to the permissions on the logo asset category. For this guide, we'll model a scenario where a certain organization using our app has created an asset-category called \"logos\", and another called \"text content\". The company administrator would like to create: a media-manager role that allows users to edit assets in the logos asset category a media-viewer role that allows users to view all assets in the logos asset category a blog-editor role that allows users to edit all assets in the text content asset category a blog-viewer role that allows users to view all assets in the text content asset category Imagine these are what the permissions the roles in one organization using our service are like: Finally, the administrator wants to assign Anne the media-manager role and Beth the media-viewer role. At the end, we'll verify our model by ensuring the following access check requests return the expected result. In order to do this, we need to: Update the Authorization Model to add a Role Type Use Relationship Tuples to tie the Users to the Roles Use Relationship Tuples to associate Permissions with the Roles Verify that the Authorization Model works","s":"Step By Step","u":"/docs/modeling/custom-roles","h":"#step-by-step","p":427},{"i":442,"t":"Because our roles are going to be dynamic and might change frequently, we represent them in a new type instead of as relations on that same type. We'll create new type called role, where users can be related as assignee to it. The authorization model becomes this: DSL JSON model schema 1.1 type user type asset-category relations define viewer: [user, role#assignee] or editor define editor: [user, role#assignee] type role relations define assignee: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"asset-category\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"role\", \"relation\": \"assignee\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"role\", \"relation\": \"assignee\" } ] } } } }, { \"type\": \"role\", \"relations\": { \"assignee\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"assignee\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } With this change we can add relationship tuples indicating that a certain user is assigned a certain role.","s":"01. Update The Authorization Model To Add A Role Type","u":"/docs/modeling/custom-roles","h":"#01-update-the-authorization-model-to-add-a-role-type","p":427},{"i":444,"t":"Once we've added the role type, we can assign roles to Anne and Beth. Anne is assigned the \"media-manager\" role and Beth is assigned the \"media-viewer\" role. We can do that by adding relationship tuples as follows: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is assigned the media-manager role { user: 'user:anne', relation: 'assignee', object: 'role:media-manager'}, // Beth is assigned the media-viewer role { user: 'user:beth', relation: 'assignee', object: 'role:media-viewer'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is assigned the media-manager role User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"assignee\"), Object: openfga.PtrString(\"role:media-manager\"), }, { // Beth is assigned the media-viewer role User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"assignee\"), Object: openfga.PtrString(\"role:media-viewer\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is assigned the media-manager role new() { User = \"user:anne\", Relation = \"assignee\", Object = \"role:media-manager\" }, // Beth is assigned the media-viewer role new() { User = \"user:beth\", Relation = \"assignee\", Object = \"role:media-viewer\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is assigned the media-manager role user=\"user:anne\", relation=\"assignee\", object=\"role:media-manager\", ), ClientTuple( # Beth is assigned the media-viewer role user=\"user:beth\", relation=\"assignee\", object=\"role:media-viewer\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"assignee\",\"object\":\"role:media-manager\"},{\"user\":\"user:beth\",\"relation\":\"assignee\",\"object\":\"role:media-viewer\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne assignee role:media-manager fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth assignee role:media-viewer write([ // Anne is assigned the media-manager role { \"user\":\"user:anne\", \"relation\":\"assignee\", \"object\":\"role:media-manager\" }, // Beth is assigned the media-viewer role { \"user\":\"user:beth\", \"relation\":\"assignee\", \"object\":\"role:media-viewer\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") We can verify they are members of said roles by issuing the following check requests: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'assignee', object: 'role:media-manager', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"assignee\", Object: \"role:media-manager\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"assignee\", Object = \"role:media-manager\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"assignee\", object=\"role:media-manager\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne assignee role:media-manager # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"assignee\",\"object\":\"role:media-manager\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"assignee\", // has an `assignee` relation object = \"role:media-manager\", // with the object `role:media-manager` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"02.Use Relationship Tuples To Tie The Users To The Roles","u":"/docs/modeling/custom-roles","h":"#02use-relationship-tuples-to-tie-the-users-to-the-roles","p":427},{"i":446,"t":"With our users and roles set up, we still need to tie members of a certain role to it's corresponding permission(s). Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Users assigned the media-manager role can edit in the Logos assets category { user: 'role:media-manager#assignee', relation: 'editor', object: 'asset-category:logos'}, // Users assigned the media-viewer role can view from the Logos assets category { user: 'role:media-viewer#assignee', relation: 'viewer', object: 'asset-category:logos'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Users assigned the media-manager role can edit in the Logos assets category User: openfga.PtrString(\"role:media-manager#assignee\"), Relation: openfga.PtrString(\"editor\"), Object: openfga.PtrString(\"asset-category:logos\"), }, { // Users assigned the media-viewer role can view from the Logos assets category User: openfga.PtrString(\"role:media-viewer#assignee\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"asset-category:logos\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Users assigned the media-manager role can edit in the Logos assets category new() { User = \"role:media-manager#assignee\", Relation = \"editor\", Object = \"asset-category:logos\" }, // Users assigned the media-viewer role can view from the Logos assets category new() { User = \"role:media-viewer#assignee\", Relation = \"viewer\", Object = \"asset-category:logos\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Users assigned the media-manager role can edit in the Logos assets category user=\"role:media-manager#assignee\", relation=\"editor\", object=\"asset-category:logos\", ), ClientTuple( # Users assigned the media-viewer role can view from the Logos assets category user=\"role:media-viewer#assignee\", relation=\"viewer\", object=\"asset-category:logos\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"role:media-manager#assignee\",\"relation\":\"editor\",\"object\":\"asset-category:logos\"},{\"user\":\"role:media-viewer#assignee\",\"relation\":\"viewer\",\"object\":\"asset-category:logos\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw role:media-manager#assignee editor asset-category:logos fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw role:media-viewer#assignee viewer asset-category:logos write([ // Users assigned the media-manager role can edit in the Logos assets category { \"user\":\"role:media-manager#assignee\", \"relation\":\"editor\", \"object\":\"asset-category:logos\" }, // Users assigned the media-viewer role can view from the Logos assets category { \"user\":\"role:media-viewer#assignee\", \"relation\":\"viewer\", \"object\":\"asset-category:logos\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"03. Use Relationship Tuples To Associate Permissions With The Roles","u":"/docs/modeling/custom-roles","h":"#03-use-relationship-tuples-to-associate-permissions-with-the-roles","p":427},{"i":448,"t":"To ensure our model works, it needs to match our expectations: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'editor', object: 'asset-category:logos', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"editor\", Object: \"asset-category:logos\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"editor\", Object = \"asset-category:logos\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"editor\", object=\"asset-category:logos\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne editor asset-category:logos # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"asset-category:logos\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"editor\", // has an `editor` relation object = \"asset-category:logos\", // with the object `asset-category:logos` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true The checks come back as we expect, so our model is working correctly.","s":"04. Verify That The Authorization Model Works","u":"/docs/modeling/custom-roles","h":"#04-verify-that-the-authorization-model-works","p":427},{"i":450,"t":"Check the following sections for more on how to model with OpenFGA. Modeling Roles and Permissions Learn how to remove the direct relationship to indicate nonassignable permissions. More Modeling Concepts: Object to Object Relationships Learn about how to model object to object relationships in OpenFGA. More","s":"Related Sections","u":"/docs/modeling/custom-roles","h":"#related-sections","p":427},{"i":452,"t":"In this guide we are going to model system that requires multiple authorizations before allowing users to perform actions on particular objects using OpenFGA. For example, users are allowed to delete a document if both of these conditions are met: they are a member of the organization that owns the document they have writer permissions on the document In this way, we prevent other users from deleting such document. When to use This is useful when: Limiting certain actions (such as deleting or reading sensitive document) to privileged users. Adding restrictions and requiring multiple authorization paths before granting access.","s":"Multiple Restrictions","u":"/docs/modeling/multiple-restrictions","h":"","p":451},{"i":454,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. You will start with the authorization model below, it represents a document type that can have users related as writer and organizations related as owner. Document's can_write relation is based on whether user is a writer to the document. The organization type can have users related as member. Let us also assume that we have: A document called \"planning\" owned by the ABC organization. Becky is a member of the ABC organization. Carl is a member of the XYZ organization. Becky and Carl both have writer access to the \"planning\" document. DSL JSON model schema 1.1 type user type document relations define owner: [organization] define writer: [user] define can_write: writer type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"can_write\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The current state of the system is represented by the following relationship tuples being in the system already: [ // organization ABC is the owner of planning document { \"user\": \"organization:ABC\", \"relation\": \"owner\", \"object\": \"document:planning\", }, // Becky is a writer to the planning document { \"user\": \"user:becky\", \"relation\": \"writer\", \"object\": \"document:planning\", }, // Carl is a writer to the planning document { \"user\": \"user:carl\", \"relation\": \"writer\", \"object\": \"document:planning\", }, // Becky is a member of the organization ABC { \"user\": \"user:becky\", \"relation\": \"member\", \"object\": \"organization:ABC\", }, // Carl is a member of the organization XYZ { \"user\": \"user:carl\", \"relation\": \"member\", \"object\": \"organization:XYZ\", }, ] info Note that we assign the organization, not the organization's members, as owner to the planning document. In addition, you will need to know the following: Modeling Parent-Child Objects​ You need to know how to model access based on parent-child relationships, e.g.: folders and documents. Learn more → Modeling Roles And Permissions​ You need to know how to model roles for users at the object level and model permissions for those roles. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Intersection Operator: the intersection operator can be used to indicate a relationship exists if the user is in all the sets of users","s":"Before You Start","u":"/docs/modeling/multiple-restrictions","h":"#before-you-start","p":451},{"i":456,"t":"You need to know how to model access based on parent-child relationships, e.g.: folders and documents. Learn more →","s":"Modeling Parent-Child Objects","u":"/docs/modeling/multiple-restrictions","h":"#modeling-parent-child-objects","p":451},{"i":458,"t":"You need to know how to model roles for users at the object level and model permissions for those roles. Learn more →","s":"Modeling Roles And Permissions","u":"/docs/modeling/multiple-restrictions","h":"#modeling-roles-and-permissions","p":451},{"i":460,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Intersection Operator: the intersection operator can be used to indicate a relationship exists if the user is in all the sets of users","s":"OpenFGA Concepts","u":"/docs/modeling/multiple-restrictions","h":"#-concepts","p":451},{"i":462,"t":"With the above authorization model and relationship tuples, OpenFGA will correctly respond with {\"allowed\":true} when checkis called to see if Carl and Becky can write this document. We can verify that by issuing two check requests: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'can_write', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"can_write\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"can_write\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"can_write\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky can_write document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"can_write\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:becky\", // check if the user `user:becky` relation = \"can_write\", // has an `can_write` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:carl', relation: 'can_write', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:carl\", Relation: \"can_write\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:carl\", Relation = \"can_write\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:carl\", relation=\"can_write\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl can_write document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:carl\",\"relation\":\"can_write\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:carl\", // check if the user `user:carl` relation = \"can_write\", // has an `can_write` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true What we would like to do is offer a way so that a document can be written by Becky and Carl, but only writers who are also members of the organization that owns the document can remove it. To do this, we need to: Add can_delete relation to only allow writers that are members of the ownership organization Verify that our solutions work","s":"Step By Step","u":"/docs/modeling/multiple-restrictions","h":"#step-by-step","p":451},{"i":464,"t":"The first step is to add the relation definition for can_delete so that it requires users to be both writer and member of the owner. This is accomplished via the keyword and. DSL JSON model schema 1.1 type user type document relations define owner: [organization] define writer: [user] define can_write: writer define can_delete: writer and member from owner type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"can_write\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, \"can_delete\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"owner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"member\" } } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"01. Add can_delete Relation To Only Allow Writers That Are Members Of The Ownership Organization","u":"/docs/modeling/multiple-restrictions","h":"#01-add-can_delete-relation-to-only-allow-writers-that-are-members-of-the-ownership-organization","p":451},{"i":466,"t":"To verify that our solutions work, we need to check that Becky can delete the planning document because she is a writer AND she is a member of organization:ABC that owns the planning document. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'can_delete', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"can_delete\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"can_delete\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"can_delete\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky can_delete document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"can_delete\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:becky\", // check if the user `user:becky` relation = \"can_delete\", // has an `can_delete` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true However, Carl cannot delete the planning document because although he is a writer, Carl is not a member of organization:ABC that owns the planning document. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:carl', relation: 'can_delete', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:carl\", Relation: \"can_delete\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:carl\", Relation = \"can_delete\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:carl\", relation=\"can_delete\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl can_delete document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:carl\",\"relation\":\"can_delete\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:carl\", // check if the user `user:carl` relation = \"can_delete\", // has an `can_delete` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"02. Verify That Our Solutions Work","u":"/docs/modeling/multiple-restrictions","h":"#02-verify-that-our-solutions-work","p":451},{"i":468,"t":"Check the following sections for more on how to model privileged access. Modeling: User Groups Learn about how to add group members. More Modeling: Blocklists Learn about how to set block lists. More Modeling: Public Access Learn about model public access. More","s":"Related Sections","u":"/docs/modeling/multiple-restrictions","h":"#related-sections","p":451},{"i":470,"t":"Creating a Relationship Based Access Control (ReBAC) authorization model might feel odd at first. Most of us tend to think about authorization models in terms of roles and permissions. After all, most software works like that. Your existing systems are likely built on a model using roles and permissions. This guide outlines a process for defining your authorization model with OpenFGA.","s":"Get Started with Modeling","u":"/docs/modeling/getting-started","h":"","p":469},{"i":472,"t":"To define a ReBAC model in OpenFGA we recommend: If you have an existing system: forget about how your system works today and start thinking about how you want it to work in the future. Thinking about authorization starting from the resources, or objects as OpenFGA calls them. If that sounds hard, don't worry! We'll guide you through it. authorization checks ReBAC systems determine access from a user's relation to an object. Authorization decisions are then yes or no answers to the question: \"Does user U have relation R with object O?\". General Authorization Check \"Can user U perform an action A on object O?\" OpenFGA (ReBAC) Authorization Check \"Does user U have relation R with object O?\" In the previous example, a relation R should be defined that implies permission to action A. For example: General Authorization Check \"Can user Jane perform action view on object project sandcastle?\" OpenFGA (ReBAC) Authorization Check \"Can user Jane have relation view with object project sandcastle?\" We'll provide more detailed examples throughout this article. When you are modeling, you need to answer a more general question: Why could user U perform an action A on an object O? If you can answer that question for all types of objects in your system, then you can codify that into an authorization model. Let's get started!","s":"Introduction To Modeling","u":"/docs/modeling/getting-started","h":"#introduction-to-modeling","p":469},{"i":474,"t":"Defining an authorization model requires codifying an answer to the question \"why could user U perform an action A on an object O?\" for all use cases or actions in your system. This is an iterative process. For the purpose of this guide, we'll go through one iteration of this process using a simplified Google Drive like system as an example. Steps for defining your authorization model: Pick the most important feature List the object types List relations for those types Define relations Test the model Iterate","s":"A Process For Defining Authorization Models","u":"/docs/modeling/getting-started","h":"#a-process-for-defining-authorization-models","p":469},{"i":476,"t":"A feature, in the context of this document, is an action or related set of actions your users can perform in your system. We'll introduce an example feature later in this section. Start with the most important feature. It doesn't have to be the most complex one, but it should be the most important one. You're probably more familiar with the authorization requirements for this feature than other less important use cases. Important Requirement clarity is fundamental when defining an authorization model. The scope of the feature is not important at this point. You can always iterate later. Write It In Plain Language​ Once you've picked a feature, describe its authorization related scope using simple language. Avoid using the word \"roles\", as this ties you to an RBAC way of thinking. info Roles don't \"disappear\" in ReBAC systems like OpenFGA. Your users might have roles on a given object, rather than the entire system. But starting from the term \"role\" might lead you down the wrong path. Instead it is better to discover roles while you are modeling. Your feature description should include the objects, users and groups of users participating in the system. Sentences should look like this: A user {user} can perform action {action} to/on/in {object types} ... IF {conditions} This feature can be described with these sentences: A user can create a document in a drive if they are the owner of the drive. A user can create a folder in a drive if they are the owner of the drive. A user can create a document in a folder if they are the owner of the folder. The folder is the parent of the document. A user can create a folder in a folder if they are the owner of the folder. The existing folder is the parent of the new folder. A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document. A user can share a folder with another user or an organization as a viewer if they are an owner of the folder. A user can view a document if they are an owner, viewer or editor of the document or if they are a viewer or owner of the folder/drive that is the parent of the document. A user can edit a document if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document. A user can change the owner of a document if they are an owner of the document. A user can change the owner of a folder if they are an owner of the folder. A user can be a member of an organization. How a user is added as a member to an organization is beyond the scope of the feature we picked to write down. A user can view a folder if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder.","s":"01. Pick The Most Important Feature","u":"/docs/modeling/getting-started","h":"#01-pick-the-most-important-feature","p":469},{"i":478,"t":"Next make a list of the types of objects in your system. You might be able to identify the objects in your system from your existing domain/database model. Find all the objects in the previous step using this template: A user {user} can perform action {action} to/on/in {object type} ... IF {conditions} These are all the object types from the previous step (in order of appearance) based on that template: Document Folder Organization Let's highlight all object types in blue: A user can create a document in a drive if they are the owner of the drive. A user can create a folder in a drive if they are the owner of the drive. A user can create a document in a folder if they are the owner of the folder. A user can create a folder in a folder if they are the owner of the folder. A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document. A user can share a folder with another user or an organization as a viewer if they are an owner of the folder. A user can view a document if they are an owner, viewer or editor of the document or if they are a viewer, owner of the folder/drive that is the parent of the document. A user can edit a document if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document. A user can change the owner of a document if they are an owner of the document. A user can change the owner of a folder if they are an owner of the folder. A user can be a member of an organization. How a user is added as a member to an organization is beyond the scope of the feature we picked to write down. A user can view a folder if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder. However, the list of object types is not finished. To complete the list of object types you must also add all the second nouns that appear in conditions as part of expressions of this format: \"{first noun} of a/the {second noun}\". ... IF {first noun} of a/the {second noun} Let's highlight those expressions in green: A user can create a document in a drive if they are the owner of the drive. A user can create a folder in a drive if they are the owner of the drive. A user can create a document in a folder if they are the owner of the folder. The folder is the parent of the document. A user can create a folder in a folder if they are the owner of the folder. The existing folder is the parent of the new folder . A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document. A user can share a folder with another user or an organization as a viewer if they are an owner of the folder. A user can view a document if they are an owner, viewer or editor of the document or if they are a viewer or owner of the folder/drive that is the parent of the document. A user can edit a document if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document. A user can change the owner of a document if they are an owner of the document. A user can change the owner of a folder if they are an owner of the folder. A user can be a member of an organization. How a user is added as a member to an organization is beyond the scope of the feature we picked to write down. A user can view a folder if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder. The only second noun we didn't have in our object type list is \"Drive\", so we'll add it to the list. We will also need to add \"User\" to the list as it establishes the type of user who can establish relations. User Document Folder Organization Drive Now that we have a list of object types we can start defining them using the OpenFGA Configuration Language: model schema 1.1 type user type document type folder type organization type drive Caution You're now in the process of building a version you can use. The model above is not yet a valid authorization model accepted by OpenFGA. Important In a few cases other users can be part of determining whether an action can be performed on an action or not. Social media is an example of this \"a user can comment on a picture if they are a friend of the user that published it\". In those cases User should also be an object type. Following the last recommendation, we would discover the User type because it is a second noun in an expression: \"friend of the user\".","s":"02. List The Object Types","u":"/docs/modeling/getting-started","h":"#02-list-the-object-types","p":469},{"i":480,"t":"Each of the previously defined types has a set of relations. Relations are an important component in your model. After all, OpenFGA is a Relationship Based Access Control (ReBAC) system. To identify relations for a type we in the write-up we can perform an exercise similar to the one we did in list the type of objects in your system. Relations for a type {type} will be all of these: any noun that is the {noun} of a \"{noun} of a/an/the {type}\" expression. These are typically the Foreign Keys in a database. We'll highlight these in green. any verb or action that is the {action} of a \"can {action} (in) a/an {type}\" expression. These are typically the permissions for a type. We'll highlight these in yellow. A user can create a document in a drive if they are the owner of the drive. A user can create a folder in a drive if they are the owner of the drive. A user can create a document in a folder if they are the owner of the folder. The folder is the parent of the document. A user can create a folder in a folder if they are the owner of the folder. The existing folder is the parent of the new folder. A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder/drive that is the parent of the document. A user can share a folder with another user or an organization as a viewer if they are an owner of the folder. A user can view a document if they are an owner, viewer or editor of the document or if they are a viewer or owner of the folder/drive that is the parent of the document. A user can edit a document if they are an owner or editor of the document or if they are an owner of the folder/drive that is the parent of the document. A user can change the owner of a document if they are an owner of the document. A user can change the owner of a folder if they are an owner of the folder. A user can be a member of an organization. How a user is added as a member to an organization is beyond the scope of the feature we picked to write down. A user can view a folder if they are the owner of the folder, or a viewer or owner of either the parent folder of the folder, or the parent drive of the folder. The resulting list is: Document parent can_share owner editor can_write can_view viewer can_change_owner Folder can_create_document owner can_create_folder can_view viewer parent Organization member Drive can_create_document owner can_create_folder info In OpenFGA, relations can only have alphanumeric characters, underscores and hyphens. We recommend using underscore (_) to separate words and removing prepositions. E.g.: \"can create a document\" can become \"can_create_document\" or \"create_document\" if you are into brevity. Using the OpenFGA Configuration Language we can enumerate the relations for each type: model schema 1.1 type user type document relations define parent: define owner: define editor: define viewer: define can_share: define can_view: define can_write: define can_change_owner: type folder relations define owner: define parent: define viewer: define can_create_folder: define can_create_document: define can_view: type organization relations define member: type drive relations define owner: define can_create_document: define can_create_folder: Caution You're now in the process of building a version you can use. The model above is not yet a valid authorization model accepted by OpenFGA.","s":"03. List Relations For Those Types","u":"/docs/modeling/getting-started","h":"#03-list-relations-for-those-types","p":469},{"i":482,"t":"We will use the OpenFGA Configuration Language to create a relation definition for each of the relations we identified. At this stage we will encode the answers to the question we asked at the beginning of the document:. Why could a user U, perform an action A on an object O? We are going to go over each type and each of its relations and create a definition for it. Type: Organization​ We recommend starting from objects that represent groups/containers of users. For features in most systems these are easy to define and help reason about the other types. Examples of type names for these are \"team\", \"group\", \"organization\", etc. Relation: Member​ The member relation is used to tell OpenFGA about the members of an organization. Important Relation names in OpenFGA are arbitrary strings. There are no reserved relation names. You can use \"member\" or \"part_of\" or anything else to refer to a user that is part of a team/organization. Remember \"How a user is added as a member to an organization is beyond the scope of this feature.\" For the purposes of this model the relation definition should be: type organization relations define member: [user, organization#member] Why? This relation definition states: That organizations have members That the members of an organization with id {id} are all users described by tuples of the form: { user: {user-id}, relation: \"member\", object: \"organization:{id}\" } Important Relation definitions of the form “define {relation}: [user, organization#member]\" are fairly common. They are used to express that relationships \"to the object with that relation\" (e.g. \"users\" of type user or \"member of organization\") can be assigned by your system and that only the users that have that relation are those with a direct relationship. You can read more about group membership and types in Modeling User Groups. For the direct relationships, we need to figure out the object types that makes sense for the relationship tuples' user. In our organization example, it makes sense for member relations to have user of type user organization#member (i.e., other organization's member) However, it will not make sense for organization member's user to be of type document, folder or drive. We will specify this logic as part of directly directly related user type. Side note This also automatically supports nested organizational membership if you want such a feature in your system. You could use relationship tuples like the following one to express that \"members of organization A are members of organization B\": { user: \"organization:A#member\", relation: \"member\", object: \"organization:B\"} If you want to learn more, you can read further about this in Modeling User Groups and Managing Relationships Between Objects. Complete Type Definition​ The complete type definition for the organization type is: type organization relations define member: [user, organization#member] Type: Document​ After defining your \"group\" like types, continue with the most important type for the feature: the one that allows the main use case. In this case \"document\", since the main use case for users is to create, write, read and collaborate on documents. Defining relations for the main type lets you to focus on your core use case, and will likely make other type definitions easier. Relation: Owner​ The owner relation is used to tell OpenFGA which users are owners of the document. Important In the current version, there is no way to state that there is only one owner in the authorization model. The application must limit this set of users to just one owner if that is a requirement. When a document is created, a relationship tuple will be stored in OpenFGA representing this relationship between owner and document. This is an example of a user to object relationship. The relation definition then should be: type document relations define owner: [user, organization#member] Why? This relation definition states that: each document can have one or more owners owners of a document are assignable by creating a tuple of the format { user: \"{user_id}\", relation: \"owner\", object: \"document:{id}\" } for individual users Relation: Editor​ The editor relation is used to tell OpenFGA which users are editors of the document. When a user shares a document with another user or set of users as editor, a relationship tuple will be stored in OpenFGA representing this relationship between editor and document. This is an example of a users to object relationship. The relation definition then should be: type document relations define editor: [user, organization#member] Why? This relation definition states that: each document can have editors the editor(s) of a document are assignable by creating a tuple with shape { user: \"{user_id}\", relation: \"editor\", object: \"document:{id}\" } for individual users This also supports making all members in an organization editors of the document, through a group to object relationship. A relationship tuple like the following one states that the members of organization A are editors of document 0001. [ { \"user\": \"organization:A#member\", \"relation\": \"editor\", \"object\": \"document:0001\", }, ] You can learn more about this in Modeling User Groups. Relation: Viewer​ The viewer relation is similar to the document's editor relation. It will be defined like this: type document relations define viewer: [user, organization#member] Relation: Parent​ The parent relation is used to tell OpenFGA which folder or drive is the parent of the document. Important Relation names in OpenFGA are arbitrary strings. There are no reserved relation names. You can use \"parent\", \"container\" or \"ancestor\" to refer to a \"parent folder\". This relation is different from the others we have seen so far, as it is a relation between two objects (a folder and or drive that is the parent of the document). This is known as an object to object relationship, of which parent-child is a particular case. When a document is created a relationship tuple will be stored in OpenFGA to represent this relationship between parent and document. The relation definition then should be: type document relations define parent: [folder, drive] Why? This relation definition states that: documents may have a parent the parent(s) of a document with id {id} is either a folder or a drive, described by one of these relationship tuples: { user: \"folder:{id}\", relation: \"parent\", object: \"document:{id}\" } { user: \"drive:{id}\", relation: \"parent\", object: \"document:{id}\" } We can use direct type restriction to ensure a document's parent can only be an object of type either drive or folder. Side note You might have noticed that the \"user\" in the tuple is an object. This is a special syntax OpenFGA accepts in the \"user\" parameter to write object to object relationships. You can read more about writing data to manage object to object relationships in Managing Relationships Between Objects. Relation: can_share​ We need to express the following in the relation definition: A user can share a document with another user or an organization as either editor or viewer if they are an owner or editor of a document or if they are an owner of the folder that is the parent of the document. We can achieve that with the following definition using OpenFGA Configuration Language: type document relations define can_share: owner or editor or owner from parent There are a few key things here: We don't use a direct relationship type restriction as part of the definition. can_share is a common example of representing a permission that is defined in terms of other relations but is not directly assignable by the system. The relation definition contains a union operator separating a list of relations that the user must have with the object in order to \"be able to share the document\". It is any of: Being an owner of the document Being an editor of the document Being an owner of the parent of the document. Whether the parent is a drive or a folder is not important, as they both have an owner relation. You can read more about the aforementioned items in Modeling Roles and Permissions. Relation: can_view​ We need to express the following in the relation definition: A user can view a document if they are an owner, viewer or editor of a document or if they are a viewer, owner of the folder/drive that is the parent of the document. Similar to the can_share relation, we can achieve that with the following definition using OpenFGA Configuration Language: type document relations define can_view: viewer or editor or owner or viewer from parent or owner from parent Relation: can_write​ We need to express the following in the relation definition: A user can write a document if they are an owner or editor of a document or if they are an owner or editor of the folder/drive that is the parent of the document. Similar to the can_share relation, we can achieve that with the following definition using OpenFGA Configuration Language: type document relations define can_write: editor or owner or owner from parent Relation: can_change_owner​ We need to express the following in the relation definition: A user can change the owner of a document if they are an owner of the document. Similar to the can_share relation, we can achieve that with the following definition using OpenFGA Configuration Language: type document relations define can_change_owner: owner Complete Type Definition​ The complete type definition for the document type is: model schema 1.1 type document relations define owner: [user, organization#member] define editor: [user, organization#member] define viewer: [user, organization#member] define parent: [folder] define can_share: owner or editor or owner from parent define can_view: viewer or editor or owner or viewer from parent or editor from parent or owner from parent define can_write: editor or owner or owner from parent define can_change_owner: owner Combining the type definitions for document and organization, we have model schema 1.1 type user type organization relations define member: [user, organization#member] type document relations define owner: [user, organization#member] define editor: [user, organization#member] define viewer: [user, organization#member] define parent: [folder] define can_share: owner or editor or owner from parent define can_view: viewer or editor or owner or viewer from parent or editor from parent or owner from parent define can_write: editor or owner or owner from parent define can_change_owner: owner note The OpenFGA authorization model API and SDK only accepts JSON in its input. To convert from DSL to JSON, you may use the FGA CLI to run fga model transform.","s":"04. Define Relations","u":"/docs/modeling/getting-started","h":"#04-define-relations","p":469},{"i":484,"t":"Once you have defined your group like types and the most important type for your feature you want to ensure everything is working as expected. This means testing the model. How? Remember from the introduction that OpenFGA's main job is to answer the question: Can user U, perform an action A on an object O? The OpenFGA service does that by checking if a user has a particular relationship to an object, based on your authorization model and relationship tuples. General Authorization Check \"Can user U perform action A on object O?\" OpenFGA (ReBAC) Authorization Check \"Can user U have relation R with object O?\" What we want is to ensure that given our current authorization model and some sample relationship tuples, we get the expected results for those questions. So we'll write some relationship tuples and assertions. An OpenFGA assertion takes one of these forms: user U has relation R with object O user U does not have relation R with object O Much like automated tests and assertions work for programming languages, you can use assertions to prevent regressions while you change your tuples and authorization model. Essentially, assertions help you ensure things work like you expect them to work as you iterate. Write Relationship Tuples​ The relationship tuples should represent real examples from your system with fake data. At this point you haven't defined the drive or folder types, so you can only test things based on users or organization members' relationships to documents. Let's imagine an example setup and write the relationship tuples for it: System Action Relationship Tuple Anne is a member of the contoso organization { user:\"user:anne\", relation: \"member\", object: \"organization:contoso\"} Beth is a member of fabrikam organization { user:\"user:beth\", relation: \"member\", object: \"organization:fabrikam\"} Anne creates document:1, becomes its owner. { user:\"user:anne\", relation: \"owner\", object: \"document:1\"} Anne shares document:1 with all members of the fabrikam organization as editor. { user:\"organization:fabrikam#member\", relation: \"editor\", object: \"document:1\"} Beth creates document:2 and becomes its owner. { user:\"user:beth\", relation: \"owner\", object: \"document:2\"} Beth shares document:2 with all members of the contoso organization as viewer { user:\"organization:contoso#member\", relation: \"viewer\", object: \"document:2\"} Follow these steps to create relationship tuples. Create Assertions​ According to our written down model and the relationship tuples from the previous step, these assertions should be specified: Because anne is the owner of document:1: user anne has relation can_share with document:1 user anne has relation can_write with document:1 user anne has relation can_view with document:1 user anne has relation can_change_owner with document:1 Because beth is a member of organization:fabrikam and members of organization:fabrikam are writer of document:1: user beth does not have relation can_share with document:1 user beth has relation can_write with document:1 user beth has relation can_view with document:1 user beth does not have relation can_change_owner with document:1 Because beth is the owner of document:2: user beth has relation can_share with document:2 user beth has relation can_write with document:2 user beth has relation can_view with document:2 user beth has relation can_change_owner with document:2 Because anne is a member of organization:contoso and members of organization:contoso are viewer of document:2: user anne does not have relation can_share with document:2 user anne does not have relation can_write with document:2 user anne has relation can_view with document:2 user anne does not have relation can_change_owner with document:2 Follow these steps to create assertions. Run Assertions​ Run the assertions. They should all pass. If they don't you can use the query view to understand what is causing them to fail, and then update your authorization model and relation tuples accordingly. Once all the assertions are working, you should continue the iterative process of working on your model.","s":"05. Test The Model","u":"/docs/modeling/getting-started","h":"#05-test-the-model","p":469},{"i":486,"t":"We'll leave the exercise of defining the drive and folder relations, then adding relationship tuples and assertions to you. Once you are finished, check out the complete example to see how you did. When defining the authorization model for your own system, you would continue iterating on the authorization model with the next feature and so on. If you have any questions about this model or others, or would like some help creating your model, drop by our Discord.","s":"06. Iterate","u":"/docs/modeling/getting-started","h":"#06-iterate","p":469},{"i":488,"t":"Check the following sections for more on how to model with OpenFGA. OpenFGA Concepts Learn about the OpenFGA Concepts. More Configuration Language Learn about OpenFGA Configuration Language. More Direct Access Learn about modeling user access to an object. More","s":"Related Sections","u":"/docs/modeling/getting-started","h":"#related-sections","p":469},{"i":490,"t":"In this guide you will learn how to indicate relationships between objects, and how users' relationships to one object can affect their relationship with another. For example: how a editor of a folder can be an editor of all documents the folder is a parent of. When to use Object-to-Object relationships, combined with a configured authorization model can be used to indicate that a user's relation with one object can influence their relationship with another object. This can also be used in some cases to remove the need to modify relations between objects using user groups. Object-to-object relationships can be used: To indicate that managers of an employee have access to approve requests the employee has made To indicate that users who have a repository admin role (repo_admin) in an organization automatically have admin access to all repositories in that organization To indicate that users who are subscribed to a plan, get access to all the features in that plan","s":"Parent-Child Objects","u":"/docs/modeling/parent-child","h":"","p":489},{"i":492,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have two types: folder that users can be related to as an editor document that users can be related to as an editor DSL JSON model schema 1.1 type user type folder relations define editor: [user] type document relations define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"folder\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Union Operator: the union operator can be used to indicate that the user has multiple ways of being related to an object","s":"Before You Start","u":"/docs/modeling/parent-child","h":"#before-you-start","p":489},{"i":494,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/modeling/parent-child","h":"#direct-access","p":489},{"i":496,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Union Operator: the union operator can be used to indicate that the user has multiple ways of being related to an object","s":"OpenFGA Concepts","u":"/docs/modeling/parent-child","h":"#-concepts","p":489},{"i":498,"t":"We would like to model folders that contain documents and that a user having editor access to the folder, has editor access to all documents in that folder. For editors of a folder to be editors of a containing document, we need to: Update the authorization model to allow a parent relationship between folder and document Update the editor relation in the document type definition to support cascading from folder and then to indicate and verify that bob is an editor of document:meeting_notes.doc because bob is an editor of folder:notes, we then need to: Create a new relationship tuple to indicate that bob is a editor of folder:notes Create a new relationship tuple to indicate that folder:notes is a parent of document:meeting_notes.doc Check to see if bob is an editor of document:meeting_notes.doc","s":"Step By Step","u":"/docs/modeling/parent-child","h":"#step-by-step","p":489},{"i":500,"t":"To allow a parent relation between a folder and a document, we need to update the authorization model to be the following (this is to allow creating relationship tuples that can indicate a relationship between folder and document. Refer to Modeling Concepts: Object to Object Relationships to understand why): DSL JSON model schema 1.1 type user type folder relations define editor: [user] type document relations define parent: [folder] define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"folder\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"parent\": { \"this\": {} }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Notice that the document type now has a parent relation, indicating that other objects can be parents of documents","s":"01. Update The Authorization Model To Allow A Parent Relationship Between Folder And Document","u":"/docs/modeling/parent-child","h":"#01-update-the-authorization-model-to-allow-a-parent-relationship-between-folder-and-document","p":489},{"i":502,"t":"To allow cascading relations between folder and document, we can update our authorization model as the following: DSL JSON model schema 1.1 type user type folder relations define editor: [user] type document relations define parent: [folder] define editor: [user] or editor from parent { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"folder\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"document\", \"relations\": { \"parent\": { \"this\": {} }, \"editor\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"parent\" }, \"computedUserset\": { \"relation\": \"editor\" } } } ] } } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info editor of a document are any of: users that are directly assigned as editors users that are related to any parent of this document as editor (editors of the parent) So with this change, anyone related to a folder that is a parent of a document as an editor is also an editor of said document.","s":"02. Update The Editor Relation In The Document Type Definition To Support Cascading From Folder","u":"/docs/modeling/parent-child","h":"#02-update-the-editor-relation-in-the-document-type-definition-to-support-cascading-from-folder","p":489},{"i":504,"t":"To leverage our cascading relation, we need to create a relationship tuple that states: bob is an editor of folder:notes Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:bob', relation: 'editor', object: 'folder:notes'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"editor\"), Object: openfga.PtrString(\"folder:notes\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:bob\", Relation = \"editor\", Object = \"folder:notes\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:bob\", relation=\"editor\", object=\"folder:notes\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:bob\",\"relation\":\"editor\",\"object\":\"folder:notes\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob editor folder:notes write([ { \"user\":\"user:bob\", \"relation\":\"editor\", \"object\":\"folder:notes\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") caution Note: Make sure to use unique ids for each object and user within your application domain when creating relationship tuples for OpenFGA. We are using first names and simple ids to illustrate an easy-to-follow example.","s":"03. Create A New Relationship Tuple To Indicate That bob Is An Editor Of folder:notes","u":"/docs/modeling/parent-child","h":"#03-create-a-new-relationship-tuple-to-indicate-that-bob-is-an-editor-of-foldernotes","p":489},{"i":506,"t":"Now that bob is an editor of folder:notes, we need to indicate that folder:notes is a parent of document:meeting_notes.doc Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // the notes folder is a parent of the meeting notes document { user: 'folder:notes', relation: 'parent', object: 'document:meeting_notes.doc'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // the notes folder is a parent of the meeting notes document User: openfga.PtrString(\"folder:notes\"), Relation: openfga.PtrString(\"parent\"), Object: openfga.PtrString(\"document:meeting_notes.doc\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // the notes folder is a parent of the meeting notes document new() { User = \"folder:notes\", Relation = \"parent\", Object = \"document:meeting_notes.doc\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # the notes folder is a parent of the meeting notes document user=\"folder:notes\", relation=\"parent\", object=\"document:meeting_notes.doc\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"folder:notes\",\"relation\":\"parent\",\"object\":\"document:meeting_notes.doc\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw folder:notes parent document:meeting_notes.doc write([ // the notes folder is a parent of the meeting notes document { \"user\":\"folder:notes\", \"relation\":\"parent\", \"object\":\"document:meeting_notes.doc\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"04. Create A New Relationship Tuple To Indicate That folder:notes Is A Parent Of document:meeting_notes.doc","u":"/docs/modeling/parent-child","h":"#04-create-a-new-relationship-tuple-to-indicate-that-foldernotes-is-a-parent-of-documentmeeting_notesdoc","p":489},{"i":508,"t":"Now that we have done the changes to the authorization model and the addition of the two new relationship tuples, we can verify if our configuration is correct by running the following check: is bob an editor of document:meeting_notes.doc. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'editor', object: 'document:meeting_notes.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"editor\", Object: \"document:meeting_notes.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"editor\", Object = \"document:meeting_notes.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"editor\", object=\"document:meeting_notes.doc\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob editor document:meeting_notes.doc # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"editor\",\"object\":\"document:meeting_notes.doc\"}}' # Response: {\"allowed\":true} check( user = \"user:bob\", // check if the user `user:bob` relation = \"editor\", // has an `editor` relation object = \"document:meeting_notes.doc\", // with the object `document:meeting_notes.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Note: There are no other relationship tuples within the store that dictate any direct relation between bob and document:meeting_notes.doc. The check succeeds because of the cascading relation applied. The chain of resolution becomes: bob is an editor of folder:notes folder:notes is a parent of document:meeting_notes.doc editors of any parent folder of document:meeting_notes.doc are also editors of the document Therefore, bob is an editor of document:meeting_notes.doc caution Note that when searching tuples that are related to the object (the word after from, also called the tupleset), OpenFGA will not do any evaluation and will only consider concrete objects (of the form :) that were directly assigned, and will throw an error if it encounters any rewrites, or a *, a type bound public access (:*) or a userset (:#). See Referencing Relations on Related Objects for more.","s":"05. Check To See If bob Is An Editor Of document:meeting_notes.doc","u":"/docs/modeling/parent-child","h":"#05-check-to-see-if-bob-is-an-editor-of-documentmeeting_notesdoc","p":489},{"i":510,"t":"Check the following sections for more on how to model for parent and child objects. Modeling Concepts: Object to Object Relationships Learn about how to model object to object relationships in OpenFGA. More Modeling Google Drive See how to make folders parents of documents, and to make editors on the parent folders editors on documents inside them.. More Modeling GitHub See how to grant users access to all repositories owned by an organization. More","s":"Related Sections","u":"/docs/modeling/parent-child","h":"#related-sections","p":489},{"i":512,"t":"In this guide you will learn how to grant public access to an object, such as a certain document, using type bound public access. When to use Public access allows your application to grant every user in the system access to an object. You would add a relationship tuple with type-bound public access when: sharing a document publicly to indicate that everyone can view it a public poll is created to indicate that anyone can vote on it a blog post is published and anyone should be able to read it a video is made public for anyone to watch","s":"Public Access","u":"/docs/modeling/public-access","h":"","p":511},{"i":514,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have a type called document that can have a view relation. DSL JSON model schema 1.1 type user type document relations define view: [user, user:*] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"view\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"view\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user\", \"wildcard\": {} } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA A Type Bound Public Access: is a special OpenFGA concept (represented by :*) can be used in relationship tuples to represent every object of that type caution Make sure to use unique ids for each object and user within your application domain when creating relationship tuples for OpenFGA. We are using first names and simple ids to just illustrate an easy-to-follow example.","s":"Before You Start","u":"/docs/modeling/public-access","h":"#before-you-start","p":511},{"i":516,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/modeling/public-access","h":"#direct-access","p":511},{"i":518,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA A Type Bound Public Access: is a special OpenFGA concept (represented by :*) can be used in relationship tuples to represent every object of that type","s":"OpenFGA Concepts","u":"/docs/modeling/public-access","h":"#-concepts","p":511},{"i":520,"t":"In previous guides, we have shown how to indicate that objects are related to users or objects. In some cases, you might want to indicate that everyone is related to an object (for example when sharing a document publicly).","s":"Step By Step","u":"/docs/modeling/public-access","h":"#step-by-step","p":511},{"i":522,"t":"To do this we need to create a relationship tuple using the type bound public access. The type bound public access syntax is used to indicate that all users of a particular type have a relation to a specific object. Let us create a relationship tuple that states: any user can view document:company-psa.doc Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // user:* denotes every object of type user { user: 'user:*', relation: 'view', object: 'document:company-psa.doc'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // user:* denotes every object of type user User: openfga.PtrString(\"user:*\"), Relation: openfga.PtrString(\"view\"), Object: openfga.PtrString(\"document:company-psa.doc\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // user:* denotes every object of type user new() { User = \"user:*\", Relation = \"view\", Object = \"document:company-psa.doc\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # user:* denotes every object of type user user=\"user:*\", relation=\"view\", object=\"document:company-psa.doc\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:*\",\"relation\":\"view\",\"object\":\"document:company-psa.doc\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:* view document:company-psa.doc write([ // user:* denotes every object of type user { \"user\":\"user:*\", \"relation\":\"view\", \"object\":\"document:company-psa.doc\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Wildcard syntax usage Please note that type-bound public access is not a wildcard or a regex expression. You cannot use the :* syntax in the tuple's object field. The following syntax is invalid: [ // It is invalid to use this syntax in the object field. The below relationship tuple is invalid and does not mean that Bob can view all documents. { \"user\": \"user:bob\", \"relation\": \"view\", \"object\": \"document:*\", }, ] Wildcard syntax usage You cannot use :* as part of a userset in the tuple's user field. The following syntax is invalid: [ // It is invalid to use this syntax as part of a userset. The below relationship tuple is invalid and does not mean that members of any org can view the company-psa document. { \"user\": \"org:*#member\", \"relation\": \"view\", \"object\": \"document:company-psa.doc\", }, ]","s":"01. Create A Relationship Tuple","u":"/docs/modeling/public-access","h":"#01-create-a-relationship-tuple","p":511},{"i":524,"t":"Once the above relationship tuple is added, we can check if bob cab view document:company-psa.doc. OpenFGA will return { \"allowed\": true } even though no relationship tuple linking bob to the document was added. That is because the relationship tuple with user:* as the user made it so every object of type user (such as user:bob) can view the document, making it public. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'view', object: 'document:company-psa.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"view\", Object: \"document:company-psa.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"view\", Object = \"document:company-psa.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"view\", object=\"document:company-psa.doc\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob view document:company-psa.doc # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"view\",\"object\":\"document:company-psa.doc\"}}' # Response: {\"allowed\":true} check( user = \"user:bob\", // check if the user `user:bob` relation = \"view\", // has an `view` relation object = \"document:company-psa.doc\", // with the object `document:company-psa.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"02. Check That The Relationship Exists","u":"/docs/modeling/public-access","h":"#02-check-that-the-relationship-exists","p":511},{"i":526,"t":"Check the following sections for more on how to model with OpenFGA. Modeling: Getting Started Learn about how to get started with modeling. More Configuration Language Learn about OpenFGA Configuration Language. More Modeling Blocklists Learn about model block lists. More","s":"Related Sections","u":"/docs/modeling/public-access","h":"#related-sections","p":511},{"i":528,"t":"In this guide you will learn how to add users to groups and grant groups access to an object using OpenFGA. When to use Adding a relationship tuple specifying that a group has a relation to an object is helpful in cases where you want to encompass a set of users with the same relation to an object. For example: Grant a group of engineers viewer access to roadmap.doc Create a block_list of members who can't access a document Sharing a document with a team Granting viewer access to a photo to followers only Making a file viewable for all users within an organization Restricting access from or to users in a certain locale","s":"User Groups","u":"/docs/modeling/user-groups","h":"","p":527},{"i":530,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have an object called document that users can be related to as an editor. DSL JSON model schema 1.1 type user type document relations define editor: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before you start","u":"/docs/modeling/user-groups","h":"#before-you-start","p":527},{"i":532,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/modeling/user-groups","h":"#direct-access","p":527},{"i":534,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/modeling/user-groups","h":"#-concepts","p":527},{"i":536,"t":"As we develop our application, we might encounter use cases where a group of users have a certain role or permission on an object. For example, members of a certain team might have an editor relation to a certain document. In order to represent this in OpenFGA, we need: Introduce the concept of a team to the authorization model Add users as members to the team Assign the team members a relation to an object Checking an individual member's access to the object","s":"Step By Step","u":"/docs/modeling/user-groups","h":"#step-by-step","p":527},{"i":538,"t":"We need to define the object team in our authorization model. In our use case, a team can have members, so we make the following changes to our authorization model: DSL JSON model schema 1.1 type user type document relations define editor: [team#member] type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"01. Introduce The Concept Of A Team To The Authorization Model","u":"/docs/modeling/user-groups","h":"#01-introduce-the-concept-of-a-team-to-the-authorization-model","p":527},{"i":540,"t":"We can now assign users as members of teams. Let's create a new relationship tuple that states alice is a member of team:writers. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:alice', relation: 'member', object: 'team:writers'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:alice\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"team:writers\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:alice\", Relation = \"member\", Object = \"team:writers\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:alice\", relation=\"member\", object=\"team:writers\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:alice\",\"relation\":\"member\",\"object\":\"team:writers\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice member team:writers write([ { \"user\":\"user:alice\", \"relation\":\"member\", \"object\":\"team:writers\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"02. Add Users As Members To The Team","u":"/docs/modeling/user-groups","h":"#02-add-users-as-members-to-the-team","p":527},{"i":542,"t":"To represent groups we use the type:object_id#relation format, which represents the set of users related to the type:object_id as a certain relation. For example, team:writers#members is used to represent the set of users related to the team:writers object as members. In order to assign members of a team a relation to a document, we can create the following relationship tuple that states that members of team:writers are editors of document:meeting_notes.doc. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Set of users related to 'team:writers' as 'member' { user: 'team:writers#member', relation: 'editor', object: 'document:meeting_notes.doc'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Set of users related to 'team:writers' as 'member' User: openfga.PtrString(\"team:writers#member\"), Relation: openfga.PtrString(\"editor\"), Object: openfga.PtrString(\"document:meeting_notes.doc\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Set of users related to 'team:writers' as 'member' new() { User = \"team:writers#member\", Relation = \"editor\", Object = \"document:meeting_notes.doc\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Set of users related to 'team:writers' as 'member' user=\"team:writers#member\", relation=\"editor\", object=\"document:meeting_notes.doc\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"team:writers#member\",\"relation\":\"editor\",\"object\":\"document:meeting_notes.doc\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw team:writers#member editor document:meeting_notes.doc write([ // Set of users related to 'team:writers' as 'member' { \"user\":\"team:writers#member\", \"relation\":\"editor\", \"object\":\"document:meeting_notes.doc\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"03. Assign The Team Members A Relation To An Object","u":"/docs/modeling/user-groups","h":"#03-assign-the-team-members-a-relation-to-an-object","p":527},{"i":544,"t":"Now that we have: a relationship tuple indicating that alice is an member of team:writers a relationship tuple indicating that members of team:writers are editors of document:meeting_notes.doc This means that if we *check*is alice an editor of document:meeting_notes.doc? We would get the following: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:alice', relation: 'editor', object: 'document:meeting_notes.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:alice\", Relation: \"editor\", Object: \"document:meeting_notes.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:alice\", Relation = \"editor\", Object = \"document:meeting_notes.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:alice\", relation=\"editor\", object=\"document:meeting_notes.doc\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice editor document:meeting_notes.doc # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:alice\",\"relation\":\"editor\",\"object\":\"document:meeting_notes.doc\"}}' # Response: {\"allowed\":true} check( user = \"user:alice\", // check if the user `user:alice` relation = \"editor\", // has an `editor` relation object = \"document:meeting_notes.doc\", // with the object `document:meeting_notes.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true The chain of resolution becomes: alice is member of team:writers members of team:writers are editors of document:meeting_notes therefore, alice is editor of document:meeting_notes caution Note: When creating relationship tuples for OpenFGA make sure to use unique ids for each object and user within your application domain. We're using first names and simple ids to just illustrate an easy-to-follow example.","s":"04. Checking An Individual Member's Access To An Object","u":"/docs/modeling/user-groups","h":"#04-checking-an-individual-members-access-to-an-object","p":527},{"i":546,"t":"Check the following sections for more on how user groups can be used. Managing Group Membership Learn how to add and remove users from groups More Modeling Google Drive See how User Groups can be used to share documents within a domain in the Google Drive use-case. More Modeling GitHub Granting teams permissions to a repo in the GitHub use-case. More","s":"Related Sections","u":"/docs/modeling/user-groups","h":"#related-sections","p":527},{"i":548,"t":"In this guide you will learn how to model roles and permissions model within OpenFGA using the authorization model and relationship tuple. Roles are assigned to users or a group of users, where any user can have more than one role (editor, owner, etc..). Permissions are what allows users to access certain objects based on their specific roles (device_renamer, channel_archiver, etc..). For example, the role viewer of a trip can have permissions to view bookings or the role owners can have permissions to add/view bookings to a trip. When to use When trying to create a role and permissions model within OpenFGA.: Create roles by creating relations that can be directly assigned to users Assign permissions by creating relations that users get through other relations For example: Grant someone an admin role that can edit and read a document Grant someone a security_guard role that can live_video_viewer on a device Grant someone a viewer role that can view_products on a shop There are advantages to implementing roles and permissions within OpenFGA, such as: Breaking down existing roles to have more fine grained permissions. This allows your application to check whether a user has access to a certain object without having to explicitly check that specific users role. Introduce new roles/permissions or consolidate roles without affecting your application behavior. For example: if in your app all the checks are for the fine permissions check('bob', 'booking_adder', 'trip:Europe') instead of check('bob', 'owner', 'trip:Europe'), and then you later decide owners can no longer add bookings to a trip, you can remove the relation within the trip type with no code changes in your application, and all the permissions will automatically honor the change.","s":"Roles and Permissions","u":"/docs/modeling/roles-and-permissions","h":"","p":547},{"i":550,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have a type called trip that users can be related to as viewer and/or an owner. DSL JSON model schema 1.1 type user type trip relations define owner: [user] define viewer: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"trip\", \"relations\": { \"owner\": { \"this\": {} }, \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in Auth OpenFGA A Relationship: OpenFGA will be called to check if there is a relationship between a user and an object, indicating that the access is allowed Direct Relationship Type Restrictions: can be used to indicate direct relationships between users and objects A Check API Request the Check API Request is used to check for relationships between users and objects","s":"Before you start","u":"/docs/modeling/roles-and-permissions","h":"#before-you-start","p":547},{"i":552,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/modeling/roles-and-permissions","h":"#direct-access","p":547},{"i":554,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in Auth OpenFGA A Relationship: OpenFGA will be called to check if there is a relationship between a user and an object, indicating that the access is allowed Direct Relationship Type Restrictions: can be used to indicate direct relationships between users and objects A Check API Request the Check API Request is used to check for relationships between users and objects","s":"OpenFGA Concepts","u":"/docs/modeling/roles-and-permissions","h":"#-concepts","p":547},{"i":556,"t":"To illustrate modeling Roles and Permissions in OpenFGA, we will use a trip booking system where you can have owners and/or viewers that can have more granular permissions such as adding bookings to a trip or viewing bookings on it. In order to represent this, we need to: Understand how roles are related to direct relations for our trip booking system Adding implied relations to existing authorization model to define permissions for bookings Checking user roles and their permissions based on *relationship tuples* for direct and implied relations","s":"Step By Step","u":"/docs/modeling/roles-and-permissions","h":"#step-by-step","p":547},{"i":558,"t":"Relating roles within OpenFGA can be best described as the following: Roles are relations that can be directly assigned to users. Looking at our authorization model, our roles would then be owner and viewer. Meaning that a specific user can be an owner and/or a viewer. DSL JSON model schema 1.1 type user type trip relations define owner: [user] define viewer: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"trip\", \"relations\": { \"owner\": { \"this\": {} }, \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"01. Understand How Roles Work Within Our Trip Booking System","u":"/docs/modeling/roles-and-permissions","h":"#01-understand-how-roles-work-within-our-trip-booking-system","p":547},{"i":560,"t":"Permissions within OpenFGA can be best described as the following: Permissions are relations that users get only through other relations. To represent permissions, we avoid adding a direct relationship type restriction to the relation in the authorization model. Instead, we define the relation from other relations to indicate that it is a permission granted to and implied from a different relation. To add permissions related to bookings, we can add new relations to the trip object type denoting the various actions a user can take on trips (view, edit, delete, rename, etc...) To allow viewers of a trip to have permissions to view bookings and owners to have permissions to add/view bookings, we would modify the type as the following: DSL JSON model schema 1.1 type user type trip relations define owner: [user] define viewer: [user] define booking_adder: owner define booking_viewer: viewer or owner { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"trip\", \"relations\": { \"owner\": { \"this\": {} }, \"viewer\": { \"this\": {} }, \"booking_adder\": { \"computedUserset\": { \"relation\": \"owner\" } }, \"booking_viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"relation\": \"viewer\" } }, { \"computedUserset\": { \"relation\": \"owner\" } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Note: notice how both booking_viewer and booking_adder don't have direct relationship type restrictions. This is to ensure that the relation can only be assigned through the role and not directly.","s":"02. Adding Permissions For Bookings","u":"/docs/modeling/roles-and-permissions","h":"#02-adding-permissions-for-bookings","p":547},{"i":562,"t":"Now that our type definitions reflects the roles and permissions on how bookings can be viewed/added. Let's create relationship tuples to assign roles to users and then check if users have the proper permissions. Let us create two relationship tuples: that gives bob the role of viewer on trip: Europe. that gives alice the role of owner on trip: Europe. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Add bob as viewer on trip:Europe { user: 'user:bob', relation: 'viewer', object: 'trip:Europe'}, // Add alice as owner on trip:Europe { user: 'user:alice', relation: 'owner', object: 'trip:Europe'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Add bob as viewer on trip:Europe User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"trip:Europe\"), }, { // Add alice as owner on trip:Europe User: openfga.PtrString(\"user:alice\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"trip:Europe\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Add bob as viewer on trip:Europe new() { User = \"user:bob\", Relation = \"viewer\", Object = \"trip:Europe\" }, // Add alice as owner on trip:Europe new() { User = \"user:alice\", Relation = \"owner\", Object = \"trip:Europe\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Add bob as viewer on trip:Europe user=\"user:bob\", relation=\"viewer\", object=\"trip:Europe\", ), ClientTuple( # Add alice as owner on trip:Europe user=\"user:alice\", relation=\"owner\", object=\"trip:Europe\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:bob\",\"relation\":\"viewer\",\"object\":\"trip:Europe\"},{\"user\":\"user:alice\",\"relation\":\"owner\",\"object\":\"trip:Europe\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob viewer trip:Europe fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice owner trip:Europe write([ // Add bob as viewer on trip:Europe { \"user\":\"user:bob\", \"relation\":\"viewer\", \"object\":\"trip:Europe\" }, // Add alice as owner on trip:Europe { \"user\":\"user:alice\", \"relation\":\"owner\", \"object\":\"trip:Europe\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Now we can check: is bob allowed to view bookings on trip Europe? Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'booking_viewer', object: 'trip:Europe', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"booking_viewer\", Object: \"trip:Europe\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"booking_viewer\", Object = \"trip:Europe\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"booking_viewer\", object=\"trip:Europe\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob booking_viewer trip:Europe # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"booking_viewer\",\"object\":\"trip:Europe\"}}' # Response: {\"allowed\":true} check( user = \"user:bob\", // check if the user `user:bob` relation = \"booking_viewer\", // has an `booking_viewer` relation object = \"trip:Europe\", // with the object `trip:Europe` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true bob is a booking_viewer because of the following chain of resolution: bob is a viewer on trip: Europe Any user related to the object trip:Europe as viewer is also related as a booking_viewer (i.e usersRelatedToObjectAs: viewer) Therefore, all viewers on a given trip are booking_viewers To confirm that bob is not allowed to add bookings on trip Europe, we can do the following check: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'booking_adder', object: 'trip:Europe', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"booking_adder\", Object: \"trip:Europe\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"booking_adder\", Object = \"trip:Europe\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"booking_adder\", object=\"trip:Europe\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob booking_adder trip:Europe # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"booking_adder\",\"object\":\"trip:Europe\"}}' # Response: {\"allowed\":false} check( user = \"user:bob\", // check if the user `user:bob` relation = \"booking_adder\", // has an `booking_adder` relation object = \"trip:Europe\", // with the object `trip:Europe` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false We can also check: is alice allowed to view and add bookings on trip Europe? Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:alice', relation: 'booking_viewer', object: 'trip:Europe', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:alice\", Relation: \"booking_viewer\", Object: \"trip:Europe\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:alice\", Relation = \"booking_viewer\", Object = \"trip:Europe\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:alice\", relation=\"booking_viewer\", object=\"trip:Europe\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice booking_viewer trip:Europe # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:alice\",\"relation\":\"booking_viewer\",\"object\":\"trip:Europe\"}}' # Response: {\"allowed\":true} check( user = \"user:alice\", // check if the user `user:alice` relation = \"booking_viewer\", // has an `booking_viewer` relation object = \"trip:Europe\", // with the object `trip:Europe` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:alice', relation: 'booking_adder', object: 'trip:Europe', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:alice\", Relation: \"booking_adder\", Object: \"trip:Europe\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:alice\", Relation = \"booking_adder\", Object = \"trip:Europe\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:alice\", relation=\"booking_adder\", object=\"trip:Europe\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:alice booking_adder trip:Europe # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:alice\",\"relation\":\"booking_adder\",\"object\":\"trip:Europe\"}}' # Response: {\"allowed\":true} check( user = \"user:alice\", // check if the user `user:alice` relation = \"booking_adder\", // has an `booking_adder` relation object = \"trip:Europe\", // with the object `trip:Europe` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true alice is a booking_viewer and booking_adder because of the following chain of resolution: alice is a owner on trip: Europe Any user related to the object trip:Europe as owner is also related as a booking_viewer Any user related to the object trip:Europe as owner is also related as a booking_adder Therefore, all owners on a given trip are booking_viewers and booking_adders on that trip caution Note: Make sure to use unique ids for each object and user within your application domain when creating relationship tuples for OpenFGA. We are using first names and simple ids to just illustrate an easy-to-follow example.","s":"03. Checking User Roles And Their Permissions","u":"/docs/modeling/roles-and-permissions","h":"#03-checking-user-roles-and-their-permissions","p":547},{"i":564,"t":"Check the following sections for more on how to model for roles and permissions. Modeling Concepts: Concentric Relationships Learn about how to represent a concentric relationships in OpenFGA. More Modeling Google Drive See how to indicate that editors are commenters and viewers in Google Drive. More Modeling GitHub See how to indicate that repository admins are writers and readers in GitHub. More","s":"Related Sections","u":"/docs/modeling/roles-and-permissions","h":"#related-sections","p":547},{"i":566,"t":"In this guide you will learn how to grant a user access to a particular object through a relationship with another object. When to use Giving user access through a relationship with another object is helpful because it allows scaling as the number of object grows. For example: organization that owns many repos team that administers many documents","s":"Managing Relationships Between Objects","u":"/docs/interacting/managing-relationships-between-objects","h":"","p":565},{"i":568,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model a repo type that can have a admin relation DSL JSON model schema 1.1 type user type repo relations define admin: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before you start","u":"/docs/interacting/managing-relationships-between-objects","h":"#before-you-start","p":565},{"i":570,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/interacting/managing-relationships-between-objects","h":"#direct-access","p":565},{"i":572,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/interacting/managing-relationships-between-objects","h":"#-concepts","p":565},{"i":574,"t":"For the current model, a user can be related as an admin to an object of type repo. If we wanted to have Anne be related to two repos, repo:1 and repo:2, we would have to add two relationship tuples, like so: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'admin', object: 'repo:1'}, { user: 'user:anne', relation: 'admin', object: 'repo:2'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"admin\"), Object: openfga.PtrString(\"repo:1\"), }, { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"admin\"), Object: openfga.PtrString(\"repo:2\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"admin\", Object = \"repo:1\" }, new() { User = \"user:anne\", Relation = \"admin\", Object = \"repo:2\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"admin\", object=\"repo:1\", ), ClientTuple( user=\"user:anne\", relation=\"admin\", object=\"repo:2\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"admin\",\"object\":\"repo:1\"},{\"user\":\"user:anne\",\"relation\":\"admin\",\"object\":\"repo:2\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne admin repo:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne admin repo:2 write([ { \"user\":\"user:anne\", \"relation\":\"admin\", \"object\":\"repo:1\" }, { \"user\":\"user:anne\", \"relation\":\"admin\", \"object\":\"repo:2\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") In general, every time we wanted to add a new admin relationship to a repo we'd have to add a new tuple. This doesn't scale as the list of repos and users grows.","s":"Step By Step","u":"/docs/interacting/managing-relationships-between-objects","h":"#step-by-step","p":565},{"i":576,"t":"Another way of modeling this is to have an authorization model as follows: DSL JSON model schema 1.1 type user type repo relations define admin: [user] or repo_admin from owner define owner: [org] type org relations define repo_admin: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"admin\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"owner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"repo_admin\" } } } ] } }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"org\" } ] }, \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"org\", \"relations\": { \"repo_admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"repo_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In this model, we have: added a new type org with one relation repo_admin. added a new relation owner for type repo. re-defined the relation admin for repo. A user can be defined as an admin directly, as we have seen above, or through the repo_admin from owner clause. How this works, for example, is that if user is related as repo_admin to org:xyz, and org:xyz is related as owner to repo:1, then user is an admin of repo:1.","s":"01. Modify Authorization Model","u":"/docs/interacting/managing-relationships-between-objects","h":"#01-modify-authorization-model","p":565},{"i":578,"t":"With this model, we can add tuples representing that an org is the owner of a repo. By adding following relationship tuples, we are indicating that the xyz organization is the owner of repositories with IDs 1 and 2: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'org:xyz', relation: 'owner', object: 'repo:1'}, { user: 'org:xyz', relation: 'owner', object: 'repo:2'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"org:xyz\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"repo:1\"), }, { User: openfga.PtrString(\"org:xyz\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"repo:2\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"org:xyz\", Relation = \"owner\", Object = \"repo:1\" }, new() { User = \"org:xyz\", Relation = \"owner\", Object = \"repo:2\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"org:xyz\", relation=\"owner\", object=\"repo:1\", ), ClientTuple( user=\"org:xyz\", relation=\"owner\", object=\"repo:2\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"org:xyz\",\"relation\":\"owner\",\"object\":\"repo:1\"},{\"user\":\"org:xyz\",\"relation\":\"owner\",\"object\":\"repo:2\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw org:xyz owner repo:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw org:xyz owner repo:2 write([ { \"user\":\"org:xyz\", \"relation\":\"owner\", \"object\":\"repo:1\" }, { \"user\":\"org:xyz\", \"relation\":\"owner\", \"object\":\"repo:2\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"02. Adding Relationship Tuples Where User Is Another Object","u":"/docs/interacting/managing-relationships-between-objects","h":"#02-adding-relationship-tuples-where-user-is-another-object","p":565},{"i":580,"t":"Now, imagine we have a new user Becky. If we wanted to have Becky be the admin of all repos without having to add one tuple per repo, all we need to do is add one tuple that says that Becky is related as repo_admin to org:xyz. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:becky', relation: 'repo_admin', object: 'org:xyz'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:becky\"), Relation: openfga.PtrString(\"repo_admin\"), Object: openfga.PtrString(\"org:xyz\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:becky\", Relation = \"repo_admin\", Object = \"org:xyz\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:becky\", relation=\"repo_admin\", object=\"org:xyz\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:becky\",\"relation\":\"repo_admin\",\"object\":\"org:xyz\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky repo_admin org:xyz write([ { \"user\":\"user:becky\", \"relation\":\"repo_admin\", \"object\":\"org:xyz\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"03. Adding Relationship Tuples To The Other Object","u":"/docs/interacting/managing-relationships-between-objects","h":"#03-adding-relationship-tuples-to-the-other-object","p":565},{"i":582,"t":"We can now verify that Becky an admin of all the repos owned by org:xyz: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'admin', object: 'repo:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"admin\", Object: \"repo:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"admin\", Object = \"repo:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"admin\", object=\"repo:1\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky admin repo:1 # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"admin\",\"object\":\"repo:1\"}}' # Response: {\"allowed\":true} check( user = \"user:becky\", // check if the user `user:becky` relation = \"admin\", // has an `admin` relation object = \"repo:1\", // with the object `repo:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'admin', object: 'repo:2', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"admin\", Object: \"repo:2\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"admin\", Object = \"repo:2\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"admin\", object=\"repo:2\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky admin repo:2 # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"admin\",\"object\":\"repo:2\"}}' # Response: {\"allowed\":true} check( user = \"user:becky\", // check if the user `user:becky` relation = \"admin\", // has an `admin` relation object = \"repo:2\", // with the object `repo:2` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"04. Validating User Access","u":"/docs/interacting/managing-relationships-between-objects","h":"#04-validating-user-access","p":565},{"i":584,"t":"Suppose now that we want to prevent users from being an admin of repo:1 via org:xyz. We can delete one tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ { user: 'org:xyz', relation: 'owner', object: 'repo:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { User: openfga.PtrString(\"org:xyz\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"repo:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { new() { User = \"org:xyz\", Relation = \"owner\", Object = \"repo:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( user=\"org:xyz\", relation=\"owner\", object=\"repo:1\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"org:xyz\",\"relation\":\"owner\",\"object\":\"repo:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} org:xyz owner repo:1 delete([ { \"user\":\"org:xyz\", \"relation\":\"owner\", \"object\":\"repo:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") With this change, we may now verify that Becky is no longer an admin of repo:1. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:becky', relation: 'admin', object: 'repo:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:becky\", Relation: \"admin\", Object: \"repo:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:becky\", Relation = \"admin\", Object = \"repo:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:becky\", relation=\"admin\", object=\"repo:1\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:becky admin repo:1 # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:becky\",\"relation\":\"admin\",\"object\":\"repo:1\"}}' # Response: {\"allowed\":false} check( user = \"user:becky\", // check if the user `user:becky` relation = \"admin\", // has an `admin` relation object = \"repo:1\", // with the object `repo:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"05. Revoking Access","u":"/docs/interacting/managing-relationships-between-objects","h":"#05-revoking-access","p":565},{"i":586,"t":"Check the following sections for more on how to model relationships between objects. Modeling Parent-Child Objects Learn about how to cascade relationships from parent object to child object. More Modeling Object to Object Relationships Learn about modeling patterns on objects that are not specifically tied to a user. More Modeling GitHub An example of object to object relationships. More","s":"Related Sections","u":"/docs/interacting/managing-relationships-between-objects","h":"#related-sections","p":565},{"i":588,"t":"In this guide you will learn the uses of and limitations for the Check, Read, Expand, and ListObjects API endpoints.","s":"Relationship Queries: Check, Read, Expand, and ListObjects","u":"/docs/interacting/relationship-queries","h":"","p":587},{"i":590,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA Concepts and know how to develop the things that we will list below. Assume that you have the following authorization model. You have a type called document that can have a reader and writer. All writers are readers. bob has a writer relationship with document:planning. DSL JSON model schema 1.1 type user type document relations define writer: [user] define reader: [user] or writer { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"writer\": { \"this\": {} }, \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } ] } } }, \"metadata\": { \"relations\": { \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } [ // Bob has writer relationship with planning document { \"user\": \"user:bob\", \"relation\": \"writer\", \"object\": \"document:planning\", }, ] In addition, you will need to know the following: Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/interacting/relationship-queries","h":"#before-you-start","p":587},{"i":592,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/interacting/relationship-queries","h":"#direct-access","p":587},{"i":594,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/interacting/relationship-queries","h":"#-concepts","p":587},{"i":597,"t":"The Check API is an API endpoint that returns whether the user has a certain relationship with an object. OpenFGA will resolve all prerequisite relationships to establish whether a relationship exists.","s":"What Is It For?","u":"/docs/interacting/relationship-queries","h":"#what-is-it-for","p":587},{"i":599,"t":"Check can be called if you need to establish whether a particular user has a specific relationship with a particular object. For example, you can call check to determine whether bob has a reader relationship with document:planning. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bob', relation: 'reader', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bob\", Relation: \"reader\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bob\", Relation = \"reader\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bob\", relation=\"reader\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob reader document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"reader\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:bob\", // check if the user `user:bob` relation = \"reader\", // has an `reader` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true The OpenFGA API will return true because there is an implied relationship as every writer is also a reader bob is a writer for document:planning","s":"When To Use?","u":"/docs/interacting/relationship-queries","h":"#when-to-use","p":587},{"i":601,"t":"Check is designed to answer the question \"Does user:X have relationship Y with object:Z?\". It is not designed to answer the following questions: \"Who has relationship Y with object:Z?\" \"What are the objects that userX has relationship Y with?\" \"Why does user:X have relationship Y with object:Z?\"","s":"Caveats And When Not To Use It","u":"/docs/interacting/relationship-queries","h":"#caveats-and-when-not-to-use-it","p":587},{"i":604,"t":"The Read API is an API endpoint that returns the relationship tuples that are stored in the system that satisfy a query.","s":"What Is It For?","u":"/docs/interacting/relationship-queries","h":"#what-is-it-for-1","p":587},{"i":606,"t":"Read can be called if you need to get all the stored relationship tuples that relate: a particular user to any objects of a specific type with a particular relation a particular user to any objects of a specific type with any relation a particular object to any user with a particular relation 1. A Particular User To Any Objects Of A Specific Type With A Particular Relation​ For example, to query all the stored relationship tuples bob has a writer relationship with, one can ask Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Execute a read const { tuples } = await fgaClient.read({ user:'user:bob', relation:'writer', object:'document:', }); // tuples = [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientReadOptions{} body := ClientReadRequest{ User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"document:\"), } data, err := fgaClient.Read(context.Background()).Body(requestBody).Options(options).Execute() // data = { \"tuples\": [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientReadOptions {} var body = new ClientReadRequest() { User = \"user:bob\", Relation = \"writer\", Object = \"document:\", }; var response = await fgaClient.Read(body, options); // data = { \"tuples\": [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = {} body = TupleKey( user=\"user:bob\", relation=\"writer\", object=\"document:\", ) response = await fga_client.read(body, options) # response = ReadResponse({\"tuples\":[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple read --store-id=${FGA_STORE_ID} --user user:bob --relation writer --object document: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:\"}}' # Response: \"tuples\": {[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]} read( // read all stored tuples \"user:bob\", // where user `user:bob` has $(opts.relation ? '': 'any ' )relation \"writer\", // `writer` \"document:\", // with the type `document:` ); Reply: tuples:[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] 2. A Particular User To Any Objects Of A Specific Type With Any Relation​ For example, to query all the stored relationship tuples in which bob is related to objects of type document as any relation, one can issue the following call: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Execute a read const { tuples } = await fgaClient.read({ user:'user:bob', object:'document:', }); // tuples = [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientReadOptions{} body := ClientReadRequest{ User: openfga.PtrString(\"user:bob\"), Object: openfga.PtrString(\"document:\"), } data, err := fgaClient.Read(context.Background()).Body(requestBody).Options(options).Execute() // data = { \"tuples\": [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientReadOptions {} var body = new ClientReadRequest() { User = \"user:bob\", Object = \"document:\", }; var response = await fgaClient.Read(body, options); // data = { \"tuples\": [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = {} body = TupleKey( user=\"user:bob\", object=\"document:\", ) response = await fga_client.read(body, options) # response = ReadResponse({\"tuples\":[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple read --store-id=${FGA_STORE_ID} --user user:bob --object document: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"tuple_key\":{\"user\":\"user:bob\",\"object\":\"document:\"}}' # Response: \"tuples\": {[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]} read( // read all stored tuples \"user:bob\", // where user `user:bob` has $(opts.relation ? '': 'any ' )relation \"document:\", // with the type `document:` ); Reply: tuples:[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] 3. A Particular Object To Any User With A Particular Relation​ For example, to query all the stored relationship tuples in which any user is related to document:planning as a writer, one can issue the following call: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Execute a read const { tuples } = await fgaClient.read({ relation:'writer', object:'document:planning', }); // tuples = [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientReadOptions{} body := ClientReadRequest{ Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"document:planning\"), } data, err := fgaClient.Read(context.Background()).Body(requestBody).Options(options).Execute() // data = { \"tuples\": [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientReadOptions {} var body = new ClientReadRequest() { Relation = \"writer\", Object = \"document:planning\", }; var response = await fgaClient.Read(body, options); // data = { \"tuples\": [{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = {} body = TupleKey( relation=\"writer\", object=\"document:planning\", ) response = await fga_client.read(body, options) # response = ReadResponse({\"tuples\":[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple read --store-id=${FGA_STORE_ID} --relation writer --object document:planning Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"tuple_key\":{\"relation\":\"writer\",\"object\":\"document:planning\"}}' # Response: \"tuples\": {[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]} read( // read all stored tuples // for users who have relation \"writer\", // `writer` \"document:planning\", // with the object `document:planning` ); Reply: tuples:[{\"key\": {\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]","s":"When To Use?","u":"/docs/interacting/relationship-queries","h":"#when-to-use-1","p":587},{"i":608,"t":"The Read API will only return all the stored relationships that match the query specification. It does not expand or traverse the graph by taking the authorization model into account. For example, if you specify that writers are viewers in the authorization model, the Read API will ignore that and it will return tuples where a user is a viewer if and only if the (user_id, \"viewer\", object_type:object_id) relationship tuple exists in the system. In the following case, although all writers have reader relationships for document objects and bob is a writer for document:planning, if you query for all objects that bob has reader relationships, it will not return document:planning. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Execute a read const { tuples } = await fgaClient.read({ user:'user:bob', relation:'reader', object:'document:', }); // tuples = [] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientReadOptions{} body := ClientReadRequest{ User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"reader\"), Object: openfga.PtrString(\"document:\"), } data, err := fgaClient.Read(context.Background()).Body(requestBody).Options(options).Execute() // data = { \"tuples\": [] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientReadOptions {} var body = new ClientReadRequest() { User = \"user:bob\", Relation = \"reader\", Object = \"document:\", }; var response = await fgaClient.Read(body, options); // data = { \"tuples\": [] } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = {} body = TupleKey( user=\"user:bob\", relation=\"reader\", object=\"document:\", ) response = await fga_client.read(body, options) # response = ReadResponse({\"tuples\":[]}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple read --store-id=${FGA_STORE_ID} --user user:bob --relation reader --object document: Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"tuple_key\":{\"user\":\"user:bob\",\"relation\":\"reader\",\"object\":\"document:\"}}' # Response: \"tuples\": {[]} read( // read all stored tuples \"user:bob\", // where user `user:bob` has $(opts.relation ? '': 'any ' )relation \"reader\", // `reader` \"document:\", // with the type `document:` ); Reply: tuples:[] info Although bob is a writer to document:planning and every writer is also a reader, the Read API will return an empty list because there are no stored relationship tuples that relate bob to document:planning as reader.","s":"Caveats And When Not To Use It","u":"/docs/interacting/relationship-queries","h":"#caveats-and-when-not-to-use-it-1","p":587},{"i":611,"t":"The Expand API returns all users (including users and usersets) that have a specific relationship with an object. The response is represented as a tree of users or usersets. To build the full graph of access, you would need to recursively call expand on the leaves returned from the previous expand call.","s":"What Is It For?","u":"/docs/interacting/relationship-queries","h":"#what-is-it-for-2","p":587},{"i":613,"t":"Expand is used for debugging and to understand why a user has a particular relationship with a specific object. For example, to understand why bob can have a reader relationship with document:planning, one could first call Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); const { tree } = await fgaClient.expand({ relation: 'reader', // expand all who has 'reader' relation object: 'document:planning', // with the object 'document:planning' }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw' }); // tree = ... Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientExpandOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientExpandRequest{ Relation: \"reader\", // expand all who has \"reader\" relation Object: \"document:planning\", // with the object \"document:planning\" } data, err := fgaClient.Expand(context.Background()).Body(requestBody).Options(options).Execute() // data = { tree: ...} Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientExpandRequest { Relation = \"reader\", // expand all who has \"reader\" relation Object = \"document:planning\" // with the object \"document:planning\" }; var response = await fgaClient.Expand(body, options); // response = { tree: ... } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientExpandRequest( relation: \"reader\", object: \"document:planning\", ) response = await fga_client.expand(body. options) # response = ExpandResponse({\"tree\":...}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query expand --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw reader document:planning # Response: {\"tree\": ...} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/expand \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"tuple_key\":{\"relation\":\"reader\",\"object\":\"document:planning\"}, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' # Response: {\"tree\": ...} expand( \"reader\", // expand all who has `reader` relation \"document:planning\", // with the object `document:planning` authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: {tree:...} The result of this call will be like { \"tree\":{ \"root\":{ \"type\":\"document:planning#reader\", \"leaf\":{ \"computed\":{ \"userset\":\"document:planning#writer\" } } } } } } The returned tree will contain writer, for which we will call Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); const { tree } = await fgaClient.expand({ relation: 'writer', // expand all who has 'writer' relation object: 'document:planning', // with the object 'document:planning' }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw' }); // tree = ... Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientExpandOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientExpandRequest{ Relation: \"writer\", // expand all who has \"writer\" relation Object: \"document:planning\", // with the object \"document:planning\" } data, err := fgaClient.Expand(context.Background()).Body(requestBody).Options(options).Execute() // data = { tree: ...} Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientExpandRequest { Relation = \"writer\", // expand all who has \"writer\" relation Object = \"document:planning\" // with the object \"document:planning\" }; var response = await fgaClient.Expand(body, options); // response = { tree: ... } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientExpandRequest( relation: \"writer\", object: \"document:planning\", ) response = await fga_client.expand(body. options) # response = ExpandResponse({\"tree\":...}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query expand --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw writer document:planning # Response: {\"tree\": ...} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/expand \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"tuple_key\":{\"relation\":\"writer\",\"object\":\"document:planning\"}, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' # Response: {\"tree\": ...} expand( \"writer\", // expand all who has `writer` relation \"document:planning\", // with the object `document:planning` authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: {tree:...} The result of this call will be like { \"tree\":{ \"root\":{ \"type\":\"document:planning#writer\", \"leaf\":{ \"users\":{ \"users\":[ \"user:bob\" ] } } } } } } From there, we will learn that those related to document:planning as reader are all those who are related to that document as writer bob is related to document:planning as writer","s":"When To Use?","u":"/docs/interacting/relationship-queries","h":"#when-to-use-2","p":587},{"i":616,"t":"The ListObjects API is an API endpoint that returns the list of all the objects of a particular type that a specific user has a specific relationship with. It provides a solution to the Search with Permissions (Option 3) use case for access-aware filtering on small object collections.","s":"What Is It For?","u":"/docs/interacting/relationship-queries","h":"#what-is-it-for-3","p":587},{"i":618,"t":"Use the ListObjects API to get what objects a user can see based on the relationships they have. See Search with Permissions for more guidance. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); const response = await fgaClient.listObjects({ user: \"user:bob\", relation: \"reader\", type: \"document\", contextual_tuples: { tuple_keys: [{ user: \"user:bob\", relation: \"reader\", object: \"document:otherdoc\" }] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }); // response.objects = [\"document:otherdoc\", \"document:planning\"] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientListObjectsOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientListObjectsRequest{ User: \"user:bob\", Relation: \"reader\", Type: \"document\", ContextualTuples: &[]ClientTupleKey{ { User: \"user:bob\", Relation: \"reader\", Object: \"document:otherdoc\", } } } data, err := fgaClient.ListObjects(context.Background()). Body(requestBody). Options(options). Execute() // data = { \"objects\": [\"document:otherdoc\", \"document:planning\"] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientListObjectsRequest { User = \"user:bob\", Relation = \"reader\", Type = \"document\",, ContextualTuples = new List({ new(user: \"user:bob\", relation: \"reader\", _object: \"document:otherdoc\") }) }; var response = await fgaClient.ListObjects(body, options); // response.Objects = [\"document:otherdoc\", \"document:planning\"] Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientListObjectsRequest( user=\"user:bob\", relation=\"reader\", type=\"document\", contextual_tuples=[ ClientTupleKey(user=\"user:bob\", relation=\"reader\", object=\"document:otherdoc\") ], ) response = await fga_client.list_objects(body, options) # response.objects = [\"document:otherdoc\", \"document:planning\"] Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query list-objects --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob reader document --contextual_tuples \"user:bob reader document:otherdoc\" # Response: {\"objects\": [\"document:otherdoc\", \"document:planning\"]} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/list-objects \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{ \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"type\": \"document\", \"relation\": \"reader\", \"user\":\"user:bob\", \"contextual_tuples\": { \"tuple_keys\": [ {\"object\": \"document:otherdoc\", \"relation\": \"reader\", \"user\": \"user:bob\"} ] } }' # Response: {\"objects\": [\"document:otherdoc\", \"document:planning\"]} listObjects( \"user:bob\", // list the objects that the user `user:bob` \"reader\", // has an `reader` relation \"document\", // and that are of type `document` authorization_model_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", // for this particular authorization model id contextual_tuples = [ // Assuming the following is true {user = \"user:bob\", relation = \"reader\", object = \"document:otherdoc\"} ] ); Reply: [\"document:otherdoc\", \"document:planning\"] There's two variations of the List Objects API. The standard version, which waits until all results are ready and sends them in one response. The streaming version, which should be used if you want the individual results as soon as they become available.","s":"When To Use?","u":"/docs/interacting/relationship-queries","h":"#when-to-use-3","p":587},{"i":620,"t":"ListObjects will return the results found within the time allotted (listObjectsDeadline, default: 3s) up to the maximum number of results configured (listObjectsMaxResults, default: 1000). See Configuring the Server) for more on how to change the default configuration. If you set listObjectsDeadline to 1s, the server will spend at most 1 second finding results. If you set listObjectsMaxResults to 10, the server will return, at most, 10 objects. If the number of objects of that type is high, you should set a high value for listObjectsDeadline. If the number of objects of that type the user could have access to is high, you should set a high value for listObjectsMaxResults.","s":"Caveats","u":"/docs/interacting/relationship-queries","h":"#caveats","p":587},{"i":622,"t":"Check Read Expand ListObjects Purpose Check if user has particular relationship with certain object Return all stored relationship tuples that match query Expand the specific relationship on a particular object List all objects of a particular type that a user has a specific relationship with When to use Validate if user X can perform Y on object Z List stored relationships in system Understand why user X can perform Y on object Z Filter the objects a user has access to","s":"Summary","u":"/docs/interacting/relationship-queries","h":"#summary","p":587},{"i":624,"t":"Check out this additional content for more information on how to query relationships. Check API Reference Official reference guide for the Check API More Read API Reference Official reference guide for the Read API More Expand API Reference Official reference guide for the Expand API More ListObjects API Reference Official reference guide for the ListObjects API More","s":"Related Sections","u":"/docs/interacting/relationship-queries","h":"#related-sections","p":587},{"i":626,"t":"In this guide you'll learn how to model your application with objects that are not specifically tied to a user. For example, a folder is a parent of a document. When to use This design pattern is helpful in the case where there are relationships between different objects. With OpenFGA, so long as both objects are in a type defined in the authorization model, relationship tuples can be added to indicate a relationship between them. For example: communities can contain channels channels can contain posts channels can contain threads threads can contain posts bookshelf can have books trips can have bookings account can contain transactions buildings can have doors","s":"Object to Object Relationships","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"","p":625},{"i":628,"t":"To better follow this guide, make sure you're familiar with some OpenFGA Concepts and know how to develop the things listed below. You will start with the authorization model below, it represents a document type that can have users related as editor, and folder type that can have users related as viewer. DSL JSON model schema 1.1 type user type document relations define editor: [user] type folder relations define viewer: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"folder\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } In addition, you will need to know the following: Modeling User Groups​ You need to know how to add users to groups and grant groups access to resources. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"Before You Start","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#before-you-start","p":625},{"i":630,"t":"You need to know how to add users to groups and grant groups access to resources. Learn more →","s":"Modeling User Groups","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#modeling-user-groups","p":625},{"i":632,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA","s":"OpenFGA Concepts","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#-concepts","p":625},{"i":635,"t":"To represent that a folder can be a parent of a document, we first need to modify our document type definition to allow a parent relation. DSL JSON model schema 1.1 type user type document relations define parent: [folder] define editor: [user] type folder relations define viewer: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"parent\": { \"this\": {} }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"folder\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"folder\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"01. Create Parent Relations In Document","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#01-create-parent-relations-in-document","p":625},{"i":637,"t":"Once the type definition is updated, we can now create the relationship between a folder as a parent of a document. To do this, we will create a new relationship tuple that describes: folder:budgets is a parent of document:may_budget.doc. In OpenFGA, users in the relationship tuples can not only be IDs, but also other objects in the form of type:object_id. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // The user in this case is another object where the type is `folder` and the object_id is `budgets` { user: 'folder:budgets', relation: 'parent', object: 'document:may_budget.doc'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // The user in this case is another object where the type is `folder` and the object_id is `budgets` User: openfga.PtrString(\"folder:budgets\"), Relation: openfga.PtrString(\"parent\"), Object: openfga.PtrString(\"document:may_budget.doc\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // The user in this case is another object where the type is `folder` and the object_id is `budgets` new() { User = \"folder:budgets\", Relation = \"parent\", Object = \"document:may_budget.doc\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # The user in this case is another object where the type is `folder` and the object_id is `budgets` user=\"folder:budgets\", relation=\"parent\", object=\"document:may_budget.doc\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"folder:budgets\",\"relation\":\"parent\",\"object\":\"document:may_budget.doc\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw folder:budgets parent document:may_budget.doc write([ // The user in this case is another object where the type is `folder` and the object_id is `budgets` { \"user\":\"folder:budgets\", \"relation\":\"parent\", \"object\":\"document:may_budget.doc\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"02. Add Parent Relationship Tuples","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#02-add-parent-relationship-tuples","p":625},{"i":639,"t":"Once that relationship tuple is added to OpenFGA, we can check if the relationship is valid by asking the following: \"is folder:budgets a parent of document:may_budget.doc?\" Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'folder:budgets', relation: 'parent', object: 'document:may_budget.doc', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"folder:budgets\", Relation: \"parent\", Object: \"document:may_budget.doc\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"folder:budgets\", Relation = \"parent\", Object = \"document:may_budget.doc\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"folder:budgets\", relation=\"parent\", object=\"document:may_budget.doc\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw folder:budgets parent document:may_budget.doc # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"folder:budgets\",\"relation\":\"parent\",\"object\":\"document:may_budget.doc\"}}' # Response: {\"allowed\":true} check( user = \"folder:budgets\", // check if the user `folder:budgets` relation = \"parent\", // has an `parent` relation object = \"document:may_budget.doc\", // with the object `document:may_budget.doc` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true It is important to note that the current authorization model does not imply inheritance of permissions. Even though folder:budgets is a parent of document:may_budget.doc, it does not inherit the editor relation from parent to document. Meaning editors on folder:budgets are not editors on document:may_budget.doc. Further configuration changes are needed to indicate that and will be tackled in a later guide. caution Note: When creating relationship tuples for OpenFGA make sure to use unique ids for each object and user within your application domain. We are using first names and simple ids to just illustrate an easy-to-follow example.","s":"03. Check That Parent Folders Have Permissions","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#03-check-that-parent-folders-have-permissions","p":625},{"i":641,"t":"Object to object can be used for more advanced use case, such as entitlements. An example use case is to allow subscribers to be entitled to different plans.","s":"Advanced Object to Object Relationships","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#advanced-object-to-object-relationships","p":625},{"i":643,"t":"To do this, the authorization model will have two types - feature and plan. DSL JSON model schema 1.1 type user type feature relations define associated_plan: [plan] define access: [user] or subscriber_member from associated_plan type plan relations define subscriber_member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber_member\" } } } ] } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"plan\", \"relations\": { \"subscriber_member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"subscriber_member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Type feature has two relations, associated_plan and access. Relation associated_plan allows associating plans with features while access defines who can access the feature. In our case, the access can be achieved either from direct relationship via [direct relationship type restrictions](/docs/configuration-language#the-direct-relationship-type-restrictions). or `this` object to object relationship where a user can access because it is a subscriber_member of a particular plan AND that plan is associated with the feature. Here, we define plan as the user of object feature with relationship associated_plan rather than defining feature as the user of object plan with relationship feature. The reason we choose the former is that we want to describe our system in the following plain language: A user can access a feature in a plan if they are a subscriber member of a plan that is the associated plan of a feature. This will give us a flow of user->organization->plan->feature and allows us to answer the question of whether user can access a feature rather than whether user is subscriber of a plan.","s":"01. Create Authorization Model With Object To Object Relationships","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#01-create-authorization-model-with-object-to-object-relationships","p":625},{"i":645,"t":"To realize the relationship, we will need to add the following relationship tuples. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // make anne as subscriber_member for plan:advanced { user: 'user:anne', relation: 'subscriber_member', object: 'plan:advanced'}, // The advanced plan is associated with the data preview feature { user: 'plan:advanced', relation: 'associated_plan', object: 'feature:data_preview'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // make anne as subscriber_member for plan:advanced User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"subscriber_member\"), Object: openfga.PtrString(\"plan:advanced\"), }, { // The advanced plan is associated with the data preview feature User: openfga.PtrString(\"plan:advanced\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:data_preview\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // make anne as subscriber_member for plan:advanced new() { User = \"user:anne\", Relation = \"subscriber_member\", Object = \"plan:advanced\" }, // The advanced plan is associated with the data preview feature new() { User = \"plan:advanced\", Relation = \"associated_plan\", Object = \"feature:data_preview\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # make anne as subscriber_member for plan:advanced user=\"user:anne\", relation=\"subscriber_member\", object=\"plan:advanced\", ), ClientTuple( # The advanced plan is associated with the data preview feature user=\"plan:advanced\", relation=\"associated_plan\", object=\"feature:data_preview\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"subscriber_member\",\"object\":\"plan:advanced\"},{\"user\":\"plan:advanced\",\"relation\":\"associated_plan\",\"object\":\"feature:data_preview\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne subscriber_member plan:advanced fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:advanced associated_plan feature:data_preview write([ // make anne as subscriber_member for plan:advanced { \"user\":\"user:anne\", \"relation\":\"subscriber_member\", \"object\":\"plan:advanced\" }, // The advanced plan is associated with the data preview feature { \"user\":\"plan:advanced\", \"relation\":\"associated_plan\", \"object\":\"feature:data_preview\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"02. Adding Relationship Tuples","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#02-adding-relationship-tuples","p":625},{"i":647,"t":"To validate that the authorization model and relationship tuples are correct, we can ask the question: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'access', object: 'feature:data_preview', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"access\", Object: \"feature:data_preview\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"access\", Object = \"feature:data_preview\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"access\", object=\"feature:data_preview\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:data_preview # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"access\",\"object\":\"feature:data_preview\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"access\", // has an `access` relation object = \"feature:data_preview\", // with the object `feature:data_preview` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true We see that anne is allowed to access feature:data_preview without requiring direct relationship.","s":"03. Check To See If Access Is Allowed Without Direct Relationship","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#03-check-to-see-if-access-is-allowed-without-direct-relationship","p":625},{"i":649,"t":"At any point in time, plan:advanced may be disassociated from feature:data_preview. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ // Remove advanced plan from data preview feature { user: 'plan:advanced', relation: 'associated_plan', object: 'feature:data_preview'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { // Remove advanced plan from data preview feature User: openfga.PtrString(\"plan:advanced\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:data_preview\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { // Remove advanced plan from data preview feature new() { User = \"plan:advanced\", Relation = \"associated_plan\", Object = \"feature:data_preview\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( # Remove advanced plan from data preview feature user=\"plan:advanced\", relation=\"associated_plan\", object=\"feature:data_preview\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"plan:advanced\",\"relation\":\"associated_plan\",\"object\":\"feature:data_preview\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} plan:advanced associated_plan feature:data_preview delete([ // Remove advanced plan from data preview feature { \"user\":\"plan:advanced\", \"relation\":\"associated_plan\", \"object\":\"feature:data_preview\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") When this is the case, anne will no longer have access to feature:data_preview even though she is still a subscriber_member of plan:advanced. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'access', object: 'feature:data_preview', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"access\", Object: \"feature:data_preview\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"access\", Object = \"feature:data_preview\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"access\", object=\"feature:data_preview\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:data_preview # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"access\",\"object\":\"feature:data_preview\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"access\", // has an `access` relation object = \"feature:data_preview\", // with the object `feature:data_preview` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'subscriber_member', object: 'plan:advanced', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"subscriber_member\", Object: \"plan:advanced\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"subscriber_member\", Object = \"plan:advanced\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"subscriber_member\", object=\"plan:advanced\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne subscriber_member plan:advanced # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"subscriber_member\",\"object\":\"plan:advanced\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"subscriber_member\", // has an `subscriber_member` relation object = \"plan:advanced\", // with the object `plan:advanced` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"04. Disassociating Plan From Feature","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#04-disassociating-plan-from-feature","p":625},{"i":651,"t":"Check the following sections for more on how object-to-object relationships can be used. Advanced Modeling Patterns: Entitlements Learn how to model entitlement access patterns. More Modeling Parent-Child Relationships Learn how to model parent and child relationships. More Modeling User Groups Learn how to model user groups. More","s":"Related Sections","u":"/docs/modeling/building-blocks/object-to-object-relationships","h":"#related-sections","p":625},{"i":653,"t":"In this guide you'll learn how to model relationships that may or may not be assigned directly to individual users. When to use Disabling direct relationships for a certain relation on an objects are useful especially in cases where you are trying to model some permissions that are not usually granted individually to a user. This is useful when: For security reason, not permitting permissions assigned directly to individuals without associating roles","s":"Direct Relationships","u":"/docs/modeling/building-blocks/direct-relationships","h":"","p":652},{"i":655,"t":"To better understand this guide, you should be familiar with some OpenFGA Concepts and know how to develop the things listed below. You will need to know the following: Direct Access OpenFGA Concepts Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → OpenFGA Concepts​ A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Direct Relationship Type Restrictions: used in the context of the relation definition can be used to allow direct relationships to the objects of this type","s":"Before You Start","u":"/docs/modeling/building-blocks/direct-relationships","h":"#before-you-start","p":652},{"i":657,"t":"You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more →","s":"Direct Access","u":"/docs/modeling/building-blocks/direct-relationships","h":"#direct-access","p":652},{"i":659,"t":"A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Direct Relationship Type Restrictions: used in the context of the relation definition can be used to allow direct relationships to the objects of this type","s":"OpenFGA Concepts","u":"/docs/modeling/building-blocks/direct-relationships","h":"#-concepts","p":652},{"i":661,"t":"Direct relationships are relationships where a user has a relationship to an object that is not dependent on any other relationship they have with that object. When checking for a relationship, a direct relationship exists if a relationship tuple is present in the system with the exact same object and relation that were in the query and where the user is one of: the same user ID as that in the query type bound public access (:*) a set of users that contains the user ID present in the query","s":"What Are Direct Relationships?","u":"/docs/modeling/building-blocks/direct-relationships","h":"#what-are-direct-relationships","p":652},{"i":663,"t":"Direct relationships can be enabled for a specific relation on an object type by adding direct relationship type restrictions from that relation's definition. Likewise, they can be disabled by removing the direct relationship type restrictions. DSL JSON model schema 1.1 type user type document relations define viewer: [user, user:*, team#member] or editor define editor: [user, team#member] type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user\", \"wildcard\": {} }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info The authorization model describes two object types: document and team. The document type definition has two relations, editor and viewer. Both relations allow a direct relationship; viewer also allows an indirect relationship through editor. In the team type definition, there is a single member relation that only allows direct relationships.","s":"Enable Or Disable Direct Relationships","u":"/docs/modeling/building-blocks/direct-relationships","h":"#enable-or-disable-direct-relationships","p":652},{"i":665,"t":"To illustrate the effect enabling or disabling direct relationships on a specific relation has, we'll investigate several situations.","s":"How It Affects Your System","u":"/docs/modeling/building-blocks/direct-relationships","h":"#how-it-affects-your-system","p":652},{"i":667,"t":"Let us start with the authorization model we had above: DSL JSON model schema 1.1 type user type document relations define viewer: [user, user:*, team#member] or editor define editor: [user, team#member] type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user\", \"wildcard\": {} }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Now choose the type of relation to see how it affects your system: Direct User Type Bound Public Access Userset Indirect Relationship Assume you have a tuple that states that Anne is a viewer of document:planning [ { \"user\": \"user:anne\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] Now if we do a check request to see if Anne can view the planning document, we will get a response of {\"allowed\": true}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne viewer document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true This is because: There is a relationship tuple specifying that Anne has a viewer relationship with document:planning. Direct relationships are allowed in the viewer relation definition in the document type definition. Assume you have a type bound public access tuple where everyone of type user is a viewer of document:planning (In other words, the document is public) [ { \"user\": \"user:*\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] Now if we do a check request to see if Beth can view the planning document, we will get a response of {\"allowed\": true}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth viewer document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true This is because: There is a relationship tuple specifying that everyone of type user has a viewer relationship with document:planning. Direct relationships are allowed in the viewer relation definition in the document type definition. info Note: Even though the relationship tuple stored in the system does not specify the user (beth), this is still considered a direct relationship. Usersets are the third way direct relationships apply, we will see how in this section. Assume you have two relationship tuples: Charlie is a member of the product team. Members of the product team are viewers of the planning document. [ { \"user\": \"user:charlie\", \"relation\": \"member\", \"object\": \"team:product\", }, { \"user\": \"team:product#member\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] info Note that these two relationship tuples are specifying that: user:charlie is a member of team:product. any member of team:product is a viewer of document:planning. Note that this second relationship tuple is specifying that the members of the team have viewer access, and not the team object itself. Now if we do a check request to see if charlie can view the planning document, we will get a response of {\"allowed\": true}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:charlie', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:charlie\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:charlie\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:charlie\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charlie viewer document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:charlie\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:charlie\", // check if the user `user:charlie` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true This is because: Charlie is a member of the product team. There is a relationship tuple specifying that all members of the product team have a viewer relationship with document:planning. Direct relationships are allowed in the viewer relation definition in the document type definition. Note that this is still considered a direct relationship no matter how many resolutions occur on the usersets until the user is found. For example, if our relationship tuples were the following relationship tuples: Dany is a member of the product leads team. Members of the product leads team are members of the product team. Members of the product team are members of the contoso team. Members of the contoso team are viewers of the planning document. [ { \"user\": \"user:dany\", \"relation\": \"member\", \"object\": \"team:product-leads\", }, { \"user\": \"team:product-leads#member\", \"relation\": \"member\", \"object\": \"team:product\", }, { \"user\": \"team:product#member\", \"relation\": \"member\", \"object\": \"team:contoso\", }, { \"user\": \"team:contoso#member\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] A subsequent check request to see if Dany can view the planning document will still return a response of {\"allowed\": true}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:dany', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:dany\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:dany\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:dany\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:dany viewer document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:dany\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:dany\", // check if the user `user:dany` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true info Note: Even though the relationship tuple stored in the system does not specify the user (charlie or dany), this is still considered a direct relationship. Here we will cover one example of an indirect relationship in order to see how they differ from direct relationships. With the same authorization model we have above, assume there is a relationship tuple that specifies that Emily is an editor of document:planning. [ { \"user\": \"user:emily\", \"relation\": \"editor\", \"object\": \"document:planning\", }, ] A subsequent check request to see if emily can view the planning document will still return a response of {\"allowed\": true}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:emily', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:emily\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:emily\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:emily\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily viewer document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:emily\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:emily\", // check if the user `user:emily` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true This is because: Emily is an editor of the planning document. The authorization model specified that anyone who is an editor on a document is also a viewer on that document. In this case, there is NO direct viewer relationship between Emily and the planning document. The only viewer relationship that exists is implied because Emily is an editor and the authorization model specified that any document's editor is that document's viewer.","s":"1. With Direct Relationships Enabled","u":"/docs/modeling/building-blocks/direct-relationships","h":"#1-with-direct-relationships-enabled","p":652},{"i":669,"t":"In this section, we will investigate the effect of disabling direct relationships on the document's viewer relation. DSL JSON model schema 1.1 type user type document relations define viewer: editor define editor: [user, team#member] type team relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"viewer\": { \"computedUserset\": { \"relation\": \"editor\" } }, \"editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } }, { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Notice that in this updated authorization model, the direct relationship keyword has been removed from the document's viewer relation definition. Now choose the type of relation to see how it affects your system: Direct User Everyone Userset Indirect Relationship Assume you have a tuple that states that Fred is a viewer of document:planning [ { \"user\": \"user:fred\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] Now if we do a check request to see if Fred can view the planning document, we will get a response of {\"allowed\": false}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:fred', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:fred\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:fred\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:fred\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:fred viewer document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:fred\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:fred\", // check if the user `user:fred` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false This is because: Even though there is a relationship tuple specifying that Fred has a viewer relationship with document:planning. Direct relationships are NOT allowed in the viewer relation definition in the document type definition. You will see the same behaviour with a relationship tuple specifying everyone of type user as the user. Assume you have a tuple that states that everyone of type user is a viewer of document:planning. [ { \"user\": \"user:*\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] Now if we do a check request to see if Gabriel can view the planning document, we will get a response of {\"allowed\": false}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:gabriel', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:gabriel\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:gabriel\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:gabriel\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:gabriel viewer document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:gabriel\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:gabriel\", // check if the user `user:gabriel` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false This is because: Even though there is a relationship tuple specifying that everyone has a viewer relationship with document:planning. Direct relationships are NOT allowed in the viewer relation definition in the document type definition. The same logic applies to usersets. Assume you have two relationship tuples: Henry is a member of the product team. Members of the product team are viewers of the planning document. [ { \"user\": \"user:henry\", \"relation\": \"member\", \"object\": \"team:product\", }, { \"user\": \"team:product#member\", \"relation\": \"viewer\", \"object\": \"document:planning\", }, ] Now if we do a check request to see if Henry can view the planning document, we will get a response of {\"allowed\": false}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:henry', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:henry\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:henry\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:henry\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:henry viewer document:planning # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:henry\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":false} check( user = \"user:henry\", // check if the user `user:henry` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false This is because although: Henry is a member of the product team. There is a relationship tuple specifying that all members of the product team have a viewer relationship with document:planning. Direct relationships are NOT allowed in the viewer relation definition in the document type definition. Indirect relationships are not affected by disabling a direct relationship on a certain relation. Assume there is a relationship tuple that specifies that Ingred is an editor of document:planning. [ { \"user\": \"user:ingred\", \"relation\": \"editor\", \"object\": \"document:planning\", }, ] A subsequent check request to see if Ingred can view the planning document will still return a response of {\"allowed\": true}. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:ingred', relation: 'viewer', object: 'document:planning', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:ingred\", Relation: \"viewer\", Object: \"document:planning\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:ingred\", Relation = \"viewer\", Object = \"document:planning\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:ingred\", relation=\"viewer\", object=\"document:planning\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:ingred viewer document:planning # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:ingred\",\"relation\":\"viewer\",\"object\":\"document:planning\"}}' # Response: {\"allowed\":true} check( user = \"user:ingred\", // check if the user `user:ingred` relation = \"viewer\", // has an `viewer` relation object = \"document:planning\", // with the object `document:planning` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"2. With Direct Relationships Disabled","u":"/docs/modeling/building-blocks/direct-relationships","h":"#2-with-direct-relationships-disabled","p":652},{"i":671,"t":"Check the following sections for more one how direct relationships can be used. Also, take a look at the access relation in the feature type in Modeling Entitlements for another use-case. Modeling Roles and Permissions Learn how to remove the direct relationship to indicate nonassignable permissions. More Modeling for IoT See how Roles and Permissions can be used in an IoT use-case. More Modeling Entitlements Take a look at the access relation in the feature type for an example of removing the direct relationship More","s":"Related Sections","u":"/docs/modeling/building-blocks/direct-relationships","h":"#related-sections","p":652},{"i":673,"t":"In the lifecycle of software development, you will need to make updates or changes to the authorization model. In this guide, you will learn best practices for changing your existing authorization model. With these recommendations, you will minimize downtime and ensure your relationship models stay up to date.","s":"Migrating Relations","u":"/docs/modeling/migrating/migrating-relations","h":"","p":672},{"i":675,"t":"This guide assumes you are familiar with the following OpenFGA concepts: A Type: a class of objects that have similar characteristics A User: an entity in the system that can be related to an object A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system An Object: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA Intersection Operator: the intersection operator can be used to indicate a relationship exists if the user is in all the sets of users","s":"Before You Start","u":"/docs/modeling/migrating/migrating-relations","h":"#before-you-start","p":672},{"i":677,"t":"The document below is an example of a relational authorization model. In this model, you can assign users to the editor relation. The editor relation has write privileges that regular users do not. In this scenario, you will migrate the following model: DSL JSON model schema 1.1 type document relations define editor: [user] define can_edit: editor type user { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} }, \"can_edit\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"editor\" } } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"user\" } ] } There are existing relationship tuples associated with editor relation. [ { \"user\": \"user:anne\", \"relation\": \"editor\", \"object\": \"document:roadmap\", }, { \"user\": \"user:charles\", \"relation\": \"editor\", \"object\": \"document:roadmap\", }, ] This is the authorization model that you will want to migrate to: DSL JSON model schema 1.1 type document relations define writer: [user] define can_write: writer type user { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"writer\": { \"this\": {} }, \"can_write\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } }, \"metadata\": { \"relations\": { \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"user\" } ] }","s":"Step By Step","u":"/docs/modeling/migrating/migrating-relations","h":"#step-by-step","p":672},{"i":679,"t":"To avoid service disruption, you will create a backwards compatible model. The backwards compatible model ensures the existing relationship tuple will still work. In the example below, user:Anne still has write privileges to the document:roadmap resource. DSL JSON model schema 1.1 type document relations define editor: [user] define writer: [user] or editor define can_write: writer define can_edit: writer type user { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"editor\": { \"this\": {} }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"editor\" } } ] } }, \"can_write\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } }, \"can_edit\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } }, \"metadata\": { \"relations\": { \"editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"user\" } ] } Test the can_edit definition. It should produce a value of true. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_write', object: 'document:roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_write\", Object: \"document:roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_write\", Object = \"document:roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_write\", object=\"document:roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_write document:roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_write\",\"object\":\"document:roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_write\", // has an `can_write` relation object = \"document:roadmap\", // with the object `document:roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_edit', object: 'document:roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_edit\", Object: \"document:roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_edit\", Object = \"document:roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_edit\", object=\"document:roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_edit document:roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_edit\",\"object\":\"document:roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_edit\", // has an `can_edit` relation object = \"document:roadmap\", // with the object `document:roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"01. Create A Backwards Compatible Model","u":"/docs/modeling/migrating/migrating-relations","h":"#01-create-a-backwards-compatible-model","p":672},{"i":681,"t":"Now that you have a backwards compatible model, you can create new relationship tuples with a new relation. In this example, you will add Bethany to the writer relationship. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Bethany assigned writer instead of editor { user: 'user:bethany', relation: 'writer', object: 'document:roadmap'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Bethany assigned writer instead of editor User: openfga.PtrString(\"user:bethany\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"document:roadmap\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Bethany assigned writer instead of editor new() { User = \"user:bethany\", Relation = \"writer\", Object = \"document:roadmap\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Bethany assigned writer instead of editor user=\"user:bethany\", relation=\"writer\", object=\"document:roadmap\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:bethany\",\"relation\":\"writer\",\"object\":\"document:roadmap\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bethany writer document:roadmap write([ // Bethany assigned writer instead of editor { \"user\":\"user:bethany\", \"relation\":\"writer\", \"object\":\"document:roadmap\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Run a check in the API for Bethany to ensure correct access. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:bethany', relation: 'can_write', object: 'document:roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:bethany\", Relation: \"can_write\", Object: \"document:roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:bethany\", Relation = \"can_write\", Object = \"document:roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:bethany\", relation=\"can_write\", object=\"document:roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bethany can_write document:roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:bethany\",\"relation\":\"can_write\",\"object\":\"document:roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:bethany\", // check if the user `user:bethany` relation = \"can_write\", // has an `can_write` relation object = \"document:roadmap\", // with the object `document:roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"02. Create a New Relationship Tuple","u":"/docs/modeling/migrating/migrating-relations","h":"#02-create-a-new-relationship-tuple","p":672},{"i":683,"t":"Next, migrate the existing relationship tuples. The new relation makes this definition obsolete. Use the read API to lookup all relationship tuples. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Execute a read const { tuples } = await fgaClient.read({ }); // tuples = [{\"key\": {\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"},{\"key\": {\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientReadOptions{} body := ClientReadRequest{ } data, err := fgaClient.Read(context.Background()).Body(requestBody).Options(options).Execute() // data = { \"tuples\": [{\"key\": {\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"},{\"key\": {\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientReadOptions {} var body = new ClientReadRequest() { }; var response = await fgaClient.Read(body, options); // data = { \"tuples\": [{\"key\": {\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"},{\"key\": {\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] } Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = {} body = TupleKey( ) response = await fga_client.read(body, options) # response = ReadResponse({\"tuples\":[{\"key\": {\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"},{\"key\": {\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]}) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple read --store-id=${FGA_STORE_ID} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/read \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" ' # Response: \"tuples\": {[{\"key\": {\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"},{\"key\": {\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}]} read( // read all stored tuples ); Reply: tuples:[{\"key\": {\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"},{\"key\": {\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:planning\"}, \"timestamp\": \"2021-10-06T15:32:11.128Z\"}] Then filter out the tuples that do not match the object type or relation (in this case, document and editor respectively), and update the new tuples with the write relationship. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'writer', object: 'document:roadmap'}, { user: 'user:charles', relation: 'writer', object: 'document:roadmap'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"document:roadmap\"), }, { User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"document:roadmap\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"writer\", Object = \"document:roadmap\" }, new() { User = \"user:charles\", Relation = \"writer\", Object = \"document:roadmap\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"writer\", object=\"document:roadmap\", ), ClientTuple( user=\"user:charles\", relation=\"writer\", object=\"document:roadmap\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"writer\",\"object\":\"document:roadmap\"},{\"user\":\"user:charles\",\"relation\":\"writer\",\"object\":\"document:roadmap\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne writer document:roadmap fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles writer document:roadmap write([ { \"user\":\"user:anne\", \"relation\":\"writer\", \"object\":\"document:roadmap\" }, { \"user\":\"user:charles\", \"relation\":\"writer\", \"object\":\"document:roadmap\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Finally, remove the old relationship tuples. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ { user: 'user:anne', relation: 'editor', object: 'document:roadmap'}, { user: 'user:charles', relation: 'editor', object: 'document:roadmap'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"editor\"), Object: openfga.PtrString(\"document:roadmap\"), }, { User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"editor\"), Object: openfga.PtrString(\"document:roadmap\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { new() { User = \"user:anne\", Relation = \"editor\", Object = \"document:roadmap\" }, new() { User = \"user:charles\", Relation = \"editor\", Object = \"document:roadmap\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( user=\"user:anne\", relation=\"editor\", object=\"document:roadmap\", ), ClientTuple( user=\"user:charles\", relation=\"editor\", object=\"document:roadmap\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:roadmap\"},{\"user\":\"user:charles\",\"relation\":\"editor\",\"object\":\"document:roadmap\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} user:anne editor document:roadmap fga tuple delete --store-id=${FGA_STORE_ID} user:charles editor document:roadmap delete([ { \"user\":\"user:anne\", \"relation\":\"editor\", \"object\":\"document:roadmap\" }, { \"user\":\"user:charles\", \"relation\":\"editor\", \"object\":\"document:roadmap\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") info Perform a write operation before a delete operation to ensure Anne still has access. Confirm the tuples are correct by running a check on the user. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_write', object: 'document:roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_write\", Object: \"document:roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_write\", Object = \"document:roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_write\", object=\"document:roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_write document:roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_write\",\"object\":\"document:roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_write\", // has an `can_write` relation object = \"document:roadmap\", // with the object `document:roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true The old relationship tuple no longer exists. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'editor', object: 'document:roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"editor\", Object: \"document:roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"editor\", Object = \"document:roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"editor\", object=\"document:roadmap\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne editor document:roadmap # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"editor\",\"object\":\"document:roadmap\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"editor\", // has an `editor` relation object = \"document:roadmap\", // with the object `document:roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"03. Migrate The Existing Relationship Tuples","u":"/docs/modeling/migrating/migrating-relations","h":"#03-migrate-the-existing-relationship-tuples","p":672},{"i":685,"t":"After you remove the previous relationship tuples, update your authorization model to remove the obsolete relation. DSL JSON model schema 1.1 type document relations define writer: [user] define can_write: writer type user { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"document\", \"relations\": { \"writer\": { \"this\": {} }, \"can_write\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"writer\" } } }, \"metadata\": { \"relations\": { \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"user\" } ] } Now, the write API will only accept the new relation name.","s":"04. Remove Obsolete Relationship From The Model","u":"/docs/modeling/migrating/migrating-relations","h":"#04-remove-obsolete-relationship-from-the-model","p":672},{"i":687,"t":"Review the following sections for more information on managing relationship tuples. Transactional Writes Learn how to perform transactional write More Relationship Queries Understand the differences between check, read, expand and list objects. More Production Best Practices Learn the best practices of running OpenFGA in a production environment More","s":"Related Sections","u":"/docs/modeling/migrating/migrating-relations","h":"#related-sections","p":672},{"i":689,"t":"This section tackles cases where a user may have access to a particular resource through their presence in a particular organization, and they should have that access only when logged in within the context of that organization. When to use Contextual Tuples should be used when modeling cases where a user's access to an object depends on the context of their request. For example: An employee’s ability to access a document when they are connected to the organization VPN or the api call is originating from an internal IP address. A support engineer is only able to access a user's account during office hours. If a user belongs to multiple organizations, they are only able to access a resource if they set a specific organization in their current context.","s":"Authorization Through Organization Context","u":"/docs/modeling/organization-context-authorization","h":"","p":688},{"i":691,"t":"To follow this guide, you should be familiar with some OpenFGA Concepts.","s":"Before You Start","u":"/docs/modeling/organization-context-authorization","h":"#before-you-start","p":688},{"i":693,"t":"A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system A Check Request: is a call to the OpenFGA check endpoint that returns whether the user has a certain relationship with an object. A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA A Contextual Tuple: a tuple that can be added to a check request, and only exist within the context of that particular request. You also need to be familiar with: Modeling Object-to-Object Relationships: You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more → Modeling Multiple Restrictions: You need to know how to model requiring multiple authorizations before allowing users to perform certain actions. Learn more →","s":"OpenFGA Concepts","u":"/docs/modeling/organization-context-authorization","h":"#-concepts","p":688},{"i":695,"t":"For the scope of this guide, we are going to consider the following scenario. Consider you are building the authorization model for a multi-tenant project management system. In this particular system: projects are owned and managed by companies users can be members of multiple companies project access is governed by the user's role in the organization that manages the project In order for a user to access a project: The project needs to be managed by an organization the user is a member of A project is owned by a single organization A project can be shared with partner companies (that are able to view, edit but not perform admin actions, such as deletion, on the project) The user should have a role that grants access to the project The user should be logged in within the context of that organization We will start with the following authorization model: DSL JSON model schema 1.1 type user type organization relations define member: [user] define project_manager: [user] define project_editor: [user] type project relations define owner: [organization] define partner: [organization] define manager: project_manager from owner define editor: project_editor from owner or project_editor from partner or manager define can_delete: manager define can_edit: editor define can_view: editor { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} }, \"project_manager\": { \"this\": {} }, \"project_editor\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"project_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"project_editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"project\", \"relations\": { \"owner\": { \"this\": {} }, \"partner\": { \"this\": {} }, \"manager\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"owner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"project_manager\" } } }, \"editor\": { \"union\": { \"child\": [ { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"owner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"project_editor\" } } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"partner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"project_editor\" } } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"manager\" } } ] } }, \"can_delete\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"manager\" } }, \"can_edit\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"editor\" } }, \"can_view\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"editor\" } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] }, \"partner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } } ] } We are considering the case that: Anne has a project manager role at organizations A, B and C Beth has a project manager role at organization B Carl has a project manager role at organization C Project X is owned by organization A Project X is shared with organization B The above state translates to the following relationship tuples: Node.js Go .NET Python curl CLI Pseudocode await fgaClient.write({ writes: [ // Anne has a `project manager` role at organization A { user: 'user:anne', relation: 'project_manager', object: 'organization:A'}, // Anne has a `project manager` role at organization B { user: 'user:anne', relation: 'project_manager', object: 'organization:B'}, // Anne has a `project manager` role at organization C { user: 'user:anne', relation: 'project_manager', object: 'organization:C'}, // Beth has a `project manager` role at organization B { user: 'user:anne', relation: 'project_manager', object: 'organization:B'}, // Carl has a `project manager` role at organization C { user: 'user:carl', relation: 'project_manager', object: 'organization:C'}, // Organization A owns Project X { user: 'organization:A', relation: 'owner', object: 'project:X'}, // Project X is shared with Organization B { user: 'organization:B', relation: 'partner', object: 'project:X'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne has a `project manager` role at organization A User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:A\"), }, { // Anne has a `project manager` role at organization B User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:B\"), }, { // Anne has a `project manager` role at organization C User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:C\"), }, { // Beth has a `project manager` role at organization B User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:B\"), }, { // Carl has a `project manager` role at organization C User: openfga.PtrString(\"user:carl\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:C\"), }, { // Organization A owns Project X User: openfga.PtrString(\"organization:A\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"project:X\"), }, { // Project X is shared with Organization B User: openfga.PtrString(\"organization:B\"), Relation: openfga.PtrString(\"partner\"), Object: openfga.PtrString(\"project:X\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne has a `project manager` role at organization A new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:A\" }, // Anne has a `project manager` role at organization B new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:B\" }, // Anne has a `project manager` role at organization C new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:C\" }, // Beth has a `project manager` role at organization B new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:B\" }, // Carl has a `project manager` role at organization C new() { User = \"user:carl\", Relation = \"project_manager\", Object = \"organization:C\" }, // Organization A owns Project X new() { User = \"organization:A\", Relation = \"owner\", Object = \"project:X\" }, // Project X is shared with Organization B new() { User = \"organization:B\", Relation = \"partner\", Object = \"project:X\" } }, }; var response = await fgaClient.Write(body, options); options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne has a `project manager` role at organization A user=\"user:anne\", relation=\"project_manager\", object=\"organization:A\", ), ClientTuple( # Anne has a `project manager` role at organization B user=\"user:anne\", relation=\"project_manager\", object=\"organization:B\", ), ClientTuple( # Anne has a `project manager` role at organization C user=\"user:anne\", relation=\"project_manager\", object=\"organization:C\", ), ClientTuple( # Beth has a `project manager` role at organization B user=\"user:anne\", relation=\"project_manager\", object=\"organization:B\", ), ClientTuple( # Carl has a `project manager` role at organization C user=\"user:carl\", relation=\"project_manager\", object=\"organization:C\", ), ClientTuple( # Organization A owns Project X user=\"organization:A\", relation=\"owner\", object=\"project:X\", ), ClientTuple( # Project X is shared with Organization B user=\"organization:B\", relation=\"partner\", object=\"project:X\", ),, ), \", ) response = await fga_client.write(body, options) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:A\"},{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:B\"},{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:C\"},{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:B\"},{\"user\":\"user:carl\",\"relation\":\"project_manager\",\"object\":\"organization:C\"},{\"user\":\"organization:A\",\"relation\":\"owner\",\"object\":\"project:X\"},{\"user\":\"organization:B\",\"relation\":\"partner\",\"object\":\"project:X\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:A fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:B fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:C fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:B fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl project_manager organization:C fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:A owner project:X fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:B partner project:X write([ // Anne has a `project manager` role at organization A { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:A\" }, // Anne has a `project manager` role at organization B { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:B\" }, // Anne has a `project manager` role at organization C { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:C\" }, // Beth has a `project manager` role at organization B { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:B\" }, // Carl has a `project manager` role at organization C { \"user\":\"user:carl\", \"relation\":\"project_manager\", \"object\":\"organization:C\" }, // Organization A owns Project X { \"user\":\"organization:A\", \"relation\":\"owner\", \"object\":\"project:X\" }, // Project X is shared with Organization B { \"user\":\"organization:B\", \"relation\":\"partner\", \"object\":\"project:X\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"Scenario","u":"/docs/modeling/organization-context-authorization","h":"#scenario","p":688},{"i":697,"t":"When logging in within the context of organization A, Anne should be able to view and delete project X. When logging in within the context of organization B, Anne should be able to view, but not delete, project X. When logging in within the context of organization C, Anne should not be able to view nor delete project X. When logging in within the context of organization B, Beth should be able to view, but not delete, project X. Carl should not be able to view nor delete project X.","s":"Requirements","u":"/docs/modeling/organization-context-authorization","h":"#requirements","p":688},{"i":699,"t":"In order to solve for the requirements above, we will break the problem down into three steps: Understand relationships without contextual tuples. For example, we need to ensure that Anne can view and delete \"Project X\". Take organization context into consideration. This includes extending the authorization model and a temporary step of adding the required tuples to mark that Anne is in an approved context. Use contextual tuples for context related checks.","s":"Step By Step","u":"/docs/modeling/organization-context-authorization","h":"#step-by-step","p":688},{"i":701,"t":"With the authorization model and relationship tuples shown above, OpenFGA has all the information needed to ensure that Anne can view and delete \"Project X\". We can verify that using the following checks: Anne can view Project X Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = true fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X # Response: {\"allowed\":true} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"project:X\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Anne can delete Project X Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_delete', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_delete\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_delete\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_delete\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = true fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_delete project:X # Response: {\"allowed\":true} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_delete\",\"object\":\"project:X\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_delete\", // has an `can_delete` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true More checks * Beth can view Project X Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'can_view', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"can_view\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"can_view\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"can_view\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = true fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth can_view project:X # Response: {\"allowed\":true} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"can_view\",\"object\":\"project:X\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true * Beth cannot delete Project X Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'can_delete', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"can_delete\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"can_delete\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"can_delete\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = false fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth can_delete project:X # Response: {\"allowed\":false} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"can_delete\",\"object\":\"project:X\"}}' # Response: {\"allowed\":false} check( user = \"user:beth\", // check if the user `user:beth` relation = \"can_delete\", // has an `can_delete` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false * Carl cannot view Project X Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:carl', relation: 'can_view', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:carl\", Relation: \"can_view\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:carl\", Relation = \"can_view\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:carl\", relation=\"can_view\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = false fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl can_view project:X # Response: {\"allowed\":false} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:carl\",\"relation\":\"can_view\",\"object\":\"project:X\"}}' # Response: {\"allowed\":false} check( user = \"user:carl\", // check if the user `user:carl` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false * Carl cannot delete Project X Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:carl', relation: 'can_delete', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:carl\", Relation: \"can_delete\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:carl\", Relation = \"can_delete\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:carl\", relation=\"can_delete\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = false fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl can_delete project:X # Response: {\"allowed\":false} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:carl\",\"relation\":\"can_delete\",\"object\":\"project:X\"}}' # Response: {\"allowed\":false} check( user = \"user:carl\", // check if the user `user:carl` relation = \"can_delete\", // has an `can_delete` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Note that so far, we have not prevented Anne from viewing \"Project X\" even if Anne is viewing it from the context of Organization C.","s":"Understand Relationships Without Contextual Data","u":"/docs/modeling/organization-context-authorization","h":"#understand-relationships-without-contextual-data","p":688},{"i":703,"t":"Extend The Authorization Model​ In order to add a restriction based on the current organization context, we will make use of OpenFGA configuration language's support for intersection to specify that a user has to both have access and be in the correct context in order to be authorized. We can do that by introducing some new relations and updating existing relation definitions: On the \"organization\" type Add \"user_in_context\" relation to mark that a user's access is being evaluated within that particular context Update the \"project_manager\" relation to require that the user be in the correct context (by adding and user_in_context to the relation definition) Considering that OpenFGA does not yet support multiple logical operations within the same definition, we will split \"project_editor\" into two: \"base_project_editor\" editor which will contain the original relation definition ([user] or project_manager) \"project_editor\" which will require that a user has both the \"base_project_editor\" and the \"user_in_context\" relations The \"organization\" type definition then becomes: DSL JSON type organization relations define member: [user] define project_manager: [user] and user_in_context define base_project_editor: [user] or project_manager define project_editor: base_project_editor and user_in_context define user_in_context: [user] { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} }, \"project_manager\": { \"intersection\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"user_in_context\" } } ] } }, \"base_project_editor\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"project_manager\" } } ] } }, \"project_editor\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"base_project_editor\" } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"user_in_context\" } } ] } }, \"user_in_context\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"project_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"base_project_editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"user_in_context\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } On the \"project\" type Nothing will need to be done, as it will inherit the updated \"project_manager\" and \"project_editor\" relation definitions from \"organization\" Add The Required Tuples To Mark That Anne Is In An Approved Context​ Now that we have updated our authorization model to take the current user's organization context into consideration, you will notice that Anne has lost access because nothing indicates that Anne is authorizing from the context of an organization. You can verify that by issuing the following check: Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = false fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X # Response: {\"allowed\":false} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"project:X\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false In order for Anne to be authorized, a tuple indicating Anne's current organization context will need to be present: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is authorizing from the context of organization:A { user: 'user:anne', relation: 'user_in_context', object: 'organization:A'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is authorizing from the context of organization:A User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"user_in_context\"), Object: openfga.PtrString(\"organization:A\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is authorizing from the context of organization:A new() { User = \"user:anne\", Relation = \"user_in_context\", Object = \"organization:A\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is authorizing from the context of organization:A user=\"user:anne\", relation=\"user_in_context\", object=\"organization:A\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"user_in_context\",\"object\":\"organization:A\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne user_in_context organization:A write([ // Anne is authorizing from the context of organization:A { \"user\":\"user:anne\", \"relation\":\"user_in_context\", \"object\":\"organization:A\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") We can verify this by running a check request Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'project:X', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"project:X\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"project:X\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"project:X\", ) response = await fga_client.check(body, options) # response.allowed = true fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X # Response: {\"allowed\":true} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"project:X\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"Take Organization Context Into Consideration","u":"/docs/modeling/organization-context-authorization","h":"#take-organization-context-into-consideration","p":688},{"i":705,"t":"Now that we know we can authorize based on present state, we have a different problem to solve. We are storing the tuples in the state in order for OpenFGA to evaluate them, which fails in certain use-cases where Anne can be connected to two different contexts in different browser windows at the same time, as each has a different context at the same time, so if they are written to the state, which will OpenFGA use to compute Anne's access to the project? For Check calls, OpenFGA has a concept called \"Contextual Tuples\". Contextual Tuples are tuples that do not exist in the system state and are not written beforehand to OpenFGA. They are tuples that are sent alongside the Check request and will be treated as if they already exist in the state for the context of that particular Check call. That means that Anne can be using two different sessions, each within a different organization context, and OpenFGA will correctly respond to each one with the correct authorization decision. First, we will undo the temporary step and remove the stored tuples for which Anne has a user_in_context relation with organization:A. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ // Delete stored tuples where Anne is authorizing from the context of organization:A { user: 'user:anne', relation: 'user_in_context', object: 'organization:A'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { // Delete stored tuples where Anne is authorizing from the context of organization:A User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"user_in_context\"), Object: openfga.PtrString(\"organization:A\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { // Delete stored tuples where Anne is authorizing from the context of organization:A new() { User = \"user:anne\", Relation = \"user_in_context\", Object = \"organization:A\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( # Delete stored tuples where Anne is authorizing from the context of organization:A user=\"user:anne\", relation=\"user_in_context\", object=\"organization:A\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"user_in_context\",\"object\":\"organization:A\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} user:anne user_in_context organization:A delete([ // Delete stored tuples where Anne is authorizing from the context of organization:A { \"user\":\"user:anne\", \"relation\":\"user_in_context\", \"object\":\"organization:A\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Next, when Anne is connecting from the context of organization A, OpenFGA will return {\"allowed\":true}: Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'project:X', contextual_tuples: [ { user: \"user:anne\", relation: \"user_in_context\", object: \"organization:A\" } ]}, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"project:X\", ContextualTuples: &[]ClientTupleKey{ { User: \"user:anne\", Relation: \"user_in_context\", Object: \"organization:A\", } } } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"project:X\",, ContextualTuples = new List({ new(user: \"user:anne\", relation: \"user_in_context\", _object: \"organization:A\") }) }; var response = await fgaClient.Check(body, options); // response.Allowed = true options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"project:X\", contextual_tuples=[ ClientTupleKey(user=\"user:anne\", relation=\"user_in_context\", object=\"organization:A\") ], ) response = await fga_client.check(body, options) # response.allowed = true fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X --contextual_tuples \"user:anne user_in_context organization:A\" # Response: {\"allowed\":true} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"project:X\"},\"contextual_tuples\":{\"tuple_keys\":[{\"user\":\"user:anne\",\"relation\":\"user_in_context\",\"object\":\"organization:A\"}]}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` contextual_tuples = [ // Assuming the following is true {user = \"user:anne\", relation = \"user_in_context\", object = \"organization:A\"} ], authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true When Anne is connecting from the context of organization C, OpenFGA will return {\"allowed\":false}: Node.js Go .NET Python CLI curl Pseudocode // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'project:X', contextual_tuples: [ { user: \"user:anne\", relation: \"user_in_context\", object: \"organization:C\" } ]}, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"project:X\", ContextualTuples: &[]ClientTupleKey{ { User: \"user:anne\", Relation: \"user_in_context\", Object: \"organization:C\", } } } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"project:X\",, ContextualTuples = new List({ new(user: \"user:anne\", relation: \"user_in_context\", _object: \"organization:C\") }) }; var response = await fgaClient.Check(body, options); // response.Allowed = false options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"project:X\", contextual_tuples=[ ClientTupleKey(user=\"user:anne\", relation=\"user_in_context\", object=\"organization:C\") ], ) response = await fga_client.check(body, options) # response.allowed = false fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view project:X --contextual_tuples \"user:anne user_in_context organization:C\" # Response: {\"allowed\":false} curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"project:X\"},\"contextual_tuples\":{\"tuple_keys\":[{\"user\":\"user:anne\",\"relation\":\"user_in_context\",\"object\":\"organization:C\"}]}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"project:X\", // with the object `project:X` contextual_tuples = [ // Assuming the following is true {user = \"user:anne\", relation = \"user_in_context\", object = \"organization:C\"} ], authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Using this, you can check that the following requirements are satisfied: User Organization Context Action Allowed Anne Organization A View Yes Anne Organization B View Yes Anne Organization C View Yes Anne Organization A Delete Yes Anne Organization B Delete No Anne Organization C Delete No Beth Organization B View Yes Beth Organization B Delete No Carl Organization C View No Carl Organization C Delete No","s":"Use Contextual Tuples For Context Related Checks","u":"/docs/modeling/organization-context-authorization","h":"#use-contextual-tuples-for-context-related-checks","p":688},{"i":707,"t":"Final version of the Authorization Model and Relationship tuples DSL JSON model schema 1.1 type user type organization relations define member: [user] define project_manager: [user] and user_in_context define base_project_editor: [user] or project_manager define project_editor: base_project_editor and user_in_context define user_in_context: [user] type project relations define owner: [organization] define partner: [organization] define manager: project_manager from owner define editor: manager or project_editor from owner or project_editor from partner define can_delete: manager define can_edit: editor define can_view: editor { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} }, \"project_manager\": { \"intersection\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"user_in_context\" } } ] } }, \"base_project_editor\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"project_manager\" } } ] } }, \"project_editor\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"base_project_editor\" } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"user_in_context\" } } ] } }, \"user_in_context\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"project_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"base_project_editor\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"user_in_context\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"project\", \"relations\": { \"owner\": { \"this\": {} }, \"partner\": { \"this\": {} }, \"manager\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"owner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"project_manager\" } } }, \"editor\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"manager\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"owner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"project_editor\" } } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"partner\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"project_editor\" } } } ] } }, \"can_delete\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"manager\" } }, \"can_edit\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"editor\" } }, \"can_view\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"editor\" } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] }, \"partner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } } ] } Node.js Go .NET Python curl CLI Pseudocode await fgaClient.write({ writes: [ // Anne has a `project manager` role at organization A { user: 'user:anne', relation: 'project_manager', object: 'organization:A'}, // Anne has a `project manager` role at organization B { user: 'user:anne', relation: 'project_manager', object: 'organization:B'}, // Anne has a `project manager` role at organization C { user: 'user:anne', relation: 'project_manager', object: 'organization:C'}, // Beth has a `project manager` role at organization B { user: 'user:beth', relation: 'project_manager', object: 'organization:B'}, // Carl has a `project manager` role at organization C { user: 'user:carl', relation: 'project_manager', object: 'organization:C'}, // Organization A owns Project X { user: 'organization:A', relation: 'owner', object: 'project:X'}, // Project X is shared with Organization B { user: 'organization:B', relation: 'partner', object: 'project:X'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne has a `project manager` role at organization A User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:A\"), }, { // Anne has a `project manager` role at organization B User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:B\"), }, { // Anne has a `project manager` role at organization C User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:C\"), }, { // Beth has a `project manager` role at organization B User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:B\"), }, { // Carl has a `project manager` role at organization C User: openfga.PtrString(\"user:carl\"), Relation: openfga.PtrString(\"project_manager\"), Object: openfga.PtrString(\"organization:C\"), }, { // Organization A owns Project X User: openfga.PtrString(\"organization:A\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"project:X\"), }, { // Project X is shared with Organization B User: openfga.PtrString(\"organization:B\"), Relation: openfga.PtrString(\"partner\"), Object: openfga.PtrString(\"project:X\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne has a `project manager` role at organization A new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:A\" }, // Anne has a `project manager` role at organization B new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:B\" }, // Anne has a `project manager` role at organization C new() { User = \"user:anne\", Relation = \"project_manager\", Object = \"organization:C\" }, // Beth has a `project manager` role at organization B new() { User = \"user:beth\", Relation = \"project_manager\", Object = \"organization:B\" }, // Carl has a `project manager` role at organization C new() { User = \"user:carl\", Relation = \"project_manager\", Object = \"organization:C\" }, // Organization A owns Project X new() { User = \"organization:A\", Relation = \"owner\", Object = \"project:X\" }, // Project X is shared with Organization B new() { User = \"organization:B\", Relation = \"partner\", Object = \"project:X\" } }, }; var response = await fgaClient.Write(body, options); options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne has a `project manager` role at organization A user=\"user:anne\", relation=\"project_manager\", object=\"organization:A\", ), ClientTuple( # Anne has a `project manager` role at organization B user=\"user:anne\", relation=\"project_manager\", object=\"organization:B\", ), ClientTuple( # Anne has a `project manager` role at organization C user=\"user:anne\", relation=\"project_manager\", object=\"organization:C\", ), ClientTuple( # Beth has a `project manager` role at organization B user=\"user:beth\", relation=\"project_manager\", object=\"organization:B\", ), ClientTuple( # Carl has a `project manager` role at organization C user=\"user:carl\", relation=\"project_manager\", object=\"organization:C\", ), ClientTuple( # Organization A owns Project X user=\"organization:A\", relation=\"owner\", object=\"project:X\", ), ClientTuple( # Project X is shared with Organization B user=\"organization:B\", relation=\"partner\", object=\"project:X\", ),, ), \", ) response = await fga_client.write(body, options) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:A\"},{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:B\"},{\"user\":\"user:anne\",\"relation\":\"project_manager\",\"object\":\"organization:C\"},{\"user\":\"user:beth\",\"relation\":\"project_manager\",\"object\":\"organization:B\"},{\"user\":\"user:carl\",\"relation\":\"project_manager\",\"object\":\"organization:C\"},{\"user\":\"organization:A\",\"relation\":\"owner\",\"object\":\"project:X\"},{\"user\":\"organization:B\",\"relation\":\"partner\",\"object\":\"project:X\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:A fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:B fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne project_manager organization:C fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth project_manager organization:B fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:carl project_manager organization:C fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:A owner project:X fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:B partner project:X write([ // Anne has a `project manager` role at organization A { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:A\" }, // Anne has a `project manager` role at organization B { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:B\" }, // Anne has a `project manager` role at organization C { \"user\":\"user:anne\", \"relation\":\"project_manager\", \"object\":\"organization:C\" }, // Beth has a `project manager` role at organization B { \"user\":\"user:beth\", \"relation\":\"project_manager\", \"object\":\"organization:B\" }, // Carl has a `project manager` role at organization C { \"user\":\"user:carl\", \"relation\":\"project_manager\", \"object\":\"organization:C\" }, // Organization A owns Project X { \"user\":\"organization:A\", \"relation\":\"owner\", \"object\":\"project:X\" }, // Project X is shared with Organization B { \"user\":\"organization:B\", \"relation\":\"partner\", \"object\":\"project:X\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Warning Contextual tuples: Are not persisted in the store. Are only supported on the Check API endpoint and ListObjects API endpoint. They are not supported on read, expand and other endpoints. If you are using the Read Changes API endpoint to build a permission aware search index, note that it will not be trivial to take contextual tuples into account.","s":"Summary","u":"/docs/modeling/organization-context-authorization","h":"#summary","p":688},{"i":709,"t":"Check the following sections for more on how user groups can be used. Modeling with Multiple Restrictions Learn how to model requiring multiple relationships before users are authorized to perform certain actions. More Contextual and Time-Based Authorization Learn how to authorize access that depends on dynamic or contextual criteria. More OpenFGA Check API Details on the Check API in the OpenFGA reference guide. More","s":"Related Sections","u":"/docs/modeling/organization-context-authorization","h":"#related-sections","p":688},{"i":711,"t":"This tutorial explains how to model entitlements for a platform like GitHub using OpenFGA. What you will learn How to model an entitlement use case in OpenFGA How to start with a given set of requirements and scenarios and iterate on the OpenFGA model until those requirements are met","s":"Modeling Entitlements for a System with OpenFGA","u":"/docs/modeling/advanced/entitlements","h":"","p":710},{"i":713,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA concepts and know how to develop the things that we will list below. OpenFGA Concepts​ It would be helpful to have an understanding of some concepts of OpenFGA before you start. Modeling Object-to-Object Relationships​ You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more → Used here to indicate that members of an org are subscriber members of the plan the org is subscriber to, and subscriber members of a plan get access to all the plan's features. Direct Relationships​ You need to know how to disallow granting direct relation to an object and requiring the user to have a relation with another object that would imply a relation with the first one. Learn more → Used here to indicate that \"access\" to a feature cannot be directly granted to a user, but is implied through the users organization subscribing to a plan that offers that feature. Concepts & Configuration Language​ Some OpenFGA Concepts Configuration Language","s":"Before You Start","u":"/docs/modeling/advanced/entitlements","h":"#before-you-start","p":710},{"i":715,"t":"It would be helpful to have an understanding of some concepts of OpenFGA before you start.","s":"OpenFGA Concepts","u":"/docs/modeling/advanced/entitlements","h":"#-concepts","p":710},{"i":717,"t":"In many product offerings, the features are behind multiple tiers. In this tutorial, you will build an authorization model for a subset of GitHub's entitlements (detailed below) using OpenFGA. You will use some scenarios to validate the model. At their core, entitlements is just asking: does a user X have access to feature Y? In GitHub's case for example, they have a concept called \"Draft Pull Requests\". Once the user loads the Pull Request page, the frontend needs to know whether it can show the \"Draft Pull Request\" option, as in it needs to know: \"Does the current user have access to feature Draft Pull Request?\". Note: For brevity, this tutorial will not model all of GitHub entitlements. Instead, it will focus on modeling for the scenarios outlined below","s":"What You Will Be Modeling","u":"/docs/modeling/advanced/entitlements","h":"#what-you-will-be-modeling","p":710},{"i":719,"t":"You will model an entitlement system similar to GitHub's, focusing on a few scenarios. GitHub has 3 plans: \"Free\", \"Team\" and \"Enterprise\", with each of them offering several features. The higher-priced plans include all the features of the lower priced plans. You will be focusing on a subset of the features offered. A summary of GitHub's entitlement system: Free Issues Team Everything from the free plan Draft Pull Requests Enterprise Everything from the team plan SAML Single Sign-On","s":"Requirements","u":"/docs/modeling/advanced/entitlements","h":"#requirements","p":710},{"i":721,"t":"Use the following scenarios to be able to validate whether the model of the requirements is correct. Take these three organizations Alpha Beta Gamma (alpha), a subscriber on the free plan Bayer Water Supplies (bayer), a subscriber on the team plan Cups and Dishes (cups), a subscriber on the enterprise plan Take these three users Anne, member of Alpha Beta Gamma Beth, member of Bayer Water Supplies Charles, member of Cups and Dishes By the end of this tutorial, you should be able to query OpenFGA with queries like: Anne has access to Issues (expecting yes) Anne has access to Draft Pull Requests (expecting no) Anne has access to Single Sign-on (expecting no) Beth has access to Issues (expecting yes) Beth has access to Draft Pull Requests (expecting yes) Beth has access to Single Sign-on (expecting no) Charles has access to Issues (expecting yes) Charles has access to Draft Pull Requests (expecting yes) Charles has access to Single Sign-on (expecting yes)","s":"Defined Scenarios","u":"/docs/modeling/advanced/entitlements","h":"#defined-scenarios","p":710},{"i":724,"t":"In this tutorial you are going to take a different approach to previous tutorials. You will start with a simpleauthorization model, add relationship tuples to represent some sample scenarios, and iterate until those scenarios return the results you expect. In the scenarios outlined above, you have organizations, plans and features. Similar to the example above, start with a basic listing of the types and their relations: A feature has a plan associated to it, we'll call the relation between them associated_plan A plan has an organization as a subscriber to it An organization has users as members DSL JSON model schema 1.1 type user type feature relations define associated_plan: [plan] type plan relations define subscriber: [organization] type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] } } } }, { \"type\": \"plan\", \"relations\": { \"subscriber\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"subscriber\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"01. Building The Initial Authorization Model And Relationship Tuples","u":"/docs/modeling/advanced/entitlements","h":"#01-building-the-initial-authorization-model-and-relationship-tuples","p":710},{"i":726,"t":"Now you can add the relationship tuples to represent these relationships mentioned in the requirements and scenarios sections: The relations between the features and plans are as follows: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // the free plan is the associated plan of the issues feature { user: 'plan:free', relation: 'associated_plan', object: 'feature:issues'}, // the team plan is the associated plan of the issues feature { user: 'plan:team', relation: 'associated_plan', object: 'feature:issues'}, // the team plan is the associated plan of the draft pull requests feature { user: 'plan:team', relation: 'associated_plan', object: 'feature:draft_prs'}, // the enterprise plan is the associated plan of the issues feature { user: 'plan:enterprise', relation: 'associated_plan', object: 'feature:issues'}, // the enterprise plan is the associated plan of the draft pull requests feature { user: 'plan:enterprise', relation: 'associated_plan', object: 'feature:draft_prs'}, // the enterprise plan is the associated plan of the SAML Single Sign-on feature { user: 'plan:enterprise', relation: 'associated_plan', object: 'feature:sso'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // the free plan is the associated plan of the issues feature User: openfga.PtrString(\"plan:free\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:issues\"), }, { // the team plan is the associated plan of the issues feature User: openfga.PtrString(\"plan:team\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:issues\"), }, { // the team plan is the associated plan of the draft pull requests feature User: openfga.PtrString(\"plan:team\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:draft_prs\"), }, { // the enterprise plan is the associated plan of the issues feature User: openfga.PtrString(\"plan:enterprise\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:issues\"), }, { // the enterprise plan is the associated plan of the draft pull requests feature User: openfga.PtrString(\"plan:enterprise\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:draft_prs\"), }, { // the enterprise plan is the associated plan of the SAML Single Sign-on feature User: openfga.PtrString(\"plan:enterprise\"), Relation: openfga.PtrString(\"associated_plan\"), Object: openfga.PtrString(\"feature:sso\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // the free plan is the associated plan of the issues feature new() { User = \"plan:free\", Relation = \"associated_plan\", Object = \"feature:issues\" }, // the team plan is the associated plan of the issues feature new() { User = \"plan:team\", Relation = \"associated_plan\", Object = \"feature:issues\" }, // the team plan is the associated plan of the draft pull requests feature new() { User = \"plan:team\", Relation = \"associated_plan\", Object = \"feature:draft_prs\" }, // the enterprise plan is the associated plan of the issues feature new() { User = \"plan:enterprise\", Relation = \"associated_plan\", Object = \"feature:issues\" }, // the enterprise plan is the associated plan of the draft pull requests feature new() { User = \"plan:enterprise\", Relation = \"associated_plan\", Object = \"feature:draft_prs\" }, // the enterprise plan is the associated plan of the SAML Single Sign-on feature new() { User = \"plan:enterprise\", Relation = \"associated_plan\", Object = \"feature:sso\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # the free plan is the associated plan of the issues feature user=\"plan:free\", relation=\"associated_plan\", object=\"feature:issues\", ), ClientTuple( # the team plan is the associated plan of the issues feature user=\"plan:team\", relation=\"associated_plan\", object=\"feature:issues\", ), ClientTuple( # the team plan is the associated plan of the draft pull requests feature user=\"plan:team\", relation=\"associated_plan\", object=\"feature:draft_prs\", ), ClientTuple( # the enterprise plan is the associated plan of the issues feature user=\"plan:enterprise\", relation=\"associated_plan\", object=\"feature:issues\", ), ClientTuple( # the enterprise plan is the associated plan of the draft pull requests feature user=\"plan:enterprise\", relation=\"associated_plan\", object=\"feature:draft_prs\", ), ClientTuple( # the enterprise plan is the associated plan of the SAML Single Sign-on feature user=\"plan:enterprise\", relation=\"associated_plan\", object=\"feature:sso\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"plan:free\",\"relation\":\"associated_plan\",\"object\":\"feature:issues\"},{\"user\":\"plan:team\",\"relation\":\"associated_plan\",\"object\":\"feature:issues\"},{\"user\":\"plan:team\",\"relation\":\"associated_plan\",\"object\":\"feature:draft_prs\"},{\"user\":\"plan:enterprise\",\"relation\":\"associated_plan\",\"object\":\"feature:issues\"},{\"user\":\"plan:enterprise\",\"relation\":\"associated_plan\",\"object\":\"feature:draft_prs\"},{\"user\":\"plan:enterprise\",\"relation\":\"associated_plan\",\"object\":\"feature:sso\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:free associated_plan feature:issues fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:team associated_plan feature:issues fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:team associated_plan feature:draft_prs fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:enterprise associated_plan feature:issues fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:enterprise associated_plan feature:draft_prs fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:enterprise associated_plan feature:sso write([ // the free plan is the associated plan of the issues feature { \"user\":\"plan:free\", \"relation\":\"associated_plan\", \"object\":\"feature:issues\" }, // the team plan is the associated plan of the issues feature { \"user\":\"plan:team\", \"relation\":\"associated_plan\", \"object\":\"feature:issues\" }, // the team plan is the associated plan of the draft pull requests feature { \"user\":\"plan:team\", \"relation\":\"associated_plan\", \"object\":\"feature:draft_prs\" }, // the enterprise plan is the associated plan of the issues feature { \"user\":\"plan:enterprise\", \"relation\":\"associated_plan\", \"object\":\"feature:issues\" }, // the enterprise plan is the associated plan of the draft pull requests feature { \"user\":\"plan:enterprise\", \"relation\":\"associated_plan\", \"object\":\"feature:draft_prs\" }, // the enterprise plan is the associated plan of the SAML Single Sign-on feature { \"user\":\"plan:enterprise\", \"relation\":\"associated_plan\", \"object\":\"feature:sso\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") The relations between the plans and the organizations are as follows: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // the Alpha Beta Gamma organization is a subscriber of the free plan { user: 'organization:alpha', relation: 'subscriber', object: 'plan:free'}, // the Bayer Water Supplies organization is a subscriber of the team plan { user: 'organization:bayer', relation: 'subscriber', object: 'plan:team'}, // the Cups and Dishes organization is a subscriber of the enterprise plan { user: 'organization:cups', relation: 'subscriber', object: 'plan:enterprise'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // the Alpha Beta Gamma organization is a subscriber of the free plan User: openfga.PtrString(\"organization:alpha\"), Relation: openfga.PtrString(\"subscriber\"), Object: openfga.PtrString(\"plan:free\"), }, { // the Bayer Water Supplies organization is a subscriber of the team plan User: openfga.PtrString(\"organization:bayer\"), Relation: openfga.PtrString(\"subscriber\"), Object: openfga.PtrString(\"plan:team\"), }, { // the Cups and Dishes organization is a subscriber of the enterprise plan User: openfga.PtrString(\"organization:cups\"), Relation: openfga.PtrString(\"subscriber\"), Object: openfga.PtrString(\"plan:enterprise\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // the Alpha Beta Gamma organization is a subscriber of the free plan new() { User = \"organization:alpha\", Relation = \"subscriber\", Object = \"plan:free\" }, // the Bayer Water Supplies organization is a subscriber of the team plan new() { User = \"organization:bayer\", Relation = \"subscriber\", Object = \"plan:team\" }, // the Cups and Dishes organization is a subscriber of the enterprise plan new() { User = \"organization:cups\", Relation = \"subscriber\", Object = \"plan:enterprise\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # the Alpha Beta Gamma organization is a subscriber of the free plan user=\"organization:alpha\", relation=\"subscriber\", object=\"plan:free\", ), ClientTuple( # the Bayer Water Supplies organization is a subscriber of the team plan user=\"organization:bayer\", relation=\"subscriber\", object=\"plan:team\", ), ClientTuple( # the Cups and Dishes organization is a subscriber of the enterprise plan user=\"organization:cups\", relation=\"subscriber\", object=\"plan:enterprise\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"organization:alpha\",\"relation\":\"subscriber\",\"object\":\"plan:free\"},{\"user\":\"organization:bayer\",\"relation\":\"subscriber\",\"object\":\"plan:team\"},{\"user\":\"organization:cups\",\"relation\":\"subscriber\",\"object\":\"plan:enterprise\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:alpha subscriber plan:free fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:bayer subscriber plan:team fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:cups subscriber plan:enterprise write([ // the Alpha Beta Gamma organization is a subscriber of the free plan { \"user\":\"organization:alpha\", \"relation\":\"subscriber\", \"object\":\"plan:free\" }, // the Bayer Water Supplies organization is a subscriber of the team plan { \"user\":\"organization:bayer\", \"relation\":\"subscriber\", \"object\":\"plan:team\" }, // the Cups and Dishes organization is a subscriber of the enterprise plan { \"user\":\"organization:cups\", \"relation\":\"subscriber\", \"object\":\"plan:enterprise\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") The relations between the organizations and the users are as follows: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // anne is a member of the Alpha Beta Gamma organization { user: 'user:anne', relation: 'member', object: 'organization:alpha'}, // beth is a member of the Bayer Water Supplies { user: 'user:beth', relation: 'member', object: 'organization:bayer'}, // charles is a member of the Cups and Dishes organization { user: 'user:charles', relation: 'member', object: 'organization:cups'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // anne is a member of the Alpha Beta Gamma organization User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"organization:alpha\"), }, { // beth is a member of the Bayer Water Supplies User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"organization:bayer\"), }, { // charles is a member of the Cups and Dishes organization User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"organization:cups\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // anne is a member of the Alpha Beta Gamma organization new() { User = \"user:anne\", Relation = \"member\", Object = \"organization:alpha\" }, // beth is a member of the Bayer Water Supplies new() { User = \"user:beth\", Relation = \"member\", Object = \"organization:bayer\" }, // charles is a member of the Cups and Dishes organization new() { User = \"user:charles\", Relation = \"member\", Object = \"organization:cups\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # anne is a member of the Alpha Beta Gamma organization user=\"user:anne\", relation=\"member\", object=\"organization:alpha\", ), ClientTuple( # beth is a member of the Bayer Water Supplies user=\"user:beth\", relation=\"member\", object=\"organization:bayer\", ), ClientTuple( # charles is a member of the Cups and Dishes organization user=\"user:charles\", relation=\"member\", object=\"organization:cups\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"member\",\"object\":\"organization:alpha\"},{\"user\":\"user:beth\",\"relation\":\"member\",\"object\":\"organization:bayer\"},{\"user\":\"user:charles\",\"relation\":\"member\",\"object\":\"organization:cups\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member organization:alpha fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth member organization:bayer fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles member organization:cups write([ // anne is a member of the Alpha Beta Gamma organization { \"user\":\"user:anne\", \"relation\":\"member\", \"object\":\"organization:alpha\" }, // beth is a member of the Bayer Water Supplies { \"user\":\"user:beth\", \"relation\":\"member\", \"object\":\"organization:bayer\" }, // charles is a member of the Cups and Dishes organization { \"user\":\"user:charles\", \"relation\":\"member\", \"object\":\"organization:cups\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") So far you have given OpenFGA a representation of the current state of your system's relationships. You will keep iterating and updating the authorization model until the results of the queries match what you expect. caution In production, it is highly recommended to use unique, immutable identifiers. Names are used in this article to make it easier to read and follow. For example, the relationship tuple indicating that anne is a member of organization:alpha could be written as: user: user:2b4840f2-7c9c-42c8-9329-911002051524 relation: member object: project:52e529c6-c571-4d5c-b78a-bc574cf98b54 Verification​ Now that you have some data, you can start using it to ask is ${USER} related to ${OBJECT} as ${RELATION}? First, you will check if anne is a member of organization:alpha. This is one of the relationship tuples you previously added, you will make sure OpenFGA can detect a relation in this case. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'member', object: 'organization:alpha', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"member\", Object: \"organization:alpha\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"member\", Object = \"organization:alpha\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"member\", object=\"organization:alpha\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member organization:alpha # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"member\",\"object\":\"organization:alpha\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"member\", // has an `member` relation object = \"organization:alpha\", // with the object `organization:alpha` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Querying for relationship tuples that you fed into OpenFGA earlier should work, try a few before proceeding to make sure everything is working well. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'member', object: 'organization:bayer', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"member\", Object: \"organization:bayer\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"member\", Object = \"organization:bayer\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"member\", object=\"organization:bayer\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member organization:bayer # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"member\",\"object\":\"organization:bayer\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"member\", // has an `member` relation object = \"organization:bayer\", // with the object `organization:bayer` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'organization:bayer', relation: 'subscriber', object: 'plan:team', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"organization:bayer\", Relation: \"subscriber\", Object: \"plan:team\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"organization:bayer\", Relation = \"subscriber\", Object = \"plan:team\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"organization:bayer\", relation=\"subscriber\", object=\"plan:team\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:bayer subscriber plan:team # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"organization:bayer\",\"relation\":\"subscriber\",\"object\":\"plan:team\"}}' # Response: {\"allowed\":true} check( user = \"organization:bayer\", // check if the user `organization:bayer` relation = \"subscriber\", // has an `subscriber` relation object = \"plan:team\", // with the object `plan:team` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'plan:free', relation: 'associated_plan', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"plan:free\", Relation: \"associated_plan\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"plan:free\", Relation = \"associated_plan\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"plan:free\", relation=\"associated_plan\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw plan:free associated_plan feature:issues # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"plan:free\",\"relation\":\"associated_plan\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":true} check( user = \"plan:free\", // check if the user `plan:free` relation = \"associated_plan\", // has an `associated_plan` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"02. Populating The Relationship Tuples","u":"/docs/modeling/advanced/entitlements","h":"#02-populating-the-relationship-tuples","p":710},{"i":728,"t":"You are working towards OpenFGA returning the correct answer when you query whether anne has access to feature:issues. It won't work yet, but you will keep updating your configuration to reach that goal. To start, try to run that query on is anne related to feature:issues as access? Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'access', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = undefined Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"access\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: undefined } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"access\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = undefined Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"access\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = undefined Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues # Response: {\"allowed\":undefined} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"access\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":undefined} check( user = \"user:anne\", // check if the user `user:anne` relation = \"access\", // has an `access` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: undefined The OpenFGA service is returning that the query tuple is invalid. That is because you are asking for relation as access, but that relation is not in the configuration of the feature type! Add it now. Like so: DSL JSON type feature relations define associated_plan: [plan] define access: [user] { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } info access relation was added to the configuration of the feature type. note In this tutorial, you will find the phrases direct relationship and implied relationship. A direct relationship R between user X and object Y means the relationship tuple (user=X, relation=R, object=Y) exists, and the OpenFGA authorization model for that relation allows this direct relationship (by use of direct relationship type restrictions). An implied relationship R exists between user X and object Y if user X is related to an object Z that is in direct or implied relationship with object Y, and the OpenFGA authorization model allows it. The resulting updated configuration would be: DSL JSON model schema 1.1 type user type feature relations define associated_plan: [plan] define access: [user] type plan relations define subscriber: [organization] type organization relations define member: [] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"plan\", \"relations\": { \"subscriber\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"subscriber\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"subscriber\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Adding Modeling Pattern Of Parent-Child Objects​ Now we can ask the following query: is anne related to feature:issues as access? again. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'access', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"access\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"access\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"access\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"access\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"access\", // has an `access` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false So far so good. OpenFGA understood your query, but said that no relation exists. That is because according to the configuration provided so far, there is no access relation between anne and feature:issues. We can also try to query is organization:alpha related to feature:issues as access? and we see that there is no relationship. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'organization:alpha', relation: 'access', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"organization:alpha\", Relation: \"access\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"organization:alpha\", Relation = \"access\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"organization:alpha\", relation=\"access\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:alpha access feature:issues # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"organization:alpha\",\"relation\":\"access\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":false} check( user = \"organization:alpha\", // check if the user `organization:alpha` relation = \"access\", // has an `access` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false If you have already completed some of the other tutorials you might have encountered the modeling pattern of parent-child objects which is modeled as such: DSL JSON type resource relations define viewer: all_objects_viewer from parent { \"type\": \"resource\", \"relations\": { \"viewer\": { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"parent\" }, \"computedUserset\": { \"relation\": \"all_objects_viewer\" } } } } } info With this, when asked to check a user's viewer relationship with the object, OpenFGA will: Read all relationship tuples of users related to this particular object as relation parent For each relationship tuple, return all usersets that have all_objects_viewer relation to the objects in those relationship tuples If the user is in any of those usersets, return yes, as the user is a viewer on this object. In other words, users related as all_objects_viewer to any of this object's parents are related as viewer to this object. If you want to give all subscribers on a plan access to a feature, you can do it like so: DSL JSON type feature relations define associated_plan: [plan] define access: [user] or subscriber from associated_plan { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber\" } } } ] } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } info Users related to feature as access are the union of (any of): the set of users with a direct access relation the set of users related to the associated_plan as subscriber (the feature's associated plans' subscribers) So everyone who has direct access, as well as the subscribers of the associated plan That would mean that in order for an object to have an access relation to a feature y, there needs to be either: a direct relationship via a relationship tuple: e.g. { \"user\": \"user:x\", \"relation\": \"access\", \"object\": \"feature:y\" } a subscriber relationship with another object related to x associated_plan: e.g. { \"user\": \"user:x\", \"relation\": \"subscriber\", \"object\": \"plan:z\" } { \"user\": \"plan:z\", \"relation\": \"associated_plan\", \"object\": \"feature:y\" } That brings you close. That will allow you to grant organizations access to the feature (as organizations have a subscriber relation with the plan). Adding Subscriber Relationship With Another Object Related To x associated_plan​ One way forward would be to add a direct access relation between a user and a feature e.g. { \"user\": \"anne\", \"relation\": \"access\", \"object\": \"feature:y\" } whenever the organization anne is subscribed to a plan, or the organization anne is in subscribes to a new plan. But there are several downsides to this: Your application layer now needs to worry about computing this relationship. Instead of letting OpenFGA figure this all out, the app layer needs to do the checks whenever a user is being added or removed If an organization changes its subscription, your application layer has to loop through all the users and update their access relationships to features accordingly Later in this tutorial, you will remove the possibility of having a direct access relation completely, but for now you will make sure the changes to the store you have made so far are working. Replace all the existing code you had previously with the updated authorization model from the below snippet. DSL JSON model schema 1.1 type user type feature relations define associated_plan: [plan] define access: [user] or subscriber from associated_plan type plan relations define subscriber: [organization] type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber\" } } } ] } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"plan\", \"relations\": { \"subscriber\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"subscriber\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Now we can ask following query: is organization:alpha related to feature:issues as access? again. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'organization:alpha', relation: 'access', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"organization:alpha\", Relation: \"access\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"organization:alpha\", Relation = \"access\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"organization:alpha\", relation=\"access\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:alpha access feature:issues # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"organization:alpha\",\"relation\":\"access\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":true} check( user = \"organization:alpha\", // check if the user `organization:alpha` relation = \"access\", // has an `access` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true You will notice that OpenFGA now did find a relation, as organization:alpha is a subscriber to plan:free which has an associated_plan relation to feature:issues. From that and the authorization model you updated above, OpenFGA deduced that organization:alpha has an implied access relation to feature:issues. That is good, but you want to be able to ask is anne related to feature:issues as access?, not is organization:alpha related to feature:issues as access?. As in, you want the subscriber members to have access to the feature, not the subscriber itself. In order to do that, you will add a relation on the plan, that indicates that all members of an organization subscribed to it, have a subscriber_member relation to the plan. And you can modify the change you did above to give implied access to the subscriber_member instead of the subscriber. Like so: DSL JSON model schema 1.1 type user type feature relations define associated_plan: [plan] define access: [user] or subscriber_member from associated_plan type plan relations define subscriber: [organization] define subscriber_member: member from subscriber type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber_member\" } } } ] } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"plan\", \"relations\": { \"subscriber\": { \"this\": {} }, \"subscriber_member\": { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"subscriber\" }, \"computedUserset\": { \"relation\": \"member\" } } } }, \"metadata\": { \"relations\": { \"subscriber\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Notice that subscriber has been updated to subscriber_member in the access relation of the feature type. Under the plan type, in order for someone to have a subscriber_member relation to the plan, they have to be related as a member to the object related as a subscriber to the plan (as in they have to be a member of on of the plan's subscribers). Now ask the following query: is anne related to feature:issues as access? Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'access', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"access\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"access\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"access\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"access\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"access\", // has an `access` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Disallow Direct Relationship​ So far, with just a OpenFGA authorization model, and the initial relationship tuples indicating the relations you know, you configured OpenFGA to give you the correct response. Earlier on, the idea of not allowing a direct access relation between a user and a feature was discussed, e.g. adding a relationship tuple like { \"user\": \"user:anne\", \"relation\": \"access\", \"object\": \"feature:y\" }. You will remove it now. To disallow a direct relationship, you need to remove the direct relationship type restriction. The following snippet: DSL JSON type feature relations define associated_plan: [plan] define access: [user] or subscriber_member from associated_plan { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber_member\" } } } ] } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] }, \"access\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } becomes DSL JSON type feature relations define associated_plan: [plan] define access: subscriber_member from associated_plan { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber_member\" } } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] } } } } With this change, even if your app layer added the following relationship tuple: { \"user\": \"user:anne\", \"relation\": \"access\", \"object\": feature:issues } a subsequent check for is anne related to feature:issues as access? would return no relation. The only way for a relation to exist is if the following three relationship tuples do: { \"user\": \"user:anne\", \"relation\": \"member\", \"object\": \"organization:z\" } { \"user\": \"organization:z\", \"relation\": \"subscriber\", \"object\": \"plan:y\" } { \"user\": \"plan:y\", \"relation\": \"associated_plan\", \"object\": \"feature:issues\" } Verification​ Ensure that your authorization model matches the one below DSL JSON model schema 1.1 type user type feature relations define associated_plan: [plan] define access: subscriber_member from associated_plan type plan relations define subscriber: [organization] define subscriber_member: member from subscriber type organization relations define member: [user] { \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"feature\", \"relations\": { \"associated_plan\": { \"this\": {} }, \"access\": { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"associated_plan\" }, \"computedUserset\": { \"relation\": \"subscriber_member\" } } } }, \"metadata\": { \"relations\": { \"associated_plan\": { \"directly_related_user_types\": [ { \"type\": \"plan\" } ] } } } }, { \"type\": \"plan\", \"relations\": { \"subscriber\": { \"this\": {} }, \"subscriber_member\": { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"subscriber\" }, \"computedUserset\": { \"relation\": \"member\" } } } }, \"metadata\": { \"relations\": { \"subscriber\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } You will now verify that the configuration is correct by running checks for all the scenarios mentioned at the beginning of the tutorial: Anne has access to Issues (expecting yes) Anne has access to Draft Pull Requests (expecting no) Anne has access to Single Sign-on (expecting no) Beth has access to Issues (expecting yes) Beth has access to Draft Pull Requests (expecting yes) Beth has access to Single Sign-on (expecting no) Charles has access to Issues (expecting yes) Charles has access to Draft Pull Requests (expecting yes) Charles has access to Single Sign-on (expecting yes) Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'access', object: 'feature:issues', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"access\", Object: \"feature:issues\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"access\", Object = \"feature:issues\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"access\", object=\"feature:issues\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne access feature:issues # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"access\",\"object\":\"feature:issues\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"access\", // has an `access` relation object = \"feature:issues\", // with the object `feature:issues` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Try to verify for the other user, object and relation combinations as listed below. User Object Relation Query Relation? anne feature:issues access is anne related to feature:issues as access? Yes anne feature:draft_prs access is anne related to feature:draft_prs as access? No anne feature:sso access is anne related to feature:sso as access? No beth feature:issues access is beth related to feature:issues as access? Yes beth feature:draft_prs access is beth related to feature:draft_prs as access? Yes beth feature:sso access is beth related to feature:sso as access? No charles feature:issues access is charles related to feature:issues as access? Yes charles feature:draft_prs access is charles related to feature:draft_prs as access? Yes charles feature:sso access is charles related to feature:sso as access? Yes","s":"03. Updating The Authorization Model","u":"/docs/modeling/advanced/entitlements","h":"#03-updating-the-authorization-model","p":710},{"i":730,"t":"In this tutorial, you learned: to model entitlements for a system in OpenFGA how to start with a set of requirements and scenarios and iterate on the OpenFGA authorization model until the checks match the expected scenarios how to model parent-child relationships to indicate that a user having a relationship with a certain object implies having a relationship with another object in OpenFGA how to use the union operator condition to indicate multiple possible paths for a relationship between two objects to be computed using direct relationship type restrictions in a OpenFGA authorization model, and how to block direct relationships by removing it Upcoming tutorials will dive deeper into OpenFGA, introducing concepts that will improve on the model you built today, and tackling different permission systems, with other relations and requirements that need to be met.","s":"Summary","u":"/docs/modeling/advanced/entitlements","h":"#summary","p":710},{"i":732,"t":"This tutorial explains how to model GitHub's Organization permission model using OpenFGA. This article from the GitHub docs has links to all other articles we are going to be exploring in this document. What you will learn Indicate relationships between a group of users and an object. See Modeling User Groups for more details. Used here to indicate that all members of an organization are repository admins on the organization. Modeling concentric relationship to have a certain relation on an object imply another relation on the same object. See Modeling Concepts: Concentric Relationships for more. Used here to indicate that maintainers of a repository are also writers of that repository. Using the union operator condition to indicate that a user might have a certain relation with an object if they match any of the criteria indicated. Used here to indicate that a user can be a reader on a repository, or can have the reader relationship implied through triager. Model parent-child objects to indicate that a user having a relationship with a certain object implies having a relationship with another object in OpenFGA. Used here to indicate that a repository admin on a GitHub organization, is an admin on all repositories that organization owns.","s":"Modeling GitHub permissions with OpenFGA","u":"/docs/modeling/advanced/github","h":"","p":731},{"i":734,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA concepts and know how to develop the things that we will list below. OpenFGA Concepts​ It would be helpful to have an understanding of some concepts of OpenFGA before you start. Modeling Concentric Relationships​ You need to know how to update the authorization model to allow having nested relations such as all writers are readers. Learn more → Modeling Object-to-Object Relationships​ You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more → Used here to indicate that users who have repo admin access on an organization, have admin access to all repositories owned by that organization. Concepts & Configuration Language​ Some OpenFGA Concepts Configuration Language","s":"Before You Start","u":"/docs/modeling/advanced/github","h":"#before-you-start","p":731},{"i":736,"t":"It would be helpful to have an understanding of some concepts of OpenFGA before you start.","s":"OpenFGA Concepts","u":"/docs/modeling/advanced/github","h":"#-concepts","p":731},{"i":738,"t":"GitHub is a system to develop and collaborate on code. In this tutorial, you will build a subset of the GitHub permission model (detailed below) in OpenFGA, using some scenarios to validate the model. Note: For brevity, this tutorial will not model all of GitHub's permissions. Instead, it will focus on modeling for the scenarios outlined below","s":"What You Will Be Modeling","u":"/docs/modeling/advanced/github","h":"#what-you-will-be-modeling","p":731},{"i":740,"t":"GitHub's permission model is represented in their documentation. In this tutorial, you will be focusing on a subset of these permissions. Requirements: Users can be admins, maintainers, writers, triagers or readers of repositories (each level inherits all access of the level lower than it. e.g. admins inherit maintainer access and so forth) Teams can have members Organizations can have members Organizations can own repositories Users can have repository admin access on organizations, and thus have admin access to all repositories owned by that organization","s":"Requirements","u":"/docs/modeling/advanced/github","h":"#requirements","p":731},{"i":742,"t":"There will be the following users: Anne Beth Charles, a member of the contoso/engineering team Diane, a member of the contoso/protocols team Erik, a member of the contoso org And these requirements: members of the contoso/protocols team are members of the contoso/engineering team members of the contoso org are repo_admins on the org repo admins on the org are admins on all the repos the org owns There will be a: contoso/tooling repository, owned by the contoso org and of which Beth is a writer and Anne is a reader and members of the contoso/engineering team are admins","s":"Defined Scenarios","u":"/docs/modeling/advanced/github","h":"#defined-scenarios","p":731},{"i":745,"t":"GitHub has 5 different permission levels for repositories: At the end of this section we want to end up with the following permissions represented: To represent permissions in OpenFGA we use relations. For repository permissions we need to create the following authorization model: DSL JSON model schema 1.1 type user type repo relations define reader: [user] define triager: [user] define writer: [user] define maintainer: [user] define admin: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"reader\": { \"this\": {} }, \"triager\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"maintainer\": { \"this\": {} }, \"admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"triager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"maintainer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The OpenFGA service determines if a user has access to an object by checking if the user has a relation to that object. Let us examine one of those relations in detail: DSL JSON model schema 1.1 type user type repo relations define reader: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"reader\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Objects of type \"repo\" have users related to them as \"reader\" if those users belong to the userset of all users related to the repo as \"reader\" If we want to say anne is a reader of repository repo:contoso/tooling we create this relationship tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'reader', object: 'repo:contoso/tooling'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"reader\"), Object: openfga.PtrString(\"repo:contoso/tooling\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"reader\", Object = \"repo:contoso/tooling\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"reader\", object=\"repo:contoso/tooling\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"repo:contoso/tooling\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader repo:contoso/tooling write([ { \"user\":\"user:anne\", \"relation\":\"reader\", \"object\":\"repo:contoso/tooling\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") We can now ask OpenFGA \"is anne a reader of repository repo:contoso/tooling?\" Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'reader', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"reader\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"reader\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"reader\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne reader repo:contoso/tooling # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"reader\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"reader\", // has an `reader` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true We could also say that beth is a writer of the same repository: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:beth', relation: 'writer', object: 'repo:contoso/tooling'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"repo:contoso/tooling\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:beth\", Relation = \"writer\", Object = \"repo:contoso/tooling\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:beth\", relation=\"writer\", object=\"repo:contoso/tooling\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:beth\",\"relation\":\"writer\",\"object\":\"repo:contoso/tooling\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth writer repo:contoso/tooling write([ { \"user\":\"user:beth\", \"relation\":\"writer\", \"object\":\"repo:contoso/tooling\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") And ask some questions to OpenFGA: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'writer', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"writer\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"writer\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"writer\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth writer repo:contoso/tooling # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"writer\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"writer\", // has an `writer` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'reader', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"reader\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"reader\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"reader\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth reader repo:contoso/tooling # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"reader\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":false} check( user = \"user:beth\", // check if the user `user:beth` relation = \"reader\", // has an `reader` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false The first reply makes sense but the second one does not. Intuitively, if beth was writer, she was also be a reader. In fact, GitHub explains this in their documentation To make OpenFGA aware of this \"concentric\" permission model we need to update our definitions: DSL JSON model schema 1.1 type user type repo relations define reader: [user] or triager define triager: [user] or writer define writer: [user] or maintainer define maintainer: [user] or admin define admin: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"triager\" } } ] } }, \"triager\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"maintainer\" } } ] } }, \"maintainer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"admin\" } } ] } }, \"admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"triager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"maintainer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Let us examine one of those relations in detail: DSL JSON type repo relations define reader: [user] or triager { \"type\": \"repo\", \"relations\": { \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"triager\" } } ] } } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } info The users with a reader relationship to a certain object of type \"repo\" are any of: the \"readers\": the set of users who are directly related to the repo as a \"reader\" the \"triagers\": the set of users who are related to the object as \"triager\" With this simple update our model now supports nested definitions and now: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'writer', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"writer\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"writer\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"writer\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth writer repo:contoso/tooling # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"writer\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"writer\", // has an `writer` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'reader', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"reader\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"reader\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"reader\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth reader repo:contoso/tooling # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"reader\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"reader\", // has an `reader` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"01. Permissions For Individuals In An Org","u":"/docs/modeling/advanced/github","h":"#01-permissions-for-individuals-in-an-org","p":731},{"i":747,"t":"GitHub also supports creating teams in an organization, adding members to a team and granting teams permissions, rather than individuals. At the end of this section we want to end up with the following permissions represented: To add support for teams and memberships all we need to do is add this object to the OpenFGA authorization model: DSL JSON model schema 1.1 type team relations define member: [user, team#member] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"team\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } } ] } In addition, the repo's relations should be add team member as a directly related user types. DSL JSON model schema 1.1 type user type repo relations define reader: [user, team#member] or triager define triager: [user, team#member] or writer define writer: [user, team#member] or maintainer define maintainer: [user, team#member] or admin define admin: [user, team#member] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"triager\" } } ] } }, \"triager\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"maintainer\" } } ] } }, \"maintainer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"admin\" } } ] } }, \"admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"triager\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"maintainer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] } } } } ] } Let us now create a team, add a member to it and make it an admin of repo:contoso/tooling by adding the following relationship tuples: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // make charles a member of the contoso/engineering team { user: 'user:charles', relation: 'member', object: 'team:contoso/engineering'}, // make members of contoso/engineering team admins of contoso/tooling { user: 'team:contoso/engineering#member', relation: 'admin', object: 'repo:contoso/tooling'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // make charles a member of the contoso/engineering team User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"team:contoso/engineering\"), }, { // make members of contoso/engineering team admins of contoso/tooling User: openfga.PtrString(\"team:contoso/engineering#member\"), Relation: openfga.PtrString(\"admin\"), Object: openfga.PtrString(\"repo:contoso/tooling\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // make charles a member of the contoso/engineering team new() { User = \"user:charles\", Relation = \"member\", Object = \"team:contoso/engineering\" }, // make members of contoso/engineering team admins of contoso/tooling new() { User = \"team:contoso/engineering#member\", Relation = \"admin\", Object = \"repo:contoso/tooling\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # make charles a member of the contoso/engineering team user=\"user:charles\", relation=\"member\", object=\"team:contoso/engineering\", ), ClientTuple( # make members of contoso/engineering team admins of contoso/tooling user=\"team:contoso/engineering#member\", relation=\"admin\", object=\"repo:contoso/tooling\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:charles\",\"relation\":\"member\",\"object\":\"team:contoso/engineering\"},{\"user\":\"team:contoso/engineering#member\",\"relation\":\"admin\",\"object\":\"repo:contoso/tooling\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles member team:contoso/engineering fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw team:contoso/engineering#member admin repo:contoso/tooling write([ // make charles a member of the contoso/engineering team { \"user\":\"user:charles\", \"relation\":\"member\", \"object\":\"team:contoso/engineering\" }, // make members of contoso/engineering team admins of contoso/tooling { \"user\":\"team:contoso/engineering#member\", \"relation\":\"admin\", \"object\":\"repo:contoso/tooling\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") The last relationship tuple introduces a new OpenFGA concept. A userset. When the value of a user is formatted like this type:objectId#relation, OpenFGA will automatically expand the userset into all its individual user identifiers: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:charles', relation: 'admin', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:charles\", Relation: \"admin\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:charles\", Relation = \"admin\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:charles\", relation=\"admin\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles admin repo:contoso/tooling # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:charles\",\"relation\":\"admin\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":true} check( user = \"user:charles\", // check if the user `user:charles` relation = \"admin\", // has an `admin` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"02. Permissions For Teams In An Org","u":"/docs/modeling/advanced/github","h":"#02-permissions-for-teams-in-an-org","p":731},{"i":749,"t":"GitHub also supports team nesting, known as \"child teams\". Child teams inherit the access permissions of the parent team. Let's say we have a protocols team that is part of the engineering. The simplest way to achieve the aforementioned requirement is just adding this relationship tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'team:contoso/protocols#member', relation: 'member', object: 'team:contoso/engineering'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"team:contoso/protocols#member\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"team:contoso/engineering\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"team:contoso/protocols#member\", Relation = \"member\", Object = \"team:contoso/engineering\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"team:contoso/protocols#member\", relation=\"member\", object=\"team:contoso/engineering\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"team:contoso/protocols#member\",\"relation\":\"member\",\"object\":\"team:contoso/engineering\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw team:contoso/protocols#member member team:contoso/engineering write([ { \"user\":\"team:contoso/protocols#member\", \"relation\":\"member\", \"object\":\"team:contoso/engineering\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") which says that members of protocols are members of engineering. Note: this is enough and valid for our current requirements, and for other read cases allows determining members of the direct team vs sub teams as the latter come from team:contoso/protocols#member. If the #member relation should not be followed for use cases a different approach could be taken. We can now add a member to the protocols team and check that they are admins of the tooling repository. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // make diane a member of the contoso/protocols team { user: 'user:diane', relation: 'member', object: 'team:contoso/protocols'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // make diane a member of the contoso/protocols team User: openfga.PtrString(\"user:diane\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"team:contoso/protocols\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // make diane a member of the contoso/protocols team new() { User = \"user:diane\", Relation = \"member\", Object = \"team:contoso/protocols\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # make diane a member of the contoso/protocols team user=\"user:diane\", relation=\"member\", object=\"team:contoso/protocols\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:diane\",\"relation\":\"member\",\"object\":\"team:contoso/protocols\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane member team:contoso/protocols write([ // make diane a member of the contoso/protocols team { \"user\":\"user:diane\", \"relation\":\"member\", \"object\":\"team:contoso/protocols\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:diane', relation: 'admin', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:diane\", Relation: \"admin\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:diane\", Relation = \"admin\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:diane\", relation=\"admin\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane admin repo:contoso/tooling # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:diane\",\"relation\":\"admin\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":true} check( user = \"user:diane\", // check if the user `user:diane` relation = \"admin\", // has an `admin` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true At the end of this section ended with the following permissions represented:","s":"03. Permissions For Child Teams In An Org","u":"/docs/modeling/advanced/github","h":"#03-permissions-for-child-teams-in-an-org","p":731},{"i":751,"t":"In GitHub, \"you can set base permissions that apply to all members of an organization when accessing any of the organization's repositories\". For our purposes this means that if: User erik is a member of an organization contoso and contoso has a repository tooling and contoso has configured base permission to be \"write\" then erik has write permissions to tooling. Let us model that! At the end of this section we want to end up with the following permissions represented: We need to introduce the notion of organization as a type, user organization membership and repository ownership as a relation. - It is worth calling that before this addition we were able to represent almost the entire GitHub repo permissions without adding the notion of organization to OpenFGA. Identifiers for users, repositories and teams were all that was necessary. Let us add support for organizations and membership. Hopefully this feels familiar by now: DSL JSON model schema 1.1 type organization relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"organization\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } And support for repositories having owners: DSL JSON model schema 1.1 type repo relations define reader: [user, team#member] or triager define triager: [user, team#member] or writer define writer: [user, team#member] or maintainer define maintainer: [user, team#member] or admin define admin: [user, team#member] define owner: [organization] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"repo\", \"relations\": { \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"triager\" } } ] } }, \"triager\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"maintainer\" } } ] } }, \"maintainer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"admin\" } } ] } }, \"admin\": { \"this\": {} }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"triager\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"maintainer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } } ] } info Note the added \"owner\" relation, indicating that organizations can own repositories. We can now make Erik a member of contoso and make contoso own contoso/tooling: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:erik', relation: 'member', object: 'organization:contoso'}, { user: 'organization:contoso', relation: 'owner', object: 'repo:contoso/tooling'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:erik\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"organization:contoso\"), }, { User: openfga.PtrString(\"organization:contoso\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"repo:contoso/tooling\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:erik\", Relation = \"member\", Object = \"organization:contoso\" }, new() { User = \"organization:contoso\", Relation = \"owner\", Object = \"repo:contoso/tooling\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:erik\", relation=\"member\", object=\"organization:contoso\", ), ClientTuple( user=\"organization:contoso\", relation=\"owner\", object=\"repo:contoso/tooling\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:erik\",\"relation\":\"member\",\"object\":\"organization:contoso\"},{\"user\":\"organization:contoso\",\"relation\":\"owner\",\"object\":\"repo:contoso/tooling\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik member organization:contoso fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:contoso owner repo:contoso/tooling write([ { \"user\":\"user:erik\", \"relation\":\"member\", \"object\":\"organization:contoso\" }, { \"user\":\"organization:contoso\", \"relation\":\"owner\", \"object\":\"repo:contoso/tooling\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") What we still lack is the ability to create \"default permissions\" for the organization and have those be considered when determining if a user has a particular relation to a repository. Let's start with the simplest case admin. We want to say that a user is a admin of a repo if either: [done] they have a repo admin relation (directly or through team membership) [pending] their organization is configured with repo_admin as the base permission We need a way to consider the organization members, not just direct relations to the repo when getting a check for: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:erik', relation: 'admin', object: 'repo:contoso/tooling', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = undefined Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:erik\", Relation: \"admin\", Object: \"repo:contoso/tooling\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: undefined } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:erik\", Relation = \"admin\", Object = \"repo:contoso/tooling\", }; var response = await fgaClient.Check(body, options); // response.Allowed = undefined Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:erik\", relation=\"admin\", object=\"repo:contoso/tooling\", ) response = await fga_client.check(body, options) # response.allowed = undefined Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik admin repo:contoso/tooling # Response: {\"allowed\":undefined} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:erik\",\"relation\":\"admin\",\"object\":\"repo:contoso/tooling\"}}' # Response: {\"allowed\":undefined} check( user = \"user:erik\", // check if the user `user:erik` relation = \"admin\", // has an `admin` relation object = \"repo:contoso/tooling\", // with the object `repo:contoso/tooling` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: undefined More details on this technique can be found in the section Modeling Parent-Child Objects. We express it like this: DSL JSON type repo relations define admin: [user, team#member, organization#member] or repo_admin from owner { \"type_definitions\": [ { \"type\": \"repo\", \"relations\": { \"admin\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"owner\" }, \"computedUserset\": { \"relation\": \"repo_admin\" } } } ] } } }, \"metadata\": { \"relations\": { \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] } } } } ] } info The users with an admin relationship to a certain object of type \"repo\" are any of: the \"admins\": the set of users who are directly related to the repo as an \"admin\" the \"repository admins of the org that owns the repo\": from the objects who are related to the doc as owner, return the sets of users who are related to those objects as \"repo_admin\" What the added section is doing is: read all relationship tuples related to repo:contoso/tooling as owner which returns: [{ \"object\": \"repo:contoso/tooling\", \"relation\": \"owner\", \"user\": \"organization:contoso\" }] for each relationship tuple read, return all usersets that match the following, returning tuples of shape: { \"object\": \"organization:contoso\", \"relation\": \"repo_admin\", \"user\": ??? } What should the users in those relationship tuples with ??? be? Well: If the base permission for org contoso is repo_admin then it should be organization:contoso#member. If the base permission for org contoso is NOT repo_admin, then it should be empty (no relationship tuple). Whenever the value of this dropdown changes: Delete the previous relationship tuple and create a new one: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'organization:contoso#member', relation: 'repo_admin', object: 'organization:contoso'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"organization:contoso#member\"), Relation: openfga.PtrString(\"repo_admin\"), Object: openfga.PtrString(\"organization:contoso\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"organization:contoso#member\", Relation = \"repo_admin\", Object = \"organization:contoso\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"organization:contoso#member\", relation=\"repo_admin\", object=\"organization:contoso\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"organization:contoso#member\",\"relation\":\"repo_admin\",\"object\":\"organization:contoso\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw organization:contoso#member repo_admin organization:contoso write([ { \"user\":\"organization:contoso#member\", \"relation\":\"repo_admin\", \"object\":\"organization:contoso\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") The updated authorization model looks like this: DSL JSON model schema 1.1 type user type repo relations define admin: [user, team#member, organization#member] or admin from owner define maintainer: [user, team#member, organization#member] or admin define writer: [user, team#member, organization#member] or maintainer or writer from owner define triager: [user, team#member, organization#member] or writer define reader: [user, team#member, organization#member] or triager or reader from owner define owner: [organization] type organization relations define owner: [organization] define repo_admin: [user, team#member, organization#member] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"repo\", \"relations\": { \"admin\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"admin\" }, \"tupleset\": { \"relation\": \"owner\" } } } ] } }, \"maintainer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"admin\" } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"maintainer\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"writer\" }, \"tupleset\": { \"relation\": \"owner\" } } } ] } }, \"triager\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"reader\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"triager\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"reader\" }, \"tupleset\": { \"relation\": \"owner\" } } } ] } }, \"owner\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"reader\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] }, \"triager\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] }, \"maintainer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] }, \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] } } } }, { \"type\": \"organization\", \"relations\": { \"owner\": { \"this\": {} }, \"repo_admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"organization\" } ] }, \"repo_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"team\", \"relation\": \"member\" }, { \"type\": \"organization\", \"relation\": \"member\" } ] } } } } ] }","s":"04. Base Permissions For Org Members","u":"/docs/modeling/advanced/github","h":"#04-base-permissions-for-org-members","p":731},{"i":753,"t":"GitHub has a number of other permissions. You have organization billing managers, users that can manage specific apps, etc. We might explore those in the future, but hopefully this blog post has shown you how you could represent those cases using OpenFGA.","s":"Summary","u":"/docs/modeling/advanced/github","h":"#summary","p":731},{"i":755,"t":"This tutorial explains how to model permissions for an IoT system using OpenFGA. What you will learn How to model a permission system using OpenFGA How to see OpenFGA Authorization in action by modeling an IoT Security Camera System","s":"Modeling Authorization for an IoT Security System with OpenFGA","u":"/docs/modeling/advanced/iot","h":"","p":754},{"i":757,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA concepts and know how to develop the things that we will list below. OpenFGA Concepts​ It would be helpful to have an understanding of some concepts of OpenFGA before you start. Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → Modeling Concentric Relationships​ You need to know how to update the authorization model to allow having nested relations such as all writers are readers. Learn more → Used here to indicate that both IT Admins and Security Guards can view live video. Direct Relationships​ You need to know how to disallow granting direct relation to an object and requiring the user to have a relation with another object that would imply a relation with the first one. Learn more → Used here to indicate that \"Rename Device\" is a permission that cannot be assigned directly, but can only be granted through the \"IT Admin\" role. User Groups​ You need to know how to add users to groups and create relationships between groups of users and an object. Learn more → Used here to indicate that security guards on a certain group are security guards on a device in that group. Concepts & Configuration Language​ Some OpenFGA Concepts Configuration Language","s":"Before You Start","u":"/docs/modeling/advanced/iot","h":"#before-you-start","p":754},{"i":759,"t":"It would be helpful to have an understanding of some concepts of OpenFGA before you start.","s":"OpenFGA Concepts","u":"/docs/modeling/advanced/iot","h":"#-concepts","p":754},{"i":761,"t":"In this tutorial, you will build an authorization model for a sample IoT Security Camera System (detailed below) using OpenFGA. You will use some scenarios to validate the model. The goal by the end of this post is to ask OpenFGA: Does person X have permission to perform action Y on device Z? In response, you want to either get a confirmation that person X can indeed do that, or a rejection that they cannot.","s":"What You Will Be Modeling","u":"/docs/modeling/advanced/iot","h":"#what-you-will-be-modeling","p":754},{"i":763,"t":"These are the requirements: Security guards have access to view live and recorded video from Devices. IT Admins can view live and recorded videos, as well as rename Devices. To make access management easier, Devices can be grouped into Device Groups. Security guards with access to the Device Group are Security Guards with access to each Device in the group. Similarly for IT Admins.","s":"Requirements","u":"/docs/modeling/advanced/iot","h":"#requirements","p":754},{"i":765,"t":"Use the following scenarios to be able to validate whether the model of the requirements is correct. There will be the following users: Anne Beth Charles Dianne These users have the following roles and permissions: Anne is a Security Guard with access to only Device 1 Beth is an IT Admin with access to only Device 1 Charles is a Security Guard with access to Device 1 and everything in Device Group 1 (which is Device 2 and Device 3) Dianne is an IT Admin with access to Device 1 and everything in Device Group 1 caution In production, it is highly recommended to use unique, immutable identifiers. Names are used in this article to make it easier to read and follow.","s":"Defined Scenarios","u":"/docs/modeling/advanced/iot","h":"#defined-scenarios","p":754},{"i":767,"t":"The OpenFGA service is based on Zanzibar, a Relationship Based Access Control system. This means it relies on object and user relations to perform authorization checks. Starting with devices, you will learn how to express the requirements in terms of relations you can feed into OpenFGA.","s":"Modeling Device Authorization","u":"/docs/modeling/advanced/iot","h":"#modeling-device-authorization","p":754},{"i":769,"t":"The requirements stated: Security guards have access to view live and recorded video from Devices. IT Admins can view live and recorded videos, as well as rename Devices. The goal is to ask OpenFGA whether person X has permission to perform action Y on device Z. To start, you will set aside the Security Guard and IT Admin designations and focus on the actions a user can take. The actions users can take on a device are: view live videos, view recorded videos, and rename devices. Mapping them to relations, they become: live_video_viewer, recorded_video_viewer, device_renamer. In OpenFGA, the authorization model for the device would be: DSL JSON model schema 1.1 type user type device relations define live_video_viewer: [user] define recorded_video_viewer: [user] define device_renamer: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"device\", \"relations\": { \"live_video_viewer\": { \"this\": {} }, \"recorded_video_viewer\": { \"this\": {} }, \"device_renamer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"live_video_viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"recorded_video_viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"device_renamer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"01. Writing The Initial Model For A Device","u":"/docs/modeling/advanced/iot","h":"#01-writing-the-initial-model-for-a-device","p":754},{"i":771,"t":"The requirements are: Anne is a Security Guard with access to only Device 1 Beth is an IT Admin with access to only Device 1 Security Guards can view live and recorded video IT Admins can view live and recorded video and rename devices Before we tackle the problem of users access to device based on their role, we will try to grant user access based on their view relationship directly. We will first focus on Anne and Beth's relationship with Device 1. To add Anne as live_video_viewer of device:1: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'live_video_viewer', object: 'device:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"live_video_viewer\"), Object: openfga.PtrString(\"device:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"live_video_viewer\", Object = \"device:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"live_video_viewer\", object=\"device:1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"live_video_viewer\",\"object\":\"device:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne live_video_viewer device:1 write([ { \"user\":\"user:anne\", \"relation\":\"live_video_viewer\", \"object\":\"device:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") To add Anne as recorded_video_viewer of device:1 Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'recorded_video_viewer', object: 'device:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"recorded_video_viewer\"), Object: openfga.PtrString(\"device:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"recorded_video_viewer\", Object = \"device:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"recorded_video_viewer\", object=\"device:1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"recorded_video_viewer\",\"object\":\"device:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne recorded_video_viewer device:1 write([ { \"user\":\"user:anne\", \"relation\":\"recorded_video_viewer\", \"object\":\"device:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Likewise, we will add Beth's relationship with device:1. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:beth', relation: 'live_video_viewer', object: 'device:1'}, { user: 'user:beth', relation: 'recorded_video_viewer', object: 'device:1'}, { user: 'user:beth', relation: 'device_renamer', object: 'device:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"live_video_viewer\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"recorded_video_viewer\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"device_renamer\"), Object: openfga.PtrString(\"device:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:beth\", Relation = \"live_video_viewer\", Object = \"device:1\" }, new() { User = \"user:beth\", Relation = \"recorded_video_viewer\", Object = \"device:1\" }, new() { User = \"user:beth\", Relation = \"device_renamer\", Object = \"device:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:beth\", relation=\"live_video_viewer\", object=\"device:1\", ), ClientTuple( user=\"user:beth\", relation=\"recorded_video_viewer\", object=\"device:1\", ), ClientTuple( user=\"user:beth\", relation=\"device_renamer\", object=\"device:1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:beth\",\"relation\":\"live_video_viewer\",\"object\":\"device:1\"},{\"user\":\"user:beth\",\"relation\":\"recorded_video_viewer\",\"object\":\"device:1\"},{\"user\":\"user:beth\",\"relation\":\"device_renamer\",\"object\":\"device:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth live_video_viewer device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth recorded_video_viewer device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth device_renamer device:1 write([ { \"user\":\"user:beth\", \"relation\":\"live_video_viewer\", \"object\":\"device:1\" }, { \"user\":\"user:beth\", \"relation\":\"recorded_video_viewer\", \"object\":\"device:1\" }, { \"user\":\"user:beth\", \"relation\":\"device_renamer\", \"object\":\"device:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Verification​ Now that you have some relationship tuples added, you can start using it to ask some questions, e.g., whether a person has access to rename a device. First, you will find out if anne has permission to view the live video on device:1, then you will see if anne can rename device:1. Anne has live_video_viewer relationship with device:1. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'live_video_viewer', object: 'device:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"live_video_viewer\", Object: \"device:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"live_video_viewer\", Object = \"device:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"live_video_viewer\", object=\"device:1\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne live_video_viewer device:1 # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"live_video_viewer\",\"object\":\"device:1\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"live_video_viewer\", // has an `live_video_viewer` relation object = \"device:1\", // with the object `device:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true On the other hand, Anne does not have device_renamer relationship with device:1. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'device_renamer', object: 'device:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"device_renamer\", Object: \"device:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"device_renamer\", Object = \"device:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"device_renamer\", object=\"device:1\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne device_renamer device:1 # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"device_renamer\",\"object\":\"device:1\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"device_renamer\", // has an `device_renamer` relation object = \"device:1\", // with the object `device:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Now, check the other relationships fore Anne and Beth. User Object Relation Query Relation? anne device:1 live_video_viewer is anne related to device:1 as live_video_viewer? Yes beth device:1 live_video_viewer is beth related to device:1 as live_video_viewer? Yes anne device:1 recorded_video_viewer is anne related to device:1 as recorded_video_viewer? Yes beth device:1 recorded_video_viewer is beth related to device:1 as recorded_video_viewer? Yes anne device:1 device_renamer is anne related to device:1 as device_renamer? No beth device:1 device_renamer is beth related to device:1 as device_renamer? Yes","s":"02. Inserting Some Relationship Tuples","u":"/docs/modeling/advanced/iot","h":"#02-inserting-some-relationship-tuples","p":754},{"i":773,"t":"Notice how you had to add the Anne and Beth as direct relations to all the actions they can take on Device 1 instead of just stating that they are related as Security Guard or IT Admin, and having the other permissions implied? In practice this might have some disadvantages: if your authorization model changes, (e.g so that Security Guards can no longer view previously recorded videos), you would need to change relationship tuples in the system instead of just changing the configuration. We can address this by using concentric relation models. It allows you to express that sets of users who have a relation X to the object also have relation Y. For example, anyone that is related to the device as a security_guard is also related as a live_video_viewer and recorded_video_viewer, and anyone who is related to the device as an it_admin is also related as a live_video_viewer, a recorded_video_viewer, and a device_renamer. At the end you want to make sure that checking if Anne, Beth, Charles, or Dianne have permission to view the live video or rename the device, will get you the correct answers back. The resulting authorization model is: DSL JSON model schema 1.1 type device relations define it_admin: [user] define security_guard: [user] define live_video_viewer: [user] or it_admin or security_guard define recorded_video_viewer: [user] or it_admin or security_guard define device_renamer: [user] or it_admin { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"device\", \"relations\": { \"it_admin\": { \"this\": {} }, \"security_guard\": { \"this\": {} }, \"live_video_viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"it_admin\" } }, { \"computedUserset\": { \"relation\": \"security_guard\" } } ] } }, \"recorded_video_viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"it_admin\" } }, { \"computedUserset\": { \"relation\": \"security_guard\" } } ] } }, \"device_renamer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"it_admin\" } } ] } } }, \"metadata\": { \"relations\": { \"it_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"security_guard\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"live_video_viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"recorded_video_viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"device_renamer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The requirements are: Anne and Charles are Security Guards with access Device 1 Beth and Dianne are IT Admins with access Device 1 Security Guards can view live and recorded video IT Admins can view live and recorded video and rename devices Instead of adding different relationship tuples with direct relations to the actions they can take, as you did in the previous section, you will only add the relation to their role: it_admin or security_guard. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'security_guard', object: 'device:1'}, { user: 'user:beth', relation: 'it_admin', object: 'device:1'}, { user: 'user:charles', relation: 'security_guard', object: 'device:1'}, { user: 'user:dianne', relation: 'it_admin', object: 'device:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"security_guard\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"it_admin\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"security_guard\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:dianne\"), Relation: openfga.PtrString(\"it_admin\"), Object: openfga.PtrString(\"device:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"security_guard\", Object = \"device:1\" }, new() { User = \"user:beth\", Relation = \"it_admin\", Object = \"device:1\" }, new() { User = \"user:charles\", Relation = \"security_guard\", Object = \"device:1\" }, new() { User = \"user:dianne\", Relation = \"it_admin\", Object = \"device:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"security_guard\", object=\"device:1\", ), ClientTuple( user=\"user:beth\", relation=\"it_admin\", object=\"device:1\", ), ClientTuple( user=\"user:charles\", relation=\"security_guard\", object=\"device:1\", ), ClientTuple( user=\"user:dianne\", relation=\"it_admin\", object=\"device:1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"security_guard\",\"object\":\"device:1\"},{\"user\":\"user:beth\",\"relation\":\"it_admin\",\"object\":\"device:1\"},{\"user\":\"user:charles\",\"relation\":\"security_guard\",\"object\":\"device:1\"},{\"user\":\"user:dianne\",\"relation\":\"it_admin\",\"object\":\"device:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne security_guard device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth it_admin device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles security_guard device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:dianne it_admin device:1 write([ { \"user\":\"user:anne\", \"relation\":\"security_guard\", \"object\":\"device:1\" }, { \"user\":\"user:beth\", \"relation\":\"it_admin\", \"object\":\"device:1\" }, { \"user\":\"user:charles\", \"relation\":\"security_guard\", \"object\":\"device:1\" }, { \"user\":\"user:dianne\", \"relation\":\"it_admin\", \"object\":\"device:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Verification​ We can now verify whether charles is related to device:1 as live_video_viewer. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:charles', relation: 'live_video_viewer', object: 'device:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:charles\", Relation: \"live_video_viewer\", Object: \"device:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:charles\", Relation = \"live_video_viewer\", Object = \"device:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:charles\", relation=\"live_video_viewer\", object=\"device:1\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles live_video_viewer device:1 # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:charles\",\"relation\":\"live_video_viewer\",\"object\":\"device:1\"}}' # Response: {\"allowed\":true} check( user = \"user:charles\", // check if the user `user:charles` relation = \"live_video_viewer\", // has an `live_video_viewer` relation object = \"device:1\", // with the object `device:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Check the other relationships for anne, beth, charles and dianne. User Object Relation Query Relation? anne device:1 live_video_viewer is anne related to device:1 as live_video_viewer? Yes beth device:1 live_video_viewer is beth related to device:1 as live_video_viewer? Yes anne device:1 recorded_video_viewer is anne related to device:1 as recorded_video_viewer? Yes beth device:1 recorded_video_viewer is beth related to device:1 as recorded_video_viewer? Yes anne device:1 device_renamer is anne related to device:1 as device_renamer? No beth device:1 device_renamer is beth related to device:1 as device_renamer? Yes charles device:1 live_video_viewer is charles related to device:1 as live_video_viewer? Yes dianne device:1 live_video_viewer is dianne related to device:1 as live_video_viewer? Yes charles device:1 recorded_video_viewer is charles related to device:1 as recorded_video_viewer? Yes dianne device:1 recorded_video_viewer is dianne related to device:1 as recorded_video_viewer? Yes charles device:1 device_renamer is charles related to device:1 as device_renamer? No dianne device:1 device_renamer is dianne related to device:1 as device_renamer? Yes","s":"03. Updating Our Authorization Model To Facilitate Future Changes","u":"/docs/modeling/advanced/iot","h":"#03-updating-our-authorization-model-to-facilitate-future-changes","p":754},{"i":775,"t":"Now that you are done with devices. Let us tackle device groups. The requirements regarding device groups were: Devices can be grouped into Device Groups Security guards with access to the Device Group are Security Guards with access to the Devices within the Device Group. Similarly for IT Admins The type definition for the device group: DSL JSON type device_group relations define it_admin: [user] define security_guard: [user] { \"type\": \"device_group\", \"relations\": { \"it_admin\": { \"this\": {} }, \"security_guard\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"it_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"security_guard\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } With this change, the full authorization model becomes: DSL JSON model schema 1.1 type user type device relations define it_admin: [user, device_group#it_admin] define security_guard: [user, device_group#security_guard] define live_video_viewer: [user] or it_admin or security_guard define recorded_video_viewer: [user] or it_admin or security_guard define device_renamer: [user] or it_admin type device_group relations define it_admin: [user] define security_guard: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"device\", \"relations\": { \"it_admin\": { \"this\": {} }, \"security_guard\": { \"this\": {} }, \"live_video_viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"it_admin\" } }, { \"computedUserset\": { \"relation\": \"security_guard\" } } ] } }, \"recorded_video_viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"it_admin\" } }, { \"computedUserset\": { \"relation\": \"security_guard\" } } ] } }, \"device_renamer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"it_admin\" } } ] } } }, \"metadata\": { \"relations\": { \"it_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"device_group\", \"relation\": \"it_admin\" } ] }, \"security_guard\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"device_group\", \"relation\": \"security_guard\" } ] }, \"live_video_viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"recorded_video_viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"device_renamer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"device_group\", \"relations\": { \"it_admin\": { \"this\": {} }, \"security_guard\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"it_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"security_guard\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Updating Relationship Tuples On Roles​ Remember that Charles is a Security Guard, and Dianne an IT Admin on Group 1, enter the relationship tuples below to reflect that. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:charles', relation: 'security_guard', object: 'device_group:group1'}, { user: 'user:dianne', relation: 'it_admin', object: 'device_group:group1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"security_guard\"), Object: openfga.PtrString(\"device_group:group1\"), }, { User: openfga.PtrString(\"user:dianne\"), Relation: openfga.PtrString(\"it_admin\"), Object: openfga.PtrString(\"device_group:group1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:charles\", Relation = \"security_guard\", Object = \"device_group:group1\" }, new() { User = \"user:dianne\", Relation = \"it_admin\", Object = \"device_group:group1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:charles\", relation=\"security_guard\", object=\"device_group:group1\", ), ClientTuple( user=\"user:dianne\", relation=\"it_admin\", object=\"device_group:group1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:charles\",\"relation\":\"security_guard\",\"object\":\"device_group:group1\"},{\"user\":\"user:dianne\",\"relation\":\"it_admin\",\"object\":\"device_group:group1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles security_guard device_group:group1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:dianne it_admin device_group:group1 write([ { \"user\":\"user:charles\", \"relation\":\"security_guard\", \"object\":\"device_group:group1\" }, { \"user\":\"user:dianne\", \"relation\":\"it_admin\", \"object\":\"device_group:group1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") You still need to give all the security guards of group1 a security_guard relation to devices 2 and 3, and similarly for IT Admins. Add the following relationship tuples to do that. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'device_group:group1#security_guard', relation: 'security_guard', object: 'device:2'}, { user: 'device_group:group1#security_guard', relation: 'security_guard', object: 'device:3'}, { user: 'device_group:group1#it_admin', relation: 'it_admin', object: 'device:2'}, { user: 'device_group:group1#it_admin', relation: 'it_admin', object: 'device:3'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"device_group:group1#security_guard\"), Relation: openfga.PtrString(\"security_guard\"), Object: openfga.PtrString(\"device:2\"), }, { User: openfga.PtrString(\"device_group:group1#security_guard\"), Relation: openfga.PtrString(\"security_guard\"), Object: openfga.PtrString(\"device:3\"), }, { User: openfga.PtrString(\"device_group:group1#it_admin\"), Relation: openfga.PtrString(\"it_admin\"), Object: openfga.PtrString(\"device:2\"), }, { User: openfga.PtrString(\"device_group:group1#it_admin\"), Relation: openfga.PtrString(\"it_admin\"), Object: openfga.PtrString(\"device:3\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"device_group:group1#security_guard\", Relation = \"security_guard\", Object = \"device:2\" }, new() { User = \"device_group:group1#security_guard\", Relation = \"security_guard\", Object = \"device:3\" }, new() { User = \"device_group:group1#it_admin\", Relation = \"it_admin\", Object = \"device:2\" }, new() { User = \"device_group:group1#it_admin\", Relation = \"it_admin\", Object = \"device:3\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"device_group:group1#security_guard\", relation=\"security_guard\", object=\"device:2\", ), ClientTuple( user=\"device_group:group1#security_guard\", relation=\"security_guard\", object=\"device:3\", ), ClientTuple( user=\"device_group:group1#it_admin\", relation=\"it_admin\", object=\"device:2\", ), ClientTuple( user=\"device_group:group1#it_admin\", relation=\"it_admin\", object=\"device:3\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"device_group:group1#security_guard\",\"relation\":\"security_guard\",\"object\":\"device:2\"},{\"user\":\"device_group:group1#security_guard\",\"relation\":\"security_guard\",\"object\":\"device:3\"},{\"user\":\"device_group:group1#it_admin\",\"relation\":\"it_admin\",\"object\":\"device:2\"},{\"user\":\"device_group:group1#it_admin\",\"relation\":\"it_admin\",\"object\":\"device:3\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw device_group:group1#security_guard security_guard device:2 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw device_group:group1#security_guard security_guard device:3 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw device_group:group1#it_admin it_admin device:2 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw device_group:group1#it_admin it_admin device:3 write([ { \"user\":\"device_group:group1#security_guard\", \"relation\":\"security_guard\", \"object\":\"device:2\" }, { \"user\":\"device_group:group1#security_guard\", \"relation\":\"security_guard\", \"object\":\"device:3\" }, { \"user\":\"device_group:group1#it_admin\", \"relation\":\"it_admin\", \"object\":\"device:2\" }, { \"user\":\"device_group:group1#it_admin\", \"relation\":\"it_admin\", \"object\":\"device:3\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Verification​ Now that you have finalized the model and added the relationship tuples, you can start asking some queries. Try asking the same queries you did earlier but on device 2 instead of device 1. We can ask is dianne related to device:2 as live_video_viewer? Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'dianne', relation: 'live_video_viewer', object: 'device:2', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"dianne\", Relation: \"live_video_viewer\", Object: \"device:2\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"dianne\", Relation = \"live_video_viewer\", Object = \"device:2\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"dianne\", relation=\"live_video_viewer\", object=\"device:2\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw dianne live_video_viewer device:2 # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"dianne\",\"relation\":\"live_video_viewer\",\"object\":\"device:2\"}}' # Response: {\"allowed\":true} check( user = \"dianne\", // check if the user `dianne` relation = \"live_video_viewer\", // has an `live_video_viewer` relation object = \"device:2\", // with the object `device:2` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Type any of the following queries in the TUPLE QUERIES section and press ENTER on your keyboard to see the results. User Object Relation Query Relation? anne device:2 live_video_viewer is anne related to device:2 as live_video_viewer? No beth device:2 live_video_viewer is beth related to device:2 as live_video_viewer? No anne device:2 recorded_video_viewer is anne related to device:2 as recorded_video_viewer? No beth device:2 recorded_video_viewer is beth related to device:2 as recorded_video_viewer? No anne device:2 device_renamer is anne related to device:2 as device_renamer? No beth device:2 device_renamer is beth related to device:2 as device_renamer? No charles device:2 live_video_viewer is charles related to device:2 as live_video_viewer? Yes dianne device:2 live_video_viewer is dianne related to device:2 as live_video_viewer? Yes charles device:2 recorded_video_viewer is charles related to device:2 as recorded_video_viewer? Yes dianne device:2 recorded_video_viewer is dianne related to device:2 as recorded_video_viewer? Yes charles device:2 device_renamer is charles related to device:2 as device_renamer? No dianne device:2 device_renamer is dianne related to device:2 as device_renamer? Yes","s":"04. Modeling Device Groups","u":"/docs/modeling/advanced/iot","h":"#04-modeling-device-groups","p":754},{"i":777,"t":"Notice that despite following Step 03, anne and beth still have direct relations to all the actions they can take on device:1. Updating The Authorization Model​ anne is a live_video_viewer by both her position as security_guard as well as her direct relationship assignment. This is undesirable. Imagine anne left her position of security_guard and she will still have live_video_viewer access to device:1. To remedy this, remove [user] from live_video_viewer, recorded_video_viewer and device_renamer. This denies direct relations to live_video_viewer, recorded_video_viewer and device_renamer from having an effect. To do this: DSL JSON model schema 1.1 type user type device relations define it_admin: [user, device_group#it_admin] define security_guard: [user, device_group#security_guard] define live_video_viewer: it_admin or security_guard define recorded_video_viewer: it_admin or security_guard define device_renamer: it_admin type device_group relations define it_admin: [user] define security_guard: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"device\", \"relations\": { \"it_admin\": { \"this\": {} }, \"security_guard\": { \"this\": {} }, \"live_video_viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"relation\": \"it_admin\" } }, { \"computedUserset\": { \"relation\": \"security_guard\" } } ] } }, \"recorded_video_viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"relation\": \"it_admin\" } }, { \"computedUserset\": { \"relation\": \"security_guard\" } } ] } }, \"device_renamer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"relation\": \"it_admin\" } } ] } } }, \"metadata\": { \"relations\": { \"it_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"device_group\", \"relation\": \"it_admin\" } ] }, \"security_guard\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"device_group\", \"relation\": \"security_guard\" } ] } } } }, { \"type\": \"device_group\", \"relations\": { \"it_admin\": { \"this\": {} }, \"security_guard\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"it_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"security_guard\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Notice that any reference to the direct relationship type restrictions has been removed. That indicates that a user cannot have a direct relationship with an object in this type. With this change, anne can no longer have a live_video_viewer permission for device:1 except through having a security_guard or it_admin role first, and when she loses access to that role, she will automatically lose access to the live_video_viewer permission. Verification​ Now that direct relationship is denied, we should see that anne has live_video_viewer relation to device:1 solely based on her position as security_guard to device:1. Let's find out. To test this, we can add a new user emily. Emily is not a security_guard nor an it_admin. However, we attempt to access via direct relations by adding the following relationship tuples: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:emily', relation: 'live_video_viewer', object: 'device:1'}, { user: 'user:emily', relation: 'recorded_video_viewer', object: 'device:1'}, { user: 'user:emily', relation: 'device_renamer', object: 'device:1'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:emily\"), Relation: openfga.PtrString(\"live_video_viewer\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:emily\"), Relation: openfga.PtrString(\"recorded_video_viewer\"), Object: openfga.PtrString(\"device:1\"), }, { User: openfga.PtrString(\"user:emily\"), Relation: openfga.PtrString(\"device_renamer\"), Object: openfga.PtrString(\"device:1\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:emily\", Relation = \"live_video_viewer\", Object = \"device:1\" }, new() { User = \"user:emily\", Relation = \"recorded_video_viewer\", Object = \"device:1\" }, new() { User = \"user:emily\", Relation = \"device_renamer\", Object = \"device:1\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:emily\", relation=\"live_video_viewer\", object=\"device:1\", ), ClientTuple( user=\"user:emily\", relation=\"recorded_video_viewer\", object=\"device:1\", ), ClientTuple( user=\"user:emily\", relation=\"device_renamer\", object=\"device:1\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:emily\",\"relation\":\"live_video_viewer\",\"object\":\"device:1\"},{\"user\":\"user:emily\",\"relation\":\"recorded_video_viewer\",\"object\":\"device:1\"},{\"user\":\"user:emily\",\"relation\":\"device_renamer\",\"object\":\"device:1\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily live_video_viewer device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily recorded_video_viewer device:1 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily device_renamer device:1 write([ { \"user\":\"user:emily\", \"relation\":\"live_video_viewer\", \"object\":\"device:1\" }, { \"user\":\"user:emily\", \"relation\":\"recorded_video_viewer\", \"object\":\"device:1\" }, { \"user\":\"user:emily\", \"relation\":\"device_renamer\", \"object\":\"device:1\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Now try to query is emily related to device:1 as live_video_viewer?. The returned result should be emily is not related to device:1 as live_video_viewer. This confirms that direct relations have no effect on the live_video_viewer relations, and that is because the direct relationship type restriction was removed from the relation configuration. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:emily', relation: 'live_video_viewer', object: 'device:1', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:emily\", Relation: \"live_video_viewer\", Object: \"device:1\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:emily\", Relation = \"live_video_viewer\", Object = \"device:1\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:emily\", relation=\"live_video_viewer\", object=\"device:1\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily live_video_viewer device:1 # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:emily\",\"relation\":\"live_video_viewer\",\"object\":\"device:1\"}}' # Response: {\"allowed\":false} check( user = \"user:emily\", // check if the user `user:emily` relation = \"live_video_viewer\", // has an `live_video_viewer` relation object = \"device:1\", // with the object `device:1` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Query on the other relationships and you will see: User Object Relation Query Relation? emily device:1 recorded_video_viewer is emily related to device:1 as recorded_video_viewer? No emily device:1 device_renamer is emily related to device:1 as device_renamer? No","s":"05. Disallow Direct Relationships To Users","u":"/docs/modeling/advanced/iot","h":"#05-disallow-direct-relationships-to-users","p":754},{"i":779,"t":"In this post, you were introduced to fine grain authentication and OpenFGA. Upcoming posts will dive deeper into OpenFGA, introducing concepts that will improve on the model you built today, and tackling more complex permission systems, with more relations and requirements that need to be met.","s":"Summary","u":"/docs/modeling/advanced/iot","h":"#summary","p":754},{"i":781,"t":"Try adding a second group tied to devices 4 and 5. Add only Charles and Dianne to this group, then try to run queries that would validate your model. Management has decided that Security Guards can only access live videos, and instituted a new position called Security Officer who can view both live and recorded videos. Can you update the authorization model to reflect that?","s":"Exercises For You","u":"/docs/modeling/advanced/iot","h":"#exercises-for-you","p":754},{"i":783,"t":"This section explores some methods available to you to tackle some use-cases where the expected authorization check may depend on certain dynamic or contextual data (such as time, location, ip address, weather) that have not been written to the OpenFGA store. When to use Contextual Tuples should be used when modeling cases where a user's access to an object depends on the context of their request. For example: An employee’s ability to access a document when they are connected to the company VPN or the api call is originating from an internal IP address. A support engineer is only able to access a user's account during office hours. If a user belongs to multiple organizations, they are only able to access a resource if they set a specific organization in their current context.","s":"Contextual and Time-Based Authorization","u":"/docs/modeling/contextual-time-based-authorization","h":"","p":782},{"i":785,"t":"To follow this guide, you should be familiar with some OpenFGA Concepts.","s":"Before You Start","u":"/docs/modeling/contextual-time-based-authorization","h":"#before-you-start","p":782},{"i":787,"t":"A Relation: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system. A Check Request: is a call to the OpenFGA check endpoint that returns whether the user has a certain relationship with an object. A Relationship Tuple: a grouping consisting of a user, a relation and an object stored in OpenFGA A Contextual Tuple: a tuple that can be added to a Check request, and only exists within the context of that particular request. You also need to be familiar with: Modeling Object-to-Object Relationships: You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more → Modeling Multiple Restrictions: You need to know how to model requiring multiple authorizations before allowing users to perform certain actions. Learn more →","s":"OpenFGA Concepts","u":"/docs/modeling/contextual-time-based-authorization","h":"#-concepts","p":782},{"i":789,"t":"For the scope of this guide, we are going to consider the following scenario. Consider you are building the authorization model for WeBank Inc. In order for an Account Manager at WeBank Inc. to be able to access a customer's account and its transactions, they would need to be: An account manager at the same branch as the customer's account Connected via the branch's internal network or through the branch's VPN Connected during this particular branch's office hours We will start with the following Authorization Model DSL JSON model schema 1.1 type user type branch relations define account_manager: [user] type account relations define branch: [branch] define account_manager: account_manager from branch define customer: [user] define viewer: customer or account_manager define can_view: viewer type transaction relations define account: [account] define can_view: viewer from account { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"branch\", \"relations\": { \"account_manager\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"account_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"account\", \"relations\": { \"branch\": { \"this\": {} }, \"account_manager\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } } }, \"customer\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"customer\" } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } } ] } }, \"can_view\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } }, \"metadata\": { \"relations\": { \"branch\": { \"directly_related_user_types\": [ { \"type\": \"branch\" } ] }, \"customer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"transaction\", \"relations\": { \"account\": { \"this\": {} }, \"can_view\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"account\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } }, \"metadata\": { \"relations\": { \"account\": { \"directly_related_user_types\": [ { \"type\": \"account\" } ] } } } } ] } We are considering the case that: Anne is the Account Manager at the West-Side branch Caroline is the customer for checking account number 526 The West-Side branch is the branch that the checking account number 526 has been created at Checking account number 526 has a transaction, we'll call it transaction A The West-Side branch’s office hours is from 8am-3pm UTC The above state translates to the following relationship tuples: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is the Account Manager at the West-Side branch { user: 'user:anne', relation: 'account_manager', object: 'branch:west-side'}, // Caroline is the customer for checking account number 526 { user: 'user:caroline', relation: 'customer', object: 'account:checking-526'}, // The West-Side branch is the branch that the Checking account number 526 has been created at { user: 'branch:west-side', relation: 'branch', object: 'account:checking-526'}, // Checking account number 526 is the account for transaction A { user: 'account:checking-526', relation: 'account', object: 'transaction:A'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is the Account Manager at the West-Side branch User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"account_manager\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // Caroline is the customer for checking account number 526 User: openfga.PtrString(\"user:caroline\"), Relation: openfga.PtrString(\"customer\"), Object: openfga.PtrString(\"account:checking-526\"), }, { // The West-Side branch is the branch that the Checking account number 526 has been created at User: openfga.PtrString(\"branch:west-side\"), Relation: openfga.PtrString(\"branch\"), Object: openfga.PtrString(\"account:checking-526\"), }, { // Checking account number 526 is the account for transaction A User: openfga.PtrString(\"account:checking-526\"), Relation: openfga.PtrString(\"account\"), Object: openfga.PtrString(\"transaction:A\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is the Account Manager at the West-Side branch new() { User = \"user:anne\", Relation = \"account_manager\", Object = \"branch:west-side\" }, // Caroline is the customer for checking account number 526 new() { User = \"user:caroline\", Relation = \"customer\", Object = \"account:checking-526\" }, // The West-Side branch is the branch that the Checking account number 526 has been created at new() { User = \"branch:west-side\", Relation = \"branch\", Object = \"account:checking-526\" }, // Checking account number 526 is the account for transaction A new() { User = \"account:checking-526\", Relation = \"account\", Object = \"transaction:A\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is the Account Manager at the West-Side branch user=\"user:anne\", relation=\"account_manager\", object=\"branch:west-side\", ), ClientTuple( # Caroline is the customer for checking account number 526 user=\"user:caroline\", relation=\"customer\", object=\"account:checking-526\", ), ClientTuple( # The West-Side branch is the branch that the Checking account number 526 has been created at user=\"branch:west-side\", relation=\"branch\", object=\"account:checking-526\", ), ClientTuple( # Checking account number 526 is the account for transaction A user=\"account:checking-526\", relation=\"account\", object=\"transaction:A\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"account_manager\",\"object\":\"branch:west-side\"},{\"user\":\"user:caroline\",\"relation\":\"customer\",\"object\":\"account:checking-526\"},{\"user\":\"branch:west-side\",\"relation\":\"branch\",\"object\":\"account:checking-526\"},{\"user\":\"account:checking-526\",\"relation\":\"account\",\"object\":\"transaction:A\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne account_manager branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:caroline customer account:checking-526 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw branch:west-side branch account:checking-526 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw account:checking-526 account transaction:A write([ // Anne is the Account Manager at the West-Side branch { \"user\":\"user:anne\", \"relation\":\"account_manager\", \"object\":\"branch:west-side\" }, // Caroline is the customer for checking account number 526 { \"user\":\"user:caroline\", \"relation\":\"customer\", \"object\":\"account:checking-526\" }, // The West-Side branch is the branch that the Checking account number 526 has been created at { \"user\":\"branch:west-side\", \"relation\":\"branch\", \"object\":\"account:checking-526\" }, // Checking account number 526 is the account for transaction A { \"user\":\"account:checking-526\", \"relation\":\"account\", \"object\":\"transaction:A\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\")","s":"Scenario","u":"/docs/modeling/contextual-time-based-authorization","h":"#scenario","p":782},{"i":791,"t":"By the end of this guide we would like to validate that: If Anne is at the branch, and it is 12pm UTC, Anne should be able to view transaction A If Anne is connecting remotely at 12pm UTC but is not connected to the VPN, Anne should not be able to view transaction A If Anne is connecting remotely and is connected to the VPN at 12pm UTC, should be able to view transaction A at 6pm UTC, should not be able to view transaction A","s":"Requirements","u":"/docs/modeling/contextual-time-based-authorization","h":"#requirements","p":782},{"i":793,"t":"In order to solve for the requirements above, we will break the problem down to three steps: Understand relationships without contextual tuples. We will want to ensure that the customer can view a transaction tied to their account the account manager can view a transaction whose account is at the same branch Extend the Authorization Model to take time and ip address into consideration Use contextual tuples for context related checks.","s":"Step By Step","u":"/docs/modeling/contextual-time-based-authorization","h":"#step-by-step","p":782},{"i":795,"t":"With the Authorization Model and relationship tuples shown above, OpenFGA has all the information needed to Ensure that the customer can view a transaction tied to their account Ensure that the account manager can view a transaction whose account is at the same branch We can verify that using the following checks Anne can view transaction:A because she is an account manager of an account that is at the same branch. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'transaction:A', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"transaction:A\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"transaction:A\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"transaction:A\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view transaction:A # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"transaction:A\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Caroline can view transaction:A because she is a customer and the transaction is tied to her account. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:caroline', relation: 'can_view', object: 'transaction:A', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:caroline\", Relation: \"can_view\", Object: \"transaction:A\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:caroline\", Relation = \"can_view\", Object = \"transaction:A\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:caroline\", relation=\"can_view\", object=\"transaction:A\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:caroline can_view transaction:A # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:caroline\",\"relation\":\"can_view\",\"object\":\"transaction:A\"}}' # Response: {\"allowed\":true} check( user = \"user:caroline\", // check if the user `user:caroline` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Additionally, we will check that Mary, an account manager at a different branch cannot view transaction A. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Mary is an account manager at the East-Side branch { user: 'user:mary', relation: 'account_manager', object: 'branch:east-side'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Mary is an account manager at the East-Side branch User: openfga.PtrString(\"user:mary\"), Relation: openfga.PtrString(\"account_manager\"), Object: openfga.PtrString(\"branch:east-side\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Mary is an account manager at the East-Side branch new() { User = \"user:mary\", Relation = \"account_manager\", Object = \"branch:east-side\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Mary is an account manager at the East-Side branch user=\"user:mary\", relation=\"account_manager\", object=\"branch:east-side\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:mary\",\"relation\":\"account_manager\",\"object\":\"branch:east-side\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:mary account_manager branch:east-side write([ // Mary is an account manager at the East-Side branch { \"user\":\"user:mary\", \"relation\":\"account_manager\", \"object\":\"branch:east-side\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:mary', relation: 'can_view', object: 'transaction:A', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:mary\", Relation: \"can_view\", Object: \"transaction:A\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:mary\", Relation = \"can_view\", Object = \"transaction:A\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:mary\", relation=\"can_view\", object=\"transaction:A\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:mary can_view transaction:A # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:mary\",\"relation\":\"can_view\",\"object\":\"transaction:A\"}}' # Response: {\"allowed\":false} check( user = \"user:mary\", // check if the user `user:mary` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Note that so far, we have not prevented Anne from viewing the transaction outside office hours, let's see if we can do better.","s":"Understand Relationships Without Contextual Data","u":"/docs/modeling/contextual-time-based-authorization","h":"#understand-relationships-without-contextual-data","p":782},{"i":797,"t":"Extend The Authorization Model​ In order to add time and ip address to our authorization model, we will add appropriate types for them. We will have a \"timeslot\" and an \"ip-address-range\" as types, and each can have users related to it as a user. DSL JSON type timeslot relations define user: [user] { \"type\": \"timeslot\", \"relations\": { \"user\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"user\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } DSL JSON type ip-address-range relations define user: [user] { \"type\": \"ip-address-range\", \"relations\": { \"user\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"user\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } We'll also need to introduce some new relations, and modify some others. On the \"branch\" type: Add \"approved_timeslot\" relation to mark than a certain timeslot is approved to view transactions for accounts in this branch Add \"approved_ip_address_range\" relation to mark than an ip address range is approved to view transactions for accounts in this branch Add \"approved_context\" relation to combine the two authorizations above (user from approved_timeslot and user from approved_ip_address_range), and indicate that the user is in an approved context The branch type definition then becomes: DSL JSON type branch relations define account_manager: [user] define approved_ip_address_range: [ip-address-range] define approved_timeslot: [timeslot] define approved_context: user from approved_timeslot and user from approved_ip_address_range { \"type\": \"branch\", \"relations\": { \"account_manager\": { \"this\": {} }, \"approved_ip_address_range\": { \"this\": {} }, \"approved_timeslot\": { \"this\": {} }, \"approved_context\": { \"intersection\": { \"child\": [ { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"approved_timeslot\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"user\" } } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"approved_ip_address_range\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"user\" } } } ] } } }, \"metadata\": { \"relations\": { \"account_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"approved_ip_address_range\": { \"directly_related_user_types\": [ { \"type\": \"ip-address-range\" } ] }, \"approved_timeslot\": { \"directly_related_user_types\": [ { \"type\": \"timeslot\" } ] } } } } On the \"account\" type: Add \"account_manager_viewer\" relation to combine the \"account_manager\" relationship and the new \"approved_context\" relation from the branch Update the \"viewer\" relation definition to customer or account_manager_viewer where \"customer\" can view without being subjected to contextual authorization, while \"account_manager_viewer\" needs to be within the branch allowed context to view The account type definition then becomes: DSL JSON type account relations define branch: [branch] define account_manager: account_manager from branch define customer: [user] define account_manager_viewer: account_manager and approved_context from branch define viewer: customer or account_manager_viewer define can_view: viewer { \"type\": \"account\", \"relations\": { \"branch\": { \"this\": {} }, \"account_manager\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } } }, \"customer\": { \"this\": {} }, \"account_manager_viewer\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"approved_context\" } } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"customer\" } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager_viewer\" } } ] } }, \"can_view\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } }, \"metadata\": { \"relations\": { \"branch\": { \"directly_related_user_types\": [ { \"type\": \"branch\" } ] }, \"customer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } note On the \"transaction\" type: Nothing will need to be done, as it will inherit the updated \"viewer\" relation definition from \"account\" Add The Required Tuples To Mark That Anne Is In An Approved Context​ Now that we have updated our authorization model to take time and ip address into consideration, you will notice that Anne has lost access because nothing indicates that Anne is connecting from an approved ip address and time. You can verify that by issuing the following check: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'anne', relation: 'can_view', object: 'transaction:A', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"anne\", Relation: \"can_view\", Object: \"transaction:A\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"anne\", Relation = \"can_view\", Object = \"transaction:A\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"anne\", relation=\"can_view\", object=\"transaction:A\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw anne can_view transaction:A # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"anne\",\"relation\":\"can_view\",\"object\":\"transaction:A\"}}' # Response: {\"allowed\":false} check( user = \"anne\", // check if the user `anne` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false We need to add relationship tuples to mark some approved timeslots and ip address ranges: note Here we added the time slots in increments of 1 hour periods, but this is not a requirement. We did not add all the office hours to keep this guide shorter. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // 11am to 12pm is within the office hours of the West-Side branch { user: 'timeslot:11_12', relation: 'approved_timeslot', object: 'branch:west-side'}, // 12pm to 1pm is within the office hours of the West-Side branch { user: 'timeslot:12_13', relation: 'approved_timeslot', object: 'branch:west-side'}, // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch { user: 'ip-address-range:10.0.0.0/16', relation: 'approved_ip_address_range', object: 'branch:west-side'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // 11am to 12pm is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:11_12\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 12pm to 1pm is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:12_13\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch User: openfga.PtrString(\"ip-address-range:10.0.0.0/16\"), Relation: openfga.PtrString(\"approved_ip_address_range\"), Object: openfga.PtrString(\"branch:west-side\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // 11am to 12pm is within the office hours of the West-Side branch new() { User = \"timeslot:11_12\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 12pm to 1pm is within the office hours of the West-Side branch new() { User = \"timeslot:12_13\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch new() { User = \"ip-address-range:10.0.0.0/16\", Relation = \"approved_ip_address_range\", Object = \"branch:west-side\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # 11am to 12pm is within the office hours of the West-Side branch user=\"timeslot:11_12\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 12pm to 1pm is within the office hours of the West-Side branch user=\"timeslot:12_13\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch user=\"ip-address-range:10.0.0.0/16\", relation=\"approved_ip_address_range\", object=\"branch:west-side\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"timeslot:11_12\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:12_13\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"ip-address-range:10.0.0.0/16\",\"relation\":\"approved_ip_address_range\",\"object\":\"branch:west-side\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:11_12 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:12_13 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw ip-address-range:10.0.0.0/16 approved_ip_address_range branch:west-side write([ // 11am to 12pm is within the office hours of the West-Side branch { \"user\":\"timeslot:11_12\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 12pm to 1pm is within the office hours of the West-Side branch { \"user\":\"timeslot:12_13\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch { \"user\":\"ip-address-range:10.0.0.0/16\", \"relation\":\"approved_ip_address_range\", \"object\":\"branch:west-side\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Now that we have added the allowed timeslots and ip address ranges we need to add the following relationship tuples to give Anne access. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is connecting from within the 10.0.0.0/16 ip address range { user: 'user:anne', relation: 'user', object: 'ip-address-range:10.0.0.0/16'}, // Anne is connecting between 12pm and 1pm { user: 'user:anne', relation: 'user', object: 'timeslot:12_13'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is connecting from within the 10.0.0.0/16 ip address range User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"user\"), Object: openfga.PtrString(\"ip-address-range:10.0.0.0/16\"), }, { // Anne is connecting between 12pm and 1pm User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"user\"), Object: openfga.PtrString(\"timeslot:12_13\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is connecting from within the 10.0.0.0/16 ip address range new() { User = \"user:anne\", Relation = \"user\", Object = \"ip-address-range:10.0.0.0/16\" }, // Anne is connecting between 12pm and 1pm new() { User = \"user:anne\", Relation = \"user\", Object = \"timeslot:12_13\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is connecting from within the 10.0.0.0/16 ip address range user=\"user:anne\", relation=\"user\", object=\"ip-address-range:10.0.0.0/16\", ), ClientTuple( # Anne is connecting between 12pm and 1pm user=\"user:anne\", relation=\"user\", object=\"timeslot:12_13\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"ip-address-range:10.0.0.0/16\"},{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"timeslot:12_13\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne user ip-address-range:10.0.0.0/16 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne user timeslot:12_13 write([ // Anne is connecting from within the 10.0.0.0/16 ip address range { \"user\":\"user:anne\", \"relation\":\"user\", \"object\":\"ip-address-range:10.0.0.0/16\" }, // Anne is connecting between 12pm and 1pm { \"user\":\"user:anne\", \"relation\":\"user\", \"object\":\"timeslot:12_13\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") If we have the above two tuples in the system, when checking whether Anne can view transaction A we should get a response stating that Anne can view it. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'transaction:A', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"transaction:A\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"transaction:A\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"transaction:A\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view transaction:A # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"transaction:A\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"Take Time And IP Address Into Consideration","u":"/docs/modeling/contextual-time-based-authorization","h":"#take-time-and-ip-address-into-consideration","p":782},{"i":799,"t":"Now that we know we can authorize based on present state, we have a different problem to solve. We are storing the tuples in the state in order for OpenFGA to evaluate them, which means that: For the case of the IP Address, we are not able to truly authorize based on the context of the request. E.g. if Anne was trying to connect from the phone and from the PC at the same time, and only the PC was connected to the VPN, how would OpenFGA know to deny one and allow the other if the data is stored in the state? On every check call we have to first write the correct tuples, then call the Check api, then clean up those tuples. This causes a substantial increase in latency as well as incorrect answers for requests happening in parallel (they could write/delete each other's tuples). How do we solve this? How do we tie the above two tuples to the context of the request instead of the system state? First, we will need to undo adding the stored relationship tuples where Anne is connecting from within the 10.0.0.0/16 ip address range and Anne connecting between 12pm and 1pm Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ deletes: [ // Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range { user: 'user:anne', relation: 'user', object: 'ip-address-range:10.0.0.0/16'}, // Remove stored tuples where Anne is connecting between 12pm and 1pm { user: 'user:anne', relation: 'user', object: 'timeslot:12_13'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Deletes: &[]ClientTupleKey{ { // Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"user\"), Object: openfga.PtrString(\"ip-address-range:10.0.0.0/16\"), }, { // Remove stored tuples where Anne is connecting between 12pm and 1pm User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"user\"), Object: openfga.PtrString(\"timeslot:12_13\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Deletes = new List() { // Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range new() { User = \"user:anne\", Relation = \"user\", Object = \"ip-address-range:10.0.0.0/16\" }, // Remove stored tuples where Anne is connecting between 12pm and 1pm new() { User = \"user:anne\", Relation = \"user\", Object = \"timeslot:12_13\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( deletes==[ ClientTuple( # Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range user=\"user:anne\", relation=\"user\", object=\"ip-address-range:10.0.0.0/16\", ), ClientTuple( # Remove stored tuples where Anne is connecting between 12pm and 1pm user=\"user:anne\", relation=\"user\", object=\"timeslot:12_13\", ),], ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"deletes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"ip-address-range:10.0.0.0/16\"},{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"timeslot:12_13\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple delete --store-id=${FGA_STORE_ID} user:anne user ip-address-range:10.0.0.0/16 fga tuple delete --store-id=${FGA_STORE_ID} user:anne user timeslot:12_13 delete([ // Remove stored tuples where Anne is connecting from within the 10.0.0.0/16 ip address range { \"user\":\"user:anne\", \"relation\":\"user\", \"object\":\"ip-address-range:10.0.0.0/16\" }, // Remove stored tuples where Anne is connecting between 12pm and 1pm { \"user\":\"user:anne\", \"relation\":\"user\", \"object\":\"timeslot:12_13\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") For Check calls, OpenFGA has a concept called \"Contextual Tuples\". Contextual Tuples are tuples that do not exist in the system state and are not written beforehand to OpenFGA. They are tuples that are sent alongside the Check request and will be treated as if they already exist in the state for the context of that particular Check call. When Anne is connecting from an allowed ip address range and timeslot, OpenFGA will return {\"allowed\":true}: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'transaction:A', contextual_tuples: [ { user: \"user:anne\", relation: \"user\", object: \"ip-address-range:10.0.0.0/16\" }, { user: \"user:anne\", relation: \"user\", object: \"timeslot:12_13\" } ]}, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"transaction:A\", ContextualTuples: &[]ClientTupleKey{ { User: \"user:anne\", Relation: \"user\", Object: \"ip-address-range:10.0.0.0/16\", }, { User: \"user:anne\", Relation: \"user\", Object: \"timeslot:12_13\", } } } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"transaction:A\",, ContextualTuples = new List({ new(user: \"user:anne\", relation: \"user\", _object: \"ip-address-range:10.0.0.0/16\"), new(user: \"user:anne\", relation: \"user\", _object: \"timeslot:12_13\") }) }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"transaction:A\", contextual_tuples=[ ClientTupleKey(user=\"user:anne\", relation=\"user\", object=\"ip-address-range:10.0.0.0/16\"), ClientTupleKey(user=\"user:anne\", relation=\"user\", object=\"timeslot:12_13\") ], ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view transaction:A --contextual_tuples \"user:anne user ip-address-range:10.0.0.0/16\" \"user:anne user timeslot:12_13\" # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"transaction:A\"},\"contextual_tuples\":{\"tuple_keys\":[{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"ip-address-range:10.0.0.0/16\"},{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"timeslot:12_13\"}]}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` contextual_tuples = [ // Assuming the following is true {user = \"user:anne\", relation = \"user\", object = \"ip-address-range:10.0.0.0/16\"}, {user = \"user:anne\", relation = \"user\", object = \"timeslot:12_13\"} ], authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true When Anne is connecting from a denied ip address range or timeslot, OpenFGA will return {\"allowed\":false}: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'can_view', object: 'transaction:A', contextual_tuples: [ { user: \"user:anne\", relation: \"user\", object: \"ip-address-range:10.0.0.0/16\" }, { user: \"user:anne\", relation: \"user\", object: \"timeslot:18_19\" } ]}, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"can_view\", Object: \"transaction:A\", ContextualTuples: &[]ClientTupleKey{ { User: \"user:anne\", Relation: \"user\", Object: \"ip-address-range:10.0.0.0/16\", }, { User: \"user:anne\", Relation: \"user\", Object: \"timeslot:18_19\", } } } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"can_view\", Object = \"transaction:A\",, ContextualTuples = new List({ new(user: \"user:anne\", relation: \"user\", _object: \"ip-address-range:10.0.0.0/16\"), new(user: \"user:anne\", relation: \"user\", _object: \"timeslot:18_19\") }) }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"can_view\", object=\"transaction:A\", contextual_tuples=[ ClientTupleKey(user=\"user:anne\", relation=\"user\", object=\"ip-address-range:10.0.0.0/16\"), ClientTupleKey(user=\"user:anne\", relation=\"user\", object=\"timeslot:18_19\") ], ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne can_view transaction:A --contextual_tuples \"user:anne user ip-address-range:10.0.0.0/16\" \"user:anne user timeslot:18_19\" # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"can_view\",\"object\":\"transaction:A\"},\"contextual_tuples\":{\"tuple_keys\":[{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"ip-address-range:10.0.0.0/16\"},{\"user\":\"user:anne\",\"relation\":\"user\",\"object\":\"timeslot:18_19\"}]}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"can_view\", // has an `can_view` relation object = \"transaction:A\", // with the object `transaction:A` contextual_tuples = [ // Assuming the following is true {user = \"user:anne\", relation = \"user\", object = \"ip-address-range:10.0.0.0/16\"}, {user = \"user:anne\", relation = \"user\", object = \"timeslot:18_19\"} ], authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"Use Contextual Tuples For Context Related Checks","u":"/docs/modeling/contextual-time-based-authorization","h":"#use-contextual-tuples-for-context-related-checks","p":782},{"i":801,"t":"Final version of the Authorization Model and Relationship tuples DSL JSON model schema 1.1 type user type branch relations define account_manager: [user] define approved_ip_address_range: [ip-address-range] define approved_timeslot: [timeslot] define approved_context: user from approved_timeslot and user from approved_ip_address_range type account relations define branch: [branch] define account_manager: account_manager from branch define customer: [user] define account_manager_viewer: account_manager and approved_context from branch define viewer: customer or account_manager_viewer define can_view: viewer type transaction relations define account: [account] define can_view: viewer from account type timeslot relations define user: [user] type ip-address-range relations define user: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"branch\", \"relations\": { \"account_manager\": { \"this\": {} }, \"approved_ip_address_range\": { \"this\": {} }, \"approved_timeslot\": { \"this\": {} }, \"approved_context\": { \"intersection\": { \"child\": [ { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"approved_timeslot\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"user\" } } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"approved_ip_address_range\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"user\" } } } ] } } }, \"metadata\": { \"relations\": { \"account_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"approved_ip_address_range\": { \"directly_related_user_types\": [ { \"type\": \"ip-address-range\" } ] }, \"approved_timeslot\": { \"directly_related_user_types\": [ { \"type\": \"timeslot\" } ] } } } }, { \"type\": \"account\", \"relations\": { \"branch\": { \"this\": {} }, \"account_manager\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } } }, \"customer\": { \"this\": {} }, \"account_manager_viewer\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"approved_context\" } } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"customer\" } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager_viewer\" } } ] } }, \"can_view\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } }, \"metadata\": { \"relations\": { \"branch\": { \"directly_related_user_types\": [ { \"type\": \"branch\" } ] }, \"customer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"transaction\", \"relations\": { \"account\": { \"this\": {} }, \"can_view\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"account\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } }, \"metadata\": { \"relations\": { \"account\": { \"directly_related_user_types\": [ { \"type\": \"account\" } ] } } } }, { \"type\": \"timeslot\", \"relations\": { \"user\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"user\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"ip-address-range\", \"relations\": { \"user\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"user\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is the Account Manager at the West-Side branch { user: 'user:anne', relation: 'account_manager', object: 'branch:west-side'}, // Caroline is the customer for checking account number 526 { user: 'user:caroline', relation: 'customer', object: 'account:checking-526'}, // The West-Side branch is the branch that the Checking account number 526 has been created at { user: 'branch:west-side', relation: 'branch', object: 'account:checking-526'}, // Checking account number 526 is the account for transaction A { user: 'account:checking-526', relation: 'account', object: 'transaction:A'}, // 8am to 9am is within the office hours of the West-Side branch { user: 'timeslot:8_9', relation: 'approved_timeslot', object: 'branch:west-side'}, // 9am to 10am is within the office hours of the West-Side branch { user: 'timeslot:9_10', relation: 'approved_timeslot', object: 'branch:west-side'}, // 10am to 11am is within the office hours of the West-Side branch { user: 'timeslot:10_11', relation: 'approved_timeslot', object: 'branch:west-side'}, // 11am to 12pm is within the office hours of the West-Side branch { user: 'timeslot:11_12', relation: 'approved_timeslot', object: 'branch:west-side'}, // 12pm to 1pm is within the office hours of the West-Side branch { user: 'timeslot:12_13', relation: 'approved_timeslot', object: 'branch:west-side'}, // 1pm to 2pm is within the office hours of the West-Side branch { user: 'timeslot:13_14', relation: 'approved_timeslot', object: 'branch:west-side'}, // 2pm to 3pm is within the office hours of the West-Side branch { user: 'timeslot:14_15', relation: 'approved_timeslot', object: 'branch:west-side'}, // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch { user: 'ip-address-range:10.0.0.0/16', relation: 'approved_ip_address_range', object: 'branch:west-side'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is the Account Manager at the West-Side branch User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"account_manager\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // Caroline is the customer for checking account number 526 User: openfga.PtrString(\"user:caroline\"), Relation: openfga.PtrString(\"customer\"), Object: openfga.PtrString(\"account:checking-526\"), }, { // The West-Side branch is the branch that the Checking account number 526 has been created at User: openfga.PtrString(\"branch:west-side\"), Relation: openfga.PtrString(\"branch\"), Object: openfga.PtrString(\"account:checking-526\"), }, { // Checking account number 526 is the account for transaction A User: openfga.PtrString(\"account:checking-526\"), Relation: openfga.PtrString(\"account\"), Object: openfga.PtrString(\"transaction:A\"), }, { // 8am to 9am is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:8_9\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 9am to 10am is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:9_10\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 10am to 11am is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:10_11\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 11am to 12pm is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:11_12\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 12pm to 1pm is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:12_13\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 1pm to 2pm is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:13_14\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // 2pm to 3pm is within the office hours of the West-Side branch User: openfga.PtrString(\"timeslot:14_15\"), Relation: openfga.PtrString(\"approved_timeslot\"), Object: openfga.PtrString(\"branch:west-side\"), }, { // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch User: openfga.PtrString(\"ip-address-range:10.0.0.0/16\"), Relation: openfga.PtrString(\"approved_ip_address_range\"), Object: openfga.PtrString(\"branch:west-side\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is the Account Manager at the West-Side branch new() { User = \"user:anne\", Relation = \"account_manager\", Object = \"branch:west-side\" }, // Caroline is the customer for checking account number 526 new() { User = \"user:caroline\", Relation = \"customer\", Object = \"account:checking-526\" }, // The West-Side branch is the branch that the Checking account number 526 has been created at new() { User = \"branch:west-side\", Relation = \"branch\", Object = \"account:checking-526\" }, // Checking account number 526 is the account for transaction A new() { User = \"account:checking-526\", Relation = \"account\", Object = \"transaction:A\" }, // 8am to 9am is within the office hours of the West-Side branch new() { User = \"timeslot:8_9\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 9am to 10am is within the office hours of the West-Side branch new() { User = \"timeslot:9_10\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 10am to 11am is within the office hours of the West-Side branch new() { User = \"timeslot:10_11\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 11am to 12pm is within the office hours of the West-Side branch new() { User = \"timeslot:11_12\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 12pm to 1pm is within the office hours of the West-Side branch new() { User = \"timeslot:12_13\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 1pm to 2pm is within the office hours of the West-Side branch new() { User = \"timeslot:13_14\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // 2pm to 3pm is within the office hours of the West-Side branch new() { User = \"timeslot:14_15\", Relation = \"approved_timeslot\", Object = \"branch:west-side\" }, // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch new() { User = \"ip-address-range:10.0.0.0/16\", Relation = \"approved_ip_address_range\", Object = \"branch:west-side\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is the Account Manager at the West-Side branch user=\"user:anne\", relation=\"account_manager\", object=\"branch:west-side\", ), ClientTuple( # Caroline is the customer for checking account number 526 user=\"user:caroline\", relation=\"customer\", object=\"account:checking-526\", ), ClientTuple( # The West-Side branch is the branch that the Checking account number 526 has been created at user=\"branch:west-side\", relation=\"branch\", object=\"account:checking-526\", ), ClientTuple( # Checking account number 526 is the account for transaction A user=\"account:checking-526\", relation=\"account\", object=\"transaction:A\", ), ClientTuple( # 8am to 9am is within the office hours of the West-Side branch user=\"timeslot:8_9\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 9am to 10am is within the office hours of the West-Side branch user=\"timeslot:9_10\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 10am to 11am is within the office hours of the West-Side branch user=\"timeslot:10_11\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 11am to 12pm is within the office hours of the West-Side branch user=\"timeslot:11_12\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 12pm to 1pm is within the office hours of the West-Side branch user=\"timeslot:12_13\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 1pm to 2pm is within the office hours of the West-Side branch user=\"timeslot:13_14\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # 2pm to 3pm is within the office hours of the West-Side branch user=\"timeslot:14_15\", relation=\"approved_timeslot\", object=\"branch:west-side\", ), ClientTuple( # The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch user=\"ip-address-range:10.0.0.0/16\", relation=\"approved_ip_address_range\", object=\"branch:west-side\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"account_manager\",\"object\":\"branch:west-side\"},{\"user\":\"user:caroline\",\"relation\":\"customer\",\"object\":\"account:checking-526\"},{\"user\":\"branch:west-side\",\"relation\":\"branch\",\"object\":\"account:checking-526\"},{\"user\":\"account:checking-526\",\"relation\":\"account\",\"object\":\"transaction:A\"},{\"user\":\"timeslot:8_9\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:9_10\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:10_11\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:11_12\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:12_13\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:13_14\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"timeslot:14_15\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west-side\"},{\"user\":\"ip-address-range:10.0.0.0/16\",\"relation\":\"approved_ip_address_range\",\"object\":\"branch:west-side\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne account_manager branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:caroline customer account:checking-526 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw branch:west-side branch account:checking-526 fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw account:checking-526 account transaction:A fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:8_9 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:9_10 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:10_11 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:11_12 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:12_13 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:13_14 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw timeslot:14_15 approved_timeslot branch:west-side fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw ip-address-range:10.0.0.0/16 approved_ip_address_range branch:west-side write([ // Anne is the Account Manager at the West-Side branch { \"user\":\"user:anne\", \"relation\":\"account_manager\", \"object\":\"branch:west-side\" }, // Caroline is the customer for checking account number 526 { \"user\":\"user:caroline\", \"relation\":\"customer\", \"object\":\"account:checking-526\" }, // The West-Side branch is the branch that the Checking account number 526 has been created at { \"user\":\"branch:west-side\", \"relation\":\"branch\", \"object\":\"account:checking-526\" }, // Checking account number 526 is the account for transaction A { \"user\":\"account:checking-526\", \"relation\":\"account\", \"object\":\"transaction:A\" }, // 8am to 9am is within the office hours of the West-Side branch { \"user\":\"timeslot:8_9\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 9am to 10am is within the office hours of the West-Side branch { \"user\":\"timeslot:9_10\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 10am to 11am is within the office hours of the West-Side branch { \"user\":\"timeslot:10_11\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 11am to 12pm is within the office hours of the West-Side branch { \"user\":\"timeslot:11_12\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 12pm to 1pm is within the office hours of the West-Side branch { \"user\":\"timeslot:12_13\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 1pm to 2pm is within the office hours of the West-Side branch { \"user\":\"timeslot:13_14\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // 2pm to 3pm is within the office hours of the West-Side branch { \"user\":\"timeslot:14_15\", \"relation\":\"approved_timeslot\", \"object\":\"branch:west-side\" }, // The office VPN w/ the 10.0.0.0/16 address range is approved for the West-Side branch { \"user\":\"ip-address-range:10.0.0.0/16\", \"relation\":\"approved_ip_address_range\", \"object\":\"branch:west-side\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Warning Contextual tuples: Are not persisted in the store. Are only supported on the Check API endpoint and ListObjects API endpoint. They are not supported on read, expand and other endpoints.- If you are using the ReadChanges API endpoint to build a permission aware search index, note that it will not be trivial to take contextual tuples into account. If you are using the Read Changes API endpoint to build a permission aware search index, note that it will not be trivial to take contextual tuples into account.","s":"Summary","u":"/docs/modeling/contextual-time-based-authorization","h":"#summary","p":782},{"i":803,"t":"In order to keep this guide concise, we assumed you were modeling for a single bank. What if you were offering a multi-tenant service where each bank is a single tenant? In that case, we can extend the model like so: DSL JSON model schema 1.1 type user type bank relations define admin: [user] type branch relations define bank: [bank] define account_manager: [user] define approved_ip_address_range: [ip-address-range] define approved_timeslot: [timeslot] define approved_context: user from approved_timeslot and user from approved_ip_address_range type account relations define branch: [branch] define account_manager: account_manager from branch define customer: [user] define account_manager_viewer: account_manager and approved_context from branch define viewer: customer or account_manager_viewer define can_view: viewer type transaction relations define account: [account] define can_view: viewer from account type timeslot relations define user: [user] type ip-address-range relations define user: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"bank\", \"relations\": { \"admin\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"branch\", \"relations\": { \"bank\": { \"this\": {} }, \"account_manager\": { \"this\": {} }, \"approved_ip_address_range\": { \"this\": {} }, \"approved_timeslot\": { \"this\": {} }, \"approved_context\": { \"intersection\": { \"child\": [ { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"approved_timeslot\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"user\" } } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"approved_ip_address_range\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"user\" } } } ] } } }, \"metadata\": { \"relations\": { \"bank\": { \"directly_related_user_types\": [ { \"type\": \"bank\" } ] }, \"account_manager\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"approved_ip_address_range\": { \"directly_related_user_types\": [ { \"type\": \"ip-address-range\" } ] }, \"approved_timeslot\": { \"directly_related_user_types\": [ { \"type\": \"timeslot\" } ] } } } }, { \"type\": \"account\", \"relations\": { \"branch\": { \"this\": {} }, \"account_manager\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } } }, \"customer\": { \"this\": {} }, \"account_manager_viewer\": { \"intersection\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager\" } }, { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"branch\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"approved_context\" } } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"computedUserset\": { \"object\": \"\", \"relation\": \"customer\" } }, { \"computedUserset\": { \"object\": \"\", \"relation\": \"account_manager_viewer\" } } ] } }, \"can_view\": { \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } }, \"metadata\": { \"relations\": { \"branch\": { \"directly_related_user_types\": [ { \"type\": \"branch\" } ] }, \"customer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"transaction\", \"relations\": { \"account\": { \"this\": {} }, \"can_view\": { \"tupleToUserset\": { \"tupleset\": { \"object\": \"\", \"relation\": \"account\" }, \"computedUserset\": { \"object\": \"\", \"relation\": \"viewer\" } } } }, \"metadata\": { \"relations\": { \"account\": { \"directly_related_user_types\": [ { \"type\": \"account\" } ] } } } }, { \"type\": \"timeslot\", \"relations\": { \"user\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"user\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"ip-address-range\", \"relations\": { \"user\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"user\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"Taking It A Step Further: Banks As A Service Authorization","u":"/docs/modeling/contextual-time-based-authorization","h":"#taking-it-a-step-further-banks-as-a-service-authorization","p":782},{"i":805,"t":"Check the following sections for more on how user groups can be used. Object to Object Relationships Learn how objects can relate to one another and how that can affect user's access. More Modeling with Multiple Restrictions Learn how to model requiring multiple relationships before users are authorized to perform certain actions. More OpenFGA API Details on the Check API in the OpenFGA reference guide. More","s":"Related Sections","u":"/docs/modeling/contextual-time-based-authorization","h":"#related-sections","p":782},{"i":807,"t":"This tutorial explains how to represent Google Drive permissions model with OpenFGA. What you will learn Indicate relationships between a group of users and an object. See Modeling User Groups for more. Used here to indicate that all users within a domain can access a document (sharing a document within an organization). Model concentric relationship to have a certain relation on an object imply another relation on the same object. See Modeling Concepts: Concentric Relationships for more. Used here is to indicate that writers are also commenters and viewers. Using the union operator condition to indicate that a user might have a certain relation with an object if they match any of the criteria indicated. Used here to indicate that a user can be a viewer on a document, or can have the viewer relationship implied through commenter. Using the type bound public access in a relationship tuple's user field to indicate that everyone has a certain relation with an object. See Modeling Public Access for more. Used here to share documents publicly. Model parent-child objects to indicate that a user having a relationship with a certain object implies having a relationship with another object in OpenFGA. Used here is to indicate that a writer on a folder is a writer on all documents inside that folder.","s":"Modeling Google Drive permissions with OpenFGA","u":"/docs/modeling/advanced/gdrive","h":"","p":806},{"i":809,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA concepts and know how to develop the things that we will list below. OpenFGA Concepts​ It would be helpful to have an understanding of some concepts of OpenFGA before you start. Modeling Concentric Relationships​ You need to know how to update the authorization model to allow having nested relations such as all writers are readers. Learn more → Modeling Object-to-Object Relationships​ You need to know how to create relationships between objects and how that might affect a user's relationships to those objects. Learn more → Used here to indicate that users who have access to view a folder have access to view all documents inside it. Modeling Public Access​ You need to know how to add a relationship tuple to indicate that a resource is publicly available. Learn more → Concepts & Configuration Language​ The OpenFGA Concepts Configuration Language","s":"Before You Start","u":"/docs/modeling/advanced/gdrive","h":"#before-you-start","p":806},{"i":811,"t":"It would be helpful to have an understanding of some concepts of OpenFGA before you start.","s":"OpenFGA Concepts","u":"/docs/modeling/advanced/gdrive","h":"#-concepts","p":806},{"i":813,"t":"Google Drive is a system to store, share, and collaborate on files and folders. Source In this tutorial, you will build a subset of the Google Drive permission model (detailed below) in OpenFGA, using some scenarios to validate the model. Note: For brevity, this tutorial will not model all of Google Drive's permissions. Instead, it will focus on modeling for the scenarios outlined below","s":"What You Will Be Modeling","u":"/docs/modeling/advanced/gdrive","h":"#what-you-will-be-modeling","p":806},{"i":815,"t":"Google Drive's permission model is represented in their documentation. In this tutorial, you will be focusing on a subset of these permissions. Requirements: Users can be owners, editors, commenters and viewers of documents Documents can be shared with all users in a domain Folders can contain documents and users with a certain permission on a folder have that same permission to a document in that folder Documents and folders can be shared publicly","s":"Requirements","u":"/docs/modeling/advanced/gdrive","h":"#requirements","p":806},{"i":817,"t":"There will be the following users: Anne, who is in the xyz domain Beth, who is in the xyz domain Charles, who is in the xyz domain Diane, who is NOT in the xyz domain Erik, who is NOT in the xyz domain There will be: a 2021-budget document, owned by Anne, shared for commenting with Beth and viewable by all members of the xyz domain. a 2021-planning folder, viewable by Diane and contains the 2021-budget document a 2021-public-roadmap document, owned by Anne, available for members xyz domain to comment on and is publicly viewable","s":"Defined Scenarios","u":"/docs/modeling/advanced/gdrive","h":"#defined-scenarios","p":806},{"i":820,"t":"To keep thing simple and focus on OpenFGA features rather than Google Drive complexity we will model only four roles (Viewer, Commenter, Writer, Owner). At the end of this section we want to have the following permissions represented: To represent permissions in OpenFGA we use relations. For document permissions we need to create the following authorization model: DSL JSON model schema 1.1 type user type document relations define owner: [user] define writer: [user] define commenter: [user] define viewer: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"commenter\": { \"this\": {} }, \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The OpenFGA service determines if a user has access to an object by checking if the user has a relation to that object. Let us examine one of those relations in detail: DSL JSON type document relations define viewer: [user] { \"type\": \"document\", \"relations\": { \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } info The snippet above indicates that objects of type document have users related to them as \"viewer\" if those users belong to the userset of all users related to the document as \"viewer\". This means that a user can be directly related as a viewer to an object of type \"document\" If we want to say beth is a commenter of document:2021-budget we create this relationship tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:beth', relation: 'commenter', object: 'document:2021-budget'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"commenter\"), Object: openfga.PtrString(\"document:2021-budget\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:beth\", Relation = \"commenter\", Object = \"document:2021-budget\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:beth\", relation=\"commenter\", object=\"document:2021-budget\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:beth\",\"relation\":\"commenter\",\"object\":\"document:2021-budget\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth commenter document:2021-budget write([ { \"user\":\"user:beth\", \"relation\":\"commenter\", \"object\":\"document:2021-budget\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") We can now ask OpenFGA \"is beth a commenter of repository document:2021-budget?\" Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'commenter', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"commenter\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"commenter\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"commenter\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth commenter document:2021-budget # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"commenter\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"commenter\", // has an `commenter` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true We could also say that anne is an owner of the same document: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:anne', relation: 'owner', object: 'document:2021-budget'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"document:2021-budget\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:anne\", Relation = \"owner\", Object = \"document:2021-budget\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:anne\", relation=\"owner\", object=\"document:2021-budget\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"owner\",\"object\":\"document:2021-budget\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-budget write([ { \"user\":\"user:anne\", \"relation\":\"owner\", \"object\":\"document:2021-budget\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") And ask some questions to OpenFGA: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'owner', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"owner\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"owner\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"owner\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-budget # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"owner\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"owner\", // has an `owner` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'writer', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"writer\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"writer\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"writer\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne writer document:2021-budget # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"writer\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":false} check( user = \"user:anne\", // check if the user `user:anne` relation = \"writer\", // has an `writer` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false The first reply makes sense but the second one does not. Intuitively, if anne was an owner, she was also be a writer. In fact, Google Drive explains this in their documentation To make OpenFGA aware of this \"concentric\" permission model we need to update our definitions: DSL JSON model schema 1.1 type user type document relations define owner: [user] define writer: [user] or owner define commenter: [user] or writer define viewer: [user] or commenter { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"this\": {} }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"owner\" } } ] } }, \"commenter\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"commenter\" } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Let's examine one of those relations in detail: objects of type document have users related to them as \"viewer\": if they belong to any of (the union of) the following: the userset of all users related to the document as \"viewer\" the userset of all users related to the document as \"commenter\" With this update our model now supports nested definitions and now: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'owner', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"owner\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"owner\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"owner\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-budget # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"owner\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"owner\", // has an `owner` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'writer', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"writer\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"writer\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"writer\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne writer document:2021-budget # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"writer\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"writer\", // has an `writer` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"01. Individual Permissions","u":"/docs/modeling/advanced/gdrive","h":"#01-individual-permissions","p":806},{"i":822,"t":"Google Drive allows you to share a file with everyone in your organization as a viewer, commenter or writer/editor. At the end of this section we want to end up with the following permissions represented: To add support for domains and members all we need to do is add this object to the OpenFGA authorization model. In addition, update the model to allow domain member to be assigned to document: DSL JSON model schema 1.1 type user type document relations define owner: [user, domain#member] define writer: [user, domain#member] or owner define commenter: [user, domain#member] or writer define viewer: [user, domain#member] or commenter type domain relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"this\": {} }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"owner\" } } ] } }, \"commenter\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"commenter\" } } ] } } }, \"metadata\": { \"relations\": { \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } }, { \"type\": \"domain\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Objects of type \"domain\" have users related to them as \"member\" if they belong to the userset of all users related to the domain as \"member\". In other words, users can be direct members of a domain. Let's now create a domain, add members to it and make all members viewers of document:2021-budget. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // make anne, beth, charles a member of the xyz domain { user: 'user:anne', relation: 'member', object: 'domain:xyz'}, { user: 'user:beth', relation: 'member', object: 'domain:xyz'}, { user: 'user:charles', relation: 'member', object: 'domain:xyz'}, // make members of xyz domain viewers of document:2021-budget { user: 'domain:xyz#member', relation: 'viewer', object: 'document:2021-budget'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // make anne, beth, charles a member of the xyz domain User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"domain:xyz\"), }, { User: openfga.PtrString(\"user:beth\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"domain:xyz\"), }, { User: openfga.PtrString(\"user:charles\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"domain:xyz\"), }, { // make members of xyz domain viewers of document:2021-budget User: openfga.PtrString(\"domain:xyz#member\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"document:2021-budget\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // make anne, beth, charles a member of the xyz domain new() { User = \"user:anne\", Relation = \"member\", Object = \"domain:xyz\" }, new() { User = \"user:beth\", Relation = \"member\", Object = \"domain:xyz\" }, new() { User = \"user:charles\", Relation = \"member\", Object = \"domain:xyz\" }, // make members of xyz domain viewers of document:2021-budget new() { User = \"domain:xyz#member\", Relation = \"viewer\", Object = \"document:2021-budget\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # make anne, beth, charles a member of the xyz domain user=\"user:anne\", relation=\"member\", object=\"domain:xyz\", ), ClientTuple( user=\"user:beth\", relation=\"member\", object=\"domain:xyz\", ), ClientTuple( user=\"user:charles\", relation=\"member\", object=\"domain:xyz\", ), ClientTuple( # make members of xyz domain viewers of document:2021-budget user=\"domain:xyz#member\", relation=\"viewer\", object=\"document:2021-budget\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"member\",\"object\":\"domain:xyz\"},{\"user\":\"user:beth\",\"relation\":\"member\",\"object\":\"domain:xyz\"},{\"user\":\"user:charles\",\"relation\":\"member\",\"object\":\"domain:xyz\"},{\"user\":\"domain:xyz#member\",\"relation\":\"viewer\",\"object\":\"document:2021-budget\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne member domain:xyz fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth member domain:xyz fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles member domain:xyz fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw domain:xyz#member viewer document:2021-budget write([ // make anne, beth, charles a member of the xyz domain { \"user\":\"user:anne\", \"relation\":\"member\", \"object\":\"domain:xyz\" }, { \"user\":\"user:beth\", \"relation\":\"member\", \"object\":\"domain:xyz\" }, { \"user\":\"user:charles\", \"relation\":\"member\", \"object\":\"domain:xyz\" }, // make members of xyz domain viewers of document:2021-budget { \"user\":\"domain:xyz#member\", \"relation\":\"viewer\", \"object\":\"document:2021-budget\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") The last relationship tuple introduces a new OpenFGA concept. A userset. When the value of a user is formatted like this objectType:objectId#relation, OpenFGA will automatically expand the userset into all its individual user identifiers: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:charles', relation: 'viewer', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:charles\", Relation: \"viewer\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:charles\", Relation = \"viewer\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:charles\", relation=\"viewer\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:charles viewer document:2021-budget # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:charles\",\"relation\":\"viewer\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":true} check( user = \"user:charles\", // check if the user `user:charles` relation = \"viewer\", // has an `viewer` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true","s":"02. Organization Permissions","u":"/docs/modeling/advanced/gdrive","h":"#02-organization-permissions","p":806},{"i":824,"t":"Permission propagation happens between folders and files: if you are a viewer in a folder, you can view its documents. This applies even when you are not explicitly a viewer in a document. At the end of this section we want to end up with the following permissions represented. Note that a folder is an object in the document type, as we do not need a separate type: We need to add the notion that a document can be the parent of another document. We know how to do that: DSL JSON model schema 1.1 type user type document relations define parent: [document] define owner: [user, domain#member] define writer: [user, domain#member] or owner define commenter: [user, domain#member] or writer define viewer: [user, domain#member] or commenter { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"parent\": { \"this\": {} }, \"owner\": { \"this\": {} }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"owner\" } } ] } }, \"commenter\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"commenter\" } } ] } } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"document\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } } ] } info Notice the newly added \"parent\" relation in the configuration above. We can indicate this relation by adding the following relationship tuples Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Diane is a viewer of document:2021-planning { user: 'user:diane', relation: 'viewer', object: 'document:2021-planning'}, // document:2021-planning is a parent of document:2021-budget { user: 'document:2021-planning', relation: 'parent', object: 'document:2021-budget'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Diane is a viewer of document:2021-planning User: openfga.PtrString(\"user:diane\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"document:2021-planning\"), }, { // document:2021-planning is a parent of document:2021-budget User: openfga.PtrString(\"document:2021-planning\"), Relation: openfga.PtrString(\"parent\"), Object: openfga.PtrString(\"document:2021-budget\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Diane is a viewer of document:2021-planning new() { User = \"user:diane\", Relation = \"viewer\", Object = \"document:2021-planning\" }, // document:2021-planning is a parent of document:2021-budget new() { User = \"document:2021-planning\", Relation = \"parent\", Object = \"document:2021-budget\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Diane is a viewer of document:2021-planning user=\"user:diane\", relation=\"viewer\", object=\"document:2021-planning\", ), ClientTuple( # document:2021-planning is a parent of document:2021-budget user=\"document:2021-planning\", relation=\"parent\", object=\"document:2021-budget\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:diane\",\"relation\":\"viewer\",\"object\":\"document:2021-planning\"},{\"user\":\"document:2021-planning\",\"relation\":\"parent\",\"object\":\"document:2021-budget\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane viewer document:2021-planning fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw document:2021-planning parent document:2021-budget write([ // Diane is a viewer of document:2021-planning { \"user\":\"user:diane\", \"relation\":\"viewer\", \"object\":\"document:2021-planning\" }, // document:2021-planning is a parent of document:2021-budget { \"user\":\"document:2021-planning\", \"relation\":\"parent\", \"object\":\"document:2021-budget\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") What we still lack is the ability to propagate permissions from parent to children. We want to say that a user is a viewer of a document if either: [done] they have a viewer relationship (directly or through domain membership) [pending] they have a viewer relationship with the parent document We need a way to consider the parent viewers, not just direct viewers of the document when getting a check for: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:diane', relation: 'viewer', object: 'document:2021-budget', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = undefined Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:diane\", Relation: \"viewer\", Object: \"document:2021-budget\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: undefined } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:diane\", Relation = \"viewer\", Object = \"document:2021-budget\", }; var response = await fgaClient.Check(body, options); // response.Allowed = undefined Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:diane\", relation=\"viewer\", object=\"document:2021-budget\", ) response = await fga_client.check(body, options) # response.allowed = undefined Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:diane viewer document:2021-budget # Response: {\"allowed\":undefined} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:diane\",\"relation\":\"viewer\",\"object\":\"document:2021-budget\"}}' # Response: {\"allowed\":undefined} check( user = \"user:diane\", // check if the user `user:diane` relation = \"viewer\", // has an `viewer` relation object = \"document:2021-budget\", // with the object `document:2021-budget` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: undefined More details on this technique can be found in the section Modeling Parent-Child Objects. We express it like this: DSL JSON type document relations define viewer: [user, domain#member] or commenter or viewer from parent { \"type\": \"document\", \"relations\": { \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"commenter\" } }, { \"tupleToUserset\": { \"tupleset\": { \"relation\": \"parent\" }, \"computedUserset\": { \"relation\": \"viewer\" } } } ] } } }, \"metadata\": { \"relations\": { \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } } info The users with a viewer relationship to a certain object of type \"document\" are any of: the \"viewers\": the set of users who are directly related to the document as a \"viewer\" the \"commenters\": the set of users who are related to the object as \"commenter\" the \"viewers of the parents\": from the objects who are related to the doc as parent, return the sets of users who are related to those objects as \"viewer\" What the added section is doing is: read all relationship tuples related to document:2021-budget as parent which returns: [{ \"object\": \"document:2021-budget\", \"relation\": \"parent\", \"user\": \"document:2021-planning\" }] for each relationship tuple read, return all usersets that match the following, returning tuples of shape: { \"object\": \"document:2021-planning\", \"viewer\", \"user\": ??? } including: { \"object\": \"document:2021-planning\", \"viewer\", \"user\": \"user:diane\" } The updated authorization model looks like this: DSL JSON model schema 1.1 type user type document relations define owner: [user, domain#member] or owner from parent define writer: [user, domain#member] or owner or writer from parent define commenter: [user, domain#member] or writer or commenter from parent define viewer: [user, domain#member] or commenter or viewer from parent define parent: [document] type domain relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"owner\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"owner\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"writer\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"commenter\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"commenter\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"commenter\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"viewer\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"parent\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"document\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } }, { \"type\": \"domain\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] }","s":"03. Folder Permission Propagation","u":"/docs/modeling/advanced/gdrive","h":"#03-folder-permission-propagation","p":806},{"i":826,"t":"Google Drive has a feature which allows sharing a file or folder publicly, and specifying the permissions a public user might have (writer/commenter/viewer). Assume that Anne has created a new document: 2021-public-roadmap, has shared it with commenter permissions to the xyz.com, and has shared it as view only with the public at large. Here's where another OpenFGA feature, type bound public access (as in everyone), would come in handy. First, we will need to update our model to allow for public access with type user for viewer relation. DSL JSON model schema 1.1 type user type document relations define owner: [user, domain#member] or owner from parent define writer: [user, domain#member] or owner or writer from parent define commenter: [user, domain#member] or writer or commenter from parent define viewer: [user, user:*, domain#member] or commenter or viewer from parent define parent: [document] type domain relations define member: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"document\", \"relations\": { \"owner\": { \"union\": { \"child\": [ { \"this\": {} }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"owner\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"writer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"owner\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"writer\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"commenter\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"commenter\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"commenter\" } }, { \"tupleToUserset\": { \"computedUserset\": { \"relation\": \"viewer\" }, \"tupleset\": { \"relation\": \"parent\" } } } ] } }, \"parent\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"parent\": { \"directly_related_user_types\": [ { \"type\": \"document\" } ] }, \"owner\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"commenter\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"domain\", \"relation\": \"member\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"user\", \"wildcard\": {} }, { \"type\": \"domain\", \"relation\": \"member\" } ] } } } }, { \"type\": \"domain\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } To mark Anne as the owner, the domain members as commenters and the public as viewers, we need to add the following relationship tuples: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Anne is the owner of document:2021-public-roadmap { user: 'user:anne', relation: 'owner', object: 'document:2021-public-roadmap'}, // Members of the domain:xyz can comment on document:2021-public-roadmap { user: 'domain:xyz#member', relation: 'commenter', object: 'document:2021-public-roadmap'}, // Everyone with type `user` can view document:2021-public-roadmap { user: 'user:*', relation: 'viewer', object: 'document:2021-public-roadmap'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Anne is the owner of document:2021-public-roadmap User: openfga.PtrString(\"user:anne\"), Relation: openfga.PtrString(\"owner\"), Object: openfga.PtrString(\"document:2021-public-roadmap\"), }, { // Members of the domain:xyz can comment on document:2021-public-roadmap User: openfga.PtrString(\"domain:xyz#member\"), Relation: openfga.PtrString(\"commenter\"), Object: openfga.PtrString(\"document:2021-public-roadmap\"), }, { // Everyone with type `user` can view document:2021-public-roadmap User: openfga.PtrString(\"user:*\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"document:2021-public-roadmap\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Anne is the owner of document:2021-public-roadmap new() { User = \"user:anne\", Relation = \"owner\", Object = \"document:2021-public-roadmap\" }, // Members of the domain:xyz can comment on document:2021-public-roadmap new() { User = \"domain:xyz#member\", Relation = \"commenter\", Object = \"document:2021-public-roadmap\" }, // Everyone with type `user` can view document:2021-public-roadmap new() { User = \"user:*\", Relation = \"viewer\", Object = \"document:2021-public-roadmap\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Anne is the owner of document:2021-public-roadmap user=\"user:anne\", relation=\"owner\", object=\"document:2021-public-roadmap\", ), ClientTuple( # Members of the domain:xyz can comment on document:2021-public-roadmap user=\"domain:xyz#member\", relation=\"commenter\", object=\"document:2021-public-roadmap\", ), ClientTuple( # Everyone with type `user` can view document:2021-public-roadmap user=\"user:*\", relation=\"viewer\", object=\"document:2021-public-roadmap\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:anne\",\"relation\":\"owner\",\"object\":\"document:2021-public-roadmap\"},{\"user\":\"domain:xyz#member\",\"relation\":\"commenter\",\"object\":\"document:2021-public-roadmap\"},{\"user\":\"user:*\",\"relation\":\"viewer\",\"object\":\"document:2021-public-roadmap\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-public-roadmap fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw domain:xyz#member commenter document:2021-public-roadmap fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:* viewer document:2021-public-roadmap write([ // Anne is the owner of document:2021-public-roadmap { \"user\":\"user:anne\", \"relation\":\"owner\", \"object\":\"document:2021-public-roadmap\" }, // Members of the domain:xyz can comment on document:2021-public-roadmap { \"user\":\"domain:xyz#member\", \"relation\":\"commenter\", \"object\":\"document:2021-public-roadmap\" }, // Everyone with type `user` can view document:2021-public-roadmap { \"user\":\"user:*\", \"relation\":\"viewer\", \"object\":\"document:2021-public-roadmap\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Anne is an owner of the document Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:anne', relation: 'owner', object: 'document:2021-public-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:anne\", Relation: \"owner\", Object: \"document:2021-public-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:anne\", Relation = \"owner\", Object = \"document:2021-public-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:anne\", relation=\"owner\", object=\"document:2021-public-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:anne owner document:2021-public-roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:anne\",\"relation\":\"owner\",\"object\":\"document:2021-public-roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:anne\", // check if the user `user:anne` relation = \"owner\", // has an `owner` relation object = \"document:2021-public-roadmap\", // with the object `document:2021-public-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Beth is a member of the xyz.com domain, and so can comment but cannot write Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'writer', object: 'document:2021-public-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"writer\", Object: \"document:2021-public-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"writer\", Object = \"document:2021-public-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"writer\", object=\"document:2021-public-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth writer document:2021-public-roadmap # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"writer\",\"object\":\"document:2021-public-roadmap\"}}' # Response: {\"allowed\":false} check( user = \"user:beth\", // check if the user `user:beth` relation = \"writer\", // has an `writer` relation object = \"document:2021-public-roadmap\", // with the object `document:2021-public-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:beth', relation: 'commenter', object: 'document:2021-public-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:beth\", Relation: \"commenter\", Object: \"document:2021-public-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:beth\", Relation = \"commenter\", Object = \"document:2021-public-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:beth\", relation=\"commenter\", object=\"document:2021-public-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:beth commenter document:2021-public-roadmap # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:beth\",\"relation\":\"commenter\",\"object\":\"document:2021-public-roadmap\"}}' # Response: {\"allowed\":true} check( user = \"user:beth\", // check if the user `user:beth` relation = \"commenter\", // has an `commenter` relation object = \"document:2021-public-roadmap\", // with the object `document:2021-public-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Erik is NOT a member of the xyz.com domain, and so can only view the document Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:erik', relation: 'writer', object: 'document:2021-public-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:erik\", Relation: \"writer\", Object: \"document:2021-public-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:erik\", Relation = \"writer\", Object = \"document:2021-public-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:erik\", relation=\"writer\", object=\"document:2021-public-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik writer document:2021-public-roadmap # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:erik\",\"relation\":\"writer\",\"object\":\"document:2021-public-roadmap\"}}' # Response: {\"allowed\":false} check( user = \"user:erik\", // check if the user `user:erik` relation = \"writer\", // has an `writer` relation object = \"document:2021-public-roadmap\", // with the object `document:2021-public-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:erik', relation: 'viewer', object: 'document:2021-public-roadmap', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:erik\", Relation: \"viewer\", Object: \"document:2021-public-roadmap\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:erik\", Relation = \"viewer\", Object = \"document:2021-public-roadmap\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:erik\", relation=\"viewer\", object=\"document:2021-public-roadmap\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:erik viewer document:2021-public-roadmap # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:erik\",\"relation\":\"viewer\",\"object\":\"document:2021-public-roadmap\"}}' # Response: {\"allowed\":false} check( user = \"user:erik\", // check if the user `user:erik` relation = \"viewer\", // has an `viewer` relation object = \"document:2021-public-roadmap\", // with the object `document:2021-public-roadmap` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false","s":"04. Sharing Files And Folders Publicly","u":"/docs/modeling/advanced/gdrive","h":"#04-sharing-files-and-folders-publicly","p":806},{"i":828,"t":"Take a look at the following sections for more information. Search with permissions Give your users search results with objects that they have access to More","s":"Related Sections","u":"/docs/modeling/advanced/gdrive","h":"#related-sections","p":806},{"i":830,"t":"This tutorial explains how to model permissions for a communication platform like Slack using OpenFGA. What you will learn How to indicate relationships between a group of users and an object. Used here to indicate that all members of a slack workspace can write in a certain channel. See Modeling User Groups for more. How to Model concentric relationship to have a certain relation on an object imply another relation on the same object. Used here to indicate that legacy admins have all the permissions of the more granular channels admin. See Modeling Concentric Relationships for more. How to use the union operator condition to indicate that a user might have a certain relation with an object if they match any of the criteria indicated.","s":"Modeling Authorization for Slack with OpenFGA","u":"/docs/modeling/advanced/slack","h":"","p":829},{"i":832,"t":"In order to understand this guide correctly you must be familiar with some OpenFGA concepts and know how to develop the things that we will list below. OpenFGA Concepts​ It would be helpful to have an understanding of some concepts of OpenFGA before you start. Direct Access​ You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. Learn more → Modeling Concentric Relationships​ You need to know how to update the authorization model to allow having nested relations such as all writers are readers. Learn more → Concepts & Configuration Language​ Some OpenFGA Concepts Configuration Language","s":"Before You Start","u":"/docs/modeling/advanced/slack","h":"#before-you-start","p":829},{"i":834,"t":"It would be helpful to have an understanding of some concepts of OpenFGA before you start.","s":"OpenFGA Concepts","u":"/docs/modeling/advanced/slack","h":"#-concepts","p":829},{"i":836,"t":"Slack is a messaging app for businesses that connects people to the information they need. By bringing people together to work as one unified team, Slack transforms the way organizations communicate. (Source: What is Slack?) In this tutorial, you will build a subset of the Slack permission model (detailed below) in OpenFGA, using some scenarios to validate the model. As reference, you can refer to Slack's publicly available docs: Role Management at Slack Types of Roles in Slack Permissions by Role in Slack Manage a Workspace on Enterprise Grid Manage channel posting permissions Note: For brevity, this tutorial will not model all of Slack's permissions. Instead, it will focus on modeling the scenarios outlined below.","s":"What you will be modeling","u":"/docs/modeling/advanced/slack","h":"#what-you-will-be-modeling","p":829},{"i":838,"t":"This tutorial will focus on the following sections (this is a partial list of Slack's roles): Workspace Roles: Guest: This type of user is limited in their ability to use Slack, and is only permitted to see one or multiple delegated channels. Member: This is the base type of user that does not have any particular administrative abilities, but has basic access to the organization's Slack workspaces. When an administrative change needs to be made, these users need the support of admins and owners to make the changes. Legacy Admin: This type of user is the basic administrator of any organization, and can make a wide variety of administrative changes across Slack, such as renaming channels, archiving channels, setting up preferences and policies, inviting new users, and installing applications. Users with this role perform the majority of administrative tasks across a team. System Roles: Channels Admin: This type of user has the permission to archive channels, rename channels, create private channels, and convert public channels into private channels. Channel Settings: Visibility: Public: Visible to all members and open to join Private: Visible to admins and invited members Posting Permissions: Open: Anyone can post Limited: Only allowed members can post","s":"Requirements","u":"/docs/modeling/advanced/slack","h":"#requirements","p":829},{"i":840,"t":"Use the following scenarios to be able to validate whether the model of the requirements is correct. There will be the following users: Amy Bob Catherine David Emily These users will interact in the following scenarios: You will assume there is a Slack workspace called Sandcastle Amy is a legacy admin of the Sandcastle workspace Bob is a member of the Sandcastle workspace with a channels admin role (Read more about system roles at Slack here) Catherine and Emily are normal members of the Sandcastle workspace, they can view all public channels, as well as channels they have been invited to David is a guest user with only view and write access to #proj-marketing-campaign, one of the public channels in the Sandcastle workspace Bob and Emily are in a private channel #marketing-internal in the Sandcastle workspace which only they can view and post to All members of the Sandcastle workspace can view the general channel, but only Amy and Emily can post to it caution In production, it is highly recommended to use unique, immutable identifiers. Names are used in this article to make it easier to read and follow.","s":"Defined Scenarios","u":"/docs/modeling/advanced/slack","h":"#defined-scenarios","p":829},{"i":842,"t":"The goal by the end of this post is to ask OpenFGA: Does person X have permission to perform action Y on channel Z? In response, you want to either get a confirmation that person X can indeed do that, or a rejection that they cannot. E.g. does David have access to view #general? The OpenFGA is based on Zanzibar, a Relation Based Access Control system. This means it relies on objects and user relations to perform authorization checks. Setting aside the permissions, you will start with the roles and learn how to express the requirements in terms of relations you can feed into OpenFGA. The requirements stated: Amy is a legacy admin of the Sandcastle workspace Bob is a channels admin of the Sandcastle workspace Catherine and Emily are a normal members of the Sandcastle workspace David is a guest user Here is how you would express than in OpenFGA's authorization model: You have a type called \"workspace\", and users can be related to it as a legacy_admin, channels_admin, member and guest DSL JSON model schema 1.1 type user type workspace relations define legacy_admin: [user] define channels_admin: [user] define member: [user] define guest: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relations\": { \"legacy_admin\": { \"this\": {} }, \"channels_admin\": { \"this\": {} }, \"member\": { \"this\": {} }, \"guest\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"legacy_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"channels_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"guest\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } info Objects of type workspace have users related to them as: Legacy Admin (legacy_admin) Channels Admin (channels_admin) Member (member) Guest (guest) Direct relationship type restrictions indicate that a user can have a direct relationship with an object of the type the relation specifies.","s":"Modeling Workspaces & Channels","u":"/docs/modeling/advanced/slack","h":"#modeling-workspaces--channels","p":829},{"i":844,"t":"To keep things simple and focus on OpenFGA rather than Slack complexity, we will model only four roles (legacy_admin, channels_admin, member, guest). At the end of this section we want to have the following permissions represented User Relation Object amy legacy_admin workspace:sandcastle bob channels_admin workspace:sandcastle catherine member workspace:sandcastle david guest workspace:sandcastle emily member workspace:sandcastle To represent permissions in OpenFGA we use relations. For workspace permissions we need to create the following authorization model: DSL JSON model schema 1.1 type user type workspace relations define legacy_admin: [user] define channels_admin: [user] define member: [user] define guest: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relations\": { \"legacy_admin\": { \"this\": {} }, \"channels_admin\": { \"this\": {} }, \"member\": { \"this\": {} }, \"guest\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"legacy_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"channels_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"guest\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } The OpenFGA service determines if a user has access to an object by checking if the user has a relation to that object. Let us examine one of those relations in detail: DSL JSON type workspace relations define member: [user] { \"type\": \"workspace\", \"relations\": { \"member\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } info The snippet above indicates that objects of type workspace have users related to them as \"member\" if those users belong to the userset of all users related to the workspace as \"member\". This means that a user can be directly related as a member to an object of type \"workspace\" If we want to say amy is a legacy_admin of workspace:sandcastle we create this relationship tuple Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Amy is a Legacy Admin in the Sandcastle workspace { user: 'user:amy', relation: 'legacy_admin', object: 'workspace:sandcastle'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Amy is a Legacy Admin in the Sandcastle workspace User: openfga.PtrString(\"user:amy\"), Relation: openfga.PtrString(\"legacy_admin\"), Object: openfga.PtrString(\"workspace:sandcastle\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Amy is a Legacy Admin in the Sandcastle workspace new() { User = \"user:amy\", Relation = \"legacy_admin\", Object = \"workspace:sandcastle\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Amy is a Legacy Admin in the Sandcastle workspace user=\"user:amy\", relation=\"legacy_admin\", object=\"workspace:sandcastle\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:amy\",\"relation\":\"legacy_admin\",\"object\":\"workspace:sandcastle\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy legacy_admin workspace:sandcastle write([ // Amy is a Legacy Admin in the Sandcastle workspace { \"user\":\"user:amy\", \"relation\":\"legacy_admin\", \"object\":\"workspace:sandcastle\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") We can now ask OpenFGA \"is amy a legacy_admin of workspace:sandcastle?\" Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:amy', relation: 'legacy_admin', object: 'workspace:sandcastle', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:amy\", Relation: \"legacy_admin\", Object: \"workspace:sandcastle\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:amy\", Relation = \"legacy_admin\", Object = \"workspace:sandcastle\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:amy\", relation=\"legacy_admin\", object=\"workspace:sandcastle\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy legacy_admin workspace:sandcastle # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:amy\",\"relation\":\"legacy_admin\",\"object\":\"workspace:sandcastle\"}}' # Response: {\"allowed\":true} check( user = \"user:amy\", // check if the user `user:amy` relation = \"legacy_admin\", // has an `legacy_admin` relation object = \"workspace:sandcastle\", // with the object `workspace:sandcastle` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true We can also say that catherine is a member of workspace:sandcastle: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Catherine is a Member in the Sandcastle workspace { user: 'user:catherine', relation: 'member', object: 'workspace:sandcastle'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Catherine is a Member in the Sandcastle workspace User: openfga.PtrString(\"user:catherine\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"workspace:sandcastle\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Catherine is a Member in the Sandcastle workspace new() { User = \"user:catherine\", Relation = \"member\", Object = \"workspace:sandcastle\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Catherine is a Member in the Sandcastle workspace user=\"user:catherine\", relation=\"member\", object=\"workspace:sandcastle\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:catherine\",\"relation\":\"member\",\"object\":\"workspace:sandcastle\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:catherine member workspace:sandcastle write([ // Catherine is a Member in the Sandcastle workspace { \"user\":\"user:catherine\", \"relation\":\"member\", \"object\":\"workspace:sandcastle\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") And verify by asking OpenFGA Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:catherine', relation: 'member', object: 'workspace:sandcastle', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:catherine\", Relation: \"member\", Object: \"workspace:sandcastle\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:catherine\", Relation = \"member\", Object = \"workspace:sandcastle\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:catherine\", relation=\"member\", object=\"workspace:sandcastle\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:catherine member workspace:sandcastle # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:catherine\",\"relation\":\"member\",\"object\":\"workspace:sandcastle\"}}' # Response: {\"allowed\":true} check( user = \"user:catherine\", // check if the user `user:catherine` relation = \"member\", // has an `member` relation object = \"workspace:sandcastle\", // with the object `workspace:sandcastle` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Catherine, on the other hand, is not a legacy_admin of workspace:sandcastle. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:catherine', relation: 'legacy_admin', object: 'workspace:sandcastle', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:catherine\", Relation: \"legacy_admin\", Object: \"workspace:sandcastle\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:catherine\", Relation = \"legacy_admin\", Object = \"workspace:sandcastle\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:catherine\", relation=\"legacy_admin\", object=\"workspace:sandcastle\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:catherine legacy_admin workspace:sandcastle # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:catherine\",\"relation\":\"legacy_admin\",\"object\":\"workspace:sandcastle\"}}' # Response: {\"allowed\":false} check( user = \"user:catherine\", // check if the user `user:catherine` relation = \"legacy_admin\", // has an `legacy_admin` relation object = \"workspace:sandcastle\", // with the object `workspace:sandcastle` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false Repeat this process for the other relationships [ { // Bob is a Channels Admin in the Sandcastle workspace user: 'user:bob', relation: 'channels_admin', object: 'workspace:sandcastle', }, { // David is a guest in the Sandcastle workspace user: 'user:david', relation: 'guest', object: 'workspace:sandcastle', }, { // Emily is a Member in the Sandcastle workspace user: 'user:emily', relation: 'member', object: 'workspace:sandcastle', }, ] Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Bob is a Channels Admin in the Sandcastle workspace { user: 'user:bob', relation: 'channels_admin', object: 'workspace:sandcastle'}, // David is a guest in the Sandcastle workspace { user: 'user:david', relation: 'guest', object: 'workspace:sandcastle'}, // Emily is a Member in the Sandcastle workspace { user: 'user:emily', relation: 'member', object: 'workspace:sandcastle'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Bob is a Channels Admin in the Sandcastle workspace User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"channels_admin\"), Object: openfga.PtrString(\"workspace:sandcastle\"), }, { // David is a guest in the Sandcastle workspace User: openfga.PtrString(\"user:david\"), Relation: openfga.PtrString(\"guest\"), Object: openfga.PtrString(\"workspace:sandcastle\"), }, { // Emily is a Member in the Sandcastle workspace User: openfga.PtrString(\"user:emily\"), Relation: openfga.PtrString(\"member\"), Object: openfga.PtrString(\"workspace:sandcastle\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Bob is a Channels Admin in the Sandcastle workspace new() { User = \"user:bob\", Relation = \"channels_admin\", Object = \"workspace:sandcastle\" }, // David is a guest in the Sandcastle workspace new() { User = \"user:david\", Relation = \"guest\", Object = \"workspace:sandcastle\" }, // Emily is a Member in the Sandcastle workspace new() { User = \"user:emily\", Relation = \"member\", Object = \"workspace:sandcastle\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Bob is a Channels Admin in the Sandcastle workspace user=\"user:bob\", relation=\"channels_admin\", object=\"workspace:sandcastle\", ), ClientTuple( # David is a guest in the Sandcastle workspace user=\"user:david\", relation=\"guest\", object=\"workspace:sandcastle\", ), ClientTuple( # Emily is a Member in the Sandcastle workspace user=\"user:emily\", relation=\"member\", object=\"workspace:sandcastle\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:bob\",\"relation\":\"channels_admin\",\"object\":\"workspace:sandcastle\"},{\"user\":\"user:david\",\"relation\":\"guest\",\"object\":\"workspace:sandcastle\"},{\"user\":\"user:emily\",\"relation\":\"member\",\"object\":\"workspace:sandcastle\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob channels_admin workspace:sandcastle fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:david guest workspace:sandcastle fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily member workspace:sandcastle write([ // Bob is a Channels Admin in the Sandcastle workspace { \"user\":\"user:bob\", \"relation\":\"channels_admin\", \"object\":\"workspace:sandcastle\" }, // David is a guest in the Sandcastle workspace { \"user\":\"user:david\", \"relation\":\"guest\", \"object\":\"workspace:sandcastle\" }, // Emily is a Member in the Sandcastle workspace { \"user\":\"user:emily\", \"relation\":\"member\", \"object\":\"workspace:sandcastle\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Verification​ To verify, we can issue check request to verify it is working as expected. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:amy', relation: 'legacy_admin', object: 'workspace:sandcastle', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:amy\", Relation: \"legacy_admin\", Object: \"workspace:sandcastle\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:amy\", Relation = \"legacy_admin\", Object = \"workspace:sandcastle\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:amy\", relation=\"legacy_admin\", object=\"workspace:sandcastle\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy legacy_admin workspace:sandcastle # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:amy\",\"relation\":\"legacy_admin\",\"object\":\"workspace:sandcastle\"}}' # Response: {\"allowed\":true} check( user = \"user:amy\", // check if the user `user:amy` relation = \"legacy_admin\", // has an `legacy_admin` relation object = \"workspace:sandcastle\", // with the object `workspace:sandcastle` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Let's try to verify the followings: User Object Relation Query Relation? amy workspace:sandcastle legacy_admin is amy related to workspace:sandcastle as legacy_admin? Yes david workspace:sandcastle legacy_admin is david related to workspace:sandcastle as legacy_admin? No amy workspace:sandcastle guest is amy related to workspace:sandcastle as guest? No david workspace:sandcastle guest is david related to workspace:sandcastle as guest? Yes amy workspace:sandcastle member is amy related to workspace:sandcastle as member? No david workspace:sandcastle member is david related to workspace:sandcastle as member? No","s":"01. Individual Permissions","u":"/docs/modeling/advanced/slack","h":"#01-individual-permissions","p":829},{"i":846,"t":"Some of the queries that you ran earlier, while returning the correct response, do not match reality. One of which is: Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:amy', relation: 'member', object: 'workspace:sandcastle', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:amy\", Relation: \"member\", Object: \"workspace:sandcastle\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:amy\", Relation = \"member\", Object = \"workspace:sandcastle\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:amy\", relation=\"member\", object=\"workspace:sandcastle\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy member workspace:sandcastle # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:amy\",\"relation\":\"member\",\"object\":\"workspace:sandcastle\"}}' # Response: {\"allowed\":false} check( user = \"user:amy\", // check if the user `user:amy` relation = \"member\", // has an `member` relation object = \"workspace:sandcastle\", // with the object `workspace:sandcastle` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false As you saw before, running this query will return amy is not a member of workspace:sandcastle, which is correct based on the data you have given OpenFGA so far. But in reality, Amy, who is a legacy_admin already has an implied channels_admin and member relations. In fact anyone (other than a guest) is a member of the workspace. To change this behavior, we will update our system with a concentric relationship model. With the following updated authorization model, you are informing OpenFGA that any user who is related to a workspace as legacy_admin, is also related as a channels_admin and a member . DSL JSON model schema 1.1 type user type workspace relations define legacy_admin: [user] define channels_admin: [user] or legacy_admin define member: [user] or channels_admin or legacy_admin define guest: [user] { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relations\": { \"legacy_admin\": { \"this\": {} }, \"channels_admin\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"legacy_admin\" } } ] } }, \"member\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"channels_admin\" } }, { \"computedUserset\": { \"relation\": \"legacy_admin\" } } ] } }, \"guest\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"legacy_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"channels_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"guest\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } } ] } We can then verify amy is a member of workspace:sandcastle. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:amy', relation: 'member', object: 'workspace:sandcastle', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:amy\", Relation: \"member\", Object: \"workspace:sandcastle\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:amy\", Relation = \"member\", Object = \"workspace:sandcastle\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:amy\", relation=\"member\", object=\"workspace:sandcastle\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy member workspace:sandcastle # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:amy\",\"relation\":\"member\",\"object\":\"workspace:sandcastle\"}}' # Response: {\"allowed\":true} check( user = \"user:amy\", // check if the user `user:amy` relation = \"member\", // has an `member` relation object = \"workspace:sandcastle\", // with the object `workspace:sandcastle` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true We can check for other users and relationships. User Object Relation Query Relation? amy workspace:sandcastle legacy_admin is amy related to workspace:sandcastle as legacy_admin? Yes david workspace:sandcastle legacy_admin is david related to workspace:sandcastle as legacy_admin? No amy workspace:sandcastle guest is amy related to workspace:sandcastle as guest? No david workspace:sandcastle guest is david related to workspace:sandcastle as guest? Yes amy workspace:sandcastle member is amy related to workspace:sandcastle as member? Yes david workspace:sandcastle member is david related to workspace:sandcastle as member? No","s":"02. Updating The workspace Authorization Model With Implied Relations","u":"/docs/modeling/advanced/slack","h":"#02-updating-the-workspace-authorization-model-with-implied-relations","p":829},{"i":848,"t":"So far, you have modeled the users' relations to the workspace itself. In this task you will expand the model to include the relations concerning the channels. By the end of it, you will run some queries to check whether a user can view or write to a certain channel. Queries such as: is david related to channel:general as viewer? (expected answer: No relation, as David is a guest user with only a relation to #proj-marketing-campaign) is david related to channel:proj_marketing_campaign as viewer? (expected answer: There is a relation, as there is a relation between David and #proj-marketing-campaign as a writer) is bob related to channel:general as viewer? (expected answer: There is a relation, as Bob is a member of the Sandcastle workspace, and all members of the workspace have a viewer relation to #general) The requirements are: Amy, Bob, Catherine and Emily, are normal members of the Sandcastle workspace, they can view all public channels, in this case: #general and #proj-marketing-campaign David, a guest user, has only view and write access to the #proj-marketing-campaign channel Bob and Emily are the only ones with either view or write access to the #marketing-internal channel Amy and Emily are the only ones with write access to the #general channel The possible relations to channels are: Workspace includes the channel, consider the relation that of a parent workspace A user can be a viewer and/or writer on a channel The authorization model already has a section describing the workspace, what remains is describing the channel. That can be done by adding the following section to the configuration above: DSL JSON type channel relations define parent_workspace: [workspace] define writer: [user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest] define viewer: [user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest] { \"type\": \"channel\", \"relations\": { \"parent_workspace\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"viewer\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"parent_workspace\": { \"directly_related_user_types\": [ { \"type\": \"workspace\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relation\": \"legacy_admin\" }, { \"type\": \"workspace\", \"relation\": \"channels_admin\" }, { \"type\": \"workspace\", \"relation\": \"member\" }, { \"type\": \"workspace\", \"relation\": \"guest\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relation\": \"legacy_admin\" }, { \"type\": \"workspace\", \"relation\": \"channels_admin\" }, { \"type\": \"workspace\", \"relation\": \"member\" }, { \"type\": \"workspace\", \"relation\": \"guest\" } ] } } } } info The configuration snippet above describes a channel that can have the following relations: workspaces related to it as parent_workspace users related to it as writer users related to it as viewer Implied Relation​ There is an implied relation that anyone who can write to a channel can also read from it, so the authorization model can be modified to be: DSL JSON type channel relations define parent_workspace: [workspace] define writer: [user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest] define viewer: [user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest] or writer { \"type\": \"channel\", \"relations\": { \"parent_workspace\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } } }, \"metadata\": { \"relations\": { \"parent_workspace\": { \"directly_related_user_types\": [ { \"type\": \"workspace\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relation\": \"legacy_admin\" }, { \"type\": \"workspace\", \"relation\": \"channels_admin\" }, { \"type\": \"workspace\", \"relation\": \"member\" }, { \"type\": \"workspace\", \"relation\": \"guest\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relation\": \"legacy_admin\" }, { \"type\": \"workspace\", \"relation\": \"channels_admin\" }, { \"type\": \"workspace\", \"relation\": \"member\" }, { \"type\": \"workspace\", \"relation\": \"guest\" } ] } } } } info Note that the channel type definition has been updated to indicate that viewer is the union of: the set of users with a direct viewer relation to this object the set of users with writer relations to this object As a result, the authorization model is: DSL JSON model schema 1.1 type user type workspace relations define legacy_admin: [user] define channels_admin: [user] or legacy_admin define member: [user] or channels_admin or legacy_admin define guest: [user] type channel relations define parent_workspace: [workspace] define writer: [user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest] define viewer: [user, workspace#legacy_admin, workspace#channels_admin, workspace#member, workspace#guest] or writer { \"schema_version\": \"1.1\", \"type_definitions\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relations\": { \"legacy_admin\": { \"this\": {} }, \"channels_admin\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"legacy_admin\" } } ] } }, \"member\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"channels_admin\" } }, { \"computedUserset\": { \"relation\": \"legacy_admin\" } } ] } }, \"guest\": { \"this\": {} } }, \"metadata\": { \"relations\": { \"legacy_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"channels_admin\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"member\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] }, \"guest\": { \"directly_related_user_types\": [ { \"type\": \"user\" } ] } } } }, { \"type\": \"channel\", \"relations\": { \"parent_workspace\": { \"this\": {} }, \"writer\": { \"this\": {} }, \"viewer\": { \"union\": { \"child\": [ { \"this\": {} }, { \"computedUserset\": { \"relation\": \"writer\" } } ] } } }, \"metadata\": { \"relations\": { \"parent_workspace\": { \"directly_related_user_types\": [ { \"type\": \"workspace\" } ] }, \"writer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relation\": \"legacy_admin\" }, { \"type\": \"workspace\", \"relation\": \"channels_admin\" }, { \"type\": \"workspace\", \"relation\": \"member\" }, { \"type\": \"workspace\", \"relation\": \"guest\" } ] }, \"viewer\": { \"directly_related_user_types\": [ { \"type\": \"user\" }, { \"type\": \"workspace\", \"relation\": \"legacy_admin\" }, { \"type\": \"workspace\", \"relation\": \"channels_admin\" }, { \"type\": \"workspace\", \"relation\": \"member\" }, { \"type\": \"workspace\", \"relation\": \"guest\" } ] } } } } ] } Updating Relationship Tuples​ What remains is to add the relationship tuples to indicate the relation between the users, workspace and the channels. The Sandcastle workspace is a parent workspace of the #general, #marketing-internal and #proj-marketing-campaign channels. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'workspace:sandcastle', relation: 'parent_workspace', object: 'channel:general'}, { user: 'workspace:sandcastle', relation: 'parent_workspace', object: 'channel:marketing_internal'}, { user: 'workspace:sandcastle', relation: 'parent_workspace', object: 'channel:proj_marketing_campaign'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"workspace:sandcastle\"), Relation: openfga.PtrString(\"parent_workspace\"), Object: openfga.PtrString(\"channel:general\"), }, { User: openfga.PtrString(\"workspace:sandcastle\"), Relation: openfga.PtrString(\"parent_workspace\"), Object: openfga.PtrString(\"channel:marketing_internal\"), }, { User: openfga.PtrString(\"workspace:sandcastle\"), Relation: openfga.PtrString(\"parent_workspace\"), Object: openfga.PtrString(\"channel:proj_marketing_campaign\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"workspace:sandcastle\", Relation = \"parent_workspace\", Object = \"channel:general\" }, new() { User = \"workspace:sandcastle\", Relation = \"parent_workspace\", Object = \"channel:marketing_internal\" }, new() { User = \"workspace:sandcastle\", Relation = \"parent_workspace\", Object = \"channel:proj_marketing_campaign\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"workspace:sandcastle\", relation=\"parent_workspace\", object=\"channel:general\", ), ClientTuple( user=\"workspace:sandcastle\", relation=\"parent_workspace\", object=\"channel:marketing_internal\", ), ClientTuple( user=\"workspace:sandcastle\", relation=\"parent_workspace\", object=\"channel:proj_marketing_campaign\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"workspace:sandcastle\",\"relation\":\"parent_workspace\",\"object\":\"channel:general\"},{\"user\":\"workspace:sandcastle\",\"relation\":\"parent_workspace\",\"object\":\"channel:marketing_internal\"},{\"user\":\"workspace:sandcastle\",\"relation\":\"parent_workspace\",\"object\":\"channel:proj_marketing_campaign\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle parent_workspace channel:general fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle parent_workspace channel:marketing_internal fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle parent_workspace channel:proj_marketing_campaign write([ { \"user\":\"workspace:sandcastle\", \"relation\":\"parent_workspace\", \"object\":\"channel:general\" }, { \"user\":\"workspace:sandcastle\", \"relation\":\"parent_workspace\", \"object\":\"channel:marketing_internal\" }, { \"user\":\"workspace:sandcastle\", \"relation\":\"parent_workspace\", \"object\":\"channel:proj_marketing_campaign\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") #general Channel​ The #general channel is a public channel visible to all the members of the workspace. In OpenFGA, you represent this relation in the form of the following relationship tuple: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer` { user: 'workspace:sandcastle#member', relation: 'viewer', object: 'channel:general'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer` User: openfga.PtrString(\"workspace:sandcastle#member\"), Relation: openfga.PtrString(\"viewer\"), Object: openfga.PtrString(\"channel:general\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer` new() { User = \"workspace:sandcastle#member\", Relation = \"viewer\", Object = \"channel:general\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer` user=\"workspace:sandcastle#member\", relation=\"viewer\", object=\"channel:general\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"workspace:sandcastle#member\",\"relation\":\"viewer\",\"object\":\"channel:general\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle#member viewer channel:general write([ // The set of users related to `workspace:sandcastle` as member are also related to `channel:general` as `viewer` { \"user\":\"workspace:sandcastle#member\", \"relation\":\"viewer\", \"object\":\"channel:general\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") info This indicates The set of users related to workspace:sandcastle as member are also related to channel:general as viewer And to indicate that Amy and Emily can write to it: Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ // Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation { user: 'user:amy', relation: 'writer', object: 'channel:general'}, { user: 'user:emily', relation: 'writer', object: 'channel:general'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { // Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation User: openfga.PtrString(\"user:amy\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"channel:general\"), }, { User: openfga.PtrString(\"user:emily\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"channel:general\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { // Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation new() { User = \"user:amy\", Relation = \"writer\", Object = \"channel:general\" }, new() { User = \"user:emily\", Relation = \"writer\", Object = \"channel:general\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( # Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation user=\"user:amy\", relation=\"writer\", object=\"channel:general\", ), ClientTuple( user=\"user:emily\", relation=\"writer\", object=\"channel:general\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:amy\",\"relation\":\"writer\",\"object\":\"channel:general\"},{\"user\":\"user:emily\",\"relation\":\"writer\",\"object\":\"channel:general\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:amy writer channel:general fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily writer channel:general write([ // Due to the configuration update you added earlier, writer relation is enough to imply a viewer relation { \"user\":\"user:amy\", \"relation\":\"writer\", \"object\":\"channel:general\" }, { \"user\":\"user:emily\", \"relation\":\"writer\", \"object\":\"channel:general\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") #marketing-internal Channel​ The #marketing-internal is visible to only Bob and Emily. They can view and write in it. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:bob', relation: 'writer', object: 'channel:marketing_internal'}, { user: 'user:emily', relation: 'writer', object: 'channel:marketing_internal'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:bob\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"channel:marketing_internal\"), }, { User: openfga.PtrString(\"user:emily\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"channel:marketing_internal\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:bob\", Relation = \"writer\", Object = \"channel:marketing_internal\" }, new() { User = \"user:emily\", Relation = \"writer\", Object = \"channel:marketing_internal\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:bob\", relation=\"writer\", object=\"channel:marketing_internal\", ), ClientTuple( user=\"user:emily\", relation=\"writer\", object=\"channel:marketing_internal\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:bob\",\"relation\":\"writer\",\"object\":\"channel:marketing_internal\"},{\"user\":\"user:emily\",\"relation\":\"writer\",\"object\":\"channel:marketing_internal\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:bob writer channel:marketing_internal fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:emily writer channel:marketing_internal write([ { \"user\":\"user:bob\", \"relation\":\"writer\", \"object\":\"channel:marketing_internal\" }, { \"user\":\"user:emily\", \"relation\":\"writer\", \"object\":\"channel:marketing_internal\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") #proj-marketing-campaign Channel​ The #proj-marketing-campaign is public to all members of the Sandcastle workspace. They can view and write in it. Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'workspace:sandcastle#member', relation: 'writer', object: 'channel:proj_marketing_campaign'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"workspace:sandcastle#member\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"channel:proj_marketing_campaign\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"workspace:sandcastle#member\", Relation = \"writer\", Object = \"channel:proj_marketing_campaign\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"workspace:sandcastle#member\", relation=\"writer\", object=\"channel:proj_marketing_campaign\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"workspace:sandcastle#member\",\"relation\":\"writer\",\"object\":\"channel:proj_marketing_campaign\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw workspace:sandcastle#member writer channel:proj_marketing_campaign write([ { \"user\":\"workspace:sandcastle#member\", \"relation\":\"writer\", \"object\":\"channel:proj_marketing_campaign\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") David is a guest user who can also view and write to #proj-marketing-campaign Node.js Go .NET Python curl CLI Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); await fgaClient.write({ writes: [ { user: 'user:david', relation: 'writer', object: 'channel:proj_marketing_campaign'}] }, }, { authorization_model_id: \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" }); Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientWriteOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := fgaClient.ClientWriteRequest{ Writes: &[]ClientTupleKey{ { User: openfga.PtrString(\"user:david\"), Relation: openfga.PtrString(\"writer\"), Object: openfga.PtrString(\"channel:proj_marketing_campaign\"), }, } } data, err := fgaClient.Write(context.Background()).Body(requestBody).Options(options).Execute() if err != nil { // .. Handle error } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientListObjectsOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientWriteRequest() { Writes = new List() { new() { User = \"user:david\", Relation = \"writer\", Object = \"channel:proj_marketing_campaign\" } }, }; var response = await fgaClient.Write(body, options); Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = body = ClientWriteRequest( writes=[ ClientTuple( user=\"user:david\", relation=\"writer\", object=\"channel:proj_marketing_campaign\", ),, ), \", ) response = await fga_client.write(body, options) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/write \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"writes\": { \"tuple_keys\" : [{\"user\":\"user:david\",\"relation\":\"writer\",\"object\":\"channel:proj_marketing_campaign\"}] }, \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"}' Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga tuple write --store-id=${FGA_STORE_ID} --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:david writer channel:proj_marketing_campaign write([ { \"user\":\"user:david\", \"relation\":\"writer\", \"object\":\"channel:proj_marketing_campaign\" } ], authorization_model_id=\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\") Verification​ Now that you have added the necessary relationship tuples, you will check to make sure that your configuration is valid. First, we want to ensure david is not related to channel:general as viewer. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:david', relation: 'viewer', object: 'channel:general', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = false Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:david\", Relation: \"viewer\", Object: \"channel:general\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: false } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:david\", Relation = \"viewer\", Object = \"channel:general\", }; var response = await fgaClient.Check(body, options); // response.Allowed = false Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:david\", relation=\"viewer\", object=\"channel:general\", ) response = await fga_client.check(body, options) # response.allowed = false Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:david viewer channel:general # Response: {\"allowed\":false} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:david\",\"relation\":\"viewer\",\"object\":\"channel:general\"}}' # Response: {\"allowed\":false} check( user = \"user:david\", // check if the user `user:david` relation = \"viewer\", // has an `viewer` relation object = \"channel:general\", // with the object `channel:general` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: false David should be related to channel:proj_marketing_campaign as viewer. Node.js Go .NET Python CLI curl Pseudocode Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK const { OpenFgaClient } = require('@openfga/sdk'); // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options const fgaClient = new OpenFgaClient({ apiScheme: process.env.FGA_API_SCHEME, // Either \"http\" or \"https\", defaults to \"https\" apiHost: process.env.FGA_API_HOST, // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) storeId: process.env.FGA_STORE_ID, authorizationModelId: process.env.FGA_MODEL_ID, // Optional, can be overridden per request }); // Run a check const { allowed } = await fgaClient.check({ user: 'user:david', relation: 'viewer', object: 'channel:proj_marketing_campaign', }, { authorization_model_id: '1uHxCSuTP0VKPYSnkq1pbb1jeZw', }); // allowed = true Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import ( . \"github.com/openfga/go-sdk/client\" \"os\" ) func main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options fgaClient, err := NewSdkClient(&ClientConfiguration{ ApiScheme: os.Getenv(\"FGA_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost: os.Getenv(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId: os.Getenv(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId: openfga.PtrString(os.Getenv(\"FGA_MODEL_ID\")), // Optional, can be overridden per request }) if err != nil { // .. Handle error } } options := ClientCheckOptions{ AuthorizationModelId: openfga.PtrString(\"1uHxCSuTP0VKPYSnkq1pbb1jeZw\"), } body := ClientCheckRequest{ User: \"user:david\", Relation: \"viewer\", Object: \"channel:proj_marketing_campaign\", } data, err := fgaClient.Check(context.Background()).Body(body).Options(options).Execute() // data = { allowed: true } Initialize the SDK // ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. // import the SDK using OpenFga.Sdk.Client; using OpenFga.Sdk.Client.Model; using OpenFga.Sdk.Model; using Environment = System.Environment; namespace Example; class Example { public static async Task Main() { // Initialize the SDK with no auth - see \"How to setup SDK client\" for more options var configuration = new ClientConfiguration() { ApiScheme = Environment.GetEnvironmentVariable(\"FGA_API_SCHEME\"), // Either \"http\" or \"https\", defaults to \"https\" ApiHost = Environment.GetEnvironmentVariable(\"FGA_API_HOST\"), // required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) StoreId = Environment.GetEnvironmentVariable(\"FGA_STORE_ID\"), // optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods AuthorizationModelId = Environment.GetEnvironmentVariable(\"FGA_MODEL_ID\"), // Optional, can be overridden per request }; var fgaClient = new OpenFgaClient(configuration); } } var options = new ClientCheckOptions { AuthorizationModelId = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", }; var body = new ClientCheckRequest { User = \"user:david\", Relation = \"viewer\", Object = \"channel:proj_marketing_campaign\", }; var response = await fgaClient.Check(body, options); // response.Allowed = true Initialize the SDK # ApiTokenIssuer, ApiAudience, ClientId and ClientSecret are optional. import os import json import openfga_sdk from openfga_sdk.client import OpenFgaClient configuration = openfga_sdk.ClientConfiguration( api_scheme = os.environ.get('FGA_API_SCHEME'), # Either \"http\" or \"https\", defaults to \"https\" api_host = os.environ.get('FGA_API_HOST'), # required, define without the scheme (e.g. api.fga.example instead of https://api.fga.example) store_id = os.environ.get('FGA_STORE_ID') # optional, not needed for `CreateStore` and `ListStores`, required before calling for all other methods authorization_model_id = os.environ.get('FGA_MODEL_ID'), # Optional, can be overridden per request ) # Enter a context with an instance of the OpenFgaClient async with OpenFgaClient(configuration) as fga_client: api_response = await fga_client.read_authorization_models() await fga_client.close() options = { \"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" } body = ClientCheckRequest( user=\"user:david\", relation=\"viewer\", object=\"channel:proj_marketing_campaign\", ) response = await fga_client.check(body, options) # response.allowed = true Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) fga query check --store-id=$FGA_STORE_ID --model-id=1uHxCSuTP0VKPYSnkq1pbb1jeZw user:david viewer channel:proj_marketing_campaign # Response: {\"allowed\":true} Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) Set FGA_SERVER_URL according to the service you are using (e.g. https://api.fga.example) curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/check \\ -H \"Authorization: Bearer $FGA_API_TOKEN\" \\ # Not needed if service does not require authorization -H \"content-type: application/json\" \\ -d '{\"authorization_model_id\": \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\", \"tuple_key\":{\"user\":\"user:david\",\"relation\":\"viewer\",\"object\":\"channel:proj_marketing_campaign\"}}' # Response: {\"allowed\":true} check( user = \"user:david\", // check if the user `user:david` relation = \"viewer\", // has an `viewer` relation object = \"channel:proj_marketing_campaign\", // with the object `channel:proj_marketing_campaign` authorization_id = \"1uHxCSuTP0VKPYSnkq1pbb1jeZw\" ); Reply: true Repeat this for the following relations User Object Relation Query Relation? amy workspace:sandcastle legacy_admin is amy related to workspace:sandcastle as legacy_admin? Yes amy workspace:sandcastle member is amy related to workspace:sandcastle as member? Yes amy workspace:sandcastle channels_admin is amy related to workspace:sandcastle as channels_admin? Yes amy channel:general writer is amy related to channel:general as writer? Yes amy channel:general viewer is amy related to channel:general as viewer? Yes amy channel:marketing_internal writer is amy related to channel:marketing_internal as writer? No amy channel:marketing_internal viewer is amy related to channel:marketing_internal as viewer? No emily channel:marketing_internal writer is emily related to channel:marketing_internal as writer? Yes emily channel:marketing_internal viewer is emily related to channel:marketing_internal as viewer? Yes david workspace:sandcastle guest is david related to workspace:sandcastle as guest? Yes david workspace:sandcastle member is david related to workspace:sandcastle as member? No david channel:general viewer is david related to channel:general as viewer? No david channel:marketing_internal viewer is david related to channel:marketing_internal as viewer? No david channel:proj_marketing_campaign viewer is david related to channel:proj_marketing_campaign as viewer? Yes","s":"03. Updating The Authorization Model To Include Channels","u":"/docs/modeling/advanced/slack","h":"#03-updating-the-authorization-model-to-include-channels","p":829},{"i":850,"t":"Have a basic understanding of authorization and OpenFGA Concepts. Understand how to model authorization for a communication platform like Slack using OpenFGA. In this tutorial, you: were introduced to fine grain authentication and OpenFGA. learned how to build and test an OpenFGA authorization model for a communication platforms like Slack. Upcoming tutorials will dive deeper into OpenFGA, introducing concepts that will improve on the model you built today, and tackling different permission systems, with other relations and requirements that need to be met. If you are interested in learning more about Authorization and Role Management at Slack, check out the Okta Fine Grained Authorization (FGA) team's chat with the Slack engineering team.","s":"Summary","u":"/docs/modeling/advanced/slack","h":"#summary","p":829},{"i":852,"t":"Try adding more relationship tuples to represent other users and channels being added. Then run queries to make sure that the authorization model remains valid. Update the configuration to model more Slack permissions (workspace owners, Slack orgs), then add the relationship tuples necessary and run some queries to validate your configuration.","s":"Exercises For You","u":"/docs/modeling/advanced/slack","h":"#exercises-for-you","p":829}],"index":{"version":"2.3.9","fields":["t"],"fieldVectors":[["t/3",[0,1.139,1,1.452,2,4.465,3,0.902,4,6.119,5,3.467,6,2.741,7,0.768,8,5.128,9,1.794,10,3.088,11,3.234,12,4.579,13,2.187,14,1.013,15,4.859,16,1.974,17,0.576,18,6.035,19,2.13,20,3.687,21,4.311,22,5.459,23,4.644,24,7.382,25,1.668,26,5.128,27,2.394,28,3.081,29,1.924,30,2.838,31,3.481,32,3.37,33,4.859,34,4.311,35,4.644,36,5.488,37,1.668,38,4.859,39,4.465,40,6.035,41,1.217,42,7.794,43,7.382,44,1.867,45,2.92,46,6.035,47,6.035,48,6.035,49,5.488,50,1.783,51,2.845,52,2.505,53,3.951,54,3.605,55,4.839,56,6.035,57,2.677,58,5.488,59,3.764,60,4.859,61,5.128,62,5.128,63,5.488,64,1.632,65,6.035,66,6.035,67,3.135,68,6.035,69,6.035,70,6.035,71,6.035,72,4.644,73,3.467,74,5.97,75,2.708,76,4.465,77,2.454,78,5.488,79,1.743,80,1.719,81,1.204,82,6.035,83,2.768,84,4.465,85,2.882,86,8.118,87,6.035,88,6.035,89,6.035,90,2.248,91,5.128,92,1.743,93,1.769,94,1.058,95,1.083,96,3.856,97,9.811,98,6.035,99,6.535,100,9.811,101,9.811,102,1.637,103,10.953,104,1.81,105,0.872,106,4.765,107,10.091,108,4.013,109,3.001,110,2.752,111,8.336,112,9.811,113,6.035,114,6.035,115,5.459,116,4.684,117,1.527,118,4.765,119,3.335,120,2.865,121,8.118,122,6.035,123,2.774,124,2.104,125,6.168,126,6.897,127,6.006,128,4.579,129,6.035,130,2.429,131,4.859,132,8.118,133,2.617,134,6.035,135,1.411,136,6.035,137,6.035,138,4.058,139,3.404]],["t/5",[3,0.963,5,4.977,7,0.594,9,1.961,10,4.434,13,3.14,20,5.083,27,2.385,42,7.362,53,5.672,54,5.176,55,4.57,61,7.362,62,7.362,63,7.879,74,4.801,75,4.577,81,1.728,83,3.478,91,7.362,94,1.129,118,4.5,140,5.997,141,1.599,142,4.977,143,6.667,144,4.033,145,6.975,146,1.882,147,5.002,148,6.41,149,0.963,150,3.169,151,5.286,152,3.452,153,8.665,154,2.466,155,5.533,156,7.362,157,5.176,158,2.139,159,4.249]],["t/7",[0,1.046,1,1.43,3,1.223,17,0.703,27,2.313,41,1.234,74,6.098,80,1.442,127,6.089,139,4.642,146,1.788,147,4.036,149,1.179,159,4.036,160,4.342,161,8.231,162,10.607,163,5.139,164,3.178,165,6.652,166,6.616,167,9.893,168,7.847,169,6.089,170,6.089,171,6.333,172,8.231,173,8.231,174,3.982,175,6.993,176,3.066,177,6.626,178,6.993,179,5.256,180,5.697,181,4.728,182,6.993,183,4.44,184,6.993,185,6.626,186,2.493,187,1.898,188,4.275,189,2.075,190,8.231,191,7.132,192,6.333,193,8.231,194,5.021,195,2.93,196,2.179,197,4.212,198,5.021]],["t/9",[1,1.047,7,0.739,9,1.673,12,5.385,17,0.734,28,2.946,29,2.707,38,6.251,41,1.164,54,4.638,59,4.843,67,4.033,74,5.73,75,3.484,80,1.36,81,1.549,92,2.243,93,2.276,94,1.245,95,0.857,102,1.608,110,2.492,115,5.221,126,6.597,127,5.744,128,5.385,138,5.221,149,1.149,177,6.251,178,6.597,179,6.097,180,5.374,183,3.484,189,1.957,191,5.221,195,2.764,199,6.597,200,4.096,201,5.221,202,2.519,203,4.737,204,5.374,205,2.402,206,5.974,207,6.251,208,7.061,209,2.085,210,2.946,211,4.23,212,5.547,213,4.886,214,6.597,215,1.6,216,4.46,217,9.81,218,7.764,219,7.764,220,7.764,221,3.093,222,7.649,223,2.54,224,1.104,225,3.556,226,4.094,227,4.843,228,6.251,229,5.974,230,5.974,231,2.892,232,5.083,233,5.547,234,3.124,235,9.548,236,4.958,237,7.764,238,5.374,239,7.764,240,7.061,241,5.744,242,6.251,243,4.958]],["t/11",[147,4.57,149,1.036,195,3.318,212,6.658,244,2.208,245,6.101,246,7.918,247,5.813,248,7.918,249,4.769,250,5.686,251,9.32]],["t/13",[14,1.056,22,6.302,151,5.718,252,3.116,253,6.302,254,6.487,255,7.963,256,8.523]],["t/15",[3,0.984,14,0.876,19,3.124,22,5.952,34,6.323,45,4.282,57,3.926,160,4.669,180,6.127,186,2.603,202,2.872,209,2.377,241,6.548,253,5.952,254,6.127,257,7.52,258,7.52,259,6.127,260,6.323,261,2.36,262,7.52,263,8.851,264,6.323,265,6.81,266,8.851,267,7.126,268,6.81,269,6.323,270,2.411,271,8.049,272,4.401,273,8.851,274,8.049,275,2.246,276,2.246,277,1.217,278,8.851,279,4.464,280,7.52]],["t/17",[5,5.085,7,0.708,10,4.529,14,1.022,28,3.359,77,3.598,81,1.766,90,3.847,117,1.665,207,7.126,277,1.217,281,6.442,282,8.775,283,7.354,284,4.597,285,5.285,286,8.049,287,10.328,288,4.401,289,3.754,290,4.529,291,6.127,292,7.947,293,4.822,294,8.851,295,8.851,296,5.288,297,3.018,298,6.548,299,3.359]],["t/19",[6,3.894,7,0.764,9,1.954,10,4.387,14,0.848,29,2.402,30,2.652,32,3.559,75,4.549,81,1.71,83,3.68,95,0.946,105,0.96,146,1.863,154,2.44,176,3.193,209,2.302,241,6.343,253,5.766,254,5.935,261,2.286,269,6.125,288,4.263,300,5.443,301,7.017,302,2.468,303,8.574,304,4.079,305,7.797,306,10.137,307,3.193,308,8.574,309,6.597,310,4.595,311,4.263,312,4.148,313,6.343,314,2.851,315,5.766,316,7.285]],["t/21",[7,0.768,9,1.791,10,4.449,20,5.188,21,7.302,30,3.162,42,9.519,83,3.485,133,3.77,224,1.236,255,7.388,256,7.907,277,1.196,299,3.3,300,4.385,302,2.117,317,4.602,318,2.558,319,2.965,320,4.818,321,2.631,322,2.27,323,1.876,324,4.737,325,8.684,326,3.728,327,7.388,328,4.207,329,6.69,330,7.907]],["t/23",[7,0.725,20,4.193,22,6.208,27,2.158,28,4.016,29,2.188,31,3.958,32,3.832,81,1.842,95,1.019,105,0.989,203,5.632,331,9.232]],["t/25",[1,1.189,5,5.066,6,4.005,7,0.748,9,1.545,14,1.02,50,2.605,95,1.242,105,0.971,117,1.659,141,1.627,149,0.98,158,2.177,226,3.781,244,2.09,264,7.801,277,1.213,302,2.148,310,5.524,311,4.385,332,8.82,333,3.549,334,8.82,335,8.82,336,8.82,337,4.005,338,8.82,339,7.493,340,6.105,341,8.02,342,8.02]],["t/27",[3,1.176,16,3.02,19,3.258,80,1.617,139,5.207,149,1.176,195,3.287,244,2.188,252,3.07,343,6.456,344,3.548,345,3.958,346,6.595]],["t/29",[0,0.998,1,1.382,3,1.297,14,1.137,17,0.782,52,3.163,104,2.286,105,0.839,117,1.929,141,2.099,144,3.547,145,6.135,158,1.881,164,2.201,176,2.838,180,6.533,186,2.701,201,5.124,202,2.472,223,3.087,244,1.806,261,2.516,272,3.789,289,4.545,326,3.267,337,4.287,347,2.734,348,3.843,349,8.155,350,7.922,351,5.527,352,2.918,353,7.62,354,4.378,355,2.213,356,9.746,357,7.262,358,2.207,359,3.304,360,7.598,361,7.262,362,6.93,363,6.843,364,6.843,365,1.856,366,5.275]],["t/31",[3,1.044,14,0.929,17,0.667,141,1.733,151,5.729,348,4.736,355,2.026,367,6.314]],["t/33",[3,1.243,25,3.091,141,2.064,186,2.89,187,1.734,189,2.359,198,6.824,224,1.59,261,2.982,275,1.908,276,1.908,347,3.121,348,5.641,351,6.424,352,3.035,365,2.762,368,1.868,369,1.976,370,7.522,371,6.309,372,8.7,373,8.362,374,3.025,375,7.991,376,6.777,377,2.171]],["t/35",[3,0.471,7,0.732,14,0.928,17,0.709,25,1.17,29,1.788,37,2.085,41,1.457,50,1.25,64,2.041,80,0.742,81,1.259,92,1.223,93,2.212,94,1.407,95,0.987,102,1.709,104,1.893,110,1.105,124,1.956,130,1.703,135,1.764,141,1.164,146,1.639,149,1.135,158,1.045,181,3.625,186,2.692,187,0.976,189,1.591,195,1.507,196,2.214,202,2.714,209,1.695,215,1.555,224,1.189,231,2.35,270,2.909,275,1.074,276,1.074,277,1.038,318,2.5,321,1.089,322,2.183,323,1.805,347,2.012,352,2.147,355,1.805,358,1.955,365,1.031,366,2.93,368,1.052,369,1.659,374,1.145,377,2.416,378,1.922,379,1.85,380,1.535,381,3.675,382,3.753,383,4.015,384,2.031,385,1.967,386,1.907,387,2.857,388,2.871,389,2.547,390,2.547,391,2.547,392,2.547,393,2.727,394,2.663,395,2.07,396,2.398,397,1.213,398,2.212,399,1.788,400,2.163,401,2.147,402,1.213,403,2.138,404,2.147,405,1.213,406,2.018,407,2.363,408,2.398,409,2.864,410,2.163,411,1.223,412,2.041,413,1.232,414,2.398,415,2.363,416,1.757,417,3.427,418,2.351,419,4.233,420,2.452,421,1.205,422,1.213,423,1.809,424,1.187,425,1.744,426,2.537,427,1.213,428,1.26,429,1.205,430,1.213,431,2.163,432,2.163,433,1.213,434,2.026,435,2.573,436,4.233,437,7.546,438,2.116,439,6.311,440,4.233,441,4.233,442,1.983,443,4.233,444,4.233,445,1.223,446,1.223,447,1.223,448,1.223,449,1.213,450,0.97,451,1.045,452,1.223,453,2.131,454,1.213,455,1.223,456,1.223,457,1.223,458,1.223,459,1.223,460,1.823,461,4.233,462,4.233,463,4.233,464,4.233,465,1.213,466,1.223,467,1.26,468,1.232,469,1.223,470,1.223,471,1.223,472,1.232,473,1.232,474,1.232,475,1.26,476,1.223,477,1.223,478,1.232,479,1.232,480,4.233,481,3.849,482,4.233,483,4.233,484,4.233,485,4.233,486,2.434,487,2.286,488,1.456,489,6.311,490,1.097,491,4.233,492,1.77,493,1.187,494,1.129,495,1.196,496,1.17,497,2.771,498,4.233,499,3.257,500,4.233]],["t/37",[0,0.956,7,0.62,9,1.585,14,1.035,17,0.82,80,1.585,83,3.084,141,1.669,144,4.21,252,3.008,277,1.518,299,3.969,344,3.507,346,6.462,355,1.952,501,5.013,502,5.013,503,5.642,504,3.22]],["t/39",[0,0.835,3,1.206,14,0.955,57,4.281,74,4.378,111,6.713,146,1.716,147,3.875,148,5.845,149,1.158,179,5.045,186,1.991,189,1.991,195,2.813,207,6.361,208,7.185,211,6.064,244,2.287,245,5.173,277,1.433,300,3.985,312,3.823,316,6.713,326,3.388,337,3.588,399,1.872,505,7.901,506,4.82,507,9.651,508,7.901,509,9.651,510,7.901,511,7.901,512,7.901,513,7.901,514,7.901,515,7.901,516,7.901,517,7.901,518,6.318,519,7.901,520,5.845,521,5.845,522,6.713,523,5.172,524,7.901,525,7.901,526,7.901,527,7.901,528,7.901,529,7.901,530,7.901,531,7.901,532,7.901,533,3.772,534,9.651,535,6.49,536,9.476,537,7.901,538,7.901,539,7.901,540,7.901,541,7.901,542,7.901,543,7.901,544,6.361,545,5.644,546,7.901,547,7.901,548,7.901,549,7.901,550,5.845,551,3.724,552,7.901,553,7.901,554,6.713,555,6.713,556,6.713,557,7.901,558,7.901,559,7.901,560,6.079,561,7.901,562,4.043,563,7.901]],["t/41",[0,0.969,1,1.235,3,1.233,14,1.043,17,0.651,52,3.804,135,2.142,141,2.047,151,5.59,158,2.262,224,1.303,261,2.443,307,3.413,347,2.443,367,6.162,564,5.264]],["t/43",[3,0.878,37,2.183,41,1.347,64,2.136,94,0.755,102,1.703,109,5.301,124,2.047,135,1.846,141,2.089,146,1.952,149,1.073,186,1.46,187,1.336,189,1.46,196,2.378,209,2.988,215,1.851,224,1.123,261,2.572,270,2.904,275,1.471,276,1.471,318,2.249,321,1.491,322,2.345,355,1.704,358,1.846,365,1.411,368,1.44,369,2.076,376,3.461,393,2.668,394,2.778,395,2.465,396,2.894,397,1.661,400,2.264,401,2.557,402,1.661,403,2.296,404,2.557,405,1.661,406,2.04,407,2.725,408,2.264,409,2.264,410,2.576,412,2.136,414,2.264,415,2.231,417,4.08,418,2.536,421,2.247,422,1.661,423,2.264,424,1.625,425,2.183,426,2.518,427,1.661,429,1.649,430,1.661,431,2.264,432,2.264,433,1.661,434,2.121,435,2.378,438,2.215,442,1.523,445,1.673,446,1.673,447,1.673,448,1.673,449,1.661,450,1.328,452,1.673,453,2.538,454,1.661,455,1.673,456,1.673,457,1.673,458,1.673,459,1.673,460,2.281,465,1.661,466,1.673,469,1.673,470,1.673,471,1.673,476,1.673,477,1.673,481,5.269,490,1.502,492,1.625,494,1.545,495,1.637,496,1.601,544,8.735,551,2.731,565,4.286,566,5.269,567,5.269,568,5.794,569,4.286,570,5.794,571,5.794,572,5.794,573,4.665,574,4.665,575,5.794,576,5.794,577,5.794,578,8.984,579,4.665,580,5.794,581,7.897,582,3.268,583,5.794,584,4.286,585,5.794,586,6.076,587,5.794,588,5.794,589,5.794,590,4.923,591,4.286,592,5.794,593,5.794,594,4.286,595,5.794]],["t/45",[0,1.154,1,1.319,3,0.867,5,2.323,6,2.582,7,0.789,9,0.996,13,0.485,14,0.955,15,1.077,16,0.438,17,0.68,19,0.853,20,0.608,25,0.913,27,2.02,29,2.363,30,0.414,35,1.03,37,1.956,39,0.99,41,1.511,44,1.446,45,1.598,50,2.091,51,0.631,52,1.371,55,1.274,57,1.465,64,0.893,74,0.742,76,0.99,77,1.342,78,1.217,79,1.35,80,1.189,81,1.723,85,1.577,90,0.9,92,0.387,93,0.708,94,1.481,95,1.25,96,3.614,102,1.705,104,0.99,105,0.989,108,3.62,110,1.361,116,0.639,117,1.753,119,0.992,120,2.591,123,0.615,124,0.856,125,0.9,128,1.363,130,0.539,133,0.58,135,1.587,141,1.438,142,0.769,144,0.623,146,1.736,149,1.137,150,1.208,154,0.381,158,1.676,159,0.656,160,0.706,163,0.695,164,0.698,179,2.582,181,2.996,185,1.945,186,2.59,187,0.762,188,0.695,189,0.832,195,0.476,196,1.943,200,0.706,202,1.692,204,1.672,205,0.414,209,1.4,215,1.607,221,0.962,223,2.114,224,1.108,226,0.574,227,1.507,231,1.506,234,0.972,244,0.572,245,3.992,259,0.926,261,0.357,262,1.137,264,1.726,270,2.746,272,0.665,275,0.838,276,0.838,277,1.207,288,1.201,297,1.126,300,0.675,302,1.485,307,0.498,310,0.717,311,0.665,312,1.169,314,0.803,315,0.9,318,2.466,319,3.236,320,0.742,321,0.85,322,1.916,323,1.725,333,0.972,347,1.723,352,1.839,355,1.395,358,2.107,359,1.047,362,1.217,365,0.985,368,0.821,369,1.603,374,0.893,377,2.12,378,1.097,379,1.529,380,1.315,381,0.55,383,3.046,384,0.431,385,1.261,386,1.576,387,2.49,388,2.628,389,2.236,390,2.236,391,2.236,392,2.236,393,2.716,394,2.372,395,1.773,396,2.105,397,0.947,398,1.895,399,2.013,400,1.853,401,1.839,402,0.947,403,1.876,404,1.839,405,0.947,406,1.883,407,2.074,408,2.105,409,2.644,410,1.853,411,0.954,412,2.162,413,0.961,414,2.105,415,2.074,416,2.11,417,1.097,418,2.101,420,2.344,421,0.94,422,0.947,423,1.495,424,0.926,425,1.441,426,1.687,427,0.947,428,0.983,429,0.94,430,0.947,431,1.853,432,1.853,433,0.947,434,0.887,435,2.116,438,1.812,442,1.992,445,0.954,446,0.954,447,0.954,448,0.954,449,0.947,450,0.926,451,1.287,452,0.954,453,1.473,454,0.947,455,0.954,456,0.954,457,0.954,458,0.954,459,0.954,460,1.506,465,0.947,466,0.954,467,0.983,468,0.961,469,0.954,470,0.954,471,0.954,472,0.961,473,0.961,474,0.961,475,0.983,476,0.954,477,0.954,478,0.961,479,0.961,486,2.136,487,2.132,488,0.46,490,1.352,492,1.462,493,0.926,494,0.88,495,0.933,496,0.913,497,0.876,502,3.379,504,2.775,518,1.582,520,0.99,551,2.68,564,1.388,594,1.787,596,1.507,597,3.047,598,1.03,599,0.528,600,1.03,601,0.587,602,0.876,603,1.302,604,2.42,605,1.479,606,1.097,607,1.543,608,4.334,609,2.443,610,1.694,611,3.111,612,2.89,613,2.489,614,3.003,615,0.665,616,0.926,617,1.03,618,1.217,619,1.137,620,1.338,621,1.137,622,0.876,623,0.675,624,1.077,625,1.787,626,0.58,627,1.945,628,0.717,629,1.934,630,0.8,631,0.99,632,1.945,633,1.338,634,1.338,635,0.838,636,2.323,637,2.416,638,2.416,639,2.416,640,2.416,641,2.416,642,2.416,643,1.859,644,3.302,645,6.893,646,6.678,647,1.537,648,1.862,649,1.338,650,1.338,651,1.338,652,1.338,653,1.338,654,2.397,655,1.338,656,2.915,657,1.859,658,1.217,659,0.769,660,0.835,661,1.694,662,3.596,663,1.338,664,1.338,665,1.135,666,1.338,667,1.338,668,0.99,669,1.625,670,0.594,671,1.077,672,1.137,673,2.416,674,2.416,675,2.416,676,2.416,677,2.416,678,2.162,679,1.338,680,1.137,681,2.416,682,2.416,683,1.338,684,1.448,685,1.217,686,1.338,687,1.338,688,1.338,689,1.137,690,1.137,691,1.338,692,2.668,693,2.014,694,1.137,695,1.137,696,1.137,697,0.956,698,0.956,699,2.541,700,1.217,701,1.03,702,0.513,703,0.485,704,0.513,705,1.077,706,0.99,707,0.868,708,1.452,709,0.975,710,1.873,711,0.876,712,0.876,713,1.465,714,1.371,715,1.973,716,2.416,717,0.876,718,0.876,719,0.99,720,1.549,721,0.876,722,2.416,723,0.883,724,2.751,725,1.543,726,2.416,727,2.416,728,2.197,729,1.859,730,1.726,731,2.053,732,1.474,733,1.137,734,2.806,735,4.831,736,2.999,737,0.876,738,2.806,739,1.137,740,1.137,741,1.137,742,0.956,743,1.137,744,1.137,745,1.137,746,1.137,747,0.665,748,2.737,749,1.217,750,1.338,751,1.077,752,1.137,753,1.415,754,1.338,755,1.03,756,0.835,757,1.137,758,0.956,759,0.835]],["t/47",[41,1.41,94,1.226,105,0.836,221,3.748,234,3.786,450,2.156,601,4.125]],["t/49",[7,0.64,41,1.399,94,1.388,95,1.176,105,0.83,355,2.015,604,2.981,605,3.415,606,4.24]],["t/51",[14,0.922,17,0.756,30,2.883,41,1.397,94,1.215,149,1.036,277,1.282,302,2.269,604,2.975,609,6.894,610,3.377]],["t/53",[3,1.04,14,0.926,52,3.883,117,1.76,141,1.726,149,1.04,158,2.309,224,1.33,596,5.835,603,3.69]],["t/55",[0,1.124,1,1.254,7,0.637,14,0.92,17,0.661,41,1.394,44,2.877,52,3.861,105,0.827,302,2.265,627,7.488,635,3.226]],["t/57",[7,0.647,52,3.92,95,1.042,105,0.84,302,2.3]],["t/59",[0,0.974,7,0.631,14,0.912,17,0.654,41,1.584,50,2.722,94,1.449,95,1.017,105,0.819,221,3.671,302,2.244,314,3.064,604,3.375,605,3.37]],["t/61",[0,0.993,74,5.204,76,6.947,95,1.036,223,3.072,406,1.898,604,2.998,605,3.434]],["t/63",[7,0.727,85,4.433,94,1.453,95,1.231,551,5.004,604,2.964,665,3.193,672,7.888]],["t/65",[0,0.991,1,1.439,3,1.042,7,0.642,95,1.035,105,0.833,141,1.729,333,3.772]],["t/67",[0,0.997,7,0.646,50,2.785,95,1.04,105,0.838,690,8.009]],["t/69",[0,1.223,1,1.17,3,1.135,7,0.743,14,1.01,17,0.725,27,2.387,50,3.016,94,1.131,95,1.127,105,0.996,149,0.965,288,4.316,490,2.812,504,3.986,594,7.553,597,4.238,684,3.806,692,5.225,693,6.618,694,7.375,695,7.375,696,7.375,697,6.201,698,6.201]],["t/71",[0,0.985,3,1.036,6,4.232,7,0.638,90,3.471,105,0.829,117,2.002,215,1.921,231,3.471,358,2.179,724,4.916]],["t/73",[0,0.98,3,1.03,7,0.635,85,4.425,94,1.208,105,0.991,215,1.91,223,3.469,227,5.78,231,3.452,358,2.166,724,4.888]],["t/75",[1,1.436,77,3.796,110,2.437,117,1.757,307,3.478,358,2.49,359,4.048,597,3.876,748,5.467]],["t/77",[0,0.955,1,1.217,3,1.161,7,0.755,9,1.582,44,3.232,81,1.801,94,1.478,105,0.929,149,1.004,160,4.763,181,5.187,200,4.763,226,3.871,288,4.489,302,2.199,359,3.915,451,2.229,518,5.911,657,6.947,753,5.287]],["t/79",[0,0.967,3,1.232,9,1.602,17,0.65,19,3.715,30,2.829,80,1.602,105,0.936,117,1.721,149,1.017,244,2.167,252,3.041,277,1.524,302,2.227,344,3.067,504,3.256]],["t/81",[3,1.086,13,2.92,14,0.797,16,2.635,17,0.746,19,2.843,29,1.909,39,5.96,50,2.38,51,4.603,74,4.464,76,5.96,90,3,94,1.273,95,1.16,105,0.934,115,5.417,135,1.883,149,0.896,181,6.276,186,2.03,202,3.631,204,5.576,215,1.66,223,2.635,264,5.755,272,4.855,277,1.108,300,4.063,302,1.962,344,2.701,345,3.454,355,2.107,379,3.203,380,2.222,497,5.274,502,4.464,518,6.393,551,3.797,605,2.946,606,3.659,610,3.539,616,5.576,619,6.845,622,5.274,625,5.96,635,3.387,647,3.749,660,6.091,689,6.845,760,8.46,761,7.326,762,7.326,763,4.464,764,8.056,765,8.056,766,6.845,767,6.845,768,5.274,769,8.056,770,6.845,771,7.326,772,6.199,773,5.274,774,3.749]],["t/83",[0,0.489,3,0.514,7,0.773,13,1.676,14,0.667,17,0.564,27,1.081,29,2.069,32,4.253,41,1.612,84,3.422,92,1.336,93,1.975,94,1.518,95,1.306,96,3.698,102,1.716,105,1.013,119,1.9,140,3.202,187,1.067,211,2.52,215,0.953,252,1.538,272,2.3,355,0.998,379,1.356,380,0.941,382,4.778,383,5.003,384,1.489,385,1.442,386,2.402,387,3.182,504,1.647,604,2.151,611,7.452,612,5.881,613,3.388,626,2.006,630,2.763,647,2.153,648,2.609,660,2.885,670,2.052,671,3.724,702,3.71,703,3.51,704,4.166,775,3.111,776,7.47,777,10.357,778,5.276,779,5.109,780,4.626]],["t/85",[0,1.149,1,1.397,3,0.925,7,0.808,9,1.096,17,0.444,27,1.463,41,1.246,57,5.113,77,3.381,80,1.096,81,1.659,85,2.988,94,1.555,95,1.307,102,1.688,105,1.019,108,3.098,126,5.316,144,3.871,149,0.925,150,2.288,152,2.493,154,1.781,181,3.594,202,2.03,221,3.721,226,2.683,277,0.861,300,3.156,302,1.524,307,3.098,318,2.492,323,1.795,337,4.242,379,2.438,380,1.273,386,1.891,387,1.906,451,1.545,501,4.609,504,3.793,551,3.92,597,2.597,604,2.982,607,3.995,610,2.268,613,3.742,624,5.037,647,2.912,648,3.529,654,2.876,656,3.903,661,3.385,665,3.212,670,2.775,678,6.116,684,4.544,699,4.814,753,3.664,781,5.316,782,4.208,783,4.096,784,6.257,785,6.257,786,6.257,787,5.316,788,4.629,789,6.257,790,6.257,791,3.409,792,6.257,793,5.445,794,5.69,795,8.014,796,6.152,797,5.69,798,5.69]],["t/87",[0,1.157,1,0.868,7,0.77,17,0.673,27,1.505,29,2.664,30,1.991,41,1.509,80,1.128,81,1.284,94,1.479,95,1.293,96,3.902,102,1.699,105,0.93,108,3.528,118,3.343,133,3.674,144,2.996,146,2.058,149,0.716,150,2.354,152,3.376,277,0.885,310,3.45,311,3.2,314,2.818,317,2.644,319,4.008,323,1.389,324,4.617,379,1.887,380,1.309,386,1.945,387,2.581,501,4.696,504,3.372,551,3.034,597,2.672,604,3.214,605,2.354,606,2.923,607,4.11,610,2.333,635,2.232,645,8.219,646,7.914,647,2.996,648,3.63,661,4.073,665,2.213,670,2.855,684,2.822,702,3.246,703,2.333,704,3.246,732,5.17,759,4.015,799,5.853,800,10.739,801,5.182,802,3.927,803,4.762,804,5.469,805,4.953,806,6.437,807,3.507]],["t/89",[0,0.977,1,0.706,3,0.583,4,3.268,7,0.782,9,0.918,14,0.843,17,0.752,27,1.722,28,1.989,29,2.585,31,4.175,32,4.62,41,1.459,55,2.764,77,2.13,80,0.918,81,1.045,90,1.952,92,2.128,93,2.16,94,1.489,95,1.305,96,4.058,102,1.708,105,1.02,108,3.173,117,0.986,119,3.026,124,1.909,130,2.964,133,2.272,144,3.428,146,2.007,149,0.819,152,2.935,163,2.722,181,3.01,183,3.306,200,2.764,215,1.518,249,2.681,277,0.721,279,3.715,310,2.808,311,2.605,323,1.131,340,3.627,379,2.16,380,1.498,384,1.686,385,2.297,386,2.575,387,2.815,406,1.059,451,1.294,490,1.909,501,4.082,504,1.866,551,2.47,597,2.175,605,1.916,606,3.869,607,3.346,610,1.899,645,6.302,646,7.18,654,2.409,661,3.349,665,1.802,684,2.298,692,2.681,693,4.494,702,2.822,703,3.087,704,2.822,753,3.068,759,5.313,777,9.629,778,4.013,779,4.493,801,7.44,805,4.032,808,3.743,809,3.431,810,5.24,811,4.765,812,2.681,813,4.032,814,6.699,815,5.24,816,4.823,817,4.823,818,3.13,819,3.627,820,4.765,821,4.452,822,4.452,823,4.765,824,4.765,825,4.218,826,4.452,827,4.452,828,3.627,829,4.765,830,3.431]],["t/91",[0,1.051,7,0.8,14,0.704,17,0.766,27,1.663,29,2.142,30,2.201,41,1.066,74,3.943,80,1.246,81,1.419,94,1.363,95,1.282,96,4.014,102,1.696,105,0.96,108,3.894,117,1.339,118,3.695,120,2.511,133,3.085,144,3.311,149,0.791,152,3.602,181,4.087,226,3.05,231,2.65,277,0.979,317,2.922,319,3.821,323,1.535,379,2.651,380,1.839,385,2.218,386,2.15,387,2.167,501,3.943,504,3.219,597,3.753,604,2.271,607,4.543,610,2.578,645,8.161,646,7.636,647,3.311,648,4.013,654,4.568,661,3.601,665,3.595,670,3.156,701,5.474,702,4.006,703,2.578,704,2.726,759,4.438,807,3.876,831,6.47,832,5.263]],["t/93",[0,1.04,1,1.202,7,0.793,14,0.689,17,0.633,27,1.628,29,2.113,41,1.044,74,3.859,80,1.562,81,1.389,94,1.352,95,1.291,96,3.835,102,1.695,105,0.992,108,4.086,117,1.31,118,3.617,120,3.147,144,3.241,149,0.774,152,3.553,181,4.001,231,2.594,277,0.958,319,3.851,323,1.503,324,3.794,379,2.615,380,1.814,385,2.171,386,2.105,387,2.121,501,3.859,597,2.891,599,2.747,604,2.223,607,4.447,645,8.563,646,8.012,654,4.523,661,4.042,665,3.067,670,3.089,684,3.054,701,5.358,703,2.524,704,3.417,833,6.279,834,11.295,835,3.463]],["t/95",[0,1.096,1,1.201,7,0.793,14,0.688,17,0.698,20,4.046,27,1.626,29,2.111,41,1.042,80,1.561,94,1.351,95,1.291,96,4.021,102,1.692,105,0.991,108,4.084,117,1.308,118,3.612,120,3.144,133,3.863,149,0.773,152,3.55,181,3.995,223,2.275,231,2.59,277,0.956,324,3.789,379,2.612,380,1.812,385,2.168,386,2.102,387,2.118,399,1.648,502,3.854,504,3.172,597,3.699,599,2.743,604,2.22,607,4.44,615,4.43,623,3.507,645,8.562,646,8.011,648,6.432,654,4.766,661,3.974,665,3.064,670,3.085,704,2.664,836,5.991,837,5.351,838,6.324,839,5.909]],["t/97",[0,0.592,3,1.109,7,0.771,17,0.548,31,4.683,32,3.663,41,1.425,44,1.731,80,0.981,81,1.116,90,2.085,92,2.227,93,2.788,94,1.403,95,1.302,96,3.962,102,1.713,105,0.845,109,4.728,181,5.069,202,1.816,244,1.326,264,7.125,277,0.77,299,2.124,318,1.401,319,3.769,323,1.904,342,5.09,379,2.587,380,1.934,383,4.74,384,2.482,385,2.404,386,2.331,387,2.896,490,1.451,497,3.664,499,4.306,551,2.638,615,2.783,616,3.874,619,6.552,621,4.755,622,3.664,693,3.414,702,4.047,703,3.9,704,3.821,778,4.807,779,4.654,833,4.516,836,3.764,840,5.597,841,5.09,842,5.597,843,3.664,844,5.597,845,5.597,846,5.597,847,7.712,848,5.09,849,7.803,850,7.712,851,7.712,852,8.823,853,5.597,854,4.274,855,5.597,856,8.823,857,5.597]],["t/99",[3,1.222,7,0.614,9,1.823,14,0.887,17,0.803,19,3.672,30,2.773,80,1.57,105,0.797,117,1.686,149,0.996,244,2.605,252,2.981,272,4.457,277,1.556,302,2.183,344,3.488,355,1.934,503,5.591,504,3.191]],["t/101",[3,1.026,14,1.047,17,0.751,55,4.87,104,2.769,146,2.005,163,4.795,261,2.822,328,4.467,361,7.104,626,4.003,858,5.632,859,5.207,860,5.895]],["t/103",[14,0.895,17,0.806,116,4.319,141,1.669,149,1.006,202,2.935,223,3.421,231,3.896,403,2.312,545,6.462,599,3.568,724,4.772,861,8.226,862,7.282,863,9.046,864,8.226,865,4.012,866,6.692,867,7.686,868,7.686,869,6.462,870,6.692,871,7.686]],["t/105",[1,1.191,14,0.874,17,0.627,67,4.589,95,0.975,104,2.65,117,1.662,128,4.983,141,1.63,149,1.147,209,2.372,284,4.589,299,3.353,302,2.151,314,2.938,326,3.788,333,3.555,337,4.013,355,1.907,358,2.066,364,5.642,371,4.983,416,2.46,417,4.963,487,2.637,497,5.784,533,4.219,623,4.456,628,4.735,724,4.66,751,7.113,869,6.312,872,7.507,873,8.034,874,8.835,875,8.034,876,8.835]],["t/107",[3,0.986,4,5.531,14,1.116,17,0.801,75,3.979,77,3.605,117,1.945,138,5.963,141,1.636,149,0.986,176,3.303,183,3.979,212,6.335,261,2.364,268,6.823,284,4.606,337,4.027,358,2.073,417,4.695,758,7.386,809,5.805,866,6.56,869,7.386,877,8.063,878,8.063,879,6.823,880,8.867,881,8.867,882,6.335]],["t/109",[7,0.67,9,1.416,12,4.559,14,1.041,17,0.818,20,3.671,27,1.89,55,4.263,73,4.643,77,3.286,80,1.416,81,1.612,102,1.364,117,1.98,135,1.89,146,2.126,149,0.898,160,4.263,163,4.198,185,6.507,187,1.864,197,4.136,201,5.435,216,4.643,247,5.041,261,2.155,272,4.019,284,4.198,289,3.428,300,4.076,304,3.938,309,6.219,324,4.403,357,6.219,394,2.155,395,2.218,417,3.671,503,5.041,597,3.355,610,2.929,623,4.076,835,4.019,875,8.898,877,7.35,878,7.35,883,8.083,884,8.083,885,8.083,886,6.507,887,7.35,888,8.083,889,6.507,890,8.083,891,7.35,892,8.083,893,7.35,894,6.867,895,8.083,896,7.35,897,8.083,898,8.083,899,7.35,900,4.733,901,8.083,902,5.979,903,6.507,904,8.083,905,8.314,906,8.942,907,9.785,908,8.083,909,8.083,910,8.083,911,8.083]],["t/111",[3,1.155,17,0.78,156,7.602,158,2.566,202,3.372,244,2.603,272,5.168,277,1.555,299,3.395,326,3.836,337,4.72,344,3.485,355,2.243,363,6.636,364,6.636,365,2.179,366,6.193,503,5.581]],["t/113",[3,1.186,27,1.603,41,1.028,64,1.855,102,1.627,109,3.41,124,1.777,130,2.76,149,1.215,164,2.55,165,4.611,166,6.092,176,2.554,177,7.863,178,8.298,179,5.638,186,2.754,187,2.52,189,2.6,196,1.815,205,3.021,249,4.518,270,1.868,275,2.241,276,2.241,313,5.073,318,1.716,322,1.79,326,3.786,344,2.299,351,6.834,355,1.48,368,2.195,393,1.716,394,2.75,401,1.951,403,1.753,404,1.951,406,1.386,407,1.937,421,2.513,424,1.923,425,1.895,426,2.305,429,1.951,434,1.841,465,2.532,565,7.225,566,6.236,567,6.236,569,5.073,626,2.973,728,6.236,730,6.308,767,5.826,912,8.753,913,6.112,914,8.882,915,8.03,916,6.858,917,4.899,918,8.83,919,6.858,920,6.858,921,6.858,922,6.858,923,6.858,924,6.977,925,6.858,926,8.83,927,9.767,928,6.858,929,6.858,930,6.858,931,6.858,932,4.184,933,5.826,934,6.858,935,6.858,936,6.858,937,8.03,938,6.236,939,8.03,940,8.03,941,8.03,942,8.882,943,7.503,944,7.109,945,6.236,946,8.882,947,6.236,948,6.236,949,6.236,950,6.236,951,6.236,952,6.236,953,6.236,954,6.236,955,8.03,956,5.073,957,6.236,958,5.521,959,6.236]],["t/115",[351,5.551,937,8.621,938,8.621]],["t/117",[27,2.126,205,2.814,351,6.144,730,6.498,912,6.999,939,8.272,940,8.272,941,8.272,942,9.542,943,7.728,944,7.323,945,8.272,946,10.056,947,8.272,948,8.272,949,8.272,950,8.272,951,8.272,952,8.272,953,8.272,954,8.272]],["t/119",[164,2.723,165,6.339,166,6.68,955,9.739]],["t/121",[109,4.678,130,3.786,187,2.17,189,2.371,351,5.509,956,6.96,957,8.556]],["t/123",[730,6.734,767,8.009,943,8.009,944,7.589,958,7.589,959,8.572]],["t/125",[3,1.299,14,0.86,43,7.907,102,1.212,149,1.207,185,7,186,2.983,187,2.504,202,3.316,205,2.69,275,2.755,276,2.755,277,1.541,344,2.915,351,5.091,368,2.541,487,2.612,533,4.152,760,7,960,6.623]],["t/127",[0,0.987,5,5.364,6,4.24,7,0.64,90,3.478,105,0.83,117,1.757,252,3.105,289,3.96,358,2.183,961,5.364]],["t/129",[0,1.158,1,1.476,3,1.242,14,1.105,17,0.793,25,3.087,176,4.079,186,2.682,187,1.723,189,1.883,198,6.814,224,1.588,275,1.896,276,1.896,347,2.978,348,5.632,351,6.231,355,2.41,365,2.72,368,1.857,369,1.964,370,7.51,371,6.299,372,8.693,373,8.355,374,3.021,375,7.979,376,6.672,377,2.158]],["t/131",[0,0.989,6,4.249,7,0.641,105,0.832,117,1.76,195,3.33,378,4.249,381,3.843,661,3.39,962,7.198]],["t/133",[9,1.046,25,1.65,37,2.521,41,1.464,64,1.614,81,1.607,102,1.696,110,1.558,117,1.123,124,1.547,135,2.283,146,1.982,149,1.168,186,2.754,187,1.377,189,1.505,196,2.586,202,2.614,215,2.013,224,1.389,270,3.099,275,1.515,276,1.515,277,1.255,318,2.631,322,2.549,323,1.739,347,2.432,352,2.78,355,1.969,358,2.283,365,1.454,368,1.484,369,1.569,377,2.327,380,1.214,388,2.695,393,2.801,394,2.864,395,2.211,396,2.8,397,1.711,398,2.675,399,2.162,400,2.615,401,2.596,402,1.711,403,2.496,404,2.596,405,1.711,406,2.171,407,2.759,408,2.8,409,3.013,410,2.615,411,1.724,412,2.467,413,1.737,414,2.8,415,2.759,416,1.662,418,2.118,421,1.699,422,1.711,423,2.31,424,1.674,425,2.227,426,2.103,427,1.711,428,1.777,429,1.699,430,1.711,431,2.615,432,2.615,433,1.711,434,1.603,435,2.133,445,1.724,446,1.724,447,1.724,448,1.724,449,1.711,450,1.368,451,1.474,452,1.724,453,2.276,454,1.711,455,1.724,456,1.724,457,1.724,458,1.724,459,1.724,460,2.327,465,1.711,466,1.724,467,1.777,468,1.737,469,1.724,470,1.724,471,1.724,472,1.737,473,1.737,474,1.737,475,1.777,476,1.724,477,1.724,478,1.737,479,1.737,486,2.345,487,2.06,963,4.416,964,3.812]],["t/135",[0,1.052,6,3.241,7,0.717,14,0.896,17,0.507,27,2.447,79,2.061,94,0.93,95,1.098,102,1.7,105,0.931,108,4.024,117,1.872,120,3.812,123,3.28,141,1.317,146,1.967,158,2.236,164,2.061,187,1.646,189,1.798,209,1.916,224,1.015,231,2.658,275,1.811,276,1.811,321,1.836,368,1.774,369,2.381,374,1.93,381,4.438,393,2.704,395,1.958,406,1.442,412,2.45,416,2.77,418,2.616,420,3.069,426,1.862,435,2.634,438,2.79,442,2.751,487,1.824,490,1.849,492,2.54,493,2.001,494,1.902,495,2.016,496,1.972,597,3.76,707,2.563,708,3.253,709,2.108,710,3.574,711,2.586,712,2.586,713,3.282,714,2.962,717,2.586,718,2.586,719,2.14,720,3.47,721,2.586,758,5.097,962,8.312,965,4.263,966,6.062,967,7.135,968,7.135]],["t/137",[3,1.022,14,0.91,29,2.18,80,1.611,117,2.09,144,4.281,202,3.426,252,3.058,277,1.452,289,3.901,299,3.49,302,2.24,399,2.18,501,5.097,562,4.706]],["t/139",[0,0.983,5,5.344,7,0.637,85,4.441,94,1.212,105,0.945,223,3.043,227,5.802,252,3.093,289,3.945,358,2.175,961,5.344]],["t/141",[0,1.158,1,1.476,3,1.242,14,1.105,17,0.793,25,3.087,176,4.079,186,2.682,187,1.723,189,1.883,198,6.814,224,1.588,275,1.896,276,1.896,347,2.978,348,5.632,351,6.231,355,2.41,365,2.72,368,1.857,369,1.964,370,7.51,371,6.299,372,8.693,373,8.355,374,3.021,375,7.979,376,6.672,377,2.158]],["t/143",[0,0.989,7,0.641,29,2.217,94,1.219,105,0.832,195,3.33,223,3.06,378,4.249,381,3.843,661,3.39]],["t/145",[9,1.046,25,1.65,37,2.521,41,1.464,64,1.614,81,1.607,102,1.696,110,1.558,117,1.123,124,1.547,135,2.283,146,1.982,149,1.168,186,2.754,187,1.377,189,1.505,196,2.586,202,2.614,215,2.013,224,1.389,270,3.099,275,1.515,276,1.515,277,1.255,318,2.631,322,2.549,323,1.739,347,2.432,352,2.78,355,1.969,358,2.283,365,1.454,368,1.484,369,1.569,377,2.327,380,1.214,388,2.695,393,2.801,394,2.864,395,2.211,396,2.8,397,1.711,398,2.675,399,2.162,400,2.615,401,2.596,402,1.711,403,2.496,404,2.596,405,1.711,406,2.171,407,2.759,408,2.8,409,3.013,410,2.615,411,1.724,412,2.467,413,1.737,414,2.8,415,2.759,416,1.662,418,2.118,421,1.699,422,1.711,423,2.31,424,1.674,425,2.227,426,2.103,427,1.711,428,1.777,429,1.699,430,1.711,431,2.615,432,2.615,433,1.711,434,1.603,435,2.133,445,1.724,446,1.724,447,1.724,448,1.724,449,1.711,450,1.368,451,1.474,452,1.724,453,2.276,454,1.711,455,1.724,456,1.724,457,1.724,458,1.724,459,1.724,460,2.327,465,1.711,466,1.724,467,1.777,468,1.737,469,1.724,470,1.724,471,1.724,472,1.737,473,1.737,474,1.737,475,1.777,476,1.724,477,1.724,478,1.737,479,1.737,486,2.345,487,2.06,963,4.416,964,3.812]],["t/147",[0,0.949,7,0.713,14,0.888,17,0.499,29,2.649,79,2.031,94,1.402,95,1.149,102,1.698,105,0.978,108,4.097,116,3.358,141,1.298,146,1.95,158,2.216,187,1.622,189,1.773,209,1.889,223,2.301,224,1,231,2.62,275,1.785,276,1.785,321,1.81,368,1.748,369,2.359,374,1.902,381,4.592,393,2.692,395,1.93,406,1.421,412,2.427,416,2.752,418,2.598,420,3.053,426,1.836,435,2.617,438,2.772,442,2.827,487,1.798,488,2.419,490,1.823,492,2.517,493,1.972,494,1.875,495,1.987,496,1.944,709,2.078,714,2.92,719,2.11,733,5.976,734,8.398,735,9.498,736,5.897,737,3.253,738,8.398,739,5.976,740,5.976,741,5.976,742,5.025,743,5.976,744,5.976,745,5.976,746,5.976,747,3.497,965,4.202]],["t/149",[3,1.019,14,0.907,29,2.171,80,1.605,105,0.937,117,1.724,144,4.265,202,3.419,223,3.447,252,3.047,277,1.449,289,3.886,299,3.477,302,2.231,399,2.171,501,5.078,562,4.689]],["t/151",[3,1.004,59,5.632,80,1.582,164,2.608,204,6.25,216,5.187,223,2.953,270,2.46,281,5.632,323,2.379,324,4.919,337,4.101,355,1.949,363,5.766,364,5.766,365,2.199,380,1.837,670,4.005,969,6.25,970,7.269,971,8.039,972,6.947,973,9.03,974,9.03,975,5.911,976,8.211]],["t/153",[3,1.211,12,5.199,23,7.093,25,2.922,27,1.715,60,7.421,79,2.119,81,1.839,149,0.816,152,2.923,164,2.662,192,5.645,197,4.717,212,5.241,214,6.234,238,5.078,241,5.428,242,5.907,243,4.685,253,4.934,257,6.234,261,1.956,269,5.241,284,4.788,289,4.275,300,3.7,309,5.645,312,3.55,323,2.463,326,3.952,348,5.083,358,1.715,371,5.685,399,2.389,494,1.956,503,4.576,523,3.932,533,3.503,616,5.078,626,3.997,628,4.94,835,3.648,836,4.934,859,4.138,867,6.234,870,5.428,872,6.234,886,5.907,899,6.672,902,6.819,903,5.907,956,5.428,960,7.117,970,5.907,977,7.233,978,7.337,979,8.114,980,7.337,981,4.576,982,5.645,983,7.337,984,5.907,985,8.383,986,7.337,987,5.907,988,6.672,989,9.218,990,9.218,991,9.218,992,6.234,993,6.234,994,4.803,995,7.337,996,6.234,997,9.218,998,7.337,999,7.337,1000,7.337,1001,7.337,1002,7.337,1003,5.428,1004,7.337,1005,7.337,1006,5.645,1007,5.645,1008,7.337,1009,9.218,1010,7.337,1011,7.337,1012,7.337,1013,7.337,1014,4.934,1015,7.337,1016,6.672,1017,7.337]],["t/155",[0,0.897,1,0.869,3,0.716,4,4.02,5,3.703,12,5.902,13,2.336,20,2.927,21,4.604,27,2.355,45,3.118,59,7.013,75,3.806,79,3.359,80,1.486,105,0.573,117,1.783,124,2.198,128,4.783,130,2.594,135,1.507,144,3.947,150,2.357,152,2.568,160,3.4,198,3.932,209,1.731,223,2.108,243,6.682,245,4.22,261,1.718,267,6.828,268,7.293,269,7.475,277,1.439,283,5.703,299,3.218,300,3.25,302,1.569,305,7.712,323,2.426,348,4.277,358,2.216,371,6.177,399,1.527,494,1.718,523,3.454,590,5.476,610,2.336,628,3.454,630,6.418,654,2.963,705,7.631,724,4.474,753,4.966,802,3.932,860,4.115,894,7.206,902,6.274,933,5.476,970,6.828,976,9.959,977,6.932,987,7.631,988,8.62,992,7.206,1006,4.959,1018,3.572,1019,5.861,1020,7.712,1021,5.861,1022,8.481,1023,6.445,1024,5.861,1025,6.445,1026,5.476,1027,6.445,1028,6.445,1029,5.476,1030,5.476,1031,6.445,1032,4.604,1033,4.959,1034,8.481,1035,6.445,1036,8.481,1037,6.445,1038,7.206,1039,9.479,1040,6.445,1041,9.479,1042,9.479,1043,6.445,1044,6.445,1045,5.861,1046,6.445,1047,6.445,1048,5.861,1049,7.631,1050,4.604,1051,6.828,1052,3.572,1053,5.861,1054,5.861,1055,5.861,1056,8.651,1057,4.959,1058,8.481,1059,8.481,1060,6.445,1061,6.445,1062,8.481,1063,6.828,1064,9.159,1065,6.445,1066,7.712,1067,6.445]],["t/157",[3,0.986,17,0.63,80,1.554,92,2.986,93,3.031,95,1.141,117,1.668,158,2.552,164,2.561,202,3.354,244,2.593,252,2.948,277,1.551,326,3.802,337,4.97,363,6.602,364,6.602,365,2.665,366,6.138,981,7.032]],["t/159",[3,1.174,29,2.18,149,1.022,198,5.611,245,6.022,277,1.265,365,2.24,522,7.815,731,8.972,732,5.611,1068,10.56,1069,10.56,1070,9.198,1071,9.198,1072,8.364]],["t/161",[3,1.23,16,3.62,80,1.597,119,3.743,166,6.552,347,3.083,348,5.581,349,7.271,350,7.063,522,8.925]],["t/163",[3,1.042,45,4.534,180,6.487,252,3.116,359,4.064,360,7.545,961,5.384,1073,7.545,1074,8.523]],["t/165",[0,1.072,1,1.367,3,1.24,14,1.003,17,0.72,25,2.802,117,1.907,176,3.776,186,2.555,187,1.978,198,6.184,224,1.441,225,3.776,289,4.299,347,2.703,348,5.112,351,5.936,355,2.188,365,2.468,368,2.131,370,6.816,371,5.717,372,8.251,373,7.968,374,2.742,375,7.242,376,6.056]],["t/167",[6,4.005,7,0.748,9,1.545,20,4.005,29,2.588,37,2.437,130,3.549,139,4.974,149,0.98,152,3.514,195,3.669,231,3.285,281,6.428,323,1.903,360,7.1,378,4.681,381,3.623,417,4.005,487,2.634,564,5.066,610,3.196,643,6.786,960,5.381,964,5.631,994,5.774,1075,8.02,1076,7.1,1077,4.974,1078,8.82,1079,8.82,1080,8.82,1081,7.1,1082,7.1,1083,6.301]],["t/169",[26,6.098,27,1.678,80,1.593,81,1.813,102,1.677,110,2.373,120,2.533,124,1.86,139,5.627,149,1.166,159,3.519,164,2.073,180,4.968,187,2.419,194,4.378,205,2.22,224,1.293,231,3.386,274,6.526,281,4.476,283,4.826,297,2.447,299,3.45,343,4.378,344,3.048,347,2.424,348,3.619,351,6.142,358,1.678,360,8.901,368,1.784,394,1.913,395,2.494,406,1.45,418,1.886,424,2.549,425,2.512,426,1.873,453,2.568,487,2.323,582,4.048,643,8.64,775,6.113,865,3.183,912,8.743,914,8.267,915,8.267,917,5.127,964,4.583,1073,9.409,1074,8.267,1075,8.267,1081,8.032,1082,7.318,1084,7.318,1085,8.912,1086,6.098,1087,7.177,1088,6.098,1089,6.098,1090,7.177,1091,6.098,1092,6.098,1093,6.098,1094,6.098,1095,6.098,1096,7.177,1097,7.177,1098,6.098,1099,6.526,1100,7.724,1101,6.098,1102,6.098,1103,6.098,1104,4.968,1105,6.098,1106,6.098,1107,6.098,1108,6.098,1109,6.098,1110,7.177]],["t/171",[3,0.689,7,0.566,9,1.447,27,1.448,102,1.703,109,3.08,120,2.186,124,2.141,135,1.448,139,3.494,146,1.346,149,0.689,164,2.386,176,2.307,183,3.707,187,1.429,205,1.916,210,2.351,215,1.277,224,0.881,231,3.077,249,3.17,281,5.153,285,4.756,286,5.633,291,4.288,297,2.817,299,3.762,307,2.307,313,4.582,337,3.752,344,2.77,347,1.652,348,3.124,358,1.931,368,1.54,394,1.652,395,2.834,417,2.813,418,2.171,424,2.317,425,2.283,426,2.773,434,1.663,435,2.187,451,2.039,453,2.801,502,3.433,544,4.987,582,4.659,626,2.686,643,8.477,659,3.558,759,3.864,843,6.491,912,6.356,964,3.955,1026,7.019,1073,7.982,1081,7.482,1082,4.987,1085,5.263,1086,5.263,1088,7.019,1089,5.263,1091,5.263,1092,5.263,1093,7.019,1094,5.263,1095,5.263,1098,7.019,1100,5.263,1101,5.263,1102,5.263,1103,5.263,1104,4.288,1105,5.263,1106,5.263,1107,5.263,1108,5.263,1109,5.263,1111,3.864,1112,6.194,1113,5.633,1114,7.512,1115,5.633,1116,8.424,1117,7.512,1118,6.194,1119,5.263,1120,6.876,1121,8.261,1122,6.194,1123,8.261,1124,6.194,1125,4.766,1126,6.194,1127,7.512,1128,6.194,1129,6.194,1130,5.633,1131,7.512,1132,7.512,1133,5.633,1134,5.633,1135,5.633,1136,5.633,1137,5.633,1138,4.055,1139,5.633,1140,5.633,1141,5.633,1142,5.633,1143,5.633,1144,5.633,1145,5.633,1146,5.633,1147,5.633,1148,5.633,1149,5.633,1150,5.633,1151,7.512,1152,5.408,1153,5.633,1154,7.512,1155,5.633,1156,5.633,1157,5.633,1158,5.633,1159,5.633,1160,5.633,1161,5.633,1162,5.263,1163,5.633,1164,5.633,1165,5.633,1166,5.633,1167,5.633,1168,5.633,1169,5.633,1170,5.633,1171,5.633,1172,5.633]],["t/173",[0,0.705,3,0.876,6,2.07,7,0.713,9,1.168,14,0.858,27,1.558,29,2.358,30,1.41,37,2.177,41,0.683,51,2.148,85,3.182,94,0.594,95,0.87,102,1.705,105,0.771,109,4.948,110,1.19,117,1.872,120,1.608,124,2.247,135,1.065,146,1.712,150,3.523,158,1.125,164,1.316,176,1.697,186,1.149,187,1.537,196,1.206,202,2.812,205,1.41,210,1.729,215,1.901,224,0.948,231,3.706,249,2.332,261,2.101,270,2.779,281,4.157,285,3.41,291,3.154,297,2.686,299,3.29,318,1.141,321,1.715,322,1.19,323,0.983,328,3.224,337,3.027,344,2.235,352,1.897,355,0.983,358,2.027,366,3.154,368,1.133,376,2.723,381,2.738,382,2.796,383,3.536,393,2.17,394,1.777,395,2.941,396,2.259,397,1.307,399,1.579,400,1.911,401,1.897,402,1.307,403,2.216,404,1.897,405,1.307,406,1.347,407,1.287,408,1.307,409,1.307,410,1.911,411,1.316,412,1.233,414,1.307,415,1.287,417,2.07,418,1.752,421,1.897,422,1.307,423,1.307,424,2.431,425,1.842,426,2.798,427,1.307,429,1.297,430,1.307,431,1.307,432,1.307,433,1.307,434,2.116,435,1.764,438,1.278,451,1.125,453,2.605,544,3.669,565,3.371,569,3.371,582,4.444,626,1.976,643,6.062,647,2.121,659,2.618,707,1.637,710,1.637,759,2.843,772,5.128,775,4.481,843,5.675,865,2.021,870,3.371,879,6.062,912,3.507,1073,6.979,1081,5.365,1082,3.669,1085,5.663,1086,3.872,1088,6.694,1089,3.872,1091,3.872,1092,3.872,1093,6.694,1094,3.872,1095,3.872,1098,7.365,1100,3.872,1101,3.872,1102,3.872,1103,3.872,1104,3.154,1105,3.872,1106,3.872,1107,3.872,1108,3.872,1109,6.694,1111,2.843,1113,6.06,1114,7.165,1115,6.06,1116,8.186,1117,7.165,1120,4.93,1127,4.144,1130,6.06,1131,4.144,1132,4.144,1133,4.144,1134,4.144,1135,4.144,1136,4.144,1137,6.06,1138,2.984,1139,4.144,1141,4.144,1142,4.144,1143,4.144,1144,4.144,1145,4.144,1146,4.144,1147,4.144,1148,4.144,1149,4.144,1150,4.144,1151,6.06,1152,4.363,1153,4.144,1154,6.06,1155,4.144,1156,4.144,1157,4.144,1158,4.144,1159,4.144,1160,4.144,1161,4.144,1162,3.872,1163,4.144,1164,4.144,1165,4.144,1166,4.144,1167,6.06,1168,6.06,1169,6.06,1170,6.06,1171,4.144,1172,6.06,1173,7.879,1174,8.669,1175,7.879,1176,4.557,1177,4.557,1178,4.557,1179,8.669,1180,6.665,1181,4.557,1182,4.557,1183,4.557,1184,4.557,1185,4.557,1186,4.557,1187,4.557,1188,4.557,1189,4.557,1190,4.557,1191,4.557,1192,4.557,1193,4.557,1194,4.557,1195,4.557,1196,4.557,1197,4.557,1198,8.669,1199,4.557,1200,4.557,1201,6.665,1202,4.557,1203,6.665,1204,6.665,1205,4.557,1206,4.557,1207,4.557,1208,4.557,1209,4.557,1210,4.557,1211,4.557]],["t/175",[3,1.224,14,1.032,17,0.782,80,1.576,81,1.794,144,4.187,180,6.227,186,2.268,252,2.991,253,6.05,254,6.227,277,1.514,302,2.539,501,4.985,582,5.074,830,6.826,832,7.713,1212,5.611,1213,7.644,1214,7.011]],["t/177",[3,1.228,14,1.093,17,0.644,41,1.358,44,2.803,95,1,104,3.14,149,1.164,158,2.585,180,6.273,195,3.226,244,2.148,252,3.482,302,2.55,345,3.886,356,8.241,623,4.57,812,4.637]],["t/179",[0,1.22,1,1.515,3,0.909,7,0.675,9,1.924,29,1.937,30,2.529,31,3.506,32,3.394,50,2.415,51,3.854,67,4.247,79,2.362,95,0.902,104,3.463,105,0.976,117,1.538,125,5.498,128,4.611,149,0.909,154,3.125,155,5.221,157,4.884,201,5.498,202,2.653,285,4.184,299,3.103,318,2.047,326,4.993,349,7.991,350,7.763,358,1.911,613,3.146,630,4.884,680,6.947,703,2.963,835,4.065,932,6.011,1215,8.176]],["t/181",[3,1.013,11,4.884,80,1.597,141,1.681,149,1.168,151,5.559,186,2.297,195,3.244,261,2.43,281,5.684,284,4.733,343,6.408,352,2.989,367,6.128,407,2.574,615,4.531,647,4.889,775,6.128,865,4.042,1083,6.51]],["t/183",[3,0.902,17,0.429,37,2.711,41,1.47,64,1.632,102,1.698,124,1.564,135,2.294,141,1.498,146,1.993,149,1.172,183,2.708,186,1.521,187,1.392,189,1.521,196,2.597,215,2.173,223,1.974,224,1.395,261,1.609,270,3.104,275,1.532,276,1.532,318,2.456,322,2.561,337,2.741,347,1.609,355,1.752,358,2.465,365,1.47,368,1.5,393,2.886,394,2.73,395,2.227,396,2.813,397,1.73,400,2.327,401,2.611,402,1.73,403,2.617,404,2.611,405,1.73,406,2.242,407,2.772,408,2.813,409,2.813,410,2.63,411,1.743,412,2.481,413,1.756,414,2.935,415,2.892,418,2.134,421,2.31,422,1.73,423,2.327,424,1.692,425,2.244,426,2.119,427,1.73,429,1.717,430,1.73,431,2.813,432,2.813,433,1.73,434,1.621,435,2.149,445,1.743,446,1.743,447,1.743,448,1.743,449,1.73,450,1.383,452,1.743,453,2.293,454,1.73,455,1.743,456,1.743,457,1.743,458,1.743,459,1.743,460,2.345,465,1.73,466,1.743,468,1.756,469,1.743,470,1.743,471,1.743,472,1.756,473,1.756,474,1.756,476,1.743,477,1.743,478,1.756,479,1.756,545,4.311,565,4.465,569,4.465,573,4.859,574,4.859,579,4.859,584,4.465,591,6.786,616,4.177,628,3.234,725,3.854,1216,3.682,1217,5.128,1218,5.128,1219,5.128,1220,5.128,1221,5.128,1222,4.644]],["t/185",[3,1.043,14,0.537,17,0.385,37,2.895,41,1.406,64,1.467,102,1.7,124,1.406,135,2.193,141,1.392,146,2.142,149,1.164,183,2.434,186,1.367,187,1.741,189,1.367,195,1.931,196,2.484,215,2.104,216,3.116,221,2.161,223,1.774,224,1.402,245,3.551,261,1.446,270,3.05,275,1.377,276,1.377,281,3.383,312,2.624,318,2.348,322,2.449,323,1.629,337,3.427,347,1.446,348,3.806,352,1.544,355,1.629,358,2.449,365,1.838,368,1.348,374,1.467,376,3.241,393,2.842,394,2.722,395,2.071,396,2.69,397,1.555,399,1.285,400,2.164,401,2.47,402,1.555,403,2.52,404,2.47,405,1.555,406,2.192,407,2.65,408,2.69,409,2.69,410,2.488,411,1.567,412,2.347,413,1.578,414,2.827,415,2.786,418,1.984,421,2.47,422,1.555,423,2.164,424,1.521,425,2.086,426,1.97,427,1.555,429,1.544,430,1.555,431,2.69,432,2.69,433,1.555,434,1.457,435,1.998,445,1.567,446,1.567,447,1.567,448,1.567,449,1.555,450,1.243,452,1.567,453,2.132,454,1.555,455,1.567,456,1.567,457,1.567,458,1.567,459,1.567,460,2.18,465,1.555,466,1.567,468,1.578,469,1.567,470,1.567,471,1.567,472,1.578,473,1.578,474,1.578,476,1.567,477,1.567,478,1.578,479,1.578,493,1.521,545,3.875,562,2.776,565,4.013,569,4.013,573,4.367,574,4.367,579,4.367,584,4.013,591,6.941,616,3.755,647,3.512,725,3.464,843,4.941,869,3.875,964,3.464,971,4.174,1033,6.677,1119,4.609,1152,3.551,1217,4.609,1218,4.609,1219,4.609,1220,4.609,1221,4.609,1222,4.174,1223,5.425,1224,3.755,1225,5.425,1226,6.863,1227,9.712,1228,7.547,1229,5.425,1230,4.933,1231,4.933,1232,5.425,1233,4.933,1234,8.679,1235,5.425,1236,4.933,1237,4.933,1238,5.425,1239,4.933,1240,4.933,1241,5.425,1242,5.425,1243,5.425]],["t/187",[3,1.088,17,0.378,37,2.879,41,1.394,64,2.013,80,0.932,102,1.7,124,1.379,130,2.141,135,2.175,139,3,141,1.374,146,2.127,149,1.088,159,2.608,183,2.387,186,1.341,187,1.227,189,1.341,196,2.463,201,3.577,215,2.091,223,1.74,224,1.323,261,1.418,270,3.04,275,1.35,276,1.35,318,2.328,322,2.428,348,2.682,352,2.444,355,1.606,358,2.372,365,1.295,368,1.322,389,2.267,390,2.267,391,2.267,392,2.267,393,2.834,394,2.705,395,2.042,396,2.667,397,1.525,400,2.134,401,2.444,402,1.525,403,2.502,404,2.444,405,1.525,406,2.182,407,2.628,408,2.667,409,2.667,410,2.462,411,1.536,412,2.323,413,1.548,414,2.807,415,2.766,418,1.957,421,2.444,422,1.525,423,2.134,424,1.492,425,2.057,426,1.943,427,1.525,429,1.514,430,1.525,431,2.667,432,2.667,433,1.525,434,1.428,435,1.971,445,1.536,446,1.536,447,1.536,448,1.536,449,1.525,450,1.219,452,1.536,453,2.103,454,1.525,455,1.536,456,1.536,457,1.536,458,1.536,459,1.536,460,2.15,465,1.525,466,1.536,468,1.548,469,1.536,470,1.536,471,1.536,472,1.548,473,1.548,474,1.548,476,1.536,477,1.536,478,1.548,479,1.548,523,2.851,545,3.8,565,3.935,569,3.935,573,4.282,574,4.282,579,4.282,584,3.935,591,7.706,616,3.682,725,3.396,766,4.519,964,3.396,1033,6.608,1072,4.837,1217,4.519,1218,4.519,1219,4.519,1220,4.519,1221,4.519,1222,4.093,1226,6.769,1227,10.056,1230,4.837,1231,4.837,1233,4.837,1237,4.837,1239,4.837,1240,4.837,1244,4.837,1245,5.319,1246,5.319,1247,7.444,1248,5.319,1249,5.319,1250,5.319,1251,5.319,1252,5.319,1253,5.319,1254,5.319,1255,5.319,1256,5.319,1257,5.319,1258,5.319,1259,5.319,1260,5.319,1261,5.319,1262,5.319,1263,5.319,1264,5.319,1265,5.319,1266,5.319,1267,5.319,1268,5.319,1269,5.319,1270,5.319,1271,5.319,1272,5.319,1273,5.319,1274,5.319,1275,5.319,1276,5.319,1277,5.319,1278,5.319]],["t/189",[0,0.908,1,1.158,7,0.765,9,1.995,13,3.113,16,2.809,29,2.405,57,3.81,77,3.492,80,1.505,81,1.713,83,3.683,85,4.101,90,3.199,95,1.12,96,3.489,105,0.96,149,0.955,150,3.141,154,3.074,194,5.24,195,3.058,228,6.915,244,2.035,261,2.29,307,3.199,312,4.155,314,2.856,323,1.853,339,7.298,359,3.724,603,3.388,613,2.742,623,4.331,684,3.766,1279,7.811,1280,5.945,1281,7.811,1282,7.811,1283,6.915,1284,5.945]],["t/191",[0,1.103,1,1.214,3,1.102,7,0.79,9,1.239,14,0.981,16,2.314,17,0.765,19,3.179,29,2.349,41,1.615,44,2.188,50,2.09,51,3.334,52,3.739,80,1.578,83,2.412,92,2.043,93,2.641,94,1.527,95,1.288,102,1.697,105,0.979,119,2.906,141,1.305,154,2.969,174,3.422,188,3.674,205,2.188,221,2.818,223,2.314,224,1.281,225,3.691,234,2.847,244,1.676,277,0.973,302,2.413,314,2.352,315,7.016,333,2.847,345,3.033,378,3.213,379,2.074,380,1.439,381,4.286,384,2.277,385,2.205,386,2.722,387,2.743,450,1.621,599,2.79,601,3.102,604,2.876,605,2.587,635,2.453,774,3.292,1285,3.731,1286,3.422,1287,7.458,1288,7.074]],["t/193",[7,0.638,9,1.633,83,3.178,102,1.299,105,0.829,154,3.028,205,2.883,224,1.325,225,3.471,244,2.208,277,1.282]],["t/195",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,450,1.996,601,3.819,604,3.267,605,3.185,635,3.021]],["t/198",[0,0.953,1,1.215,7,0.617,29,2.136,77,3.664,94,1.36,95,0.995,102,1.607,105,0.928,150,3.296,195,3.209,205,2.788,224,1.281,299,3.42,315,7.018,381,4.287,736,5.812,1287,7.224,1289,8.196]],["t/200",[1,0.93,7,0.555,14,0.683,17,0.34,25,1.322,37,2.238,41,1.329,64,1.867,81,1.377,94,0.623,95,0.894,102,1.705,104,3.101,105,0.72,108,3.016,110,1.248,124,1.789,135,1.893,141,0.882,146,2.194,149,1.149,158,1.181,186,2.758,187,1.103,189,1.205,196,2.347,209,1.284,215,1.669,224,1.261,270,2.981,275,1.214,276,1.214,277,1.114,318,2.588,321,1.231,322,2.314,323,1.914,347,2.159,352,2.305,355,1.49,358,2.073,365,1.165,368,1.189,369,1.814,374,1.294,377,2.561,380,0.973,388,2.983,389,2.701,390,2.701,391,2.701,392,2.701,393,2.863,394,2.693,395,1.894,396,2.542,397,1.371,398,2.374,399,1.919,400,2.322,401,2.305,402,1.371,403,2.266,404,2.305,405,1.371,406,2.089,407,2.505,408,2.542,409,2.964,410,2.322,411,1.381,412,2.543,413,1.392,414,2.542,415,2.505,416,2.469,418,2.472,420,2.6,421,1.361,422,1.371,423,1.979,424,1.341,425,1.908,426,2.314,427,1.371,428,1.424,429,1.361,430,1.371,431,2.322,432,2.322,433,1.371,434,1.853,435,2.489,438,2.487,442,1.814,445,1.381,446,1.381,447,1.381,448,1.381,449,1.371,450,1.096,451,1.181,452,1.381,453,1.95,454,1.371,455,1.381,456,1.381,457,1.381,458,1.381,459,1.381,460,1.994,465,1.371,466,1.381,467,1.424,468,1.392,469,1.381,470,1.381,471,1.381,472,1.392,473,1.392,474,1.392,475,1.424,476,1.381,477,1.381,478,1.392,479,1.392,486,2.58,487,2.403,488,1.645,490,1.24,492,1.936,493,1.341,494,1.275,495,1.351,496,1.322,661,1.733,706,1.434,709,1.413,714,1.985,719,1.434,737,1.733,747,2.378,1287,6.138,1290,7.534,1291,1.781,1292,1.781,1293,1.781,1294,1.765,1295,2.378,1296,4.783,1297,4.783,1298,1.781,1299,2.571,1300,1.765,1301,1.781,1302,1.781,1303,4.783,1304,4.783,1305,1.781,1306,1.781,1307,1.765,1308,4.783,1309,4.783,1310,4.783,1311,1.798]],["t/202",[0,0.33,6,1.417,7,0.669,14,0.704,17,0.354,25,1.378,27,1.938,37,2.291,41,1.355,64,1.349,79,1.44,81,1.419,94,0.65,95,1.055,102,1.706,105,0.85,108,3.088,110,1.302,117,1.798,120,2.926,123,3.811,124,1.292,135,1.938,141,0.92,146,2.076,149,1.162,158,1.756,164,1.44,186,2.78,187,1.15,189,1.257,196,2.393,202,1.013,209,1.339,215,1.793,224,1.285,231,1.857,270,3.005,275,1.266,276,1.266,277,1.14,297,1.7,299,1.184,314,1.038,318,2.617,321,1.283,322,2.359,323,1.951,347,2.21,352,2.359,355,1.535,358,2.113,365,1.214,368,1.24,369,1.87,374,1.349,377,2.611,380,1.014,381,4.081,388,3.021,389,2.753,390,2.753,391,2.753,392,2.753,393,2.878,394,2.726,395,2.275,396,2.591,397,1.43,398,2.431,399,2.062,400,2.377,401,2.359,402,1.43,403,2.31,404,2.359,405,1.43,406,2.113,407,2.553,408,2.591,409,2.997,410,2.377,411,1.44,412,2.585,413,1.451,414,2.591,415,2.553,416,2.516,418,2.512,420,2.802,421,1.419,422,1.43,423,2.039,424,1.398,425,1.966,426,2.164,427,1.43,428,1.484,429,1.419,430,1.43,431,2.377,432,2.377,433,1.43,434,1.339,435,2.53,438,2.325,442,2.376,445,1.44,446,1.44,447,1.44,448,1.44,449,1.43,450,1.143,451,1.231,452,1.44,453,2.009,454,1.43,455,1.44,456,1.44,457,1.44,458,1.44,459,1.44,460,2.054,465,1.43,466,1.44,467,1.484,468,1.451,469,1.44,470,1.44,471,1.44,472,1.451,473,1.451,474,1.451,475,1.484,476,1.44,477,1.44,478,1.451,479,1.451,486,2.63,487,2.442,490,1.292,492,1.994,493,1.398,494,1.33,495,1.409,496,1.378,615,1.552,661,1.131,706,1.496,707,1.791,708,2.555,709,1.473,710,2.978,711,1.807,712,1.807,713,2.578,714,1.296,717,1.807,718,1.807,719,1.496,720,1.91,721,1.807,723,1.824,736,5.322,965,2.979,1287,2.16,1290,2.652,1312,3.184,1313,2.652,1314,3.11,1315,5.171,1316,2.099,1317,2.381,1318,2.838]],["t/204",[7,0.721,17,0.787,80,1.602,117,1.721,154,3.294,155,6.721,244,2.494,252,3.041,277,1.524,326,4.513]],["t/206",[3,1.044,149,1.044,151,5.729,166,5.857,344,3.148,348,4.736,355,2.026,367,6.314]],["t/208",[3,0.963,80,1.518,149,1.205,164,3.296,165,5.826,166,7.119,168,8.019,169,6.41,170,6.41,171,6.667,195,3.085,202,3.309,204,5.997,270,2.778,343,5.286,344,2.905,348,5.144,351,5.973,355,1.87,393,2.169,403,2.214,545,6.19,564,4.977,972,7.848,1284,5.997,1319,5.533,1320,7.848,1321,7.879,1322,6.975,1323,8.665,1324,7.848,1325,8.665,1326,7.879]],["t/210",[3,1.227,37,2.298,41,1.246,80,1.457,84,6.151,85,3.97,102,1.159,140,5.755,144,3.87,149,0.924,152,3.312,159,4.077,164,2.401,194,6.499,200,4.385,281,5.186,282,7.064,318,2.081,348,5.372,355,2.473,365,2.025,371,4.689,376,5.946,393,2.081,403,2.125,502,4.607,523,4.456,562,4.254,599,3.279,605,3.04,626,3.605,755,6.397,843,6.974,854,4.607,932,5.072,971,6.397,972,6.397,977,5.186,993,8.456,1033,6.397,1280,5.755,1327,9.051,1328,8.314,1329,8.314,1330,7.56,1331,9.687,1332,7.064,1333,7.56,1334,8.314,1335,7.56,1336,7.56,1337,8.314,1338,8.314,1339,8.314,1340,8.314,1341,8.314,1342,8.314]],["t/212",[1,0.653,3,1.318,7,0.332,13,2.524,25,1.925,50,2.058,59,3.021,74,4.943,77,1.969,79,1.399,85,2.313,94,0.631,102,1.603,105,0.619,109,4.892,119,2.861,130,1.949,141,1.285,146,1.052,149,1.094,152,2.775,158,1.196,159,2.375,160,2.555,163,3.618,164,3.309,166,7.045,168,7.279,169,6.598,170,6.598,171,6.863,179,4.448,191,4.684,194,4.25,195,1.724,204,4.822,210,3.385,216,4.002,224,1.399,234,1.949,246,5.918,261,2.817,270,1.897,323,1.503,344,3.478,348,5.328,350,4.684,355,1.503,365,2.396,378,2.2,393,1.212,403,1.238,406,1.648,417,2.2,487,1.78,492,1.358,496,1.925,501,3.86,550,3.583,564,5.652,582,3.929,586,6.863,648,3.929,670,2.148,749,8.111,758,3.46,768,5.34,791,2.639,835,2.408,841,4.405,865,3.09,917,4.976,956,7.279,960,2.955,972,5.36,977,5.563,981,7.004,992,4.116,993,9.597,1029,7.578,1052,2.684,1055,4.405,1077,5.031,1138,5.839,1280,7.313,1284,4.822,1286,2.343,1320,6.863,1321,8.948,1322,7.181,1330,6.334,1332,9.112,1333,8.593,1343,8.111,1344,6.334,1345,3.899,1346,3.899,1347,4.405,1348,11.229,1349,4.844,1350,9.597,1351,4.844,1352,8.948,1353,6.966,1354,6.966,1355,6.966,1356,6.966,1357,6.966,1358,6.334,1359,6.334,1360,6.966,1361,9.84,1362,4.844,1363,6.966,1364,6.966,1365,4.844,1366,4.844,1367,4.844,1368,6.966,1369,6.966,1370,6.966,1371,5.918,1372,8.92,1373,6.966,1374,8.92,1375,6.966,1376,6.966,1377,6.966,1378,6.966,1379,6.966,1380,6.966,1381,4.116,1382,4.844,1383,4.844,1384,6.966,1385,6.93,1386,8.157,1387,4.844,1388,6.966,1389,6.966,1390,6.966,1391,6.966,1392,4.844,1393,4.844,1394,4.844,1395,4.844,1396,3.899,1397,4.844,1398,4.844,1399,6.966,1400,6.966]],["t/214",[3,1.196,11,3.219,14,0.594,37,2.706,80,1.418,102,1.575,109,4.023,120,2.855,139,3.387,149,1.017,164,3.041,166,6.824,168,7.789,169,5.986,170,5.986,171,6.226,176,3.014,187,1.866,194,6.423,215,1.238,216,6.285,224,1.301,270,3.188,281,7.147,282,9.143,312,4.945,323,1.296,337,3.675,347,2.157,348,5.155,355,2.546,365,1.97,376,4.834,403,1.535,493,1.684,523,3.219,533,2.868,564,4.648,591,8.362,782,4.038,835,2.986,843,7.663,865,2.664,956,5.986,958,8.228,963,4.443,971,9.056,994,3.932,1119,5.103,1224,5.601,1236,5.461,1320,6.226,1327,7.358,1331,9.295,1335,5.461,1336,5.461,1352,7.358,1358,7.358,1401,11.204,1402,10.529,1403,8.092,1404,8.092,1405,8.092,1406,6.006,1407,6.006,1408,8.092,1409,8.904,1410,8.092,1411,8.092,1412,6.006,1413,6.006,1414,7.358,1415,8.092,1416,8.092,1417,10.221,1418,10.221,1419,6.006,1420,6.006,1421,6.006,1422,6.006,1423,6.006,1424,6.006]],["t/216",[0,0.939,1,1.197,3,0.987,9,1.556,13,3.219,14,0.879,17,0.631,25,2.455,27,2.077,149,0.987,164,2.566,166,5.541,174,4.298,177,7.151,204,7.581,216,5.103,326,3.809,348,4.48,355,1.917,399,2.105,403,2.27,975,5.815,1018,4.923,1048,8.078,1284,7.164,1322,8.332,1326,9.412,1350,7.547,1425,8.078,1426,8.883,1427,8.883,1428,8.883,1429,7.547]],["t/218",[3,0.934,75,3.769,81,1.997,85,4.01,139,4.737,149,0.934,164,3.2,166,6.673,168,8.656,169,7.408,170,7.408,171,7.705,198,5.124,216,6.364,224,1.424,289,3.562,337,3.814,348,4.236,403,2.147,615,4.176,628,4.501,635,2.913,975,5.499,1032,7.153,1224,5.814,1320,7.705,1322,6.762,1324,6.462,1344,7.638,1430,6,1431,9.419,1432,7.638,1433,8.399,1434,6,1435,8.399,1436,8.399,1437,8.399,1438,9.106,1439,8.399,1440,8.399]],["t/220",[3,0.989,102,1.528,117,1.949,191,5.984,270,2.424,355,1.92,369,2.723,371,5.019,373,6.357,399,2.109,442,2.339,490,2.306,605,3.254,724,4.694,972,7.972,1324,6.847,1332,7.561,1441,10.361,1442,8.899,1443,10.361,1444,8.899,1445,8.899,1446,8.899,1447,8.899,1448,8.899,1449,10.361,1450,8.899,1451,8.899,1452,8.899]],["t/222",[3,1.225,12,4.305,75,3.425,79,2.204,80,1.337,102,1.536,105,0.679,109,3.795,116,3.644,117,1.777,128,4.305,139,4.305,147,5.404,149,0.848,159,4.633,163,4.907,164,3.097,166,5.893,168,7.933,169,6.989,170,6.989,200,4.026,202,3.065,216,6.45,217,6.94,223,3.09,245,4.997,304,3.071,348,3.849,365,1.859,376,4.559,403,2.415,586,5.872,626,3.309,627,6.144,628,4.09,635,2.647,732,4.656,756,4.76,944,8.261,1029,6.485,1030,6.485,1032,7.873,1033,5.872,1162,8.718,1224,5.283,1320,7.269,1429,6.485,1453,11.668,1454,7.632,1455,9.448,1456,5.452,1457,7.632,1458,8.591,1459,7.632,1460,8.027,1461,6.94,1462,7.632,1463,8.591,1464,9.448,1465,7.632,1466,9.448,1467,9.448,1468,7.632,1469,7.632,1470,7.632,1471,7.632,1472,6.485,1473,7.632,1474,6.94,1475,6.485,1476,6.94]],["t/224",[3,1.151,75,3.986,81,2.064,130,3.575,149,0.987,158,2.193,160,4.686,163,4.614,166,6.455,194,5.419,198,5.419,213,4.545,245,5.815,291,6.149,309,6.835,344,2.978,365,2.163,403,2.27,502,4.923,732,5.419,1324,6.835,1359,8.078,1460,8.794,1461,8.078,1463,8.078,1477,10.35,1478,7.963,1479,8.883,1480,9.412,1481,8.883,1482,8.078]],["t/226",[3,1.208,54,6.112,81,1.737,139,5.771,158,2.15,164,2.516,198,5.314,216,5.004,268,6.702,323,1.88,358,2.036,365,2.645,376,6.49,399,2.064,403,2.226,415,2.461,724,4.595,783,5.702,975,5.702,1032,7.309,1429,8.693,1438,7.921,1460,9.839,1478,6.702,1483,8.711,1484,8.711,1485,8.711,1486,8.711,1487,8.711,1488,8.711,1489,8.711,1490,8.711,1491,8.711,1492,8.711]],["t/228",[3,0.909,20,3.713,54,5.886,61,6.947,139,4.611,140,7.991,149,1.095,158,2.018,198,4.988,216,5.66,224,1.163,304,3.29,318,2.047,365,2.576,376,6.559,403,2.703,406,1.652,590,6.947,591,6.049,628,4.382,724,4.313,783,5.353,902,6.049,960,4.988,971,7.582,975,5.353,1032,7.556,1051,6.582,1224,5.659,1414,8.96,1478,6.291,1480,10.767,1482,7.435,1493,10.577,1494,8.176,1495,8.176,1496,8.176,1497,8.176,1498,10.98,1499,8.176,1500,8.176,1501,8.176,1502,8.176,1503,10.577,1504,7.435,1505,8.96,1506,6.947,1507,8.176]],["t/230",[3,1.002,38,7.256,80,1.579,159,4.42,291,8.075,323,2.378,355,1.945,380,1.833,403,2.668,670,3.998,783,7.213,1032,6.439,1050,7.456,1152,5.9,1508,6.935,1509,8.196,1510,9.013,1511,9.013,1512,9.013]],["t/232",[3,1.176,80,1.617,117,1.737,149,1.026,164,2.667,244,2.188,252,3.07,277,1.456,337,4.806,363,6.757,364,6.757,365,2.248]],["t/234",[1,1.238,3,1.021,14,0.908,17,0.652,80,1.608,85,4.383,131,7.391,141,1.694,149,1.021,223,3.003,363,5.862,364,5.862,417,4.169,502,5.087,605,3.357,636,5.274,969,6.355,970,7.391,1513,6.792,1514,7.8]],["t/236",[7,0.616,29,2.132,45,4.352,76,6.655,80,1.576,81,1.794,105,0.8,109,4.473,130,3.62,133,3.9,140,6.227,149,1.159,158,2.718,160,4.745,221,3.584,406,1.818,417,4.086,636,5.989,684,3.945,865,3.99,961,5.168,1216,5.488,1513,6.655,1515,8.181,1516,8.181,1517,8.997,1518,6.05]],["t/238",[0,1.086,3,0.975,14,1.078,17,0.798,27,2.051,45,4.971,79,2.967,80,1.537,85,4.906,104,2.631,117,1.65,128,4.948,145,7.062,146,1.906,202,2.846,215,1.808,224,1.247,289,4.357,302,2.136,333,3.53,337,3.984,370,5.899,417,4.948,545,6.267,628,4.701,772,6.75,773,5.743,872,7.453,956,6.49,977,5.472,1057,6.75,1519,6.909]],["t/240",[17,0.744,80,1.588,92,3.024,93,3.07,95,1.219,117,1.705,244,2.481,252,3.013,277,1.519,326,3.886,337,4.755,365,2.55,628,4.857,981,7.081]],["t/242",[0,0.998,1,1.273,176,3.518,252,3.14,961,5.425]],["t/244",[3,1.249,14,1.111,17,0.798,25,3.104,186,2.704,187,1.763,189,1.927,198,6.853,224,1.597,275,1.94,276,1.94,347,2.995,348,5.665,351,6.282,355,2.424,365,2.735,368,1.9,369,2.009,370,7.553,371,6.335,372,8.719,373,8.382,374,3.038,375,8.024,376,6.71,377,2.208]],["t/246",[0,0.976,7,0.725,95,1.019,102,1.475,105,0.941,108,3.942,195,3.287,205,2.856,378,4.193,381,4.347,962,8.143]],["t/248",[9,1.046,25,1.65,37,2.521,41,1.464,64,1.614,81,1.607,102,1.696,104,1.79,110,1.558,124,1.547,135,2.283,146,1.982,149,1.168,186,2.754,187,1.377,189,1.505,196,2.586,202,2.614,215,2.013,224,1.389,270,3.099,275,1.515,276,1.515,277,1.255,318,2.631,322,2.549,323,1.739,347,2.432,352,2.78,355,1.969,358,2.283,365,1.454,368,1.484,369,1.569,377,2.327,380,1.214,388,2.695,393,2.801,394,2.864,395,2.211,396,2.8,397,1.711,398,2.675,399,2.162,400,2.615,401,2.596,402,1.711,403,2.496,404,2.596,405,1.711,406,2.171,407,2.759,408,2.8,409,3.013,410,2.615,411,1.724,412,2.467,413,1.737,414,2.8,415,2.759,416,1.662,418,2.118,421,1.699,422,1.711,423,2.31,424,1.674,425,2.227,426,2.103,427,1.711,428,1.777,429,1.699,430,1.711,431,2.615,432,2.615,433,1.711,434,1.603,435,2.133,445,1.724,446,1.724,447,1.724,448,1.724,449,1.711,450,1.368,451,1.474,452,1.724,453,2.276,454,1.711,455,1.724,456,1.724,457,1.724,458,1.724,459,1.724,460,2.327,465,1.711,466,1.724,467,1.777,468,1.737,469,1.724,470,1.724,471,1.724,472,1.737,473,1.737,474,1.737,475,1.777,476,1.724,477,1.724,478,1.737,479,1.737,486,2.345,487,2.06,963,4.416,964,3.812]],["t/250",[0,0.761,1,1.228,7,0.684,14,0.901,17,0.511,64,1.947,94,0.938,95,1.103,102,1.704,104,3.37,105,0.888,108,3.721,124,1.866,141,1.328,146,2.281,158,1.777,187,1.66,189,1.814,202,2.335,205,2.226,209,1.933,224,1.023,275,1.827,276,1.827,321,1.852,366,4.982,368,1.789,369,2.394,374,1.947,381,4.104,393,2.711,406,1.455,412,2.463,416,2.781,418,2.626,420,3.079,426,2.377,434,1.933,435,2.645,438,2.945,442,2.394,487,1.84,488,2.475,490,1.866,492,2.554,493,2.018,494,1.919,495,2.033,496,1.989,709,2.126,714,2.988,719,2.159,737,2.609,962,7.687,965,4.3,966,6.116,1291,2.681,1292,2.681,1293,2.681,1294,2.656,1295,3.579,1298,2.681,1299,3.392,1300,2.656,1301,2.681,1302,2.681,1305,2.681,1306,2.681,1307,2.656,1520,5.538,1521,6.545,1522,6.545]],["t/252",[0,0.95,1,1.211,7,0.737,14,0.889,64,1.905,94,0.918,95,1.15,102,1.704,104,2.113,105,0.957,108,3.88,124,1.826,141,1.3,146,2.263,158,1.739,187,1.625,189,1.775,195,2.508,202,2.285,209,1.891,224,1.001,275,1.788,276,1.788,321,1.813,328,5.477,366,4.875,368,1.751,369,2.361,374,1.905,378,3.199,381,4.42,393,2.693,406,1.423,412,2.429,416,2.753,418,2.6,420,3.054,426,2.345,434,1.891,435,2.618,438,2.921,442,2.361,487,1.8,488,2.422,490,1.826,492,2.519,493,1.975,494,1.878,495,1.99,496,1.947,709,2.081,714,2.924,737,2.553,962,8.28,965,4.208,966,5.985,1291,2.623,1292,2.623,1293,2.623,1294,2.599,1295,3.502,1298,2.623,1299,3.346,1300,2.599,1301,2.623,1302,2.623,1305,2.623,1306,2.623,1307,2.599,1520,5.42,1521,6.405,1522,6.405,1523,7.044]],["t/254",[7,0.75,9,1.975,14,0.877,77,4.203,80,1.554,95,0.979,104,3.101,105,0.919,117,1.668,154,2.942,157,5.297,158,2.189,176,3.303,202,2.877,215,1.827,244,2.593,252,2.948,277,1.551,314,2.948,326,4.433,359,3.844,835,4.409,1524,6.769]],["t/256",[0,1.192,1,1.475,2,6.56,3,0.986,7,0.75,9,1.811,14,0.877,16,2.9,17,0.63,44,3.198,50,3.054,77,3.605,83,3.525,95,0.979,105,0.973,117,1.668,125,5.963,149,1.149,196,2.347,244,2.101,302,2.518,605,3.243,756,5.531,1525,7.138]],["t/258",[0,1.158,1,1.37,3,1.13,7,0.791,9,1.633,14,1.053,16,2.443,17,0.778,19,3.29,41,1.595,44,2.311,50,2.207,52,3.87,80,1.633,83,2.547,92,2.158,93,2.733,94,1.516,95,1.233,102,1.682,105,0.993,119,3.069,141,1.378,154,2.126,174,3.614,188,3.88,215,1.54,221,2.976,223,2.443,224,1.326,225,3.785,234,3.006,244,1.77,261,2.486,277,1.027,298,7.518,302,2.475,314,2.484,333,3.006,345,3.203,378,3.393,379,2.19,380,1.52,381,4.371,384,2.404,385,2.329,386,2.258,387,2.275,450,1.712,504,2.66,599,2.947,601,3.276,604,2.976,605,2.732,635,2.591,774,3.477,1285,3.94,1286,3.614]],["t/260",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.452,244,2.196,261,2.828,277,1.275]],["t/262",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,450,1.996,601,3.819,604,3.267,605,3.185,635,3.021]],["t/265",[0,0.834,1,0.616,3,0.508,7,0.682,14,0.661,17,0.325,25,1.263,27,1.845,37,2.181,41,1.301,50,1.35,64,1.236,77,1.858,79,1.32,80,0.801,81,1.332,94,0.596,95,1.064,102,1.703,105,0.857,108,3.71,110,1.193,117,1.737,120,3.259,124,1.184,135,1.845,141,0.843,146,2.006,149,1.135,152,1.821,158,1.649,164,1.32,186,2.734,187,1.054,189,1.152,196,2.298,202,1.483,205,1.414,209,1.227,215,1.789,224,1.234,270,2.955,275,1.16,276,1.16,277,1.085,297,1.558,298,3.381,299,1.734,307,1.702,318,2.556,321,1.176,322,2.266,323,1.873,347,2.104,352,2.246,355,1.441,358,2.029,365,1.113,368,1.136,369,1.755,374,1.236,377,2.507,380,0.93,381,4.278,388,2.942,389,2.644,390,2.644,391,2.644,392,2.644,393,2.846,394,2.655,395,2.165,396,2.488,397,1.31,398,2.314,399,2.057,400,2.262,401,2.246,402,1.31,403,2.218,404,2.246,405,1.31,406,2.063,407,2.452,408,2.488,409,2.927,410,2.262,411,1.32,412,2.497,413,1.33,414,2.488,415,2.452,416,2.416,418,2.427,420,2.707,421,1.301,422,1.31,423,1.915,424,1.282,425,1.846,426,2.06,427,1.31,428,1.36,429,1.301,430,1.31,431,2.262,432,2.262,433,1.31,434,1.227,435,2.444,438,2.213,442,2.282,445,1.32,446,1.32,447,1.32,448,1.32,449,1.31,450,1.047,451,1.128,452,1.32,453,1.886,454,1.31,455,1.32,456,1.32,457,1.32,458,1.32,459,1.32,460,1.929,465,1.31,466,1.32,467,1.36,468,1.33,469,1.32,470,1.32,471,1.32,472,1.33,473,1.33,474,1.33,475,1.36,476,1.32,477,1.32,478,1.33,479,1.33,486,2.526,487,2.36,490,1.184,492,1.873,493,1.282,494,1.218,495,1.291,496,1.263,504,1.627,533,2.182,661,3.146,706,1.371,707,1.641,708,2.399,709,1.35,710,2.834,711,1.656,712,1.656,713,2.42,714,1.897,717,1.656,718,1.656,719,1.371,720,2.558,721,1.656,723,1.671,965,2.73,1524,2.992,1526,8.849,1527,2.918,1528,3.883,1529,4.156]],["t/267",[0,0.529,1,0.675,7,0.62,14,0.706,17,0.223,25,1.383,27,1.46,37,2.296,41,1.357,50,0.926,64,1.689,79,0.905,81,1.422,94,0.814,95,1.03,102,1.706,105,0.805,108,3.476,110,1.306,117,1.466,123,3.582,124,1.619,135,1.942,141,0.923,146,2.161,149,1.163,158,1.542,160,1.654,164,0.905,186,2.782,187,1.154,189,1.261,196,2.397,202,1.017,209,1.344,210,1.899,215,1.797,224,1.287,231,1.168,270,3.007,275,1.27,276,1.27,277,1.142,297,1.069,304,1.262,318,2.619,321,1.288,322,2.363,323,1.954,328,4.38,347,2.215,352,2.364,355,1.539,358,2.117,365,1.219,368,1.244,369,1.874,374,1.353,377,2.615,380,1.018,381,4.014,388,3.024,389,2.757,390,2.757,391,2.757,392,2.757,393,2.879,394,2.729,395,2.138,396,2.595,397,1.435,398,2.435,399,1.968,400,2.381,401,2.364,402,1.435,403,2.314,404,2.364,405,1.435,406,2.115,407,2.557,408,2.595,409,3,410,2.381,411,1.445,412,2.588,413,1.456,414,2.595,415,2.557,416,2.52,418,2.515,420,2.736,421,1.424,422,1.435,423,2.044,424,1.403,425,1.971,426,2.275,427,1.435,428,1.49,429,1.424,430,1.435,431,2.381,432,2.381,433,1.435,434,1.677,435,2.533,438,2.445,442,2.291,445,1.445,446,1.445,447,1.445,448,1.445,449,1.435,450,1.147,451,1.235,452,1.445,453,2.014,454,1.435,455,1.445,456,1.445,457,1.445,458,1.445,459,1.445,460,2.059,465,1.435,466,1.445,467,1.49,468,1.456,469,1.445,470,1.445,471,1.445,472,1.456,473,1.456,474,1.456,475,1.49,476,1.445,477,1.445,478,1.456,479,1.456,486,2.634,487,2.446,488,1.078,490,1.297,492,2,493,1.403,494,1.334,495,1.414,496,1.383,504,1.116,604,1.001,661,1.814,706,1.501,707,1.126,708,1.797,709,1.478,710,2.243,711,1.136,712,1.136,713,1.814,714,2.077,717,1.136,718,1.136,719,0.94,721,1.136,723,1.146,737,1.136,747,1.559,791,1.708,859,1.768,965,2.99,987,2.524,1291,1.168,1292,1.168,1293,1.168,1294,1.157,1295,1.559,1298,1.168,1299,1.864,1300,1.157,1301,1.168,1302,1.168,1305,1.168,1306,1.168,1307,1.157,1311,1.179,1317,2.389,1520,2.412,1526,8.303,1528,4.252,1529,2.851,1530,2.851,1531,3.135,1532,2.851,1533,2.851,1534,1.559]],["t/269",[0,1.099,1,1.401,7,0.712,9,2.016,17,0.78,80,1.568,83,3.544,105,0.795,117,1.683,176,3.871,186,2.255,244,2.603,252,2.975,277,1.555,326,3.836,451,2.566,504,3.185]],["t/271",[0,0.953,1,1.407,14,0.892,17,0.64,141,1.926,146,1.958,160,5.505,176,3.357,202,3.386,206,6.935,215,1.857,223,2.948,252,2.997,299,3.42,304,4.434,307,3.887,442,2.369,599,3.555,882,7.456,961,5.178,1534,4.481,1535,7.658]],["t/273",[0,1.094,1,1.395,3,1.232,14,1.096,17,0.787,25,3.062,186,2.72,187,1.794,198,6.76,224,1.575,275,1.974,276,1.974,307,3.854,347,2.954,348,5.588,351,6.32,355,2.391,365,2.698,368,1.933,369,2.044,370,7.45,371,6.249,372,8.656,373,8.359,374,2.997,375,7.915,376,6.619]],["t/275",[1,1.259,141,1.723,202,3.029,215,1.924,223,3.054,299,3.543,304,3.757,328,4.517,599,3.683,678,6.113,864,8.491]],["t/277",[9,1.06,25,1.672,37,2.538,41,1.472,64,1.636,81,1.622,102,1.697,110,1.579,124,1.568,135,2.147,146,1.995,149,1.139,186,2.762,187,1.395,196,2.6,202,1.963,215,1.893,224,1.396,270,3.105,275,1.535,276,1.535,277,1.263,318,2.565,322,2.563,323,1.306,347,2.449,352,2.795,355,1.982,358,2.296,365,1.473,368,1.504,369,1.59,377,1.747,380,1.231,388,2.713,393,2.808,394,2.874,395,2.231,396,2.816,397,1.734,398,2.693,399,2.176,400,2.633,401,2.614,402,1.734,403,2.51,404,2.614,405,1.734,406,2.179,407,2.774,408,2.816,409,2.938,410,2.633,411,1.747,412,2.484,413,1.76,414,2.816,415,2.774,416,1.684,418,2.137,421,1.722,422,1.734,423,2.331,424,1.697,425,2.247,426,2.122,427,1.734,428,1.801,429,1.722,430,1.734,431,2.633,432,2.633,433,1.734,434,1.625,435,2.153,445,1.747,446,1.747,447,1.747,448,1.747,449,1.734,450,1.386,451,1.494,452,1.747,453,2.297,454,1.734,455,1.747,456,1.747,457,1.747,458,1.747,459,1.747,460,2.349,465,1.734,466,1.747,467,1.801,468,1.76,469,1.747,470,1.747,471,1.747,472,1.76,473,1.76,474,1.76,475,1.801,476,1.747,477,1.747,478,1.76,479,1.76,486,1.76,487,1.546,865,2.683,963,4.476,964,3.863]],["t/279",[1,1.432,7,0.391,14,0.949,27,1.336,50,2.311,55,4.705,58,7.113,60,4.6,64,2.115,67,2.968,94,1.352,95,0.631,99,4.6,102,1.699,104,1.714,116,3.735,118,4.063,124,2.312,130,2.299,141,1.646,146,2.254,149,0.87,158,1.931,160,3.014,187,1.804,189,1.971,202,3.259,205,1.767,209,2.1,215,1.177,223,1.869,224,1.112,231,3.322,275,1.985,276,1.985,277,0.786,299,2.968,302,1.391,304,4.352,314,1.9,321,2.013,323,1.233,328,3.784,368,1.944,369,2.521,374,2.115,383,2.564,393,2.778,399,1.354,403,1.46,406,1.581,418,2.727,426,2.504,434,2.1,435,2.99,438,2.909,442,2.792,487,1.999,488,2.69,490,2.027,492,2.69,493,2.193,494,2.085,495,2.21,496,2.162,564,4.493,610,2.835,625,4.227,654,2.627,672,4.854,730,5.588,775,3.842,858,3.486,867,4.854,868,4.854,871,6.646,882,4.082,903,4.6,964,6.415,1066,5.196,1077,3.223,1343,7.113,1345,6.297,1346,4.6,1347,7.113,1430,5.588,1535,4.854,1536,9.434,1537,9.835,1538,9.976,1539,7.113,1540,9.434,1541,7.113,1542,9.434,1543,7.113,1544,7.113,1545,8.722,1546,7.113,1547,7.113,1548,5.714,1549,7.113,1550,5.714,1551,8.722,1552,5.196,1553,4.854,1554,4.396,1555,5.196,1556,5.714,1557,5.714,1558,5.714,1559,5.714,1560,5.714]],["t/281",[1,0.993,7,0.725,14,0.963,17,0.523,32,4.657,41,1.277,64,1.992,75,2.352,80,0.918,92,1.513,93,2.16,94,1.545,95,1.228,102,1.71,105,0.466,124,2.208,127,3.877,141,1.572,146,2.194,154,2.63,158,1.819,160,3.886,187,1.699,189,1.857,196,1.387,209,1.978,215,1.518,223,1.714,224,1.047,229,4.032,275,1.87,276,1.87,304,3.428,321,1.896,323,1.131,368,1.831,369,2.429,374,1.992,379,1.536,380,1.066,383,4.532,384,1.686,385,1.634,386,2.575,387,2.594,393,2.73,406,1.489,418,2.654,426,2.412,434,1.978,435,2.946,438,2.832,442,2.559,487,1.883,488,2.533,490,1.909,492,2.591,493,2.066,494,1.964,495,2.081,496,2.036,605,1.916,610,1.899,613,3.109,787,6.259,849,5.262,871,6.259,882,3.743,900,3.068,964,5.439,1007,4.032,1430,5.262,1536,9.183,1537,9.629,1538,9.629,1539,6.699,1540,9.183,1541,6.699,1542,8.404,1543,6.699,1544,6.699,1545,8.404,1546,6.699,1547,6.699,1551,8.404,1552,4.765,1561,3.627,1562,7.366]],["t/283",[0,0.888,1,1.35,7,0.733,9,1.983,10,5.475,16,2.747,77,3.415,84,6.213,105,0.747,142,4.825,149,1.113,150,3.071,154,3.153,155,6.394,176,3.128,205,3.097,224,1.194,244,1.99,249,4.298,285,4.298,307,3.128,315,5.648,328,4.063,603,3.95,623,4.236,665,3.443,705,8.061,756,5.239,859,4.737,1021,7.638,1120,6.213,1287,6.931,1534,4.176,1563,7.638,1564,8.399,1565,10.014,1566,10.014,1567,9.106,1568,7.638,1569,8.399,1570,8.399,1571,8.399,1572,8.399,1573,8.399,1574,5.363,1575,8.399,1576,7.136,1577,5.814]],["t/285",[0,0.642,1,0.819,3,0.613,7,0.703,9,0.704,13,0.62,14,0.807,16,0.559,17,0.542,19,1.061,25,1.337,27,1.71,29,1.439,37,2.253,41,1.432,44,0.93,50,0.505,51,0.806,52,1.248,64,1.49,79,1.161,80,0.527,81,1.388,83,0.583,92,0.494,93,0.881,94,1.182,95,1.139,102,1.707,104,1.964,105,0.889,108,2.725,110,1.263,117,1.612,119,0.702,120,1.944,123,3.507,124,1.428,135,1.906,141,1.12,146,2.097,149,1.153,152,0.681,154,1.864,158,1.617,164,1.161,174,0.827,186,2.765,187,1.116,189,1.219,196,2.36,197,0.875,205,0.529,209,1.299,210,1.141,215,1.868,221,0.681,223,0.559,224,1.308,225,1.498,234,0.688,244,0.712,250,1.043,270,2.988,275,1.228,276,1.228,277,1.179,279,1.516,297,1.371,299,1.836,302,0.979,307,0.637,314,0.999,318,2.596,321,1.245,322,2.327,323,1.924,326,1.289,333,0.688,345,0.733,347,2.173,352,2.32,355,1.502,358,2.084,365,1.178,368,1.203,369,1.829,374,1.308,377,2.575,378,1.365,379,0.501,380,1.121,381,4.004,384,0.55,385,0.533,386,0.908,387,0.915,388,2.994,389,2.715,390,2.715,391,2.715,392,2.715,393,2.867,394,2.702,395,2.169,396,2.556,397,1.387,398,2.39,399,2.031,400,2.337,401,2.32,402,1.387,403,2.278,404,2.32,405,1.387,406,2.096,407,2.518,408,2.556,409,2.973,410,2.337,411,1.397,412,2.554,413,1.408,414,2.556,415,2.518,416,2.482,418,2.483,420,2.735,421,1.377,422,1.387,423,1.995,424,1.357,425,1.923,426,2.185,427,1.387,428,1.44,429,1.377,430,1.387,431,2.337,432,2.337,433,1.387,434,1.48,435,2.5,438,2.348,442,2.253,445,1.397,446,1.397,447,1.397,448,1.397,449,1.387,450,1.262,451,1.194,452,1.397,453,1.966,454,1.387,455,1.397,456,1.397,457,1.397,458,1.397,459,1.397,460,2.01,465,1.387,466,1.397,467,1.44,468,1.408,469,1.397,470,1.397,471,1.397,472,1.408,473,1.408,474,1.408,475,1.44,476,1.397,477,1.397,478,1.408,479,1.408,486,2.594,487,2.442,488,0.588,490,1.254,492,1.952,493,1.357,494,1.29,495,1.367,496,1.337,599,0.675,601,0.75,604,0.96,605,0.625,606,1.365,613,2.894,635,0.593,661,3.106,706,1.451,707,1.444,708,2.181,709,1.429,710,2.628,711,1.457,712,1.457,713,2.201,714,1.248,717,1.457,718,1.457,719,1.451,720,1.54,721,1.457,723,1.47,729,3.094,736,5.039,737,0.62,747,0.85,774,0.796,791,0.932,796,4.845,965,2.402,1052,0.948,1285,1.585,1286,0.827,1291,0.637,1292,0.637,1293,0.637,1294,0.631,1295,0.85,1298,0.637,1299,1.119,1300,0.631,1301,0.637,1302,0.637,1305,0.637,1306,0.637,1307,0.631,1311,0.643,1312,2.567,1313,1.453,1314,1.067,1315,3.787,1316,1.15,1317,2.899,1318,1.555,1578,5.336,1579,1.453,1580,1.71,1581,1.555,1582,1.71,1583,5.01,1584,1.15,1585,1.555,1586,1.12,1587,1.555,1588,1.555,1589,1.15,1590,1.555,1591,0.964]],["t/287",[7,0.638,9,1.633,83,3.178,102,1.299,105,0.829,154,3.028,205,2.883,224,1.325,225,3.471,244,2.208,277,1.282]],["t/289",[9,1.642,102,1.306,105,0.833,154,2.667,224,1.333,225,3.491,244,2.221,277,1.289,326,4.019]],["t/291",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,450,1.996,601,3.819,604,3.267,605,3.185,635,3.021]],["t/294",[0,0.495,1,0.916,3,0.521,7,0.548,9,0.82,14,0.673,25,1.294,29,1.611,37,2.212,41,1.316,64,1.838,81,1.356,85,2.236,94,0.61,95,0.883,102,1.704,105,0.711,108,2.981,110,1.222,124,1.762,135,1.871,141,0.864,146,2.18,149,1.143,158,1.156,160,2.47,186,2.747,187,1.08,189,1.18,195,1.667,196,2.324,209,1.257,210,1.777,215,1.649,224,1.248,226,2.008,270,2.969,275,1.189,276,1.189,277,1.101,318,2.573,321,1.205,322,2.292,323,1.895,328,4.973,347,2.134,352,2.277,355,1.467,358,2.053,365,1.14,368,1.164,369,1.787,374,1.266,377,2.536,380,0.953,381,1.924,388,2.964,389,2.674,390,2.674,391,2.674,392,2.674,393,2.855,394,2.675,395,1.865,396,2.517,397,1.343,398,2.346,399,1.896,400,2.294,401,2.277,402,1.343,403,2.244,404,2.277,405,1.343,406,2.077,407,2.48,408,2.517,409,2.947,410,2.294,411,1.353,412,2.522,413,1.363,414,2.517,415,2.48,416,2.444,418,2.451,420,2.574,421,1.333,422,1.343,423,1.949,424,1.313,425,1.879,426,2.292,427,1.343,428,1.394,429,1.333,430,1.343,431,2.294,432,2.294,433,1.343,434,1.825,435,2.468,438,2.462,442,1.787,445,1.353,446,1.353,447,1.353,448,1.353,449,1.343,450,1.073,451,1.156,452,1.353,453,1.92,454,1.343,455,1.353,456,1.353,457,1.353,458,1.353,459,1.353,460,1.963,465,1.343,466,1.353,467,1.394,468,1.363,469,1.353,470,1.353,471,1.353,472,1.363,473,1.363,474,1.363,475,1.394,476,1.353,477,1.353,478,1.363,479,1.363,486,2.555,487,2.383,488,1.61,490,1.214,492,1.906,493,1.313,494,1.249,495,1.323,496,1.294,613,3.105,661,2.464,706,1.404,709,1.383,714,1.944,736,2.47,737,1.697,747,2.328,859,2.641,1291,1.744,1292,1.744,1293,1.744,1294,1.728,1295,2.328,1298,1.744,1299,2.532,1300,1.728,1301,1.744,1302,1.744,1305,1.744,1306,1.744,1307,1.728,1311,1.76,1561,4.705,1576,3.979,1583,8.845,1584,3.149,1585,4.258,1586,3.066,1587,4.258,1588,4.258,1589,3.149,1590,4.258,1592,4.258,1593,4.258,1594,4.683]],["t/296",[0,0.495,1,0.631,3,0.521,7,0.639,14,0.673,17,0.333,25,1.294,27,2.053,37,2.212,41,1.316,64,1.266,79,1.353,81,1.356,94,0.61,95,1.029,102,1.704,105,0.829,108,3.623,110,1.222,117,1.754,123,4.471,124,1.214,135,1.871,141,0.864,146,2.026,149,1.143,152,1.866,158,1.678,164,1.353,186,2.747,187,1.08,189,1.18,196,2.324,209,1.257,215,1.649,224,1.248,231,1.744,270,2.969,275,1.189,276,1.189,277,1.101,297,1.597,299,1.777,318,2.573,321,1.205,322,2.292,323,1.895,328,2.266,347,2.134,352,2.277,355,1.467,358,2.053,365,1.14,368,1.164,369,1.787,374,1.266,377,2.536,380,0.953,381,3.995,388,2.964,389,2.674,390,2.674,391,2.674,392,2.674,393,2.855,394,2.675,395,2.196,396,2.517,397,1.343,398,2.346,399,1.896,400,2.294,401,2.277,402,1.343,403,2.244,404,2.277,405,1.343,406,2.077,407,2.48,408,2.517,409,2.947,410,2.294,411,1.353,412,2.522,413,1.363,414,2.517,415,2.48,416,2.444,418,2.451,420,2.734,421,1.333,422,1.343,423,1.949,424,1.313,425,1.879,426,2.089,427,1.343,428,1.394,429,1.333,430,1.343,431,2.294,432,2.294,433,1.343,434,1.257,435,2.468,438,2.244,442,2.308,445,1.353,446,1.353,447,1.353,448,1.353,449,1.343,450,1.073,451,1.156,452,1.353,453,1.92,454,1.343,455,1.353,456,1.353,457,1.353,458,1.353,459,1.353,460,1.963,465,1.343,466,1.353,467,1.394,468,1.363,469,1.353,470,1.353,471,1.353,472,1.363,473,1.363,474,1.363,475,1.394,476,1.353,477,1.353,478,1.363,479,1.363,486,2.555,487,2.383,490,1.214,492,1.906,493,1.313,494,1.249,495,1.323,496,1.294,661,1.697,706,1.404,707,1.682,708,2.442,709,1.383,710,2.874,711,1.697,712,1.697,713,2.464,714,1.944,717,1.697,718,1.697,719,1.404,721,1.697,723,1.712,736,5.293,858,2.857,965,2.797,1312,2.99,1313,3.979,1317,3.246]],["t/298",[7,0.721,9,1.844,17,0.787,80,1.602,117,1.721,154,3.294,244,2.494,252,3.041,277,1.524,326,4.513]],["t/300",[0,1.118,1,1.425,16,3.014,149,1.175,157,5.505,176,3.937,244,2.184,302,2.244,333,3.708,630,5.505,812,4.715,835,5.256,1014,6.196]],["t/302",[0,1.147,1,1.301,3,1.073,7,0.809,9,1.79,14,1.011,16,2.188,17,0.771,19,3.067,41,1.627,44,2.069,50,1.976,52,3.607,80,1.936,83,2.963,92,1.932,93,2.548,94,1.529,95,1.261,96,3.319,102,1.701,105,0.982,119,2.748,141,1.234,154,1.904,174,3.237,188,3.475,215,1.791,221,2.665,223,2.188,224,1.372,225,3.806,234,2.692,244,2.059,261,2.317,277,1.195,298,7.14,302,2.35,314,2.225,333,2.692,345,2.868,378,3.038,379,1.961,380,1.361,381,2.748,384,2.153,385,2.086,386,2.626,387,2.94,450,1.533,451,2.145,504,2.382,599,2.639,601,2.933,604,2.774,605,2.447,606,3.038,635,2.32,774,3.114,1285,3.529,1286,3.237,1595,9.291,1596,6.69,1597,4.631]],["t/304",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.452,244,2.196,261,2.828,277,1.275]],["t/306",[9,1.642,83,3.196,102,1.306,105,0.833,224,1.333,225,3.491,244,2.221,277,1.289,451,2.314]],["t/308",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,450,1.996,601,3.819,604,3.267,605,3.185,635,3.021]],["t/311",[1,1.017,7,0.693,13,1.381,14,0.7,17,0.16,25,1.369,27,0.526,28,2.474,37,2.283,41,1.351,59,1.404,64,1.914,80,1.24,81,1.504,94,0.646,95,0.995,96,3.024,102,1.708,104,2.939,105,0.801,110,1.293,124,1.835,135,1.931,141,0.914,146,2.252,149,1.144,158,1.223,186,2.777,187,1.143,189,0.96,195,1.764,196,2.386,202,1.607,205,0.696,209,1.023,215,1.812,224,1.333,229,1.732,260,1.608,270,3.001,275,1.257,276,1.257,277,1.136,285,1.152,288,1.119,298,3.665,318,2.575,321,1.275,322,2.352,323,1.844,324,1.226,328,4.679,347,2.202,352,2.351,355,1.528,358,2.192,365,1.206,368,1.231,369,1.861,374,1.34,377,2.468,380,1.008,388,3.015,389,2.745,390,2.745,391,2.745,392,2.745,393,2.875,394,2.721,395,1.942,396,2.583,397,1.42,398,2.422,399,1.957,400,2.368,401,2.351,402,1.42,403,2.303,404,2.351,405,1.42,406,2.109,407,2.546,408,2.583,409,2.95,410,2.368,411,1.431,412,2.578,413,1.441,414,2.583,415,2.546,416,2.509,418,2.506,420,2.642,421,1.41,422,1.42,423,2.029,424,1.389,425,1.956,426,2.352,427,1.42,428,1.474,429,1.41,430,1.42,431,2.368,432,2.368,433,1.42,434,1.901,435,2.523,438,2.527,442,1.861,445,1.431,446,1.431,447,1.431,448,1.431,449,1.42,450,1.135,451,1.609,452,1.431,453,2,454,1.42,455,1.431,456,1.431,457,1.431,458,1.431,459,1.431,460,2.044,465,1.42,466,1.431,467,1.474,468,1.441,469,1.431,470,1.431,471,1.431,472,1.441,473,1.441,474,1.441,475,1.474,476,1.431,477,1.431,478,1.441,479,1.441,486,2.486,487,2.353,488,1.31,490,1.284,492,1.985,493,1.389,494,1.321,495,1.399,496,1.369,499,2.931,610,1.795,656,4.415,706,1.486,709,1.463,715,3.482,719,0.675,737,1.795,809,1.474,859,3.677,1077,1.27,1120,1.665,1283,5.248,1291,1.845,1292,1.845,1293,1.845,1294,2.151,1298,1.845,1299,2.636,1300,2.151,1301,1.845,1302,2.171,1305,1.845,1306,1.845,1307,2.151,1311,2.191,1526,8.671,1528,4.952,1530,5.3,1533,5.3,1534,1.119,1598,3.811,1599,4.034,1600,4.209,1601,4.954,1602,4.209,1603,4.034,1604,3.237,1605,1.812,1606,1.404,1607,2.251,1608,2.251,1609,5.539,1610,3.81,1611,2.251,1612,2.251,1613,2.251,1614,2.251]],["t/313",[1,1.339,3,0.921,7,0.773,51,3.906,80,1.976,81,1.981,94,1.295,95,1.174,102,1.627,104,2.485,105,0.883,108,3.7,125,5.572,149,0.921,150,3.03,157,4.95,195,3.536,197,4.24,202,2.688,210,3.144,215,2.047,228,6.671,229,6.376,289,3.514,302,2.018,304,4.281,333,3.334,344,2.778,358,2.322,415,2.341,487,2.118,520,6.13,610,3.003,625,6.13,626,3.592,630,4.95,661,3.855,670,3.675,825,6.671,835,4.12,1314,6.635,1315,6.195,1549,7.535,1595,7.535,1615,5.919,1616,5.919]],["t/315",[0,1.109,1,1.491,3,1.166,16,2.975,80,1.594,104,2.728,117,1.711,176,4.119,186,2.645,202,3.404,244,2.155,252,3.025,277,1.521,732,5.549,1617,5.326]],["t/317",[3,1.102,7,0.566,9,1.737,10,5.435,14,0.981,55,4.356,77,3.357,79,2.385,90,3.076,105,0.881,109,4.106,116,4.733,135,1.931,141,1.524,152,3.29,158,2.039,176,3.076,183,3.706,194,5.038,201,5.553,210,3.134,224,1.174,227,5.151,231,3.076,232,6.954,253,5.553,254,5.716,277,1.136,285,5.072,288,4.106,289,3.502,290,4.226,323,1.782,340,5.716,358,1.931,386,2.496,406,1.669,442,2.171,486,2.403,487,2.715,599,3.257,626,3.58,631,6.109,763,4.576,833,4.836,854,4.576,858,5.038,862,8.551,866,6.109,905,7.017,906,7.017,932,6.874,977,6.625,1026,7.017,1434,7.082,1618,6.354,1619,6.354,1620,8.258,1621,5.9]],["t/319",[11,5.081,605,3.467,782,6.375]],["t/321",[3,1.011,7,0.719,9,1.594,105,0.933,116,4.343,117,1.974,215,2.162,231,3.908,232,7.441,247,5.673,626,3.944,724,4.798,862,7.323,958,7.323,977,6.545,1622,8.272]],["t/323",[1,1.146,3,0.945,10,5.161,14,0.998,17,0.604,30,2.629,50,2.511,51,4.754,77,3.456,105,0.756,108,4.005,116,4.815,117,1.599,135,1.987,149,1.121,158,2.099,202,2.758,215,2.078,231,3.166,232,5.565,247,5.302,261,2.689,304,4.327,318,2.128,323,2.176,337,3.86,381,3.492,382,4.231,442,2.234,626,3.685,647,3.956,724,4.484,809,5.565,812,4.35,833,5.905,854,4.71,977,5.302,982,7.76,1024,7.73,1284,5.884,1576,7.222,1623,8.5,1624,8.5,1625,10.754,1626,8.5,1627,6.843]],["t/325",[3,0.991,7,0.751,9,1.817,10,4.562,59,5.561,79,2.575,105,1.022,116,4.257,164,2.575,202,3.365,215,2.137,223,3.694,231,3.863,232,6.79,323,1.924,417,4.981,684,3.909,869,6.369,932,5.439,977,5.561]],["t/327",[3,0.883,7,0.799,9,2.03,12,3.295,13,2.117,29,1.882,32,2.425,55,3.082,59,3.644,79,2.924,80,1.391,84,4.322,90,3.771,94,1.361,102,0.814,105,1.041,116,5.101,117,2.074,130,2.351,135,1.857,149,1.209,150,4.031,152,2.327,164,1.687,195,2.08,201,3.928,202,2.927,213,2.989,223,3.646,224,0.831,231,3.979,232,3.825,243,7.239,259,5.497,267,8.601,269,7.767,277,1.241,288,4.486,289,2.478,292,6.11,298,4.322,300,2.946,302,1.934,304,3.631,310,4.256,311,3.949,323,2.089,344,2.663,357,6.11,359,2.533,393,1.988,399,1.384,417,4.598,449,1.675,451,1.442,496,1.615,562,4.064,586,4.495,628,5.426,724,5.107,730,4.174,763,3.237,782,3.928,816,3.825,817,3.825,835,2.905,854,3.237,862,6.393,865,2.591,868,6.748,869,4.174,870,4.322,902,4.322,903,4.703,932,7.161,977,5.627,982,7.79,1003,5.875,1006,4.495,1052,4.401,1083,4.174,1111,3.644,1116,4.964,1138,3.825,1284,7.008,1381,4.964,1431,4.703,1519,3.928,1553,6.748,1616,4.174,1621,4.174,1628,4.703,1629,9.886,1630,7.666,1631,5.313,1632,7.222,1633,9.497,1634,4.322,1635,5.842,1636,7.666,1637,5.313,1638,5.313,1639,7.942,1640,5.842,1641,5.313,1642,5.313,1643,5.842,1644,5.313,1645,5.842]],["t/329",[7,0.789,9,2.017,29,1.909,79,2.327,94,1.273,102,1.523,105,1.023,116,4.663,149,0.896,150,2.946,213,4.122,231,3.637,236,6.71,238,7.274,243,5.144,267,9.35,269,8.356,292,6.199,310,4.317,311,4.005,393,2.016,442,2.118,451,1.989,496,2.226,586,6.199,768,6.393,816,5.274,817,5.274,932,6.665,977,5.025,1003,7.224,1006,6.199,1052,4.464,1381,6.845,1431,6.485,1621,5.755,1629,7.326,1633,9.556,1646,7.326,1647,9.766,1648,6.199,1649,7.326,1650,7.326,1651,5.576]],["t/331",[3,1.009,14,1.093,16,2.97,17,0.744,19,3.204,41,1.571,44,2.808,81,1.811,149,1.165,195,3.232,224,1.291,244,2.151,252,3.485,344,3.044,494,2.421,562,4.646,623,4.579,1574,5.797,1652,9.079,1653,6.717]],["t/333",[0,0.754,3,0.793,7,0.778,9,1.989,14,1.11,17,0.839,20,4.113,29,1.691,30,2.802,31,3.883,32,2.962,53,4.671,54,4.263,55,4.778,75,3.202,83,3.393,95,0.788,105,0.885,110,1.862,135,1.668,149,1.106,150,3.312,154,2.832,155,4.556,223,2.963,226,3.059,244,2.767,261,2.415,299,2.708,302,1.738,317,4.438,318,2.267,337,3.241,344,3.037,346,5.097,349,8.151,350,7.919,365,1.738,406,1.83,451,1.762,503,4.45,504,2.54,600,5.49,603,3.573,613,2.278,635,2.475,647,4.215,648,5.904,656,5.649,684,3.971,703,3.282,748,5.303,756,4.45,759,5.649,835,4.947,981,5.649,1049,5.744,1050,5.097,1524,4.671,1577,4.939,1654,5.097,1655,5.49,1656,6.09,1657,5.744,1658,7.135,1659,7.135,1660,5.097]],["t/335",[3,1.013,14,1.039,17,0.746,80,1.597,149,1.264,150,3.841,252,3.493,494,2.43,518,5.966,647,4.241,759,5.684,1660,7.504,1661,6.034,1662,4.965,1663,8.287]],["t/337",[14,1.117,17,0.802,249,4.554,261,3.009,302,2.749,310,4.769,311,4.425,344,3.784,349,7.813,350,7.59,406,2.281,832,6.583,1214,5.984]],["t/339",[14,0.927,17,0.666,261,2.499,302,2.282,344,3.142,349,6.487,350,6.302,406,1.894,830,6.136]],["t/341",[3,1.022,14,0.91,16,3.008,17,0.75,149,1.235,195,3.275,244,2.18,252,3.511,344,3.084,494,2.452,647,5.17,648,5.956]],["t/343",[0,1.228,7,0.748,17,0.799,75,3.958,105,0.971,133,4.468,154,2.51,244,2.667,301,6.105,349,7.791,350,7.568,504,3.14,533,5.214,551,4.157,654,4.054,807,4.805,1664,5.774,1665,6.301]],["t/345",[0,1.15,1,1.382,13,3.168,16,2.859,27,2.044,29,2.43,44,2.704,81,2.045,95,1.263,96,3.526,115,5.878,149,0.972,195,3.112,197,5.246,244,2.071,261,2.734,319,3.496,326,3.748,606,3.97,610,3.168,612,4.844,613,2.791,626,3.79,630,5.222,692,4.473,807,5.586,1634,6.467,1664,5.723,1666,7.949,1667,7.037,1668,8.741,1669,6.245,1670,8.741]],["t/347",[0,1.135,1,1.329,3,1.096,7,0.805,9,1.225,10,3.579,14,0.975,16,2.288,17,0.762,19,3.156,29,2.544,41,1.609,44,3.049,50,2.066,52,3.712,80,1.567,83,2.385,92,2.02,93,2.622,94,1.51,95,1.248,96,3.573,102,1.692,105,0.976,106,3.633,119,3.673,133,3.032,141,1.29,154,2.957,174,3.384,188,3.633,200,3.689,205,2.163,215,1.441,221,2.786,223,2.288,224,1.271,225,3.672,234,2.814,244,1.657,277,0.962,300,3.527,302,2.615,314,2.325,319,3.745,333,2.814,344,2.345,345,2.999,378,3.176,379,2.05,380,1.423,384,2.251,385,2.18,386,2.114,387,2.723,450,1.602,601,3.067,604,2.855,605,2.558,635,2.426,773,4.579,774,3.255,812,3.579,1286,3.384,1319,4.466,1671,6.994,1672,3.633,1673,4.703]],["t/349",[7,0.638,9,1.633,10,4.769,83,3.178,102,1.299,154,3.028,205,2.883,224,1.325,225,3.471,244,2.208,277,1.282]],["t/351",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,450,1.996,601,3.819,604,3.267,605,3.185,635,3.021]],["t/353",[0,0.953,1,1.215,7,0.617,11,4.83,28,3.42,29,2.611,51,4.248,90,4.104,94,1.175,96,3.589,200,4.754,224,1.281,261,2.403,319,3.559,320,4.995,324,4.91,599,3.555,604,2.877,606,4.093,610,3.266,665,3.589,1674,9.013,1675,6.439]],["t/355",[0,1.137,1,1.039,7,0.789,14,0.94,17,0.732,29,2.667,41,1.544,51,3.631,80,1.35,90,2.869,92,2.225,93,2.786,94,1.467,95,1.187,96,3.921,102,1.703,133,3.34,197,4.862,261,2.054,304,3.1,314,2.562,319,3.928,322,2.011,379,2.259,380,1.567,384,2.479,385,2.402,386,2.328,387,2.894,551,3.631,670,3.417,692,3.942,702,2.951,703,2.792,704,2.951,807,4.197,854,4.269,1676,7.005]],["t/357",[0,0.705,1,0.898,3,0.507,7,0.66,13,1.652,14,0.659,17,0.324,25,1.26,27,1.842,37,2.177,41,1.299,64,1.233,79,1.316,80,1.168,81,1.572,94,0.594,95,1.018,96,3.508,102,1.702,105,0.857,106,5.004,109,2.266,110,1.19,117,1.735,120,3.255,124,1.181,130,1.834,135,1.842,141,0.841,146,2.004,149,1.176,158,1.645,164,1.316,186,2.733,187,1.051,189,1.149,196,2.295,209,1.224,210,2.529,215,1.624,224,1.233,261,1.215,270,2.953,275,1.157,276,1.157,277,1.084,288,2.266,297,1.554,318,2.554,319,1.554,321,1.173,322,2.263,323,1.871,347,2.101,352,2.242,355,1.438,358,2.027,359,1.976,365,1.11,368,1.133,369,1.752,374,1.233,377,2.504,380,0.927,388,2.94,389,2.64,390,2.64,391,2.64,392,2.64,393,2.845,394,2.653,395,2.162,396,2.485,397,1.307,398,2.31,399,1.867,400,2.259,401,2.242,402,1.307,403,2.216,404,2.242,405,1.307,406,2.062,407,2.449,408,2.485,409,2.925,410,2.259,411,1.316,412,2.494,413,1.326,414,2.485,415,2.449,416,2.413,417,3.027,418,2.424,420,2.704,421,1.297,422,1.307,423,1.911,424,1.278,425,1.842,426,2.056,427,1.307,428,1.356,429,1.297,430,1.307,431,2.259,432,2.259,433,1.307,434,1.224,435,2.442,438,2.209,442,2.279,445,1.316,446,1.316,447,1.316,448,1.316,449,1.307,450,1.044,451,1.125,452,1.316,453,1.883,454,1.307,455,1.316,456,1.316,457,1.316,458,1.316,459,1.316,460,1.925,465,1.307,466,1.316,467,1.356,468,1.326,469,1.316,470,1.316,471,1.316,472,1.326,473,1.326,474,1.326,475,1.356,476,1.316,477,1.316,478,1.326,479,1.326,486,2.523,487,2.357,490,1.181,492,1.869,493,1.278,494,1.215,495,1.287,496,1.26,533,2.176,612,2.525,626,1.976,665,1.567,706,1.367,707,1.637,708,2.394,709,1.346,710,2.83,711,1.652,712,1.652,713,2.415,715,2.723,717,1.652,718,1.652,719,1.367,720,2.553,721,1.652,723,1.667,831,4.144,865,2.021,961,2.618,1018,2.525,1216,2.78,1518,3.065,1606,2.843,1672,4.092,1673,6.998,1677,2.78,1678,3.256,1679,4.144,1680,3.872]],["t/359",[0,0.956,17,0.743,80,1.585,96,3.111,117,1.702,142,5.197,149,1.006,249,5.352,252,3.008,277,1.518,310,5.606,311,5.2,319,3.084,381,3.716,382,3.795,399,2.479,608,5.776,665,3.597,807,4.928,1681,4.108]],["t/361",[3,0.923,7,0.773,9,2.029,16,2.715,17,0.589,29,2.356,45,4.016,75,3.725,77,3.374,80,1.454,81,1.656,83,2.83,90,3.091,105,0.738,115,5.581,147,4.07,149,1.227,154,2.829,159,4.07,201,5.581,224,1.18,234,3.34,285,4.247,292,6.386,310,4.448,311,4.127,312,4.81,318,2.489,329,6.386,399,1.967,518,5.434,533,3.963,613,2.65,647,3.863,648,6.224,684,4.36,756,5.177,836,5.581,837,6.386,1064,7.548,1284,5.745,1319,5.3,1431,6.682,1660,5.929,1682,7.356,1683,5.3,1684,7.548,1685,9.042,1686,7.65,1687,8.3,1688,6.682,1689,8.3,1690,5.929]],["t/363",[0,1.098,1,1.263,3,1.042,7,0.803,9,1.103,10,3.222,13,2.282,14,0.927,16,2.06,17,0.737,19,2.947,29,2.461,41,1.556,44,2.899,50,1.86,52,3.467,57,4.905,80,1.463,83,2.147,90,2.345,92,1.819,93,2.449,94,1.518,95,1.29,102,1.697,105,0.995,118,4.338,119,3.431,135,1.472,141,1.162,149,0.7,154,2.84,174,3.047,188,3.271,200,3.322,205,1.948,215,1.298,221,2.509,223,2.06,224,1.187,225,3.49,234,2.534,244,1.492,277,0.866,279,4.212,300,4.212,302,2.529,312,3.047,314,2.094,319,3.541,320,4.628,333,2.534,337,4.532,344,2.8,359,2.73,378,2.86,379,1.846,380,1.281,384,2.027,385,1.963,386,2.524,387,2.544,450,1.443,601,2.761,604,2.666,605,2.303,613,3.608,635,2.184,654,2.895,699,4.845,736,3.322,774,2.931,793,4.123,795,6.724,812,3.222,836,5.616,837,4.845,1018,3.49,1286,3.047,1314,5.209,1315,3.928,1319,4.021,1456,4.499,1691,6.297,1692,5.333,1693,4.234]],["t/365",[7,0.638,9,1.633,10,4.769,83,3.178,102,1.299,154,3.028,205,2.883,224,1.325,225,3.471,244,2.208,277,1.282]],["t/367",[0,1.178,1,1.364,3,0.95,7,0.763,14,1.001,17,0.718,41,1.615,44,2.643,50,2.524,52,4.199,90,3.182,94,1.452,95,1.23,105,1.025,118,5.254,141,1.577,149,0.95,154,2.432,221,3.404,234,3.438,300,4.309,302,2.624,314,2.841,333,3.438,450,1.958,601,3.747,604,3.23,605,3.125,635,2.963,654,3.928,836,6.802,837,6.574]],["t/369",[0,0.318,1,0.405,3,0.334,7,0.685,9,1.219,14,0.755,17,0.542,25,1.337,27,2.004,29,2.112,37,2.253,41,1.336,51,1.416,57,1.333,64,1.308,79,1.397,81,1.388,90,1.119,94,0.631,95,1.042,102,1.705,105,0.84,110,1.263,117,1.777,120,3.333,124,1.254,135,1.906,141,0.893,146,2.052,149,1.153,152,1.197,158,1.718,164,1.397,186,2.764,187,1.116,189,1.219,195,1.07,196,2.36,209,1.299,210,1.14,215,1.766,224,1.308,259,2.08,270,2.988,275,1.228,276,1.228,277,1.121,279,1.515,293,3.308,297,1.649,312,2.34,318,2.596,319,3.353,320,4.517,321,1.245,322,2.327,323,1.924,337,1.365,347,2.173,352,2.32,355,1.502,358,2.151,365,1.178,368,1.203,369,1.829,374,1.308,377,2.575,380,0.984,388,2.994,389,2.715,390,2.715,391,2.715,392,2.715,393,2.867,394,2.702,395,2.236,396,2.556,397,1.387,398,2.39,399,2.031,400,2.337,401,2.32,402,1.387,403,2.278,404,2.32,405,1.387,406,2.096,407,2.518,408,2.556,409,2.973,410,2.337,411,1.397,412,2.554,413,1.408,414,2.556,415,2.518,416,2.482,418,2.483,420,2.769,421,1.377,422,1.387,423,1.995,424,1.357,425,1.923,426,2.127,427,1.387,428,1.44,429,1.377,430,1.387,431,2.337,432,2.337,433,1.387,434,1.299,435,2.5,438,2.286,442,2.343,445,1.397,446,1.397,447,1.397,448,1.397,449,1.387,450,1.108,451,1.194,452,1.397,453,1.966,454,1.387,455,1.397,456,1.397,457,1.397,458,1.397,459,1.397,460,2.01,465,1.387,466,1.397,467,1.44,468,1.408,469,1.397,470,1.397,471,1.397,472,1.408,473,1.408,474,1.408,475,1.44,476,1.397,477,1.397,478,1.408,479,1.408,486,2.594,487,2.414,490,1.254,492,1.952,493,1.357,494,1.29,495,1.367,496,1.337,562,1.538,599,1.185,648,4.303,665,2.088,706,1.451,707,1.738,708,2.5,709,1.429,710,2.928,711,1.753,712,1.753,713,2.522,717,1.753,718,1.753,719,1.451,720,2.923,721,1.753,723,1.769,729,2.312,736,5.188,816,1.967,817,1.967,859,2.728,860,3.089,900,1.76,1052,1.665,1285,1.585,1312,3.089,1314,3.017,1315,5.084,1316,2.021,1319,3.089,1615,2.147,1654,2.147,1683,1.919,1692,4.444,1693,5.481,1694,3.089,1695,2.733,1696,2.147,1697,2.733,1698,2.419]],["t/371",[0,0.795,1,1.013,7,0.797,9,1.317,14,0.744,17,0.724,27,2.188,29,2.6,41,1.527,57,4.52,90,2.799,92,2.171,93,2.744,94,1.526,95,1.276,102,1.706,141,1.387,176,2.799,205,2.895,210,2.852,211,4.095,224,1.069,319,3.475,320,4.165,379,2.204,380,1.529,384,2.419,385,2.343,386,2.828,387,3.104,613,3.405,648,6.309,665,2.584,793,4.92,854,4.165,865,3.334]],["t/373",[0,0.781,7,0.8,13,2.679,17,0.525,20,3.357,29,2.397,41,1.516,57,4.486,92,2.135,93,2.715,94,1.513,95,1.273,102,1.708,118,3.839,149,0.822,159,3.625,210,2.805,224,1.051,319,3.723,320,4.096,323,1.595,379,2.167,380,1.504,384,2.379,385,2.305,386,2.799,387,3.08,399,1.752,523,3.962,604,2.36,613,3.385,615,3.675,648,6.446,704,2.832,793,4.839,836,4.971,837,5.688,838,6.722,860,4.72,1654,5.281,1699,5.688]],["t/375",[0,0.518,1,0.872,3,0.247,7,0.669,9,1.231,13,1.777,14,0.78,17,0.532,25,1.355,27,1.643,29,2.014,37,2.27,41,1.344,64,1.562,79,1.088,81,1.402,94,0.639,95,1.012,102,1.706,104,2.247,105,0.83,109,1.104,110,1.28,117,1.724,120,2.48,123,3.231,124,1.497,130,0.894,135,1.92,141,0.905,146,2.146,149,1.172,158,1.597,164,1.088,186,2.772,187,1.131,189,1.236,196,2.375,205,0.687,209,1.317,210,1.429,211,2.052,215,1.693,224,1.275,259,2.607,261,0.592,270,2.995,275,1.245,276,1.245,277,1.13,279,3.544,293,1.21,297,1.284,299,0.843,304,0.894,307,1.403,318,2.605,319,3.125,320,4.152,321,1.262,322,2.341,323,1.936,347,2.19,352,2.337,355,1.517,358,2.183,359,0.963,365,1.194,368,1.219,369,1.847,374,1.326,377,2.591,380,0.998,388,3.006,389,2.732,390,2.732,391,2.732,392,2.732,393,2.872,394,2.713,395,2.162,396,2.572,397,1.406,398,2.408,399,1.946,400,2.355,401,2.337,402,1.406,403,2.293,404,2.337,405,1.406,406,2.103,407,2.534,408,2.572,409,2.984,410,2.355,411,1.417,412,2.568,413,1.427,414,2.572,415,2.534,416,2.497,417,1.008,418,2.496,420,2.738,421,1.396,422,1.406,423,2.015,424,1.375,425,1.942,426,2.219,427,1.406,428,1.46,429,1.396,430,1.406,431,2.355,432,2.355,433,1.406,434,1.551,435,2.514,438,2.384,442,2.358,445,1.417,446,1.417,447,1.417,448,1.417,449,1.406,450,1.124,451,1.211,452,1.417,453,1.985,454,1.656,455,1.417,456,1.417,457,1.417,458,1.417,459,1.417,460,2.03,465,1.406,466,1.417,467,1.46,468,1.427,469,1.417,470,1.417,471,1.417,472,1.427,473,1.427,474,1.427,475,1.46,476,1.417,477,1.417,478,1.427,479,1.427,486,2.61,487,2.427,488,0.764,490,1.271,492,1.971,493,1.375,494,1.308,495,1.385,496,1.355,506,2.298,533,1.06,562,2.51,606,1.008,612,1.23,622,1.454,626,0.963,636,1.276,648,5.267,665,1.987,706,1.471,707,1.353,708,2.075,709,1.449,710,2.524,711,1.365,712,1.365,713,2.094,717,1.365,718,1.365,719,1.471,720,1.443,721,1.365,723,1.377,736,5.083,737,0.805,791,1.21,816,1.454,817,1.454,818,1.326,859,2.124,860,2.405,865,0.985,900,2.205,1018,2.087,1052,2.718,1291,0.827,1292,0.827,1293,0.827,1294,0.819,1298,0.827,1299,1.403,1300,0.819,1301,0.827,1302,0.827,1305,0.827,1306,0.827,1307,0.819,1311,0.835,1312,3.132,1314,3.059,1315,4.384,1316,1.493,1317,1.798,1606,1.385,1654,1.586,1692,5.852,1693,5.523,1694,2.405,1695,2.019,1696,2.691,1697,2.019,1700,1.887,1701,2.22,1702,2.019,1703,2.22,1704,2.22,1705,1.887,1706,2.22,1707,2.22,1708,2.22,1709,2.22,1710,2.019]],["t/377",[3,1.164,9,1.834,17,0.806,80,1.588,117,1.705,244,2.617,252,3.013,272,5.206,277,1.561,344,3.511,355,2.259,451,2.585,503,5.653]],["t/380",[1,1.154,3,0.951,7,0.779,9,1.5,27,2.001,30,3.132,36,7.783,44,3.519,75,3.841,81,1.707,83,3.453,90,3.188,94,1.116,95,1.19,96,2.943,105,0.959,133,3.711,149,1.199,154,2.882,302,2.466,323,1.847,610,3.102,636,4.917,654,4.958,665,2.943,809,5.604,994,5.604,1077,4.828,1287,5.925,1289,7.783,1290,7.272,1478,6.586,1506,7.272,1654,6.115,1711,8.559,1712,8.559,1713,8.559,1714,8.559,1715,8.559]],["t/382",[0,0.655,1,0.557,3,0.459,6,1.877,7,0.743,14,0.736,17,0.528,25,1.142,27,1.739,29,1.763,37,2.056,41,1.394,64,1.118,79,1.194,80,1.086,81,1.237,92,1.194,93,1.818,94,1.347,95,1.197,102,1.707,105,0.857,108,3.591,110,1.079,117,1.749,120,3.281,124,1.071,135,1.739,141,1.144,146,1.924,149,1.103,158,1.531,164,1.194,186,2.678,187,0.953,189,1.042,196,2.188,202,1.341,209,1.11,210,1.569,215,1.703,224,1.175,231,1.54,270,2.895,275,1.049,276,1.049,277,1.023,297,1.409,299,1.569,318,2.483,321,1.064,322,2.157,323,1.784,347,1.983,352,2.117,355,1.338,358,2.07,365,1.007,368,1.027,369,1.63,374,1.118,377,2.387,378,1.877,379,1.212,380,1.261,381,4.365,384,1.33,385,1.289,386,1.874,387,1.888,388,2.848,389,2.517,390,2.517,391,2.517,392,2.517,393,2.807,394,2.571,395,2.041,396,2.37,397,1.185,398,2.181,399,1.959,400,2.133,401,2.117,402,1.185,403,2.112,404,2.117,405,1.185,406,2.004,407,2.335,408,2.37,409,2.843,410,2.133,411,1.194,412,2.395,413,1.203,414,2.37,415,2.335,416,2.301,418,2.328,420,2.596,421,1.176,422,1.185,423,1.777,424,1.159,425,1.713,426,1.942,427,1.185,428,1.23,429,1.176,430,1.185,431,2.133,432,2.133,433,1.185,434,1.11,435,2.344,438,2.086,442,2.173,445,1.194,446,1.194,447,1.194,448,1.194,449,1.185,450,0.947,451,1.02,452,1.194,453,1.751,454,1.185,455,1.194,456,1.194,457,1.194,458,1.194,459,1.194,460,1.791,465,1.185,466,1.194,467,1.23,468,1.203,469,1.194,470,1.194,471,1.194,472,1.203,473,1.203,474,1.203,475,1.23,476,1.194,477,1.194,478,1.203,479,1.203,486,2.405,487,2.263,490,1.071,492,1.739,493,1.159,494,1.102,495,1.168,496,1.142,613,3.078,654,3.8,661,2.696,706,1.24,707,1.485,708,2.227,709,1.221,710,2.672,711,1.498,712,1.498,713,2.247,714,1.716,717,1.498,718,1.498,719,1.24,720,2.375,721,1.498,723,1.512,756,4.64,965,2.469,1561,2.861,1578,5.798,1579,3.512,1716,4.77,1717,3.058,1718,4.133,1719,9.019,1720,3.058,1721,4.133,1722,4.133]],["t/384",[0,0.754,7,0.796,14,0.706,17,0.643,29,2.146,41,1.357,67,3.706,75,3.202,80,1.25,81,1.423,92,2.061,93,2.655,94,1.514,95,1.219,102,1.709,106,3.706,152,2.843,154,2.031,195,2.54,202,2.315,203,5.526,215,1.47,379,2.092,380,1.451,381,4.299,382,4.532,384,2.296,385,2.224,386,2.156,387,2.759,399,2.146,417,3.241,442,2.381,564,4.099,613,2.892,654,4.966,697,5.097,702,3.812,703,2.586,704,2.734,833,4.178,836,4.798,1038,7.695,1396,5.744,1561,4.939,1578,5.93,1579,7.695,1719,6.489,1723,7.291,1724,8.455,1725,9.951,1726,7.135]],["t/386",[0,1.2,1,1.016,3,0.838,6,3.424,7,0.809,14,0.928,17,0.666,44,2.332,67,4.87,80,1.321,90,4.169,94,1.222,95,1.266,105,1.041,116,3.599,117,1.764,146,1.638,149,0.838,197,5.619,202,3.042,231,2.808,261,2.01,288,3.748,289,3.197,300,4.728,302,1.836,323,2.304,343,4.599,344,2.528,399,2.418,501,4.178,504,3.633,597,3.129,604,2.993,606,4.258,610,2.732,613,2.407,617,5.801,647,3.509,654,4.908,692,3.858,702,3.592,742,5.386,763,4.178,807,4.107,808,5.386,833,5.49,836,6.305,913,6.49,975,4.935,1038,9.33,1049,6.069,1077,4.252,1138,4.935,1396,6.069,1555,6.855,1630,6.405,1683,4.814,1723,8.215,1724,7.966,1727,7.539,1728,6.855,1729,6.405]],["t/388",[7,0.63,9,1.611,30,2.845,80,1.611,154,3.005,155,5.873,205,3.267,252,3.058,277,1.528,326,4.528,399,2.18,502,5.097,654,4.855]],["t/390",[14,0.908,16,3.003,17,0.749,73,5.274,92,2.652,95,1.013,146,1.994,149,1.173,163,4.769,195,3.268,252,3.508,304,3.694,494,2.448,597,3.811,981,5.726,1730,5.862,1731,9.181]],["t/392",[17,0.653,92,3.05,93,3.096,95,1.166,244,2.502,337,4.177,349,7.309,350,7.101,365,2.24,981,7.114]],["t/394",[0,1.156,1,1.392,2,6.548,3,1.148,7,0.749,9,1.809,14,0.876,16,2.895,17,0.629,29,2.097,44,3.195,45,4.282,50,3.051,83,3.521,90,3.297,95,0.977,105,0.972,117,1.665,125,5.952,149,1.148,196,2.343,244,2.097,302,2.515,605,3.237,756,5.521,1525,7.126]],["t/396",[0,1.124,1,1.254,3,1.128,7,0.796,14,1.004,16,2.436,17,0.755,19,3.284,29,2.405,41,1.64,44,2.304,50,2.2,52,3.862,80,1.63,92,2.151,93,2.728,94,1.524,95,1.232,96,3.656,102,1.693,105,0.973,119,3.059,141,1.374,154,2.119,174,3.603,188,3.868,215,1.535,221,2.967,223,2.436,224,1.059,225,3.466,234,2.997,302,2.471,314,2.476,319,3.625,333,2.997,345,3.193,378,3.382,379,2.184,380,1.515,384,2.397,385,2.322,386,2.251,387,2.834,450,1.706,599,2.938,601,3.266,604,2.971,605,2.724,635,2.583,774,3.466,1285,3.929,1286,3.603,1732,5.321]],["t/398",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,450,1.996,601,3.819,604,3.267,605,3.185,635,3.021]],["t/400",[0,1.112,1,1.418,3,1.015,7,0.72,9,1.6,29,2.163,95,1.008,105,0.812,127,6.754,139,5.149,224,1.298,345,3.914,346,6.522,490,2.366,502,5.059,533,4.359,626,3.958,635,3.166,693,5.57,782,6.139]],["t/402",[0,0.503,1,0.927,7,0.553,14,0.681,17,0.338,25,1.315,37,2.232,41,1.326,44,1.472,64,1.86,80,0.834,81,1.372,94,0.62,95,0.891,102,1.704,104,3.025,105,0.718,106,4.195,110,1.242,124,1.783,135,1.888,141,0.878,146,2.191,149,1.148,158,1.175,186,2.756,187,1.098,189,1.2,196,2.342,205,1.472,209,1.278,215,1.665,224,1.258,270,2.979,275,1.208,276,1.208,277,1.111,307,1.773,318,2.585,319,3.017,321,1.225,322,2.309,323,1.909,347,2.153,352,2.298,355,1.484,358,2.068,365,1.159,368,1.183,369,1.808,374,1.287,377,2.555,380,0.968,388,2.979,389,2.695,390,2.695,391,2.695,392,2.695,393,2.861,394,2.689,395,1.887,396,2.536,397,1.365,398,2.368,399,1.914,400,2.316,401,2.298,402,1.365,403,2.261,404,2.298,405,1.365,406,2.087,407,2.499,408,2.536,409,2.96,410,2.316,411,1.375,412,2.538,413,1.385,414,2.536,415,2.499,416,2.463,418,2.467,420,2.594,421,1.354,422,1.365,423,1.972,424,1.335,425,1.901,426,2.309,427,1.365,428,1.417,429,1.354,430,1.365,431,2.316,432,2.316,433,1.365,434,1.847,435,2.484,438,2.481,442,1.808,445,1.375,446,1.375,447,1.375,448,1.375,449,1.365,450,1.091,451,1.175,452,1.375,453,1.943,454,1.365,455,1.375,456,1.375,457,1.375,458,1.375,459,1.375,460,1.987,465,1.365,466,1.375,467,1.417,468,1.385,469,1.375,470,1.375,471,1.375,472,1.385,473,1.385,474,1.385,475,1.417,476,1.375,477,1.375,478,1.385,479,1.385,486,2.575,487,2.399,488,1.637,490,1.234,492,1.929,493,1.335,494,1.269,495,1.345,496,1.315,665,1.637,706,1.428,709,1.406,719,1.428,737,1.725,1291,1.773,1292,1.773,1293,1.773,1294,1.757,1298,1.773,1299,2.562,1300,1.757,1301,1.773,1302,1.773,1305,1.773,1306,1.773,1307,1.757,1311,1.789,1672,2.472,1673,5.949,1677,2.904,1678,3.4,1694,3.039,1733,3.4,1734,3.662,1735,4.044,1736,4.76,1737,3.521,1738,3.662,1739,4.044]],["t/404",[0,0.744,1,0.829,3,0.683,7,0.665,13,1.109,14,0.696,17,0.349,25,1.357,27,1.921,37,2.271,41,1.345,64,1.328,79,1.418,80,1.077,81,1.536,94,0.64,95,1.048,96,2.969,102,1.705,105,0.863,106,5.134,109,1.522,110,1.281,117,1.787,120,2.717,123,3.778,124,1.273,130,1.232,135,1.921,141,0.906,146,2.064,149,1.178,158,1.736,164,1.418,183,1.374,186,2.772,187,1.132,189,1.237,196,2.376,209,1.318,215,1.694,224,1.276,231,1.14,261,0.816,270,2.996,275,1.246,276,1.246,277,1.13,297,1.674,307,1.14,318,2.606,319,2.944,321,1.264,322,2.343,323,1.937,347,2.191,352,2.339,355,1.518,358,2.098,359,2.129,365,1.196,368,1.22,369,1.849,374,1.328,377,2.592,380,0.999,388,3.007,389,2.733,390,2.733,391,2.733,392,2.733,393,2.872,394,2.714,395,2.255,396,2.573,397,1.408,398,2.41,399,1.948,400,2.356,401,2.339,402,1.408,403,2.294,404,2.339,405,1.408,406,2.104,407,2.535,408,2.573,409,2.985,410,2.356,411,1.418,412,2.569,413,1.429,414,2.573,415,2.535,416,2.499,417,2.23,418,2.497,420,2.785,421,1.397,422,1.408,423,2.016,424,1.377,425,1.944,426,2.145,427,1.408,428,1.461,429,1.397,430,1.408,431,2.356,432,2.356,433,1.408,434,1.318,435,2.515,438,2.305,442,2.359,445,1.418,446,1.418,447,1.418,448,1.418,449,1.408,450,1.125,451,1.212,452,1.418,453,1.987,454,1.408,455,1.418,456,1.418,457,1.418,458,1.418,459,1.418,460,2.032,465,1.408,466,1.418,467,1.461,468,1.429,469,1.418,470,1.418,471,1.418,472,1.429,473,1.429,474,1.429,475,1.461,476,1.418,477,1.418,478,1.429,479,1.429,486,2.612,487,2.428,490,1.273,492,1.972,493,1.377,494,1.309,495,1.387,496,1.357,533,1.462,597,1.271,612,1.696,626,1.327,706,1.473,707,1.763,708,2.526,709,1.45,710,2.952,711,1.779,712,1.779,713,2.549,715,1.829,717,1.779,718,1.779,719,1.473,720,1.881,721,1.779,723,1.795,818,1.829,858,1.867,865,1.358,961,1.758,1018,1.696,1216,1.867,1317,2.344,1518,2.058,1591,1.726,1606,1.909,1672,2.55,1673,6.845,1677,2.995,1678,3.507,1679,2.784,1680,2.601,1694,1.955,1740,2.784]],["t/406",[3,1.263,17,0.785,19,3.699,80,1.591,117,1.708,244,2.619,252,3.019,272,5.211,277,1.562,344,3.514,355,2.262,503,5.663]],["t/408",[1,1.482,3,0.842,4,4.724,7,0.644,9,1.327,13,2.745,14,0.749,17,0.822,27,1.771,41,1.135,67,3.934,73,4.351,77,3.079,79,2.716,85,4.489,92,3.282,94,1.333,95,0.836,102,1.056,104,3.207,105,0.673,117,1.425,135,1.771,139,4.272,141,1.397,143,5.827,146,2.323,163,4.884,164,2.187,176,2.821,183,4.22,200,3.995,202,2.457,216,4.351,221,3.017,223,2.477,224,1.337,277,1.042,284,3.934,289,3.988,299,2.874,302,1.844,304,3.784,307,3.809,328,3.664,333,3.048,337,3.44,344,2.539,357,5.827,370,5.093,379,2.757,393,1.896,406,1.531,417,4.27,451,1.87,599,2.987,615,3.766,621,6.435,622,4.958,628,4.059,670,4.171,684,4.484,758,6.717,772,5.827,773,4.958,788,5.603,827,6.435,828,5.242,859,4.272,963,5.603,981,6.378,984,6.097,1049,6.097,1057,7.235,1385,6.435,1425,6.887,1519,5.093,1534,3.766,1597,5.242,1627,6.097,1631,6.887,1666,6.887,1741,7.574,1742,7.574,1743,6.887,1744,7.574,1745,6.097,1746,7.574,1747,6.435]],["t/410",[3,0.977,17,0.73,80,1.54,92,3.309,93,3.015,135,2.055,146,2.234,149,0.977,159,4.309,163,5.839,181,5.048,205,3.181,245,5.753,248,7.467,249,4.497,292,6.762,304,4.139,321,2.262,379,3.015,670,3.898,766,7.467,828,7.119,887,7.991,1748,7.467,1749,5.753,1750,8.788,1751,8.788,1752,8.788,1753,8.788,1754,7.467]],["t/412",[1,1.362,3,0.584,7,0.774,11,2.814,13,3.091,17,0.718,28,2.8,29,2.511,31,4.873,32,4.47,41,1.682,57,2.329,80,0.92,81,1.472,85,2.507,92,2.131,93,2.712,94,1.508,95,1.298,96,3.978,102,1.711,104,2.558,105,0.97,106,2.728,124,1.361,133,3.198,149,0.584,152,2.092,154,2.954,163,3.832,183,3.311,196,1.39,199,6.268,202,1.704,224,1.049,226,2.251,240,4.775,265,4.04,277,1.015,304,2.969,318,1.314,344,2.473,366,3.635,379,1.54,380,1.068,384,2.374,385,1.637,386,2.577,387,3.078,406,1.061,503,3.275,533,2.507,613,3.522,684,2.303,702,2.826,703,2.674,704,3.267,763,2.91,773,3.438,778,4.019,779,3.891,828,5.106,961,3.017,1534,2.611,1653,3.885,1672,2.728,1710,4.775,1743,9.438,1755,8.411,1756,8.586,1757,6.268,1758,7.246,1759,6.709,1760,7.246,1761,4.775,1762,5.251,1763,4.775,1764,5.251,1765,4.462,1766,5.251,1767,5.251,1768,5.251,1769,4.04,1770,4.462]],["t/414",[1,1.331,7,0.791,17,0.781,41,1.23,81,1.969,85,4.714,92,2.369,93,2.895,94,1.489,95,1.241,102,1.677,104,2.961,105,0.942,106,5.128,131,6.604,149,0.912,154,2.81,163,5.128,183,3.681,205,2.538,224,1.166,379,2.405,380,1.669,385,2.557,417,3.726,613,3.509,636,4.712,828,5.678,859,4.627,1672,5.502,1756,8.389,1757,8.389,1771,7.46]],["t/416",[0,0.917,1,1.264,3,0.602,7,0.782,13,1.964,17,0.616,27,1.763,29,2.222,31,4.758,32,4.647,38,4.362,41,1.569,49,4.927,80,1.321,81,1.081,85,2.587,92,1.565,93,2.211,94,1.513,95,1.296,96,4.054,102,1.712,105,0.976,106,2.814,119,2.226,133,4.066,138,3.644,141,1,152,2.159,154,2.904,183,3.892,195,3.338,203,3.306,205,2.683,215,1.117,223,1.772,224,1.233,227,3.38,314,1.802,379,1.589,380,1.102,384,1.744,385,1.689,386,2.621,387,3.108,486,1.577,501,3.003,604,1.73,610,1.964,613,3.409,636,3.113,654,3.987,678,3.547,702,2.889,703,2.733,704,3.323,778,4.108,779,3.978,787,7.967,900,3.173,913,3.751,1006,4.169,1052,3.003,1634,4.009,1755,7.887,1756,6.407,1757,4.604,1759,7.887,1760,6.407,1761,8.964,1763,4.927,1770,4.604,1772,5.419,1773,4.362,1774,5.419,1775,5.419,1776,5.419,1777,5.419]],["t/418",[0,0.929,1,1.564,3,0.853,7,0.82,9,1.539,11,2.976,12,3.132,17,0.798,26,4.718,27,1.793,29,2.584,41,1.491,45,2.686,75,3.442,83,1.893,85,4.525,92,2.538,93,2.916,94,1.512,95,1.203,96,3.833,102,1.691,104,3.084,105,0.991,119,2.281,133,2.407,146,2.059,149,1.143,150,2.031,152,2.212,163,3.984,179,3.546,181,3.19,195,2.731,199,4.718,202,1.802,205,2.718,213,3.925,215,1.144,216,3.19,224,1.569,226,3.289,232,3.635,233,3.967,234,2.235,261,1.48,277,0.764,288,3.813,299,2.107,300,2.8,304,3.536,318,2.372,322,1.449,328,3.711,371,4.326,379,2.249,380,1.129,384,1.787,385,1.731,386,1.678,387,1.691,399,1.316,417,2.522,451,1.894,551,2.617,597,2.305,610,2.78,615,3.813,626,2.407,660,3.463,665,1.909,684,2.435,692,2.841,724,2.929,755,4.272,783,5.021,828,6.082,870,5.674,981,4.784,984,6.175,1224,3.843,1287,6.082,1553,6.517,1574,4.897,1597,7.118,1651,3.843,1745,4.47,1758,8.052,1760,7.465,1769,4.272,1770,8.738,1771,5.049,1778,7.67,1779,7.67,1780,4.718,1781,4.718,1782,5.553,1783,4.784,1784,5.553,1785,5.553,1786,5.553,1787,6.975,1788,5.049,1789,7.67,1790,5.049,1791,8.787,1792,5.553,1793,5.553,1794,4.718,1795,5.553]],["t/420",[1,1.531,3,1.122,4,5.311,9,1.492,12,4.803,13,3.086,17,0.764,67,4.423,73,5.799,79,2.459,94,1.403,95,1.114,105,0.757,117,1.602,146,2.193,150,3.692,152,3.392,160,5.325,197,4.357,223,3.302,226,4.328,242,6.855,243,5.437,289,3.611,304,4.33,328,4.12,340,5.894,451,2.102,597,3.535,605,3.114,629,4.986,684,4.427,882,7.212,987,6.855,1534,4.234,1769,8.28,1796,8.515,1797,8.515,1798,10.096]],["t/422",[1,1.114,3,0.918,4,5.797,7,0.708,9,1.085,14,0.817,17,0.66,27,1.931,31,4.428,32,2.571,41,1.238,45,2.997,55,4.903,64,1.675,79,1.789,92,3.182,93,2.725,94,1.436,95,1.231,102,1.697,104,3.408,105,0.918,117,1.165,119,3.393,124,2.57,125,4.165,141,1.143,146,2.244,148,4.582,150,2.265,158,1.529,163,4.291,183,3.707,187,1.429,189,1.561,209,1.663,215,1.702,224,0.881,275,1.572,276,1.572,288,3.08,318,1.55,319,2.817,321,1.594,322,1.617,358,1.931,368,1.54,369,2.171,374,1.675,393,2.585,406,1.252,412,2.234,416,2.587,418,2.443,420,2.907,426,2.156,434,1.663,435,2.46,438,2.78,442,2.171,451,1.529,487,1.583,488,2.13,490,1.605,492,2.317,493,1.737,494,1.652,495,1.75,496,1.712,606,2.813,610,2.245,654,2.848,684,4.075,706,1.858,709,1.83,719,1.858,737,2.245,753,3.627,773,4.055,779,3.267,801,6.65,814,8.452,819,4.288,820,5.633,821,5.263,822,5.263,823,5.633,825,4.987,826,7.019,828,6.433,829,5.633,924,4.425,1291,2.307,1292,2.307,1293,2.307,1294,2.286,1298,2.307,1299,3.077,1300,2.286,1301,2.307,1302,2.307,1305,2.307,1306,2.307,1307,2.286,1311,2.329,1504,5.633,1754,5.263,1799,6.194,1800,8.261,1801,6.194,1802,9.295,1803,6.194,1804,4.987,1805,6.194,1806,6.194,1807,4.766,1808,6.194,1809,6.194,1810,6.194,1811,4.987,1812,6.194]],["t/424",[3,1.054,4,6.418,14,0.938,17,0.834,67,3.989,92,2.739,93,3.017,95,0.848,104,3.086,111,9.131,116,3.667,117,1.445,128,4.331,130,3.09,146,2.334,149,1.054,163,5.734,179,6.056,181,4.412,196,2.033,202,2.492,204,5.316,206,5.909,226,3.293,236,4.904,238,5.316,299,2.914,321,1.977,323,2.047,357,5.909,358,1.795,403,2.424,406,1.552,497,6.209,520,5.681,562,3.93,584,5.681,629,4.497,772,5.909,788,5.681,802,5.786,826,6.525,827,8.058,828,7.642,849,5.486,859,5.349,861,9.772,1014,5.164,1032,7.351,1324,5.909,1430,5.486,1432,8.624,1534,5.116,1651,5.316,1813,7.68,1814,7.68,1815,9.484,1816,9.484,1817,7.68,1818,9.484,1819,9.484,1820,5.681,1821,7.68,1822,9.484,1823,9.484,1824,7.68,1825,6.525,1826,6.984,1827,7.68,1828,5.316]],["t/426",[1,1.228,3,1.013,80,1.597,95,1.159,164,2.632,244,2.489,252,3.03,277,1.522,337,4.77,363,6.707,364,6.707,365,2.219,502,5.05,981,6.903,1829,8.287]],["t/428",[3,0.93,7,0.732,9,1.751,14,0.989,16,2.738,17,0.786,27,1.957,30,3.091,41,1.255,55,4.415,57,4.433,81,1.67,83,2.854,94,1.091,95,0.924,105,0.888,115,5.629,149,1.188,150,3.654,244,1.984,261,2.664,302,2.038,317,4.803,323,1.806,442,2.627,533,5.399,615,4.969,647,3.896,905,7.112,1003,6.192,1111,5.221,1650,7.612,1656,7.441,1698,6.739,1830,9.087,1831,8.371,1832,6.739,1833,7.612,1834,7.612,1835,7.112,1836,7.112]],["t/430",[0,1.047,3,1,7,0.79,9,1.735,10,3.614,13,2.56,14,0.699,16,2.31,17,0.765,19,3.495,27,1.651,28,3.758,30,2.185,41,1.349,50,2.087,80,1.577,83,2.408,92,2.04,93,2.638,94,1.491,95,1.151,96,3.406,102,1.699,105,0.927,115,4.75,119,2.902,135,1.651,154,2.561,174,3.417,188,3.669,205,2.185,211,3.848,215,1.456,223,2.31,224,1.408,225,3.884,226,3.029,244,2.133,261,1.883,272,4.475,277,1.238,285,3.614,302,1.72,317,2.902,319,3.672,320,5.488,344,3.321,355,1.942,379,2.071,380,1.437,384,2.273,385,2.202,386,2.135,387,2.741,388,2.087,533,3.373,629,4.136,702,2.706,703,2.56,704,2.706,774,3.288,791,3.848,996,6.002,1018,3.914,1286,3.417,1456,5.046,1732,5.046,1837,7.968,1838,8.287]],["t/432",[7,0.725,9,1.617,28,4.016,94,1.203,215,1.903,320,5.865,344,3.095,533,4.408,791,5.03,1732,6.595,1837,7.829,1838,8.143]],["t/434",[7,0.638,9,1.633,10,4.769,83,3.178,102,1.299,154,3.028,205,2.883,224,1.325,225,3.471,244,2.208,277,1.282]],["t/436",[0,1.122,50,2.743,102,1.294,105,0.944,224,1.32,225,3.458,226,3.981,244,2.2,261,2.475,277,1.277,285,4.751,629,5.436]],["t/438",[3,1.052,19,3.339,272,4.705,355,2.042]],["t/440",[0,0.991,1,1.264,7,0.778,9,1.321,14,1.01,16,2.466,17,0.78,27,2.496,28,3.558,30,3.303,51,3.553,80,1.321,90,2.808,94,0.983,96,3.509,116,3.599,117,1.418,133,3.268,149,1.187,152,3.003,176,2.808,195,2.684,205,2.332,211,5.108,213,3.858,215,1.932,216,4.331,224,1.072,226,3.232,231,2.808,261,2.721,284,3.916,293,5.108,315,5.069,317,4.833,319,2.57,320,5.196,326,4.02,344,2.528,358,1.762,487,1.927,494,2.721,506,4.599,562,3.858,599,2.974,603,3.698,606,3.424,610,2.732,661,2.732,1076,6.069,1104,5.218,1138,4.935,1509,9.28,1561,5.218,1656,5.069,1661,4.331,1686,8.215,1837,8.615,1838,8.613,1839,7.966,1840,9.709,1841,8.526,1842,7.966,1843,3.858,1844,5.218]],["t/442",[0,0.762,1,0.972,7,0.792,14,0.713,17,0.647,41,1.498,44,2.23,90,3.395,92,2.082,93,2.673,94,1.537,95,1.284,96,3.438,102,1.708,133,3.125,146,1.98,187,1.663,205,2.23,211,3.927,215,1.486,261,1.922,304,3.668,314,2.397,317,4.617,319,3.695,322,1.881,379,2.113,380,1.466,384,2.32,385,2.247,386,2.755,387,3.045,665,2.479,702,2.762,703,2.612,704,2.762,854,3.994,985,6.555,1657,5.803,1837,6.744,1838,7.014,1845,10.065,1846,9.116]],["t/444",[0,0.306,1,0.797,7,0.654,14,0.673,17,0.42,25,1.296,27,1.383,37,2.213,41,1.317,64,1.599,79,0.835,80,0.821,81,1.357,94,0.771,95,1.053,96,3.402,102,1.706,104,2.635,105,0.848,108,3.382,110,1.224,117,1.407,120,2.639,124,1.533,133,4.289,135,1.872,141,1.091,146,2.149,149,1.143,158,1.46,164,0.835,186,2.748,187,1.081,189,1.182,196,2.326,209,1.588,215,1.65,224,1.249,270,2.97,275,1.19,276,1.19,277,1.101,293,1.575,297,0.986,307,1.746,317,4.176,318,2.574,321,1.207,322,2.293,323,1.896,326,4.565,347,2.135,352,2.279,355,1.468,358,2.123,365,1.142,368,1.165,369,1.788,374,1.268,377,2.537,380,0.954,388,2.965,389,2.676,390,2.676,391,2.676,392,2.676,393,2.856,394,2.676,395,2.052,396,2.519,397,1.344,398,2.348,399,1.898,400,2.296,401,2.279,402,1.344,403,2.245,404,2.279,405,1.344,406,2.078,407,2.482,408,2.519,409,2.948,410,2.296,411,1.354,412,2.523,413,1.364,414,2.519,415,2.482,416,2.446,418,2.452,420,2.662,421,1.334,422,1.344,423,1.95,424,1.315,425,1.88,426,2.201,427,1.344,428,1.395,429,1.334,430,1.344,431,2.296,432,2.296,433,1.344,434,1.588,435,2.47,438,2.365,442,2.105,445,1.354,446,1.354,447,1.354,448,1.354,449,1.344,450,1.074,451,1.157,452,1.354,453,1.922,454,1.344,455,1.354,456,1.354,457,1.354,458,1.354,459,1.354,460,1.965,465,1.344,466,1.354,467,1.395,468,1.364,469,1.354,470,1.354,471,1.354,472,1.364,473,1.364,474,1.364,475,1.395,476,1.354,477,1.354,478,1.364,479,1.364,486,2.556,487,2.384,488,1.612,490,1.215,492,1.908,493,1.315,494,1.25,495,1.324,496,1.296,613,0.923,661,3.057,706,1.406,707,1.038,708,1.684,709,1.385,710,2.124,711,1.048,712,1.048,713,1.699,714,1.946,717,1.048,718,1.048,719,1.774,720,1.796,721,1.048,723,1.057,737,1.048,747,1.437,858,1.763,900,1.693,1291,1.077,1292,1.077,1293,1.077,1294,1.067,1295,1.437,1298,1.077,1299,1.746,1300,1.067,1301,1.077,1302,1.746,1305,1.077,1306,1.077,1307,1.067,1311,1.087,1686,7.487,1843,4.316,1845,8.848,1847,2.891,1848,8.848,1849,3.776,1850,4.688,1851,4.263,1852,2.001,1853,5.914,1854,5.914,1855,1.846,1856,2.891,1857,2.891,1858,4.688,1859,4.688,1860,2.001,1861,2.891]],["t/446",[1,0.825,7,0.758,14,0.605,17,0.435,25,1.123,28,3.335,37,2.034,41,1.228,64,1.655,81,1.221,90,1.513,94,0.529,95,1.02,96,3.393,102,1.702,104,2.959,105,0.821,110,1.06,124,1.586,133,4.459,135,1.721,141,1.129,146,2.143,149,1.097,158,1.003,186,2.668,187,0.937,189,1.024,196,2.169,209,1.643,214,3.451,215,1.517,224,1.25,270,2.884,275,1.031,276,1.031,277,1.012,317,4.349,318,2.469,319,2.51,320,4.871,321,1.045,322,2.139,323,1.897,326,3.769,347,1.963,352,2.095,355,1.32,358,1.915,365,0.989,368,1.01,369,1.608,374,1.099,377,2.366,380,0.826,388,2.832,389,2.495,390,2.495,391,2.495,392,2.495,393,2.8,394,2.556,395,1.679,396,2.349,397,1.165,398,2.158,399,1.744,400,2.11,401,2.095,402,1.165,403,2.094,404,2.095,405,1.165,406,1.994,407,2.315,408,2.349,409,2.828,410,2.11,411,1.173,412,2.377,413,1.182,414,2.349,415,2.315,416,2.281,418,2.31,420,2.402,421,1.156,422,1.165,423,1.754,424,1.139,425,1.691,426,2.139,427,1.165,428,1.209,429,1.156,430,1.165,431,2.11,432,2.11,433,1.165,434,1.643,435,2.327,438,2.298,442,1.608,445,1.173,446,1.173,447,1.173,448,1.173,449,1.165,450,0.931,451,1.003,452,1.173,453,1.729,454,1.165,455,1.173,456,1.173,457,1.173,458,1.173,459,1.173,460,1.767,465,1.165,466,1.173,467,1.209,468,1.182,469,1.173,470,1.173,471,1.173,472,1.182,473,1.182,474,1.182,475,1.209,476,1.173,477,1.173,478,1.182,479,1.182,486,2.384,487,2.246,488,2.104,490,1.053,492,1.716,493,1.139,494,1.083,495,1.147,496,1.123,613,1.297,706,1.218,709,1.2,715,2.427,719,1.835,737,1.472,1052,2.251,1077,2.291,1291,1.513,1292,1.513,1293,1.513,1294,1.499,1298,1.513,1299,2.279,1300,1.499,1301,1.513,1302,2.279,1305,1.513,1306,1.513,1307,1.499,1311,1.527,1599,2.812,1603,2.812,1686,7.914,1694,2.594,1734,3.125,1738,3.125,1788,3.694,1837,8.128,1838,7.914,1839,3.451,1840,9.354,1848,8.4,1851,5.564,1862,4.062,1863,9.238,1864,9.736,1865,9.238,1866,6.119,1867,6.119,1868,5.564,1869,7.362,1870,4.062,1871,4.062,1872,4.062,1873,6.119]],["t/448",[7,0.637,14,0.67,17,0.566,25,1.287,27,1.865,37,2.204,41,1.313,64,1.259,79,1.345,81,1.35,94,0.607,95,1.027,102,1.703,105,0.827,108,3.615,110,1.215,117,1.75,120,3.283,124,1.207,135,1.865,141,0.859,146,2.021,149,1.141,158,1.671,164,1.345,186,2.744,187,1.074,189,1.174,196,2.318,209,1.25,215,1.644,224,1.323,270,2.966,275,1.182,276,1.182,277,1.097,284,2.419,297,1.588,318,2.569,319,3.31,321,1.198,322,2.286,323,1.89,347,2.127,352,2.27,355,1.461,358,2.047,365,1.134,368,1.157,369,1.779,374,1.259,377,2.529,380,0.947,388,2.959,389,2.667,390,2.667,391,2.667,392,2.667,393,2.853,394,2.671,395,2.189,396,2.511,397,1.335,398,2.339,399,1.89,400,2.287,401,2.27,402,1.335,403,2.238,404,2.27,405,1.335,406,2.074,407,2.474,408,2.511,409,2.942,410,2.287,411,1.345,412,2.516,413,1.355,414,2.511,415,2.474,416,2.438,418,2.445,420,2.728,421,1.325,422,1.335,423,1.941,424,1.306,425,1.871,426,2.082,427,1.335,428,1.386,429,1.325,430,1.335,431,2.287,432,2.287,433,1.335,434,1.25,435,2.463,438,2.237,442,2.302,445,1.345,446,1.345,447,1.345,448,1.345,449,1.335,450,1.067,451,1.15,452,1.345,453,1.912,454,1.335,455,1.345,456,1.345,457,1.345,458,1.345,459,1.345,460,1.955,465,1.335,466,1.345,467,1.386,468,1.355,469,1.345,470,1.345,471,1.345,472,1.355,473,1.355,474,1.355,475,1.386,476,1.345,477,1.345,478,1.355,479,1.355,486,2.548,487,2.378,490,1.207,492,1.898,493,1.306,494,1.241,495,1.315,496,1.287,506,4.13,562,3.464,706,1.397,707,1.672,708,2.432,709,1.375,710,2.865,711,1.687,712,1.687,713,2.453,714,1.933,717,1.687,718,1.687,719,1.397,720,2.594,721,1.687,723,1.703,763,2.58,1285,2.456,1694,2.973,1747,3.956,1837,7.181,1864,9.333,1868,4.234,1874,4.656,1875,3.956]],["t/450",[0,1.166,3,1.161,17,0.805,19,3.186,30,3.232,80,1.582,105,1.008,117,1.699,244,2.476,252,3.002,277,1.516,317,3.709,504,3.215,665,3.105,1534,4.489,1876,8.211]],["t/452",[3,0.953,7,0.764,9,1.502,11,4.595,14,1.003,16,2.805,17,0.609,27,2.37,29,2.697,30,2.652,45,4.904,59,5.348,74,4.751,77,3.486,81,1.71,83,2.923,90,3.193,105,0.762,135,2.37,149,1.2,187,1.978,289,3.636,290,5.187,299,3.254,302,2.088,307,3.193,324,4.671,328,5.221,354,4.925,382,3.597,406,2.049,603,3.382,613,2.737,684,3.76,835,5.04,1516,7.797,1655,6.597,1682,6.343,1877,6.597,1878,7.285]],["t/454",[0,1.117,1,1.191,3,0.982,6,2.548,7,0.803,9,1.353,14,0.874,16,1.835,17,0.776,19,2.726,20,3.508,29,2.646,30,2.389,31,3.312,32,2.329,41,1.584,44,2.733,50,1.657,52,3.206,80,1.353,92,1.62,93,2.265,94,1.495,95,1.286,102,1.7,105,1.008,118,4.012,119,3.173,130,2.257,133,2.432,141,1.035,149,0.624,154,1.596,174,2.714,188,2.914,200,2.959,215,1.156,221,2.235,223,1.835,224,1.256,225,3.545,226,2.405,234,2.257,244,1.83,277,1.062,279,5.202,300,2.829,302,2.431,314,1.865,317,3.629,318,1.404,323,1.211,324,3.056,333,2.257,344,1.881,345,2.405,354,3.222,378,2.548,379,1.645,380,1.141,382,4.724,383,4.743,384,1.805,385,1.749,386,2.334,387,2.69,450,1.285,597,2.329,599,2.213,601,2.46,603,4.473,604,2.466,605,2.051,613,3.565,635,1.946,665,1.929,670,2.488,703,2.799,704,2.149,736,4.66,774,2.611,812,2.87,813,4.316,833,4.523,1050,4.007,1285,2.959,1286,2.714,1314,5.936,1315,4.818,1319,3.582,1692,6.077,1693,5.194,1716,5.943,1879,5.641,1880,9.518,1881,7.024,1882,5.61,1883,4.516]],["t/456",[0,0.981,9,1.627,17,0.659,20,4.217,29,2.2,31,3.981,32,3.854,102,1.294,224,1.32,225,3.458,244,2.2,277,1.277,318,2.324,703,3.365]],["t/458",[7,0.636,17,0.754,30,2.872,102,1.294,105,0.825,224,1.32,225,3.458,226,3.981,244,2.2,277,1.277,317,4.361,1050,6.633]],["t/460",[0,1.202,1,1.364,3,0.95,7,0.79,14,1.001,17,0.718,41,1.615,44,2.643,50,2.524,52,4.199,94,1.452,95,1.19,105,1.011,118,5.254,141,1.577,149,0.95,154,2.432,221,3.404,234,3.438,302,2.624,314,2.841,323,1.844,333,3.438,450,1.958,597,3.547,601,3.747,604,3.23,605,3.125,635,2.963,665,2.938,833,5.924]],["t/462",[0,0.325,1,0.414,3,0.342,7,0.652,11,1.648,14,0.764,17,0.438,25,1.362,27,2.022,29,1.461,34,2.196,37,2.276,41,1.347,51,1.449,64,1.333,79,1.423,81,1.406,94,0.642,95,1.073,102,1.705,104,0.922,105,0.846,110,1.286,117,1.744,120,3.357,124,1.277,135,1.925,141,0.909,146,2.066,149,1.158,152,1.225,158,1.741,164,1.423,186,2.774,187,1.136,189,1.242,196,2.38,205,0.951,209,1.323,215,1.783,224,1.318,259,2.128,270,2.998,275,1.25,276,1.25,277,1.133,293,2.684,297,1.68,318,2.609,321,1.268,322,2.346,323,1.94,347,2.196,352,2.343,354,1.766,355,1.522,358,2.168,365,1.2,368,1.225,369,1.854,374,1.333,377,2.596,380,1.002,382,2.067,388,3.01,389,2.738,390,2.738,391,2.738,392,2.738,393,2.874,394,2.717,395,2.259,396,2.577,397,1.413,398,2.414,399,2.05,400,2.361,401,2.343,402,1.413,403,2.297,404,2.343,405,1.413,406,2.106,407,2.539,408,2.577,409,2.988,410,2.361,411,1.423,412,2.573,413,1.434,414,2.577,415,2.539,416,2.502,418,2.5,420,2.789,421,1.402,422,1.413,423,2.022,424,1.382,425,1.949,426,2.149,427,1.413,428,1.466,429,1.402,430,1.413,431,2.361,432,2.361,433,1.413,434,1.323,435,2.518,438,2.309,442,2.363,445,1.423,446,1.423,447,1.423,448,1.423,449,1.413,450,1.129,451,1.216,452,1.423,453,1.992,454,1.413,455,1.423,456,1.423,457,1.423,458,1.423,459,1.423,460,2.037,465,1.413,466,1.423,467,1.466,468,1.434,469,1.423,470,1.423,471,1.423,472,1.434,473,1.434,474,1.434,475,1.466,476,1.423,477,1.423,478,1.434,479,1.434,486,2.616,487,2.431,490,1.277,492,1.977,493,1.382,494,1.314,495,1.392,496,1.362,562,1.573,603,1.943,613,1.573,678,2.013,706,1.478,707,1.77,708,2.533,709,1.455,710,2.958,711,1.786,712,1.786,713,2.555,717,1.786,718,1.786,719,1.478,720,2.956,721,1.786,723,1.802,729,2.366,736,5.22,900,1.8,1285,1.622,1312,3.146,1314,3.073,1315,5.136,1316,2.067,1534,1.529,1692,3.146,1693,5.537,1696,2.196,1879,6.319,1884,3.074,1885,3.966,1886,3.074,1887,3.074,1888,2.274,1889,2.796]],["t/464",[7,0.769,17,0.509,29,2.152,41,1.621,92,2.07,93,2.663,94,1.495,95,1.283,102,1.711,105,0.932,205,2.217,324,3.904,343,4.372,379,2.101,380,1.458,382,4.766,383,4.96,384,2.306,385,2.234,386,2.745,387,3.037,406,1.448,603,4.135,604,2.288,613,3.528,703,2.597,704,3.82,778,3.904,779,3.78,833,4.196,865,3.179,994,4.692,1593,6.517,1765,6.089,1879,5.799,1888,7.376]],["t/466",[7,0.654,14,0.702,17,0.353,25,1.374,27,1.935,29,1.682,33,2.503,37,2.287,41,1.353,64,1.345,79,1.436,81,1.416,94,0.648,95,1.054,102,1.706,105,0.849,110,1.298,117,1.751,120,2.739,123,3.567,124,1.289,135,1.935,141,0.917,146,2.074,149,1.161,158,1.752,164,1.436,186,2.779,187,1.147,189,1.253,196,2.39,209,1.335,215,1.706,224,1.323,259,2.152,270,3.003,275,1.262,276,1.262,277,1.138,279,3.579,293,1.694,297,1.695,318,2.615,321,1.28,322,2.356,323,1.948,328,2.405,347,2.207,352,2.355,354,2.856,355,1.532,358,2.11,365,1.211,368,1.236,369,1.866,374,1.345,377,2.607,380,1.011,382,2.086,388,3.018,389,2.749,390,2.749,391,2.749,392,2.749,393,2.877,394,2.724,395,2.271,396,2.588,397,1.425,398,2.426,399,1.961,400,2.373,401,2.355,402,1.425,403,2.307,404,2.355,405,1.425,406,2.111,407,2.55,408,2.588,409,2.995,410,2.373,411,1.436,412,2.582,413,1.447,414,2.588,415,2.55,416,2.513,418,2.509,420,2.799,421,1.415,422,1.425,423,2.035,424,1.394,425,1.961,426,2.16,427,1.425,428,1.48,429,1.415,430,1.425,431,2.373,432,2.373,433,1.425,434,1.335,435,2.527,438,2.321,442,2.373,445,1.436,446,1.436,447,1.436,448,1.436,449,1.425,450,1.139,451,1.227,452,1.436,453,2.005,454,1.425,455,1.436,456,1.436,457,1.436,458,1.436,459,1.436,460,2.05,465,1.425,466,1.436,467,1.48,468,1.447,469,1.436,470,1.436,471,1.436,472,1.447,473,1.447,474,1.447,475,1.48,476,1.436,477,1.436,478,1.447,479,1.447,486,2.627,487,2.44,490,1.289,492,1.99,493,1.394,494,1.326,495,1.404,496,1.374,562,1.591,613,1.587,706,1.491,707,1.786,708,2.549,709,1.469,710,2.973,711,1.802,712,1.802,713,2.572,717,1.802,718,1.802,719,1.491,720,1.905,721,1.802,723,1.818,736,5.236,1312,3.175,1314,1.939,1315,5.162,1316,2.091,1317,2.374,1692,3.175,1693,5.565,1696,2.221,1881,4.521,1888,7.343,1890,4.521,1891,3.109,1892,3.109]],["t/468",[7,0.617,9,1.93,17,0.819,80,1.579,117,1.696,154,2.97,205,2.788,223,2.948,244,2.611,252,2.997,277,1.559,323,1.945,451,2.577,613,2.877,648,5.083,839,7.658,1655,6.935]],["t/470",[0,0.946,3,0.995,9,1.568,14,1.087,16,2.927,17,0.803,20,4.064,21,6.392,22,6.017,30,3.215,41,1.341,149,0.995,261,2.386,283,6.017,302,2.179,317,4.269,562,4.578,597,3.714,865,3.969,969,6.193,1773,7.203,1893,8.136,1894,8.948,1895,8.948,1896,6.884,1897,8.136,1898,7.203]],["t/472",[3,1.192,5,4.384,7,0.769,9,1.337,10,3.905,14,1.138,15,6.144,16,2.496,17,0.729,22,7.21,28,3.585,30,2.361,41,1.416,81,2.047,94,0.995,95,1.216,105,1.031,117,2.073,138,5.132,139,4.305,195,2.717,211,5.147,215,1.573,224,1.085,250,6.26,277,1.299,280,6.485,285,3.905,289,4.352,290,5.487,302,2.611,344,3.44,367,5.132,535,6.353,562,4.834,594,7.591,596,6.4,597,3.168,628,4.09,635,2.647,689,6.485,692,3.905,791,4.158,917,7.66,1152,6.718,1508,5.872,1527,4.873,1617,4.469,1749,4.997,1773,7.606,1899,7.632,1900,7.632,1901,7.632,1902,6.94,1903,8.632,1904,9.448,1905,7.269,1906,6.94]],["t/474",[7,0.594,14,1.009,16,2.834,17,0.77,41,1.625,81,1.728,94,1.33,95,1.126,105,0.907,147,4.249,149,1.134,150,3.169,187,1.999,191,5.826,211,4.721,223,3.336,226,3.715,250,5.286,283,6.859,289,3.675,290,5.219,302,2.484,310,4.644,311,4.308,343,5.286,394,2.31,406,1.751,560,6.667,596,5.404,610,3.14,635,3.005,799,7.879,917,6.19,1574,6.922,1903,6.975,1906,7.879,1907,6.975]],["t/476",[3,0.728,7,0.815,11,3.509,14,0.945,17,0.609,22,4.403,28,3.252,29,2.772,31,4.714,32,4.902,41,0.981,73,3.762,74,3.629,81,1.306,94,0.854,95,0.946,96,3.617,102,0.913,104,2.57,105,0.849,110,1.709,131,5.271,138,4.403,146,1.422,147,5.53,149,1.062,150,2.395,154,1.863,160,3.454,192,5.038,211,3.567,227,4.084,252,2.177,255,5.563,261,2.702,272,4.261,277,0.901,289,3.634,290,5.185,302,2.468,304,3.448,307,2.439,311,5.229,312,4.146,317,4.32,319,3.455,320,3.629,322,1.709,323,1.413,344,2.873,383,5.285,394,2.804,406,1.732,501,3.629,560,6.594,597,2.718,603,3.997,606,3.892,610,3.106,613,2.736,660,5.345,670,2.904,768,5.61,773,4.287,774,3.048,819,4.532,858,3.995,979,5.271,1019,5.954,1216,3.995,1456,4.678,1458,5.954,1472,5.563,1506,5.563,1554,6.594,1574,4.181,1618,5.038,1636,5.563,1649,5.954,1665,4.678,1773,5.271,1878,5.563,1896,5.038,1908,5.954,1909,6.548,1910,6.548,1911,7.067,1912,5.954,1913,6.548,1914,6.548,1915,5.954,1916,6.548,1917,8.57,1918,5.954,1919,7.69,1920,5.271]],["t/478",[3,0.836,5,3.099,6,2.45,7,0.824,13,1.955,14,0.534,17,0.665,20,2.45,23,5.784,28,3.552,29,2.816,31,4.796,32,4.967,41,0.809,74,4.166,80,0.945,81,1.076,92,1.558,93,1.582,94,1.495,95,0.595,96,3.773,102,1.206,104,2.255,105,0.986,146,1.172,147,3.687,149,0.962,150,2.749,152,2.149,163,2.802,182,6.388,183,2.421,203,5.279,205,2.677,210,2.853,211,2.939,223,3.421,224,0.767,226,3.223,261,2.844,272,2.682,283,3.628,289,3.188,290,4.789,302,1.831,304,3.766,307,2.8,311,5.604,312,4.528,319,3.637,320,4.166,327,4.584,343,4.586,344,1.809,355,1.164,383,5.359,394,1.438,497,3.532,560,5.784,597,3.121,599,2.128,603,4.374,606,4.251,608,3.445,613,2.988,628,2.891,631,3.991,636,3.099,647,2.511,756,4.689,768,4.922,775,3.628,783,3.532,791,4.096,818,3.223,865,3.335,866,3.991,913,3.734,1456,3.854,1648,4.151,1685,4.906,1686,4.151,1749,4.922,1911,5.562,1915,4.906,1918,4.906,1919,8.205,1920,6.052,1921,5.395,1922,7.518,1923,7.518,1924,5.395,1925,4.906,1926,7.281,1927,9.51,1928,7.518,1929,4.906,1930,5.395,1931,5.395,1932,7.518]],["t/480",[0,0.641,3,1.093,7,0.797,9,1.063,14,0.6,17,0.698,20,2.754,21,4.333,22,4.078,28,3.091,29,2.768,30,1.876,31,4.854,32,4.89,41,1.761,92,1.752,93,1.778,94,1.504,95,1.239,96,3.82,104,2.443,105,0.539,116,2.896,146,1.317,147,2.974,149,1.022,152,2.416,163,3.15,182,6.92,183,2.722,203,4.969,210,2.302,211,4.437,223,2.664,234,2.441,261,2.734,272,3.015,283,4.078,289,2.572,290,4.706,302,1.983,304,3.278,307,2.259,311,5.364,312,3.94,318,1.518,319,3.6,320,3.361,323,1.309,355,1.309,383,5.322,394,1.617,497,3.97,560,4.666,597,2.518,603,4.165,606,3.699,610,2.198,613,3.139,626,3.531,628,3.25,632,4.882,636,3.484,647,2.823,670,2.69,768,3.97,776,6.557,818,3.623,819,4.198,843,3.97,854,3.361,977,3.783,1030,5.153,1077,3.421,1385,5.153,1456,4.333,1534,3.015,1653,4.487,1879,5.201,1911,4.487,1919,7.403,1920,4.882,1927,8.363,1929,5.515,1933,6.065,1934,5.515,1935,6.065,1936,8.145,1937,6.065,1938,6.065,1939,6.065,1940,6.065,1941,5.873,1942,6.92,1943,10.255,1944,9.831,1945,6.065,1946,8.145,1947,6.065,1948,6.065,1949,6.065,1950,6.065,1951,4.666]],["t/482",[0,1.167,1,1.341,3,1.178,6,1.517,7,0.811,11,1.791,13,2.913,14,0.521,17,0.693,27,0.781,28,1.268,29,2.786,30,1.628,31,4.923,32,4.128,41,1.717,44,2.487,45,1.616,50,2.522,51,1.575,57,1.482,59,2.084,77,1.358,80,1.709,81,1.603,84,2.472,85,1.595,92,1.52,93,1.543,94,1.511,95,1.317,96,3.571,102,1.463,104,2.216,105,0.998,109,3.997,118,1.735,127,2.472,130,2.621,133,3.204,138,2.247,141,1.202,147,3.624,149,1.206,150,2.94,154,2.543,155,3.361,158,0.825,159,2.581,163,1.735,164,0.965,181,1.919,186,0.842,187,1.214,189,0.842,195,1.874,200,1.762,202,1.084,203,5.209,209,1.413,221,2.097,223,1.093,224,1.143,226,1.432,233,3.76,234,2.974,244,1.247,247,2.084,250,2.038,261,2.383,272,3.997,277,1.174,284,1.735,289,1.417,290,1.71,299,3.051,300,3.284,301,3.643,302,1.799,304,1.344,307,1.244,311,4.443,312,3.151,317,1.372,318,0.836,319,3.887,323,1.136,324,1.82,326,2.792,329,2.571,340,2.313,344,1.12,355,1.735,379,0.98,380,1.071,383,5.24,394,2.277,406,0.675,417,3.651,425,1.8,497,3.446,499,2.571,504,2.631,523,1.791,533,1.595,551,3.07,564,3.024,596,2.084,599,1.318,603,4.279,604,3.597,606,2.39,609,2.472,610,3.239,613,3.464,615,1.661,622,2.187,623,1.685,626,3.485,628,1.791,631,5.467,632,2.69,635,1.159,636,1.919,657,2.571,660,3.283,684,2.308,702,1.28,703,1.211,732,3.211,755,2.571,756,4.062,776,7.454,781,2.839,783,2.187,802,2.038,808,3.76,812,4.369,813,4.05,816,2.187,843,2.187,917,2.387,1286,1.616,1430,2.387,1474,3.038,1515,3.038,1518,2.247,1525,2.69,1591,1.884,1634,4.818,1644,3.038,1648,2.571,1663,4.786,1664,2.187,1667,2.69,1675,2.387,1698,2.69,1730,2.133,1745,4.237,1781,2.839,1790,3.038,1825,2.839,1833,4.786,1835,2.839,1879,4.718,1883,2.69,1896,2.571,1903,2.69,1907,2.69,1911,2.472,1919,4.237,1920,2.69,1941,4.414,1942,6.278,1952,3.341,1953,3.341,1954,2.839,1955,7.39,1956,5.264,1957,3.341,1958,3.341,1959,2.839,1960,9.444,1961,3.341,1962,3.341,1963,3.038,1964,3.038,1965,3.341,1966,5.264,1967,2.839,1968,3.038,1969,2.839,1970,7.39,1971,3.341,1972,2.839,1973,3.341,1974,3.341,1975,3.341,1976,2.387,1977,3.341,1978,3.341,1979,3.341,1980,6.278,1981,3.038]],["t/484",[0,1.179,1,1.503,3,0.978,7,0.806,14,1.018,17,0.749,20,3.489,22,3.742,28,2.112,29,1.319,32,2.31,41,1.151,44,1.721,77,2.263,79,1.607,80,1.346,81,1.532,85,2.657,94,1.147,95,1.307,96,3.025,102,1.434,104,2.638,105,1,107,10.364,116,2.657,117,1.655,125,3.742,138,3.742,140,3.852,144,2.59,147,2.729,149,0.854,154,1.584,158,1.374,164,2.219,176,2.073,191,5.915,192,4.282,195,2.735,200,2.936,206,8.581,211,3.032,226,2.386,227,3.471,250,4.686,261,2.654,271,5.061,272,2.767,283,3.742,284,4.569,288,2.767,289,3.258,290,4.501,302,1.871,304,2.24,311,2.767,312,3.716,319,2.619,343,5.367,345,2.386,347,1.484,382,2.335,383,4.618,394,1.484,425,1.538,486,1.619,487,1.422,506,5.367,562,5.266,594,6.508,596,3.471,603,3.926,610,2.017,613,3.56,623,2.807,661,4.105,678,3.643,760,4.48,768,3.643,776,7.636,791,3.032,796,5.683,808,3.976,854,4.257,858,4.686,869,3.976,917,7.11,1152,3.643,1286,3.716,1430,3.976,1561,3.852,1574,4.905,1682,4.117,1749,3.643,1794,4.729,1843,5.796,1879,6.057,1903,8.013,1941,5.667,1942,8.059,1959,4.729,1982,4.48,1983,5.565,1984,5.565,1985,5.565,1986,5.565,1987,5.565,1988,5.565,1989,5.565,1990,5.565,1991,5.565,1992,7.682,1993,8,1994,7.682,1995,7.682,1996,8.797,1997,5.565,1998,11.397,1999,5.565,2000,5.061]],["t/486",[0,0.942,1,1.202,14,1.026,17,0.802,32,3.701,41,1.554,81,1.778,95,0.984,117,1.677,147,4.372,206,6.86,211,4.857,247,5.561,248,7.575,250,5.439,261,2.377,302,2.171,307,3.32,311,4.433,329,6.86,399,2.113,623,4.496,631,6.595,775,5.995,858,5.439,1430,6.369,1574,5.693,1925,8.107,1934,8.107,2001,8.107,2002,8.915]],["t/488",[3,1.262,7,0.621,9,1.834,17,0.744,19,3.695,80,1.588,105,0.806,117,1.705,244,2.617,252,3.013,272,5.206,277,1.561,355,2.259,504,3.226]],["t/490",[0,1.209,7,0.755,9,1.861,14,0.817,16,2.701,17,0.586,29,1.957,31,3.541,32,4.115,50,2.928,81,1.647,95,1.094,105,1.044,142,5.694,147,4.05,149,1.253,150,3.02,154,2.35,224,1.174,244,1.957,279,4.999,285,4.226,317,3.392,319,3.38,326,3.541,355,1.782,358,1.931,603,3.91,606,4.502,609,6.109,610,3.592,629,4.836,665,3.874,809,5.406,860,5.273,1287,6.861,1534,4.106,1675,5.9,1681,4.502,2003,8.258,2004,6.354,2005,6.354,2006,5.716]],["t/492",[0,1.132,1,1.324,3,1.091,7,0.804,9,1.558,11,3.717,14,1.025,16,2.268,17,0.76,19,3.139,29,2.327,32,4.076,41,1.605,44,2.145,50,2.048,51,3.269,52,3.692,80,1.558,83,2.364,92,2.003,93,2.608,94,1.524,95,1.284,102,1.695,105,0.991,118,4.62,119,2.849,141,1.28,149,0.771,154,1.973,174,3.355,188,3.602,221,2.763,223,2.268,224,1.265,225,3.657,234,2.791,244,1.643,261,2.371,277,0.954,300,3.497,302,2.391,314,2.306,319,3.848,333,2.791,345,2.973,378,3.149,379,2.033,380,1.411,384,2.232,385,2.162,386,2.688,387,2.709,450,1.589,504,2.469,599,2.735,601,3.041,604,2.839,605,2.536,635,2.405,665,2.385,702,3.407,774,3.228,835,3.448,1285,3.658,1286,3.355]],["t/494",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.452,244,2.196,261,2.828,277,1.275]],["t/496",[0,1.177,1,1.362,3,0.948,7,0.779,11,4.571,14,1,17,0.718,41,1.614,44,2.638,50,2.52,52,4.195,94,1.451,95,1.229,105,1.025,118,5.249,141,1.574,149,0.948,154,2.427,221,3.398,234,3.432,300,4.302,302,2.622,314,2.836,333,3.432,450,1.954,601,3.74,604,3.226,605,3.119,635,2.958,665,2.933,702,3.872,835,4.241]],["t/498",[0,1.134,1,1.354,7,0.578,9,1.76,14,0.835,17,0.713,27,1.974,29,2.686,31,4.306,32,4.773,50,2.494,94,1.1,95,0.932,117,1.588,146,2.182,159,4.14,176,3.741,197,4.32,224,1.428,261,2.678,293,4.599,319,4.018,399,2,564,5.77,604,2.695,665,3.687,1672,5.764,1673,7.21,2007,6.496,2008,8.632]],["t/500",[0,1.077,1,1.013,7,0.766,14,0.744,17,0.724,19,2.652,27,2.188,29,2.651,31,4.796,32,4.643,41,1.527,50,2.764,80,1.317,92,2.171,93,2.744,94,1.517,95,1.266,102,1.705,105,0.906,176,2.799,210,2.852,224,1.069,261,2.004,319,3.814,345,3.222,379,2.204,380,1.529,384,2.419,385,2.343,386,2.828,387,3.104,665,3.218,670,3.334,732,4.585,802,4.585]],["t/502",[7,0.781,14,0.722,17,0.652,27,1.705,29,2.671,31,4.888,32,4.608,41,1.507,50,2.155,80,1.278,92,2.107,93,2.693,94,1.499,95,1.286,102,1.709,133,3.162,176,2.717,304,2.935,319,4.026,379,2.138,380,1.484,384,2.347,385,2.274,386,2.776,387,3.061,551,3.438,670,3.235,702,2.794,703,2.643,704,2.794,778,3.974,779,3.847,2007,5.612,2009,5.21]],["t/504",[0,0.714,1,1.073,3,0.516,7,0.599,13,1.681,14,0.668,17,0.329,25,1.282,37,2.2,41,1.31,64,1.826,80,0.813,81,1.588,94,0.605,95,0.965,102,1.703,104,3.001,105,0.777,106,4.134,109,2.306,110,1.211,124,1.75,130,1.867,135,1.861,141,0.856,146,2.174,149,1.181,158,1.145,186,2.742,187,1.07,189,1.169,196,2.314,209,1.246,215,1.64,224,1.321,261,1.8,270,2.964,275,1.177,276,1.177,277,1.095,318,2.566,319,2.981,321,1.194,322,2.282,323,1.886,347,2.122,352,2.265,355,1.457,358,2.044,359,2.011,365,1.13,368,1.153,369,1.775,374,1.255,377,2.525,380,0.944,388,2.956,389,2.662,390,2.662,391,2.662,392,2.662,393,2.852,394,2.668,395,1.852,396,2.506,397,1.33,398,2.334,399,1.886,400,2.282,401,2.265,402,1.33,403,2.234,404,2.265,405,1.33,406,2.072,407,2.469,408,2.506,409,2.939,410,2.282,411,1.34,412,2.512,413,1.35,414,2.506,415,2.469,416,2.434,417,3.066,418,2.442,420,2.563,421,1.32,422,1.33,423,1.936,424,1.301,425,1.866,426,2.282,427,1.33,428,1.381,429,1.32,430,1.33,431,2.282,432,2.282,433,1.33,434,1.813,435,2.459,438,2.451,442,1.775,445,1.34,446,1.34,447,1.34,448,1.34,449,1.33,450,1.063,451,1.145,452,1.34,453,1.907,454,1.33,455,1.34,456,1.34,457,1.34,458,1.34,459,1.34,460,1.95,465,1.33,466,1.34,467,1.381,468,1.35,469,1.34,470,1.34,471,1.34,472,1.35,473,1.35,474,1.35,475,1.381,476,1.34,477,1.34,478,1.35,479,1.35,486,2.544,487,2.374,488,1.595,490,1.202,492,1.893,493,1.301,494,1.237,495,1.31,496,1.282,533,2.215,612,2.571,626,2.011,706,1.391,709,1.37,719,1.391,737,1.681,812,2.374,818,2.771,865,2.058,961,2.665,1018,2.571,1216,2.83,1291,1.728,1292,1.728,1293,1.728,1294,1.712,1298,1.728,1299,2.515,1300,1.712,1301,1.728,1302,1.728,1305,1.728,1306,1.728,1307,1.712,1311,1.744,1518,3.119,1606,2.893,1672,2.409,1676,4.218,1677,2.83,1694,2.962,1733,3.314,1734,3.569,1737,3.432,1738,3.569,2007,3.569,2008,7.037,2010,4.218,2011,4.639,2012,4.639,2013,4.639]],["t/506",[1,0.621,7,0.543,14,0.665,17,0.327,25,1.274,29,2.195,31,4.475,32,3.846,37,2.191,41,1.306,64,1.817,81,1.34,94,0.601,95,0.875,102,1.704,104,2.995,105,0.705,110,1.203,124,1.741,130,4.267,135,1.854,141,0.85,146,2.169,149,1.138,158,1.138,186,2.739,187,1.063,189,1.162,196,2.307,209,1.237,210,1.749,215,1.634,224,1.317,270,2.96,275,1.17,276,1.17,277,1.091,318,2.562,319,1.571,321,1.186,322,2.275,323,1.881,347,2.114,352,2.257,355,1.45,358,2.037,365,1.122,368,1.146,369,1.766,374,1.246,377,2.517,380,0.937,388,2.95,389,2.654,390,2.654,391,2.654,392,2.654,393,2.849,394,2.662,395,1.844,396,2.498,397,1.321,398,2.325,399,1.879,400,2.273,401,2.257,402,1.321,403,2.227,404,2.257,405,1.321,406,2.068,407,2.462,408,2.498,409,2.934,410,2.273,411,1.331,412,2.506,413,1.341,414,2.498,415,2.462,416,2.426,418,2.435,420,2.555,421,1.311,422,1.321,423,1.926,424,1.292,425,1.857,426,2.275,427,1.321,428,1.372,429,1.311,430,1.321,431,2.273,432,2.273,433,1.321,434,1.804,435,2.453,438,2.444,442,1.766,445,1.331,446,1.331,447,1.331,448,1.331,449,1.321,450,1.056,451,1.138,452,1.331,453,1.898,454,1.321,455,1.331,456,1.331,457,1.331,458,1.331,459,1.331,460,1.941,465,1.321,466,1.331,467,1.372,468,1.341,469,1.331,470,1.331,471,1.331,472,1.341,473,1.341,474,1.341,475,1.372,476,1.331,477,1.331,478,1.341,479,1.341,486,2.536,487,2.368,488,1.585,490,1.194,492,1.884,493,1.292,494,1.229,495,1.302,496,1.274,536,8.425,665,1.585,706,1.382,709,1.361,719,1.382,737,1.67,1291,1.716,1292,1.716,1293,1.716,1294,1.701,1298,1.716,1299,2.503,1300,1.701,1301,1.716,1302,1.716,1305,1.716,1306,1.716,1307,1.701,1311,1.732,1672,2.394,1673,5.86,1678,3.292,1735,3.916,1739,3.916,1804,3.71,1807,3.546,1811,3.71,2008,7.459,2010,4.191,2014,4.609,2015,4.609,2016,4.609]],["t/508",[0,0.683,1,1.037,3,0.486,4,2.727,7,0.621,9,0.766,12,2.466,14,0.761,17,0.459,25,1.208,27,1.798,29,1.036,31,2.771,32,1.815,37,2.125,39,3.234,41,1.274,50,1.291,51,2.06,64,1.182,79,1.263,80,0.766,81,1.289,94,0.843,95,1.156,102,1.701,105,0.896,106,4.93,110,1.141,117,1.786,120,3.2,124,1.675,130,2.601,133,1.895,135,1.798,141,1.193,146,2.062,149,1.121,158,1.596,164,1.867,186,2.71,187,1.008,188,2.271,189,1.102,196,2.249,209,1.174,210,1.659,215,1.751,224,1.208,260,3.123,270,2.929,275,1.11,276,1.11,277,1.169,293,2.382,296,2.612,297,1.491,304,1.759,318,2.524,319,3.622,321,1.125,322,2.218,323,1.834,347,2.05,352,2.189,355,1.66,358,1.986,359,1.895,365,1.065,368,1.087,369,1.699,374,1.182,377,2.454,380,0.889,388,2.901,389,2.588,390,2.588,391,2.588,392,2.588,393,2.829,394,2.618,395,2.11,396,2.436,397,1.253,398,2.255,399,2.013,400,2.205,401,2.189,402,1.253,403,2.172,404,2.189,405,1.253,406,2.038,407,2.4,408,2.436,409,2.891,410,2.205,411,1.263,412,2.452,413,1.272,414,2.436,415,2.4,416,2.365,418,2.383,420,2.658,421,1.244,422,1.253,423,1.853,424,1.226,425,1.786,426,2.007,427,1.253,428,1.301,429,1.244,430,1.253,431,2.205,432,2.205,433,1.253,434,1.174,435,2.4,438,2.157,442,2.233,445,1.263,446,1.263,447,1.263,448,1.263,449,1.253,450,1.002,451,1.596,452,1.263,453,1.826,454,1.253,455,1.263,456,1.263,457,1.263,458,1.263,459,1.263,460,1.867,465,1.253,466,1.263,467,1.301,468,1.272,469,1.263,470,1.263,471,1.263,472,1.272,473,1.272,474,1.272,475,1.301,476,1.263,477,1.263,478,1.272,479,1.272,486,2.473,487,2.317,490,1.133,492,1.813,493,1.226,494,1.166,495,1.235,496,1.208,504,1.556,551,2.06,654,2.01,680,3.714,706,1.311,707,1.57,708,2.322,709,1.291,710,2.762,711,1.584,712,1.584,713,2.342,717,1.584,718,1.584,719,1.311,720,2.476,721,1.584,723,1.599,725,2.791,753,2.56,779,2.306,801,3.519,808,3.123,818,2.612,819,3.026,821,3.714,822,3.714,824,3.975,854,2.423,932,2.667,1056,3.364,1063,3.519,1672,4.413,1673,7.144,1677,2.667,1678,3.123,1694,2.791,1740,3.975,2007,3.364,2008,5.204,2017,4.372,2018,3.714,2019,4.372,2020,4.372,2021,4.372]],["t/510",[0,1.085,3,0.973,7,0.6,9,1.534,13,3.72,17,0.813,19,3.09,29,2.432,31,4.668,32,4.26,80,1.534,83,2.986,105,1.018,117,1.647,142,5.03,244,2.075,249,4.481,252,2.912,277,1.544,310,4.693,311,4.354,313,6.478,319,3.499,354,5.03,399,2.432,603,3.454,703,3.174]],["t/512",[0,0.914,1,1.166,7,0.593,9,1.999,16,2.829,27,2.022,28,3.282,29,2.415,45,4.185,83,3.474,90,3.221,94,1.328,105,0.906,149,1.133,205,2.675,244,2.05,261,2.306,299,3.282,302,2.106,312,4.185,321,2.226,327,7.349,451,2.854,533,4.13,656,5.395,665,3.504,669,5.816,753,5.966,809,5.662,1842,7.349,2009,7.738,2022,8.649,2023,8.649,2024,6.179,2025,8.649]],["t/514",[0,1.179,1,1.446,3,1.192,7,0.797,9,1.724,13,2.524,14,1.026,16,2.278,17,0.761,19,3.472,28,3.937,29,2.331,41,1.555,44,3.043,50,2.057,52,3.702,80,1.724,81,1.389,83,2.374,92,2.011,93,2.615,94,1.531,95,1.231,102,1.679,105,1.004,109,3.463,119,2.861,141,1.285,149,1.094,154,1.982,174,3.369,188,3.617,215,1.435,221,2.774,223,2.278,224,1.268,225,3.664,234,2.802,244,1.65,261,2.623,277,0.958,302,2.396,314,2.316,333,2.802,345,2.986,359,3.019,378,3.163,379,2.042,380,1.417,384,2.241,385,2.171,386,2.105,387,2.121,417,4.05,450,1.596,451,1.719,504,2.479,533,3.325,599,2.747,601,3.054,604,2.847,605,2.547,612,3.859,626,3.019,635,2.415,657,5.358,753,4.078,774,3.241,818,4.16,865,3.089,961,4.001,1018,3.859,1216,4.249,1285,3.673,1286,3.369,1518,4.683,1597,4.82,1606,4.344]],["t/516",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.452,244,2.196,261,2.828,277,1.275]],["t/518",[0,1.2,1,1.449,3,1.12,7,0.761,9,1.487,14,0.997,17,0.715,19,2.995,41,1.611,44,3.324,50,2.507,52,4.182,94,1.516,95,1.186,105,1.023,141,1.566,149,0.943,154,2.415,221,3.381,234,3.415,302,2.617,314,2.822,333,3.415,450,1.944,451,2.095,601,3.721,604,3.216,605,3.103,635,2.943,657,6.529,753,4.969]],["t/520",[7,0.631,16,3.014,29,2.184,81,1.838,95,1.167,105,0.988,150,3.37,195,3.281,312,4.458,656,5.748,665,3.635,669,6.196,1619,7.09,1749,6.033]],["t/522",[0,0.879,1,1.2,7,0.777,9,1.313,14,0.619,17,0.297,25,1.156,28,3.777,29,1.775,37,2.071,41,1.246,64,1.692,75,1.877,77,1.7,80,1.096,81,1.248,94,1.389,95,1.031,102,1.702,104,2.903,105,0.957,106,2.172,110,1.092,119,2.569,124,1.621,130,1.683,135,1.751,141,0.772,146,2.103,149,1.209,156,5.314,158,1.033,181,5.718,186,2.685,187,0.965,189,1.054,196,2.201,203,2.552,209,1.123,215,1.544,224,1.265,245,2.738,261,1.668,270,2.902,275,1.062,276,1.062,277,1.03,288,3.11,315,2.812,318,2.491,321,1.076,322,2.17,323,1.794,347,1.997,352,2.132,355,1.35,358,1.944,365,1.018,368,1.04,369,1.644,374,1.131,377,2.401,380,0.851,388,2.86,389,2.532,390,2.532,391,2.532,392,2.532,393,2.812,394,2.581,395,1.716,396,2.384,397,1.199,398,2.197,399,1.775,400,2.148,401,2.132,402,1.199,403,2.125,404,2.132,405,1.199,406,2.011,407,2.349,408,2.384,409,2.853,410,2.148,411,1.208,412,2.407,413,1.217,414,2.384,415,2.349,416,2.315,418,2.34,420,2.438,421,1.19,422,1.199,423,1.793,424,1.173,425,1.729,426,2.17,427,1.199,428,1.245,429,1.19,430,1.199,431,2.148,432,2.148,433,1.199,434,1.68,435,2.356,438,2.332,442,1.644,445,1.208,446,1.208,447,1.208,448,1.208,449,1.199,450,0.958,451,2.053,452,1.208,453,1.767,454,1.199,455,1.208,456,1.208,457,1.208,458,1.208,459,1.208,460,1.807,465,1.199,466,1.208,467,1.245,468,1.217,469,1.208,470,1.208,471,1.208,472,1.217,473,1.217,474,1.217,475,1.245,476,1.208,477,1.208,478,1.217,479,1.217,486,2.419,487,2.275,488,1.438,490,1.084,492,1.754,493,1.173,494,1.115,495,1.182,496,1.156,613,1.335,654,2.875,665,1.438,706,1.254,709,1.236,715,2.499,719,1.254,737,1.516,753,4.387,756,3.901,757,5.314,758,5.352,812,2.14,1291,1.558,1292,1.558,1293,1.558,1294,1.544,1298,1.558,1299,2.33,1300,1.544,1301,1.558,1302,1.558,1305,1.558,1306,1.558,1307,1.544,1311,1.572,1578,2.738,1597,5.186,1598,3.218,1599,2.895,1600,3.554,1602,3.554,1603,2.895,1672,2.172,1769,7.186,2026,8.094,2027,9.254,2028,8.094,2029,4.183,2030,3.803,2031,4.183,2032,4.183,2033,4.183,2034,4.183,2035,4.183]],["t/524",[0,0.832,1,1.06,3,0.505,7,0.698,13,1.647,14,0.658,17,0.323,25,1.256,27,2.024,28,3.869,29,1.576,37,2.174,41,1.298,45,2.199,64,1.229,79,1.313,81,1.327,94,0.867,95,1.017,102,1.703,105,0.856,106,5.164,110,1.186,117,1.733,120,3.397,124,1.178,135,1.839,141,0.839,146,2.001,149,1.133,152,1.811,158,1.642,164,1.313,186,2.731,187,1.048,189,1.145,196,2.292,209,1.22,215,1.621,224,1.231,231,1.693,270,2.952,275,1.153,276,1.153,277,1.082,297,1.55,307,2.477,318,2.552,321,1.17,322,2.26,323,1.868,347,2.097,352,2.239,355,1.435,358,2.024,365,1.107,368,1.13,369,1.748,374,1.229,377,2.5,380,0.924,388,2.937,389,2.637,390,2.637,391,2.637,392,2.637,393,2.844,394,2.651,395,2.158,396,2.482,397,1.303,398,2.306,399,1.864,400,2.255,401,2.239,402,1.303,403,2.213,404,2.239,405,1.303,406,2.06,407,2.446,408,2.482,409,2.923,410,2.255,411,1.313,412,2.492,413,1.322,414,2.482,415,2.446,416,2.41,418,2.422,420,2.701,421,1.293,422,1.303,423,1.907,424,1.274,425,1.838,426,2.053,427,1.303,428,1.353,429,1.293,430,1.303,431,2.255,432,2.255,433,1.303,434,1.22,435,2.439,438,2.206,442,2.276,445,1.313,446,1.313,447,1.313,448,1.313,449,1.303,450,1.041,451,1.642,452,1.313,453,1.879,454,1.303,455,1.313,456,1.313,457,1.313,458,1.313,459,1.313,460,1.921,465,1.303,466,1.313,467,1.353,468,1.322,469,1.313,470,1.313,471,1.313,472,1.322,473,1.322,474,1.322,475,1.353,476,1.313,477,1.313,478,1.322,479,1.322,486,2.519,487,2.355,490,1.178,492,1.865,493,1.274,494,1.212,495,1.284,496,1.256,706,1.363,707,1.632,708,2.389,709,1.343,710,2.825,711,1.647,712,1.647,713,2.41,715,2.715,717,1.647,718,1.647,719,1.363,720,2.548,721,1.647,723,1.662,809,2.975,858,2.773,1672,3.455,1677,2.773,1683,2.902,2026,9.041,2027,9.457,2030,4.133,2036,4.545,2037,3.497,2038,4.133,2039,4.545]],["t/526",[3,1.164,17,0.82,80,1.588,117,1.705,223,2.964,244,2.617,252,3.013,272,5.206,277,1.561,344,3.511,355,2.259,503,5.653,648,5.111,839,7.7]],["t/528",[0,0.903,1,1.152,3,0.95,7,0.763,9,1.992,13,3.097,16,2.795,29,2.397,57,3.79,80,1.497,81,1.704,83,3.675,85,4.08,90,3.182,95,1.117,96,3.479,105,0.958,149,1.125,150,3.125,154,3.17,194,5.213,195,3.042,205,2.643,228,6.879,244,2.025,261,2.278,307,3.182,312,4.134,314,2.841,323,1.844,339,7.26,359,3.704,603,3.37,613,2.728,623,4.309,684,3.747,1279,7.77,1280,5.914,1281,7.77,1282,7.77,1283,6.879,1284,5.914]],["t/530",[0,1.157,1,1.368,3,1.128,7,0.796,9,1.63,14,1.052,16,2.436,17,0.777,19,3.284,29,2.405,41,1.593,44,2.304,50,2.2,52,3.862,80,1.63,83,2.539,92,2.151,93,2.728,94,1.505,95,1.25,102,1.681,105,1.007,119,3.059,141,1.374,154,2.119,174,3.603,188,3.868,215,1.535,221,2.967,223,2.436,224,1.323,225,3.78,234,2.997,244,1.765,261,2.481,277,1.024,302,2.471,314,2.476,319,3.625,333,2.997,345,3.193,378,3.382,379,2.184,380,1.515,384,2.397,385,2.322,386,2.251,387,2.268,450,1.706,504,2.651,599,2.938,601,3.266,604,2.971,605,2.724,635,2.583,774,3.466,1285,3.929,1286,3.603]],["t/532",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.452,244,2.196,261,2.828,277,1.275]],["t/534",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,450,1.996,601,3.819,604,3.267,605,3.185,635,3.021]],["t/536",[3,0.98,7,0.706,9,1.545,14,0.873,17,0.626,19,3.112,29,2.09,30,2.728,39,6.525,44,2.728,57,4.992,73,5.066,81,1.759,90,4.067,95,1.138,105,0.971,117,1.659,133,3.824,149,0.98,150,3.225,154,2.51,174,4.267,205,2.728,224,1.254,301,6.105,317,3.623,319,3.007,533,4.211,599,3.479,613,3.486,1964,8.02]],["t/538",[7,0.746,13,2.891,14,0.961,17,0.743,29,2.3,41,1.568,57,4.95,80,1.398,92,2.304,93,2.846,94,1.511,95,1.268,102,1.704,105,0.709,149,0.887,150,2.917,224,1.134,304,3.21,319,3.568,379,2.339,380,1.623,384,2.568,385,2.487,386,2.934,387,2.957,613,3.563,793,5.223]],["t/540",[0,0.501,1,0.925,7,0.605,14,0.679,17,0.337,25,1.31,37,2.227,41,1.324,57,2.103,64,1.855,81,1.368,94,0.618,95,0.89,102,1.704,104,3.021,105,0.717,110,1.238,124,1.778,133,2.056,135,1.884,141,0.875,146,2.241,149,1.147,158,1.171,186,2.754,187,1.094,189,1.195,196,2.338,209,1.273,210,1.799,215,1.661,224,1.256,261,1.264,270,2.976,275,1.203,276,1.203,277,1.108,318,2.582,321,1.22,322,2.305,323,1.906,347,2.149,352,2.293,355,1.48,358,2.065,365,1.155,368,1.179,369,1.803,374,1.282,377,2.551,380,0.964,388,2.976,389,2.69,390,2.69,391,2.69,392,2.69,393,2.86,394,2.686,395,1.882,396,2.532,397,1.359,398,2.363,399,1.91,400,2.31,401,2.293,402,1.359,403,2.257,404,2.293,405,1.359,406,2.084,407,2.495,408,2.532,409,2.957,410,2.31,411,1.369,412,2.534,413,1.38,414,2.532,415,2.495,416,2.459,418,2.463,420,2.589,421,1.349,422,1.359,423,1.966,424,1.33,425,1.896,426,2.305,427,1.359,428,1.411,429,1.349,430,1.359,431,2.31,432,2.31,433,1.359,434,1.842,435,2.481,438,2.477,442,1.803,445,1.369,446,1.369,447,1.369,448,1.369,449,1.359,450,1.086,451,1.171,452,1.369,453,1.938,454,1.359,455,1.369,456,1.369,457,1.369,458,1.369,459,1.369,460,1.981,465,1.359,466,1.369,467,1.411,468,1.38,469,1.369,470,1.369,471,1.369,472,1.38,473,1.38,474,1.38,475,1.411,476,1.369,477,1.369,478,1.38,479,1.38,486,2.57,487,2.395,488,1.63,490,1.229,492,1.923,493,1.33,494,1.264,495,1.339,496,1.31,613,2.992,706,1.422,709,1.401,719,1.422,737,1.718,791,2.583,812,2.426,1291,1.766,1292,1.766,1293,1.766,1294,1.75,1298,1.766,1299,2.555,1300,1.75,1301,1.766,1302,1.766,1305,1.766,1306,1.766,1307,1.75,1311,1.782,1584,3.188,1586,3.104,1589,3.188,2040,4.028,2041,7.504,2042,6.847,2043,4.312,2044,4.741,2045,4.028,2046,4.741,2047,4.741,2048,4.312,2049,4.741]],["t/542",[0,0.477,1,0.892,7,0.723,14,0.655,17,0.32,25,1.247,29,1.069,37,2.165,41,1.293,44,2.423,57,2.001,64,1.789,80,0.79,81,1.562,90,1.68,94,0.588,95,1.194,102,1.703,104,2.975,105,0.767,110,1.178,124,1.715,133,1.956,135,1.831,141,0.832,146,2.155,149,1.173,154,1.284,158,1.114,186,2.727,187,1.041,189,1.137,196,2.284,209,1.211,215,1.614,224,1.227,261,1.203,270,2.948,275,1.145,276,1.145,277,1.077,318,2.547,319,2.941,321,1.161,322,2.252,323,2.308,347,2.088,352,2.229,355,1.428,358,2.017,365,1.099,368,1.121,369,1.739,374,1.22,377,2.492,380,0.918,388,2.93,389,2.627,390,2.627,391,2.627,392,2.627,393,2.841,394,2.645,395,1.815,396,2.473,397,1.293,398,2.297,399,1.856,400,2.246,401,2.229,402,1.293,403,2.205,404,2.229,405,1.293,406,2.056,407,2.437,408,2.473,409,2.917,410,2.246,411,1.303,412,2.484,413,1.313,414,2.473,415,2.437,416,2.402,418,2.415,420,2.529,421,1.284,422,1.293,423,1.897,424,1.265,425,1.828,426,2.252,427,1.293,428,1.343,429,1.284,430,1.293,431,2.246,432,2.246,433,1.293,434,1.776,435,2.432,438,2.419,442,1.739,445,1.303,446,1.303,447,1.303,448,1.303,449,1.293,450,1.034,451,1.114,452,1.303,453,1.869,454,1.293,455,1.303,456,1.303,457,1.303,458,1.303,459,1.303,460,1.911,465,1.293,466,1.303,467,1.343,468,1.313,469,1.303,470,1.303,471,1.303,472,1.313,473,1.313,474,1.313,475,1.343,476,1.303,477,1.303,478,1.313,479,1.313,486,2.51,487,2.348,488,1.551,490,1.169,492,1.855,493,1.265,494,1.203,495,1.274,496,1.247,599,1.78,613,3.248,706,1.353,709,1.333,719,1.353,737,1.635,783,2.954,812,2.309,1291,1.68,1292,1.68,1293,1.68,1294,1.665,1298,1.68,1299,2.464,1300,1.665,1301,1.68,1302,1.68,1305,1.68,1306,1.68,1307,1.665,1311,1.696,1673,5.801,1678,3.223,1694,2.881,1734,3.471,1735,3.833,1738,3.471,1739,3.833,2041,8.428,2050,4.512,2051,4.103,2052,8.627,2053,4.512,2054,4.512,2055,4.512,2056,4.512]],["t/544",[0,0.825,1,1.053,3,0.499,7,0.656,13,1.626,14,0.652,17,0.319,25,1.24,27,1.825,37,2.158,41,1.29,64,1.213,79,1.296,80,1.154,81,1.557,94,0.585,95,1.012,102,1.702,105,0.852,109,2.231,110,1.171,117,1.619,120,3.234,124,1.163,130,1.806,135,1.825,141,0.828,146,1.991,149,1.172,158,1.627,164,1.296,186,2.724,187,1.035,189,1.131,196,2.278,209,1.205,210,1.703,215,1.609,224,1.223,261,1.196,270,2.944,275,1.139,276,1.139,277,1.074,288,2.231,297,1.53,318,2.543,319,3.593,321,1.155,322,2.246,323,1.857,347,2.082,352,2.222,355,1.422,358,2.012,359,1.945,365,1.093,368,1.115,369,1.732,374,1.213,377,2.485,380,0.913,388,2.925,389,2.621,390,2.621,391,2.621,392,2.621,393,2.839,394,2.64,395,2.142,396,2.467,397,1.286,398,2.289,399,1.85,400,2.239,401,2.222,402,1.286,403,2.199,404,2.222,405,1.286,406,2.053,407,2.431,408,2.467,409,2.912,410,2.239,411,1.296,412,2.479,413,1.306,414,2.467,415,2.431,416,2.395,417,2.992,418,2.409,420,2.687,421,1.277,422,1.286,423,1.889,424,1.258,425,1.821,426,2.038,427,1.286,428,1.336,429,1.277,430,1.286,431,2.239,432,2.239,433,1.286,434,1.205,435,2.426,438,2.19,442,2.262,445,1.296,446,1.296,447,1.296,448,1.296,449,1.286,450,1.028,451,1.108,452,1.296,453,1.861,454,1.286,455,1.296,456,1.296,457,1.296,458,1.296,459,1.296,460,1.903,465,1.286,466,1.296,467,1.336,468,1.306,469,1.296,470,1.296,471,1.296,472,1.306,473,1.306,474,1.306,475,1.336,476,1.296,477,1.296,478,1.306,479,1.306,486,2.504,487,2.342,490,1.163,492,1.848,493,1.258,494,1.196,495,1.267,496,1.24,533,2.142,612,2.486,613,2.747,626,1.945,665,2.266,706,1.346,707,1.612,708,2.367,709,1.325,710,2.805,711,1.626,712,1.626,713,2.388,717,1.626,718,1.626,719,1.346,720,2.524,721,1.626,723,1.641,818,2.68,854,2.486,865,1.99,961,2.578,1018,2.486,1056,3.452,1063,3.612,1216,2.737,1518,3.017,1606,2.799,1673,6.831,1678,3.205,1680,3.812,1694,2.865,2018,3.812,2040,7.311,2041,7.311,2042,8.141,2045,3.812,2057,4.487,2058,4.487,2059,6.589]],["t/546",[7,0.748,17,0.732,29,2.09,30,2.728,57,3.912,80,1.545,83,3.007,117,1.659,149,1.251,150,3.769,154,3.203,155,5.631,205,2.728,244,2.09,249,5.274,252,2.933,277,1.548,310,5.524,311,5.124,312,4.267,326,3.781,359,3.824,399,2.09,612,4.887,659,5.066,1534,4.385]],["t/548",[0,0.768,1,0.979,3,1.115,6,3.298,7,0.78,9,1.605,14,0.718,16,2.375,17,0.748,20,3.298,27,2.141,28,2.756,29,1.721,30,3.581,45,3.513,73,4.171,75,4.11,81,2.001,83,3.42,90,3.411,94,0.946,95,1.163,96,3.149,105,0.814,117,1.887,133,4.349,145,5.846,146,1.577,149,1.018,154,2.066,179,4.637,196,2.424,197,3.716,201,4.883,205,2.246,244,1.721,253,6.158,254,5.026,261,2.809,277,1.26,299,2.756,304,3.685,317,4.863,319,2.476,320,4.024,322,1.895,340,6.339,359,4.567,383,4.727,533,4.79,551,3.423,582,4.096,597,3.014,610,2.632,629,4.252,635,2.518,768,4.754,859,4.096,879,5.587,1057,5.587,1104,5.026,1534,3.61,1554,5.587,1669,5.187,1675,5.187,1681,3.298,1748,6.17,1780,6.17,2060,7.261,2061,7.525,2062,7.719,2063,6.603,2064,9.122,2065,5.846,2066,5.372,2067,4.529,2068,7.261,2069,7.261,2070,7.261,2071,7.261,2072,9.158,2073,6.17,2074,8.328,2075,7.261]],["t/550",[0,1.213,1,1.319,3,1.148,7,0.806,9,1.715,14,1.022,16,2.252,17,0.759,19,3.125,27,1.61,41,1.602,44,2.13,50,3.051,52,3.675,80,1.551,83,2.348,92,1.989,93,2.596,94,1.515,95,1.228,96,3.552,102,1.687,105,1.012,117,1.943,119,2.829,141,1.271,149,0.984,154,1.96,174,3.332,188,3.577,202,2.873,215,1.825,221,2.743,223,2.252,224,1.259,225,3.645,234,2.771,244,1.632,261,2.361,277,0.947,302,2.383,314,2.29,333,2.771,345,2.953,358,2.07,378,3.127,379,2.019,380,1.401,383,4.636,384,2.216,385,2.147,386,2.081,387,2.697,398,2.019,450,1.578,504,3.484,599,2.716,601,3.019,604,2.827,605,2.518,635,2.388,665,3.045,684,3.019,774,3.205,1285,3.632,1286,3.332,1732,4.919,2061,6.991]],["t/552",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.452,244,2.196,261,2.828,277,1.275]],["t/554",[0,1.24,1,1.331,3,1.098,7,0.791,9,1.437,14,0.977,17,0.701,27,1.918,41,1.587,44,2.538,50,3.247,52,4.098,94,1.466,95,1.169,105,1.036,117,2.068,141,1.514,149,1.098,154,2.334,202,3.203,215,1.691,221,3.268,234,3.301,302,2.579,314,2.728,333,3.301,358,2.308,398,2.405,450,1.88,504,3.515,601,3.597,604,3.152,605,3,635,2.845,665,3.395,684,3.597]],["t/556",[0,0.918,1,1.17,3,0.965,7,0.595,14,0.859,17,0.725,20,3.942,28,3.294,30,3.464,41,1.301,44,2.685,45,4.199,95,1.236,96,2.985,117,1.633,149,0.965,224,1.234,277,1.194,302,2.486,307,3.803,317,4.456,345,3.722,383,3.895,504,3.635,597,3.603,599,3.424,692,5.225,961,4.986,1732,6.201,2061,7.75,2062,8.786,2076,7.893]],["t/558",[3,0.9,7,0.796,14,0.801,17,0.696,41,1.468,75,3.633,80,1.418,92,2.338,93,2.872,94,1.484,95,1.237,96,3.853,102,1.7,133,3.51,288,4.025,317,4.326,359,3.51,363,5.169,379,2.374,380,1.647,383,5.029,384,2.605,385,2.524,386,2.447,387,2.983,501,4.486,551,3.816,660,5.049,1732,5.783,2061,6.997]],["t/560",[0,0.945,3,0.777,7,0.774,14,0.692,17,0.635,27,1.635,28,3.393,30,3.453,41,1.609,44,2.163,80,1.567,83,2.385,92,2.02,93,2.622,94,1.5,95,1.301,96,3.777,102,1.702,105,0.622,130,2.814,133,3.032,138,4.703,144,3.255,146,1.519,205,2.766,284,3.633,290,3.579,307,2.605,317,2.873,320,3.876,322,1.825,324,3.81,328,3.384,340,4.841,359,3.032,363,4.466,379,2.05,380,1.423,383,5.073,384,2.251,385,2.18,386,2.114,387,2.723,504,3.184,551,3.296,615,3.477,627,5.63,635,3.101,660,4.362,665,2.405,684,3.921,692,3.579,702,2.679,703,2.535,704,3.777,802,4.267,860,4.466,979,5.63,2028,6.36,2061,7.671,2062,7.585,2063,6.36,2073,8.376,2077,4.996,2078,8.964]],["t/562",[0,0.377,1,0.673,3,0.164,7,0.689,13,0.534,14,0.704,17,0.394,25,1.38,27,1.939,28,0.999,30,0.815,37,2.293,41,1.355,51,0.694,64,1.499,79,1.255,80,0.761,81,1.477,94,0.723,95,1.111,96,2.714,102,1.707,104,1.929,105,0.884,106,4.309,109,0.732,110,1.303,117,1.701,120,2.927,123,2.295,124,1.437,130,0.593,133,0.639,135,1.939,141,1.023,146,2.129,149,1.171,158,1.678,164,1.255,186,2.781,187,1.152,189,1.258,196,2.394,205,2.37,209,1.489,210,0.999,215,1.71,224,1.286,227,1.642,261,0.952,270,3.005,275,1.267,276,1.267,277,1.141,297,1.481,317,1.784,318,2.618,321,1.285,322,2.36,323,1.952,347,2.212,352,2.361,355,1.536,358,2.114,359,0.639,365,1.216,368,1.241,369,1.871,374,1.35,377,2.612,380,1.015,383,3.542,388,3.022,389,2.754,390,2.754,391,2.754,392,2.754,393,2.878,394,2.727,395,2.224,396,2.593,397,1.431,398,2.432,399,1.966,400,2.378,401,2.361,402,1.431,403,2.311,404,2.361,405,1.431,406,2.113,407,2.555,408,2.593,409,2.998,410,2.378,411,1.442,412,2.586,413,1.453,414,2.593,415,2.555,416,2.518,417,1.196,418,2.513,420,2.777,421,1.421,422,1.431,423,2.041,424,1.4,425,1.967,426,2.211,427,1.431,428,1.486,429,1.421,430,1.431,431,2.378,432,2.378,433,1.431,434,1.489,435,2.531,438,2.375,442,2.308,445,1.442,446,1.442,447,1.442,448,1.442,449,1.431,450,1.144,451,1.232,452,1.442,453,2.011,454,1.431,455,1.442,456,1.442,457,1.442,458,1.442,459,1.442,460,2.056,465,1.431,466,1.442,467,1.486,468,1.453,469,1.442,470,1.442,471,1.442,472,1.453,473,1.453,474,1.453,475,1.486,476,1.442,477,1.442,478,1.453,479,1.453,486,2.632,487,2.443,488,0.905,490,1.294,492,1.996,493,1.4,494,1.331,495,1.41,496,1.38,533,0.703,604,0.47,612,0.816,626,0.639,706,1.497,707,1.56,708,2.311,709,1.475,710,2.752,711,1.574,712,1.574,713,2.331,715,0.88,717,1.574,718,1.574,719,1.663,720,2.124,721,1.574,723,1.588,737,0.534,755,1.133,791,0.803,818,0.88,865,0.653,961,0.846,1018,0.816,1056,2.026,1063,2.12,1216,0.899,1291,0.549,1292,0.549,1293,0.549,1294,0.544,1298,0.549,1299,0.981,1300,0.544,1301,0.549,1302,0.981,1305,0.549,1306,0.549,1307,0.544,1311,0.554,1317,1.257,1518,0.991,1524,1.724,1599,1.02,1603,1.02,1606,0.919,1672,3.697,1677,2.178,1733,1.052,1737,1.09,1787,1.34,2018,2.237,2040,5.775,2042,7.048,2043,1.34,2045,3.034,2048,1.34,2061,5.085,2062,3.342,2073,7.048,2074,9.615,2078,7.984,2079,1.252,2080,1.473,2081,6.02,2082,2.633,2083,1.02,2084,5.544,2085,1.02,2086,1.473,2087,2.633,2088,1.02,2089,2.633,2090,1.473,2091,1.473,2092,1.133,2093,2.633,2094,1.473,2095,1.473,2096,1.473]],["t/564",[0,1.094,3,0.987,17,0.801,19,3.135,30,2.748,44,2.748,80,1.556,96,3.055,117,1.671,142,5.103,244,2.105,249,5.296,252,2.954,277,1.552,310,5.547,311,5.146,317,3.649,319,3.029,381,3.649,382,3.727,399,2.453,608,5.672,665,3.559,807,5.639,1681,4.034]],["t/566",[0,1.099,7,0.712,9,1.821,16,2.927,27,2.092,29,2.12,57,3.969,77,3.638,81,1.785,83,3.051,105,1.005,149,0.995,241,6.619,243,5.713,244,2.12,354,5.14,603,3.529,606,4.72,623,4.512,635,3.605,658,8.136,659,5.14,1524,5.858,1832,8.367,2097,8.136]],["t/568",[0,1.158,1,1.37,3,1.13,7,0.791,9,1.633,14,1.053,16,2.443,17,0.778,19,3.29,41,1.595,44,2.311,50,2.207,52,3.87,80,1.633,83,2.547,92,2.158,93,2.733,94,1.516,95,1.25,102,1.682,105,0.993,119,3.069,141,1.378,154,2.126,174,3.614,188,3.88,221,2.976,223,2.443,224,1.326,225,3.785,234,3.006,244,1.77,261,2.486,277,1.027,302,2.475,314,2.484,333,3.006,345,3.203,378,3.393,379,2.19,380,1.52,384,2.404,385,2.329,386,2.258,387,2.275,450,1.712,504,2.66,599,2.947,601,3.276,604,2.976,605,2.732,635,2.591,659,5.838,774,3.477,1285,3.94,1286,3.614,1681,4.833]],["t/570",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.452,244,2.196,261,2.828,277,1.275]],["t/572",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,450,1.996,601,3.819,604,3.267,605,3.185,635,3.021]],["t/574",[0,0.691,1,1.154,7,0.694,14,0.647,17,0.551,25,1.228,37,2.145,41,1.283,51,3.083,55,2.343,64,1.769,81,1.305,94,0.853,95,1.118,102,1.704,104,3.038,105,0.878,108,3.556,110,1.16,124,1.695,135,1.815,141,1.207,146,2.284,149,1.126,158,1.097,186,2.719,187,1.025,189,1.12,195,2.329,196,2.267,200,2.343,205,2.401,209,1.756,215,1.6,223,1.453,224,1.218,241,3.286,270,2.938,275,1.127,276,1.127,277,1.068,318,2.535,321,1.143,322,2.235,323,1.848,347,2.07,352,2.209,355,1.411,358,2.002,365,1.082,368,1.104,369,1.719,374,1.201,377,2.473,380,0.904,388,2.916,389,2.608,390,2.608,391,2.608,392,2.608,393,2.836,394,2.632,395,1.795,396,2.455,397,1.274,398,2.276,399,1.84,400,2.226,401,2.209,402,1.274,403,2.189,404,2.209,405,1.274,406,2.047,407,2.419,408,2.455,409,2.904,410,2.226,411,1.283,412,2.469,413,1.293,414,2.455,415,2.419,416,2.384,418,2.399,420,2.511,421,1.264,422,1.274,423,1.875,424,1.246,425,1.808,426,2.235,427,1.274,428,1.322,429,1.264,430,1.274,431,2.226,432,2.226,433,1.274,434,1.756,435,2.416,438,2.401,442,1.719,445,1.283,446,1.283,447,1.283,448,1.283,449,1.274,450,1.018,451,1.097,452,1.283,453,1.848,454,1.274,455,1.283,456,1.283,457,1.283,458,1.283,459,1.283,460,1.889,465,1.274,466,1.283,467,1.322,468,1.293,469,1.283,470,1.283,471,1.283,472,1.293,473,1.293,474,1.293,475,1.322,476,1.283,477,1.283,478,1.293,479,1.293,486,2.492,487,2.333,488,2.249,490,1.151,492,1.834,493,1.246,494,1.184,495,1.255,496,1.228,659,4.919,661,1.61,706,1.332,709,1.312,714,2.715,719,1.962,737,1.61,747,3.252,1152,2.908,1291,1.655,1292,1.655,1293,1.655,1294,1.639,1295,3.252,1298,1.655,1299,2.436,1300,1.639,1301,1.655,1302,2.436,1305,1.655,1306,1.655,1307,1.639,1311,1.67,1681,4.6,1908,4.04,2097,4.04,2098,6.589,2099,7.276,2100,5.948,2101,3.774,2102,4.04,2103,4.839,2104,3.576,2105,3.774,2106,4.442,2107,5.948,2108,3.774,2109,4.04,2110,4.442]],["t/576",[7,0.784,11,3.802,14,0.702,17,0.742,41,1.616,80,1.243,81,1.415,92,2.049,93,2.646,94,1.513,95,1.294,102,1.708,105,0.802,146,1.96,152,2.826,307,3.361,379,2.08,380,1.443,383,5.088,384,2.283,385,2.212,386,2.727,387,3.022,551,3.344,562,3.63,606,3.222,610,2.571,635,2.46,659,6,702,2.718,703,2.571,704,2.718,778,3.865,779,3.742,984,5.711,1578,7.06,1681,5.006,1698,5.711,1720,6.676,2005,8.723,2098,6.943,2111,7.094]],["t/578",[0,0.477,1,1.163,7,0.658,14,0.655,17,0.557,25,1.248,37,2.166,41,1.294,44,1.397,64,1.79,80,0.791,81,1.32,94,0.589,95,1.06,102,1.705,104,3.052,105,0.854,110,1.179,124,1.716,135,1.832,141,1.221,142,2.594,146,2.211,149,1.131,158,1.115,186,2.728,187,1.042,189,1.138,196,2.285,205,1.397,209,1.778,215,1.615,224,1.227,236,2.883,238,3.126,270,2.948,275,1.146,276,1.146,277,1.078,307,1.682,318,2.547,321,1.162,322,2.253,323,1.862,347,2.09,352,2.23,355,1.429,358,2.018,365,1.1,368,1.123,369,1.74,374,1.221,377,2.493,380,0.919,383,4.567,388,2.931,389,2.629,390,2.629,391,2.629,392,2.629,393,2.842,394,2.645,395,1.816,396,2.474,397,1.295,398,2.298,399,1.857,400,2.247,401,2.23,402,1.295,403,2.206,404,2.23,405,1.295,406,2.056,407,2.438,408,2.474,409,2.917,410,2.247,411,1.304,412,2.485,413,1.314,414,2.474,415,2.438,416,2.403,417,2.051,418,2.415,420,2.53,421,1.285,422,1.295,423,1.898,424,1.266,425,1.83,426,2.253,427,1.295,428,1.344,429,1.285,430,1.295,431,2.247,432,2.247,433,1.295,434,1.778,435,2.433,438,2.42,442,1.74,445,1.304,446,1.304,447,1.304,448,1.304,449,1.295,450,1.035,451,1.115,452,1.304,453,1.87,454,1.295,455,1.304,456,1.304,457,1.304,458,1.304,459,1.304,460,1.912,465,1.295,466,1.304,467,1.344,468,1.314,469,1.304,470,1.304,471,1.304,472,1.314,473,1.314,474,1.314,475,1.344,476,1.304,477,1.304,478,1.314,479,1.314,486,2.511,487,2.348,488,2.276,490,1.17,492,1.856,493,1.266,494,1.204,495,1.276,496,1.248,603,1.781,659,2.594,665,1.553,706,1.354,709,1.334,719,1.985,737,1.636,1291,1.682,1292,1.682,1293,1.682,1294,1.666,1298,1.682,1299,2.466,1300,1.666,1301,1.682,1302,2.466,1305,1.682,1306,1.682,1307,1.666,1311,1.698,1578,2.956,1716,3.474,1720,7.104,2083,4.582,2085,4.582,2088,4.582,2098,6.03,2099,6.659,2101,3.837,2102,4.106,2104,3.635,2105,3.837,2108,3.837,2109,4.106,2112,5.625,2113,6.02,2114,4.516,2115,6.02]],["t/580",[1,1.081,7,0.602,14,0.674,17,0.333,25,1.298,37,2.215,41,1.318,64,1.842,81,1.359,94,0.612,95,0.97,102,1.704,104,3.012,105,0.713,110,1.226,124,1.765,135,1.874,141,0.867,146,2.235,149,1.144,158,1.159,186,2.749,187,1.083,189,1.184,195,1.672,196,2.471,197,2.403,205,2.107,209,1.261,210,1.782,215,1.652,224,1.327,270,2.971,275,1.192,276,1.192,277,1.102,318,2.575,321,1.209,322,2.295,323,1.897,347,2.137,352,2.281,355,1.47,358,2.055,365,1.144,368,1.167,369,1.791,374,1.27,377,2.539,380,0.955,388,2.967,389,2.678,390,2.678,391,2.678,392,2.678,393,2.856,394,2.678,395,1.869,396,2.521,397,1.346,398,2.35,399,1.899,400,2.298,401,2.281,402,1.346,403,2.247,404,2.281,405,1.346,406,2.079,407,2.484,408,2.521,409,2.949,410,2.298,411,1.356,412,2.525,413,1.367,414,2.521,415,2.637,416,2.448,418,2.454,420,2.578,421,1.336,422,1.346,423,1.953,424,1.317,425,1.883,426,2.295,427,1.346,428,1.398,429,1.336,430,1.346,431,2.298,432,2.298,433,1.346,434,1.829,435,2.471,438,2.466,442,1.791,445,1.356,446,1.356,447,1.356,448,1.356,449,1.346,450,1.076,451,1.159,452,1.356,453,1.924,454,1.346,455,1.356,456,1.356,457,1.356,458,1.356,459,1.356,460,1.967,465,1.346,466,1.356,467,1.398,468,1.367,469,1.356,470,1.356,471,1.356,472,1.367,473,1.367,474,1.367,475,1.398,476,1.356,477,1.356,478,1.367,479,1.367,486,2.558,487,2.386,488,1.615,490,1.217,492,1.91,493,1.317,494,1.252,495,1.327,496,1.298,610,2.469,659,3.913,706,1.409,709,1.387,719,1.409,737,1.702,1291,1.749,1292,1.749,1293,1.749,1294,1.733,1298,1.749,1299,2.537,1300,1.733,1301,1.749,1302,1.749,1305,1.749,1306,1.749,1307,1.733,1311,1.765,1314,4.999,1315,4.999,1316,3.158,1561,3.251,1681,2.133,1720,6.504,2005,6.765,2112,3.99,2116,4.696,2117,4.271,2118,4.271,2119,4.696,2120,4.696,2121,4.696,2122,4.271,2123,4.696]],["t/582",[7,0.656,14,0.707,17,0.357,25,1.388,27,1.946,37,2.3,41,1.359,64,1.358,79,1.451,81,1.426,94,0.655,95,1.058,102,1.706,105,0.852,110,1.311,117,1.706,120,3.382,124,1.302,135,1.946,141,0.927,146,2.082,149,1.164,158,1.765,164,1.451,186,2.784,187,1.158,189,1.266,196,2.4,209,1.349,210,1.195,215,1.715,224,1.289,270,3.009,275,1.275,276,1.275,277,1.145,293,1.716,297,1.712,318,2.622,321,1.293,322,2.367,323,1.957,347,2.219,352,2.369,354,1.809,355,1.543,358,2.12,365,1.223,368,1.248,369,1.879,374,1.358,377,2.619,380,1.022,388,3.027,389,2.762,390,2.762,391,2.762,392,2.762,393,2.88,394,2.732,395,2.284,396,2.6,397,1.44,398,2.44,399,1.972,400,2.386,401,2.369,402,1.44,403,2.318,404,2.369,405,1.44,406,2.117,407,2.562,408,2.6,409,3.003,410,2.386,411,1.451,412,2.592,413,1.461,414,2.6,415,2.562,416,2.524,418,2.519,420,2.809,421,1.429,422,1.44,423,2.049,424,1.408,425,1.976,426,2.172,427,1.44,428,1.495,429,1.429,430,1.44,431,2.386,432,2.386,433,1.44,434,1.349,435,2.537,438,2.334,442,2.384,445,1.451,446,1.451,447,1.451,448,1.451,449,1.44,450,1.151,451,1.24,452,1.451,453,2.019,454,1.44,455,1.451,456,1.451,457,1.451,458,1.451,459,1.451,460,2.065,465,1.44,466,1.451,467,1.495,468,1.461,469,1.451,470,1.451,471,1.451,472,1.461,473,1.461,474,1.461,475,1.495,476,1.451,477,1.451,478,1.461,479,1.461,486,2.639,487,2.449,490,1.302,492,2.005,493,1.408,494,1.339,495,1.419,496,1.388,659,1.809,706,1.506,707,1.804,708,2.568,709,1.484,710,2.989,711,1.82,712,1.82,713,2.591,717,1.82,718,1.82,719,1.506,720,2.739,721,1.82,723,1.837,1314,1.964,1315,6.212,1316,3.377,1681,4.592,1720,2.33,2098,6.404,2099,7.072,2103,3.715,2104,2.535,2105,2.676,2124,2.864,2125,3.149]],["t/584",[1,0.677,7,0.64,14,0.708,17,0.224,25,1.389,27,1.465,37,2.301,41,1.359,64,1.695,79,0.91,81,1.426,94,0.655,95,1.001,102,1.706,105,0.806,110,1.312,117,1.345,123,3.591,124,1.624,135,1.946,141,0.927,146,2.164,149,1.164,158,1.547,164,0.91,186,2.784,187,1.159,189,1.266,195,1.122,196,2.401,209,1.349,210,1.907,215,1.716,224,1.29,270,3.009,275,1.275,276,1.275,277,1.145,293,1.717,297,1.074,300,1.589,304,1.268,318,2.622,321,1.293,322,2.367,323,1.957,328,4.388,347,2.22,352,2.369,355,1.543,358,2.12,365,1.224,368,1.249,369,1.88,374,1.359,377,2.62,380,1.022,383,2.812,388,3.027,389,2.762,390,2.762,391,2.762,392,2.762,393,2.88,394,2.732,395,2.143,396,2.6,397,1.441,398,2.441,399,1.973,400,2.387,401,2.369,402,1.441,403,2.318,404,2.369,405,1.441,406,2.117,407,2.562,408,2.6,409,3.003,410,2.387,411,1.451,412,2.592,413,1.462,414,2.6,415,2.562,416,2.525,418,2.519,420,2.741,421,1.43,422,1.441,423,2.05,424,1.409,425,1.976,426,2.28,427,1.441,428,1.496,429,1.43,430,1.441,431,2.387,432,2.387,433,1.441,434,1.683,435,2.537,438,2.45,442,2.188,445,1.451,446,1.451,447,1.451,448,1.451,449,1.441,450,1.151,451,1.241,452,1.451,453,2.02,454,1.441,455,1.451,456,1.451,457,1.451,458,1.451,459,1.451,460,2.065,465,1.441,466,1.451,467,1.496,468,1.462,469,1.451,470,1.451,471,1.451,472,1.462,473,1.462,474,1.462,475,1.496,476,1.451,477,1.451,478,1.462,479,1.462,486,2.639,487,2.45,488,1.084,490,1.302,492,2.005,493,1.409,494,1.34,495,1.419,496,1.389,610,1.142,706,1.507,707,1.132,708,1.805,709,1.484,710,2.251,711,1.142,712,1.142,713,1.821,717,1.142,718,1.142,719,0.945,721,1.142,723,1.152,737,1.142,859,1.777,994,2.063,1291,1.174,1292,1.174,1293,1.174,1294,1.163,1298,1.174,1299,1.872,1300,1.163,1301,1.174,1302,1.174,1305,1.174,1306,1.174,1307,1.163,1311,1.185,1314,1.965,1315,5.193,1316,2.119,1317,2.399,1563,2.865,1681,4.119,1682,2.331,1720,5.29,2083,2.181,2085,2.181,2088,2.181,2098,7.53,2101,2.677,2103,2.331,2104,4.045,2108,2.677,2112,2.677,2113,2.865,2115,2.865,2124,2.865,2126,3.151]],["t/586",[0,1.192,7,0.607,17,0.815,31,4.433,50,2.619,75,3.979,80,1.554,81,1.769,105,1.055,117,1.668,244,2.45,249,4.537,252,2.948,277,1.551,703,3.747,1660,6.335,1665,6.335,2007,6.823]],["t/588",[16,3.06,59,5.835,67,4.859,117,1.76,128,5.276,149,1.04,202,3.035,244,2.217,299,3.55,724,4.934]],["t/590",[0,1.175,1,1.317,3,1.086,7,0.796,9,1.548,14,1.021,16,2.246,17,0.758,19,3.119,29,2.445,41,1.6,44,2.124,50,2.029,52,3.669,80,1.548,83,2.341,92,1.983,93,2.591,94,1.506,95,1.243,102,1.7,105,1.001,106,3.567,119,2.821,141,1.267,154,1.954,174,3.322,188,3.567,215,1.415,221,2.736,223,2.246,224,1.257,225,3.64,234,2.763,244,1.627,261,2.356,277,0.944,279,3.463,302,2.38,314,2.283,333,2.763,345,2.944,378,3.119,379,2.013,380,1.397,381,4.386,382,4.813,384,2.21,385,2.141,386,2.075,387,2.692,450,1.573,504,2.445,599,2.709,601,3.011,604,2.822,605,2.511,635,2.382,702,2.631,703,2.489,704,2.631,736,4.662,774,3.196,1285,3.622,1286,3.322,1672,4.591]],["t/592",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.452,244,2.196,261,2.828,277,1.275]],["t/594",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,450,1.996,601,3.819,604,3.267,605,3.185,635,3.021]],["t/597",[0,1.175,3,1.024,6,4.801,7,0.631,23,7.09,90,3.432,105,0.819,117,1.734,202,3.43,231,3.432,597,3.825,724,4.861,894,7.829,2127,9.215]],["t/599",[0,0.839,3,0.513,5,2.65,6,3.054,7,0.663,14,0.665,17,0.328,23,3.549,25,1.275,27,1.855,37,2.193,41,1.307,64,1.248,75,2.07,77,2.733,79,1.332,81,1.583,94,0.601,95,1.023,102,1.703,105,0.86,106,5.025,110,1.204,117,1.82,120,3.414,124,1.196,135,1.855,141,0.851,146,2.013,149,1.138,158,1.66,164,1.332,186,2.739,187,1.064,189,1.163,196,2.308,202,1.497,209,1.239,215,1.91,224,1.318,231,1.718,270,2.96,275,1.171,276,1.171,277,1.091,297,1.573,318,2.562,321,1.187,322,2.276,323,1.881,347,2.115,352,2.258,355,1.451,358,2.038,365,1.123,368,1.147,369,1.767,374,1.248,377,2.518,380,0.938,381,4.205,382,2.821,388,2.951,389,2.655,390,2.655,391,2.655,392,2.655,393,2.85,394,2.663,395,2.177,396,2.499,397,1.322,398,2.326,399,1.88,400,2.275,401,2.258,402,1.322,403,2.228,404,2.258,405,1.322,406,2.069,407,2.463,408,2.499,409,2.935,410,2.275,411,1.332,412,2.507,413,1.342,414,2.499,415,2.463,416,2.427,418,2.436,420,2.717,421,1.313,422,1.322,423,1.928,424,1.294,425,1.858,426,2.071,427,1.322,428,1.373,429,1.313,430,1.322,431,2.275,432,2.275,433,1.322,434,1.239,435,2.454,438,2.225,442,2.292,445,1.332,446,1.332,447,1.332,448,1.332,449,1.322,450,1.057,451,1.139,452,1.332,453,1.899,454,1.322,455,1.332,456,1.332,457,1.332,458,1.332,459,1.332,460,1.942,465,1.322,466,1.332,467,1.373,468,1.342,469,1.332,470,1.332,471,1.332,472,1.342,473,1.342,474,1.342,475,1.373,476,1.332,477,1.332,478,1.342,479,1.342,486,2.537,487,2.369,490,1.196,492,1.885,493,1.294,494,1.23,495,1.303,496,1.275,692,2.36,706,1.383,707,1.657,708,2.415,709,1.363,710,2.85,711,1.672,712,1.672,713,2.437,717,1.672,718,1.672,719,1.383,720,2.576,721,1.672,723,1.687,736,5.4,965,2.756,1312,2.945,1672,3.492,1677,2.814,2128,4.613]],["t/601",[0,1.203,80,1.6,105,0.812,117,1.718,250,6.415,265,8.091,596,6.559,693,6.942,2129,9.562,2130,11.076,2131,9.13]],["t/604",[0,0.987,1,1.259,79,2.697,141,1.723,202,3.456,231,3.478,299,3.543,302,2.274,701,7.184,724,4.925]],["t/606",[0,0.693,1,1.418,7,0.664,14,0.704,25,1.379,29,1.965,37,2.292,41,1.355,64,1.349,75,2.632,77,3.487,79,1.441,80,0.673,81,1.654,94,1.118,95,1.108,99,8,102,1.704,105,0.873,106,4.136,110,1.302,124,1.293,135,1.939,141,1.582,146,2.076,149,1.162,158,2.047,186,2.78,187,1.151,189,1.257,196,2.393,209,1.34,215,1.863,224,1.313,236,1.451,238,1.573,270,3.005,275,1.266,276,1.266,277,1.14,297,1.701,299,3.504,318,2.617,321,1.284,322,2.36,323,1.951,347,2.211,352,2.36,355,1.535,358,2.113,365,1.215,368,1.24,369,1.87,374,1.349,377,2.611,380,1.015,382,3.598,388,3.021,389,2.753,390,2.753,391,2.753,392,2.753,393,2.878,394,2.727,395,2.275,396,2.592,397,1.43,398,2.431,399,1.965,400,2.377,401,2.36,402,1.43,403,2.311,404,2.36,405,1.43,406,2.113,407,2.554,408,2.592,409,2.998,410,2.377,411,1.441,412,2.243,413,1.452,414,2.592,415,2.554,416,1.389,418,2.512,421,1.42,422,1.43,423,2.04,424,1.399,425,1.966,426,2.164,427,1.43,428,1.485,429,1.42,430,1.43,431,2.377,432,2.377,433,1.43,434,1.34,435,2.53,438,2.325,442,2.376,445,1.441,446,1.441,447,1.441,448,1.441,449,1.43,450,1.143,451,1.232,452,1.441,453,2.01,454,1.43,455,1.441,456,1.441,457,1.441,458,1.441,459,1.441,460,2.055,465,1.43,466,1.441,467,1.485,468,1.452,469,1.441,470,1.441,471,1.441,472,1.452,473,1.452,474,1.452,475,1.485,476,1.441,477,1.441,478,1.452,479,1.452,486,2.631,487,2.443,488,1.715,490,1.293,492,1.995,493,1.399,494,1.33,495,1.409,496,1.379,610,1.808,706,1.496,736,3.458,742,3.564,843,5.918,900,2.249,1312,1.451,1591,1.282,1605,8,1651,1.573,1672,1.995,1677,2.343,1702,2.067,1733,2.744,2132,4.239,2133,3.493,2134,3.841,2135,3.493,2136,9.937,2137,8,2138,9.036,2139,6.045,2140,6.045,2141,2.955,2142,3.493,2143,4.239,2144,4.239,2145,4.239,2146,2.744,2147,3.493,2148,4.239,2149,4.537,2150,4.239,2151,2.273,2152,3.493,2153,4.537,2154,2.273,2155,2.273,2156,2.067]],["t/608",[0,0.972,1,1.443,7,0.63,14,0.854,17,0.47,25,1.249,29,2.178,33,5.333,37,2.167,41,1.294,64,1.222,67,2.348,75,2.028,79,1.913,80,0.792,81,1.564,85,2.158,94,0.863,95,1.015,96,2.696,102,1.702,105,0.817,106,4.485,110,1.18,124,1.171,135,1.833,141,1.593,144,2.104,146,1.997,149,1.132,150,1.653,158,1.936,186,2.728,187,1.043,189,1.139,196,2.286,202,2.544,209,1.214,215,1.616,223,1.478,224,1.228,231,3.216,270,2.949,275,1.147,276,1.147,277,1.078,297,1.541,299,3.767,302,1.101,318,2.548,321,1.163,322,2.254,323,1.863,341,4.11,347,2.091,352,2.231,355,1.43,358,2.019,365,1.101,368,1.124,369,1.741,374,1.222,377,2.494,380,0.919,381,4.181,382,3.857,388,2.932,389,2.63,390,2.63,391,2.63,392,2.63,393,2.842,394,2.646,395,2.151,396,2.475,397,1.296,398,2.299,399,1.858,400,2.248,401,2.231,402,1.296,403,2.207,404,2.231,405,1.296,406,2.057,407,2.439,408,2.475,409,2.918,410,2.248,411,1.305,412,2.121,413,1.315,414,2.475,415,2.439,416,1.258,418,2.416,421,1.286,422,1.296,423,1.899,424,1.267,425,1.831,426,2.047,427,1.296,428,1.345,429,1.286,430,1.296,431,2.248,432,2.248,433,1.296,434,1.214,435,2.433,438,2.199,442,2.27,445,1.305,446,1.305,447,1.305,448,1.305,449,1.296,450,1.036,451,1.116,452,1.305,453,1.871,454,1.296,455,1.305,456,1.305,457,1.305,458,1.305,459,1.305,460,1.913,465,1.296,466,1.305,467,1.345,468,1.315,469,1.305,470,1.305,471,1.305,472,1.315,473,1.315,474,1.315,475,1.345,476,1.305,477,1.305,478,1.315,479,1.315,486,2.513,487,2.349,488,1.554,490,1.171,492,1.858,493,1.267,494,1.205,495,1.277,496,1.249,597,1.876,670,2.005,706,1.356,736,4.555,742,3.229,763,2.505,965,2.7,1222,3.478,1520,3.478,1672,4.485,1677,2.757,1733,3.229,1745,3.639,1783,2.819,2132,3.84,2133,4.11,2135,4.11,2139,5.628,2140,5.628,2142,4.11,2143,3.84,2144,3.84,2145,3.84,2147,4.11,2148,3.84,2150,3.84,2152,4.11,2157,4.11,2158,4.52,2159,4.52,2160,4.52,2161,4.52,2162,4.52]],["t/611",[0,0.956,7,0.756,9,1.585,44,2.798,67,5.731,75,4.06,105,0.804,160,4.772,202,2.935,215,2.156,224,1.286,231,3.896,442,2.378,647,4.21,654,4.808,1723,7.282,1728,8.226,1749,5.922,2001,8.226,2157,8.226,2163,8.226]],["t/613",[0,0.513,7,0.417,14,0.691,17,0.345,25,1.342,29,0.716,37,2.258,41,1.338,64,1.313,67,5.197,75,1.355,77,1.228,79,1.403,81,1.525,94,0.633,95,1.176,102,1.707,105,0.932,106,1.569,110,1.268,116,2.319,124,1.259,135,1.91,141,0.896,146,2.055,149,1.165,158,1.723,186,2.767,187,1.12,189,1.224,196,2.364,209,1.304,215,1.949,224,1.27,226,2.082,231,1.125,244,0.716,270,2.99,275,1.233,276,1.233,277,1.124,297,1.656,318,2.599,321,1.25,322,2.331,323,1.927,345,2.082,347,2.178,352,2.325,355,1.506,358,2.088,365,1.183,368,1.207,369,1.834,374,1.313,377,2.579,380,0.988,381,4.045,382,4.198,388,2.997,389,2.72,390,2.72,391,2.72,392,2.72,393,2.868,394,2.705,395,2.241,396,2.56,397,1.392,398,2.395,399,1.936,400,2.342,401,2.325,402,1.392,403,2.282,404,2.325,405,1.392,406,2.098,407,2.523,408,2.56,409,2.976,410,2.342,411,1.403,412,2.558,413,1.413,414,2.56,415,2.523,416,2.486,418,2.486,420,2.618,421,1.382,422,1.392,423,2.001,424,1.362,425,1.929,426,2.132,427,1.392,428,1.446,429,1.382,430,1.392,431,2.342,432,2.342,433,1.392,434,1.304,435,2.504,438,2.291,442,2.589,445,1.403,446,1.403,447,1.403,448,1.403,449,1.392,450,1.113,451,1.199,452,1.403,453,1.971,454,1.392,455,1.403,456,1.403,457,1.403,458,1.403,459,1.403,460,2.016,465,1.392,466,1.403,467,1.446,468,1.413,469,1.403,470,1.403,471,1.403,472,1.413,473,1.413,474,1.413,475,1.446,476,1.403,477,1.403,478,1.413,479,1.413,486,2.599,487,2.418,488,1.67,490,1.259,492,1.957,493,1.362,494,1.295,495,1.372,496,1.342,564,1.735,610,1.094,697,2.157,706,1.457,708,1.744,709,1.435,719,1.457,736,5.761,865,1.339,1311,1.826,1396,3.91,1672,2.523,1723,8.438,1724,4.126,2156,2.746,2164,3.02,2165,4.857,2166,4.857,2167,8.169,2168,4.857,2169,4.857,2170,4.857,2171,4.857,2172,4.857,2173,3.02,2174,3.02,2175,3.02,2176,3.02]],["t/616",[0,0.958,7,0.621,9,1.588,30,2.803,75,4.699,77,3.684,94,1.181,105,0.931,128,5.111,139,5.111,149,1.007,150,3.314,202,3.397,223,2.964,231,3.375,232,5.933,259,6.273,393,2.268,724,4.78,932,5.529,1478,6.973,1632,8.241,1651,6.273,2177,6.973]],["t/618",[0,0.449,7,0.7,14,0.748,17,0.449,20,1.927,25,1.173,29,2.305,30,1.313,37,2.089,41,1.255,51,2,64,1.148,77,1.725,79,1.226,80,0.743,81,1.261,94,1.224,95,1.148,102,1.703,105,0.95,106,5.55,110,1.108,116,3.019,120,1.498,124,1.1,128,3.566,135,1.767,141,0.783,146,2.04,149,1.156,158,1.561,163,3.284,186,2.693,187,0.979,189,1.07,195,1.511,196,2.217,202,2.051,209,1.14,215,1.557,223,2.472,224,1.191,229,3.265,270,2.911,275,1.077,276,1.077,277,1.152,297,1.447,301,2.937,318,2.502,321,1.092,322,2.186,323,1.807,347,2.015,352,2.151,355,1.364,358,1.958,365,1.033,368,1.055,369,1.662,370,2.854,374,1.148,377,2.419,378,1.927,380,0.863,381,4.436,388,2.873,389,2.551,390,2.551,391,2.551,392,2.551,393,2.818,394,2.593,395,2.073,396,2.401,397,1.217,398,2.216,399,2.122,400,2.167,401,2.151,402,1.217,403,2.14,404,2.151,405,1.217,406,2.02,407,2.366,408,2.401,409,2.866,410,2.167,411,1.226,412,2.422,413,1.235,414,2.401,415,2.366,416,2.493,417,1.927,418,2.354,420,2.626,421,1.208,422,1.217,423,1.813,424,1.19,425,1.747,426,1.972,427,1.217,428,1.263,429,1.208,430,1.217,431,2.167,432,2.167,433,1.217,434,1.14,435,2.371,438,2.119,442,2.468,445,1.226,446,1.226,447,1.226,448,1.226,449,1.217,450,0.972,451,1.048,452,1.226,453,1.786,454,1.217,455,1.226,456,1.226,457,1.226,458,1.226,459,1.226,460,1.826,465,1.217,466,1.226,467,1.263,468,1.235,469,1.226,470,1.226,471,1.226,472,1.235,473,1.235,474,1.235,475,1.263,476,1.226,477,1.226,478,1.235,479,1.235,486,2.437,487,2.289,488,1.459,490,1.1,492,1.773,493,1.19,494,1.131,495,1.199,496,1.173,610,1.538,706,1.273,709,1.254,719,1.273,733,3.606,734,6.421,735,9.176,736,5.131,737,2.291,738,6.421,739,3.606,740,3.606,741,3.606,742,3.032,743,3.606,744,3.606,745,3.606,746,3.606,848,3.859,854,2.352,924,3.032,932,2.589,965,3.777,1020,3.859,1294,1.566,1300,1.566,1307,2.333,1519,2.854,1641,3.859,1677,2.589,1737,3.139,2178,7.609,2179,5.372,2180,3.606,2181,3.606,2182,4.244,2183,4.244,2184,4.244,2185,4.244,2186,4.244,2187,4.244]],["t/620",[7,0.586,9,1.5,55,4.515,60,6.891,94,1.32,105,0.959,116,5.149,128,4.828,231,3.772,236,5.465,243,6.886,269,7.963,277,1.177,304,3.444,323,2.405,348,5.439,355,2.327,359,3.711,371,5.712,399,2.028,403,2.756,913,5.925,1077,4.828,1592,7.783,1605,8.152,1926,6.332,2188,6.891,2189,8.559,2190,10.785,2191,8.559,2192,10.785,2193,8.559,2194,8.559]],["t/622",[0,1.207,1,1.168,7,0.782,9,1.518,67,5.298,75,4.577,77,4.407,79,2.503,90,3.227,94,1.129,105,1.028,117,1.919,128,4.887,141,1.882,149,0.963,183,3.888,223,3.336,231,3.227,232,5.672,289,4.326,299,3.288,302,2.11,345,3.715,490,2.644,693,6.223,698,7.287,763,4.801,1907,6.975]],["t/624",[0,0.929,16,3.677,67,5.342,79,2.538,117,2.051,128,5.801,188,4.565,202,3.826,247,5.481,277,1.576,299,3.903,494,2.343,502,4.87,731,9.552,732,7.193]],["t/626",[0,1.141,1,1.156,3,0.953,7,0.587,14,0.848,16,2.805,17,0.72,29,2.032,31,3.676,32,3.559,41,1.285,50,2.994,75,3.848,81,2.022,94,1.118,105,0.96,115,5.766,149,0.953,150,3.136,157,5.122,244,2.032,265,6.597,307,3.193,321,2.609,324,4.671,533,4.094,550,6.343,564,6.538,615,4.263,623,4.324,647,3.991,665,2.948,1642,7.797,1660,6.125,1665,6.125,1783,5.348,2061,6.125,2062,7.8,2195,7.257,2196,10.137,2197,8.574,2198,8.574]],["t/628",[0,1.101,1,1.211,3,1.1,7,0.806,9,1.234,10,3.604,13,2.553,14,0.979,16,2.304,17,0.764,19,3.17,29,2.344,32,4.106,41,1.613,44,2.779,50,2.081,52,3.729,80,1.574,83,2.402,92,2.034,93,2.634,94,1.533,95,1.28,96,3.582,102,1.696,105,0.957,119,3.69,141,1.3,154,2.964,174,3.408,188,3.659,205,2.179,221,2.806,223,2.304,224,1.277,225,3.684,234,2.834,244,1.669,277,0.969,302,2.409,314,2.342,319,3.552,333,2.834,344,2.362,379,2.065,380,1.433,384,2.267,385,2.196,386,2.715,387,2.736,450,1.614,601,3.088,604,2.868,605,2.576,635,2.443,773,4.611,774,3.278,1018,3.903,1286,3.408,1456,5.032]],["t/630",[7,0.638,9,1.633,10,4.769,83,3.178,102,1.299,154,3.028,205,2.883,224,1.325,225,3.471,244,2.208,277,1.282]],["t/632",[0,1.185,1,1.379,3,0.968,7,0.768,14,1.012,17,0.727,41,1.628,44,2.694,50,2.573,52,4.247,94,1.461,95,1.199,105,1.016,141,1.607,154,2.479,221,3.47,234,3.505,302,2.645,314,2.896,333,3.505,450,1.996,601,3.819,604,3.267,605,3.185,635,3.021]],["t/635",[7,0.774,17,0.555,27,1.827,29,2.562,31,4.757,32,4.605,41,1.554,44,2.417,92,2.257,93,2.81,94,1.526,95,1.262,96,3.566,102,1.707,224,1.111,319,3.535,379,2.291,380,1.589,384,2.515,385,2.436,386,2.897,387,3.158,604,2.495,860,4.989,865,3.466]],["t/637",[0,0.826,1,1.053,3,0.499,7,0.71,14,0.652,17,0.319,25,1.241,29,1.064,31,3.931,32,3.978,37,2.159,41,1.29,50,1.327,64,1.783,81,1.315,94,1.291,95,0.862,102,1.703,104,2.971,105,0.922,110,1.172,124,1.709,135,1.826,141,0.829,146,2.207,149,1.13,150,3.353,158,1.109,176,1.673,186,2.725,187,1.036,189,1.132,196,2.279,209,1.206,210,1.704,215,1.61,224,1.224,261,1.758,270,2.945,275,1.14,276,1.14,277,1.074,318,2.543,321,1.156,322,2.247,323,1.858,347,2.083,352,2.223,355,1.423,358,2.012,365,1.094,368,1.116,369,1.733,374,1.215,377,2.486,380,0.914,388,2.926,389,2.622,390,2.622,391,2.622,392,2.622,393,2.84,394,2.641,395,1.809,396,2.468,397,1.288,398,2.29,399,1.851,400,2.24,401,2.223,402,1.288,403,2.2,404,2.223,405,1.288,406,2.053,407,2.432,408,2.468,409,2.913,410,2.24,411,1.297,412,2.48,413,1.307,414,2.468,415,2.432,416,2.396,417,2.04,418,2.41,420,2.524,421,1.278,422,1.288,423,1.89,424,1.259,425,1.822,426,2.247,427,1.288,428,1.337,429,1.278,430,1.288,431,2.24,432,2.24,433,1.288,434,1.77,435,2.427,438,2.414,442,1.733,445,1.297,446,1.297,447,1.297,448,1.297,449,1.288,450,1.029,451,1.109,452,1.297,453,1.863,454,1.288,455,1.297,456,1.297,457,1.297,458,1.297,459,1.297,460,1.904,465,1.288,466,1.297,467,1.337,468,1.307,469,1.297,470,1.297,471,1.297,472,1.307,473,1.307,474,1.307,475,1.337,476,1.297,477,1.297,478,1.307,479,1.307,486,2.505,487,2.343,488,1.544,490,1.164,492,1.849,493,1.259,494,1.197,495,1.269,496,1.241,604,1.434,606,4.164,660,2.801,706,1.347,709,1.327,719,1.347,737,1.628,808,3.208,858,2.74,1291,1.673,1292,1.673,1293,1.673,1294,1.657,1298,1.673,1299,2.456,1300,1.657,1301,1.673,1302,1.673,1305,1.673,1306,1.673,1307,1.657,1311,1.688,1717,6.783,1804,3.615,1807,3.455,1811,3.615,2051,4.084,2199,7.828,2200,7.828,2201,9.169,2202,4.491,2203,4.491,2204,4.084,2205,4.084,2206,4.491,2207,4.491,2208,4.491]],["t/639",[0,0.822,1,0.883,3,0.728,7,0.654,13,1.613,14,0.769,16,1.456,17,0.465,25,1.23,27,1.817,29,1.055,30,1.377,31,4.435,37,2.148,41,1.285,64,1.204,79,1.285,80,1.147,81,1.55,94,0.58,95,1.054,102,1.701,105,0.849,109,2.213,110,1.162,117,1.719,120,3.224,124,1.153,130,2.636,135,1.817,141,0.821,146,1.984,149,1.169,158,1.617,164,1.285,183,1.997,186,2.72,187,1.027,189,1.122,196,2.269,200,2.348,209,1.195,215,1.602,224,1.299,261,1.187,270,2.939,275,1.13,276,1.13,277,1.069,288,2.213,297,1.517,304,1.791,307,1.658,318,2.537,319,2.65,321,1.145,322,2.237,323,1.85,347,2.072,352,2.212,355,1.677,358,2.004,359,1.93,365,1.084,368,1.106,369,1.722,374,1.204,377,2.475,380,0.905,388,2.918,389,2.61,390,2.61,391,2.61,392,2.61,393,2.836,394,2.702,395,2.132,396,2.457,397,1.276,398,2.278,399,1.842,400,2.228,401,2.212,402,1.276,403,2.19,404,2.212,405,1.276,406,2.048,407,2.421,408,2.457,409,2.905,410,2.228,411,1.285,412,2.47,413,1.295,414,2.457,415,2.421,416,2.386,417,2.974,418,2.401,420,2.678,421,1.266,422,1.276,423,1.878,424,1.248,425,1.81,426,2.028,427,1.276,428,1.325,429,1.266,430,1.276,431,2.228,432,2.228,433,1.276,434,1.195,435,2.418,438,2.179,442,2.253,445,1.285,446,1.285,447,1.285,448,1.285,449,1.276,450,1.02,451,1.099,452,1.285,453,1.85,454,1.276,455,1.285,456,1.285,457,1.285,458,1.285,459,1.285,460,1.892,465,1.276,466,1.285,467,1.325,468,1.295,469,1.285,470,1.285,471,1.285,472,1.295,473,1.295,474,1.295,475,1.325,476,1.285,477,1.285,478,1.295,479,1.295,486,2.494,487,2.335,490,1.153,492,1.837,493,1.248,494,1.187,495,1.257,496,1.23,533,2.125,612,2.466,626,1.93,665,1.53,692,2.277,706,1.335,707,1.599,708,2.352,709,1.315,710,2.791,711,1.613,712,1.613,713,2.374,717,1.613,718,1.613,719,1.335,720,2.509,721,1.613,723,1.627,803,4.845,818,2.659,858,2.715,865,1.974,961,2.557,1018,2.466,1216,2.715,1518,2.993,1554,3.424,1591,2.51,1606,2.776,1683,2.842,1807,3.424,1968,4.047,2037,3.424,2199,9.407,2200,9.407,2204,4.047,2205,4.047,2209,4.451,2210,3.08]],["t/641",[27,2.158,45,4.467,81,1.842,105,0.941,149,1.237,150,3.87,277,1.27,279,4.656,615,4.59,759,5.758,830,6.928,2006,6.39]],["t/643",[0,1.145,6,3.929,7,0.796,9,1.999,14,0.658,17,0.614,27,2.023,41,1.624,51,4.078,77,2.701,80,1.164,92,1.919,93,2.537,94,1.515,95,1.259,102,1.704,105,0.906,147,5.725,150,2.43,195,2.366,250,4.054,272,3.304,279,5.91,302,1.618,379,1.948,380,1.352,384,2.139,385,2.072,386,2.615,387,2.93,504,3.425,523,3.561,596,4.145,603,2.621,613,2.121,660,4.145,684,2.914,702,2.546,703,2.408,704,2.546,778,3.62,779,3.505,994,4.35,1244,6.043,1524,4.35,1628,5.35,1844,6.659,1912,6.043,1954,5.646,1980,5.646,2006,5.989,2211,8.275,2212,8.721,2213,6.645,2214,6.645,2215,6.645]],["t/645",[0,0.678,1,1.03,7,0.648,13,3.272,14,0.635,17,0.455,25,1.195,37,2.112,41,1.267,64,1.734,80,0.758,81,1.279,94,0.564,95,1.044,102,1.705,104,3.015,105,0.841,108,2.847,110,1.129,124,1.662,135,1.787,141,1.183,146,2.184,147,4.427,149,1.117,158,2.334,186,2.704,187,0.998,189,1.09,196,2.238,205,1.338,209,1.722,215,1.575,224,1.284,270,2.922,275,1.098,276,1.098,277,1.051,279,4.553,318,2.516,321,1.113,322,2.206,323,1.824,347,2.038,352,2.175,355,1.384,358,1.976,365,1.053,368,1.075,369,1.686,374,1.17,377,2.442,380,0.88,388,2.891,389,2.575,390,2.575,391,2.575,392,2.575,393,2.825,394,2.609,395,1.76,396,2.423,397,1.24,398,2.241,399,1.811,400,2.191,401,2.175,402,1.24,403,2.16,404,2.175,405,1.24,406,2.031,407,2.388,408,2.423,409,2.882,410,2.191,411,1.249,412,2.442,413,1.259,414,2.423,415,2.388,416,2.353,418,2.373,420,2.478,421,1.231,422,1.24,423,1.839,424,1.213,425,1.772,426,2.206,427,1.24,428,1.287,429,1.231,430,1.24,431,2.191,432,2.191,433,1.24,434,1.722,435,2.39,438,2.37,442,1.686,445,1.249,446,1.249,447,1.249,448,1.249,449,1.24,450,0.991,451,1.068,452,1.249,453,1.812,454,1.24,455,1.249,456,1.249,457,1.249,458,1.249,459,1.249,460,1.852,465,1.24,466,1.249,467,1.287,468,1.259,469,1.249,470,1.249,471,1.249,472,1.259,473,1.259,474,1.259,475,1.287,476,1.249,477,1.249,478,1.259,479,1.259,486,2.46,487,2.307,488,2.205,490,1.121,492,1.798,493,1.213,494,1.153,495,1.222,496,1.195,661,3.272,690,3.675,706,1.297,709,1.278,714,1.796,719,1.923,737,1.568,747,2.151,759,5.631,1291,1.611,1292,1.611,1293,1.611,1294,1.596,1295,2.151,1298,1.611,1299,2.389,1300,1.596,1301,1.611,1302,2.389,1305,1.611,1306,1.611,1307,1.596,1311,1.626,1844,6.249,2211,5.654,2212,8.092,2216,9.638,2217,8.209,2218,6.494,2219,4.326,2220,5.832,2221,3.675,2222,3.933,2223,3.933,2224,3.933,2225,3.933,2226,3.675,2227,3.675,2228,4.326,2229,4.326,2230,4.326,2231,3.933,2232,3.675,2233,3.933]],["t/647",[0,0.718,1,0.63,7,0.638,9,1.757,14,0.791,17,0.482,25,1.292,27,2.051,37,2.209,41,1.315,64,1.264,79,1.35,81,1.354,94,0.609,95,1.028,102,1.703,105,0.828,108,3.62,110,1.22,117,1.65,120,3.288,124,1.211,135,1.869,141,0.862,146,2.024,149,1.142,158,1.676,164,1.35,183,2.098,186,2.746,187,1.078,189,1.178,196,2.467,209,1.255,215,1.647,224,1.247,250,2.851,270,2.968,275,1.186,276,1.186,277,1.099,296,2.792,297,1.594,318,2.572,321,1.203,322,2.29,323,1.893,347,2.131,352,2.275,355,1.465,358,2.051,365,1.138,368,1.162,369,1.784,374,1.264,377,2.534,380,0.951,388,2.963,389,2.672,390,2.672,391,2.672,392,2.672,393,2.855,394,2.674,395,2.193,396,2.515,397,1.34,398,2.344,399,2.079,400,2.292,401,2.275,402,1.34,403,2.242,404,2.275,405,1.34,406,2.117,407,2.478,408,2.515,409,2.946,410,2.292,411,1.35,412,2.52,413,1.36,414,2.515,415,2.478,416,2.442,418,2.449,420,2.732,421,1.33,422,1.34,423,1.946,424,1.311,425,1.876,426,2.086,427,1.34,428,1.391,429,1.33,430,1.34,431,2.292,432,2.292,433,1.34,434,1.255,435,2.467,438,2.242,442,2.306,445,1.35,446,1.35,447,1.35,448,1.35,449,1.34,450,1.071,451,1.154,452,1.35,453,1.918,454,1.34,455,1.35,456,1.35,457,1.35,458,1.35,459,1.35,460,1.961,465,1.34,466,1.35,467,1.391,468,1.36,469,1.35,470,1.35,471,1.35,472,1.36,473,1.36,474,1.36,475,1.391,476,1.35,477,1.35,478,1.36,479,1.36,486,2.553,487,2.381,490,1.211,492,1.904,493,1.311,494,1.246,495,1.32,496,1.292,504,1.664,661,1.694,706,1.402,707,1.679,708,2.438,709,1.381,710,2.871,711,1.694,712,1.694,713,2.46,714,1.94,717,1.694,718,1.694,719,1.402,720,2.601,721,1.694,723,1.709,1591,2.636,2218,8.521,2227,3.971,2234,3.971,2235,4.25]],["t/649",[1,0.314,7,0.637,9,1.343,14,0.713,17,0.279,25,1.404,27,1.685,37,2.315,41,1.366,55,1.229,64,1.612,79,1.133,81,1.438,94,0.662,95,1.027,102,1.707,105,0.827,108,3.395,110,1.326,117,1.515,120,2.347,123,3.058,124,1.545,135,1.958,141,0.938,146,2.147,147,3.262,149,1.168,150,0.852,158,2.137,164,1.133,186,2.79,187,1.172,189,1.281,192,1.793,196,2.413,209,1.364,215,1.726,224,1.296,270,3.015,275,1.29,276,1.29,277,1.152,279,3.354,297,1.338,318,2.63,321,1.308,322,2.379,323,1.967,328,3.709,347,2.233,352,2.384,355,1.555,358,2.131,365,1.237,368,1.263,369,1.895,374,1.374,377,2.633,380,1.034,388,3.037,389,2.776,390,2.776,391,2.776,392,2.776,393,2.884,394,2.741,395,2.209,396,2.613,397,1.457,398,2.456,399,1.985,400,2.401,401,2.384,402,1.457,403,2.33,404,2.384,405,1.457,406,2.123,407,2.575,408,2.613,409,3.012,410,2.401,411,1.468,412,2.603,413,1.479,414,2.613,415,2.575,416,2.538,418,2.53,420,2.778,421,1.446,422,1.457,423,2.066,424,1.425,425,1.992,426,2.26,427,1.457,428,1.512,429,1.446,430,1.457,431,2.401,432,2.401,433,1.457,434,1.601,435,2.548,438,2.428,442,2.276,445,1.468,446,1.468,447,1.468,448,1.468,449,1.457,450,1.164,451,1.254,452,1.468,453,2.036,454,1.457,455,1.468,456,1.468,457,1.468,458,1.468,459,1.468,460,2.082,465,1.457,466,1.468,467,1.512,468,1.479,469,1.468,470,1.468,471,1.468,472,1.479,473,1.479,474,1.479,475,1.512,476,1.468,477,1.468,478,1.479,479,1.479,486,2.653,487,2.46,488,0.801,490,1.317,492,2.021,493,1.425,494,1.355,495,1.435,496,1.404,661,0.845,706,1.524,707,1.409,708,2.141,709,1.501,710,2.589,711,1.422,712,1.422,713,2.16,714,1.629,717,1.422,718,1.422,719,1.177,720,1.503,721,1.422,723,1.435,737,0.845,759,4.149,859,1.314,1052,1.292,1291,0.868,1292,0.868,1293,0.868,1294,0.86,1298,0.868,1299,1.461,1300,0.86,1301,0.868,1302,0.868,1305,0.868,1306,0.868,1307,0.86,1311,0.876,1317,1.873,1534,3.307,1683,1.488,2037,1.793,2211,3.759,2212,6.172,2216,8.095,2217,6.048,2218,7.563,2220,2.119,2221,1.98,2222,2.119,2223,2.119,2224,2.119,2225,2.119,2226,1.98,2227,3.334,2231,2.119,2232,1.98,2233,2.119,2234,1.98,2235,2.119,2236,2.331,2237,2.331,2238,2.331]],["t/651",[0,1.16,7,0.711,9,1.562,17,0.826,31,4.447,80,1.562,105,0.922,117,1.677,149,0.991,154,2.951,244,2.599,252,2.964,277,1.553,703,3.759,759,5.561,830,6.79,1660,7.409]],["t/653",[0,1.095,7,0.71,8,7.561,16,2.911,17,0.736,30,3.205,83,3.034,90,3.314,95,0.982,105,0.791,115,5.984,133,4.492,149,1.218,150,3.254,196,2.356,244,2.109,301,7.587,317,3.655,504,3.168,551,4.883,582,5.019,873,8.092,975,5.826,1212,5.551,1844,6.16,1954,7.561,2239,8.899]],["t/655",[0,1.215,1,1.412,3,1.211,7,0.765,9,1.835,14,1.036,16,2.614,17,0.744,19,3.695,27,1.868,41,1.57,44,2.472,50,2.36,52,4.034,80,1.4,83,2.725,94,1.48,95,1.203,102,1.114,105,1.022,110,2.086,119,3.282,141,1.474,149,1.08,154,2.274,174,3.866,221,3.183,223,2.614,224,1.382,225,3.9,234,3.216,244,1.894,261,2.591,277,1.099,302,2.55,314,2.657,333,3.216,345,3.426,450,1.831,504,3.879,601,3.504,604,3.343,605,2.922,635,2.771,684,3.504,773,5.231,774,3.719,1286,3.866]],["t/657",[0,0.98,1,1.249,7,0.635,9,1.624,14,0.917,17,0.658,83,3.16,102,1.292,105,0.824,224,1.318,225,3.452,244,2.196,261,2.828,277,1.275]],["t/659",[0,1.217,1,1.36,3,0.945,7,0.762,14,0.998,17,0.716,27,1.987,41,1.612,44,2.629,50,2.511,52,4.186,94,1.501,95,1.228,105,1.024,110,2.219,141,1.568,149,1.121,154,2.419,221,3.386,234,3.421,302,2.619,314,2.826,333,3.421,450,1.948,504,3.59,601,3.727,604,3.433,605,3.108,635,2.948,684,3.727]],["t/661",[0,1.239,1,1.191,7,0.786,9,1.548,79,3.156,94,1.345,95,0.975,105,0.972,117,1.662,302,2.151,314,3.431,323,1.907,417,4.686,451,2.181,504,3.673,518,6.754,564,5.075,597,3.668,610,3.202,753,5.174,1083,6.312,1535,7.507]],["t/663",[0,1.158,7,0.787,14,0.685,17,0.631,27,2.294,29,2.453,41,1.471,51,4.188,57,4.859,75,3.108,92,2,93,2.605,94,1.548,95,1.29,96,3.681,102,1.707,105,0.79,216,3.978,307,2.579,319,3.798,324,3.773,379,2.03,380,1.409,384,2.229,385,2.159,386,2.686,387,2.988,504,3.811,604,3.133,613,3.497,630,4.137,635,2.402,660,4.319,670,3.072,684,3.896,702,2.653,703,2.51,704,2.653,793,5.817,805,5.328,975,4.534,1534,3.443,1597,4.793,2240,6.925,2241,6.297]],["t/665",[0,0.985,75,4.182,95,1.029,143,7.171,211,5.077,216,5.354,504,3.318,961,5.354,975,6.101,1630,7.918,2242,7.918,2243,8.475]],["t/667",[0,0.995,1,1.023,7,0.731,9,0.58,11,0.719,12,1.867,14,0.772,17,0.483,25,1.294,27,2.134,28,1.777,29,1.979,37,2.212,41,1.368,50,0.396,51,1.141,57,3.63,64,1.266,79,1.352,80,0.235,81,1.466,85,3.245,92,0.388,93,0.71,94,1.215,95,1.164,96,3.689,102,1.707,105,0.892,108,2.121,110,1.222,117,1.754,120,3.432,124,1.214,130,1.884,135,1.871,141,1.051,146,2.025,149,1.143,150,0.491,152,0.965,158,1.678,164,1.352,186,2.747,187,1.08,189,1.18,196,2.324,209,1.257,210,1.538,215,1.649,224,1.248,231,0.902,252,0.446,260,0.959,270,2.969,275,1.188,276,1.188,277,1.101,279,3.264,297,1.597,302,0.806,314,0.446,318,2.573,319,2.417,321,1.205,322,2.292,323,1.895,337,2.774,344,0.45,347,2.133,352,2.277,355,1.467,358,2.18,365,1.14,368,1.164,369,1.787,374,1.266,377,2.536,378,1.84,379,0.393,380,1.063,384,0.432,385,0.418,386,0.732,387,1.008,388,2.964,389,2.674,390,2.674,391,2.674,392,2.674,393,2.855,394,2.675,395,2.196,396,2.517,397,1.342,398,2.346,399,2.163,400,2.294,401,2.277,402,1.342,403,2.244,404,2.277,405,1.342,406,2.077,407,2.48,408,2.517,409,2.947,410,2.294,411,1.352,412,2.522,413,1.363,414,2.517,415,2.48,416,2.444,418,2.451,420,2.734,421,1.332,422,1.342,423,1.949,424,1.313,425,1.879,426,2.089,427,1.342,428,1.394,429,1.332,430,1.342,431,2.294,432,2.294,433,1.342,434,1.257,435,2.468,438,2.244,442,2.451,445,1.352,446,1.352,447,1.352,448,1.352,449,1.342,450,1.073,451,1.508,452,1.352,453,1.92,454,1.342,455,1.352,456,1.352,457,1.352,458,1.352,459,1.352,460,1.963,465,1.342,466,1.352,467,1.394,468,1.363,469,1.352,470,1.352,471,1.352,472,1.363,473,1.363,474,1.363,475,1.394,476,1.352,477,1.352,478,1.363,479,1.363,486,2.555,487,2.383,490,1.214,492,1.906,493,1.313,494,1.248,495,1.323,496,1.294,504,2.42,523,0.719,597,0.557,599,0.529,604,1.668,610,0.486,613,2.879,615,0.667,629,0.786,654,1.521,656,1.511,661,1.199,670,1.468,692,0.687,699,1.863,702,0.514,703,0.486,704,0.514,706,1.404,707,1.682,708,2.441,709,1.383,710,2.874,711,1.697,712,1.697,713,2.463,714,0.557,715,2.797,717,1.697,718,1.697,719,1.404,720,2.604,721,1.697,723,1.712,736,5.467,753,1.418,793,1.585,795,4.206,796,1.792,797,1.22,798,1.22,805,1.863,812,0.687,813,1.863,819,0.929,1007,1.863,1052,2.595,1056,1.033,1084,1.08,1312,2.99,1472,2.812,1519,0.902,1597,0.929,1628,1.08,1683,1.546,1754,1.14,1832,1.08,1843,1.239,1849,3.336,1855,0.857,1926,0.993,2009,0.959,2037,1.863,2188,1.08,2244,1.342,2245,1.342,2246,1.342,2247,4.052,2248,6.108,2249,1.342,2250,1.342,2251,1.342,2252,3.309,2253,5.695,2254,1.342,2255,1.342,2256,1.342,2257,1.342,2258,3.464,2259,4.585,2260,1.08,2261,1.342]],["t/669",[0,0.952,1,0.928,7,0.721,14,0.716,17,0.426,25,1.316,27,2.167,28,1.808,29,1.79,33,1.347,37,2.233,41,1.389,51,0.789,57,2.87,64,1.288,79,1.376,81,1.373,85,2.594,90,0.623,92,0.483,93,0.864,94,1.208,95,1.179,96,3.674,102,1.707,105,0.877,110,1.243,117,1.766,120,2.115,123,4.202,124,1.235,135,1.889,141,0.879,146,2.039,149,1.148,158,1.699,164,1.376,176,0.623,186,2.756,187,1.099,189,1.201,196,2.343,209,1.279,210,1.808,215,1.665,224,1.258,231,0.623,252,0.556,260,1.195,270,2.979,275,1.209,276,1.209,277,1.111,279,2.739,297,1.624,302,0.407,314,0.98,318,2.585,319,2.206,321,1.226,322,2.31,323,1.91,337,2.163,347,2.154,352,2.299,355,1.485,358,2.195,365,1.16,368,1.184,369,1.809,374,1.288,377,2.556,378,2.163,379,0.49,380,1.105,384,0.538,385,0.522,386,0.891,387,0.898,388,2.98,389,2.696,390,2.696,391,2.696,392,2.696,393,2.862,394,2.689,395,2.217,396,2.537,397,1.366,398,2.369,399,2.166,400,2.316,401,2.299,402,1.366,403,2.262,404,2.299,405,1.366,406,2.087,407,2.5,408,2.537,409,2.961,410,2.316,411,1.376,412,2.539,413,1.386,414,2.537,415,2.5,416,2.464,418,2.468,420,2.752,421,1.355,422,1.366,423,1.973,424,1.336,425,1.902,426,2.109,427,1.366,428,1.418,429,1.355,430,1.366,431,2.316,432,2.316,433,1.366,434,1.279,435,2.485,438,2.266,442,2.468,445,1.376,446,1.376,447,1.376,448,1.376,449,1.366,450,1.091,451,1.176,452,1.376,453,1.944,454,1.366,455,1.376,456,1.376,457,1.376,458,1.376,459,1.376,460,1.988,465,1.366,466,1.376,467,1.418,468,1.386,469,1.376,470,1.376,471,1.376,472,1.386,473,1.386,474,1.386,475,1.418,476,1.376,477,1.376,478,1.386,479,1.386,486,2.575,487,2.399,490,1.235,492,1.93,493,1.336,494,1.27,495,1.346,496,1.316,504,2.304,604,2.066,613,2.311,629,1.726,654,1.355,656,2.971,670,0.742,699,1.287,704,0.641,706,1.429,707,1.711,708,2.472,709,1.407,710,2.902,711,1.726,712,1.726,713,2.494,715,2.845,717,1.726,718,1.726,719,1.429,720,1.129,721,1.726,723,1.742,736,5.502,793,1.095,795,1.347,802,1.021,805,2.268,812,1.508,813,2.268,975,1.93,1007,1.287,1052,0.927,1312,3.041,1317,2.862,1534,0.832,1628,1.347,1667,1.347,1683,1.882,1765,1.421,2037,2.268,2242,1.421,2243,1.521,2262,3.952,2263,6.471,2264,1.673,2265,1.673,2266,1.673,2267,1.673,2268,5.993,2269,1.673,2270,1.673,2271,3.952,2272,6.471,2273,1.673,2274,1.673,2275,2.948,2276,6.471,2277,1.673,2278,1.673]],["t/671",[0,1.145,9,1.785,17,0.794,30,3.351,80,1.515,81,1.725,94,1.328,95,1.125,117,1.627,144,4.742,147,4.997,149,1.243,150,3.726,244,2.05,252,2.876,277,1.538,317,4.185,399,2.05,501,5.646,504,3.856,606,3.928,610,3.135,665,2.974,830,6.671,832,7.538,1534,5.066,1876,7.865]],["t/673",[0,0.96,13,3.29,14,1.037,16,2.97,17,0.785,174,4.393,176,3.382,224,1.291,244,2.151,284,4.716,304,4.218,363,5.797,364,5.797,597,3.769,628,4.866,906,7.714,1077,5.121,1897,8.256,2279,9.079,2280,9.079,2281,9.079,2282,9.079]],["t/675",[0,1.199,1,1.355,3,1.118,7,0.788,14,0.995,16,2.766,17,0.714,19,2.984,41,1.608,44,2.616,50,2.498,52,4.174,80,1.482,94,1.447,95,1.184,105,1.008,118,5.222,141,1.56,149,0.94,154,2.407,221,3.369,234,3.403,302,2.613,314,2.812,323,1.825,333,3.403,378,3.841,450,1.938,597,3.51,601,3.708,604,3.21,605,3.093,635,2.933,665,2.908,774,3.936,833,5.887]],["t/677",[0,0.751,1,0.958,7,0.8,14,0.894,17,0.783,29,2.557,41,1.566,80,1.245,81,1.417,92,2.609,93,3.064,94,1.504,95,1.299,102,1.707,104,2.131,105,0.929,108,2.646,119,2.918,133,3.08,195,2.529,213,3.635,319,3.934,379,2.648,380,1.837,382,4.526,384,2.907,385,2.816,386,2.73,387,2.751,597,2.949,662,6.95,704,3.46,981,5.634,1655,5.466,1844,4.918,1879,5.767,2283,7.105,2284,7.271,2285,5.075]],["t/679",[0,0.307,1,0.391,7,0.705,10,1.485,14,0.675,17,0.532,25,1.3,27,1.876,29,1.115,37,2.217,41,1.46,64,1.272,79,1.359,81,1.495,92,0.838,93,1.379,94,1.147,95,1.136,102,1.708,104,0.871,105,0.866,108,3.689,110,1.228,117,1.655,119,1.192,120,3.372,124,1.219,135,1.876,141,0.868,146,2.029,149,1.144,158,1.684,164,1.359,186,2.75,187,1.085,189,1.186,191,1.952,196,2.329,209,1.263,215,1.653,224,1.251,261,0.774,270,2.972,275,1.194,276,1.194,277,1.103,284,1.508,297,1.604,318,2.576,319,2.555,321,1.211,322,2.297,323,1.899,347,2.139,352,2.283,355,1.472,358,2.057,365,1.145,368,1.169,369,1.793,371,1.637,374,1.272,377,2.541,379,0.851,380,1.206,382,3.544,384,0.934,385,0.905,386,0.877,387,1.433,388,2.968,389,2.68,390,2.68,391,2.68,392,2.68,393,2.857,394,2.679,395,2.201,396,2.523,397,1.349,398,2.352,399,1.901,400,2.3,401,2.283,402,1.349,403,2.249,404,2.283,405,1.349,406,2.08,407,2.486,408,2.523,409,2.951,410,2.3,411,1.359,412,2.526,413,1.369,414,2.523,415,2.486,416,2.449,418,2.455,420,2.739,421,1.339,422,1.349,423,1.955,424,1.319,425,1.885,426,2.094,427,1.349,428,1.4,429,1.339,430,1.349,431,2.3,432,2.3,433,1.349,434,1.263,435,2.473,438,2.25,442,2.313,445,1.359,446,1.359,447,1.359,448,1.359,449,1.349,450,1.078,451,1.161,452,1.359,453,1.927,454,1.349,455,1.359,456,1.359,457,1.359,458,1.359,459,1.359,460,1.97,465,1.349,466,1.359,467,1.4,468,1.369,469,1.359,470,1.359,471,1.359,472,1.369,473,1.369,474,1.369,475,1.4,476,1.359,477,1.359,478,1.369,479,1.369,486,2.56,487,2.442,490,1.219,492,1.912,493,1.319,494,1.254,495,1.329,496,1.3,562,1.485,597,1.205,604,0.927,662,7.621,702,1.112,703,1.052,704,2.272,706,1.411,707,1.689,708,2.45,709,1.389,710,2.882,711,1.705,712,1.705,713,2.472,714,1.953,717,1.705,718,1.705,719,1.411,720,2.613,721,1.705,723,1.72,979,2.337,1052,2.607,1475,3.997,1655,2.233,1879,5.618,1885,2.337,2284,7.319,2286,2.903,2287,4.277,2288,2.903,2289,3.997,2290,2.639,2291,2.903,2292,2.903]],["t/681",[0,0.522,1,0.666,7,0.617,9,0.54,14,0.699,17,0.439,25,1.365,27,1.444,37,2.279,41,1.349,64,1.671,79,0.891,81,1.542,94,0.644,95,1.025,102,1.706,104,2.598,105,0.8,110,1.289,117,1.454,120,2.727,124,1.601,133,3.351,135,1.928,141,0.911,146,2.215,149,1.159,158,1.525,164,1.427,186,2.775,187,1.139,189,1.245,196,2.382,202,1.001,205,0.954,209,1.326,210,1.17,215,1.699,224,1.28,261,0.822,270,2.999,275,1.254,276,1.254,277,1.134,284,1.602,296,1.842,297,1.052,318,2.61,319,2.635,321,1.271,322,2.626,323,1.942,347,2.199,352,2.347,355,1.524,358,2.104,365,1.203,368,1.228,369,1.857,374,1.336,377,2.599,380,1.005,382,3.894,388,3.012,389,2.741,390,2.741,391,2.741,392,2.741,393,2.874,394,2.719,395,2.121,396,2.58,397,1.416,398,2.418,399,1.954,400,2.364,401,2.347,402,1.416,403,2.3,404,2.347,405,1.416,406,2.107,407,2.542,408,2.58,409,2.99,410,2.364,411,1.427,412,2.575,413,1.437,414,2.58,415,2.542,416,2.505,418,2.503,420,2.721,421,1.406,422,1.416,423,2.025,424,1.385,425,1.952,426,2.26,427,1.416,428,1.47,429,1.406,430,1.416,431,2.364,432,2.364,433,1.416,434,1.659,435,2.521,438,2.429,442,2.168,445,1.427,446,1.427,447,1.427,448,1.427,449,1.416,450,1.132,451,1.219,452,1.427,453,1.995,454,1.416,455,1.427,456,1.427,457,1.427,458,1.427,459,1.427,460,2.04,465,1.416,466,1.427,467,1.47,468,1.437,469,1.427,470,1.427,471,1.427,472,1.437,473,1.437,474,1.437,475,1.47,476,1.427,477,1.427,478,1.437,479,1.437,486,2.619,487,2.433,488,1.061,490,1.28,492,1.981,493,1.385,494,1.317,495,1.395,496,1.365,662,7.142,706,1.481,707,1.108,708,1.774,709,1.459,710,2.219,711,1.118,712,1.118,713,1.79,717,1.118,718,1.118,719,1.481,720,1.892,721,1.118,723,1.128,737,1.118,1291,1.149,1292,1.149,1293,1.149,1294,1.138,1298,1.149,1299,1.84,1300,1.138,1301,1.149,1302,1.149,1305,1.149,1306,1.149,1307,1.138,1311,1.159,1475,2.62,1879,5.266,1885,2.483,2141,2.373,2146,2.203,2287,2.805,2289,4.197,2293,8.661,2294,9.282,2295,3.084,2296,2.805,2297,4.939,2298,3.084,2299,3.084,2300,2.483,2301,2.805,2302,3.084]],["t/683",[0,0.539,1,1.196,7,0.648,9,0.266,13,0.551,14,0.715,17,0.316,25,1.41,27,1.322,29,0.36,37,2.32,41,1.369,64,1.658,79,0.782,81,1.442,94,0.737,95,1.054,99,6.253,102,1.707,104,2.168,105,0.841,108,3.304,110,1.331,117,1.3,118,1.407,120,1.8,123,2.345,124,1.589,135,2.003,141,1.208,146,2.213,149,1.173,150,0.556,158,1.705,164,1.058,176,0.566,186,2.792,187,1.177,189,1.286,196,2.417,202,0.493,209,1.647,215,1.73,224,1.298,232,0.996,247,0.949,270,3.017,275,1.295,276,1.295,277,1.155,284,0.79,289,0.645,296,0.908,297,1.249,299,1.936,318,2.632,319,2.727,321,1.313,322,2.383,323,1.97,328,3.342,347,2.238,352,2.389,355,1.56,358,2.135,365,1.242,368,1.268,369,1.9,374,1.38,377,2.637,380,1.038,382,2.373,388,3.041,389,2.781,390,2.781,391,2.781,392,2.781,393,2.886,394,2.744,395,2.194,396,2.618,397,1.462,398,2.461,399,1.989,400,2.407,401,2.389,402,1.462,403,2.334,404,2.389,405,1.462,406,2.125,407,2.579,408,2.618,409,3.015,410,2.407,411,1.473,412,2.557,413,1.484,414,2.618,415,2.579,416,2.429,418,2.534,420,2.601,421,1.452,422,1.462,423,2.072,424,1.43,425,1.997,426,2.277,427,1.462,428,1.518,429,1.452,430,1.462,431,2.407,432,2.407,433,1.462,434,1.647,435,2.552,438,2.447,442,2.252,445,1.473,446,1.473,447,1.473,448,1.473,449,1.462,450,1.169,451,1.259,452,1.473,453,2.042,454,1.462,455,1.473,456,1.473,457,1.473,458,1.473,459,1.473,460,2.088,465,1.462,466,1.473,467,1.518,468,1.484,469,1.473,470,1.473,471,1.473,472,1.484,473,1.484,474,1.484,475,1.518,476,1.473,477,1.473,478,1.484,479,1.484,486,2.657,487,2.464,488,1.754,490,1.322,492,2.027,493,1.43,494,1.36,495,1.441,496,1.229,597,1.125,604,0.486,661,0.551,662,7.348,670,0.675,706,1.53,707,0.973,708,1.597,709,1.314,710,2.031,711,0.982,712,0.982,713,1.611,714,1.846,717,0.982,718,0.982,719,1.334,720,1.038,721,0.982,723,0.991,737,0.982,742,1.086,747,1.347,763,0.843,775,1.023,843,2.911,859,0.858,896,2.464,933,1.292,981,0.949,1052,0.843,1138,0.996,1291,1.009,1292,1.009,1293,1.009,1294,1,1295,1.347,1298,1.009,1299,1.656,1300,1,1301,1.009,1302,1.656,1305,1.009,1306,1.009,1307,1,1311,1.018,1317,1.294,1534,0.756,1605,6.253,1694,2.339,1734,2.084,1738,2.084,1879,3.611,1885,1.224,2092,1.17,2132,1.292,2137,6.253,2138,5.143,2139,2.302,2140,2.302,2141,2.084,2143,1.292,2144,1.292,2145,1.292,2146,1.935,2148,1.292,2149,1.383,2150,1.292,2153,1.383,2285,4.04,2289,4.805,2290,1.383,2296,4.043,2300,2.181,2301,4.043,2303,1.383,2304,1.521,2305,5.656,2306,5.656,2307,5.656,2308,2.004,2309,2.004,2310,1.521,2311,2.004,2312,1.521,2313,1.521]],["t/685",[0,0.872,1,1.111,7,0.754,14,0.816,17,0.703,29,2.347,41,1.484,92,2.381,93,2.903,94,1.468,95,1.262,102,1.697,104,2.473,105,0.733,109,4.099,146,1.791,176,3.071,202,2.675,210,3.129,379,2.417,380,1.677,382,4.725,384,2.653,385,2.57,386,2.492,387,2.511,497,5.397,704,3.159,1534,4.924,1749,5.397,1879,6.323,2303,7.497]],["t/687",[0,1.095,1,1.2,3,0.989,50,2.629,67,4.622,79,2.57,80,1.559,104,3.107,105,0.791,117,1.674,157,6.189,164,2.57,223,2.911,244,2.455,252,2.959,277,1.552,289,3.774,299,3.377,326,3.816,337,4.705,345,3.816,363,6.615,364,6.615,365,2.167,502,4.931,615,4.425,1829,8.092]],["t/689",[1,1.15,7,0.692,9,2.019,10,5.171,17,0.606,29,2.021,53,5.584,54,5.096,75,3.828,77,4.108,81,1.701,105,0.758,110,2.811,148,6.31,149,1.123,150,3.696,159,4.183,200,4.499,202,2.767,215,1.758,252,2.836,285,5.171,291,5.904,323,1.841,358,1.994,359,3.698,603,4.483,617,6.563,635,2.958,668,6.31,700,7.757,748,4.995,835,4.241,960,5.204,1083,6.093,1280,5.904,1577,5.904,1615,6.093,1783,5.32,2210,5.904,2314,7.757,2315,6.093,2316,6.093,2317,6.31]],["t/691",[3,1.05,16,3.089,19,3.333,80,1.655,774,4.396]],["t/693",[0,1.206,1,1.424,3,1.093,6,3.701,7,0.751,14,0.973,17,0.779,27,1.905,41,1.474,50,2.905,77,3.313,90,3.663,94,1.377,95,1.085,102,1.371,105,1.026,110,2.127,117,1.987,135,1.905,141,1.504,154,2.319,215,1.679,221,3.246,224,1.502,225,3.663,226,3.494,231,3.035,244,2.33,261,2.173,277,1.353,285,4.17,289,3.456,290,4.17,302,1.984,307,3.035,314,2.71,333,3.279,358,2.469,359,3.533,406,1.647,597,3.383,604,3.14,605,2.98,629,4.772,684,3.573,724,4.299,748,4.772,774,3.793,835,4.889]],["t/695",[0,0.333,1,1.223,7,0.782,9,1.098,12,3.535,14,0.708,16,1.031,17,0.681,28,1.196,41,1.436,45,1.524,64,0.852,77,1.281,80,1.098,83,1.074,92,0.91,93,1.473,94,1.298,95,1.268,102,1.71,104,3.033,105,1.007,108,3.71,110,0.822,124,0.817,141,1.612,146,2.082,150,1.152,152,1.255,158,0.778,187,1.159,189,0.794,209,2.346,213,1.612,224,0.714,275,0.8,276,0.8,285,1.612,289,1.336,290,1.612,291,2.181,302,1.224,312,4.226,315,4.214,317,4.638,319,2.839,320,1.746,321,0.811,326,4.934,328,1.524,344,1.056,354,5.21,359,1.366,368,0.783,369,1.321,374,0.852,379,0.924,380,0.641,383,4.301,384,1.014,385,0.982,386,1.519,387,2.379,393,1.955,406,0.637,412,1.359,416,1.745,418,1.647,420,2.097,426,1.312,434,0.846,435,1.659,438,2.005,442,1.321,487,0.805,488,3.004,490,2.621,492,1.409,493,0.884,494,0.84,495,0.89,496,0.871,535,7.891,599,1.243,603,4.619,613,2.494,624,2.537,630,1.882,647,1.467,661,3.796,702,1.207,703,1.142,704,3.346,706,0.945,709,0.931,714,2.968,719,2.62,737,1.142,747,3.555,778,3.414,779,3.306,812,1.612,816,6.978,817,6.521,835,1.567,1291,1.174,1292,1.174,1293,1.174,1294,1.163,1295,3.555,1298,1.174,1299,1.872,1300,1.163,1301,1.174,1302,3.253,1305,1.174,1306,1.174,1307,1.163,1311,1.185,1681,1.431,1692,5.316,1693,4.214,1696,2.251,1700,2.677,1705,2.677,1834,2.865,1843,4.26,1888,3.717,1911,2.331,1941,3.002,1967,7.943,2083,2.181,2085,2.181,2088,2.181,2284,4.045,2318,2.865,2319,2.865,2320,8.501,2321,9.185,2322,7.422,2323,6.702,2324,7.073,2325,6.406,2326,7.104,2327,4.045,2328,5.699,2329,4.569,2330,4.569,2331,2.865,2332,7.104,2333,2.537,2334,4.569,2335,4.269,2336,2.865,2337,3.866,2338,2.865,2339,2.865,2340,3.151,2341,7.104,2342,2.537,2343,4.569,2344,4.569,2345,2.865,2346,4.569,2347,2.865,2348,2.865]],["t/697",[28,4.347,110,2.934,291,7.782,328,5.542,359,4.874,490,2.969,535,7.703,603,4.434,661,3.952,816,6.733,817,5.753,1692,5.611,1843,4.497]],["t/699",[0,0.927,1,1.469,14,0.868,17,0.623,28,3.329,81,1.75,95,0.968,110,2.844,117,1.65,144,4.083,149,0.975,152,3.495,160,4.627,196,2.322,224,1.247,284,4.557,307,3.267,328,4.244,343,6.268,345,3.761,406,2.076,490,2.274,521,6.49,535,5.899,598,6.75,599,3.46,603,3.46,661,3.723,748,6.016,768,5.743,782,5.899,879,6.75,1434,6.267,1699,6.75,2004,6.75,2349,7.062,2350,7.977]],["t/701",[0,0.311,1,0.396,3,0.327,7,0.767,14,0.983,17,0.603,27,2.459,28,3.063,79,2.331,80,0.515,94,1.052,95,1.236,102,1.711,105,0.995,108,3.641,110,0.768,117,2.075,120,3.602,123,4.693,130,1.183,141,1.489,146,2.124,149,0.327,152,1.171,158,2.414,164,2.331,187,1.862,189,2.034,209,2.167,224,1.208,275,2.048,276,2.048,277,0.404,284,1.527,293,1.602,297,2.752,321,2.077,328,3.325,368,2.006,369,2.57,374,2.183,393,2.802,395,2.214,406,1.631,412,2.644,416,2.928,418,2.765,420,3.283,426,2.107,435,2.784,438,2.949,442,2.873,487,2.063,490,2.613,492,2.742,493,2.263,494,2.152,495,2.28,496,2.231,502,1.63,535,5.946,603,1.16,661,2.734,706,2.421,707,2.899,708,3.512,709,2.384,710,3.778,711,2.925,712,2.925,713,3.543,714,1.973,717,2.925,718,2.925,719,2.421,720,3.092,721,2.925,723,2.951,817,1.925,1317,3.854,1619,2.263,1682,2.175,1683,1.878,1692,3.035,1693,6.574,1696,3.396,1843,2.432,1849,6.243,1855,3.035,1888,7.781,1890,5.441,1941,6.283,1976,2.101,2325,8.756,2337,6.21,2351,4.426,2352,2.674,2353,2.941,2354,2.941,2355,2.941,2356,2.941,2357,2.941]],["t/703",[1,0.794,3,0.519,4,1.794,7,0.75,9,1.032,12,1.622,13,1.042,14,1.016,17,0.53,20,1.306,25,0.795,27,1.867,37,1.629,41,1.358,51,1.355,64,1.263,73,1.652,77,1.169,79,1.348,80,0.504,81,0.931,85,1.373,94,1.266,95,1.224,102,1.71,104,2.524,105,0.922,108,3.782,110,2.617,117,1.752,118,1.494,120,2.632,123,3.428,124,1.21,135,1.378,141,1.087,144,1.338,146,2.11,149,1.007,158,1.841,159,2.289,164,1.702,176,2.526,186,2.449,187,1.359,189,1.485,196,1.795,200,3.108,205,1.823,209,1.582,210,1.091,215,1.214,224,1.247,270,2.647,275,1.496,276,1.496,277,0.81,285,2.389,293,2.543,296,2.789,297,1.592,300,1.45,307,1.071,314,0.956,318,2.195,319,0.98,321,1.517,322,1.77,323,1.464,324,2.543,347,1.571,352,1.677,355,1.272,358,1.744,359,2.024,365,0.7,368,1.465,369,2.1,374,1.594,377,1.959,379,0.843,380,0.95,386,0.869,387,2.066,388,2.486,389,2.066,390,2.066,391,2.066,392,2.066,393,2.785,394,2.244,395,1.861,396,1.944,397,0.824,398,1.728,399,1.396,400,1.689,401,1.677,402,0.824,403,1.733,404,1.677,405,0.824,406,1.997,407,1.916,408,1.944,409,2.514,410,1.689,411,0.831,412,2.451,413,0.837,414,1.944,415,1.916,416,2.593,418,2.505,420,2.939,421,0.818,422,0.824,423,1.338,424,0.806,425,1.29,426,2.085,427,0.824,428,0.856,429,0.818,430,0.824,431,1.689,432,1.689,433,0.824,434,1.254,435,2.522,438,2.612,442,2.448,445,0.831,446,0.831,447,0.831,448,0.831,449,0.824,450,0.659,451,0.71,452,0.831,453,1.319,454,0.824,455,0.831,456,0.831,457,0.831,458,0.831,459,0.831,460,1.348,465,0.824,466,0.831,467,0.856,468,0.837,469,0.831,470,0.831,471,0.831,472,0.837,473,0.837,474,0.837,475,0.856,476,0.831,477,0.831,478,0.837,479,0.837,486,1.974,487,2.151,488,0.989,490,1.527,492,2.24,493,1.652,494,1.571,495,1.665,496,1.629,518,1.882,521,2.127,535,1.934,564,1.652,597,1.194,598,2.212,599,2.324,603,3.575,604,2.55,613,1.881,617,2.212,661,3.284,665,1.605,684,1.261,702,1.102,703,2.136,704,2.598,706,1.767,707,1.677,708,2.436,709,1.741,710,2.869,711,1.692,712,1.692,713,2.458,714,2.446,717,1.692,718,1.692,719,1.767,720,1.788,721,1.692,723,1.707,725,1.836,737,1.042,747,1.43,802,1.754,803,2.127,833,3.45,835,1.43,854,1.593,900,1.684,1291,1.071,1292,1.071,1293,1.071,1294,1.061,1295,1.43,1298,1.071,1299,1.739,1300,1.061,1301,1.071,1302,1.071,1305,1.071,1306,1.071,1307,1.061,1311,1.081,1317,2.229,1346,2.315,1609,2.443,1667,2.315,1699,3.592,1941,5.804,2004,2.212,2321,7.449,2322,6.336,2323,7.058,2325,7.475,2327,2.315,2333,2.315,2337,3.592,2342,2.315,2351,3.453,2352,4.245,2358,2.876,2359,8.394,2360,2.876,2361,7.653,2362,4.245,2363,2.615,2364,2.615,2365,2.615,2366,2.615]],["t/705",[1,1.31,3,0.935,4,1.792,7,0.729,9,0.503,14,0.977,15,2.314,17,0.331,19,1.014,20,1.305,25,0.794,27,1.967,28,2.829,37,1.628,41,1.016,51,2.199,55,2.461,64,1.262,77,1.168,79,1.348,80,1.032,81,0.931,90,1.07,94,0.768,95,1.189,102,1.706,105,0.938,108,4.077,110,2.578,117,1.828,120,2.969,123,3.427,124,1.209,125,1.932,135,1.377,141,1.718,146,2.146,149,1.08,150,1.051,158,1.841,164,1.348,186,2.448,187,1.359,189,1.485,196,1.795,209,1.582,210,1.091,215,1.646,224,1.135,225,1.07,231,1.738,270,2.646,275,1.495,276,1.495,277,0.81,288,1.429,290,1.471,296,1.717,297,1.591,302,0.7,314,1.551,318,2.194,321,1.516,322,1.77,323,1.463,328,5.019,343,1.753,347,1.57,352,1.676,355,1.007,358,1.743,359,1.246,365,0.7,368,1.464,369,2.099,374,1.593,377,1.958,378,2.119,380,0.585,388,2.485,389,2.065,390,2.065,391,2.065,392,2.065,393,2.785,394,2.243,395,1.86,396,1.944,397,0.824,398,1.727,399,1.396,400,1.689,401,1.676,402,0.824,403,1.733,404,1.676,405,0.824,406,1.925,407,1.915,408,1.944,409,2.513,410,1.689,411,0.83,412,2.45,413,0.836,414,1.944,415,1.915,416,2.592,418,2.504,420,2.939,421,0.818,422,0.824,423,1.338,424,0.806,425,1.29,426,2.084,427,0.824,428,0.855,429,0.818,430,0.824,431,1.689,432,1.689,433,0.824,434,1.253,435,2.522,438,2.611,442,2.447,445,0.83,446,0.83,447,0.83,448,0.83,449,0.824,450,0.658,451,0.709,452,0.83,453,1.318,454,0.824,455,0.83,456,0.83,457,0.83,458,0.83,459,0.83,460,1.348,465,0.824,466,0.83,467,0.855,468,0.836,469,0.83,470,0.83,471,0.83,472,0.836,473,0.836,474,0.836,475,0.855,476,0.83,477,0.83,478,0.836,479,0.836,486,1.973,487,2.15,488,0.988,490,1.527,492,2.239,493,1.652,494,1.57,495,1.664,496,1.628,518,1.881,535,1.932,597,1.937,599,1.134,603,3.954,610,1.041,615,3.971,625,2.126,626,2.554,661,3.722,678,3.055,697,2.053,701,2.211,706,1.767,707,1.676,708,2.435,709,1.74,710,2.868,711,1.691,712,1.691,713,2.457,714,2.445,717,1.691,718,1.691,719,1.399,720,2.257,721,1.691,723,1.706,729,2.211,737,1.041,747,1.429,748,2.732,751,2.314,752,2.442,775,1.932,812,3.815,816,4.439,817,4.881,865,1.275,960,3.594,1285,1.516,1291,1.07,1292,1.07,1293,1.07,1294,2.174,1295,1.429,1298,1.07,1299,1.738,1300,2.174,1301,1.07,1302,1.07,1305,1.07,1306,1.07,1307,1.061,1311,1.08,1317,2.812,1319,1.835,1434,2.053,1527,4.761,1534,1.429,1609,2.442,1692,2.979,1836,2.442,1843,2.388,1941,5.803,2178,7.448,2179,5.761,2180,3.964,2181,3.964,2323,8.07,2324,6.335,2325,7.474,2327,2.314,2333,3.756,2335,2.442,2337,3.59,2342,2.314,2349,2.314,2350,2.613,2351,3.452,2359,8.517,2363,2.613,2364,5.356,2365,2.613,2366,2.613,2367,2.874,2368,2.874,2369,2.874,2370,2.613,2371,4.243,2372,2.874,2373,2.874]],["t/707",[0,0.33,1,1.289,7,0.775,14,0.617,17,0.662,30,0.967,41,1.49,64,0.845,67,1.623,92,0.903,93,1.464,94,1.316,95,1.276,102,1.712,104,3.027,105,1.016,108,3.472,117,0.588,124,0.81,128,1.763,130,1.258,141,1.669,144,1.454,146,2.077,149,0.347,158,0.772,159,2.448,163,1.623,187,0.721,189,0.788,202,2.022,209,2.338,224,0.444,275,0.793,276,0.793,299,1.894,304,1.258,312,3.764,317,4.552,319,2.828,321,0.804,326,4.851,354,4.469,368,0.777,369,1.312,374,0.845,379,0.916,380,0.636,383,4.29,384,1.006,385,0.974,386,1.509,387,2.526,393,1.947,406,0.632,412,1.35,416,1.735,418,1.638,420,2.087,426,1.303,434,0.839,435,1.65,438,1.996,442,1.312,487,0.799,488,2.994,490,2.53,492,1.4,493,0.876,494,0.833,495,0.883,496,0.864,535,7.717,603,4.56,613,1.99,647,1.454,661,3.751,702,1.912,703,2.579,704,3.74,706,0.937,709,0.923,714,2.587,719,2.611,724,3.754,737,1.133,747,3.099,748,2.923,778,3.396,779,3.288,816,6.775,817,6.259,833,2.923,932,1.907,982,2.405,1138,2.046,1224,2.163,1291,1.164,1292,1.164,1293,1.164,1294,1.153,1295,3.099,1298,1.164,1299,1.859,1300,1.153,1301,1.164,1302,3.243,1305,1.164,1306,1.164,1307,1.153,1311,1.175,1345,2.516,1692,4.968,1693,4.191,1696,2.233,1700,2.655,1705,2.655,1783,1.949,1843,3.981,1849,3.98,1852,2.163,1855,1.995,1860,2.163,1888,3.693,1941,2.982,1967,7.921,2083,2.163,2085,2.163,2088,2.163,2177,2.405,2284,4.019,2320,8.223,2321,9.281,2322,7.048,2323,6.678,2324,7.048,2325,6.382,2326,7.075,2327,4.019,2328,5.668,2329,4.539,2330,4.539,2331,2.842,2332,7.075,2333,2.516,2334,4.539,2335,4.241,2336,2.842,2337,3.841,2338,2.842,2339,2.842,2341,7.075,2342,2.516,2343,4.539,2344,4.539,2345,2.842,2346,4.539,2347,2.842,2348,2.842,2359,7.397,2361,7.075,2374,3.125,2375,2.842]],["t/709",[0,0.929,3,1.143,7,0.705,9,1.54,14,1.079,16,2.874,17,0.73,20,3.991,55,4.636,80,1.54,90,3.273,117,2.051,135,2.055,149,0.977,154,2.501,202,3.337,244,2.437,252,2.922,277,1.546,289,3.727,290,4.497,406,1.776,684,3.853,732,5.361,748,6.022,835,5.114,1083,6.278,1617,5.146,1621,6.278,1657,7.075]],["t/711",[3,1.228,17,0.785,149,1.165,150,3.32,151,5.539,213,4.646,226,3.893,227,5.663,244,2.151,249,4.646,323,1.959,344,3.044,406,2.118,830,6.862,1519,6.105,1574,5.797,1662,4.946,1688,7.309,1877,6.986]],["t/713",[0,1.152,3,1.212,7,0.718,9,1.704,16,2.618,17,0.568,19,3.942,34,5.718,50,2.364,83,3.317,95,1.157,102,1.461,105,1.01,119,3.288,135,1.871,147,5.139,149,1.081,174,3.872,223,2.618,224,1.383,225,3.903,226,3.432,244,2.305,261,2.134,272,4.836,277,1.338,279,5.285,285,4.095,344,2.683,345,4.171,355,2.099,406,1.617,504,3.463,523,5.213,551,3.772,599,3.157,603,3.157,606,3.635,610,2.901,613,3.346,623,4.036,629,4.687,635,2.776,665,3.345,692,4.977,774,3.725,788,5.921,865,3.55,1285,4.222,1286,3.872,1578,6.368,2006,7.545,2376,7.278]],["t/715",[3,1.048,19,3.327,135,2.204,344,3.16,345,4.042,623,4.754]],["t/717",[3,0.927,6,3.789,7,0.731,9,1.747,14,0.825,17,0.785,19,2.944,34,5.96,81,1.664,119,4.097,130,3.357,147,5.231,149,1.109,150,3.051,165,7.433,183,3.744,200,4.4,213,5.103,215,1.719,222,7.892,224,1.418,225,3.714,249,4.269,322,2.177,337,3.789,358,2.584,375,5.96,393,2.088,490,2.162,647,3.883,693,5.089,730,5.96,830,6.984,835,4.148,858,5.089,969,5.774,996,7.088,1525,6.716,1591,4.705,1617,4.885,1662,5.433,1730,5.327,1832,6.716,1951,6.419,2377,8.342,2378,8.342,2379,5.96,2380,7.673,2381,8.342]],["t/719",[17,0.617,34,7.302,57,4.815,143,6.69,147,5.323,160,4.587,165,5.847,213,4.449,222,6.432,234,3.499,249,4.449,279,5.761,302,2.489,358,2.033,626,3.77,630,5.194,830,6.691,900,5.091,1051,7,1125,6.69,1505,7.907,1648,6.69,1651,6.019,1758,8.684,1982,8.228,2379,6.212,2380,7.864,2382,8.684,2383,9.224,2384,8.228,2385,8.695,2386,7.907]],["t/721",[3,0.883,6,3.606,7,0.544,9,2.044,17,0.564,57,3.522,79,2.796,80,1.391,144,4.505,149,0.883,165,7.022,183,3.563,184,8.224,213,4.062,222,7.725,279,5.266,296,4.743,358,2.441,406,1.604,506,7.119,603,3.132,613,3.334,630,6.238,661,3.94,782,6.509,900,6.114,1125,8.035,1527,7.238,1661,4.561,1662,4.325,1843,5.562,2006,7.228,2383,6.746,2384,6.391,2387,9.496,2388,8.802,2389,9.496,2390,8.802,2391,8.802,2392,9.496,2393,8.802,2394,6.941]],["t/724",[0,0.761,1,0.97,7,0.742,17,0.647,41,1.497,44,2.226,50,2.126,81,1.436,92,2.079,93,2.67,94,1.524,95,1.284,102,1.706,116,3.437,140,4.982,144,3.35,147,5.149,152,3.628,187,1.66,205,2.226,211,3.921,213,5.112,215,1.483,223,2.354,226,3.086,231,2.681,234,2.896,279,5.667,344,3.054,346,5.142,379,2.11,380,1.464,384,2.316,385,2.244,386,3.02,387,3.043,506,4.391,603,4.432,613,3.352,615,3.579,969,4.982,1519,4.84,1574,4.596,1662,4.962,1749,4.712,1844,4.982,2006,7.268,2211,7.768,2395,6.545,2396,7.198]],["t/726",[0,0.44,1,0.959,3,0.278,7,0.707,13,0.906,14,0.685,17,0.518,25,1.27,27,1.457,35,0.741,37,2.188,41,1.305,44,0.298,50,0.738,57,3.069,64,1.533,79,1.202,80,0.547,81,1.38,94,0.599,95,1.151,102,1.707,104,2.663,105,0.915,108,2.577,109,0.479,110,1.2,116,0.46,117,1.373,120,2.442,123,1.688,124,1.469,135,1.882,141,1.313,146,2.176,147,4.395,149,1.147,150,0.352,158,1.538,164,0.902,165,3.81,176,0.359,184,4.814,186,2.737,187,1.06,189,1.159,196,2.304,200,0.508,205,0.298,209,1.911,210,0.678,213,0.493,215,1.632,222,4.192,224,1.238,227,0.6,252,0.32,270,2.958,275,1.167,276,1.167,277,1.089,279,5.416,297,1.065,299,0.365,307,0.359,318,2.56,321,1.183,322,2.272,323,1.878,337,0.437,344,0.323,347,2.111,352,2.253,355,1.447,358,2.208,361,0.741,365,1.119,367,0.647,368,1.143,369,1.763,374,1.243,377,2.514,380,0.935,388,2.947,389,2.651,390,2.651,391,2.651,392,2.651,393,2.848,394,2.66,395,2.049,396,2.495,397,1.318,398,2.321,399,1.876,400,2.27,401,2.253,402,1.318,403,2.225,404,2.253,405,1.318,406,2.073,407,2.459,408,2.495,409,2.932,410,2.27,411,1.328,412,2.503,413,1.338,414,2.495,415,2.459,416,2.423,418,2.433,420,2.651,421,1.308,422,1.318,423,1.923,424,1.289,425,1.854,426,2.164,427,1.318,428,1.368,429,1.308,430,1.318,431,2.27,432,2.27,433,1.318,434,1.522,435,2.45,438,2.325,442,2.116,445,1.328,446,1.328,447,1.328,448,1.328,449,1.318,450,1.053,451,1.135,452,1.328,453,1.895,454,1.318,455,1.328,456,1.328,457,1.328,458,1.328,459,1.328,460,1.937,465,1.318,466,1.328,467,1.368,468,1.338,469,1.328,470,1.328,471,1.328,472,1.338,473,1.338,474,1.338,475,1.368,476,1.328,477,1.328,478,1.338,479,1.338,486,2.533,487,2.366,488,2.142,490,1.191,492,1.881,493,1.289,494,1.226,495,1.299,496,1.27,506,0.587,562,0.914,582,0.543,603,3.396,610,0.349,613,3.034,622,0.63,628,0.516,630,2.194,636,0.553,661,1.666,665,0.331,678,0.63,706,1.379,707,1.122,708,1.792,709,1.358,710,2.238,711,1.132,712,1.132,713,1.808,714,1.038,717,1.132,718,1.132,719,2.134,720,1.594,721,1.132,723,1.142,737,0.906,747,0.479,761,0.875,762,0.875,763,0.533,812,0.493,818,0.575,865,0.427,893,0.875,900,4.051,1014,0.647,1018,0.99,1076,0.775,1111,0.6,1125,2.826,1291,0.931,1292,0.931,1293,0.931,1294,0.923,1295,0.479,1298,0.931,1299,1.55,1300,0.923,1301,0.931,1302,2.32,1305,0.931,1306,0.931,1307,0.923,1311,0.94,1317,0.853,1519,0.647,1574,0.615,1584,1.681,1586,2.404,1589,1.681,1591,0.543,1606,0.6,1648,0.741,1653,0.712,1820,0.712,1843,1.879,1844,6.147,1849,1.596,1852,0.666,1855,0.615,1860,0.666,1976,0.688,1982,0.775,2006,6.147,2211,6.135,2221,3.535,2226,3.906,2232,3.535,2285,1.786,2308,0.712,2309,0.712,2311,0.712,2383,4.814,2384,6.261,2386,3.34,2387,5.153,2388,5.153,2389,5.153,2390,5.153,2391,5.153,2392,5.153,2393,5.153,2394,2.345,2397,5.665,2398,6.291,2399,6.919,2400,3.783,2401,6.23,2402,2.273,2403,1.787,2404,2.5,2405,2.5,2406,1.787,2407,3.123,2408,0.963,2409,1.787,2410,2.84,2411,1.787,2412,1.787,2413,2.5,2414,0.963,2415,0.963,2416,0.963,2417,2.5,2418,1.787,2419,1.787,2420,2.5,2421,0.963,2422,6.099,2423,7.469,2424,4.161,2425,1.787,2426,2.5,2427,1.787,2428,1.787,2429,0.875,2430,3.123,2431,0.963,2432,1.787,2433,1.787,2434,0.963,2435,0.963,2436,0.963,2437,0.963,2438,2.5,2439,0.963,2440,0.963,2441,0.963,2442,0.963,2443,0.963,2444,1.787,2445,1.787,2446,0.963,2447,0.963,2448,0.963,2449,0.963,2450,0.963,2451,0.963,2452,0.963,2453,0.963,2454,0.963,2455,0.963,2456,0.963,2457,0.963,2458,0.963,2459,0.963,2460,0.963,2461,0.666,2462,0.963,2463,0.963,2464,0.963,2465,0.963,2466,0.963,2467,0.963]],["t/728",[0,0.888,1,0.747,3,0.649,6,0.421,7,0.738,9,1.961,10,0.883,11,0.925,13,0.336,14,0.727,17,0.533,25,1.119,27,1.855,31,1.736,37,2.031,39,0.686,41,1.495,45,0.449,50,1.054,64,1.095,76,0.686,77,0.377,79,1.962,80,0.709,81,1.218,83,0.316,92,0.875,93,1.314,94,1.39,95,1.271,96,1.227,102,1.71,105,0.903,108,3.167,110,1.057,116,0.443,117,1.618,119,0.994,120,2.398,123,2.548,124,1.05,130,0.373,135,1.718,139,0.523,141,0.827,143,0.714,146,1.925,147,4.169,149,1.1,152,0.687,158,1.507,164,1.406,165,1.627,176,1.508,179,0.592,186,2.666,187,0.934,189,1.021,195,0.862,196,2.166,197,0.475,205,0.749,209,1.087,210,1.981,213,0.475,215,1.514,222,1.79,223,0.303,224,1.223,225,0.345,226,0.74,230,0.714,231,1.329,246,0.788,247,0.578,270,2.882,275,1.028,276,1.028,277,1.011,279,4.619,284,0.482,285,0.475,288,0.858,293,0.94,296,1.446,297,1.381,299,0.352,300,0.468,304,1.219,307,1.508,309,1.328,318,2.507,321,1.042,322,2.193,323,1.813,344,0.311,347,1.959,352,2.091,355,1.62,358,1.988,365,0.986,368,1.007,369,1.605,374,1.095,377,2.363,379,1.531,380,1.382,384,0.779,385,0.945,386,2.113,387,2.417,388,2.844,389,2.492,390,2.492,391,2.492,392,2.492,393,2.799,394,2.553,395,2.016,396,2.345,397,1.161,398,2.154,399,1.779,400,2.107,401,2.091,402,1.161,403,2.091,404,2.091,405,1.161,406,1.992,407,2.311,408,2.345,409,2.826,410,2.107,411,1.17,412,2.374,413,1.178,414,2.345,415,2.311,416,2.277,418,2.307,420,2.574,421,1.152,422,1.161,423,1.75,424,1.136,425,1.687,426,1.918,427,1.161,428,1.205,429,1.152,430,1.161,431,2.107,432,2.107,433,1.161,434,1.087,435,2.324,438,2.061,442,2.18,445,1.17,446,1.17,447,1.17,448,1.17,449,1.161,450,0.928,451,1,452,1.17,453,1.725,454,1.161,455,1.17,456,1.17,457,1.17,458,1.17,459,1.17,460,1.763,465,1.161,466,1.17,467,1.205,468,1.178,469,1.17,470,1.17,471,1.17,472,1.178,473,1.178,474,1.178,475,1.205,476,1.17,477,1.17,478,1.178,479,1.178,486,2.413,487,2.265,490,1.512,492,1.712,493,1.136,494,1.08,495,1.144,496,1.119,504,2.343,506,3.185,533,0.824,562,1.238,582,1.365,594,1.277,596,0.578,597,1.481,599,0.955,603,3.13,605,0.339,606,0.784,607,1.102,609,0.686,610,0.625,613,2.445,616,0.642,618,0.843,626,0.402,630,1.446,631,1.277,635,0.322,654,0.793,656,0.578,661,2.721,665,0.593,670,1.344,684,0.757,692,1.826,693,1.848,694,0.788,695,0.788,696,0.788,697,0.663,698,0.663,702,1.367,703,1.468,704,2,706,1.215,707,1.455,708,2.193,709,1.196,710,2.639,711,1.468,712,1.468,713,2.212,714,1.258,717,1.468,718,1.468,719,1.215,720,1.551,721,1.468,723,1.481,763,0.514,778,2.845,779,2.754,781,0.788,782,0.624,788,1.277,802,1.053,809,0.607,819,0.642,854,0.514,860,0.592,891,0.843,900,1.417,913,1.194,994,0.607,1007,0.714,1014,0.624,1018,0.514,1076,0.747,1084,0.747,1099,2.755,1104,1.194,1111,0.578,1125,1.862,1317,1.447,1319,0.592,1514,1.466,1524,1.584,1527,4.056,1534,1.506,1554,0.714,1591,2.284,1638,0.843,1653,0.686,1660,1.233,1662,1.651,1683,0.592,1769,0.714,1781,0.788,1820,0.686,1843,2.672,1844,1.194,1902,0.843,1963,0.843,1976,2.164,2000,0.843,2006,6.554,2064,0.843,2129,1.569,2211,7.085,2212,5.629,2234,3.441,2376,0.843,2394,3.334,2397,0.843,2398,9.234,2400,3.683,2402,3.683,2410,3.683,2422,6.526,2429,1.569,2461,0.642,2468,0.927,2469,3.032,2470,1.466,2471,3.03,2472,0.927,2473,1.726,2474,0.927,2475,1.726,2476,3.03,2477,0.927,2478,0.927,2479,3.03,2480,1.726,2481,0.843,2482,0.927,2483,0.927,2484,0.927,2485,0.927,2486,0.927,2487,0.927,2488,1.726,2489,1.726]],["t/730",[0,1.21,3,1.253,7,0.567,14,0.982,17,0.8,19,2.919,30,2.559,31,3.547,50,2.444,51,3.899,73,4.752,74,4.584,90,3.081,94,1.078,95,0.913,105,0.945,117,1.556,118,4.297,149,1.103,197,5.077,212,5.91,213,5.077,224,1.176,244,1.96,302,2.416,323,1.785,344,2.774,406,2.005,504,3.533,506,5.047,605,3.025,606,3.757,615,4.113,648,4.666,665,3.412,684,3.627,692,4.233,697,5.91,702,3.169,703,2.998,763,4.584,830,5.416,835,4.113,889,6.659,1508,6.365,1519,5.562,1534,4.113,1574,5.282,1662,5.406,1877,6.365,1878,7.028,1898,6.659,2210,5.726,2490,7.028,2491,7.028]],["t/732",[0,1.195,3,1.068,7,0.761,17,0.802,19,2.766,29,1.857,30,2.425,31,3.361,50,2.315,74,4.344,90,3.867,95,1.146,105,1.018,118,4.071,142,6.492,149,1.256,151,4.782,154,2.733,187,1.808,197,4.914,244,1.857,249,4.914,277,1.321,314,2.606,354,4.503,367,6.458,381,3.945,382,3.288,399,2.276,523,5.8,600,6.031,603,4.38,606,4.362,613,2.502,635,2.719,665,3.974,692,5.313,702,3.003,703,2.841,763,4.344,807,5.232,849,5.6,1616,5.6,1617,4.59,1621,5.6,1662,4.27,1681,4.716,2038,7.128,2380,6.031,2492,6.031]],["t/734",[0,1.167,3,1.227,7,0.569,9,1.742,14,0.821,16,2.715,17,0.756,19,3.982,27,1.94,45,4.016,50,2.452,95,0.916,102,1.484,105,0.981,119,3.409,135,1.94,142,4.768,149,0.923,174,4.016,176,3.091,197,4.247,223,2.715,224,1.414,225,3.965,226,3.559,244,2.356,261,2.213,272,4.944,277,1.367,285,4.247,344,2.783,345,4.263,354,4.768,355,2.146,381,3.409,382,3.482,523,4.448,599,3.274,603,3.922,623,4.186,629,4.86,659,4.768,665,2.854,774,3.863,807,4.522,1285,4.378,1286,4.016,1664,5.434,1681,4.516]],["t/736",[3,1.048,19,3.327,135,2.204,344,3.16,345,4.042,623,4.754]],["t/738",[3,1.002,17,0.805,30,3.229,119,4.287,130,3.627,149,1.002,174,4.36,179,5.755,183,4.045,213,5.341,249,5.341,302,2.195,322,2.352,647,4.195,969,6.238,1617,5.278,1662,5.686,1730,5.755,1951,6.935,1969,7.658,2379,6.439,2380,6.935]],["t/740",[7,0.703,9,1.967,17,0.622,29,2.075,30,3.175,44,2.709,57,3.884,142,6.451,318,2.192,354,5.03,381,3.597,382,3.674,406,1.77,603,4.429,613,3.277,626,3.797,705,7.05,803,7.593,1050,7.332,1051,7.05,1616,7.332,1662,4.771,1681,5.1,2379,6.256,2380,6.738,2382,7.44,2492,6.738,2493,8.757]],["t/742",[7,0.598,57,5.072,80,1.529,142,5.013,354,5.884,381,3.584,382,3.661,406,1.763,613,3.733,659,5.884,661,3.712,796,8.043,1578,7.584,1681,4.938,1843,5.241,2005,6.714,2394,5.572,2494,9.886,2495,7.025,2496,9.314,2497,7.025,2498,7.414]],["t/745",[0,0.205,1,0.364,2,0.78,3,0.437,5,0.606,7,0.735,9,0.185,13,0.704,14,0.714,17,0.482,25,1.35,27,1.687,29,0.25,30,1.216,37,2.265,41,1.464,44,0.601,64,1.527,79,1.136,80,0.34,81,1.398,90,0.393,92,0.781,93,1.301,94,1.236,95,1.148,102,1.71,104,2.102,105,0.848,108,2.103,110,1.275,117,1.542,120,2.844,123,1.808,124,1.463,135,1.916,141,0.901,142,2.259,146,2.111,149,1.159,151,0.643,158,1.613,159,0.517,164,1.136,176,0.724,186,2.77,187,1.127,189,1.231,195,0.692,196,2.371,209,1.312,210,1.026,215,1.689,224,1.297,226,1.159,249,0.994,250,0.643,252,0.35,261,0.518,270,2.993,275,1.24,276,1.24,277,1.127,297,1.513,314,0.35,318,2.603,321,1.257,322,2.337,323,1.969,347,2.185,352,2.332,355,1.513,358,2.094,365,1.19,368,1.215,369,1.842,374,1.321,377,2.586,379,0.985,380,1.275,381,4.033,382,3.636,384,0.87,385,0.843,386,1.015,387,1.991,388,3.003,389,2.727,390,2.727,391,2.727,392,2.727,393,2.871,394,2.71,395,2.171,396,2.567,397,1.401,398,2.403,399,1.942,400,2.35,401,2.332,402,1.401,403,2.289,404,2.332,405,1.401,406,2.101,407,2.53,408,2.567,409,2.981,410,2.35,411,1.411,412,2.564,413,1.422,414,2.567,415,2.53,416,2.493,418,2.492,420,2.741,421,1.39,422,1.401,423,2.009,424,1.37,425,1.937,426,2.204,427,1.401,428,1.454,429,1.39,430,1.401,431,2.35,432,2.35,433,1.401,434,1.516,435,2.51,438,2.368,442,2.25,445,1.411,446,1.411,447,1.411,448,1.411,449,1.401,450,1.119,451,1.206,452,1.411,453,1.98,454,1.401,455,1.411,456,1.411,457,1.411,458,1.411,459,1.411,460,2.024,465,1.401,466,1.411,467,1.454,468,1.422,469,1.411,470,1.411,471,1.411,472,1.422,473,1.422,474,1.422,475,1.454,476,1.411,477,1.411,478,1.422,479,1.422,486,2.606,487,2.439,488,0.668,490,1.266,492,1.966,493,1.37,494,1.303,495,1.38,496,1.35,551,0.497,604,0.62,610,0.979,615,0.524,654,0.485,659,3.754,661,0.704,670,0.862,702,1.507,703,1.425,704,1.507,706,1.465,707,1.413,708,2.145,709,1.443,710,2.593,711,1.425,712,1.425,713,2.164,714,0.806,717,1.425,718,1.425,719,1.465,720,2.025,721,1.425,723,1.438,737,0.704,747,0.524,770,0.896,807,0.574,865,0.468,965,2.007,1050,0.753,1077,0.594,1216,0.643,1291,0.724,1292,0.724,1293,0.724,1294,0.717,1295,0.524,1298,0.724,1299,1.251,1300,0.717,1301,0.724,1302,0.724,1305,0.724,1306,0.724,1307,0.717,1311,0.73,1317,0.928,1371,0.896,1520,0.811,1532,0.959,1577,0.73,1591,1.096,1616,3.776,1617,1.138,1634,0.78,1661,1.116,1664,0.69,1681,2.401,1843,0.994,1849,5.66,1852,0.73,1855,2.511,1860,0.73,1926,0.78,2141,0.811,2146,1.931,2177,0.811,2300,0.849,2492,5.029,2499,1.651,2500,7.777,2501,1.651,2502,3.933,2503,1.054,2504,1.651,2505,1.054,2506,1.054,2507,1.943,2508,1.943]],["t/747",[0,0.435,1,0.833,3,0.588,7,0.742,13,3.289,14,0.679,17,0.527,19,0.87,25,1.137,27,1.237,30,1.272,37,2.05,41,1.443,44,0.763,57,4.708,64,1.431,67,1.281,73,1.416,79,0.712,80,0.721,81,1.232,83,0.841,92,1.188,93,1.811,94,1.356,95,1.201,102,1.71,104,2.473,105,0.825,110,1.074,117,1.162,120,2.423,124,1.372,135,1.734,141,0.976,146,2.091,149,1.101,155,1.574,158,1.306,159,2.017,164,0.712,186,2.675,187,0.949,188,1.281,189,1.037,195,0.878,196,2.183,205,1.911,209,1.421,210,0.936,215,1.529,224,1.218,249,1.262,252,0.82,261,1.097,270,2.892,275,1.044,276,1.044,277,1.02,297,0.841,301,2.847,307,1.532,318,2.479,321,1.059,322,2.152,323,1.779,347,1.978,352,2.111,355,1.333,358,1.928,365,1.002,368,1.023,369,1.624,371,1.391,374,1.112,377,2.382,379,1.206,380,1.256,381,2.174,382,2.881,384,1.324,385,1.282,386,1.243,387,2.259,388,2.844,389,2.511,390,2.511,391,2.511,392,2.511,393,2.806,394,2.567,395,1.884,396,2.364,397,1.179,398,2.175,399,1.758,400,2.127,401,2.111,402,1.179,403,2.107,404,2.111,405,1.179,406,2.001,407,2.329,408,2.364,409,2.839,410,2.127,411,1.188,412,2.39,413,1.197,414,2.364,415,2.329,416,2.295,418,2.323,420,2.511,421,1.171,422,1.179,423,1.771,424,1.153,425,1.707,426,2.054,427,1.179,428,1.224,429,1.171,430,1.179,431,2.127,432,2.127,433,1.179,434,1.421,435,2.339,438,2.207,442,1.95,445,1.188,446,1.188,447,1.188,448,1.188,449,1.179,450,0.942,451,1.015,452,1.188,453,1.745,454,1.179,455,1.188,456,1.188,457,1.188,458,1.188,459,1.188,460,1.784,465,1.179,466,1.188,467,1.224,468,1.197,469,1.188,470,1.188,471,1.188,472,1.197,473,1.197,474,1.197,475,1.224,476,1.188,477,1.188,478,1.197,479,1.197,486,2.399,487,2.259,488,1.414,490,1.066,492,1.732,493,1.153,494,1.097,495,1.162,496,1.137,551,1.162,603,0.973,613,3.409,636,1.416,654,1.891,659,2.363,702,2.366,703,2.239,704,2.366,706,1.234,707,0.886,708,1.477,709,1.215,710,1.901,711,0.894,712,0.894,713,1.491,717,0.894,718,0.894,719,1.587,720,1.576,721,0.894,723,0.902,737,0.894,783,1.614,793,4.856,866,1.824,1077,1.391,1291,0.918,1292,0.918,1293,0.918,1294,0.91,1298,0.918,1299,1.532,1300,0.91,1301,0.918,1302,1.532,1305,0.918,1306,0.918,1307,0.91,1311,0.927,1584,1.658,1586,1.614,1589,1.658,1616,4.905,1661,2.363,1675,1.762,1681,4.686,2100,2.242,2103,3.043,2107,2.242,2285,6.118,2308,1.824,2309,3.043,2311,1.824,2394,4.384,2492,5.283,2494,8.036,2498,5.834,2500,7.114,2501,2.095,2502,3.311,2504,2.095,2509,2.466,2510,4.812,2511,5.292,2512,2.242,2513,2.466,2514,2.242,2515,2.466,2516,2.466,2517,2.242,2518,2.466,2519,2.466,2520,2.466]],["t/749",[0,0.242,1,0.675,5,1.313,7,0.606,9,0.4,11,1.225,13,2.383,14,0.706,17,0.356,25,1.384,27,1.376,30,1.194,31,0.98,37,2.297,41,1.357,44,0.707,57,4.102,64,1.779,79,0.66,80,0.676,81,1.423,94,0.653,95,1,102,1.706,104,2.825,105,0.786,110,1.307,117,1.237,120,2.321,124,1.705,130,0.92,135,1.943,141,0.924,142,1.313,146,2.184,149,1.171,150,1.411,158,1.453,159,1.121,164,0.66,175,1.942,183,1.026,186,2.782,187,1.155,189,1.262,196,2.398,200,1.205,205,0.707,207,1.84,209,1.345,210,0.867,215,1.713,224,1.288,249,1.169,252,0.76,270,3.007,275,1.271,276,1.271,277,1.143,297,0.779,299,0.867,307,0.851,318,2.62,321,1.289,322,2.364,323,1.954,347,2.216,352,2.365,355,1.54,358,2.117,365,1.22,368,1.245,369,1.875,374,1.355,377,2.616,380,1.019,388,3.025,389,2.758,390,2.758,391,2.758,392,2.758,393,2.879,394,2.73,395,2.084,396,2.597,397,1.436,398,2.437,399,1.969,400,2.383,401,2.365,402,1.436,403,2.315,404,2.365,405,1.436,406,2.141,407,2.558,408,2.597,409,3.001,410,2.383,411,1.447,412,2.589,413,1.458,414,2.597,415,2.558,416,2.521,418,2.516,420,2.712,421,1.425,422,1.436,423,2.046,424,1.405,425,1.972,426,2.307,427,1.436,428,1.491,429,1.425,430,1.436,431,2.383,432,2.383,433,1.436,434,1.766,435,2.534,438,2.479,442,2.098,445,1.447,446,1.447,447,1.447,448,1.447,449,1.436,450,1.148,451,1.237,452,1.447,453,2.016,454,1.436,455,1.447,456,1.447,457,1.447,458,1.447,459,1.447,460,2.061,465,1.436,466,1.447,467,1.491,468,1.458,469,1.447,470,1.447,471,1.447,472,1.458,473,1.458,474,1.458,475,1.491,476,1.447,477,1.447,478,1.458,479,1.458,486,2.636,487,2.447,488,1.327,490,1.298,492,2.001,493,1.405,494,1.335,495,1.415,496,1.384,504,0.814,613,3.1,615,1.136,703,1.399,706,1.502,707,0.821,708,1.386,709,1.48,710,1.799,711,0.828,712,0.828,713,1.399,717,0.828,718,0.828,719,1.502,720,1.478,721,0.828,723,0.836,737,1.399,756,1.425,791,1.245,803,1.691,811,2.078,1003,1.691,1280,2.671,1291,1.437,1292,1.437,1293,1.437,1294,1.424,1298,1.437,1299,2.192,1300,1.424,1301,1.437,1302,1.437,1305,1.437,1306,1.437,1307,1.424,1311,1.451,1584,2.595,1586,2.526,1589,2.595,1661,2.217,1664,1.496,1681,3.45,1835,1.942,1875,1.942,1980,1.942,1981,2.078,2103,1.691,2395,2.078,2495,5.295,2496,5.981,2500,5.744,2502,1.84,2510,4.555,2512,2.078,2514,2.078,2517,2.078,2521,5.009,2522,2.078,2523,5.886,2524,2.285,2525,2.285,2526,2.285,2527,2.285,2528,2.285,2529,2.285,2530,7.557,2531,5.009,2532,2.078,2533,2.285,2534,3.509,2535,2.285,2536,2.285,2537,2.078,2538,2.285,2539,2.285]],["t/751",[0,0.614,1,0.952,3,0.177,5,0.912,7,0.753,9,0.278,11,0.851,12,1.588,13,1.02,14,0.622,17,0.524,20,2.385,25,1.048,27,0.887,30,2.184,31,0.681,37,1.951,41,1.495,44,0.871,57,3.7,64,1.42,73,0.912,77,0.646,79,0.459,80,0.493,81,1.159,90,0.592,92,1.096,93,1.703,94,1.429,95,1.254,102,1.712,104,2.655,105,0.822,110,0.99,117,0.988,124,1.361,130,0.639,135,1.725,141,0.847,142,3.848,146,2.034,149,1.074,150,0.581,155,2.422,158,1.133,159,1.381,164,0.459,175,2.392,176,0.592,186,2.628,187,0.875,188,0.825,189,0.956,195,1.002,196,2.154,197,0.813,203,0.969,205,0.491,209,1.232,210,1.069,215,1.52,224,1.186,226,1.626,231,1.709,249,1.441,252,1.261,260,1.135,261,0.751,270,2.84,275,0.963,276,0.963,277,1.015,288,0.79,297,0.542,299,1.069,304,0.639,307,1.413,318,2.417,321,0.976,322,2.065,323,1.84,328,0.768,344,0.533,347,1.882,352,2.009,354,0.912,355,1.446,358,1.849,365,0.924,368,0.943,369,1.527,371,0.896,374,1.026,377,2.285,379,1.345,380,1.279,381,2.752,382,3.319,383,4.373,384,1.221,385,1.431,386,1.587,387,2.649,388,2.766,389,2.409,390,2.409,391,2.409,392,2.409,393,2.772,394,2.496,395,1.725,396,2.268,397,1.087,398,2.07,399,1.673,400,2.024,401,2.009,402,1.087,403,2.08,404,2.009,405,1.087,406,1.952,407,2.235,408,2.268,409,2.769,410,2.024,411,1.096,412,2.306,413,1.104,414,2.268,415,2.235,416,2.202,418,2.242,420,2.386,421,1.079,422,1.087,423,1.665,424,1.064,425,1.605,426,1.999,427,1.087,428,1.129,429,1.079,430,1.087,431,2.024,432,2.024,433,1.087,434,1.41,435,2.258,438,2.148,442,1.761,445,1.096,446,1.096,447,1.096,448,1.096,449,1.087,450,0.869,451,0.936,452,1.096,453,1.641,454,1.087,455,1.096,456,1.096,457,1.096,458,1.096,459,1.096,460,1.678,465,1.087,466,1.096,467,1.129,468,1.104,469,1.096,470,1.096,471,1.096,472,1.104,473,1.104,474,1.104,475,1.129,476,1.096,477,1.096,478,1.104,479,1.104,486,2.302,487,2.179,488,1.304,490,0.983,492,1.629,493,1.064,494,1.011,495,1.071,496,1.048,501,0.88,503,0.991,504,0.565,551,1.327,603,3.905,610,0.576,613,3.205,626,0.689,635,0.551,636,0.912,654,0.73,659,4.674,665,0.546,670,1.249,702,2.826,703,2.776,704,3.031,706,1.138,707,0.57,708,1.011,709,1.12,710,1.362,711,0.576,712,0.576,713,1.02,717,0.576,718,0.576,719,1.376,721,0.576,723,0.581,725,1.014,737,1.02,763,0.88,774,0.739,778,2.5,779,2.421,791,0.865,793,5.179,796,4.65,849,1.135,886,1.279,1052,0.88,1077,0.896,1111,0.991,1222,1.222,1291,1.049,1292,1.049,1293,1.049,1294,1.039,1298,1.049,1299,1.709,1300,1.039,1301,1.049,1302,1.413,1305,1.049,1306,1.049,1307,1.039,1311,1.059,1514,1.35,1578,2.483,1584,1.068,1586,1.04,1589,1.068,1615,1.135,1616,5.27,1617,0.93,1636,1.35,1661,1.618,1681,4.529,1749,1.04,1883,1.279,1889,1.444,1893,1.444,1907,1.279,1960,5.716,1972,1.35,1993,6.964,2005,6.261,2083,1.099,2085,1.099,2088,1.099,2103,1.175,2117,1.444,2118,1.444,2122,1.444,2188,1.279,2469,4.461,2470,2.392,2492,5.676,2497,3.054,2498,1.35,2500,6.166,2501,1.35,2502,2.267,2504,1.35,2522,1.444,2540,2.561,2541,1.588,2542,1.35,2543,1.444,2544,6.419,2545,1.588,2546,3.793,2547,2.561,2548,2.816,2549,1.588,2550,1.588,2551,1.588,2552,2.816,2553,1.588,2554,1.444,2555,1.444,2556,1.588,2557,1.444,2558,4.589,2559,1.588,2560,1.588,2561,1.588,2562,1.588,2563,1.588]],["t/753",[3,1.015,7,0.625,30,2.824,44,2.824,75,4.097,149,1.015,150,3.339,226,4.508,243,5.83,249,4.672,280,7.757,321,2.35,326,4.508,340,6.319,600,7.025,603,3.601,1104,6.319,1619,7.025,1842,7.757,2543,8.302,2564,9.13]],["t/755",[3,1.231,14,0.903,17,0.786,30,3.253,149,1.169,151,5.57,244,2.163,290,4.672,302,2.697,399,2.163,832,7.779,1212,5.694,1213,7.757,1662,4.974]],["t/757",[0,1.131,1,1.023,3,1.189,7,0.754,9,1.649,14,0.931,16,2.481,17,0.727,19,3.882,27,1.773,28,2.878,30,2.346,45,3.67,50,2.241,83,3.489,90,2.825,95,1.181,102,1.533,105,0.951,119,3.116,133,3.289,135,1.773,149,1.138,154,3.131,174,3.67,176,2.825,197,3.881,205,2.346,223,2.481,224,1.521,225,4.097,244,2.535,261,2.728,272,4.679,277,1.472,317,3.116,324,4.132,344,2.543,345,4.035,355,2.031,381,3.116,382,3.182,406,1.533,504,3.643,523,5.484,551,3.575,599,2.992,606,3.445,610,2.749,623,3.825,635,2.631,665,3.519,692,3.881,774,3.53,788,5.611,807,4.132,865,3.364,1212,6.383,1285,4.001,1286,3.67,1664,4.966,1681,4.274,2024,5.419,2067,5.87,2077,5.419,2565,7.083,2566,5.611]],["t/759",[3,1.048,19,3.327,135,2.204,344,3.16,345,4.042,623,4.754]],["t/761",[3,1.152,14,0.881,17,0.736,30,2.753,119,3.655,140,6.16,149,1.152,183,3.994,195,3.168,213,4.554,230,6.847,289,3.774,290,4.554,302,2.167,321,2.29,442,2.339,490,2.685,520,6.583,647,4.142,693,5.429,698,6.357,832,6.583,1212,5.551,1213,7.561,1513,7.665,1591,5.019,1617,5.211,1661,5.112,1662,4.848,2067,5.551,2092,6.847,2567,8.092]],["t/763",[9,1.976,13,3.219,28,3.928,154,3.21,326,3.809,406,1.795,622,5.815,626,3.851,1111,5.541,1212,6.831,1681,4.7,2024,7.394,2067,7.254,2077,6.346,2565,7.581,2566,7.656,2568,7.963,2569,8.078]],["t/765",[6,3.834,7,0.688,9,1.944,13,3.059,17,0.599,30,2.611,35,6.496,80,1.944,109,4.197,149,1.192,154,2.858,183,3.789,213,4.32,236,7.342,238,5.843,296,5.043,299,3.204,317,3.468,337,3.834,361,6.496,367,5.677,406,1.706,622,5.527,628,4.524,636,4.85,661,3.64,818,5.043,1212,6.265,1606,5.266,1651,5.843,1681,4.562,1843,5.139,1982,8.086,2067,7.304,2394,6.413,2565,6.952,2570,8.086]],["t/767",[0,0.96,3,1.165,7,0.622,9,1.591,14,0.898,20,4.76,21,6.486,95,1.157,105,0.807,117,1.708,203,5.539,244,2.151,264,6.486,288,4.514,289,3.85,302,2.211,344,3.044,406,1.835,487,2.32,1896,6.986,2067,5.663,2571,8.256,2572,8.256]],["t/769",[3,1.031,6,3.367,7,0.796,9,1.299,14,0.734,17,0.659,28,4.028,30,2.293,41,1.518,92,2.141,93,2.72,94,1.474,95,1.171,102,1.7,144,4.319,230,5.705,265,5.705,289,3.144,290,5.182,323,1.6,344,2.486,379,2.174,380,1.508,384,2.386,385,2.311,386,2.241,387,3.085,406,1.498,490,1.922,693,4.523,698,5.297,812,3.794,854,4.109,1111,4.624,1212,5.787,1513,5.485,1591,4.182,1669,7.582,1681,4.214,1730,4.734,2024,7.582,2066,7.852,2067,7.133,2077,6.629,2565,6.423,2566,7.492,2568,7.793,2573,6.742,2574,7.414,2575,8.166]],["t/771",[0,0.638,1,0.749,6,0.671,7,0.672,9,0.877,14,0.706,17,0.428,20,1.2,25,1.383,27,1.299,28,1.653,30,0.457,37,2.296,41,1.357,64,1.743,79,1.034,81,1.422,83,0.504,94,0.652,95,1.118,102,1.707,104,2.814,105,0.858,108,3.274,110,1.306,117,1.281,120,1.766,123,2.301,124,1.671,135,1.983,141,1.113,146,2.2,149,1.168,158,1.489,164,0.763,186,2.782,187,1.154,189,1.261,196,2.397,205,1.108,209,1.62,210,1.002,215,1.712,224,1.287,236,2.287,247,0.922,250,0.902,270,3.007,275,1.27,276,1.27,277,1.142,297,0.901,307,0.551,317,0.607,318,2.629,321,1.288,322,2.363,323,1.954,344,0.496,347,2.215,352,2.364,355,1.539,358,2.117,365,1.219,368,1.244,369,1.874,374,1.353,377,2.615,380,1.018,388,3.024,389,2.757,390,2.757,391,2.757,392,2.757,393,2.879,394,2.729,395,2.105,396,2.595,397,1.435,398,2.435,399,2.01,400,2.381,401,2.364,402,1.435,403,2.314,404,2.364,405,1.435,406,2.123,407,2.557,408,2.595,409,3,410,2.381,411,1.445,412,2.588,413,1.456,414,2.595,415,2.557,416,2.52,418,2.515,420,2.721,421,1.424,422,1.435,423,2.044,424,1.403,425,1.971,426,2.294,427,1.435,428,1.49,429,1.424,430,1.435,431,2.381,432,2.381,433,1.435,434,1.731,435,2.533,438,2.465,442,2.133,445,1.445,446,1.445,447,1.445,448,1.445,449,1.435,450,1.147,451,1.235,452,1.445,453,2.014,454,1.435,455,1.445,456,1.445,457,1.445,458,1.445,459,1.445,460,2.059,465,1.435,466,1.445,467,1.49,468,1.456,469,1.445,470,1.445,471,1.445,472,1.456,473,1.456,474,1.456,475,1.49,476,1.445,477,1.445,478,1.456,479,1.456,486,2.634,487,2.446,488,1.721,490,1.297,492,2,493,1.403,494,1.334,495,1.414,496,1.383,551,0.697,582,0.834,661,3.01,706,1.501,707,0.949,708,1.564,709,1.478,710,1.996,711,0.957,712,0.957,713,1.578,714,1.808,717,0.957,718,0.957,719,1.809,720,1.012,721,0.957,723,0.966,737,1.298,747,1.313,804,1.256,865,1.172,913,1.023,1212,1.648,1291,1.334,1292,1.334,1293,1.334,1294,1.322,1295,1.313,1298,1.334,1299,2.07,1300,1.322,1301,1.334,1302,1.864,1305,1.334,1306,1.334,1307,1.322,1311,1.346,1317,1.261,1434,1.056,1513,1.094,1527,3.195,1591,0.834,1669,5.797,1681,1.2,1730,0.944,1843,3.298,1849,4.348,1852,2.479,1855,2.287,1860,2.479,2024,2.558,2066,6.503,2067,3.466,2077,2.558,2210,1.023,2241,1.344,2461,1.023,2565,1.828,2566,2.649,2568,2.033,2575,5.707,2576,2.642,2577,9.075,2578,2.402,2579,4.252,2580,2.883,2581,5.125,2582,1.478,2583,2.402,2584,4.252,2585,2.402,2586,2.402,2587,1.478,2588,2.402,2589,1.344,2590,2.402,2591,1.478,2592,1.344,2593,1.478,2594,1.478,2595,1.478]],["t/773",[0,0.538,1,0.973,6,1.06,7,0.739,9,0.689,13,0.846,14,0.714,17,0.595,25,1.086,27,1.395,28,2.265,30,1.216,37,1.994,41,1.395,54,1.395,64,1.376,79,1.135,81,1.328,92,0.674,93,1.152,94,1.093,95,1.262,102,1.707,104,2.598,105,0.898,108,1.895,110,1.026,116,1.115,117,1.357,120,2.35,124,1.319,135,1.687,141,1.229,144,1.829,146,2.092,149,1.099,158,1.256,164,0.674,186,2.649,187,0.906,189,0.99,195,0.831,196,2.133,197,1.195,203,1.425,205,1.216,209,1.788,210,0.886,215,1.487,224,1.192,236,3.249,252,0.776,270,2.863,275,0.997,276,0.997,277,0.992,290,2.011,293,1.272,296,1.395,297,0.796,302,0.569,304,2.048,307,0.87,317,0.959,318,2.475,321,1.011,322,2.325,323,1.809,347,1.924,352,2.053,355,1.437,358,1.884,364,1.491,365,0.957,368,0.977,369,1.569,374,1.063,377,2.327,379,0.685,380,1.035,384,0.751,385,0.728,386,0.706,387,2.028,388,2.8,389,2.454,390,2.454,391,2.454,392,2.454,393,2.787,394,2.527,395,1.827,396,2.31,397,1.127,398,2.115,399,1.71,400,2.068,401,2.053,402,1.127,403,2.059,404,2.053,405,1.127,406,1.999,407,2.276,408,2.31,409,2.8,410,2.068,411,1.135,412,2.343,413,1.144,414,2.31,415,2.276,416,2.243,418,2.277,420,2.458,421,1.118,422,1.127,423,1.711,424,1.102,425,1.649,426,2.003,427,1.127,428,1.17,429,1.118,430,1.127,431,2.068,432,2.068,433,1.127,434,1.366,435,2.293,438,2.152,442,1.897,445,1.135,446,1.135,447,1.135,448,1.135,449,1.127,450,0.9,451,0.97,452,1.135,453,1.686,454,1.127,455,1.135,456,1.135,457,1.135,458,1.135,459,1.135,460,1.724,465,1.127,466,1.135,467,1.17,468,1.144,469,1.135,470,1.135,471,1.135,472,1.144,473,1.144,474,1.144,475,1.17,476,1.135,477,1.135,478,1.144,479,1.144,486,2.344,487,2.214,488,2.052,490,1.319,492,1.674,493,1.102,494,1.048,495,1.11,496,1.086,504,1.399,596,1.456,615,1.161,661,3.14,692,1.195,693,1.425,702,1.949,703,1.844,704,2.551,706,1.179,707,0.839,708,1.412,709,1.161,710,1.828,711,0.846,712,0.846,713,1.424,714,0.969,717,0.846,718,0.846,719,1.997,720,1.506,721,0.846,723,0.854,737,0.846,747,1.161,802,1.425,807,1.272,812,1.195,859,1.317,1018,1.294,1212,3.722,1291,0.87,1292,0.87,1293,0.87,1294,0.862,1295,1.161,1298,0.87,1299,1.464,1300,0.862,1301,0.87,1302,2.223,1305,0.87,1306,0.87,1307,0.862,1311,0.878,1527,5.532,1653,1.727,1661,1.341,1669,6.516,1681,2.311,1747,1.984,1749,1.529,1843,4.433,1849,3.249,1852,1.616,1855,1.491,1860,1.616,2009,2.807,2024,4.263,2065,7.753,2066,7.545,2067,5.229,2077,2.807,2285,5.989,2308,1.727,2309,2.907,2311,1.727,2394,5.532,2461,1.616,2565,4.131,2566,3.764,2568,3.915,2570,6.749,2575,7.164,2577,9.573,2579,5.07,2580,1.88,2581,5.657,2584,5.07,2596,2.335,2597,8.403,2598,4.627,2599,3.574,2600,3.574,2601,2.123,2602,3.574,2603,3.574,2604,2.123,2605,2.335,2606,3.574,2607,3.574,2608,2.123,2609,2.335]],["t/775",[0,0.53,1,1.088,7,0.749,9,0.55,14,0.666,17,0.554,25,1.155,27,0.977,37,2.07,41,1.451,64,1.538,79,1.806,80,0.55,81,1.247,92,0.519,93,0.92,94,1.297,95,1.236,102,1.709,104,2.8,105,0.885,110,1.091,116,0.858,117,0.943,119,0.738,120,2.007,124,1.474,135,1.751,141,1.241,146,2.143,149,1.106,154,2.031,158,1.237,164,0.519,176,0.669,186,2.685,187,0.964,189,1.053,196,2.2,205,0.556,209,1.807,210,1.191,215,1.543,224,1.213,236,2.005,238,2.173,252,0.598,270,2.901,275,1.061,276,1.061,277,1.03,297,0.613,304,0.723,307,0.669,314,0.598,317,0.738,318,2.491,321,1.076,322,2.226,323,1.794,344,0.603,347,1.997,352,2.131,355,1.349,358,1.943,359,0.779,365,1.018,368,1.039,369,1.643,374,1.13,377,2.401,379,0.92,380,1.157,384,0.578,385,0.56,386,1.263,387,2.281,388,2.859,389,2.531,390,2.531,391,2.531,392,2.531,393,2.812,394,2.58,395,1.846,396,2.383,397,1.198,398,2.196,399,1.848,400,2.147,401,2.131,402,1.198,403,2.124,404,2.131,405,1.198,406,2.027,407,2.348,408,2.383,409,2.853,410,2.147,411,1.207,412,2.406,413,1.216,414,2.383,415,2.348,416,2.314,418,2.339,420,2.5,421,1.189,422,1.198,423,1.792,424,1.172,425,1.728,426,2.106,427,1.198,428,1.244,429,1.189,430,1.198,431,2.147,432,2.147,433,1.198,434,1.527,435,2.356,438,2.263,442,1.876,445,1.207,446,1.207,447,1.207,448,1.207,449,1.198,450,0.958,451,1.032,452,1.207,453,1.766,454,1.198,455,1.207,456,1.207,457,1.207,458,1.207,459,1.207,460,1.806,465,1.198,466,1.207,467,1.244,468,1.216,469,1.207,470,1.207,471,1.207,472,1.216,473,1.216,474,1.216,475,1.693,476,1.207,477,1.207,478,1.216,479,1.216,486,2.419,487,2.274,488,2.15,490,1.083,492,1.753,493,1.172,494,1.114,495,1.181,496,1.155,582,1.014,604,0.574,661,2.266,702,1.601,703,1.515,704,2.179,706,1.254,707,0.646,708,1.128,709,1.235,710,1.501,711,0.651,712,0.651,713,1.138,717,0.651,718,0.651,719,2.018,720,1.203,721,0.651,723,0.657,725,1.148,737,1.138,854,0.996,1052,0.996,1138,1.177,1212,3.125,1291,1.169,1292,1.169,1293,1.169,1294,1.159,1298,1.169,1299,1.866,1300,1.159,1301,1.169,1302,2.328,1305,1.169,1306,1.169,1307,1.159,1311,1.18,1524,1.177,1527,3.632,1591,2.357,1651,1.244,1669,5.765,1681,1.898,1820,1.33,1843,3.199,1959,1.527,2065,8.011,2066,6.907,2067,5.44,2079,1.527,2163,1.634,2210,1.244,2285,2.986,2308,1.33,2309,1.33,2311,1.33,2394,4.296,2461,1.244,2565,3.468,2569,2.855,2570,7.022,2575,6.209,2580,1.447,2597,8.522,2598,3.801,2599,3.801,2600,3.801,2601,1.634,2602,3.801,2603,3.801,2604,1.634,2606,3.801,2607,3.801,2608,1.634,2610,1.797,2611,5.685,2612,1.634,2613,1.634,2614,6.252,2615,3.139,2616,3.139,2617,1.797,2618,3.139,2619,1.797,2620,6.252,2621,10.692,2622,6.252,2623,6.252,2624,3.139,2625,3.139,2626,3.139,2627,3.139,2628,3.139,2629,4.18,2630,3.139,2631,3.139,2632,1.797,2633,3.139,2634,3.139,2635,3.139,2636,3.139,2637,1.797,2638,1.797,2639,1.797,2640,1.797]],["t/777",[0,0.829,1,0.829,7,0.742,9,1.078,14,0.677,17,0.525,20,1.113,25,1.131,27,1.231,30,1.266,37,2.043,41,1.462,64,1.425,79,1.777,80,0.717,81,1.227,92,0.708,93,1.199,94,1.304,95,1.242,102,1.708,104,2.562,105,0.879,110,1.068,116,1.17,117,1.157,123,3.145,124,1.365,133,1.062,135,1.728,141,1.135,144,1.14,146,2.119,149,1.099,158,1.3,164,0.708,176,0.912,186,2.672,187,0.944,189,1.031,191,1.647,196,2.177,197,2.093,205,0.758,209,1.652,210,1.553,215,1.524,224,1.169,231,0.912,247,1.528,270,2.888,275,1.038,276,1.038,277,1.017,290,1.254,297,0.835,304,0.986,307,0.912,317,1.681,318,2.475,321,1.053,322,2.146,323,1.775,324,1.335,343,1.495,347,1.971,352,2.104,355,1.476,358,1.922,365,0.996,368,1.017,369,1.617,374,1.106,377,2.375,379,0.718,380,1.071,384,0.788,385,0.764,386,1.236,387,1.874,388,2.839,389,2.504,390,2.504,391,2.504,392,2.504,393,2.803,394,2.562,395,1.877,396,2.357,397,1.173,398,2.168,399,1.949,400,2.12,401,2.104,402,1.173,403,2.102,404,2.104,405,1.173,406,1.998,407,2.323,408,2.357,409,2.835,410,2.12,411,1.182,412,2.384,413,1.19,414,2.357,415,2.323,416,2.289,418,2.318,420,2.505,421,1.164,422,1.173,423,1.764,424,1.147,425,1.7,426,2.048,427,1.173,428,1.218,429,1.164,430,1.173,431,2.12,432,2.12,433,1.173,434,1.414,435,2.334,438,2.2,442,1.943,445,1.182,446,1.182,447,1.182,448,1.182,449,1.173,450,0.937,451,1.01,452,1.182,453,1.738,454,1.173,455,1.182,456,1.182,457,1.182,458,1.182,459,1.182,460,1.777,465,1.173,466,1.182,467,1.218,468,1.19,469,1.182,470,1.182,471,1.182,472,1.19,473,1.19,474,1.19,475,1.218,476,1.182,477,1.182,478,1.19,479,1.19,486,2.393,487,2.253,488,1.811,490,1.06,492,1.725,493,1.147,494,1.091,495,1.156,496,1.131,504,3.041,582,1.382,584,1.812,635,0.85,661,2.479,665,0.842,670,1.087,684,1.794,702,2.018,703,1.909,704,2.621,706,1.227,707,0.88,708,1.469,709,1.209,710,1.892,711,0.888,712,0.888,713,1.483,717,0.888,718,0.888,719,1.845,721,0.888,723,0.896,732,1.495,737,0.888,791,1.335,802,2.496,825,1.972,859,1.382,865,1.087,913,1.696,994,1.604,1052,2.267,1053,2.228,1111,1.528,1291,0.912,1292,0.912,1293,0.912,1294,0.904,1298,0.912,1299,1.524,1300,0.904,1301,0.912,1302,1.962,1305,0.912,1306,0.912,1307,0.904,1311,0.921,1317,1.953,1534,2.619,1561,1.696,1567,3.72,1654,2.923,1669,6.103,1675,1.75,1843,1.254,2065,7.96,2066,7.685,2067,2.552,2092,1.885,2242,3.476,2258,6.083,2259,7.854,2260,4.953,2461,1.696,2575,6.573,2577,9.11,2578,2.228,2579,4.476,2580,3.294,2581,5.227,2583,2.228,2584,4.476,2585,2.228,2586,2.228,2588,2.228,2589,2.228,2590,2.228,2592,2.228,2597,8.289,2611,5.594,2612,2.228,2613,2.228,2641,2.45,2642,4.79,2643,2.45,2644,2.45,2645,2.45,2646,2.45,2647,4.476,2648,2.45,2649,4.476,2650,2.45]],["t/779",[3,1.164,17,0.644,19,3.198,30,2.803,73,6.015,95,1,212,6.474,224,1.289,253,6.094,254,6.273,277,1.44,281,5.653,302,2.207,321,2.695,406,1.831,889,7.296,1508,6.973,1618,6.973,1877,6.973,1898,7.296,2210,6.273,2490,7.7,2491,7.7]],["t/781",[9,1.554,14,0.877,17,0.734,28,3.365,79,2.561,146,1.926,154,2.942,164,2.561,176,3.303,183,3.979,205,2.743,215,1.827,307,3.303,324,4.831,326,3.802,582,5.831,1212,6.449,1371,7.534,1665,6.335,1748,7.534,1826,8.063,1926,6.56,2024,7.386,2067,5.531,2079,7.534,2316,6.335,2394,5.662,2565,6.138,2566,7.648,2568,6.823,2570,7.138,2642,8.063,2651,8.867]],["t/783",[1,1.134,3,0.935,7,0.576,9,1.942,10,4.305,14,0.832,17,0.597,29,1.994,37,2.325,45,4.07,53,6.562,54,5.988,55,4.438,75,3.776,81,1.678,90,3.134,105,0.748,110,2.616,117,1.583,141,1.552,148,6.224,149,1.19,150,3.666,158,2.077,159,4.126,200,4.438,202,2.73,215,1.734,252,2.797,285,5.129,315,5.657,323,1.816,358,1.967,506,5.133,600,6.473,603,3.954,617,6.473,668,6.224,678,5.508,748,5.869,835,4.183,924,6.01,960,5.133,1083,7.161,1280,5.823,1409,7.651,1577,5.823,1615,6.01,1657,6.773,1783,5.248,2210,5.823,2314,7.651,2315,6.01,2316,6.01,2317,6.224,2652,8.413]],["t/785",[3,1.05,16,3.089,19,3.333,80,1.655,774,4.396]],["t/787",[0,1.206,1,1.424,3,1.093,6,3.701,7,0.751,14,0.973,17,0.779,27,1.905,41,1.474,50,2.905,77,3.313,90,3.663,94,1.377,95,1.085,102,1.371,105,1.026,110,2.127,117,1.987,135,1.905,141,1.504,154,2.319,215,1.679,221,3.246,224,1.502,225,3.663,226,3.494,231,3.035,244,2.33,261,2.173,277,1.353,285,4.17,289,3.456,290,4.17,302,1.984,307,3.035,314,2.71,333,3.279,358,2.469,359,3.533,406,1.647,597,3.383,604,3.14,605,2.98,629,4.772,684,3.573,724,4.299,748,4.772,774,3.793,835,4.889]],["t/789",[0,0.311,1,1.018,7,0.721,9,0.516,12,3.379,14,0.681,16,0.964,17,0.604,25,0.814,37,1.656,41,1.466,64,1.287,77,1.198,80,1.05,81,0.95,92,0.851,93,1.396,94,1.296,95,1.228,96,2.778,102,1.708,104,2.815,105,0.943,108,2.231,110,0.769,117,1.979,124,1.234,135,1.4,141,1.269,146,2.039,148,2.179,149,0.984,150,1.077,152,1.174,157,5.607,158,0.727,186,2.465,187,1.098,189,0.742,196,1.821,209,1.847,211,1.605,213,1.507,215,1.418,224,1.074,233,7.849,243,6.718,261,2.154,270,2.664,275,0.748,276,0.748,277,0.824,314,0.98,318,2.215,321,0.758,322,1.796,323,1.485,326,3.794,344,0.988,347,1.597,352,1.705,355,1.027,358,1.608,365,0.717,368,0.732,369,1.251,374,0.797,377,1.987,379,0.864,380,0.968,384,0.948,385,0.918,386,1.81,387,2.095,388,2.511,389,2.095,390,2.095,391,2.095,392,2.095,393,2.655,394,2.266,395,1.306,396,1.972,397,0.845,398,1.756,399,1.42,400,1.717,401,1.705,402,0.845,403,1.758,404,1.705,405,0.845,406,1.788,407,1.943,408,1.972,409,2.537,410,1.717,411,0.851,412,2.042,413,0.857,414,1.972,415,1.943,416,1.915,418,1.985,420,2.017,421,0.838,422,0.845,423,1.365,424,0.826,425,1.316,426,1.796,427,0.845,428,0.877,429,0.838,430,0.845,431,1.717,432,1.717,433,0.845,434,1.278,435,1.999,438,1.929,442,1.251,445,0.851,446,0.851,447,0.851,448,0.851,449,0.845,450,0.675,451,0.727,452,0.851,453,1.345,454,0.845,455,0.851,456,0.851,457,0.851,458,0.851,459,0.851,460,1.375,465,0.845,466,0.851,467,0.877,468,0.857,469,0.851,470,0.851,471,0.851,472,0.857,473,0.857,474,0.857,475,0.877,476,0.851,477,0.851,478,0.857,479,0.857,486,2.002,487,1.93,488,2.366,490,0.764,492,1.335,493,0.826,494,0.785,495,0.832,496,0.814,554,2.503,555,2.503,556,2.503,599,1.162,624,2.372,635,1.022,647,1.371,661,2.927,668,2.179,702,1.129,703,1.068,704,2.893,706,0.884,709,0.87,714,1.223,719,2.063,737,1.068,747,1.465,778,2.594,779,2.511,812,1.507,960,2.904,994,1.929,1291,1.097,1292,1.097,1293,1.097,1294,1.087,1295,1.465,1298,1.097,1299,1.773,1300,1.087,1301,1.097,1302,2.562,1305,1.097,1306,1.097,1307,1.087,1311,1.107,1350,2.503,1656,6.782,1783,7.217,1828,7.776,1911,2.179,1941,4.11,2315,2.105,2316,3.401,2317,3.522,2653,4.761,2654,4.761,2655,4.761,2656,5.991,2657,7.526,2658,8.448,2659,6.863,2660,10.35,2661,2.946,2662,6.863,2663,5.09,2664,8.31,2665,4.609,2666,2.503,2667,4.045,2668,2.679,2669,2.679,2670,5.448,2671,2.679,2672,2.679,2673,2.679,2674,2.503,2675,2.503,2676,2.503,2677,2.679,2678,4.329,2679,2.679,2680,2.679,2681,2.679,2682,2.679,2683,2.267,2684,2.679,2685,2.679,2686,2.679,2687,2.679,2688,2.679,2689,2.946,2690,2.503,2691,2.503,2692,2.679,2693,2.679,2694,4.329,2695,2.679,2696,2.679,2697,2.679,2698,2.679,2699,2.679]],["t/791",[16,2.932,28,4.293,157,6.758,183,4.023,555,9.612,661,4.173,960,6.902,1661,5.149,1828,6.204,2315,7.433,2700,8.85,2701,10.404,2702,8.964]],["t/793",[0,0.931,1,1.388,14,0.871,17,0.625,28,3.907,53,5.764,54,5.259,55,4.644,95,0.972,110,2.298,117,1.656,144,4.097,149,0.979,152,3.507,157,6.15,195,3.134,196,2.331,284,4.573,314,2.927,326,3.775,343,5.371,345,3.775,406,1.779,521,6.513,598,6.774,599,3.473,748,6.029,768,5.764,782,5.92,879,6.774,1434,6.289,1627,7.087,1656,5.92,1665,6.289,1783,6.806,1828,6.094,2349,7.087]],["t/795",[0,0.193,1,0.43,3,0.203,7,0.643,14,0.747,17,0.409,25,1.402,27,1.765,28,2.397,37,2.313,41,1.365,64,1.556,79,1.224,80,0.321,81,1.436,94,0.661,95,1.036,102,1.707,104,2.037,105,0.834,108,2.353,110,1.324,117,1.651,120,2.773,123,2.645,124,1.491,130,0.736,135,1.957,141,0.936,146,2.133,149,1.173,152,0.729,157,3.437,158,1.677,164,1.224,186,2.789,187,1.17,189,1.279,196,2.411,209,1.362,215,1.725,224,1.316,233,5.979,270,3.014,275,1.288,276,1.288,277,1.151,284,1.656,293,0.997,297,1.445,314,1.06,316,1.555,318,2.629,321,1.306,322,2.378,323,1.966,326,3.087,347,2.231,352,2.382,355,1.554,358,2.13,365,1.235,368,1.261,369,1.893,374,1.372,377,2.631,380,1.032,388,3.036,389,2.774,390,2.774,391,2.774,392,2.774,393,2.884,394,2.74,395,2.23,396,2.611,397,1.454,398,2.454,399,2.034,400,2.399,401,2.382,402,1.454,403,2.328,404,2.382,405,1.454,406,2.122,407,2.573,408,2.611,409,3.011,410,2.399,411,1.465,412,2.602,413,1.476,414,2.611,415,2.573,416,2.536,418,2.528,420,2.787,421,1.444,422,1.454,423,2.064,424,1.423,425,1.99,426,2.24,427,1.454,428,1.51,429,1.444,430,1.454,431,2.399,432,2.399,433,1.454,434,1.545,435,2.546,438,2.407,442,2.307,445,1.465,446,1.465,447,1.465,448,1.465,449,1.454,450,1.162,451,1.252,452,1.465,453,2.034,454,1.454,455,1.465,456,1.465,457,1.465,458,1.465,459,1.465,460,2.079,465,1.454,466,1.465,467,1.51,468,1.476,469,1.465,470,1.465,471,1.465,472,1.476,473,1.476,474,1.476,475,1.51,476,1.465,477,1.465,478,1.476,479,1.476,486,2.651,487,2.458,488,0.629,490,1.315,492,2.019,493,1.423,494,1.353,495,1.433,496,1.402,502,1.014,615,0.91,661,1.156,706,1.522,707,1.522,708,2.269,709,1.499,710,2.712,711,1.536,712,1.536,713,2.289,714,0.76,717,1.536,718,1.536,719,1.522,720,1.944,721,1.536,723,1.55,737,0.663,773,1.198,791,0.997,1054,1.664,1291,0.682,1292,0.682,1293,0.682,1294,0.675,1298,0.682,1299,1.188,1300,0.675,1301,0.682,1302,0.682,1305,0.682,1306,0.682,1307,0.675,1311,0.688,1317,1.523,1619,1.408,1627,1.473,1656,2.144,1665,2.278,1682,1.354,1783,5.22,1828,4.983,1941,5.607,1976,1.307,2316,1.307,2317,1.354,2351,3.136,2657,3.261,2659,1.555,2663,5.367,2665,7.401,2666,1.555,2674,1.555,2676,1.555,2683,3.261,2690,1.555,2703,1.664,2704,1.83,2705,6.317,2706,5.753,2707,7.552,2708,4.239,2709,1.83,2710,1.83,2711,3.189,2712,1.83,2713,1.83,2714,1.83,2715,1.83,2716,1.83]],["t/797",[0,0.36,1,0.889,6,0.631,7,0.741,9,0.438,14,0.762,16,0.454,17,0.491,25,1.149,27,1.456,28,2.027,37,2.063,41,1.448,50,1.417,51,1.177,53,5.966,54,6.038,55,2.193,64,1.445,72,6.622,73,0.798,79,0.721,80,0.438,81,1.242,90,0.517,91,1.18,94,1.238,95,1.204,96,1.837,102,1.708,104,2.536,105,0.908,108,2.781,110,1.517,117,1.301,120,1.692,123,2.204,124,1.384,130,1.005,135,1.745,141,1.073,144,0.646,146,2.115,149,1.104,152,0.995,157,2.484,158,1.319,164,0.721,176,1.268,186,2.682,187,0.959,189,1.048,196,2.238,205,2.139,209,1.561,210,0.948,211,0.757,215,1.539,224,1.28,233,7.182,236,0.887,270,2.898,275,1.055,276,1.055,277,1.027,293,0.757,297,0.852,300,0.7,302,0.338,307,0.93,318,2.487,321,1.07,322,2.164,323,1.789,329,1.069,347,1.99,352,2.125,355,1.344,358,1.938,359,3.594,365,1.012,368,1.034,369,1.637,374,1.125,377,2.394,379,1.219,380,1.267,386,1.257,387,1.771,388,2.854,389,2.525,390,2.525,391,2.525,392,2.525,393,2.81,394,2.576,395,1.897,396,2.377,397,1.192,398,2.189,399,1.769,400,2.14,401,2.125,402,1.192,403,2.119,404,2.125,405,1.192,406,2.032,407,2.342,408,2.377,409,2.848,410,2.14,411,1.201,412,2.401,413,1.21,414,2.377,415,2.342,416,2.308,418,2.334,420,2.523,421,1.183,422,1.192,423,1.785,424,1.166,425,1.721,426,2.066,427,1.192,428,1.238,429,1.183,430,1.192,431,2.14,432,2.14,433,1.192,434,1.434,435,2.35,438,2.22,442,2.024,445,1.201,446,1.201,447,1.201,448,1.201,449,1.192,450,0.953,451,1.026,452,1.201,453,1.759,454,1.192,455,1.201,456,1.201,457,1.201,458,1.201,459,1.201,460,1.799,465,1.192,466,1.201,467,1.238,468,1.21,469,1.201,470,1.201,471,1.201,472,1.21,473,1.21,474,1.21,475,1.238,476,1.201,477,1.201,478,1.21,479,1.21,486,2.412,487,2.269,488,1.649,490,1.078,492,1.746,493,1.166,494,1.109,495,1.175,496,1.149,521,1.027,523,0.744,598,1.069,599,0.548,604,1.327,609,1.848,626,0.602,661,3.303,665,0.859,702,0.532,703,1.234,704,2.386,706,1.247,707,0.897,708,1.493,709,1.228,710,1.918,711,0.905,712,0.905,713,1.507,714,1.413,717,0.905,718,0.905,719,1.744,720,0.957,721,0.905,723,0.913,725,0.887,737,0.905,747,1.242,748,0.813,778,2.265,779,2.193,802,0.847,803,1.027,812,0.711,833,1.463,854,1.384,860,0.887,870,1.027,900,0.813,960,4.396,1014,0.934,1016,1.263,1291,0.93,1292,0.93,1293,0.93,1294,0.922,1295,1.242,1298,0.93,1299,1.549,1300,0.922,1301,0.93,1302,1.786,1305,0.93,1306,0.93,1307,0.922,1311,0.939,1317,1.193,1346,1.118,1476,1.263,1524,0.909,1581,1.263,1598,1.922,1656,3.909,1699,3.199,1783,3.626,1828,6.877,1941,4.729,2004,5.544,2315,3.426,2316,5.922,2317,5.523,2351,1.848,2362,2.271,2657,5.321,2658,6.891,2662,5.601,2665,5.744,2667,2.892,2675,2.892,2683,1.922,2691,2.892,2700,6.53,2703,1.263,2717,5.013,2718,6.543,2719,5.876,2720,4.538,2721,4.94,2722,1.389,2723,1.389,2724,1.389,2725,4.361,2726,3.095,2727,5.876,2728,4.538,2729,4.361,2730,5.876,2731,6.343,2732,1.263,2733,2.271,2734,2.122,2735,2.122,2736,1.263,2737,1.263,2738,2.271,2739,1.263,2740,1.263,2741,1.263,2742,1.389,2743,1.263,2744,1.263,2745,1.263,2746,1.263,2747,2.271,2748,1.263,2749,1.263,2750,1.263,2751,2.271,2752,1.263,2753,1.263,2754,1.263,2755,1.263,2756,2.271,2757,1.263,2758,1.263]],["t/799",[0,0.201,1,1.336,3,0.718,4,1.187,7,0.771,14,0.726,17,0.234,19,0.672,20,1.499,25,1.207,27,1.716,37,2.125,41,1.273,50,1.908,51,0.897,53,6.489,54,6.256,55,1.004,64,1.41,72,5.647,77,0.774,79,0.953,80,0.578,81,1.289,94,0.569,95,1.167,102,1.705,104,0.571,105,0.921,108,4.032,110,1.686,117,1.638,120,2.447,123,2.71,124,1.351,135,1.797,141,1.727,146,2.111,149,1.121,150,0.696,152,0.758,158,1.595,164,0.953,186,2.71,187,1.008,189,1.101,196,2.249,202,0.618,209,1.4,210,0.722,215,1.833,224,1.238,225,1.229,226,0.816,231,1.229,268,1.465,270,2.928,275,1.109,276,1.109,277,1.057,288,0.946,296,1.137,297,1.125,302,0.804,307,0.709,314,0.633,318,2.542,321,1.124,322,2.272,323,1.833,328,3.551,347,2.05,352,2.188,355,1.394,358,2.155,359,2.801,365,1.064,368,1.086,369,1.698,374,1.181,377,2.453,378,1.499,380,0.889,388,2.9,389,2.587,390,2.587,391,2.587,392,2.587,393,2.829,394,2.618,395,2.014,396,2.435,397,1.252,398,2.254,399,1.822,400,2.204,401,2.188,402,1.252,403,2.171,404,2.188,405,1.252,406,2.037,407,2.399,408,2.435,409,2.89,410,2.204,411,1.262,412,2.452,413,1.271,414,2.435,415,2.399,416,2.365,418,2.383,420,2.608,421,1.243,422,1.252,423,1.852,424,1.225,425,1.785,426,2.086,427,1.252,428,1.3,429,1.243,430,1.252,431,2.204,432,2.204,433,1.252,434,1.4,435,2.4,438,2.241,442,2.101,445,1.262,446,1.262,447,1.262,448,1.262,449,1.252,450,1.001,451,1.079,452,1.262,453,1.825,454,1.252,455,1.262,456,1.262,457,1.262,458,1.262,459,1.262,460,1.866,465,1.252,466,1.262,467,1.3,468,1.271,469,1.262,470,1.262,471,1.262,472,1.271,473,1.271,474,1.271,475,1.3,476,1.262,477,1.262,478,1.271,479,1.271,486,2.472,487,2.317,488,1.135,490,1.132,492,1.812,493,1.225,494,1.165,495,1.234,496,1.207,518,1.246,582,1.074,596,1.187,597,1.37,599,0.751,610,0.69,615,0.946,625,1.408,626,0.825,661,3.285,678,1.246,706,1.31,707,1.185,708,1.872,709,1.29,710,2.32,711,1.196,712,1.196,713,1.889,714,2.164,717,1.196,718,1.196,719,0.99,720,1.674,721,1.196,723,1.207,737,0.69,747,1.641,748,1.932,751,1.532,752,1.617,812,3.306,865,1.464,882,1.36,902,1.408,960,5.625,1077,1.074,1111,1.187,1291,0.709,1292,0.709,1293,0.709,1294,1.612,1295,1.641,1298,0.709,1299,1.229,1300,1.612,1301,0.709,1302,1.229,1305,0.709,1306,0.709,1307,0.702,1311,0.716,1317,2.086,1319,1.215,1434,1.36,1534,3.973,1598,2.539,1622,1.731,1654,2.358,1794,1.617,1836,1.617,1839,1.617,1941,5.074,2178,6.236,2179,4.429,2180,4.429,2181,4.429,2315,1.36,2349,2.657,2351,2.441,2370,1.731,2371,4.74,2665,6.536,2683,2.539,2700,5.201,2717,2.657,2727,5.489,2728,6.236,2730,5.489,2731,8.063,2734,1.617,2735,1.617,2751,5.875,2752,3.973,2753,3.001,2754,1.731,2755,3.001,2756,3.001,2757,1.731,2758,1.731,2759,1.903,2760,1.903,2761,3.3,2762,1.903,2763,1.903,2764,1.903,2765,1.903,2766,1.903,2767,3.3,2768,5.896,2769,1.903,2770,1.903]],["t/801",[0,0.196,1,1.234,7,0.771,14,0.424,17,0.626,25,0.513,30,0.999,37,1.185,41,1.413,53,4.482,54,5.467,64,0.874,67,0.965,72,5.85,81,0.644,92,0.536,93,0.947,94,1.272,95,1.258,96,2.191,102,1.709,104,2.827,105,0.99,108,1.597,110,0.485,117,1.722,124,0.837,128,1.048,130,1.3,135,1.002,141,1.592,144,1.504,146,2.047,149,0.879,157,4.09,158,0.459,159,1.584,163,0.965,186,2.121,187,0.428,189,0.468,196,1.357,202,1.663,209,2.26,215,0.884,224,0.729,233,8.425,243,5.743,261,1.548,270,2.293,275,0.471,276,0.471,277,0.59,299,1.226,304,0.747,318,1.815,321,0.478,322,1.338,323,1.106,326,2.49,347,1.143,352,1.22,355,0.697,358,1.198,359,4.625,365,0.452,368,0.462,369,0.849,374,0.502,377,1.48,379,0.545,380,0.657,384,0.598,385,0.579,386,1.755,387,2.209,388,2.023,389,1.561,390,1.561,391,1.561,392,1.561,393,2.389,394,1.825,395,0.886,396,1.47,397,0.533,398,1.257,399,1.016,400,1.229,401,1.22,402,0.533,403,1.31,404,1.22,405,0.533,406,1.466,407,1.448,408,1.47,409,2.079,410,1.229,411,0.536,412,1.571,413,0.541,414,1.47,415,1.448,416,1.427,418,1.526,420,1.503,421,0.529,422,0.533,423,0.926,424,0.521,425,0.893,426,1.338,427,0.533,428,0.553,429,0.529,430,0.533,431,1.229,432,1.229,433,0.533,434,0.868,435,1.537,438,1.437,442,0.849,445,0.536,446,0.536,447,0.536,448,0.536,449,0.533,450,0.426,451,0.459,452,0.536,453,0.913,454,0.533,455,0.536,456,0.536,457,0.536,458,0.536,459,0.536,460,0.933,465,0.533,466,0.536,467,0.553,468,0.541,469,0.536,470,0.536,471,0.536,472,0.541,473,0.541,474,0.541,475,0.553,476,0.536,477,0.536,478,0.541,479,0.541,486,1.492,487,1.484,488,2.894,490,0.481,492,0.906,493,0.521,494,0.495,495,0.525,496,0.513,554,4.934,556,4.934,647,1.504,661,2.104,702,0.712,703,1.554,704,2.913,706,0.557,709,0.549,714,0.771,719,2.524,724,3.063,737,0.673,747,0.924,748,2.511,778,3.164,779,3.063,833,1.892,932,1.971,982,2.486,1138,1.216,1224,1.286,1291,0.692,1292,0.692,1293,0.692,1294,0.685,1295,0.924,1298,0.692,1299,1.203,1300,0.685,1301,0.692,1302,3.135,1305,0.692,1306,0.692,1307,0.685,1311,0.698,1345,1.495,1656,5.803,1783,6.75,1828,7.928,1941,3.062,2004,4.468,2177,2.486,2315,4.148,2316,7.756,2317,7.891,2375,2.938,2657,6.476,2658,9.459,2659,4.934,2660,9.619,2662,8.857,2663,3.643,2664,6.914,2665,3.299,2666,1.578,2667,6.72,2668,1.689,2669,1.689,2670,3.899,2671,1.689,2672,1.689,2673,1.689,2674,1.578,2675,6.46,2676,1.578,2677,1.689,2678,2.938,2679,1.689,2680,1.689,2681,1.689,2682,1.689,2683,1.429,2684,1.689,2685,1.689,2686,1.689,2687,1.689,2688,1.689,2690,1.578,2691,6.46,2692,1.689,2693,1.689,2694,2.938,2695,1.689,2696,1.689,2697,1.689,2698,1.689,2699,1.689,2700,6.367,2717,4.127,2718,8.646,2719,6.162,2720,4.355,2721,4.355,2725,7.192,2726,3.899,2727,6.72,2728,3.643,2729,5.281,2730,4.934,2731,5.413,2732,1.689,2733,6.226,2734,1.578,2735,1.578,2736,1.689,2737,1.689,2738,6.226,2739,1.689,2740,1.689,2741,1.689,2743,1.689,2744,1.689,2745,1.689,2746,1.689,2747,6.226,2748,1.689,2749,1.689,2750,1.689,2771,7.909,2772,4.288,2773,7.909,2774,4.288,2775,4.288,2776,7.909,2777,4.288,2778,4.288,2779,1.858,2780,1.858,2781,1.858,2782,1.858,2783,1.858,2784,1.858,2785,1.858,2786,1.858,2787,1.858,2788,1.858,2789,1.858,2790,1.858,2791,1.858,2792,1.858,2793,1.858,2794,1.858,2795,1.858,2796,1.858,2797,1.858,2798,1.858,2799,1.858,2800,1.858]],["t/803",[7,0.793,16,1.589,17,0.58,34,3.471,41,1.694,53,5.847,54,5.336,62,8.984,72,6.872,92,1.403,93,2.047,94,1.518,95,1.305,96,3.387,102,1.716,105,0.992,150,1.777,157,4.17,378,2.206,379,1.424,380,0.988,384,1.563,385,1.515,386,2.977,387,3.268,487,1.242,521,3.594,599,1.916,626,2.106,630,4.17,702,1.861,703,2.961,704,4.051,778,5.154,779,4.99,833,4.087,1014,3.267,1656,6.362,1681,3.711,1783,6.595,1828,7.52,1941,5.336,2318,4.418,2319,6.348,2657,8.135,2717,7.19,2718,8.038,2719,8.038,2720,7.589,2721,7.589,2801,4.858]],["t/805",[0,1.088,3,1.145,7,0.705,9,1.542,14,0.871,16,2.88,17,0.731,80,1.542,90,3.279,95,0.972,105,0.97,117,1.937,135,2.058,149,0.979,154,2.505,202,3.34,244,2.44,252,2.927,277,1.547,285,4.505,289,3.734,290,4.505,406,1.779,606,3.998,610,3.191,629,5.155,684,3.86,732,5.371,835,5.119,1617,5.155]],["t/807",[0,1.204,3,1.052,7,0.78,9,1.8,17,0.798,19,2.702,29,2.614,30,2.368,31,3.282,32,3.929,44,2.368,50,2.262,74,4.243,90,3.998,94,0.998,95,1.185,96,3.533,105,1.023,118,3.977,149,1.266,151,4.671,154,2.694,197,4.844,244,1.814,277,1.413,310,4.103,311,3.806,312,4.58,313,5.664,314,2.546,359,4.104,382,4.311,399,2.435,451,2.337,523,5.912,603,3.02,606,4.299,608,6.044,612,4.243,635,2.655,656,4.775,665,3.988,669,5.148,692,5.258,702,2.933,703,2.775,753,4.483,757,6.505,758,5.469,763,4.243,807,5.157,1621,5.469,1662,4.171]],["t/809",[0,1.186,1,1.095,3,1.218,7,0.556,9,1.848,10,4.156,14,0.804,16,2.657,17,0.778,19,3.958,27,1.899,28,3.724,29,1.925,32,3.372,45,3.93,50,2.399,95,0.897,102,1.527,105,0.974,119,3.336,135,1.899,149,0.903,174,3.93,176,3.025,197,4.156,205,2.512,223,2.657,224,1.5,225,4.08,226,3.482,244,2.499,261,2.166,272,4.88,277,1.451,285,4.156,313,6.009,344,2.723,345,4.208,355,2.118,381,3.336,382,3.408,451,2.005,523,4.353,599,3.204,623,4.096,629,4.756,665,3.375,669,5.462,774,3.78,807,4.425,924,5.802,1285,4.284,1286,3.93,1664,5.317]],["t/811",[3,1.048,19,3.327,135,2.204,344,3.16,345,4.042,623,4.754]],["t/813",[3,0.991,17,0.802,30,3.208,32,3.701,119,4.26,130,3.588,141,1.645,149,0.991,183,4.001,194,5.439,213,5.307,258,7.575,302,2.171,310,5.878,311,5.157,312,4.313,322,2.327,647,4.149,969,6.171,1617,5.22,1662,5.65,1730,5.693,1951,6.86,1969,7.575,2379,6.369,2802,8.107]],["t/815",[7,0.751,17,0.633,29,2.758,30,3.493,32,4.688,44,2.758,90,3.32,96,3.066,310,4.778,312,5.018,314,2.964,319,3.04,383,4.001,406,1.802,564,5.121,608,5.693,612,4.94,669,5.995,1662,4.857,2379,6.369,2382,7.575,2802,8.107]],["t/817",[7,0.595,29,2.571,32,3.603,80,1.521,279,4.377,312,4.199,354,5.865,451,2.143,564,4.986,608,6.52,612,6.473,613,3.26,646,6.008,661,3.931,669,5.837,924,6.201,1283,8.733,1716,8.988,1717,7.553,1843,5.225,2137,9.015,2394,5.542,2495,8.22,2497,6.988]],["t/820",[0,0.112,1,0.367,2,0.787,3,0.497,5,0.611,7,0.725,9,0.186,13,0.71,14,0.717,17,0.484,25,1.359,27,1.695,29,1.718,30,1.047,37,2.273,41,1.443,44,0.606,64,1.535,79,1.144,80,0.477,81,1.404,92,0.566,93,0.992,94,1.182,95,1.139,96,2.493,102,1.709,104,2.111,105,0.85,108,3.311,110,1.283,117,1.547,120,2.854,123,1.82,124,1.471,135,1.923,141,0.907,142,0.611,146,2.115,147,0.522,149,1.161,151,0.649,152,0.424,158,1.621,159,0.522,164,1.144,176,0.73,186,2.773,187,1.134,189,1.239,195,0.698,196,2.377,209,1.32,210,1.034,215,1.695,224,1.301,226,1.168,250,0.649,252,0.354,261,0.522,270,2.997,275,1.248,276,1.248,277,1.131,288,0.529,297,1.523,310,1.05,311,0.974,314,0.354,317,0.437,318,2.607,321,1.265,322,2.344,323,1.938,347,2.193,352,2.34,355,1.519,358,2.099,365,1.197,368,1.222,369,1.85,374,1.329,377,2.594,379,0.799,380,1.221,382,3.504,383,3.946,384,0.631,385,0.611,386,0.823,387,1.729,388,3.008,389,2.735,390,2.735,391,2.735,392,2.735,393,2.873,394,2.715,395,2.179,396,2.574,397,1.409,398,2.411,399,1.949,400,2.358,401,2.34,402,1.409,403,2.295,404,2.34,405,1.409,406,2.105,407,2.537,408,2.574,409,2.986,410,2.358,411,1.42,412,2.57,413,1.43,414,2.574,415,2.537,416,2.5,418,2.498,420,2.747,421,1.399,422,1.409,423,2.018,424,1.378,425,1.946,426,2.211,427,1.409,428,1.463,429,1.399,430,1.409,431,2.358,432,2.358,433,1.409,434,1.524,435,2.516,438,2.376,442,2.257,445,1.42,446,1.42,447,1.42,448,1.42,449,1.409,450,1.126,451,1.214,452,1.42,453,1.989,454,1.409,455,1.42,456,1.42,457,1.42,458,1.42,459,1.42,460,2.033,465,1.409,466,1.42,467,1.463,468,1.43,469,1.42,470,1.42,471,1.42,472,1.43,473,1.43,474,1.43,475,1.463,476,1.42,477,1.42,478,1.43,479,1.43,486,2.613,487,2.445,488,0.674,490,1.274,492,1.974,493,1.378,494,1.311,495,1.389,496,1.359,551,0.501,604,0.626,607,0.679,608,5.251,610,0.987,654,1.252,661,0.71,665,0.366,670,0.869,671,0.856,702,1.296,703,0.987,704,1.044,706,1.474,707,1.422,708,2.156,709,1.452,710,2.604,711,1.435,712,1.435,713,2.175,714,1.644,717,1.435,718,1.435,719,1.474,720,2.037,721,1.435,723,1.448,737,0.71,747,0.529,770,0.904,791,0.58,807,0.58,865,0.472,1014,0.715,1216,0.649,1286,0.515,1291,0.73,1292,0.73,1293,0.73,1294,0.723,1295,0.529,1298,0.73,1299,1.26,1300,0.723,1301,0.73,1302,0.73,1305,0.73,1306,0.73,1307,0.723,1311,0.737,1317,0.936,1577,1.356,1591,1.105,1617,1.147,1618,0.819,1634,0.787,1661,0.611,1664,0.696,1717,7.705,1730,0.679,1843,1.003,1849,3.625,1852,0.736,1855,1.251,1860,0.736,1926,0.787,2083,0.736,2085,1.885,2088,0.736,2146,1.4,2177,0.819,2499,1.665,2803,7.795,2804,0.967,2805,1.577,2806,1.782,2807,3.957,2808,1.064,2809,0.967,2810,1.577,2811,0.967,2812,0.967,2813,1.782,2814,1.96]],["t/822",[0,0.251,1,0.906,3,0.572,7,0.755,13,3.246,14,0.665,17,0.576,19,0.838,25,1.101,27,1.571,29,1.22,30,0.734,37,2.011,41,1.402,44,0.734,64,1.392,67,1.233,73,1.363,79,0.685,80,0.416,81,1.203,92,0.685,93,1.168,94,1.309,95,1.209,96,3.488,102,1.709,104,2.614,105,0.902,108,1.918,110,1.04,117,1.134,120,2.371,124,1.334,133,1.029,135,1.701,141,1.24,146,2.13,149,1.09,158,1.271,159,1.164,164,0.685,176,0.884,186,2.657,187,0.919,188,1.233,189,1.004,194,1.448,195,0.845,196,2.148,205,1.593,209,1.804,210,0.901,215,1.499,224,1.2,252,0.789,261,0.633,270,2.871,275,1.011,276,1.011,277,1.001,297,0.809,301,1.643,310,1.272,311,1.18,312,1.148,318,2.455,321,1.025,322,2.118,323,1.751,347,1.94,352,2.07,355,1.301,358,1.897,365,0.97,368,0.99,369,1.585,371,1.339,374,1.077,377,2.343,379,0.696,380,1.047,382,2.819,383,3.016,384,0.764,385,0.74,386,1.204,387,2.047,388,2.813,389,2.471,390,2.471,391,2.471,392,2.471,393,2.792,394,2.539,395,1.844,396,2.326,397,1.142,398,2.133,399,1.724,400,2.086,401,2.07,402,1.142,403,2.074,404,2.07,405,1.142,406,1.982,407,2.292,408,2.326,409,2.812,410,2.086,411,1.151,412,2.357,413,1.159,414,2.326,415,2.292,416,2.259,418,2.291,420,2.474,421,1.134,422,1.142,423,1.729,424,1.117,425,1.666,426,2.018,427,1.142,428,1.186,429,1.134,430,1.142,431,2.086,432,2.086,433,1.142,434,1.382,435,2.307,438,2.168,442,1.912,445,1.151,446,1.151,447,1.151,448,1.151,449,1.142,450,0.913,451,0.983,452,1.151,453,1.703,454,1.142,455,1.151,456,1.151,457,1.151,458,1.151,459,1.151,460,1.742,465,1.142,466,1.151,467,1.186,468,1.159,469,1.151,470,1.151,471,1.151,472,1.159,473,1.159,474,1.159,475,1.186,476,1.151,477,1.151,478,1.159,479,1.159,486,2.361,487,2.227,488,2.073,490,1.033,492,1.691,493,1.117,494,1.062,495,1.125,496,1.101,504,0.845,603,0.936,608,4.645,611,4.639,612,5.763,613,3.509,636,1.363,654,2.367,656,1.48,661,2.435,670,1.053,702,1.972,703,1.866,704,1.972,706,1.195,707,0.852,708,1.431,709,1.177,710,1.849,711,0.86,712,0.86,713,1.444,714,0.985,715,2.38,717,0.86,718,0.86,719,2.015,720,1.526,721,0.86,723,0.868,737,0.86,747,1.18,783,1.554,791,1.293,819,1.643,866,1.756,1077,1.339,1291,0.884,1292,0.884,1293,0.884,1294,0.876,1295,1.18,1298,0.884,1299,1.484,1300,0.876,1301,0.884,1302,2.246,1305,0.884,1306,0.884,1307,0.876,1311,0.892,1577,1.643,1584,3.462,1586,3.371,1589,3.462,1599,1.643,1603,1.643,1661,2.289,1675,1.695,1716,6.706,1717,7.635,1843,3.439,1849,3.287,1852,1.643,1855,1.515,1860,1.643,2285,6.027,2308,1.756,2309,2.947,2311,1.756,2394,4.291,2803,7.787,2805,1.911,2807,3.207,2810,1.911,2815,2.373,2816,7.672,2817,4.682,2818,5.148,2819,2.158,2820,5.148,2821,2.158,2822,2.373,2823,5.148,2824,2.158,2825,2.373,2826,2.373]],["t/824",[0,0.707,1,0.902,7,0.759,11,1.085,12,1.142,14,0.606,17,0.508,25,0.962,27,1.071,28,0.769,29,2.339,30,1.417,31,4.619,32,1.901,37,1.848,41,1.479,44,0.626,50,0.598,64,1.239,79,0.585,80,0.802,81,1.084,90,0.754,92,1.006,93,1.594,94,1.424,95,1.255,96,3.789,102,1.712,104,2.267,105,0.877,110,0.909,117,1.152,124,1.187,130,0.815,135,1.564,141,0.845,146,1.932,149,1.044,152,0.807,155,1.293,158,1.131,160,1.068,164,0.585,176,0.754,186,2.575,187,0.803,189,0.878,194,1.236,195,1.24,196,2.001,203,1.236,205,0.626,209,1.23,215,1.378,224,1.203,225,0.754,226,0.868,231,2.025,252,1.523,260,1.447,270,2.783,275,0.884,276,0.884,277,0.985,279,5.189,297,0.691,299,1.321,307,1.706,318,2.351,321,0.896,322,1.973,323,1.825,347,1.783,352,1.903,355,1.322,358,1.767,365,0.848,368,0.866,369,1.429,374,0.942,377,2.183,379,1.343,380,1.246,382,3.645,383,3.899,384,1.121,385,1.085,386,1.643,387,2.646,388,2.681,389,2.302,390,2.302,391,2.302,392,2.302,393,2.734,394,2.42,395,1.68,396,2.167,397,0.998,398,1.961,399,1.585,400,1.917,401,1.903,402,0.998,403,1.932,404,1.903,405,0.998,406,1.898,407,2.135,408,2.167,409,2.692,410,1.917,411,1.006,412,2.217,413,1.013,414,2.167,415,2.135,416,2.104,418,2.155,420,2.316,421,0.991,422,0.998,423,1.559,424,0.976,425,1.502,426,1.869,427,0.998,428,1.036,429,0.991,430,0.998,431,1.917,432,1.917,433,0.998,434,1.23,435,2.17,438,2.008,442,1.758,445,1.006,446,1.006,447,1.006,448,1.006,449,0.998,450,0.798,451,0.86,452,1.006,453,1.536,454,0.998,455,1.006,456,1.006,457,1.006,458,1.006,459,1.006,460,1.57,465,0.998,466,1.006,467,1.036,468,1.013,469,1.006,470,1.006,471,1.006,472,1.013,473,1.013,474,1.013,475,1.036,476,1.006,477,1.006,478,1.013,479,1.013,486,2.199,487,2.095,488,1.197,490,0.902,492,1.525,493,0.976,494,0.928,495,0.984,496,0.962,501,1.122,503,1.263,504,0.721,551,1.641,606,0.92,608,5.996,611,6.079,612,4.815,613,2.774,626,0.878,632,1.63,635,0.702,654,0.931,665,0.696,670,1.544,702,2.896,703,2.863,704,3.329,706,1.044,707,0.727,708,1.251,709,1.029,710,1.645,711,0.734,712,0.734,713,1.262,715,2.08,717,0.734,718,0.734,719,1.374,721,0.734,723,0.741,725,1.293,737,0.734,763,1.122,778,3.337,779,3.23,802,1.236,849,1.447,882,1.447,886,1.63,1052,1.122,1077,1.142,1140,1.842,1291,0.754,1292,0.754,1293,0.754,1294,0.747,1298,0.754,1299,1.297,1300,0.747,1301,0.754,1302,1.297,1305,0.754,1306,0.754,1307,0.747,1311,0.761,1599,1.402,1603,1.402,1615,1.447,1617,1.186,1661,2,1683,1.293,1717,7.439,1780,1.721,1804,1.63,1807,1.558,1811,1.63,1972,1.721,2188,1.63,2469,5.203,2470,2.958,2495,4.93,2530,7.455,2532,1.842,2534,3.166,2537,1.842,2540,1.842,2554,1.842,2555,1.842,2557,1.842,2803,8.706,2805,3.687,2807,3.687,2810,2.803,2827,3.482,2828,2.025,2829,2.025,2830,2.025,2831,2.025,2832,2.025,2833,2.025,2834,2.025]],["t/826",[0,0.12,1,0.48,3,0.126,7,0.725,9,0.365,14,0.672,17,0.442,25,1.292,27,1.831,28,1.947,29,1.216,30,0.644,31,2.796,32,0.471,37,2.209,41,1.396,64,1.388,79,1.2,80,0.199,81,1.354,85,0.542,92,0.328,93,0.61,94,1.214,95,1.162,96,2.632,102,1.709,104,1.867,105,0.853,108,2.197,110,1.22,117,1.559,120,2.197,123,3.431,124,1.33,135,1.869,141,1.021,146,2.098,147,1.02,149,1.142,158,1.61,164,1.2,176,0.423,186,2.746,187,1.078,189,1.178,194,0.693,196,2.322,205,0.351,209,1.487,215,1.647,224,1.276,242,0.914,261,0.303,270,2.968,275,1.186,276,1.186,277,1.099,297,1.417,310,0.609,311,0.565,312,1.393,318,2.572,321,1.203,322,2.29,323,1.893,347,2.131,352,2.275,355,1.465,358,2.051,365,1.138,368,1.162,369,1.784,374,1.264,377,2.534,378,0.516,379,0.333,380,1.044,382,3.418,383,3.888,384,0.366,385,0.354,386,0.629,387,1.423,388,2.963,389,2.672,390,2.672,391,2.672,392,2.672,393,2.855,394,2.674,395,2.148,396,2.515,397,1.34,398,2.344,399,1.894,400,2.292,401,2.275,402,1.34,403,2.242,404,2.275,405,1.34,406,2.076,407,2.478,408,2.515,409,2.946,410,2.292,411,1.35,412,2.52,413,1.36,414,2.515,415,2.478,416,2.442,418,2.449,420,2.708,421,1.33,422,1.34,423,1.946,424,1.311,425,1.876,426,2.126,427,1.34,428,1.391,429,1.33,430,1.34,431,2.292,432,2.292,433,1.34,434,1.378,435,2.467,438,2.284,442,2.246,445,1.35,446,1.35,447,1.35,448,1.35,449,1.34,450,1.071,451,2.75,452,1.35,453,1.918,454,1.34,455,1.35,456,1.35,457,1.35,458,1.35,459,1.35,460,1.961,465,1.34,466,1.35,467,1.391,468,1.36,469,1.35,470,1.35,471,1.35,472,1.36,473,1.36,474,1.36,475,1.391,476,1.35,477,1.35,478,1.36,479,1.36,486,2.553,487,2.381,488,0.99,490,1.211,492,1.904,493,1.311,494,1.246,495,1.32,496,1.292,606,0.516,608,5.602,611,2.742,612,3.269,613,2.383,646,7.579,656,2.915,661,2.006,669,0.764,702,1.365,703,1.292,704,1.965,706,1.402,707,1.493,708,2.236,709,1.381,710,2.681,711,1.506,712,1.506,713,2.256,714,0.864,715,1.243,717,1.506,718,1.506,719,1.66,720,1.365,721,1.506,723,1.52,737,0.412,747,0.565,753,0.665,778,1.942,779,1.88,865,0.504,1291,0.423,1292,0.423,1293,0.423,1294,0.419,1295,0.565,1298,0.423,1299,0.775,1300,0.419,1301,0.423,1302,1.073,1305,0.423,1306,0.423,1307,0.419,1311,0.427,1317,2.232,1597,0.786,1598,0.874,1599,0.786,1600,0.965,1602,0.965,1603,0.786,1699,0.874,1843,0.581,1849,4.334,1855,1.329,1875,0.965,2083,0.786,2085,1.44,2088,0.786,2137,0.914,2146,1.487,2497,0.914,2544,6.173,2547,1.892,2803,8.432,2804,1.033,2805,2.318,2806,1.892,2807,4.457,2809,1.033,2810,2.318,2811,1.033,2812,1.033,2813,1.033,2816,3.779,2817,2.619,2819,1.033,2821,1.033,2824,1.033,2835,1.136,2836,2.88,2837,1.136,2838,1.136,2839,1.136,2840,1.136,2841,1.136,2842,1.136,2843,1.136]],["t/828",[7,0.635,9,1.624,30,2.867,80,1.624,105,0.824,116,4.425,144,4.313,252,3.081,277,1.459,501,5.135,502,5.135,932,6.47,1524,6.067]],["t/830",[0,1.133,3,0.937,7,0.734,17,0.788,30,3.104,50,2.49,74,4.67,90,3.991,95,1.183,104,2.528,105,0.986,118,4.377,149,1.233,151,5.141,154,2.855,244,1.997,277,1.474,314,2.802,399,2.378,523,5.377,550,6.235,602,5.517,606,3.827,613,2.691,665,3.896,692,4.312,702,3.229,763,4.67,807,5.467,1214,6.747,1621,6.021,1662,4.591,1681,4.557,1688,6.785,2076,7.664,2195,6.747,2844,6.484]],["t/832",[0,1.066,1,1.146,3,1.236,7,0.582,9,1.767,14,0.998,16,2.78,17,0.764,19,4.007,27,1.987,45,4.112,83,2.898,95,0.938,102,1.499,105,0.756,119,3.492,135,1.987,174,4.112,176,3.166,197,4.35,223,2.78,224,1.434,225,4.005,244,2.39,261,2.689,272,5.014,277,1.387,344,2.85,345,4.324,355,2.176,381,3.492,382,3.566,504,3.026,599,3.353,623,4.287,774,3.956,807,4.631,1285,4.484,1286,4.112,1664,5.565]],["t/834",[3,1.048,19,3.327,135,2.204,344,3.16,345,4.042,623,4.754]],["t/836",[3,0.934,11,4.501,17,0.787,30,3.427,57,3.725,94,1.095,119,4.113,130,3.38,149,0.934,183,3.769,213,5.124,224,1.194,258,7.136,317,4.395,321,2.162,322,2.192,326,4.587,502,4.654,550,6.213,562,4.298,602,5.499,603,3.313,610,3.044,614,7.638,647,3.909,669,5.648,732,6.109,849,6,924,6,960,5.124,969,5.814,1104,5.814,1214,7.805,1617,4.918,1662,5.455,1684,9.106,1730,5.363,1825,7.136,1830,7.638,1951,6.462,2195,5.648,2379,6,2384,6.762,2481,7.638,2845,8.399,2846,8.399,2847,9.106,2848,8.399]],["t/838",[7,0.782,8,6.566,9,1.354,13,3.45,20,3.51,24,7.027,27,1.807,30,2.945,45,3.739,57,3.428,59,5.938,77,3.142,80,1.354,94,1.404,146,1.679,149,0.859,159,3.79,223,2.528,224,1.354,252,2.57,257,8.089,261,2.06,289,3.277,302,1.882,304,4.152,317,4.424,321,2.656,323,2.055,346,6.801,351,4.525,383,3.468,399,1.831,451,2.35,454,2.215,499,5.946,533,3.69,602,6.233,603,3.048,610,2.801,613,3.438,809,5.059,835,3.842,1045,7.027,1077,4.359,1120,7.633,1214,6.938,1568,7.027,1604,8.767,1615,6.801,1637,7.027,1646,7.027,1662,4.21,1681,4.891,1690,5.521,1730,4.934,1841,10.058,1883,6.221,2009,5.521,2077,6.801,2195,7.861,2844,5.946,2847,7.027,2849,7.728,2850,7.728,2851,9.521,2852,8.658,2853,7.728]],["t/840",[6,3.617,7,0.716,9,1.395,13,2.887,17,0.566,28,4.13,35,6.128,80,1.907,104,2.389,109,3.96,149,1.162,183,3.574,213,4.963,215,1.641,277,1.095,296,4.758,299,3.68,302,1.94,317,3.984,321,2.496,325,8.24,337,3.617,361,6.128,367,5.356,378,3.617,406,1.61,451,2.394,523,4.269,602,7.518,610,2.887,613,3.338,622,5.214,628,4.269,636,4.576,668,5.892,771,7.243,818,4.758,1111,4.968,1120,5.892,1152,5.214,1214,6.522,1606,4.968,1672,5.432,1681,4.405,1690,5.69,1905,8.836,2195,7.628,2258,8.051,2844,6.128,2852,7.243,2854,8.046,2855,7.808,2856,7.462,2857,6.767,2858,7.243,2859,7.243]],["t/842",[0,0.92,3,1.074,7,0.804,9,1.525,14,0.861,17,0.618,20,3.954,21,4.792,28,2.546,30,2.693,41,1.533,85,3.203,92,1.938,93,2.552,94,1.509,95,1.25,102,1.699,105,0.859,117,1.262,195,2.388,203,5.311,215,1.382,230,5.162,244,1.59,264,4.792,288,3.335,289,3.692,290,3.433,302,1.634,317,2.756,318,1.679,321,1.727,323,1.448,344,2.249,379,1.967,380,1.365,384,2.159,385,2.091,386,2.027,387,3.115,406,1.759,442,1.763,490,2.256,504,3.099,520,4.963,523,3.595,602,7.239,613,3.53,665,2.307,670,2.975,684,2.941,693,4.093,698,4.792,760,5.4,812,3.433,1152,4.392,1513,6.44,1591,3.784,1661,3.854,1672,3.484,1681,4.645,1690,7.899,1896,5.162,1905,7.436,2092,5.162,2195,6.499,2258,4.963,2567,6.1,2571,6.1,2572,6.1,2573,6.1,2844,6.698,2854,5.162,2855,5.4,2856,6.698,2857,5.7,2860,8.533,2861,8.533]],["t/844",[0,0.204,1,0.595,3,0.435,5,0.601,7,0.715,9,0.183,14,0.712,17,0.462,25,1.344,27,1.522,30,0.831,37,2.259,41,1.398,44,0.597,64,1.608,79,1.13,80,0.47,81,1.393,92,0.302,93,0.566,94,1.048,95,1.156,102,1.708,104,2.526,105,0.884,106,1.735,110,1.269,117,1.455,120,2.539,123,1.798,124,1.541,135,1.911,141,1.037,146,2.15,149,1.158,152,0.417,158,1.541,164,0.965,186,2.767,187,1.121,189,1.225,195,0.687,196,2.365,209,1.509,210,0.397,215,1.685,224,1.283,226,0.827,252,0.348,261,0.514,270,2.991,275,1.234,276,1.234,277,1.124,283,0.704,288,0.52,293,1.819,297,1.139,317,0.43,318,2.599,321,1.251,322,2.332,323,1.928,347,2.179,352,2.326,355,1.507,358,2.109,365,1.184,368,1.209,369,1.836,374,1.315,377,2.581,379,0.566,380,1.143,384,0.337,385,0.326,386,0.583,387,1.191,388,2.998,389,2.721,390,2.721,391,2.721,392,2.721,393,2.869,394,2.706,395,2.122,396,2.561,397,1.394,398,2.396,399,1.937,400,2.343,401,2.326,402,1.394,403,2.283,404,2.326,405,1.394,406,2.099,407,2.524,408,2.561,409,2.977,410,2.343,411,1.404,412,2.559,413,1.415,414,2.561,415,2.524,416,2.487,418,2.487,420,2.714,421,1.384,422,1.394,423,2.002,424,1.363,425,1.93,426,2.228,427,1.394,428,1.447,429,1.384,430,1.394,431,2.343,432,2.343,433,1.394,434,1.597,435,2.505,438,2.394,442,2.182,445,1.404,446,1.404,447,1.404,448,1.404,449,1.394,450,1.114,451,1.2,452,1.404,453,1.973,454,1.394,455,1.404,456,1.404,457,1.404,458,1.404,459,1.404,460,2.017,465,1.394,466,1.404,467,1.447,468,1.415,469,1.404,470,1.404,471,1.404,472,1.415,473,1.415,474,1.415,475,1.447,476,1.404,477,1.404,478,1.415,479,1.415,486,2.6,487,2.435,488,1.345,490,1.26,492,1.959,493,1.363,494,1.296,495,1.373,496,1.344,506,0.638,551,0.493,562,0.535,582,0.59,602,6.236,607,0.668,610,0.379,613,3.13,654,0.481,665,0.36,670,0.464,671,0.842,706,1.458,707,1.199,708,1.89,709,1.436,710,2.338,711,1.21,712,1.21,713,1.907,717,1.21,718,1.21,719,1.686,720,1.691,721,1.21,723,1.221,737,0.973,791,0.57,804,0.889,900,0.613,1014,0.704,1214,0.704,1216,0.638,1286,0.506,1291,1,1292,1,1293,1,1294,0.991,1298,1,1299,1.644,1300,0.991,1301,1,1302,1.457,1305,1,1306,1,1307,0.991,1311,1.01,1317,0.921,1527,1.232,1577,0.724,1584,1.298,1586,1.758,1589,1.298,1591,1.088,1617,0.613,1618,0.805,1661,0.601,1672,2.525,1677,0.638,1681,2.834,1690,5.637,1730,0.668,1733,0.747,1737,0.774,1905,6.875,2195,2.968,2258,3.597,2259,2.688,2260,0.842,2461,0.724,2499,0.889,2647,0.889,2649,0.889,2844,3.009,2854,5.374,2855,4.236,2856,5.199,2860,7.511,2861,4.525,2862,8.985,2863,6.112,2864,0.951,2865,1.046,2866,3.556,2867,2.282,2868,3.339,2869,5.111,2870,1.046,2871,0.951,2872,1.046,2873,3.911,2874,1.93,2875,7.194,2876,1.046,2877,2.685,2878,1.046,2879,1.046,2880,1.046,2881,1.046,2882,0.951,2883,3.037,2884,1.046,2885,0.951,2886,1.046,2887,1.046,2888,0.951,2889,1.046,2890,1.046,2891,1.046,2892,0.951,2893,1.046]],["t/846",[0,0.471,2,2.01,3,0.495,7,0.735,14,0.716,17,0.514,20,1.234,25,1.232,27,1.818,37,2.15,41,1.433,64,1.205,79,2.091,80,0.476,81,1.308,92,0.785,93,1.307,94,1.191,95,1.209,102,1.708,105,0.832,110,1.163,117,1.671,120,2.555,123,3.328,124,1.155,135,1.921,141,0.822,146,1.986,149,1.127,158,1.787,164,1.637,176,1.66,186,2.721,187,1.028,189,1.123,196,2.271,209,1.197,215,1.603,224,1.22,227,1.695,231,1.66,270,2.94,275,1.131,276,1.131,277,1.07,293,1.48,296,2.663,297,1.52,302,0.662,304,1.093,318,2.538,321,1.147,322,2.239,323,1.851,347,2.074,352,2.213,355,1.415,358,2.005,365,1.085,368,1.108,369,1.724,374,1.205,377,2.477,379,0.797,380,1.153,384,0.874,385,0.847,386,0.821,387,1.997,388,2.919,389,2.612,390,2.612,391,2.612,392,2.612,393,2.837,394,2.635,395,2.134,396,2.459,397,1.278,398,2.28,399,1.843,400,2.23,401,2.213,402,1.278,403,2.192,404,2.213,405,1.278,406,2.049,407,2.423,408,2.459,409,2.907,410,2.23,411,1.287,412,2.472,413,1.297,414,2.459,415,2.423,416,2.388,418,2.403,420,2.68,421,1.268,422,1.278,423,1.88,424,1.25,425,1.812,426,2.03,427,1.278,428,1.327,429,1.268,430,1.278,431,2.23,432,2.23,433,1.278,434,1.197,435,2.42,438,2.181,442,2.334,445,1.287,446,1.287,447,1.287,448,1.287,449,1.278,450,1.021,451,1.1,452,1.287,453,1.852,454,1.278,455,1.287,456,1.287,457,1.287,458,1.287,459,1.287,460,1.894,465,1.278,466,1.287,467,1.327,468,1.297,469,1.287,470,1.287,471,1.287,472,1.297,473,1.297,474,1.297,475,1.327,476,1.287,477,1.287,478,1.297,479,1.297,486,2.496,487,2.336,490,1.155,492,1.839,493,1.25,494,1.188,495,1.259,496,1.232,502,1.506,602,4.293,610,0.985,613,3.446,692,1.39,702,1.708,703,1.615,704,2.171,706,1.337,707,1.601,708,2.355,709,1.317,710,2.794,711,1.615,712,1.615,713,2.376,717,1.615,718,1.615,719,1.337,720,1.708,721,1.615,723,1.63,763,1.506,807,1.48,1057,2.091,1317,2.128,1319,1.735,1527,3.619,1586,2.918,1690,6.127,1820,2.01,1976,1.941,2009,1.941,2854,6.833,2856,5.985,2860,7.833,2861,6.614,2862,9.263,2863,8.121,2867,3.787,2869,4.053,2894,2.717,2895,4.457,2896,4.457,2897,2.717]],["t/848",[0,0.295,1,0.843,3,0.093,6,0.382,7,0.725,9,0.389,12,0.474,13,0.305,14,0.712,17,0.499,25,1.26,27,0.88,28,1.587,31,0.675,37,2.178,41,1.423,44,0.26,45,0.407,50,0.465,64,1.691,67,0.437,79,0.955,80,0.489,81,1.33,90,0.313,92,0.243,93,0.462,94,1.297,95,1.25,96,3.434,102,1.709,104,2.974,105,0.835,106,1.153,110,1.19,116,0.401,117,0.982,120,1.167,123,1.52,124,1.621,130,0.338,135,1.843,141,1.066,146,2.162,149,1.134,150,0.307,152,0.627,158,1.289,160,0.83,164,0.641,176,1.558,183,0.377,186,2.733,187,1.052,189,1.149,195,0.299,196,2.295,205,0.26,209,1.551,210,0.319,215,1.624,224,1.233,252,0.523,270,2.954,275,1.157,276,1.157,277,1.084,284,0.437,297,0.537,299,0.319,307,1.558,318,2.554,321,1.174,322,2.263,323,1.991,325,4.908,347,2.101,352,2.243,355,1.701,358,2.027,365,1.11,368,1.133,369,1.753,374,1.233,377,2.504,379,0.651,380,1.121,382,4.004,384,0.27,385,0.262,386,0.844,387,1.835,388,2.94,389,2.641,390,2.641,391,2.641,392,2.641,393,2.845,394,2.654,395,1.928,396,2.486,397,1.307,398,2.311,399,1.868,400,2.259,401,2.243,402,1.307,403,2.216,404,2.243,405,1.307,406,2.068,407,2.449,408,2.486,409,2.925,410,2.259,411,1.317,412,2.495,413,1.327,414,2.486,415,2.449,416,2.414,418,2.425,420,2.588,421,1.298,422,1.307,423,1.911,424,1.279,425,1.843,426,2.219,427,1.307,428,1.357,429,1.298,430,1.307,431,2.259,432,2.259,433,1.307,434,1.679,435,2.442,438,2.384,442,1.931,445,1.317,446,1.317,447,1.317,448,1.317,449,1.307,450,1.045,451,1.36,452,1.317,453,1.883,454,1.406,455,1.317,456,1.317,457,1.317,458,1.317,459,1.317,460,1.926,465,1.307,466,1.317,467,1.357,468,1.327,469,1.317,470,1.317,471,1.317,472,1.327,473,1.327,474,1.327,475,1.357,476,1.317,477,1.317,478,1.327,479,1.327,486,2.523,487,2.358,488,1.795,490,1.182,492,1.87,493,1.279,494,1.216,495,1.288,496,1.26,504,0.299,506,1.355,596,1.385,602,6.216,604,0.268,605,0.307,607,0.537,610,0.571,613,2.516,660,1.385,665,0.961,668,2.067,670,0.985,685,6.54,692,2.14,702,1.266,703,1.012,704,1.266,706,1.368,707,0.565,708,1.003,709,1.347,710,1.353,711,0.571,712,0.571,713,1.012,715,1.326,717,0.571,718,0.571,719,1.733,720,0.603,721,0.571,723,0.576,725,0.537,737,1.365,794,3.006,808,0.6,860,0.537,865,0.373,1003,2.446,1018,0.466,1084,0.677,1152,2.466,1291,1.403,1292,1.403,1293,1.403,1294,1.39,1298,1.403,1299,2.152,1300,1.39,1301,1.403,1302,1.944,1305,1.403,1306,1.403,1307,1.39,1311,1.416,1317,0.752,1319,0.537,1527,3.131,1599,0.582,1603,0.582,1604,1.338,1661,0.483,1672,1.717,1677,0.513,1690,4.468,1729,1.338,1732,0.6,1733,0.6,1737,0.622,1820,2.446,1905,2.15,1976,0.6,2009,0.6,2141,2.898,2146,2.69,2195,5.452,2258,3.628,2259,3.032,2260,1.267,2300,3.032,2461,0.582,2542,0.714,2647,1.338,2649,1.338,2854,5.273,2855,0.677,2856,5.408,2857,0.714,2858,4.146,2859,4.146,2860,5.207,2861,4.85,2862,6.795,2863,1.887,2864,0.764,2866,2.019,2867,0.714,2871,0.764,2882,0.764,2883,5.882,2885,0.764,2888,2.019,2892,0.764,2898,0.84,2899,8.751,2900,7.192,2901,3.766,2902,3.766,2903,3.766,2904,3.766,2905,7.192,2906,2.22,2907,2.794,2908,2.22,2909,2.22,2910,2.22,2911,2.22,2912,3.306,2913,2.22,2914,2.794,2915,0.84,2916,2.22,2917,2.22,2918,2.794,2919,2.22,2920,2.22,2921,3.766,2922,1.574,2923,1.574,2924,0.84,2925,1.574,2926,0.84,2927,0.84,2928,0.84,2929,0.84,2930,0.84,2931,0.84]],["t/850",[3,1.261,14,1.122,17,0.762,19,3.548,30,2.616,57,3.751,73,5.776,95,0.933,117,1.591,149,0.94,191,5.686,209,2.271,212,6.041,224,1.202,244,2.383,247,5.275,253,6.761,254,6.959,262,7.185,277,1.163,281,5.275,302,2.059,317,3.474,326,3.626,330,7.69,345,4.311,346,6.041,406,1.709,550,7.438,615,4.205,647,3.936,889,6.808,1214,7.466,1280,5.853,1508,6.507,1662,5.478,1688,8.094,1877,6.507,1898,6.808,2210,5.853,2490,7.185,2491,7.185,2932,8.457,2933,8.457]],["t/852",[0,1.096,1,1.398,7,0.611,13,3.231,14,0.882,17,0.736,30,2.758,44,2.758,79,2.996,164,2.996,176,3.32,183,4.654,205,2.758,277,1.426,300,4.496,307,3.863,355,2.238,383,4.001,582,5.028,602,5.836,1018,4.94,1214,6.974,1578,5.836,1729,7.575,2195,5.995,2542,7.575]]],"invertedIndex":[["",{"_index":102,"t":{"3":{"position":[[1685,1],[1700,1],[1713,1],[1730,1],[1857,1],[1886,1],[1888,1],[1901,1],[1940,1],[1945,1],[2083,1],[2131,1],[2162,1],[2210,1],[2241,1],[2283,1],[2544,1],[2576,1],[2949,1]]},"9":{"position":[[299,1],[676,1],[685,2],[696,1],[1047,1],[1073,1],[1100,1],[1117,1]]},"35":{"position":[[196,1],[243,1],[245,1],[262,2],[265,1],[300,1],[312,1],[322,2],[325,2],[338,1],[348,2],[351,2],[363,1],[373,2],[376,1],[378,2],[393,1],[408,1],[420,1],[453,1],[455,1],[472,1],[474,1],[476,2],[489,1],[522,1],[524,1],[541,1],[543,1],[545,2],[557,1],[590,1],[592,1],[609,1],[611,1],[613,1],[615,1],[617,1],[619,1],[621,1],[623,1],[760,2],[832,2],[856,1],[872,1],[874,1],[901,2],[1001,1],[1062,2],[1146,2],[1326,2],[1369,3],[1379,1],[1408,1],[1410,1],[1499,1],[1501,1],[1518,2],[1521,1],[1556,1],[1568,1],[1578,2],[1581,2],[1594,1],[1604,2],[1607,2],[1619,1],[1629,2],[1632,1],[1634,2],[1649,1],[1664,1],[1676,1],[1709,1],[1711,1],[1728,1],[1730,1],[1732,2],[1745,1],[1778,1],[1780,1],[1797,1],[1799,1],[1801,2],[1813,1],[1846,1],[1848,1],[1865,1],[1867,1],[1869,1],[1871,1],[1873,1],[1875,1],[1877,1],[1879,3],[1883,2],[1889,1],[1940,2],[2019,1],[2021,1],[2063,1],[2077,1],[2079,2],[2178,2],[2252,2],[2337,2],[2470,2],[2644,2],[2687,2],[2697,2],[2704,1],[2706,2],[2709,2],[2725,1],[2727,1],[2770,1],[3238,2],[3314,2],[3321,1],[3343,2],[3346,2],[3369,1],[3391,2],[3492,2],[3499,1],[3501,2],[3504,2],[3520,1],[3522,2],[3551,1],[3602,2],[3674,2],[3793,1],[3848,1],[3882,1],[3884,2],[3986,1],[4014,1],[4026,1],[4082,2],[4139,1],[4193,2],[4298,1],[4352,2],[4479,1],[4533,2],[4576,2],[4593,1],[4629,1],[4631,1],[4647,1],[5078,1],[5182,1],[5231,2],[5264,1],[5315,1],[5486,1],[5532,1],[5568,1],[5625,1],[5659,1],[5764,1],[5797,1],[5925,1],[5959,1],[6001,1],[6003,1],[6127,1],[6199,1],[6348,1],[6778,1],[6850,1],[6884,1],[7747,1],[7791,1],[7793,1],[7884,1]]},"43":{"position":[[38,1],[54,1],[56,1],[83,2],[96,1],[112,1],[149,1],[210,2],[277,2],[382,3],[392,1],[406,1],[408,1],[462,3],[473,1],[511,1],[553,1],[567,1],[584,2],[662,2],[757,2],[890,2],[1068,2],[1111,2],[1121,2],[1128,1],[1130,2],[1133,2],[1149,1],[1161,2],[1274,2],[1281,1],[1283,2],[1286,2],[1302,1],[1304,1],[1407,1],[1467,1],[1494,1],[1514,1],[1542,1],[1554,1],[1610,2],[1677,1],[1731,2],[1836,1],[1890,2],[2021,1],[2075,2],[2118,2],[2135,1],[2181,1],[2247,1],[2262,1],[2269,1],[2288,3],[2292,1],[2294,1],[2455,1],[2491,1],[2536,1],[2570,1],[2632,1],[2659,1],[2679,1],[2690,1],[2759,1],[2781,1],[2808,1],[2822,1],[2837,1],[2987,1],[3033,1],[3107,1],[3172,1],[3219,1],[3257,1]]},"45":{"position":[[962,1],[997,1],[1009,1],[1019,2],[1022,2],[1038,1],[1048,2],[1051,2],[1064,1],[1074,2],[1077,2],[1089,1],[1099,2],[1102,1],[1104,2],[1119,1],[1134,1],[1146,1],[1179,1],[1181,1],[1198,1],[1200,1],[1202,2],[1218,1],[1251,1],[1253,1],[1270,1],[1272,1],[1274,2],[1287,1],[1320,1],[1322,1],[1339,1],[1341,1],[1343,2],[1355,1],[1388,1],[1390,1],[1407,1],[1409,1],[1411,1],[1413,1],[1415,1],[1417,1],[1896,1],[1943,1],[1945,1],[1980,1],[1992,1],[2002,2],[2005,2],[2021,1],[2031,2],[2034,2],[2047,1],[2057,2],[2060,2],[2072,1],[2082,2],[2085,1],[2087,2],[2102,1],[2117,1],[2129,1],[2162,1],[2164,1],[2205,2],[2208,1],[2225,1],[2227,1],[2229,2],[2245,1],[2278,1],[2280,1],[2321,2],[2324,1],[2341,1],[2343,1],[2345,2],[2358,1],[2391,1],[2393,1],[2434,2],[2437,1],[2454,1],[2456,1],[2458,2],[2470,1],[2503,1],[2505,1],[2546,2],[2549,1],[2566,1],[2568,1],[2570,1],[2572,1],[2574,1],[2576,2],[2579,1],[2612,1],[2624,1],[2634,2],[2637,1],[2639,2],[2654,1],[2669,1],[2681,1],[2714,1],[2716,1],[2733,1],[2735,1],[2737,1],[2739,1],[2741,1],[2743,2],[2746,1],[2763,1],[2765,1],[2767,1],[5086,1],[6489,3],[6782,1],[6804,1],[6806,1],[6841,1],[6853,1],[6863,2],[6866,2],[6882,1],[6892,2],[6895,2],[6908,1],[6918,2],[6921,2],[6933,1],[6943,2],[6946,1],[6948,2],[6963,1],[6978,1],[6990,1],[7023,1],[7025,1],[7042,1],[7044,1],[7046,2],[7062,1],[7095,1],[7097,1],[7114,1],[7116,1],[7118,2],[7131,1],[7164,1],[7166,1],[7183,1],[7185,1],[7187,2],[7199,1],[7232,1],[7234,1],[7251,1],[7253,1],[7255,1],[7257,1],[7259,1],[7261,2],[7264,1],[7281,1],[7283,1],[7285,1],[7859,1],[7881,1],[7883,1],[7918,1],[7930,1],[7940,2],[7943,1],[7945,2],[7960,1],[7975,1],[7987,1],[8020,1],[8022,1],[8039,1],[8041,1],[8043,1],[8045,1],[8047,1],[8049,1],[8051,1],[8053,1],[9345,1],[9347,1],[9426,2],[9429,1],[10505,1],[10507,2],[10564,1],[10643,2],[10646,1],[10648,1],[10650,2],[10662,5],[10717,1],[10727,4],[10788,2],[10791,1],[10793,1],[10795,2],[10847,1],[10936,2],[10939,2],[11016,1],[11094,2],[11097,1],[11422,1],[11444,1],[11446,1],[11481,1],[11493,1],[11504,1],[11515,1],[11517,1],[11527,2],[11530,2],[11533,1],[11554,1],[11577,1],[11579,1],[11581,1],[11583,1],[11585,2],[11598,1],[11608,2],[11611,1],[11613,2],[11628,1],[11643,1],[11655,1],[11688,1],[11690,1],[11707,1],[11709,1],[11711,2],[11724,1],[11757,1],[11759,1],[11776,1],[11778,1],[11780,1],[11782,1],[11784,1],[11786,1],[11788,1],[11790,1],[11860,1],[11862,1],[11941,2],[11944,1],[12315,2],[12387,2],[12411,1],[12427,1],[12429,1],[12456,2],[12556,1],[12617,2],[12701,2],[12881,2],[12924,3],[12928,2],[12949,1],[12959,1],[12961,1],[13058,2],[13061,1],[13118,3],[13122,2],[13133,1],[13159,2],[13238,1],[13240,1],[13282,1],[13296,1],[13298,2],[13397,2],[13471,2],[13556,2],[13689,2],[13863,2],[13906,2],[13916,2],[13923,1],[13925,2],[13928,2],[13944,1],[13946,1],[13956,2],[14051,1],[14058,2],[14152,1],[14164,2],[14243,2],[14251,1],[14253,1],[14269,1],[14290,2],[14362,2],[14481,1],[14536,1],[14570,1],[14572,2],[14674,1],[14702,1],[14714,1],[14770,2],[14827,1],[14881,2],[14986,1],[15040,2],[15167,1],[15221,2],[15264,2],[15281,1],[15317,1],[15319,1],[15333,1],[15358,1],[15381,1],[15414,2],[15426,1],[15451,1],[15458,1],[15482,1],[15501,1],[15527,2],[15543,1],[15583,2],[15603,1],[15629,1],[15800,1],[15846,1],[15882,1],[15939,1],[15973,1],[16078,1],[16111,1],[16239,1],[16273,1],[16315,1],[16317,1],[16441,1],[16521,1],[16523,1],[16581,1],[16588,1],[16678,1],[16689,1],[16729,1],[16748,1],[17051,1],[17314,1],[17358,1],[17360,1],[17451,1],[17602,1],[17643,1],[17658,2],[17700,1],[17712,2],[17747,1],[17773,2],[17832,1],[17864,2],[18230,1],[18248,1],[18285,1],[18304,1],[18509,2],[18581,2],[18605,1],[18621,1],[18623,1],[18650,2],[18750,1],[18811,2],[18895,2],[19075,2],[19118,3],[19122,2],[19143,1],[19153,1],[19155,1],[19252,2],[19255,1],[19312,3],[19316,2],[19327,1],[19353,2],[19432,1],[19434,1],[19476,1],[19490,1],[19492,2],[19591,2],[19665,2],[19750,2],[19883,2],[20057,2],[20100,2],[20110,2],[20117,1],[20119,2],[20122,2],[20138,1],[20140,1],[20150,2],[20245,1],[20252,2],[20346,1],[20358,2],[20437,2],[20445,1],[20447,1],[20463,1],[20484,2],[20556,2],[20675,1],[20730,1],[20764,1],[20766,2],[20868,1],[20896,1],[20908,1],[20964,2],[21021,1],[21075,2],[21180,1],[21234,2],[21361,1],[21415,2],[21458,2],[21475,1],[21511,1],[21513,1],[21527,1],[21552,1],[21575,1],[21608,2],[21620,1],[21645,1],[21652,1],[21676,1],[21695,1],[21721,2],[21737,1],[21777,2],[21797,1],[21823,1],[21994,1],[22040,1],[22076,1],[22133,1],[22167,1],[22272,1],[22305,1],[22433,1],[22467,1],[22509,1],[22511,1],[22635,1],[22715,1],[22717,1],[22775,1],[22782,1],[22872,1],[22883,1],[22923,1],[22942,1],[23245,1],[23508,1],[23552,1],[23554,1],[23645,1],[23796,1],[23837,1],[23852,2],[23894,1],[23906,2],[23941,1],[23967,2],[24026,1],[24058,2],[24863,2],[24935,2],[24959,1],[24975,1],[24977,1],[25004,2],[25104,1],[25165,2],[25249,2],[25429,2],[25472,3],[25491,1],[25580,2],[25583,1],[25640,3],[25644,2],[25664,1],[25728,2],[25807,1],[25809,1],[25851,1],[25865,1],[25867,2],[25966,2],[26040,2],[26125,2],[26258,2],[26432,2],[26475,2],[26485,2],[26492,1],[26494,2],[26497,2],[26513,1],[26515,1],[26525,2],[26626,1],[26633,2],[26719,1],[26731,2],[26826,2],[26834,1],[26836,1],[26892,1],[26913,2],[26985,2],[27104,1],[27159,1],[27193,1],[27195,2],[27297,1],[27325,1],[27337,1],[27393,2],[27450,1],[27504,2],[27609,1],[27663,2],[27790,1],[27844,2],[27887,2],[27904,1],[27940,1],[27942,1],[27956,1],[27987,1],[28010,1],[28043,2],[28055,1],[28086,1],[28093,1],[28117,1],[28134,1],[28148,2],[28164,1],[28210,2],[28230,1],[28294,1],[28465,1],[28511,1],[28547,1],[28604,1],[28638,1],[28743,1],[28776,1],[28904,1],[28938,1],[28980,1],[28982,1],[29106,1],[29186,1],[29188,1],[29246,1],[29253,1],[29335,1],[29346,1],[29393,1],[29412,1],[29750,1],[30059,1],[30103,1],[30105,1],[30196,1],[30201,2],[30322,2],[30325,1],[30419,2],[30475,2],[30515,2],[30573,1],[30606,2],[30652,2],[31978,1],[31980,1],[32056,2],[32059,1]]},"83":{"position":[[808,1],[855,1],[857,1],[874,2],[877,1],[910,1],[922,1],[932,2],[935,1],[937,2],[952,1],[967,1],[979,1],[1012,1],[1014,1],[1031,1],[1033,1],[1035,1],[1037,1],[1039,1],[1041,2],[1044,1],[1077,1],[1092,1],[1113,1],[1125,3],[1150,1],[1152,2],[1164,1],[1175,1],[1186,1],[1188,1],[1198,2],[1201,2],[1204,1],[1224,1],[1238,1],[1250,3],[1282,2],[1304,1],[1316,3],[1340,1],[1342,1],[1344,1],[1346,1],[1348,1],[1350,2],[1370,1],[1380,2],[1383,2],[1396,1],[1407,1],[1418,1],[1420,1],[1430,2],[1433,2],[1436,1],[1457,1],[1469,3],[1494,1],[1496,2],[1499,1],[1519,1],[1533,1],[1545,3],[1577,2],[1599,1],[1611,3],[1636,1],[1638,1],[1640,1],[1642,1],[1644,1],[1646,2],[1659,1],[1670,1],[1681,1],[1683,1],[1693,2],[1696,2],[1699,1],[1720,1],[1732,3],[1756,1],[1758,2],[1761,1],[1781,1],[1795,1],[1807,3],[1839,2],[1861,1],[1873,3],[1898,1],[1900,1],[1902,1],[1904,1],[1906,1],[1908,1],[1910,2],[1925,1],[1940,1],[1951,1],[1984,1],[1986,1],[2003,2],[2006,1],[2047,1],[2049,1],[2051,2],[2071,1],[2104,1],[2106,1],[2125,1],[2127,1],[2129,2],[2142,1],[2175,1],[2177,1],[2194,2],[2197,1],[2238,1],[2240,1],[2242,2],[2255,1],[2288,1],[2290,1],[2307,2],[2310,1],[2351,1],[2353,1],[2355,1],[2357,1],[2359,1],[2361,2],[2364,1],[2399,1],[2414,1],[2435,1],[2447,3],[2472,1],[2474,2],[2486,1],[2497,1],[2508,1],[2510,1],[2520,2],[2523,2],[2526,1],[2546,1],[2560,1],[2572,3],[2604,2],[2626,1],[2638,3],[2662,1],[2664,1],[2666,1],[2668,1],[2670,1],[2672,2],[2692,1],[2702,2],[2705,2],[2718,1],[2729,1],[2740,1],[2742,1],[2752,2],[2755,2],[2758,1],[2779,1],[2791,3],[2816,1],[2818,2],[2821,1],[2841,1],[2855,1],[2867,3],[2899,2],[2921,1],[2933,3],[2958,1],[2960,1],[2962,1],[2964,1],[2966,1],[2968,2],[2981,1],[2992,1],[3003,1],[3005,1],[3015,2],[3018,2],[3021,1],[3042,1],[3054,3],[3078,1],[3080,2],[3083,1],[3103,1],[3117,1],[3129,3],[3161,2],[3183,1],[3195,3],[3220,1],[3222,1],[3224,1],[3226,1],[3228,1],[3230,1],[3232,2],[3247,1],[3262,1],[3273,1],[3306,1],[3308,1],[3325,2],[3328,1],[3369,1],[3371,1],[3373,2],[3393,1],[3426,1],[3428,1],[3447,1],[3449,1],[3451,2],[3464,1],[3497,1],[3499,1],[3516,2],[3519,1],[3560,1],[3562,1],[3564,2],[3577,1],[3610,1],[3612,1],[3629,2],[3632,1],[3673,1],[3675,1],[3677,1],[3679,1],[3681,1],[3683,1],[3685,1],[3687,1]]},"85":{"position":[[20,5],[942,4],[1140,1],[1171,1],[1183,1],[1193,2],[1196,1],[1198,2],[1213,1],[1228,1],[1240,1],[1273,1],[1275,1],[1292,2],[1295,1],[1314,2],[1317,1],[1356,1],[1358,1],[1360,1],[1362,1],[1364,1],[1366,1],[1951,1],[1953,2],[2013,1],[2084,2],[2087,1],[2089,1],[2091,2],[2103,5],[2161,1],[2229,2],[2232,1],[2234,1],[2236,2],[2299,1],[2380,2],[2383,2],[2423,1],[2494,2],[2497,1]]},"87":{"position":[[226,1],[261,1],[273,1],[283,2],[286,2],[299,1],[310,1],[321,1],[323,1],[333,2],[336,2],[339,1],[360,1],[383,1],[385,1],[387,1],[389,1],[391,2],[408,1],[429,1],[452,1],[454,1],[456,2],[471,1],[486,1],[498,1],[531,1],[533,1],[550,1],[552,1],[554,2],[567,1],[600,1],[602,1],[619,1],[621,1],[623,1],[625,1],[627,1],[629,1],[1489,1],[1491,2],[1540,1],[1619,2],[1622,1],[1665,1],[1667,2],[1715,1],[1794,2],[1797,1],[1961,1],[1963,2],[2013,1],[2092,2],[2095,1]]},"89":{"position":[[486,1],[533,1],[535,1],[552,2],[555,1],[588,1],[600,1],[610,2],[613,1],[615,2],[630,1],[645,1],[657,1],[690,1],[692,1],[709,2],[712,1],[753,1],[755,1],[757,1],[759,1],[761,1],[763,2],[766,1],[801,1],[820,1],[830,2],[833,2],[846,1],[857,1],[868,1],[870,1],[880,2],[883,2],[886,1],[906,1],[920,1],[932,3],[964,2],[986,1],[998,3],[1023,1],[1025,1],[1027,1],[1029,1],[1031,1],[1033,1],[1035,2],[1050,1],[1065,1],[1084,1],[1117,1],[1119,1],[1138,1],[1140,1],[1142,2],[1155,1],[1188,1],[1190,1],[1207,1],[1209,1],[1211,1],[1213,1],[1215,1],[1217,1],[1219,1],[1221,1],[1513,1],[1535,1],[1537,1],[1572,1],[1584,1],[1595,1],[1606,1],[1608,1],[1618,2],[1621,2],[1624,1],[1644,1],[1658,1],[1670,3],[1702,2],[1724,1],[1736,3],[1761,1],[1763,1],[1765,1],[1767,1],[1769,1],[1771,1],[1773,2],[1788,1],[1803,1],[1815,1],[1848,1],[1850,1],[1867,1],[1869,1],[1871,1],[1873,1],[1875,1],[1877,1],[1879,1],[1881,1],[2089,1],[2091,2],[2159,1],[2251,2],[2254,2],[2297,1],[2371,2],[2374,1],[2443,1],[2445,2],[2493,1],[2572,2],[2575,1]]},"91":{"position":[[225,1],[247,1],[249,1],[284,1],[296,1],[307,1],[318,1],[320,1],[330,2],[333,2],[336,1],[357,1],[380,1],[382,1],[384,1],[386,1],[388,1],[390,2],[405,1],[420,1],[432,1],[465,1],[467,1],[484,1],[486,1],[488,1],[490,1],[492,1],[494,1],[496,1],[498,1],[713,1],[715,1],[794,2],[797,1],[840,1],[842,1],[921,2],[924,1]]},"93":{"position":[[253,1],[275,1],[277,1],[312,1],[324,1],[342,1],[353,1],[355,1],[376,1],[408,1],[410,2],[413,1],[434,1],[457,1],[459,1],[461,1],[463,1],[465,1],[467,2],[482,1],[497,1],[509,1],[542,1],[544,1],[561,1],[563,1],[565,1],[567,1],[569,1],[571,1],[573,1],[575,1],[753,1],[755,1],[834,2],[837,1],[895,1],[897,1],[985,2],[988,1]]},"95":{"position":[[316,1],[338,1],[340,1],[375,1],[387,1],[403,1],[413,1],[423,2],[426,2],[441,1],[462,1],[486,1],[488,1],[490,1],[492,1],[494,2],[509,1],[524,1],[536,1],[569,1],[571,1],[588,1],[590,1],[592,1],[594,1],[596,1],[598,1],[600,1],[602,1],[765,1],[767,1],[846,2],[849,1],[954,1],[956,1],[1036,2],[1039,1]]},"97":{"position":[[424,1],[440,1],[451,1],[484,1],[492,1],[500,1],[508,2],[511,1],[519,1],[538,1],[558,1],[560,1],[562,3],[575,1],[608,1],[616,1],[624,1],[632,2],[635,1],[643,1],[662,1],[683,1],[685,1],[693,1],[712,1],[723,1],[744,1],[763,1],[795,1],[830,3],[834,3],[1059,1],[1106,1],[1108,1],[1138,1],[1149,1],[1159,2],[1162,2],[1175,1],[1186,1],[1197,1],[1199,1],[1209,2],[1212,2],[1215,1],[1236,1],[1258,1],[1260,1],[1262,1],[1264,1],[1266,2],[1279,1],[1290,1],[1301,1],[1303,1],[1313,2],[1316,2],[1319,1],[1340,1],[1363,1],[1365,2],[1368,1],[1388,1],[1402,1],[1425,2],[1447,1],[1470,1],[1472,1],[1474,1],[1476,1],[1478,1],[1480,1],[1482,2],[1497,1],[1512,1],[1523,1],[1556,1],[1558,1],[1575,1],[1577,1],[1579,2],[1592,1],[1625,1],[1627,1],[1644,1],[1646,1],[1648,2],[1661,1],[1694,1],[1696,1],[1713,1],[1715,1],[1717,1],[1719,1],[1721,1],[1723,1],[1725,1],[1727,1],[1894,1],[1941,1],[1943,1],[1973,1],[1985,1],[1996,1],[2007,1],[2009,1],[2019,2],[2022,2],[2025,1],[2046,1],[2069,1],[2071,2],[2074,1],[2094,1],[2108,1],[2131,2],[2153,1],[2176,1],[2178,1],[2180,1],[2182,1],[2184,1],[2186,1],[2188,2],[2203,1],[2218,1],[2230,1],[2263,1],[2265,1],[2282,1],[2284,1],[2286,1],[2288,1],[2290,1],[2292,1],[2294,1],[2296,1]]},"109":{"position":[[999,1],[1029,1]]},"113":{"position":[[363,1],[401,1],[415,1],[436,2],[527,2],[596,2],[701,2],[711,2],[718,1],[720,2],[723,2],[739,1],[741,1]]},"125":{"position":[[93,1]]},"133":{"position":[[105,2],[129,1],[145,1],[147,1],[174,2],[274,1],[335,2],[419,2],[599,2],[642,3],[653,1],[655,1],[697,1],[711,1],[713,2],[812,2],[886,2],[971,2],[1104,2],[1278,2],[1321,2],[1331,2],[1338,1],[1340,2],[1343,2],[1359,1],[1361,1],[1363,2],[1482,1],[1537,1],[1571,1],[1573,2],[1675,1],[1703,1],[1715,1],[1771,2],[1828,1],[1882,2],[1987,1],[2041,2],[2168,1],[2222,2],[2265,2],[2282,1],[2318,1],[2320,1],[2422,1],[2468,1],[2504,1],[2561,1],[2595,1],[2700,1],[2733,1],[2861,1],[2895,1],[2937,1],[2939,1],[3063,1]]},"135":{"position":[[111,2],[132,1],[142,1],[144,1],[231,2],[234,1],[291,3],[295,2],[306,1],[321,2],[416,1],[423,2],[507,1],[519,2],[598,2],[606,1],[608,1],[624,1],[638,1],[663,1],[686,1],[719,2],[731,1],[756,1],[763,1],[787,1],[806,1],[822,2],[838,1],[878,2],[898,1],[913,1],[915,1],[973,1],[980,1],[1060,1],[1071,1],[1111,1],[1130,1],[1245,1],[1330,1],[1374,1],[1376,1],[1467,1],[1608,1]]},"145":{"position":[[105,2],[129,1],[145,1],[147,1],[174,2],[274,1],[335,2],[419,2],[599,2],[642,3],[653,1],[655,1],[697,1],[711,1],[713,2],[812,2],[886,2],[971,2],[1104,2],[1278,2],[1321,2],[1331,2],[1338,1],[1340,2],[1343,2],[1359,1],[1361,1],[1363,2],[1482,1],[1537,1],[1571,1],[1573,2],[1675,1],[1703,1],[1715,1],[1771,2],[1828,1],[1882,2],[1987,1],[2041,2],[2168,1],[2222,2],[2265,2],[2282,1],[2318,1],[2320,1],[2422,1],[2468,1],[2504,1],[2561,1],[2595,1],[2700,1],[2733,1],[2861,1],[2895,1],[2937,1],[2939,1],[3063,1]]},"147":{"position":[[121,1],[210,2],[213,1],[270,3],[274,2],[294,1],[347,2],[448,1],[455,2],[541,1],[553,2],[648,2],[656,1],[658,1],[714,1],[728,1],[759,1],[782,1],[815,2],[827,1],[858,1],[865,1],[889,1],[906,1],[920,2],[936,1],[982,2],[1002,1],[1055,1],[1057,1],[1115,1],[1122,1],[1204,1],[1215,1],[1262,1],[1281,1],[1441,1],[1572,1],[1616,1],[1618,1],[1709,1],[1714,2],[1835,2],[1838,1]]},"169":{"position":[[549,2],[607,1],[643,3],[647,2],[722,2],[725,1],[734,1],[766,2],[769,3],[773,2],[803,1],[811,2],[814,2],[817,1],[823,1],[853,1],[867,1],[910,1],[912,2],[1447,1],[1453,2],[1521,1],[1553,1],[1597,1]]},"171":{"position":[[255,1],[299,1],[335,1],[378,1],[388,1],[546,2],[555,1],[576,2],[579,3],[648,1],[654,1],[683,1],[697,1],[716,1],[718,3],[722,3],[865,1],[898,1],[932,1],[973,2],[1008,1],[1010,2],[1053,1],[1085,2],[1088,2],[1091,2],[1094,2],[1169,1],[1205,3],[1231,1],[1280,1],[1371,2],[1402,1],[1410,2],[1413,2],[1416,1],[1422,1],[1452,1],[1466,1],[1509,1],[1511,1],[1606,1],[1738,1],[1744,1],[1746,2],[1779,2],[1858,2],[1944,1],[1958,1],[1964,2],[1979,2],[2054,2],[2099,1],[2135,2],[2142,1],[2183,1],[2185,2],[2296,3],[2353,1],[2385,1],[2392,2],[2432,2],[2468,2],[2520,1],[2522,1],[2529,1],[2531,1],[2555,1]]},"173":{"position":[[226,1],[270,1],[306,1],[373,1],[379,1],[405,1],[436,1],[485,1],[545,1],[563,1],[580,1],[621,1],[635,1],[654,1],[656,3],[660,3],[849,1],[884,1],[900,1],[902,1],[929,2],[942,1],[958,1],[996,1],[1032,1],[1096,1],[1102,1],[1104,2],[1156,1],[1217,2],[1346,3],[1356,1],[1366,1],[1368,1],[1466,3],[1484,1],[1529,1],[1531,1],[1545,1],[1564,1],[1566,3],[1570,3],[1687,1],[1720,1],[1754,1],[1836,2],[1871,1],[1873,2],[1916,1],[1948,2],[1951,2],[1954,2],[1957,2],[2025,1],[2061,3],[2087,1],[2139,1],[2184,1],[2226,1],[2390,1],[2398,2],[2401,2],[2404,1],[2410,1],[2440,1],[2454,1],[2497,1],[2499,1],[2759,1],[2942,1],[2979,1],[2985,1],[2987,2],[3020,2],[3099,2],[3185,1],[3199,1],[3205,2],[3220,2],[3295,2],[3340,1],[3376,2],[3383,1],[3424,1],[3426,2],[3537,3],[3663,1],[3695,1],[3702,2],[3742,2],[3778,2],[3830,1],[3832,1],[3839,1],[3841,1],[3865,1],[3905,1],[3907,2],[3942,2],[3982,2],[4018,2],[4072,2],[4117,1],[4290,1],[4292,2],[4385,1],[4425,1],[4427,2],[4540,1],[4557,2],[4635,2],[4730,2],[4863,2],[5041,2],[5084,2],[5094,2],[5101,1],[5191,1],[5198,2],[5336,1],[5348,2],[5425,2],[5432,1],[5525,1],[5547,1],[5632,1],[5634,2],[5679,1]]},"183":{"position":[[102,1],[118,1],[120,1],[147,2],[160,1],[176,1],[213,1],[274,2],[368,2],[500,2],[658,2],[701,3],[712,1],[755,1],[792,1],[806,1],[823,2],[901,2],[996,2],[1129,2],[1307,2],[1350,2],[1360,2],[1367,1],[1369,2],[1372,2],[1388,1],[1390,1],[1493,1],[1553,1],[1580,1],[1600,1],[1628,1],[1640,1],[1696,2],[1763,1],[1817,2],[1922,1],[1976,2],[2107,1],[2161,2],[2204,2],[2221,1],[2257,1],[2259,1],[2349,1],[2389,1],[2425,1],[2492,1],[2526,1],[2631,1],[2665,1],[2783,1],[2817,1],[2859,1],[2929,1],[2976,2],[3018,2],[3083,1],[3163,1],[3285,1]]},"185":{"position":[[412,1],[447,1],[449,1],[476,2],[489,1],[524,1],[561,1],[622,2],[716,2],[848,2],[1006,2],[1062,1],[1108,1],[1145,2],[1148,1],[1150,3],[1161,1],[1204,1],[1281,1],[1295,1],[1312,2],[1390,2],[1485,2],[1618,2],[1796,2],[1996,2],[2072,2],[2075,2],[2078,2],[2088,2],[2095,1],[2097,2],[2100,2],[2116,1],[2118,1],[2221,1],[2281,1],[2308,1],[2328,1],[2356,1],[2368,1],[2424,2],[2491,1],[2545,2],[2650,1],[2704,2],[2835,1],[2889,2],[2944,1],[2964,1],[2973,1],[3010,1],[3036,1],[3047,1],[3101,2],[3104,2],[3107,2],[3124,1],[3160,1],[3162,1],[3323,1],[3451,1],[3491,1],[3527,1],[3594,1],[3628,1],[3733,1],[3767,1],[3885,1],[3919,1],[3973,1],[3988,1],[4058,1],[4105,2],[4147,2],[4212,1],[4292,1],[4414,1]]},"187":{"position":[[288,1],[323,1],[325,1],[352,2],[365,1],[400,1],[437,1],[498,2],[592,2],[724,2],[882,2],[938,1],[993,1],[1170,2],[1173,1],[1175,3],[1186,1],[1229,1],[1306,1],[1320,1],[1337,2],[1415,2],[1510,2],[1643,2],[1821,2],[2235,2],[2238,2],[2241,2],[2251,2],[2258,1],[2260,2],[2263,2],[2279,1],[2281,1],[2384,1],[2444,1],[2471,1],[2491,1],[2519,1],[2531,1],[2587,2],[2654,1],[2708,2],[2813,1],[2867,2],[2998,1],[3052,2],[3107,1],[3127,1],[3136,1],[3182,1],[3208,1],[3225,1],[3299,1],[3366,1],[3434,1],[3493,1],[3495,1],[3497,2],[3514,1],[3550,1],[3552,1],[3713,1],[3994,1],[3996,1],[4012,1],[4052,1],[4088,1],[4155,1],[4189,1],[4294,1],[4328,1],[4446,1],[4480,1],[4534,1],[4549,1],[4619,1],[4666,2],[4708,2],[4773,1],[4853,1],[4975,1]]},"191":{"position":[[453,1],[500,1],[502,1],[519,2],[522,1],[556,1],[570,1],[580,2],[583,1],[585,2],[600,1],[615,1],[629,1],[662,1],[664,1],[681,1],[683,1],[685,1],[687,1],[689,1],[691,2],[694,1],[729,1],[741,1],[751,2],[754,1],[756,2],[771,1],[786,1],[798,1],[831,1],[833,1],[877,1],[879,1],[881,1],[883,1],[885,1],[887,1],[889,1],[891,1],[1058,1]]},"193":{"position":[[93,1]]},"198":{"position":[[187,1],[189,2],[249,1],[336,2],[339,1]]},"200":{"position":[[146,2],[218,2],[242,1],[258,1],[260,1],[287,2],[387,1],[448,2],[532,2],[712,2],[755,3],[791,1],[793,1],[860,2],[863,2],[866,1],[922,3],[945,2],[1024,1],[1026,1],[1068,1],[1082,1],[1084,2],[1183,2],[1257,2],[1342,2],[1475,2],[1649,2],[1692,2],[1702,2],[1709,1],[1711,2],[1714,2],[1730,1],[1732,1],[1742,2],[1837,1],[1844,2],[1904,1],[2027,2],[2030,1],[2032,1],[2044,2],[2137,2],[2144,1],[2146,2],[2149,2],[2165,1],[2186,2],[2258,2],[2377,1],[2432,1],[2466,1],[2468,2],[2570,1],[2598,1],[2610,1],[2666,2],[2723,1],[2777,2],[2882,1],[2936,2],[3063,1],[3117,2],[3160,2],[3177,1],[3213,1],[3215,1],[3229,1],[3260,1],[3283,1],[3316,2],[3328,1],[3355,1],[3364,1],[3393,1],[3401,1],[3408,1],[3432,1],[3453,1],[3469,1],[3471,2],[3474,2],[3490,1],[3549,1],[3720,1],[3766,1],[3802,1],[3859,1],[3893,1],[3998,1],[4031,1],[4159,1],[4193,1],[4235,1],[4237,1],[4361,1],[4441,1],[4443,1],[4501,1],[4508,1],[4515,1],[4620,3],[4624,2],[4627,2],[4630,1],[4641,1],[4915,1],[4959,1],[4961,1],[5052,1],[5069,1],[5084,1],[5154,2],[5514,1],[5582,1],[5584,2]]},"202":{"position":[[156,2],[228,2],[252,1],[268,1],[270,1],[297,2],[397,1],[458,2],[542,2],[722,2],[765,3],[769,2],[790,1],[800,1],[802,1],[896,2],[899,1],[956,3],[960,2],[971,1],[997,2],[1076,1],[1078,1],[1120,1],[1134,1],[1136,2],[1235,2],[1309,2],[1394,2],[1527,2],[1701,2],[1744,2],[1754,2],[1761,1],[1763,2],[1766,2],[1782,1],[1784,1],[1794,2],[1889,1],[1896,2],[1987,1],[1999,2],[2078,2],[2086,1],[2088,1],[2104,1],[2125,2],[2197,2],[2316,1],[2371,1],[2405,1],[2407,2],[2509,1],[2537,1],[2549,1],[2605,2],[2662,1],[2716,2],[2821,1],[2875,2],[3002,1],[3056,2],[3099,2],[3116,1],[3152,1],[3154,1],[3168,1],[3193,1],[3216,1],[3249,2],[3261,1],[3286,1],[3293,1],[3317,1],[3336,1],[3359,2],[3375,1],[3415,2],[3435,1],[3461,1],[3632,1],[3678,1],[3714,1],[3771,1],[3805,1],[3910,1],[3943,1],[4071,1],[4105,1],[4147,1],[4149,1],[4273,1],[4353,1],[4355,1],[4413,1],[4420,1],[4507,1],[4518,1],[4558,1],[4577,1],[4877,1],[5140,1],[5184,1],[5186,1],[5277,1],[5425,1],[5466,1],[5481,2],[5523,1],[5535,2],[5570,1],[5593,2],[5649,1],[5681,2],[5900,2],[5972,2],[5996,1],[6012,1],[6014,1],[6041,2],[6141,1],[6202,2],[6286,2],[6466,2],[6509,3],[6513,2],[6534,1],[6544,1],[6546,1],[6641,2],[6644,1],[6701,3],[6705,2],[6716,1],[6743,2],[6822,1],[6824,1],[6866,1],[6880,1],[6882,2],[6981,2],[7055,2],[7140,2],[7273,2],[7447,2],[7490,2],[7500,2],[7507,1],[7509,2],[7512,2],[7528,1],[7530,1],[7540,2],[7635,1],[7642,2],[7734,1],[7746,2],[7825,2],[7833,1],[7835,1],[7852,1],[7873,2],[7945,2],[8064,1],[8119,1],[8153,1],[8155,2],[8257,1],[8285,1],[8297,1],[8353,2],[8410,1],[8464,2],[8569,1],[8623,2],[8750,1],[8804,2],[8847,2],[8864,1],[8900,1],[8902,1],[8916,1],[8941,1],[8964,1],[8997,2],[9009,1],[9034,1],[9041,1],[9066,1],[9085,1],[9108,2],[9124,1],[9164,2],[9184,1],[9211,1],[9382,1],[9428,1],[9464,1],[9521,1],[9555,1],[9660,1],[9693,1],[9821,1],[9855,1],[9897,1],[9899,1],[10023,1],[10103,1],[10105,1],[10163,1],[10170,1],[10258,1],[10269,1],[10309,1],[10328,1],[10630,1],[10894,1],[10938,1],[10940,1],[11031,1],[11180,1],[11222,1],[11238,2],[11281,1],[11293,2],[11328,1],[11351,2],[11407,1],[11439,2]]},"210":{"position":[[134,1]]},"212":{"position":[[1154,1],[1184,1],[1399,1],[1429,1],[1813,1],[1853,1],[2514,1],[2557,1],[2610,1],[3841,1],[3868,1],[4066,1],[4093,1],[4480,1],[4499,1],[4513,1],[4539,1],[5145,1],[5188,1],[5241,1]]},"214":{"position":[[1522,1],[1549,1],[1586,1],[1612,1],[1661,1],[3041,1],[3063,1],[3099,1],[3139,1],[3165,1],[3214,1]]},"220":{"position":[[273,1],[296,1],[416,1]]},"222":{"position":[[651,2],[656,1],[733,2],[738,1],[839,2]]},"246":{"position":[[94,1],[157,1]]},"248":{"position":[[105,2],[129,1],[145,1],[147,1],[174,2],[274,1],[335,2],[419,2],[599,2],[642,3],[653,1],[655,1],[697,1],[711,1],[713,2],[812,2],[886,2],[971,2],[1104,2],[1278,2],[1321,2],[1331,2],[1338,1],[1340,2],[1343,2],[1359,1],[1361,1],[1363,2],[1482,1],[1537,1],[1571,1],[1573,2],[1675,1],[1703,1],[1715,1],[1771,2],[1828,1],[1882,2],[1987,1],[2041,2],[2168,1],[2222,2],[2265,2],[2282,1],[2318,1],[2320,1],[2422,1],[2468,1],[2504,1],[2561,1],[2595,1],[2700,1],[2733,1],[2861,1],[2895,1],[2937,1],[2939,1],[3063,1]]},"250":{"position":[[125,1],[127,1],[191,2],[194,2],[197,1],[253,3],[265,2],[360,1],[367,2],[427,1],[547,2],[550,1],[552,1],[564,2],[657,2],[664,1],[666,2],[669,2],[685,1],[699,1],[730,1],[753,1],[786,2],[798,1],[825,1],[834,1],[863,1],[871,1],[878,1],[902,1],[921,1],[936,1],[938,2],[941,2],[957,1],[1005,1],[1007,1],[1065,1],[1072,1],[1079,1],[1181,3],[1185,2],[1188,2],[1191,1],[1202,1],[1408,1],[1452,1],[1454,1],[1545,1],[1562,1],[1577,1],[1644,2]]},"252":{"position":[[151,1],[214,1],[281,1],[283,1],[347,2],[350,2],[353,1],[409,3],[421,2],[516,1],[523,2],[584,1],[704,2],[707,1],[709,1],[721,2],[814,2],[821,1],[823,2],[826,2],[842,1],[856,1],[887,1],[910,1],[943,2],[955,1],[982,1],[992,1],[1021,1],[1029,1],[1036,1],[1060,1],[1079,1],[1094,1],[1096,2],[1099,2],[1115,1],[1163,1],[1165,1],[1223,1],[1230,1],[1237,1],[1341,4],[1346,2],[1349,2],[1352,1],[1363,1],[1531,1],[1575,1],[1577,1],[1668,1],[1686,1],[1701,1],[1768,2]]},"258":{"position":[[340,1],[387,1],[389,1],[406,2],[409,1],[441,1],[453,1],[463,2],[466,1],[468,2],[483,1],[498,1],[510,1],[543,1],[545,1],[562,1],[564,1],[566,1],[568,1],[570,1],[572,1],[574,1],[576,1],[777,1]]},"260":{"position":[[134,1]]},"265":{"position":[[127,1],[129,2],[154,1],[220,2],[223,1],[456,2],[528,2],[552,1],[568,1],[570,1],[597,2],[697,1],[758,2],[842,2],[1022,2],[1065,3],[1069,2],[1090,1],[1100,1],[1102,1],[1186,2],[1189,1],[1246,3],[1250,2],[1261,1],[1287,2],[1366,1],[1368,1],[1410,1],[1424,1],[1426,2],[1525,2],[1599,2],[1684,2],[1817,2],[1991,2],[2034,2],[2044,2],[2051,1],[2053,2],[2056,2],[2072,1],[2074,1],[2084,2],[2179,1],[2186,2],[2267,1],[2279,2],[2358,2],[2366,1],[2368,1],[2384,1],[2405,2],[2477,2],[2596,1],[2651,1],[2685,1],[2687,2],[2789,1],[2817,1],[2829,1],[2885,2],[2942,1],[2996,2],[3101,1],[3155,2],[3282,1],[3336,2],[3379,2],[3396,1],[3432,1],[3434,1],[3448,1],[3473,1],[3496,1],[3529,2],[3541,1],[3566,1],[3573,1],[3597,1],[3616,1],[3629,2],[3645,1],[3685,2],[3705,1],[3731,1],[3902,1],[3948,1],[3984,1],[4041,1],[4075,1],[4180,1],[4213,1],[4341,1],[4375,1],[4417,1],[4419,1],[4543,1],[4623,1],[4625,1],[4683,1],[4690,1],[4767,1],[4778,1],[4818,1],[4837,1],[5127,1],[5390,1],[5434,1],[5436,1],[5527,1],[5665,1],[5706,1],[5721,2],[5763,1],[5775,2],[5810,1],[5823,2],[5869,1],[5901,2]]},"267":{"position":[[167,2],[239,2],[263,1],[279,1],[281,1],[308,2],[408,1],[469,2],[553,2],[733,2],[776,3],[813,1],[815,1],[876,2],[879,2],[882,1],[938,3],[961,2],[1040,1],[1042,1],[1084,1],[1098,1],[1100,2],[1199,2],[1273,2],[1358,2],[1491,2],[1665,2],[1708,2],[1718,2],[1725,1],[1727,2],[1730,2],[1746,1],[1748,1],[1758,2],[1853,1],[1860,2],[1921,1],[2038,2],[2041,1],[2043,1],[2055,2],[2148,2],[2155,1],[2157,2],[2160,2],[2176,1],[2197,2],[2269,2],[2388,1],[2443,1],[2477,1],[2479,2],[2581,1],[2609,1],[2621,1],[2677,2],[2734,1],[2788,2],[2893,1],[2947,2],[3074,1],[3128,2],[3171,2],[3188,1],[3224,1],[3226,1],[3240,1],[3271,1],[3294,1],[3327,2],[3339,1],[3366,1],[3376,1],[3405,1],[3413,1],[3420,1],[3444,1],[3463,1],[3475,1],[3477,2],[3480,2],[3496,1],[3555,1],[3726,1],[3772,1],[3808,1],[3865,1],[3899,1],[4004,1],[4037,1],[4165,1],[4199,1],[4241,1],[4243,1],[4367,1],[4447,1],[4449,1],[4507,1],[4514,1],[4521,1],[4622,4],[4627,2],[4630,2],[4633,1],[4644,1],[4918,1],[4962,1],[4964,1],[5055,1],[5073,1],[5088,1],[5152,2],[5469,1],[5531,1],[5533,2],[5871,2],[5943,2],[5967,1],[5983,1],[5985,1],[6012,2],[6112,1],[6173,2],[6257,2],[6437,2],[6480,3],[6484,2],[6505,1],[6515,1],[6517,1],[6601,2],[6604,1],[6661,3],[6665,2],[6676,1],[6703,2],[6782,1],[6784,1],[6826,1],[6840,1],[6842,2],[6941,2],[7015,2],[7100,2],[7233,2],[7407,2],[7450,2],[7460,2],[7467,1],[7469,2],[7472,2],[7488,1],[7490,1],[7500,2],[7595,1],[7602,2],[7683,1],[7695,2],[7774,2],[7782,1],[7784,1],[7801,1],[7822,2],[7894,2],[8013,1],[8068,1],[8102,1],[8104,2],[8206,1],[8234,1],[8246,1],[8302,2],[8359,1],[8413,2],[8518,1],[8572,2],[8699,1],[8753,2],[8796,2],[8813,1],[8849,1],[8851,1],[8865,1],[8890,1],[8913,1],[8946,2],[8958,1],[8983,1],[8990,1],[9014,1],[9033,1],[9046,2],[9062,1],[9102,2],[9122,1],[9149,1],[9320,1],[9366,1],[9402,1],[9459,1],[9493,1],[9598,1],[9631,1],[9759,1],[9793,1],[9835,1],[9837,1],[9961,1],[10041,1],[10043,1],[10101,1],[10108,1],[10185,1],[10196,1],[10236,1],[10255,1],[10546,1],[10810,1],[10854,1],[10856,1],[10947,1],[11085,1],[11127,1],[11142,2],[11184,1],[11196,2],[11231,1],[11244,2],[11290,1],[11322,2]]},"277":{"position":[[77,2],[101,1],[117,1],[119,1],[146,2],[246,1],[307,2],[391,2],[571,2],[614,3],[625,1],[627,1],[669,1],[683,1],[685,2],[784,2],[858,2],[943,2],[1076,2],[1250,2],[1293,2],[1303,2],[1310,1],[1312,2],[1315,2],[1331,1],[1333,1],[1335,2],[1454,1],[1509,1],[1543,1],[1545,2],[1647,1],[1675,1],[1687,1],[1743,2],[1800,1],[1854,2],[1959,1],[2013,2],[2140,1],[2194,2],[2237,2],[2254,1],[2290,1],[2292,1],[2394,1],[2440,1],[2476,1],[2533,1],[2567,1],[2672,1],[2705,1],[2833,1],[2867,1],[2909,1],[2911,1],[3035,1]]},"279":{"position":[[105,1],[107,3],[133,1],[135,3],[152,1],[193,2],[196,1],[226,3],[238,2],[299,1],[306,2],[335,1],[347,2],[439,2],[446,1],[448,2],[451,2],[467,1],[478,1],[509,1],[511,2],[526,1],[557,1],[568,1],[574,2],[590,1],[641,1],[678,1],[709,1],[726,2],[738,1],[888,1],[932,1],[934,1],[1025,1],[1509,1],[1511,3],[1537,1],[1652,1],[1693,2],[1696,1],[1726,3],[1738,2],[1937,1],[1944,2],[1973,1],[1985,2],[2077,2],[2084,1],[2086,2],[2089,2],[2105,1],[2116,1],[2147,1],[2149,2],[2164,1],[2195,1],[2206,1],[2230,1],[2332,2],[2348,1],[2399,1],[2436,1],[2467,1],[2604,2],[2616,1],[2766,1],[2810,1],[2812,1],[2903,1]]},"281":{"position":[[242,1],[289,1],[291,1],[308,2],[311,1],[343,1],[355,1],[365,2],[368,1],[370,2],[385,1],[400,1],[412,1],[445,1],[447,1],[464,1],[466,1],[468,1],[470,1],[472,1],[474,2],[477,1],[510,1],[521,1],[531,2],[534,1],[536,2],[551,1],[566,1],[577,1],[610,1],[612,1],[652,2],[655,1],[672,1],[674,1],[676,1],[678,1],[680,1],[682,2],[685,1],[715,1],[726,1],[736,2],[739,1],[741,2],[756,1],[771,1],[782,1],[815,1],[817,1],[857,2],[860,1],[877,1],[879,1],[881,1],[883,1],[885,1],[887,1],[889,1],[891,1],[1090,1],[1124,1],[1126,3],[1143,1],[1184,2],[1187,1],[1217,3],[1229,2],[1290,1],[1297,2],[1342,1],[1354,2],[1446,2],[1453,1],[1455,2],[1458,2],[1474,1],[1485,1],[1516,1],[1523,1],[1534,2],[1549,1],[1580,1],[1591,1],[1597,2],[1613,1],[1664,1],[1709,1],[1740,1],[1757,2],[1769,1],[1933,1],[1977,1],[1979,1],[2070,1],[2359,1],[2393,1],[2508,1],[2549,2],[2552,1],[2582,3],[2594,2],[2793,1],[2800,2],[2845,1],[2857,2],[2949,2],[2956,1],[2958,2],[2961,2],[2977,1],[2988,1],[3019,1],[3026,1],[3037,2],[3052,1],[3083,1],[3094,1],[3118,1],[3220,2],[3236,1],[3287,1],[3332,1],[3363,1],[3500,2],[3512,1],[3676,1],[3720,1],[3722,1],[3813,1]]},"285":{"position":[[435,1],[482,1],[484,1],[501,2],[504,1],[534,1],[546,1],[556,2],[559,1],[561,2],[576,1],[591,1],[603,1],[636,1],[638,1],[655,1],[657,1],[659,1],[661,1],[663,1],[665,2],[668,1],[703,1],[715,1],[725,2],[728,1],[730,2],[745,1],[760,1],[772,1],[805,1],[807,1],[845,1],[847,1],[849,1],[851,1],[853,1],[855,1],[857,1],[859,1],[1078,1],[1080,2],[1141,1],[1226,2],[1229,1],[1461,2],[1533,2],[1557,1],[1573,1],[1575,1],[1602,2],[1702,1],[1763,2],[1847,2],[2027,2],[2070,3],[2074,2],[2095,1],[2105,1],[2107,1],[2196,2],[2199,1],[2256,3],[2260,2],[2271,1],[2298,2],[2377,1],[2379,1],[2421,1],[2435,1],[2437,2],[2536,2],[2610,2],[2695,2],[2828,2],[3002,2],[3045,2],[3055,2],[3062,1],[3064,2],[3067,2],[3083,1],[3085,1],[3095,2],[3190,1],[3197,2],[3283,1],[3295,2],[3374,2],[3382,1],[3384,1],[3401,1],[3422,2],[3494,2],[3613,1],[3668,1],[3702,1],[3704,2],[3806,1],[3834,1],[3846,1],[3902,2],[3959,1],[4013,2],[4118,1],[4172,2],[4299,1],[4353,2],[4396,2],[4413,1],[4449,1],[4451,1],[4465,1],[4490,1],[4513,1],[4546,2],[4558,1],[4583,1],[4590,1],[4609,1],[4628,1],[4651,2],[4667,1],[4707,2],[4727,1],[4754,1],[4925,1],[4971,1],[5007,1],[5064,1],[5098,1],[5203,1],[5236,1],[5364,1],[5398,1],[5440,1],[5442,1],[5566,1],[5646,1],[5648,1],[5706,1],[5713,1],[5795,1],[5806,1],[5846,1],[5865,1],[6161,1],[6425,1],[6469,1],[6471,1],[6562,1],[6705,1],[6747,1],[6757,2],[6794,1],[6806,2],[6841,1],[6864,2],[6920,1],[6952,2],[7099,2],[7171,2],[7195,1],[7211,1],[7213,1],[7240,2],[7340,1],[7401,2],[7485,2],[7665,2],[7708,3],[7744,1],[7746,2],[7785,1],[7850,2],[7853,2],[7856,1],[7912,3],[7935,2],[8014,1],[8016,1],[8058,1],[8072,1],[8074,2],[8173,2],[8247,2],[8332,2],[8465,2],[8639,2],[8682,2],[8692,2],[8699,1],[8701,2],[8704,2],[8720,1],[8722,1],[8732,2],[8827,1],[8834,2],[8894,1],[8896,2],[9054,2],[9057,1],[9059,1],[9071,2],[9164,2],[9171,1],[9173,2],[9176,2],[9192,1],[9213,2],[9285,2],[9404,1],[9459,1],[9493,1],[9495,2],[9597,1],[9625,1],[9637,1],[9693,2],[9750,1],[9804,2],[9909,1],[9963,2],[10090,1],[10144,2],[10187,2],[10204,1],[10240,1],[10242,1],[10256,1],[10287,1],[10310,1],[10343,2],[10355,1],[10382,1],[10391,1],[10420,1],[10422,2],[10467,1],[10474,1],[10498,1],[10517,1],[10533,1],[10535,2],[10538,2],[10554,1],[10613,1],[10784,1],[10830,1],[10866,1],[10923,1],[10957,1],[11062,1],[11095,1],[11223,1],[11257,1],[11299,1],[11301,1],[11425,1],[11505,1],[11507,1],[11565,1],[11572,1],[11579,1],[11623,1],[11720,3],[11724,2],[11727,2],[11730,1],[11741,1],[12015,1],[12059,1],[12061,1],[12152,1],[12169,1],[12184,1],[12252,2],[12610,2],[12649,1],[12715,1],[12717,2],[13123,2],[13195,2],[13219,1],[13235,1],[13237,1],[13264,2],[13364,1],[13425,2],[13509,2],[13689,2],[13732,3],[13736,2],[13757,1],[13767,1],[13769,1],[13863,2],[13866,1],[13923,3],[13927,2],[13938,1],[13964,2],[14043,1],[14045,1],[14087,1],[14101,1],[14103,2],[14202,2],[14276,2],[14361,2],[14494,2],[14668,2],[14711,2],[14721,2],[14728,1],[14730,2],[14733,2],[14749,1],[14751,1],[14761,2],[14856,1],[14863,2],[14954,1],[14966,2],[15045,2],[15053,1],[15055,1],[15071,1],[15092,2],[15164,2],[15283,1],[15338,1],[15372,1],[15374,2],[15476,1],[15504,1],[15516,1],[15572,2],[15629,1],[15683,2],[15788,1],[15842,2],[15969,1],[16023,2],[16066,2],[16083,1],[16119,1],[16121,1],[16135,1],[16160,1],[16183,1],[16216,2],[16228,1],[16253,1],[16260,1],[16284,1],[16303,1],[16326,2],[16342,1],[16382,2],[16402,1],[16428,1],[16599,1],[16645,1],[16681,1],[16738,1],[16772,1],[16877,1],[16910,1],[17038,1],[17072,1],[17114,1],[17116,1],[17240,1],[17320,1],[17322,1],[17380,1],[17387,1],[17474,1],[17485,1],[17525,1],[17544,1],[17844,1],[18107,1],[18151,1],[18153,1],[18244,1],[18392,1],[18433,1],[18448,2],[18490,1],[18502,2],[18537,1],[18560,2],[18616,1],[18648,2],[18725,2],[18797,2],[18821,1],[18837,1],[18839,1],[18866,2],[18966,1],[19027,2],[19111,2],[19291,2],[19334,3],[19338,2],[19359,1],[19369,1],[19371,1],[19466,2],[19469,1],[19526,3],[19530,2],[19541,1],[19568,2],[19647,1],[19649,1],[19691,1],[19705,1],[19707,2],[19806,2],[19880,2],[19965,2],[20098,2],[20272,2],[20315,2],[20325,2],[20332,1],[20334,2],[20337,2],[20353,1],[20355,1],[20365,2],[20460,1],[20467,2],[20559,1],[20571,2],[20650,2],[20658,1],[20660,1],[20677,1],[20698,2],[20770,2],[20889,1],[20944,1],[20978,1],[20980,2],[21082,1],[21110,1],[21122,1],[21178,2],[21235,1],[21289,2],[21394,1],[21448,2],[21575,1],[21629,2],[21672,2],[21689,1],[21725,1],[21727,1],[21741,1],[21766,1],[21789,1],[21822,2],[21834,1],[21859,1],[21866,1],[21891,1],[21910,1],[21933,2],[21949,1],[21989,2],[22009,1],[22036,1],[22207,1],[22253,1],[22289,1],[22346,1],[22380,1],[22485,1],[22518,1],[22646,1],[22680,1],[22722,1],[22724,1],[22848,1],[22928,1],[22930,1],[22988,1],[22995,1],[23083,1],[23094,1],[23134,1],[23153,1],[23455,1],[23719,1],[23763,1],[23765,1],[23856,1],[24005,1],[24047,1],[24063,2],[24106,1],[24118,2],[24153,1],[24176,2],[24232,1],[24264,2],[24395,1],[24489,1]]},"287":{"position":[[93,1]]},"289":{"position":[[69,1]]},"294":{"position":[[408,2],[480,2],[504,1],[520,1],[522,1],[549,2],[649,1],[710,2],[794,2],[974,2],[1017,3],[1054,1],[1056,1],[1121,2],[1124,2],[1127,1],[1183,3],[1206,2],[1285,1],[1287,1],[1329,1],[1343,1],[1345,2],[1444,2],[1518,2],[1603,2],[1736,2],[1910,2],[1953,2],[1963,2],[1970,1],[1972,2],[1975,2],[1991,1],[1993,1],[2003,2],[2098,1],[2105,2],[2166,1],[2287,2],[2290,1],[2292,1],[2304,2],[2397,2],[2404,1],[2406,2],[2409,2],[2425,1],[2446,2],[2518,2],[2637,1],[2692,1],[2726,1],[2728,2],[2830,1],[2858,1],[2870,1],[2926,2],[2983,1],[3037,2],[3142,1],[3196,2],[3323,1],[3377,2],[3420,2],[3437,1],[3473,1],[3475,1],[3489,1],[3520,1],[3543,1],[3576,2],[3588,1],[3615,1],[3625,1],[3654,1],[3662,1],[3669,1],[3693,1],[3712,1],[3728,1],[3730,2],[3733,2],[3749,1],[3808,1],[3979,1],[4025,1],[4061,1],[4118,1],[4152,1],[4257,1],[4290,1],[4418,1],[4452,1],[4494,1],[4496,1],[4620,1],[4700,1],[4702,1],[4760,1],[4767,1],[4774,1],[4879,4],[4884,2],[4887,2],[4890,1],[4901,1],[5175,1],[5219,1],[5221,1],[5312,1],[5330,1],[5345,1],[5413,2],[5734,1],[5800,1],[5802,2]]},"296":{"position":[[115,1],[134,2],[199,2],[271,2],[295,1],[311,1],[313,1],[340,2],[440,1],[501,2],[585,2],[765,2],[808,3],[812,2],[833,1],[843,1],[845,1],[939,2],[942,1],[999,3],[1003,2],[1014,1],[1041,2],[1120,1],[1122,1],[1164,1],[1178,1],[1180,2],[1279,2],[1353,2],[1438,2],[1571,2],[1745,2],[1788,2],[1798,2],[1805,1],[1807,2],[1810,2],[1826,1],[1828,1],[1838,2],[1933,1],[1940,2],[2031,1],[2043,2],[2122,2],[2130,1],[2132,1],[2149,1],[2170,2],[2242,2],[2361,1],[2416,1],[2450,1],[2452,2],[2554,1],[2582,1],[2594,1],[2650,2],[2707,1],[2761,2],[2866,1],[2920,2],[3047,1],[3101,2],[3144,2],[3161,1],[3197,1],[3199,1],[3213,1],[3238,1],[3261,1],[3294,2],[3306,1],[3331,1],[3338,1],[3362,1],[3381,1],[3404,2],[3420,1],[3460,2],[3480,1],[3507,1],[3678,1],[3724,1],[3760,1],[3817,1],[3851,1],[3956,1],[3989,1],[4117,1],[4151,1],[4193,1],[4195,1],[4319,1],[4399,1],[4401,1],[4459,1],[4466,1],[4553,1],[4564,1],[4604,1],[4623,1],[4924,1],[5188,1],[5232,1],[5234,1],[5325,1],[5473,1],[5515,1],[5530,2],[5572,1],[5584,2],[5619,1],[5642,2],[5698,1],[5730,2]]},"302":{"position":[[513,1],[560,1],[562,1],[594,1],[606,1],[616,2],[619,1],[621,2],[636,1],[651,1],[663,1],[696,1],[698,1],[715,2],[718,1],[748,2],[751,2],[754,1],[795,1],[797,1],[799,1],[801,1],[803,1],[805,2],[808,1],[839,1],[853,1],[863,2],[866,2],[884,1],[894,2],[897,1],[899,2],[914,1],[929,1],[943,1],[976,1],[978,1],[995,1],[997,1],[999,2],[1017,1],[1050,1],[1052,1],[1069,1],[1071,1],[1073,1],[1075,1],[1077,1],[1079,1],[1081,1],[1083,1],[1284,1],[1379,1]]},"304":{"position":[[134,1]]},"306":{"position":[[69,1]]},"311":{"position":[[253,2],[325,2],[349,1],[365,1],[367,1],[394,2],[494,1],[555,2],[639,2],[819,2],[862,3],[898,1],[900,1],[958,2],[961,2],[964,1],[1020,3],[1043,2],[1122,1],[1124,1],[1166,1],[1180,1],[1182,2],[1281,2],[1355,2],[1440,2],[1573,2],[1747,2],[1790,2],[1800,2],[1807,1],[1809,2],[1812,2],[1828,1],[1830,1],[1840,2],[1935,1],[1942,2],[2002,1],[2116,2],[2119,1],[2121,1],[2133,2],[2226,2],[2233,1],[2235,2],[2238,2],[2254,1],[2275,2],[2347,2],[2466,1],[2521,1],[2555,1],[2557,2],[2659,1],[2687,1],[2699,1],[2755,2],[2812,1],[2866,2],[2971,1],[3025,2],[3152,1],[3206,2],[3249,2],[3266,1],[3302,1],[3304,1],[3318,1],[3349,1],[3372,1],[3405,2],[3417,1],[3444,1],[3453,1],[3482,1],[3490,1],[3497,1],[3518,1],[3537,1],[3549,1],[3551,2],[3554,2],[3570,1],[3629,1],[3800,1],[3846,1],[3882,1],[3939,1],[3973,1],[4078,1],[4111,1],[4239,1],[4273,1],[4315,1],[4317,1],[4441,1],[4521,1],[4523,1],[4581,1],[4588,1],[4595,1],[4691,3],[4695,2],[4698,2],[4701,1],[4712,1],[4986,1],[5030,1],[5032,1],[5123,1],[5140,1],[5155,1],[5216,2],[5567,1],[5626,1],[5628,2],[5834,2],[5906,2],[5930,1],[5946,1],[5948,1],[5975,2],[6075,1],[6136,2],[6220,2],[6400,2],[6443,3],[6480,1],[6482,1],[6540,2],[6543,2],[6546,1],[6602,3],[6625,2],[6704,1],[6706,1],[6748,1],[6762,1],[6764,2],[6863,2],[6937,2],[7022,2],[7155,2],[7329,2],[7372,2],[7382,2],[7389,1],[7391,2],[7394,2],[7410,1],[7412,1],[7422,2],[7517,1],[7524,2],[7585,1],[7699,2],[7702,1],[7704,1],[7716,2],[7809,2],[7816,1],[7818,2],[7821,2],[7837,1],[7858,2],[7930,2],[8049,1],[8104,1],[8138,1],[8140,2],[8242,1],[8270,1],[8282,1],[8338,2],[8395,1],[8449,2],[8554,1],[8608,2],[8735,1],[8789,2],[8832,2],[8849,1],[8885,1],[8887,1],[8901,1],[8932,1],[8955,1],[8988,2],[9000,1],[9027,1],[9037,1],[9066,1],[9074,1],[9081,1],[9102,1],[9121,1],[9133,1],[9135,2],[9138,2],[9154,1],[9213,1],[9384,1],[9430,1],[9466,1],[9523,1],[9557,1],[9662,1],[9695,1],[9823,1],[9857,1],[9899,1],[9901,1],[10025,1],[10105,1],[10107,1],[10165,1],[10172,1],[10179,1],[10277,4],[10282,2],[10285,2],[10288,1],[10299,1],[10573,1],[10617,1],[10619,1],[10710,1],[10728,1],[10743,1],[10804,2],[11118,1],[11177,1],[11179,2],[11648,2],[11720,2],[11744,1],[11760,1],[11762,1],[11789,2],[11889,1],[11950,2],[12034,2],[12214,2],[12257,3],[12293,1],[12295,2],[12332,1],[12402,2],[12414,1],[12416,2],[12461,3],[12465,1],[12523,2],[12526,2],[12529,1],[12585,3],[12608,2],[12687,1],[12689,1],[12731,1],[12745,1],[12747,2],[12846,2],[12920,2],[13005,2],[13138,2],[13312,2],[13355,2],[13365,2],[13372,1],[13374,2],[13377,2],[13393,1],[13395,1],[13405,2],[13500,1],[13507,2],[13567,1],[13569,2],[13730,2],[13733,1],[13763,1],[13765,2],[13810,3],[13926,2],[13929,1],[13931,1],[13943,2],[14036,2],[14043,1],[14045,2],[14048,2],[14064,1],[14085,2],[14157,2],[14276,1],[14331,1],[14365,1],[14367,2],[14469,1],[14497,1],[14509,1],[14565,2],[14622,1],[14676,2],[14781,1],[14835,2],[14962,1],[15016,2],[15059,2],[15076,1],[15112,1],[15114,1],[15128,1],[15159,1],[15182,1],[15215,2],[15227,1],[15254,1],[15263,1],[15292,1],[15294,2],[15337,1],[15344,1],[15377,1],[15396,1],[15408,1],[15410,2],[15421,1],[15450,1],[15452,2],[15497,3],[15507,1],[15514,1],[15535,1],[15554,1],[15566,1],[15568,2],[15571,2],[15587,1],[15646,1],[15817,1],[15863,1],[15899,1],[15956,1],[15990,1],[16095,1],[16128,1],[16256,1],[16290,1],[16332,1],[16334,1],[16458,1],[16538,1],[16540,1],[16598,1],[16605,1],[16612,1],[16656,1],[16756,3],[16760,2],[16787,1],[16831,3],[16887,4],[16892,2],[16895,2],[16898,1],[16909,1],[17183,1],[17227,1],[17229,1],[17320,1],[17337,1],[17352,1],[17438,1],[17453,1],[17514,2],[17583,2],[17620,1],[17691,1],[17693,2],[17760,2],[17805,3],[17809,1],[17868,1],[17870,2]]},"313":{"position":[[227,1],[229,2],[260,1],[331,2],[334,2],[363,1],[437,2],[440,1]]},"327":{"position":[[1067,2]]},"329":{"position":[[18,1],[60,1],[99,1],[268,1]]},"347":{"position":[[485,1],[532,1],[534,1],[551,2],[554,1],[589,1],[601,1],[611,2],[614,2],[627,1],[637,2],[640,1],[642,2],[657,1],[672,1],[684,1],[717,1],[719,1],[736,1],[738,1],[740,2],[753,1],[786,1],[788,1],[805,1],[807,1],[809,1],[811,1],[813,1],[815,1],[817,1],[819,1],[934,1],[936,1],[1020,2],[1023,1],[1190,1]]},"349":{"position":[[93,1]]},"355":{"position":[[280,1],[327,1],[329,1],[346,2],[349,1],[384,1],[396,1],[407,1],[418,1],[420,1],[430,2],[433,2],[436,1],[457,1],[480,1],[482,1],[484,1],[486,1],[488,2],[501,1],[511,2],[514,1],[516,2],[531,1],[546,1],[558,1],[591,1],[593,1],[610,1],[612,1],[614,2],[627,1],[660,1],[662,1],[679,1],[681,1],[683,1],[685,1],[687,1],[689,1],[691,1],[693,1]]},"357":{"position":[[329,2],[401,2],[425,1],[441,1],[443,1],[470,2],[570,1],[631,2],[715,2],[895,2],[938,3],[942,2],[963,1],[973,1],[975,1],[1077,2],[1080,1],[1137,3],[1141,2],[1152,1],[1178,2],[1257,1],[1259,1],[1301,1],[1315,1],[1317,2],[1416,2],[1490,2],[1575,2],[1708,2],[1882,2],[1925,2],[1935,2],[1942,1],[1944,2],[1947,2],[1963,1],[1965,1],[1975,2],[2070,1],[2077,2],[2176,1],[2188,2],[2267,2],[2275,1],[2277,1],[2293,1],[2314,2],[2386,2],[2505,1],[2560,1],[2594,1],[2596,2],[2698,1],[2726,1],[2738,1],[2794,2],[2851,1],[2905,2],[3010,1],[3064,2],[3191,1],[3245,2],[3288,2],[3305,1],[3341,1],[3343,1],[3357,1],[3382,1],[3405,1],[3438,2],[3450,1],[3475,1],[3482,1],[3505,1],[3524,1],[3556,2],[3572,1],[3612,2],[3632,1],[3658,1],[3829,1],[3875,1],[3911,1],[3968,1],[4002,1],[4107,1],[4140,1],[4268,1],[4302,1],[4344,1],[4346,1],[4470,1],[4550,1],[4552,1],[4610,1],[4617,1],[4712,1],[4723,1],[4763,1],[4782,1],[5090,1],[5353,1],[5397,1],[5399,1],[5490,1],[5646,1],[5687,1],[5701,2],[5742,1],[5754,2],[5789,1],[5821,2],[5886,1],[5918,2]]},"363":{"position":[[577,1],[624,1],[626,1],[643,2],[646,1],[681,1],[693,1],[703,2],[706,1],[708,2],[723,1],[738,1],[750,1],[783,1],[785,1],[802,2],[805,1],[844,1],[846,1],[848,1],[850,1],[852,1],[854,2],[857,1],[888,1],[900,1],[910,2],[913,1],[915,2],[930,1],[945,1],[957,1],[990,1],[992,1],[1009,1],[1011,1],[1013,1],[1015,1],[1017,1],[1019,1],[1021,1],[1023,1],[1138,1],[1140,2],[1202,1],[1288,2],[1291,2],[1332,1],[1404,2],[1407,2],[1447,1],[1518,2],[1521,1],[1688,1]]},"365":{"position":[[93,1]]},"369":{"position":[[295,2],[367,2],[391,1],[407,1],[409,1],[436,2],[536,1],[597,2],[681,2],[861,2],[904,3],[908,2],[929,1],[939,1],[941,1],[1036,2],[1039,1],[1096,3],[1100,2],[1111,1],[1137,2],[1216,1],[1218,1],[1260,1],[1274,1],[1276,2],[1375,2],[1449,2],[1534,2],[1667,2],[1841,2],[1884,2],[1894,2],[1901,1],[1903,2],[1906,2],[1922,1],[1924,1],[1934,2],[2029,1],[2036,2],[2128,1],[2140,2],[2219,2],[2227,1],[2229,1],[2245,1],[2266,2],[2338,2],[2457,1],[2512,1],[2546,1],[2548,2],[2650,1],[2678,1],[2690,1],[2746,2],[2803,1],[2857,2],[2962,1],[3016,2],[3143,1],[3197,2],[3240,2],[3257,1],[3293,1],[3295,1],[3309,1],[3334,1],[3357,1],[3390,2],[3402,1],[3427,1],[3434,1],[3459,1],[3478,1],[3501,2],[3517,1],[3557,2],[3577,1],[3603,1],[3774,1],[3820,1],[3856,1],[3913,1],[3947,1],[4052,1],[4085,1],[4213,1],[4247,1],[4289,1],[4291,1],[4415,1],[4495,1],[4497,1],[4555,1],[4562,1],[4650,1],[4661,1],[4701,1],[4720,1],[5021,1],[5284,1],[5328,1],[5330,1],[5421,1],[5570,1],[5611,1],[5627,2],[5670,1],[5682,2],[5717,1],[5740,2],[5796,1],[5828,2],[5905,2],[5977,2],[6001,1],[6017,1],[6019,1],[6046,2],[6146,1],[6207,2],[6291,2],[6471,2],[6514,3],[6518,2],[6539,1],[6549,1],[6551,1],[6645,2],[6648,1],[6705,3],[6709,2],[6720,1],[6746,2],[6825,1],[6827,1],[6869,1],[6883,1],[6885,2],[6984,2],[7058,2],[7143,2],[7276,2],[7450,2],[7493,2],[7503,2],[7510,1],[7512,2],[7515,2],[7531,1],[7533,1],[7543,2],[7638,1],[7645,2],[7736,1],[7748,2],[7827,2],[7835,1],[7837,1],[7853,1],[7874,2],[7946,2],[8065,1],[8120,1],[8154,1],[8156,2],[8258,1],[8286,1],[8298,1],[8354,2],[8411,1],[8465,2],[8570,1],[8624,2],[8751,1],[8805,2],[8848,2],[8865,1],[8901,1],[8903,1],[8917,1],[8942,1],[8965,1],[8998,2],[9010,1],[9035,1],[9042,1],[9066,1],[9085,1],[9108,2],[9124,1],[9164,2],[9184,1],[9210,1],[9381,1],[9427,1],[9463,1],[9520,1],[9554,1],[9659,1],[9692,1],[9820,1],[9854,1],[9896,1],[9898,1],[10022,1],[10102,1],[10104,1],[10162,1],[10169,1],[10256,1],[10267,1],[10307,1],[10326,1],[10626,1],[10889,1],[10933,1],[10935,1],[11026,1],[11174,1],[11215,1],[11230,2],[11272,1],[11284,2],[11319,1],[11342,2],[11398,1],[11430,2]]},"371":{"position":[[371,1],[418,1],[420,1],[437,2],[440,1],[475,1],[488,1],[498,2],[501,2],[514,1],[524,2],[527,1],[529,2],[544,1],[559,1],[572,1],[605,1],[607,1],[624,1],[626,1],[628,2],[641,1],[674,1],[676,1],[693,2],[696,1],[735,1],[737,1],[739,1],[741,1],[743,1],[745,2],[748,1],[779,1],[791,1],[801,2],[804,1],[806,2],[821,1],[836,1],[848,1],[881,1],[883,1],[900,1],[902,1],[904,1],[906,1],[908,1],[910,1],[912,1],[914,1]]},"373":{"position":[[474,1],[521,1],[523,1],[540,2],[543,1],[578,1],[591,1],[601,2],[604,2],[617,1],[633,1],[643,1],[653,2],[656,2],[671,1],[692,1],[716,1],[718,1],[720,1],[722,1],[724,2],[739,1],[754,1],[767,1],[800,1],[802,1],[819,1],[821,1],[823,2],[836,1],[869,1],[871,1],[888,2],[891,1],[930,1],[932,1],[934,1],[936,1],[938,1],[940,2],[943,1],[974,1],[986,1],[996,2],[999,1],[1001,2],[1016,1],[1031,1],[1043,1],[1076,1],[1078,1],[1095,1],[1097,1],[1099,1],[1101,1],[1103,1],[1105,1],[1107,1],[1109,1]]},"375":{"position":[[414,2],[486,2],[510,1],[526,1],[528,1],[555,2],[655,1],[716,2],[800,2],[980,2],[1023,3],[1059,1],[1061,2],[1115,1],[1187,2],[1190,2],[1193,1],[1249,3],[1272,2],[1351,1],[1353,1],[1395,1],[1409,1],[1411,2],[1510,2],[1584,2],[1669,2],[1802,2],[1976,2],[2019,2],[2029,2],[2036,1],[2038,2],[2041,2],[2057,1],[2059,1],[2069,2],[2164,1],[2171,2],[2231,1],[2233,2],[2413,2],[2416,1],[2418,1],[2430,2],[2523,2],[2530,1],[2532,2],[2535,2],[2551,1],[2572,2],[2644,2],[2763,1],[2818,1],[2852,1],[2854,2],[2956,1],[2984,1],[2996,1],[3052,2],[3109,1],[3163,2],[3268,1],[3322,2],[3449,1],[3503,2],[3546,2],[3563,1],[3599,1],[3601,1],[3615,1],[3646,1],[3669,1],[3702,2],[3714,1],[3741,1],[3750,1],[3779,1],[3781,2],[3841,1],[3848,1],[3872,1],[3892,1],[3914,1],[3916,2],[3919,2],[3935,1],[3994,1],[4165,1],[4211,1],[4247,1],[4304,1],[4338,1],[4443,1],[4476,1],[4604,1],[4638,1],[4680,1],[4682,1],[4806,1],[4886,1],[4888,1],[4946,1],[4953,1],[4960,1],[5004,1],[5123,3],[5127,2],[5130,2],[5133,1],[5144,1],[5418,1],[5462,1],[5464,1],[5555,1],[5572,1],[5587,1],[5662,2],[6027,2],[6081,1],[6154,1],[6156,2],[6590,2],[6662,2],[6686,1],[6702,1],[6704,1],[6731,2],[6831,1],[6892,2],[6976,2],[7156,2],[7199,3],[7203,2],[7224,1],[7234,1],[7236,1],[7330,2],[7333,1],[7390,3],[7394,2],[7405,1],[7432,2],[7511,1],[7513,1],[7555,1],[7569,1],[7571,2],[7670,2],[7744,2],[7829,2],[7962,2],[8136,2],[8179,2],[8189,2],[8196,1],[8198,2],[8201,2],[8217,1],[8219,1],[8229,2],[8324,1],[8331,2],[8422,1],[8434,2],[8513,2],[8521,1],[8523,1],[8540,1],[8561,2],[8633,2],[8752,1],[8807,1],[8841,1],[8843,2],[8945,1],[8973,1],[8985,1],[9041,2],[9098,1],[9152,2],[9257,1],[9311,2],[9438,1],[9492,2],[9535,2],[9552,1],[9588,1],[9590,1],[9604,1],[9629,1],[9652,1],[9685,2],[9697,1],[9722,1],[9729,1],[9753,1],[9772,1],[9795,2],[9811,1],[9851,2],[9871,1],[9898,1],[10069,1],[10115,1],[10151,1],[10208,1],[10242,1],[10347,1],[10380,1],[10508,1],[10542,1],[10584,1],[10586,1],[10710,1],[10790,1],[10792,1],[10850,1],[10857,1],[10944,1],[10955,1],[10995,1],[11014,1],[11315,1],[11579,1],[11623,1],[11625,1],[11716,1],[11864,1],[11906,1],[11921,2],[11963,1],[11975,2],[12010,1],[12033,2],[12089,1],[12121,2],[12404,2],[12476,2],[12500,1],[12516,1],[12518,1],[12545,2],[12645,1],[12706,2],[12790,2],[12970,2],[13013,3],[13017,2],[13038,1],[13048,1],[13050,1],[13145,2],[13148,1],[13205,3],[13209,2],[13220,1],[13246,2],[13325,1],[13327,1],[13369,1],[13383,1],[13385,2],[13484,2],[13558,2],[13643,2],[13776,2],[13950,2],[13993,2],[14003,2],[14010,1],[14012,2],[14015,2],[14031,1],[14033,1],[14043,2],[14138,1],[14145,2],[14237,1],[14249,2],[14328,2],[14336,1],[14338,1],[14354,1],[14375,2],[14447,2],[14566,1],[14621,1],[14655,1],[14657,2],[14759,1],[14787,1],[14799,1],[14855,2],[14912,1],[14966,2],[15071,1],[15125,2],[15252,1],[15306,2],[15349,2],[15366,1],[15402,1],[15404,1],[15418,1],[15443,1],[15466,1],[15499,2],[15511,1],[15536,1],[15543,1],[15568,1],[15587,1],[15610,2],[15626,1],[15666,2],[15686,1],[15712,1],[15883,1],[15929,1],[15965,1],[16022,1],[16056,1],[16161,1],[16194,1],[16322,1],[16356,1],[16398,1],[16400,1],[16524,1],[16604,1],[16606,1],[16664,1],[16671,1],[16759,1],[16770,1],[16810,1],[16829,1],[17130,1],[17393,1],[17437,1],[17439,1],[17530,1],[17679,1],[17720,1],[17736,2],[17779,1],[17791,2],[17826,1],[17849,2],[17905,1],[17937,2]]},"382":{"position":[[178,1],[225,1],[227,1],[244,2],[247,1],[277,1],[289,1],[299,2],[302,1],[304,2],[319,1],[334,1],[346,1],[379,1],[381,1],[398,1],[400,1],[402,1],[404,1],[406,1],[408,2],[411,1],[446,1],[458,1],[468,2],[471,1],[473,2],[488,1],[503,1],[515,1],[548,1],[550,1],[567,2],[570,1],[608,1],[610,1],[612,1],[614,1],[616,1],[618,1],[620,1],[622,1],[683,1],[685,2],[750,1],[829,2],[832,2],[888,1],[954,2],[957,1],[1274,2],[1346,2],[1370,1],[1386,1],[1388,1],[1415,2],[1515,1],[1576,2],[1660,2],[1840,2],[1883,3],[1887,2],[1908,1],[1918,1],[1920,1],[2012,2],[2015,1],[2072,3],[2076,2],[2087,1],[2113,2],[2192,1],[2194,1],[2236,1],[2250,1],[2252,2],[2351,2],[2425,2],[2510,2],[2643,2],[2817,2],[2860,2],[2870,2],[2877,1],[2879,2],[2882,2],[2898,1],[2900,1],[2910,2],[3005,1],[3012,2],[3101,1],[3113,2],[3192,2],[3200,1],[3202,1],[3218,1],[3239,2],[3311,2],[3430,1],[3485,1],[3519,1],[3521,2],[3623,1],[3651,1],[3663,1],[3719,2],[3776,1],[3830,2],[3935,1],[3989,2],[4116,1],[4170,2],[4213,2],[4230,1],[4266,1],[4268,1],[4282,1],[4307,1],[4330,1],[4363,2],[4375,1],[4400,1],[4407,1],[4431,1],[4450,1],[4471,2],[4487,1],[4527,2],[4547,1],[4573,1],[4744,1],[4790,1],[4826,1],[4883,1],[4917,1],[5022,1],[5055,1],[5183,1],[5217,1],[5259,1],[5261,1],[5385,1],[5465,1],[5467,1],[5525,1],[5532,1],[5617,1],[5628,1],[5668,1],[5687,1],[5985,1],[6248,1],[6292,1],[6294,1],[6385,1],[6531,1],[6572,1],[6587,2],[6629,1],[6641,2],[6676,1],[6697,2],[6751,1],[6783,2]]},"384":{"position":[[181,1],[228,1],[230,1],[247,2],[250,1],[285,1],[297,1],[307,2],[310,2],[323,1],[334,1],[345,1],[347,1],[357,2],[360,2],[363,1],[384,1],[407,1],[409,1],[411,1],[413,1],[415,1],[417,2],[432,1],[447,1],[459,1],[492,1],[494,1],[511,2],[514,1],[552,1],[554,1],[556,2],[569,1],[602,1],[604,1],[621,2],[624,1],[662,1],[664,1],[666,1],[668,1],[670,1],[672,1],[674,1],[676,1],[911,1],[921,1],[931,1],[976,1],[987,1],[989,1],[1033,1],[1044,1],[1068,1],[1070,1],[1072,2],[1075,1],[1119,1],[1133,1],[1171,1],[1173,1],[1175,1],[1177,1],[1179,1],[1181,1],[1183,1],[1185,1]]},"396":{"position":[[385,1],[432,1],[434,1],[451,2],[454,1],[489,1],[501,1],[511,2],[514,2],[527,1],[537,2],[540,1],[542,2],[557,1],[572,1],[584,1],[617,1],[619,1],[636,1],[638,1],[640,2],[653,1],[686,1],[688,1],[705,1],[707,1],[709,1],[711,1],[713,1],[715,1],[717,1],[719,1]]},"402":{"position":[[208,2],[280,2],[304,1],[320,1],[322,1],[349,2],[449,1],[510,2],[594,2],[774,2],[817,3],[853,1],[855,1],[934,2],[937,2],[940,1],[996,3],[1019,2],[1098,1],[1100,1],[1142,1],[1156,1],[1158,2],[1257,2],[1331,2],[1416,2],[1549,2],[1723,2],[1766,2],[1776,2],[1783,1],[1785,2],[1788,2],[1804,1],[1806,1],[1816,2],[1911,1],[1918,2],[1978,1],[2113,2],[2116,1],[2118,1],[2130,2],[2223,2],[2230,1],[2232,2],[2235,2],[2251,1],[2272,2],[2344,2],[2463,1],[2518,1],[2552,1],[2554,2],[2656,1],[2684,1],[2696,1],[2752,2],[2809,1],[2863,2],[2968,1],[3022,2],[3149,1],[3203,2],[3246,2],[3263,1],[3299,1],[3301,1],[3315,1],[3346,1],[3369,1],[3402,2],[3414,1],[3441,1],[3450,1],[3479,1],[3487,1],[3494,1],[3517,1],[3536,1],[3567,1],[3569,2],[3572,2],[3588,1],[3647,1],[3818,1],[3864,1],[3900,1],[3957,1],[3991,1],[4096,1],[4129,1],[4257,1],[4291,1],[4333,1],[4335,1],[4459,1],[4539,1],[4541,1],[4599,1],[4606,1],[4613,1],[4730,3],[4734,2],[4737,2],[4740,1],[4751,1],[5025,1],[5069,1],[5071,1],[5162,1],[5179,1],[5194,1],[5276,2],[5648,1],[5728,1],[5730,2]]},"404":{"position":[[229,2],[301,2],[325,1],[341,1],[343,1],[370,2],[470,1],[531,2],[615,2],[795,2],[838,3],[842,2],[863,1],[873,1],[875,1],[977,2],[980,1],[1037,3],[1041,2],[1052,1],[1078,2],[1157,1],[1159,1],[1201,1],[1215,1],[1217,2],[1316,2],[1390,2],[1475,2],[1608,2],[1782,2],[1825,2],[1835,2],[1842,1],[1844,2],[1847,2],[1863,1],[1865,1],[1875,2],[1970,1],[1977,2],[2076,1],[2088,2],[2167,2],[2175,1],[2177,1],[2193,1],[2214,2],[2286,2],[2405,1],[2460,1],[2494,1],[2496,2],[2598,1],[2626,1],[2638,1],[2694,2],[2751,1],[2805,2],[2910,1],[2964,2],[3091,1],[3145,2],[3188,2],[3205,1],[3241,1],[3243,1],[3257,1],[3282,1],[3305,1],[3338,2],[3350,1],[3375,1],[3382,1],[3405,1],[3424,1],[3456,2],[3472,1],[3512,2],[3532,1],[3558,1],[3729,1],[3775,1],[3811,1],[3868,1],[3902,1],[4007,1],[4040,1],[4168,1],[4202,1],[4244,1],[4246,1],[4370,1],[4450,1],[4452,1],[4510,1],[4517,1],[4612,1],[4623,1],[4663,1],[4682,1],[4990,1],[5253,1],[5297,1],[5299,1],[5390,1],[5546,1],[5587,1],[5601,2],[5642,1],[5654,2],[5689,1],[5721,2],[5786,1],[5818,2],[6066,2],[6138,2],[6162,1],[6178,1],[6180,1],[6207,2],[6307,1],[6368,2],[6452,2],[6632,2],[6675,3],[6679,2],[6700,1],[6710,1],[6712,1],[6814,2],[6817,1],[6874,3],[6878,2],[6889,1],[6916,2],[6995,1],[6997,1],[7039,1],[7053,1],[7055,2],[7154,2],[7228,2],[7313,2],[7446,2],[7620,2],[7663,2],[7673,2],[7680,1],[7682,2],[7685,2],[7701,1],[7703,1],[7713,2],[7808,1],[7815,2],[7914,1],[7926,2],[8005,2],[8013,1],[8015,1],[8032,1],[8053,2],[8125,2],[8244,1],[8299,1],[8333,1],[8335,2],[8437,1],[8465,1],[8477,1],[8533,2],[8590,1],[8644,2],[8749,1],[8803,2],[8930,1],[8984,2],[9027,2],[9044,1],[9080,1],[9082,1],[9096,1],[9121,1],[9144,1],[9177,2],[9189,1],[9214,1],[9221,1],[9244,1],[9263,1],[9295,2],[9311,1],[9351,2],[9371,1],[9398,1],[9569,1],[9615,1],[9651,1],[9708,1],[9742,1],[9847,1],[9880,1],[10008,1],[10042,1],[10084,1],[10086,1],[10210,1],[10290,1],[10292,1],[10350,1],[10357,1],[10452,1],[10463,1],[10503,1],[10522,1],[10831,1],[11095,1],[11139,1],[11141,1],[11232,1],[11388,1],[11430,1],[11444,2],[11485,1],[11497,2],[11532,1],[11564,2],[11629,1],[11661,2]]},"408":{"position":[[897,2]]},"412":{"position":[[373,1],[375,2],[413,1],[482,2],[485,2],[532,1],[610,2],[613,2],[672,1],[752,2],[755,2],[795,1],[870,2],[873,1],[1079,1],[1081,2],[1140,1],[1217,2],[1220,1],[1797,1],[1807,1],[1833,2],[1856,1],[1858,1],[1889,2],[1892,2],[1895,1],[1927,1],[1939,1],[1949,2],[1952,1],[1954,2],[1969,1],[1984,1],[1996,1],[2029,1],[2031,1],[2048,1],[2050,1],[2052,1],[2054,1],[2056,1],[2058,2],[2061,1],[2094,1],[2106,1],[2116,2],[2119,2],[2132,1],[2143,1],[2154,1],[2156,1],[2166,2],[2169,2],[2172,1],[2192,1],[2206,1],[2218,3],[2243,2],[2265,1],[2277,3],[2302,1],[2304,1],[2306,1],[2308,1],[2310,1],[2312,1],[2314,2],[2329,1],[2344,1],[2356,1],[2389,1],[2391,1],[2410,1],[2412,1],[2414,2],[2427,1],[2460,1],[2462,1],[2479,1],[2481,1],[2483,1],[2485,1],[2487,1],[2489,2],[2492,1],[2527,1],[2539,1],[2549,2],[2552,2],[2565,1],[2575,2],[2578,2],[2593,1],[2604,1],[2615,1],[2617,1],[2638,1],[2650,3],[2675,1],[2677,2],[2680,1],[2700,1],[2714,1],[2726,3],[2751,2],[2773,1],[2785,3],[2810,1],[2812,1],[2814,1],[2816,1],[2818,1],[2820,1],[2822,2],[2837,1],[2852,1],[2864,1],[2897,1],[2899,1],[2918,1],[2920,1],[2922,2],[2935,1],[2968,1],[2970,1],[2987,1],[2989,1],[2991,2],[3006,1],[3039,2],[3042,1],[3044,1],[3046,1],[3048,1],[3050,2],[3077,1]]},"414":{"position":[[104,1],[106,2],[148,1],[212,2],[215,1],[505,1],[527,1],[529,1],[560,2],[563,1],[565,1],[567,1],[617,1],[619,2],[666,1],[735,2],[738,1]]},"416":{"position":[[92,1],[94,1],[163,2],[166,1],[244,2],[247,1],[322,2],[325,1],[447,1],[449,1],[529,2],[532,1],[1645,1],[1667,1],[1669,1],[1700,2],[1703,2],[1706,1],[1738,1],[1750,1],[1760,2],[1763,1],[1765,2],[1780,1],[1795,1],[1807,1],[1840,1],[1842,1],[1859,1],[1861,1],[1863,1],[1865,1],[1867,1],[1869,2],[1872,1],[1905,1],[1917,1],[1927,2],[1930,2],[1943,1],[1954,1],[1965,1],[1967,1],[1977,2],[1980,2],[1983,1],[2003,1],[2017,1],[2029,3],[2054,2],[2076,1],[2088,3],[2113,1],[2115,1],[2117,1],[2119,1],[2121,1],[2123,1],[2125,2],[2140,1],[2155,1],[2167,1],[2200,1],[2202,1],[2221,1],[2223,1],[2225,2],[2238,1],[2271,1],[2273,1],[2290,2],[2293,1],[2333,1],[2335,1],[2337,1],[2339,1],[2341,1],[2343,2],[2346,1],[2381,1],[2393,1],[2403,2],[2406,2],[2419,1],[2429,2],[2432,2],[2447,1],[2458,1],[2469,1],[2471,1],[2492,1],[2504,3],[2529,1],[2531,2],[2534,1],[2554,1],[2568,1],[2580,3],[2605,2],[2627,1],[2639,3],[2664,1],[2666,1],[2668,1],[2670,1],[2672,1],[2674,1],[2676,2],[2691,1],[2706,1],[2718,1],[2751,1],[2753,1],[2772,1],[2774,1],[2776,2],[2789,1],[2822,1],[2824,1],[2841,2],[2844,1],[2884,1],[2886,1],[2888,2],[2903,1],[2936,2],[2939,1],[2941,1],[2943,1],[2945,1],[2947,2],[2974,1],[3094,1],[3096,2],[3162,1],[3242,2],[3245,1]]},"418":{"position":[[144,1],[146,2],[197,1],[207,4],[264,2],[267,1],[853,1],[875,1],[877,1],[908,2],[911,2],[914,1],[949,1],[961,1],[971,2],[974,1],[976,2],[991,1],[1006,1],[1018,1],[1051,1],[1053,1],[1070,2],[1073,1],[1103,2],[1106,1],[1108,1],[1110,1],[1112,1],[1114,1],[1116,1],[1118,2],[1145,1],[1224,1],[1226,2],[1294,1],[1366,2],[1369,1],[1838,2],[1900,1],[1902,1],[2098,1],[2100,4],[2169,1],[2171,2],[2239,1],[2311,2],[2314,1],[2338,1],[2713,1],[2762,1],[2764,2],[2943,1],[2945,2],[3011,2],[3258,1]]},"422":{"position":[[1012,2],[1249,1],[1251,1],[1332,2],[1335,2],[1338,1],[1394,3],[1406,2],[1501,1],[1508,2],[1568,1],[1705,2],[1708,1],[1710,1],[1722,2],[1815,2],[1822,1],[1824,2],[1827,2],[1843,1],[1857,1],[1888,1],[1911,1],[1944,2],[1956,1],[1983,1],[1992,1],[2021,1],[2029,1],[2036,1],[2072,1],[2091,1],[2111,1],[2113,2],[2116,2],[2132,1],[2180,1],[2182,1],[2240,1],[2247,1],[2254,1],[2373,3],[2377,2],[2380,2],[2383,1],[2394,1],[2490,1],[2534,1],[2536,1],[2627,1],[2644,1],[2659,1],[2743,2],[2939,1],[3021,1],[3023,2]]},"430":{"position":[[605,1],[652,1],[654,1],[671,2],[674,1],[715,1],[727,1],[738,1],[749,1],[751,1],[761,2],[764,2],[767,1],[788,1],[811,1],[813,1],[815,1],[817,1],[819,2],[832,1],[842,2],[845,1],[847,2],[862,1],[877,1],[889,1],[922,1],[924,1],[941,1],[943,1],[945,2],[958,1],[991,1],[993,1],[1010,1],[1012,1],[1014,1],[1016,1],[1018,1],[1020,1],[1022,1],[1024,1],[1199,1],[1381,1],[1392,1]]},"434":{"position":[[93,1]]},"436":{"position":[[139,1]]},"442":{"position":[[459,1],[506,1],[508,1],[525,2],[528,1],[569,1],[581,1],[592,1],[603,1],[605,1],[615,2],[618,2],[621,1],[642,1],[665,1],[667,1],[669,1],[671,1],[673,2],[686,1],[696,2],[699,1],[701,2],[716,1],[731,1],[743,1],[776,1],[778,1],[795,2],[798,1],[839,1],[841,1],[843,2],[856,1],[889,1],[891,1],[908,2],[911,1],[952,1],[954,1],[956,1],[958,1],[960,1],[962,2],[965,1],[996,1],[1010,1],[1020,2],[1023,1],[1025,2],[1040,1],[1055,1],[1069,1],[1102,1],[1104,1],[1121,1],[1123,1],[1125,1],[1127,1],[1129,1],[1131,1],[1133,1],[1135,1]]},"444":{"position":[[277,2],[349,2],[373,1],[389,1],[391,1],[418,2],[518,1],[579,2],[663,2],[843,2],[886,3],[922,1],[924,2],[967,1],[1041,2],[1083,1],[1156,2],[1159,2],[1162,1],[1218,3],[1241,2],[1320,1],[1322,1],[1364,1],[1378,1],[1380,2],[1479,2],[1553,2],[1638,2],[1771,2],[1945,2],[1988,2],[1998,2],[2005,1],[2007,2],[2010,2],[2026,1],[2028,1],[2038,2],[2133,1],[2140,2],[2200,1],[2202,2],[2373,2],[2376,1],[2378,2],[2547,2],[2550,1],[2552,1],[2564,2],[2657,2],[2664,1],[2666,2],[2669,2],[2685,1],[2706,2],[2778,2],[2897,1],[2952,1],[2986,1],[2988,2],[3090,1],[3118,1],[3130,1],[3186,2],[3243,1],[3297,2],[3402,1],[3456,2],[3583,1],[3637,2],[3680,2],[3697,1],[3733,1],[3735,1],[3749,1],[3780,1],[3803,1],[3836,2],[3848,1],[3875,1],[3884,1],[3913,1],[3915,2],[3964,1],[3971,1],[3995,1],[4016,1],[4039,2],[4042,2],[4090,1],[4097,1],[4121,1],[4142,1],[4164,1],[4166,2],[4169,2],[4185,1],[4244,1],[4415,1],[4461,1],[4497,1],[4554,1],[4588,1],[4693,1],[4726,1],[4854,1],[4888,1],[4930,1],[4932,1],[5056,1],[5136,1],[5138,1],[5196,1],[5203,1],[5210,1],[5254,1],[5364,2],[5380,1],[5488,3],[5492,2],[5495,2],[5498,1],[5509,1],[5783,1],[5827,1],[5829,1],[5920,1],[5937,1],[5952,1],[6101,2],[6587,2],[6630,1],[6705,2],[6708,2],[6750,1],[6824,1],[6826,2],[7031,2],[7103,2],[7127,1],[7143,1],[7145,1],[7172,2],[7272,1],[7333,2],[7417,2],[7597,2],[7640,3],[7644,2],[7665,1],[7675,1],[7677,1],[7774,2],[7777,1],[7834,3],[7838,2],[7849,1],[7875,2],[7954,1],[7956,1],[7998,1],[8012,1],[8014,2],[8113,2],[8187,2],[8272,2],[8405,2],[8579,2],[8622,2],[8632,2],[8639,1],[8641,2],[8644,2],[8660,1],[8662,1],[8672,2],[8767,1],[8774,2],[8868,1],[8880,2],[8959,2],[8967,1],[8969,1],[8985,1],[9006,2],[9078,2],[9197,1],[9252,1],[9286,1],[9288,2],[9390,1],[9418,1],[9430,1],[9486,2],[9543,1],[9597,2],[9702,1],[9756,2],[9883,1],[9937,2],[9980,2],[9997,1],[10033,1],[10035,1],[10049,1],[10074,1],[10097,1],[10130,2],[10142,1],[10167,1],[10174,1],[10198,1],[10219,1],[10243,2],[10259,1],[10299,2],[10319,1],[10345,1],[10516,1],[10562,1],[10598,1],[10655,1],[10689,1],[10794,1],[10827,1],[10955,1],[10989,1],[11031,1],[11033,1],[11157,1],[11237,1],[11239,1],[11297,1],[11304,1],[11394,1],[11405,1],[11445,1],[11464,1],[11767,1],[12030,1],[12074,1],[12076,1],[12167,1],[12318,1],[12359,1],[12374,2],[12416,1],[12430,2],[12467,1],[12491,2],[12548,1],[12580,2]]},"446":{"position":[[179,2],[251,2],[275,1],[291,1],[293,1],[320,2],[420,1],[481,2],[565,2],[745,2],[788,3],[824,1],[826,2],[905,1],[997,2],[1077,1],[1168,2],[1171,2],[1174,1],[1230,3],[1253,2],[1332,1],[1334,1],[1376,1],[1390,1],[1392,2],[1491,2],[1565,2],[1650,2],[1783,2],[1957,2],[2000,2],[2010,2],[2017,1],[2019,2],[2022,2],[2038,1],[2040,1],[2050,2],[2145,1],[2152,2],[2212,1],[2214,2],[2439,2],[2442,1],[2444,2],[2669,2],[2672,1],[2674,1],[2686,2],[2779,2],[2786,1],[2788,2],[2791,2],[2807,1],[2828,2],[2900,2],[3019,1],[3074,1],[3108,1],[3110,2],[3212,1],[3240,1],[3252,1],[3308,2],[3365,1],[3419,2],[3524,1],[3578,2],[3705,1],[3759,2],[3802,2],[3819,1],[3855,1],[3857,1],[3871,1],[3902,1],[3925,1],[3958,2],[3970,1],[3997,1],[4006,1],[4035,1],[4037,2],[4122,1],[4129,1],[4171,1],[4190,1],[4215,2],[4218,2],[4304,1],[4311,1],[4352,1],[4371,1],[4396,1],[4398,2],[4401,2],[4417,1],[4476,1],[4647,1],[4693,1],[4729,1],[4786,1],[4820,1],[4925,1],[4958,1],[5086,1],[5120,1],[5162,1],[5164,1],[5288,1],[5368,1],[5370,1],[5428,1],[5435,1],[5442,1],[5486,1],[5650,2],[5666,1],[5830,3],[5834,2],[5837,2],[5840,1],[5851,1],[6125,1],[6169,1],[6171,1],[6262,1],[6279,1],[6294,1],[6479,2],[7001,2],[7080,1],[7173,2],[7176,2],[7256,1],[7348,1],[7350,2]]},"448":{"position":[[125,2],[197,2],[221,1],[237,1],[239,1],[266,2],[366,1],[427,2],[511,2],[691,2],[734,3],[738,2],[759,1],[769,1],[771,1],[868,2],[871,1],[928,3],[932,2],[943,1],[969,2],[1048,1],[1050,1],[1092,1],[1106,1],[1108,2],[1207,2],[1281,2],[1366,2],[1499,2],[1673,2],[1716,2],[1726,2],[1733,1],[1735,2],[1738,2],[1754,1],[1756,1],[1766,2],[1861,1],[1868,2],[1962,1],[1974,2],[2053,2],[2061,1],[2063,1],[2079,1],[2100,2],[2172,2],[2291,1],[2346,1],[2380,1],[2382,2],[2484,1],[2512,1],[2524,1],[2580,2],[2637,1],[2691,2],[2796,1],[2850,2],[2977,1],[3031,2],[3074,2],[3091,1],[3127,1],[3129,1],[3143,1],[3168,1],[3191,1],[3224,2],[3236,1],[3261,1],[3268,1],[3292,1],[3311,1],[3337,2],[3353,1],[3393,2],[3413,1],[3439,1],[3610,1],[3656,1],[3692,1],[3749,1],[3783,1],[3888,1],[3921,1],[4049,1],[4083,1],[4125,1],[4127,1],[4251,1],[4331,1],[4333,1],[4391,1],[4398,1],[4488,1],[4499,1],[4539,1],[4558,1],[4861,1],[5124,1],[5168,1],[5170,1],[5261,1],[5412,1],[5453,1],[5468,2],[5510,1],[5522,2],[5557,1],[5583,2],[5642,1],[5674,2]]},"454":{"position":[[878,1],[925,1],[927,1],[944,2],[947,1],[982,1],[993,1],[1003,2],[1006,2],[1019,1],[1029,2],[1032,2],[1048,1],[1069,1],[1081,3],[1106,1],[1108,1],[1110,2],[1125,1],[1140,1],[1151,1],[1184,1],[1186,1],[1211,1],[1213,1],[1215,2],[1228,1],[1261,1],[1263,1],[1280,1],[1282,1],[1284,1],[1286,1],[1288,1],[1290,2],[1293,1],[1332,1],[1344,1],[1354,2],[1357,1],[1359,2],[1374,1],[1389,1],[1401,1],[1434,1],[1436,1],[1453,1],[1455,1],[1457,1],[1459,1],[1461,1],[1463,1],[1465,1],[1467,1],[1582,1],[1584,2],[1638,1],[1720,2],[1723,2],[1769,1],[1846,2],[1849,2],[1894,1],[1970,2],[1973,2],[2018,1],[2094,2],[2097,2],[2141,1],[2216,2],[2219,1],[2526,1],[2676,1]]},"456":{"position":[[114,1]]},"458":{"position":[[116,1]]},"462":{"position":[[295,2],[367,2],[391,1],[407,1],[409,1],[436,2],[536,1],[597,2],[681,2],[861,2],[904,3],[908,2],[929,1],[939,1],[941,1],[1039,2],[1042,1],[1099,3],[1103,2],[1114,1],[1140,2],[1219,1],[1221,1],[1263,1],[1277,1],[1279,2],[1378,2],[1452,2],[1537,2],[1670,2],[1844,2],[1887,2],[1897,2],[1904,1],[1906,2],[1909,2],[1925,1],[1927,1],[1937,2],[2032,1],[2039,2],[2134,1],[2146,2],[2225,2],[2233,1],[2235,1],[2251,1],[2272,2],[2344,2],[2463,1],[2518,1],[2552,1],[2554,2],[2656,1],[2684,1],[2696,1],[2752,2],[2809,1],[2863,2],[2968,1],[3022,2],[3149,1],[3203,2],[3246,2],[3263,1],[3299,1],[3301,1],[3315,1],[3340,1],[3363,1],[3396,2],[3408,1],[3433,1],[3440,1],[3465,1],[3487,1],[3510,2],[3526,1],[3566,2],[3586,1],[3612,1],[3783,1],[3829,1],[3865,1],[3922,1],[3956,1],[4061,1],[4094,1],[4222,1],[4256,1],[4298,1],[4300,1],[4424,1],[4504,1],[4506,1],[4564,1],[4571,1],[4662,1],[4673,1],[4713,1],[4732,1],[5036,1],[5299,1],[5343,1],[5345,1],[5436,1],[5588,1],[5629,1],[5645,2],[5688,1],[5703,2],[5741,1],[5764,2],[5820,1],[5852,2],[5929,2],[6001,2],[6025,1],[6041,1],[6043,1],[6070,2],[6170,1],[6231,2],[6315,2],[6495,2],[6538,3],[6542,2],[6563,1],[6573,1],[6575,1],[6672,2],[6675,1],[6732,3],[6736,2],[6747,1],[6773,2],[6852,1],[6854,1],[6896,1],[6910,1],[6912,2],[7011,2],[7085,2],[7170,2],[7303,2],[7477,2],[7520,2],[7530,2],[7537,1],[7539,2],[7542,2],[7558,1],[7560,1],[7570,2],[7665,1],[7672,2],[7766,1],[7778,2],[7857,2],[7865,1],[7867,1],[7883,1],[7904,2],[7976,2],[8095,1],[8150,1],[8184,1],[8186,2],[8288,1],[8316,1],[8328,1],[8384,2],[8441,1],[8495,2],[8600,1],[8654,2],[8781,1],[8835,2],[8878,2],[8895,1],[8931,1],[8933,1],[8947,1],[8972,1],[8995,1],[9028,2],[9040,1],[9065,1],[9072,1],[9096,1],[9118,1],[9141,2],[9157,1],[9197,2],[9217,1],[9243,1],[9414,1],[9460,1],[9496,1],[9553,1],[9587,1],[9692,1],[9725,1],[9853,1],[9887,1],[9929,1],[9931,1],[10055,1],[10135,1],[10137,1],[10195,1],[10202,1],[10292,1],[10303,1],[10343,1],[10362,1],[10665,1],[10928,1],[10972,1],[10974,1],[11065,1],[11216,1],[11257,1],[11272,2],[11314,1],[11329,2],[11367,1],[11390,2],[11446,1],[11478,2]]},"464":{"position":[[409,1],[456,1],[458,1],[475,2],[478,1],[513,1],[524,1],[534,2],[537,2],[550,1],[560,2],[563,2],[579,1],[600,1],[612,3],[637,1],[639,2],[656,1],[674,1],[685,1],[687,1],[708,1],[720,3],[745,1],[747,2],[750,1],[770,1],[784,1],[796,3],[820,2],[842,1],[854,3],[879,1],[881,1],[883,1],[885,1],[887,1],[889,1],[891,2],[906,1],[921,1],[932,1],[965,1],[967,1],[992,1],[994,1],[996,2],[1009,1],[1042,1],[1044,1],[1061,1],[1063,1],[1065,1],[1067,1],[1069,1],[1071,2],[1074,1],[1113,1],[1125,1],[1135,2],[1138,1],[1140,2],[1155,1],[1170,1],[1182,1],[1215,1],[1217,1],[1234,1],[1236,1],[1238,1],[1240,1],[1242,1],[1244,1],[1246,1],[1248,1]]},"466":{"position":[[255,2],[327,2],[351,1],[367,1],[369,1],[396,2],[496,1],[557,2],[641,2],[821,2],[864,3],[868,2],[889,1],[899,1],[901,1],[1000,2],[1003,1],[1060,3],[1064,2],[1075,1],[1101,2],[1180,1],[1182,1],[1224,1],[1238,1],[1240,2],[1339,2],[1413,2],[1498,2],[1631,2],[1805,2],[1848,2],[1858,2],[1865,1],[1867,2],[1870,2],[1886,1],[1888,1],[1898,2],[1993,1],[2000,2],[2096,1],[2108,2],[2187,2],[2195,1],[2197,1],[2213,1],[2234,2],[2306,2],[2425,1],[2480,1],[2514,1],[2516,2],[2618,1],[2646,1],[2658,1],[2714,2],[2771,1],[2825,2],[2930,1],[2984,2],[3111,1],[3165,2],[3208,2],[3225,1],[3261,1],[3263,1],[3277,1],[3302,1],[3325,1],[3358,2],[3370,1],[3395,1],[3402,1],[3427,1],[3450,1],[3473,2],[3489,1],[3529,2],[3549,1],[3575,1],[3746,1],[3792,1],[3828,1],[3885,1],[3919,1],[4024,1],[4057,1],[4185,1],[4219,1],[4261,1],[4263,1],[4387,1],[4467,1],[4469,1],[4527,1],[4534,1],[4626,1],[4637,1],[4677,1],[4696,1],[5001,1],[5264,1],[5308,1],[5310,1],[5401,1],[5554,1],[5595,1],[5611,2],[5654,1],[5670,2],[5709,1],[5732,2],[5788,1],[5820,2],[6054,2],[6126,2],[6150,1],[6166,1],[6168,1],[6195,2],[6295,1],[6356,2],[6440,2],[6620,2],[6663,3],[6667,2],[6688,1],[6698,1],[6700,1],[6798,2],[6801,1],[6858,3],[6862,2],[6873,1],[6900,2],[6979,1],[6981,1],[7023,1],[7037,1],[7039,2],[7138,2],[7212,2],[7297,2],[7430,2],[7604,2],[7647,2],[7657,2],[7664,1],[7666,2],[7669,2],[7685,1],[7687,1],[7697,2],[7792,1],[7799,2],[7894,1],[7906,2],[7985,2],[7993,1],[7995,1],[8012,1],[8033,2],[8105,2],[8224,1],[8279,1],[8313,1],[8315,2],[8417,1],[8445,1],[8457,1],[8513,2],[8570,1],[8624,2],[8729,1],[8783,2],[8910,1],[8964,2],[9007,2],[9024,1],[9060,1],[9062,1],[9076,1],[9101,1],[9124,1],[9157,2],[9169,1],[9194,1],[9201,1],[9225,1],[9248,1],[9271,2],[9287,1],[9327,2],[9347,1],[9374,1],[9545,1],[9591,1],[9627,1],[9684,1],[9718,1],[9823,1],[9856,1],[9984,1],[10018,1],[10060,1],[10062,1],[10186,1],[10266,1],[10268,1],[10326,1],[10333,1],[10424,1],[10435,1],[10475,1],[10494,1],[10799,1],[11063,1],[11107,1],[11109,1],[11200,1],[11352,1],[11394,1],[11409,2],[11451,1],[11467,2],[11506,1],[11529,2],[11585,1],[11617,2]]},"476":{"position":[[1269,3]]},"478":{"position":[[284,3],[2135,3],[2620,1]]},"482":{"position":[[1341,1],[1408,1],[2547,1],[4057,1],[4121,1],[4738,1],[4803,1],[5064,1],[5066,1],[5150,2],[5153,1],[6360,1],[6427,1],[6429,1],[6495,1]]},"484":{"position":[[1647,1],[1761,1],[1878,1],[2019,1],[2147,1],[2286,1]]},"492":{"position":[[454,1],[501,1],[503,1],[520,2],[523,1],[556,1],[568,1],[578,2],[581,1],[583,2],[598,1],[613,1],[625,1],[658,1],[660,1],[677,1],[679,1],[681,1],[683,1],[685,1],[687,2],[690,1],[725,1],[737,1],[747,2],[750,1],[752,2],[767,1],[782,1],[794,1],[827,1],[829,1],[846,1],[848,1],[850,1],[852,1],[854,1],[856,1],[858,1],[860,1],[1061,1]]},"494":{"position":[[134,1]]},"500":{"position":[[460,1],[507,1],[509,1],[526,2],[529,1],[562,1],[574,1],[584,2],[587,1],[589,2],[604,1],[619,1],[631,1],[664,1],[666,1],[683,1],[685,1],[687,1],[689,1],[691,1],[693,2],[696,1],[731,1],[743,1],[753,2],[756,2],[769,1],[779,2],[782,1],[784,2],[799,1],[814,1],[826,1],[859,1],[861,1],[880,1],[882,1],[884,2],[897,1],[930,1],[932,1],[949,1],[951,1],[953,1],[955,1],[957,1],[959,1],[961,1],[963,1]]},"502":{"position":[[286,1],[333,1],[335,1],[352,2],[355,1],[388,1],[400,1],[410,2],[413,1],[415,2],[430,1],[445,1],[457,1],[490,1],[492,1],[509,1],[511,1],[513,1],[515,1],[517,1],[519,2],[522,1],[557,1],[569,1],[579,2],[582,2],[595,1],[606,1],[617,1],[619,1],[629,2],[632,2],[635,1],[655,1],[669,1],[692,2],[714,1],[737,1],[739,1],[741,1],[743,1],[745,1],[747,1],[749,2],[764,1],[779,1],[791,1],[824,1],[826,1],[845,1],[847,1],[849,2],[862,1],[895,1],[897,1],[914,1],[916,1],[918,1],[920,1],[922,1],[924,1],[926,1],[928,1]]},"504":{"position":[[183,2],[255,2],[279,1],[295,1],[297,1],[324,2],[424,1],[485,2],[569,2],[749,2],[792,3],[828,1],[830,1],[895,2],[898,2],[901,1],[957,3],[980,2],[1059,1],[1061,1],[1103,1],[1117,1],[1119,2],[1218,2],[1292,2],[1377,2],[1510,2],[1684,2],[1727,2],[1737,2],[1744,1],[1746,2],[1749,2],[1765,1],[1767,1],[1777,2],[1872,1],[1879,2],[1939,1],[2060,2],[2063,1],[2065,1],[2077,2],[2170,2],[2177,1],[2179,2],[2182,2],[2198,1],[2219,2],[2291,2],[2410,1],[2465,1],[2499,1],[2501,2],[2603,1],[2631,1],[2643,1],[2699,2],[2756,1],[2810,2],[2915,1],[2969,2],[3096,1],[3150,2],[3193,2],[3210,1],[3246,1],[3248,1],[3262,1],[3293,1],[3316,1],[3349,2],[3361,1],[3388,1],[3397,1],[3426,1],[3434,1],[3441,1],[3464,1],[3483,1],[3500,1],[3502,2],[3505,2],[3521,1],[3580,1],[3751,1],[3797,1],[3833,1],[3890,1],[3924,1],[4029,1],[4062,1],[4190,1],[4224,1],[4266,1],[4268,1],[4392,1],[4472,1],[4474,1],[4532,1],[4539,1],[4546,1],[4649,3],[4653,2],[4656,2],[4659,1],[4670,1],[4944,1],[4988,1],[4990,1],[5081,1],[5098,1],[5113,1],[5181,2],[5539,1],[5605,1],[5607,2]]},"506":{"position":[[185,2],[257,2],[281,1],[297,1],[299,1],[326,2],[426,1],[487,2],[571,2],[751,2],[794,3],[830,1],[832,2],[894,1],[977,2],[980,2],[983,1],[1039,3],[1062,2],[1141,1],[1143,1],[1185,1],[1199,1],[1201,2],[1300,2],[1374,2],[1459,2],[1592,2],[1766,2],[1809,2],[1819,2],[1826,1],[1828,2],[1831,2],[1847,1],[1849,1],[1859,2],[1954,1],[1961,2],[2021,1],[2023,2],[2222,2],[2225,1],[2227,1],[2239,2],[2332,2],[2339,1],[2341,2],[2344,2],[2360,1],[2381,2],[2453,2],[2572,1],[2627,1],[2661,1],[2663,2],[2765,1],[2793,1],[2805,1],[2861,2],[2918,1],[2972,2],[3077,1],[3131,2],[3258,1],[3312,2],[3355,2],[3372,1],[3408,1],[3410,1],[3424,1],[3455,1],[3478,1],[3511,2],[3523,1],[3550,1],[3559,1],[3588,1],[3590,2],[3658,1],[3665,1],[3692,1],[3711,1],[3742,1],[3744,2],[3747,2],[3763,1],[3822,1],[3993,1],[4039,1],[4075,1],[4132,1],[4166,1],[4271,1],[4304,1],[4432,1],[4466,1],[4508,1],[4510,1],[4634,1],[4714,1],[4716,1],[4774,1],[4781,1],[4788,1],[4832,1],[4970,3],[4974,2],[4977,2],[4980,1],[4991,1],[5265,1],[5309,1],[5311,1],[5402,1],[5419,1],[5434,1],[5520,2],[5896,2],[5958,1],[6042,1],[6044,2]]},"508":{"position":[[302,2],[374,2],[398,1],[414,1],[416,1],[443,2],[543,1],[604,2],[688,2],[868,2],[911,3],[915,2],[936,1],[946,1],[948,1],[1050,2],[1053,1],[1110,3],[1114,2],[1125,1],[1151,2],[1230,1],[1232,1],[1274,1],[1288,1],[1290,2],[1389,2],[1463,2],[1548,2],[1681,2],[1855,2],[1898,2],[1908,2],[1915,1],[1917,2],[1920,2],[1936,1],[1938,1],[1948,2],[2043,1],[2050,2],[2149,1],[2161,2],[2240,2],[2248,1],[2250,1],[2266,1],[2287,2],[2359,2],[2478,1],[2533,1],[2567,1],[2569,2],[2671,1],[2699,1],[2711,1],[2767,2],[2824,1],[2878,2],[2983,1],[3037,2],[3164,1],[3218,2],[3261,2],[3278,1],[3314,1],[3316,1],[3330,1],[3355,1],[3378,1],[3411,2],[3423,1],[3448,1],[3455,1],[3478,1],[3497,1],[3529,2],[3545,1],[3585,2],[3605,1],[3631,1],[3802,1],[3848,1],[3884,1],[3941,1],[3975,1],[4080,1],[4113,1],[4241,1],[4275,1],[4317,1],[4319,1],[4443,1],[4523,1],[4525,1],[4583,1],[4590,1],[4685,1],[4696,1],[4736,1],[4755,1],[5063,1],[5326,1],[5370,1],[5372,1],[5463,1],[5619,1],[5660,1],[5674,2],[5715,1],[5727,2],[5762,1],[5794,2],[5859,1],[5891,2],[6702,2]]},"514":{"position":[[359,1],[406,1],[408,1],[425,2],[428,1],[463,1],[473,1],[483,2],[486,1],[488,2],[503,1],[518,1],[528,1],[561,1],[563,1],[580,2],[583,1],[613,2],[616,1],[618,1],[620,1],[622,1],[624,1],[626,1],[628,1],[630,1],[831,1]]},"516":{"position":[[134,1]]},"522":{"position":[[369,2],[441,2],[465,1],[481,1],[483,1],[510,2],[610,1],[671,2],[755,2],[935,2],[978,3],[1014,1],[1016,2],[1060,1],[1133,2],[1136,2],[1139,1],[1195,3],[1218,2],[1297,1],[1299,1],[1341,1],[1355,1],[1357,2],[1456,2],[1530,2],[1615,2],[1748,2],[1922,2],[1965,2],[1975,2],[1982,1],[1984,2],[1987,2],[2003,1],[2005,1],[2015,2],[2110,1],[2117,2],[2177,1],[2179,2],[2350,2],[2353,1],[2355,1],[2367,2],[2460,2],[2467,1],[2469,2],[2472,2],[2488,1],[2509,2],[2581,2],[2700,1],[2755,1],[2789,1],[2791,2],[2893,1],[2921,1],[2933,1],[2989,2],[3046,1],[3100,2],[3205,1],[3259,2],[3386,1],[3440,2],[3483,2],[3500,1],[3536,1],[3538,1],[3552,1],[3583,1],[3606,1],[3639,2],[3651,1],[3678,1],[3687,1],[3716,1],[3718,2],[3768,1],[3775,1],[3796,1],[3813,1],[3842,1],[3844,2],[3847,2],[3863,1],[3922,1],[4093,1],[4139,1],[4175,1],[4232,1],[4266,1],[4371,1],[4404,1],[4532,1],[4566,1],[4608,1],[4610,1],[4734,1],[4814,1],[4816,1],[4874,1],[4881,1],[4888,1],[4932,1],[5042,3],[5046,2],[5049,2],[5052,1],[5063,1],[5337,1],[5381,1],[5383,1],[5474,1],[5491,1],[5506,1],[5582,2],[5948,2],[5992,1],[6066,1],[6068,2],[6327,1],[6329,2],[6477,1],[6543,2],[6546,1],[6675,1],[6677,2],[6852,1],[6936,2],[6939,1]]},"524":{"position":[[119,1],[137,1],[434,2],[506,2],[530,1],[546,1],[548,1],[575,2],[675,1],[736,2],[820,2],[1000,2],[1043,3],[1047,2],[1068,1],[1078,1],[1080,1],[1178,2],[1181,1],[1238,3],[1242,2],[1253,1],[1279,2],[1358,1],[1360,1],[1402,1],[1416,1],[1418,2],[1517,2],[1591,2],[1676,2],[1809,2],[1983,2],[2026,2],[2036,2],[2043,1],[2045,2],[2048,2],[2064,1],[2066,1],[2076,2],[2171,1],[2178,2],[2273,1],[2285,2],[2364,2],[2372,1],[2374,1],[2390,1],[2411,2],[2483,2],[2602,1],[2657,1],[2691,1],[2693,2],[2795,1],[2823,1],[2835,1],[2891,2],[2948,1],[3002,2],[3107,1],[3161,2],[3288,1],[3342,2],[3385,2],[3402,1],[3438,1],[3440,1],[3454,1],[3479,1],[3502,1],[3535,2],[3547,1],[3572,1],[3579,1],[3602,1],[3619,1],[3649,2],[3665,1],[3705,2],[3725,1],[3751,1],[3922,1],[3968,1],[4004,1],[4061,1],[4095,1],[4200,1],[4233,1],[4361,1],[4395,1],[4437,1],[4439,1],[4563,1],[4643,1],[4645,1],[4703,1],[4710,1],[4801,1],[4812,1],[4852,1],[4871,1],[5175,1],[5438,1],[5482,1],[5484,1],[5575,1],[5727,1],[5768,1],[5782,2],[5823,1],[5833,2],[5866,1],[5896,2],[5959,1],[5991,2]]},"530":{"position":[[368,1],[415,1],[417,1],[434,2],[437,1],[472,1],[484,1],[494,2],[497,1],[499,2],[514,1],[529,1],[541,1],[574,1],[576,1],[593,1],[595,1],[597,1],[599,1],[601,1],[603,1],[605,1],[607,1],[808,1]]},"532":{"position":[[134,1]]},"538":{"position":[[296,1],[343,1],[345,1],[362,2],[365,1],[400,1],[412,1],[422,2],[425,1],[427,2],[442,1],[457,1],[469,1],[502,1],[504,1],[543,1],[545,1],[547,1],[549,1],[551,1],[553,2],[556,1],[587,1],[599,1],[609,2],[612,1],[614,2],[629,1],[644,1],[656,1],[689,1],[691,1],[708,1],[710,1],[712,1],[714,1],[716,1],[718,1],[720,1],[722,1]]},"540":{"position":[[192,2],[264,2],[288,1],[304,1],[306,1],[333,2],[433,1],[494,2],[578,2],[758,2],[801,3],[837,1],[839,1],[906,2],[909,2],[912,1],[968,3],[991,2],[1070,1],[1072,1],[1114,1],[1128,1],[1130,2],[1229,2],[1303,2],[1388,2],[1521,2],[1695,2],[1738,2],[1748,2],[1755,1],[1757,2],[1760,2],[1776,1],[1778,1],[1788,2],[1883,1],[1890,2],[1950,1],[2073,2],[2076,1],[2078,1],[2090,2],[2183,2],[2190,1],[2192,2],[2195,2],[2211,1],[2232,2],[2304,2],[2423,1],[2478,1],[2512,1],[2514,2],[2616,1],[2644,1],[2656,1],[2712,2],[2769,1],[2823,2],[2928,1],[2982,2],[3109,1],[3163,2],[3206,2],[3223,1],[3259,1],[3261,1],[3275,1],[3306,1],[3329,1],[3362,2],[3374,1],[3401,1],[3410,1],[3439,1],[3447,1],[3454,1],[3479,1],[3498,1],[3515,1],[3517,2],[3520,2],[3536,1],[3595,1],[3766,1],[3812,1],[3848,1],[3905,1],[3939,1],[4044,1],[4077,1],[4205,1],[4239,1],[4281,1],[4283,1],[4407,1],[4487,1],[4489,1],[4547,1],[4554,1],[4561,1],[4666,3],[4670,2],[4673,2],[4676,1],[4687,1],[4961,1],[5005,1],[5007,1],[5098,1],[5115,1],[5130,1],[5200,2],[5560,1],[5628,1],[5630,2]]},"542":{"position":[[525,2],[597,2],[621,1],[637,1],[639,1],[666,2],[766,1],[827,2],[911,2],[1091,2],[1134,3],[1170,1],[1172,2],[1226,1],[1316,2],[1319,2],[1322,1],[1378,3],[1401,2],[1480,1],[1482,1],[1524,1],[1538,1],[1540,2],[1639,2],[1713,2],[1798,2],[1931,2],[2105,2],[2148,2],[2158,2],[2165,1],[2167,2],[2170,2],[2186,1],[2188,1],[2198,2],[2293,1],[2300,2],[2360,1],[2362,2],[2560,2],[2563,1],[2565,1],[2577,2],[2670,2],[2677,1],[2679,2],[2682,2],[2698,1],[2719,2],[2791,2],[2910,1],[2965,1],[2999,1],[3001,2],[3103,1],[3131,1],[3143,1],[3199,2],[3256,1],[3310,2],[3415,1],[3469,2],[3596,1],[3650,2],[3693,2],[3710,1],[3746,1],[3748,1],[3762,1],[3793,1],[3816,1],[3849,2],[3861,1],[3888,1],[3897,1],[3926,1],[3928,2],[3988,1],[3995,1],[4029,1],[4048,1],[4079,1],[4081,2],[4084,2],[4100,1],[4159,1],[4330,1],[4376,1],[4412,1],[4469,1],[4503,1],[4608,1],[4641,1],[4769,1],[4803,1],[4845,1],[4847,1],[4971,1],[5051,1],[5053,1],[5111,1],[5118,1],[5125,1],[5169,1],[5306,3],[5310,2],[5313,2],[5316,1],[5327,1],[5601,1],[5645,1],[5647,1],[5738,1],[5755,1],[5770,1],[5863,2],[6246,2],[6300,1],[6391,1],[6393,2]]},"544":{"position":[[362,2],[434,2],[458,1],[474,1],[476,1],[503,2],[603,1],[664,2],[748,2],[928,2],[971,3],[975,2],[996,1],[1006,1],[1008,1],[1112,2],[1115,1],[1172,3],[1176,2],[1187,1],[1213,2],[1292,1],[1294,1],[1336,1],[1350,1],[1352,2],[1451,2],[1525,2],[1610,2],[1743,2],[1917,2],[1960,2],[1970,2],[1977,1],[1979,2],[1982,2],[1998,1],[2000,1],[2010,2],[2105,1],[2112,2],[2213,1],[2225,2],[2304,2],[2312,1],[2314,1],[2330,1],[2351,2],[2423,2],[2542,1],[2597,1],[2631,1],[2633,2],[2735,1],[2763,1],[2775,1],[2831,2],[2888,1],[2942,2],[3047,1],[3101,2],[3228,1],[3282,2],[3325,2],[3342,1],[3378,1],[3380,1],[3394,1],[3419,1],[3442,1],[3475,2],[3487,1],[3512,1],[3519,1],[3544,1],[3563,1],[3595,2],[3611,1],[3651,2],[3671,1],[3697,1],[3868,1],[3914,1],[3950,1],[4007,1],[4041,1],[4146,1],[4179,1],[4307,1],[4341,1],[4383,1],[4385,1],[4509,1],[4589,1],[4591,1],[4649,1],[4656,1],[4753,1],[4764,1],[4804,1],[4823,1],[5133,1],[5396,1],[5440,1],[5442,1],[5533,1],[5691,1],[5732,1],[5748,2],[5791,1],[5803,2],[5838,1],[5870,2],[5935,1],[5967,2]]},"550":{"position":[[391,1],[438,1],[440,1],[457,2],[460,1],[491,1],[502,1],[512,2],[515,2],[528,1],[538,2],[541,1],[543,2],[558,1],[573,1],[584,1],[617,1],[619,1],[636,1],[638,1],[640,2],[653,1],[686,1],[688,1],[705,1],[707,1],[709,1],[711,1],[713,1],[715,1],[717,1],[719,1],[920,1]]},"552":{"position":[[134,1]]},"558":{"position":[[369,1],[416,1],[418,1],[435,2],[438,1],[469,1],[480,1],[490,2],[493,2],[506,1],[516,2],[519,1],[521,2],[536,1],[551,1],[562,1],[595,1],[597,1],[614,1],[616,1],[618,2],[631,1],[664,1],[666,1],[683,1],[685,1],[687,1],[689,1],[691,1],[693,1],[695,1],[697,1]]},"560":{"position":[[908,1],[955,1],[957,1],[974,2],[977,1],[1008,1],[1019,1],[1029,2],[1032,2],[1045,1],[1055,2],[1058,2],[1078,1],[1099,1],[1121,1],[1123,2],[1144,1],[1155,1],[1166,1],[1168,1],[1189,1],[1212,1],[1214,2],[1217,1],[1238,1],[1260,1],[1262,1],[1264,1],[1266,1],[1268,1],[1270,2],[1285,1],[1300,1],[1311,1],[1344,1],[1346,1],[1363,1],[1365,1],[1367,2],[1380,1],[1413,1],[1415,1],[1432,1],[1434,1],[1436,1],[1438,1],[1440,1],[1442,1],[1444,1],[1446,1]]},"562":{"position":[[417,2],[489,2],[513,1],[529,1],[531,1],[558,2],[658,1],[719,2],[803,2],[983,2],[1026,3],[1062,1],[1064,2],[1100,1],[1164,2],[1201,1],[1266,2],[1269,2],[1272,1],[1328,3],[1351,2],[1430,1],[1432,1],[1474,1],[1488,1],[1490,2],[1589,2],[1663,2],[1748,2],[1881,2],[2055,2],[2098,2],[2108,2],[2115,1],[2117,2],[2120,2],[2136,1],[2138,1],[2148,2],[2243,1],[2250,2],[2310,1],[2312,2],[2466,2],[2469,1],[2471,2],[2627,2],[2630,1],[2632,1],[2644,2],[2737,2],[2744,1],[2746,2],[2749,2],[2765,1],[2786,2],[2858,2],[2977,1],[3032,1],[3066,1],[3068,2],[3170,1],[3198,1],[3210,1],[3266,2],[3323,1],[3377,2],[3482,1],[3536,2],[3663,1],[3717,2],[3760,2],[3777,1],[3813,1],[3815,1],[3829,1],[3860,1],[3883,1],[3916,2],[3928,1],[3955,1],[3964,1],[3993,1],[3995,2],[4037,1],[4044,1],[4067,1],[4086,1],[4102,2],[4105,2],[4148,1],[4155,1],[4180,1],[4198,1],[4214,1],[4216,2],[4219,2],[4235,1],[4294,1],[4465,1],[4511,1],[4547,1],[4604,1],[4638,1],[4743,1],[4776,1],[4904,1],[4938,1],[4980,1],[4982,1],[5106,1],[5186,1],[5188,1],[5246,1],[5253,1],[5260,1],[5304,1],[5397,2],[5413,1],[5508,3],[5512,2],[5515,2],[5518,1],[5529,1],[5803,1],[5847,1],[5849,1],[5940,1],[5957,1],[5972,1],[6103,2],[6571,2],[6607,1],[6672,2],[6675,2],[6712,1],[6778,1],[6780,2],[6965,2],[7037,2],[7061,1],[7077,1],[7079,1],[7106,2],[7206,1],[7267,2],[7351,2],[7531,2],[7574,3],[7578,2],[7599,1],[7609,1],[7611,1],[7706,2],[7709,1],[7766,3],[7770,2],[7781,1],[7807,2],[7886,1],[7888,1],[7930,1],[7944,1],[7946,2],[8045,2],[8119,2],[8204,2],[8337,2],[8511,2],[8554,2],[8564,2],[8571,1],[8573,2],[8576,2],[8592,1],[8594,1],[8604,2],[8699,1],[8706,2],[8798,1],[8810,2],[8889,2],[8897,1],[8899,1],[8915,1],[8936,2],[9008,2],[9127,1],[9182,1],[9216,1],[9218,2],[9320,1],[9348,1],[9360,1],[9416,2],[9473,1],[9527,2],[9632,1],[9686,2],[9813,1],[9867,2],[9910,2],[9927,1],[9963,1],[9965,1],[9979,1],[10004,1],[10027,1],[10060,2],[10072,1],[10097,1],[10104,1],[10127,1],[10154,1],[10171,2],[10187,1],[10227,2],[10247,1],[10273,1],[10444,1],[10490,1],[10526,1],[10583,1],[10617,1],[10722,1],[10755,1],[10883,1],[10917,1],[10959,1],[10961,1],[11085,1],[11165,1],[11167,1],[11225,1],[11232,1],[11320,1],[11331,1],[11371,1],[11390,1],[11691,1],[11954,1],[11998,1],[12000,1],[12091,1],[12240,1],[12281,1],[12295,2],[12336,1],[12356,2],[12399,1],[12416,2],[12466,1],[12498,2],[12960,2],[13032,2],[13056,1],[13072,1],[13074,1],[13101,2],[13201,1],[13262,2],[13346,2],[13526,2],[13569,3],[13573,2],[13594,1],[13604,1],[13606,1],[13700,2],[13703,1],[13760,3],[13764,2],[13775,1],[13802,2],[13881,1],[13883,1],[13925,1],[13939,1],[13941,2],[14040,2],[14114,2],[14199,2],[14332,2],[14506,2],[14549,2],[14559,2],[14566,1],[14568,2],[14571,2],[14587,1],[14589,1],[14599,2],[14694,1],[14701,2],[14792,1],[14804,2],[14883,2],[14891,1],[14893,1],[14910,1],[14931,2],[15003,2],[15122,1],[15177,1],[15211,1],[15213,2],[15315,1],[15343,1],[15355,1],[15411,2],[15468,1],[15522,2],[15627,1],[15681,2],[15808,1],[15862,2],[15905,2],[15922,1],[15958,1],[15960,1],[15974,1],[15999,1],[16022,1],[16055,2],[16067,1],[16092,1],[16099,1],[16122,1],[16148,1],[16165,2],[16181,1],[16221,2],[16241,1],[16268,1],[16439,1],[16485,1],[16521,1],[16578,1],[16612,1],[16717,1],[16750,1],[16878,1],[16912,1],[16954,1],[16956,1],[17080,1],[17160,1],[17162,1],[17220,1],[17227,1],[17314,1],[17325,1],[17365,1],[17384,1],[17685,1],[17949,1],[17993,1],[17995,1],[18086,1],[18234,1],[18276,1],[18290,2],[18331,1],[18350,2],[18392,1],[18409,2],[18459,1],[18491,2],[18646,2],[18718,2],[18742,1],[18758,1],[18760,1],[18787,2],[18887,1],[18948,2],[19032,2],[19212,2],[19255,3],[19259,2],[19280,1],[19290,1],[19292,1],[19389,2],[19392,1],[19449,3],[19453,2],[19464,1],[19490,2],[19569,1],[19571,1],[19613,1],[19627,1],[19629,2],[19728,2],[19802,2],[19887,2],[20020,2],[20194,2],[20237,2],[20247,2],[20254,1],[20256,2],[20259,2],[20275,1],[20277,1],[20287,2],[20382,1],[20389,2],[20483,1],[20495,2],[20574,2],[20582,1],[20584,1],[20600,1],[20621,2],[20693,2],[20812,1],[20867,1],[20901,1],[20903,2],[21005,1],[21033,1],[21045,1],[21101,2],[21158,1],[21212,2],[21317,1],[21371,2],[21498,1],[21552,2],[21595,2],[21612,1],[21648,1],[21650,1],[21664,1],[21689,1],[21712,1],[21745,2],[21757,1],[21782,1],[21789,1],[21814,1],[21841,1],[21858,2],[21874,1],[21914,2],[21934,1],[21960,1],[22131,1],[22177,1],[22213,1],[22270,1],[22304,1],[22409,1],[22442,1],[22570,1],[22604,1],[22646,1],[22648,1],[22772,1],[22852,1],[22854,1],[22912,1],[22919,1],[23009,1],[23020,1],[23060,1],[23079,1],[23382,1],[23645,1],[23689,1],[23691,1],[23782,1],[23933,1],[23974,1],[23990,2],[24033,1],[24053,2],[24096,1],[24113,2],[24163,1],[24195,2],[24272,2],[24344,2],[24368,1],[24384,1],[24386,1],[24413,2],[24513,1],[24574,2],[24658,2],[24838,2],[24881,3],[24885,2],[24906,1],[24916,1],[24918,1],[25014,2],[25017,1],[25074,3],[25078,2],[25089,1],[25115,2],[25194,1],[25196,1],[25238,1],[25252,1],[25254,2],[25353,2],[25427,2],[25512,2],[25645,2],[25819,2],[25862,2],[25872,2],[25879,1],[25881,2],[25884,2],[25900,1],[25902,1],[25912,2],[26007,1],[26014,2],[26107,1],[26119,2],[26198,2],[26206,1],[26208,1],[26224,1],[26245,2],[26317,2],[26436,1],[26491,1],[26525,1],[26527,2],[26629,1],[26657,1],[26669,1],[26725,2],[26782,1],[26836,2],[26941,1],[26995,2],[27122,1],[27176,2],[27219,2],[27236,1],[27272,1],[27274,1],[27288,1],[27313,1],[27336,1],[27369,2],[27381,1],[27406,1],[27413,1],[27438,1],[27464,1],[27481,2],[27497,1],[27537,2],[27557,1],[27583,1],[27754,1],[27800,1],[27836,1],[27893,1],[27927,1],[28032,1],[28065,1],[28193,1],[28227,1],[28269,1],[28271,1],[28395,1],[28475,1],[28477,1],[28535,1],[28542,1],[28631,1],[28642,1],[28682,1],[28701,1],[29003,1],[29266,1],[29310,1],[29312,1],[29403,1],[29553,1],[29594,1],[29610,2],[29653,1],[29672,2],[29714,1],[29731,2],[29781,1],[29813,2]]},"568":{"position":[[327,1],[374,1],[376,1],[393,2],[396,1],[427,1],[438,1],[448,2],[451,1],[453,2],[468,1],[483,1],[494,1],[527,1],[529,1],[546,1],[548,1],[550,1],[552,1],[554,1],[556,1],[558,1],[560,1],[761,1]]},"570":{"position":[[134,1]]},"574":{"position":[[271,2],[343,2],[367,1],[383,1],[385,1],[412,2],[512,1],[573,2],[657,2],[837,2],[880,3],[916,1],[918,1],[977,1],[1036,2],[1039,2],[1042,1],[1098,3],[1121,2],[1200,1],[1202,1],[1244,1],[1258,1],[1260,2],[1359,2],[1433,2],[1518,2],[1651,2],[1825,2],[1868,2],[1878,2],[1885,1],[1887,2],[1890,2],[1906,1],[1908,1],[1918,2],[2013,1],[2020,2],[2080,1],[2195,2],[2198,1],[2313,2],[2316,1],[2318,1],[2330,2],[2423,2],[2430,1],[2432,2],[2435,2],[2451,1],[2472,2],[2544,2],[2663,1],[2718,1],[2752,1],[2754,2],[2856,1],[2884,1],[2896,1],[2952,2],[3009,1],[3063,2],[3168,1],[3222,2],[3349,1],[3403,2],[3446,2],[3463,1],[3499,1],[3501,1],[3515,1],[3546,1],[3569,1],[3602,2],[3614,1],[3641,1],[3650,1],[3679,1],[3687,1],[3694,1],[3718,1],[3736,1],[3747,2],[3756,1],[3763,1],[3787,1],[3805,1],[3816,1],[3818,2],[3821,2],[3837,1],[3896,1],[4067,1],[4113,1],[4149,1],[4206,1],[4240,1],[4345,1],[4378,1],[4506,1],[4540,1],[4582,1],[4584,1],[4708,1],[4788,1],[4790,1],[4848,1],[4855,1],[4862,1],[4959,2],[5028,3],[5032,2],[5035,2],[5038,1],[5049,1],[5323,1],[5367,1],[5369,1],[5460,1],[5477,1],[5492,1],[5612,2],[6069,1],[6129,2],[6132,1],[6192,1],[6194,2]]},"576":{"position":[[242,1],[289,1],[291,1],[308,2],[311,1],[342,1],[353,1],[364,1],[375,1],[377,1],[387,2],[390,2],[393,1],[413,1],[427,1],[439,3],[463,2],[485,1],[497,3],[526,1],[528,1],[530,1],[532,1],[534,1],[536,2],[548,1],[558,2],[561,1],[563,2],[578,1],[593,1],[604,1],[637,1],[639,1],[655,1],[657,1],[659,2],[671,1],[704,1],[706,1],[723,1],[725,1],[727,1],[729,1],[731,1],[733,2],[736,1],[766,1],[782,1],[792,2],[795,1],[797,2],[812,1],[827,1],[843,1],[876,1],[878,1],[895,1],[897,1],[899,1],[901,1],[903,1],[905,1],[907,1],[909,1]]},"578":{"position":[[278,2],[350,2],[374,1],[390,1],[392,1],[419,2],[519,1],[580,2],[664,2],[844,2],[887,3],[923,1],[925,1],[982,1],[1039,2],[1042,2],[1045,1],[1101,3],[1124,2],[1203,1],[1205,1],[1247,1],[1261,1],[1263,2],[1362,2],[1436,2],[1521,2],[1654,2],[1828,2],[1871,2],[1881,2],[1888,1],[1890,2],[1893,2],[1909,1],[1911,1],[1921,2],[2016,1],[2023,2],[2083,1],[2196,2],[2199,1],[2312,2],[2315,1],[2317,1],[2329,2],[2422,2],[2429,1],[2431,2],[2434,2],[2450,1],[2471,2],[2543,2],[2662,1],[2717,1],[2751,1],[2753,2],[2855,1],[2883,1],[2895,1],[2951,2],[3008,1],[3062,2],[3167,1],[3221,2],[3348,1],[3402,2],[3445,2],[3462,1],[3498,1],[3500,1],[3514,1],[3545,1],[3568,1],[3601,2],[3613,1],[3640,1],[3649,1],[3678,1],[3686,1],[3693,1],[3715,1],[3733,1],[3744,2],[3753,1],[3760,1],[3782,1],[3800,1],[3811,1],[3813,2],[3816,2],[3832,1],[3891,1],[4062,1],[4108,1],[4144,1],[4201,1],[4235,1],[4340,1],[4373,1],[4501,1],[4535,1],[4577,1],[4579,1],[4703,1],[4783,1],[4785,1],[4843,1],[4850,1],[4857,1],[4952,2],[5019,3],[5023,2],[5026,2],[5029,1],[5040,1],[5314,1],[5358,1],[5360,1],[5451,1],[5468,1],[5483,1],[5599,2],[6052,1],[6110,2],[6113,1],[6171,1],[6173,2]]},"580":{"position":[[289,2],[361,2],[385,1],[401,1],[403,1],[430,2],[530,1],[591,2],[675,2],[855,2],[898,3],[934,1],[936,1],[1002,2],[1005,2],[1008,1],[1064,3],[1087,2],[1166,1],[1168,1],[1210,1],[1224,1],[1226,2],[1325,2],[1399,2],[1484,2],[1617,2],[1791,2],[1834,2],[1844,2],[1851,1],[1853,2],[1856,2],[1872,1],[1874,1],[1884,2],[1979,1],[1986,2],[2046,1],[2168,2],[2171,1],[2173,1],[2185,2],[2278,2],[2285,1],[2287,2],[2290,2],[2306,1],[2327,2],[2399,2],[2518,1],[2573,1],[2607,1],[2609,2],[2711,1],[2739,1],[2751,1],[2807,2],[2864,1],[2918,2],[3023,1],[3077,2],[3204,1],[3258,2],[3301,2],[3318,1],[3354,1],[3356,1],[3370,1],[3401,1],[3424,1],[3457,2],[3469,1],[3496,1],[3505,1],[3534,1],[3542,1],[3549,1],[3574,1],[3597,1],[3609,1],[3611,2],[3614,2],[3630,1],[3689,1],[3860,1],[3906,1],[3942,1],[3999,1],[4033,1],[4138,1],[4171,1],[4299,1],[4333,1],[4375,1],[4377,1],[4501,1],[4581,1],[4583,1],[4641,1],[4648,1],[4655,1],[4759,3],[4763,2],[4766,2],[4769,1],[4780,1],[5054,1],[5098,1],[5100,1],[5191,1],[5208,1],[5223,1],[5292,2],[5651,1],[5718,1],[5720,2]]},"582":{"position":[[135,2],[207,2],[231,1],[247,1],[249,1],[276,2],[376,1],[437,2],[521,2],[701,2],[744,3],[748,2],[769,1],[779,1],[781,1],[864,2],[867,1],[924,3],[928,2],[939,1],[965,2],[1044,1],[1046,1],[1088,1],[1102,1],[1104,2],[1203,2],[1277,2],[1362,2],[1495,2],[1669,2],[1712,2],[1722,2],[1729,1],[1731,2],[1734,2],[1750,1],[1752,1],[1762,2],[1857,1],[1864,2],[1944,1],[1956,2],[2035,2],[2043,1],[2045,1],[2061,1],[2082,2],[2154,2],[2273,1],[2328,1],[2362,1],[2364,2],[2466,1],[2494,1],[2506,1],[2562,2],[2619,1],[2673,2],[2778,1],[2832,2],[2959,1],[3013,2],[3056,2],[3073,1],[3109,1],[3111,1],[3125,1],[3150,1],[3173,1],[3206,2],[3218,1],[3243,1],[3250,1],[3275,1],[3293,1],[3305,2],[3321,1],[3361,2],[3381,1],[3407,1],[3578,1],[3624,1],[3660,1],[3717,1],[3751,1],[3856,1],[3889,1],[4017,1],[4051,1],[4093,1],[4095,1],[4219,1],[4299,1],[4301,1],[4359,1],[4366,1],[4442,1],[4453,1],[4493,1],[4512,1],[4801,1],[5064,1],[5108,1],[5110,1],[5201,1],[5338,1],[5379,1],[5395,2],[5438,1],[5449,2],[5483,1],[5495,2],[5540,1],[5572,2],[5649,2],[5721,2],[5745,1],[5761,1],[5763,1],[5790,2],[5890,1],[5951,2],[6035,2],[6215,2],[6258,3],[6262,2],[6283,1],[6293,1],[6295,1],[6378,2],[6381,1],[6438,3],[6442,2],[6453,1],[6479,2],[6558,1],[6560,1],[6602,1],[6616,1],[6618,2],[6717,2],[6791,2],[6876,2],[7009,2],[7183,2],[7226,2],[7236,2],[7243,1],[7245,2],[7248,2],[7264,1],[7266,1],[7276,2],[7371,1],[7378,2],[7458,1],[7470,2],[7549,2],[7557,1],[7559,1],[7575,1],[7596,2],[7668,2],[7787,1],[7842,1],[7876,1],[7878,2],[7980,1],[8008,1],[8020,1],[8076,2],[8133,1],[8187,2],[8292,1],[8346,2],[8473,1],[8527,2],[8570,2],[8587,1],[8623,1],[8625,1],[8639,1],[8664,1],[8687,1],[8720,2],[8732,1],[8757,1],[8764,1],[8789,1],[8807,1],[8819,2],[8835,1],[8875,2],[8895,1],[8921,1],[9092,1],[9138,1],[9174,1],[9231,1],[9265,1],[9370,1],[9403,1],[9531,1],[9565,1],[9607,1],[9609,1],[9733,1],[9813,1],[9815,1],[9873,1],[9880,1],[9956,1],[9967,1],[10007,1],[10026,1],[10315,1],[10578,1],[10622,1],[10624,1],[10715,1],[10852,1],[10893,1],[10909,2],[10952,1],[10963,2],[10997,1],[11009,2],[11054,1],[11086,2]]},"584":{"position":[[172,2],[244,2],[268,1],[284,1],[286,1],[313,2],[413,1],[474,2],[558,2],[738,2],[781,3],[818,1],[820,1],[877,2],[880,2],[883,1],[939,3],[962,2],[1041,1],[1043,1],[1085,1],[1099,1],[1101,2],[1200,2],[1274,2],[1359,2],[1492,2],[1666,2],[1709,2],[1719,2],[1726,1],[1728,2],[1731,2],[1747,1],[1749,1],[1759,2],[1854,1],[1861,2],[1922,1],[2035,2],[2038,1],[2040,1],[2052,2],[2145,2],[2152,1],[2154,2],[2157,2],[2173,1],[2194,2],[2266,2],[2385,1],[2440,1],[2474,1],[2476,2],[2578,1],[2606,1],[2618,1],[2674,2],[2731,1],[2785,2],[2890,1],[2944,2],[3071,1],[3125,2],[3168,2],[3185,1],[3221,1],[3223,1],[3237,1],[3268,1],[3291,1],[3324,2],[3336,1],[3363,1],[3373,1],[3402,1],[3410,1],[3417,1],[3439,1],[3457,1],[3468,1],[3470,2],[3473,2],[3489,1],[3548,1],[3719,1],[3765,1],[3801,1],[3858,1],[3892,1],[3997,1],[4030,1],[4158,1],[4192,1],[4234,1],[4236,1],[4360,1],[4440,1],[4442,1],[4500,1],[4507,1],[4514,1],[4611,4],[4616,2],[4619,2],[4622,1],[4633,1],[4907,1],[4951,1],[4953,1],[5044,1],[5062,1],[5077,1],[5137,2],[5450,1],[5508,1],[5510,2],[5709,2],[5781,2],[5805,1],[5821,1],[5823,1],[5850,2],[5950,1],[6011,2],[6095,2],[6275,2],[6318,3],[6322,2],[6343,1],[6353,1],[6355,1],[6438,2],[6441,1],[6498,3],[6502,2],[6513,1],[6540,2],[6619,1],[6621,1],[6663,1],[6677,1],[6679,2],[6778,2],[6852,2],[6937,2],[7070,2],[7244,2],[7287,2],[7297,2],[7304,1],[7306,2],[7309,2],[7325,1],[7327,1],[7337,2],[7432,1],[7439,2],[7519,1],[7531,2],[7610,2],[7618,1],[7620,1],[7637,1],[7658,2],[7730,2],[7849,1],[7904,1],[7938,1],[7940,2],[8042,1],[8070,1],[8082,1],[8138,2],[8195,1],[8249,2],[8354,1],[8408,2],[8535,1],[8589,2],[8632,2],[8649,1],[8685,1],[8687,1],[8701,1],[8726,1],[8749,1],[8782,2],[8794,1],[8819,1],[8826,1],[8851,1],[8869,1],[8881,2],[8897,1],[8937,2],[8957,1],[8984,1],[9155,1],[9201,1],[9237,1],[9294,1],[9328,1],[9433,1],[9466,1],[9594,1],[9628,1],[9670,1],[9672,1],[9796,1],[9876,1],[9878,1],[9936,1],[9943,1],[10019,1],[10030,1],[10070,1],[10089,1],[10379,1],[10643,1],[10687,1],[10689,1],[10780,1],[10917,1],[10959,1],[10975,2],[11018,1],[11029,2],[11063,1],[11075,2],[11120,1],[11152,2]]},"590":{"position":[[468,1],[515,1],[517,1],[534,2],[537,1],[572,1],[584,1],[594,2],[597,2],[610,1],[621,1],[632,1],[634,1],[644,2],[647,2],[650,1],[671,1],[683,3],[708,1],[710,1],[712,1],[714,1],[716,1],[718,2],[733,1],[748,1],[760,1],[793,1],[795,1],[812,1],[814,1],[816,2],[829,1],[862,1],[864,1],[881,1],[883,1],[885,1],[887,1],[889,1],[891,1],[893,1],[895,1],[897,1],[899,2],[953,1],[1028,2],[1031,1],[1232,1]]},"592":{"position":[[134,1]]},"599":{"position":[[294,2],[366,2],[390,1],[406,1],[408,1],[435,2],[535,1],[596,2],[680,2],[860,2],[903,3],[907,2],[928,1],[938,1],[940,1],[1033,2],[1036,1],[1093,3],[1097,2],[1108,1],[1134,2],[1213,1],[1215,1],[1257,1],[1271,1],[1273,2],[1372,2],[1446,2],[1531,2],[1664,2],[1838,2],[1881,2],[1891,2],[1898,1],[1900,2],[1903,2],[1919,1],[1921,1],[1931,2],[2026,1],[2033,2],[2123,1],[2135,2],[2214,2],[2222,1],[2224,1],[2240,1],[2261,2],[2333,2],[2452,1],[2507,1],[2541,1],[2543,2],[2645,1],[2673,1],[2685,1],[2741,2],[2798,1],[2852,2],[2957,1],[3011,2],[3138,1],[3192,2],[3235,2],[3252,1],[3288,1],[3290,1],[3304,1],[3329,1],[3352,1],[3385,2],[3397,1],[3422,1],[3429,1],[3452,1],[3471,1],[3494,2],[3510,1],[3550,2],[3570,1],[3596,1],[3767,1],[3813,1],[3849,1],[3906,1],[3940,1],[4045,1],[4078,1],[4206,1],[4240,1],[4282,1],[4284,1],[4408,1],[4488,1],[4490,1],[4548,1],[4555,1],[4641,1],[4652,1],[4692,1],[4711,1],[5010,1],[5273,1],[5317,1],[5319,1],[5410,1],[5557,1],[5598,1],[5612,2],[5653,1],[5665,2],[5700,1],[5723,2],[5779,1],[5811,2]]},"606":{"position":[[544,2],[616,2],[640,1],[656,1],[658,1],[685,2],[785,1],[846,2],[930,2],[1110,2],[1153,3],[1157,2],[1181,1],[1190,1],[1192,1],[1273,3],[1277,2],[1287,1],[1429,2],[1508,1],[1510,1],[1552,1],[1566,1],[1568,2],[1667,2],[1741,2],[1826,2],[1959,2],[2133,2],[2176,2],[2186,2],[2193,1],[2195,2],[2198,2],[2214,1],[2216,1],[2226,2],[2254,2],[2392,1],[2404,2],[2489,2],[2497,1],[2499,1],[2632,1],[2653,2],[2725,2],[2844,1],[2899,1],[2933,1],[2935,2],[3037,1],[3065,1],[3077,1],[3133,2],[3190,1],[3244,2],[3349,1],[3403,2],[3530,1],[3584,2],[3627,2],[3644,1],[3680,1],[3682,1],[3696,1],[3720,2],[3732,1],[3758,1],[3765,1],[3788,1],[3807,1],[3822,2],[3838,1],[3877,2],[3885,1],[3887,1],[4020,1],[4041,1],[4212,1],[4258,1],[4294,1],[4351,1],[4385,1],[4490,1],[4523,1],[4651,1],[4685,1],[4727,1],[4729,1],[4853,1],[4933,1],[4935,2],[4943,1],[5011,1],[5022,1],[5061,1],[5072,1],[5726,1],[5770,1],[5772,1],[5863,1],[5945,1],[6096,2],[6134,2],[6179,1],[6181,3],[6190,1],[6212,2],[6237,2],[6266,2],[6700,2],[6772,2],[6796,1],[6812,1],[6814,1],[6841,2],[6941,1],[7002,2],[7086,2],[7266,2],[7309,3],[7313,2],[7337,1],[7346,1],[7348,1],[7410,3],[7414,2],[7424,1],[7566,2],[7645,1],[7647,1],[7689,1],[7703,1],[7705,2],[7804,2],[7878,2],[7963,2],[8096,2],[8270,2],[8313,2],[8323,2],[8330,1],[8332,2],[8335,2],[8351,1],[8353,1],[8363,2],[8391,2],[8490,1],[8502,2],[8587,2],[8595,1],[8597,1],[8730,1],[8751,2],[8823,2],[8942,1],[8997,1],[9031,1],[9033,2],[9135,1],[9163,1],[9175,1],[9231,2],[9288,1],[9342,2],[9447,1],[9501,2],[9628,1],[9682,2],[9725,2],[9742,1],[9778,1],[9780,1],[9794,1],[9818,2],[9830,1],[9856,1],[9863,1],[9884,1],[9899,2],[9915,1],[9954,2],[9962,1],[9964,1],[10097,1],[10118,1],[10289,1],[10335,1],[10371,1],[10428,1],[10462,1],[10567,1],[10600,1],[10728,1],[10762,1],[10804,1],[10806,1],[10930,1],[11010,1],[11012,2],[11020,1],[11069,1],[11080,1],[11119,1],[11130,1],[11766,1],[11810,1],[11812,1],[11903,1],[11965,1],[12116,2],[12154,2],[12199,1],[12201,3],[12210,1],[12235,2],[12264,2],[12681,2],[12753,2],[12777,1],[12793,1],[12795,1],[12822,2],[12922,1],[12983,2],[13067,2],[13247,2],[13290,3],[13294,2],[13318,1],[13327,1],[13329,1],[13401,3],[13405,2],[13415,1],[13557,2],[13636,1],[13638,1],[13680,1],[13694,1],[13696,2],[13795,2],[13869,2],[13954,2],[14087,2],[14261,2],[14304,2],[14314,2],[14321,1],[14323,2],[14326,2],[14342,1],[14344,1],[14354,2],[14382,2],[14491,1],[14503,2],[14588,2],[14596,1],[14598,1],[14731,1],[14752,2],[14824,2],[14943,1],[14998,1],[15032,1],[15034,2],[15136,1],[15164,1],[15176,1],[15232,2],[15289,1],[15343,2],[15448,1],[15502,2],[15629,1],[15683,2],[15726,2],[15743,1],[15779,1],[15781,1],[15795,1],[15819,2],[15831,1],[15857,1],[15868,1],[15887,1],[15910,2],[15926,1],[15965,2],[15973,1],[15975,1],[16108,1],[16129,1],[16300,1],[16346,1],[16382,1],[16439,1],[16473,1],[16578,1],[16611,1],[16739,1],[16773,1],[16815,1],[16817,1],[16941,1],[17021,1],[17023,2],[17031,1],[17090,1],[17101,1],[17140,1],[17151,1],[17797,1],[17841,1],[17843,1],[17934,1],[18006,1],[18157,2],[18183,2],[18224,2],[18257,2],[18296,2]]},"608":{"position":[[747,2],[819,2],[843,1],[859,1],[861,1],[888,2],[988,1],[1049,2],[1133,2],[1313,2],[1356,3],[1360,2],[1384,1],[1393,1],[1395,1],[1476,3],[1480,2],[1490,1],[1492,2],[1514,2],[1593,1],[1595,1],[1637,1],[1651,1],[1653,2],[1752,2],[1826,2],[1911,2],[2044,2],[2218,2],[2261,2],[2271,2],[2278,1],[2280,2],[2283,2],[2299,1],[2301,1],[2311,2],[2339,2],[2477,1],[2489,2],[2574,2],[2582,1],[2584,1],[2596,2],[2599,1],[2620,2],[2692,2],[2811,1],[2866,1],[2900,1],[2902,2],[3004,1],[3032,1],[3044,1],[3100,2],[3157,1],[3211,2],[3316,1],[3370,2],[3497,1],[3551,2],[3594,2],[3611,1],[3647,1],[3649,1],[3663,1],[3687,2],[3699,1],[3725,1],[3732,1],[3755,1],[3774,1],[3789,2],[3805,1],[3844,2],[3852,1],[3854,1],[3866,2],[3869,1],[3890,1],[4061,1],[4107,1],[4143,1],[4200,1],[4234,1],[4339,1],[4372,1],[4500,1],[4534,1],[4576,1],[4578,1],[4702,1],[4782,1],[4784,2],[4792,1],[4860,1],[4871,1],[4910,1],[4921,1],[5457,1],[5501,1],[5503,1],[5594,1],[5676,1],[5698,4],[5709,2],[5747,2],[5792,1],[5794,3],[5803,1],[5825,2],[5850,2],[5879,2]]},"613":{"position":[[285,2],[357,2],[381,1],[397,1],[399,1],[426,2],[526,1],[587,2],[671,2],[851,2],[894,3],[904,1],[911,1],[913,1],[960,2],[1029,2],[1068,2],[1071,1],[1127,3],[1131,2],[1139,1],[1141,3],[1164,2],[1243,1],[1245,1],[1287,1],[1301,1],[1303,2],[1402,2],[1476,2],[1561,2],[1694,2],[1868,2],[1911,2],[1921,2],[1928,1],[1930,2],[1933,2],[1949,1],[1951,1],[1961,2],[2057,1],[2064,2],[2108,2],[2177,2],[2216,1],[2228,2],[2315,2],[2323,1],[2325,1],[2333,4],[2357,2],[2429,2],[2548,1],[2603,1],[2637,1],[2639,2],[2741,1],[2769,1],[2781,1],[2837,2],[2894,1],[2948,2],[3053,1],[3107,2],[3234,1],[3288,2],[3331,2],[3348,1],[3384,1],[3386,1],[3400,1],[3425,1],[3448,1],[3481,2],[3493,1],[3519,1],[3530,1],[3542,2],[3589,1],[3611,2],[3650,2],[3666,1],[3707,2],[3719,1],[3721,1],[3729,3],[3733,1],[3754,1],[3925,1],[3971,1],[4007,1],[4064,1],[4098,1],[4203,1],[4236,1],[4364,1],[4398,1],[4440,1],[4442,1],[4566,1],[4646,1],[4648,1],[4706,1],[4713,1],[4785,1],[4796,1],[4837,1],[4848,1],[5165,1],[5186,4],[5426,1],[5470,1],[5472,1],[5563,1],[5692,1],[5713,4],[5736,2],[5797,2],[5889,2],[5947,1],[6061,1],[6063,1],[6065,1],[6067,1],[6069,1],[6071,1],[6197,2],[6269,2],[6293,1],[6309,1],[6311,1],[6338,2],[6438,1],[6499,2],[6583,2],[6763,2],[6806,3],[6816,1],[6823,1],[6825,1],[6872,2],[6941,2],[6980,2],[6983,1],[7039,3],[7043,2],[7051,1],[7053,3],[7076,2],[7155,1],[7157,1],[7199,1],[7213,1],[7215,2],[7314,2],[7388,2],[7473,2],[7606,2],[7780,2],[7823,2],[7833,2],[7840,1],[7842,2],[7845,2],[7861,1],[7863,1],[7873,2],[7969,1],[7976,2],[8020,2],[8089,2],[8128,1],[8140,2],[8227,2],[8235,1],[8237,1],[8245,4],[8269,2],[8341,2],[8460,1],[8515,1],[8549,1],[8551,2],[8653,1],[8681,1],[8693,1],[8749,2],[8806,1],[8860,2],[8965,1],[9019,2],[9146,1],[9200,2],[9243,2],[9260,1],[9296,1],[9298,1],[9312,1],[9337,1],[9360,1],[9393,2],[9405,1],[9431,1],[9442,1],[9454,2],[9501,1],[9523,2],[9562,2],[9578,1],[9619,2],[9631,1],[9633,1],[9641,3],[9645,1],[9666,1],[9837,1],[9883,1],[9919,1],[9976,1],[10010,1],[10115,1],[10148,1],[10276,1],[10310,1],[10352,1],[10354,1],[10478,1],[10558,1],[10560,1],[10618,1],[10625,1],[10697,1],[10708,1],[10749,1],[10760,1],[11077,1],[11098,4],[11338,1],[11382,1],[11384,1],[11475,1],[11604,1],[11625,4],[11648,2],[11709,2],[11801,2],[11859,1],[11954,1],[11956,1],[11958,1],[11960,1],[11962,1],[11964,1],[11966,1]]},"618":{"position":[[206,2],[278,2],[302,1],[318,1],[320,1],[347,2],[447,1],[508,2],[592,2],[772,2],[815,3],[834,1],[941,1],[955,2],[1024,2],[1027,2],[1030,2],[1033,1],[1090,3],[1094,2],[1114,1],[1178,2],[1257,1],[1259,1],[1301,1],[1315,1],[1317,2],[1416,2],[1490,2],[1575,2],[1708,2],[1882,2],[1925,2],[1935,2],[1942,1],[1944,2],[1947,2],[1963,1],[1965,1],[1975,2],[2076,1],[2083,2],[2205,1],[2274,1],[2276,1],[2278,1],[2290,2],[2385,2],[2393,1],[2395,1],[2451,1],[2472,2],[2544,2],[2663,1],[2718,1],[2752,1],[2754,2],[2856,1],[2884,1],[2896,1],[2952,2],[3009,1],[3063,2],[3168,1],[3222,2],[3349,1],[3403,2],[3446,2],[3463,1],[3499,1],[3501,1],[3515,1],[3546,1],[3569,1],[3602,2],[3614,1],[3645,1],[3652,1],[3675,1],[3692,1],[3724,1],[3825,2],[3828,2],[3844,1],[3890,2],[3910,1],[3974,1],[4145,1],[4191,1],[4227,1],[4284,1],[4318,1],[4423,1],[4456,1],[4584,1],[4618,1],[4660,1],[4662,1],[4786,1],[4866,1],[4868,1],[4926,1],[4933,1],[5113,2],[5116,1],[5127,1],[5174,1],[5193,1],[5586,1],[5895,1],[5939,1],[5941,1],[6032,1],[6037,2],[6179,1],[6195,1],[6271,1],[6273,1],[6275,2],[6278,1],[6371,2],[6426,2],[6466,2],[6524,1],[6557,2],[6621,1],[6623,1],[6625,2],[6665,1],[6688,1],[6707,1],[6730,1],[6732,2]]},"628":{"position":[[432,1],[479,1],[481,1],[498,2],[501,1],[536,1],[548,1],[558,2],[561,1],[563,2],[578,1],[593,1],[605,1],[638,1],[640,1],[657,1],[659,1],[661,1],[663,1],[665,1],[667,2],[670,1],[703,1],[715,1],[725,2],[728,1],[730,2],[745,1],[760,1],[772,1],[805,1],[807,1],[824,1],[826,1],[828,1],[830,1],[832,1],[834,1],[836,1],[838,1],[1005,1]]},"630":{"position":[[93,1]]},"635":{"position":[[289,1],[336,1],[338,1],[355,2],[358,1],[393,1],[405,1],[415,2],[418,2],[431,1],[441,2],[444,1],[446,2],[461,1],[476,1],[488,1],[521,1],[523,1],[542,1],[544,1],[546,2],[559,1],[592,1],[594,1],[611,1],[613,1],[615,1],[617,1],[619,1],[621,2],[624,1],[657,1],[669,1],[679,2],[682,1],[684,2],[699,1],[714,1],[726,1],[759,1],[761,1],[778,1],[780,1],[782,1],[784,1],[786,1],[788,1],[790,1],[792,1]]},"637":{"position":[[421,2],[493,2],[517,1],[533,1],[535,1],[562,2],[662,1],[723,2],[807,2],[987,2],[1030,3],[1066,1],[1068,2],[1169,1],[1251,2],[1254,2],[1257,1],[1313,3],[1336,2],[1415,1],[1417,1],[1459,1],[1473,1],[1475,2],[1574,2],[1648,2],[1733,2],[1866,2],[2040,2],[2083,2],[2093,2],[2100,1],[2102,2],[2105,2],[2121,1],[2123,1],[2133,2],[2228,1],[2235,2],[2295,1],[2297,2],[2534,2],[2537,1],[2539,1],[2551,2],[2644,2],[2651,1],[2653,2],[2656,2],[2672,1],[2693,2],[2765,2],[2884,1],[2939,1],[2973,1],[2975,2],[3077,1],[3105,1],[3117,1],[3173,2],[3230,1],[3284,2],[3389,1],[3443,2],[3570,1],[3624,2],[3667,2],[3684,1],[3720,1],[3722,1],[3736,1],[3767,1],[3790,1],[3823,2],[3835,1],[3862,1],[3871,1],[3900,1],[3902,2],[4009,1],[4016,1],[4045,1],[4064,1],[4092,1],[4094,2],[4097,2],[4113,1],[4172,1],[4343,1],[4389,1],[4425,1],[4482,1],[4516,1],[4621,1],[4654,1],[4782,1],[4816,1],[4858,1],[4860,1],[4984,1],[5064,1],[5066,1],[5124,1],[5131,1],[5138,1],[5182,1],[5358,3],[5362,2],[5365,2],[5368,1],[5379,1],[5653,1],[5697,1],[5699,1],[5790,1],[5807,1],[5822,1],[5907,2],[6282,2],[6383,1],[6466,1],[6468,2]]},"639":{"position":[[236,2],[308,2],[332,1],[348,1],[350,1],[377,2],[477,1],[538,2],[622,2],[802,2],[845,3],[849,2],[870,1],[880,1],[882,1],[987,2],[990,1],[1047,3],[1051,2],[1062,1],[1088,2],[1167,1],[1169,1],[1211,1],[1225,1],[1227,2],[1326,2],[1400,2],[1485,2],[1618,2],[1792,2],[1835,2],[1845,2],[1852,1],[1854,2],[1857,2],[1873,1],[1875,1],[1885,2],[1980,1],[1987,2],[2089,1],[2101,2],[2180,2],[2188,1],[2190,1],[2206,1],[2227,2],[2299,2],[2418,1],[2473,1],[2507,1],[2509,2],[2611,1],[2639,1],[2651,1],[2707,2],[2764,1],[2818,2],[2923,1],[2977,2],[3104,1],[3158,2],[3201,2],[3218,1],[3254,1],[3256,1],[3270,1],[3295,1],[3318,1],[3351,2],[3363,1],[3388,1],[3395,1],[3424,1],[3443,1],[3472,2],[3488,1],[3528,2],[3548,1],[3574,1],[3745,1],[3791,1],[3827,1],[3884,1],[3918,1],[4023,1],[4056,1],[4184,1],[4218,1],[4260,1],[4262,1],[4386,1],[4466,1],[4468,1],[4526,1],[4533,1],[4631,1],[4642,1],[4682,1],[4701,1],[5012,1],[5275,1],[5319,1],[5321,1],[5412,1],[5571,1],[5612,1],[5632,2],[5679,1],[5691,2],[5726,1],[5755,2],[5817,1],[5849,2]]},"643":{"position":[[283,1],[330,1],[332,1],[349,2],[352,1],[386,1],[407,1],[417,2],[420,2],[433,1],[444,1],[455,1],[457,1],[467,2],[470,2],[473,1],[493,1],[507,1],[539,2],[561,1],[595,1],[597,1],[599,1],[601,1],[603,1],[605,1],[607,2],[622,1],[637,1],[658,1],[691,1],[693,1],[710,1],[712,1],[714,2],[727,1],[760,1],[762,1],[779,1],[781,1],[783,1],[785,1],[787,1],[789,2],[792,1],[823,1],[846,1],[856,2],[859,1],[861,2],[876,1],[891,1],[914,1],[947,1],[949,1],[966,1],[968,1],[970,1],[972,1],[974,1],[976,1],[978,1],[980,1]]},"645":{"position":[[146,2],[218,2],[242,1],[258,1],[260,1],[287,2],[387,1],[448,2],[532,2],[712,2],[755,3],[791,1],[793,2],[845,1],[923,2],[988,1],[1075,2],[1078,2],[1081,1],[1137,3],[1160,2],[1239,1],[1241,1],[1283,1],[1297,1],[1299,2],[1398,2],[1472,2],[1557,2],[1690,2],[1864,2],[1907,2],[1917,2],[1924,1],[1926,2],[1929,2],[1945,1],[1947,1],[1957,2],[2052,1],[2059,2],[2119,1],[2121,2],[2305,2],[2308,1],[2310,2],[2516,2],[2519,1],[2521,1],[2533,2],[2626,2],[2633,1],[2635,2],[2638,2],[2654,1],[2675,2],[2747,2],[2866,1],[2921,1],[2955,1],[2957,2],[3059,1],[3087,1],[3099,1],[3155,2],[3212,1],[3266,2],[3371,1],[3425,2],[3552,1],[3606,2],[3649,2],[3666,1],[3702,1],[3704,1],[3718,1],[3749,1],[3772,1],[3805,2],[3817,1],[3844,1],[3853,1],[3882,1],[3884,2],[3942,1],[3949,1],[3973,1],[4003,1],[4021,2],[4024,2],[4095,1],[4102,1],[4130,1],[4158,1],[4183,1],[4185,2],[4188,2],[4204,1],[4263,1],[4434,1],[4480,1],[4516,1],[4573,1],[4607,1],[4712,1],[4745,1],[4873,1],[4907,1],[4949,1],[4951,1],[5075,1],[5155,1],[5157,1],[5215,1],[5222,1],[5229,1],[5273,1],[5396,2],[5412,1],[5557,3],[5561,2],[5564,2],[5567,1],[5578,1],[5852,1],[5896,1],[5898,1],[5989,1],[6006,1],[6021,1],[6188,2],[6692,2],[6744,1],[6823,2],[6826,2],[6891,1],[6979,1],[6981,2]]},"647":{"position":[[165,2],[237,2],[261,1],[277,1],[279,1],[306,2],[406,1],[467,2],[551,2],[731,2],[774,3],[778,2],[799,1],[809,1],[811,1],[908,2],[911,1],[968,3],[972,2],[983,1],[1009,2],[1088,1],[1090,1],[1132,1],[1146,1],[1148,2],[1247,2],[1321,2],[1406,2],[1539,2],[1713,2],[1756,2],[1766,2],[1773,1],[1775,2],[1778,2],[1794,1],[1796,1],[1806,2],[1901,1],[1908,2],[2002,1],[2014,2],[2093,2],[2101,1],[2103,1],[2119,1],[2140,2],[2212,2],[2331,1],[2386,1],[2420,1],[2422,2],[2524,1],[2552,1],[2564,1],[2620,2],[2677,1],[2731,2],[2836,1],[2890,2],[3017,1],[3071,2],[3114,2],[3131,1],[3167,1],[3169,1],[3183,1],[3208,1],[3231,1],[3264,2],[3276,1],[3301,1],[3308,1],[3332,1],[3351,1],[3377,2],[3393,1],[3433,2],[3453,1],[3479,1],[3650,1],[3696,1],[3732,1],[3789,1],[3823,1],[3928,1],[3961,1],[4089,1],[4123,1],[4165,1],[4167,1],[4291,1],[4371,1],[4373,1],[4431,1],[4438,1],[4528,1],[4539,1],[4579,1],[4598,1],[4901,1],[5164,1],[5208,1],[5210,1],[5301,1],[5452,1],[5493,1],[5508,2],[5550,1],[5562,2],[5597,1],[5623,2],[5682,1],[5714,2]]},"649":{"position":[[146,2],[218,2],[242,1],[258,1],[260,1],[287,2],[387,1],[448,2],[532,2],[712,2],[755,3],[792,1],[794,2],[844,1],[931,2],[934,2],[937,1],[993,3],[1016,2],[1095,1],[1097,1],[1139,1],[1153,1],[1155,2],[1254,2],[1328,2],[1413,2],[1546,2],[1720,2],[1763,2],[1773,2],[1780,1],[1782,2],[1785,2],[1801,1],[1803,1],[1813,2],[1908,1],[1915,2],[1976,1],[1978,2],[2169,2],[2172,1],[2174,1],[2186,2],[2279,2],[2286,1],[2288,2],[2291,2],[2307,1],[2328,2],[2400,2],[2519,1],[2574,1],[2608,1],[2610,2],[2712,1],[2740,1],[2752,1],[2808,2],[2865,1],[2919,2],[3024,1],[3078,2],[3205,1],[3259,2],[3302,2],[3319,1],[3355,1],[3357,1],[3371,1],[3402,1],[3425,1],[3458,2],[3470,1],[3497,1],[3507,1],[3536,1],[3538,2],[3594,1],[3601,1],[3629,1],[3657,1],[3682,1],[3684,2],[3687,2],[3703,1],[3762,1],[3933,1],[3979,1],[4015,1],[4072,1],[4106,1],[4211,1],[4244,1],[4372,1],[4406,1],[4448,1],[4450,1],[4574,1],[4654,1],[4656,1],[4714,1],[4721,1],[4728,1],[4774,1],[4904,4],[4909,2],[4912,2],[4915,1],[4926,1],[5200,1],[5244,1],[5246,1],[5337,1],[5355,1],[5370,1],[5460,2],[5803,2],[5853,1],[5941,1],[5943,2],[6204,2],[6276,2],[6300,1],[6316,1],[6318,1],[6345,2],[6445,1],[6506,2],[6590,2],[6770,2],[6813,3],[6817,2],[6838,1],[6848,1],[6850,1],[6947,2],[6950,1],[7007,3],[7011,2],[7022,1],[7049,2],[7128,1],[7130,1],[7172,1],[7186,1],[7188,2],[7287,2],[7361,2],[7446,2],[7579,2],[7753,2],[7796,2],[7806,2],[7813,1],[7815,2],[7818,2],[7834,1],[7836,1],[7846,2],[7941,1],[7948,2],[8042,1],[8054,2],[8133,2],[8141,1],[8143,1],[8160,1],[8181,2],[8253,2],[8372,1],[8427,1],[8461,1],[8463,2],[8565,1],[8593,1],[8605,1],[8661,2],[8718,1],[8772,2],[8877,1],[8931,2],[9058,1],[9112,2],[9155,2],[9172,1],[9208,1],[9210,1],[9224,1],[9249,1],[9272,1],[9305,2],[9317,1],[9342,1],[9349,1],[9373,1],[9392,1],[9418,2],[9434,1],[9474,2],[9494,1],[9521,1],[9692,1],[9738,1],[9774,1],[9831,1],[9865,1],[9970,1],[10003,1],[10131,1],[10165,1],[10207,1],[10209,1],[10333,1],[10413,1],[10415,1],[10473,1],[10480,1],[10570,1],[10581,1],[10621,1],[10640,1],[10944,1],[11208,1],[11252,1],[11254,1],[11345,1],[11496,1],[11538,1],[11553,2],[11595,1],[11607,2],[11642,1],[11668,2],[11727,1],[11759,2],[11837,2],[11909,2],[11933,1],[11949,1],[11951,1],[11978,2],[12078,1],[12139,2],[12223,2],[12403,2],[12446,3],[12450,2],[12471,1],[12481,1],[12483,1],[12584,2],[12587,1],[12644,3],[12648,2],[12659,1],[12685,2],[12764,1],[12766,1],[12808,1],[12822,1],[12824,2],[12923,2],[12997,2],[13082,2],[13215,2],[13389,2],[13432,2],[13442,2],[13449,1],[13451,2],[13454,2],[13470,1],[13472,1],[13482,2],[13577,1],[13584,2],[13682,1],[13694,2],[13773,2],[13781,1],[13783,1],[13799,1],[13820,2],[13892,2],[14011,1],[14066,1],[14100,1],[14102,2],[14204,1],[14232,1],[14244,1],[14300,2],[14357,1],[14411,2],[14516,1],[14570,2],[14697,1],[14751,2],[14794,2],[14811,1],[14847,1],[14849,1],[14863,1],[14888,1],[14911,1],[14944,2],[14956,1],[14981,1],[14988,1],[15012,1],[15042,1],[15061,2],[15077,1],[15117,2],[15137,1],[15163,1],[15334,1],[15380,1],[15416,1],[15473,1],[15507,1],[15612,1],[15645,1],[15773,1],[15807,1],[15849,1],[15851,1],[15975,1],[16055,1],[16057,1],[16115,1],[16122,1],[16216,1],[16227,1],[16267,1],[16286,1],[16593,1],[16856,1],[16900,1],[16902,1],[16993,1],[17148,1],[17189,1],[17204,2],[17246,1],[17269,2],[17315,1],[17334,2],[17386,1],[17418,2]]},"655":{"position":[[349,1]]},"657":{"position":[[134,1]]},"663":{"position":[[435,1],[482,1],[484,1],[501,2],[504,1],[539,1],[551,1],[562,1],[573,1],[575,1],[585,2],[588,2],[591,1],[612,1],[635,1],[637,1],[639,1],[641,1],[643,2],[656,1],[666,2],[669,1],[671,2],[686,1],[701,1],[713,1],[746,1],[748,1],[765,2],[768,1],[798,2],[801,2],[804,1],[843,1],[845,1],[847,2],[860,1],[893,1],[895,1],[912,2],[915,1],[954,1],[956,1],[958,1],[960,1],[962,1],[964,2],[967,1],[998,1],[1010,1],[1020,2],[1023,1],[1025,2],[1040,1],[1055,1],[1067,1],[1100,1],[1102,1],[1119,1],[1121,1],[1123,1],[1125,1],[1127,1],[1129,1],[1131,1],[1133,1]]},"667":{"position":[[246,1],[293,1],[295,1],[312,2],[315,1],[350,1],[362,1],[373,1],[384,1],[386,1],[396,2],[399,2],[402,1],[423,1],[446,1],[448,1],[450,1],[452,1],[454,2],[467,1],[477,2],[480,1],[482,2],[497,1],[512,1],[524,1],[557,1],[559,1],[576,2],[579,1],[609,2],[612,2],[615,1],[654,1],[656,1],[658,2],[671,1],[704,1],[706,1],[723,2],[726,1],[765,1],[767,1],[769,1],[771,1],[773,1],[775,2],[778,1],[809,1],[821,1],[831,2],[834,1],[836,2],[851,1],[866,1],[878,1],[911,1],[913,1],[930,1],[932,1],[934,1],[936,1],[938,1],[940,1],[942,1],[944,1],[1159,1],[1161,1],[1237,2],[1240,1],[1425,2],[1497,2],[1521,1],[1537,1],[1539,1],[1566,2],[1666,1],[1727,2],[1811,2],[1991,2],[2034,3],[2038,2],[2059,1],[2069,1],[2071,1],[2165,2],[2168,1],[2225,3],[2229,2],[2240,1],[2266,2],[2345,1],[2347,1],[2389,1],[2403,1],[2405,2],[2504,2],[2578,2],[2663,2],[2796,2],[2970,2],[3013,2],[3023,2],[3030,1],[3032,2],[3035,2],[3051,1],[3053,1],[3063,2],[3158,1],[3165,2],[3256,1],[3268,2],[3347,2],[3355,1],[3357,1],[3373,1],[3394,2],[3466,2],[3585,1],[3640,1],[3674,1],[3676,2],[3778,1],[3806,1],[3818,1],[3874,2],[3931,1],[3985,2],[4090,1],[4144,2],[4271,1],[4325,2],[4368,2],[4385,1],[4421,1],[4423,1],[4437,1],[4462,1],[4485,1],[4518,2],[4530,1],[4555,1],[4562,1],[4586,1],[4605,1],[4628,2],[4644,1],[4684,2],[4704,1],[4730,1],[4901,1],[4947,1],[4983,1],[5040,1],[5074,1],[5179,1],[5212,1],[5340,1],[5374,1],[5416,1],[5418,1],[5542,1],[5622,1],[5624,1],[5682,1],[5689,1],[5776,1],[5787,1],[5827,1],[5846,1],[6146,1],[6409,1],[6453,1],[6455,1],[6546,1],[6694,1],[6735,1],[6750,2],[6792,1],[6804,2],[6839,1],[6862,2],[6918,1],[6950,2],[7334,1],[7336,1],[7409,2],[7412,1],[7597,2],[7669,2],[7693,1],[7709,1],[7711,1],[7738,2],[7838,1],[7899,2],[7983,2],[8163,2],[8206,3],[8210,2],[8231,1],[8241,1],[8243,1],[8337,2],[8340,1],[8397,3],[8401,2],[8412,1],[8438,2],[8517,1],[8519,1],[8561,1],[8575,1],[8577,2],[8676,2],[8750,2],[8835,2],[8968,2],[9142,2],[9185,2],[9195,2],[9202,1],[9204,2],[9207,2],[9223,1],[9225,1],[9235,2],[9330,1],[9337,2],[9428,1],[9440,2],[9519,2],[9527,1],[9529,1],[9545,1],[9566,2],[9638,2],[9757,1],[9812,1],[9846,1],[9848,2],[9950,1],[9978,1],[9990,1],[10046,2],[10103,1],[10157,2],[10262,1],[10316,2],[10443,1],[10497,2],[10540,2],[10557,1],[10593,1],[10595,1],[10609,1],[10634,1],[10657,1],[10690,2],[10702,1],[10727,1],[10734,1],[10758,1],[10777,1],[10800,2],[10816,1],[10856,2],[10876,1],[10902,1],[11073,1],[11119,1],[11155,1],[11212,1],[11246,1],[11351,1],[11384,1],[11512,1],[11546,1],[11588,1],[11590,1],[11714,1],[11794,1],[11796,1],[11854,1],[11861,1],[11948,1],[11959,1],[11999,1],[12018,1],[12318,1],[12581,1],[12625,1],[12627,1],[12718,1],[12866,1],[12907,1],[12922,2],[12964,1],[12976,2],[13011,1],[13034,2],[13090,1],[13122,2],[13757,1],[13759,1],[13833,2],[13836,1],[13922,2],[13925,1],[14418,2],[14490,2],[14514,1],[14530,1],[14532,1],[14559,2],[14659,1],[14720,2],[14804,2],[14984,2],[15027,3],[15031,2],[15052,1],[15062,1],[15064,1],[15161,2],[15164,1],[15221,3],[15225,2],[15236,1],[15262,2],[15341,1],[15343,1],[15385,1],[15399,1],[15401,2],[15500,2],[15574,2],[15659,2],[15792,2],[15966,2],[16009,2],[16019,2],[16026,1],[16028,2],[16031,2],[16047,1],[16049,1],[16059,2],[16154,1],[16161,2],[16255,1],[16267,2],[16346,2],[16354,1],[16356,1],[16372,1],[16393,2],[16465,2],[16584,1],[16639,1],[16673,1],[16675,2],[16777,1],[16805,1],[16817,1],[16873,2],[16930,1],[16984,2],[17089,1],[17143,2],[17270,1],[17324,2],[17367,2],[17384,1],[17420,1],[17422,1],[17436,1],[17461,1],[17484,1],[17517,2],[17529,1],[17554,1],[17561,1],[17588,1],[17607,1],[17630,2],[17646,1],[17686,2],[17706,1],[17732,1],[17903,1],[17949,1],[17985,1],[18042,1],[18076,1],[18181,1],[18214,1],[18342,1],[18376,1],[18418,1],[18420,1],[18544,1],[18624,1],[18626,1],[18684,1],[18691,1],[18781,1],[18792,1],[18832,1],[18851,1],[19154,1],[19417,1],[19461,1],[19463,1],[19554,1],[19705,1],[19746,1],[19764,2],[19809,1],[19821,2],[19856,1],[19879,2],[19935,1],[19967,2],[20722,1],[20724,1],[20801,2],[20804,1],[20891,2],[20894,1],[20975,2],[20978,1],[21064,2],[21067,1],[21255,2],[21327,2],[21351,1],[21367,1],[21369,1],[21396,2],[21496,1],[21557,2],[21641,2],[21821,2],[21864,3],[21868,2],[21889,1],[21899,1],[21901,1],[21995,2],[21998,1],[22055,3],[22059,2],[22070,1],[22096,2],[22175,1],[22177,1],[22219,1],[22233,1],[22235,2],[22334,2],[22408,2],[22493,2],[22626,2],[22800,2],[22843,2],[22853,2],[22860,1],[22862,2],[22865,2],[22881,1],[22883,1],[22893,2],[22988,1],[22995,2],[23086,1],[23098,2],[23177,2],[23185,1],[23187,1],[23203,1],[23224,2],[23296,2],[23415,1],[23470,1],[23504,1],[23506,2],[23608,1],[23636,1],[23648,1],[23704,2],[23761,1],[23815,2],[23920,1],[23974,2],[24101,1],[24155,2],[24198,2],[24215,1],[24251,1],[24253,1],[24267,1],[24292,1],[24315,1],[24348,2],[24360,1],[24385,1],[24392,1],[24416,1],[24435,1],[24458,2],[24474,1],[24514,2],[24534,1],[24560,1],[24731,1],[24777,1],[24813,1],[24870,1],[24904,1],[25009,1],[25042,1],[25170,1],[25204,1],[25246,1],[25248,1],[25372,1],[25452,1],[25454,1],[25512,1],[25519,1],[25606,1],[25617,1],[25657,1],[25676,1],[25976,1],[26239,1],[26283,1],[26285,1],[26376,1],[26524,1],[26565,1],[26580,2],[26622,1],[26634,2],[26669,1],[26692,2],[26748,1],[26780,2],[27220,1],[27222,1],[27299,2],[27302,1],[27491,2],[27563,2],[27587,1],[27603,1],[27605,1],[27632,2],[27732,1],[27793,2],[27877,2],[28057,2],[28100,3],[28104,2],[28125,1],[28135,1],[28137,1],[28232,2],[28235,1],[28292,3],[28296,2],[28307,1],[28333,2],[28412,1],[28414,1],[28456,1],[28470,1],[28472,2],[28571,2],[28645,2],[28730,2],[28863,2],[29037,2],[29080,2],[29090,2],[29097,1],[29099,2],[29102,2],[29118,1],[29120,1],[29130,2],[29225,1],[29232,2],[29324,1],[29336,2],[29415,2],[29423,1],[29425,1],[29441,1],[29462,2],[29534,2],[29653,1],[29708,1],[29742,1],[29744,2],[29846,1],[29874,1],[29886,1],[29942,2],[29999,1],[30053,2],[30158,1],[30212,2],[30339,1],[30393,2],[30436,2],[30453,1],[30489,1],[30491,1],[30505,1],[30530,1],[30553,1],[30586,2],[30598,1],[30623,1],[30630,1],[30655,1],[30674,1],[30697,2],[30713,1],[30753,2],[30773,1],[30799,1],[30970,1],[31016,1],[31052,1],[31109,1],[31143,1],[31248,1],[31281,1],[31409,1],[31443,1],[31485,1],[31487,1],[31611,1],[31691,1],[31693,1],[31751,1],[31758,1],[31846,1],[31857,1],[31897,1],[31916,1],[32217,1],[32480,1],[32524,1],[32526,1],[32617,1],[32766,1],[32807,1],[32823,2],[32866,1],[32878,2],[32913,1],[32936,2],[32992,1],[33024,2]]},"669":{"position":[[276,1],[323,1],[325,1],[342,2],[345,1],[380,1],[392,1],[413,1],[436,1],[438,2],[451,1],[461,2],[464,1],[466,2],[481,1],[496,1],[508,1],[541,1],[543,1],[560,2],[563,1],[602,1],[604,1],[606,1],[608,1],[610,1],[612,2],[615,1],[646,1],[658,1],[668,2],[671,1],[673,2],[688,1],[703,1],[715,1],[748,1],[750,1],[767,1],[769,1],[771,1],[773,1],[775,1],[777,1],[779,1],[781,1],[1131,1],[1133,1],[1209,2],[1212,1],[1398,2],[1470,2],[1494,1],[1510,1],[1512,1],[1539,2],[1639,1],[1700,2],[1784,2],[1964,2],[2007,3],[2011,2],[2032,1],[2042,1],[2044,1],[2138,2],[2141,1],[2198,3],[2202,2],[2213,1],[2240,2],[2319,1],[2321,1],[2363,1],[2377,1],[2379,2],[2478,2],[2552,2],[2637,2],[2770,2],[2944,2],[2987,2],[2997,2],[3004,1],[3006,2],[3009,2],[3025,1],[3027,1],[3037,2],[3132,1],[3139,2],[3230,1],[3242,2],[3321,2],[3329,1],[3331,1],[3348,1],[3369,2],[3441,2],[3560,1],[3615,1],[3649,1],[3651,2],[3753,1],[3781,1],[3793,1],[3849,2],[3906,1],[3960,2],[4065,1],[4119,2],[4246,1],[4300,2],[4343,2],[4360,1],[4396,1],[4398,1],[4412,1],[4437,1],[4460,1],[4493,2],[4505,1],[4530,1],[4537,1],[4561,1],[4580,1],[4603,2],[4619,1],[4659,2],[4679,1],[4706,1],[4877,1],[4923,1],[4959,1],[5016,1],[5050,1],[5155,1],[5188,1],[5316,1],[5350,1],[5392,1],[5394,1],[5518,1],[5598,1],[5600,1],[5658,1],[5665,1],[5752,1],[5763,1],[5803,1],[5822,1],[6123,1],[6387,1],[6431,1],[6433,1],[6524,1],[6672,1],[6714,1],[6729,2],[6771,1],[6783,2],[6818,1],[6841,2],[6897,1],[6929,2],[7380,1],[7382,1],[7455,2],[7458,1],[7647,2],[7719,2],[7743,1],[7759,1],[7761,1],[7788,2],[7888,1],[7949,2],[8033,2],[8213,2],[8256,3],[8260,2],[8281,1],[8291,1],[8293,1],[8390,2],[8393,1],[8450,3],[8454,2],[8465,1],[8492,2],[8571,1],[8573,1],[8615,1],[8629,1],[8631,2],[8730,2],[8804,2],[8889,2],[9022,2],[9196,2],[9239,2],[9249,2],[9256,1],[9258,2],[9261,2],[9277,1],[9279,1],[9289,2],[9384,1],[9391,2],[9485,1],[9497,2],[9576,2],[9584,1],[9586,1],[9603,1],[9624,2],[9696,2],[9815,1],[9870,1],[9904,1],[9906,2],[10008,1],[10036,1],[10048,1],[10104,2],[10161,1],[10215,2],[10320,1],[10374,2],[10501,1],[10555,2],[10598,2],[10615,1],[10651,1],[10653,1],[10667,1],[10692,1],[10715,1],[10748,2],[10760,1],[10785,1],[10792,1],[10819,1],[10838,1],[10861,2],[10877,1],[10917,2],[10937,1],[10964,1],[11135,1],[11181,1],[11217,1],[11274,1],[11308,1],[11413,1],[11446,1],[11574,1],[11608,1],[11650,1],[11652,1],[11776,1],[11856,1],[11858,1],[11916,1],[11923,1],[12013,1],[12024,1],[12064,1],[12083,1],[12387,1],[12651,1],[12695,1],[12697,1],[12788,1],[12939,1],[12981,1],[12999,2],[13044,1],[13056,2],[13091,1],[13114,2],[13170,1],[13202,2],[13638,1],[13640,1],[13712,2],[13715,1],[13801,2],[13804,1],[13991,2],[14063,2],[14087,1],[14103,1],[14105,1],[14132,2],[14232,1],[14293,2],[14377,2],[14557,2],[14600,3],[14604,2],[14625,1],[14635,1],[14637,1],[14732,2],[14735,1],[14792,3],[14796,2],[14807,1],[14834,2],[14913,1],[14915,1],[14957,1],[14971,1],[14973,2],[15072,2],[15146,2],[15231,2],[15364,2],[15538,2],[15581,2],[15591,2],[15598,1],[15600,2],[15603,2],[15619,1],[15621,1],[15631,2],[15726,1],[15733,2],[15825,1],[15837,2],[15916,2],[15924,1],[15926,1],[15943,1],[15964,2],[16036,2],[16155,1],[16210,1],[16244,1],[16246,2],[16348,1],[16376,1],[16388,1],[16444,2],[16501,1],[16555,2],[16660,1],[16714,2],[16841,1],[16895,2],[16938,2],[16955,1],[16991,1],[16993,1],[17007,1],[17032,1],[17055,1],[17088,2],[17100,1],[17125,1],[17132,1],[17157,1],[17176,1],[17199,2],[17215,1],[17255,2],[17275,1],[17302,1],[17473,1],[17519,1],[17555,1],[17612,1],[17646,1],[17751,1],[17784,1],[17912,1],[17946,1],[17988,1],[17990,1],[18114,1],[18194,1],[18196,1],[18254,1],[18261,1],[18349,1],[18360,1],[18400,1],[18419,1],[18721,1],[18985,1],[19029,1],[19031,1],[19122,1],[19271,1],[19313,1],[19329,2],[19372,1],[19384,2],[19419,1],[19442,2],[19498,1],[19530,2],[20041,1],[20043,1],[20121,2],[20124,1],[20314,2],[20386,2],[20410,1],[20426,1],[20428,1],[20455,2],[20555,1],[20616,2],[20700,2],[20880,2],[20923,3],[20927,2],[20948,1],[20958,1],[20960,1],[21056,2],[21059,1],[21116,3],[21120,2],[21131,1],[21157,2],[21236,1],[21238,1],[21280,1],[21294,1],[21296,2],[21395,2],[21469,2],[21554,2],[21687,2],[21861,2],[21904,2],[21914,2],[21921,1],[21923,2],[21926,2],[21942,1],[21944,1],[21954,2],[22049,1],[22056,2],[22149,1],[22161,2],[22240,2],[22248,1],[22250,1],[22266,1],[22287,2],[22359,2],[22478,1],[22533,1],[22567,1],[22569,2],[22671,1],[22699,1],[22711,1],[22767,2],[22824,1],[22878,2],[22983,1],[23037,2],[23164,1],[23218,2],[23261,2],[23278,1],[23314,1],[23316,1],[23330,1],[23355,1],[23378,1],[23411,2],[23423,1],[23448,1],[23455,1],[23481,1],[23500,1],[23523,2],[23539,1],[23579,2],[23599,1],[23625,1],[23796,1],[23842,1],[23878,1],[23935,1],[23969,1],[24074,1],[24107,1],[24235,1],[24269,1],[24311,1],[24313,1],[24437,1],[24517,1],[24519,1],[24577,1],[24584,1],[24673,1],[24684,1],[24724,1],[24743,1],[25045,1],[25308,1],[25352,1],[25354,1],[25445,1],[25595,1],[25636,1],[25653,2],[25697,1],[25709,2],[25744,1],[25767,2],[25823,1],[25855,2]]},"677":{"position":[[360,1],[407,1],[409,1],[444,1],[456,1],[466,2],[469,2],[484,1],[505,1],[517,3],[542,1],[544,1],[546,2],[561,1],[576,1],[588,1],[621,1],[623,1],[640,1],[642,1],[644,1],[646,1],[648,1],[650,2],[653,1],[670,1],[672,1],[674,1],[748,1],[750,1],[825,2],[828,1],[906,2],[909,1],[1084,1],[1131,1],[1133,1],[1168,1],[1180,1],[1190,2],[1193,2],[1209,1],[1230,1],[1242,3],[1267,1],[1269,1],[1271,2],[1286,1],[1301,1],[1313,1],[1346,1],[1348,1],[1365,1],[1367,1],[1369,1],[1371,1],[1373,1],[1375,2],[1378,1],[1395,1],[1397,1],[1399,1]]},"679":{"position":[[419,1],[466,1],[468,1],[503,1],[515,1],[525,2],[528,2],[541,1],[552,1],[563,1],[565,1],[575,2],[578,2],[581,1],[602,1],[625,1],[627,1],[629,1],[631,1],[633,2],[649,1],[670,1],[682,3],[707,1],[709,2],[724,1],[745,1],[757,3],[782,1],[784,1],[786,2],[801,1],[816,1],[828,1],[861,1],[863,1],[880,1],[882,1],[884,2],[897,1],[930,1],[932,1],[949,1],[951,1],[953,1],[955,1],[957,1],[959,2],[962,1],[979,1],[981,1],[983,1],[1112,2],[1184,2],[1208,1],[1224,1],[1226,1],[1253,2],[1353,1],[1414,2],[1498,2],[1678,2],[1721,3],[1725,2],[1746,1],[1756,1],[1758,1],[1854,2],[1857,1],[1914,3],[1918,2],[1929,1],[1955,2],[2034,1],[2036,1],[2078,1],[2092,1],[2094,2],[2193,2],[2267,2],[2352,2],[2485,2],[2659,2],[2702,2],[2712,2],[2719,1],[2721,2],[2724,2],[2740,1],[2742,1],[2752,2],[2847,1],[2854,2],[2947,1],[2959,2],[3038,2],[3046,1],[3048,1],[3064,1],[3085,2],[3157,2],[3276,1],[3331,1],[3365,1],[3367,2],[3469,1],[3497,1],[3509,1],[3565,2],[3622,1],[3676,2],[3781,1],[3835,2],[3962,1],[4016,2],[4059,2],[4076,1],[4112,1],[4114,1],[4128,1],[4153,1],[4176,1],[4209,2],[4221,1],[4246,1],[4253,1],[4277,1],[4299,1],[4321,2],[4337,1],[4377,2],[4397,1],[4423,1],[4594,1],[4640,1],[4676,1],[4733,1],[4767,1],[4872,1],[4905,1],[5033,1],[5067,1],[5109,1],[5111,1],[5235,1],[5315,1],[5317,1],[5375,1],[5382,1],[5471,1],[5482,1],[5522,1],[5541,1],[5843,1],[6106,1],[6150,1],[6152,1],[6243,1],[6393,1],[6434,1],[6449,2],[6491,1],[6506,2],[6544,1],[6566,2],[6621,1],[6653,2],[6730,2],[6802,2],[6826,1],[6842,1],[6844,1],[6871,2],[6971,1],[7032,2],[7116,2],[7296,2],[7339,3],[7343,2],[7364,1],[7374,1],[7376,1],[7471,2],[7474,1],[7531,3],[7535,2],[7546,1],[7572,2],[7651,1],[7653,1],[7695,1],[7709,1],[7711,2],[7810,2],[7884,2],[7969,2],[8102,2],[8276,2],[8319,2],[8329,2],[8336,1],[8338,2],[8341,2],[8357,1],[8359,1],[8369,2],[8464,1],[8471,2],[8563,1],[8575,2],[8654,2],[8662,1],[8664,1],[8680,1],[8701,2],[8773,2],[8892,1],[8947,1],[8981,1],[8983,2],[9085,1],[9113,1],[9125,1],[9181,2],[9238,1],[9292,2],[9397,1],[9451,2],[9578,1],[9632,2],[9675,2],[9692,1],[9728,1],[9730,1],[9744,1],[9769,1],[9792,1],[9825,2],[9837,1],[9862,1],[9869,1],[9893,1],[9914,1],[9936,2],[9952,1],[9992,2],[10012,1],[10038,1],[10209,1],[10255,1],[10291,1],[10348,1],[10382,1],[10487,1],[10520,1],[10648,1],[10682,1],[10724,1],[10726,1],[10850,1],[10930,1],[10932,1],[10990,1],[10997,1],[11085,1],[11096,1],[11136,1],[11155,1],[11456,1],[11719,1],[11763,1],[11765,1],[11856,1],[12005,1],[12046,1],[12061,2],[12103,1],[12117,2],[12154,1],[12176,2],[12231,1],[12263,2]]},"681":{"position":[[236,2],[308,2],[332,1],[348,1],[350,1],[377,2],[477,1],[538,2],[622,2],[802,2],[845,3],[881,1],[883,2],[928,1],[1001,2],[1004,2],[1007,1],[1063,3],[1086,2],[1165,1],[1167,1],[1209,1],[1223,1],[1225,2],[1324,2],[1398,2],[1483,2],[1616,2],[1790,2],[1833,2],[1843,2],[1850,1],[1852,2],[1855,2],[1871,1],[1873,1],[1883,2],[1978,1],[1985,2],[2045,1],[2047,2],[2219,2],[2222,1],[2224,1],[2236,2],[2329,2],[2336,1],[2338,2],[2341,2],[2357,1],[2378,2],[2450,2],[2569,1],[2624,1],[2658,1],[2660,2],[2762,1],[2790,1],[2802,1],[2858,2],[2915,1],[2969,2],[3074,1],[3128,2],[3255,1],[3309,2],[3352,2],[3369,1],[3405,1],[3407,1],[3421,1],[3452,1],[3475,1],[3508,2],[3520,1],[3547,1],[3556,1],[3585,1],[3587,2],[3638,1],[3645,1],[3672,1],[3691,1],[3712,1],[3714,2],[3717,2],[3733,1],[3792,1],[3963,1],[4009,1],[4045,1],[4102,1],[4136,1],[4241,1],[4274,1],[4402,1],[4436,1],[4478,1],[4480,1],[4604,1],[4684,1],[4686,1],[4744,1],[4751,1],[4758,1],[4802,1],[4913,3],[4917,2],[4920,2],[4923,1],[4934,1],[5208,1],[5252,1],[5254,1],[5345,1],[5362,1],[5377,1],[5453,2],[5819,2],[5864,1],[5938,1],[5940,2],[6120,2],[6192,2],[6216,1],[6232,1],[6234,1],[6261,2],[6361,1],[6422,2],[6506,2],[6686,2],[6729,3],[6733,2],[6754,1],[6764,1],[6766,1],[6865,2],[6868,1],[6925,3],[6929,2],[6940,1],[6966,2],[7045,1],[7047,1],[7089,1],[7103,1],[7105,2],[7204,2],[7278,2],[7363,2],[7496,2],[7670,2],[7713,2],[7723,2],[7730,1],[7732,2],[7735,2],[7751,1],[7753,1],[7763,2],[7858,1],[7865,2],[7961,1],[7973,2],[8052,2],[8060,1],[8062,1],[8078,1],[8099,2],[8171,2],[8290,1],[8345,1],[8379,1],[8381,2],[8483,1],[8511,1],[8523,1],[8579,2],[8636,1],[8690,2],[8795,1],[8849,2],[8976,1],[9030,2],[9073,2],[9090,1],[9126,1],[9128,1],[9142,1],[9167,1],[9190,1],[9223,2],[9235,1],[9260,1],[9267,1],[9294,1],[9316,1],[9338,2],[9354,1],[9394,2],[9414,1],[9440,1],[9611,1],[9657,1],[9693,1],[9750,1],[9784,1],[9889,1],[9922,1],[10050,1],[10084,1],[10126,1],[10128,1],[10252,1],[10332,1],[10334,1],[10392,1],[10399,1],[10491,1],[10502,1],[10542,1],[10561,1],[10866,1],[11129,1],[11173,1],[11175,1],[11266,1],[11419,1],[11460,1],[11478,2],[11523,1],[11538,2],[11576,1],[11598,2],[11653,1],[11685,2]]},"683":{"position":[[211,2],[283,2],[307,1],[323,1],[325,1],[352,2],[452,1],[513,2],[597,2],[777,2],[820,3],[824,2],[848,1],[857,1],[859,1],[884,3],[888,2],[898,1],[1164,2],[1243,1],[1245,1],[1287,1],[1301,1],[1303,2],[1402,2],[1476,2],[1561,2],[1694,2],[1868,2],[1911,2],[1921,2],[1928,1],[1930,2],[1933,2],[1949,1],[1951,1],[1961,2],[1989,2],[2011,1],[2023,2],[2108,2],[2116,1],[2118,1],[2375,1],[2396,2],[2468,2],[2587,1],[2642,1],[2676,1],[2678,2],[2780,1],[2808,1],[2820,1],[2876,2],[2933,1],[2987,2],[3092,1],[3146,2],[3273,1],[3327,2],[3370,2],[3387,1],[3423,1],[3425,1],[3439,1],[3463,2],[3475,1],[3501,1],[3503,2],[3519,1],[3558,2],[3566,1],[3568,1],[3825,1],[3846,1],[4017,1],[4063,1],[4099,1],[4156,1],[4190,1],[4295,1],[4328,1],[4456,1],[4490,1],[4532,1],[4534,1],[4658,1],[4738,1],[4740,2],[4748,1],[4760,1],[4771,1],[4810,1],[4821,1],[5546,1],[5590,1],[5592,1],[5683,1],[5685,1],[5960,2],[5986,2],[6488,2],[6560,2],[6584,1],[6600,1],[6602,1],[6629,2],[6729,1],[6790,2],[6874,2],[7054,2],[7097,3],[7133,1],[7135,1],[7205,1],[7278,2],[7281,2],[7284,1],[7340,3],[7363,2],[7442,1],[7444,1],[7486,1],[7500,1],[7502,2],[7601,2],[7675,2],[7760,2],[7893,2],[8067,2],[8110,2],[8120,2],[8127,1],[8129,2],[8132,2],[8148,1],[8150,1],[8160,2],[8255,1],[8262,2],[8322,1],[8448,2],[8451,1],[8580,2],[8583,1],[8585,1],[8597,2],[8690,2],[8697,1],[8699,2],[8702,2],[8718,1],[8739,2],[8811,2],[8930,1],[8985,1],[9019,1],[9021,2],[9123,1],[9151,1],[9163,1],[9219,2],[9276,1],[9330,2],[9435,1],[9489,2],[9616,1],[9670,2],[9713,2],[9730,1],[9766,1],[9768,1],[9782,1],[9813,1],[9836,1],[9869,2],[9881,1],[9908,1],[9917,1],[9946,1],[9954,1],[9961,1],[9985,1],[10004,1],[10025,2],[10034,1],[10041,1],[10068,1],[10087,1],[10108,1],[10110,2],[10113,2],[10129,1],[10188,1],[10359,1],[10405,1],[10441,1],[10498,1],[10532,1],[10637,1],[10670,1],[10798,1],[10832,1],[10874,1],[10876,1],[11000,1],[11080,1],[11082,1],[11140,1],[11147,1],[11154,1],[11262,2],[11345,3],[11349,2],[11352,2],[11355,1],[11366,1],[11640,1],[11684,1],[11686,1],[11777,1],[11794,1],[11809,1],[11954,2],[12436,1],[12507,2],[12510,1],[12584,1],[12586,2],[12750,2],[12822,2],[12846,1],[12862,1],[12864,1],[12891,2],[12991,1],[13052,2],[13136,2],[13316,2],[13359,3],[13396,1],[13398,1],[13468,1],[13541,2],[13544,2],[13547,1],[13603,3],[13626,2],[13705,1],[13707,1],[13749,1],[13763,1],[13765,2],[13864,2],[13938,2],[14023,2],[14156,2],[14330,2],[14373,2],[14383,2],[14390,1],[14392,2],[14395,2],[14411,1],[14413,1],[14423,2],[14518,1],[14525,2],[14586,1],[14712,2],[14715,1],[14844,2],[14847,1],[14849,1],[14861,2],[14954,2],[14961,1],[14963,2],[14966,2],[14982,1],[15003,2],[15075,2],[15194,1],[15249,1],[15283,1],[15285,2],[15387,1],[15415,1],[15427,1],[15483,2],[15540,1],[15594,2],[15699,1],[15753,2],[15880,1],[15934,2],[15977,2],[15994,1],[16030,1],[16032,1],[16046,1],[16077,1],[16100,1],[16133,2],[16145,1],[16172,1],[16182,1],[16211,1],[16219,1],[16226,1],[16250,1],[16269,1],[16290,2],[16299,1],[16306,1],[16333,1],[16352,1],[16373,1],[16375,2],[16378,2],[16394,1],[16453,1],[16624,1],[16670,1],[16706,1],[16763,1],[16797,1],[16902,1],[16935,1],[17063,1],[17097,1],[17139,1],[17141,1],[17265,1],[17345,1],[17347,1],[17405,1],[17412,1],[17419,1],[17529,2],[17612,4],[17617,2],[17620,2],[17623,1],[17634,1],[17908,1],[17952,1],[17954,1],[18045,1],[18063,1],[18078,1],[18223,2],[18630,1],[18701,2],[18704,1],[18778,1],[18780,2],[19052,2],[19124,2],[19148,1],[19164,1],[19166,1],[19193,2],[19293,1],[19354,2],[19438,2],[19618,2],[19661,3],[19665,2],[19686,1],[19696,1],[19698,1],[19794,2],[19797,1],[19854,3],[19858,2],[19869,1],[19895,2],[19974,1],[19976,1],[20018,1],[20032,1],[20034,2],[20133,2],[20207,2],[20292,2],[20425,2],[20599,2],[20642,2],[20652,2],[20659,1],[20661,2],[20664,2],[20680,1],[20682,1],[20692,2],[20787,1],[20794,2],[20887,1],[20899,2],[20978,2],[20986,1],[20988,1],[21004,1],[21025,2],[21097,2],[21216,1],[21271,1],[21305,1],[21307,2],[21409,1],[21437,1],[21449,1],[21505,2],[21562,1],[21616,2],[21721,1],[21775,2],[21902,1],[21956,2],[21999,2],[22016,1],[22052,1],[22054,1],[22068,1],[22093,1],[22116,1],[22149,2],[22161,1],[22186,1],[22193,1],[22217,1],[22239,1],[22261,2],[22277,1],[22317,2],[22337,1],[22363,1],[22534,1],[22580,1],[22616,1],[22673,1],[22707,1],[22812,1],[22845,1],[22973,1],[23007,1],[23049,1],[23051,1],[23175,1],[23255,1],[23257,1],[23315,1],[23322,1],[23411,1],[23422,1],[23462,1],[23481,1],[23783,1],[24046,1],[24090,1],[24092,1],[24183,1],[24333,1],[24374,1],[24389,2],[24431,1],[24446,2],[24484,1],[24506,2],[24561,1],[24593,2],[24715,2],[24787,2],[24811,1],[24827,1],[24829,1],[24856,2],[24956,1],[25017,2],[25101,2],[25281,2],[25324,3],[25328,2],[25349,1],[25359,1],[25361,1],[25454,2],[25457,1],[25514,3],[25518,2],[25529,1],[25556,2],[25635,1],[25637,1],[25679,1],[25693,1],[25695,2],[25794,2],[25868,2],[25953,2],[26086,2],[26260,2],[26303,2],[26313,2],[26320,1],[26322,2],[26325,2],[26341,1],[26343,1],[26353,2],[26448,1],[26455,2],[26545,1],[26557,2],[26636,2],[26644,1],[26646,1],[26663,1],[26684,2],[26756,2],[26875,1],[26930,1],[26964,1],[26966,2],[27068,1],[27096,1],[27108,1],[27164,2],[27221,1],[27275,2],[27380,1],[27434,2],[27561,1],[27615,2],[27658,2],[27675,1],[27711,1],[27713,1],[27727,1],[27752,1],[27775,1],[27808,2],[27820,1],[27845,1],[27852,1],[27876,1],[27895,1],[27917,2],[27933,1],[27973,2],[27993,1],[28020,1],[28191,1],[28237,1],[28273,1],[28330,1],[28364,1],[28469,1],[28502,1],[28630,1],[28664,1],[28706,1],[28708,1],[28832,1],[28912,1],[28914,1],[28972,1],[28979,1],[29065,1],[29076,1],[29116,1],[29135,1],[29435,1],[29699,1],[29743,1],[29745,1],[29836,1],[29983,1],[30025,1],[30040,2],[30082,1],[30094,2],[30129,1],[30151,2],[30206,1],[30238,2]]},"685":{"position":[[223,1],[270,1],[272,1],[307,1],[319,1],[329,2],[332,2],[348,1],[369,1],[381,3],[406,1],[408,1],[410,2],[425,1],[440,1],[452,1],[485,1],[487,1],[504,1],[506,1],[508,1],[510,1],[512,1],[514,2],[517,1],[534,1],[536,1],[538,1]]},"693":{"position":[[782,1],[941,1]]},"695":{"position":[[1296,1],[1343,1],[1345,1],[1362,2],[1365,1],[1404,1],[1416,1],[1426,2],[1429,2],[1451,1],[1461,2],[1464,2],[1485,1],[1495,2],[1498,1],[1500,2],[1515,1],[1530,1],[1542,1],[1575,1],[1577,1],[1594,1],[1596,1],[1598,2],[1620,1],[1653,1],[1655,1],[1672,1],[1674,1],[1676,2],[1697,1],[1730,1],[1732,1],[1749,1],[1751,1],[1753,1],[1755,1],[1757,1],[1759,2],[1762,1],[1796,1],[1807,1],[1817,2],[1820,2],[1834,1],[1844,2],[1847,2],[1861,1],[1881,1],[1895,1],[1907,3],[1931,2],[1953,1],[1965,3],[1999,1],[2001,1],[2003,2],[2016,1],[2027,1],[2038,1],[2040,1],[2060,1],[2074,1],[2086,3],[2110,2],[2132,1],[2144,3],[2177,1],[2179,1],[2181,2],[2184,1],[2204,1],[2218,1],[2230,3],[2256,2],[2278,1],[2290,3],[2323,1],[2325,1],[2327,2],[2330,1],[2351,1],[2363,3],[2389,1],[2391,1],[2393,1],[2395,1],[2397,2],[2414,1],[2435,1],[2447,3],[2473,1],[2475,2],[2490,1],[2511,1],[2523,3],[2548,1],[2550,2],[2565,1],[2586,1],[2598,3],[2623,1],[2625,1],[2627,2],[2642,1],[2657,1],[2668,1],[2701,1],[2703,1],[2728,1],[2730,1],[2732,2],[2746,1],[2779,1],[2781,1],[2806,1],[2808,1],[2810,1],[2812,1],[2814,1],[2816,1],[2818,1],[2820,1],[3233,1],[3235,2],[3290,1],[3367,2],[3422,1],[3499,2],[3554,1],[3631,2],[3686,1],[3763,2],[3818,1],[3895,2],[3928,1],[3995,2],[4038,1],[4107,2],[4110,2],[4113,1],[4169,3],[4181,2],[4276,1],[4283,2],[4343,1],[4345,2],[4531,2],[4534,1],[4536,2],[4722,2],[4725,1],[4727,2],[4913,2],[4916,1],[4918,2],[5104,2],[5107,1],[5109,2],[5295,2],[5298,1],[5300,2],[5454,2],[5457,1],[5459,2],[5625,2],[5628,1],[5630,1],[5642,2],[5735,2],[5742,1],[5744,2],[5747,2],[5763,1],[5777,1],[5808,1],[5831,1],[5864,2],[5876,1],[5903,1],[5912,1],[5941,1],[5943,2],[6004,1],[6011,1],[6035,1],[6063,1],[6082,2],[6085,2],[6146,1],[6153,1],[6177,1],[6205,1],[6224,2],[6227,2],[6288,1],[6295,1],[6319,1],[6347,1],[6366,2],[6369,2],[6430,1],[6437,1],[6461,1],[6489,1],[6508,2],[6511,2],[6572,1],[6579,1],[6603,1],[6631,1],[6650,2],[6653,2],[6692,1],[6699,1],[6728,1],[6746,1],[6760,2],[6763,2],[6812,1],[6819,1],[6848,1],[6868,1],[6882,1],[6884,2],[6887,2],[6903,1],[6951,1],[6953,1],[7011,1],[7018,1],[7025,1],[7069,1],[7194,2],[7210,1],[7335,2],[7351,1],[7476,2],[7492,1],[7617,2],[7633,1],[7758,2],[7774,1],[7867,2],[7883,1],[7988,3],[7992,2],[7995,2],[7998,1],[8009,1],[8105,1],[8149,1],[8151,1],[8242,1],[8259,1],[8274,1],[8792,2],[9704,2],[9759,1],[9837,2],[9840,2],[9895,1],[9973,2],[9976,2],[10031,1],[10109,2],[10112,2],[10167,1],[10245,2],[10248,2],[10303,1],[10381,2],[10384,2],[10417,1],[10485,2],[10488,2],[10531,1],[10601,1],[10603,2]]},"701":{"position":[[272,2],[293,1],[303,1],[305,1],[393,2],[396,1],[453,3],[457,2],[468,1],[483,2],[578,1],[585,2],[670,1],[682,2],[761,2],[769,1],[771,1],[787,1],[801,1],[826,1],[849,1],[882,2],[894,1],[919,1],[926,1],[950,1],[971,1],[986,2],[1002,1],[1042,2],[1062,1],[1077,1],[1079,1],[1137,1],[1144,1],[1225,1],[1236,1],[1276,1],[1295,1],[1411,1],[1496,1],[1540,1],[1542,1],[1633,1],[1775,1],[1816,1],[1831,2],[1873,1],[1887,2],[1924,1],[1939,2],[1987,1],[2019,2],[2103,2],[2124,1],[2134,1],[2136,1],[2226,2],[2229,1],[2286,3],[2290,2],[2301,1],[2316,2],[2411,1],[2418,2],[2505,1],[2517,2],[2596,2],[2604,1],[2606,1],[2622,1],[2636,1],[2661,1],[2684,1],[2717,2],[2729,1],[2754,1],[2761,1],[2785,1],[2808,1],[2823,2],[2839,1],[2879,2],[2899,1],[2914,1],[2916,1],[2974,1],[2981,1],[3064,1],[3075,1],[3115,1],[3134,1],[3252,1],[3337,1],[3381,1],[3383,1],[3474,1],[3618,1],[3659,1],[3674,2],[3716,1],[3732,2],[3771,1],[3786,2],[3834,1],[3866,2],[3893,1],[3962,2],[3983,1],[3993,1],[3995,1],[4083,2],[4086,1],[4143,3],[4147,2],[4158,1],[4173,2],[4268,1],[4275,2],[4360,1],[4372,2],[4451,2],[4459,1],[4461,1],[4477,1],[4491,1],[4516,1],[4539,1],[4572,2],[4584,1],[4609,1],[4616,1],[4640,1],[4661,1],[4676,2],[4692,1],[4732,2],[4752,1],[4767,1],[4769,1],[4827,1],[4834,1],[4915,1],[4926,1],[4966,1],[4985,1],[5101,1],[5186,1],[5230,1],[5232,1],[5323,1],[5465,1],[5506,1],[5521,2],[5563,1],[5577,2],[5614,1],[5629,2],[5677,1],[5709,2],[5724,1],[5798,2],[5819,1],[5829,1],[5831,1],[5921,2],[5924,1],[5981,3],[5985,2],[5996,1],[6012,2],[6107,1],[6114,2],[6201,1],[6213,2],[6292,2],[6300,1],[6302,1],[6319,1],[6333,1],[6358,1],[6381,1],[6414,2],[6426,1],[6451,1],[6458,1],[6482,1],[6505,1],[6520,2],[6536,1],[6576,2],[6596,1],[6612,1],[6614,1],[6672,1],[6679,1],[6762,1],[6773,1],[6813,1],[6832,1],[6951,1],[7037,1],[7081,1],[7083,1],[7174,1],[7318,1],[7360,1],[7375,2],[7417,1],[7433,2],[7472,1],[7487,2],[7535,1],[7567,2],[7583,1],[7655,2],[7676,1],[7686,1],[7688,1],[7776,2],[7779,1],[7836,3],[7840,2],[7851,1],[7867,2],[7962,1],[7969,2],[8054,1],[8066,2],[8145,2],[8153,1],[8155,1],[8172,1],[8186,1],[8211,1],[8234,1],[8267,2],[8279,1],[8304,1],[8311,1],[8335,1],[8356,1],[8371,2],[8387,1],[8427,2],[8447,1],[8463,1],[8465,1],[8523,1],[8530,1],[8611,1],[8622,1],[8662,1],[8681,1],[8798,1],[8884,1],[8928,1],[8930,1],[9021,1],[9163,1],[9205,1],[9220,2],[9262,1],[9276,2],[9313,1],[9328,2],[9376,1],[9408,2],[9424,1],[9498,2],[9519,1],[9529,1],[9531,1],[9621,2],[9624,1],[9681,3],[9685,2],[9696,1],[9712,2],[9807,1],[9814,2],[9901,1],[9913,2],[9992,2],[10000,1],[10002,1],[10019,1],[10033,1],[10058,1],[10081,1],[10114,2],[10126,1],[10151,1],[10158,1],[10182,1],[10205,1],[10220,2],[10236,1],[10276,2],[10296,1],[10312,1],[10314,1],[10372,1],[10379,1],[10462,1],[10473,1],[10513,1],[10532,1],[10651,1],[10737,1],[10781,1],[10783,1],[10874,1],[11018,1],[11060,1],[11075,2],[11117,1],[11133,2],[11172,1],[11187,2],[11235,1],[11267,2]]},"703":{"position":[[1343,1],[1382,1],[1394,1],[1404,2],[1407,2],[1429,1],[1447,1],[1458,1],[1460,1],[1470,2],[1473,2],[1476,1],[1497,1],[1509,3],[1543,1],[1545,1],[1547,1],[1549,1],[1551,2],[1577,1],[1588,1],[1599,1],[1601,1],[1611,2],[1614,2],[1617,1],[1638,1],[1650,3],[1684,1],[1686,1],[1688,1],[1690,1],[1692,2],[1713,1],[1731,1],[1742,1],[1744,1],[1765,1],[1777,3],[1815,1],[1817,2],[1820,1],[1841,1],[1853,3],[1887,1],[1889,1],[1891,1],[1893,1],[1895,2],[1917,1],[1927,2],[1930,1],[1932,2],[1947,1],[1962,1],[1974,1],[2007,1],[2009,1],[2026,1],[2028,1],[2030,2],[2052,1],[2085,1],[2087,1],[2104,1],[2106,1],[2108,2],[2134,1],[2167,1],[2169,1],[2186,1],[2188,1],[2190,2],[2212,1],[2245,1],[2247,1],[2264,1],[2266,1],[2268,1],[2270,1],[2272,1],[2274,1],[2850,2],[2871,1],[2881,1],[2883,1],[2971,2],[2974,1],[3031,3],[3035,2],[3046,1],[3062,2],[3157,1],[3164,2],[3249,1],[3261,2],[3340,2],[3348,1],[3350,1],[3367,1],[3381,1],[3406,1],[3429,1],[3462,2],[3474,1],[3499,1],[3506,1],[3530,1],[3551,1],[3566,2],[3582,1],[3622,2],[3642,1],[3658,1],[3660,1],[3718,1],[3725,1],[3806,1],[3817,1],[3857,1],[3876,1],[3993,1],[4079,1],[4123,1],[4125,1],[4216,1],[4358,1],[4400,1],[4415,2],[4457,1],[4471,2],[4508,1],[4523,2],[4571,1],[4603,2],[4797,2],[4869,2],[4893,1],[4909,1],[4911,1],[4938,2],[5038,1],[5099,2],[5183,2],[5363,2],[5406,3],[5442,1],[5444,2],[5502,1],[5579,2],[5582,2],[5585,1],[5641,3],[5664,2],[5743,1],[5745,1],[5787,1],[5801,1],[5803,2],[5902,2],[5976,2],[6061,2],[6194,2],[6368,2],[6411,2],[6421,2],[6428,1],[6430,2],[6433,2],[6449,1],[6451,1],[6461,2],[6556,1],[6563,2],[6623,1],[6625,2],[6814,2],[6817,1],[6819,1],[6831,2],[6924,2],[6931,1],[6933,2],[6936,2],[6952,1],[6973,2],[7045,2],[7164,1],[7219,1],[7253,1],[7255,2],[7357,1],[7385,1],[7397,1],[7453,2],[7510,1],[7564,2],[7669,1],[7723,2],[7850,1],[7904,2],[7947,2],[7964,1],[8000,1],[8002,1],[8016,1],[8047,1],[8070,1],[8103,2],[8115,1],[8142,1],[8151,1],[8180,1],[8182,2],[8246,1],[8253,1],[8277,1],[8305,1],[8324,1],[8326,2],[8329,2],[8345,1],[8404,1],[8575,1],[8621,1],[8657,1],[8714,1],[8748,1],[8853,1],[8886,1],[9014,1],[9048,1],[9090,1],[9092,1],[9216,1],[9296,1],[9298,1],[9356,1],[9363,1],[9370,1],[9414,1],[9542,3],[9546,2],[9549,2],[9552,1],[9563,1],[9837,1],[9881,1],[9883,1],[9974,1],[9991,1],[10006,1],[10086,2],[10456,2],[10514,1],[10592,1],[10594,2],[10740,2],[10761,1],[10771,1],[10773,1],[10861,2],[10864,1],[10921,3],[10925,2],[10936,1],[10951,2],[11046,1],[11053,2],[11138,1],[11150,2],[11229,2],[11237,1],[11239,1],[11255,1],[11269,1],[11294,1],[11317,1],[11350,2],[11362,1],[11387,1],[11394,1],[11418,1],[11439,1],[11454,2],[11470,1],[11510,2],[11530,1],[11545,1],[11547,1],[11605,1],[11612,1],[11693,1],[11704,1],[11744,1],[11763,1],[11879,1],[11964,1],[12008,1],[12010,1],[12101,1],[12243,1],[12284,1],[12299,2],[12341,1],[12355,2],[12392,1],[12407,2],[12455,1],[12487,2]]},"705":{"position":[[1188,2],[1260,2],[1284,1],[1300,1],[1302,1],[1329,2],[1429,1],[1490,2],[1574,2],[1754,2],[1797,3],[1834,1],[1836,2],[1921,1],[1998,2],[2001,2],[2004,1],[2060,3],[2083,2],[2162,1],[2164,1],[2206,1],[2220,1],[2222,2],[2321,2],[2395,2],[2480,2],[2613,2],[2787,2],[2830,2],[2840,2],[2847,1],[2849,2],[2852,2],[2868,1],[2870,1],[2880,2],[2975,1],[2982,2],[3043,1],[3045,2],[3261,2],[3264,1],[3266,1],[3278,2],[3371,2],[3378,1],[3380,2],[3383,2],[3399,1],[3420,2],[3492,2],[3611,1],[3666,1],[3700,1],[3702,2],[3804,1],[3832,1],[3844,1],[3900,2],[3957,1],[4011,2],[4116,1],[4170,2],[4297,1],[4351,2],[4394,2],[4411,1],[4447,1],[4449,1],[4463,1],[4494,1],[4517,1],[4550,2],[4562,1],[4589,1],[4599,1],[4628,1],[4630,2],[4721,1],[4728,1],[4752,1],[4780,1],[4799,1],[4801,2],[4804,2],[4820,1],[4879,1],[5050,1],[5096,1],[5132,1],[5189,1],[5223,1],[5328,1],[5361,1],[5489,1],[5523,1],[5565,1],[5567,1],[5691,1],[5771,1],[5773,1],[5831,1],[5838,1],[5845,1],[5891,1],[6046,4],[6051,2],[6054,2],[6057,1],[6068,1],[6342,1],[6386,1],[6388,1],[6479,1],[6497,1],[6512,1],[6592,2],[6925,2],[7010,1],[7088,1],[7090,2],[7294,2],[7315,1],[7325,1],[7327,1],[7434,1],[7436,1],[7511,1],[7513,3],[7517,1],[7574,3],[7578,2],[7589,1],[7604,2],[7699,1],[7706,2],[7828,1],[7904,1],[7906,1],[7908,1],[7920,2],[7999,2],[8007,1],[8009,1],[8025,1],[8039,1],[8064,1],[8087,1],[8120,2],[8132,1],[8157,1],[8164,1],[8188,1],[8209,1],[8242,1],[8350,2],[8353,2],[8369,1],[8409,2],[8429,1],[8444,1],[8446,1],[8504,1],[8511,1],[8698,2],[8701,1],[8712,1],[8752,1],[8771,1],[8950,1],[9035,1],[9079,1],[9081,1],[9172,1],[9427,1],[9468,1],[9483,2],[9525,1],[9539,2],[9576,1],[9591,2],[9640,1],[9642,1],[9644,2],[9684,1],[9708,1],[9736,1],[9756,2],[9776,1],[9808,2],[9965,2],[9986,1],[9996,1],[9998,1],[10105,1],[10107,1],[10182,1],[10184,3],[10188,1],[10245,3],[10249,2],[10260,1],[10276,2],[10371,1],[10378,2],[10500,1],[10576,1],[10578,1],[10580,1],[10592,2],[10671,2],[10679,1],[10681,1],[10698,1],[10712,1],[10737,1],[10760,1],[10793,2],[10805,1],[10830,1],[10837,1],[10861,1],[10882,1],[10915,1],[11023,2],[11026,2],[11042,1],[11082,2],[11102,1],[11118,1],[11120,1],[11178,1],[11185,1],[11372,2],[11375,1],[11386,1],[11426,1],[11445,1],[11625,1],[11711,1],[11755,1],[11757,1],[11848,1],[12103,1],[12145,1],[12160,2],[12202,1],[12216,2],[12253,1],[12268,2],[12317,1],[12319,1],[12321,2],[12361,1],[12385,1],[12413,1],[12433,2],[12453,1],[12485,2]]},"707":{"position":[[634,1],[681,1],[683,1],[700,2],[703,1],[742,1],[754,1],[764,2],[767,2],[789,1],[807,1],[818,1],[820,1],[830,2],[833,2],[836,1],[857,1],[869,3],[903,1],[905,1],[907,1],[909,1],[911,2],[937,1],[948,1],[959,1],[961,1],[971,2],[974,2],[977,1],[998,1],[1010,3],[1044,1],[1046,1],[1048,1],[1050,1],[1052,2],[1073,1],[1091,1],[1102,1],[1104,1],[1125,1],[1137,3],[1175,1],[1177,2],[1180,1],[1201,1],[1213,3],[1247,1],[1249,1],[1251,1],[1253,1],[1255,2],[1277,1],[1287,2],[1290,1],[1292,2],[1307,1],[1322,1],[1334,1],[1367,1],[1369,1],[1386,1],[1388,1],[1390,2],[1412,1],[1445,1],[1447,1],[1464,1],[1466,1],[1468,2],[1494,1],[1527,1],[1529,1],[1546,1],[1548,1],[1550,2],[1572,1],[1605,1],[1607,1],[1624,1],[1626,1],[1628,1],[1630,1],[1632,1],[1634,2],[1637,1],[1671,1],[1682,1],[1692,2],[1695,2],[1709,1],[1719,2],[1722,2],[1736,1],[1756,1],[1770,1],[1782,3],[1806,2],[1828,1],[1840,3],[1874,1],[1876,1],[1878,2],[1891,1],[1902,1],[1913,1],[1915,1],[1936,1],[1948,3],[1974,1],[1976,2],[1979,1],[1999,1],[2013,1],[2025,3],[2049,2],[2071,1],[2083,3],[2116,1],[2118,1],[2120,2],[2123,1],[2143,1],[2157,1],[2169,3],[2195,2],[2217,1],[2229,3],[2262,1],[2264,1],[2266,1],[2268,1],[2270,1],[2272,2],[2289,1],[2310,1],[2322,3],[2348,1],[2350,2],[2365,1],[2386,1],[2398,3],[2423,1],[2425,2],[2440,1],[2461,1],[2473,3],[2498,1],[2500,1],[2502,2],[2517,1],[2532,1],[2543,1],[2576,1],[2578,1],[2603,1],[2605,1],[2607,2],[2621,1],[2654,1],[2656,1],[2681,1],[2683,1],[2685,1],[2687,1],[2689,1],[2691,1],[2693,1],[2695,1],[2772,1],[2774,2],[2829,1],[2906,2],[2961,1],[3038,2],[3093,1],[3170,2],[3225,1],[3302,2],[3357,1],[3434,2],[3467,1],[3534,2],[3577,1],[3646,2],[3649,2],[3652,1],[3708,3],[3720,2],[3815,1],[3822,2],[3882,1],[3884,2],[4070,2],[4073,1],[4075,2],[4261,2],[4264,1],[4266,2],[4452,2],[4455,1],[4457,2],[4643,2],[4646,1],[4648,2],[4834,2],[4837,1],[4839,2],[4993,2],[4996,1],[4998,2],[5164,2],[5167,1],[5169,1],[5181,2],[5274,2],[5281,1],[5283,2],[5286,2],[5302,1],[5316,1],[5347,1],[5370,1],[5403,2],[5415,1],[5442,1],[5451,1],[5480,1],[5482,2],[5543,1],[5550,1],[5574,1],[5602,1],[5621,2],[5624,2],[5685,1],[5692,1],[5716,1],[5744,1],[5763,2],[5766,2],[5827,1],[5834,1],[5858,1],[5886,1],[5905,2],[5908,2],[5969,1],[5976,1],[6000,1],[6028,1],[6047,2],[6050,2],[6111,1],[6118,1],[6142,1],[6170,1],[6189,2],[6192,2],[6231,1],[6238,1],[6267,1],[6285,1],[6299,2],[6302,2],[6351,1],[6358,1],[6387,1],[6407,1],[6421,1],[6423,2],[6426,2],[6442,1],[6490,1],[6492,1],[6550,1],[6557,1],[6564,1],[6608,1],[6733,2],[6749,1],[6874,2],[6890,1],[7015,2],[7031,1],[7156,2],[7172,1],[7297,2],[7313,1],[7406,2],[7422,1],[7527,3],[7531,2],[7534,2],[7537,1],[7548,1],[7644,1],[7688,1],[7690,1],[7781,1],[7798,1],[7813,1],[8331,2],[9243,2],[9298,1],[9376,2],[9379,2],[9434,1],[9512,2],[9515,2],[9570,1],[9648,2],[9651,2],[9706,1],[9784,2],[9787,2],[9842,1],[9920,2],[9923,2],[9956,1],[10024,2],[10027,2],[10070,1],[10140,1],[10142,2]]},"713":{"position":[[441,1],[835,1],[1027,1]]},"724":{"position":[[797,1],[844,1],[846,1],[863,2],[866,1],[900,1],[921,1],[931,2],[934,1],[936,2],[951,1],[966,1],[987,1],[1020,1],[1022,1],[1039,1],[1041,1],[1043,1],[1045,1],[1047,1],[1049,2],[1052,1],[1083,1],[1099,1],[1109,2],[1112,1],[1114,2],[1129,1],[1144,1],[1160,1],[1193,1],[1195,1],[1220,1],[1222,1],[1224,1],[1226,1],[1228,1],[1230,2],[1233,1],[1272,1],[1284,1],[1294,2],[1297,1],[1299,2],[1314,1],[1329,1],[1341,1],[1374,1],[1376,1],[1393,1],[1395,1],[1397,1],[1399,1],[1401,1],[1403,1],[1405,1],[1407,1]]},"726":{"position":[[250,2],[322,2],[346,1],[362,1],[364,1],[391,2],[491,1],[552,2],[636,2],[816,2],[859,3],[895,1],[897,2],[959,1],[1036,2],[1098,1],[1175,2],[1250,1],[1330,2],[1398,1],[1481,2],[1562,1],[1648,2],[1729,1],[1809,2],[1812,2],[1815,1],[1871,3],[1894,2],[1973,1],[1975,1],[2017,1],[2031,1],[2033,2],[2132,2],[2206,2],[2291,2],[2424,2],[2598,2],[2641,2],[2651,2],[2658,1],[2660,2],[2663,2],[2679,1],[2681,1],[2691,2],[2786,1],[2793,2],[2853,1],[2855,2],[3048,2],[3051,1],[3053,2],[3246,2],[3249,1],[3251,2],[3460,2],[3463,1],[3465,2],[3670,2],[3673,1],[3675,2],[3896,2],[3899,1],[3901,2],[4116,2],[4119,1],[4121,1],[4133,2],[4226,2],[4233,1],[4235,2],[4238,2],[4254,1],[4275,2],[4347,2],[4466,1],[4521,1],[4555,1],[4557,2],[4659,1],[4687,1],[4699,1],[4755,2],[4812,1],[4866,2],[4971,1],[5025,2],[5152,1],[5206,2],[5249,2],[5266,1],[5302,1],[5304,1],[5318,1],[5349,1],[5372,1],[5405,2],[5417,1],[5444,1],[5453,1],[5482,1],[5484,2],[5552,1],[5559,1],[5583,1],[5611,1],[5630,2],[5633,2],[5701,1],[5708,1],[5732,1],[5760,1],[5779,2],[5782,2],[5863,1],[5870,1],[5894,1],[5922,1],[5944,2],[5947,2],[6021,1],[6028,1],[6058,1],[6086,1],[6105,2],[6108,2],[6195,1],[6202,1],[6232,1],[6260,1],[6282,2],[6285,2],[6372,1],[6379,1],[6409,1],[6437,1],[6453,1],[6455,2],[6458,2],[6474,1],[6533,1],[6704,1],[6750,1],[6786,1],[6843,1],[6877,1],[6982,1],[7015,1],[7143,1],[7177,1],[7219,1],[7221,1],[7345,1],[7425,1],[7427,1],[7485,1],[7492,1],[7499,1],[7543,1],[7675,2],[7691,1],[7823,2],[7839,1],[7987,2],[8003,1],[8147,2],[8163,1],[8323,2],[8339,1],[8493,3],[8497,2],[8500,2],[8503,1],[8514,1],[8788,1],[8832,1],[8834,1],[8925,1],[8942,1],[8957,1],[9438,2],[10444,2],[10506,1],[10584,2],[10587,2],[10649,1],[10727,2],[10730,2],[10805,1],[10886,2],[10889,2],[10957,1],[11041,2],[11044,2],[11125,1],[11212,2],[11215,2],[11296,1],[11377,1],[11379,2],[11568,2],[11640,2],[11664,1],[11680,1],[11682,1],[11709,2],[11809,1],[11870,2],[11954,2],[12134,2],[12177,3],[12213,1],[12215,2],[12285,1],[12361,2],[12435,1],[12511,2],[12586,1],[12667,2],[12670,2],[12673,1],[12729,3],[12752,2],[12831,1],[12833,1],[12875,1],[12889,1],[12891,2],[12990,2],[13064,2],[13149,2],[13282,2],[13456,2],[13499,2],[13509,2],[13516,1],[13518,2],[13521,2],[13537,1],[13539,1],[13549,2],[13644,1],[13651,2],[13711,1],[13713,2],[13913,2],[13916,1],[13918,2],[14122,2],[14125,1],[14127,2],[14337,2],[14340,1],[14342,1],[14354,2],[14447,2],[14454,1],[14456,2],[14459,2],[14475,1],[14496,2],[14568,2],[14687,1],[14742,1],[14776,1],[14778,2],[14880,1],[14908,1],[14920,1],[14976,2],[15033,1],[15087,2],[15192,1],[15246,2],[15373,1],[15427,2],[15470,2],[15487,1],[15523,1],[15525,1],[15539,1],[15570,1],[15593,1],[15626,2],[15638,1],[15665,1],[15674,1],[15703,1],[15705,2],[15781,1],[15788,1],[15821,1],[15844,1],[15858,2],[15861,2],[15941,1],[15948,1],[15981,1],[16004,1],[16018,2],[16021,2],[16102,1],[16109,1],[16141,1],[16164,1],[16184,1],[16186,2],[16189,2],[16205,1],[16264,1],[16435,1],[16481,1],[16517,1],[16574,1],[16608,1],[16713,1],[16746,1],[16874,1],[16908,1],[16950,1],[16952,1],[17076,1],[17156,1],[17158,1],[17216,1],[17223,1],[17230,1],[17274,1],[17413,2],[17429,1],[17572,2],[17588,1],[17737,3],[17741,2],[17744,2],[17747,1],[17758,1],[18032,1],[18076,1],[18078,1],[18169,1],[18186,1],[18201,1],[18435,2],[19053,2],[19123,1],[19200,2],[19203,2],[19277,1],[19354,2],[19357,2],[19432,1],[19514,1],[19516,2],[19705,2],[19777,2],[19801,1],[19817,1],[19819,1],[19846,2],[19946,1],[20007,2],[20091,2],[20271,2],[20314,3],[20350,1],[20352,2],[20409,1],[20481,2],[20529,1],[20601,2],[20660,1],[20734,2],[20737,2],[20740,1],[20796,3],[20819,2],[20898,1],[20900,1],[20942,1],[20956,1],[20958,2],[21057,2],[21131,2],[21216,2],[21349,2],[21523,2],[21566,2],[21576,2],[21583,1],[21585,2],[21588,2],[21604,1],[21606,1],[21616,2],[21711,1],[21718,2],[21778,1],[21780,2],[21963,2],[21966,1],[21968,2],[22142,2],[22145,1],[22147,2],[22334,2],[22337,1],[22339,1],[22351,2],[22444,2],[22451,1],[22453,2],[22456,2],[22472,1],[22493,2],[22565,2],[22684,1],[22739,1],[22773,1],[22775,2],[22877,1],[22905,1],[22917,1],[22973,2],[23030,1],[23084,2],[23189,1],[23243,2],[23370,1],[23424,2],[23467,2],[23484,1],[23520,1],[23522,1],[23536,1],[23567,1],[23590,1],[23623,2],[23635,1],[23662,1],[23671,1],[23700,1],[23702,2],[23765,1],[23772,1],[23796,1],[23815,1],[23838,2],[23841,2],[23895,1],[23902,1],[23926,1],[23945,1],[23968,2],[23971,2],[24036,1],[24043,1],[24070,1],[24089,1],[24111,1],[24113,2],[24116,2],[24132,1],[24191,1],[24362,1],[24408,1],[24444,1],[24501,1],[24535,1],[24640,1],[24673,1],[24801,1],[24835,1],[24877,1],[24879,1],[25003,1],[25083,1],[25085,1],[25143,1],[25150,1],[25157,1],[25201,1],[25323,2],[25339,1],[25452,2],[25468,1],[25594,3],[25598,2],[25601,2],[25604,1],[25615,1],[25889,1],[25933,1],[25935,1],[26026,1],[26043,1],[26058,1],[26277,2],[26880,2],[26937,1],[27010,2],[27013,2],[27061,1],[27134,2],[27137,2],[27196,1],[27271,1],[27273,2],[28304,2],[28376,2],[28400,1],[28416,1],[28418,1],[28445,2],[28545,1],[28606,2],[28690,2],[28870,2],[28913,3],[28917,2],[28938,1],[28948,1],[28950,1],[29045,2],[29048,1],[29105,3],[29109,2],[29120,1],[29146,2],[29225,1],[29227,1],[29269,1],[29283,1],[29285,2],[29384,2],[29458,2],[29543,2],[29676,2],[29850,2],[29893,2],[29903,2],[29910,1],[29912,2],[29915,2],[29931,1],[29933,1],[29943,2],[30038,1],[30045,2],[30137,1],[30149,2],[30228,2],[30236,1],[30238,1],[30254,1],[30275,2],[30347,2],[30466,1],[30521,1],[30555,1],[30557,2],[30659,1],[30687,1],[30699,1],[30755,2],[30812,1],[30866,2],[30971,1],[31025,2],[31152,1],[31206,2],[31249,2],[31266,1],[31302,1],[31304,1],[31318,1],[31343,1],[31366,1],[31399,2],[31411,1],[31436,1],[31443,1],[31467,1],[31486,1],[31510,2],[31526,1],[31566,2],[31586,1],[31612,1],[31783,1],[31829,1],[31865,1],[31922,1],[31956,1],[32061,1],[32094,1],[32222,1],[32256,1],[32298,1],[32300,1],[32424,1],[32504,1],[32506,1],[32564,1],[32571,1],[32659,1],[32670,1],[32710,1],[32729,1],[33030,1],[33293,1],[33337,1],[33339,1],[33430,1],[33579,1],[33620,1],[33635,2],[33677,1],[33689,2],[33724,1],[33748,2],[33805,1],[33837,2],[34063,2],[34135,2],[34159,1],[34175,1],[34177,1],[34204,2],[34304,1],[34365,2],[34449,2],[34629,2],[34672,3],[34676,2],[34697,1],[34707,1],[34709,1],[34804,2],[34807,1],[34864,3],[34868,2],[34879,1],[34906,2],[34985,1],[34987,1],[35029,1],[35043,1],[35045,2],[35144,2],[35218,2],[35303,2],[35436,2],[35610,2],[35653,2],[35663,2],[35670,1],[35672,2],[35675,2],[35691,1],[35693,1],[35703,2],[35798,1],[35805,2],[35897,1],[35909,2],[35988,2],[35996,1],[35998,1],[36015,1],[36036,2],[36108,2],[36227,1],[36282,1],[36316,1],[36318,2],[36420,1],[36448,1],[36460,1],[36516,2],[36573,1],[36627,2],[36732,1],[36786,2],[36913,1],[36967,2],[37010,2],[37027,1],[37063,1],[37065,1],[37079,1],[37104,1],[37127,1],[37160,2],[37172,1],[37197,1],[37204,1],[37228,1],[37247,1],[37271,2],[37287,1],[37327,2],[37347,1],[37374,1],[37545,1],[37591,1],[37627,1],[37684,1],[37718,1],[37823,1],[37856,1],[37984,1],[38018,1],[38060,1],[38062,1],[38186,1],[38266,1],[38268,1],[38326,1],[38333,1],[38421,1],[38432,1],[38472,1],[38491,1],[38793,1],[39057,1],[39101,1],[39103,1],[39194,1],[39343,1],[39385,1],[39400,2],[39442,1],[39454,2],[39489,1],[39513,2],[39570,1],[39602,2],[39680,2],[39752,2],[39776,1],[39792,1],[39794,1],[39821,2],[39921,1],[39982,2],[40066,2],[40246,2],[40289,3],[40293,2],[40314,1],[40324,1],[40326,1],[40425,2],[40428,1],[40485,3],[40489,2],[40500,1],[40526,2],[40605,1],[40607,1],[40649,1],[40663,1],[40665,2],[40764,2],[40838,2],[40923,2],[41056,2],[41230,2],[41273,2],[41283,2],[41290,1],[41292,2],[41295,2],[41311,1],[41313,1],[41323,2],[41418,1],[41425,2],[41521,1],[41533,2],[41612,2],[41620,1],[41622,1],[41638,1],[41659,2],[41731,2],[41850,1],[41905,1],[41939,1],[41941,2],[42043,1],[42071,1],[42083,1],[42139,2],[42196,1],[42250,2],[42355,1],[42409,2],[42536,1],[42590,2],[42633,2],[42650,1],[42686,1],[42688,1],[42702,1],[42727,1],[42750,1],[42783,2],[42795,1],[42820,1],[42827,1],[42860,1],[42883,1],[42898,2],[42914,1],[42954,2],[42974,1],[43000,1],[43171,1],[43217,1],[43253,1],[43310,1],[43344,1],[43449,1],[43482,1],[43610,1],[43644,1],[43686,1],[43688,1],[43812,1],[43892,1],[43894,1],[43952,1],[43959,1],[44051,1],[44062,1],[44102,1],[44121,1],[44426,1],[44689,1],[44733,1],[44735,1],[44826,1],[44979,1],[45020,1],[45044,2],[45095,1],[45111,2],[45150,1],[45165,2],[45213,1],[45245,2],[45322,2],[45394,2],[45418,1],[45434,1],[45436,1],[45463,2],[45563,1],[45624,2],[45708,2],[45888,2],[45931,3],[45935,2],[45956,1],[45966,1],[45968,1],[46068,2],[46071,1],[46128,3],[46132,2],[46143,1],[46169,2],[46248,1],[46250,1],[46292,1],[46306,1],[46308,2],[46407,2],[46481,2],[46566,2],[46699,2],[46873,2],[46916,2],[46926,2],[46933,1],[46935,2],[46938,2],[46954,1],[46956,1],[46966,2],[47061,1],[47068,2],[47165,1],[47177,2],[47256,2],[47264,1],[47266,1],[47282,1],[47303,2],[47375,2],[47494,1],[47549,1],[47583,1],[47585,2],[47687,1],[47715,1],[47727,1],[47783,2],[47840,1],[47894,2],[47999,1],[48053,2],[48180,1],[48234,2],[48277,2],[48294,1],[48330,1],[48332,1],[48346,1],[48371,1],[48394,1],[48427,2],[48439,1],[48464,1],[48471,1],[48495,1],[48523,1],[48543,2],[48559,1],[48599,2],[48619,1],[48645,1],[48816,1],[48862,1],[48898,1],[48955,1],[48989,1],[49094,1],[49127,1],[49255,1],[49289,1],[49331,1],[49333,1],[49457,1],[49537,1],[49539,1],[49597,1],[49604,1],[49697,1],[49708,1],[49748,1],[49767,1],[50073,1],[50336,1],[50380,1],[50382,1],[50473,1],[50627,1],[50668,1],[50683,2],[50725,1],[50746,2],[50790,1],[50810,2],[50863,1],[50895,2]]},"728":{"position":[[346,2],[418,2],[442,1],[458,1],[460,1],[487,2],[587,1],[648,2],[732,2],[912,2],[955,3],[959,2],[980,1],[990,1],[992,1],[1083,2],[1086,1],[1143,3],[1147,2],[1158,1],[1189,2],[1268,1],[1270,1],[1312,1],[1326,1],[1328,2],[1427,2],[1501,2],[1586,2],[1719,2],[1893,2],[1936,2],[1946,2],[1953,1],[1955,2],[1958,2],[1974,1],[1976,1],[1986,2],[2081,1],[2088,2],[2176,1],[2188,2],[2267,2],[2275,1],[2277,1],[2298,1],[2319,2],[2391,2],[2510,1],[2565,1],[2599,1],[2601,2],[2703,1],[2731,1],[2743,1],[2799,2],[2856,1],[2910,2],[3015,1],[3069,2],[3196,1],[3250,2],[3293,2],[3310,1],[3346,1],[3348,1],[3362,1],[3387,1],[3410,1],[3443,2],[3455,1],[3480,1],[3487,1],[3511,1],[3530,1],[3550,2],[3566,1],[3606,2],[3626,1],[3657,1],[3828,1],[3874,1],[3910,1],[3967,1],[4001,1],[4106,1],[4139,1],[4267,1],[4301,1],[4343,1],[4345,1],[4469,1],[4549,1],[4551,1],[4609,1],[4616,1],[4700,1],[4711,1],[4751,1],[4770,1],[5072,1],[5340,1],[5384,1],[5386,1],[5477,1],[5622,1],[5668,1],[5683,2],[5725,1],[5737,2],[5772,1],[5792,2],[5845,1],[5877,2],[6191,1],[6225,1],[6246,1],[6256,2],[6259,2],[6272,1],[6282,2],[6285,1],[6287,2],[6302,1],[6317,1],[6338,1],[6371,1],[6373,1],[6390,1],[6392,1],[6394,2],[6407,1],[6440,1],[6442,1],[6459,1],[6461,1],[6463,1],[6465,1],[6467,1],[6469,1],[7352,2],[7355,1],[7402,1],[7404,1],[7421,2],[7424,1],[7458,1],[7479,1],[7489,2],[7492,2],[7505,1],[7515,2],[7518,1],[7520,2],[7535,1],[7550,1],[7571,1],[7604,1],[7606,1],[7623,1],[7625,1],[7627,2],[7640,1],[7673,1],[7675,1],[7692,1],[7694,1],[7696,1],[7698,1],[7700,1],[7702,2],[7705,1],[7736,1],[7752,1],[7762,2],[7765,1],[7767,2],[7782,1],[7797,1],[7813,1],[7846,1],[7848,1],[7873,1],[7875,1],[7877,1],[7879,1],[7881,1],[7883,2],[7886,1],[7925,1],[7937,1],[7947,2],[7950,1],[7952,2],[7967,1],[7982,1],[7998,1],[8031,1],[8033,1],[8050,1],[8052,1],[8054,1],[8056,1],[8058,1],[8060,1],[8062,1],[8064,1],[8265,2],[8337,2],[8361,1],[8377,1],[8379,1],[8406,2],[8506,1],[8567,2],[8651,2],[8831,2],[8874,3],[8878,2],[8899,1],[8909,1],[8911,1],[9002,2],[9005,1],[9062,3],[9066,2],[9077,1],[9104,2],[9183,1],[9185,1],[9227,1],[9241,1],[9243,2],[9342,2],[9416,2],[9501,2],[9634,2],[9808,2],[9851,2],[9861,2],[9868,1],[9870,2],[9873,2],[9889,1],[9891,1],[9901,2],[9996,1],[10003,2],[10091,1],[10103,2],[10182,2],[10190,1],[10192,1],[10209,1],[10230,2],[10302,2],[10421,1],[10476,1],[10510,1],[10512,2],[10614,1],[10642,1],[10654,1],[10710,2],[10767,1],[10821,2],[10926,1],[10980,2],[11107,1],[11161,2],[11204,2],[11221,1],[11257,1],[11259,1],[11273,1],[11298,1],[11321,1],[11354,2],[11366,1],[11391,1],[11398,1],[11422,1],[11441,1],[11461,2],[11477,1],[11517,2],[11537,1],[11564,1],[11735,1],[11781,1],[11817,1],[11874,1],[11908,1],[12013,1],[12046,1],[12174,1],[12208,1],[12250,1],[12252,1],[12376,1],[12456,1],[12458,1],[12516,1],[12523,1],[12607,1],[12618,1],[12658,1],[12677,1],[12975,1],[13239,1],[13283,1],[13285,1],[13376,1],[13521,1],[13563,1],[13578,2],[13620,1],[13632,2],[13667,1],[13687,2],[13740,1],[13772,2],[14182,2],[14254,2],[14278,1],[14294,1],[14296,1],[14323,2],[14423,1],[14484,2],[14568,2],[14748,2],[14791,3],[14795,2],[14816,1],[14826,1],[14828,1],[14928,2],[14931,1],[14988,3],[14992,2],[15003,1],[15030,2],[15109,1],[15111,1],[15153,1],[15167,1],[15169,2],[15268,2],[15342,2],[15427,2],[15560,2],[15734,2],[15777,2],[15787,2],[15794,1],[15796,2],[15799,2],[15815,1],[15817,1],[15827,2],[15922,1],[15929,2],[16026,1],[16038,2],[16117,2],[16125,1],[16127,1],[16144,1],[16165,2],[16237,2],[16356,1],[16411,1],[16445,1],[16447,2],[16549,1],[16577,1],[16589,1],[16645,2],[16702,1],[16756,2],[16861,1],[16915,2],[17042,1],[17096,2],[17139,2],[17156,1],[17192,1],[17194,1],[17208,1],[17233,1],[17256,1],[17289,2],[17301,1],[17326,1],[17333,1],[17366,1],[17385,1],[17405,2],[17421,1],[17461,2],[17481,1],[17508,1],[17679,1],[17725,1],[17761,1],[17818,1],[17852,1],[17957,1],[17990,1],[18118,1],[18152,1],[18194,1],[18196,1],[18320,1],[18400,1],[18402,1],[18460,1],[18467,1],[18560,1],[18571,1],[18611,1],[18630,1],[18937,1],[19201,1],[19245,1],[19247,1],[19338,1],[19492,1],[19534,1],[19558,2],[19609,1],[19621,2],[19656,1],[19676,2],[19729,1],[19761,2],[20012,1],[20047,1],[20059,1],[20079,1],[20093,1],[20116,2],[20138,1],[20173,1],[20175,1],[20177,1],[20179,1],[20181,1],[20926,1],[20960,1],[20981,1],[20991,2],[20994,2],[21007,1],[21018,1],[21029,1],[21031,1],[21041,2],[21044,2],[21047,1],[21067,1],[21081,1],[21113,2],[21135,1],[21162,1],[21164,1],[21166,1],[21168,1],[21170,1],[21172,1],[21174,2],[21189,1],[21204,1],[21225,1],[21258,1],[21260,1],[21277,1],[21279,1],[21281,2],[21294,1],[21327,1],[21329,1],[21346,1],[21348,1],[21350,1],[21352,1],[21354,1],[21356,1],[21831,1],[21895,1],[21978,1],[22043,1],[22045,1],[22118,1],[22441,1],[22503,1],[23581,1],[23628,1],[23630,1],[23647,2],[23650,1],[23684,1],[23705,1],[23715,2],[23718,2],[23731,1],[23742,1],[23753,1],[23755,1],[23765,2],[23768,2],[23771,1],[23791,1],[23805,1],[23837,2],[23859,1],[23886,1],[23888,1],[23890,1],[23892,1],[23894,1],[23896,1],[23898,2],[23913,1],[23928,1],[23949,1],[23982,1],[23984,1],[24001,1],[24003,1],[24005,2],[24018,1],[24051,1],[24053,1],[24070,1],[24072,1],[24074,1],[24076,1],[24078,1],[24080,2],[24083,1],[24114,1],[24130,1],[24140,2],[24143,1],[24145,2],[24160,1],[24175,1],[24191,1],[24224,1],[24226,1],[24251,1],[24253,1],[24255,1],[24257,1],[24259,1],[24261,2],[24264,1],[24303,1],[24315,1],[24325,2],[24328,1],[24330,2],[24345,1],[24360,1],[24372,1],[24405,1],[24407,1],[24424,1],[24426,1],[24428,1],[24430,1],[24432,1],[24434,1],[24436,1],[24438,1],[24600,2],[24672,2],[24696,1],[24712,1],[24714,1],[24741,2],[24841,1],[24902,2],[24986,2],[25166,2],[25209,3],[25213,2],[25234,1],[25244,1],[25246,1],[25346,2],[25349,1],[25406,3],[25410,2],[25421,1],[25447,2],[25526,1],[25528,1],[25570,1],[25584,1],[25586,2],[25685,2],[25759,2],[25844,2],[25977,2],[26151,2],[26194,2],[26204,2],[26211,1],[26213,2],[26216,2],[26232,1],[26234,1],[26244,2],[26339,1],[26346,2],[26443,1],[26455,2],[26534,2],[26542,1],[26544,1],[26560,1],[26581,2],[26653,2],[26772,1],[26827,1],[26861,1],[26863,2],[26965,1],[26993,1],[27005,1],[27061,2],[27118,1],[27172,2],[27277,1],[27331,2],[27458,1],[27512,2],[27555,2],[27572,1],[27608,1],[27610,1],[27624,1],[27649,1],[27672,1],[27705,2],[27717,1],[27742,1],[27749,1],[27782,1],[27801,1],[27821,2],[27837,1],[27877,2],[27897,1],[27923,1],[28094,1],[28140,1],[28176,1],[28233,1],[28267,1],[28372,1],[28405,1],[28533,1],[28567,1],[28609,1],[28611,1],[28735,1],[28815,1],[28817,1],[28875,1],[28882,1],[28975,1],[28986,1],[29026,1],[29045,1],[29351,1],[29614,1],[29658,1],[29660,1],[29751,1],[29905,1],[29946,1],[29970,2],[30021,1],[30033,2],[30068,1],[30088,2],[30141,1],[30173,2],[31358,1],[31405,1],[31407,1],[31424,2],[31427,1],[31461,1],[31482,1],[31492,2],[31495,2],[31508,1],[31519,1],[31530,1],[31532,1],[31542,2],[31545,2],[31548,1],[31568,1],[31582,1],[31614,2],[31636,1],[31670,1],[31672,1],[31674,1],[31676,1],[31678,1],[31680,1],[31682,2],[31697,1],[31712,1],[31733,1],[31766,1],[31768,1],[31785,1],[31787,1],[31789,2],[31802,1],[31835,1],[31837,1],[31854,1],[31856,1],[31858,1],[31860,1],[31862,1],[31864,2],[31867,1],[31898,1],[31914,1],[31924,2],[31927,2],[31951,1],[31971,1],[31985,1],[32012,2],[32034,1],[32057,1],[32059,1],[32061,1],[32063,2],[32078,1],[32093,1],[32109,1],[32142,1],[32144,1],[32169,1],[32171,1],[32173,1],[32175,1],[32177,1],[32179,2],[32182,1],[32221,1],[32233,1],[32243,2],[32246,1],[32248,2],[32263,1],[32278,1],[32290,1],[32323,1],[32325,1],[32342,1],[32344,1],[32346,1],[32348,1],[32350,1],[32352,1],[32354,1],[32356,1],[32848,2],[32920,2],[32944,1],[32960,1],[32962,1],[32989,2],[33089,1],[33150,2],[33234,2],[33414,2],[33457,3],[33461,2],[33482,1],[33492,1],[33494,1],[33585,2],[33588,1],[33645,3],[33649,2],[33660,1],[33686,2],[33765,1],[33767,1],[33809,1],[33823,1],[33825,2],[33924,2],[33998,2],[34083,2],[34216,2],[34390,2],[34433,2],[34443,2],[34450,1],[34452,2],[34455,2],[34471,1],[34473,1],[34483,2],[34578,1],[34585,2],[34673,1],[34685,2],[34764,2],[34772,1],[34774,1],[34790,1],[34811,2],[34883,2],[35002,1],[35057,1],[35091,1],[35093,2],[35195,1],[35223,1],[35235,1],[35291,2],[35348,1],[35402,2],[35507,1],[35561,2],[35688,1],[35742,2],[35785,2],[35802,1],[35838,1],[35840,1],[35854,1],[35879,1],[35902,1],[35935,2],[35947,1],[35972,1],[35979,1],[36003,1],[36022,1],[36042,2],[36058,1],[36098,2],[36118,1],[36144,1],[36315,1],[36361,1],[36397,1],[36454,1],[36488,1],[36593,1],[36626,1],[36754,1],[36788,1],[36830,1],[36832,1],[36956,1],[37036,1],[37038,1],[37096,1],[37103,1],[37187,1],[37198,1],[37238,1],[37257,1],[37554,1],[37817,1],[37861,1],[37863,1],[37954,1],[38099,1],[38140,1],[38155,2],[38197,1],[38209,2],[38244,1],[38264,2],[38317,1],[38349,2],[38715,1],[38782,2],[39055,1],[39089,1],[39110,1],[39120,2],[39123,2],[39136,1],[39147,1],[39158,1],[39160,1],[39170,2],[39173,2],[39176,1],[39196,1],[39210,1],[39242,2],[39264,1],[39298,1],[39300,1],[39302,1],[39304,1],[39306,1],[39308,1],[39310,2],[39325,1],[39340,1],[39361,1],[39394,1],[39396,1],[39413,1],[39415,1],[39417,2],[39430,1],[39463,1],[39465,1],[39482,1],[39484,1],[39486,1],[39488,1],[39490,1],[39492,1],[39619,1],[39653,1],[39674,1],[39684,2],[39687,2],[39700,1],[39720,1],[39734,1],[39766,2],[39788,1],[39822,1],[39824,1],[39826,1],[39828,2],[39843,1],[39858,1],[39879,1],[39912,1],[39914,1],[39931,1],[39933,1],[39935,1],[39937,1],[39939,1],[39941,1],[40024,1],[40094,1],[40277,1],[40349,1],[40351,1],[40424,1],[40426,1],[40504,1],[40876,1],[40898,1],[40900,1],[40917,2],[40920,1],[40954,1],[40975,1],[40985,2],[40988,2],[41001,1],[41021,1],[41035,1],[41067,2],[41089,1],[41123,1],[41125,1],[41127,1],[41129,2],[41144,1],[41159,1],[41180,1],[41213,1],[41215,1],[41232,1],[41234,1],[41236,1],[41238,1],[41240,1],[41242,2],[41245,1],[41276,1],[41292,1],[41302,2],[41305,2],[41329,1],[41349,1],[41363,1],[41390,2],[41412,1],[41435,1],[41437,1],[41439,1],[41441,2],[41456,1],[41471,1],[41487,1],[41520,1],[41522,1],[41547,1],[41549,1],[41551,1],[41553,1],[41555,1],[41557,2],[41560,1],[41599,1],[41611,1],[41621,2],[41624,1],[41626,2],[41641,1],[41656,1],[41668,1],[41701,1],[41703,1],[41720,1],[41722,1],[41724,1],[41726,1],[41728,1],[41730,1],[41732,1],[41734,1],[42383,2],[42455,2],[42479,1],[42495,1],[42497,1],[42524,2],[42624,1],[42685,2],[42769,2],[42949,2],[42992,3],[42996,2],[43017,1],[43027,1],[43029,1],[43120,2],[43123,1],[43180,3],[43184,2],[43195,1],[43221,2],[43300,1],[43302,1],[43344,1],[43358,1],[43360,2],[43459,2],[43533,2],[43618,2],[43751,2],[43925,2],[43968,2],[43978,2],[43985,1],[43987,2],[43990,2],[44006,1],[44008,1],[44018,2],[44113,1],[44120,2],[44208,1],[44220,2],[44299,2],[44307,1],[44309,1],[44325,1],[44346,2],[44418,2],[44537,1],[44592,1],[44626,1],[44628,2],[44730,1],[44758,1],[44770,1],[44826,2],[44883,1],[44937,2],[45042,1],[45096,2],[45223,1],[45277,2],[45320,2],[45337,1],[45373,1],[45375,1],[45389,1],[45414,1],[45437,1],[45470,2],[45482,1],[45507,1],[45514,1],[45538,1],[45557,1],[45577,2],[45593,1],[45633,2],[45653,1],[45679,1],[45850,1],[45896,1],[45932,1],[45989,1],[46023,1],[46128,1],[46161,1],[46289,1],[46323,1],[46365,1],[46367,1],[46491,1],[46571,1],[46573,1],[46631,1],[46638,1],[46722,1],[46733,1],[46773,1],[46792,1],[47089,1],[47352,1],[47396,1],[47398,1],[47489,1],[47634,1],[47675,1],[47690,2],[47732,1],[47744,2],[47779,1],[47799,2],[47852,1],[47884,2]]},"734":{"position":[[428,1],[610,1],[767,1]]},"745":{"position":[[452,1],[499,1],[501,1],[518,2],[521,1],[552,1],[564,1],[574,2],[577,2],[591,1],[601,2],[604,2],[617,1],[627,2],[630,2],[647,1],[657,2],[660,2],[672,1],[682,2],[685,1],[687,2],[702,1],[717,1],[729,1],[762,1],[764,1],[781,1],[783,1],[785,2],[799,1],[832,1],[834,1],[851,1],[853,1],[855,2],[868,1],[901,1],[903,1],[920,1],[922,1],[924,2],[941,1],[974,1],[976,1],[993,1],[995,1],[997,2],[1009,1],[1042,1],[1044,1],[1061,1],[1063,1],[1065,1],[1067,1],[1069,1],[1071,1],[1073,1],[1075,1],[1324,1],[1371,1],[1373,1],[1390,2],[1393,1],[1424,1],[1436,1],[1446,2],[1449,1],[1451,2],[1466,1],[1481,1],[1493,1],[1526,1],[1528,1],[1545,1],[1547,1],[1549,1],[1551,1],[1553,1],[1555,1],[1557,1],[1559,1],[1877,2],[1949,2],[1973,1],[1989,1],[1991,1],[2018,2],[2118,1],[2179,2],[2263,2],[2443,2],[2486,3],[2522,1],[2524,1],[2598,2],[2601,2],[2604,1],[2660,3],[2683,2],[2762,1],[2764,1],[2806,1],[2820,1],[2822,2],[2921,2],[2995,2],[3080,2],[3213,2],[3387,2],[3430,2],[3440,2],[3447,1],[3449,2],[3452,2],[3468,1],[3470,1],[3480,2],[3575,1],[3582,2],[3642,1],[3772,2],[3775,1],[3777,1],[3789,2],[3882,2],[3889,1],[3891,2],[3894,2],[3910,1],[3931,2],[4003,2],[4122,1],[4177,1],[4211,1],[4213,2],[4315,1],[4343,1],[4355,1],[4411,2],[4468,1],[4522,2],[4627,1],[4681,2],[4808,1],[4862,2],[4905,2],[4922,1],[4958,1],[4960,1],[4974,1],[5005,1],[5028,1],[5061,2],[5073,1],[5100,1],[5109,1],[5138,1],[5146,1],[5153,1],[5177,1],[5196,1],[5221,1],[5223,2],[5226,2],[5242,1],[5301,1],[5472,1],[5518,1],[5554,1],[5611,1],[5645,1],[5750,1],[5783,1],[5911,1],[5945,1],[5987,1],[5989,1],[6113,1],[6193,1],[6195,1],[6253,1],[6260,1],[6267,1],[6379,3],[6383,2],[6386,2],[6389,1],[6400,1],[6674,1],[6718,1],[6720,1],[6811,1],[6828,1],[6843,1],[6920,2],[7287,1],[7362,1],[7364,2],[7561,2],[7633,2],[7657,1],[7673,1],[7675,1],[7702,2],[7802,1],[7863,2],[7947,2],[8127,2],[8170,3],[8174,2],[8195,1],[8205,1],[8207,1],[8304,2],[8307,1],[8364,3],[8368,2],[8379,1],[8405,2],[8484,1],[8486,1],[8528,1],[8542,1],[8544,2],[8643,2],[8717,2],[8802,2],[8935,2],[9109,2],[9152,2],[9162,2],[9169,1],[9171,2],[9174,2],[9190,1],[9192,1],[9202,2],[9297,1],[9304,2],[9398,1],[9410,2],[9489,2],[9497,1],[9499,1],[9515,1],[9536,2],[9608,2],[9727,1],[9782,1],[9816,1],[9818,2],[9920,1],[9948,1],[9960,1],[10016,2],[10073,1],[10127,2],[10232,1],[10286,2],[10413,1],[10467,2],[10510,2],[10527,1],[10563,1],[10565,1],[10579,1],[10604,1],[10627,1],[10660,2],[10672,1],[10697,1],[10704,1],[10728,1],[10747,1],[10773,2],[10789,1],[10829,2],[10849,1],[10875,1],[11046,1],[11092,1],[11128,1],[11185,1],[11219,1],[11324,1],[11357,1],[11485,1],[11519,1],[11561,1],[11563,1],[11687,1],[11767,1],[11769,1],[11827,1],[11834,1],[11924,1],[11935,1],[11975,1],[11994,1],[12297,1],[12560,1],[12604,1],[12606,1],[12697,1],[12848,1],[12889,1],[12904,2],[12946,1],[12958,2],[12993,1],[13019,2],[13078,1],[13110,2],[13251,2],[13323,2],[13347,1],[13363,1],[13365,1],[13392,2],[13492,1],[13553,2],[13637,2],[13817,2],[13860,3],[13896,1],[13898,1],[13972,2],[13975,2],[13978,1],[14034,3],[14057,2],[14136,1],[14138,1],[14180,1],[14194,1],[14196,2],[14295,2],[14369,2],[14454,2],[14587,2],[14761,2],[14804,2],[14814,2],[14821,1],[14823,2],[14826,2],[14842,1],[14844,1],[14854,2],[14949,1],[14956,2],[15016,1],[15146,2],[15149,1],[15151,1],[15163,2],[15256,2],[15263,1],[15265,2],[15268,2],[15284,1],[15305,2],[15377,2],[15496,1],[15551,1],[15585,1],[15587,2],[15689,1],[15717,1],[15729,1],[15785,2],[15842,1],[15896,2],[16001,1],[16055,2],[16182,1],[16236,2],[16279,2],[16296,1],[16332,1],[16334,1],[16348,1],[16379,1],[16402,1],[16435,2],[16447,1],[16474,1],[16483,1],[16512,1],[16520,1],[16527,1],[16551,1],[16570,1],[16595,1],[16597,2],[16600,2],[16616,1],[16675,1],[16846,1],[16892,1],[16928,1],[16985,1],[17019,1],[17124,1],[17157,1],[17285,1],[17319,1],[17361,1],[17363,1],[17487,1],[17567,1],[17569,1],[17627,1],[17634,1],[17641,1],[17753,3],[17757,2],[17760,2],[17763,1],[17774,1],[18048,1],[18092,1],[18094,1],[18185,1],[18202,1],[18217,1],[18294,2],[18661,1],[18736,1],[18738,2],[18892,2],[18964,2],[18988,1],[19004,1],[19006,1],[19033,2],[19133,1],[19194,2],[19278,2],[19458,2],[19501,3],[19505,2],[19526,1],[19536,1],[19538,1],[19635,2],[19638,1],[19695,3],[19699,2],[19710,1],[19736,2],[19815,1],[19817,1],[19859,1],[19873,1],[19875,2],[19974,2],[20048,2],[20133,2],[20266,2],[20440,2],[20483,2],[20493,2],[20500,1],[20502,2],[20505,2],[20521,1],[20523,1],[20533,2],[20628,1],[20635,2],[20729,1],[20741,2],[20820,2],[20828,1],[20830,1],[20846,1],[20867,2],[20939,2],[21058,1],[21113,1],[21147,1],[21149,2],[21251,1],[21279,1],[21291,1],[21347,2],[21404,1],[21458,2],[21563,1],[21617,2],[21744,1],[21798,2],[21841,2],[21858,1],[21894,1],[21896,1],[21910,1],[21935,1],[21958,1],[21991,2],[22003,1],[22028,1],[22035,1],[22059,1],[22078,1],[22104,2],[22120,1],[22160,2],[22180,1],[22206,1],[22377,1],[22423,1],[22459,1],[22516,1],[22550,1],[22655,1],[22688,1],[22816,1],[22850,1],[22892,1],[22894,1],[23018,1],[23098,1],[23100,1],[23158,1],[23165,1],[23255,1],[23266,1],[23306,1],[23325,1],[23628,1],[23891,1],[23935,1],[23937,1],[24028,1],[24179,1],[24220,1],[24235,2],[24277,1],[24289,2],[24324,1],[24350,2],[24409,1],[24441,2],[24518,2],[24590,2],[24614,1],[24630,1],[24632,1],[24659,2],[24759,1],[24820,2],[24904,2],[25084,2],[25127,3],[25131,2],[25152,1],[25162,1],[25164,1],[25261,2],[25264,1],[25321,3],[25325,2],[25336,1],[25363,2],[25442,1],[25444,1],[25486,1],[25500,1],[25502,2],[25601,2],[25675,2],[25760,2],[25893,2],[26067,2],[26110,2],[26120,2],[26127,1],[26129,2],[26132,2],[26148,1],[26150,1],[26160,2],[26255,1],[26262,2],[26356,1],[26368,2],[26447,2],[26455,1],[26457,1],[26474,1],[26495,2],[26567,2],[26686,1],[26741,1],[26775,1],[26777,2],[26879,1],[26907,1],[26919,1],[26975,2],[27032,1],[27086,2],[27191,1],[27245,2],[27372,1],[27426,2],[27469,2],[27486,1],[27522,1],[27524,1],[27538,1],[27563,1],[27586,1],[27619,2],[27631,1],[27656,1],[27663,1],[27687,1],[27706,1],[27732,2],[27748,1],[27788,2],[27808,1],[27835,1],[28006,1],[28052,1],[28088,1],[28145,1],[28179,1],[28284,1],[28317,1],[28445,1],[28479,1],[28521,1],[28523,1],[28647,1],[28727,1],[28729,1],[28787,1],[28794,1],[28884,1],[28895,1],[28935,1],[28954,1],[29258,1],[29522,1],[29566,1],[29568,1],[29659,1],[29810,1],[29852,1],[29867,2],[29909,1],[29921,2],[29956,1],[29982,2],[30041,1],[30073,2],[30567,1],[30614,1],[30616,1],[30633,2],[30636,1],[30667,1],[30679,1],[30690,1],[30701,1],[30703,1],[30713,2],[30716,2],[30719,1],[30740,1],[30764,1],[30766,1],[30768,1],[30770,1],[30772,2],[30786,1],[30797,1],[30808,1],[30810,1],[30820,2],[30823,2],[30826,1],[30847,1],[30870,1],[30872,1],[30874,1],[30876,1],[30878,2],[30891,1],[30902,1],[30913,1],[30915,1],[30925,2],[30928,2],[30931,1],[30952,1],[30979,1],[30981,1],[30983,1],[30985,1],[30987,2],[31004,1],[31015,1],[31026,1],[31028,1],[31038,2],[31041,2],[31044,1],[31065,1],[31087,1],[31089,1],[31091,1],[31093,1],[31095,2],[31107,1],[31117,2],[31120,1],[31122,2],[31137,1],[31152,1],[31164,1],[31197,1],[31199,1],[31216,1],[31218,1],[31220,2],[31234,1],[31267,1],[31269,1],[31286,1],[31288,1],[31290,2],[31303,1],[31336,1],[31338,1],[31355,1],[31357,1],[31359,2],[31376,1],[31409,1],[31411,1],[31428,1],[31430,1],[31432,2],[31444,1],[31477,1],[31479,1],[31496,1],[31498,1],[31500,1],[31502,1],[31504,1],[31506,1],[31508,1],[31510,1],[31623,1],[31654,1],[31666,1],[31677,1],[31688,1],[31690,1],[31700,2],[31703,2],[31706,1],[31727,1],[31751,1],[31753,1],[31755,1],[31757,1],[31759,1],[31761,2],[31776,1],[31791,1],[31803,1],[31836,1],[31838,1],[31855,1],[31857,1],[31859,1],[31861,1],[31863,1],[31865,1],[32252,2],[32324,2],[32348,1],[32364,1],[32366,1],[32393,2],[32493,1],[32554,2],[32638,2],[32818,2],[32861,3],[32865,2],[32886,1],[32896,1],[32898,1],[32995,2],[32998,1],[33055,3],[33059,2],[33070,1],[33096,2],[33175,1],[33177,1],[33219,1],[33233,1],[33235,2],[33334,2],[33408,2],[33493,2],[33626,2],[33800,2],[33843,2],[33853,2],[33860,1],[33862,2],[33865,2],[33881,1],[33883,1],[33893,2],[33988,1],[33995,2],[34089,1],[34101,2],[34180,2],[34188,1],[34190,1],[34206,1],[34227,2],[34299,2],[34418,1],[34473,1],[34507,1],[34509,2],[34611,1],[34639,1],[34651,1],[34707,2],[34764,1],[34818,2],[34923,1],[34977,2],[35104,1],[35158,2],[35201,2],[35218,1],[35254,1],[35256,1],[35270,1],[35295,1],[35318,1],[35351,2],[35363,1],[35388,1],[35395,1],[35419,1],[35438,1],[35464,2],[35480,1],[35520,2],[35540,1],[35566,1],[35737,1],[35783,1],[35819,1],[35876,1],[35910,1],[36015,1],[36048,1],[36176,1],[36210,1],[36252,1],[36254,1],[36378,1],[36458,1],[36460,1],[36518,1],[36525,1],[36615,1],[36626,1],[36666,1],[36685,1],[36988,1],[37251,1],[37295,1],[37297,1],[37388,1],[37539,1],[37580,1],[37595,2],[37637,1],[37649,2],[37684,1],[37710,2],[37769,1],[37801,2],[37878,2],[37950,2],[37974,1],[37990,1],[37992,1],[38019,2],[38119,1],[38180,2],[38264,2],[38444,2],[38487,3],[38491,2],[38512,1],[38522,1],[38524,1],[38621,2],[38624,1],[38681,3],[38685,2],[38696,1],[38722,2],[38801,1],[38803,1],[38845,1],[38859,1],[38861,2],[38960,2],[39034,2],[39119,2],[39252,2],[39426,2],[39469,2],[39479,2],[39486,1],[39488,2],[39491,2],[39507,1],[39509,1],[39519,2],[39614,1],[39621,2],[39715,1],[39727,2],[39806,2],[39814,1],[39816,1],[39832,1],[39853,2],[39925,2],[40044,1],[40099,1],[40133,1],[40135,2],[40237,1],[40265,1],[40277,1],[40333,2],[40390,1],[40444,2],[40549,1],[40603,2],[40730,1],[40784,2],[40827,2],[40844,1],[40880,1],[40882,1],[40896,1],[40921,1],[40944,1],[40977,2],[40989,1],[41014,1],[41021,1],[41045,1],[41064,1],[41090,2],[41106,1],[41146,2],[41166,1],[41192,1],[41363,1],[41409,1],[41445,1],[41502,1],[41536,1],[41641,1],[41674,1],[41802,1],[41836,1],[41878,1],[41880,1],[42004,1],[42084,1],[42086,1],[42144,1],[42151,1],[42241,1],[42252,1],[42292,1],[42311,1],[42614,1],[42877,1],[42921,1],[42923,1],[43014,1],[43165,1],[43206,1],[43221,2],[43263,1],[43275,2],[43310,1],[43336,2],[43395,1],[43427,2]]},"747":{"position":[[422,1],[469,1],[471,1],[502,1],[514,1],[524,2],[527,1],[529,2],[544,1],[559,1],[571,1],[604,1],[606,1],[623,2],[626,1],[665,1],[667,1],[669,1],[671,1],[673,1],[675,1],[677,1],[679,1],[1054,1],[1101,1],[1103,1],[1120,2],[1123,1],[1154,1],[1166,1],[1177,1],[1188,1],[1190,1],[1200,2],[1203,2],[1206,1],[1227,1],[1251,1],[1253,1],[1255,1],[1257,1],[1259,2],[1273,1],[1284,1],[1295,1],[1297,1],[1307,2],[1310,2],[1313,1],[1334,1],[1357,1],[1359,1],[1361,1],[1363,1],[1365,2],[1378,1],[1389,1],[1400,1],[1402,1],[1412,2],[1415,2],[1418,1],[1439,1],[1466,1],[1468,1],[1470,1],[1472,1],[1474,2],[1491,1],[1502,1],[1513,1],[1515,1],[1525,2],[1528,2],[1531,1],[1552,1],[1574,1],[1576,1],[1578,1],[1580,1],[1582,2],[1594,1],[1604,2],[1607,1],[1609,2],[1624,1],[1639,1],[1651,1],[1684,1],[1686,1],[1703,2],[1706,1],[1745,1],[1747,1],[1749,2],[1763,1],[1796,1],[1798,1],[1815,2],[1818,1],[1857,1],[1859,1],[1861,2],[1874,1],[1907,1],[1909,1],[1926,2],[1929,1],[1968,1],[1970,1],[1972,2],[1989,1],[2022,1],[2024,1],[2041,2],[2044,1],[2083,1],[2085,1],[2087,2],[2099,1],[2132,1],[2134,1],[2151,2],[2154,1],[2193,1],[2195,1],[2197,1],[2199,1],[2201,1],[2203,1],[2205,1],[2207,1],[2406,2],[2478,2],[2502,1],[2518,1],[2520,1],[2547,2],[2647,1],[2708,2],[2792,2],[2972,2],[3015,3],[3051,1],[3053,2],[3110,1],[3191,2],[3261,1],[3356,2],[3359,2],[3362,1],[3418,3],[3441,2],[3520,1],[3522,1],[3564,1],[3578,1],[3580,2],[3679,2],[3753,2],[3838,2],[3971,2],[4145,2],[4188,2],[4198,2],[4205,1],[4207,2],[4210,2],[4226,1],[4228,1],[4238,2],[4333,1],[4340,2],[4400,1],[4402,2],[4594,2],[4597,1],[4599,2],[4818,2],[4821,1],[4823,1],[4835,2],[4928,2],[4935,1],[4937,2],[4940,2],[4956,1],[4977,2],[5049,2],[5168,1],[5223,1],[5257,1],[5259,2],[5361,1],[5389,1],[5401,1],[5457,2],[5514,1],[5568,2],[5673,1],[5727,2],[5854,1],[5908,2],[5951,2],[5968,1],[6004,1],[6006,1],[6020,1],[6051,1],[6074,1],[6107,2],[6119,1],[6146,1],[6155,1],[6184,1],[6186,2],[6249,1],[6256,1],[6283,1],[6302,1],[6331,2],[6334,2],[6410,1],[6417,1],[6463,1],[6481,1],[6506,1],[6508,2],[6511,2],[6527,1],[6586,1],[6757,1],[6803,1],[6839,1],[6896,1],[6930,1],[7035,1],[7068,1],[7196,1],[7230,1],[7272,1],[7274,1],[7398,1],[7478,1],[7480,1],[7538,1],[7545,1],[7552,1],[7596,1],[7727,2],[7743,1],[7901,3],[7905,2],[7908,2],[7911,1],[7922,1],[8196,1],[8240,1],[8242,1],[8333,1],[8350,1],[8365,1],[8543,2],[9058,2],[9115,1],[9197,2],[9200,2],[9270,1],[9366,1],[9368,2],[9720,2],[9792,2],[9816,1],[9832,1],[9834,1],[9861,2],[9961,1],[10022,2],[10106,2],[10286,2],[10329,3],[10333,2],[10354,1],[10364,1],[10366,1],[10465,2],[10468,1],[10525,3],[10529,2],[10540,1],[10566,2],[10645,1],[10647,1],[10689,1],[10703,1],[10705,2],[10804,2],[10878,2],[10963,2],[11096,2],[11270,2],[11313,2],[11323,2],[11330,1],[11332,2],[11335,2],[11351,1],[11353,1],[11363,2],[11458,1],[11465,2],[11561,1],[11573,2],[11652,2],[11660,1],[11662,1],[11678,1],[11699,2],[11771,2],[11890,1],[11945,1],[11979,1],[11981,2],[12083,1],[12111,1],[12123,1],[12179,2],[12236,1],[12290,2],[12395,1],[12449,2],[12576,1],[12630,2],[12673,2],[12690,1],[12726,1],[12728,1],[12742,1],[12767,1],[12790,1],[12823,2],[12835,1],[12860,1],[12867,1],[12894,1],[12912,1],[12938,2],[12954,1],[12994,2],[13014,1],[13040,1],[13211,1],[13257,1],[13293,1],[13350,1],[13384,1],[13489,1],[13522,1],[13650,1],[13684,1],[13726,1],[13728,1],[13852,1],[13932,1],[13934,1],[13992,1],[13999,1],[14091,1],[14102,1],[14142,1],[14161,1],[14466,1],[14729,1],[14773,1],[14775,1],[14866,1],[15019,1],[15060,1],[15078,2],[15123,1],[15134,2],[15168,1],[15194,2],[15253,1],[15285,2]]},"749":{"position":[[351,2],[423,2],[447,1],[463,1],[465,1],[492,2],[592,1],[653,2],[737,2],[917,2],[960,3],[996,1],[998,1],[1096,2],[1099,2],[1102,1],[1158,3],[1181,2],[1260,1],[1262,1],[1304,1],[1318,1],[1320,2],[1419,2],[1493,2],[1578,2],[1711,2],[1885,2],[1928,2],[1938,2],[1945,1],[1947,2],[1950,2],[1966,1],[1968,1],[1978,2],[2073,1],[2080,2],[2140,1],[2294,2],[2297,1],[2299,1],[2311,2],[2404,2],[2411,1],[2413,2],[2416,2],[2432,1],[2453,2],[2525,2],[2644,1],[2699,1],[2733,1],[2735,2],[2837,1],[2865,1],[2877,1],[2933,2],[2990,1],[3044,2],[3149,1],[3203,2],[3330,1],[3384,2],[3427,2],[3444,1],[3480,1],[3482,1],[3496,1],[3527,1],[3550,1],[3583,2],[3595,1],[3622,1],[3631,1],[3660,1],[3668,1],[3675,1],[3719,1],[3738,1],[3767,1],[3769,2],[3772,2],[3788,1],[3847,1],[4018,1],[4064,1],[4100,1],[4157,1],[4191,1],[4296,1],[4329,1],[4457,1],[4491,1],[4533,1],[4535,1],[4659,1],[4739,1],[4741,1],[4799,1],[4806,1],[4813,1],[4949,3],[4953,2],[4956,2],[4959,1],[4970,1],[5244,1],[5288,1],[5290,1],[5381,1],[5398,1],[5413,1],[5514,2],[5905,1],[6004,1],[6006,2],[6592,2],[6664,2],[6688,1],[6704,1],[6706,1],[6733,2],[6833,1],[6894,2],[6978,2],[7158,2],[7201,3],[7237,1],[7239,2],[7292,1],[7369,2],[7372,2],[7375,1],[7431,3],[7454,2],[7533,1],[7535,1],[7577,1],[7591,1],[7593,2],[7692,2],[7766,2],[7851,2],[7984,2],[8158,2],[8201,2],[8211,2],[8218,1],[8220,2],[8223,2],[8239,1],[8241,1],[8251,2],[8346,1],[8353,2],[8413,1],[8415,2],[8599,2],[8602,1],[8604,1],[8616,2],[8709,2],[8716,1],[8718,2],[8721,2],[8737,1],[8758,2],[8830,2],[8949,1],[9004,1],[9038,1],[9040,2],[9142,1],[9170,1],[9182,1],[9238,2],[9295,1],[9349,2],[9454,1],[9508,2],[9635,1],[9689,2],[9732,2],[9749,1],[9785,1],[9787,1],[9801,1],[9832,1],[9855,1],[9888,2],[9900,1],[9927,1],[9936,1],[9965,1],[9967,2],[10026,1],[10033,1],[10058,1],[10077,1],[10104,1],[10106,2],[10109,2],[10125,1],[10184,1],[10355,1],[10401,1],[10437,1],[10494,1],[10528,1],[10633,1],[10666,1],[10794,1],[10828,1],[10870,1],[10872,1],[10996,1],[11076,1],[11078,1],[11136,1],[11143,1],[11150,1],[11194,1],[11317,3],[11321,2],[11324,2],[11327,1],[11338,1],[11612,1],[11656,1],[11658,1],[11749,1],[11766,1],[11781,1],[11861,2],[12231,2],[12284,1],[12362,1],[12364,2],[12483,2],[12555,2],[12579,1],[12595,1],[12597,1],[12624,2],[12724,1],[12785,2],[12869,2],[13049,2],[13092,3],[13096,2],[13117,1],[13127,1],[13129,1],[13226,2],[13229,1],[13286,3],[13290,2],[13301,1],[13327,2],[13406,1],[13408,1],[13450,1],[13464,1],[13466,2],[13565,2],[13639,2],[13724,2],[13857,2],[14031,2],[14074,2],[14084,2],[14091,1],[14093,2],[14096,2],[14112,1],[14114,1],[14124,2],[14219,1],[14226,2],[14320,1],[14332,2],[14411,2],[14419,1],[14421,1],[14437,1],[14458,2],[14530,2],[14649,1],[14704,1],[14738,1],[14740,2],[14842,1],[14870,1],[14882,1],[14938,2],[14995,1],[15049,2],[15154,1],[15208,2],[15335,1],[15389,2],[15432,2],[15449,1],[15485,1],[15487,1],[15501,1],[15526,1],[15549,1],[15582,2],[15594,1],[15619,1],[15626,1],[15651,1],[15669,1],[15695,2],[15711,1],[15751,2],[15771,1],[15797,1],[15968,1],[16014,1],[16050,1],[16107,1],[16141,1],[16246,1],[16279,1],[16407,1],[16441,1],[16483,1],[16485,1],[16609,1],[16689,1],[16691,1],[16749,1],[16756,1],[16846,1],[16857,1],[16897,1],[16916,1],[17219,1],[17482,1],[17526,1],[17528,1],[17619,1],[17770,1],[17811,1],[17827,2],[17870,1],[17881,2],[17915,1],[17941,2],[18000,1],[18032,2]]},"751":{"position":[[1014,1],[1061,1],[1063,1],[1102,1],[1114,1],[1124,2],[1127,1],[1129,2],[1144,1],[1159,1],[1171,1],[1204,1],[1206,1],[1223,1],[1225,1],[1227,1],[1229,1],[1231,1],[1233,1],[1235,1],[1237,1],[1581,1],[1628,1],[1630,1],[1661,1],[1673,1],[1684,1],[1695,1],[1697,1],[1707,2],[1710,2],[1713,1],[1734,1],[1758,1],[1760,1],[1762,1],[1764,1],[1766,2],[1780,1],[1791,1],[1802,1],[1804,1],[1814,2],[1817,2],[1820,1],[1841,1],[1864,1],[1866,1],[1868,1],[1870,1],[1872,2],[1885,1],[1896,1],[1907,1],[1909,1],[1919,2],[1922,2],[1925,1],[1946,1],[1973,1],[1975,1],[1977,1],[1979,1],[1981,2],[1998,1],[2009,1],[2020,1],[2022,1],[2032,2],[2035,2],[2038,1],[2059,1],[2081,1],[2083,1],[2085,1],[2087,1],[2089,2],[2101,1],[2111,2],[2114,2],[2126,1],[2136,2],[2139,1],[2141,2],[2156,1],[2171,1],[2183,1],[2216,1],[2218,1],[2235,2],[2238,1],[2277,1],[2279,1],[2281,2],[2295,1],[2328,1],[2330,1],[2347,2],[2350,1],[2389,1],[2391,1],[2393,2],[2406,1],[2439,1],[2441,1],[2458,2],[2461,1],[2500,1],[2502,1],[2504,2],[2521,1],[2554,1],[2556,1],[2573,2],[2576,1],[2615,1],[2617,1],[2619,2],[2631,1],[2664,1],[2666,1],[2683,2],[2686,1],[2725,1],[2727,1],[2729,2],[2741,1],[2774,1],[2776,1],[2801,1],[2803,1],[2805,1],[2807,1],[2809,1],[2811,1],[2813,1],[2815,1],[3048,2],[3120,2],[3144,1],[3160,1],[3162,1],[3189,2],[3289,1],[3350,2],[3434,2],[3614,2],[3657,3],[3693,1],[3695,1],[3769,1],[3853,2],[3856,2],[3859,1],[3915,3],[3938,2],[4017,1],[4019,1],[4061,1],[4075,1],[4077,2],[4176,2],[4250,2],[4335,2],[4468,2],[4642,2],[4685,2],[4695,2],[4702,1],[4704,2],[4707,2],[4723,1],[4725,1],[4735,2],[4830,1],[4837,2],[4897,1],[5027,2],[5030,1],[5170,2],[5173,1],[5175,1],[5187,2],[5280,2],[5287,1],[5289,2],[5292,2],[5308,1],[5329,2],[5401,2],[5520,1],[5575,1],[5609,1],[5611,2],[5713,1],[5741,1],[5753,1],[5809,2],[5866,1],[5920,2],[6025,1],[6079,2],[6206,1],[6260,2],[6303,2],[6320,1],[6356,1],[6358,1],[6372,1],[6403,1],[6426,1],[6459,2],[6471,1],[6498,1],[6507,1],[6536,1],[6544,1],[6551,1],[6575,1],[6594,1],[6619,2],[6628,1],[6635,1],[6670,1],[6688,1],[6713,1],[6715,2],[6718,2],[6734,1],[6793,1],[6964,1],[7010,1],[7046,1],[7103,1],[7137,1],[7242,1],[7275,1],[7403,1],[7437,1],[7479,1],[7481,1],[7605,1],[7685,1],[7687,1],[7745,1],[7752,1],[7759,1],[7871,2],[7965,3],[7969,2],[7972,2],[7975,1],[7986,1],[8260,1],[8304,1],[8306,1],[8397,1],[8414,1],[8429,1],[8589,2],[9086,1],[9161,2],[9164,1],[9249,1],[9251,2],[9932,2],[10004,2],[10028,1],[10044,1],[10046,1],[10073,2],[10173,1],[10234,2],[10318,2],[10498,2],[10541,3],[10545,2],[10566,1],[10576,1],[10578,1],[10674,2],[10677,1],[10734,3],[10738,2],[10749,1],[10780,2],[10859,1],[10861,1],[10903,1],[10917,1],[10919,2],[11018,2],[11092,2],[11177,2],[11310,2],[11484,2],[11527,2],[11537,2],[11544,1],[11546,2],[11549,2],[11565,1],[11567,1],[11577,2],[11672,1],[11679,2],[11772,1],[11784,2],[11863,2],[11871,1],[11873,1],[11894,1],[11915,2],[11987,2],[12106,1],[12161,1],[12195,1],[12197,2],[12299,1],[12327,1],[12339,1],[12395,2],[12452,1],[12506,2],[12611,1],[12665,2],[12792,1],[12846,2],[12889,2],[12906,1],[12942,1],[12944,1],[12958,1],[12983,1],[13006,1],[13039,2],[13051,1],[13076,1],[13083,1],[13107,1],[13125,1],[13151,2],[13167,1],[13207,2],[13227,1],[13258,1],[13429,1],[13475,1],[13511,1],[13568,1],[13602,1],[13707,1],[13740,1],[13868,1],[13902,1],[13944,1],[13946,1],[14070,1],[14150,1],[14152,1],[14210,1],[14217,1],[14306,1],[14317,1],[14357,1],[14376,1],[14683,1],[14951,1],[14995,1],[14997,1],[15088,1],[15238,1],[15284,1],[15299,2],[15341,1],[15352,2],[15386,1],[15412,2],[15471,1],[15503,2],[15747,1],[15769,1],[15771,1],[15802,1],[15813,1],[15824,1],[15835,1],[15837,1],[15847,2],[15850,2],[15853,1],[15873,1],[15887,1],[15909,2],[15931,1],[15958,1],[15960,1],[15962,1],[15964,1],[15966,1],[15968,1],[15970,2],[15985,1],[16000,1],[16011,1],[16044,1],[16046,1],[16063,2],[16066,1],[16105,2],[16108,1],[16155,1],[16157,1],[16159,1],[16161,1],[16163,1],[16165,1],[16167,1],[16169,1],[16646,2],[16735,2],[16845,1],[16915,3],[16919,1],[16977,3],[17366,2],[17438,2],[17462,1],[17478,1],[17480,1],[17507,2],[17607,1],[17668,2],[17752,2],[17932,2],[17975,3],[18011,1],[18013,1],[18109,2],[18112,2],[18115,1],[18171,3],[18194,2],[18273,1],[18275,1],[18317,1],[18331,1],[18333,2],[18432,2],[18506,2],[18591,2],[18724,2],[18898,2],[18941,2],[18951,2],[18958,1],[18960,2],[18963,2],[18979,1],[18981,1],[18991,2],[19086,1],[19093,2],[19153,1],[19305,2],[19308,1],[19310,1],[19322,2],[19415,2],[19422,1],[19424,2],[19427,2],[19443,1],[19464,2],[19536,2],[19655,1],[19710,1],[19744,1],[19746,2],[19848,1],[19876,1],[19888,1],[19944,2],[20001,1],[20055,2],[20160,1],[20214,2],[20341,1],[20395,2],[20438,2],[20455,1],[20491,1],[20493,1],[20507,1],[20538,1],[20561,1],[20594,2],[20606,1],[20633,1],[20642,1],[20671,1],[20679,1],[20686,1],[20728,1],[20751,1],[20776,1],[20778,2],[20781,2],[20797,1],[20856,1],[21027,1],[21073,1],[21109,1],[21166,1],[21200,1],[21305,1],[21338,1],[21466,1],[21500,1],[21542,1],[21544,1],[21668,1],[21748,1],[21750,1],[21808,1],[21815,1],[21822,1],[21956,3],[21960,2],[21963,2],[21966,1],[21977,1],[22251,1],[22295,1],[22297,1],[22388,1],[22405,1],[22420,1],[22519,2],[22908,1],[23005,1],[23007,2],[23705,1],[23752,1],[23754,1],[23771,2],[23774,1],[23805,1],[23816,1],[23827,1],[23838,1],[23840,1],[23850,2],[23853,2],[23856,1],[23876,1],[23897,1],[23919,2],[23934,1],[23956,1],[23958,1],[23960,1],[23962,1],[23964,1],[23966,2],[23983,1],[23994,1],[24005,1],[24007,1],[24017,2],[24020,2],[24023,1],[24044,1],[24066,1],[24068,1],[24070,1],[24072,1],[24074,2],[24087,1],[24098,1],[24109,1],[24111,1],[24121,2],[24124,2],[24127,1],[24148,1],[24175,1],[24177,2],[24180,1],[24200,1],[24221,1],[24244,2],[24259,1],[24281,1],[24283,1],[24285,1],[24287,1],[24289,1],[24291,2],[24305,1],[24316,1],[24327,1],[24329,1],[24339,2],[24342,2],[24345,1],[24366,1],[24389,1],[24391,1],[24393,1],[24395,1],[24397,2],[24410,1],[24421,1],[24432,1],[24434,1],[24444,2],[24447,2],[24450,1],[24471,1],[24495,1],[24497,2],[24500,1],[24520,1],[24541,1],[24564,2],[24579,1],[24601,1],[24603,1],[24605,1],[24607,1],[24609,1],[24611,2],[24623,1],[24633,2],[24636,1],[24638,2],[24653,1],[24668,1],[24680,1],[24713,1],[24715,1],[24732,2],[24735,1],[24774,2],[24777,1],[24824,1],[24826,1],[24828,2],[24842,1],[24875,1],[24877,1],[24894,2],[24897,1],[24936,2],[24939,1],[24986,1],[24988,1],[24990,2],[25003,1],[25036,1],[25038,1],[25055,2],[25058,1],[25097,2],[25100,1],[25147,1],[25149,1],[25151,2],[25168,1],[25201,1],[25203,1],[25220,2],[25223,1],[25262,2],[25265,1],[25312,1],[25314,1],[25316,2],[25328,1],[25361,1],[25363,1],[25380,2],[25383,1],[25422,2],[25425,1],[25472,1],[25474,1],[25476,2],[25488,1],[25521,1],[25523,1],[25548,1],[25550,1],[25552,1],[25554,1],[25556,1],[25558,2],[25561,1],[25600,1],[25611,1],[25621,2],[25624,2],[25641,1],[25651,2],[25654,1],[25656,2],[25671,1],[25686,1],[25697,1],[25730,1],[25732,1],[25757,1],[25759,1],[25761,2],[25778,1],[25811,1],[25813,1],[25830,2],[25833,1],[25872,2],[25875,1],[25922,1],[25924,1],[25926,1],[25928,1],[25930,1],[25932,1],[25934,1],[25936,1]]},"757":{"position":[[410,1],[579,1],[878,1],[1158,1],[1278,1]]},"769":{"position":[[800,1],[847,1],[849,1],[866,2],[869,1],[902,1],[925,1],[935,2],[938,2],[966,1],[976,2],[979,2],[1000,1],[1010,2],[1013,1],[1015,2],[1030,1],[1045,1],[1068,1],[1101,1],[1103,1],[1120,1],[1122,1],[1124,2],[1152,1],[1185,1],[1187,1],[1204,1],[1206,1],[1208,2],[1229,1],[1262,1],[1264,1],[1281,1],[1283,1],[1285,1],[1287,1],[1289,1],[1291,1],[1293,1],[1295,1]]},"771":{"position":[[563,2],[635,2],[659,1],[675,1],[677,1],[704,2],[804,1],[865,2],[949,2],[1129,2],[1172,3],[1208,1],[1210,1],[1283,2],[1286,2],[1289,1],[1345,3],[1368,2],[1447,1],[1449,1],[1491,1],[1505,1],[1507,2],[1606,2],[1680,2],[1765,2],[1898,2],[2072,2],[2115,2],[2125,2],[2132,1],[2134,2],[2137,2],[2153,1],[2155,1],[2165,2],[2260,1],[2267,2],[2327,1],[2456,2],[2459,1],[2461,1],[2473,2],[2566,2],[2573,1],[2575,2],[2578,2],[2594,1],[2615,2],[2687,2],[2806,1],[2861,1],[2895,1],[2897,2],[2999,1],[3027,1],[3039,1],[3095,2],[3152,1],[3206,2],[3311,1],[3365,2],[3492,1],[3546,2],[3589,2],[3606,1],[3642,1],[3644,1],[3658,1],[3689,1],[3712,1],[3745,2],[3757,1],[3784,1],[3793,1],[3822,1],[3830,1],[3837,1],[3861,1],[3891,1],[3904,1],[3906,2],[3909,2],[3925,1],[3984,1],[4155,1],[4201,1],[4237,1],[4294,1],[4328,1],[4433,1],[4466,1],[4594,1],[4628,1],[4670,1],[4672,1],[4796,1],[4876,1],[4878,1],[4936,1],[4943,1],[4950,1],[5061,3],[5065,2],[5068,2],[5071,1],[5082,1],[5356,1],[5400,1],[5402,1],[5493,1],[5510,1],[5525,1],[5601,2],[5967,1],[6041,1],[6043,2],[6211,2],[6283,2],[6307,1],[6323,1],[6325,1],[6352,2],[6452,1],[6513,2],[6597,2],[6777,2],[6820,3],[6856,1],[6858,1],[6935,2],[6938,2],[6941,1],[6997,3],[7020,2],[7099,1],[7101,1],[7143,1],[7157,1],[7159,2],[7258,2],[7332,2],[7417,2],[7550,2],[7724,2],[7767,2],[7777,2],[7784,1],[7786,2],[7789,2],[7805,1],[7807,1],[7817,2],[7912,1],[7919,2],[7979,1],[8112,2],[8115,1],[8117,1],[8129,2],[8222,2],[8229,1],[8231,2],[8234,2],[8250,1],[8271,2],[8343,2],[8462,1],[8517,1],[8551,1],[8553,2],[8655,1],[8683,1],[8695,1],[8751,2],[8808,1],[8862,2],[8967,1],[9021,2],[9148,1],[9202,2],[9245,2],[9262,1],[9298,1],[9300,1],[9314,1],[9345,1],[9368,1],[9401,2],[9413,1],[9440,1],[9449,1],[9478,1],[9486,1],[9493,1],[9517,1],[9551,1],[9564,1],[9566,2],[9569,2],[9585,1],[9644,1],[9815,1],[9861,1],[9897,1],[9954,1],[9988,1],[10093,1],[10126,1],[10254,1],[10288,1],[10330,1],[10332,1],[10456,1],[10536,1],[10538,1],[10596,1],[10603,1],[10610,1],[10725,3],[10729,2],[10732,2],[10735,1],[10746,1],[11020,1],[11064,1],[11066,1],[11157,1],[11174,1],[11189,1],[11269,2],[11639,1],[11717,1],[11719,2],[11895,2],[11967,2],[11991,1],[12007,1],[12009,1],[12036,2],[12136,1],[12197,2],[12281,2],[12461,2],[12504,3],[12540,1],[12542,1],[12615,1],[12692,1],[12762,2],[12765,2],[12768,1],[12824,3],[12847,2],[12926,1],[12928,1],[12970,1],[12984,1],[12986,2],[13085,2],[13159,2],[13244,2],[13377,2],[13551,2],[13594,2],[13604,2],[13611,1],[13613,2],[13616,2],[13632,1],[13634,1],[13644,2],[13739,1],[13746,2],[13806,1],[13935,2],[13938,1],[14071,2],[14074,1],[14200,2],[14203,1],[14205,1],[14217,2],[14310,2],[14317,1],[14319,2],[14322,2],[14338,1],[14359,2],[14431,2],[14550,1],[14605,1],[14639,1],[14641,2],[14743,1],[14771,1],[14783,1],[14839,2],[14896,1],[14950,2],[15055,1],[15109,2],[15236,1],[15290,2],[15333,2],[15350,1],[15386,1],[15388,1],[15402,1],[15433,1],[15456,1],[15489,2],[15501,1],[15528,1],[15537,1],[15566,1],[15574,1],[15581,1],[15605,1],[15635,1],[15648,2],[15657,1],[15664,1],[15688,1],[15722,1],[15735,2],[15744,1],[15751,1],[15775,1],[15802,1],[15815,1],[15817,2],[15820,2],[15836,1],[15895,1],[16066,1],[16112,1],[16148,1],[16205,1],[16239,1],[16344,1],[16377,1],[16505,1],[16539,1],[16581,1],[16583,1],[16707,1],[16787,1],[16789,1],[16847,1],[16854,1],[16861,1],[16972,2],[17059,2],[17139,3],[17143,2],[17146,2],[17149,1],[17160,1],[17434,1],[17478,1],[17480,1],[17571,1],[17588,1],[17603,1],[17824,2],[18429,1],[18503,2],[18506,1],[18584,2],[18587,1],[18658,1],[18660,2],[19129,2],[19201,2],[19225,1],[19241,1],[19243,1],[19270,2],[19370,1],[19431,2],[19515,2],[19695,2],[19738,3],[19742,2],[19763,1],[19773,1],[19775,1],[19871,2],[19874,1],[19931,3],[19935,2],[19946,1],[19972,2],[20051,1],[20053,1],[20095,1],[20109,1],[20111,2],[20210,2],[20284,2],[20369,2],[20502,2],[20676,2],[20719,2],[20729,2],[20736,1],[20738,2],[20741,2],[20757,1],[20759,1],[20769,2],[20864,1],[20871,2],[20964,1],[20976,2],[21055,2],[21063,1],[21065,1],[21081,1],[21102,2],[21174,2],[21293,1],[21348,1],[21382,1],[21384,2],[21486,1],[21514,1],[21526,1],[21582,2],[21639,1],[21693,2],[21798,1],[21852,2],[21979,1],[22033,2],[22076,2],[22093,1],[22129,1],[22131,1],[22145,1],[22170,1],[22193,1],[22226,2],[22238,1],[22263,1],[22270,1],[22294,1],[22324,1],[22338,2],[22354,1],[22394,2],[22414,1],[22440,1],[22611,1],[22657,1],[22693,1],[22750,1],[22784,1],[22889,1],[22922,1],[23050,1],[23084,1],[23126,1],[23128,1],[23252,1],[23332,1],[23334,1],[23392,1],[23399,1],[23488,1],[23499,1],[23539,1],[23558,1],[23860,1],[24123,1],[24167,1],[24169,1],[24260,1],[24410,1],[24451,1],[24466,2],[24508,1],[24531,2],[24577,1],[24591,2],[24638,1],[24670,2],[24828,2],[24900,2],[24924,1],[24940,1],[24942,1],[24969,2],[25069,1],[25130,2],[25214,2],[25394,2],[25437,3],[25441,2],[25462,1],[25472,1],[25474,1],[25567,2],[25570,1],[25627,3],[25631,2],[25642,1],[25669,2],[25748,1],[25750,1],[25792,1],[25806,1],[25808,2],[25907,2],[25981,2],[26066,2],[26199,2],[26373,2],[26416,2],[26426,2],[26433,1],[26435,2],[26438,2],[26454,1],[26456,1],[26466,2],[26561,1],[26568,2],[26658,1],[26670,2],[26749,2],[26757,1],[26759,1],[26776,1],[26797,2],[26869,2],[26988,1],[27043,1],[27077,1],[27079,2],[27181,1],[27209,1],[27221,1],[27277,2],[27334,1],[27388,2],[27493,1],[27547,2],[27674,1],[27728,2],[27771,2],[27788,1],[27824,1],[27826,1],[27840,1],[27865,1],[27888,1],[27921,2],[27933,1],[27958,1],[27965,1],[27989,1],[28016,1],[28030,2],[28046,1],[28086,2],[28106,1],[28133,1],[28304,1],[28350,1],[28386,1],[28443,1],[28477,1],[28582,1],[28615,1],[28743,1],[28777,1],[28819,1],[28821,1],[28945,1],[29025,1],[29027,1],[29085,1],[29092,1],[29178,1],[29189,1],[29229,1],[29248,1],[29548,1],[29812,1],[29856,1],[29858,1],[29949,1],[30096,1],[30138,1],[30153,2],[30195,1],[30215,2],[30258,1],[30272,2],[30319,1],[30351,2]]},"773":{"position":[[1423,1],[1470,1],[1472,1],[1505,1],[1519,1],[1529,2],[1532,2],[1553,1],[1563,2],[1566,2],[1590,1],[1601,1],[1612,1],[1614,1],[1624,2],[1627,2],[1630,1],[1651,1],[1676,1],[1678,2],[1681,1],[1702,1],[1733,1],[1735,1],[1737,1],[1739,1],[1741,2],[1769,1],[1780,1],[1791,1],[1793,1],[1803,2],[1806,2],[1809,1],[1830,1],[1855,1],[1857,2],[1860,1],[1881,1],[1912,1],[1914,1],[1916,1],[1918,1],[1920,2],[1941,1],[1952,1],[1963,1],[1965,1],[1975,2],[1978,2],[1981,1],[2002,1],[2027,1],[2029,1],[2031,1],[2033,1],[2035,1],[2037,2],[2052,1],[2067,1],[2081,1],[2114,1],[2116,1],[2133,1],[2135,1],[2137,2],[2158,1],[2191,1],[2193,1],[2210,1],[2212,1],[2214,2],[2238,1],[2271,1],[2273,1],[2290,1],[2292,1],[2294,2],[2322,1],[2355,1],[2357,1],[2374,1],[2376,1],[2378,2],[2399,1],[2432,1],[2434,1],[2451,1],[2453,1],[2455,1],[2457,1],[2459,1],[2461,1],[2463,1],[2465,1],[2981,2],[3053,2],[3077,1],[3093,1],[3095,1],[3122,2],[3222,1],[3283,2],[3367,2],[3547,2],[3590,3],[3626,1],[3628,1],[3698,1],[3762,1],[3835,1],[3901,2],[3904,2],[3907,1],[3963,3],[3986,2],[4065,1],[4067,1],[4109,1],[4123,1],[4125,2],[4224,2],[4298,2],[4383,2],[4516,2],[4690,2],[4733,2],[4743,2],[4750,1],[4752,2],[4755,2],[4771,1],[4773,1],[4783,2],[4878,1],[4885,2],[4945,1],[5071,2],[5074,1],[5194,2],[5197,1],[5326,2],[5329,1],[5451,2],[5454,1],[5456,1],[5468,2],[5561,2],[5568,1],[5570,2],[5573,2],[5589,1],[5610,2],[5682,2],[5801,1],[5856,1],[5890,1],[5892,2],[5994,1],[6022,1],[6034,1],[6090,2],[6147,1],[6201,2],[6306,1],[6360,2],[6487,1],[6541,2],[6584,2],[6601,1],[6637,1],[6639,1],[6653,1],[6684,1],[6707,1],[6740,2],[6752,1],[6779,1],[6788,1],[6817,1],[6825,1],[6832,1],[6856,1],[6883,1],[6896,2],[6905,1],[6912,1],[6936,1],[6957,1],[6970,2],[6979,1],[6986,1],[7013,1],[7040,1],[7053,2],[7062,1],[7069,1],[7095,1],[7116,1],[7129,1],[7131,2],[7134,2],[7150,1],[7209,1],[7380,1],[7426,1],[7462,1],[7519,1],[7553,1],[7658,1],[7691,1],[7819,1],[7853,1],[7895,1],[7897,1],[8021,1],[8101,1],[8103,1],[8161,1],[8168,1],[8175,1],[8283,2],[8357,2],[8440,2],[8516,3],[8520,2],[8523,2],[8526,1],[8537,1],[8811,1],[8855,1],[8857,1],[8948,1],[8965,1],[8980,1],[9253,2],[9957,1],[10028,2],[10031,1],[10096,2],[10099,1],[10173,2],[10176,1],[10243,1],[10245,2],[10457,2],[10529,2],[10553,1],[10569,1],[10571,1],[10598,2],[10698,1],[10759,2],[10843,2],[11023,2],[11066,3],[11070,2],[11091,1],[11101,1],[11103,1],[11202,2],[11205,1],[11262,3],[11266,2],[11277,1],[11303,2],[11382,1],[11384,1],[11426,1],[11440,1],[11442,2],[11541,2],[11615,2],[11700,2],[11833,2],[12007,2],[12050,2],[12060,2],[12067,1],[12069,2],[12072,2],[12088,1],[12090,1],[12100,2],[12195,1],[12202,2],[12298,1],[12310,2],[12389,2],[12397,1],[12399,1],[12415,1],[12436,2],[12508,2],[12627,1],[12682,1],[12716,1],[12718,2],[12820,1],[12848,1],[12860,1],[12916,2],[12973,1],[13027,2],[13132,1],[13186,2],[13313,1],[13367,2],[13410,2],[13427,1],[13463,1],[13465,1],[13479,1],[13504,1],[13527,1],[13560,2],[13572,1],[13597,1],[13604,1],[13631,1],[13661,1],[13675,2],[13691,1],[13731,2],[13751,1],[13777,1],[13948,1],[13994,1],[14030,1],[14087,1],[14121,1],[14226,1],[14259,1],[14387,1],[14421,1],[14463,1],[14465,1],[14589,1],[14669,1],[14671,1],[14729,1],[14736,1],[14828,1],[14839,1],[14879,1],[14898,1],[15203,1],[15466,1],[15510,1],[15512,1],[15603,1],[15756,1],[15797,1],[15815,2],[15860,1],[15883,2],[15929,1],[15943,2],[15990,1],[16022,2]]},"775":{"position":[[431,1],[470,1],[484,1],[494,2],[497,2],[518,1],[528,2],[531,1],[533,2],[548,1],[563,1],[577,1],[610,1],[612,1],[629,1],[631,1],[633,2],[654,1],[687,1],[689,1],[706,1],[708,1],[710,1],[712,1],[714,1],[716,1],[1192,1],[1239,1],[1241,1],[1258,2],[1261,1],[1294,1],[1308,1],[1318,2],[1321,2],[1342,1],[1352,2],[1355,2],[1379,1],[1390,1],[1401,1],[1403,1],[1413,2],[1416,2],[1419,1],[1440,1],[1465,1],[1467,2],[1470,1],[1491,1],[1522,1],[1524,1],[1526,1],[1528,1],[1530,2],[1558,1],[1569,1],[1580,1],[1582,1],[1592,2],[1595,2],[1598,1],[1619,1],[1644,1],[1646,2],[1649,1],[1670,1],[1701,1],[1703,1],[1705,1],[1707,1],[1709,2],[1730,1],[1741,1],[1752,1],[1754,1],[1764,2],[1767,2],[1770,1],[1791,1],[1816,1],[1818,1],[1820,1],[1822,1],[1824,1],[1826,2],[1841,1],[1856,1],[1870,1],[1903,1],[1905,1],[1922,2],[1925,1],[1974,1],[1976,1],[1978,2],[1999,1],[2032,1],[2034,1],[2051,2],[2054,1],[2109,1],[2111,1],[2113,2],[2137,1],[2170,1],[2172,1],[2189,1],[2191,1],[2193,2],[2221,1],[2254,1],[2256,1],[2273,1],[2275,1],[2277,2],[2298,1],[2331,1],[2333,1],[2350,1],[2352,1],[2354,1],[2356,1],[2358,1],[2360,2],[2363,1],[2402,1],[2416,1],[2426,2],[2429,2],[2450,1],[2460,2],[2463,1],[2465,2],[2480,1],[2495,1],[2509,1],[2542,1],[2544,1],[2561,1],[2563,1],[2565,2],[2586,1],[2619,1],[2621,1],[2638,1],[2640,1],[2642,1],[2644,1],[2646,1],[2648,1],[2650,1],[2652,1],[2886,2],[2958,2],[2982,1],[2998,1],[3000,1],[3027,2],[3127,1],[3188,2],[3272,2],[3452,2],[3495,3],[3531,1],[3533,1],[3617,1],[3694,2],[3697,2],[3700,1],[3756,3],[3779,2],[3858,1],[3860,1],[3902,1],[3916,1],[3918,2],[4017,2],[4091,2],[4176,2],[4309,2],[4483,2],[4526,2],[4536,2],[4543,1],[4545,2],[4548,2],[4564,1],[4566,1],[4576,2],[4671,1],[4678,2],[4738,1],[4878,2],[4881,1],[5014,2],[5017,1],[5019,1],[5031,2],[5124,2],[5131,1],[5133,2],[5136,2],[5152,1],[5173,2],[5245,2],[5364,1],[5419,1],[5453,1],[5455,2],[5557,1],[5585,1],[5597,1],[5653,2],[5710,1],[5764,2],[5869,1],[5923,2],[6050,1],[6104,2],[6147,2],[6164,1],[6200,1],[6202,1],[6216,1],[6247,1],[6270,1],[6303,2],[6315,1],[6342,1],[6351,1],[6380,1],[6388,1],[6395,1],[6422,1],[6449,1],[6473,2],[6482,1],[6489,1],[6515,1],[6536,1],[6560,1],[6562,2],[6565,2],[6581,1],[6640,1],[6811,1],[6857,1],[6893,1],[6950,1],[6984,1],[7089,1],[7122,1],[7250,1],[7284,1],[7326,1],[7328,1],[7452,1],[7532,1],[7534,1],[7592,1],[7599,1],[7606,1],[7728,2],[7815,3],[7819,2],[7822,2],[7825,1],[7836,1],[8110,1],[8154,1],[8156,1],[8247,1],[8264,1],[8279,1],[8442,2],[8942,1],[9027,2],[9030,1],[9108,1],[9110,2],[9411,2],[9483,2],[9507,1],[9523,1],[9525,1],[9552,2],[9652,1],[9713,2],[9797,2],[9977,2],[10020,3],[10056,1],[10058,1],[10153,1],[10248,1],[10331,1],[10414,2],[10417,2],[10420,1],[10476,3],[10499,2],[10578,1],[10580,1],[10622,1],[10636,1],[10638,2],[10737,2],[10811,2],[10896,2],[11029,2],[11203,2],[11246,2],[11256,2],[11263,1],[11265,2],[11268,2],[11284,1],[11286,1],[11296,2],[11391,1],[11398,2],[11458,1],[11609,2],[11612,1],[11763,2],[11766,1],[11905,2],[11908,1],[12047,2],[12050,1],[12052,1],[12064,2],[12157,2],[12164,1],[12166,2],[12169,2],[12185,1],[12206,2],[12278,2],[12397,1],[12452,1],[12486,1],[12488,2],[12590,1],[12618,1],[12630,1],[12686,2],[12743,1],[12797,2],[12902,1],[12956,2],[13083,1],[13137,2],[13180,2],[13197,1],[13233,1],[13235,1],[13249,1],[13280,1],[13303,1],[13336,2],[13348,1],[13375,1],[13384,1],[13413,1],[13421,1],[13428,1],[13477,1],[13504,1],[13517,2],[13526,1],[13533,1],[13582,1],[13609,1],[13622,2],[13631,1],[13638,1],[13681,1],[13702,1],[13715,2],[13724,1],[13731,1],[13774,1],[13795,1],[13808,1],[13810,2],[13813,2],[13829,1],[13888,1],[14059,1],[14105,1],[14141,1],[14198,1],[14232,1],[14337,1],[14370,1],[14498,1],[14532,1],[14574,1],[14576,1],[14700,1],[14780,1],[14782,1],[14840,1],[14847,1],[14854,1],[14987,2],[15092,2],[15185,2],[15278,3],[15282,2],[15285,2],[15288,1],[15299,1],[15573,1],[15617,1],[15619,1],[15710,1],[15727,1],[15742,1],[16098,2],[16885,1],[16981,2],[16984,1],[17080,2],[17083,1],[17167,2],[17170,1],[17254,1],[17256,2],[17641,2],[17713,2],[17737,1],[17753,1],[17755,1],[17782,2],[17882,1],[17943,2],[18027,2],[18207,2],[18250,3],[18254,2],[18275,1],[18285,1],[18287,1],[18380,2],[18383,1],[18440,3],[18444,2],[18455,1],[18481,2],[18560,1],[18562,1],[18604,1],[18618,1],[18620,2],[18719,2],[18793,2],[18878,2],[19011,2],[19185,2],[19228,2],[19238,2],[19245,1],[19247,2],[19250,2],[19266,1],[19268,1],[19278,2],[19373,1],[19380,2],[19470,1],[19482,2],[19561,2],[19569,1],[19571,1],[19587,1],[19608,2],[19680,2],[19799,1],[19854,1],[19888,1],[19890,2],[19992,1],[20020,1],[20032,1],[20088,2],[20145,1],[20199,2],[20304,1],[20358,2],[20485,1],[20539,2],[20582,2],[20599,1],[20635,1],[20637,1],[20651,1],[20676,1],[20699,1],[20732,2],[20744,1],[20769,1],[20776,1],[20797,1],[20827,1],[20841,2],[20857,1],[20897,2],[20917,1],[20943,1],[21114,1],[21160,1],[21196,1],[21253,1],[21287,1],[21392,1],[21425,1],[21553,1],[21587,1],[21629,1],[21631,1],[21755,1],[21835,1],[21837,1],[21895,1],[21902,1],[21988,1],[21999,1],[22039,1],[22058,1],[22357,1],[22620,1],[22664,1],[22666,1],[22757,1],[22904,1],[22945,1],[22957,2],[22996,1],[23019,2],[23065,1],[23079,2],[23126,1],[23158,2]]},"777":{"position":[[1018,1],[1065,1],[1067,1],[1084,2],[1087,1],[1120,1],[1134,1],[1144,2],[1147,2],[1168,1],[1178,2],[1181,2],[1205,1],[1216,1],[1227,1],[1229,1],[1250,1],[1275,1],[1277,2],[1280,1],[1301,1],[1332,1],[1334,1],[1336,1],[1338,1],[1340,2],[1368,1],[1379,1],[1390,1],[1392,1],[1413,1],[1438,1],[1440,2],[1443,1],[1464,1],[1495,1],[1497,1],[1499,1],[1501,1],[1503,2],[1524,1],[1535,1],[1546,1],[1548,1],[1569,1],[1594,1],[1596,1],[1598,1],[1600,1],[1602,1],[1604,2],[1619,1],[1634,1],[1648,1],[1681,1],[1683,1],[1700,2],[1703,1],[1752,1],[1754,1],[1756,2],[1777,1],[1810,1],[1812,1],[1829,2],[1832,1],[1887,1],[1889,1],[1891,1],[1893,1],[1895,1],[1897,2],[1900,1],[1939,1],[1953,1],[1963,2],[1966,2],[1987,1],[1997,2],[2000,1],[2002,2],[2017,1],[2032,1],[2046,1],[2079,1],[2081,1],[2098,1],[2100,1],[2102,2],[2123,1],[2156,1],[2158,1],[2175,1],[2177,1],[2179,1],[2181,1],[2183,1],[2185,1],[2187,1],[2189,1],[3081,2],[3153,2],[3177,1],[3193,1],[3195,1],[3222,2],[3322,1],[3383,2],[3467,2],[3647,2],[3690,3],[3726,1],[3728,1],[3802,1],[3880,1],[3951,2],[3954,2],[3957,1],[4013,3],[4036,2],[4115,1],[4117,1],[4159,1],[4173,1],[4175,2],[4274,2],[4348,2],[4433,2],[4566,2],[4740,2],[4783,2],[4793,2],[4800,1],[4802,2],[4805,2],[4821,1],[4823,1],[4833,2],[4928,1],[4935,2],[4995,1],[5125,2],[5128,1],[5262,2],[5265,1],[5392,2],[5395,1],[5397,1],[5409,2],[5502,2],[5509,1],[5511,2],[5514,2],[5530,1],[5551,2],[5623,2],[5742,1],[5797,1],[5831,1],[5833,2],[5935,1],[5963,1],[5975,1],[6031,2],[6088,1],[6142,2],[6247,1],[6301,2],[6428,1],[6482,2],[6525,2],[6542,1],[6578,1],[6580,1],[6594,1],[6625,1],[6648,1],[6681,2],[6693,1],[6720,1],[6729,1],[6758,1],[6766,1],[6773,1],[6798,1],[6828,1],[6841,2],[6850,1],[6857,1],[6882,1],[6916,1],[6929,2],[6938,1],[6945,1],[6970,1],[6997,1],[7010,1],[7012,2],[7015,2],[7031,1],[7090,1],[7261,1],[7307,1],[7343,1],[7400,1],[7434,1],[7539,1],[7572,1],[7700,1],[7734,1],[7776,1],[7778,1],[7902,1],[7982,1],[7984,1],[8042,1],[8049,1],[8056,1],[8168,2],[8256,2],[8337,3],[8341,2],[8344,2],[8347,1],[8358,1],[8632,1],[8676,1],[8678,1],[8769,1],[8786,1],[8801,1],[9025,2],[9633,1],[9708,2],[9711,1],[9790,2],[9793,1],[9865,1],[9867,2],[10333,2],[10405,2],[10429,1],[10445,1],[10447,1],[10474,2],[10574,1],[10635,2],[10719,2],[10899,2],[10942,3],[10946,2],[10967,1],[10977,1],[10979,1],[11076,2],[11079,1],[11136,3],[11140,2],[11151,1],[11178,2],[11257,1],[11259,1],[11301,1],[11315,1],[11317,2],[11416,2],[11490,2],[11575,2],[11708,2],[11882,2],[11925,2],[11935,2],[11942,1],[11944,2],[11947,2],[11963,1],[11965,1],[11975,2],[12070,1],[12077,2],[12171,1],[12183,2],[12262,2],[12270,1],[12272,1],[12289,1],[12310,2],[12382,2],[12501,1],[12556,1],[12590,1],[12592,2],[12694,1],[12722,1],[12734,1],[12790,2],[12847,1],[12901,2],[13006,1],[13060,2],[13187,1],[13241,2],[13284,2],[13301,1],[13337,1],[13339,1],[13353,1],[13378,1],[13401,1],[13434,2],[13446,1],[13471,1],[13478,1],[13503,1],[13533,1],[13547,2],[13563,1],[13603,2],[13623,1],[13650,1],[13821,1],[13867,1],[13903,1],[13960,1],[13994,1],[14099,1],[14132,1],[14260,1],[14294,1],[14336,1],[14338,1],[14462,1],[14542,1],[14544,1],[14602,1],[14609,1],[14699,1],[14710,1],[14750,1],[14769,1],[15073,1],[15337,1],[15381,1],[15383,1],[15474,1],[15625,1],[15667,1],[15683,2],[15726,1],[15749,2],[15795,1],[15809,2],[15856,1],[15888,2]]},"787":{"position":[[784,1],[943,1]]},"789":{"position":[[891,1],[938,1],[940,1],[957,2],[960,1],[993,1],[1014,1],[1024,2],[1027,1],[1029,2],[1044,1],[1059,1],[1080,1],[1113,1],[1115,1],[1132,1],[1134,1],[1136,1],[1138,1],[1140,1],[1142,2],[1145,1],[1179,1],[1191,1],[1201,2],[1204,2],[1226,1],[1246,1],[1260,1],[1272,3],[1297,2],[1319,1],[1331,3],[1365,1],[1367,1],[1369,2],[1384,1],[1394,2],[1397,2],[1410,1],[1421,1],[1432,1],[1434,1],[1455,1],[1467,3],[1494,1],[1496,2],[1499,1],[1520,1],[1532,3],[1566,1],[1568,1],[1570,1],[1572,1],[1574,2],[1589,1],[1610,1],[1622,3],[1647,1],[1649,1],[1651,2],[1666,1],[1681,1],[1693,1],[1726,1],[1728,1],[1747,1],[1749,1],[1751,2],[1766,1],[1799,1],[1801,1],[1818,1],[1820,1],[1822,1],[1824,1],[1826,1],[1828,2],[1831,1],[1869,1],[1882,1],[1892,2],[1895,2],[1910,1],[1930,1],[1944,1],[1956,3],[1982,2],[2004,1],[2016,3],[2041,1],[2043,1],[2045,1],[2047,2],[2062,1],[2077,1],[2090,1],[2123,1],[2125,1],[2145,1],[2147,1],[2149,1],[2151,1],[2153,1],[2155,1],[2157,1],[2159,1],[2654,2],[2726,2],[2750,1],[2766,1],[2768,1],[2795,2],[2895,1],[2956,2],[3040,2],[3220,2],[3263,3],[3299,1],[3301,2],[3356,1],[3435,2],[3495,1],[3575,2],[3670,1],[3751,2],[3815,1],[3894,2],[3897,2],[3900,1],[3956,3],[3979,2],[4058,1],[4060,1],[4102,1],[4116,1],[4118,2],[4217,2],[4291,2],[4376,2],[4509,2],[4683,2],[4726,2],[4736,2],[4743,1],[4745,2],[4748,2],[4764,1],[4766,1],[4776,2],[4871,1],[4878,2],[4938,1],[4940,2],[5128,2],[5131,1],[5133,2],[5327,2],[5330,1],[5332,2],[5562,2],[5565,1],[5567,2],[5764,2],[5767,1],[5769,1],[5781,2],[5874,2],[5881,1],[5883,2],[5886,2],[5902,1],[5923,2],[5995,2],[6114,1],[6169,1],[6203,1],[6205,2],[6307,1],[6335,1],[6347,1],[6403,2],[6460,1],[6514,2],[6619,1],[6673,2],[6800,1],[6854,2],[6897,2],[6914,1],[6950,1],[6952,1],[6966,1],[6997,1],[7020,1],[7053,2],[7065,1],[7092,1],[7101,1],[7130,1],[7132,2],[7193,1],[7200,1],[7224,1],[7252,1],[7273,2],[7276,2],[7342,1],[7349,1],[7377,1],[7398,1],[7423,2],[7426,2],[7527,1],[7534,1],[7565,1],[7584,1],[7609,2],[7612,2],[7682,1],[7689,1],[7724,1],[7744,1],[7762,1],[7764,2],[7767,2],[7783,1],[7842,1],[8013,1],[8059,1],[8095,1],[8152,1],[8186,1],[8291,1],[8324,1],[8452,1],[8486,1],[8528,1],[8530,1],[8654,1],[8734,1],[8736,1],[8794,1],[8801,1],[8808,1],[8852,1],[8979,2],[8995,1],[9128,2],[9144,1],[9313,2],[9329,1],[9465,3],[9469,2],[9472,2],[9475,1],[9486,1],[9760,1],[9804,1],[9806,1],[9897,1],[9914,1],[9929,1],[10248,2],[10998,2],[11053,1],[11133,2],[11136,2],[11196,1],[11277,2],[11280,2],[11375,1],[11457,2],[11460,2],[11524,1],[11604,1],[11606,2]]},"795":{"position":[[481,2],[553,2],[577,1],[593,1],[595,1],[622,2],[722,1],[783,2],[867,2],[1047,2],[1090,3],[1094,2],[1115,1],[1125,1],[1127,1],[1219,2],[1222,1],[1279,3],[1283,2],[1294,1],[1320,2],[1399,1],[1401,1],[1443,1],[1457,1],[1459,2],[1558,2],[1632,2],[1717,2],[1850,2],[2024,2],[2067,2],[2077,2],[2084,1],[2086,2],[2089,2],[2105,1],[2107,1],[2117,2],[2212,1],[2219,2],[2308,1],[2320,2],[2399,2],[2407,1],[2409,1],[2425,1],[2446,2],[2518,2],[2637,1],[2692,1],[2726,1],[2728,2],[2830,1],[2858,1],[2870,1],[2926,2],[2983,1],[3037,2],[3142,1],[3196,2],[3323,1],[3377,2],[3420,2],[3437,1],[3473,1],[3475,1],[3489,1],[3514,1],[3537,1],[3570,2],[3582,1],[3607,1],[3614,1],[3638,1],[3659,1],[3678,2],[3694,1],[3734,2],[3754,1],[3780,1],[3951,1],[3997,1],[4033,1],[4090,1],[4124,1],[4229,1],[4262,1],[4390,1],[4424,1],[4466,1],[4468,1],[4592,1],[4672,1],[4674,1],[4732,1],[4739,1],[4824,1],[4835,1],[4875,1],[4894,1],[5192,1],[5455,1],[5499,1],[5501,1],[5592,1],[5738,1],[5779,1],[5794,2],[5836,1],[5850,2],[5887,1],[5906,2],[5958,1],[5990,2],[6169,2],[6241,2],[6265,1],[6281,1],[6283,1],[6310,2],[6410,1],[6471,2],[6555,2],[6735,2],[6778,3],[6782,2],[6803,1],[6813,1],[6815,1],[6911,2],[6914,1],[6971,3],[6975,2],[6986,1],[7012,2],[7091,1],[7093,1],[7135,1],[7149,1],[7151,2],[7250,2],[7324,2],[7409,2],[7542,2],[7716,2],[7759,2],[7769,2],[7776,1],[7778,2],[7781,2],[7797,1],[7799,1],[7809,2],[7904,1],[7911,2],[8004,1],[8016,2],[8095,2],[8103,1],[8105,1],[8121,1],[8142,2],[8214,2],[8333,1],[8388,1],[8422,1],[8424,2],[8526,1],[8554,1],[8566,1],[8622,2],[8679,1],[8733,2],[8838,1],[8892,2],[9019,1],[9073,2],[9116,2],[9133,1],[9169,1],[9171,1],[9185,1],[9210,1],[9233,1],[9266,2],[9278,1],[9303,1],[9310,1],[9338,1],[9359,1],[9378,2],[9394,1],[9434,2],[9454,1],[9480,1],[9651,1],[9697,1],[9733,1],[9790,1],[9824,1],[9929,1],[9962,1],[10090,1],[10124,1],[10166,1],[10168,1],[10292,1],[10372,1],[10374,1],[10432,1],[10439,1],[10528,1],[10539,1],[10579,1],[10598,1],[10900,1],[11163,1],[11207,1],[11209,1],[11300,1],[11450,1],[11491,1],[11510,2],[11556,1],[11570,2],[11607,1],[11626,2],[11678,1],[11710,2],[11894,2],[11966,2],[11990,1],[12006,1],[12008,1],[12035,2],[12135,1],[12196,2],[12280,2],[12460,2],[12503,3],[12539,1],[12541,2],[12595,1],[12674,2],[12677,2],[12680,1],[12736,3],[12759,2],[12838,1],[12840,1],[12882,1],[12896,1],[12898,2],[12997,2],[13071,2],[13156,2],[13289,2],[13463,2],[13506,2],[13516,2],[13523,1],[13525,2],[13528,2],[13544,1],[13546,1],[13556,2],[13651,1],[13658,2],[13718,1],[13720,2],[13907,2],[13910,1],[13912,1],[13924,2],[14017,2],[14024,1],[14026,2],[14029,2],[14045,1],[14066,2],[14138,2],[14257,1],[14312,1],[14346,1],[14348,2],[14450,1],[14478,1],[14490,1],[14546,2],[14603,1],[14657,2],[14762,1],[14816,2],[14943,1],[14997,2],[15040,2],[15057,1],[15093,1],[15095,1],[15109,1],[15140,1],[15163,1],[15196,2],[15208,1],[15235,1],[15244,1],[15273,1],[15275,2],[15335,1],[15342,1],[15366,1],[15394,1],[15415,1],[15417,2],[15420,2],[15436,1],[15495,1],[15666,1],[15712,1],[15748,1],[15805,1],[15839,1],[15944,1],[15977,1],[16105,1],[16139,1],[16181,1],[16183,1],[16307,1],[16387,1],[16389,1],[16447,1],[16454,1],[16461,1],[16505,1],[16631,3],[16635,2],[16638,2],[16641,1],[16652,1],[16926,1],[16970,1],[16972,1],[17063,1],[17080,1],[17095,1],[17177,2],[17549,2],[17603,1],[17683,1],[17685,2],[17804,2],[17876,2],[17900,1],[17916,1],[17918,1],[17945,2],[18045,1],[18106,2],[18190,2],[18370,2],[18413,3],[18417,2],[18438,1],[18448,1],[18450,1],[18542,2],[18545,1],[18602,3],[18606,2],[18617,1],[18644,2],[18723,1],[18725,1],[18767,1],[18781,1],[18783,2],[18882,2],[18956,2],[19041,2],[19174,2],[19348,2],[19391,2],[19401,2],[19408,1],[19410,2],[19413,2],[19429,1],[19431,1],[19441,2],[19536,1],[19543,2],[19632,1],[19644,2],[19723,2],[19731,1],[19733,1],[19750,1],[19771,2],[19843,2],[19962,1],[20017,1],[20051,1],[20053,2],[20155,1],[20183,1],[20195,1],[20251,2],[20308,1],[20362,2],[20467,1],[20521,2],[20648,1],[20702,2],[20745,2],[20762,1],[20798,1],[20800,1],[20814,1],[20839,1],[20862,1],[20895,2],[20907,1],[20932,1],[20939,1],[20963,1],[20984,1],[21003,2],[21019,1],[21059,2],[21079,1],[21106,1],[21277,1],[21323,1],[21359,1],[21416,1],[21450,1],[21555,1],[21588,1],[21716,1],[21750,1],[21792,1],[21794,1],[21918,1],[21998,1],[22000,1],[22058,1],[22065,1],[22150,1],[22161,1],[22201,1],[22220,1],[22519,1],[22783,1],[22827,1],[22829,1],[22920,1],[23066,1],[23108,1],[23123,2],[23165,1],[23179,2],[23216,1],[23235,2],[23287,1],[23319,2]]},"797":{"position":[[300,1],[335,1],[345,1],[355,2],[358,1],[360,2],[375,1],[390,1],[400,1],[433,1],[435,1],[452,1],[454,1],[456,1],[458,1],[460,1],[462,1],[525,1],[568,1],[578,1],[588,2],[591,1],[593,2],[608,1],[623,1],[633,1],[666,1],[668,1],[685,1],[687,1],[689,1],[691,1],[693,1],[695,1],[1535,1],[1568,1],[1589,1],[1599,2],[1602,2],[1634,1],[1644,2],[1647,2],[1671,1],[1681,2],[1684,2],[1707,1],[1725,1],[1736,1],[1738,1],[1758,1],[1772,1],[1784,3],[1820,2],[1842,1],[1854,3],[1877,1],[1879,1],[1881,2],[1884,1],[1904,1],[1918,1],[1930,3],[1974,2],[1996,1],[2008,3],[2031,1],[2033,1],[2035,1],[2037,1],[2039,1],[2041,1],[2043,2],[2058,1],[2073,1],[2094,1],[2127,1],[2129,1],[2146,1],[2148,1],[2150,2],[2182,1],[2215,1],[2217,1],[2246,1],[2248,1],[2250,2],[2274,1],[2307,1],[2309,1],[2330,1],[2332,1],[2334,1],[2336,1],[2338,1],[2340,1],[3075,1],[3109,1],[3121,1],[3131,2],[3134,2],[3156,1],[3176,1],[3190,1],[3202,3],[3227,2],[3249,1],[3261,3],[3295,1],[3297,1],[3299,2],[3314,1],[3324,2],[3327,2],[3356,1],[3374,1],[3385,1],[3387,1],[3408,1],[3420,3],[3454,1],[3456,2],[3459,1],[3479,1],[3493,1],[3505,3],[3530,2],[3552,1],[3564,3],[3599,1],[3601,1],[3603,1],[3605,1],[3607,1],[3609,2],[3622,1],[3633,1],[3644,1],[3646,1],[3667,1],[3679,3],[3706,1],[3708,2],[3711,1],[3732,1],[3744,3],[3785,1],[3787,1],[3789,1],[3791,1],[3793,2],[3808,1],[3829,1],[3841,3],[3866,1],[3868,1],[3870,2],[3885,1],[3900,1],[3912,1],[3945,1],[3947,1],[3966,1],[3968,1],[3970,2],[3985,1],[4018,1],[4020,1],[4037,1],[4039,1],[4041,1],[4043,1],[4045,1],[4047,1],[4596,2],[4668,2],[4692,1],[4708,1],[4710,1],[4737,2],[4837,1],[4898,2],[4982,2],[5162,2],[5205,3],[5209,2],[5230,1],[5240,1],[5242,1],[5329,2],[5332,1],[5389,3],[5393,2],[5404,1],[5431,2],[5510,1],[5512,1],[5554,1],[5568,1],[5570,2],[5669,2],[5743,2],[5828,2],[5961,2],[6135,2],[6178,2],[6188,2],[6195,1],[6197,2],[6200,2],[6216,1],[6218,1],[6228,2],[6323,1],[6330,2],[6414,1],[6426,2],[6505,2],[6513,1],[6515,1],[6532,1],[6553,2],[6625,2],[6744,1],[6799,1],[6833,1],[6835,2],[6937,1],[6965,1],[6977,1],[7033,2],[7090,1],[7144,2],[7249,1],[7303,2],[7430,1],[7484,2],[7527,2],[7544,1],[7580,1],[7582,1],[7596,1],[7621,1],[7644,1],[7677,2],[7689,1],[7714,1],[7721,1],[7740,1],[7761,1],[7780,2],[7796,1],[7836,2],[7856,1],[7883,1],[8054,1],[8100,1],[8136,1],[8193,1],[8227,1],[8332,1],[8365,1],[8493,1],[8527,1],[8569,1],[8571,1],[8695,1],[8775,1],[8777,1],[8835,1],[8842,1],[8922,1],[8933,1],[8973,1],[8992,1],[9286,1],[9550,1],[9594,1],[9596,1],[9687,1],[9828,1],[9870,1],[9880,2],[9917,1],[9931,2],[9968,1],[9987,2],[10039,1],[10071,2],[10401,2],[10473,2],[10497,1],[10513,1],[10515,1],[10542,2],[10642,1],[10703,2],[10787,2],[10967,2],[11010,3],[11046,1],[11048,2],[11115,1],[11201,2],[11267,1],[11353,2],[11441,1],[11549,2],[11552,2],[11555,1],[11611,3],[11634,2],[11713,1],[11715,1],[11757,1],[11771,1],[11773,2],[11872,2],[11946,2],[12031,2],[12164,2],[12338,2],[12381,2],[12391,2],[12398,1],[12400,2],[12403,2],[12419,1],[12421,1],[12431,2],[12526,1],[12533,2],[12593,1],[12595,2],[12802,2],[12805,1],[12807,2],[13013,2],[13016,1],[13018,2],[13268,2],[13271,1],[13273,1],[13285,2],[13378,2],[13385,1],[13387,2],[13390,2],[13406,1],[13427,2],[13499,2],[13618,1],[13673,1],[13707,1],[13709,2],[13811,1],[13839,1],[13851,1],[13907,2],[13964,1],[14018,2],[14123,1],[14177,2],[14304,1],[14358,2],[14401,2],[14418,1],[14454,1],[14456,1],[14470,1],[14501,1],[14524,1],[14557,2],[14569,1],[14596,1],[14605,1],[14634,1],[14636,2],[14709,1],[14716,1],[14745,1],[14775,1],[14796,2],[14799,2],[14871,1],[14878,1],[14907,1],[14937,1],[14958,2],[14961,2],[15055,1],[15062,1],[15105,1],[15143,1],[15164,1],[15166,2],[15169,2],[15185,1],[15244,1],[15415,1],[15461,1],[15497,1],[15554,1],[15588,1],[15693,1],[15726,1],[15854,1],[15888,1],[15930,1],[15932,1],[16056,1],[16136,1],[16138,1],[16196,1],[16203,1],[16210,1],[16254,1],[16400,2],[16416,1],[16561,2],[16577,1],[16766,3],[16770,2],[16773,2],[16776,1],[16787,1],[17061,1],[17105,1],[17107,1],[17198,1],[17215,1],[17230,1],[17511,2],[18176,2],[18243,1],[18330,2],[18333,2],[18399,1],[18486,2],[18489,2],[18577,1],[18686,1],[18688,2],[18944,2],[19016,2],[19040,1],[19056,1],[19058,1],[19085,2],[19185,1],[19246,2],[19330,2],[19510,2],[19553,3],[19589,1],[19591,2],[19658,1],[19738,2],[19781,1],[19847,2],[19850,2],[19853,1],[19909,3],[19932,2],[20011,1],[20013,1],[20055,1],[20069,1],[20071,2],[20170,2],[20244,2],[20329,2],[20462,2],[20636,2],[20679,2],[20689,2],[20696,1],[20698,2],[20701,2],[20717,1],[20719,1],[20729,2],[20824,1],[20831,2],[20891,1],[20893,2],[21094,2],[21097,1],[21099,2],[21262,2],[21265,1],[21267,1],[21279,2],[21372,2],[21379,1],[21381,2],[21384,2],[21400,1],[21421,2],[21493,2],[21612,1],[21667,1],[21701,1],[21703,2],[21805,1],[21833,1],[21845,1],[21901,2],[21958,1],[22012,2],[22117,1],[22171,2],[22298,1],[22352,2],[22395,2],[22412,1],[22448,1],[22450,1],[22464,1],[22495,1],[22518,1],[22551,2],[22563,1],[22590,1],[22599,1],[22628,1],[22630,2],[22703,1],[22710,1],[22734,1],[22751,1],[22784,2],[22787,2],[22836,1],[22843,1],[22867,1],[22884,1],[22903,1],[22905,2],[22908,2],[22924,1],[22983,1],[23154,1],[23200,1],[23236,1],[23293,1],[23327,1],[23432,1],[23465,1],[23593,1],[23627,1],[23669,1],[23671,1],[23795,1],[23875,1],[23877,1],[23935,1],[23942,1],[23949,1],[23993,1],[24133,2],[24149,1],[24251,3],[24255,2],[24258,2],[24261,1],[24272,1],[24546,1],[24590,1],[24592,1],[24683,1],[24700,1],[24715,1],[24863,2],[25348,2],[25415,1],[25496,2],[25499,2],[25542,1],[25609,1],[25611,2],[25883,2],[25955,2],[25979,1],[25995,1],[25997,1],[26024,2],[26124,1],[26185,2],[26269,2],[26449,2],[26492,3],[26496,2],[26517,1],[26527,1],[26529,1],[26621,2],[26624,1],[26681,3],[26685,2],[26696,1],[26722,2],[26801,1],[26803,1],[26845,1],[26859,1],[26861,2],[26960,2],[27034,2],[27119,2],[27252,2],[27426,2],[27469,2],[27479,2],[27486,1],[27488,2],[27491,2],[27507,1],[27509,1],[27519,2],[27614,1],[27621,2],[27710,1],[27722,2],[27801,2],[27809,1],[27811,1],[27827,1],[27848,2],[27920,2],[28039,1],[28094,1],[28128,1],[28130,2],[28232,1],[28260,1],[28272,1],[28328,2],[28385,1],[28439,2],[28544,1],[28598,2],[28725,1],[28779,2],[28822,2],[28839,1],[28875,1],[28877,1],[28891,1],[28916,1],[28939,1],[28972,2],[28984,1],[29009,1],[29016,1],[29040,1],[29061,1],[29080,2],[29096,1],[29136,2],[29156,1],[29182,1],[29353,1],[29399,1],[29435,1],[29492,1],[29526,1],[29631,1],[29664,1],[29792,1],[29826,1],[29868,1],[29870,1],[29994,1],[30074,1],[30076,1],[30134,1],[30141,1],[30226,1],[30237,1],[30277,1],[30296,1],[30594,1],[30857,1],[30901,1],[30903,1],[30994,1],[31140,1],[31181,1],[31196,2],[31238,1],[31252,2],[31289,1],[31308,2],[31360,1],[31392,2]]},"799":{"position":[[1141,2],[1213,2],[1237,1],[1253,1],[1255,1],[1282,2],[1382,1],[1443,2],[1527,2],[1707,2],[1750,3],[1787,1],[1789,2],[1883,1],[1963,2],[2033,1],[2099,2],[2102,2],[2105,1],[2161,3],[2184,2],[2263,1],[2265,1],[2307,1],[2321,1],[2323,2],[2422,2],[2496,2],[2581,2],[2714,2],[2888,2],[2931,2],[2941,2],[2948,1],[2950,2],[2953,2],[2969,1],[2971,1],[2981,2],[3076,1],[3083,2],[3144,1],[3146,2],[3374,2],[3377,1],[3379,2],[3569,2],[3572,1],[3574,1],[3586,2],[3679,2],[3686,1],[3688,2],[3691,2],[3707,1],[3728,2],[3800,2],[3919,1],[3974,1],[4008,1],[4010,2],[4112,1],[4140,1],[4152,1],[4208,2],[4265,1],[4319,2],[4424,1],[4478,2],[4605,1],[4659,2],[4702,2],[4719,1],[4755,1],[4757,1],[4771,1],[4802,1],[4825,1],[4858,2],[4870,1],[4897,1],[4907,1],[4936,1],[4938,2],[5038,1],[5045,1],[5069,1],[5086,1],[5119,2],[5122,2],[5198,1],[5205,1],[5229,1],[5246,1],[5265,1],[5267,2],[5270,2],[5286,1],[5345,1],[5516,1],[5562,1],[5598,1],[5655,1],[5689,1],[5794,1],[5827,1],[5955,1],[5989,1],[6031,1],[6033,1],[6157,1],[6237,1],[6239,1],[6297,1],[6304,1],[6311,1],[6357,1],[6524,2],[6540,1],[6669,4],[6674,2],[6677,2],[6680,1],[6691,1],[6965,1],[7009,1],[7011,1],[7102,1],[7120,1],[7135,1],[7283,2],[7693,2],[7787,1],[7868,2],[7871,2],[7941,1],[8008,1],[8010,2],[8578,2],[8650,2],[8674,1],[8690,1],[8692,1],[8719,2],[8819,1],[8880,2],[8964,2],[9144,2],[9187,3],[9191,2],[9212,1],[9222,1],[9224,1],[9335,1],[9337,1],[9415,2],[9418,1],[9482,1],[9484,3],[9488,1],[9545,3],[9549,2],[9560,1],[9586,2],[9665,1],[9667,1],[9709,1],[9723,1],[9725,2],[9824,2],[9898,2],[9983,2],[10116,2],[10290,2],[10333,2],[10343,2],[10350,1],[10352,2],[10355,2],[10371,1],[10373,1],[10383,2],[10478,1],[10485,2],[10611,1],[10690,2],[10693,1],[10758,1],[10760,1],[10762,1],[10774,2],[10853,2],[10861,1],[10863,1],[10879,1],[10900,2],[10972,2],[11091,1],[11146,1],[11180,1],[11182,2],[11284,1],[11312,1],[11324,1],[11380,2],[11437,1],[11491,2],[11596,1],[11650,2],[11777,1],[11831,2],[11874,2],[11891,1],[11927,1],[11929,1],[11943,1],[11968,1],[11991,1],[12024,2],[12036,1],[12061,1],[12068,1],[12092,1],[12113,1],[12150,1],[12330,2],[12333,2],[12349,1],[12389,2],[12409,1],[12435,1],[12606,1],[12652,1],[12688,1],[12745,1],[12779,1],[12884,1],[12917,1],[13045,1],[13079,1],[13121,1],[13123,1],[13247,1],[13327,1],[13329,1],[13387,1],[13394,1],[13664,2],[13667,1],[13678,1],[13718,1],[13737,1],[14133,1],[14396,1],[14440,1],[14442,1],[14533,1],[14860,1],[14901,1],[14916,2],[14958,1],[14972,2],[15009,1],[15028,2],[15081,1],[15083,1],[15085,2],[15125,1],[15149,1],[15166,1],[15207,1],[15231,1],[15248,1],[15268,2],[15288,1],[15320,2],[15504,2],[15576,2],[15600,1],[15616,1],[15618,1],[15645,2],[15745,1],[15806,2],[15890,2],[16070,2],[16113,3],[16117,2],[16138,1],[16148,1],[16150,1],[16261,1],[16263,1],[16341,2],[16344,1],[16408,1],[16410,3],[16414,1],[16471,3],[16475,2],[16486,1],[16513,2],[16592,1],[16594,1],[16636,1],[16650,1],[16652,2],[16751,2],[16825,2],[16910,2],[17043,2],[17217,2],[17260,2],[17270,2],[17277,1],[17279,2],[17282,2],[17298,1],[17300,1],[17310,2],[17405,1],[17412,2],[17538,1],[17617,2],[17620,1],[17685,1],[17687,1],[17689,1],[17701,2],[17780,2],[17788,1],[17790,1],[17807,1],[17828,2],[17900,2],[18019,1],[18074,1],[18108,1],[18110,2],[18212,1],[18240,1],[18252,1],[18308,2],[18365,1],[18419,2],[18524,1],[18578,2],[18705,1],[18759,2],[18802,2],[18819,1],[18855,1],[18857,1],[18871,1],[18896,1],[18919,1],[18952,2],[18964,1],[18989,1],[18996,1],[19020,1],[19041,1],[19078,1],[19258,2],[19261,2],[19277,1],[19317,2],[19337,1],[19364,1],[19535,1],[19581,1],[19617,1],[19674,1],[19708,1],[19813,1],[19846,1],[19974,1],[20008,1],[20050,1],[20052,1],[20176,1],[20256,1],[20258,1],[20316,1],[20323,1],[20593,2],[20596,1],[20607,1],[20647,1],[20666,1],[21063,1],[21327,1],[21371,1],[21373,1],[21464,1],[21791,1],[21833,1],[21848,2],[21890,1],[21904,2],[21941,1],[21960,2],[22013,1],[22015,1],[22017,2],[22057,1],[22081,1],[22098,1],[22139,1],[22163,1],[22180,1],[22200,2],[22220,1],[22252,2]]},"801":{"position":[[800,1],[847,1],[849,1],[866,2],[869,1],[902,1],[923,1],[933,2],[936,2],[968,1],[978,2],[981,2],[1005,1],[1015,2],[1018,2],[1041,1],[1059,1],[1070,1],[1072,1],[1092,1],[1106,1],[1118,3],[1154,2],[1176,1],[1188,3],[1211,1],[1213,1],[1215,2],[1218,1],[1238,1],[1252,1],[1264,3],[1308,2],[1330,1],[1342,3],[1365,1],[1367,1],[1369,1],[1371,1],[1373,1],[1375,1],[1377,2],[1392,1],[1407,1],[1428,1],[1461,1],[1463,1],[1480,1],[1482,1],[1484,2],[1516,1],[1549,1],[1551,1],[1580,1],[1582,1],[1584,2],[1608,1],[1641,1],[1643,1],[1664,1],[1666,1],[1668,1],[1670,1],[1672,1],[1674,2],[1677,1],[1711,1],[1723,1],[1733,2],[1736,2],[1758,1],[1778,1],[1792,1],[1804,3],[1829,2],[1851,1],[1863,3],[1897,1],[1899,1],[1901,2],[1916,1],[1926,2],[1929,2],[1958,1],[1976,1],[1987,1],[1989,1],[2010,1],[2022,3],[2056,1],[2058,2],[2061,1],[2081,1],[2095,1],[2107,3],[2132,2],[2154,1],[2166,3],[2201,1],[2203,1],[2205,1],[2207,1],[2209,1],[2211,2],[2224,1],[2235,1],[2246,1],[2248,1],[2269,1],[2281,3],[2308,1],[2310,2],[2313,1],[2334,1],[2346,3],[2387,1],[2389,1],[2391,1],[2393,1],[2395,2],[2410,1],[2431,1],[2443,3],[2468,1],[2470,1],[2472,2],[2487,1],[2502,1],[2514,1],[2547,1],[2549,1],[2568,1],[2570,1],[2572,2],[2587,1],[2620,1],[2622,1],[2639,1],[2641,1],[2643,1],[2645,1],[2647,1],[2649,2],[2652,1],[2690,1],[2703,1],[2713,2],[2716,2],[2731,1],[2751,1],[2765,1],[2777,3],[2803,2],[2825,1],[2837,3],[2862,1],[2864,1],[2866,1],[2868,2],[2883,1],[2898,1],[2911,1],[2944,1],[2946,1],[2966,1],[2968,1],[2970,1],[2972,1],[2974,1],[2976,2],[2979,1],[3014,1],[3024,1],[3034,2],[3037,1],[3039,2],[3054,1],[3069,1],[3079,1],[3112,1],[3114,1],[3131,1],[3133,1],[3135,1],[3137,1],[3139,1],[3141,2],[3144,1],[3187,1],[3197,1],[3207,2],[3210,1],[3212,2],[3227,1],[3242,1],[3252,1],[3285,1],[3287,1],[3304,1],[3306,1],[3308,1],[3310,1],[3312,1],[3314,1],[3316,1],[3318,1],[3382,2],[3454,2],[3478,1],[3494,1],[3496,1],[3523,2],[3623,1],[3684,2],[3768,2],[3948,2],[3991,3],[4027,1],[4029,2],[4084,1],[4163,2],[4223,1],[4303,2],[4398,1],[4479,2],[4543,1],[4622,2],[4687,1],[4771,2],[4837,1],[4922,2],[4989,1],[5075,2],[5142,1],[5228,2],[5294,1],[5380,2],[5445,1],[5531,2],[5596,1],[5682,2],[5770,1],[5878,2],[5881,2],[5884,1],[5940,3],[5963,2],[6042,1],[6044,1],[6086,1],[6100,1],[6102,2],[6201,2],[6275,2],[6360,2],[6493,2],[6667,2],[6710,2],[6720,2],[6727,1],[6729,2],[6732,2],[6748,1],[6750,1],[6760,2],[6855,1],[6862,2],[6922,1],[6924,2],[7112,2],[7115,1],[7117,2],[7311,2],[7314,1],[7316,2],[7546,2],[7549,1],[7551,2],[7748,2],[7751,1],[7753,2],[7956,2],[7959,1],[7961,2],[8166,2],[8169,1],[8171,2],[8378,2],[8381,1],[8383,2],[8590,2],[8593,1],[8595,2],[8801,2],[8804,1],[8806,2],[9011,2],[9014,1],[9016,2],[9221,2],[9224,1],[9226,2],[9476,2],[9479,1],[9481,1],[9493,2],[9586,2],[9593,1],[9595,2],[9598,2],[9614,1],[9635,2],[9707,2],[9826,1],[9881,1],[9915,1],[9917,2],[10019,1],[10047,1],[10059,1],[10115,2],[10172,1],[10226,2],[10331,1],[10385,2],[10512,1],[10566,2],[10609,2],[10626,1],[10662,1],[10664,1],[10678,1],[10709,1],[10732,1],[10765,2],[10777,1],[10804,1],[10813,1],[10842,1],[10844,2],[10905,1],[10912,1],[10936,1],[10964,1],[10985,2],[10988,2],[11054,1],[11061,1],[11089,1],[11110,1],[11135,2],[11138,2],[11239,1],[11246,1],[11277,1],[11296,1],[11321,2],[11324,2],[11394,1],[11401,1],[11436,1],[11456,1],[11474,2],[11477,2],[11548,1],[11555,1],[11582,1],[11612,1],[11633,2],[11636,2],[11708,1],[11715,1],[11743,1],[11773,1],[11794,2],[11797,2],[11870,1],[11877,1],[11906,1],[11936,1],[11957,2],[11960,2],[12033,1],[12040,1],[12069,1],[12099,1],[12120,2],[12123,2],[12195,1],[12202,1],[12231,1],[12261,1],[12282,2],[12285,2],[12356,1],[12363,1],[12392,1],[12422,1],[12443,2],[12446,2],[12517,1],[12524,1],[12553,1],[12583,1],[12604,2],[12607,2],[12701,1],[12708,1],[12751,1],[12789,1],[12810,1],[12812,2],[12815,2],[12831,1],[12890,1],[13061,1],[13107,1],[13143,1],[13200,1],[13234,1],[13339,1],[13372,1],[13500,1],[13534,1],[13576,1],[13578,1],[13702,1],[13782,1],[13784,1],[13842,1],[13849,1],[13856,1],[13900,1],[14027,2],[14043,1],[14176,2],[14192,1],[14361,2],[14377,1],[14513,2],[14529,1],[14671,2],[14687,1],[14831,2],[14847,1],[14993,2],[15009,1],[15155,2],[15171,1],[15316,2],[15332,1],[15476,2],[15492,1],[15636,2],[15652,1],[15841,3],[15845,2],[15848,2],[15851,1],[15862,1],[16136,1],[16180,1],[16182,1],[16273,1],[16290,1],[16305,1],[17323,2],[19148,2],[19203,1],[19283,2],[19286,2],[19346,1],[19427,2],[19430,2],[19525,1],[19607,2],[19610,2],[19674,1],[19754,2],[19757,2],[19822,1],[19907,2],[19910,2],[19976,1],[20062,2],[20065,2],[20132,1],[20219,2],[20222,2],[20289,1],[20376,2],[20379,2],[20445,1],[20532,2],[20535,2],[20600,1],[20687,2],[20690,2],[20755,1],[20842,2],[20845,2],[20933,1],[21042,1],[21044,2]]},"803":{"position":[[1013,1],[1060,1],[1062,1],[1079,2],[1082,1],[1113,1],[1124,1],[1134,2],[1137,1],[1139,2],[1154,1],[1169,1],[1180,1],[1213,1],[1215,1],[1232,1],[1234,1],[1236,1],[1238,1],[1240,1],[1242,2],[1245,1],[1278,1],[1288,1],[1298,2],[1301,2],[1323,1],[1333,2],[1336,2],[1368,1],[1378,2],[1381,2],[1405,1],[1415,2],[1418,2],[1441,1],[1459,1],[1470,1],[1472,1],[1492,1],[1506,1],[1518,3],[1554,2],[1576,1],[1588,3],[1611,1],[1613,1],[1615,2],[1618,1],[1638,1],[1652,1],[1664,3],[1708,2],[1730,1],[1742,3],[1765,1],[1767,1],[1769,1],[1771,1],[1773,1],[1775,1],[1777,2],[1792,1],[1807,1],[1817,1],[1850,1],[1852,1],[1869,1],[1871,1],[1873,2],[1895,1],[1928,1],[1930,1],[1947,1],[1949,1],[1951,2],[1983,1],[2016,1],[2018,1],[2047,1],[2049,1],[2051,2],[2075,1],[2108,1],[2110,1],[2131,1],[2133,1],[2135,1],[2137,1],[2139,1],[2141,2],[2144,1],[2178,1],[2190,1],[2200,2],[2203,2],[2225,1],[2245,1],[2259,1],[2271,3],[2296,2],[2318,1],[2330,3],[2364,1],[2366,1],[2368,2],[2383,1],[2393,2],[2396,2],[2425,1],[2443,1],[2454,1],[2456,1],[2477,1],[2489,3],[2523,1],[2525,2],[2528,1],[2548,1],[2562,1],[2574,3],[2599,2],[2621,1],[2633,3],[2668,1],[2670,1],[2672,1],[2674,1],[2676,1],[2678,2],[2691,1],[2702,1],[2713,1],[2715,1],[2736,1],[2748,3],[2775,1],[2777,2],[2780,1],[2801,1],[2813,3],[2854,1],[2856,1],[2858,1],[2860,1],[2862,2],[2877,1],[2898,1],[2910,3],[2935,1],[2937,1],[2939,2],[2954,1],[2969,1],[2981,1],[3014,1],[3016,1],[3035,1],[3037,1],[3039,2],[3054,1],[3087,1],[3089,1],[3106,1],[3108,1],[3110,1],[3112,1],[3114,1],[3116,2],[3119,1],[3157,1],[3170,1],[3180,2],[3183,2],[3198,1],[3218,1],[3232,1],[3244,3],[3270,2],[3292,1],[3304,3],[3329,1],[3331,1],[3333,1],[3335,2],[3350,1],[3365,1],[3378,1],[3411,1],[3413,1],[3433,1],[3435,1],[3437,1],[3439,1],[3441,1],[3443,2],[3446,1],[3481,1],[3491,1],[3501,2],[3504,1],[3506,2],[3521,1],[3536,1],[3546,1],[3579,1],[3581,1],[3598,1],[3600,1],[3602,1],[3604,1],[3606,1],[3608,2],[3611,1],[3654,1],[3664,1],[3674,2],[3677,1],[3679,2],[3694,1],[3709,1],[3719,1],[3752,1],[3754,1],[3771,1],[3773,1],[3775,1],[3777,1],[3779,1],[3781,1],[3783,1],[3785,1]]},"809":{"position":[[428,1],[610,1],[858,1],[869,1]]},"820":{"position":[[517,1],[564,1],[566,1],[583,2],[586,1],[621,1],[632,1],[642,2],[645,2],[658,1],[668,2],[671,2],[687,1],[697,2],[700,2],[713,1],[723,2],[726,1],[728,2],[743,1],[758,1],[769,1],[802,1],[804,1],[821,1],[823,1],[825,2],[838,1],[871,1],[873,1],[890,1],[892,1],[894,2],[910,1],[943,1],[945,1],[962,1],[964,1],[966,2],[979,1],[1012,1],[1014,1],[1031,1],[1033,1],[1035,1],[1037,1],[1039,1],[1041,1],[1043,1],[1045,1],[1271,1],[1306,1],[1318,1],[1328,2],[1331,1],[1333,2],[1348,1],[1363,1],[1375,1],[1408,1],[1410,1],[1427,1],[1429,1],[1431,1],[1433,1],[1435,1],[1437,1],[1878,2],[1950,2],[1974,1],[1990,1],[1992,1],[2019,2],[2119,1],[2180,2],[2264,2],[2444,2],[2487,3],[2523,1],[2525,1],[2602,2],[2605,2],[2608,1],[2664,3],[2687,2],[2766,1],[2768,1],[2810,1],[2824,1],[2826,2],[2925,2],[2999,2],[3084,2],[3217,2],[3391,2],[3434,2],[3444,2],[3451,1],[3453,2],[3456,2],[3472,1],[3474,1],[3484,2],[3579,1],[3586,2],[3646,1],[3779,2],[3782,1],[3784,1],[3796,2],[3889,2],[3896,1],[3898,2],[3901,2],[3917,1],[3938,2],[4010,2],[4129,1],[4184,1],[4218,1],[4220,2],[4322,1],[4350,1],[4362,1],[4418,2],[4475,1],[4529,2],[4634,1],[4688,2],[4815,1],[4869,2],[4912,2],[4929,1],[4965,1],[4967,1],[4981,1],[5012,1],[5035,1],[5068,2],[5080,1],[5107,1],[5116,1],[5145,1],[5153,1],[5160,1],[5184,1],[5206,1],[5231,1],[5233,2],[5236,2],[5252,1],[5311,1],[5482,1],[5528,1],[5564,1],[5621,1],[5655,1],[5760,1],[5793,1],[5921,1],[5955,1],[5997,1],[5999,1],[6123,1],[6203,1],[6205,1],[6263,1],[6270,1],[6277,1],[6392,3],[6396,2],[6399,2],[6402,1],[6413,1],[6687,1],[6731,1],[6733,1],[6824,1],[6841,1],[6856,1],[6936,2],[7306,1],[7384,1],[7386,2],[7586,2],[7658,2],[7682,1],[7698,1],[7700,1],[7727,2],[7827,1],[7888,2],[7972,2],[8152,2],[8195,3],[8199,2],[8220,1],[8230,1],[8232,1],[8332,2],[8335,1],[8392,3],[8396,2],[8407,1],[8433,2],[8512,1],[8514,1],[8556,1],[8570,1],[8572,2],[8671,2],[8745,2],[8830,2],[8963,2],[9137,2],[9180,2],[9190,2],[9197,1],[9199,2],[9202,2],[9218,1],[9220,1],[9230,2],[9325,1],[9332,2],[9429,1],[9441,2],[9520,2],[9528,1],[9530,1],[9546,1],[9567,2],[9639,2],[9758,1],[9813,1],[9847,1],[9849,2],[9951,1],[9979,1],[9991,1],[10047,2],[10104,1],[10158,2],[10263,1],[10317,2],[10444,1],[10498,2],[10541,2],[10558,1],[10594,1],[10596,1],[10610,1],[10635,1],[10658,1],[10691,2],[10703,1],[10728,1],[10735,1],[10759,1],[10781,1],[10807,2],[10823,1],[10863,2],[10883,1],[10909,1],[11080,1],[11126,1],[11162,1],[11219,1],[11253,1],[11358,1],[11391,1],[11519,1],[11553,1],[11595,1],[11597,1],[11721,1],[11801,1],[11803,1],[11861,1],[11868,1],[11961,1],[11972,1],[12012,1],[12031,1],[12337,1],[12600,1],[12644,1],[12646,1],[12737,1],[12891,1],[12932,1],[12947,2],[12989,1],[13004,2],[13042,1],[13068,2],[13127,1],[13159,2],[13298,2],[13370,2],[13394,1],[13410,1],[13412,1],[13439,2],[13539,1],[13600,2],[13684,2],[13864,2],[13907,3],[13943,1],[13945,1],[14018,2],[14021,2],[14024,1],[14080,3],[14103,2],[14182,1],[14184,1],[14226,1],[14240,1],[14242,2],[14341,2],[14415,2],[14500,2],[14633,2],[14807,2],[14850,2],[14860,2],[14867,1],[14869,2],[14872,2],[14888,1],[14890,1],[14900,2],[14995,1],[15002,2],[15062,1],[15191,2],[15194,1],[15196,1],[15208,2],[15301,2],[15308,1],[15310,2],[15313,2],[15329,1],[15350,2],[15422,2],[15541,1],[15596,1],[15630,1],[15632,2],[15734,1],[15762,1],[15774,1],[15830,2],[15887,1],[15941,2],[16046,1],[16100,2],[16227,1],[16281,2],[16324,2],[16341,1],[16377,1],[16379,1],[16393,1],[16424,1],[16447,1],[16480,2],[16492,1],[16519,1],[16528,1],[16557,1],[16565,1],[16572,1],[16596,1],[16614,1],[16639,1],[16641,2],[16644,2],[16660,1],[16719,1],[16890,1],[16936,1],[16972,1],[17029,1],[17063,1],[17168,1],[17201,1],[17329,1],[17363,1],[17405,1],[17407,1],[17531,1],[17611,1],[17613,1],[17671,1],[17678,1],[17685,1],[17796,3],[17800,2],[17803,2],[17806,1],[17817,1],[18091,1],[18135,1],[18137,1],[18228,1],[18245,1],[18260,1],[18336,2],[18702,1],[18776,1],[18778,2],[18932,2],[19004,2],[19028,1],[19044,1],[19046,1],[19073,2],[19173,1],[19234,2],[19318,2],[19498,2],[19541,3],[19545,2],[19566,1],[19576,1],[19578,1],[19674,2],[19677,1],[19734,3],[19738,2],[19749,1],[19775,2],[19854,1],[19856,1],[19898,1],[19912,1],[19914,2],[20013,2],[20087,2],[20172,2],[20305,2],[20479,2],[20522,2],[20532,2],[20539,1],[20541,2],[20544,2],[20560,1],[20562,1],[20572,2],[20667,1],[20674,2],[20767,1],[20779,2],[20858,2],[20866,1],[20868,1],[20884,1],[20905,2],[20977,2],[21096,1],[21151,1],[21185,1],[21187,2],[21289,1],[21317,1],[21329,1],[21385,2],[21442,1],[21496,2],[21601,1],[21655,2],[21782,1],[21836,2],[21879,2],[21896,1],[21932,1],[21934,1],[21948,1],[21973,1],[21996,1],[22029,2],[22041,1],[22066,1],[22073,1],[22097,1],[22115,1],[22141,2],[22157,1],[22197,2],[22217,1],[22243,1],[22414,1],[22460,1],[22496,1],[22553,1],[22587,1],[22692,1],[22725,1],[22853,1],[22887,1],[22929,1],[22931,1],[23055,1],[23135,1],[23137,1],[23195,1],[23202,1],[23291,1],[23302,1],[23342,1],[23361,1],[23663,1],[23926,1],[23970,1],[23972,1],[24063,1],[24213,1],[24254,1],[24269,2],[24311,1],[24322,2],[24356,1],[24382,2],[24441,1],[24473,2],[24550,2],[24622,2],[24646,1],[24662,1],[24664,1],[24691,2],[24791,1],[24852,2],[24936,2],[25116,2],[25159,3],[25163,2],[25184,1],[25194,1],[25196,1],[25293,2],[25296,1],[25353,3],[25357,2],[25368,1],[25395,2],[25474,1],[25476,1],[25518,1],[25532,1],[25534,2],[25633,2],[25707,2],[25792,2],[25925,2],[26099,2],[26142,2],[26152,2],[26159,1],[26161,2],[26164,2],[26180,1],[26182,1],[26192,2],[26287,1],[26294,2],[26388,1],[26400,2],[26479,2],[26487,1],[26489,1],[26506,1],[26527,2],[26599,2],[26718,1],[26773,1],[26807,1],[26809,2],[26911,1],[26939,1],[26951,1],[27007,2],[27064,1],[27118,2],[27223,1],[27277,2],[27404,1],[27458,2],[27501,2],[27518,1],[27554,1],[27556,1],[27570,1],[27595,1],[27618,1],[27651,2],[27663,1],[27688,1],[27695,1],[27719,1],[27738,1],[27764,2],[27780,1],[27820,2],[27840,1],[27867,1],[28038,1],[28084,1],[28120,1],[28177,1],[28211,1],[28316,1],[28349,1],[28477,1],[28511,1],[28553,1],[28555,1],[28679,1],[28759,1],[28761,1],[28819,1],[28826,1],[28916,1],[28927,1],[28967,1],[28986,1],[29290,1],[29554,1],[29598,1],[29600,1],[29691,1],[29842,1],[29884,1],[29899,2],[29941,1],[29953,2],[29988,1],[30014,2],[30073,1],[30105,2],[30575,1],[30622,1],[30624,1],[30641,2],[30644,1],[30679,1],[30690,1],[30700,2],[30703,2],[30716,1],[30727,1],[30738,1],[30740,1],[30750,2],[30753,2],[30756,1],[30777,1],[30799,1],[30801,1],[30803,1],[30805,1],[30807,2],[30823,1],[30834,1],[30845,1],[30847,1],[30857,2],[30860,2],[30863,1],[30884,1],[30907,1],[30909,1],[30911,1],[30913,1],[30915,2],[30928,1],[30939,1],[30950,1],[30952,1],[30962,2],[30965,2],[30968,1],[30989,1],[31015,1],[31017,1],[31019,1],[31021,1],[31023,1],[31025,2],[31040,1],[31055,1],[31066,1],[31099,1],[31101,1],[31118,1],[31120,1],[31122,2],[31135,1],[31168,1],[31170,1],[31187,1],[31189,1],[31191,2],[31207,1],[31240,1],[31242,1],[31259,1],[31261,1],[31263,2],[31276,1],[31309,1],[31311,1],[31328,1],[31330,1],[31332,1],[31334,1],[31336,1],[31338,1],[31340,1],[31342,1],[31772,2],[31844,2],[31868,1],[31884,1],[31886,1],[31913,2],[32013,1],[32074,2],[32158,2],[32338,2],[32381,3],[32385,2],[32406,1],[32416,1],[32418,1],[32514,2],[32517,1],[32574,3],[32578,2],[32589,1],[32615,2],[32694,1],[32696,1],[32738,1],[32752,1],[32754,2],[32853,2],[32927,2],[33012,2],[33145,2],[33319,2],[33362,2],[33372,2],[33379,1],[33381,2],[33384,2],[33400,1],[33402,1],[33412,2],[33507,1],[33514,2],[33607,1],[33619,2],[33698,2],[33706,1],[33708,1],[33724,1],[33745,2],[33817,2],[33936,1],[33991,1],[34025,1],[34027,2],[34129,1],[34157,1],[34169,1],[34225,2],[34282,1],[34336,2],[34441,1],[34495,2],[34622,1],[34676,2],[34719,2],[34736,1],[34772,1],[34774,1],[34788,1],[34813,1],[34836,1],[34869,2],[34881,1],[34906,1],[34913,1],[34937,1],[34955,1],[34981,2],[34997,1],[35037,2],[35057,1],[35083,1],[35254,1],[35300,1],[35336,1],[35393,1],[35427,1],[35532,1],[35565,1],[35693,1],[35727,1],[35769,1],[35771,1],[35895,1],[35975,1],[35977,1],[36035,1],[36042,1],[36131,1],[36142,1],[36182,1],[36201,1],[36503,1],[36766,1],[36810,1],[36812,1],[36903,1],[37053,1],[37094,1],[37109,2],[37151,1],[37162,2],[37196,1],[37222,2],[37281,1],[37313,2],[37390,2],[37462,2],[37486,1],[37502,1],[37504,1],[37531,2],[37631,1],[37692,2],[37776,2],[37956,2],[37999,3],[38003,2],[38024,1],[38034,1],[38036,1],[38133,2],[38136,1],[38193,3],[38197,2],[38208,1],[38234,2],[38313,1],[38315,1],[38357,1],[38371,1],[38373,2],[38472,2],[38546,2],[38631,2],[38764,2],[38938,2],[38981,2],[38991,2],[38998,1],[39000,2],[39003,2],[39019,1],[39021,1],[39031,2],[39126,1],[39133,2],[39227,1],[39239,2],[39318,2],[39326,1],[39328,1],[39344,1],[39365,2],[39437,2],[39556,1],[39611,1],[39645,1],[39647,2],[39749,1],[39777,1],[39789,1],[39845,2],[39902,1],[39956,2],[40061,1],[40115,2],[40242,1],[40296,2],[40339,2],[40356,1],[40392,1],[40394,1],[40408,1],[40433,1],[40456,1],[40489,2],[40501,1],[40526,1],[40533,1],[40557,1],[40576,1],[40602,2],[40618,1],[40658,2],[40678,1],[40704,1],[40875,1],[40921,1],[40957,1],[41014,1],[41048,1],[41153,1],[41186,1],[41314,1],[41348,1],[41390,1],[41392,1],[41516,1],[41596,1],[41598,1],[41656,1],[41663,1],[41753,1],[41764,1],[41804,1],[41823,1],[42126,1],[42389,1],[42433,1],[42435,1],[42526,1],[42677,1],[42718,1],[42733,2],[42775,1],[42787,2],[42822,1],[42848,2],[42907,1],[42939,2]]},"822":{"position":[[684,1],[731,1],[733,1],[750,2],[753,1],[788,1],[799,1],[809,2],[812,2],[825,1],[836,1],[847,1],[849,1],[859,2],[862,2],[865,1],[886,1],[908,1],[910,1],[912,1],[914,1],[916,2],[932,1],[943,1],[954,1],[956,1],[966,2],[969,2],[972,1],[993,1],[1016,1],[1018,1],[1020,1],[1022,1],[1024,2],[1037,1],[1048,1],[1059,1],[1061,1],[1071,2],[1074,2],[1077,1],[1098,1],[1124,1],[1126,1],[1128,1],[1130,1],[1132,1],[1134,2],[1149,1],[1164,1],[1175,1],[1208,1],[1210,1],[1227,2],[1230,1],[1271,1],[1273,1],[1275,2],[1288,1],[1321,1],[1323,1],[1340,2],[1343,1],[1384,1],[1386,1],[1388,2],[1404,1],[1437,1],[1439,1],[1456,2],[1459,1],[1500,1],[1502,1],[1504,2],[1517,1],[1550,1],[1552,1],[1569,2],[1572,1],[1613,1],[1615,1],[1617,1],[1619,1],[1621,1],[1623,2],[1626,1],[1659,1],[1671,1],[1681,2],[1684,1],[1686,2],[1701,1],[1716,1],[1728,1],[1761,1],[1763,1],[1780,1],[1782,1],[1784,1],[1786,1],[1788,1],[1790,1],[1792,1],[1794,1],[2161,2],[2233,2],[2257,1],[2273,1],[2275,1],[2302,2],[2402,1],[2463,2],[2547,2],[2727,2],[2770,3],[2806,1],[2808,2],[2863,1],[2927,1],[2991,1],[3058,2],[3120,1],[3202,2],[3205,2],[3208,1],[3264,3],[3287,2],[3366,1],[3368,1],[3410,1],[3424,1],[3426,2],[3525,2],[3599,2],[3684,2],[3817,2],[3991,2],[4034,2],[4044,2],[4051,1],[4053,2],[4056,2],[4072,1],[4074,1],[4084,2],[4179,1],[4186,2],[4246,1],[4248,2],[4421,2],[4424,1],[4544,2],[4547,1],[4670,2],[4673,1],[4675,2],[4873,2],[4876,1],[4878,1],[4890,2],[4983,2],[4990,1],[4992,2],[4995,2],[5011,1],[5032,2],[5104,2],[5223,1],[5278,1],[5312,1],[5314,2],[5416,1],[5444,1],[5456,1],[5512,2],[5569,1],[5623,2],[5728,1],[5782,2],[5909,1],[5963,2],[6006,2],[6023,1],[6059,1],[6061,1],[6075,1],[6106,1],[6129,1],[6162,2],[6174,1],[6201,1],[6210,1],[6239,1],[6241,2],[6302,1],[6309,1],[6333,1],[6352,1],[6367,2],[6376,1],[6383,1],[6407,1],[6426,1],[6441,2],[6450,1],[6457,1],[6484,1],[6503,1],[6518,2],[6521,2],[6589,1],[6596,1],[6628,1],[6647,1],[6672,1],[6674,2],[6677,2],[6693,1],[6752,1],[6923,1],[6969,1],[7005,1],[7062,1],[7096,1],[7201,1],[7234,1],[7362,1],[7396,1],[7438,1],[7440,1],[7564,1],[7644,1],[7646,1],[7704,1],[7711,1],[7718,1],[7762,1],[7874,2],[7948,2],[8025,2],[8041,1],[8178,3],[8182,2],[8185,2],[8188,1],[8199,1],[8473,1],[8517,1],[8519,1],[8610,1],[8627,1],[8642,1],[8919,2],[9627,2],[9682,1],[9747,2],[9750,1],[9815,2],[9818,1],[9886,2],[9889,2],[9951,1],[10034,1],[10036,2],[10394,2],[10466,2],[10490,1],[10506,1],[10508,1],[10535,2],[10635,1],[10696,2],[10780,2],[10960,2],[11003,3],[11007,2],[11028,1],[11038,1],[11040,1],[11140,2],[11143,1],[11200,3],[11204,2],[11215,1],[11241,2],[11320,1],[11322,1],[11364,1],[11378,1],[11380,2],[11479,2],[11553,2],[11638,2],[11771,2],[11945,2],[11988,2],[11998,2],[12005,1],[12007,2],[12010,2],[12026,1],[12028,1],[12038,2],[12133,1],[12140,2],[12237,1],[12249,2],[12328,2],[12336,1],[12338,1],[12354,1],[12375,2],[12447,2],[12566,1],[12621,1],[12655,1],[12657,2],[12759,1],[12787,1],[12799,1],[12855,2],[12912,1],[12966,2],[13071,1],[13125,2],[13252,1],[13306,2],[13349,2],[13366,1],[13402,1],[13404,1],[13418,1],[13443,1],[13466,1],[13499,2],[13511,1],[13536,1],[13543,1],[13570,1],[13589,1],[13615,2],[13631,1],[13671,2],[13691,1],[13717,1],[13888,1],[13934,1],[13970,1],[14027,1],[14061,1],[14166,1],[14199,1],[14327,1],[14361,1],[14403,1],[14405,1],[14529,1],[14609,1],[14611,1],[14669,1],[14676,1],[14769,1],[14780,1],[14820,1],[14839,1],[15145,1],[15408,1],[15452,1],[15454,1],[15545,1],[15699,1],[15740,1],[15758,2],[15803,1],[15815,2],[15850,1],[15876,2],[15935,1],[15967,2]]},"824":{"position":[[740,1],[787,1],[789,1],[806,2],[809,1],[844,1],[856,1],[866,2],[869,2],[881,1],[891,2],[894,2],[907,1],[918,1],[929,1],[931,1],[941,2],[944,2],[947,1],[968,1],[990,1],[992,1],[994,1],[996,1],[998,2],[1014,1],[1025,1],[1036,1],[1038,1],[1048,2],[1051,2],[1054,1],[1075,1],[1098,1],[1100,1],[1102,1],[1104,1],[1106,2],[1119,1],[1130,1],[1141,1],[1143,1],[1153,2],[1156,2],[1159,1],[1180,1],[1206,1],[1208,1],[1210,1],[1212,1],[1214,1],[1216,2],[1231,1],[1246,1],[1258,1],[1291,1],[1293,1],[1314,1],[1316,1],[1318,2],[1330,1],[1363,1],[1365,1],[1382,2],[1385,1],[1426,1],[1428,1],[1430,2],[1443,1],[1476,1],[1478,1],[1495,2],[1498,1],[1539,1],[1541,1],[1543,2],[1559,1],[1592,1],[1594,1],[1611,2],[1614,1],[1655,1],[1657,1],[1659,2],[1672,1],[1705,1],[1707,1],[1724,2],[1727,1],[1768,1],[1770,1],[1772,1],[1774,1],[1776,1],[1778,1],[1780,1],[1782,1],[1994,2],[2066,2],[2090,1],[2106,1],[2108,1],[2135,2],[2235,1],[2296,2],[2380,2],[2560,2],[2603,3],[2639,1],[2641,2],[2688,1],[2765,2],[2827,1],[2914,2],[2917,2],[2920,1],[2976,3],[2999,2],[3078,1],[3080,1],[3122,1],[3136,1],[3138,2],[3237,2],[3311,2],[3396,2],[3529,2],[3703,2],[3746,2],[3756,2],[3763,1],[3765,2],[3768,2],[3784,1],[3786,1],[3796,2],[3891,1],[3898,2],[3958,1],[3960,2],[4138,2],[4141,1],[4143,2],[4346,2],[4349,1],[4351,1],[4363,2],[4456,2],[4463,1],[4465,2],[4468,2],[4484,1],[4505,2],[4577,2],[4696,1],[4751,1],[4785,1],[4787,2],[4889,1],[4917,1],[4929,1],[4985,2],[5042,1],[5096,2],[5201,1],[5255,2],[5382,1],[5436,2],[5479,2],[5496,1],[5532,1],[5534,1],[5548,1],[5579,1],[5602,1],[5635,2],[5647,1],[5674,1],[5683,1],[5712,1],[5714,2],[5767,1],[5774,1],[5799,1],[5818,1],[5845,2],[5848,2],[5916,1],[5923,1],[5960,1],[5979,1],[6004,1],[6006,2],[6009,2],[6025,1],[6084,1],[6255,1],[6301,1],[6337,1],[6394,1],[6428,1],[6533,1],[6566,1],[6694,1],[6728,1],[6770,1],[6772,1],[6896,1],[6976,1],[6978,1],[7036,1],[7043,1],[7050,1],[7094,1],[7211,2],[7227,1],[7369,3],[7373,2],[7376,2],[7379,1],[7390,1],[7664,1],[7708,1],[7710,1],[7801,1],[7818,1],[7833,1],[7999,2],[8502,2],[8549,1],[8627,2],[8630,2],[8692,1],[8780,1],[8782,2],[9307,2],[9379,2],[9403,1],[9419,1],[9421,1],[9448,2],[9548,1],[9609,2],[9693,2],[9873,2],[9916,3],[9920,2],[9941,1],[9951,1],[9953,1],[10051,2],[10054,1],[10111,3],[10115,2],[10126,1],[10157,2],[10236,1],[10238,1],[10280,1],[10294,1],[10296,2],[10395,2],[10469,2],[10554,2],[10687,2],[10861,2],[10904,2],[10914,2],[10921,1],[10923,2],[10926,2],[10942,1],[10944,1],[10954,2],[11049,1],[11056,2],[11151,1],[11163,2],[11242,2],[11250,1],[11252,1],[11273,1],[11294,2],[11366,2],[11485,1],[11540,1],[11574,1],[11576,2],[11678,1],[11706,1],[11718,1],[11774,2],[11831,1],[11885,2],[11990,1],[12044,2],[12171,1],[12225,2],[12268,2],[12285,1],[12321,1],[12323,1],[12337,1],[12362,1],[12385,1],[12418,2],[12430,1],[12455,1],[12462,1],[12487,1],[12506,1],[12532,2],[12548,1],[12588,2],[12608,1],[12639,1],[12810,1],[12856,1],[12892,1],[12949,1],[12983,1],[13088,1],[13121,1],[13249,1],[13283,1],[13325,1],[13327,1],[13451,1],[13531,1],[13533,1],[13591,1],[13598,1],[13689,1],[13700,1],[13740,1],[13759,1],[14068,1],[14336,1],[14380,1],[14382,1],[14473,1],[14625,1],[14671,1],[14687,2],[14730,1],[14742,2],[14777,1],[14803,2],[14862,1],[14894,2],[15134,1],[15169,1],[15181,1],[15192,1],[15203,1],[15205,1],[15215,2],[15218,2],[15221,1],[15242,1],[15268,1],[15270,2],[15273,1],[15293,1],[15307,1],[15330,2],[15352,1],[15375,1],[15377,1],[15379,1],[15381,1],[15383,1],[15385,1],[15387,2],[15402,1],[15417,1],[15429,1],[15462,1],[15464,1],[15481,2],[15484,1],[15525,1],[15527,1],[15529,1],[15531,1],[15533,1],[15535,1],[16074,2],[16166,2],[16276,1],[16332,3],[16336,1],[16349,1],[16418,1],[16871,1],[16918,1],[16920,1],[16937,2],[16940,1],[16975,1],[16986,1],[16997,1],[17008,1],[17010,1],[17020,2],[17023,2],[17026,1],[17046,1],[17067,1],[17089,2],[17104,1],[17127,1],[17129,1],[17131,1],[17133,1],[17135,1],[17137,2],[17150,1],[17161,1],[17172,1],[17174,1],[17184,2],[17187,2],[17190,1],[17211,1],[17233,1],[17235,2],[17238,1],[17258,1],[17279,1],[17302,2],[17317,1],[17340,1],[17342,1],[17344,1],[17346,1],[17348,1],[17350,2],[17366,1],[17377,1],[17388,1],[17390,1],[17400,2],[17403,2],[17406,1],[17427,1],[17450,1],[17452,2],[17455,1],[17475,1],[17496,1],[17522,2],[17537,1],[17560,1],[17562,1],[17564,1],[17566,1],[17568,1],[17570,2],[17583,1],[17594,1],[17605,1],[17607,1],[17617,2],[17620,2],[17623,1],[17644,1],[17670,1],[17672,2],[17675,1],[17695,1],[17716,1],[17739,2],[17754,1],[17777,1],[17779,1],[17781,1],[17783,1],[17785,1],[17787,2],[17800,1],[17810,2],[17813,1],[17815,2],[17830,1],[17845,1],[17857,1],[17890,1],[17892,1],[17913,1],[17915,1],[17917,2],[17929,1],[17962,1],[17964,1],[17981,2],[17984,1],[18025,1],[18027,1],[18029,2],[18042,1],[18075,1],[18077,1],[18094,2],[18097,1],[18138,1],[18140,1],[18142,2],[18158,1],[18191,1],[18193,1],[18210,2],[18213,1],[18254,1],[18256,1],[18258,2],[18271,1],[18304,1],[18306,1],[18323,2],[18326,1],[18367,1],[18369,1],[18371,1],[18373,1],[18375,1],[18377,2],[18380,1],[18413,1],[18425,1],[18435,2],[18438,1],[18440,2],[18455,1],[18470,1],[18482,1],[18515,1],[18517,1],[18534,1],[18536,1],[18538,1],[18540,1],[18542,1],[18544,1],[18546,1],[18548,1]]},"826":{"position":[[953,1],[1000,1],[1002,1],[1019,2],[1022,1],[1057,1],[1068,1],[1079,1],[1090,1],[1092,1],[1102,2],[1105,2],[1108,1],[1128,1],[1149,1],[1171,2],[1186,1],[1209,1],[1211,1],[1213,1],[1215,1],[1217,1],[1219,2],[1232,1],[1243,1],[1254,1],[1256,1],[1266,2],[1269,2],[1272,1],[1293,1],[1315,1],[1317,2],[1320,1],[1340,1],[1361,1],[1384,2],[1399,1],[1422,1],[1424,1],[1426,1],[1428,1],[1430,1],[1432,2],[1448,1],[1459,1],[1470,1],[1472,1],[1482,2],[1485,2],[1488,1],[1509,1],[1532,1],[1534,2],[1537,1],[1557,1],[1578,1],[1604,2],[1619,1],[1642,1],[1644,1],[1646,1],[1648,1],[1650,1],[1652,2],[1665,1],[1676,1],[1687,1],[1689,1],[1699,2],[1702,2],[1705,1],[1726,1],[1752,1],[1754,2],[1757,1],[1777,1],[1798,1],[1821,2],[1836,1],[1859,1],[1861,1],[1863,1],[1865,1],[1867,1],[1869,2],[1882,1],[1892,2],[1895,1],[1897,2],[1912,1],[1927,1],[1939,1],[1972,1],[1974,1],[1995,1],[1997,1],[1999,2],[2011,1],[2044,1],[2046,1],[2063,2],[2066,1],[2107,1],[2109,1],[2111,2],[2124,1],[2157,1],[2159,1],[2176,2],[2179,1],[2220,1],[2222,1],[2224,2],[2240,1],[2273,1],[2275,1],[2292,2],[2295,1],[2336,1],[2338,1],[2340,2],[2353,1],[2386,1],[2388,1],[2405,2],[2408,1],[2438,2],[2441,2],[2444,1],[2485,1],[2487,1],[2489,1],[2491,1],[2493,1],[2495,2],[2498,1],[2531,1],[2543,1],[2553,2],[2556,1],[2558,2],[2573,1],[2588,1],[2600,1],[2633,1],[2635,1],[2652,1],[2654,1],[2656,1],[2658,1],[2660,1],[2662,1],[2664,1],[2666,1],[2867,2],[2939,2],[2963,1],[2979,1],[2981,1],[3008,2],[3108,1],[3169,2],[3253,2],[3433,2],[3476,3],[3512,1],[3514,2],[3567,1],[3648,2],[3721,1],[3814,2],[3881,1],[3960,2],[3963,2],[3966,1],[4022,3],[4045,2],[4124,1],[4126,1],[4168,1],[4182,1],[4184,2],[4283,2],[4357,2],[4442,2],[4575,2],[4749,2],[4792,2],[4802,2],[4809,1],[4811,2],[4814,2],[4830,1],[4832,1],[4842,2],[4937,1],[4944,2],[5004,1],[5006,2],[5194,2],[5197,1],[5199,2],[5419,2],[5422,1],[5424,2],[5624,2],[5627,1],[5629,1],[5641,2],[5734,2],[5741,1],[5743,2],[5746,2],[5762,1],[5783,2],[5855,2],[5974,1],[6029,1],[6063,1],[6065,2],[6167,1],[6195,1],[6207,1],[6263,2],[6320,1],[6374,2],[6479,1],[6533,2],[6660,1],[6714,2],[6757,2],[6774,1],[6810,1],[6812,1],[6826,1],[6857,1],[6880,1],[6913,2],[6925,1],[6952,1],[6961,1],[6990,1],[6992,2],[7051,1],[7058,1],[7082,1],[7100,1],[7133,2],[7136,2],[7215,1],[7222,1],[7254,1],[7276,1],[7309,2],[7312,2],[7385,1],[7392,1],[7413,1],[7432,1],[7465,1],[7467,2],[7470,2],[7486,1],[7545,1],[7716,1],[7762,1],[7798,1],[7855,1],[7889,1],[7994,1],[8027,1],[8155,1],[8189,1],[8231,1],[8233,1],[8357,1],[8437,1],[8439,1],[8497,1],[8504,1],[8511,1],[8555,1],[8682,2],[8698,1],[8857,2],[8873,1],[9012,3],[9016,2],[9019,2],[9022,1],[9033,1],[9307,1],[9351,1],[9353,1],[9444,1],[9461,1],[9476,1],[9730,2],[10368,2],[10421,1],[10503,2],[10506,2],[10579,1],[10673,2],[10676,2],[10743,1],[10823,1],[10825,2],[10977,2],[11049,2],[11073,1],[11089,1],[11091,1],[11118,2],[11218,1],[11279,2],[11363,2],[11543,2],[11586,3],[11590,2],[11611,1],[11621,1],[11623,1],[11727,2],[11730,1],[11787,3],[11791,2],[11802,1],[11828,2],[11907,1],[11909,1],[11951,1],[11965,1],[11967,2],[12066,2],[12140,2],[12225,2],[12358,2],[12532,2],[12575,2],[12585,2],[12592,1],[12594,2],[12597,2],[12613,1],[12615,1],[12625,2],[12720,1],[12727,2],[12828,1],[12840,2],[12919,2],[12927,1],[12929,1],[12945,1],[12966,2],[13038,2],[13157,1],[13212,1],[13246,1],[13248,2],[13350,1],[13378,1],[13390,1],[13446,2],[13503,1],[13557,2],[13662,1],[13716,2],[13843,1],[13897,2],[13940,2],[13957,1],[13993,1],[13995,1],[14009,1],[14034,1],[14057,1],[14090,2],[14102,1],[14127,1],[14134,1],[14158,1],[14176,1],[14210,2],[14226,1],[14266,2],[14286,1],[14312,1],[14483,1],[14529,1],[14565,1],[14622,1],[14656,1],[14761,1],[14794,1],[14922,1],[14956,1],[14998,1],[15000,1],[15124,1],[15204,1],[15206,1],[15264,1],[15271,1],[15368,1],[15379,1],[15419,1],[15438,1],[15748,1],[16011,1],[16055,1],[16057,1],[16148,1],[16306,1],[16347,1],[16362,2],[16404,1],[16415,2],[16449,1],[16483,2],[16550,1],[16582,2],[16735,2],[16807,2],[16831,1],[16847,1],[16849,1],[16876,2],[16976,1],[17037,2],[17121,2],[17301,2],[17344,3],[17348,2],[17369,1],[17379,1],[17381,1],[17486,2],[17489,1],[17546,3],[17550,2],[17561,1],[17588,2],[17667,1],[17669,1],[17711,1],[17725,1],[17727,2],[17826,2],[17900,2],[17985,2],[18118,2],[18292,2],[18335,2],[18345,2],[18352,1],[18354,2],[18357,2],[18373,1],[18375,1],[18385,2],[18480,1],[18487,2],[18589,1],[18601,2],[18680,2],[18688,1],[18690,1],[18707,1],[18728,2],[18800,2],[18919,1],[18974,1],[19008,1],[19010,2],[19112,1],[19140,1],[19152,1],[19208,2],[19265,1],[19319,2],[19424,1],[19478,2],[19605,1],[19659,2],[19702,2],[19719,1],[19755,1],[19757,1],[19771,1],[19796,1],[19819,1],[19852,2],[19864,1],[19889,1],[19896,1],[19920,1],[19939,1],[19973,2],[19989,1],[20029,2],[20049,1],[20076,1],[20247,1],[20293,1],[20329,1],[20386,1],[20420,1],[20525,1],[20558,1],[20686,1],[20720,1],[20762,1],[20764,1],[20888,1],[20968,1],[20970,1],[21028,1],[21035,1],[21133,1],[21144,1],[21184,1],[21203,1],[21515,1],[21779,1],[21823,1],[21825,1],[21916,1],[22075,1],[22117,1],[22132,2],[22174,1],[22186,2],[22221,1],[22255,2],[22322,1],[22354,2],[22432,2],[22504,2],[22528,1],[22544,1],[22546,1],[22573,2],[22673,1],[22734,2],[22818,2],[22998,2],[23041,3],[23045,2],[23066,1],[23076,1],[23078,1],[23186,2],[23189,1],[23246,3],[23250,2],[23261,1],[23287,2],[23366,1],[23368,1],[23410,1],[23424,1],[23426,2],[23525,2],[23599,2],[23684,2],[23817,2],[23991,2],[24034,2],[24044,2],[24051,1],[24053,2],[24056,2],[24072,1],[24074,1],[24084,2],[24179,1],[24186,2],[24291,1],[24303,2],[24382,2],[24390,1],[24392,1],[24408,1],[24429,2],[24501,2],[24620,1],[24675,1],[24709,1],[24711,2],[24813,1],[24841,1],[24853,1],[24909,2],[24966,1],[25020,2],[25125,1],[25179,2],[25306,1],[25360,2],[25403,2],[25420,1],[25456,1],[25458,1],[25472,1],[25497,1],[25520,1],[25553,2],[25565,1],[25590,1],[25597,1],[25621,1],[25643,1],[25677,2],[25693,1],[25733,2],[25753,1],[25779,1],[25950,1],[25996,1],[26032,1],[26089,1],[26123,1],[26228,1],[26261,1],[26389,1],[26423,1],[26465,1],[26467,1],[26591,1],[26671,1],[26673,1],[26731,1],[26738,1],[26839,1],[26850,1],[26890,1],[26909,1],[27223,1],[27486,1],[27530,1],[27532,1],[27623,1],[27785,1],[27826,1],[27841,2],[27883,1],[27898,2],[27936,1],[27970,2],[28037,1],[28069,2],[28224,2],[28296,2],[28320,1],[28336,1],[28338,1],[28365,2],[28465,1],[28526,2],[28610,2],[28790,2],[28833,3],[28837,2],[28858,1],[28868,1],[28870,1],[28975,2],[28978,1],[29035,3],[29039,2],[29050,1],[29077,2],[29156,1],[29158,1],[29200,1],[29214,1],[29216,2],[29315,2],[29389,2],[29474,2],[29607,2],[29781,2],[29824,2],[29834,2],[29841,1],[29843,2],[29846,2],[29862,1],[29864,1],[29874,2],[29969,1],[29976,2],[30078,1],[30090,2],[30169,2],[30177,1],[30179,1],[30196,1],[30217,2],[30289,2],[30408,1],[30463,1],[30497,1],[30499,2],[30601,1],[30629,1],[30641,1],[30697,2],[30754,1],[30808,2],[30913,1],[30967,2],[31094,1],[31148,2],[31191,2],[31208,1],[31244,1],[31246,1],[31260,1],[31285,1],[31308,1],[31341,2],[31353,1],[31378,1],[31385,1],[31409,1],[31428,1],[31462,2],[31478,1],[31518,2],[31538,1],[31565,1],[31736,1],[31782,1],[31818,1],[31875,1],[31909,1],[32014,1],[32047,1],[32175,1],[32209,1],[32251,1],[32253,1],[32377,1],[32457,1],[32459,1],[32517,1],[32524,1],[32622,1],[32633,1],[32673,1],[32692,1],[33004,1],[33268,1],[33312,1],[33314,1],[33405,1],[33564,1],[33606,1],[33621,2],[33663,1],[33675,2],[33710,1],[33744,2],[33811,1],[33843,2],[33921,2],[33993,2],[34017,1],[34033,1],[34035,1],[34062,2],[34162,1],[34223,2],[34307,2],[34487,2],[34530,3],[34534,2],[34555,1],[34565,1],[34567,1],[34672,2],[34675,1],[34732,3],[34736,2],[34747,1],[34774,2],[34853,1],[34855,1],[34897,1],[34911,1],[34913,2],[35012,2],[35086,2],[35171,2],[35304,2],[35478,2],[35521,2],[35531,2],[35538,1],[35540,2],[35543,2],[35559,1],[35561,1],[35571,2],[35666,1],[35673,2],[35775,1],[35787,2],[35866,2],[35874,1],[35876,1],[35893,1],[35914,2],[35986,2],[36105,1],[36160,1],[36194,1],[36196,2],[36298,1],[36326,1],[36338,1],[36394,2],[36451,1],[36505,2],[36610,1],[36664,2],[36791,1],[36845,2],[36888,2],[36905,1],[36941,1],[36943,1],[36957,1],[36982,1],[37005,1],[37038,2],[37050,1],[37075,1],[37082,1],[37106,1],[37125,1],[37159,2],[37175,1],[37215,2],[37235,1],[37262,1],[37433,1],[37479,1],[37515,1],[37572,1],[37606,1],[37711,1],[37744,1],[37872,1],[37906,1],[37948,1],[37950,1],[38074,1],[38154,1],[38156,1],[38214,1],[38221,1],[38319,1],[38330,1],[38370,1],[38389,1],[38701,1],[38965,1],[39009,1],[39011,1],[39102,1],[39261,1],[39303,1],[39318,2],[39360,1],[39372,2],[39407,1],[39441,2],[39508,1],[39540,2]]},"832":{"position":[[410,1],[579,1],[590,1]]},"842":{"position":[[1158,1],[1205,1],[1207,1],[1224,2],[1227,1],[1263,1],[1281,1],[1291,2],[1294,2],[1315,1],[1325,2],[1328,2],[1341,1],[1351,2],[1354,2],[1366,1],[1376,2],[1379,1],[1381,2],[1396,1],[1411,1],[1429,1],[1462,1],[1464,1],[1481,1],[1483,1],[1485,2],[1506,1],[1539,1],[1541,1],[1558,1],[1560,1],[1562,2],[1575,1],[1608,1],[1610,1],[1627,1],[1629,1],[1631,2],[1643,1],[1676,1],[1678,1],[1695,1],[1697,1],[1699,1],[1701,1],[1703,1],[1705,1],[1707,1],[1709,1]]},"844":{"position":[[730,1],[777,1],[779,1],[796,2],[799,1],[835,1],[853,1],[863,2],[866,2],[887,1],[897,2],[900,2],[913,1],[923,2],[926,2],[938,1],[948,2],[951,1],[953,2],[968,1],[983,1],[1001,1],[1034,1],[1036,1],[1053,1],[1055,1],[1057,2],[1078,1],[1111,1],[1113,1],[1130,1],[1132,1],[1134,2],[1147,1],[1180,1],[1182,1],[1199,1],[1201,1],[1203,2],[1215,1],[1248,1],[1250,1],[1267,1],[1269,1],[1271,1],[1273,1],[1275,1],[1277,1],[1279,1],[1281,1],[1508,1],[1544,1],[1556,1],[1566,2],[1569,1],[1571,2],[1586,1],[1601,1],[1613,1],[1646,1],[1648,1],[1665,1],[1667,1],[1669,1],[1671,1],[1673,1],[1675,1],[2120,2],[2192,2],[2216,1],[2232,1],[2234,1],[2261,2],[2361,1],[2422,2],[2506,2],[2686,2],[2729,3],[2765,1],[2767,2],[2820,1],[2899,2],[2902,2],[2905,1],[2961,3],[2984,2],[3063,1],[3065,1],[3107,1],[3121,1],[3123,2],[3222,2],[3296,2],[3381,2],[3514,2],[3688,2],[3731,2],[3741,2],[3748,1],[3750,2],[3753,2],[3769,1],[3771,1],[3781,2],[3876,1],[3883,2],[3943,1],[3945,2],[4131,2],[4134,1],[4136,1],[4148,2],[4241,2],[4248,1],[4250,2],[4253,2],[4269,1],[4290,2],[4362,2],[4481,1],[4536,1],[4570,1],[4572,2],[4674,1],[4702,1],[4714,1],[4770,2],[4827,1],[4881,2],[4986,1],[5040,2],[5167,1],[5221,2],[5264,2],[5281,1],[5317,1],[5319,1],[5333,1],[5364,1],[5387,1],[5420,2],[5432,1],[5459,1],[5468,1],[5497,1],[5499,2],[5558,1],[5565,1],[5588,1],[5613,1],[5638,1],[5640,2],[5643,2],[5659,1],[5718,1],[5889,1],[5935,1],[5971,1],[6028,1],[6062,1],[6167,1],[6200,1],[6328,1],[6362,1],[6404,1],[6406,1],[6530,1],[6610,1],[6612,1],[6670,1],[6677,1],[6684,1],[6728,1],[6853,3],[6857,2],[6860,2],[6863,1],[6874,1],[7148,1],[7192,1],[7194,1],[7285,1],[7302,1],[7317,1],[7399,2],[7771,2],[7824,1],[7904,1],[7906,2],[8097,2],[8169,2],[8193,1],[8209,1],[8211,1],[8238,2],[8338,1],[8399,2],[8483,2],[8663,2],[8706,3],[8710,2],[8731,1],[8741,1],[8743,1],[8845,2],[8848,1],[8905,3],[8909,2],[8920,1],[8946,2],[9025,1],[9027,1],[9069,1],[9083,1],[9085,2],[9184,2],[9258,2],[9343,2],[9476,2],[9650,2],[9693,2],[9703,2],[9710,1],[9712,2],[9715,2],[9731,1],[9733,1],[9743,2],[9838,1],[9845,2],[9944,1],[9956,2],[10035,2],[10043,1],[10045,1],[10061,1],[10082,2],[10154,2],[10273,1],[10328,1],[10362,1],[10364,2],[10466,1],[10494,1],[10506,1],[10562,2],[10619,1],[10673,2],[10778,1],[10832,2],[10959,1],[11013,2],[11056,2],[11073,1],[11109,1],[11111,1],[11125,1],[11150,1],[11173,1],[11206,2],[11218,1],[11243,1],[11250,1],[11273,1],[11298,1],[11324,2],[11340,1],[11380,2],[11400,1],[11426,1],[11597,1],[11643,1],[11679,1],[11736,1],[11770,1],[11875,1],[11908,1],[12036,1],[12070,1],[12112,1],[12114,1],[12238,1],[12318,1],[12320,1],[12378,1],[12385,1],[12480,1],[12491,1],[12531,1],[12550,1],[12858,1],[13121,1],[13165,1],[13167,1],[13258,1],[13414,1],[13455,1],[13469,2],[13510,1],[13528,2],[13569,1],[13595,2],[13654,1],[13686,2],[13831,2],[13903,2],[13927,1],[13943,1],[13945,1],[13972,2],[14072,1],[14133,2],[14217,2],[14397,2],[14440,3],[14476,1],[14478,2],[14531,1],[14610,2],[14613,2],[14616,1],[14672,3],[14695,2],[14774,1],[14776,1],[14818,1],[14832,1],[14834,2],[14933,2],[15007,2],[15092,2],[15225,2],[15399,2],[15442,2],[15452,2],[15459,1],[15461,2],[15464,2],[15480,1],[15482,1],[15492,2],[15587,1],[15594,2],[15654,1],[15656,2],[15842,2],[15845,1],[15847,1],[15859,2],[15952,2],[15959,1],[15961,2],[15964,2],[15980,1],[16001,2],[16073,2],[16192,1],[16247,1],[16281,1],[16283,2],[16385,1],[16413,1],[16425,1],[16481,2],[16538,1],[16592,2],[16697,1],[16751,2],[16878,1],[16932,2],[16975,2],[16992,1],[17028,1],[17030,1],[17044,1],[17075,1],[17098,1],[17131,2],[17143,1],[17170,1],[17179,1],[17208,1],[17210,2],[17269,1],[17276,1],[17305,1],[17324,1],[17349,1],[17351,2],[17354,2],[17370,1],[17429,1],[17600,1],[17646,1],[17682,1],[17739,1],[17773,1],[17878,1],[17911,1],[18039,1],[18073,1],[18115,1],[18117,1],[18241,1],[18321,1],[18323,1],[18381,1],[18388,1],[18395,1],[18439,1],[18564,3],[18568,2],[18571,2],[18574,1],[18585,1],[18859,1],[18903,1],[18905,1],[18996,1],[19013,1],[19028,1],[19110,2],[19482,2],[19535,1],[19615,1],[19617,2],[19765,2],[19837,2],[19861,1],[19877,1],[19879,1],[19906,2],[20006,1],[20067,2],[20151,2],[20331,2],[20374,3],[20378,2],[20399,1],[20409,1],[20411,1],[20513,2],[20516,1],[20573,3],[20577,2],[20588,1],[20614,2],[20693,1],[20695,1],[20737,1],[20751,1],[20753,2],[20852,2],[20926,2],[21011,2],[21144,2],[21318,2],[21361,2],[21371,2],[21378,1],[21380,2],[21383,2],[21399,1],[21401,1],[21411,2],[21506,1],[21513,2],[21612,1],[21624,2],[21703,2],[21711,1],[21713,1],[21729,1],[21750,2],[21822,2],[21941,1],[21996,1],[22030,1],[22032,2],[22134,1],[22162,1],[22174,1],[22230,2],[22287,1],[22341,2],[22446,1],[22500,2],[22627,1],[22681,2],[22724,2],[22741,1],[22777,1],[22779,1],[22793,1],[22818,1],[22841,1],[22874,2],[22886,1],[22911,1],[22918,1],[22947,1],[22966,1],[22992,2],[23008,1],[23048,2],[23068,1],[23094,1],[23265,1],[23311,1],[23347,1],[23404,1],[23438,1],[23543,1],[23576,1],[23704,1],[23738,1],[23780,1],[23782,1],[23906,1],[23986,1],[23988,1],[24046,1],[24053,1],[24148,1],[24159,1],[24199,1],[24218,1],[24526,1],[24789,1],[24833,1],[24835,1],[24926,1],[25082,1],[25123,1],[25143,2],[25190,1],[25202,2],[25237,1],[25263,2],[25322,1],[25354,2],[25508,2],[25580,2],[25604,1],[25620,1],[25622,1],[25649,2],[25749,1],[25810,2],[25894,2],[26074,2],[26117,3],[26121,2],[26142,1],[26152,1],[26154,1],[26262,2],[26265,1],[26322,3],[26326,2],[26337,1],[26364,2],[26443,1],[26445,1],[26487,1],[26501,1],[26503,2],[26602,2],[26676,2],[26761,2],[26894,2],[27068,2],[27111,2],[27121,2],[27128,1],[27130,2],[27133,2],[27149,1],[27151,1],[27161,2],[27256,1],[27263,2],[27368,1],[27380,2],[27459,2],[27467,1],[27469,1],[27486,1],[27507,2],[27579,2],[27698,1],[27753,1],[27787,1],[27789,2],[27891,1],[27919,1],[27931,1],[27987,2],[28044,1],[28098,2],[28203,1],[28257,2],[28384,1],[28438,2],[28481,2],[28498,1],[28534,1],[28536,1],[28550,1],[28575,1],[28598,1],[28631,2],[28643,1],[28668,1],[28675,1],[28704,1],[28729,1],[28755,2],[28771,1],[28811,2],[28831,1],[28858,1],[29029,1],[29075,1],[29111,1],[29168,1],[29202,1],[29307,1],[29340,1],[29468,1],[29502,1],[29544,1],[29546,1],[29670,1],[29750,1],[29752,1],[29810,1],[29817,1],[29918,1],[29929,1],[29969,1],[29988,1],[30303,1],[30567,1],[30611,1],[30613,1],[30704,1],[30866,1],[30908,1],[30928,2],[30975,1],[30993,2],[31034,1],[31060,2],[31119,1],[31151,2],[31215,1],[31217,1],[31219,2],[31352,2],[31355,1],[31357,2],[31476,2],[31479,1],[31481,2],[31602,2],[31605,1],[31669,2],[31741,2],[31765,1],[31781,1],[31783,1],[31810,2],[31910,1],[31971,2],[32055,2],[32235,2],[32278,3],[32314,1],[32316,2],[32371,1],[32452,2],[32500,1],[32574,2],[32623,1],[32698,2],[32701,2],[32704,1],[32760,3],[32783,2],[32862,1],[32864,1],[32906,1],[32920,1],[32922,2],[33021,2],[33095,2],[33180,2],[33313,2],[33487,2],[33530,2],[33540,2],[33547,1],[33549,2],[33552,2],[33568,1],[33570,1],[33580,2],[33675,1],[33682,2],[33742,1],[33744,2],[33934,2],[33937,1],[33939,2],[34115,2],[34118,1],[34120,2],[34298,2],[34301,1],[34303,1],[34315,2],[34408,2],[34415,1],[34417,2],[34420,2],[34436,1],[34457,2],[34529,2],[34648,1],[34703,1],[34737,1],[34739,2],[34841,1],[34869,1],[34881,1],[34937,2],[34994,1],[35048,2],[35153,1],[35207,2],[35334,1],[35388,2],[35431,2],[35448,1],[35484,1],[35486,1],[35500,1],[35531,1],[35554,1],[35587,2],[35599,1],[35626,1],[35635,1],[35664,1],[35666,2],[35727,1],[35734,1],[35757,1],[35784,1],[35809,2],[35812,2],[35866,1],[35873,1],[35898,1],[35916,1],[35941,2],[35944,2],[35999,1],[36006,1],[36031,1],[36050,1],[36075,1],[36077,2],[36080,2],[36096,1],[36155,1],[36326,1],[36372,1],[36408,1],[36465,1],[36499,1],[36604,1],[36637,1],[36765,1],[36799,1],[36841,1],[36843,1],[36967,1],[37047,1],[37049,1],[37107,1],[37114,1],[37121,1],[37165,1],[37294,2],[37310,1],[37425,2],[37441,1],[37558,3],[37562,2],[37565,2],[37568,1],[37579,1],[37853,1],[37897,1],[37899,1],[37990,1],[38007,1],[38022,1],[38253,2],[38868,2],[38923,1],[39005,2],[39008,2],[39056,1],[39131,2],[39134,2],[39183,1],[39259,1],[39261,2],[39469,2],[39541,2],[39565,1],[39581,1],[39583,1],[39610,2],[39710,1],[39771,2],[39855,2],[40035,2],[40078,3],[40082,2],[40103,1],[40113,1],[40115,1],[40217,2],[40220,1],[40277,3],[40281,2],[40292,1],[40318,2],[40397,1],[40399,1],[40441,1],[40455,1],[40457,2],[40556,2],[40630,2],[40715,2],[40848,2],[41022,2],[41065,2],[41075,2],[41082,1],[41084,2],[41087,2],[41103,1],[41105,1],[41115,2],[41210,1],[41217,2],[41316,1],[41328,2],[41407,2],[41415,1],[41417,1],[41433,1],[41454,2],[41526,2],[41645,1],[41700,1],[41734,1],[41736,2],[41838,1],[41866,1],[41878,1],[41934,2],[41991,1],[42045,2],[42150,1],[42204,2],[42331,1],[42385,2],[42428,2],[42445,1],[42481,1],[42483,1],[42497,1],[42522,1],[42545,1],[42578,2],[42590,1],[42615,1],[42622,1],[42645,1],[42670,1],[42696,2],[42712,1],[42752,2],[42772,1],[42798,1],[42969,1],[43015,1],[43051,1],[43108,1],[43142,1],[43247,1],[43280,1],[43408,1],[43442,1],[43484,1],[43486,1],[43610,1],[43690,1],[43692,1],[43750,1],[43757,1],[43852,1],[43863,1],[43903,1],[43922,1],[44230,1],[44493,1],[44537,1],[44539,1],[44630,1],[44786,1],[44827,1],[44841,2],[44882,1],[44900,2],[44941,1],[44967,2],[45026,1],[45058,2]]},"846":{"position":[[181,2],[253,2],[277,1],[293,1],[295,1],[322,2],[422,1],[483,2],[567,2],[747,2],[790,3],[794,2],[815,1],[825,1],[827,1],[923,2],[926,1],[983,3],[987,2],[998,1],[1025,2],[1104,1],[1106,1],[1148,1],[1162,1],[1164,2],[1263,2],[1337,2],[1422,2],[1555,2],[1729,2],[1772,2],[1782,2],[1789,1],[1791,2],[1794,2],[1810,1],[1812,1],[1822,2],[1917,1],[1924,2],[2017,1],[2029,2],[2108,2],[2116,1],[2118,1],[2135,1],[2156,2],[2228,2],[2347,1],[2402,1],[2436,1],[2438,2],[2540,1],[2568,1],[2580,1],[2636,2],[2693,1],[2747,2],[2852,1],[2906,2],[3033,1],[3087,2],[3130,2],[3147,1],[3183,1],[3185,1],[3199,1],[3224,1],[3247,1],[3280,2],[3292,1],[3317,1],[3324,1],[3347,1],[3366,1],[3392,2],[3408,1],[3448,2],[3468,1],[3495,1],[3666,1],[3712,1],[3748,1],[3805,1],[3839,1],[3944,1],[3977,1],[4105,1],[4139,1],[4181,1],[4183,1],[4307,1],[4387,1],[4389,1],[4447,1],[4454,1],[4543,1],[4554,1],[4594,1],[4613,1],[4916,1],[5180,1],[5224,1],[5226,1],[5317,1],[5467,1],[5509,1],[5523,2],[5564,1],[5576,2],[5611,1],[5637,2],[5696,1],[5728,2],[6347,1],[6561,1],[6608,1],[6610,1],[6627,2],[6630,1],[6666,1],[6684,1],[6694,2],[6697,2],[6718,1],[6729,1],[6740,1],[6742,1],[6752,2],[6755,2],[6758,1],[6779,1],[6808,1],[6810,1],[6812,1],[6814,1],[6816,2],[6829,1],[6840,1],[6851,1],[6853,1],[6863,2],[6866,2],[6869,1],[6890,1],[6921,1],[6923,2],[6926,1],[6947,1],[6976,1],[6978,1],[6980,1],[6982,1],[6984,2],[6996,1],[7006,2],[7009,1],[7011,2],[7026,1],[7041,1],[7059,1],[7092,1],[7094,1],[7111,1],[7113,1],[7115,2],[7136,1],[7169,1],[7171,1],[7188,1],[7190,1],[7192,2],[7205,1],[7238,1],[7240,1],[7257,1],[7259,1],[7261,2],[7273,1],[7306,1],[7308,1],[7325,1],[7327,1],[7329,1],[7331,1],[7333,1],[7335,1],[7337,1],[7339,1],[7463,2],[7535,2],[7559,1],[7575,1],[7577,1],[7604,2],[7704,1],[7765,2],[7849,2],[8029,2],[8072,3],[8076,2],[8097,1],[8107,1],[8109,1],[8205,2],[8208,1],[8265,3],[8269,2],[8280,1],[8306,2],[8385,1],[8387,1],[8429,1],[8443,1],[8445,2],[8544,2],[8618,2],[8703,2],[8836,2],[9010,2],[9053,2],[9063,2],[9070,1],[9072,2],[9075,2],[9091,1],[9093,1],[9103,2],[9198,1],[9205,2],[9298,1],[9310,2],[9389,2],[9397,1],[9399,1],[9415,1],[9436,2],[9508,2],[9627,1],[9682,1],[9716,1],[9718,2],[9820,1],[9848,1],[9860,1],[9916,2],[9973,1],[10027,2],[10132,1],[10186,2],[10313,1],[10367,2],[10410,2],[10427,1],[10463,1],[10465,1],[10479,1],[10504,1],[10527,1],[10560,2],[10572,1],[10597,1],[10604,1],[10627,1],[10646,1],[10672,2],[10688,1],[10728,2],[10748,1],[10774,1],[10945,1],[10991,1],[11027,1],[11084,1],[11118,1],[11223,1],[11256,1],[11384,1],[11418,1],[11460,1],[11462,1],[11586,1],[11666,1],[11668,1],[11726,1],[11733,1],[11822,1],[11833,1],[11873,1],[11892,1],[12194,1],[12457,1],[12501,1],[12503,1],[12594,1],[12744,1],[12785,1],[12799,2],[12840,1],[12852,2],[12887,1],[12913,2],[12972,1],[13004,2]]},"848":{"position":[[1917,1],[1951,1],[1973,1],[1983,2],[1986,2],[1999,1],[2009,2],[2012,2],[2025,1],[2035,2],[2038,1],[2040,2],[2055,1],[2070,1],[2092,1],[2125,1],[2127,1],[2149,1],[2151,1],[2153,2],[2166,1],[2199,1],[2201,1],[2218,2],[2221,1],[2271,2],[2274,1],[2326,2],[2329,1],[2373,2],[2376,1],[2419,1],[2421,1],[2423,2],[2436,1],[2469,1],[2471,1],[2488,2],[2491,1],[2541,2],[2544,1],[2596,2],[2599,1],[2643,2],[2646,1],[2689,1],[2691,1],[2693,1],[2695,1],[2697,1],[2699,1],[3354,1],[3388,1],[3410,1],[3420,2],[3423,2],[3436,1],[3446,2],[3449,2],[3462,1],[3473,1],[3484,1],[3486,1],[3496,2],[3499,2],[3502,1],[3523,1],[3546,1],[3548,1],[3550,1],[3552,1],[3554,1],[3556,2],[3571,1],[3586,1],[3608,1],[3641,1],[3643,1],[3665,1],[3667,1],[3669,2],[3682,1],[3715,1],[3717,1],[3734,2],[3737,1],[3787,2],[3790,1],[3842,2],[3845,1],[3889,2],[3892,1],[3935,1],[3937,1],[3939,2],[3952,1],[3985,1],[3987,1],[4004,2],[4007,1],[4057,2],[4060,1],[4112,2],[4115,1],[4159,2],[4162,1],[4205,1],[4207,1],[4209,1],[4211,1],[4213,1],[4215,1],[4971,1],[5018,1],[5020,1],[5037,2],[5040,1],[5076,1],[5094,1],[5104,2],[5107,2],[5128,1],[5139,1],[5150,1],[5152,1],[5162,2],[5165,2],[5168,1],[5189,1],[5218,1],[5220,1],[5222,1],[5224,1],[5226,2],[5239,1],[5250,1],[5261,1],[5263,1],[5273,2],[5276,2],[5279,1],[5300,1],[5331,1],[5333,2],[5336,1],[5357,1],[5386,1],[5388,1],[5390,1],[5392,1],[5394,2],[5406,1],[5416,2],[5419,1],[5421,2],[5436,1],[5451,1],[5469,1],[5502,1],[5504,1],[5521,1],[5523,1],[5525,2],[5546,1],[5579,1],[5581,1],[5598,1],[5600,1],[5602,2],[5615,1],[5648,1],[5650,1],[5667,1],[5669,1],[5671,2],[5683,1],[5716,1],[5718,1],[5735,1],[5737,1],[5739,1],[5741,1],[5743,1],[5745,2],[5748,1],[5782,1],[5804,1],[5814,2],[5817,2],[5830,1],[5840,2],[5843,2],[5856,1],[5867,1],[5878,1],[5880,1],[5890,2],[5893,2],[5896,1],[5917,1],[5940,1],[5942,1],[5944,1],[5946,1],[5948,1],[5950,2],[5965,1],[5980,1],[6002,1],[6035,1],[6037,1],[6059,1],[6061,1],[6063,2],[6076,1],[6109,1],[6111,1],[6128,2],[6131,1],[6181,2],[6184,1],[6236,2],[6239,1],[6283,2],[6286,1],[6329,1],[6331,1],[6333,2],[6346,1],[6379,1],[6381,1],[6398,2],[6401,1],[6451,2],[6454,1],[6506,2],[6509,1],[6553,2],[6556,1],[6599,1],[6601,1],[6603,1],[6605,1],[6607,1],[6609,1],[6611,1],[6613,1],[6949,2],[7021,2],[7045,1],[7061,1],[7063,1],[7090,2],[7190,1],[7251,2],[7335,2],[7515,2],[7558,3],[7594,1],[7596,1],[7686,1],[7787,1],[7893,2],[7896,2],[7899,1],[7955,3],[7978,2],[8057,1],[8059,1],[8101,1],[8115,1],[8117,2],[8216,2],[8290,2],[8375,2],[8508,2],[8682,2],[8725,2],[8735,2],[8742,1],[8744,2],[8747,2],[8763,1],[8765,1],[8775,2],[8870,1],[8877,2],[8937,1],[9083,2],[9086,1],[9243,2],[9246,1],[9408,2],[9411,1],[9413,1],[9425,2],[9518,2],[9525,1],[9527,2],[9530,2],[9546,1],[9567,2],[9639,2],[9758,1],[9813,1],[9847,1],[9849,2],[9951,1],[9979,1],[9991,1],[10047,2],[10104,1],[10158,2],[10263,1],[10317,2],[10444,1],[10498,2],[10541,2],[10558,1],[10594,1],[10596,1],[10610,1],[10641,1],[10664,1],[10697,2],[10709,1],[10736,1],[10745,1],[10774,1],[10782,1],[10789,1],[10824,1],[10853,1],[10873,2],[10882,1],[10889,1],[10924,1],[10953,1],[10984,2],[10993,1],[11000,1],[11035,1],[11064,1],[11100,1],[11102,2],[11105,2],[11121,1],[11180,1],[11351,1],[11397,1],[11433,1],[11490,1],[11524,1],[11629,1],[11662,1],[11790,1],[11824,1],[11866,1],[11868,1],[11992,1],[12072,1],[12074,1],[12132,1],[12139,1],[12146,1],[12274,2],[12385,2],[12501,3],[12505,2],[12508,2],[12511,1],[12522,1],[12796,1],[12840,1],[12842,1],[12933,1],[12950,1],[12965,1],[13263,2],[13945,1],[14036,2],[14039,1],[14141,2],[14144,1],[14251,1],[14253,2],[14565,2],[14637,2],[14661,1],[14677,1],[14679,1],[14706,2],[14806,1],[14867,2],[14951,2],[15131,2],[15174,3],[15210,1],[15212,2],[15326,1],[15413,2],[15416,2],[15419,1],[15475,3],[15498,2],[15577,1],[15579,1],[15621,1],[15635,1],[15637,2],[15736,2],[15810,2],[15895,2],[16028,2],[16202,2],[16245,2],[16255,2],[16262,1],[16264,2],[16267,2],[16283,1],[16285,1],[16295,2],[16390,1],[16397,2],[16457,1],[16459,2],[16714,2],[16717,1],[16719,1],[16731,2],[16824,2],[16831,1],[16833,2],[16836,2],[16852,1],[16873,2],[16945,2],[17064,1],[17119,1],[17153,1],[17155,2],[17257,1],[17285,1],[17297,1],[17353,2],[17410,1],[17464,2],[17569,1],[17623,2],[17750,1],[17804,2],[17847,2],[17864,1],[17900,1],[17902,1],[17916,1],[17947,1],[17970,1],[18003,2],[18015,1],[18042,1],[18051,1],[18080,1],[18082,2],[18202,1],[18209,1],[18251,1],[18270,1],[18290,1],[18292,2],[18295,2],[18311,1],[18370,1],[18541,1],[18587,1],[18623,1],[18680,1],[18714,1],[18819,1],[18852,1],[18980,1],[19014,1],[19056,1],[19058,1],[19182,1],[19262,1],[19264,1],[19322,1],[19329,1],[19336,1],[19380,1],[19574,3],[19578,2],[19581,2],[19584,1],[19595,1],[19869,1],[19913,1],[19915,1],[20006,1],[20023,1],[20038,1],[20128,2],[20508,2],[20622,1],[20710,1],[20712,2],[21008,2],[21080,2],[21104,1],[21120,1],[21122,1],[21149,2],[21249,1],[21310,2],[21394,2],[21574,2],[21617,3],[21653,1],[21655,2],[21762,1],[21830,1],[21900,2],[21903,2],[21906,1],[21962,3],[21985,2],[22064,1],[22066,1],[22108,1],[22122,1],[22124,2],[22223,2],[22297,2],[22382,2],[22515,2],[22689,2],[22732,2],[22742,2],[22749,1],[22751,2],[22754,2],[22770,1],[22772,1],[22782,2],[22877,1],[22884,2],[22944,1],[22946,2],[23175,2],[23178,1],[23304,2],[23307,1],[23309,1],[23321,2],[23414,2],[23421,1],[23423,2],[23426,2],[23442,1],[23463,2],[23535,2],[23654,1],[23709,1],[23743,1],[23745,2],[23847,1],[23875,1],[23887,1],[23943,2],[24000,1],[24054,2],[24159,1],[24213,2],[24340,1],[24394,2],[24437,2],[24454,1],[24490,1],[24492,1],[24506,1],[24537,1],[24560,1],[24593,2],[24605,1],[24632,1],[24641,1],[24670,1],[24672,2],[24785,1],[24792,1],[24815,1],[24834,1],[24854,2],[24863,1],[24870,1],[24895,1],[24914,1],[24934,1],[24936,2],[24939,2],[24955,1],[25014,1],[25185,1],[25231,1],[25267,1],[25324,1],[25358,1],[25463,1],[25496,1],[25624,1],[25658,1],[25700,1],[25702,1],[25826,1],[25906,1],[25908,1],[25966,1],[25973,1],[25980,1],[26024,1],[26192,2],[26272,3],[26276,2],[26279,2],[26282,1],[26293,1],[26567,1],[26611,1],[26613,1],[26704,1],[26721,1],[26736,1],[26876,2],[27353,2],[27460,1],[27529,2],[27532,1],[27603,1],[27605,2],[27842,2],[27914,2],[27938,1],[27954,1],[27956,1],[27983,2],[28083,1],[28144,2],[28228,2],[28408,2],[28451,3],[28487,1],[28489,1],[28568,1],[28649,2],[28652,2],[28655,1],[28711,3],[28734,2],[28813,1],[28815,1],[28857,1],[28871,1],[28873,2],[28972,2],[29046,2],[29131,2],[29264,2],[29438,2],[29481,2],[29491,2],[29498,1],[29500,2],[29503,2],[29519,1],[29521,1],[29531,2],[29626,1],[29633,2],[29693,1],[29828,2],[29831,1],[29968,2],[29971,1],[29973,1],[29985,2],[30078,2],[30085,1],[30087,2],[30090,2],[30106,1],[30127,2],[30199,2],[30318,1],[30373,1],[30407,1],[30409,2],[30511,1],[30539,1],[30551,1],[30607,2],[30664,1],[30718,2],[30823,1],[30877,2],[31004,1],[31058,2],[31101,2],[31118,1],[31154,1],[31156,1],[31170,1],[31201,1],[31224,1],[31257,2],[31269,1],[31296,1],[31305,1],[31334,1],[31342,1],[31349,1],[31372,1],[31391,1],[31422,2],[31431,1],[31438,1],[31463,1],[31482,1],[31513,1],[31515,2],[31518,2],[31534,1],[31593,1],[31764,1],[31810,1],[31846,1],[31903,1],[31937,1],[32042,1],[32075,1],[32203,1],[32237,1],[32279,1],[32281,1],[32405,1],[32485,1],[32487,1],[32545,1],[32552,1],[32559,1],[32676,2],[32767,3],[32771,2],[32774,2],[32777,1],[32788,1],[33062,1],[33106,1],[33108,1],[33199,1],[33216,1],[33231,1],[33393,2],[33892,1],[33972,2],[33975,1],[34057,1],[34059,2],[34326,2],[34398,2],[34422,1],[34438,1],[34440,1],[34467,2],[34567,1],[34628,2],[34712,2],[34892,2],[34935,3],[34971,1],[34973,1],[35076,2],[35079,2],[35082,1],[35138,3],[35161,2],[35240,1],[35242,1],[35284,1],[35298,1],[35300,2],[35399,2],[35473,2],[35558,2],[35691,2],[35865,2],[35908,2],[35918,2],[35925,1],[35927,2],[35930,2],[35946,1],[35948,1],[35958,2],[36053,1],[36060,2],[36120,1],[36279,2],[36282,1],[36284,1],[36296,2],[36389,2],[36396,1],[36398,2],[36401,2],[36417,1],[36438,2],[36510,2],[36629,1],[36684,1],[36718,1],[36720,2],[36822,1],[36850,1],[36862,1],[36918,2],[36975,1],[37029,2],[37134,1],[37188,2],[37315,1],[37369,2],[37412,2],[37429,1],[37465,1],[37467,1],[37481,1],[37512,1],[37535,1],[37568,2],[37580,1],[37607,1],[37616,1],[37645,1],[37653,1],[37660,1],[37702,1],[37721,1],[37757,1],[37759,2],[37762,2],[37778,1],[37837,1],[38008,1],[38054,1],[38090,1],[38147,1],[38181,1],[38286,1],[38319,1],[38447,1],[38481,1],[38523,1],[38525,1],[38649,1],[38729,1],[38731,1],[38789,1],[38796,1],[38803,1],[38944,3],[38948,2],[38951,2],[38954,1],[38965,1],[39239,1],[39283,1],[39285,1],[39376,1],[39393,1],[39408,1],[39514,2],[39910,1],[40014,1],[40016,2],[40213,2],[40285,2],[40309,1],[40325,1],[40327,1],[40354,2],[40454,1],[40515,2],[40599,2],[40779,2],[40822,3],[40858,1],[40860,1],[40946,2],[40949,2],[40952,1],[41008,3],[41031,2],[41110,1],[41112,1],[41154,1],[41168,1],[41170,2],[41269,2],[41343,2],[41428,2],[41561,2],[41735,2],[41778,2],[41788,2],[41795,1],[41797,2],[41800,2],[41816,1],[41818,1],[41828,2],[41923,1],[41930,2],[41990,1],[42132,2],[42135,1],[42137,1],[42149,2],[42242,2],[42249,1],[42251,2],[42254,2],[42270,1],[42291,2],[42363,2],[42482,1],[42537,1],[42571,1],[42573,2],[42675,1],[42703,1],[42715,1],[42771,2],[42828,1],[42882,2],[42987,1],[43041,2],[43168,1],[43222,2],[43265,2],[43282,1],[43318,1],[43320,1],[43334,1],[43365,1],[43388,1],[43421,2],[43433,1],[43460,1],[43469,1],[43498,1],[43506,1],[43513,1],[43538,1],[43557,1],[43593,1],[43595,2],[43598,2],[43614,1],[43673,1],[43844,1],[43890,1],[43926,1],[43983,1],[44017,1],[44122,1],[44155,1],[44283,1],[44317,1],[44359,1],[44361,1],[44485,1],[44565,1],[44567,1],[44625,1],[44632,1],[44639,1],[44763,3],[44767,2],[44770,2],[44773,1],[44784,1],[45058,1],[45102,1],[45104,1],[45195,1],[45212,1],[45227,1],[45316,2],[45695,1],[45782,1],[45784,2],[46114,2],[46186,2],[46210,1],[46226,1],[46228,1],[46255,2],[46355,1],[46416,2],[46500,2],[46680,2],[46723,3],[46727,2],[46748,1],[46758,1],[46760,1],[46853,2],[46856,1],[46913,3],[46917,2],[46928,1],[46955,2],[47034,1],[47036,1],[47078,1],[47092,1],[47094,2],[47193,2],[47267,2],[47352,2],[47485,2],[47659,2],[47702,2],[47712,2],[47719,1],[47721,2],[47724,2],[47740,1],[47742,1],[47752,2],[47847,1],[47854,2],[47944,1],[47956,2],[48035,2],[48043,1],[48045,1],[48062,1],[48083,2],[48155,2],[48274,1],[48329,1],[48363,1],[48365,2],[48467,1],[48495,1],[48507,1],[48563,2],[48620,1],[48674,2],[48779,1],[48833,2],[48960,1],[49014,2],[49057,2],[49074,1],[49110,1],[49112,1],[49126,1],[49151,1],[49174,1],[49207,2],[49219,1],[49244,1],[49251,1],[49276,1],[49295,1],[49316,2],[49332,1],[49372,2],[49392,1],[49419,1],[49590,1],[49636,1],[49672,1],[49729,1],[49763,1],[49868,1],[49901,1],[50029,1],[50063,1],[50105,1],[50107,1],[50231,1],[50311,1],[50313,1],[50371,1],[50378,1],[50464,1],[50475,1],[50515,1],[50534,1],[50834,1],[51098,1],[51142,1],[51144,1],[51235,1],[51382,1],[51424,1],[51440,2],[51483,1],[51495,2],[51530,1],[51551,2],[51605,1],[51637,2],[51785,2],[51857,2],[51881,1],[51897,1],[51899,1],[51926,2],[52026,1],[52087,2],[52171,2],[52351,2],[52394,3],[52398,2],[52419,1],[52429,1],[52431,1],[52540,2],[52543,1],[52600,3],[52604,2],[52615,1],[52641,2],[52720,1],[52722,1],[52764,1],[52778,1],[52780,2],[52879,2],[52953,2],[53038,2],[53171,2],[53345,2],[53388,2],[53398,2],[53405,1],[53407,2],[53410,2],[53426,1],[53428,1],[53438,2],[53533,1],[53540,2],[53646,1],[53658,2],[53737,2],[53745,1],[53747,1],[53763,1],[53784,2],[53856,2],[53975,1],[54030,1],[54064,1],[54066,2],[54168,1],[54196,1],[54208,1],[54264,2],[54321,1],[54375,2],[54480,1],[54534,2],[54661,1],[54715,2],[54758,2],[54775,1],[54811,1],[54813,1],[54827,1],[54852,1],[54875,1],[54908,2],[54920,1],[54945,1],[54952,1],[54977,1],[54996,1],[55033,2],[55049,1],[55089,2],[55109,1],[55135,1],[55306,1],[55352,1],[55388,1],[55445,1],[55479,1],[55584,1],[55617,1],[55745,1],[55779,1],[55821,1],[55823,1],[55947,1],[56027,1],[56029,1],[56087,1],[56094,1],[56196,1],[56207,1],[56247,1],[56266,1],[56581,1],[56844,1],[56888,1],[56890,1],[56981,1],[57144,1],[57185,1],[57201,2],[57244,1],[57256,2],[57291,1],[57328,2],[57398,1],[57430,2]]}}}],["0.0.0.0:2112/metric",{"_index":1484,"t":{"226":{"position":[[85,21]]}}}],["0.0.0.0:4317",{"_index":1495,"t":{"228":{"position":[[242,13]]}}}],["0.2.0",{"_index":1465,"t":{"222":{"position":[[727,5]]}}}],["0.3.2",{"_index":1462,"t":{"222":{"position":[[645,5]]}}}],["0.4.0",{"_index":1817,"t":{"424":{"position":[[165,5]]}}}],["0.5.0",{"_index":1827,"t":{"424":{"position":[[1067,5]]}}}],["0001",{"_index":1973,"t":{"482":{"position":[[5058,5]]}}}],["01",{"_index":112,"t":{"3":{"position":[[1908,2],[2138,2],[2217,2],[2551,2]]}}}],["01t00:00:00z",{"_index":113,"t":{"3":{"position":[[1911,13]]}}}],["01t00:10:00z",{"_index":121,"t":{"3":{"position":[[2141,12],[2554,12]]}}}],["01t02:00:00z",{"_index":122,"t":{"3":{"position":[[2220,12]]}}}],["03",{"_index":2641,"t":{"777":{"position":[[35,3]]}}}],["06t15:32:11.128z",{"_index":2138,"t":{"606":{"position":[[1390,19],[2612,19],[4000,19],[5198,21],[6069,20],[6384,19],[7527,19],[8710,19],[10077,19],[11256,21],[12089,20],[12382,19],[13518,19],[14711,19],[16088,19],[17277,21],[18130,20],[18414,19]]},"683":{"position":[[1125,19],[2355,19],[3805,19],[5071,21],[5933,20],[6228,19]]}}}],["06t15:32:11.128z\"},{\"key",{"_index":2306,"t":{"683":{"position":[[1002,26],[2232,26],[3682,26],[4948,26],[5810,26],[6105,26]]}}}],["1",{"_index":236,"t":{"9":{"position":[[1049,3]]},"329":{"position":[[211,1],[300,1],[688,1]]},"424":{"position":[[0,1]]},"578":{"position":[[207,1]]},"606":{"position":[[294,2]]},"620":{"position":[[338,1]]},"765":{"position":[[267,1],[316,1],[368,1],[401,1],[480,1],[513,1]]},"771":{"position":[[74,1],[123,1],[452,2]]},"773":{"position":[[107,1],[2545,1],[2596,1]]},"775":{"position":[[2768,2],[17513,2]]},"797":{"position":[[10228,1]]}}}],["1.0",{"_index":828,"t":{"89":{"position":[[3329,3]]},"408":{"position":[[937,3]]},"410":{"position":[[143,4],[337,4]]},"412":{"position":[[32,3],[112,3]]},"414":{"position":[[13,3]]},"418":{"position":[[19,4],[3129,3],[3307,4]]},"422":{"position":[[509,4],[876,4],[1025,4]]},"424":{"position":[[133,3],[213,3],[499,3],[737,3],[1206,3]]}}}],["1.1",{"_index":93,"t":{"3":{"position":[[1494,3]]},"9":{"position":[[539,3]]},"35":{"position":[[93,3],[216,6],[1472,6]]},"45":{"position":[[1664,3],[1916,6]]},"83":{"position":[[162,3],[828,6]]},"89":{"position":[[307,3],[506,6]]},"97":{"position":[[888,3],[1079,6],[1817,3],[1914,6]]},"157":{"position":[[308,3],[349,3]]},"191":{"position":[[334,3],[473,6]]},"240":{"position":[[217,3],[258,3]]},"258":{"position":[[283,3],[360,6]]},"281":{"position":[[74,3],[262,6]]},"285":{"position":[[328,3],[455,6]]},"302":{"position":[[372,3],[533,6]]},"347":{"position":[[403,3],[505,6]]},"355":{"position":[[188,3],[300,6]]},"363":{"position":[[462,3],[597,6]]},"371":{"position":[[233,3],[391,6]]},"373":{"position":[[320,3],[494,6]]},"382":{"position":[[65,3],[198,6]]},"384":{"position":[[65,3],[201,6]]},"392":{"position":[[114,3],[152,4]]},"396":{"position":[[303,3],[405,6]]},"410":{"position":[[183,4],[273,3]]},"412":{"position":[[1301,3],[1534,3],[1827,5],[3071,5]]},"414":{"position":[[239,3],[491,3]]},"416":{"position":[[1354,3],[2968,5]]},"418":{"position":[[483,3],[785,3],[1139,5],[3194,3],[3461,3]]},"422":{"position":[[656,4],[820,3],[894,3]]},"424":{"position":[[745,3],[852,3],[1011,3]]},"430":{"position":[[507,3],[625,6]]},"442":{"position":[[287,3],[479,6]]},"454":{"position":[[714,3],[898,6]]},"464":{"position":[[197,3],[429,6]]},"478":{"position":[[4117,3]]},"480":{"position":[[2864,3]]},"482":{"position":[[9479,3],[9991,3]]},"492":{"position":[[350,3],[474,6]]},"500":{"position":[[332,3],[480,6]]},"502":{"position":[[136,3],[306,6]]},"514":{"position":[[293,3],[379,6]]},"530":{"position":[[308,3],[388,6]]},"538":{"position":[[187,3],[316,6]]},"550":{"position":[[314,3],[411,6]]},"558":{"position":[[292,3],[389,6]]},"560":{"position":[[764,3],[928,6]]},"568":{"position":[[272,3],[347,6]]},"576":{"position":[[97,3],[262,6]]},"590":{"position":[[376,3],[488,6]]},"628":{"position":[[328,3],[452,6]]},"635":{"position":[[161,3],[309,6]]},"643":{"position":[[98,3],[303,6]]},"663":{"position":[[267,3],[455,6]]},"667":{"position":[[78,3],[266,6]]},"669":{"position":[[139,3],[296,6]]},"677":{"position":[[276,3],[380,6],[999,3],[1104,6]]},"679":{"position":[[278,3],[439,6]]},"685":{"position":[[138,3],[243,6]]},"695":{"position":[[887,3],[1316,6]]},"707":{"position":[[87,3],[654,6]]},"724":{"position":[[625,3],[817,6]]},"728":{"position":[[7165,3],[7375,6],[23352,3],[23601,6],[31073,3],[31378,6],[40601,3]]},"745":{"position":[[304,3],[472,6],[1268,3],[1344,6],[30375,3],[30587,6]]},"747":{"position":[[363,3],[442,6],[797,3],[1074,6]]},"751":{"position":[[960,3],[1034,6],[1305,3],[1601,6],[23135,3],[23725,6]]},"769":{"position":[[664,3],[820,6]]},"773":{"position":[[1171,3],[1443,6]]},"775":{"position":[[796,3],[1212,6]]},"777":{"position":[[652,3],[1038,6]]},"789":{"position":[[544,3],[911,6]]},"801":{"position":[[87,3],[820,6]]},"803":{"position":[[239,3],[1033,6]]},"820":{"position":[[389,3],[537,6],[30415,3],[30595,6]]},"822":{"position":[[420,3],[704,6]]},"824":{"position":[[494,3],[760,6],[16491,3],[16891,6]]},"826":{"position":[[565,3],[973,6]]},"842":{"position":[[1018,3],[1178,6]]},"844":{"position":[[590,3],[750,6]]},"846":{"position":[[6371,3],[6581,6]]},"848":{"position":[[4497,3],[4991,6]]}}}],["1.3.1",{"_index":1469,"t":{"222":{"position":[[833,5]]}}}],["1.4.0",{"_index":161,"t":{"7":{"position":[[56,5]]}}}],["10",{"_index":1605,"t":{"311":{"position":[[11366,2]]},"606":{"position":[[1387,2],[2609,2],[3997,2],[5195,2],[6066,2],[6381,2],[7524,2],[8707,2],[10074,2],[11253,2],[12086,2],[12379,2],[13515,2],[14708,2],[16085,2],[17274,2],[18127,2],[18411,2]]},"620":{"position":[[400,3],[437,2]]},"683":{"position":[[999,2],[1122,2],[2229,2],[2352,2],[3679,2],[3802,2],[4945,2],[5068,2],[5807,2],[5930,2],[6102,2],[6225,2]]}}}],["10.0.0.0/16",{"_index":2730,"t":{"797":{"position":[[11378,11],[13043,11],[14986,11],[16601,11],[18514,11],[19629,11],[20931,11],[22668,11],[24030,11],[25386,11]]},"799":{"position":[[1009,11],[1854,11],[3211,11],[5003,11],[6421,11],[7758,11]]},"801":{"position":[[5707,11],[9251,11],[12632,11],[15676,11],[20870,11]]}}}],["100",{"_index":903,"t":{"109":{"position":[[713,4]]},"153":{"position":[[1048,4]]},"279":{"position":[[3278,4]]},"327":{"position":[[1070,5]]}}}],["1000",{"_index":1592,"t":{"294":{"position":[[70,4]]},"620":{"position":[[182,6]]}}}],["10am",{"_index":2773,"t":{"801":{"position":[[4781,4],[4925,4],[7971,4],[8174,4],[11646,4],[11800,4],[14696,4],[14849,4],[19920,4],[20068,4]]}}}],["11am",{"_index":2725,"t":{"797":{"position":[[11051,4],[12598,4],[14639,4],[16256,4],[18179,4]]},"801":{"position":[[4933,4],[5078,4],[8182,4],[8386,4],[11808,4],[11963,4],[14857,4],[15011,4],[20076,4],[20225,4]]}}}],["128",{"_index":1384,"t":{"212":{"position":[[3167,3],[3219,3]]}}}],["12pm",{"_index":2700,"t":{"791":{"position":[[93,4],[179,4],[329,4]]},"797":{"position":[[11059,4],[11204,4],[12606,4],[12810,4],[14647,4],[14802,4],[16264,4],[16418,4],[18187,4],[18336,4],[19768,4],[21129,4],[22817,4],[24178,4],[25529,4]]},"799":{"position":[[1066,4],[2020,4],[3436,4],[5179,4],[6596,4],[7928,4]]},"801":{"position":[[5086,4],[5231,4],[8394,4],[8598,4],[11971,4],[12126,4],[15019,4],[15173,4],[20233,4],[20382,4]]}}}],["13th",{"_index":1814,"t":{"424":{"position":[[12,4]]}}}],["15th",{"_index":1816,"t":{"424":{"position":[[86,4],[1022,4]]}}}],["1h",{"_index":114,"t":{"3":{"position":[[1942,2]]}}}],["1pm",{"_index":2727,"t":{"797":{"position":[[11212,3],[12818,3],[14810,3],[16426,3],[18344,3],[19777,3],[21138,3],[22826,3],[24187,3],[25538,3]]},"799":{"position":[[1075,3],[2029,3],[3445,3],[5188,3],[6605,3],[7937,3]]},"801":{"position":[[5239,3],[5383,3],[8606,3],[8809,3],[12134,3],[12288,3],[15181,3],[15334,3],[20390,3],[20538,3]]}}}],["1s",{"_index":2193,"t":{"620":{"position":[[304,3]]}}}],["1uhxcsutp0vkpysnkq1pbb1jezw",{"_index":420,"t":{"35":{"position":[[1891,29],[3553,29],[5266,29],[6886,29]]},"45":{"position":[[13087,30],[15383,30],[16551,29],[17484,30],[17834,29],[19281,30],[21577,30],[22745,29],[23678,30],[24028,29],[25609,30],[28012,30],[29216,29],[30230,30],[30575,30]]},"135":{"position":[[260,30],[688,30],[943,29],[1500,30]]},"147":{"position":[[239,30],[784,30],[1085,29],[1743,30]]},"200":{"position":[[892,29],[3285,30],[4471,29],[5183,31]]},"202":{"position":[[925,30],[3218,30],[4383,29],[5310,30],[5651,29],[6670,30],[8966,30],[10133,29],[11064,30],[11409,29]]},"250":{"position":[[223,29],[755,30],[1035,29],[1673,31]]},"252":{"position":[[379,29],[912,30],[1193,29],[1797,31]]},"265":{"position":[[1215,30],[3498,30],[4653,29],[5560,30],[5871,29]]},"267":{"position":[[908,29],[3296,30],[4477,29],[5181,31],[6630,30],[8915,30],[10071,29],[10980,30],[11292,29]]},"285":{"position":[[2225,30],[4515,30],[5676,29],[6595,30],[6922,29],[7882,29],[10312,30],[11535,29],[12281,31],[13892,30],[16185,30],[17350,29],[18277,30],[18618,29],[19495,30],[21791,30],[22958,29],[23889,30],[24234,29]]},"294":{"position":[[1153,29],[3545,30],[4730,29],[5442,31]]},"296":{"position":[[968,30],[3263,30],[4429,29],[5358,30],[5700,29]]},"311":{"position":[[990,29],[3374,30],[4551,29],[5245,31],[6572,29],[8957,30],[10135,29],[10833,31],[12555,29],[15184,30],[16568,29],[17543,31]]},"357":{"position":[[1106,30],[3407,30],[4580,29],[5523,30],[5888,29]]},"369":{"position":[[1065,30],[3359,30],[4525,29],[5454,30],[5798,29],[6674,30],[8967,30],[10132,29],[11059,30],[11400,29]]},"375":{"position":[[1219,29],[3671,30],[4916,29],[5691,31],[7359,30],[9654,30],[10820,29],[11749,30],[12091,29],[13174,30],[15468,30],[16634,29],[17563,30],[17907,29]]},"382":{"position":[[2041,30],[4332,30],[5495,29],[6418,30],[6753,29]]},"402":{"position":[[966,29],[3371,30],[4569,29],[5305,31]]},"404":{"position":[[1006,30],[3307,30],[4480,29],[5423,30],[5788,29],[6843,30],[9146,30],[10320,29],[11265,30],[11631,29]]},"422":{"position":[[1364,29],[1913,30],[2210,29],[2772,31]]},"444":{"position":[[1188,29],[3805,30],[5166,29],[6130,31],[7803,30],[10099,30],[11267,29],[12200,30],[12550,29]]},"446":{"position":[[1200,29],[3927,30],[5398,29],[6508,31]]},"448":{"position":[[897,30],[3193,30],[4361,29],[5294,30],[5644,29]]},"462":{"position":[[1068,30],[3365,30],[4534,29],[5469,30],[5822,29],[6701,30],[8997,30],[10165,29],[11098,30],[11448,29]]},"466":{"position":[[1029,30],[3327,30],[4497,29],[5434,30],[5790,29],[6827,30],[9126,30],[10296,29],[11233,30],[11587,29]]},"504":{"position":[[927,29],[3318,30],[4502,29],[5210,31]]},"506":{"position":[[1009,29],[3480,30],[4744,29],[5549,31]]},"508":{"position":[[1079,30],[3380,30],[4553,29],[5496,30],[5861,29]]},"522":{"position":[[1165,29],[3608,30],[4844,29],[5611,31]]},"524":{"position":[[1207,30],[3504,30],[4673,29],[5608,30],[5961,29]]},"540":{"position":[[938,29],[3331,30],[4517,29],[5229,31]]},"542":{"position":[[1348,29],[3818,30],[5081,29],[5892,31]]},"544":{"position":[[1141,30],[3444,30],[4619,29],[5566,30],[5937,29]]},"562":{"position":[[1298,29],[3885,30],[5216,29],[6132,31],[7735,30],[10029,30],[11195,29],[12124,30],[12468,29],[13729,30],[16024,30],[17190,29],[18119,30],[18461,29],[19418,30],[21714,30],[22882,29],[23815,30],[24165,29],[25043,30],[27338,30],[28505,29],[29436,30],[29783,29]]},"574":{"position":[[1068,29],[3571,30],[4818,29],[5641,31]]},"578":{"position":[[1071,29],[3570,30],[4813,29],[5628,31]]},"580":{"position":[[1034,29],[3426,30],[4611,29],[5321,31]]},"582":{"position":[[893,30],[3175,30],[4329,29],[5234,30],[5542,29],[6407,30],[8689,30],[9843,29],[10748,30],[11056,29]]},"584":{"position":[[909,29],[3293,30],[4470,29],[5166,31],[6467,30],[8751,30],[9906,29],[10813,30],[11122,29]]},"599":{"position":[[1062,30],[3354,30],[4518,29],[5443,30],[5781,29]]},"613":{"position":[[1097,29],[3450,30],[4676,29],[5660,31],[7009,29],[9362,30],[10588,29],[11572,31]]},"618":{"position":[[1059,30],[3571,30],[4896,29],[6066,30],[6526,30]]},"637":{"position":[[1283,29],[3792,30],[5094,29],[5936,31]]},"639":{"position":[[1016,30],[3320,30],[4496,29],[5445,30],[5819,29]]},"645":{"position":[[1107,29],[3774,30],[5185,29],[6217,31]]},"647":{"position":[[937,30],[3233,30],[4401,29],[5334,30],[5684,29]]},"649":{"position":[[963,29],[3427,30],[4684,29],[5489,31],[6976,30],[9274,30],[10443,29],[11378,30],[11729,29],[12613,30],[14913,30],[16085,29],[17026,30],[17388,29]]},"667":{"position":[[2194,30],[4487,30],[5652,29],[6579,30],[6920,29],[8366,30],[10659,30],[11824,29],[12751,30],[13092,29],[15190,30],[17486,30],[18654,29],[19587,30],[19937,29],[22024,30],[24317,30],[25482,29],[26409,30],[26750,29],[28261,30],[30555,30],[31721,29],[32650,30],[32994,29]]},"669":{"position":[[2167,30],[4462,30],[5628,29],[6557,30],[6899,29],[8419,30],[10717,30],[11886,29],[12821,30],[13172,29],[14761,30],[17057,30],[18224,29],[19155,30],[19500,29],[21085,30],[23380,30],[24547,29],[25478,30],[25825,29]]},"679":{"position":[[1883,30],[4178,30],[5345,29],[6276,30],[6623,29],[7500,30],[9794,30],[10960,29],[11889,30],[12233,29]]},"681":{"position":[[1033,29],[3477,30],[4714,29],[5482,31],[6894,30],[9192,30],[10362,29],[11299,30],[11655,29]]},"683":{"position":[[7310,29],[9838,30],[11110,29],[11983,31],[13573,29],[16102,30],[17375,29],[18252,31],[19823,30],[22118,30],[23285,29],[24216,30],[24563,29],[25483,30],[27777,30],[28942,29],[29869,30],[30208,29]]},"695":{"position":[[4139,29],[5833,30],[6981,29],[8821,31]]},"701":{"position":[[422,30],[851,30],[1107,29],[1666,30],[1989,29],[2255,30],[2686,30],[2944,29],[3507,30],[3836,29],[4112,30],[4541,30],[4797,29],[5356,30],[5679,29],[5950,30],[6383,30],[6642,29],[7207,30],[7537,29],[7805,30],[8236,30],[8493,29],[9054,30],[9378,29],[9650,30],[10083,30],[10342,29],[10907,30],[11237,29]]},"703":{"position":[[3000,30],[3431,30],[3688,29],[4249,30],[4573,29],[5611,29],[8072,30],[9326,29],[10115,31],[10890,30],[11319,30],[11575,29],[12134,30],[12457,29]]},"705":{"position":[[2030,29],[4519,30],[5801,29],[6621,31],[7543,30],[8089,30],[8474,29],[9205,30],[9778,29],[10214,30],[10762,30],[11148,29],[11881,30],[12455,29]]},"707":{"position":[[3678,29],[5372,30],[6520,29],[8360,31]]},"726":{"position":[[1841,29],[5374,30],[7455,29],[9467,31],[12699,29],[15595,30],[17186,29],[18464,31],[20766,29],[23592,30],[25113,29],[26306,31],[29074,30],[31368,30],[32534,29],[33463,30],[33807,29],[34833,30],[37129,30],[38296,29],[39227,30],[39572,29],[40454,30],[42752,30],[43922,29],[44859,30],[45215,29],[46097,30],[48396,30],[49567,29],[50506,30],[50865,29]]},"728":{"position":[[1112,30],[3412,30],[4579,29],[5510,30],[5847,29],[9031,30],[11323,30],[12486,29],[13409,30],[13742,29],[14957,30],[17258,30],[18430,29],[19371,30],[19731,29],[25375,30],[27674,30],[28845,29],[29784,30],[30143,29],[33614,30],[35904,30],[37066,29],[37987,30],[38319,29],[43149,30],[45439,30],[46601,29],[47522,30],[47854,29]]},"745":{"position":[[2630,29],[5030,30],[6223,29],[6949,31],[8333,30],[10629,30],[11797,29],[12730,30],[13080,29],[14004,29],[16404,30],[17597,29],[18323,31],[19664,30],[21960,30],[23128,29],[24061,30],[24411,29],[25290,30],[27588,30],[28757,29],[29692,30],[30043,29],[33024,30],[35320,30],[36488,29],[37421,30],[37771,29],[38650,30],[40946,30],[42114,29],[43047,30],[43397,29]]},"747":{"position":[[3388,29],[6076,30],[7508,29],[8572,31],[10494,30],[12792,30],[13962,29],[14899,30],[15255,29]]},"749":{"position":[[1128,29],[3552,30],[4769,29],[5543,31],[7401,29],[9857,30],[11106,29],[11890,31],[13255,30],[15551,30],[16719,29],[17652,30],[18002,29]]},"751":{"position":[[3885,29],[6428,30],[7715,29],[8618,31],[10703,30],[13008,30],[14180,29],[15121,30],[15473,29],[18141,29],[20563,30],[21778,29],[22548,31]]},"771":{"position":[[1315,29],[3714,30],[4906,29],[5630,31],[6967,29],[9370,30],[10566,29],[11298,31],[12794,29],[15458,30],[16817,29],[17853,31],[19900,30],[22195,30],[23362,29],[24293,30],[24640,29],[25596,30],[27890,30],[29055,29],[29982,30],[30321,29]]},"773":{"position":[[3933,29],[6709,30],[8131,29],[9282,31],[11231,30],[13529,30],[14699,29],[15636,30],[15992,29]]},"775":{"position":[[3726,29],[6272,30],[7562,29],[8471,31],[10446,29],[13305,30],[14810,29],[16127,31],[18409,30],[20701,30],[21865,29],[22790,30],[23128,29]]},"777":{"position":[[3983,29],[6650,30],[8012,29],[9054,31],[11105,30],[13403,30],[14572,29],[15507,30],[15858,29]]},"789":{"position":[[3926,29],[7022,30],[8764,29],[10277,31]]},"795":{"position":[[1248,30],[3539,30],[4702,29],[5625,30],[5960,29],[6940,30],[9235,30],[10402,29],[11333,30],[11680,29],[12706,29],[15165,30],[16417,29],[17206,31],[18571,30],[20864,30],[22028,29],[22953,30],[23289,29]]},"797":{"position":[[5358,30],[7646,30],[8805,29],[9720,30],[10041,29],[11581,29],[14526,30],[16166,29],[17540,31],[19879,29],[22520,30],[23905,29],[24892,31],[26650,30],[28941,30],[30104,29],[31027,30],[31362,29]]},"799":{"position":[[2131,29],[4827,30],[6267,29],[7312,31],[9514,30],[11993,30],[13357,29],[14566,30],[15290,29],[16440,30],[18921,30],[20286,29],[21497,30],[22222,29]]},"801":{"position":[[5910,29],[10734,30],[13812,29],[17352,31]]},"820":{"position":[[2634,29],[5037,30],[6233,29],[6965,31],[8361,30],[10660,30],[11831,29],[12770,30],[13129,29],[14050,29],[16449,30],[17641,29],[18365,31],[19703,30],[21998,30],[23165,29],[24096,30],[24443,29],[25322,30],[27620,30],[28789,29],[29724,30],[30075,29],[32543,30],[34838,30],[36005,29],[36936,30],[37283,29],[38162,30],[40458,30],[41626,29],[42559,30],[42909,29]]},"822":{"position":[[3234,29],[6131,30],[7674,29],[8948,31],[11169,30],[13468,30],[14639,29],[15578,30],[15937,29]]},"824":{"position":[[2946,29],[5604,30],[7006,29],[8028,31],[10080,30],[12387,30],[13561,29],[14506,30],[14864,29]]},"826":{"position":[[3992,29],[6882,30],[8467,29],[9759,31],[11756,30],[14059,30],[15234,29],[16181,30],[16552,29],[17515,30],[19821,30],[20998,29],[21949,30],[22324,29],[23215,30],[25522,30],[26701,29],[27656,30],[28039,29],[29004,30],[31310,30],[32487,29],[33438,30],[33813,29],[34701,30],[37007,30],[38184,29],[39135,30],[39510,29]]},"844":{"position":[[2931,29],[5389,30],[6640,29],[7428,31],[8874,30],[11175,30],[12348,29],[13291,30],[13656,29],[14642,29],[17100,30],[18351,29],[19139,31],[20542,30],[22843,30],[24016,29],[24959,30],[25324,29],[26291,30],[28600,30],[29780,29],[30737,30],[31121,29],[32730,29],[35556,30],[37077,29],[38282,31],[40246,30],[42547,30],[43720,29],[44663,30],[45028,29]]},"846":{"position":[[952,30],[3249,30],[4417,29],[5350,30],[5698,29],[8234,30],[10529,30],[11696,29],[12627,30],[12974,29]]},"848":{"position":[[7925,29],[10666,30],[12102,29],[13292,31],[15445,29],[17972,30],[19292,29],[20157,31],[21932,29],[24562,30],[25936,29],[26905,31],[28681,29],[31226,30],[32515,29],[33422,31],[35108,29],[37537,30],[38759,29],[39543,31],[40978,29],[43390,30],[44595,29],[45345,31],[46882,30],[49176,30],[50341,29],[51268,30],[51607,29],[52569,30],[54877,30],[56057,29],[57014,30],[57400,29]]}}}],["2",{"_index":238,"t":{"9":{"position":[[1102,3]]},"153":{"position":[[1066,1]]},"329":{"position":[[497,1],[598,1],[693,1]]},"424":{"position":[[77,1]]},"578":{"position":[[213,2]]},"606":{"position":[[6404,2]]},"765":{"position":[[420,1]]},"775":{"position":[[9261,1],[17493,1]]}}}],["20",{"_index":1398,"t":{"212":{"position":[[4550,3]]}}}],["2021",{"_index":2137,"t":{"606":{"position":[[1381,5],[2603,5],[3991,5],[5189,5],[6060,5],[6375,5],[7518,5],[8701,5],[10068,5],[11247,5],[12080,5],[12373,5],[13509,5],[14702,5],[16079,5],[17268,5],[18121,5],[18405,5]]},"683":{"position":[[993,5],[1116,5],[2223,5],[2346,5],[3673,5],[3796,5],[4939,5],[5062,5],[5801,5],[5924,5],[6096,5],[6219,5]]},"817":{"position":[[219,4],[337,4],[394,4],[417,4]]},"826":{"position":[[203,4]]}}}],["2023",{"_index":111,"t":{"3":{"position":[[1903,4],[2133,4],[2212,4],[2546,4]]},"39":{"position":[[56,4]]},"424":{"position":[[17,5],[91,5],[771,5],[1027,5]]}}}],["2048",{"_index":1160,"t":{"171":{"position":[[2122,5]]},"173":{"position":[[3363,5]]}}}],["25",{"_index":1538,"t":{"279":{"position":[[154,3],[570,3],[722,3],[1045,4],[1092,2],[1654,3],[2208,3],[2480,3],[3045,4]]},"281":{"position":[[1145,3],[1593,3],[1753,3],[2107,4],[2510,3],[3096,3],[3376,3],[3972,4]]}}}],["256",{"_index":1386,"t":{"212":{"position":[[3193,4],[3245,4],[3266,3]]}}}],["2pm",{"_index":2776,"t":{"801":{"position":[[5390,3],[5534,3],[8816,3],[9019,3],[12295,3],[12449,3],[15341,3],[15494,3],[20545,3],[20693,3]]}}}],["3",{"_index":1651,"t":{"329":{"position":[[492,1]]},"418":{"position":[[1797,1]]},"424":{"position":[[757,1]]},"606":{"position":[[12402,2]]},"616":{"position":[[218,2]]},"719":{"position":[[98,1]]},"765":{"position":[[433,2]]},"775":{"position":[[9267,2]]}}}],["3.8",{"_index":1360,"t":{"212":{"position":[[1597,5],[4244,5]]}}}],["3000",{"_index":1326,"t":{"208":{"position":[[428,4]]},"216":{"position":[[232,4],[332,4]]}}}],["3000:3000",{"_index":171,"t":{"7":{"position":[[196,9]]},"208":{"position":[[229,9]]},"212":{"position":[[1343,9],[2665,11],[4010,9],[5296,11]]},"214":{"position":[[1466,9],[2985,9]]},"218":{"position":[[342,9],[588,9]]}}}],["3001",{"_index":1437,"t":{"218":{"position":[[475,5]]}}}],["3001:3001",{"_index":1436,"t":{"218":{"position":[[355,9]]}}}],["3002",{"_index":1440,"t":{"218":{"position":[[666,5]]}}}],["3002:3002",{"_index":1439,"t":{"218":{"position":[[601,9]]}}}],["3060",{"_index":638,"t":{"45":{"position":[[4269,4],[4783,4]]}}}],["31st",{"_index":1824,"t":{"424":{"position":[[766,4]]}}}],["3306:3306",{"_index":1392,"t":{"212":{"position":[[4352,11]]}}}],["3pm",{"_index":554,"t":{"39":{"position":[[857,3]]},"789":{"position":[[2519,3]]},"801":{"position":[[5541,3],[9026,3],[12456,3],[15501,3],[20700,3]]}}}],["3s",{"_index":2191,"t":{"620":{"position":[[98,3]]}}}],["4",{"_index":1826,"t":{"424":{"position":[[1015,1]]},"781":{"position":[[42,1]]}}}],["41f4",{"_index":639,"t":{"45":{"position":[[4274,4],[4788,4]]}}}],["42c8",{"_index":2453,"t":{"726":{"position":[[27839,4]]}}}],["4930",{"_index":651,"t":{"45":{"position":[[4724,4]]}}}],["4d5c",{"_index":2458,"t":{"726":{"position":[[27909,4]]}}}],["4da68ce1846c",{"_index":677,"t":{"45":{"position":[[8126,12],[8934,13]]}}}],["4e93",{"_index":675,"t":{"45":{"position":[[8116,4],[8924,4]]}}}],["4fa7",{"_index":674,"t":{"45":{"position":[[8111,4],[8919,4]]}}}],["5",{"_index":1371,"t":{"212":{"position":[[1889,1],[4563,1]]},"745":{"position":[[11,1]]},"781":{"position":[[48,2]]}}}],["50",{"_index":867,"t":{"103":{"position":[[247,2]]},"153":{"position":[[1137,2]]},"279":{"position":[[3241,3]]}}}],["512",{"_index":1387,"t":{"212":{"position":[[3292,4]]}}}],["526",{"_index":2660,"t":{"789":{"position":[[2300,3],[2372,3],[2420,3],[3491,3],[3568,6],[3646,3],[3744,6],[3778,3],[3841,5],[5189,3],[5320,6],[5403,3],[5555,6],[5594,3],[5673,6],[7332,3],[7418,4],[7497,3],[7604,4],[7639,3],[7709,5],[9050,3],[9122,5],[9214,3],[9307,5],[9355,3],[9415,5],[10734,3],[10861,3],[10964,3],[11192,3],[11272,4],[11351,3],[11452,4],[11487,3],[11551,5]]},"801":{"position":[[4219,3],[4296,6],[4374,3],[4472,6],[4506,3],[4569,5],[7173,3],[7304,6],[7387,3],[7539,6],[7578,3],[7657,6],[11044,3],[11130,4],[11209,3],[11316,4],[11351,3],[11421,5],[14098,3],[14170,5],[14262,3],[14355,5],[14403,3],[14463,5],[17809,3],[17936,3],[18039,3],[19342,3],[19422,4],[19501,3],[19602,4],[19637,3],[19701,5]]}}}],["526\",\"relation\":\"account\",\"object\":\"transaction:a",{"_index":2689,"t":{"789":{"position":[[10195,52]]}}}],["526\",\"relation\":\"account\",\"object\":\"transaction:a\"},{\"user\":\"timeslot:8_9\",\"relation\":\"approved_timeslot\",\"object\":\"branch:west",{"_index":2789,"t":{"801":{"position":[[16571,127]]}}}],["526\"},{\"user\":\"account:check",{"_index":2688,"t":{"789":{"position":[[10163,31]]},"801":{"position":[[16539,31]]}}}],["526\"},{\"user\":\"branch:west",{"_index":2686,"t":{"789":{"position":[[10083,26]]},"801":{"position":[[16459,26]]}}}],["5432:5432",{"_index":1362,"t":{"212":{"position":[[1715,11]]}}}],["5570c7bf6f59",{"_index":653,"t":{"45":{"position":[[4734,12]]}}}],["5s",{"_index":1368,"t":{"212":{"position":[[1865,2],[1877,2]]}}}],["6pm",{"_index":2702,"t":{"791":{"position":[[379,3]]}}}],["7c9c",{"_index":2452,"t":{"726":{"position":[[27834,4]]}}}],["8080",{"_index":1323,"t":{"208":{"position":[[352,4]]}}}],["8080:8080",{"_index":169,"t":{"7":{"position":[[170,9]]},"208":{"position":[[203,9]]},"212":{"position":[[1356,9],[2545,11],[4023,9],[5176,11]]},"214":{"position":[[1479,9],[2998,9]]},"218":{"position":[[316,9],[562,9]]},"222":{"position":[[160,9],[296,9]]}}}],["8081",{"_index":1325,"t":{"208":{"position":[[388,4]]}}}],["8081:8081",{"_index":170,"t":{"7":{"position":[[183,9]]},"208":{"position":[[216,9]]},"212":{"position":[[1369,9],[2598,11],[4036,9],[5229,11]]},"214":{"position":[[1492,9],[3011,9]]},"218":{"position":[[329,9],[575,9]]},"222":{"position":[[173,9],[309,9]]}}}],["8417",{"_index":676,"t":{"45":{"position":[[8121,4],[8929,4]]}}}],["88fd",{"_index":652,"t":{"45":{"position":[[4729,4]]}}}],["8am",{"_index":556,"t":{"39":{"position":[[865,4]]},"789":{"position":[[2515,3]]},"801":{"position":[[4625,3],[7756,3],[11480,3],[14531,3],[19760,3]]}}}],["9.30",{"_index":538,"t":{"39":{"position":[[498,4]]}}}],["911002051524",{"_index":2455,"t":{"726":{"position":[[27849,12]]}}}],["9329",{"_index":2454,"t":{"726":{"position":[[27844,4]]}}}],["9590",{"_index":640,"t":{"45":{"position":[[4279,4],[4793,4]]}}}],["9am",{"_index":2771,"t":{"801":{"position":[[4632,3],[4774,3],[7763,3],[7964,3],[11487,3],[11639,3],[14538,3],[14689,3],[19767,3],[19913,3]]}}}],["9th",{"_index":553,"t":{"39":{"position":[[850,3]]}}}],["_",{"_index":1948,"t":{"480":{"position":[[2606,3]]}}}],["_object",{"_index":2181,"t":{"618":{"position":[[3795,8]]},"705":{"position":[[8323,8],[10996,8]]},"799":{"position":[[12220,8],[12303,8],[19148,8],[19231,8]]}}}],["_thi",{"_index":851,"t":{"97":{"position":[[502,5],[626,5]]}}}],["a/an",{"_index":1939,"t":{"480":{"position":[[607,4]]}}}],["a/an/th",{"_index":1935,"t":{"480":{"position":[[430,8]]}}}],["a/th",{"_index":1928,"t":{"478":{"position":[[2113,5],[2158,5]]}}}],["abac",{"_index":256,"t":{"13":{"position":[[71,5]]},"21":{"position":[[504,5]]}}}],["abc",{"_index":1880,"t":{"454":{"position":[[522,3],[565,3],[1600,3],[2014,3]]}}}],["abil",{"_index":1615,"t":{"313":{"position":[[11,7]]},"369":{"position":[[11513,7]]},"689":{"position":[[396,7]]},"751":{"position":[[9334,7]]},"783":{"position":[[428,7]]},"824":{"position":[[8865,7]]},"838":{"position":[[156,7],[330,10]]}}}],["abov",{"_index":152,"t":{"5":{"position":[[172,7]]},"85":{"position":[[1852,6]]},"87":{"position":[[635,5],[1339,6]]},"89":{"position":[[1276,5],[1910,6]]},"91":{"position":[[531,6],[935,5]]},"93":{"position":[[608,6],[999,5]]},"95":{"position":[[635,6],[1098,5]]},"153":{"position":[[1288,7]]},"155":{"position":[[1680,6]]},"167":{"position":[[95,6]]},"210":{"position":[[240,5]]},"212":{"position":[[726,6],[3419,6]]},"265":{"position":[[234,6]]},"285":{"position":[[1240,5]]},"296":{"position":[[9,5]]},"317":{"position":[[848,6]]},"327":{"position":[[46,5]]},"369":{"position":[[9,5]]},"384":{"position":[[1220,6]]},"412":{"position":[[1480,5]]},"416":{"position":[[15,6]]},"418":{"position":[[294,6]]},"420":{"position":[[568,5]]},"440":{"position":[[48,6]]},"462":{"position":[[9,5]]},"478":{"position":[[4265,5]]},"480":{"position":[[3387,5]]},"524":{"position":[[9,5]]},"576":{"position":[[1128,6]]},"667":{"position":[[49,6],[27115,6]]},"695":{"position":[[3097,5]]},"699":{"position":[[39,6]]},"701":{"position":[[59,6]]},"724":{"position":[[283,6],[357,6]]},"728":{"position":[[30400,6],[30961,5]]},"789":{"position":[[2531,5]]},"793":{"position":[[39,6]]},"795":{"position":[[59,6]]},"797":{"position":[[1119,5],[25683,5]]},"799":{"position":[[826,5]]},"820":{"position":[[1456,5]]},"824":{"position":[[1851,6]]},"844":{"position":[[1694,5]]},"848":{"position":[[1627,6],[2732,5]]}}}],["academi",{"_index":342,"t":{"25":{"position":[[409,8]]},"97":{"position":[[2747,8]]}}}],["accept",{"_index":497,"t":{"35":{"position":[[8331,7]]},"45":{"position":[[3004,8]]},"81":{"position":[[452,8]]},"97":{"position":[[16,8]]},"105":{"position":[[70,6]]},"424":{"position":[[194,6],[541,8]]},"478":{"position":[[4310,8]]},"480":{"position":[[3432,8]]},"482":{"position":[[6725,7],[10555,7]]},"685":{"position":[[569,6]]}}}],["access",{"_index":9,"t":{"3":{"position":[[105,6],[285,6],[1315,6],[1426,6],[1436,6]]},"5":{"position":[[108,6],[186,6],[234,6],[298,6]]},"9":{"position":[[477,6],[859,6]]},"19":{"position":[[67,6],[288,6],[383,6],[493,6]]},"21":{"position":[[14,6],[170,6]]},"25":{"position":[[119,6]]},"37":{"position":[[274,6]]},"45":{"position":[[4487,7],[5203,7],[7511,7],[9471,7],[31473,8],[31512,6],[32267,6]]},"77":{"position":[[30,6]]},"79":{"position":[[151,6]]},"85":{"position":[[1725,6]]},"89":{"position":[[3132,6]]},"99":{"position":[[280,6],[313,6]]},"109":{"position":[[651,6]]},"133":{"position":[[3238,6]]},"145":{"position":[[3238,6]]},"167":{"position":[[419,6]]},"171":{"position":[[191,6],[788,6]]},"173":{"position":[[4480,6],[5614,6]]},"179":{"position":[[12,6],[64,6],[116,6],[159,6]]},"189":{"position":[[59,6],[329,6],[392,6],[457,6],[565,6]]},"191":{"position":[[1026,6]]},"193":{"position":[[61,6]]},"216":{"position":[[252,10]]},"248":{"position":[[3238,6]]},"254":{"position":[[92,6],[130,6],[181,6],[229,6]]},"256":{"position":[[49,6],[101,6]]},"258":{"position":[[635,7],[745,6]]},"260":{"position":[[102,6]]},"269":{"position":[[60,7],[75,6],[121,6],[163,6],[211,7]]},"277":{"position":[[3121,6]]},"283":{"position":[[181,6],[256,6],[343,6],[435,6],[611,6]]},"285":{"position":[[24363,6],[24412,7],[24457,6]]},"287":{"position":[[61,6]]},"289":{"position":[[37,6]]},"294":{"position":[[171,6]]},"298":{"position":[[145,6],[179,7]]},"302":{"position":[[1142,7],[1252,6],[1302,7],[1347,6]]},"304":{"position":[[102,6]]},"306":{"position":[[37,6]]},"317":{"position":[[131,6],[337,8]]},"321":{"position":[[190,6]]},"325":{"position":[[72,6],[222,7]]},"327":{"position":[[211,6],[273,6],[604,6],[685,6],[817,6],[1050,6],[1139,6],[1228,6],[2031,6],[2113,6],[2842,6],[3016,6],[3098,6],[3273,6],[3366,6],[3587,6]]},"329":{"position":[[82,6],[121,6],[240,6],[396,7],[437,6],[524,6],[661,6]]},"333":{"position":[[126,6],[189,6],[287,6],[505,6],[631,6],[707,6],[754,6],[901,7]]},"347":{"position":[[1158,6]]},"349":{"position":[[61,6]]},"361":{"position":[[60,9],[126,9],[279,6],[309,6],[679,6],[743,6],[797,6]]},"363":{"position":[[1656,6]]},"365":{"position":[[61,6]]},"369":{"position":[[11543,7],[11679,7],[11815,9],[12094,6]]},"371":{"position":[[36,9]]},"375":{"position":[[155,6],[6452,6],[12224,7],[12260,6],[18029,6],[18055,6]]},"377":{"position":[[224,6],[256,7]]},"380":{"position":[[369,6]]},"388":{"position":[[125,6]]},"394":{"position":[[49,6],[131,6]]},"400":{"position":[[51,6]]},"408":{"position":[[653,6]]},"418":{"position":[[48,6],[1548,6],[3048,6]]},"420":{"position":[[344,7]]},"422":{"position":[[408,6]]},"428":{"position":[[555,6],[800,6]]},"430":{"position":[[257,6],[471,6],[1167,6]]},"432":{"position":[[111,6]]},"434":{"position":[[61,6]]},"440":{"position":[[1037,6]]},"452":{"position":[[626,7]]},"454":{"position":[[657,6],[2442,6]]},"456":{"position":[[30,6]]},"468":{"position":[[65,7],[217,6],[249,7]]},"470":{"position":[[30,6]]},"472":{"position":[[385,6]]},"480":{"position":[[156,6]]},"488":{"position":[[203,6],[236,6]]},"490":{"position":[[670,6],[832,6],[937,6]]},"492":{"position":[[919,7],[1029,6]]},"494":{"position":[[102,6]]},"498":{"position":[[84,6],[117,6]]},"508":{"position":[[6725,6]]},"510":{"position":[[396,6]]},"512":{"position":[[49,6],[122,7],[149,6],[214,6],[293,6]]},"514":{"position":[[689,7],[799,6],[1450,7]]},"516":{"position":[[102,6]]},"518":{"position":[[599,7]]},"522":{"position":[[78,7],[108,6],[6182,6]]},"528":{"position":[[73,6],[347,6],[410,6],[475,6],[583,6]]},"530":{"position":[[666,7],[776,6]]},"532":{"position":[[102,6]]},"536":{"position":[[443,6]]},"548":{"position":[[292,6],[1191,6]]},"550":{"position":[[778,7],[888,6],[1649,6]]},"552":{"position":[[102,6]]},"554":{"position":[[709,6]]},"566":{"position":[[49,6],[147,6]]},"568":{"position":[[619,7],[729,6]]},"570":{"position":[[102,6]]},"590":{"position":[[1090,7],[1200,6]]},"592":{"position":[[102,6]]},"611":{"position":[[201,7]]},"616":{"position":[[234,6]]},"620":{"position":[[607,6]]},"622":{"position":[[465,6]]},"628":{"position":[[973,6]]},"630":{"position":[[61,6]]},"643":{"position":[[173,7],[423,9],[717,9],[1034,7],[1112,6],[1135,6],[1172,6],[1401,6],[1792,6],[2022,6]]},"647":{"position":[[866,9],[1960,9],[3334,9],[4873,6],[5552,9],[5572,8],[5760,6]]},"649":{"position":[[6048,6],[6905,9],[8000,9],[9375,9],[10916,6],[11597,9],[11617,8]]},"651":{"position":[[161,6]]},"655":{"position":[[176,6],[207,7],[317,6]]},"657":{"position":[[102,6]]},"661":{"position":[[421,6]]},"667":{"position":[[1043,6],[7219,6],[14192,7]]},"671":{"position":[[105,6],[432,6]]},"681":{"position":[[6050,7]]},"683":{"position":[[18919,7]]},"689":{"position":[[49,6],[160,6],[308,6],[407,6],[568,6],[680,6]]},"695":{"position":[[296,6],[402,6],[720,6]]},"703":{"position":[[223,6],[460,6],[2660,6]]},"705":{"position":[[436,6]]},"709":{"position":[[282,6]]},"713":{"position":[[586,6],[864,8]]},"717":{"position":[[307,6],[583,6]]},"721":{"position":[[529,6],[571,6],[625,6],[674,6],[716,6],[771,6],[823,6],[868,6],[926,6]]},"728":{"position":[[93,6],[276,7],[1047,9],[2140,9],[3513,9],[5050,6],[5727,9],[5747,8],[6010,7],[6176,7],[6262,9],[6397,9],[6476,6],[7240,7],[7495,9],[7630,9],[8188,7],[8966,9],[10055,9],[11424,9],[12953,6],[13622,9],[13642,8],[13945,6],[14070,7],[14892,9],[15990,9],[17368,9],[18915,6],[19611,9],[19631,8],[20762,6],[20876,7],[20997,9],[21284,9],[21391,6],[21456,6],[21607,7],[21720,6],[21863,9],[22186,6],[22391,6],[22471,9],[22982,6],[23102,6],[23427,7],[23721,9],[24008,9],[24523,7],[25310,9],[26407,9],[27784,9],[29329,6],[30023,9],[30043,8],[30462,6],[30579,8],[30643,8],[30699,6],[30983,6],[31148,7],[31498,9],[31792,9],[32431,6],[32778,7],[33549,9],[34637,9],[36005,9],[37532,6],[38199,9],[38219,8],[38617,6],[38750,9],[38998,7],[39126,9],[39420,9],[39572,7],[39690,9],[40059,9],[40156,7],[40676,7],[40991,9],[41883,6],[41925,6],[41979,6],[42028,6],[42070,6],[42125,6],[42177,6],[42222,6],[42280,6],[43084,9],[44172,9],[45540,9],[47067,6],[47734,9],[47754,8],[48040,6],[48084,7],[48119,6],[48166,7],[48194,6],[48235,7],[48266,6],[48310,7],[48345,6],[48392,7],[48421,6],[48462,7],[48496,6],[48543,7],[48581,6],[48631,7],[48663,6],[48707,7]]},"734":{"position":[[665,6],[703,6]]},"740":{"position":[[256,6],[322,6],[464,6],[509,6]]},"745":{"position":[[1122,6]]},"749":{"position":[[83,6]]},"751":{"position":[[91,9]]},"757":{"position":[[268,7],[378,6]]},"763":{"position":[[49,6],[182,6],[272,6],[324,6]]},"765":{"position":[[245,6],[294,6],[351,6],[463,6]]},"767":{"position":[[63,6]]},"769":{"position":[[46,6]]},"771":{"position":[[52,6],[101,6],[274,6],[338,6],[18854,6]]},"773":{"position":[[2531,6],[2582,6]]},"775":{"position":[[175,6],[227,6]]},"777":{"position":[[387,6],[2543,6],[2592,6],[2946,6]]},"781":{"position":[[203,6]]},"783":{"position":[[340,6],[439,6],[595,6],[707,6]]},"789":{"position":[[205,6]]},"797":{"position":[[4387,6],[18874,7]]},"805":{"position":[[176,7]]},"807":{"position":[[260,6],[870,6],[999,6]]},"809":{"position":[[654,6],[683,6],[739,7]]},"820":{"position":[[1092,6]]},"826":{"position":[[394,6],[500,6]]},"828":{"position":[[143,6]]},"832":{"position":[[268,7],[378,6]]},"838":{"position":[[355,6]]},"840":{"position":[[643,6]]},"842":{"position":[[255,6],[331,6]]},"844":{"position":[[1328,6]]},"848":{"position":[[1053,6],[1158,6],[1243,6]]}}}],["accident",{"_index":878,"t":{"107":{"position":[[58,12]]},"109":{"position":[[391,10]]}}}],["accomplish",{"_index":1593,"t":{"294":{"position":[[234,10]]},"464":{"position":[[141,12]]}}}],["accord",{"_index":486,"t":{"35":{"position":[[6935,9],[7024,9],[7517,9],[7606,9]]},"45":{"position":[[16774,9],[16863,9],[17099,9],[17188,9],[22968,9],[23057,9],[23293,9],[23382,9],[29476,9],[29565,9],[29837,9],[29926,9]]},"133":{"position":[[3154,9],[3271,9]]},"145":{"position":[[3154,9],[3271,9]]},"200":{"position":[[4700,9],[4789,9],[5234,9],[5323,9]]},"202":{"position":[[4603,9],[4692,9],[4925,9],[5014,9],[10355,9],[10444,9],[10679,9],[10768,9]]},"248":{"position":[[3154,9],[3271,9]]},"265":{"position":[[4863,9],[4952,9],[5175,9],[5264,9]]},"267":{"position":[[4703,9],[4792,9],[5232,9],[5321,9],[10282,9],[10371,9],[10595,9],[10684,9]]},"277":{"position":[[3154,9]]},"285":{"position":[[5892,9],[5981,9],[6210,9],[6299,9],[11800,9],[11889,9],[12332,9],[12421,9],[17570,9],[17659,9],[17892,9],[17981,9],[23180,9],[23269,9],[23504,9],[23593,9]]},"294":{"position":[[4960,9],[5049,9],[5493,9],[5582,9]]},"296":{"position":[[4650,9],[4739,9],[4973,9],[5062,9]]},"311":{"position":[[4771,9],[4860,9],[5296,9],[5385,9],[10358,9],[10447,9],[10884,9],[10973,9],[16968,9],[17057,9]]},"317":{"position":[[524,9]]},"357":{"position":[[4808,9],[4897,9],[5138,9],[5227,9]]},"369":{"position":[[4746,9],[4835,9],[5069,9],[5158,9],[10352,9],[10441,9],[10674,9],[10763,9]]},"375":{"position":[[5203,9],[5292,9],[5742,9],[5831,9],[11041,9],[11130,9],[11364,9],[11453,9],[16855,9],[16944,9],[17178,9],[17267,9]]},"382":{"position":[[5713,9],[5802,9],[6033,9],[6122,9]]},"402":{"position":[[4810,9],[4899,9],[5356,9],[5445,9]]},"404":{"position":[[4708,9],[4797,9],[5038,9],[5127,9],[10549,9],[10638,9],[10880,9],[10969,9]]},"416":{"position":[[57,9]]},"444":{"position":[[5568,9],[5657,9],[6181,9],[6270,9],[11490,9],[11579,9],[11815,9],[11904,9]]},"446":{"position":[[5910,9],[5999,9],[6559,9],[6648,9]]},"448":{"position":[[4584,9],[4673,9],[4909,9],[4998,9]]},"462":{"position":[[4758,9],[4847,9],[5084,9],[5173,9],[10388,9],[10477,9],[10713,9],[10802,9]]},"466":{"position":[[4722,9],[4811,9],[5049,9],[5138,9],[10521,9],[10610,9],[10848,9],[10937,9]]},"484":{"position":[[2435,9]]},"504":{"position":[[4729,9],[4818,9],[5261,9],[5350,9]]},"506":{"position":[[5050,9],[5139,9],[5600,9],[5689,9]]},"508":{"position":[[4781,9],[4870,9],[5111,9],[5200,9]]},"522":{"position":[[5122,9],[5211,9],[5662,9],[5751,9]]},"524":{"position":[[4897,9],[4986,9],[5223,9],[5312,9]]},"540":{"position":[[4746,9],[4835,9],[5280,9],[5369,9]]},"542":{"position":[[5386,9],[5475,9],[5943,9],[6032,9]]},"544":{"position":[[4849,9],[4938,9],[5181,9],[5270,9]]},"562":{"position":[[5588,9],[5677,9],[6183,9],[6272,9],[11416,9],[11505,9],[11739,9],[11828,9],[17411,9],[17500,9],[17734,9],[17823,9],[23105,9],[23194,9],[23430,9],[23519,9],[28727,9],[28816,9],[29051,9],[29140,9]]},"574":{"position":[[5108,9],[5197,9],[5692,9],[5781,9]]},"578":{"position":[[5099,9],[5188,9],[5679,9],[5768,9]]},"580":{"position":[[4839,9],[4928,9],[5372,9],[5461,9]]},"582":{"position":[[4538,9],[4627,9],[4849,9],[4938,9],[10052,9],[10141,9],[10363,9],[10452,9]]},"584":{"position":[[4692,9],[4781,9],[5217,9],[5306,9],[10116,9],[10205,9],[10428,9],[10517,9]]},"599":{"position":[[4737,9],[4826,9],[5058,9],[5147,9]]},"606":{"position":[[5239,9],[5328,9],[5512,9],[5601,9],[11297,9],[11386,9],[11552,9],[11641,9],[17318,9],[17407,9],[17583,9],[17672,9]]},"608":{"position":[[4970,9],[5059,9],[5243,9],[5332,9]]},"613":{"position":[[4898,9],[4987,9],[5210,9],[5299,9],[10810,9],[10899,9],[11122,9],[11211,9]]},"618":{"position":[[5257,9],[5346,9],[5673,9],[5762,9]]},"637":{"position":[[5438,9],[5527,9],[5987,9],[6076,9]]},"639":{"position":[[4727,9],[4816,9],[5060,9],[5149,9]]},"645":{"position":[[5637,9],[5726,9],[6268,9],[6357,9]]},"647":{"position":[[4624,9],[4713,9],[4949,9],[5038,9]]},"649":{"position":[[4985,9],[5074,9],[5540,9],[5629,9],[10667,9],[10756,9],[10993,9],[11082,9],[16312,9],[16401,9],[16641,9],[16730,9]]},"667":{"position":[[5872,9],[5961,9],[6194,9],[6283,9],[12044,9],[12133,9],[12366,9],[12455,9],[18877,9],[18966,9],[19202,9],[19291,9],[25702,9],[25791,9],[26024,9],[26113,9],[31942,9],[32031,9],[32265,9],[32354,9]]},"669":{"position":[[5849,9],[5938,9],[6172,9],[6261,9],[12110,9],[12199,9],[12436,9],[12525,9],[18446,9],[18535,9],[18770,9],[18859,9],[24769,9],[24858,9],[25093,9],[25182,9]]},"679":{"position":[[5567,9],[5656,9],[5891,9],[5980,9],[11181,9],[11270,9],[11504,9],[11593,9]]},"681":{"position":[[4993,9],[5082,9],[5533,9],[5622,9],[10587,9],[10676,9],[10914,9],[11003,9]]},"683":{"position":[[5112,9],[5201,9],[5332,9],[5421,9],[11425,9],[11514,9],[12034,9],[12123,9],[17693,9],[17782,9],[18303,9],[18392,9],[23507,9],[23596,9],[23831,9],[23920,9],[29162,9],[29251,9],[29484,9],[29573,9]]},"703":{"position":[[9622,9],[9711,9],[10166,9],[10255,9]]},"705":{"position":[[6127,9],[6216,9],[6672,9],[6761,9]]},"726":{"position":[[8573,9],[8662,9],[9518,9],[9607,9],[17817,9],[17906,9],[18515,9],[18604,9],[25674,9],[25763,9],[26357,9],[26446,9],[32755,9],[32844,9],[33078,9],[33167,9],[38518,9],[38607,9],[38842,9],[38931,9],[44147,9],[44236,9],[44474,9],[44563,9],[49793,9],[49882,9],[50121,9],[50210,9]]},"728":{"position":[[4801,9],[4890,9],[5125,9],[5214,9],[12704,9],[12793,9],[13024,9],[13113,9],[13885,9],[18657,9],[18746,9],[18986,9],[19075,9],[29071,9],[29160,9],[29399,9],[29488,9],[37283,9],[37372,9],[37602,9],[37691,9],[46818,9],[46907,9],[47137,9],[47226,9]]},"745":{"position":[[6459,9],[6548,9],[7000,9],[7089,9],[12020,9],[12109,9],[12345,9],[12434,9],[17833,9],[17922,9],[18374,9],[18463,9],[23351,9],[23440,9],[23676,9],[23765,9],[28981,9],[29070,9],[29307,9],[29396,9],[36711,9],[36800,9],[37036,9],[37125,9],[42337,9],[42426,9],[42662,9],[42751,9]]},"747":{"position":[[7981,9],[8070,9],[8623,9],[8712,9],[14187,9],[14276,9],[14514,9],[14603,9]]},"749":{"position":[[5029,9],[5118,9],[5594,9],[5683,9],[11397,9],[11486,9],[11941,9],[12030,9],[16942,9],[17031,9],[17267,9],[17356,9]]},"751":{"position":[[8045,9],[8134,9],[8669,9],[8758,9],[14407,9],[14496,9],[14736,9],[14825,9],[22036,9],[22125,9],[22599,9],[22688,9]]},"771":{"position":[[5141,9],[5230,9],[5681,9],[5770,9],[10805,9],[10894,9],[11349,9],[11438,9],[17219,9],[17308,9],[17904,9],[17993,9],[23584,9],[23673,9],[23908,9],[23997,9],[29275,9],[29364,9],[29597,9],[29686,9]]},"773":{"position":[[8596,9],[8685,9],[9333,9],[9422,9],[14924,9],[15013,9],[15251,9],[15340,9]]},"775":{"position":[[7895,9],[7984,9],[8522,9],[8611,9],[15358,9],[15447,9],[16178,9],[16267,9],[22084,9],[22173,9],[22405,9],[22494,9]]},"777":{"position":[[8417,9],[8506,9],[9105,9],[9194,9],[14796,9],[14885,9],[15122,9],[15211,9]]},"789":{"position":[[9545,9],[9634,9],[10328,9],[10417,9]]},"795":{"position":[[4920,9],[5009,9],[5240,9],[5329,9],[10624,9],[10713,9],[10948,9],[11037,9],[16711,9],[16800,9],[17257,9],[17346,9],[22247,9],[22336,9],[22568,9],[22657,9]]},"797":{"position":[[9019,9],[9108,9],[9335,9],[9424,9],[16846,9],[16935,9],[17591,9],[17680,9],[24331,9],[24420,9],[24943,9],[25032,9],[30322,9],[30411,9],[30642,9],[30731,9]]},"799":{"position":[[6750,9],[6839,9],[7363,9],[7452,9],[13763,9],[13852,9],[14181,9],[14270,9],[20693,9],[20782,9],[21112,9],[21201,9]]},"801":{"position":[[15921,9],[16010,9],[17403,9],[17492,9]]},"820":{"position":[[6472,9],[6561,9],[7016,9],[7105,9],[12057,9],[12146,9],[12385,9],[12474,9],[17876,9],[17965,9],[18416,9],[18505,9],[23387,9],[23476,9],[23711,9],[23800,9],[29013,9],[29102,9],[29339,9],[29428,9],[36227,9],[36316,9],[36551,9],[36640,9],[41849,9],[41938,9],[42174,9],[42263,9]]},"822":{"position":[[8258,9],[8347,9],[8999,9],[9088,9],[14865,9],[14954,9],[15193,9],[15282,9]]},"824":{"position":[[7449,9],[7538,9],[8079,9],[8168,9],[13790,9],[13879,9],[14121,9],[14210,9]]},"826":{"position":[[9092,9],[9181,9],[9810,9],[9899,9],[15464,9],[15553,9],[15796,9],[15885,9],[21230,9],[21319,9],[21564,9],[21653,9],[26935,9],[27024,9],[27271,9],[27360,9],[32719,9],[32808,9],[33053,9],[33142,9],[38416,9],[38505,9],[38750,9],[38839,9]]},"844":{"position":[[6933,9],[7022,9],[7479,9],[7568,9],[12576,9],[12665,9],[12906,9],[12995,9],[18644,9],[18733,9],[19190,9],[19279,9],[24244,9],[24333,9],[24574,9],[24663,9],[30015,9],[30104,9],[30352,9],[30441,9],[37638,9],[37727,9],[38333,9],[38422,9],[43948,9],[44037,9],[44278,9],[44367,9]]},"846":{"position":[[4640,9],[4729,9],[4965,9],[5054,9],[11918,9],[12007,9],[12242,9],[12331,9]]},"848":{"position":[[12581,9],[12670,9],[13343,9],[13432,9],[19654,9],[19743,9],[20208,9],[20297,9],[26352,9],[26441,9],[26956,9],[27045,9],[32847,9],[32936,9],[33473,9],[33562,9],[39024,9],[39113,9],[39594,9],[39683,9],[44843,9],[44932,9],[45396,9],[45485,9],[50561,9],[50650,9],[50883,9],[50972,9],[56292,9],[56381,9],[56629,9],[56718,9]]}}}],["accordingli",{"_index":2000,"t":{"484":{"position":[[3970,12]]},"728":{"position":[[23015,11]]}}}],["account",{"_index":1783,"t":{"418":{"position":[[1535,8],[1605,10]]},"608":{"position":[[175,8]]},"626":{"position":[[612,7]]},"689":{"position":[[584,7]]},"707":{"position":[[10546,8]]},"783":{"position":[[611,7]]},"789":{"position":[[160,7],[225,7],[281,7],[334,7],[616,7],[835,8],[844,9],[883,7],[1155,10],[1871,10],[1972,9],[2079,10],[2135,9],[2207,7],[2285,7],[2357,7],[2405,7],[3316,7],[3476,7],[3631,7],[3763,7],[3789,7],[3857,10],[4955,7],[5174,7],[5388,7],[5579,7],[5605,7],[7147,7],[7317,7],[7482,7],[7624,7],[7650,7],[7726,10],[8866,7],[9035,7],[9199,7],[9340,7],[9366,7],[10968,7],[11013,7],[11177,7],[11336,7],[11472,7],[11498,7]]},"793":{"position":[[223,7],[235,7],[280,7]]},"795":{"position":[[170,7],[194,7],[239,7],[361,7],[383,7],[6098,8],[11767,7],[12555,7],[13734,7],[15289,7],[16518,7],[17563,7]]},"797":{"position":[[894,8],[1029,8],[2349,9],[2751,7],[2803,7],[3085,10],[4176,9]]},"801":{"position":[[342,7],[648,8],[657,9],[696,7],[1687,10],[2692,10],[2793,9],[2900,10],[2956,9],[4044,7],[4204,7],[4359,7],[4491,7],[4517,7],[4585,10],[6939,7],[7158,7],[7372,7],[7563,7],[7589,7],[10859,7],[11029,7],[11194,7],[11336,7],[11362,7],[11438,10],[13914,7],[14083,7],[14247,7],[14388,7],[14414,7],[18043,7],[19163,7],[19327,7],[19486,7],[19622,7],[19648,7],[21448,8],[21610,8]]},"803":{"position":[[555,7],[861,8],[870,9],[909,7],[2154,10],[3159,10],[3260,9],[3367,10],[3423,9]]}}}],["account:check",{"_index":2664,"t":{"789":{"position":[[3550,17],[3726,17],[3823,17],[7400,17],[7586,17],[7691,17],[10717,16],[10844,16],[10947,16]]},"801":{"position":[[4278,17],[4454,17],[4551,17],[11112,17],[11298,17],[11403,17],[17792,16],[17919,16],[18022,16]]}}}],["account_manag",{"_index":2657,"t":{"789":{"position":[[587,16],[665,16],[682,15],[761,15],[995,18],[1061,18],[1207,18],[1347,17],[1548,17],[3387,18],[7226,18],[10579,15]]},"795":{"position":[[12626,18],[15368,18],[17508,15]]},"797":{"position":[[1328,16],[1570,18],[2075,18],[2418,17],[2852,16],[2869,15],[2952,15],[3137,18],[3277,17],[3436,17]]},"801":{"position":[[130,16],[391,16],[408,15],[491,15],[904,18],[1409,18],[1739,18],[1879,17],[2038,17],[4115,18],[10938,18],[17654,15]]},"803":{"position":[[343,16],[604,16],[621,15],[704,15],[1304,18],[1876,18],[2206,18],[2346,17],[2505,17]]}}}],["account_manager_view",{"_index":2721,"t":{"797":{"position":[[2369,24],[2560,22],[2668,24],[2928,23],[3028,22],[3330,25],[3760,24]]},"801":{"position":[[467,23],[567,22],[1932,25],[2362,24]]},"803":{"position":[[680,23],[780,22],[2399,25],[2829,24]]}}}],["achiev",{"_index":1980,"t":{"482":{"position":[[7219,7],[8400,7],[8878,7],[9249,7]]},"643":{"position":[[1186,8]]},"749":{"position":[[210,7]]}}}],["action",{"_index":290,"t":{"17":{"position":[[146,6]]},"317":{"position":[[638,7]]},"452":{"position":[[114,7],[469,7]]},"472":{"position":[[594,6],[781,6],[855,6],[1158,6]]},"474":{"position":[[106,6],[153,7]]},"476":{"position":[[50,6],[75,7],[1229,6],[1236,8]]},"478":{"position":[[245,6],[252,8],[4406,6],[4436,6]]},"480":{"position":[[555,6],[574,8],[593,8]]},"482":{"position":[[252,6]]},"484":{"position":[[283,6],[511,6],[1576,6]]},"560":{"position":[[512,7]]},"693":{"position":[[921,8]]},"695":{"position":[[637,8]]},"705":{"position":[[12600,6]]},"709":{"position":[[205,8]]},"755":{"position":[[184,6]]},"761":{"position":[[272,6]]},"769":{"position":[[241,6],[354,7],[383,7]]},"773":{"position":[[75,7],[2786,7]]},"777":{"position":[[92,7]]},"787":{"position":[[923,8]]},"805":{"position":[[324,8]]},"842":{"position":[[93,6]]}}}],["actual",{"_index":1774,"t":{"416":{"position":[[584,8]]}}}],["ad",{"_index":307,"t":{"19":{"position":[[278,5]]},"41":{"position":[[117,6]]},"45":{"position":[[30876,5]]},"75":{"position":[[41,5]]},"85":{"position":[[451,5],[664,5]]},"171":{"position":[[1142,5]]},"189":{"position":[[102,6]]},"265":{"position":[[249,5]]},"271":{"position":[[220,5],[332,6]]},"273":{"position":[[246,5],[568,5],[1436,5]]},"283":{"position":[[77,6]]},"285":{"position":[[7015,6]]},"375":{"position":[[320,6],[6313,5]]},"402":{"position":[[124,6]]},"404":{"position":[[32,5]]},"408":{"position":[[411,6],[445,6],[964,5]]},"444":{"position":[[11,5],[176,6]]},"452":{"position":[[547,6]]},"476":{"position":[[2606,5]]},"478":{"position":[[1646,5],[3488,5]]},"480":{"position":[[1978,5]]},"482":{"position":[[963,5]]},"486":{"position":[[74,6]]},"524":{"position":[[37,6],[205,6]]},"528":{"position":[[120,6]]},"556":{"position":[[180,6],[354,6]]},"560":{"position":[[173,6]]},"576":{"position":[[935,5],[986,5]]},"578":{"position":[[87,6]]},"626":{"position":[[388,5]]},"639":{"position":[[32,5]]},"663":{"position":[[81,6]]},"693":{"position":[[479,5]]},"699":{"position":[[339,6]]},"703":{"position":[[610,6]]},"726":{"position":[[28172,6]]},"728":{"position":[[6496,5],[8066,6],[22269,6],[22846,5],[38682,6],[39984,5]]},"747":{"position":[[56,6],[2302,6]]},"749":{"position":[[257,6]]},"751":{"position":[[726,6],[2831,5],[16534,5]]},"771":{"position":[[18774,6]]},"773":{"position":[[2720,6]]},"775":{"position":[[17369,5]]},"777":{"position":[[2977,6]]},"781":{"position":[[4,6]]},"787":{"position":[[480,5]]},"797":{"position":[[10190,5],[18762,5]]},"799":{"position":[[930,6]]},"824":{"position":[[1806,5],[1891,6],[15961,5]]},"848":{"position":[[1577,6],[21694,5],[22985,5],[24711,5],[26062,5],[27392,5],[45873,5]]},"852":{"position":[[4,6],[80,6]]}}}],["add",{"_index":205,"t":{"9":{"position":[[223,3]]},"45":{"position":[[31940,3]]},"113":{"position":[[188,3],[916,3],[1630,3]]},"117":{"position":[[204,3]]},"125":{"position":[[22,3]]},"169":{"position":[[427,3]]},"171":{"position":[[1879,3]]},"173":{"position":[[3120,3]]},"191":{"position":[[989,3]]},"193":{"position":[[24,3]]},"198":{"position":[[166,3]]},"246":{"position":[[24,3]]},"250":{"position":[[3,3]]},"265":{"position":[[103,3]]},"279":{"position":[[3407,3]]},"283":{"position":[[597,3],[649,3]]},"285":{"position":[[24326,3]]},"287":{"position":[[24,3]]},"311":{"position":[[17,3]]},"347":{"position":[[1121,3]]},"349":{"position":[[24,3]]},"363":{"position":[[1619,3]]},"365":{"position":[[24,3]]},"371":{"position":[[128,3],[927,3]]},"375":{"position":[[39,3]]},"388":{"position":[[82,3],[139,3]]},"402":{"position":[[7,3]]},"410":{"position":[[65,3],[217,3]]},"414":{"position":[[405,3]]},"416":{"position":[[892,3],[3020,3],[3293,3]]},"418":{"position":[[2609,3],[3335,3],[3501,3]]},"430":{"position":[[1130,3]]},"434":{"position":[[24,3]]},"440":{"position":[[1154,3]]},"442":{"position":[[1161,3]]},"462":{"position":[[11706,3]]},"464":{"position":[[21,3]]},"468":{"position":[[114,3]]},"478":{"position":[[2006,3],[3827,3],[3868,3]]},"512":{"position":[[245,3]]},"528":{"position":[[36,3]]},"536":{"position":[[330,3]]},"546":{"position":[[109,3]]},"548":{"position":[[1590,3]]},"560":{"position":[[405,3],[449,3]]},"562":{"position":[[1067,3],[1167,3],[2315,3],[2474,3],[3998,3],[4108,3],[5306,3],[5415,3],[6574,3],[6678,3],[12838,3],[18555,3]]},"574":{"position":[[171,3],[6287,3],[6339,3]]},"578":{"position":[[24,3]]},"580":{"position":[[110,3],[155,3]]},"628":{"position":[[936,3]]},"630":{"position":[[24,3]]},"645":{"position":[[45,3]]},"681":{"position":[[134,3]]},"703":{"position":[[44,3],[407,3],[2439,3]]},"724":{"position":[[132,3]]},"726":{"position":[[12,3]]},"728":{"position":[[6085,3],[22378,3],[30779,3]]},"747":{"position":[[230,3],[289,3],[725,3],[2235,3]]},"749":{"position":[[6437,3]]},"751":{"position":[[854,3]]},"757":{"position":[[1063,3]]},"771":{"position":[[458,3],[6103,3],[11794,3]]},"773":{"position":[[22,3],[2859,3]]},"775":{"position":[[9299,3]]},"777":{"position":[[2854,3]]},"781":{"position":[[51,3]]},"797":{"position":[[44,3],[104,3],[792,3],[918,3],[1053,3],[2365,3],[4186,3],[10098,3],[10286,3],[18823,3]]},"809":{"position":[[771,3]]},"822":{"position":[[208,3],[265,3],[2027,3]]},"824":{"position":[[378,3]]},"826":{"position":[[2766,3]]},"848":{"position":[[6664,3]]},"852":{"position":[[255,3]]}}}],["add/view",{"_index":2063,"t":{"548":{"position":[[508,8]]},"560":{"position":[[680,8]]}}}],["addit",{"_index":188,"t":{"7":{"position":[[542,10]]},"45":{"position":[[32136,9]]},"191":{"position":[[896,9]]},"258":{"position":[[581,9]]},"302":{"position":[[1088,9]]},"347":{"position":[[1028,9]]},"363":{"position":[[1526,9]]},"396":{"position":[[724,9]]},"430":{"position":[[1029,9]]},"454":{"position":[[2334,9]]},"492":{"position":[[865,9]]},"508":{"position":[[69,8]]},"514":{"position":[[635,9]]},"530":{"position":[[612,9]]},"550":{"position":[[724,9]]},"568":{"position":[[565,9]]},"590":{"position":[[1036,9]]},"624":{"position":[[15,10]]},"628":{"position":[[843,9]]},"747":{"position":[[684,9]]},"751":{"position":[[641,8]]},"822":{"position":[[320,9]]}}}],["addition",{"_index":1054,"t":{"155":{"position":[[1700,12]]},"795":{"position":[[11725,13]]}}}],["addr",{"_index":1438,"t":{"218":{"position":[[524,4],[661,4]]},"226":{"position":[[311,4]]}}}],["addr=0.0.0.0:2114",{"_index":1489,"t":{"226":{"position":[[401,17]]}}}],["address",{"_index":54,"t":{"3":{"position":[[833,9]]},"5":{"position":[[216,8]]},"9":{"position":[[6,7]]},"226":{"position":[[77,7],[272,8]]},"228":{"position":[[234,7],[276,7]]},"333":{"position":[[1090,8]]},"689":{"position":[[524,8]]},"773":{"position":[[500,7]]},"783":{"position":[[193,8],[551,8]]},"793":{"position":[[361,7]]},"797":{"position":[[60,7],[173,7],[481,7],[539,7],[978,7],[1390,7],[2231,7],[4324,7],[4464,7],[10161,7],[11390,7],[11453,7],[13055,7],[13134,7],[14998,7],[15068,7],[16613,7],[16673,7],[17415,7],[18099,7],[18526,7],[18590,7],[18797,7],[19644,7],[19709,7],[20946,7],[21065,7],[22683,7],[22757,7],[24045,7],[24105,7],[24769,7],[25202,7],[25401,7],[25469,7]]},"799":{"position":[[215,8],[1024,7],[1869,7],[1934,7],[3226,7],[3345,7],[5018,7],[5092,7],[6436,7],[6496,7],[7189,7],[7584,7],[7773,7],[7841,7],[8450,7],[9388,7],[10662,7],[12233,7],[13560,7],[14074,7],[14763,7],[15172,7],[15376,7],[16314,7],[17589,7],[19161,7],[20489,7],[21004,7],[21694,7],[22104,7]]},"801":{"position":[[192,7],[756,7],[1565,7],[3158,7],[5719,7],[5782,7],[9263,7],[9342,7],[12644,7],[12714,7],[15688,7],[15748,7],[17227,7],[19071,7],[20882,7],[20946,7]]},"803":{"position":[[405,7],[969,7],[2032,7],[3625,7]]}}}],["adjust",{"_index":1482,"t":{"224":{"position":[[375,6]]},"228":{"position":[[780,6]]}}}],["admin",{"_index":1681,"t":{"359":{"position":[[239,6]]},"490":{"position":[[764,5],[826,5]]},"548":{"position":[[801,5]]},"564":{"position":[[354,6]]},"568":{"position":[[235,5],[313,6],[429,8],[485,8]]},"574":{"position":[[51,5],[949,8],[1008,8],[3720,8],[3789,8],[5943,5],[6048,5],[6297,5]]},"576":{"position":[[138,6],[344,8],[662,8],[1052,5],[1096,5],[1321,5]]},"580":{"position":[[73,5]]},"582":{"position":[[32,5],[837,8],[1917,8],[3277,8],[4788,5],[5440,8],[5459,7],[6351,8],[7431,8],[8791,8],[10302,5],[10954,8],[10973,7]]},"584":{"position":[[56,5],[5630,5],[6411,8],[7492,8],[8853,8],[10366,5],[11020,8],[11039,7]]},"695":{"position":[[631,5]]},"732":{"position":[[402,6],[1170,5],[1208,5]]},"734":{"position":[[659,5],[697,5]]},"740":{"position":[[165,7],[296,6],[458,5],[503,5]]},"742":{"position":[[340,6],[362,6],[568,6]]},"745":{"position":[[438,6],[663,8],[1000,8],[30540,5],[30553,6],[31079,7],[31098,8],[31435,8]]},"747":{"position":[[1014,5],[1027,6],[1566,7],[1585,8],[2090,8],[2269,5],[3235,6],[3314,8],[4643,6],[6378,6],[6465,8],[7786,6],[9023,5],[9244,6],[10424,8],[11520,8],[12896,8],[14439,5],[15125,8],[15144,7]]},"749":{"position":[[6496,6],[13185,8],[14279,8],[15653,8],[17192,5],[17872,8],[17891,7]]},"751":{"position":[[1512,5],[1525,6],[2073,7],[2092,8],[2622,8],[9529,6],[9568,5],[9619,5],[10633,8],[11731,8],[13109,8],[14656,5],[15343,8],[15362,7],[15674,6],[15804,8],[16002,8],[16194,5],[16264,9],[16334,7],[16358,6],[23176,6],[23227,5],[23307,5],[23807,8],[23911,7],[24058,7],[25319,8]]},"757":{"position":[[616,6],[1013,6]]},"763":{"position":[[105,6],[377,7]]},"765":{"position":[[283,5],[452,5]]},"769":{"position":[[102,6],[318,5]]},"771":{"position":[[90,5],[177,6]]},"773":{"position":[[179,6],[2570,6],[2650,6]]},"775":{"position":[[291,6],[2753,5],[9291,7]]},"803":{"position":[[280,6],[1115,8],[1171,8]]},"830":{"position":[[474,6],[536,6]]},"838":{"position":[[482,6],[528,6],[906,6],[1162,6]]},"840":{"position":[[297,5],[391,5]]},"842":{"position":[[631,5],[683,5],[1780,5],[1810,5]]},"844":{"position":[[2786,5],[3964,5],[5518,5],[6746,5],[7790,5],[31240,5],[32337,5],[33765,5],[35687,5],[37185,5],[38889,5]]}}}],["administ",{"_index":658,"t":{"45":{"position":[[5509,10]]},"566":{"position":[[322,11]]}}}],["administr",{"_index":1841,"t":{"440":{"position":[[391,13],[886,13]]},"838":{"position":[[315,14],[410,14],[566,13],[632,14],[847,14]]}}}],["advanc",{"_index":759,"t":{"45":{"position":[[32278,8]]},"87":{"position":[[2219,8]]},"89":{"position":[[3491,8],[3524,8],[3555,8]]},"91":{"position":[[1607,8]]},"171":{"position":[[1864,8]]},"173":{"position":[[3105,8]]},"333":{"position":[[1437,8],[1464,8]]},"335":{"position":[[26,8]]},"641":{"position":[[38,8]]},"645":{"position":[[930,8],[2317,8],[4031,8],[5418,8],[6833,8]]},"649":{"position":[[804,8],[1988,8],[3548,8],[4783,8],[5813,8]]},"651":{"position":[[89,8]]}}}],["advantag",{"_index":145,"t":{"5":{"position":[[68,9]]},"29":{"position":[[955,9]]},"238":{"position":[[238,11]]},"548":{"position":[[992,10]]}}}],["affect",{"_index":629,"t":{"45":{"position":[[3768,6],[3920,6],[8594,6]]},"420":{"position":[[672,6]]},"424":{"position":[[224,8]]},"430":{"position":[[1322,6]]},"436":{"position":[[80,6]]},"490":{"position":[[123,6]]},"548":{"position":[[1340,9]]},"667":{"position":[[992,7]]},"669":{"position":[[980,7],[19875,8]]},"693":{"position":[[723,6]]},"713":{"position":[[382,6]]},"734":{"position":[[551,6]]},"787":{"position":[[725,6]]},"805":{"position":[[162,6]]},"809":{"position":[[551,6]]}}}],["aforement",{"_index":1981,"t":{"482":{"position":[[8054,14]]},"749":{"position":[[222,14]]}}}],["afternoon",{"_index":549,"t":{"39":{"position":[[763,11]]}}}],["again",{"_index":2473,"t":{"728":{"position":[[8196,6],[24531,6]]}}}],["against",{"_index":357,"t":{"29":{"position":[[643,7],[766,7]]},"109":{"position":[[255,7]]},"327":{"position":[[2697,7],[3673,7]]},"408":{"position":[[1179,7]]},"424":{"position":[[491,7]]}}}],["agenda",{"_index":512,"t":{"39":{"position":[[97,6]]}}}],["aggress",{"_index":1028,"t":{"155":{"position":[[450,10]]}}}],["aguiar",{"_index":528,"t":{"39":{"position":[[320,6]]}}}],["ahead",{"_index":901,"t":{"109":{"position":[[679,5]]}}}],["algorithm",{"_index":1126,"t":{"171":{"position":[[557,10]]}}}],["alic",{"_index":2040,"t":{"540":{"position":[[95,5]]},"544":{"position":[[55,5],[225,5],[6015,5],[6120,5]]},"562":{"position":[[314,5],[1171,5],[2478,5],[4112,5],[5419,5],[6682,5],[18529,5],[29828,5],[29918,5]]}}}],["all_objects_view",{"_index":2476,"t":{"728":{"position":[[19981,18],[20152,20],[20429,18],[20627,18]]}}}],["allot",{"_index":2189,"t":{"620":{"position":[[58,8]]}}}],["allow",{"_index":27,"t":{"3":{"position":[[392,7],[1113,5],[2075,7],[2154,7],[2233,7]]},"5":{"position":[[180,5],[292,5]]},"7":{"position":[[525,6],[581,6]]},"23":{"position":[[6,6]]},"45":{"position":[[2825,5],[5803,6],[6328,6],[8354,7],[9173,5],[9641,5],[10000,6],[10289,6],[10395,6],[10405,7],[11196,6],[12951,7],[13125,7],[14255,8],[18232,10],[18287,10],[19145,7],[19319,7],[20449,8]]},"69":{"position":[[174,6],[463,6]]},"83":{"position":[[3859,6]]},"85":{"position":[[78,6]]},"87":{"position":[[1236,6]]},"89":{"position":[[2972,5],[3088,5]]},"91":{"position":[[1467,11]]},"93":{"position":[[1444,11]]},"95":{"position":[[1479,11]]},"109":{"position":[[596,5]]},"113":{"position":[[1636,5]]},"117":{"position":[[210,5]]},"135":{"position":[[134,7],[298,7],[610,8],[1650,7]]},"153":{"position":[[154,6]]},"155":{"position":[[2155,5],[2335,7],[2587,5],[2807,7]]},"169":{"position":[[262,6]]},"171":{"position":[[137,6]]},"173":{"position":[[1358,7],[1473,10]]},"202":{"position":[[792,7],[963,7],[2090,8],[6536,7],[6708,7],[7837,8]]},"216":{"position":[[48,8]]},"238":{"position":[[364,6]]},"265":{"position":[[1092,7],[1253,7],[2370,8]]},"267":{"position":[[6507,7],[6668,7],[7786,8]]},"279":{"position":[[3267,7]]},"285":{"position":[[2097,7],[2263,7],[3386,8],[13759,7],[13930,7],[15057,8],[19361,7],[19533,7],[20662,8]]},"296":{"position":[[117,10],[835,7],[1006,7],[2134,8]]},"311":{"position":[[11341,6]]},"345":{"position":[[436,6]]},"357":{"position":[[965,7],[1144,7],[2279,8]]},"369":{"position":[[931,7],[1103,7],[2231,8],[6541,7],[6712,7],[7839,8],[11767,5]]},"371":{"position":[[3,5],[75,5]]},"375":{"position":[[7226,7],[7397,7],[8525,8],[13040,7],[13212,7],[14340,8]]},"380":{"position":[[245,8]]},"382":{"position":[[1910,7],[2079,7],[3204,8]]},"404":{"position":[[865,7],[1044,7],[2179,8],[6702,7],[6881,7],[8017,8]]},"408":{"position":[[1207,6]]},"416":{"position":[[1061,5],[3331,7]]},"418":{"position":[[600,5],[3384,6]]},"422":{"position":[[18,5],[364,5]]},"428":{"position":[[143,5]]},"430":{"position":[[436,6]]},"440":{"position":[[453,6],[534,6],[618,6],[709,6]]},"444":{"position":[[7667,7],[7841,7],[8971,8]]},"448":{"position":[[761,7],[935,7],[2065,8]]},"452":{"position":[[88,8],[182,7]]},"462":{"position":[[931,7],[1106,7],[2237,8],[6565,7],[6739,7],[7869,8],[11738,5]]},"466":{"position":[[891,7],[1067,7],[2199,8],[6690,7],[6865,7],[7997,8]]},"482":{"position":[[3033,6]]},"498":{"position":[[267,5]]},"500":{"position":[[3,5],[134,5]]},"502":{"position":[[3,5]]},"508":{"position":[[938,7],[1117,7],[2252,8]]},"512":{"position":[[156,6]]},"524":{"position":[[121,10],[1070,7],[1245,7],[2376,8]]},"544":{"position":[[998,7],[1179,7],[2316,8]]},"548":{"position":[[276,6],[1139,6]]},"550":{"position":[[1659,7]]},"554":{"position":[[719,7]]},"560":{"position":[[585,5]]},"562":{"position":[[6862,7],[7601,7],[7773,7],[8901,8],[12827,7],[13596,7],[13767,7],[14895,8],[18535,7],[19282,7],[19456,7],[20586,8],[24908,7],[25081,7],[26210,8]]},"566":{"position":[[219,6]]},"582":{"position":[[771,7],[931,7],[2047,8],[6285,7],[6445,7],[7561,8]]},"584":{"position":[[6345,7],[6505,7],[7622,8]]},"599":{"position":[[930,7],[1100,7],[2226,8]]},"635":{"position":[[114,5]]},"639":{"position":[[872,7],[1054,7],[2192,8]]},"641":{"position":[[105,5]]},"643":{"position":[[1067,6],[1969,6]]},"647":{"position":[[801,7],[975,7],[2105,8],[5749,7]]},"649":{"position":[[6840,7],[7014,7],[8145,8],[12473,7],[12651,7],[13785,8]]},"655":{"position":[[1049,5]]},"659":{"position":[[680,5]]},"663":{"position":[[1293,5],[1334,6],[1455,6]]},"667":{"position":[[1344,11],[2061,7],[2232,7],[3359,8],[7108,7],[7516,11],[8233,7],[8404,7],[9531,8],[13297,7],[14337,11],[15054,7],[15228,7],[16358,8],[20194,7],[21174,11],[21891,7],[22062,7],[23189,8],[27410,11],[28127,7],[28299,7],[29427,8]]},"669":{"position":[[1316,11],[2034,7],[2205,7],[3333,8],[7104,7],[7565,11],[8283,7],[8457,7],[9588,8],[13381,7],[13909,11],[14627,7],[14799,7],[15928,8],[19769,7],[20233,11],[20950,7],[21123,7],[22252,8]]},"679":{"position":[[1748,7],[1921,7],[3050,8],[7366,7],[7538,7],[8666,8]]},"681":{"position":[[6756,7],[6932,7],[8064,8]]},"683":{"position":[[19688,7],[19861,7],[20990,8],[25351,7],[25521,7],[26648,8]]},"693":{"position":[[887,8]]},"701":{"position":[[295,7],[460,7],[773,8],[2126,7],[2293,7],[2608,8],[3985,7],[4150,7],[4463,8],[5821,7],[5988,7],[6304,8],[7678,7],[7843,7],[8157,8],[9521,7],[9688,7],[10004,8]]},"703":{"position":[[2873,7],[3038,7],[3352,8],[10763,7],[10928,7],[11241,8]]},"705":{"position":[[7317,7],[7581,7],[8011,8],[9988,7],[10252,7],[10683,8],[12607,7]]},"726":{"position":[[28940,7],[29112,7],[30240,8],[34699,7],[34871,7],[36000,8],[40316,7],[40492,7],[41624,8],[45958,7],[46135,7],[47268,8]]},"728":{"position":[[982,7],[1150,7],[2279,8],[6813,6],[7086,6],[8901,7],[9069,7],[10194,8],[14818,7],[14995,7],[16129,8],[22153,5],[25236,7],[25413,7],[26546,8],[33484,7],[33652,7],[34776,8],[38599,8],[43019,7],[43187,7],[44311,8]]},"734":{"position":[[354,5]]},"745":{"position":[[8197,7],[8371,7],[9501,8],[19528,7],[19702,7],[20832,8],[25154,7],[25328,7],[26459,8],[32888,7],[33062,7],[34192,8],[38514,7],[38688,7],[39818,8]]},"747":{"position":[[10356,7],[10532,7],[11664,8]]},"749":{"position":[[6214,6],[13119,7],[13293,7],[14423,8]]},"751":{"position":[[10568,7],[10741,7],[11875,8]]},"757":{"position":[[505,5]]},"771":{"position":[[19765,7],[19938,7],[21067,8],[25464,7],[25634,7],[26761,8]]},"773":{"position":[[553,6],[11093,7],[11269,7],[12401,8]]},"775":{"position":[[18277,7],[18447,7],[19573,8]]},"777":{"position":[[10969,7],[11143,7],[12274,8]]},"787":{"position":[[889,8]]},"795":{"position":[[1117,7],[1286,7],[2411,8],[6805,7],[6978,7],[8107,8],[18440,7],[18609,7],[19735,8]]},"797":{"position":[[2723,7],[5232,7],[5396,7],[6517,8],[18772,7],[26519,7],[26688,7],[27813,8]]},"799":{"position":[[461,5],[8439,7],[9214,7],[9552,7],[10865,8],[16140,7],[16478,7],[17792,8]]},"809":{"position":[[354,5]]},"820":{"position":[[8222,7],[8399,7],[9532,8],[19568,7],[19741,7],[20870,8],[25186,7],[25360,7],[26491,8],[32408,7],[32581,7],[33710,8],[38026,7],[38200,7],[39330,8]]},"822":{"position":[[13,6],[350,5],[11030,7],[11207,7],[12340,8]]},"824":{"position":[[9943,7],[10118,7],[11254,8]]},"826":{"position":[[33,6],[483,5],[11613,7],[11794,7],[12931,8],[17371,7],[17553,7],[18692,8],[23068,7],[23253,7],[24394,8],[28860,7],[29042,7],[30181,8],[34557,7],[34739,7],[35878,8]]},"832":{"position":[[505,5]]},"838":{"position":[[1246,7]]},"844":{"position":[[8733,7],[8912,7],[10047,8],[20401,7],[20580,7],[21715,8],[26144,7],[26329,7],[27471,8],[40105,7],[40284,7],[41419,8]]},"846":{"position":[[817,7],[990,7],[2120,8],[8099,7],[8272,7],[9401,8]]},"848":{"position":[[46750,7],[46920,7],[48047,8],[52421,7],[52607,7],[53749,8]]}}}],["allowed\":fals",{"_index":1317,"t":{"202":{"position":[[10642,17],[11192,17]]},"267":{"position":[[10558,17],[11097,17]]},"285":{"position":[[1317,17],[6173,17],[6717,17],[12938,17],[23467,17],[24017,17]]},"296":{"position":[[4936,17],[5485,17]]},"375":{"position":[[11327,17],[11876,17]]},"404":{"position":[[10843,17],[11400,17]]},"466":{"position":[[10811,17],[11364,17]]},"562":{"position":[[17697,17],[18246,17]]},"584":{"position":[[10391,17],[10929,17]]},"649":{"position":[[10956,17],[11508,17]]},"669":{"position":[[6135,17],[6684,17],[12399,17],[12951,17],[18733,17],[19283,17]]},"683":{"position":[[29447,17],[29995,17]]},"701":{"position":[[6963,17],[7330,17],[8810,17],[9175,17],[10663,17],[11030,17]]},"703":{"position":[[4005,17],[4370,17]]},"705":{"position":[[9903,18],[11637,17],[12115,17]]},"726":{"position":[[38805,17],[39355,17]]},"728":{"position":[[12987,17],[13533,17],[18949,17],[19504,17]]},"745":{"position":[[29270,17],[29822,17]]},"771":{"position":[[29560,17],[30108,17]]},"777":{"position":[[15085,17],[15637,17]]},"795":{"position":[[22531,17],[23078,17]]},"797":{"position":[[9298,17],[9840,17]]},"799":{"position":[[15423,18],[21075,17],[21803,17]]},"820":{"position":[[29302,17],[29854,17]]},"826":{"position":[[21527,17],[22087,17],[33016,17],[33576,17],[38713,17],[39273,17]]},"844":{"position":[[30315,17],[30878,17]]},"846":{"position":[[4928,17],[5479,17]]},"848":{"position":[[50846,17],[51394,17]]}}}],["allowed\":tru",{"_index":720,"t":{"45":{"position":[[17063,16],[17614,16],[23257,16],[23808,16]]},"135":{"position":[[1257,16],[1620,16]]},"202":{"position":[[4889,16],[5437,16]]},"265":{"position":[[5139,16],[5677,16]]},"285":{"position":[[12826,16],[17856,16],[18404,16]]},"357":{"position":[[5102,16],[5658,16]]},"369":{"position":[[96,16],[5033,16],[5582,16],[10638,16],[11186,16]]},"375":{"position":[[17142,16],[17691,16]]},"382":{"position":[[5997,16],[6543,16]]},"404":{"position":[[5002,16],[5558,16]]},"444":{"position":[[11779,16],[12330,16]]},"448":{"position":[[4873,16],[5424,16]]},"462":{"position":[[96,16],[5048,16],[5600,16],[10677,16],[11228,16]]},"466":{"position":[[5013,16],[5566,16]]},"508":{"position":[[5075,16],[5631,16]]},"524":{"position":[[5187,16],[5739,16]]},"544":{"position":[[5145,16],[5703,16]]},"562":{"position":[[11703,16],[12252,16],[23394,16],[23945,16],[29015,16],[29565,16]]},"582":{"position":[[4813,16],[5350,16],[10327,16],[10864,16]]},"599":{"position":[[5022,16],[5569,16]]},"639":{"position":[[5024,16],[5583,16]]},"647":{"position":[[4913,16],[5464,16]]},"649":{"position":[[16605,16],[17160,16]]},"667":{"position":[[6158,16],[6706,16],[12330,16],[12878,16],[19166,16],[19717,16],[25988,16],[26536,16],[32229,16],[32778,16]]},"669":{"position":[[25057,16],[25607,16]]},"679":{"position":[[5855,16],[6405,16],[11468,16],[12017,16]]},"681":{"position":[[10878,16],[11431,16]]},"683":{"position":[[23795,16],[24345,16]]},"701":{"position":[[1423,16],[1787,16],[3264,16],[3630,16],[5113,16],[5477,16]]},"703":{"position":[[11891,16],[12255,16]]},"705":{"position":[[7233,17],[8962,16],[9439,16]]},"726":{"position":[[33042,16],[33591,16],[44438,16],[44991,16],[50085,16],[50639,16]]},"728":{"position":[[29363,16],[29917,16],[37566,16],[38111,16],[47101,16],[47646,16]]},"745":{"position":[[12309,16],[12860,16],[23640,16],[24191,16],[37000,16],[37551,16],[42626,16],[43177,16]]},"747":{"position":[[14478,16],[15031,16]]},"749":{"position":[[17231,16],[17782,16]]},"771":{"position":[[23872,16],[24422,16]]},"773":{"position":[[15215,16],[15768,16]]},"775":{"position":[[22369,16],[22916,16]]},"795":{"position":[[5204,16],[5750,16],[10912,16],[11462,16]]},"797":{"position":[[30606,16],[31152,16]]},"799":{"position":[[8498,17],[14145,16],[14872,16]]},"820":{"position":[[12349,16],[12903,16],[23675,16],[24225,16],[36515,16],[37065,16],[42138,16],[42689,16]]},"822":{"position":[[15157,16],[15711,16]]},"826":{"position":[[15760,16],[16318,16],[27235,16],[27797,16]]},"844":{"position":[[12870,16],[13426,16],[24538,16],[25094,16],[44242,16],[44798,16]]},"846":{"position":[[12206,16],[12756,16]]},"848":{"position":[[56593,16],[57156,16]]}}}],["allowed\":undefin",{"_index":2470,"t":{"728":{"position":[[5084,21],[5634,21]]},"751":{"position":[[14695,21],[15250,21]]},"824":{"position":[[14080,21],[14637,21]]}}}],["allowed:fals",{"_index":136,"t":{"3":{"position":[[2970,13]]}}}],["allowed:tru",{"_index":132,"t":{"3":{"position":[[2810,12],[2891,12]]}}}],["alongsid",{"_index":751,"t":{"45":{"position":[[31161,9]]},"105":{"position":[[221,9]]},"705":{"position":[[666,9]]},"799":{"position":[[8274,9]]}}}],["alpha",{"_index":2387,"t":{"721":{"position":[[132,5],[149,8],[347,5]]},"726":{"position":[[12222,5],[13720,5],[15712,5],[17280,5],[19060,5],[20379,5],[21807,5],[23729,5],[25227,5],[26907,5]]}}}],["alphanumer",{"_index":1945,"t":{"480":{"position":[[2526,12]]}}}],["alpin",{"_index":952,"t":{"113":{"position":[[1607,6]]},"117":{"position":[[181,6]]}}}],["alreadi",{"_index":1319,"t":{"208":{"position":[[101,7]]},"347":{"position":[[925,8]]},"361":{"position":[[168,7]]},"363":{"position":[[1129,8]]},"369":{"position":[[11599,8],[11662,7]]},"454":{"position":[[1573,8]]},"705":{"position":[[725,7]]},"728":{"position":[[19789,7]]},"799":{"position":[[8333,7]]},"846":{"position":[[5948,7]]},"848":{"position":[[1469,7]]}}}],["altern",{"_index":1487,"t":{"226":{"position":[[260,11]]}}}],["although",{"_index":33,"t":{"3":{"position":[[470,8]]},"466":{"position":[[5893,8]]},"608":{"position":[[472,8],[5904,8]]},"669":{"position":[[19562,9]]}}}],["alway",{"_index":131,"t":{"3":{"position":[[2799,6]]},"234":{"position":[[139,6]]},"414":{"position":[[247,6]]},"476":{"position":[[572,6]]}}}],["ami",{"_index":2854,"t":{"840":{"position":[[136,3],[281,3],[937,3]]},"842":{"position":[[615,3]]},"844":{"position":[[252,3],[1978,3],[2770,3],[3948,3],[5502,3],[6730,3],[7774,3],[7990,3],[45146,3],[45187,3],[45345,3],[45379,3],[45516,3],[45551,3]]},"846":{"position":[[5794,3],[5921,4],[7360,3],[13104,3],[13145,3],[13303,3],[13337,3],[13474,3],[13509,3]]},"848":{"position":[[842,4],[1200,3],[20915,3],[57522,3],[57563,3],[57620,3],[57655,3],[57706,3],[57749,3],[57808,3],[57838,3],[57884,3],[57914,3],[57960,3],[58001,3],[58057,3],[58098,3]]}}}],["amount",{"_index":61,"t":{"3":{"position":[[889,6]]},"5":{"position":[[413,7]]},"228":{"position":[[820,6]]}}}],["ancestor",{"_index":1975,"t":{"482":{"position":[[5640,10]]}}}],["and.statu",{"_index":239,"t":{"9":{"position":[[1106,10]]}}}],["and/or",{"_index":1732,"t":{"396":{"position":[[263,6]]},"430":{"position":[[245,6]]},"432":{"position":[[99,6]]},"550":{"position":[[275,6]]},"556":{"position":[[117,6]]},"558":{"position":[[253,6]]},"848":{"position":[[1418,6]]}}}],["andr",{"_index":527,"t":{"39":{"position":[[313,6]]}}}],["ann",{"_index":661,"t":{"45":{"position":[[5877,4],[10510,4],[10946,4],[18382,4],[24755,4]]},"85":{"position":[[1859,4],[1956,4],[2386,4]]},"87":{"position":[[1346,4],[1447,4],[1494,4],[1624,4],[1670,4],[1799,4],[1868,4],[1919,4],[1966,4]]},"89":{"position":[[2023,4],[2257,4],[2376,4],[2448,4]]},"91":{"position":[[674,4],[799,4],[1287,4]]},"93":{"position":[[711,4],[843,4],[1223,4],[1274,5],[1463,4],[1545,4],[1695,4]]},"95":{"position":[[692,4],[855,4],[1319,4],[1498,4],[1580,4],[1759,4]]},"131":{"position":[[43,4]]},"143":{"position":[[68,4]]},"200":{"position":[[40,4]]},"202":{"position":[[44,4]]},"265":{"position":[[39,4],[132,4],[285,4],[340,4]]},"267":{"position":[[30,4],[5649,4]]},"285":{"position":[[1366,4],[2139,7],[3226,7],[4592,7],[6131,4],[6749,7],[6778,6],[6983,4],[7749,4],[8899,4],[10425,4],[11625,4],[12613,4],[12874,4]]},"294":{"position":[[103,4],[313,4]]},"296":{"position":[[62,4]]},"313":{"position":[[125,4],[232,4],[358,4]]},"382":{"position":[[835,4],[999,4],[1079,4]]},"440":{"position":[[916,4]]},"444":{"position":[[55,4],[70,4],[927,4],[2205,4],[3918,4],[5256,4],[6590,4]]},"484":{"position":[[1602,4],[1834,4],[1939,4],[2569,4],[2607,4],[2656,4],[2705,4],[2753,4],[3390,4],[3498,4],[3557,4],[3616,4],[3664,4]]},"574":{"position":[[105,4]]},"645":{"position":[[801,4],[2129,4],[3892,4],[5280,4],[6700,4]]},"647":{"position":[[5741,4]]},"649":{"position":[[6023,4]]},"667":{"position":[[1121,4],[1281,4],[7028,4]]},"683":{"position":[[18904,4]]},"695":{"position":[[2856,4],[3238,4],[3370,4],[3502,4],[4348,4],[4539,4],[4730,4],[5946,4],[6088,4],[6230,4],[7071,4],[7212,4],[7353,4],[9707,4],[9843,4],[9979,4]]},"697":{"position":[[54,4],[158,4],[268,4]]},"699":{"position":[[183,4],[379,4]]},"701":{"position":[[120,4],[205,4],[2034,4],[11323,4],[11361,4]]},"703":{"position":[[2476,4],[2646,4],[2698,4],[4632,4],[5447,4],[6628,4],[8185,4],[9416,4],[10459,4]]},"705":{"position":[[213,4],[815,4],[1069,4],[1866,4],[3075,4],[4660,4],[5920,4],[6955,4],[7158,4],[9828,4],[12615,4],[12644,4],[12673,4],[12702,4],[12733,4],[12763,4]]},"707":{"position":[[2777,4],[2909,4],[3041,4],[3887,4],[4078,4],[4269,4],[5485,4],[5627,4],[5769,4],[6610,4],[6751,4],[6892,4],[9246,4],[9382,4],[9518,4]]},"721":{"position":[[331,5],[520,4],[562,4],[616,4]]},"726":{"position":[[20355,4],[21783,4],[23705,4],[25203,4],[26883,4],[27754,4],[28078,4]]},"728":{"position":[[84,4],[242,4],[8154,4],[13969,4],[22451,7],[22531,4],[22581,4],[30545,4],[32744,4],[40122,4],[41874,4],[41916,4],[41970,4],[48020,4],[48050,4],[48096,4],[48129,4],[48177,4],[48204,4]]},"742":{"position":[[35,4],[503,4]]},"745":{"position":[[1728,4],[7448,4]]},"765":{"position":[[136,4],[215,4]]},"771":{"position":[[22,4],[411,4],[462,4],[6107,4],[18909,4],[18986,4],[19012,4],[24704,4],[30407,4],[30459,4],[30494,4],[30631,4],[30670,4],[30819,4],[30851,4]]},"773":{"position":[[30,4],[980,5],[2489,4],[16071,5],[16140,4],[16175,4],[16312,4],[16351,4],[16500,4],[16532,4]]},"775":{"position":[[23326,4],[23361,4],[23496,4],[23535,4],[23682,4],[23714,4]]},"777":{"position":[[39,4],[161,4],[304,4],[2393,4],[2709,4]]},"789":{"position":[[2195,4],[3304,4],[4943,4],[7135,4],[8854,4],[11001,4]]},"791":{"position":[[60,4],[103,4],[148,4],[221,4],[270,4]]},"795":{"position":[[315,4],[23375,4]]},"797":{"position":[[4223,4],[4373,4],[4425,4],[5274,7],[6359,7],[7723,7],[9258,4],[9872,7],[9901,6],[18869,4],[19594,4],[19741,4],[20896,4],[21102,4],[22633,4],[22790,4],[23995,4],[24151,4],[25351,4],[25502,4],[25737,4],[25803,4]]},"799":{"position":[[304,4],[974,4],[1042,4],[1819,4],[1993,4],[3176,4],[3409,4],[4968,4],[5152,4],[6386,4],[6569,4],[7723,4],[7901,4],[8412,4],[15340,4]]},"801":{"position":[[4032,4],[6927,4],[10847,4],[13902,4],[19151,4]]},"817":{"position":[[35,5],[250,5],[456,5]]},"820":{"position":[[13197,4],[30194,4]]},"822":{"position":[[2816,5],[4256,5],[6249,5],[7769,5],[9635,5]]},"826":{"position":[[170,4],[2676,4],[3517,4],[5009,4],[6995,4],[8557,4],[10371,4],[10882,4]]}}}],["anne'",{"_index":1609,"t":{"311":{"position":[[12298,6],[13572,6],[15297,6],[16658,6],[17586,6]]},"703":{"position":[[4674,6]]},"705":{"position":[[429,6]]}}}],["anoth",{"_index":606,"t":{"45":{"position":[[734,7],[3927,7]]},"49":{"position":[[83,7]]},"81":{"position":[[207,8]]},"87":{"position":[[893,7]]},"89":{"position":[[0,7],[219,7],[3068,7]]},"285":{"position":[[7022,7],[12988,7]]},"302":{"position":[[270,7]]},"345":{"position":[[311,7]]},"353":{"position":[[313,7]]},"375":{"position":[[12296,7]]},"386":{"position":[[483,7],[687,7]]},"422":{"position":[[343,7]]},"440":{"position":[[348,7]]},"476":{"position":[[1773,7],[1988,7]]},"478":{"position":[[815,7],[1030,7],[2655,7],[2870,7]]},"480":{"position":[[1145,7],[1360,7]]},"482":{"position":[[4282,7],[7034,7]]},"490":{"position":[[154,8],[454,7]]},"566":{"position":[[107,7],[182,7]]},"576":{"position":[[0,7]]},"637":{"position":[[1096,7],[2325,7],[3930,7],[5209,7],[6310,7]]},"671":{"position":[[170,7]]},"713":{"position":[[761,7]]},"728":{"position":[[21928,7],[22305,7]]},"730":{"position":[[367,7]]},"732":{"position":[[509,7],[1103,7]]},"757":{"position":[[804,7]]},"805":{"position":[[137,7]]},"807":{"position":[[399,7],[1185,7]]},"824":{"position":[[430,7]]},"826":{"position":[[351,7]]},"830":{"position":[[403,7]]}}}],["answer",{"_index":596,"t":{"45":{"position":[[20,7],[3454,6]]},"53":{"position":[[65,6]]},"472":{"position":[[472,7],[1098,6],[1194,6]]},"474":{"position":[[54,6]]},"482":{"position":[[153,7]]},"484":{"position":[[239,6]]},"601":{"position":[[21,6],[113,6]]},"643":{"position":[[1982,6]]},"728":{"position":[[54,6]]},"773":{"position":[[1097,7]]},"799":{"position":[[696,7]]},"848":{"position":[[342,7],[511,7],[674,7]]}}}],["anyon",{"_index":2009,"t":{"502":{"position":[[1121,6]]},"512":{"position":[[414,6],[465,6],[525,6]]},"667":{"position":[[33140,6]]},"773":{"position":[[665,6],[792,6]]},"838":{"position":[[1216,6]]},"846":{"position":[[6016,6]]},"848":{"position":[[2954,6]]}}}],["anyth",{"_index":1474,"t":{"222":{"position":[[1025,8]]},"482":{"position":[[869,8]]}}}],["api",{"_index":202,"t":{"9":{"position":[[73,3]]},"15":{"position":[[249,3]]},"29":{"position":[[1237,5]]},"35":{"position":[[704,4],[8256,3],[8322,3],[8411,3]]},"45":{"position":[[3028,3],[3267,3],[3313,4],[24159,3],[30791,3],[31420,3]]},"81":{"position":[[127,3],[468,3],[496,3],[641,4],[757,3]]},"85":{"position":[[1000,3]]},"97":{"position":[[40,3]]},"103":{"position":[[88,4]]},"111":{"position":[[218,3],[293,4]]},"125":{"position":[[48,4],[214,3]]},"133":{"position":[[25,4],[61,3]]},"137":{"position":[[114,3],[133,3]]},"145":{"position":[[25,4],[61,3]]},"149":{"position":[[121,3],[147,3]]},"157":{"position":[[96,3],[171,4]]},"173":{"position":[[752,3],[1129,3],[2624,4],[2668,3]]},"179":{"position":[[720,5]]},"202":{"position":[[25,3]]},"208":{"position":[[383,4],[419,4]]},"222":{"position":[[723,3],[1121,3]]},"238":{"position":[[209,3]]},"248":{"position":[[25,4],[61,3]]},"250":{"position":[[56,4]]},"252":{"position":[[55,4]]},"254":{"position":[[347,3]]},"265":{"position":[[326,3]]},"267":{"position":[[5768,3]]},"271":{"position":[[54,3],[176,3]]},"275":{"position":[[139,4]]},"277":{"position":[[37,3]]},"279":{"position":[[3098,3],[3287,3],[3478,3],[3496,3],[3670,3]]},"311":{"position":[[88,4],[11337,3],[11504,3]]},"313":{"position":[[656,3]]},"315":{"position":[[164,3],[189,3]]},"323":{"position":[[145,4]]},"325":{"position":[[27,3],[173,4]]},"327":{"position":[[1179,3],[1272,3],[1582,3]]},"382":{"position":[[980,3]]},"384":{"position":[[795,4]]},"386":{"position":[[844,3],[1423,3]]},"408":{"position":[[383,5]]},"412":{"position":[[3338,4]]},"418":{"position":[[2124,3]]},"424":{"position":[[175,3]]},"482":{"position":[[10538,3]]},"550":{"position":[[1785,3],[1807,3]]},"554":{"position":[[845,3],[867,3]]},"588":{"position":[[102,3]]},"597":{"position":[[10,3],[20,3]]},"599":{"position":[[5838,3]]},"604":{"position":[[9,3],[19,3]]},"608":{"position":[[9,3],[274,3],[5994,3]]},"611":{"position":[[11,3]]},"616":{"position":[[16,3],[26,3]]},"618":{"position":[[20,3],[6828,4]]},"624":{"position":[[92,3],[145,3],[159,3],[211,3],[227,3],[281,3],[302,3],[361,3]]},"681":{"position":[[6016,3]]},"683":{"position":[[110,3]]},"685":{"position":[[555,3]]},"689":{"position":[[480,3]]},"707":{"position":[[10290,3],[10319,3],[10427,3]]},"709":{"position":[[356,3],[381,3]]},"783":{"position":[[507,3]]},"799":{"position":[[596,4]]},"801":{"position":[[21192,3],[21221,3],[21329,3],[21491,3]]},"805":{"position":[[346,3],[371,3]]}}}],["api'",{"_index":498,"t":{"35":{"position":[[8369,5]]}}}],["api.fga.exampl",{"_index":408,"t":{"35":{"position":[[1191,15],[2382,15],[4238,15],[5703,15]]},"43":{"position":[[802,15],[1776,15]]},"45":{"position":[[12746,15],[13601,15],[14926,15],[16017,15],[18940,15],[19795,15],[21120,15],[22211,15],[25294,15],[26170,15],[27549,15],[28682,15]]},"133":{"position":[[464,15],[1016,15],[1927,15],[2639,15]]},"145":{"position":[[464,15],[1016,15],[1927,15],[2639,15]]},"173":{"position":[[4775,15]]},"183":{"position":[[413,15],[1041,15],[1862,15],[2570,15]]},"185":{"position":[[761,15],[1530,15],[2590,15],[3672,15]]},"187":{"position":[[637,15],[1555,15],[2753,15],[4233,15]]},"200":{"position":[[577,15],[1387,15],[2822,15],[3937,15]]},"202":{"position":[[587,15],[1439,15],[2761,15],[3849,15],[6331,15],[7185,15],[8509,15],[9599,15]]},"248":{"position":[[464,15],[1016,15],[1927,15],[2639,15]]},"265":{"position":[[887,15],[1729,15],[3041,15],[4119,15]]},"267":{"position":[[598,15],[1403,15],[2833,15],[3943,15],[6302,15],[7145,15],[8458,15],[9537,15]]},"277":{"position":[[436,15],[988,15],[1899,15],[2611,15]]},"285":{"position":[[1892,15],[2740,15],[4058,15],[5142,15],[7530,15],[8377,15],[9849,15],[11001,15],[13554,15],[14406,15],[15728,15],[16816,15],[19156,15],[20010,15],[21334,15],[22424,15]]},"294":{"position":[[839,15],[1648,15],[3082,15],[4196,15]]},"296":{"position":[[630,15],[1483,15],[2806,15],[3895,15]]},"311":{"position":[[684,15],[1485,15],[2911,15],[4017,15],[6265,15],[7067,15],[8494,15],[9601,15],[12079,15],[13050,15],[14721,15],[16034,15]]},"357":{"position":[[760,15],[1620,15],[2950,15],[4046,15]]},"369":{"position":[[726,15],[1579,15],[2902,15],[3991,15],[6336,15],[7188,15],[8510,15],[9598,15]]},"375":{"position":[[845,15],[1714,15],[3208,15],[4382,15],[7021,15],[7874,15],[9197,15],[10286,15],[12835,15],[13688,15],[15011,15],[16100,15]]},"382":{"position":[[1705,15],[2555,15],[3875,15],[4961,15]]},"402":{"position":[[639,15],[1461,15],[2908,15],[4035,15]]},"404":{"position":[[660,15],[1520,15],[2850,15],[3946,15],[6497,15],[7358,15],[8689,15],[9786,15]]},"444":{"position":[[708,15],[1683,15],[3342,15],[4632,15],[7462,15],[8317,15],[9642,15],[10733,15]]},"446":{"position":[[610,15],[1695,15],[3464,15],[4864,15]]},"448":{"position":[[556,15],[1411,15],[2736,15],[3827,15]]},"462":{"position":[[726,15],[1582,15],[2908,15],[4000,15],[6360,15],[7215,15],[8540,15],[9631,15]]},"466":{"position":[[686,15],[1543,15],[2870,15],[3963,15],[6485,15],[7342,15],[8669,15],[9762,15]]},"504":{"position":[[614,15],[1422,15],[2855,15],[3968,15]]},"506":{"position":[[616,15],[1504,15],[3017,15],[4210,15]]},"508":{"position":[[733,15],[1593,15],[2923,15],[4019,15]]},"522":{"position":[[800,15],[1660,15],[3145,15],[4310,15]]},"524":{"position":[[865,15],[1721,15],[3047,15],[4139,15]]},"540":{"position":[[623,15],[1433,15],[2868,15],[3983,15]]},"542":{"position":[[956,15],[1843,15],[3355,15],[4547,15]]},"544":{"position":[[793,15],[1655,15],[2987,15],[4085,15]]},"562":{"position":[[848,15],[1793,15],[3422,15],[4682,15],[7396,15],[8249,15],[9572,15],[10661,15],[13391,15],[14244,15],[15567,15],[16656,15],[19077,15],[19932,15],[21257,15],[22348,15],[24703,15],[25557,15],[26881,15],[27971,15]]},"574":{"position":[[702,15],[1563,15],[3108,15],[4284,15]]},"578":{"position":[[709,15],[1566,15],[3107,15],[4279,15]]},"580":{"position":[[720,15],[1529,15],[2963,15],[4077,15]]},"582":{"position":[[566,15],[1407,15],[2718,15],[3795,15],[6080,15],[6921,15],[8232,15],[9309,15]]},"584":{"position":[[603,15],[1404,15],[2830,15],[3936,15],[6140,15],[6982,15],[8294,15],[9372,15]]},"599":{"position":[[725,15],[1576,15],[2897,15],[3984,15]]},"606":{"position":[[975,15],[1871,15],[3289,15],[4429,15],[7131,15],[8008,15],[9387,15],[10506,15],[13112,15],[13999,15],[15388,15],[16517,15]]},"608":{"position":[[1178,15],[1956,15],[3256,15],[4278,15]]},"613":{"position":[[716,15],[1606,15],[2993,15],[4142,15],[6628,15],[7518,15],[8905,15],[10054,15]]},"618":{"position":[[637,15],[1620,15],[3108,15],[4362,15]]},"637":{"position":[[852,15],[1778,15],[3329,15],[4560,15]]},"639":{"position":[[667,15],[1530,15],[2863,15],[3962,15]]},"645":{"position":[[577,15],[1602,15],[3311,15],[4651,15]]},"647":{"position":[[596,15],[1451,15],[2776,15],[3867,15]]},"649":{"position":[[577,15],[1458,15],[2964,15],[4150,15],[6635,15],[7491,15],[8817,15],[9909,15],[12268,15],[13127,15],[14456,15],[15551,15]]},"667":{"position":[[1856,15],[2708,15],[4030,15],[5118,15],[8028,15],[8880,15],[10202,15],[11290,15],[14849,15],[15704,15],[17029,15],[18120,15],[21686,15],[22538,15],[23860,15],[24948,15],[27922,15],[28775,15],[30098,15],[31187,15]]},"669":{"position":[[1829,15],[2682,15],[4005,15],[5094,15],[8078,15],[8934,15],[10260,15],[11352,15],[14422,15],[15276,15],[16600,15],[17690,15],[20745,15],[21599,15],[22923,15],[24013,15]]},"679":{"position":[[1543,15],[2397,15],[3721,15],[4811,15],[7161,15],[8014,15],[9337,15],[10426,15]]},"681":{"position":[[667,15],[1528,15],[3014,15],[4180,15],[6551,15],[7408,15],[8735,15],[9828,15]]},"683":{"position":[[642,15],[1606,15],[3032,15],[4234,15],[6919,15],[7805,15],[9375,15],[10576,15],[13181,15],[14068,15],[15639,15],[16841,15],[19483,15],[20337,15],[21661,15],[22751,15],[25146,15],[25998,15],[27320,15],[28408,15]]},"703":{"position":[[5228,15],[6106,15],[7609,15],[8792,15]]},"705":{"position":[[1619,15],[2525,15],[4056,15],[5267,15]]},"726":{"position":[[681,15],[2336,15],[4911,15],[6921,15],[11999,15],[13194,15],[15132,15],[16652,15],[20136,15],[21261,15],[23129,15],[24579,15],[28735,15],[29588,15],[30911,15],[32000,15],[34494,15],[35348,15],[36672,15],[37762,15],[40111,15],[40968,15],[42295,15],[43388,15],[45753,15],[46611,15],[47939,15],[49033,15]]},"728":{"position":[[777,15],[1631,15],[2955,15],[4045,15],[8696,15],[9546,15],[10866,15],[11952,15],[14613,15],[15472,15],[16801,15],[17896,15],[25031,15],[25889,15],[27217,15],[28311,15],[33279,15],[34128,15],[35447,15],[36532,15],[42814,15],[43663,15],[44982,15],[46067,15]]},"745":{"position":[[2308,15],[3125,15],[4567,15],[5689,15],[7992,15],[8847,15],[10172,15],[11263,15],[13682,15],[14499,15],[15941,15],[17063,15],[19323,15],[20178,15],[21503,15],[22594,15],[24949,15],[25805,15],[27131,15],[28223,15],[32683,15],[33538,15],[34863,15],[35954,15],[38309,15],[39164,15],[40489,15],[41580,15]]},"747":{"position":[[2837,15],[3883,15],[5613,15],[6974,15],[10151,15],[11008,15],[12335,15],[13428,15]]},"749":{"position":[[782,15],[1623,15],[3089,15],[4235,15],[7023,15],[7896,15],[9394,15],[10572,15],[12914,15],[13769,15],[15094,15],[16185,15]]},"751":{"position":[[3479,15],[4380,15],[5965,15],[7181,15],[10363,15],[11222,15],[12551,15],[13646,15],[17797,15],[18636,15],[20100,15],[21244,15]]},"771":{"position":[[994,15],[1810,15],[3251,15],[4372,15],[6642,15],[7462,15],[8907,15],[10032,15],[12326,15],[13289,15],[14995,15],[16283,15],[19560,15],[20414,15],[21738,15],[22828,15],[25259,15],[26111,15],[27433,15],[28521,15]]},"773":{"position":[[3412,15],[4428,15],[6246,15],[7597,15],[10888,15],[11745,15],[13072,15],[14165,15]]},"775":{"position":[[3317,15],[4221,15],[5809,15],[7028,15],[9842,15],[10941,15],[12842,15],[14276,15],[18072,15],[18923,15],[20244,15],[21331,15]]},"777":{"position":[[3512,15],[4478,15],[6187,15],[7478,15],[10764,15],[11620,15],[12946,15],[14038,15]]},"789":{"position":[[3085,15],[4421,15],[6559,15],[8230,15]]},"795":{"position":[[912,15],[1762,15],[3082,15],[4168,15],[6600,15],[7454,15],[8778,15],[9868,15],[12325,15],[13201,15],[14702,15],[15883,15],[18235,15],[19086,15],[20407,15],[21494,15]]},"797":{"position":[[5027,15],[5873,15],[7189,15],[8271,15],[10832,15],[12076,15],[14063,15],[15632,15],[19375,15],[20374,15],[22057,15],[23371,15],[26314,15],[27164,15],[28484,15],[29570,15]]},"799":{"position":[[1572,15],[2626,15],[4364,15],[5733,15],[9009,15],[10028,15],[11536,15],[12823,15],[15935,15],[16955,15],[18464,15],[19752,15]]},"801":{"position":[[3813,15],[6405,15],[10271,15],[13278,15]]},"820":{"position":[[2309,15],[3129,15],[4574,15],[5699,15],[8017,15],[8875,15],[10203,15],[11297,15],[13729,15],[14545,15],[15986,15],[17107,15],[19363,15],[20217,15],[21541,15],[22631,15],[24981,15],[25837,15],[27163,15],[28255,15],[32203,15],[33057,15],[34381,15],[35471,15],[37821,15],[38676,15],[40001,15],[41092,15]]},"822":{"position":[[2592,15],[3729,15],[5668,15],[7140,15],[10825,15],[11683,15],[13011,15],[14105,15]]},"824":{"position":[[2425,15],[3441,15],[5141,15],[6472,15],[9738,15],[10599,15],[11930,15],[13027,15]]},"826":{"position":[[3298,15],[4487,15],[6419,15],[7933,15],[11408,15],[12270,15],[13602,15],[14700,15],[17166,15],[18030,15],[19364,15],[20464,15],[22863,15],[23729,15],[25065,15],[26167,15],[28655,15],[29519,15],[30853,15],[31953,15],[34352,15],[35216,15],[36550,15],[37650,15]]},"844":{"position":[[2551,15],[3426,15],[4926,15],[6106,15],[8528,15],[9388,15],[10718,15],[11814,15],[14262,15],[15137,15],[16637,15],[17817,15],[20196,15],[21056,15],[22386,15],[23482,15],[25939,15],[26806,15],[28143,15],[29246,15],[32100,15],[33225,15],[35093,15],[36543,15],[39900,15],[40760,15],[42090,15],[43186,15]]},"846":{"position":[[612,15],[1467,15],[2792,15],[3883,15],[7894,15],[8748,15],[10072,15],[11162,15]]},"848":{"position":[[7380,15],[8420,15],[10203,15],[11568,15],[14996,15],[15940,15],[17509,15],[18758,15],[21439,15],[22427,15],[24099,15],[25402,15],[28273,15],[29176,15],[30763,15],[31981,15],[34757,15],[35603,15],[37074,15],[38225,15],[40644,15],[41473,15],[42927,15],[44061,15],[46545,15],[47397,15],[48719,15],[49807,15],[52216,15],[53083,15],[54420,15],[55523,15]]}}}],["api.openfga.exampl",{"_index":566,"t":{"43":{"position":[[322,19]]},"113":{"position":[[641,19]]}}}],["api_audi",{"_index":1269,"t":{"187":{"position":[[3848,13]]}}}],["api_host",{"_index":470,"t":{"35":{"position":[[5616,8]]},"43":{"position":[[2527,8]]},"45":{"position":[[15930,8],[22124,8],[28595,8]]},"133":{"position":[[2552,8]]},"145":{"position":[[2552,8]]},"183":{"position":[[2483,8]]},"185":{"position":[[3585,8]]},"187":{"position":[[4146,8]]},"200":{"position":[[3850,8]]},"202":{"position":[[3762,8],[9512,8]]},"248":{"position":[[2552,8]]},"265":{"position":[[4032,8]]},"267":{"position":[[3856,8],[9450,8]]},"277":{"position":[[2524,8]]},"285":{"position":[[5055,8],[10914,8],[16729,8],[22337,8]]},"294":{"position":[[4109,8]]},"296":{"position":[[3808,8]]},"311":{"position":[[3930,8],[9514,8],[15947,8]]},"357":{"position":[[3959,8]]},"369":{"position":[[3904,8],[9511,8]]},"375":{"position":[[4295,8],[10199,8],[16013,8]]},"382":{"position":[[4874,8]]},"402":{"position":[[3948,8]]},"404":{"position":[[3859,8],[9699,8]]},"444":{"position":[[4545,8],[10646,8]]},"446":{"position":[[4777,8]]},"448":{"position":[[3740,8]]},"462":{"position":[[3913,8],[9544,8]]},"466":{"position":[[3876,8],[9675,8]]},"504":{"position":[[3881,8]]},"506":{"position":[[4123,8]]},"508":{"position":[[3932,8]]},"522":{"position":[[4223,8]]},"524":{"position":[[4052,8]]},"540":{"position":[[3896,8]]},"542":{"position":[[4460,8]]},"544":{"position":[[3998,8]]},"562":{"position":[[4595,8],[10574,8],[16569,8],[22261,8],[27884,8]]},"574":{"position":[[4197,8]]},"578":{"position":[[4192,8]]},"580":{"position":[[3990,8]]},"582":{"position":[[3708,8],[9222,8]]},"584":{"position":[[3849,8],[9285,8]]},"599":{"position":[[3897,8]]},"606":{"position":[[4342,8],[10419,8],[16430,8]]},"608":{"position":[[4191,8]]},"613":{"position":[[4055,8],[9967,8]]},"618":{"position":[[4275,8]]},"637":{"position":[[4473,8]]},"639":{"position":[[3875,8]]},"645":{"position":[[4564,8]]},"647":{"position":[[3780,8]]},"649":{"position":[[4063,8],[9822,8],[15464,8]]},"667":{"position":[[5031,8],[11203,8],[18033,8],[24861,8],[31100,8]]},"669":{"position":[[5007,8],[11265,8],[17603,8],[23926,8]]},"679":{"position":[[4724,8],[10339,8]]},"681":{"position":[[4093,8],[9741,8]]},"683":{"position":[[4147,8],[10489,8],[16754,8],[22664,8],[28321,8]]},"703":{"position":[[8705,8]]},"705":{"position":[[5180,8]]},"726":{"position":[[6834,8],[16565,8],[24492,8],[31913,8],[37675,8],[43301,8],[48946,8]]},"728":{"position":[[3958,8],[11865,8],[17809,8],[28224,8],[36445,8],[45980,8]]},"745":{"position":[[5602,8],[11176,8],[16976,8],[22507,8],[28136,8],[35867,8],[41493,8]]},"747":{"position":[[6887,8],[13341,8]]},"749":{"position":[[4148,8],[10485,8],[16098,8]]},"751":{"position":[[7094,8],[13559,8],[21157,8]]},"771":{"position":[[4285,8],[9945,8],[16196,8],[22741,8],[28434,8]]},"773":{"position":[[7510,8],[14078,8]]},"775":{"position":[[6941,8],[14189,8],[21244,8]]},"777":{"position":[[7391,8],[13951,8]]},"789":{"position":[[8143,8]]},"795":{"position":[[4081,8],[9781,8],[15796,8],[21407,8]]},"797":{"position":[[8184,8],[15545,8],[23284,8],[29483,8]]},"799":{"position":[[5646,8],[12736,8],[19665,8]]},"801":{"position":[[13191,8]]},"820":{"position":[[5612,8],[11210,8],[17020,8],[22544,8],[28168,8],[35384,8],[41005,8]]},"822":{"position":[[7053,8],[14018,8]]},"824":{"position":[[6385,8],[12940,8]]},"826":{"position":[[7846,8],[14613,8],[20377,8],[26080,8],[31866,8],[37563,8]]},"844":{"position":[[6019,8],[11727,8],[17730,8],[23395,8],[29159,8],[36456,8],[43099,8]]},"846":{"position":[[3796,8],[11075,8]]},"848":{"position":[[11481,8],[18671,8],[25315,8],[31894,8],[38138,8],[43974,8],[49720,8],[55436,8]]}}}],["api_issu",{"_index":1267,"t":{"187":{"position":[[3796,11]]}}}],["api_respons",{"_index":477,"t":{"35":{"position":[[6114,12]]},"43":{"position":[[2824,12]]},"45":{"position":[[16428,12],[22622,12],[29093,12]]},"133":{"position":[[3050,12]]},"145":{"position":[[3050,12]]},"183":{"position":[[2916,12]]},"185":{"position":[[4045,12]]},"187":{"position":[[4606,12]]},"200":{"position":[[4348,12]]},"202":{"position":[[4260,12],[10010,12]]},"248":{"position":[[3050,12]]},"265":{"position":[[4530,12]]},"267":{"position":[[4354,12],[9948,12]]},"277":{"position":[[3022,12]]},"285":{"position":[[5553,12],[11412,12],[17227,12],[22835,12]]},"294":{"position":[[4607,12]]},"296":{"position":[[4306,12]]},"311":{"position":[[4428,12],[10012,12],[16445,12]]},"357":{"position":[[4457,12]]},"369":{"position":[[4402,12],[10009,12]]},"375":{"position":[[4793,12],[10697,12],[16511,12]]},"382":{"position":[[5372,12]]},"402":{"position":[[4446,12]]},"404":{"position":[[4357,12],[10197,12]]},"444":{"position":[[5043,12],[11144,12]]},"446":{"position":[[5275,12]]},"448":{"position":[[4238,12]]},"462":{"position":[[4411,12],[10042,12]]},"466":{"position":[[4374,12],[10173,12]]},"504":{"position":[[4379,12]]},"506":{"position":[[4621,12]]},"508":{"position":[[4430,12]]},"522":{"position":[[4721,12]]},"524":{"position":[[4550,12]]},"540":{"position":[[4394,12]]},"542":{"position":[[4958,12]]},"544":{"position":[[4496,12]]},"562":{"position":[[5093,12],[11072,12],[17067,12],[22759,12],[28382,12]]},"574":{"position":[[4695,12]]},"578":{"position":[[4690,12]]},"580":{"position":[[4488,12]]},"582":{"position":[[4206,12],[9720,12]]},"584":{"position":[[4347,12],[9783,12]]},"599":{"position":[[4395,12]]},"606":{"position":[[4840,12],[10917,12],[16928,12]]},"608":{"position":[[4689,12]]},"613":{"position":[[4553,12],[10465,12]]},"618":{"position":[[4773,12]]},"637":{"position":[[4971,12]]},"639":{"position":[[4373,12]]},"645":{"position":[[5062,12]]},"647":{"position":[[4278,12]]},"649":{"position":[[4561,12],[10320,12],[15962,12]]},"667":{"position":[[5529,12],[11701,12],[18531,12],[25359,12],[31598,12]]},"669":{"position":[[5505,12],[11763,12],[18101,12],[24424,12]]},"679":{"position":[[5222,12],[10837,12]]},"681":{"position":[[4591,12],[10239,12]]},"683":{"position":[[4645,12],[10987,12],[17252,12],[23162,12],[28819,12]]},"703":{"position":[[9203,12]]},"705":{"position":[[5678,12]]},"726":{"position":[[7332,12],[17063,12],[24990,12],[32411,12],[38173,12],[43799,12],[49444,12]]},"728":{"position":[[4456,12],[12363,12],[18307,12],[28722,12],[36943,12],[46478,12]]},"745":{"position":[[6100,12],[11674,12],[17474,12],[23005,12],[28634,12],[36365,12],[41991,12]]},"747":{"position":[[7385,12],[13839,12]]},"749":{"position":[[4646,12],[10983,12],[16596,12]]},"751":{"position":[[7592,12],[14057,12],[21655,12]]},"771":{"position":[[4783,12],[10443,12],[16694,12],[23239,12],[28932,12]]},"773":{"position":[[8008,12],[14576,12]]},"775":{"position":[[7439,12],[14687,12],[21742,12]]},"777":{"position":[[7889,12],[14449,12]]},"789":{"position":[[8641,12]]},"795":{"position":[[4579,12],[10279,12],[16294,12],[21905,12]]},"797":{"position":[[8682,12],[16043,12],[23782,12],[29981,12]]},"799":{"position":[[6144,12],[13234,12],[20163,12]]},"801":{"position":[[13689,12]]},"820":{"position":[[6110,12],[11708,12],[17518,12],[23042,12],[28666,12],[35882,12],[41503,12]]},"822":{"position":[[7551,12],[14516,12]]},"824":{"position":[[6883,12],[13438,12]]},"826":{"position":[[8344,12],[15111,12],[20875,12],[26578,12],[32364,12],[38061,12]]},"844":{"position":[[6517,12],[12225,12],[18228,12],[23893,12],[29657,12],[36954,12],[43597,12]]},"846":{"position":[[4294,12],[11573,12]]},"848":{"position":[[11979,12],[19169,12],[25813,12],[32392,12],[38636,12],[44472,12],[50218,12],[55934,12]]}}}],["api_schem",{"_index":468,"t":{"35":{"position":[[5521,10]]},"45":{"position":[[15835,10],[22029,10],[28500,10]]},"133":{"position":[[2457,10]]},"145":{"position":[[2457,10]]},"183":{"position":[[2378,10]]},"185":{"position":[[3480,10]]},"187":{"position":[[4041,10]]},"200":{"position":[[3755,10]]},"202":{"position":[[3667,10],[9417,10]]},"248":{"position":[[2457,10]]},"265":{"position":[[3937,10]]},"267":{"position":[[3761,10],[9355,10]]},"277":{"position":[[2429,10]]},"285":{"position":[[4960,10],[10819,10],[16634,10],[22242,10]]},"294":{"position":[[4014,10]]},"296":{"position":[[3713,10]]},"311":{"position":[[3835,10],[9419,10],[15852,10]]},"357":{"position":[[3864,10]]},"369":{"position":[[3809,10],[9416,10]]},"375":{"position":[[4200,10],[10104,10],[15918,10]]},"382":{"position":[[4779,10]]},"402":{"position":[[3853,10]]},"404":{"position":[[3764,10],[9604,10]]},"444":{"position":[[4450,10],[10551,10]]},"446":{"position":[[4682,10]]},"448":{"position":[[3645,10]]},"462":{"position":[[3818,10],[9449,10]]},"466":{"position":[[3781,10],[9580,10]]},"504":{"position":[[3786,10]]},"506":{"position":[[4028,10]]},"508":{"position":[[3837,10]]},"522":{"position":[[4128,10]]},"524":{"position":[[3957,10]]},"540":{"position":[[3801,10]]},"542":{"position":[[4365,10]]},"544":{"position":[[3903,10]]},"562":{"position":[[4500,10],[10479,10],[16474,10],[22166,10],[27789,10]]},"574":{"position":[[4102,10]]},"578":{"position":[[4097,10]]},"580":{"position":[[3895,10]]},"582":{"position":[[3613,10],[9127,10]]},"584":{"position":[[3754,10],[9190,10]]},"599":{"position":[[3802,10]]},"606":{"position":[[4247,10],[10324,10],[16335,10]]},"608":{"position":[[4096,10]]},"613":{"position":[[3960,10],[9872,10]]},"618":{"position":[[4180,10]]},"637":{"position":[[4378,10]]},"639":{"position":[[3780,10]]},"645":{"position":[[4469,10]]},"647":{"position":[[3685,10]]},"649":{"position":[[3968,10],[9727,10],[15369,10]]},"667":{"position":[[4936,10],[11108,10],[17938,10],[24766,10],[31005,10]]},"669":{"position":[[4912,10],[11170,10],[17508,10],[23831,10]]},"679":{"position":[[4629,10],[10244,10]]},"681":{"position":[[3998,10],[9646,10]]},"683":{"position":[[4052,10],[10394,10],[16659,10],[22569,10],[28226,10]]},"703":{"position":[[8610,10]]},"705":{"position":[[5085,10]]},"726":{"position":[[6739,10],[16470,10],[24397,10],[31818,10],[37580,10],[43206,10],[48851,10]]},"728":{"position":[[3863,10],[11770,10],[17714,10],[28129,10],[36350,10],[45885,10]]},"745":{"position":[[5507,10],[11081,10],[16881,10],[22412,10],[28041,10],[35772,10],[41398,10]]},"747":{"position":[[6792,10],[13246,10]]},"749":{"position":[[4053,10],[10390,10],[16003,10]]},"751":{"position":[[6999,10],[13464,10],[21062,10]]},"771":{"position":[[4190,10],[9850,10],[16101,10],[22646,10],[28339,10]]},"773":{"position":[[7415,10],[13983,10]]},"775":{"position":[[6846,10],[14094,10],[21149,10]]},"777":{"position":[[7296,10],[13856,10]]},"789":{"position":[[8048,10]]},"795":{"position":[[3986,10],[9686,10],[15701,10],[21312,10]]},"797":{"position":[[8089,10],[15450,10],[23189,10],[29388,10]]},"799":{"position":[[5551,10],[12641,10],[19570,10]]},"801":{"position":[[13096,10]]},"820":{"position":[[5517,10],[11115,10],[16925,10],[22449,10],[28073,10],[35289,10],[40910,10]]},"822":{"position":[[6958,10],[13923,10]]},"824":{"position":[[6290,10],[12845,10]]},"826":{"position":[[7751,10],[14518,10],[20282,10],[25985,10],[31771,10],[37468,10]]},"844":{"position":[[5924,10],[11632,10],[17635,10],[23300,10],[29064,10],[36361,10],[43004,10]]},"846":{"position":[[3701,10],[10980,10]]},"848":{"position":[[11386,10],[18576,10],[25220,10],[31799,10],[38043,10],[43879,10],[49625,10],[55341,10]]}}}],["apiaudi",{"_index":390,"t":{"35":{"position":[[779,12],[1959,12],[3621,12],[5333,12]]},"45":{"position":[[12334,12],[13178,12],[14309,12],[15647,12],[18528,12],[19372,12],[20503,12],[21841,12],[24882,12],[25747,12],[26932,12],[28312,12]]},"187":{"position":[[1045,12],[3287,11]]},"200":{"position":[[165,12],[964,12],[2205,12],[3567,12]]},"202":{"position":[[175,12],[1016,12],[2144,12],[3479,12],[5919,12],[6762,12],[7892,12],[9229,12]]},"265":{"position":[[475,12],[1306,12],[2424,12],[3749,12]]},"267":{"position":[[186,12],[980,12],[2216,12],[3573,12],[5890,12],[6722,12],[7841,12],[9167,12]]},"285":{"position":[[1480,12],[2317,12],[3441,12],[4772,12],[7118,12],[7954,12],[9232,12],[10631,12],[13142,12],[13983,12],[15111,12],[16446,12],[18744,12],[19587,12],[20717,12],[22054,12]]},"294":{"position":[[427,12],[1225,12],[2465,12],[3826,12]]},"296":{"position":[[218,12],[1060,12],[2189,12],[3525,12]]},"311":{"position":[[272,12],[1062,12],[2294,12],[3647,12],[5853,12],[6644,12],[7877,12],[9231,12],[11667,12],[12627,12],[14104,12],[15664,12]]},"357":{"position":[[348,12],[1197,12],[2333,12],[3676,12]]},"369":{"position":[[314,12],[1156,12],[2285,12],[3621,12],[5924,12],[6765,12],[7893,12],[9228,12]]},"375":{"position":[[433,12],[1291,12],[2591,12],[4012,12],[6609,12],[7451,12],[8580,12],[9916,12],[12423,12],[13265,12],[14394,12],[15730,12]]},"382":{"position":[[1293,12],[2132,12],[3258,12],[4591,12]]},"402":{"position":[[227,12],[1038,12],[2291,12],[3665,12]]},"404":{"position":[[248,12],[1097,12],[2233,12],[3576,12],[6085,12],[6935,12],[8072,12],[9416,12]]},"444":{"position":[[296,12],[1260,12],[2725,12],[4262,12],[7050,12],[7894,12],[9025,12],[10363,12]]},"446":{"position":[[198,12],[1272,12],[2847,12],[4494,12]]},"448":{"position":[[144,12],[988,12],[2119,12],[3457,12]]},"462":{"position":[[314,12],[1159,12],[2291,12],[3630,12],[5948,12],[6792,12],[7923,12],[9261,12]]},"466":{"position":[[274,12],[1120,12],[2253,12],[3593,12],[6073,12],[6919,12],[8052,12],[9392,12]]},"504":{"position":[[202,12],[999,12],[2238,12],[3598,12]]},"506":{"position":[[204,12],[1081,12],[2400,12],[3840,12]]},"508":{"position":[[321,12],[1170,12],[2306,12],[3649,12]]},"522":{"position":[[388,12],[1237,12],[2528,12],[3940,12]]},"524":{"position":[[453,12],[1298,12],[2430,12],[3769,12]]},"540":{"position":[[211,12],[1010,12],[2251,12],[3613,12]]},"542":{"position":[[544,12],[1420,12],[2738,12],[4177,12]]},"544":{"position":[[381,12],[1232,12],[2370,12],[3715,12]]},"562":{"position":[[436,12],[1370,12],[2805,12],[4312,12],[6984,12],[7826,12],[8955,12],[10291,12],[12979,12],[13821,12],[14950,12],[16286,12],[18665,12],[19509,12],[20640,12],[21978,12],[24291,12],[25134,12],[26264,12],[27601,12]]},"574":{"position":[[290,12],[1140,12],[2491,12],[3914,12]]},"578":{"position":[[297,12],[1143,12],[2490,12],[3909,12]]},"580":{"position":[[308,12],[1106,12],[2346,12],[3707,12]]},"582":{"position":[[154,12],[984,12],[2101,12],[3425,12],[5668,12],[6498,12],[7615,12],[8939,12]]},"584":{"position":[[191,12],[981,12],[2213,12],[3566,12],[5728,12],[6559,12],[7677,12],[9002,12]]},"599":{"position":[[313,12],[1153,12],[2280,12],[3614,12]]},"606":{"position":[[563,12],[1448,12],[2672,12],[4059,12],[6719,12],[7585,12],[8770,12],[10136,12],[12700,12],[13576,12],[14771,12],[16147,12]]},"608":{"position":[[766,12],[1533,12],[2639,12],[3908,12]]},"613":{"position":[[304,12],[1183,12],[2376,12],[3772,12],[6216,12],[7095,12],[8288,12],[9684,12]]},"618":{"position":[[225,12],[1197,12],[2491,12],[3992,12]]},"637":{"position":[[440,12],[1355,12],[2712,12],[4190,12]]},"639":{"position":[[255,12],[1107,12],[2246,12],[3592,12]]},"645":{"position":[[165,12],[1179,12],[2694,12],[4281,12]]},"647":{"position":[[184,12],[1028,12],[2159,12],[3497,12]]},"649":{"position":[[165,12],[1035,12],[2347,12],[3780,12],[6223,12],[7068,12],[8200,12],[9539,12],[11856,12],[12704,12],[13839,12],[15181,12]]},"667":{"position":[[1444,12],[2285,12],[3413,12],[4748,12],[7616,12],[8457,12],[9585,12],[10920,12],[14437,12],[15281,12],[16412,12],[17750,12],[21274,12],[22115,12],[23243,12],[24578,12],[27510,12],[28352,12],[29481,12],[30817,12]]},"669":{"position":[[1417,12],[2259,12],[3388,12],[4724,12],[7666,12],[8511,12],[9643,12],[10982,12],[14010,12],[14853,12],[15983,12],[17320,12],[20333,12],[21176,12],[22306,12],[23643,12]]},"679":{"position":[[1131,12],[1974,12],[3104,12],[4441,12],[6749,12],[7591,12],[8720,12],[10056,12]]},"681":{"position":[[255,12],[1105,12],[2397,12],[3810,12],[6139,12],[6985,12],[8118,12],[9458,12]]},"683":{"position":[[230,12],[1183,12],[2415,12],[3864,12],[6507,12],[7382,12],[8758,12],[10206,12],[12769,12],[13645,12],[15022,12],[16471,12],[19071,12],[19914,12],[21044,12],[22381,12],[24734,12],[25575,12],[26703,12],[28038,12]]},"703":{"position":[[4816,12],[5683,12],[6992,12],[8422,12]]},"705":{"position":[[1207,12],[2102,12],[3439,12],[4897,12]]},"726":{"position":[[269,12],[1913,12],[4294,12],[6551,12],[11587,12],[12771,12],[14515,12],[16282,12],[19724,12],[20838,12],[22512,12],[24209,12],[28323,12],[29165,12],[30294,12],[31630,12],[34082,12],[34925,12],[36055,12],[37392,12],[39699,12],[40545,12],[41678,12],[43018,12],[45341,12],[46188,12],[47322,12],[48663,12]]},"728":{"position":[[365,12],[1208,12],[2338,12],[3675,12],[8284,12],[9123,12],[10249,12],[11582,12],[14201,12],[15049,12],[16184,12],[17526,12],[24619,12],[25466,12],[26600,12],[27941,12],[32867,12],[33705,12],[34830,12],[36162,12],[42402,12],[43240,12],[44365,12],[45697,12]]},"745":{"position":[[1896,12],[2702,12],[3950,12],[5319,12],[7580,12],[8424,12],[9555,12],[10893,12],[13270,12],[14076,12],[15324,12],[16693,12],[18911,12],[19755,12],[20886,12],[22224,12],[24537,12],[25382,12],[26514,12],[27853,12],[32271,12],[33115,12],[34246,12],[35584,12],[37897,12],[38741,12],[39872,12],[41210,12]]},"747":{"position":[[2425,12],[3460,12],[4996,12],[6604,12],[9739,12],[10585,12],[11718,12],[13058,12]]},"749":{"position":[[370,12],[1200,12],[2472,12],[3865,12],[6611,12],[7473,12],[8777,12],[10202,12],[12502,12],[13346,12],[14477,12],[15815,12]]},"751":{"position":[[3067,12],[3957,12],[5348,12],[6811,12],[9951,12],[10799,12],[11934,12],[13276,12],[17385,12],[18213,12],[19483,12],[20874,12]]},"771":{"position":[[582,12],[1387,12],[2634,12],[4002,12],[6230,12],[7039,12],[8290,12],[9662,12],[11914,12],[12866,12],[14378,12],[15913,12],[19148,12],[19991,12],[21121,12],[22458,12],[24847,12],[25688,12],[26816,12],[28151,12]]},"773":{"position":[[3000,12],[4005,12],[5629,12],[7227,12],[10476,12],[11322,12],[12455,12],[13795,12]]},"775":{"position":[[2905,12],[3798,12],[5192,12],[6658,12],[9430,12],[10518,12],[12225,12],[13906,12],[17660,12],[18500,12],[19627,12],[20961,12]]},"777":{"position":[[3100,12],[4055,12],[5570,12],[7108,12],[10352,12],[11197,12],[12329,12],[13668,12]]},"789":{"position":[[2673,12],[3998,12],[5942,12],[7860,12]]},"795":{"position":[[500,12],[1339,12],[2465,12],[3798,12],[6188,12],[7031,12],[8161,12],[9498,12],[11913,12],[12778,12],[14085,12],[15513,12],[17823,12],[18663,12],[19790,12],[21124,12]]},"797":{"position":[[4615,12],[5450,12],[6572,12],[7901,12],[10420,12],[11653,12],[13446,12],[15262,12],[18963,12],[19951,12],[21440,12],[23001,12],[25902,12],[26741,12],[27867,12],[29200,12]]},"799":{"position":[[1160,12],[2203,12],[3747,12],[5363,12],[8597,12],[9605,12],[10919,12],[12453,12],[15523,12],[16532,12],[17847,12],[19382,12]]},"801":{"position":[[3401,12],[5982,12],[9654,12],[12908,12]]},"820":{"position":[[1897,12],[2706,12],[3957,12],[5329,12],[7605,12],[8452,12],[9586,12],[10927,12],[13317,12],[14122,12],[15369,12],[16737,12],[18951,12],[19794,12],[20924,12],[22261,12],[24569,12],[25414,12],[26546,12],[27885,12],[31791,12],[32634,12],[33764,12],[35101,12],[37409,12],[38253,12],[39384,12],[40722,12]]},"822":{"position":[[2180,12],[3306,12],[5051,12],[6770,12],[10413,12],[11260,12],[12394,12],[13735,12]]},"824":{"position":[[2013,12],[3018,12],[4524,12],[6102,12],[9326,12],[10176,12],[11313,12],[12657,12]]},"826":{"position":[[2886,12],[4064,12],[5802,12],[7563,12],[10996,12],[11847,12],[12985,12],[14330,12],[16754,12],[17607,12],[18747,12],[20094,12],[22451,12],[23306,12],[24448,12],[25797,12],[28243,12],[29096,12],[30236,12],[31583,12],[33940,12],[34793,12],[35933,12],[37280,12]]},"844":{"position":[[2139,12],[3003,12],[4309,12],[5736,12],[8116,12],[8965,12],[10101,12],[11444,12],[13850,12],[14714,12],[16020,12],[17447,12],[19784,12],[20633,12],[21769,12],[23112,12],[25527,12],[26383,12],[27526,12],[28876,12],[31688,12],[32802,12],[34476,12],[36173,12],[39488,12],[40337,12],[41473,12],[42816,12]]},"846":{"position":[[200,12],[1044,12],[2175,12],[3513,12],[7482,12],[8325,12],[9455,12],[10792,12]]},"848":{"position":[[6968,12],[7997,12],[9586,12],[11198,12],[14584,12],[15517,12],[16892,12],[18388,12],[21027,12],[22004,12],[23482,12],[25032,12],[27861,12],[28753,12],[30146,12],[31611,12],[34345,12],[35180,12],[36457,12],[37855,12],[40232,12],[41050,12],[42310,12],[43691,12],[46133,12],[46974,12],[48102,12],[49437,12],[51804,12],[52660,12],[53803,12],[55153,12]]}}}],["apihost",{"_index":404,"t":{"35":{"position":[[1111,8],[2301,8],[4131,7]]},"43":{"position":[[243,8],[721,8],[1669,7]]},"45":{"position":[[12666,8],[13520,8],[14819,7],[18860,8],[19714,8],[21013,7],[25214,8],[26089,8],[27442,7]]},"113":{"position":[[560,8]]},"133":{"position":[[384,8],[935,8],[1820,7]]},"145":{"position":[[384,8],[935,8],[1820,7]]},"173":{"position":[[1276,8],[4694,8]]},"183":{"position":[[333,8],[960,8],[1755,7]]},"185":{"position":[[681,8],[1449,8],[2483,7]]},"187":{"position":[[557,8],[1474,8],[2646,7]]},"200":{"position":[[497,8],[1306,8],[2715,7]]},"202":{"position":[[507,8],[1358,8],[2654,7],[6251,8],[7104,8],[8402,7]]},"248":{"position":[[384,8],[935,8],[1820,7]]},"265":{"position":[[807,8],[1648,8],[2934,7]]},"267":{"position":[[518,8],[1322,8],[2726,7],[6222,8],[7064,8],[8351,7]]},"277":{"position":[[356,8],[907,8],[1792,7]]},"285":{"position":[[1812,8],[2659,8],[3951,7],[7450,8],[8296,8],[9742,7],[13474,8],[14325,8],[15621,7],[19076,8],[19929,8],[21227,7]]},"294":{"position":[[759,8],[1567,8],[2975,7]]},"296":{"position":[[550,8],[1402,8],[2699,7]]},"311":{"position":[[604,8],[1404,8],[2804,7],[6185,8],[6986,8],[8387,7],[11999,8],[12969,8],[14614,7]]},"357":{"position":[[680,8],[1539,8],[2843,7]]},"369":{"position":[[646,8],[1498,8],[2795,7],[6256,8],[7107,8],[8403,7]]},"375":{"position":[[765,8],[1633,8],[3101,7],[6941,8],[7793,8],[9090,7],[12755,8],[13607,8],[14904,7]]},"382":{"position":[[1625,8],[2474,8],[3768,7]]},"402":{"position":[[559,8],[1380,8],[2801,7]]},"404":{"position":[[580,8],[1439,8],[2743,7],[6417,8],[7277,8],[8582,7]]},"444":{"position":[[628,8],[1602,8],[3235,7],[7382,8],[8236,8],[9535,7]]},"446":{"position":[[530,8],[1614,8],[3357,7]]},"448":{"position":[[476,8],[1330,8],[2629,7]]},"462":{"position":[[646,8],[1501,8],[2801,7],[6280,8],[7134,8],[8433,7]]},"466":{"position":[[606,8],[1462,8],[2763,7],[6405,8],[7261,8],[8562,7]]},"504":{"position":[[534,8],[1341,8],[2748,7]]},"506":{"position":[[536,8],[1423,8],[2910,7]]},"508":{"position":[[653,8],[1512,8],[2816,7]]},"522":{"position":[[720,8],[1579,8],[3038,7]]},"524":{"position":[[785,8],[1640,8],[2940,7]]},"540":{"position":[[543,8],[1352,8],[2761,7]]},"542":{"position":[[876,8],[1762,8],[3248,7]]},"544":{"position":[[713,8],[1574,8],[2880,7]]},"562":{"position":[[768,8],[1712,8],[3315,7],[7316,8],[8168,8],[9465,7],[13311,8],[14163,8],[15460,7],[18997,8],[19851,8],[21150,7],[24623,8],[25476,8],[26774,7]]},"574":{"position":[[622,8],[1482,8],[3001,7]]},"578":{"position":[[629,8],[1485,8],[3000,7]]},"580":{"position":[[640,8],[1448,8],[2856,7]]},"582":{"position":[[486,8],[1326,8],[2611,7],[6000,8],[6840,8],[8125,7]]},"584":{"position":[[523,8],[1323,8],[2723,7],[6060,8],[6901,8],[8187,7]]},"599":{"position":[[645,8],[1495,8],[2790,7]]},"606":{"position":[[895,8],[1790,8],[3182,7],[7051,8],[7927,8],[9280,7],[13032,8],[13918,8],[15281,7]]},"608":{"position":[[1098,8],[1875,8],[3149,7]]},"613":{"position":[[636,8],[1525,8],[2886,7],[6548,8],[7437,8],[8798,7]]},"618":{"position":[[557,8],[1539,8],[3001,7]]},"637":{"position":[[772,8],[1697,8],[3222,7]]},"639":{"position":[[587,8],[1449,8],[2756,7]]},"645":{"position":[[497,8],[1521,8],[3204,7]]},"647":{"position":[[516,8],[1370,8],[2669,7]]},"649":{"position":[[497,8],[1377,8],[2857,7],[6555,8],[7410,8],[8710,7],[12188,8],[13046,8],[14349,7]]},"667":{"position":[[1776,8],[2627,8],[3923,7],[7948,8],[8799,8],[10095,7],[14769,8],[15623,8],[16922,7],[21606,8],[22457,8],[23753,7],[27842,8],[28694,8],[29991,7]]},"669":{"position":[[1749,8],[2601,8],[3898,7],[7998,8],[8853,8],[10153,7],[14342,8],[15195,8],[16493,7],[20665,8],[21518,8],[22816,7]]},"679":{"position":[[1463,8],[2316,8],[3614,7],[7081,8],[7933,8],[9230,7]]},"681":{"position":[[587,8],[1447,8],[2907,7],[6471,8],[7327,8],[8628,7]]},"683":{"position":[[562,8],[1525,8],[2925,7],[6839,8],[7724,8],[9268,7],[13101,8],[13987,8],[15532,7],[19403,8],[20256,8],[21554,7],[25066,8],[25917,8],[27213,7]]},"703":{"position":[[5148,8],[6025,8],[7502,7]]},"705":{"position":[[1539,8],[2444,8],[3949,7]]},"726":{"position":[[601,8],[2255,8],[4804,7],[11919,8],[13113,8],[15025,7],[20056,8],[21180,8],[23022,7],[28655,8],[29507,8],[30804,7],[34414,8],[35267,8],[36565,7],[40031,8],[40887,8],[42188,7],[45673,8],[46530,8],[47832,7]]},"728":{"position":[[697,8],[1550,8],[2848,7],[8616,8],[9465,8],[10759,7],[14533,8],[15391,8],[16694,7],[24951,8],[25808,8],[27110,7],[33199,8],[34047,8],[35340,7],[42734,8],[43582,8],[44875,7]]},"745":{"position":[[2228,8],[3044,8],[4460,7],[7912,8],[8766,8],[10065,7],[13602,8],[14418,8],[15834,7],[19243,8],[20097,8],[21396,7],[24869,8],[25724,8],[27024,7],[32603,8],[33457,8],[34756,7],[38229,8],[39083,8],[40382,7]]},"747":{"position":[[2757,8],[3802,8],[5506,7],[10071,8],[10927,8],[12228,7]]},"749":{"position":[[702,8],[1542,8],[2982,7],[6943,8],[7815,8],[9287,7],[12834,8],[13688,8],[14987,7]]},"751":{"position":[[3399,8],[4299,8],[5858,7],[10283,8],[11141,8],[12444,7],[17717,8],[18555,8],[19993,7]]},"771":{"position":[[914,8],[1729,8],[3144,7],[6562,8],[7381,8],[8800,7],[12246,8],[13208,8],[14888,7],[19480,8],[20333,8],[21631,7],[25179,8],[26030,8],[27326,7]]},"773":{"position":[[3332,8],[4347,8],[6139,7],[10808,8],[11664,8],[12965,7]]},"775":{"position":[[3237,8],[4140,8],[5702,7],[9762,8],[10860,8],[12735,7],[17992,8],[18842,8],[20137,7]]},"777":{"position":[[3432,8],[4397,8],[6080,7],[10684,8],[11539,8],[12839,7]]},"789":{"position":[[3005,8],[4340,8],[6452,7]]},"795":{"position":[[832,8],[1681,8],[2975,7],[6520,8],[7373,8],[8671,7],[12245,8],[13120,8],[14595,7],[18155,8],[19005,8],[20300,7]]},"797":{"position":[[4947,8],[5792,8],[7082,7],[10752,8],[11995,8],[13956,7],[19295,8],[20293,8],[21950,7],[26234,8],[27083,8],[28377,7]]},"799":{"position":[[1492,8],[2545,8],[4257,7],[8929,8],[9947,8],[11429,7],[15855,8],[16874,8],[18357,7]]},"801":{"position":[[3733,8],[6324,8],[10164,7]]},"820":{"position":[[2229,8],[3048,8],[4467,7],[7937,8],[8794,8],[10096,7],[13649,8],[14464,8],[15879,7],[19283,8],[20136,8],[21434,7],[24901,8],[25756,8],[27056,7],[32123,8],[32976,8],[34274,7],[37741,8],[38595,8],[39894,7]]},"822":{"position":[[2512,8],[3648,8],[5561,7],[10745,8],[11602,8],[12904,7]]},"824":{"position":[[2345,8],[3360,8],[5034,7],[9658,8],[10518,8],[11823,7]]},"826":{"position":[[3218,8],[4406,8],[6312,7],[11328,8],[12189,8],[13495,7],[17086,8],[17949,8],[19257,7],[22783,8],[23648,8],[24958,7],[28575,8],[29438,8],[30746,7],[34272,8],[35135,8],[36443,7]]},"844":{"position":[[2471,8],[3345,8],[4819,7],[8448,8],[9307,8],[10611,7],[14182,8],[15056,8],[16530,7],[20116,8],[20975,8],[22279,7],[25859,8],[26725,8],[28036,7],[32020,8],[33144,8],[34986,7],[39820,8],[40679,8],[41983,7]]},"846":{"position":[[532,8],[1386,8],[2685,7],[7814,8],[8667,8],[9965,7]]},"848":{"position":[[7300,8],[8339,8],[10096,7],[14916,8],[15859,8],[17402,7],[21359,8],[22346,8],[23992,7],[28193,8],[29095,8],[30656,7],[34677,8],[35522,8],[36967,7],[40564,8],[41392,8],[42820,7],[46465,8],[47316,8],[48612,7],[52136,8],[53002,8],[54313,7]]}}}],["apischem",{"_index":401,"t":{"35":{"position":[[1023,10],[2216,10],[4016,9]]},"43":{"position":[[171,10],[622,10],[1544,9]]},"45":{"position":[[12578,10],[13435,10],[14704,9],[18772,10],[19629,10],[20898,9],[25126,10],[26004,10],[27327,9]]},"113":{"position":[[487,10]]},"133":{"position":[[296,10],[850,10],[1705,9]]},"145":{"position":[[296,10],[850,10],[1705,9]]},"173":{"position":[[1178,10],[4595,10]]},"183":{"position":[[235,10],[861,10],[1630,9]]},"185":{"position":[[583,10],[1350,10],[2358,9]]},"187":{"position":[[459,10],[1375,10],[2521,9]]},"200":{"position":[[409,10],[1221,10],[2600,9]]},"202":{"position":[[419,10],[1273,10],[2539,9],[6163,10],[7019,10],[8287,9]]},"248":{"position":[[296,10],[850,10],[1705,9]]},"265":{"position":[[719,10],[1563,10],[2819,9]]},"267":{"position":[[430,10],[1237,10],[2611,9],[6134,10],[6979,10],[8236,9]]},"277":{"position":[[268,10],[822,10],[1677,9]]},"285":{"position":[[1724,10],[2574,10],[3836,9],[7362,10],[8211,10],[9627,9],[13386,10],[14240,10],[15506,9],[18988,10],[19844,10],[21112,9]]},"294":{"position":[[671,10],[1482,10],[2860,9]]},"296":{"position":[[462,10],[1317,10],[2584,9]]},"311":{"position":[[516,10],[1319,10],[2689,9],[6097,10],[6901,10],[8272,9],[11911,10],[12884,10],[14499,9]]},"357":{"position":[[592,10],[1454,10],[2728,9]]},"369":{"position":[[558,10],[1413,10],[2680,9],[6168,10],[7022,10],[8288,9]]},"375":{"position":[[677,10],[1548,10],[2986,9],[6853,10],[7708,10],[8975,9],[12667,10],[13522,10],[14789,9]]},"382":{"position":[[1537,10],[2389,10],[3653,9]]},"402":{"position":[[471,10],[1295,10],[2686,9]]},"404":{"position":[[492,10],[1354,10],[2628,9],[6329,10],[7192,10],[8467,9]]},"444":{"position":[[540,10],[1517,10],[3120,9],[7294,10],[8151,10],[9420,9]]},"446":{"position":[[442,10],[1529,10],[3242,9]]},"448":{"position":[[388,10],[1245,10],[2514,9]]},"462":{"position":[[558,10],[1416,10],[2686,9],[6192,10],[7049,10],[8318,9]]},"466":{"position":[[518,10],[1377,10],[2648,9],[6317,10],[7176,10],[8447,9]]},"504":{"position":[[446,10],[1256,10],[2633,9]]},"506":{"position":[[448,10],[1338,10],[2795,9]]},"508":{"position":[[565,10],[1427,10],[2701,9]]},"522":{"position":[[632,10],[1494,10],[2923,9]]},"524":{"position":[[697,10],[1555,10],[2825,9]]},"540":{"position":[[455,10],[1267,10],[2646,9]]},"542":{"position":[[788,10],[1677,10],[3133,9]]},"544":{"position":[[625,10],[1489,10],[2765,9]]},"562":{"position":[[680,10],[1627,10],[3200,9],[7228,10],[8083,10],[9350,9],[13223,10],[14078,10],[15345,9],[18909,10],[19766,10],[21035,9],[24535,10],[25391,10],[26659,9]]},"574":{"position":[[534,10],[1397,10],[2886,9]]},"578":{"position":[[541,10],[1400,10],[2885,9]]},"580":{"position":[[552,10],[1363,10],[2741,9]]},"582":{"position":[[398,10],[1241,10],[2496,9],[5912,10],[6755,10],[8010,9]]},"584":{"position":[[435,10],[1238,10],[2608,9],[5972,10],[6816,10],[8072,9]]},"599":{"position":[[557,10],[1410,10],[2675,9]]},"606":{"position":[[807,10],[1705,10],[3067,9],[6963,10],[7842,10],[9165,9],[12944,10],[13833,10],[15166,9]]},"608":{"position":[[1010,10],[1790,10],[3034,9]]},"613":{"position":[[548,10],[1440,10],[2771,9],[6460,10],[7352,10],[8683,9]]},"618":{"position":[[469,10],[1454,10],[2886,9]]},"637":{"position":[[684,10],[1612,10],[3107,9]]},"639":{"position":[[499,10],[1364,10],[2641,9]]},"645":{"position":[[409,10],[1436,10],[3089,9]]},"647":{"position":[[428,10],[1285,10],[2554,9]]},"649":{"position":[[409,10],[1292,10],[2742,9],[6467,10],[7325,10],[8595,9],[12100,10],[12961,10],[14234,9]]},"667":{"position":[[1688,10],[2542,10],[3808,9],[7860,10],[8714,10],[9980,9],[14681,10],[15538,10],[16807,9],[21518,10],[22372,10],[23638,9],[27754,10],[28609,10],[29876,9]]},"669":{"position":[[1661,10],[2516,10],[3783,9],[7910,10],[8768,10],[10038,9],[14254,10],[15110,10],[16378,9],[20577,10],[21433,10],[22701,9]]},"679":{"position":[[1375,10],[2231,10],[3499,9],[6993,10],[7848,10],[9115,9]]},"681":{"position":[[499,10],[1362,10],[2792,9],[6383,10],[7242,10],[8513,9]]},"683":{"position":[[474,10],[1440,10],[2810,9],[6751,10],[7639,10],[9153,9],[13013,10],[13902,10],[15417,9],[19315,10],[20171,10],[21439,9],[24978,10],[25832,10],[27098,9]]},"703":{"position":[[5060,10],[5940,10],[7387,9]]},"705":{"position":[[1451,10],[2359,10],[3834,9]]},"726":{"position":[[513,10],[2170,10],[4689,9],[11831,10],[13028,10],[14910,9],[19968,10],[21095,10],[22907,9],[28567,10],[29422,10],[30689,9],[34326,10],[35182,10],[36450,9],[39943,10],[40802,10],[42073,9],[45585,10],[46445,10],[47717,9]]},"728":{"position":[[609,10],[1465,10],[2733,9],[8528,10],[9380,10],[10644,9],[14445,10],[15306,10],[16579,9],[24863,10],[25723,10],[26995,9],[33111,10],[33962,10],[35225,9],[42646,10],[43497,10],[44760,9]]},"745":{"position":[[2140,10],[2959,10],[4345,9],[7824,10],[8681,10],[9950,9],[13514,10],[14333,10],[15719,9],[19155,10],[20012,10],[21281,9],[24781,10],[25639,10],[26909,9],[32515,10],[33372,10],[34641,9],[38141,10],[38998,10],[40267,9]]},"747":{"position":[[2669,10],[3717,10],[5391,9],[9983,10],[10842,10],[12113,9]]},"749":{"position":[[614,10],[1457,10],[2867,9],[6855,10],[7730,10],[9172,9],[12746,10],[13603,10],[14872,9]]},"751":{"position":[[3311,10],[4214,10],[5743,9],[10195,10],[11056,10],[12329,9],[17629,10],[18470,10],[19878,9]]},"771":{"position":[[826,10],[1644,10],[3029,9],[6474,10],[7296,10],[8685,9],[12158,10],[13123,10],[14773,9],[19392,10],[20248,10],[21516,9],[25091,10],[25945,10],[27211,9]]},"773":{"position":[[3244,10],[4262,10],[6024,9],[10720,10],[11579,10],[12850,9]]},"775":{"position":[[3149,10],[4055,10],[5587,9],[9674,10],[10775,10],[12620,9],[17904,10],[18757,10],[20022,9]]},"777":{"position":[[3344,10],[4312,10],[5965,9],[10596,10],[11454,10],[12724,9]]},"789":{"position":[[2917,10],[4255,10],[6337,9]]},"795":{"position":[[744,10],[1596,10],[2860,9],[6432,10],[7288,10],[8556,9],[12157,10],[13035,10],[14480,9],[18067,10],[18920,10],[20185,9]]},"797":{"position":[[4859,10],[5707,10],[6967,9],[10664,10],[11910,10],[13841,9],[19207,10],[20208,10],[21835,9],[26146,10],[26998,10],[28262,9]]},"799":{"position":[[1404,10],[2460,10],[4142,9],[8841,10],[9862,10],[11314,9],[15767,10],[16789,10],[18242,9]]},"801":{"position":[[3645,10],[6239,10],[10049,9]]},"820":{"position":[[2141,10],[2963,10],[4352,9],[7849,10],[8709,10],[9981,9],[13561,10],[14379,10],[15764,9],[19195,10],[20051,10],[21319,9],[24813,10],[25671,10],[26941,9],[32035,10],[32891,10],[34159,9],[37653,10],[38510,10],[39779,9]]},"822":{"position":[[2424,10],[3563,10],[5446,9],[10657,10],[11517,10],[12789,9]]},"824":{"position":[[2257,10],[3275,10],[4919,9],[9570,10],[10433,10],[11708,9]]},"826":{"position":[[3130,10],[4321,10],[6197,9],[11240,10],[12104,10],[13380,9],[16998,10],[17864,10],[19142,9],[22695,10],[23563,10],[24843,9],[28487,10],[29353,10],[30631,9],[34184,10],[35050,10],[36328,9]]},"844":{"position":[[2383,10],[3260,10],[4704,9],[8360,10],[9222,10],[10496,9],[14094,10],[14971,10],[16415,9],[20028,10],[20890,10],[22164,9],[25771,10],[26640,10],[27921,9],[31932,10],[33059,10],[34871,9],[39732,10],[40594,10],[41868,9]]},"846":{"position":[[444,10],[1301,10],[2570,9],[7726,10],[8582,10],[9850,9]]},"848":{"position":[[7212,10],[8254,10],[9981,9],[14828,10],[15774,10],[17287,9],[21271,10],[22261,10],[23877,9],[28105,10],[29010,10],[30541,9],[34589,10],[35437,10],[36852,9],[40476,10],[41307,10],[42705,9],[46377,10],[47231,10],[48497,9],[52048,10],[52917,10],[54198,9]]}}}],["apitoken",{"_index":1234,"t":{"185":{"position":[[1954,9],[2044,12],[3038,8]]}}}],["apitokenissu",{"_index":389,"t":{"35":{"position":[[763,15],[1943,15],[3605,15],[5317,15]]},"45":{"position":[[12318,15],[13162,15],[14293,15],[15631,15],[18512,15],[19356,15],[20487,15],[21825,15],[24866,15],[25731,15],[26916,15],[28296,15]]},"187":{"position":[[995,15],[3210,14]]},"200":{"position":[[149,15],[948,15],[2189,15],[3551,15]]},"202":{"position":[[159,15],[1000,15],[2128,15],[3463,15],[5903,15],[6746,15],[7876,15],[9213,15]]},"265":{"position":[[459,15],[1290,15],[2408,15],[3733,15]]},"267":{"position":[[170,15],[964,15],[2200,15],[3557,15],[5874,15],[6706,15],[7825,15],[9151,15]]},"285":{"position":[[1464,15],[2301,15],[3425,15],[4756,15],[7102,15],[7938,15],[9216,15],[10615,15],[13126,15],[13967,15],[15095,15],[16430,15],[18728,15],[19571,15],[20701,15],[22038,15]]},"294":{"position":[[411,15],[1209,15],[2449,15],[3810,15]]},"296":{"position":[[202,15],[1044,15],[2173,15],[3509,15]]},"311":{"position":[[256,15],[1046,15],[2278,15],[3631,15],[5837,15],[6628,15],[7861,15],[9215,15],[11651,15],[12611,15],[14088,15],[15648,15]]},"357":{"position":[[332,15],[1181,15],[2317,15],[3660,15]]},"369":{"position":[[298,15],[1140,15],[2269,15],[3605,15],[5908,15],[6749,15],[7877,15],[9212,15]]},"375":{"position":[[417,15],[1275,15],[2575,15],[3996,15],[6593,15],[7435,15],[8564,15],[9900,15],[12407,15],[13249,15],[14378,15],[15714,15]]},"382":{"position":[[1277,15],[2116,15],[3242,15],[4575,15]]},"402":{"position":[[211,15],[1022,15],[2275,15],[3649,15]]},"404":{"position":[[232,15],[1081,15],[2217,15],[3560,15],[6069,15],[6919,15],[8056,15],[9400,15]]},"444":{"position":[[280,15],[1244,15],[2709,15],[4246,15],[7034,15],[7878,15],[9009,15],[10347,15]]},"446":{"position":[[182,15],[1256,15],[2831,15],[4478,15]]},"448":{"position":[[128,15],[972,15],[2103,15],[3441,15]]},"462":{"position":[[298,15],[1143,15],[2275,15],[3614,15],[5932,15],[6776,15],[7907,15],[9245,15]]},"466":{"position":[[258,15],[1104,15],[2237,15],[3577,15],[6057,15],[6903,15],[8036,15],[9376,15]]},"504":{"position":[[186,15],[983,15],[2222,15],[3582,15]]},"506":{"position":[[188,15],[1065,15],[2384,15],[3824,15]]},"508":{"position":[[305,15],[1154,15],[2290,15],[3633,15]]},"522":{"position":[[372,15],[1221,15],[2512,15],[3924,15]]},"524":{"position":[[437,15],[1282,15],[2414,15],[3753,15]]},"540":{"position":[[195,15],[994,15],[2235,15],[3597,15]]},"542":{"position":[[528,15],[1404,15],[2722,15],[4161,15]]},"544":{"position":[[365,15],[1216,15],[2354,15],[3699,15]]},"562":{"position":[[420,15],[1354,15],[2789,15],[4296,15],[6968,15],[7810,15],[8939,15],[10275,15],[12963,15],[13805,15],[14934,15],[16270,15],[18649,15],[19493,15],[20624,15],[21962,15],[24275,15],[25118,15],[26248,15],[27585,15]]},"574":{"position":[[274,15],[1124,15],[2475,15],[3898,15]]},"578":{"position":[[281,15],[1127,15],[2474,15],[3893,15]]},"580":{"position":[[292,15],[1090,15],[2330,15],[3691,15]]},"582":{"position":[[138,15],[968,15],[2085,15],[3409,15],[5652,15],[6482,15],[7599,15],[8923,15]]},"584":{"position":[[175,15],[965,15],[2197,15],[3550,15],[5712,15],[6543,15],[7661,15],[8986,15]]},"599":{"position":[[297,15],[1137,15],[2264,15],[3598,15]]},"606":{"position":[[547,15],[1432,15],[2656,15],[4043,15],[6703,15],[7569,15],[8754,15],[10120,15],[12684,15],[13560,15],[14755,15],[16131,15]]},"608":{"position":[[750,15],[1517,15],[2623,15],[3892,15]]},"613":{"position":[[288,15],[1167,15],[2360,15],[3756,15],[6200,15],[7079,15],[8272,15],[9668,15]]},"618":{"position":[[209,15],[1181,15],[2475,15],[3976,15]]},"637":{"position":[[424,15],[1339,15],[2696,15],[4174,15]]},"639":{"position":[[239,15],[1091,15],[2230,15],[3576,15]]},"645":{"position":[[149,15],[1163,15],[2678,15],[4265,15]]},"647":{"position":[[168,15],[1012,15],[2143,15],[3481,15]]},"649":{"position":[[149,15],[1019,15],[2331,15],[3764,15],[6207,15],[7052,15],[8184,15],[9523,15],[11840,15],[12688,15],[13823,15],[15165,15]]},"667":{"position":[[1428,15],[2269,15],[3397,15],[4732,15],[7600,15],[8441,15],[9569,15],[10904,15],[14421,15],[15265,15],[16396,15],[17734,15],[21258,15],[22099,15],[23227,15],[24562,15],[27494,15],[28336,15],[29465,15],[30801,15]]},"669":{"position":[[1401,15],[2243,15],[3372,15],[4708,15],[7650,15],[8495,15],[9627,15],[10966,15],[13994,15],[14837,15],[15967,15],[17304,15],[20317,15],[21160,15],[22290,15],[23627,15]]},"679":{"position":[[1115,15],[1958,15],[3088,15],[4425,15],[6733,15],[7575,15],[8704,15],[10040,15]]},"681":{"position":[[239,15],[1089,15],[2381,15],[3794,15],[6123,15],[6969,15],[8102,15],[9442,15]]},"683":{"position":[[214,15],[1167,15],[2399,15],[3848,15],[6491,15],[7366,15],[8742,15],[10190,15],[12753,15],[13629,15],[15006,15],[16455,15],[19055,15],[19898,15],[21028,15],[22365,15],[24718,15],[25559,15],[26687,15],[28022,15]]},"703":{"position":[[4800,15],[5667,15],[6976,15],[8406,15]]},"705":{"position":[[1191,15],[2086,15],[3423,15],[4881,15]]},"726":{"position":[[253,15],[1897,15],[4278,15],[6535,15],[11571,15],[12755,15],[14499,15],[16266,15],[19708,15],[20822,15],[22496,15],[24193,15],[28307,15],[29149,15],[30278,15],[31614,15],[34066,15],[34909,15],[36039,15],[37376,15],[39683,15],[40529,15],[41662,15],[43002,15],[45325,15],[46172,15],[47306,15],[48647,15]]},"728":{"position":[[349,15],[1192,15],[2322,15],[3659,15],[8268,15],[9107,15],[10233,15],[11566,15],[14185,15],[15033,15],[16168,15],[17510,15],[24603,15],[25450,15],[26584,15],[27925,15],[32851,15],[33689,15],[34814,15],[36146,15],[42386,15],[43224,15],[44349,15],[45681,15]]},"745":{"position":[[1880,15],[2686,15],[3934,15],[5303,15],[7564,15],[8408,15],[9539,15],[10877,15],[13254,15],[14060,15],[15308,15],[16677,15],[18895,15],[19739,15],[20870,15],[22208,15],[24521,15],[25366,15],[26498,15],[27837,15],[32255,15],[33099,15],[34230,15],[35568,15],[37881,15],[38725,15],[39856,15],[41194,15]]},"747":{"position":[[2409,15],[3444,15],[4980,15],[6588,15],[9723,15],[10569,15],[11702,15],[13042,15]]},"749":{"position":[[354,15],[1184,15],[2456,15],[3849,15],[6595,15],[7457,15],[8761,15],[10186,15],[12486,15],[13330,15],[14461,15],[15799,15]]},"751":{"position":[[3051,15],[3941,15],[5332,15],[6795,15],[9935,15],[10783,15],[11918,15],[13260,15],[17369,15],[18197,15],[19467,15],[20858,15]]},"771":{"position":[[566,15],[1371,15],[2618,15],[3986,15],[6214,15],[7023,15],[8274,15],[9646,15],[11898,15],[12850,15],[14362,15],[15897,15],[19132,15],[19975,15],[21105,15],[22442,15],[24831,15],[25672,15],[26800,15],[28135,15]]},"773":{"position":[[2984,15],[3989,15],[5613,15],[7211,15],[10460,15],[11306,15],[12439,15],[13779,15]]},"775":{"position":[[2889,15],[3782,15],[5176,15],[6642,15],[9414,15],[10502,15],[12209,15],[13890,15],[17644,15],[18484,15],[19611,15],[20945,15]]},"777":{"position":[[3084,15],[4039,15],[5554,15],[7092,15],[10336,15],[11181,15],[12313,15],[13652,15]]},"789":{"position":[[2657,15],[3982,15],[5926,15],[7844,15]]},"795":{"position":[[484,15],[1323,15],[2449,15],[3782,15],[6172,15],[7015,15],[8145,15],[9482,15],[11897,15],[12762,15],[14069,15],[15497,15],[17807,15],[18647,15],[19774,15],[21108,15]]},"797":{"position":[[4599,15],[5434,15],[6556,15],[7885,15],[10404,15],[11637,15],[13430,15],[15246,15],[18947,15],[19935,15],[21424,15],[22985,15],[25886,15],[26725,15],[27851,15],[29184,15]]},"799":{"position":[[1144,15],[2187,15],[3731,15],[5347,15],[8581,15],[9589,15],[10903,15],[12437,15],[15507,15],[16516,15],[17831,15],[19366,15]]},"801":{"position":[[3385,15],[5966,15],[9638,15],[12892,15]]},"820":{"position":[[1881,15],[2690,15],[3941,15],[5313,15],[7589,15],[8436,15],[9570,15],[10911,15],[13301,15],[14106,15],[15353,15],[16721,15],[18935,15],[19778,15],[20908,15],[22245,15],[24553,15],[25398,15],[26530,15],[27869,15],[31775,15],[32618,15],[33748,15],[35085,15],[37393,15],[38237,15],[39368,15],[40706,15]]},"822":{"position":[[2164,15],[3290,15],[5035,15],[6754,15],[10397,15],[11244,15],[12378,15],[13719,15]]},"824":{"position":[[1997,15],[3002,15],[4508,15],[6086,15],[9310,15],[10160,15],[11297,15],[12641,15]]},"826":{"position":[[2870,15],[4048,15],[5786,15],[7547,15],[10980,15],[11831,15],[12969,15],[14314,15],[16738,15],[17591,15],[18731,15],[20078,15],[22435,15],[23290,15],[24432,15],[25781,15],[28227,15],[29080,15],[30220,15],[31567,15],[33924,15],[34777,15],[35917,15],[37264,15]]},"844":{"position":[[2123,15],[2987,15],[4293,15],[5720,15],[8100,15],[8949,15],[10085,15],[11428,15],[13834,15],[14698,15],[16004,15],[17431,15],[19768,15],[20617,15],[21753,15],[23096,15],[25511,15],[26367,15],[27510,15],[28860,15],[31672,15],[32786,15],[34460,15],[36157,15],[39472,15],[40321,15],[41457,15],[42800,15]]},"846":{"position":[[184,15],[1028,15],[2159,15],[3497,15],[7466,15],[8309,15],[9439,15],[10776,15]]},"848":{"position":[[6952,15],[7981,15],[9570,15],[11182,15],[14568,15],[15501,15],[16876,15],[18372,15],[21011,15],[21988,15],[23466,15],[25016,15],[27845,15],[28737,15],[30130,15],[31595,15],[34329,15],[35164,15],[36441,15],[37839,15],[40216,15],[41034,15],[42294,15],[43675,15],[46117,15],[46958,15],[48086,15],[49421,15],[51788,15],[52644,15],[53787,15],[55137,15]]}}}],["apk",{"_index":942,"t":{"113":{"position":[[1411,4],[1453,4],[1626,3]]},"117":{"position":[[27,4],[200,3]]}}}],["app",{"_index":1104,"t":{"169":{"position":[[1449,3]]},"171":{"position":[[1960,3]]},"173":{"position":[[3201,3]]},"440":{"position":[[294,3]]},"548":{"position":[[1401,3]]},"728":{"position":[[22788,3],[39974,3]]},"753":{"position":[[113,5]]},"836":{"position":[[21,3]]}}}],["app.get(\"/read/:docu",{"_index":1106,"t":{"169":{"position":[[1468,26]]},"171":{"position":[[2300,26]]},"173":{"position":[[3610,26]]}}}],["app.j",{"_index":1086,"t":{"169":{"position":[[541,7]]},"171":{"position":[[1113,6]]},"173":{"position":[[2003,7]]}}}],["app.listen(\":3000",{"_index":1107,"t":{"169":{"position":[[1501,19]]},"171":{"position":[[2333,19]]},"173":{"position":[[3643,19]]}}}],["app.use(\"/read/:docu",{"_index":1193,"t":{"173":{"position":[[3541,26]]}}}],["app.use(checkauthor",{"_index":1194,"t":{"173":{"position":[[3582,27]]}}}],["app.use(jwtware.new(jwtware.config",{"_index":1163,"t":{"171":{"position":[[2203,35]]},"173":{"position":[[3444,35]]}}}],["appdevelopercon",{"_index":529,"t":{"39":{"position":[[349,15]]}}}],["appear",{"_index":1923,"t":{"478":{"position":[[371,11],[2036,6]]}}}],["appli",{"_index":260,"t":{"15":{"position":[[70,7]]},"311":{"position":[[11411,7]]},"508":{"position":[[6098,8]]},"667":{"position":[[13569,6]]},"669":{"position":[[13471,7]]},"751":{"position":[[46,5]]},"824":{"position":[[124,7]]}}}],["applic",{"_index":533,"t":{"39":{"position":[[414,12]]},"105":{"position":[[448,13]]},"125":{"position":[[187,11]]},"153":{"position":[[135,13]]},"214":{"position":[[272,11]]},"265":{"position":[[8,12]]},"343":{"position":[[199,12],[281,11],[395,11]]},"357":{"position":[[6049,11]]},"361":{"position":[[241,13]]},"375":{"position":[[18195,11]]},"400":{"position":[[8,12]]},"404":{"position":[[11802,11]]},"412":{"position":[[3247,11]]},"428":{"position":[[125,11],[199,11],[450,11],[656,11],[814,12]]},"430":{"position":[[178,11]]},"432":{"position":[[32,11]]},"482":{"position":[[3524,11]]},"504":{"position":[[5743,11]]},"512":{"position":[[168,11]]},"514":{"position":[[1660,11]]},"536":{"position":[[18,12]]},"544":{"position":[[6287,11]]},"548":{"position":[[1151,11],[1355,11],[1692,12]]},"562":{"position":[[30295,11]]},"626":{"position":[[45,11]]},"639":{"position":[[6399,11]]},"728":{"position":[[22664,11],[22913,11]]},"838":{"position":[[788,13]]}}}],["application'",{"_index":1427,"t":{"216":{"position":[[89,13]]}}}],["application/json",{"_index":495,"t":{"35":{"position":[[7866,17]]},"43":{"position":[[3239,17]]},"45":{"position":[[17433,17],[23627,17],[30178,17]]},"135":{"position":[[1449,17]]},"147":{"position":[[1691,17]]},"200":{"position":[[5034,17]]},"202":{"position":[[5259,17],[11013,17]]},"250":{"position":[[1527,17]]},"252":{"position":[[1650,17]]},"265":{"position":[[5509,17]]},"267":{"position":[[5037,17],[10929,17]]},"279":{"position":[[1007,17],[2885,17]]},"281":{"position":[[2052,17],[3795,17]]},"285":{"position":[[6544,17],[12134,17],[18226,17],[23838,17]]},"294":{"position":[[5294,17]]},"296":{"position":[[5307,17]]},"311":{"position":[[5105,17],[10692,17],[17302,17]]},"357":{"position":[[5472,17]]},"369":{"position":[[5403,17],[11008,17]]},"375":{"position":[[5537,17],[11698,17],[17512,17]]},"382":{"position":[[6367,17]]},"402":{"position":[[5144,17]]},"404":{"position":[[5372,17],[11214,17]]},"422":{"position":[[2609,17]]},"444":{"position":[[5902,17],[12149,17]]},"446":{"position":[[6244,17]]},"448":{"position":[[5243,17]]},"462":{"position":[[5418,17],[11047,17]]},"466":{"position":[[5383,17],[11182,17]]},"504":{"position":[[5063,17]]},"506":{"position":[[5384,17]]},"508":{"position":[[5445,17]]},"522":{"position":[[5456,17]]},"524":{"position":[[5557,17]]},"540":{"position":[[5080,17]]},"542":{"position":[[5720,17]]},"544":{"position":[[5515,17]]},"562":{"position":[[5922,17],[12073,17],[18068,17],[23764,17],[29385,17]]},"574":{"position":[[5442,17]]},"578":{"position":[[5433,17]]},"580":{"position":[[5173,17]]},"582":{"position":[[5183,17],[10697,17]]},"584":{"position":[[5026,17],[10762,17]]},"599":{"position":[[5392,17]]},"606":{"position":[[5845,17],[11885,17],[17916,17]]},"608":{"position":[[5576,17]]},"613":{"position":[[5545,17],[11457,17]]},"618":{"position":[[6014,17]]},"637":{"position":[[5772,17]]},"639":{"position":[[5394,17]]},"645":{"position":[[5971,17]]},"647":{"position":[[5283,17]]},"649":{"position":[[5319,17],[11327,17],[16975,17]]},"667":{"position":[[6528,17],[12700,17],[19536,17],[26358,17],[32599,17]]},"669":{"position":[[6506,17],[12770,17],[19104,17],[25427,17]]},"679":{"position":[[6225,17],[11838,17]]},"681":{"position":[[5327,17],[11248,17]]},"683":{"position":[[5665,17],[11759,17],[18027,17],[24165,17],[29818,17]]},"695":{"position":[[8224,17]]},"701":{"position":[[1615,17],[3456,17],[5305,17],[7156,17],[9003,17],[10856,17]]},"703":{"position":[[4198,17],[9956,17],[12083,17]]},"705":{"position":[[6461,17],[9154,17],[11830,17]]},"707":{"position":[[7763,17]]},"726":{"position":[[8907,17],[18151,17],[26008,17],[33412,17],[39176,17],[44808,17],[50455,17]]},"728":{"position":[[5459,17],[13358,17],[19320,17],[29733,17],[37936,17],[47471,17]]},"745":{"position":[[6793,17],[12679,17],[18167,17],[24010,17],[29641,17],[37370,17],[42996,17]]},"747":{"position":[[8315,17],[14848,17]]},"749":{"position":[[5363,17],[11731,17],[17601,17]]},"751":{"position":[[8379,17],[15070,17],[22370,17]]},"771":{"position":[[5475,17],[11139,17],[17553,17],[24242,17],[29931,17]]},"773":{"position":[[8930,17],[15585,17]]},"775":{"position":[[8229,17],[15692,17],[22739,17]]},"777":{"position":[[8751,17],[15456,17]]},"789":{"position":[[9879,17]]},"795":{"position":[[5574,17],[11282,17],[17045,17],[22902,17]]},"797":{"position":[[9669,17],[17180,17],[24665,17],[30976,17]]},"799":{"position":[[7084,17],[14515,17],[21446,17]]},"801":{"position":[[16255,17]]},"820":{"position":[[6806,17],[12719,17],[18210,17],[24045,17],[29673,17],[36885,17],[42508,17]]},"822":{"position":[[8592,17],[15527,17]]},"824":{"position":[[7783,17],[14455,17]]},"826":{"position":[[9426,17],[16130,17],[21898,17],[27605,17],[33387,17],[39084,17]]},"844":{"position":[[7267,17],[13240,17],[18978,17],[24908,17],[30686,17],[37972,17],[44612,17]]},"846":{"position":[[5299,17],[12576,17]]},"848":{"position":[[12915,17],[19988,17],[26686,17],[33181,17],[39358,17],[45177,17],[51217,17],[56963,17]]}}}],["application:ifft",{"_index":663,"t":{"45":{"position":[[5989,16]]}}}],["approach",{"_index":2395,"t":{"724":{"position":[[51,8]]},"749":{"position":[[6401,8]]}}}],["appropri",{"_index":870,"t":{"103":{"position":[[317,11]]},"153":{"position":[[320,11]]},"173":{"position":[[137,11]]},"327":{"position":[[3718,12]]},"418":{"position":[[3361,11],[3425,13]]},"797":{"position":[[108,11]]}}}],["approv",{"_index":2004,"t":{"490":{"position":[[680,7]]},"699":{"position":[[393,8]]},"703":{"position":[[2490,8]]},"797":{"position":[[860,8],[995,8],[1232,8],[4237,8],[4452,8],[10135,8],[11407,8],[13072,8],[15015,8],[16630,8],[18543,8]]},"801":{"position":[[5736,8],[9280,8],[12661,8],[15705,8],[20899,8]]}}}],["approved_context",{"_index":2720,"t":{"797":{"position":[[1057,18],[1449,17],[1687,19],[2461,18],[2972,16],[3580,18]]},"801":{"position":[[251,17],[511,16],[1021,19],[2182,18]]},"803":{"position":[[464,17],[724,16],[1421,19],[2649,18]]}}}],["approved_ip_address_rang",{"_index":2719,"t":{"797":{"position":[[922,27],[1168,27],[1359,26],[1509,25],[1605,28],[1946,27],[2153,28],[11491,28],[15107,28],[18125,25]]},"801":{"position":[[161,26],[311,25],[939,28],[1280,27],[1487,28],[5820,28],[12753,28],[19097,25]]},"803":{"position":[[374,26],[524,25],[1339,28],[1680,27],[1954,28]]}}}],["approved_timeslot",{"_index":2718,"t":{"797":{"position":[[796,19],[1136,17],[1412,18],[1477,17],[1650,20],[1800,19],[2253,20],[11151,20],[11303,20],[14747,20],[14909,20],[17847,17],[17979,17]]},"801":{"position":[[214,18],[279,17],[984,20],[1134,19],[1587,20],[4721,20],[4872,20],[5025,20],[5178,20],[5330,20],[5481,20],[5632,20],[11584,20],[11745,20],[11908,20],[12071,20],[12233,20],[12394,20],[12555,20],[18160,17],[18291,17],[18423,17],[18555,17],[18687,17],[18819,17],[18951,17]]},"803":{"position":[[427,18],[492,17],[1384,20],[1534,19],[2054,20]]}}}],["apt",{"_index":947,"t":{"113":{"position":[[1504,3]]},"117":{"position":[[78,3]]}}}],["arbitrari",{"_index":1833,"t":{"428":{"position":[[481,9]]},"482":{"position":[[775,9],[5546,9]]}}}],["archiv",{"_index":2851,"t":{"838":{"position":[[696,9],[953,7]]}}}],["around",{"_index":1015,"t":{"153":{"position":[[1775,6]]}}}],["array",{"_index":672,"t":{"45":{"position":[[7593,5]]},"63":{"position":[[35,5]]},"279":{"position":[[1077,5]]}}}],["articl",{"_index":367,"t":{"31":{"position":[[5,7]]},"41":{"position":[[183,7]]},"181":{"position":[[5,7]]},"206":{"position":[[5,7]]},"472":{"position":[[1054,8]]},"726":{"position":[[27656,7]]},"732":{"position":[[95,7],[147,8]]},"765":{"position":[[624,7]]},"840":{"position":[[1075,7]]}}}],["articul",{"_index":70,"t":{"3":{"position":[[999,12]]}}}],["artifact",{"_index":1070,"t":{"159":{"position":[[139,8]]}}}],["asid",{"_index":2573,"t":{"769":{"position":[[286,5]]},"842":{"position":[[446,5]]}}}],["ask",{"_index":1591,"t":{"285":{"position":[[12962,3]]},"404":{"position":[[95,6]]},"482":{"position":[[180,5]]},"606":{"position":[[478,3]]},"639":{"position":[[95,6]]},"647":{"position":[[85,3]]},"717":{"position":[[280,7]]},"726":{"position":[[28001,3]]},"728":{"position":[[5987,6],[8126,3],[20204,5],[24451,3],[30538,3],[32716,3]]},"745":{"position":[[7432,3],[18799,3]]},"761":{"position":[[218,3]]},"769":{"position":[[186,3]]},"771":{"position":[[18807,3]]},"775":{"position":[[17414,6],[17439,6],[17523,3]]},"820":{"position":[[7454,3],[18839,3]]},"842":{"position":[[39,3]]},"844":{"position":[[7974,3],[19688,6]]}}}],["assert",{"_index":206,"t":{"9":{"position":[[250,11]]},"271":{"position":[[343,11]]},"424":{"position":[[385,10]]},"484":{"position":[[813,11],[836,9],[984,10],[1039,10],[1140,10],[2423,11],[2529,10],[3754,11],[3770,11],[3790,11],[3996,10]]},"486":{"position":[[105,10]]}}}],["asset",{"_index":1837,"t":{"430":{"position":[[209,5],[267,6],[405,5],[526,5],[684,6]]},"432":{"position":[[63,5],[121,6]]},"440":{"position":[[200,5],[313,5],[474,6],[494,5],[559,6],[579,5],[643,6],[670,5],[734,6],[761,5]]},"442":{"position":[[306,5],[538,6]]},"446":{"position":[[889,6],[972,6],[1061,6],[1143,6],[2277,6],[2508,6],[4100,6],[4192,6],[4282,6],[4373,6],[5548,6],[5729,6],[6835,5],[6972,5],[7064,6],[7240,6]]},"448":{"position":[[844,6],[1938,6],[3313,6],[4840,5],[5559,6],[5602,6]]}}}],["assign",{"_index":133,"t":{"3":{"position":[[2833,8]]},"21":{"position":[[46,8]]},"45":{"position":[[7782,8]]},"87":{"position":[[1104,8],[1162,10]]},"89":{"position":[[1343,8]]},"91":{"position":[[1119,8]]},"95":{"position":[[700,8],[1592,8]]},"236":{"position":[[88,6]]},"343":{"position":[[73,8],[410,9]]},"347":{"position":[[344,8]]},"355":{"position":[[757,8]]},"380":{"position":[[180,6]]},"412":{"position":[[1378,10],[3197,6]]},"416":{"position":[[381,6],[628,6],[732,6],[824,8]]},"418":{"position":[[447,10]]},"440":{"position":[[909,6]]},"442":{"position":[[1219,8]]},"444":{"position":[[39,6],[78,8],[124,8],[935,8],[1052,8],[2213,8],[2389,8],[3926,8],[4053,8],[5264,8],[5390,8],[6598,8],[6719,8]]},"446":{"position":[[835,8],[1006,8],[2223,8],[2453,8],[4046,8],[4227,8],[5494,8],[5674,8],[7010,8],[7185,8]]},"454":{"position":[[2239,6]]},"482":{"position":[[1663,8],[4012,10],[4696,10],[7614,10]]},"502":{"position":[[992,8]]},"508":{"position":[[6632,9]]},"536":{"position":[[363,6]]},"540":{"position":[[11,6]]},"542":{"position":[[281,6]]},"548":{"position":[[149,8],[673,8],[691,6]]},"558":{"position":[[111,8]]},"560":{"position":[[1601,8]]},"562":{"position":[[138,6]]},"653":{"position":[[77,8],[396,8]]},"677":{"position":[[93,6]]},"681":{"position":[[894,8],[2058,8],[3598,8],[4812,8],[5830,8]]},"757":{"position":[[954,8]]},"777":{"position":[[263,11]]},"822":{"position":[[376,8]]}}}],["assigne",{"_index":1845,"t":{"442":{"position":[[211,8],[442,9],[828,10],[941,10],[998,11],[1057,11]]},"444":{"position":[[998,11],[1114,11],[3997,11],[4123,11],[6432,8],[6552,8],[7732,11],[8826,11],[10200,11],[11739,8],[12418,11],[12440,10]]}}}],["associ",{"_index":1844,"t":{"440":{"position":[[1251,9]]},"643":{"position":[[1074,11],[1480,10],[1873,10]]},"645":{"position":[[947,10],[2334,10],[4048,10],[5435,10],[6850,10]]},"653":{"position":[[437,11]]},"677":{"position":[[715,10]]},"724":{"position":[[446,10]]},"726":{"position":[[921,10],[1060,10],[1199,10],[1360,10],[1511,10],[1678,10],[2879,10],[3077,10],[3275,10],[3495,10],[3705,10],[3931,10],[5508,10],[5657,10],[5806,10],[5977,10],[6138,10],[6315,10],[7566,10],[7714,10],[7862,10],[8032,10],[8192,10],[8368,10],[10468,10],[10611,10],[10754,10],[10919,10],[11074,10],[11245,10]]},"728":{"position":[[21549,10],[21649,10]]}}}],["associated_plan",{"_index":2211,"t":{"643":{"position":[[142,16],[214,15],[388,18],[521,17],[639,18],[1014,15],[1051,15],[1578,15]]},"645":{"position":[[1023,18],[4132,18],[6647,15]]},"649":{"position":[[879,18],[3631,18],[5757,15]]},"724":{"position":[[501,15],[669,16],[902,18],[968,18]]},"726":{"position":[[990,18],[1129,18],[1281,18],[1435,18],[1599,18],[1766,18],[5585,18],[5734,18],[5896,18],[6060,18],[6234,18],[6411,18],[9769,15],[9892,15],[10015,15],[10147,15],[10276,15],[10408,15],[46023,18],[47120,18],[48497,18],[50042,15],[50727,18],[50756,17]]},"728":{"position":[[6145,16],[6227,18],[6319,18],[7209,16],[7460,18],[7552,18],[20845,16],[20910,15],[20962,18],[21095,17],[21206,18],[21504,15],[21956,16],[22077,18],[22333,16],[23396,16],[23461,15],[23686,18],[23819,17],[23930,18],[30306,15],[31117,16],[31189,15],[31463,18],[31596,17],[31714,18],[38967,16],[39039,15],[39091,18],[39224,17],[39342,18],[39541,16],[39603,15],[39655,18],[39748,17],[39860,18],[40458,18],[40645,16],[40707,15],[40956,18],[41049,17],[41161,18]]}}}],["assum",{"_index":378,"t":{"35":{"position":[[0,6]]},"45":{"position":[[11295,8],[11796,8]]},"131":{"position":[[0,6]]},"143":{"position":[[0,6]]},"167":{"position":[[0,6],[290,6]]},"191":{"position":[[152,6]]},"212":{"position":[[476,6]]},"246":{"position":[[0,6]]},"252":{"position":[[60,6]]},"258":{"position":[[152,6]]},"285":{"position":[[152,6],[873,6]]},"302":{"position":[[152,6]]},"347":{"position":[[275,6]]},"363":{"position":[[316,6]]},"382":{"position":[[635,6]]},"396":{"position":[[152,6]]},"454":{"position":[[459,6]]},"492":{"position":[[152,6]]},"514":{"position":[[152,6]]},"530":{"position":[[152,6]]},"550":{"position":[[152,6]]},"568":{"position":[[152,6]]},"590":{"position":[[152,6]]},"618":{"position":[[6628,8]]},"667":{"position":[[1080,6],[7183,6],[13609,6],[27122,6]]},"669":{"position":[[1052,6],[7283,6],[13492,6],[19942,6]]},"675":{"position":[[11,7]]},"705":{"position":[[9647,8],[12324,8]]},"799":{"position":[[15088,8],[22020,8]]},"803":{"position":[[40,7]]},"826":{"position":[[158,6]]},"840":{"position":[[229,6]]}}}],["async",{"_index":453,"t":{"35":{"position":[[3864,5],[6059,5],[6297,5]]},"43":{"position":[[1476,5],[2572,5],[2728,5]]},"45":{"position":[[14552,5],[16373,5],[20746,5],[22567,5],[27175,5],[29038,5]]},"133":{"position":[[1553,5],[2995,5]]},"145":{"position":[[1553,5],[2995,5]]},"169":{"position":[[699,5],[805,5]]},"171":{"position":[[616,5],[867,5],[976,5],[1404,5]]},"173":{"position":[[341,5],[1064,5],[1689,5],[1839,5],[2392,5]]},"183":{"position":[[1562,5],[2861,5]]},"185":{"position":[[2290,5],[3990,5]]},"187":{"position":[[2453,5],[4551,5]]},"200":{"position":[[2448,5],[4293,5]]},"202":{"position":[[2387,5],[4205,5],[8135,5],[9955,5]]},"248":{"position":[[1553,5],[2995,5]]},"265":{"position":[[2667,5],[4475,5]]},"267":{"position":[[2459,5],[4299,5],[8084,5],[9893,5]]},"277":{"position":[[1525,5],[2967,5]]},"285":{"position":[[3684,5],[5498,5],[9475,5],[11357,5],[15354,5],[17172,5],[20960,5],[22780,5]]},"294":{"position":[[2708,5],[4552,5]]},"296":{"position":[[2432,5],[4251,5]]},"311":{"position":[[2537,5],[4373,5],[8120,5],[9957,5],[14347,5],[16390,5]]},"357":{"position":[[2576,5],[4402,5]]},"369":{"position":[[2528,5],[4347,5],[8136,5],[9954,5]]},"375":{"position":[[2834,5],[4738,5],[8823,5],[10642,5],[14637,5],[16456,5]]},"382":{"position":[[3501,5],[5317,5]]},"402":{"position":[[2534,5],[4391,5]]},"404":{"position":[[2476,5],[4302,5],[8315,5],[10142,5]]},"444":{"position":[[2968,5],[4988,5],[9268,5],[11089,5]]},"446":{"position":[[3090,5],[5220,5]]},"448":{"position":[[2362,5],[4183,5]]},"462":{"position":[[2534,5],[4356,5],[8166,5],[9987,5]]},"466":{"position":[[2496,5],[4319,5],[8295,5],[10118,5]]},"504":{"position":[[2481,5],[4324,5]]},"506":{"position":[[2643,5],[4566,5]]},"508":{"position":[[2549,5],[4375,5]]},"522":{"position":[[2771,5],[4666,5]]},"524":{"position":[[2673,5],[4495,5]]},"540":{"position":[[2494,5],[4339,5]]},"542":{"position":[[2981,5],[4903,5]]},"544":{"position":[[2613,5],[4441,5]]},"562":{"position":[[3048,5],[5038,5],[9198,5],[11017,5],[15193,5],[17012,5],[20883,5],[22704,5],[26507,5],[28327,5]]},"574":{"position":[[2734,5],[4640,5]]},"578":{"position":[[2733,5],[4635,5]]},"580":{"position":[[2589,5],[4433,5]]},"582":{"position":[[2344,5],[4151,5],[7858,5],[9665,5]]},"584":{"position":[[2456,5],[4292,5],[7920,5],[9728,5]]},"599":{"position":[[2523,5],[4340,5]]},"606":{"position":[[2915,5],[4785,5],[9013,5],[10862,5],[15014,5],[16873,5]]},"608":{"position":[[2882,5],[4634,5]]},"613":{"position":[[2619,5],[4498,5],[8531,5],[10410,5]]},"618":{"position":[[2734,5],[4718,5]]},"637":{"position":[[2955,5],[4916,5]]},"639":{"position":[[2489,5],[4318,5]]},"645":{"position":[[2937,5],[5007,5]]},"647":{"position":[[2402,5],[4223,5]]},"649":{"position":[[2590,5],[4506,5],[8443,5],[10265,5],[14082,5],[15907,5]]},"667":{"position":[[3656,5],[5474,5],[9828,5],[11646,5],[16655,5],[18476,5],[23486,5],[25304,5],[29724,5],[31543,5]]},"669":{"position":[[3631,5],[5450,5],[9886,5],[11708,5],[16226,5],[18046,5],[22549,5],[24369,5]]},"679":{"position":[[3347,5],[5167,5],[8963,5],[10782,5]]},"681":{"position":[[2640,5],[4536,5],[8361,5],[10184,5]]},"683":{"position":[[2658,5],[4590,5],[9001,5],[10932,5],[15265,5],[17197,5],[21287,5],[23107,5],[26946,5],[28764,5]]},"703":{"position":[[7235,5],[9148,5]]},"705":{"position":[[3682,5],[5623,5]]},"726":{"position":[[4537,5],[7277,5],[14758,5],[17008,5],[22755,5],[24935,5],[30537,5],[32356,5],[36298,5],[38118,5],[41921,5],[43744,5],[47565,5],[49389,5]]},"728":{"position":[[2581,5],[4401,5],[10492,5],[12308,5],[16427,5],[18252,5],[26843,5],[28667,5],[35073,5],[36888,5],[44608,5],[46423,5]]},"745":{"position":[[4193,5],[6045,5],[9798,5],[11619,5],[15567,5],[17419,5],[21129,5],[22950,5],[26757,5],[28579,5],[34489,5],[36310,5],[40115,5],[41936,5]]},"747":{"position":[[5239,5],[7330,5],[11961,5],[13784,5]]},"749":{"position":[[2715,5],[4591,5],[9020,5],[10928,5],[14720,5],[16541,5]]},"751":{"position":[[5591,5],[7537,5],[12177,5],[14002,5],[19726,5],[21600,5]]},"771":{"position":[[2877,5],[4728,5],[8533,5],[10388,5],[14621,5],[16639,5],[21364,5],[23184,5],[27059,5],[28877,5]]},"773":{"position":[[5872,5],[7953,5],[12698,5],[14521,5]]},"775":{"position":[[5435,5],[7384,5],[12468,5],[14632,5],[19870,5],[21687,5]]},"777":{"position":[[5813,5],[7834,5],[12572,5],[14394,5]]},"789":{"position":[[6185,5],[8586,5]]},"795":{"position":[[2708,5],[4524,5],[8404,5],[10224,5],[14328,5],[16239,5],[20033,5],[21850,5]]},"797":{"position":[[6815,5],[8627,5],[13689,5],[15988,5],[21683,5],[23727,5],[28110,5],[29926,5]]},"799":{"position":[[3990,5],[6089,5],[11162,5],[13179,5],[18090,5],[20108,5]]},"801":{"position":[[9897,5],[13634,5]]},"820":{"position":[[4200,5],[6055,5],[9829,5],[11653,5],[15612,5],[17463,5],[21167,5],[22987,5],[26789,5],[28611,5],[34007,5],[35827,5],[39627,5],[41448,5]]},"822":{"position":[[5294,5],[7496,5],[12637,5],[14461,5]]},"824":{"position":[[4767,5],[6828,5],[11556,5],[13383,5]]},"826":{"position":[[6045,5],[8289,5],[13228,5],[15056,5],[18990,5],[20820,5],[24691,5],[26523,5],[30479,5],[32309,5],[36176,5],[38006,5]]},"844":{"position":[[4552,5],[6462,5],[10344,5],[12170,5],[16263,5],[18173,5],[22012,5],[23838,5],[27769,5],[29602,5],[34719,5],[36899,5],[41716,5],[43542,5]]},"846":{"position":[[2418,5],[4239,5],[9698,5],[11518,5]]},"848":{"position":[[9829,5],[11924,5],[17135,5],[19114,5],[23725,5],[25758,5],[30389,5],[32337,5],[36700,5],[38581,5],[42553,5],[44417,5],[48345,5],[50163,5],[54046,5],[55879,5]]}}}],["attempt",{"_index":825,"t":{"89":{"position":[[3261,10]]},"313":{"position":[[598,7]]},"422":{"position":[[1089,10]]},"777":{"position":[[2935,7]]}}}],["attribut",{"_index":42,"t":{"3":{"position":[[608,10],[669,10],[813,10]]},"5":{"position":[[280,11]]},"21":{"position":[[154,9],[274,10],[354,10],[421,10]]}}}],["audienc",{"_index":1418,"t":{"214":{"position":[[1804,8],[2125,9],[2141,9],[2484,8],[3129,9]]}}}],["audience=\"oidc",{"_index":1424,"t":{"214":{"position":[[3114,14]]}}}],["auth",{"_index":398,"t":{"35":{"position":[[931,4],[2109,4],[3914,4]]},"45":{"position":[[12486,4],[13328,4],[14602,4],[18680,4],[19522,4],[20796,4],[25034,4],[25897,4],[27225,4]]},"133":{"position":[[204,4],[743,4],[1603,4]]},"145":{"position":[[204,4],[743,4],[1603,4]]},"200":{"position":[[317,4],[1114,4],[2498,4]]},"202":{"position":[[327,4],[1166,4],[2437,4],[6071,4],[6912,4],[8185,4]]},"248":{"position":[[204,4],[743,4],[1603,4]]},"265":{"position":[[627,4],[1456,4],[2717,4]]},"267":{"position":[[338,4],[1130,4],[2509,4],[6042,4],[6872,4],[8134,4]]},"277":{"position":[[176,4],[715,4],[1575,4]]},"285":{"position":[[1632,4],[2467,4],[3734,4],[7270,4],[8104,4],[9525,4],[13294,4],[14133,4],[15404,4],[18896,4],[19737,4],[21010,4]]},"294":{"position":[[579,4],[1375,4],[2758,4]]},"296":{"position":[[370,4],[1210,4],[2482,4]]},"311":{"position":[[424,4],[1212,4],[2587,4],[6005,4],[6794,4],[8170,4],[11819,4],[12777,4],[14397,4]]},"357":{"position":[[500,4],[1347,4],[2626,4]]},"369":{"position":[[466,4],[1306,4],[2578,4],[6076,4],[6915,4],[8186,4]]},"375":{"position":[[585,4],[1441,4],[2884,4],[6761,4],[7601,4],[8873,4],[12575,4],[13415,4],[14687,4]]},"382":{"position":[[1445,4],[2282,4],[3551,4]]},"402":{"position":[[379,4],[1188,4],[2584,4]]},"404":{"position":[[400,4],[1247,4],[2526,4],[6237,4],[7085,4],[8365,4]]},"444":{"position":[[448,4],[1410,4],[3018,4],[7202,4],[8044,4],[9318,4]]},"446":{"position":[[350,4],[1422,4],[3140,4]]},"448":{"position":[[296,4],[1138,4],[2412,4]]},"462":{"position":[[466,4],[1309,4],[2584,4],[6100,4],[6942,4],[8216,4]]},"466":{"position":[[426,4],[1270,4],[2546,4],[6225,4],[7069,4],[8345,4]]},"504":{"position":[[354,4],[1149,4],[2531,4]]},"506":{"position":[[356,4],[1231,4],[2693,4]]},"508":{"position":[[473,4],[1320,4],[2599,4]]},"522":{"position":[[540,4],[1387,4],[2821,4]]},"524":{"position":[[605,4],[1448,4],[2723,4]]},"540":{"position":[[363,4],[1160,4],[2544,4]]},"542":{"position":[[696,4],[1570,4],[3031,4]]},"544":{"position":[[533,4],[1382,4],[2663,4]]},"550":{"position":[[1511,4]]},"554":{"position":[[571,4]]},"562":{"position":[[588,4],[1520,4],[3098,4],[7136,4],[7976,4],[9248,4],[13131,4],[13971,4],[15243,4],[18817,4],[19659,4],[20933,4],[24443,4],[25284,4],[26557,4]]},"574":{"position":[[442,4],[1290,4],[2784,4]]},"578":{"position":[[449,4],[1293,4],[2783,4]]},"580":{"position":[[460,4],[1256,4],[2639,4]]},"582":{"position":[[306,4],[1134,4],[2394,4],[5820,4],[6648,4],[7908,4]]},"584":{"position":[[343,4],[1131,4],[2506,4],[5880,4],[6709,4],[7970,4]]},"599":{"position":[[465,4],[1303,4],[2573,4]]},"606":{"position":[[715,4],[1598,4],[2965,4],[6871,4],[7735,4],[9063,4],[12852,4],[13726,4],[15064,4]]},"608":{"position":[[918,4],[1683,4],[2932,4]]},"613":{"position":[[456,4],[1333,4],[2669,4],[6368,4],[7245,4],[8581,4]]},"618":{"position":[[377,4],[1347,4],[2784,4]]},"637":{"position":[[592,4],[1505,4],[3005,4]]},"639":{"position":[[407,4],[1257,4],[2539,4]]},"645":{"position":[[317,4],[1329,4],[2987,4]]},"647":{"position":[[336,4],[1178,4],[2452,4]]},"649":{"position":[[317,4],[1185,4],[2640,4],[6375,4],[7218,4],[8493,4],[12008,4],[12854,4],[14132,4]]},"667":{"position":[[1596,4],[2435,4],[3706,4],[7768,4],[8607,4],[9878,4],[14589,4],[15431,4],[16705,4],[21426,4],[22265,4],[23536,4],[27662,4],[28502,4],[29774,4]]},"669":{"position":[[1569,4],[2409,4],[3681,4],[7818,4],[8661,4],[9936,4],[14162,4],[15003,4],[16276,4],[20485,4],[21326,4],[22599,4]]},"679":{"position":[[1283,4],[2124,4],[3397,4],[6901,4],[7741,4],[9013,4]]},"681":{"position":[[407,4],[1255,4],[2690,4],[6291,4],[7135,4],[8411,4]]},"683":{"position":[[382,4],[1333,4],[2708,4],[6659,4],[7532,4],[9051,4],[12921,4],[13795,4],[15315,4],[19223,4],[20064,4],[21337,4],[24886,4],[25725,4],[26996,4]]},"703":{"position":[[4968,4],[5833,4],[7285,4]]},"705":{"position":[[1359,4],[2252,4],[3732,4]]},"726":{"position":[[421,4],[2063,4],[4587,4],[11739,4],[12921,4],[14808,4],[19876,4],[20988,4],[22805,4],[28475,4],[29315,4],[30587,4],[34234,4],[35075,4],[36348,4],[39851,4],[40695,4],[41971,4],[45493,4],[46338,4],[47615,4]]},"728":{"position":[[517,4],[1358,4],[2631,4],[8436,4],[9273,4],[10542,4],[14353,4],[15199,4],[16477,4],[24771,4],[25616,4],[26893,4],[33019,4],[33855,4],[35123,4],[42554,4],[43390,4],[44658,4]]},"745":{"position":[[2048,4],[2852,4],[4243,4],[7732,4],[8574,4],[9848,4],[13422,4],[14226,4],[15617,4],[19063,4],[19905,4],[21179,4],[24689,4],[25532,4],[26807,4],[32423,4],[33265,4],[34539,4],[38049,4],[38891,4],[40165,4]]},"747":{"position":[[2577,4],[3610,4],[5289,4],[9891,4],[10735,4],[12011,4]]},"749":{"position":[[522,4],[1350,4],[2765,4],[6763,4],[7623,4],[9070,4],[12654,4],[13496,4],[14770,4]]},"751":{"position":[[3219,4],[4107,4],[5641,4],[10103,4],[10949,4],[12227,4],[17537,4],[18363,4],[19776,4]]},"771":{"position":[[734,4],[1537,4],[2927,4],[6382,4],[7189,4],[8583,4],[12066,4],[13016,4],[14671,4],[19300,4],[20141,4],[21414,4],[24999,4],[25838,4],[27109,4]]},"773":{"position":[[3152,4],[4155,4],[5922,4],[10628,4],[11472,4],[12748,4]]},"775":{"position":[[3057,4],[3948,4],[5485,4],[9582,4],[10668,4],[12518,4],[17812,4],[18650,4],[19920,4]]},"777":{"position":[[3252,4],[4205,4],[5863,4],[10504,4],[11347,4],[12622,4]]},"789":{"position":[[2825,4],[4148,4],[6235,4]]},"795":{"position":[[652,4],[1489,4],[2758,4],[6340,4],[7181,4],[8454,4],[12065,4],[12928,4],[14378,4],[17975,4],[18813,4],[20083,4]]},"797":{"position":[[4767,4],[5600,4],[6865,4],[10572,4],[11803,4],[13739,4],[19115,4],[20101,4],[21733,4],[26054,4],[26891,4],[28160,4]]},"799":{"position":[[1312,4],[2353,4],[4040,4],[8749,4],[9755,4],[11212,4],[15675,4],[16682,4],[18140,4]]},"801":{"position":[[3553,4],[6132,4],[9947,4]]},"820":{"position":[[2049,4],[2856,4],[4250,4],[7757,4],[8602,4],[9879,4],[13469,4],[14272,4],[15662,4],[19103,4],[19944,4],[21217,4],[24721,4],[25564,4],[26839,4],[31943,4],[32784,4],[34057,4],[37561,4],[38403,4],[39677,4]]},"822":{"position":[[2332,4],[3456,4],[5344,4],[10565,4],[11410,4],[12687,4]]},"824":{"position":[[2165,4],[3168,4],[4817,4],[9478,4],[10326,4],[11606,4]]},"826":{"position":[[3038,4],[4214,4],[6095,4],[11148,4],[11997,4],[13278,4],[16906,4],[17757,4],[19040,4],[22603,4],[23456,4],[24741,4],[28395,4],[29246,4],[30529,4],[34092,4],[34943,4],[36226,4]]},"844":{"position":[[2291,4],[3153,4],[4602,4],[8268,4],[9115,4],[10394,4],[14002,4],[14864,4],[16313,4],[19936,4],[20783,4],[22062,4],[25679,4],[26533,4],[27819,4],[31840,4],[32952,4],[34769,4],[39640,4],[40487,4],[41766,4]]},"846":{"position":[[352,4],[1194,4],[2468,4],[7634,4],[8475,4],[9748,4]]},"848":{"position":[[7120,4],[8147,4],[9879,4],[14736,4],[15667,4],[17185,4],[21179,4],[22154,4],[23775,4],[28013,4],[28903,4],[30439,4],[34497,4],[35330,4],[36750,4],[40384,4],[41200,4],[42603,4],[46285,4],[47124,4],[48395,4],[51956,4],[52810,4],[54096,4]]}}}],["authent",{"_index":281,"t":{"17":{"position":[[0,14],[306,15]]},"151":{"position":[[122,14]]},"167":{"position":[[119,12],[396,13]]},"169":{"position":[[1139,14]]},"171":{"position":[[1248,15],[1554,12]]},"173":{"position":[[1512,16],[2104,15]]},"181":{"position":[[179,14]]},"185":{"position":[[30,15]]},"210":{"position":[[354,15]]},"214":{"position":[[18,14],[74,14],[119,14],[162,15],[202,15],[810,14],[899,14],[1266,14],[1738,15],[2259,14],[2343,14],[2423,14],[2791,14]]},"779":{"position":[[48,14]]},"850":{"position":[[212,14]]}}}],["authenticate.j",{"_index":1112,"t":{"171":{"position":[[229,16]]}}}],["authn",{"_index":282,"t":{"17":{"position":[[19,6],[430,5]]},"210":{"position":[[454,6]]},"214":{"position":[[643,6],[1526,5],[1553,5],[2077,6],[3045,5],[3067,5],[3103,5]]}}}],["author",{"_index":14,"t":{"3":{"position":[[166,13],[217,13],[321,13],[1031,13],[1217,13]]},"13":{"position":[[22,14],[50,14]]},"15":{"position":[[51,13]]},"17":{"position":[[71,13],[399,14]]},"19":{"position":[[13,13]]},"25":{"position":[[41,13],[105,10]]},"29":{"position":[[205,13],[364,13],[411,13],[521,13],[623,13],[849,13],[916,13],[996,13]]},"31":{"position":[[42,13]]},"35":{"position":[[638,13],[683,13],[7752,15],[7834,13],[8281,13],[8342,13]]},"37":{"position":[[79,13],[247,13]]},"39":{"position":[[242,13],[383,13]]},"41":{"position":[[47,13],[127,13]]},"45":{"position":[[28,13],[160,13],[374,13],[1430,13],[1455,13],[1621,13],[2769,13],[2969,13],[3461,13],[3530,13],[3618,13],[3780,13],[3844,13],[4160,13],[5292,13],[6620,13],[9117,13],[9585,13],[9962,13],[10269,13],[17319,15],[17401,13],[23513,15],[23595,13],[30064,15],[30146,13],[30629,13],[31352,14],[31367,13]]},"51":{"position":[[3,13]]},"53":{"position":[[72,13]]},"55":{"position":[[140,13]]},"59":{"position":[[60,13]]},"69":{"position":[[136,13],[443,13]]},"81":{"position":[[85,13]]},"83":{"position":[[18,13],[3698,13]]},"89":{"position":[[258,13],[1256,13],[1890,13]]},"91":{"position":[[941,13]]},"93":{"position":[[1005,13]]},"95":{"position":[[1104,13]]},"99":{"position":[[91,14]]},"101":{"position":[[0,13],[139,13]]},"103":{"position":[[21,13]]},"105":{"position":[[198,13]]},"107":{"position":[[82,13],[162,13],[333,13],[420,13]]},"109":{"position":[[46,13],[748,13],[788,13]]},"125":{"position":[[26,13]]},"129":{"position":[[226,13],[549,13],[872,13],[1195,13],[1490,13],[1751,13]]},"135":{"position":[[1335,15],[1417,13]]},"137":{"position":[[64,13]]},"141":{"position":[[226,13],[549,13],[872,13],[1195,13],[1490,13],[1751,13]]},"147":{"position":[[1577,15],[1659,13]]},"149":{"position":[[64,13]]},"165":{"position":[[213,13],[577,13]]},"173":{"position":[[704,10],[2174,9],[4466,10],[5509,15]]},"175":{"position":[[186,13],[268,13]]},"177":{"position":[[116,13],[213,13],[269,13]]},"185":{"position":[[2021,15]]},"191":{"position":[[187,13],[1265,13],[1539,13]]},"195":{"position":[[187,13],[461,13]]},"200":{"position":[[4920,15],[5002,13]]},"202":{"position":[[5145,15],[5227,13],[10899,15],[10981,13]]},"214":{"position":[[320,14]]},"216":{"position":[[103,13]]},"234":{"position":[[154,13]]},"238":{"position":[[32,13],[183,13],[340,13]]},"244":{"position":[[226,13],[513,13],[800,13],[1087,13],[1346,13],[1607,13]]},"250":{"position":[[1413,15],[1495,13]]},"252":{"position":[[1536,15],[1618,13]]},"254":{"position":[[59,13]]},"256":{"position":[[231,13]]},"258":{"position":[[187,13],[677,13],[984,13],[1258,13]]},"260":{"position":[[34,13]]},"262":{"position":[[187,13],[461,13]]},"265":{"position":[[5395,15],[5477,13]]},"267":{"position":[[4923,15],[5005,13],[10815,15],[10897,13]]},"271":{"position":[[308,13]]},"273":{"position":[[222,13],[544,13],[866,13],[1153,13],[1412,13]]},"279":{"position":[[893,15],[975,13],[2771,15],[2853,13]]},"281":{"position":[[31,13],[1938,15],[2020,13],[3681,15],[3763,13]]},"285":{"position":[[187,13],[1246,13],[6430,15],[6512,13],[12020,15],[12102,13],[18112,15],[18194,13],[23724,15],[23806,13],[24696,13],[24970,13]]},"291":{"position":[[187,13],[461,13]]},"294":{"position":[[5180,15],[5262,13]]},"296":{"position":[[5193,15],[5275,13]]},"302":{"position":[[187,13],[1184,13],[1586,13],[1860,13]]},"304":{"position":[[34,13]]},"308":{"position":[[187,13],[461,13]]},"311":{"position":[[4991,15],[5073,13],[10578,15],[10660,13],[17188,15],[17270,13]]},"317":{"position":[[32,13],[693,10]]},"323":{"position":[[169,13],[645,13]]},"331":{"position":[[71,13],[240,13],[299,13]]},"333":{"position":[[33,13],[162,13],[1039,13],[1072,9],[1183,13],[1245,9],[1500,13]]},"335":{"position":[[62,13],[219,13]]},"337":{"position":[[30,13],[140,13],[247,13],[356,13]]},"339":{"position":[[30,13]]},"341":{"position":[[55,13]]},"347":{"position":[[156,13],[1397,13],[1671,13]]},"351":{"position":[[187,13],[461,13]]},"355":{"position":[[123,13],[825,13]]},"357":{"position":[[5358,15],[5440,13]]},"363":{"position":[[155,13],[1895,13],[2169,13]]},"367":{"position":[[187,13],[461,13]]},"369":{"position":[[15,13],[5289,15],[5371,13],[10894,15],[10976,13]]},"371":{"position":[[177,13]]},"375":{"position":[[259,13],[5423,15],[5505,13],[6289,13],[11584,15],[11666,13],[17398,15],[17480,13]]},"382":{"position":[[22,13],[6253,15],[6335,13]]},"384":{"position":[[22,13]]},"386":{"position":[[34,13],[940,13]]},"390":{"position":[[171,13]]},"394":{"position":[[241,13]]},"396":{"position":[[187,13],[976,13],[1250,13]]},"398":{"position":[[187,13],[461,13]]},"402":{"position":[[5030,15],[5112,13]]},"404":{"position":[[5258,15],[5340,13],[11100,15],[11182,13]]},"408":{"position":[[1080,13]]},"422":{"position":[[2495,15],[2577,13]]},"424":{"position":[[909,13],[939,13]]},"428":{"position":[[617,13],[717,13]]},"430":{"position":[[360,13]]},"440":{"position":[[18,13],[1131,13],[1304,13]]},"442":{"position":[[231,13]]},"444":{"position":[[5788,15],[5870,13],[12035,15],[12117,13]]},"446":{"position":[[6130,15],[6212,13]]},"448":{"position":[[5129,15],[5211,13]]},"452":{"position":[[66,14],[590,13]]},"454":{"position":[[176,13],[2883,13],[3157,13]]},"460":{"position":[[187,13],[461,13]]},"462":{"position":[[15,13],[5304,15],[5386,13],[10933,15],[11015,13]]},"466":{"position":[[5269,15],[5351,13],[11068,15],[11150,13]]},"470":{"position":[[53,13],[129,13],[354,13]]},"472":{"position":[[201,13],[340,13],[429,13],[551,13],[633,13],[812,13],[914,13],[1289,13]]},"474":{"position":[[12,13],[368,13]]},"476":{"position":[[343,13],[486,13],[665,13]]},"478":{"position":[[4290,13]]},"480":{"position":[[3412,13]]},"482":{"position":[[3499,13],[10518,13]]},"484":{"position":[[418,13],[471,13],[550,13],[663,13],[1106,13],[3930,13]]},"486":{"position":[[216,13],[293,13]]},"490":{"position":[[333,13]]},"492":{"position":[[187,13],[961,13],[1268,13],[1542,13]]},"494":{"position":[[34,13]]},"496":{"position":[[187,13],[461,13]]},"498":{"position":[[244,13]]},"500":{"position":[[82,13]]},"502":{"position":[[76,13]]},"504":{"position":[[4949,15],[5031,13]]},"506":{"position":[[5270,15],[5352,13]]},"508":{"position":[[41,13],[5331,15],[5413,13]]},"514":{"position":[[187,13],[731,13],[1038,13],[1312,13]]},"516":{"position":[[34,13]]},"518":{"position":[[187,13],[461,13]]},"522":{"position":[[5342,15],[5424,13]]},"524":{"position":[[5443,15],[5525,13]]},"530":{"position":[[187,13],[708,13],[1015,13],[1289,13]]},"532":{"position":[[34,13]]},"534":{"position":[[187,13],[461,13]]},"536":{"position":[[310,13]]},"538":{"position":[[41,13],[144,13]]},"540":{"position":[[4966,15],[5048,13]]},"542":{"position":[[5606,15],[5688,13]]},"544":{"position":[[5401,15],[5483,13]]},"548":{"position":[[95,13]]},"550":{"position":[[187,13],[820,13],[1127,13],[1401,13]]},"552":{"position":[[34,13]]},"554":{"position":[[187,13],[461,13]]},"556":{"position":[[391,13]]},"558":{"position":[[145,13]]},"560":{"position":[[242,13]]},"562":{"position":[[5808,15],[5890,13],[11959,15],[12041,13],[17954,15],[18036,13],[23650,15],[23732,13],[29271,15],[29353,13]]},"568":{"position":[[187,13],[661,13],[968,13],[1242,13]]},"570":{"position":[[34,13]]},"572":{"position":[[187,13],[461,13]]},"574":{"position":[[5328,15],[5410,13]]},"576":{"position":[[43,13]]},"578":{"position":[[5319,15],[5401,13]]},"580":{"position":[[5059,15],[5141,13]]},"582":{"position":[[5069,15],[5151,13],[10583,15],[10665,13]]},"584":{"position":[[4912,15],[4994,13],[10648,15],[10730,13]]},"590":{"position":[[187,13],[1132,13],[1439,13],[1713,13]]},"592":{"position":[[34,13]]},"594":{"position":[[187,13],[461,13]]},"599":{"position":[[5278,15],[5360,13]]},"606":{"position":[[5731,15],[5813,13],[11771,15],[11853,13],[17802,15],[17884,13]]},"608":{"position":[[150,13],[244,13],[5462,15],[5544,13]]},"613":{"position":[[5431,15],[5513,13],[11343,15],[11425,13]]},"618":{"position":[[5900,15],[5982,13],[6580,13]]},"626":{"position":[[340,13]]},"628":{"position":[[155,13],[1212,13],[1486,13]]},"632":{"position":[[187,13],[461,13]]},"637":{"position":[[5658,15],[5740,13]]},"639":{"position":[[5280,15],[5362,13],[5905,13]]},"643":{"position":[[16,13]]},"645":{"position":[[5857,15],[5939,13]]},"647":{"position":[[21,13],[5169,15],[5251,13]]},"649":{"position":[[5205,15],[5287,13],[11213,15],[11295,13],[16861,15],[16943,13]]},"655":{"position":[[249,13],[556,13],[830,13]]},"657":{"position":[[34,13]]},"659":{"position":[[187,13],[461,13]]},"663":{"position":[[1144,13]]},"667":{"position":[[22,13],[6414,15],[6496,13],[12586,15],[12668,13],[19422,15],[19504,13],[26244,15],[26326,13],[27087,13],[32485,15],[32567,13],[33105,13],[33394,13]]},"669":{"position":[[816,13],[6392,15],[6474,13],[12656,15],[12738,13],[18990,15],[19072,13],[25313,15],[25395,13]]},"673":{"position":[[90,13],[183,13]]},"675":{"position":[[260,13],[534,13]]},"677":{"position":[[49,13],[923,13]]},"679":{"position":[[6111,15],[6193,13],[11724,15],[11806,13]]},"681":{"position":[[5213,15],[5295,13],[11134,15],[11216,13]]},"683":{"position":[[5551,15],[5633,13],[11645,15],[11727,13],[17913,15],[17995,13],[24051,15],[24133,13],[29704,15],[29786,13]]},"685":{"position":[[63,13]]},"693":{"position":[[61,13],[865,14]]},"695":{"position":[[108,13],[844,13],[8110,15],[8192,13]]},"699":{"position":[[295,13]]},"701":{"position":[[9,13],[1501,15],[1583,13],[3342,15],[3424,13],[5191,15],[5273,13],[7042,15],[7124,13],[8889,15],[8971,13],[10742,15],[10824,13]]},"703":{"position":[[11,13],[275,11],[2537,13],[2706,11],[4084,15],[4166,13],[4643,11],[5455,11],[6636,11],[8193,11],[9424,11],[9842,15],[9924,13],[10467,11],[11969,15],[12051,13]]},"705":{"position":[[24,9],[967,13],[1874,11],[3083,11],[4668,11],[5928,11],[6347,15],[6429,13],[6963,11],[9040,15],[9122,13],[11716,15],[11798,13]]},"707":{"position":[[21,13],[7649,15],[7731,13]]},"709":{"position":[[175,10],[245,13],[272,9]]},"717":{"position":[[103,13]]},"726":{"position":[[8793,15],[8875,13],[18037,15],[18119,13],[25894,15],[25976,13],[27471,13],[33298,15],[33380,13],[39062,15],[39144,13],[44694,15],[44776,13],[50341,15],[50423,13]]},"728":{"position":[[5345,15],[5427,13],[6775,13],[7066,13],[13244,15],[13326,13],[19206,15],[19288,13],[23286,13],[29619,15],[29701,13],[30368,13],[37822,15],[37904,13],[38422,13],[40537,13],[47357,15],[47439,13]]},"730":{"position":[[158,13],[580,13]]},"734":{"position":[[331,13]]},"745":{"position":[[261,13],[6679,15],[6761,13],[12565,15],[12647,13],[18053,15],[18135,13],[23896,15],[23978,13],[29527,15],[29609,13],[37256,15],[37338,13],[42882,15],[42964,13]]},"747":{"position":[[320,13],[8201,15],[8283,13],[14734,15],[14816,13]]},"749":{"position":[[5249,15],[5331,13],[11617,15],[11699,13],[17487,15],[17569,13]]},"751":{"position":[[8265,15],[8347,13],[14956,15],[15038,13],[22256,15],[22338,13],[23076,13]]},"755":{"position":[[167,13]]},"757":{"position":[[310,13],[482,13]]},"761":{"position":[[36,13]]},"767":{"position":[[147,13]]},"769":{"position":[[597,13]]},"771":{"position":[[5361,15],[5443,13],[11025,15],[11107,13],[17439,15],[17521,13],[24128,15],[24210,13],[29817,15],[29899,13]]},"773":{"position":[[284,13],[1125,13],[8816,15],[8898,13],[15471,15],[15553,13]]},"775":{"position":[[745,13],[8115,15],[8197,13],[15578,15],[15660,13],[22625,15],[22707,13]]},"777":{"position":[[140,13],[8637,15],[8719,13],[15342,15],[15424,13]]},"781":{"position":[[340,13]]},"783":{"position":[[96,13]]},"787":{"position":[[61,13],[867,14]]},"789":{"position":[[108,13],[502,13],[9765,15],[9847,13]]},"793":{"position":[[321,13]]},"795":{"position":[[9,13],[5460,15],[5542,13],[11168,15],[11250,13],[16931,15],[17013,13],[22788,15],[22870,13]]},"797":{"position":[[11,13],[75,13],[1104,14],[2647,14],[4284,13],[9555,15],[9637,13],[17066,15],[17148,13],[24551,15],[24633,13],[30862,15],[30944,13]]},"799":{"position":[[24,9],[249,9],[6970,15],[7052,13],[14401,15],[14483,13],[21332,15],[21414,13]]},"801":{"position":[[21,13],[16141,15],[16223,13]]},"805":{"position":[[294,10]]},"809":{"position":[[331,13]]},"820":{"position":[[346,13],[6692,15],[6774,13],[12605,15],[12687,13],[18096,15],[18178,13],[23931,15],[24013,13],[29559,15],[29641,13],[36771,15],[36853,13],[42394,15],[42476,13]]},"822":{"position":[[296,13],[8478,15],[8560,13],[15413,15],[15495,13]]},"824":{"position":[[7669,15],[7751,13],[14341,15],[14423,13],[16432,13]]},"826":{"position":[[9312,15],[9394,13],[16016,15],[16098,13],[21784,15],[21866,13],[27491,15],[27573,13],[33273,15],[33355,13],[38970,15],[39052,13]]},"832":{"position":[[310,13],[482,13]]},"842":{"position":[[416,13],[856,13]]},"844":{"position":[[547,13],[7153,15],[7235,13],[13126,15],[13208,13],[18864,15],[18946,13],[24794,15],[24876,13],[30572,15],[30654,13],[37858,15],[37940,13],[44498,15],[44580,13]]},"846":{"position":[[5185,15],[5267,13],[6190,13],[12462,15],[12544,13]]},"848":{"position":[[1449,13],[3018,13],[4451,13],[12801,15],[12883,13],[19874,15],[19956,13],[26572,15],[26654,13],[33067,15],[33149,13],[39244,15],[39326,13],[45063,15],[45145,13],[51103,15],[51185,13],[56849,15],[56931,13]]},"850":{"position":[[30,13],[90,13],[281,13],[609,13],[685,13]]},"852":{"position":[[126,13]]}}}],["authorization_id",{"_index":723,"t":{"45":{"position":[[17815,16],[24009,16]]},"202":{"position":[[5632,16],[11390,16]]},"265":{"position":[[5852,16]]},"267":{"position":[[11273,16]]},"285":{"position":[[6903,16],[18599,16],[24215,16]]},"296":{"position":[[5681,16]]},"357":{"position":[[5869,16]]},"369":{"position":[[5779,16],[11381,16]]},"375":{"position":[[12072,16],[17888,16]]},"382":{"position":[[6734,16]]},"404":{"position":[[5769,16],[11612,16]]},"444":{"position":[[12531,16]]},"448":{"position":[[5625,16]]},"462":{"position":[[5803,16],[11429,16]]},"466":{"position":[[5771,16],[11568,16]]},"508":{"position":[[5842,16]]},"524":{"position":[[5942,16]]},"544":{"position":[[5918,16]]},"562":{"position":[[12449,16],[18442,16],[24146,16],[29764,16]]},"582":{"position":[[5523,16],[11037,16]]},"584":{"position":[[11103,16]]},"599":{"position":[[5762,16]]},"639":{"position":[[5800,16]]},"647":{"position":[[5665,16]]},"649":{"position":[[11710,16],[17369,16]]},"667":{"position":[[6901,16],[13073,16],[19918,16],[26731,16],[32975,16]]},"669":{"position":[[6880,16],[13153,16],[19481,16],[25806,16]]},"679":{"position":[[6604,16],[12214,16]]},"681":{"position":[[11636,16]]},"683":{"position":[[24544,16],[30189,16]]},"701":{"position":[[1970,16],[3817,16],[5660,16],[7518,16],[9359,16],[11218,16]]},"703":{"position":[[4554,16],[12438,16]]},"705":{"position":[[9759,16],[12436,16]]},"726":{"position":[[33788,16],[39553,16],[45196,16],[50846,16]]},"728":{"position":[[5828,16],[13723,16],[19712,16],[30124,16],[38300,16],[47835,16]]},"745":{"position":[[13061,16],[24392,16],[30024,16],[37752,16],[43378,16]]},"747":{"position":[[15236,16]]},"749":{"position":[[17983,16]]},"751":{"position":[[15454,16]]},"771":{"position":[[24621,16],[30302,16]]},"773":{"position":[[15973,16]]},"775":{"position":[[23109,16]]},"777":{"position":[[15839,16]]},"795":{"position":[[5941,16],[11661,16],[23270,16]]},"797":{"position":[[10022,16],[31343,16]]},"799":{"position":[[15271,16],[22203,16]]},"820":{"position":[[13110,16],[24424,16],[30056,16],[37264,16],[42890,16]]},"822":{"position":[[15918,16]]},"824":{"position":[[14845,16]]},"826":{"position":[[16533,16],[22305,16],[28020,16],[33794,16],[39491,16]]},"844":{"position":[[13637,16],[25305,16],[31102,16],[45009,16]]},"846":{"position":[[5679,16],[12955,16]]},"848":{"position":[[51588,16],[57381,16]]}}}],["authorization_model_id",{"_index":416,"t":{"35":{"position":[[1381,23],[5902,22]]},"45":{"position":[[13063,23],[16216,22],[16525,25],[17456,27],[19257,23],[22410,22],[22719,25],[23650,27],[25585,23],[28881,22],[29190,25],[30204,25],[30550,22]]},"105":{"position":[[80,23]]},"133":{"position":[[2838,22]]},"135":{"position":[[236,23],[917,25],[1472,27]]},"145":{"position":[[2838,22]]},"147":{"position":[[215,23],[1059,25],[1717,25]]},"200":{"position":[[868,23],[4136,22],[4445,25],[5157,25]]},"202":{"position":[[901,23],[4048,22],[4357,25],[5282,27],[6646,23],[9798,22],[10107,25],[11036,27]]},"248":{"position":[[2838,22]]},"250":{"position":[[199,23],[1009,25],[1647,25]]},"252":{"position":[[355,23],[1167,25],[1771,25]]},"265":{"position":[[1191,23],[4318,22],[4627,25],[5532,27]]},"267":{"position":[[884,23],[4142,22],[4451,25],[5155,25],[6606,23],[9736,22],[10045,25],[10952,27]]},"277":{"position":[[2810,22]]},"285":{"position":[[2201,23],[5341,22],[5650,25],[6567,27],[7858,23],[11200,22],[11509,25],[12255,25],[13868,23],[17015,22],[17324,25],[18249,27],[19471,23],[22623,22],[22932,25],[23861,27]]},"294":{"position":[[1129,23],[4395,22],[4704,25],[5416,25]]},"296":{"position":[[944,23],[4094,22],[4403,25],[5330,27]]},"311":{"position":[[966,23],[4216,22],[4525,25],[5219,25],[6548,23],[9800,22],[10109,25],[10807,25],[12531,23],[16233,22],[16542,25],[17517,25]]},"357":{"position":[[1082,23],[4245,22],[4554,25],[5495,27]]},"369":{"position":[[1041,23],[4190,22],[4499,25],[5426,27],[6650,23],[9797,22],[10106,25],[11031,27]]},"375":{"position":[[1195,23],[4581,22],[4890,25],[5665,25],[7335,23],[10485,22],[10794,25],[11721,27],[13150,23],[16299,22],[16608,25],[17535,27]]},"382":{"position":[[2017,23],[5160,22],[5469,25],[6390,27]]},"402":{"position":[[942,23],[4234,22],[4543,25],[5279,25]]},"404":{"position":[[982,23],[4145,22],[4454,25],[5395,27],[6819,23],[9985,22],[10294,25],[11237,27]]},"422":{"position":[[1340,23],[2184,25],[2746,25]]},"444":{"position":[[1164,23],[4831,22],[5140,25],[6104,25],[7779,23],[10932,22],[11241,25],[12172,27]]},"446":{"position":[[1176,23],[5063,22],[5372,25],[6482,25]]},"448":{"position":[[873,23],[4026,22],[4335,25],[5266,27]]},"462":{"position":[[1044,23],[4199,22],[4508,25],[5441,27],[6677,23],[9830,22],[10139,25],[11070,27]]},"466":{"position":[[1005,23],[4162,22],[4471,25],[5406,27],[6803,23],[9961,22],[10270,25],[11205,27]]},"504":{"position":[[903,23],[4167,22],[4476,25],[5184,25]]},"506":{"position":[[985,23],[4409,22],[4718,25],[5523,25]]},"508":{"position":[[1055,23],[4218,22],[4527,25],[5468,27]]},"522":{"position":[[1141,23],[4509,22],[4818,25],[5585,25]]},"524":{"position":[[1183,23],[4338,22],[4647,25],[5580,27]]},"540":{"position":[[914,23],[4182,22],[4491,25],[5203,25]]},"542":{"position":[[1324,23],[4746,22],[5055,25],[5866,25]]},"544":{"position":[[1117,23],[4284,22],[4593,25],[5538,27]]},"562":{"position":[[1274,23],[4881,22],[5190,25],[6106,25],[7711,23],[10860,22],[11169,25],[12096,27],[13705,23],[16855,22],[17164,25],[18091,27],[19394,23],[22547,22],[22856,25],[23787,27],[25019,23],[28170,22],[28479,25],[29408,27]]},"574":{"position":[[1044,23],[4483,22],[4792,25],[5615,25]]},"578":{"position":[[1047,23],[4478,22],[4787,25],[5602,25]]},"580":{"position":[[1010,23],[4276,22],[4585,25],[5295,25]]},"582":{"position":[[869,23],[3994,22],[4303,25],[5206,27],[6383,23],[9508,22],[9817,25],[10720,27]]},"584":{"position":[[885,23],[4135,22],[4444,25],[5140,25],[6443,23],[9571,22],[9880,25],[10785,27]]},"599":{"position":[[1038,23],[4183,22],[4492,25],[5415,27]]},"606":{"position":[[4628,22],[10705,22],[16716,22]]},"608":{"position":[[4477,22]]},"613":{"position":[[1073,23],[4341,22],[4650,25],[5634,25],[6985,23],[10253,22],[10562,25],[11546,25]]},"618":{"position":[[1035,23],[4561,22],[4870,25],[6040,25],[6501,22]]},"637":{"position":[[1259,23],[4759,22],[5068,25],[5910,25]]},"639":{"position":[[992,23],[4161,22],[4470,25],[5417,27]]},"645":{"position":[[1083,23],[4850,22],[5159,25],[6191,25]]},"647":{"position":[[913,23],[4066,22],[4375,25],[5306,27]]},"649":{"position":[[939,23],[4349,22],[4658,25],[5463,25],[6952,23],[10108,22],[10417,25],[11350,27],[12589,23],[15750,22],[16059,25],[16998,27]]},"667":{"position":[[2170,23],[5317,22],[5626,25],[6551,27],[8342,23],[11489,22],[11798,25],[12723,27],[15166,23],[18319,22],[18628,25],[19559,27],[22000,23],[25147,22],[25456,25],[26381,27],[28237,23],[31386,22],[31695,25],[32622,27]]},"669":{"position":[[2143,23],[5293,22],[5602,25],[6529,27],[8395,23],[11551,22],[11860,25],[12793,27],[14737,23],[17889,22],[18198,25],[19127,27],[21061,23],[24212,22],[24521,25],[25450,27]]},"679":{"position":[[1859,23],[5010,22],[5319,25],[6248,27],[7476,23],[10625,22],[10934,25],[11861,27]]},"681":{"position":[[1009,23],[4379,22],[4688,25],[5456,25],[6870,23],[10027,22],[10336,25],[11271,27]]},"683":{"position":[[4433,22],[7286,23],[10775,22],[11084,25],[11957,25],[13549,23],[17040,22],[17349,25],[18226,25],[19799,23],[22950,22],[23259,25],[24188,27],[25459,23],[28607,22],[28916,25],[29841,27]]},"695":{"position":[[4115,23],[6955,25],[8795,25]]},"701":{"position":[[398,23],[1081,25],[1638,27],[2231,23],[2918,25],[3479,27],[4088,23],[4771,25],[5328,27],[5926,23],[6616,25],[7179,27],[7781,23],[8467,25],[9026,27],[9626,23],[10316,25],[10879,27]]},"703":{"position":[[2976,23],[3662,25],[4221,27],[5587,23],[8991,22],[9300,25],[10089,25],[10866,23],[11549,25],[12106,27]]},"705":{"position":[[2006,23],[5466,22],[5775,25],[6595,25],[7519,23],[8448,25],[9177,27],[10190,23],[11122,25],[11853,27]]},"707":{"position":[[3654,23],[6494,25],[8334,25]]},"726":{"position":[[1817,23],[7120,22],[7429,25],[9441,25],[12675,23],[16851,22],[17160,25],[18438,25],[20742,23],[24778,22],[25087,25],[26280,25],[29050,23],[32199,22],[32508,25],[33435,27],[34809,23],[37961,22],[38270,25],[39199,27],[40430,23],[43587,22],[43896,25],[44831,27],[46073,23],[49232,22],[49541,25],[50478,27]]},"728":{"position":[[1088,23],[4244,22],[4553,25],[5482,27],[9007,23],[12151,22],[12460,25],[13381,27],[14933,23],[18095,22],[18404,25],[19343,27],[25351,23],[28510,22],[28819,25],[29756,27],[33590,23],[36731,22],[37040,25],[37959,27],[43125,23],[46266,22],[46575,25],[47494,27]]},"745":{"position":[[2606,23],[5888,22],[6197,25],[6923,25],[8309,23],[11462,22],[11771,25],[12702,27],[13980,23],[17262,22],[17571,25],[18297,25],[19640,23],[22793,22],[23102,25],[24033,27],[25266,23],[28422,22],[28731,25],[29664,27],[33000,23],[36153,22],[36462,25],[37393,27],[38626,23],[41779,22],[42088,25],[43019,27]]},"747":{"position":[[3364,23],[7173,22],[7482,25],[8546,25],[10470,23],[13627,22],[13936,25],[14871,27]]},"749":{"position":[[1104,23],[4434,22],[4743,25],[5517,25],[7377,23],[10771,22],[11080,25],[11864,25],[13231,23],[16384,22],[16693,25],[17624,27]]},"751":{"position":[[3861,23],[7380,22],[7689,25],[8592,25],[10679,23],[13845,22],[14154,25],[15093,27],[18117,23],[21443,22],[21752,25],[22522,25]]},"771":{"position":[[1291,23],[4571,22],[4880,25],[5604,25],[6943,23],[10231,22],[10540,25],[11272,25],[12770,23],[16482,22],[16791,25],[17827,25],[19876,23],[23027,22],[23336,25],[24265,27],[25572,23],[28720,22],[29029,25],[29954,27]]},"773":{"position":[[3909,23],[7796,22],[8105,25],[9256,25],[11207,23],[14364,22],[14673,25],[15608,27]]},"775":{"position":[[3702,23],[7227,22],[7536,25],[8445,25],[10422,23],[14475,22],[14784,25],[16101,25],[18385,23],[21530,22],[21839,25],[22762,27]]},"777":{"position":[[3959,23],[7677,22],[7986,25],[9028,25],[11081,23],[14237,22],[14546,25],[15479,27]]},"789":{"position":[[3902,23],[8429,22],[8738,25],[10251,25]]},"795":{"position":[[1224,23],[4367,22],[4676,25],[5597,27],[6916,23],[10067,22],[10376,25],[11305,27],[12682,23],[16082,22],[16391,25],[17180,25],[18547,23],[21693,22],[22002,25],[22925,27]]},"797":{"position":[[5334,23],[8470,22],[8779,25],[9692,27],[11557,23],[15831,22],[16140,25],[17514,25],[19855,23],[23570,22],[23879,25],[24866,25],[26626,23],[29769,22],[30078,25],[30999,27]]},"799":{"position":[[2107,23],[5932,22],[6241,25],[7286,25],[9490,23],[13022,22],[13331,25],[14538,27],[16416,23],[19951,22],[20260,25],[21469,27]]},"801":{"position":[[5886,23],[13477,22],[13786,25],[17326,25]]},"820":{"position":[[2610,23],[5898,22],[6207,25],[6939,25],[8337,23],[11496,22],[11805,25],[12742,27],[14026,23],[17306,22],[17615,25],[18339,25],[19679,23],[22830,22],[23139,25],[24068,27],[25298,23],[28454,22],[28763,25],[29696,27],[32519,23],[35670,22],[35979,25],[36908,27],[38138,23],[41291,22],[41600,25],[42531,27]]},"822":{"position":[[3210,23],[7339,22],[7648,25],[8922,25],[11145,23],[14304,22],[14613,25],[15550,27]]},"824":{"position":[[2922,23],[6671,22],[6980,25],[8002,25],[10056,23],[13226,22],[13535,25],[14478,27]]},"826":{"position":[[3968,23],[8132,22],[8441,25],[9733,25],[11732,23],[14899,22],[15208,25],[16153,27],[17491,23],[20663,22],[20972,25],[21921,27],[23191,23],[26366,22],[26675,25],[27628,27],[28980,23],[32152,22],[32461,25],[33410,27],[34677,23],[37849,22],[38158,25],[39107,27]]},"844":{"position":[[2907,23],[6305,22],[6614,25],[7402,25],[8850,23],[12013,22],[12322,25],[13263,27],[14618,23],[18016,22],[18325,25],[19113,25],[20518,23],[23681,22],[23990,25],[24931,27],[26267,23],[29445,22],[29754,25],[30709,27],[32706,23],[36742,22],[37051,25],[38256,25],[40222,23],[43385,22],[43694,25],[44635,27]]},"846":{"position":[[928,23],[4082,22],[4391,25],[5322,27],[8210,23],[11361,22],[11670,25],[12599,27]]},"848":{"position":[[7901,23],[11767,22],[12076,25],[13266,25],[15421,23],[18957,22],[19266,25],[20131,25],[21908,23],[25601,22],[25910,25],[26879,25],[28657,23],[32180,22],[32489,25],[33396,25],[35084,23],[38424,22],[38733,25],[39517,25],[40954,23],[44260,22],[44569,25],[45319,25],[46858,23],[50006,22],[50315,25],[51240,27],[52545,23],[55722,22],[56031,25],[56986,27]]}}}],["authorization_model_id=\"1uhxcsutp0vkpysnkq1pbb1jezw",{"_index":1311,"t":{"200":{"position":[[5587,53]]},"267":{"position":[[5536,53]]},"285":{"position":[[12720,53]]},"294":{"position":[[5805,53]]},"311":{"position":[[5631,53],[11182,53],[17696,54],[17873,53]]},"375":{"position":[[6159,53]]},"402":{"position":[[5733,53]]},"422":{"position":[[3026,53]]},"444":{"position":[[6829,53]]},"446":{"position":[[7353,53]]},"504":{"position":[[5610,53]]},"506":{"position":[[6047,53]]},"522":{"position":[[6071,53]]},"540":{"position":[[5633,53]]},"542":{"position":[[6396,53]]},"562":{"position":[[6783,53]]},"574":{"position":[[6197,53]]},"578":{"position":[[6176,53]]},"580":{"position":[[5723,53]]},"584":{"position":[[5513,53]]},"613":{"position":[[5836,52],[11748,52]]},"637":{"position":[[6471,53]]},"645":{"position":[[6984,53]]},"649":{"position":[[5946,53]]},"681":{"position":[[5943,53]]},"683":{"position":[[12589,53],[18783,53]]},"695":{"position":[[10606,53]]},"703":{"position":[[10597,53]]},"705":{"position":[[7093,53]]},"707":{"position":[[10145,53]]},"726":{"position":[[11382,53],[19519,53],[27276,53]]},"745":{"position":[[7367,53],[18741,53]]},"747":{"position":[[9371,53]]},"749":{"position":[[6009,53],[12367,53]]},"751":{"position":[[9254,53],[23010,53]]},"771":{"position":[[6046,53],[11722,53],[18663,53]]},"773":{"position":[[10248,53]]},"775":{"position":[[9113,53],[17259,53]]},"777":{"position":[[9870,53]]},"789":{"position":[[11609,53]]},"795":{"position":[[17688,53]]},"797":{"position":[[18691,53],[25614,53]]},"799":{"position":[[8013,53]]},"801":{"position":[[21047,53]]},"820":{"position":[[7389,53],[18781,53]]},"822":{"position":[[10039,53]]},"824":{"position":[[8785,53]]},"826":{"position":[[10828,53]]},"844":{"position":[[7909,53],[19620,53],[39264,53]]},"848":{"position":[[14256,53],[20715,53],[27608,53],[34062,53],[40019,53],[45787,53]]}}}],["authorizationmodelid",{"_index":412,"t":{"35":{"position":[[1278,21],[2576,21],[4458,20]]},"43":{"position":[[1000,21],[2000,20]]},"45":{"position":[[12833,21],[13795,21],[13979,21],[15146,20],[15360,20],[19027,21],[19989,21],[20173,21],[21340,20],[21554,20],[25381,21],[26364,21],[26554,21],[27769,20],[27989,20]]},"133":{"position":[[551,21],[1210,21],[2147,20]]},"135":{"position":[[344,21],[665,20]]},"145":{"position":[[551,21],[1210,21],[2147,20]]},"147":{"position":[[376,21],[761,20]]},"173":{"position":[[4973,21]]},"183":{"position":[[610,21],[1239,21],[2086,20]]},"185":{"position":[[958,21],[1728,21],[2814,20]]},"187":{"position":[[834,21],[1753,21],[2977,20]]},"200":{"position":[[664,21],[1581,21],[1765,21],[3042,20],[3262,20]]},"202":{"position":[[674,21],[1633,21],[1817,21],[2981,20],[3195,20],[6418,21],[7379,21],[7563,21],[8729,20],[8943,20]]},"248":{"position":[[551,21],[1210,21],[2147,20]]},"250":{"position":[[288,21],[732,20]]},"252":{"position":[[444,21],[889,20]]},"265":{"position":[[974,21],[1923,21],[2107,21],[3261,20],[3475,20]]},"267":{"position":[[685,21],[1597,21],[1781,21],[3053,20],[3273,20],[6389,21],[7339,21],[7523,21],[8678,20],[8892,20]]},"277":{"position":[[523,21],[1182,21],[2119,20]]},"285":{"position":[[1979,21],[2934,21],[3118,21],[4278,20],[4492,20],[7617,21],[8571,21],[8755,21],[10069,20],[10289,20],[13641,21],[14600,21],[14784,21],[15948,20],[16162,20],[19243,21],[20204,21],[20388,21],[21554,20],[21768,20]]},"294":{"position":[[926,21],[1842,21],[2026,21],[3302,20],[3522,20]]},"296":{"position":[[717,21],[1677,21],[1861,21],[3026,20],[3240,20]]},"311":{"position":[[771,21],[1679,21],[1863,21],[3131,20],[3351,20],[6352,21],[7261,21],[7445,21],[8714,20],[8934,20],[12166,21],[13244,21],[13428,21],[14941,20],[15161,20]]},"357":{"position":[[847,21],[1814,21],[1998,21],[3170,20],[3384,20]]},"369":{"position":[[813,21],[1773,21],[1957,21],[3122,20],[3336,20],[6423,21],[7382,21],[7566,21],[8730,20],[8944,20]]},"375":{"position":[[932,21],[1908,21],[2092,21],[3428,20],[3648,20],[7108,21],[8068,21],[8252,21],[9417,20],[9631,20],[12922,21],[13882,21],[14066,21],[15231,20],[15445,20]]},"382":{"position":[[1792,21],[2749,21],[2933,21],[4095,20],[4309,20]]},"402":{"position":[[726,21],[1655,21],[1839,21],[3128,20],[3348,20]]},"404":{"position":[[747,21],[1714,21],[1898,21],[3070,20],[3284,20],[6584,21],[7552,21],[7736,21],[8909,20],[9123,20]]},"422":{"position":[[1429,21],[1890,20]]},"444":{"position":[[795,21],[1877,21],[2061,21],[3562,20],[3782,20],[7549,21],[8511,21],[8695,21],[9862,20],[10076,20]]},"446":{"position":[[697,21],[1889,21],[2073,21],[3684,20],[3904,20]]},"448":{"position":[[643,21],[1605,21],[1789,21],[2956,20],[3170,20]]},"462":{"position":[[813,21],[1776,21],[1960,21],[3128,20],[3342,20],[6447,21],[7409,21],[7593,21],[8760,20],[8974,20]]},"466":{"position":[[773,21],[1737,21],[1921,21],[3090,20],[3304,20],[6572,21],[7536,21],[7720,21],[8889,20],[9103,20]]},"504":{"position":[[701,21],[1616,21],[1800,21],[3075,20],[3295,20]]},"506":{"position":[[703,21],[1698,21],[1882,21],[3237,20],[3457,20]]},"508":{"position":[[820,21],[1787,21],[1971,21],[3143,20],[3357,20]]},"522":{"position":[[887,21],[1854,21],[2038,21],[3365,20],[3585,20]]},"524":{"position":[[952,21],[1915,21],[2099,21],[3267,20],[3481,20]]},"540":{"position":[[710,21],[1627,21],[1811,21],[3088,20],[3308,20]]},"542":{"position":[[1043,21],[2037,21],[2221,21],[3575,20],[3795,20]]},"544":{"position":[[880,21],[1849,21],[2033,21],[3207,20],[3421,20]]},"562":{"position":[[935,21],[1987,21],[2171,21],[3642,20],[3862,20],[7483,21],[8443,21],[8627,21],[9792,20],[10006,20],[13478,21],[14438,21],[14622,21],[15787,20],[16001,20],[19164,21],[20126,21],[20310,21],[21477,20],[21691,20],[24790,21],[25751,21],[25935,21],[27101,20],[27315,20]]},"574":{"position":[[789,21],[1757,21],[1941,21],[3328,20],[3548,20]]},"578":{"position":[[796,21],[1760,21],[1944,21],[3327,20],[3547,20]]},"580":{"position":[[807,21],[1723,21],[1907,21],[3183,20],[3403,20]]},"582":{"position":[[653,21],[1601,21],[1785,21],[2938,20],[3152,20],[6167,21],[7115,21],[7299,21],[8452,20],[8666,20]]},"584":{"position":[[690,21],[1598,21],[1782,21],[3050,20],[3270,20],[6227,21],[7176,21],[7360,21],[8514,20],[8728,20]]},"599":{"position":[[812,21],[1770,21],[1954,21],[3117,20],[3331,20]]},"606":{"position":[[1062,21],[2065,21],[3509,20],[7218,21],[8202,21],[9607,20],[13199,21],[14193,21],[15608,20]]},"608":{"position":[[1265,21],[2150,21],[3476,20]]},"613":{"position":[[803,21],[1800,21],[1985,21],[3213,20],[3427,20],[6715,21],[7712,21],[7897,21],[9125,20],[9339,20]]},"618":{"position":[[724,21],[1814,21],[2004,21],[3328,20],[3548,20]]},"637":{"position":[[939,21],[1972,21],[2156,21],[3549,20],[3769,20]]},"639":{"position":[[754,21],[1724,21],[1908,21],[3083,20],[3297,20]]},"645":{"position":[[664,21],[1796,21],[1980,21],[3531,20],[3751,20]]},"647":{"position":[[683,21],[1645,21],[1829,21],[2996,20],[3210,20]]},"649":{"position":[[664,21],[1652,21],[1836,21],[3184,20],[3404,20],[6722,21],[7685,21],[7869,21],[9037,20],[9251,20],[12355,21],[13321,21],[13505,21],[14676,20],[14890,20]]},"667":{"position":[[1943,21],[2902,21],[3086,21],[4250,20],[4464,20],[8115,21],[9074,21],[9258,21],[10422,20],[10636,20],[14936,21],[15898,21],[16082,21],[17249,20],[17463,20],[21773,21],[22732,21],[22916,21],[24080,20],[24294,20],[28009,21],[28969,21],[29153,21],[30318,20],[30532,20]]},"669":{"position":[[1916,21],[2876,21],[3060,21],[4225,20],[4439,20],[8165,21],[9128,21],[9312,21],[10480,20],[10694,20],[14509,21],[15470,21],[15654,21],[16820,20],[17034,20],[20832,21],[21793,21],[21977,21],[23143,20],[23357,20]]},"679":{"position":[[1630,21],[2591,21],[2775,21],[3941,20],[4155,20],[7248,21],[8208,21],[8392,21],[9557,20],[9771,20]]},"681":{"position":[[754,21],[1722,21],[1906,21],[3234,20],[3454,20],[6638,21],[7602,21],[7786,21],[8955,20],[9169,20]]},"683":{"position":[[729,21],[1800,21],[3252,20],[7006,21],[7999,21],[8183,21],[9595,20],[9815,20],[13268,21],[14262,21],[14446,21],[15859,20],[16079,20],[19570,21],[20531,21],[20715,21],[21881,20],[22095,20],[25233,21],[26192,21],[26376,21],[27540,20],[27754,20]]},"695":{"position":[[4204,21],[5810,20]]},"701":{"position":[[506,21],[828,20],[2339,21],[2663,20],[4196,21],[4518,20],[6035,21],[6360,20],[7890,21],[8213,20],[9735,21],[10060,20]]},"703":{"position":[[3085,21],[3408,20],[5315,21],[6300,21],[6484,21],[7829,20],[8049,20],[10974,21],[11296,20]]},"705":{"position":[[1706,21],[2719,21],[2903,21],[4276,20],[4496,20],[7627,21],[8066,20],[10299,21],[10739,20]]},"707":{"position":[[3743,21],[5349,20]]},"726":{"position":[[768,21],[2530,21],[2714,21],[5131,20],[5351,20],[12086,21],[13388,21],[13572,21],[15352,20],[15572,20],[20223,21],[21455,21],[21639,21],[23349,20],[23569,20],[28822,21],[29782,21],[29966,21],[31131,20],[31345,20],[34581,21],[35542,21],[35726,21],[36892,20],[37106,20],[40198,21],[41162,21],[41346,21],[42515,20],[42729,20],[45840,21],[46805,21],[46989,21],[48159,20],[48373,20]]},"728":{"position":[[864,21],[1825,21],[2009,21],[3175,20],[3389,20],[8783,21],[9740,21],[9924,21],[11086,20],[11300,20],[14700,21],[15666,21],[15850,21],[17021,20],[17235,20],[25118,21],[26083,21],[26267,21],[27437,20],[27651,20],[33366,21],[34322,21],[34506,21],[35667,20],[35881,20],[42901,21],[43857,21],[44041,21],[45202,20],[45416,20]]},"745":{"position":[[2395,21],[3319,21],[3503,21],[4787,20],[5007,20],[8079,21],[9041,21],[9225,21],[10392,20],[10606,20],[13769,21],[14693,21],[14877,21],[16161,20],[16381,20],[19410,21],[20372,21],[20556,21],[21723,20],[21937,20],[25036,21],[25999,21],[26183,21],[27351,20],[27565,20],[32770,21],[33732,21],[33916,21],[35083,20],[35297,20],[38396,21],[39358,21],[39542,21],[40709,20],[40923,20]]},"747":{"position":[[2924,21],[4077,21],[4261,21],[5833,20],[6053,20],[10238,21],[11202,21],[11386,21],[12555,20],[12769,20]]},"749":{"position":[[869,21],[1817,21],[2001,21],[3309,20],[3529,20],[7110,21],[8090,21],[8274,21],[9614,20],[9834,20],[13001,21],[13963,21],[14147,21],[15314,20],[15528,20]]},"751":{"position":[[3566,21],[4574,21],[4758,21],[6185,20],[6405,20],[10450,21],[11416,21],[11600,21],[12771,20],[12985,20],[17884,21],[18830,21],[19014,21],[20320,20],[20540,20]]},"771":{"position":[[1081,21],[2004,21],[2188,21],[3471,20],[3691,20],[6729,21],[7656,21],[7840,21],[9127,20],[9347,20],[12413,21],[13483,21],[13667,21],[15215,20],[15435,20],[19647,21],[20608,21],[20792,21],[21958,20],[22172,20],[25346,21],[26305,21],[26489,21],[27653,20],[27867,20]]},"773":{"position":[[3499,21],[4622,21],[4806,21],[6466,20],[6686,20],[10975,21],[11939,21],[12123,21],[13292,20],[13506,20]]},"775":{"position":[[3404,21],[4415,21],[4599,21],[6029,20],[6249,20],[9929,21],[11135,21],[11319,21],[13062,20],[13282,20],[18159,21],[19117,21],[19301,21],[20464,20],[20678,20]]},"777":{"position":[[3599,21],[4672,21],[4856,21],[6407,20],[6627,20],[10851,21],[11814,21],[11998,21],[13166,20],[13380,20]]},"789":{"position":[[3172,21],[4615,21],[4799,21],[6779,20],[6999,20]]},"795":{"position":[[999,21],[1956,21],[2140,21],[3302,20],[3516,20],[6687,21],[7648,21],[7832,21],[8998,20],[9212,20],[12412,21],[13395,21],[13579,21],[14922,20],[15142,20],[18322,21],[19280,21],[19464,21],[20627,20],[20841,20]]},"797":{"position":[[5114,21],[6067,21],[6251,21],[7409,20],[7623,20],[10919,21],[12270,21],[12454,21],[14283,20],[14503,20],[19462,21],[20568,21],[20752,21],[22277,20],[22497,20],[26401,21],[27358,21],[27542,21],[28704,20],[28918,20]]},"799":{"position":[[1659,21],[2820,21],[3004,21],[4584,20],[4804,20],[9096,21],[10222,21],[10406,21],[11756,20],[11970,20],[16022,21],[17149,21],[17333,21],[18684,20],[18898,20]]},"801":{"position":[[3900,21],[6599,21],[6783,21],[10491,20],[10711,20]]},"820":{"position":[[2396,21],[3323,21],[3507,21],[4794,20],[5014,20],[8104,21],[9069,21],[9253,21],[10423,20],[10637,20],[13816,21],[14739,21],[14923,21],[16206,20],[16426,20],[19450,21],[20411,21],[20595,21],[21761,20],[21975,20],[25068,21],[26031,21],[26215,21],[27383,20],[27597,20],[32290,21],[33251,21],[33435,21],[34601,20],[34815,20],[37908,21],[38870,21],[39054,21],[40221,20],[40435,20]]},"822":{"position":[[2679,21],[3923,21],[4107,21],[5888,20],[6108,20],[10912,21],[11877,21],[12061,21],[13231,20],[13445,20]]},"824":{"position":[[2512,21],[3635,21],[3819,21],[5361,20],[5581,20],[9825,21],[10793,21],[10977,21],[12150,20],[12364,20]]},"826":{"position":[[3385,21],[4681,21],[4865,21],[6639,20],[6859,20],[11495,21],[12464,21],[12648,21],[13822,20],[14036,20],[17253,21],[18224,21],[18408,21],[19584,20],[19798,20],[22950,21],[23923,21],[24107,21],[25285,20],[25499,20],[28742,21],[29713,21],[29897,21],[31073,20],[31287,20],[34439,21],[35410,21],[35594,21],[36770,20],[36984,20]]},"844":{"position":[[2638,21],[3620,21],[3804,21],[5146,20],[5366,20],[8615,21],[9582,21],[9766,21],[10938,20],[11152,20],[14349,21],[15331,21],[15515,21],[16857,20],[17077,20],[20283,21],[21250,21],[21434,21],[22606,20],[22820,20],[26026,21],[27000,21],[27184,21],[28363,20],[28577,20],[32187,21],[33419,21],[33603,21],[35313,20],[35533,20],[39987,21],[40954,21],[41138,21],[42310,20],[42524,20]]},"846":{"position":[[699,21],[1661,21],[1845,21],[3012,20],[3226,20],[7981,21],[8942,21],[9126,21],[10292,20],[10506,20]]},"848":{"position":[[7467,21],[8614,21],[8798,21],[10423,20],[10643,20],[15083,21],[16134,21],[16318,21],[17729,20],[17949,20],[21526,21],[22621,21],[22805,21],[24319,20],[24539,20],[28360,21],[29370,21],[29554,21],[30983,20],[31203,20],[34844,21],[35797,21],[35981,21],[37294,20],[37514,20],[40731,21],[41667,21],[41851,21],[43147,20],[43367,20],[46632,21],[47591,21],[47775,21],[48939,20],[49153,20],[52303,21],[53277,21],[53461,21],[54640,20],[54854,20]]}}}],["authorize.j",{"_index":1182,"t":{"173":{"position":[[826,13]]}}}],["authorized_us",{"_index":834,"t":{"93":{"position":[[226,15],[390,17],[854,15],[932,18],[1143,17],[1312,17],[1710,15],[1814,18]]}}}],["authz",{"_index":287,"t":{"17":{"position":[[89,6],[439,6]]}}}],["autom",{"_index":1986,"t":{"484":{"position":[[964,9]]}}}],["automat",{"_index":1675,"t":{"353":{"position":[[112,13]]},"482":{"position":[[2316,13]]},"490":{"position":[[807,13]]},"548":{"position":[[1734,13]]},"747":{"position":[[9583,13]]},"777":{"position":[[2573,13]]},"822":{"position":[[10257,13]]}}}],["avail",{"_index":924,"t":{"113":{"position":[[847,9],[1185,9],[1323,9]]},"422":{"position":[[549,10]]},"618":{"position":[[7029,10]]},"783":{"position":[[35,9]]},"809":{"position":[[836,10]]},"817":{"position":[[462,9]]},"836":{"position":[[418,9]]}}}],["avoid",{"_index":979,"t":{"153":{"position":[[200,8],[445,5],[1345,5]]},"476":{"position":[[716,5]]},"560":{"position":[[167,5]]},"679":{"position":[[3,5]]}}}],["await",{"_index":418,"t":{"35":{"position":[[1412,5],[5184,5],[6129,5],[6174,5],[6780,5]]},"43":{"position":[[410,5],[2183,5],[2692,5],[2839,5]]},"45":{"position":[[12963,5],[15545,5],[16443,5],[16488,5],[16691,5],[19157,5],[21739,5],[22637,5],[22682,5],[22885,5],[25493,5],[28166,5],[29108,5],[29153,5],[29348,5]]},"133":{"position":[[3065,5],[3110,5]]},"135":{"position":[[146,5],[840,5],[1073,5]]},"145":{"position":[[3065,5],[3110,5]]},"147":{"position":[[123,5],[938,5],[1217,5]]},"169":{"position":[[825,5]]},"171":{"position":[[656,5],[1424,5]]},"173":{"position":[[1370,5],[2412,5]]},"183":{"position":[[2931,5],[2993,5]]},"185":{"position":[[4060,5],[4122,5]]},"187":{"position":[[4621,5],[4683,5]]},"200":{"position":[[759,5],[3492,5],[4363,5],[4408,5],[4643,5]]},"202":{"position":[[804,5],[3377,5],[4275,5],[4320,5],[4520,5],[6548,5],[9126,5],[10025,5],[10070,5],[10271,5]]},"248":{"position":[[3065,5],[3110,5]]},"250":{"position":[[93,5],[959,5],[1204,5]]},"252":{"position":[[248,5],[1117,5],[1365,5]]},"265":{"position":[[1104,5],[3647,5],[4545,5],[4590,5],[4780,5]]},"267":{"position":[[780,5],[3498,5],[4369,5],[4414,5],[4646,5],[6519,5],[9064,5],[9963,5],[10008,5],[10198,5]]},"277":{"position":[[3037,5],[3082,5]]},"279":{"position":[[158,5],[592,5],[740,5],[1658,5],[2350,5],[2618,5]]},"281":{"position":[[1149,5],[1615,5],[1771,5],[2514,5],[3238,5],[3514,5]]},"285":{"position":[[2109,5],[4669,5],[5568,5],[5613,5],[5808,5],[7712,5],[10556,5],[11427,5],[11472,5],[11743,5],[13771,5],[16344,5],[17242,5],[17287,5],[17487,5],[19373,5],[21951,5],[22850,5],[22895,5],[23096,5]]},"294":{"position":[[1021,5],[3751,5],[4622,5],[4667,5],[4903,5]]},"296":{"position":[[847,5],[3422,5],[4321,5],[4366,5],[4566,5]]},"311":{"position":[[866,5],[3572,5],[4443,5],[4488,5],[4714,5],[6447,5],[9156,5],[10027,5],[10072,5],[10301,5],[12261,5],[15589,5],[16460,5],[16505,5],[16911,5]]},"357":{"position":[[977,5],[3574,5],[4472,5],[4517,5],[4725,5]]},"369":{"position":[[943,5],[3519,5],[4417,5],[4462,5],[4663,5],[6553,5],[9126,5],[10024,5],[10069,5],[10269,5]]},"375":{"position":[[1027,5],[3937,5],[4808,5],[4853,5],[5146,5],[7238,5],[9813,5],[10712,5],[10757,5],[10957,5],[13052,5],[15628,5],[16526,5],[16571,5],[16772,5]]},"382":{"position":[[1922,5],[4489,5],[5387,5],[5432,5],[5630,5]]},"402":{"position":[[821,5],[3590,5],[4461,5],[4506,5],[4753,5]]},"404":{"position":[[877,5],[3474,5],[4372,5],[4417,5],[4625,5],[6714,5],[9313,5],[10212,5],[10257,5],[10465,5]]},"422":{"position":[[1217,5],[2134,5],[2396,5]]},"444":{"position":[[890,5],[4187,5],[5058,5],[5103,5],[5511,5],[7679,5],[10261,5],[11159,5],[11204,5],[11407,5]]},"446":{"position":[[792,5],[4419,5],[5290,5],[5335,5],[5853,5]]},"448":{"position":[[773,5],[3355,5],[4253,5],[4298,5],[4501,5]]},"462":{"position":[[943,5],[3528,5],[4426,5],[4471,5],[4675,5],[6577,5],[9159,5],[10057,5],[10102,5],[10305,5]]},"466":{"position":[[903,5],[3491,5],[4389,5],[4434,5],[4639,5],[6702,5],[9289,5],[10188,5],[10233,5],[10437,5]]},"504":{"position":[[796,5],[3523,5],[4394,5],[4439,5],[4672,5]]},"506":{"position":[[798,5],[3765,5],[4636,5],[4681,5],[4993,5]]},"508":{"position":[[950,5],[3547,5],[4445,5],[4490,5],[4698,5]]},"522":{"position":[[982,5],[3865,5],[4736,5],[4781,5],[5065,5]]},"524":{"position":[[1082,5],[3667,5],[4565,5],[4610,5],[4814,5]]},"540":{"position":[[805,5],[3538,5],[4409,5],[4454,5],[4689,5]]},"542":{"position":[[1138,5],[4102,5],[4973,5],[5018,5],[5329,5]]},"544":{"position":[[1010,5],[3613,5],[4511,5],[4556,5],[4766,5]]},"562":{"position":[[1030,5],[4237,5],[5108,5],[5153,5],[5531,5],[7613,5],[10189,5],[11087,5],[11132,5],[11333,5],[13608,5],[16183,5],[17082,5],[17127,5],[17327,5],[19294,5],[21876,5],[22774,5],[22819,5],[23022,5],[24920,5],[27499,5],[28397,5],[28442,5],[28644,5]]},"574":{"position":[[884,5],[3839,5],[4710,5],[4755,5],[5051,5]]},"578":{"position":[[891,5],[3834,5],[4705,5],[4750,5],[5042,5]]},"580":{"position":[[902,5],[3632,5],[4503,5],[4548,5],[4782,5]]},"582":{"position":[[783,5],[3323,5],[4221,5],[4266,5],[4455,5],[6297,5],[8837,5],[9735,5],[9780,5],[9969,5]]},"584":{"position":[[785,5],[3491,5],[4362,5],[4407,5],[4635,5],[6357,5],[8899,5],[9798,5],[9843,5],[10032,5]]},"599":{"position":[[942,5],[3512,5],[4410,5],[4455,5],[4654,5]]},"606":{"position":[[1194,5],[3840,5],[4855,5],[4900,5],[5024,5],[7350,5],[9917,5],[10932,5],[10977,5],[11082,5],[13331,5],[15928,5],[16943,5],[16988,5],[17103,5]]},"608":{"position":[[1397,5],[3807,5],[4704,5],[4749,5],[4873,5]]},"613":{"position":[[915,5],[3668,5],[4568,5],[4613,5],[4798,5],[6827,5],[9580,5],[10480,5],[10525,5],[10710,5]]},"618":{"position":[[836,5],[3846,5],[4788,5],[4833,5],[5129,5]]},"637":{"position":[[1034,5],[4115,5],[4986,5],[5031,5],[5381,5]]},"639":{"position":[[884,5],[3490,5],[4388,5],[4433,5],[4644,5]]},"645":{"position":[[759,5],[4206,5],[5077,5],[5122,5],[5580,5]]},"647":{"position":[[813,5],[3395,5],[4293,5],[4338,5],[4541,5]]},"649":{"position":[[759,5],[3705,5],[4576,5],[4621,5],[4928,5],[6852,5],[9436,5],[10335,5],[10380,5],[10583,5],[12485,5],[15079,5],[15977,5],[16022,5],[16229,5]]},"667":{"position":[[2073,5],[4646,5],[5544,5],[5589,5],[5789,5],[8245,5],[10818,5],[11716,5],[11761,5],[11961,5],[15066,5],[17648,5],[18546,5],[18591,5],[18794,5],[21903,5],[24476,5],[25374,5],[25419,5],[25619,5],[28139,5],[30715,5],[31613,5],[31658,5],[31859,5]]},"669":{"position":[[2046,5],[4621,5],[5520,5],[5565,5],[5765,5],[8295,5],[10879,5],[11778,5],[11823,5],[12026,5],[14639,5],[17217,5],[18116,5],[18161,5],[18362,5],[20962,5],[23541,5],[24439,5],[24484,5],[24686,5]]},"679":{"position":[[1760,5],[4339,5],[5237,5],[5282,5],[5484,5],[7378,5],[9954,5],[10852,5],[10897,5],[11098,5]]},"681":{"position":[[849,5],[3735,5],[4606,5],[4651,5],[4936,5],[6768,5],[9356,5],[10254,5],[10299,5],[10504,5]]},"683":{"position":[[861,5],[3521,5],[4660,5],[4705,5],[4773,5],[7101,5],[10131,5],[11002,5],[11047,5],[11368,5],[13363,5],[16396,5],[17267,5],[17312,5],[17636,5],[19700,5],[22279,5],[23177,5],[23222,5],[23424,5],[25363,5],[27935,5],[28834,5],[28879,5],[29078,5]]},"695":{"position":[[3201,5],[6905,5],[8011,5]]},"701":{"position":[[307,5],[1004,5],[1238,5],[2138,5],[2841,5],[3077,5],[3997,5],[4694,5],[4928,5],[5833,5],[6538,5],[6775,5],[7690,5],[8389,5],[8624,5],[9533,5],[10238,5],[10475,5]]},"703":{"position":[[2885,5],[3584,5],[3819,5],[5410,5],[8347,5],[9218,5],[9263,5],[9565,5],[10775,5],[11472,5],[11706,5]]},"705":{"position":[[1801,5],[4822,5],[5693,5],[5738,5],[6070,5],[7329,5],[8371,5],[8714,5],[10000,5],[11044,5],[11388,5]]},"707":{"position":[[2740,5],[6444,5],[7550,5]]},"726":{"position":[[863,5],[6476,5],[7347,5],[7392,5],[8516,5],[12181,5],[16207,5],[17078,5],[17123,5],[17760,5],[20318,5],[24134,5],[25005,5],[25050,5],[25617,5],[28952,5],[31528,5],[32426,5],[32471,5],[32672,5],[34711,5],[37289,5],[38188,5],[38233,5],[38434,5],[40328,5],[42916,5],[43814,5],[43859,5],[44064,5],[45970,5],[48561,5],[49459,5],[49504,5],[49710,5]]},"728":{"position":[[994,5],[3568,5],[4471,5],[4516,5],[4713,5],[8913,5],[11479,5],[12378,5],[12423,5],[12620,5],[14830,5],[17423,5],[18322,5],[18367,5],[18573,5],[25248,5],[27839,5],[28737,5],[28782,5],[28988,5],[33496,5],[36060,5],[36958,5],[37003,5],[37200,5],[43031,5],[45595,5],[46493,5],[46538,5],[46735,5]]},"745":{"position":[[2490,5],[5244,5],[6115,5],[6160,5],[6402,5],[8209,5],[10791,5],[11689,5],[11734,5],[11937,5],[13864,5],[16618,5],[17489,5],[17534,5],[17776,5],[19540,5],[22122,5],[23020,5],[23065,5],[23268,5],[25166,5],[27750,5],[28649,5],[28694,5],[28897,5],[32900,5],[35482,5],[36380,5],[36425,5],[36628,5],[38526,5],[41108,5],[42006,5],[42051,5],[42254,5]]},"747":{"position":[[3019,5],[6529,5],[7400,5],[7445,5],[7924,5],[10368,5],[12956,5],[13854,5],[13899,5],[14104,5]]},"749":{"position":[[964,5],[3790,5],[4661,5],[4706,5],[4972,5],[7205,5],[10127,5],[10998,5],[11043,5],[11340,5],[13131,5],[15713,5],[16611,5],[16656,5],[16859,5]]},"751":{"position":[[3661,5],[6736,5],[7607,5],[7652,5],[7988,5],[10580,5],[13169,5],[14072,5],[14117,5],[14319,5],[17979,5],[20799,5],[21670,5],[21715,5],[21979,5]]},"771":{"position":[[1176,5],[3927,5],[4798,5],[4843,5],[5084,5],[6824,5],[9587,5],[10458,5],[10503,5],[10748,5],[12508,5],[15838,5],[16709,5],[16754,5],[17162,5],[19777,5],[22356,5],[23254,5],[23299,5],[23501,5],[25476,5],[28048,5],[28947,5],[28992,5],[29191,5]]},"773":{"position":[[3594,5],[7152,5],[8023,5],[8068,5],[8539,5],[11105,5],[13693,5],[14591,5],[14636,5],[14841,5]]},"775":{"position":[[3499,5],[6583,5],[7454,5],[7499,5],[7838,5],[10024,5],[13831,5],[14702,5],[14747,5],[15301,5],[18289,5],[20859,5],[21757,5],[21802,5],[22001,5]]},"777":{"position":[[3694,5],[7033,5],[7904,5],[7949,5],[8360,5],[10981,5],[13565,5],[14464,5],[14509,5],[14712,5]]},"789":{"position":[[3267,5],[7785,5],[8656,5],[8701,5],[9488,5]]},"795":{"position":[[1129,5],[3696,5],[4594,5],[4639,5],[4837,5],[6817,5],[9396,5],[10294,5],[10339,5],[10541,5],[12507,5],[15438,5],[16309,5],[16354,5],[16654,5],[18452,5],[21021,5],[21920,5],[21965,5],[22163,5]]},"797":{"position":[[5244,5],[7798,5],[8697,5],[8742,5],[8935,5],[11014,5],[15187,5],[16058,5],[16103,5],[16789,5],[19557,5],[22926,5],[23797,5],[23842,5],[24274,5],[26531,5],[29098,5],[29996,5],[30041,5],[30239,5]]},"799":{"position":[[1754,5],[5288,5],[6159,5],[6204,5],[6693,5],[9226,5],[12351,5],[13249,5],[13294,5],[13680,5],[16152,5],[19279,5],[20178,5],[20223,5],[20609,5]]},"801":{"position":[[3995,5],[12833,5],[13704,5],[13749,5],[15864,5]]},"820":{"position":[[2491,5],[5254,5],[6125,5],[6170,5],[6415,5],[8234,5],[10825,5],[11723,5],[11768,5],[11974,5],[13911,5],[16662,5],[17533,5],[17578,5],[17819,5],[19580,5],[22159,5],[23057,5],[23102,5],[23304,5],[25198,5],[27782,5],[28681,5],[28726,5],[28929,5],[32420,5],[34999,5],[35897,5],[35942,5],[36144,5],[38038,5],[40620,5],[41518,5],[41563,5],[41766,5]]},"822":{"position":[[2774,5],[6695,5],[7566,5],[7611,5],[8201,5],[11042,5],[13633,5],[14531,5],[14576,5],[14782,5]]},"824":{"position":[[2607,5],[6027,5],[6898,5],[6943,5],[7392,5],[9955,5],[12550,5],[13453,5],[13498,5],[13702,5]]},"826":{"position":[[3480,5],[7488,5],[8359,5],[8404,5],[9035,5],[11625,5],[14228,5],[15126,5],[15171,5],[15381,5],[17383,5],[19991,5],[20890,5],[20935,5],[21146,5],[23080,5],[25695,5],[26593,5],[26638,5],[26852,5],[28872,5],[31480,5],[32379,5],[32424,5],[32635,5],[34569,5],[37177,5],[38076,5],[38121,5],[38332,5]]},"844":{"position":[[2733,5],[5661,5],[6532,5],[6577,5],[6876,5],[8745,5],[11342,5],[12240,5],[12285,5],[12493,5],[14444,5],[17372,5],[18243,5],[18288,5],[18587,5],[20413,5],[23010,5],[23908,5],[23953,5],[24161,5],[26156,5],[28773,5],[29672,5],[29717,5],[29931,5],[32282,5],[36098,5],[36969,5],[37014,5],[37581,5],[40117,5],[42714,5],[43612,5],[43657,5],[43865,5]]},"846":{"position":[[829,5],[3410,5],[4309,5],[4354,5],[4556,5],[8111,5],[10690,5],[11588,5],[11633,5],[11835,5]]},"848":{"position":[[7562,5],[11123,5],[11994,5],[12039,5],[12524,5],[15178,5],[18313,5],[19184,5],[19229,5],[19597,5],[21621,5],[24957,5],[25828,5],[25873,5],[26295,5],[28455,5],[31536,5],[32407,5],[32452,5],[32790,5],[34939,5],[37780,5],[38651,5],[38696,5],[38967,5],[40826,5],[43616,5],[44487,5],[44532,5],[44786,5],[46762,5],[49334,5],[50233,5],[50278,5],[50477,5],[52433,5],[55051,5],[55949,5],[55994,5],[56209,5]]}}}],["awar",{"_index":2177,"t":{"616":{"position":[[241,5]]},"707":{"position":[[10462,5]]},"745":{"position":[[30274,5]]},"801":{"position":[[21364,5],[21526,5]]},"820":{"position":[[30314,5]]}}}],["b",{"_index":816,"t":{"89":{"position":[[2729,1],[2755,1]]},"327":{"position":[[541,2]]},"329":{"position":[[213,1]]},"369":{"position":[[12016,2]]},"375":{"position":[[6213,2]]},"482":{"position":[[2543,3]]},"695":{"position":[[2908,1],[2964,1],[3091,1],[3420,1],[3684,1],[4036,1],[4589,1],[4971,1],[5500,1],[6138,1],[6422,1],[6804,1],[7262,1],[7544,1],[7923,1],[9893,1],[10165,1],[10529,1]]},"697":{"position":[[155,2],[373,2]]},"705":{"position":[[12662,1],[12751,1],[12811,1],[12840,1]]},"707":{"position":[[2959,1],[3223,1],[3575,1],[4128,1],[4510,1],[5039,1],[5677,1],[5961,1],[6343,1],[6801,1],[7083,1],[7462,1],[9432,1],[9704,1],[10068,1]]}}}],["b2b",{"_index":1831,"t":{"428":{"position":[[119,5]]}}}],["b78a",{"_index":2459,"t":{"726":{"position":[[27914,4]]}}}],["back",{"_index":1747,"t":{"408":{"position":[[970,5]]},"448":{"position":[[5705,4]]},"773":{"position":[[1105,5]]}}}],["backward",{"_index":2287,"t":{"679":{"position":[[47,9],[79,9]]},"681":{"position":[[20,9]]}}}],["bank",{"_index":62,"t":{"3":{"position":[[902,4]]},"5":{"position":[[373,4]]},"803":{"position":[[79,5],[145,4],[258,4],[323,5],[329,6],[1092,7],[1280,7],[1809,7],[1862,6]]}}}],["base",{"_index":20,"t":{"3":{"position":[[279,5],[599,5]]},"5":{"position":[[193,5],[241,5],[326,5],[387,5]]},"21":{"position":[[8,5],[64,5],[164,5],[223,5],[256,5]]},"23":{"position":[[30,5]]},"45":{"position":[[31346,5]]},"95":{"position":[[144,4],[405,7]]},"109":{"position":[[731,5]]},"155":{"position":[[988,5]]},"167":{"position":[[234,5]]},"228":{"position":[[807,5]]},"333":{"position":[[512,5],[1033,5]]},"373":{"position":[[635,7]]},"454":{"position":[[340,5],[2449,5]]},"456":{"position":[[37,5]]},"470":{"position":[[24,5]]},"478":{"position":[[383,5]]},"480":{"position":[[150,5]]},"484":{"position":[[404,5],[1428,5]]},"548":{"position":[[315,5]]},"556":{"position":[[488,5]]},"618":{"position":[[59,5]]},"703":{"position":[[62,5]]},"705":{"position":[[34,5]]},"709":{"position":[[239,5]]},"751":{"position":[[24,4],[292,4],[9738,4],[16998,4],[17098,4]]},"767":{"position":[[23,5],[57,5]]},"771":{"position":[[291,5],[345,5]]},"777":{"position":[[2764,5]]},"799":{"position":[[34,5],[259,5]]},"838":{"position":[[263,4]]},"842":{"position":[[295,5],[325,5]]},"846":{"position":[[5856,5]]}}}],["base_project_editor",{"_index":2361,"t":{"703":{"position":[[808,21],[978,21],[1202,20],[1272,19],[1554,22],[1793,21],[2111,22]]},"707":{"position":[[209,20],[279,19],[914,22],[1153,21],[1471,22]]}}}],["basic",{"_index":346,"t":{"27":{"position":[[141,5]]},"37":{"position":[[228,6]]},"333":{"position":[[143,6]]},"400":{"position":[[180,5]]},"724":{"position":[[377,5]]},"838":{"position":[[349,5],[560,5]]},"850":{"position":[[7,5]]}}}],["bayer",{"_index":2389,"t":{"721":{"position":[[188,5],[209,8],[380,5]]},"726":{"position":[[12368,5],[13925,5],[15868,5],[17435,5],[19210,5],[20508,5],[21995,5],[23868,5],[25365,5],[27040,5]]}}}],["bc574cf98b54",{"_index":2460,"t":{"726":{"position":[[27919,12]]}}}],["be",{"_index":300,"t":{"19":{"position":[[30,5],[139,5],[322,5]]},"21":{"position":[[209,5]]},"39":{"position":[[582,5]]},"45":{"position":[[3295,5]]},"81":{"position":[[617,5]]},"85":{"position":[[1578,5]]},"109":{"position":[[0,5]]},"153":{"position":[[1478,5]]},"155":{"position":[[414,5]]},"327":{"position":[[1527,5]]},"347":{"position":[[905,5]]},"363":{"position":[[1109,5],[2375,5]]},"367":{"position":[[667,5]]},"386":{"position":[[394,5],[558,5]]},"418":{"position":[[1371,5]]},"454":{"position":[[1553,5]]},"482":{"position":[[7820,5],[7851,5],[7883,5]]},"492":{"position":[[1754,5]]},"496":{"position":[[673,5]]},"584":{"position":[[47,5]]},"703":{"position":[[470,5]]},"728":{"position":[[22840,5]]},"797":{"position":[[2617,5]]},"852":{"position":[[74,5]]}}}],["bearer",{"_index":493,"t":{"35":{"position":[[7768,6]]},"45":{"position":[[17335,6],[23529,6],[30080,6]]},"135":{"position":[[1351,6]]},"147":{"position":[[1593,6]]},"185":{"position":[[2037,6]]},"200":{"position":[[4936,6]]},"202":{"position":[[5161,6],[10915,6]]},"214":{"position":[[335,6]]},"250":{"position":[[1429,6]]},"252":{"position":[[1552,6]]},"265":{"position":[[5411,6]]},"267":{"position":[[4939,6],[10831,6]]},"279":{"position":[[909,6],[2787,6]]},"281":{"position":[[1954,6],[3697,6]]},"285":{"position":[[6446,6],[12036,6],[18128,6],[23740,6]]},"294":{"position":[[5196,6]]},"296":{"position":[[5209,6]]},"311":{"position":[[5007,6],[10594,6],[17204,6]]},"357":{"position":[[5374,6]]},"369":{"position":[[5305,6],[10910,6]]},"375":{"position":[[5439,6],[11600,6],[17414,6]]},"382":{"position":[[6269,6]]},"402":{"position":[[5046,6]]},"404":{"position":[[5274,6],[11116,6]]},"422":{"position":[[2511,6]]},"444":{"position":[[5804,6],[12051,6]]},"446":{"position":[[6146,6]]},"448":{"position":[[5145,6]]},"462":{"position":[[5320,6],[10949,6]]},"466":{"position":[[5285,6],[11084,6]]},"504":{"position":[[4965,6]]},"506":{"position":[[5286,6]]},"508":{"position":[[5347,6]]},"522":{"position":[[5358,6]]},"524":{"position":[[5459,6]]},"540":{"position":[[4982,6]]},"542":{"position":[[5622,6]]},"544":{"position":[[5417,6]]},"562":{"position":[[5824,6],[11975,6],[17970,6],[23666,6],[29287,6]]},"574":{"position":[[5344,6]]},"578":{"position":[[5335,6]]},"580":{"position":[[5075,6]]},"582":{"position":[[5085,6],[10599,6]]},"584":{"position":[[4928,6],[10664,6]]},"599":{"position":[[5294,6]]},"606":{"position":[[5747,6],[11787,6],[17818,6]]},"608":{"position":[[5478,6]]},"613":{"position":[[5447,6],[11359,6]]},"618":{"position":[[5916,6]]},"637":{"position":[[5674,6]]},"639":{"position":[[5296,6]]},"645":{"position":[[5873,6]]},"647":{"position":[[5185,6]]},"649":{"position":[[5221,6],[11229,6],[16877,6]]},"667":{"position":[[6430,6],[12602,6],[19438,6],[26260,6],[32501,6]]},"669":{"position":[[6408,6],[12672,6],[19006,6],[25329,6]]},"679":{"position":[[6127,6],[11740,6]]},"681":{"position":[[5229,6],[11150,6]]},"683":{"position":[[5567,6],[11661,6],[17929,6],[24067,6],[29720,6]]},"695":{"position":[[8126,6]]},"701":{"position":[[1517,6],[3358,6],[5207,6],[7058,6],[8905,6],[10758,6]]},"703":{"position":[[4100,6],[9858,6],[11985,6]]},"705":{"position":[[6363,6],[9056,6],[11732,6]]},"707":{"position":[[7665,6]]},"726":{"position":[[8809,6],[18053,6],[25910,6],[33314,6],[39078,6],[44710,6],[50357,6]]},"728":{"position":[[5361,6],[13260,6],[19222,6],[29635,6],[37838,6],[47373,6]]},"745":{"position":[[6695,6],[12581,6],[18069,6],[23912,6],[29543,6],[37272,6],[42898,6]]},"747":{"position":[[8217,6],[14750,6]]},"749":{"position":[[5265,6],[11633,6],[17503,6]]},"751":{"position":[[8281,6],[14972,6],[22272,6]]},"771":{"position":[[5377,6],[11041,6],[17455,6],[24144,6],[29833,6]]},"773":{"position":[[8832,6],[15487,6]]},"775":{"position":[[8131,6],[15594,6],[22641,6]]},"777":{"position":[[8653,6],[15358,6]]},"789":{"position":[[9781,6]]},"795":{"position":[[5476,6],[11184,6],[16947,6],[22804,6]]},"797":{"position":[[9571,6],[17082,6],[24567,6],[30878,6]]},"799":{"position":[[6986,6],[14417,6],[21348,6]]},"801":{"position":[[16157,6]]},"820":{"position":[[6708,6],[12621,6],[18112,6],[23947,6],[29575,6],[36787,6],[42410,6]]},"822":{"position":[[8494,6],[15429,6]]},"824":{"position":[[7685,6],[14357,6]]},"826":{"position":[[9328,6],[16032,6],[21800,6],[27507,6],[33289,6],[38986,6]]},"844":{"position":[[7169,6],[13142,6],[18880,6],[24810,6],[30588,6],[37874,6],[44514,6]]},"846":{"position":[[5201,6],[12478,6]]},"848":{"position":[[12817,6],[19890,6],[26588,6],[33083,6],[39260,6],[45079,6],[51119,6],[56865,6]]}}}],["becam",{"_index":1464,"t":{"222":{"position":[[665,6],[747,6]]}}}],["becki",{"_index":1314,"t":{"202":{"position":[[5732,6],[5775,5]]},"285":{"position":[[13008,6]]},"313":{"position":[[147,6],[254,5],[337,5]]},"363":{"position":[[423,5],[1294,5]]},"369":{"position":[[153,5],[12073,5]]},"375":{"position":[[12203,5],[12244,5],[12323,5]]},"454":{"position":[[540,5],[625,5],[1726,5],[1976,5]]},"462":{"position":[[152,5],[11570,5]]},"466":{"position":[[57,5]]},"580":{"position":[[32,6],[60,5],[184,5]]},"582":{"position":[[23,5]]},"584":{"position":[[5608,5]]}}}],["becom",{"_index":854,"t":{"97":{"position":[[867,7],[1051,7]]},"210":{"position":[[846,7]]},"317":{"position":[[80,7]]},"323":{"position":[[294,7]]},"327":{"position":[[1421,7]]},"355":{"position":[[143,7]]},"371":{"position":[[197,7]]},"442":{"position":[[251,7]]},"480":{"position":[[2689,6]]},"484":{"position":[[1859,7],[2128,7]]},"508":{"position":[[6131,8]]},"544":{"position":[[6006,8]]},"618":{"position":[[7022,6]]},"703":{"position":[[1076,8]]},"728":{"position":[[39494,7]]},"769":{"position":[[515,7]]},"775":{"position":[[765,8]]},"797":{"position":[[1281,8],[2780,8]]}}}],["befor",{"_index":135,"t":{"3":{"position":[[2927,6]]},"35":{"position":[[2539,6],[4421,6],[5865,6]]},"41":{"position":[[110,6]]},"43":{"position":[[963,6],[1963,6]]},"45":{"position":[[3288,6],[13758,6],[15109,6],[16179,6],[19952,6],[21303,6],[22373,6],[26327,6],[27732,6],[28844,6]]},"81":{"position":[[610,6]]},"109":{"position":[[665,6]]},"133":{"position":[[0,6],[1173,6],[2110,6],[2801,6]]},"145":{"position":[[0,6],[1173,6],[2110,6],[2801,6]]},"155":{"position":[[5,6]]},"171":{"position":[[0,6]]},"173":{"position":[[4936,6]]},"183":{"position":[[573,6],[1202,6],[2049,6],[2737,6]]},"185":{"position":[[921,6],[1691,6],[2777,6],[3839,6]]},"187":{"position":[[797,6],[1716,6],[2940,6],[4400,6]]},"200":{"position":[[1544,6],[3005,6],[4099,6]]},"202":{"position":[[1596,6],[2944,6],[4011,6],[7342,6],[8692,6],[9761,6]]},"248":{"position":[[0,6],[1173,6],[2110,6],[2801,6]]},"265":{"position":[[1886,6],[3224,6],[4281,6]]},"267":{"position":[[1560,6],[3016,6],[4105,6],[7302,6],[8641,6],[9699,6]]},"277":{"position":[[1145,6],[2082,6],[2773,6]]},"285":{"position":[[2897,6],[4241,6],[5304,6],[8534,6],[10032,6],[11163,6],[14563,6],[15911,6],[16978,6],[20167,6],[21517,6],[22586,6]]},"294":{"position":[[1805,6],[3265,6],[4358,6]]},"296":{"position":[[1640,6],[2989,6],[4057,6]]},"311":{"position":[[1642,6],[3094,6],[4179,6],[7224,6],[8677,6],[9763,6],[13207,6],[14904,6],[16196,6]]},"317":{"position":[[179,6]]},"323":{"position":[[553,6]]},"327":{"position":[[1520,6],[2577,6]]},"333":{"position":[[885,6]]},"357":{"position":[[1777,6],[3133,6],[4208,6]]},"363":{"position":[[0,6]]},"369":{"position":[[1736,6],[3085,6],[4153,6],[7345,6],[8693,6],[9760,6]]},"375":{"position":[[1871,6],[3391,6],[4544,6],[8031,6],[9380,6],[10448,6],[13845,6],[15194,6],[16262,6]]},"382":{"position":[[2712,6],[4058,6],[5123,6]]},"402":{"position":[[1618,6],[3091,6],[4197,6]]},"404":{"position":[[1677,6],[3033,6],[4108,6],[7515,6],[8872,6],[9948,6]]},"408":{"position":[[981,6]]},"410":{"position":[[402,6]]},"430":{"position":[[0,6]]},"444":{"position":[[1840,6],[3525,6],[4794,6],[8474,6],[9825,6],[10895,6]]},"446":{"position":[[1852,6],[3647,6],[5026,6]]},"448":{"position":[[1568,6],[2919,6],[3989,6]]},"452":{"position":[[81,6],[610,6]]},"462":{"position":[[1739,6],[3091,6],[4162,6],[7372,6],[8723,6],[9793,6]]},"466":{"position":[[1700,6],[3053,6],[4125,6],[7499,6],[8852,6],[9924,6]]},"504":{"position":[[1579,6],[3038,6],[4130,6]]},"506":{"position":[[1661,6],[3200,6],[4372,6]]},"508":{"position":[[1750,6],[3106,6],[4181,6]]},"522":{"position":[[1817,6],[3328,6],[4472,6]]},"524":{"position":[[1878,6],[3230,6],[4301,6]]},"540":{"position":[[1590,6],[3051,6],[4145,6]]},"542":{"position":[[2000,6],[3538,6],[4709,6]]},"544":{"position":[[1812,6],[3170,6],[4247,6]]},"562":{"position":[[1950,6],[3605,6],[4844,6],[8406,6],[9755,6],[10823,6],[14401,6],[15750,6],[16818,6],[20089,6],[21440,6],[22510,6],[25714,6],[27064,6],[28133,6]]},"574":{"position":[[1720,6],[3291,6],[4446,6]]},"578":{"position":[[1723,6],[3290,6],[4441,6]]},"580":{"position":[[1686,6],[3146,6],[4239,6]]},"582":{"position":[[1564,6],[2901,6],[3957,6],[7078,6],[8415,6],[9471,6]]},"584":{"position":[[1561,6],[3013,6],[4098,6],[7139,6],[8477,6],[9534,6]]},"599":{"position":[[1733,6],[3080,6],[4146,6]]},"606":{"position":[[2028,6],[3472,6],[4591,6],[8165,6],[9570,6],[10668,6],[14156,6],[15571,6],[16679,6]]},"608":{"position":[[2113,6],[3439,6],[4440,6]]},"613":{"position":[[1763,6],[3176,6],[4304,6],[7675,6],[9088,6],[10216,6]]},"618":{"position":[[1777,6],[3291,6],[4524,6]]},"637":{"position":[[1935,6],[3512,6],[4722,6]]},"639":{"position":[[1687,6],[3046,6],[4124,6]]},"645":{"position":[[1759,6],[3494,6],[4813,6]]},"647":{"position":[[1608,6],[2959,6],[4029,6]]},"649":{"position":[[1615,6],[3147,6],[4312,6],[7648,6],[9000,6],[10071,6],[13284,6],[14639,6],[15713,6]]},"667":{"position":[[2865,6],[4213,6],[5280,6],[9037,6],[10385,6],[11452,6],[15861,6],[17212,6],[18282,6],[22695,6],[24043,6],[25110,6],[28932,6],[30281,6],[31349,6]]},"669":{"position":[[2839,6],[4188,6],[5256,6],[9091,6],[10443,6],[11514,6],[15433,6],[16783,6],[17852,6],[21756,6],[23106,6],[24175,6]]},"679":{"position":[[2554,6],[3904,6],[4973,6],[8171,6],[9520,6],[10588,6]]},"681":{"position":[[1685,6],[3197,6],[4342,6],[7565,6],[8918,6],[9990,6]]},"683":{"position":[[1763,6],[3215,6],[4396,6],[7962,6],[9558,6],[10738,6],[14225,6],[15822,6],[17003,6],[18868,6],[20494,6],[21844,6],[22913,6],[26155,6],[27503,6],[28570,6]]},"693":{"position":[[880,6]]},"703":{"position":[[6263,6],[7792,6],[8954,6]]},"705":{"position":[[2682,6],[4239,6],[5429,6]]},"709":{"position":[[158,6]]},"713":{"position":[[243,6]]},"715":{"position":[[73,6]]},"726":{"position":[[2493,6],[5094,6],[7083,6],[13351,6],[15315,6],[16814,6],[21418,6],[23312,6],[24741,6],[29745,6],[31094,6],[32162,6],[33942,6],[35505,6],[36855,6],[37924,6],[41125,6],[42478,6],[43550,6],[46768,6],[48122,6],[49195,6]]},"728":{"position":[[1788,6],[3138,6],[4207,6],[9703,6],[11049,6],[12114,6],[15629,6],[16984,6],[18058,6],[26046,6],[27400,6],[28473,6],[34285,6],[35630,6],[36694,6],[43820,6],[45165,6],[46229,6]]},"734":{"position":[[243,6]]},"736":{"position":[[73,6]]},"745":{"position":[[3282,6],[4750,6],[5851,6],[9004,6],[10355,6],[11425,6],[14656,6],[16124,6],[17225,6],[20335,6],[21686,6],[22756,6],[25962,6],[27314,6],[28385,6],[33695,6],[35046,6],[36116,6],[39321,6],[40672,6],[41742,6]]},"747":{"position":[[4040,6],[5796,6],[7136,6],[11165,6],[12518,6],[13590,6]]},"749":{"position":[[1780,6],[3272,6],[4397,6],[8053,6],[9577,6],[10734,6],[13926,6],[15277,6],[16347,6]]},"751":{"position":[[629,6],[4537,6],[6148,6],[7343,6],[11379,6],[12734,6],[13808,6],[18793,6],[20283,6],[21406,6]]},"757":{"position":[[243,6]]},"759":{"position":[[73,6]]},"771":{"position":[[236,6],[1967,6],[3434,6],[4534,6],[7619,6],[9090,6],[10194,6],[13446,6],[15178,6],[16445,6],[20571,6],[21921,6],[22990,6],[26268,6],[27616,6],[28683,6]]},"773":{"position":[[4585,6],[6429,6],[7759,6],[11902,6],[13255,6],[14327,6]]},"775":{"position":[[4378,6],[5992,6],[7190,6],[11098,6],[13025,6],[14438,6],[19080,6],[20427,6],[21493,6]]},"777":{"position":[[4635,6],[6370,6],[7640,6],[11777,6],[13129,6],[14200,6]]},"787":{"position":[[882,6]]},"789":{"position":[[4578,6],[6742,6],[8392,6]]},"795":{"position":[[1919,6],[3265,6],[4330,6],[7611,6],[8961,6],[10030,6],[13358,6],[14885,6],[16045,6],[19243,6],[20590,6],[21656,6]]},"797":{"position":[[6030,6],[7372,6],[8433,6],[12233,6],[14246,6],[15794,6],[20531,6],[22240,6],[23533,6],[27321,6],[28667,6],[29732,6]]},"799":{"position":[[2783,6],[4547,6],[5895,6],[10185,6],[11719,6],[12985,6],[17112,6],[18647,6],[19914,6]]},"801":{"position":[[6562,6],[10454,6],[13440,6]]},"805":{"position":[[277,6]]},"809":{"position":[[243,6]]},"811":{"position":[[73,6]]},"820":{"position":[[3286,6],[4757,6],[5861,6],[9032,6],[10386,6],[11459,6],[14702,6],[16169,6],[17269,6],[20374,6],[21724,6],[22793,6],[25994,6],[27346,6],[28417,6],[33214,6],[34564,6],[35633,6],[38833,6],[40184,6],[41254,6]]},"822":{"position":[[3886,6],[5851,6],[7302,6],[11840,6],[13194,6],[14267,6]]},"824":{"position":[[3598,6],[5324,6],[6634,6],[10756,6],[12113,6],[13189,6]]},"826":{"position":[[4644,6],[6602,6],[8095,6],[12427,6],[13785,6],[14862,6],[18187,6],[19547,6],[20626,6],[23886,6],[25248,6],[26329,6],[29676,6],[31036,6],[32115,6],[35373,6],[36733,6],[37812,6]]},"832":{"position":[[243,6]]},"834":{"position":[[73,6]]},"844":{"position":[[3583,6],[5109,6],[6268,6],[9545,6],[10901,6],[11976,6],[15294,6],[16820,6],[17979,6],[21213,6],[22569,6],[23644,6],[26963,6],[28326,6],[29408,6],[33382,6],[35276,6],[36705,6],[40917,6],[42273,6],[43348,6]]},"846":{"position":[[1624,6],[2975,6],[4045,6],[5755,7],[8905,6],[10255,6],[11324,6]]},"848":{"position":[[8577,6],[10386,6],[11730,6],[16097,6],[17692,6],[18920,6],[22584,6],[24282,6],[25564,6],[29333,6],[30946,6],[32143,6],[35760,6],[37257,6],[38387,6],[41630,6],[43110,6],[44223,6],[47554,6],[48902,6],[49969,6],[53240,6],[54603,6],[55685,6]]}}}],["beforehand",{"_index":1836,"t":{"428":{"position":[[590,10]]},"705":{"position":[[613,10]]},"799":{"position":[[8221,10]]}}}],["begin",{"_index":781,"t":{"85":{"position":[[43,9]]},"482":{"position":[[193,9]]},"728":{"position":[[41847,9]]}}}],["behavior",{"_index":1057,"t":{"155":{"position":[[1770,8]]},"238":{"position":[[382,8]]},"408":{"position":[[688,8],[1225,8]]},"548":{"position":[[1367,9]]},"846":{"position":[[6089,9]]}}}],["behaviour",{"_index":2266,"t":{"669":{"position":[[7201,9]]}}}],["behind",{"_index":2377,"t":{"717":{"position":[[44,6]]}}}],["believ",{"_index":621,"t":{"45":{"position":[[3154,7]]},"97":{"position":[[1732,7]]},"408":{"position":[[212,7]]}}}],["belong",{"_index":1577,"t":{"283":{"position":[[697,7]]},"333":{"position":[[1267,7]]},"689":{"position":[[623,7]]},"745":{"position":[[1643,6]]},"783":{"position":[[650,7]]},"820":{"position":[[1556,6],[31470,6]]},"822":{"position":[[1873,6]]},"844":{"position":[[1795,6]]}}}],["below",{"_index":119,"t":{"3":{"position":[[2005,6],[2460,6]]},"45":{"position":[[797,5],[1595,5]]},"83":{"position":[[0,5]]},"89":{"position":[[278,6],[1235,5]]},"161":{"position":[[18,5]]},"191":{"position":[[145,6]]},"212":{"position":[[1526,5],[4173,5]]},"258":{"position":[[145,6]]},"285":{"position":[[145,6]]},"302":{"position":[[145,6]]},"347":{"position":[[125,6],[176,6]]},"363":{"position":[[124,6],[175,6]]},"396":{"position":[[145,6]]},"416":{"position":[[344,5]]},"418":{"position":[[2684,6]]},"422":{"position":[[767,6],[1133,6]]},"430":{"position":[[124,6]]},"454":{"position":[[145,6],[196,6]]},"492":{"position":[[145,6]]},"514":{"position":[[145,6]]},"522":{"position":[[6390,5],[6739,5]]},"530":{"position":[[145,6]]},"550":{"position":[[145,6]]},"568":{"position":[[145,6]]},"590":{"position":[[145,6]]},"628":{"position":[[124,6],[175,6]]},"655":{"position":[[125,6]]},"677":{"position":[[13,5]]},"679":{"position":[[178,6]]},"713":{"position":[[145,6]]},"717":{"position":[[171,6],[761,5]]},"728":{"position":[[23315,5],[40573,5],[47976,6]]},"734":{"position":[[145,6]]},"738":{"position":[[138,6],[340,5]]},"757":{"position":[[145,6]]},"761":{"position":[[106,6]]},"775":{"position":[[2801,5]]},"809":{"position":[[145,6]]},"813":{"position":[[176,6],[384,5]]},"832":{"position":[[145,6]]},"836":{"position":[[307,6],[719,6]]}}}],["best",{"_index":363,"t":{"29":{"position":[[1058,4],[1073,4],[1167,4],[1182,4]]},"111":{"position":[[222,4],[247,4]]},"151":{"position":[[48,4]]},"157":{"position":[[100,4],[125,4]]},"232":{"position":[[72,4],[97,4]]},"234":{"position":[[48,4]]},"426":{"position":[[139,4],[164,4]]},"558":{"position":[[37,4]]},"560":{"position":[[34,4]]},"673":{"position":[[141,4]]},"687":{"position":[[261,4],[286,4]]}}}],["beta",{"_index":184,"t":{"7":{"position":[[467,4]]},"721":{"position":[[138,4],[353,4]]},"726":{"position":[[12228,4],[13726,4],[15718,4],[17286,4],[19066,4],[20385,4],[21813,4],[23735,4],[25233,4],[26913,4]]}}}],["beth",{"_index":1843,"t":{"440":{"position":[[948,4]]},"444":{"position":[[64,5],[116,4],[1044,4],[2381,4],[4045,4],[5382,4],[6711,4]]},"484":{"position":[[1719,4],[2100,4],[2208,4],[2812,4],[2922,4],[2981,4],[3030,4],[3078,4],[3147,4],[3185,4],[3234,4],[3283,4],[3331,4]]},"667":{"position":[[7453,4],[13465,7]]},"695":{"position":[[2916,4],[3634,4],[4921,4],[6372,4],[7494,4],[10115,4]]},"697":{"position":[[376,4]]},"701":{"position":[[3895,4],[5726,4]]},"705":{"position":[[12793,4],[12822,4]]},"707":{"position":[[3173,4],[4460,4],[5911,4],[7033,4],[9654,4]]},"721":{"position":[[364,5],[665,4],[707,4],[762,4]]},"726":{"position":[[20484,4],[21971,4],[23844,4],[25341,4],[27016,4]]},"728":{"position":[[42019,4],[42061,4],[42116,4],[48246,4],[48276,4],[48322,4],[48355,4],[48404,4],[48431,4]]},"742":{"position":[[40,4],[482,4]]},"745":{"position":[[13148,4],[30162,4]]},"765":{"position":[[141,4],[269,4]]},"771":{"position":[[76,4],[30416,5],[30545,4],[30580,4],[30725,4],[30764,4],[30898,4],[30930,4]]},"773":{"position":[[39,4],[986,5],[2547,4],[16077,5],[16226,4],[16261,4],[16406,4],[16445,4],[16579,4],[16611,4]]},"775":{"position":[[23411,4],[23446,4],[23589,4],[23628,4],[23761,4],[23793,4]]},"777":{"position":[[48,4]]},"817":{"position":[[66,5],[283,4]]},"820":{"position":[[1737,4],[7470,4]]},"822":{"position":[[2822,5],[4262,5],[6255,5],[7775,5],[9641,5]]},"826":{"position":[[16597,4]]}}}],["beth'",{"_index":2576,"t":{"771":{"position":[[420,6],[11798,6]]}}}],["bethani",{"_index":2293,"t":{"681":{"position":[[138,7],[886,7],[2050,7],[3590,7],[4804,7],[5822,7],[6024,7]]}}}],["better",{"_index":773,"t":{"81":{"position":[[957,7]]},"238":{"position":[[250,6]]},"347":{"position":[[3,6]]},"408":{"position":[[270,6]]},"412":{"position":[[1236,6]]},"422":{"position":[[55,6]]},"476":{"position":[[1013,6]]},"628":{"position":[[3,6]]},"655":{"position":[[3,6]]},"795":{"position":[[23454,7]]}}}],["between",{"_index":50,"t":{"3":{"position":[[782,7]]},"25":{"position":[[337,7]]},"35":{"position":[[8399,7]]},"45":{"position":[[94,7],[2878,7],[5359,7],[5753,7],[9230,7],[9552,7],[9698,7],[9850,7],[10130,7],[11977,7],[12192,7]]},"59":{"position":[[127,7]]},"67":{"position":[[48,7]]},"69":{"position":[[24,7],[304,7]]},"81":{"position":[[901,7]]},"179":{"position":[[363,7]]},"191":{"position":[[1332,7]]},"195":{"position":[[254,7]]},"212":{"position":[[151,7],[620,7]]},"256":{"position":[[292,7],[404,7]]},"258":{"position":[[1051,7]]},"262":{"position":[[254,7]]},"265":{"position":[[277,7]]},"267":{"position":[[5641,7]]},"279":{"position":[[1296,7],[3381,7]]},"285":{"position":[[24763,7]]},"291":{"position":[[254,7]]},"302":{"position":[[1653,7]]},"308":{"position":[[254,7]]},"323":{"position":[[407,7]]},"347":{"position":[[1464,7]]},"351":{"position":[[254,7]]},"363":{"position":[[1962,7]]},"367":{"position":[[254,7]]},"394":{"position":[[302,7],[413,7]]},"396":{"position":[[1043,7]]},"398":{"position":[[254,7]]},"430":{"position":[[1287,7]]},"436":{"position":[[45,7]]},"454":{"position":[[2950,7]]},"460":{"position":[[254,7]]},"482":{"position":[[2736,7],[3715,7],[4400,7],[5766,7],[6046,7],[6902,7]]},"490":{"position":[[59,7],[545,7]]},"492":{"position":[[1335,7]]},"496":{"position":[[254,7]]},"498":{"position":[[295,7]]},"500":{"position":[[27,7],[202,7]]},"502":{"position":[[29,7]]},"508":{"position":[[6001,7]]},"514":{"position":[[1105,7]]},"518":{"position":[[254,7]]},"530":{"position":[[1082,7]]},"534":{"position":[[254,7]]},"550":{"position":[[1194,7],[1599,7],[1751,7],[1854,7]]},"554":{"position":[[254,7],[659,7],[811,7],[914,7]]},"568":{"position":[[1035,7]]},"572":{"position":[[254,7]]},"586":{"position":[[68,7]]},"590":{"position":[[1506,7]]},"594":{"position":[[254,7]]},"626":{"position":[[246,7],[421,7]]},"628":{"position":[[1279,7]]},"632":{"position":[[254,7]]},"637":{"position":[[72,7]]},"655":{"position":[[623,7]]},"659":{"position":[[254,7]]},"667":{"position":[[33266,7]]},"675":{"position":[[327,7]]},"687":{"position":[[199,7]]},"693":{"position":[[128,7],[688,7]]},"713":{"position":[[347,7]]},"724":{"position":[[488,7]]},"726":{"position":[[141,7],[11450,7],[19587,7]]},"728":{"position":[[6663,7],[6929,7],[13961,7],[22407,7],[38633,7]]},"730":{"position":[[488,7]]},"732":{"position":[[246,7]]},"734":{"position":[[516,7]]},"757":{"position":[[1108,7]]},"787":{"position":[[128,7],[690,7]]},"797":{"position":[[19760,7],[21121,7],[22809,7],[24170,7],[25521,7]]},"799":{"position":[[1058,7],[2012,7],[3428,7],[5171,7],[6588,7],[7920,7]]},"807":{"position":[[128,7]]},"809":{"position":[[516,7]]},"824":{"position":[[31,7]]},"830":{"position":[[153,7]]},"848":{"position":[[563,7],[6717,7]]}}}],["beyond",{"_index":1920,"t":{"476":{"position":[[2646,6]]},"478":{"position":[[1686,6],[3528,6]]},"480":{"position":[[2018,6]]},"482":{"position":[[1003,6]]}}}],["bill",{"_index":2564,"t":{"753":{"position":[[64,7]]}}}],["binari",{"_index":959,"t":{"113":{"position":[[1866,8]]},"123":{"position":[[26,8]]}}}],["bit",{"_index":841,"t":{"97":{"position":[[113,3]]},"212":{"position":[[641,3]]}}}],["block",{"_index":648,"t":{"45":{"position":[[4415,6],[5131,6],[7439,6]]},"83":{"position":[[87,6]]},"85":{"position":[[2549,7]]},"87":{"position":[[2149,7]]},"91":{"position":[[1538,7]]},"95":{"position":[[232,5],[308,7],[476,9],[867,7],[991,10],[1306,9],[1356,8],[1767,7],[1837,10]]},"212":{"position":[[1537,5],[4184,5]]},"333":{"position":[[596,5],[667,7],[1329,6],[1375,6]]},"341":{"position":[[45,6],[191,6]]},"361":{"position":[[106,8],[397,5],[541,10],[581,8]]},"369":{"position":[[11630,8],[11802,7],[11884,7],[11981,7],[12029,8]]},"371":{"position":[[21,9],[134,7],[278,8],[477,10],[561,10],[985,7]]},"373":{"position":[[30,7],[128,8],[263,7],[365,8],[424,7],[580,10],[706,9],[756,10]]},"375":{"position":[[77,7],[205,7],[309,7],[1072,7],[1146,10],[2244,7],[3792,7],[3874,10],[5014,7],[5993,7],[6038,7],[6226,8],[6364,8],[18074,8]]},"468":{"position":[[182,5]]},"526":{"position":[[255,5]]},"730":{"position":[[612,5]]}}}],["block_list",{"_index":1282,"t":{"189":{"position":[[360,10]]},"528":{"position":[[378,10]]}}}],["blocklist",{"_index":839,"t":{"95":{"position":[[1077,11]]},"468":{"position":[[148,10]]},"526":{"position":[[226,10]]}}}],["blog",{"_index":1842,"t":{"440":{"position":[[596,4],[687,4]]},"512":{"position":[[438,4]]},"753":{"position":[[181,4]]}}}],["blue",{"_index":1924,"t":{"478":{"position":[[472,5]]}}}],["bob",{"_index":1672,"t":{"347":{"position":[[337,3]]},"357":{"position":[[54,3],[113,3],[195,3]]},"402":{"position":[[49,3]]},"404":{"position":[[121,3],[5872,3]]},"412":{"position":[[378,3]]},"414":{"position":[[109,5],[158,6],[284,6]]},"498":{"position":[[452,3],[507,3],[607,3],[759,3]]},"504":{"position":[[88,3]]},"506":{"position":[[9,3]]},"508":{"position":[[195,3],[6009,3],[6140,3],[6331,3]]},"522":{"position":[[6449,3]]},"524":{"position":[[60,3],[181,3]]},"562":{"position":[[263,3],[1071,3],[2319,3],[4002,3],[5310,3],[6578,3],[6858,3],[12513,3],[12583,3],[12816,3]]},"590":{"position":[[300,3],[902,3]]},"599":{"position":[[178,3],[5933,3]]},"606":{"position":[[434,3],[6544,3]]},"608":{"position":[[544,3],[617,3],[5913,3],[6084,3]]},"613":{"position":[[143,3],[12101,3]]},"840":{"position":[[140,3],[331,3],[734,3]]},"842":{"position":[[665,3]]},"844":{"position":[[290,3],[31222,3],[32319,3],[33747,3],[35669,3],[37167,3],[38871,3]]},"848":{"position":[[622,3],[706,3],[847,4],[1100,3],[27734,3]]}}}],["bodi",{"_index":438,"t":{"35":{"position":[[3195,4],[3302,7],[5073,4]]},"43":{"position":[[2627,4],[2776,4]]},"45":{"position":[[14053,4],[15421,4],[16583,4],[20247,4],[21615,4],[22777,4],[26628,4],[28050,4],[29248,4]]},"135":{"position":[[418,4],[726,4],[975,4]]},"147":{"position":[[450,4],[822,4],[1117,4]]},"173":{"position":[[5193,4]]},"200":{"position":[[1839,4],[3323,4],[4503,4],[4510,4]]},"202":{"position":[[1891,4],[3256,4],[4415,4],[7637,4],[9004,4],[10165,4]]},"250":{"position":[[362,4],[793,4],[1067,4],[1074,4]]},"252":{"position":[[518,4],[950,4],[1225,4],[1232,4]]},"265":{"position":[[2181,4],[3536,4],[4685,4]]},"267":{"position":[[1855,4],[3334,4],[4509,4],[4516,4],[7597,4],[8953,4],[10103,4]]},"279":{"position":[[301,4],[473,4],[636,4],[1939,4],[2111,4],[2394,4]]},"281":{"position":[[1292,4],[1480,4],[1659,4],[2795,4],[2983,4],[3282,4]]},"285":{"position":[[3192,4],[4553,4],[5708,4],[8829,4],[10350,4],[11567,4],[11574,4],[14858,4],[16223,4],[17382,4],[20462,4],[21829,4],[22990,4]]},"294":{"position":[[2100,4],[3583,4],[4762,4],[4769,4]]},"296":{"position":[[1935,4],[3301,4],[4461,4]]},"311":{"position":[[1937,4],[3412,4],[4583,4],[4590,4],[7519,4],[8995,4],[10167,4],[10174,4],[13502,4],[15222,4],[16600,4],[16607,4]]},"357":{"position":[[2072,4],[3445,4],[4612,4]]},"369":{"position":[[2031,4],[3397,4],[4557,4],[7640,4],[9005,4],[10164,4]]},"375":{"position":[[2166,4],[3709,4],[4948,4],[4955,4],[8326,4],[9692,4],[10852,4],[14140,4],[15506,4],[16666,4]]},"382":{"position":[[3007,4],[4370,4],[5527,4]]},"402":{"position":[[1913,4],[3409,4],[4601,4],[4608,4]]},"404":{"position":[[1972,4],[3345,4],[4512,4],[7810,4],[9184,4],[10352,4]]},"422":{"position":[[1503,4],[1951,4],[2242,4],[2249,4]]},"444":{"position":[[2135,4],[3843,4],[5198,4],[5205,4],[8769,4],[10137,4],[11299,4]]},"446":{"position":[[2147,4],[3965,4],[5430,4],[5437,4]]},"448":{"position":[[1863,4],[3231,4],[4393,4]]},"462":{"position":[[2034,4],[3403,4],[4566,4],[7667,4],[9035,4],[10197,4]]},"466":{"position":[[1995,4],[3365,4],[4529,4],[7794,4],[9164,4],[10328,4]]},"504":{"position":[[1874,4],[3356,4],[4534,4],[4541,4]]},"506":{"position":[[1956,4],[3518,4],[4776,4],[4783,4]]},"508":{"position":[[2045,4],[3418,4],[4585,4]]},"522":{"position":[[2112,4],[3646,4],[4876,4],[4883,4]]},"524":{"position":[[2173,4],[3542,4],[4705,4]]},"540":{"position":[[1885,4],[3369,4],[4549,4],[4556,4]]},"542":{"position":[[2295,4],[3856,4],[5113,4],[5120,4]]},"544":{"position":[[2107,4],[3482,4],[4651,4]]},"562":{"position":[[2245,4],[3923,4],[5248,4],[5255,4],[8701,4],[10067,4],[11227,4],[14696,4],[16062,4],[17222,4],[20384,4],[21752,4],[22914,4],[26009,4],[27376,4],[28537,4]]},"574":{"position":[[2015,4],[3609,4],[4850,4],[4857,4]]},"578":{"position":[[2018,4],[3608,4],[4845,4],[4852,4]]},"580":{"position":[[1981,4],[3464,4],[4643,4],[4650,4]]},"582":{"position":[[1859,4],[3213,4],[4361,4],[7373,4],[8727,4],[9875,4]]},"584":{"position":[[1856,4],[3331,4],[4502,4],[4509,4],[7434,4],[8789,4],[9938,4]]},"599":{"position":[[2028,4],[3392,4],[4550,4]]},"606":{"position":[[2249,4],[3727,4],[4938,4],[8386,4],[9825,4],[11015,4],[14377,4],[15826,4],[17026,4]]},"608":{"position":[[2334,4],[3694,4],[4787,4]]},"613":{"position":[[2059,4],[3488,4],[4708,4],[7971,4],[9400,4],[10620,4]]},"618":{"position":[[2078,4],[3609,4],[4928,4]]},"637":{"position":[[2230,4],[3830,4],[5126,4],[5133,4]]},"639":{"position":[[1982,4],[3358,4],[4528,4]]},"645":{"position":[[2054,4],[3812,4],[5217,4],[5224,4]]},"647":{"position":[[1903,4],[3271,4],[4433,4]]},"649":{"position":[[1910,4],[3465,4],[4716,4],[4723,4],[7943,4],[9312,4],[10475,4],[13579,4],[14951,4],[16117,4]]},"667":{"position":[[3160,4],[4525,4],[5684,4],[9332,4],[10697,4],[11856,4],[16156,4],[17524,4],[18686,4],[22990,4],[24355,4],[25514,4],[29227,4],[30593,4],[31753,4]]},"669":{"position":[[3134,4],[4500,4],[5660,4],[9386,4],[10755,4],[11918,4],[15728,4],[17095,4],[18256,4],[22051,4],[23418,4],[24579,4]]},"679":{"position":[[2849,4],[4216,4],[5377,4],[8466,4],[9832,4],[10992,4]]},"681":{"position":[[1980,4],[3515,4],[4746,4],[4753,4],[7860,4],[9230,4],[10394,4]]},"683":{"position":[[1984,4],[3470,4],[4743,4],[8257,4],[9876,4],[11142,4],[11149,4],[14520,4],[16140,4],[17407,4],[17414,4],[20789,4],[22156,4],[23317,4],[26450,4],[27815,4],[28974,4]]},"695":{"position":[[4278,4],[5871,4],[7013,4],[7020,4]]},"701":{"position":[[580,4],[889,4],[1139,4],[2413,4],[2724,4],[2976,4],[4270,4],[4579,4],[4829,4],[6109,4],[6421,4],[6674,4],[7964,4],[8274,4],[8525,4],[9809,4],[10121,4],[10374,4]]},"703":{"position":[[3159,4],[3469,4],[3720,4],[6558,4],[8110,4],[9358,4],[9365,4],[11048,4],[11357,4],[11607,4]]},"705":{"position":[[2977,4],[4557,4],[5833,4],[5840,4],[7701,4],[8127,4],[8506,4],[10373,4],[10800,4],[11180,4]]},"707":{"position":[[3817,4],[5410,4],[6552,4],[6559,4]]},"726":{"position":[[2788,4],[5412,4],[7487,4],[7494,4],[13646,4],[15633,4],[17218,4],[17225,4],[21713,4],[23630,4],[25145,4],[25152,4],[30040,4],[31406,4],[32566,4],[35800,4],[37167,4],[38328,4],[41420,4],[42790,4],[43954,4],[47063,4],[48434,4],[49599,4]]},"728":{"position":[[2083,4],[3450,4],[4611,4],[9998,4],[11361,4],[12518,4],[15924,4],[17296,4],[18462,4],[26341,4],[27712,4],[28877,4],[34580,4],[35942,4],[37098,4],[44115,4],[45477,4],[46633,4]]},"745":{"position":[[3577,4],[5068,4],[6255,4],[6262,4],[9299,4],[10667,4],[11829,4],[14951,4],[16442,4],[17629,4],[17636,4],[20630,4],[21998,4],[23160,4],[26257,4],[27626,4],[28789,4],[33990,4],[35358,4],[36520,4],[39616,4],[40984,4],[42146,4]]},"747":{"position":[[4335,4],[6114,4],[7540,4],[7547,4],[11460,4],[12830,4],[13994,4]]},"749":{"position":[[2075,4],[3590,4],[4801,4],[4808,4],[8348,4],[9895,4],[11138,4],[11145,4],[14221,4],[15589,4],[16751,4]]},"751":{"position":[[4832,4],[6466,4],[7747,4],[7754,4],[11674,4],[13046,4],[14212,4],[19088,4],[20601,4],[21810,4],[21817,4]]},"771":{"position":[[2262,4],[3752,4],[4938,4],[4945,4],[7914,4],[9408,4],[10598,4],[10605,4],[13741,4],[15496,4],[16849,4],[16856,4],[20866,4],[22233,4],[23394,4],[26563,4],[27928,4],[29087,4]]},"773":{"position":[[4880,4],[6747,4],[8163,4],[8170,4],[12197,4],[13567,4],[14731,4]]},"775":{"position":[[4673,4],[6310,4],[7594,4],[7601,4],[11393,4],[13343,4],[14842,4],[14849,4],[19375,4],[20739,4],[21897,4]]},"777":{"position":[[4930,4],[6688,4],[8044,4],[8051,4],[12072,4],[13441,4],[14604,4]]},"789":{"position":[[4873,4],[7060,4],[8796,4],[8803,4]]},"795":{"position":[[2214,4],[3577,4],[4734,4],[7906,4],[9273,4],[10434,4],[13653,4],[15203,4],[16449,4],[16456,4],[19538,4],[20902,4],[22060,4]]},"797":{"position":[[6325,4],[7684,4],[8837,4],[12528,4],[14564,4],[16198,4],[16205,4],[20826,4],[22558,4],[23937,4],[23944,4],[27616,4],[28979,4],[30136,4]]},"799":{"position":[[3078,4],[4865,4],[6299,4],[6306,4],[10480,4],[12031,4],[13389,4],[17407,4],[18959,4],[20318,4]]},"801":{"position":[[6857,4],[10772,4],[13844,4],[13851,4]]},"820":{"position":[[3581,4],[5075,4],[6265,4],[6272,4],[9327,4],[10698,4],[11863,4],[14997,4],[16487,4],[17673,4],[17680,4],[20669,4],[22036,4],[23197,4],[26289,4],[27658,4],[28821,4],[33509,4],[34876,4],[36037,4],[39128,4],[40496,4],[41658,4]]},"822":{"position":[[4181,4],[6169,4],[7706,4],[7713,4],[12135,4],[13506,4],[14671,4]]},"824":{"position":[[3893,4],[5642,4],[7038,4],[7045,4],[11051,4],[12425,4],[13593,4]]},"826":{"position":[[4939,4],[6920,4],[8499,4],[8506,4],[12722,4],[14097,4],[15266,4],[18482,4],[19859,4],[21030,4],[24181,4],[25560,4],[26733,4],[29971,4],[31348,4],[32519,4],[35668,4],[37045,4],[38216,4]]},"844":{"position":[[3878,4],[5427,4],[6672,4],[6679,4],[9840,4],[11213,4],[12380,4],[15589,4],[17138,4],[18383,4],[18390,4],[21508,4],[22881,4],[24048,4],[27258,4],[28638,4],[29812,4],[33677,4],[35594,4],[37109,4],[37116,4],[41212,4],[42585,4],[43752,4]]},"846":{"position":[[1919,4],[3287,4],[4449,4],[9200,4],[10567,4],[11728,4]]},"848":{"position":[[8872,4],[10704,4],[12134,4],[12141,4],[16392,4],[18010,4],[19324,4],[19331,4],[22879,4],[24600,4],[25968,4],[25975,4],[29628,4],[31264,4],[32547,4],[32554,4],[36055,4],[37575,4],[38791,4],[38798,4],[41925,4],[43428,4],[44627,4],[44634,4],[47849,4],[49214,4],[50373,4],[53535,4],[54915,4],[56089,4]]}}}],["body(requestbodi",{"_index":740,"t":{"45":{"position":[[26779,18]]},"147":{"position":[[601,18]]},"618":{"position":[[2338,18]]}}}],["body_str",{"_index":483,"t":{"35":{"position":[[6336,11]]}}}],["book",{"_index":2062,"t":{"548":{"position":[[456,8],[517,8],[1594,8]]},"556":{"position":[[76,7],[187,8],[217,8],[339,7],[437,8]]},"560":{"position":[[432,9],[637,8],[689,9]]},"562":{"position":[[72,8],[6878,8],[12842,8],[18559,8]]},"626":{"position":[[582,5],[603,8]]}}}],["booking_add",{"_index":2073,"t":{"548":{"position":[[1462,16]]},"560":{"position":[[848,14],[1061,16],[1489,13]]},"562":{"position":[[13660,16],[14752,16],[16124,16],[17659,13],[18333,16],[18360,15],[24974,16],[26067,16],[27440,16],[28977,13],[29655,16],[29682,15],[29858,13],[30112,13],[30188,14]]}}}],["booking_view",{"_index":2078,"t":{"560":{"position":[[876,15],[1126,17],[1470,14]]},"562":{"position":[[7665,17],[8757,17],[10129,17],[11664,14],[12338,17],[12366,16],[12522,14],[12689,14],[12784,15],[19348,17],[20442,17],[21816,17],[23355,14],[24035,17],[24063,16],[29839,14],[30024,14],[30168,15]]}}}],["bookshelf",{"_index":2197,"t":{"626":{"position":[[563,9]]}}}],["bootstrap",{"_index":980,"t":{"153":{"position":[[240,12]]}}}],["both",{"_index":324,"t":{"21":{"position":[[327,4]]},"87":{"position":[[859,4],[1243,4]]},"93":{"position":[[1290,4]]},"95":{"position":[[1334,4]]},"109":{"position":[[263,4]]},"151":{"position":[[168,4]]},"311":{"position":[[11433,4]]},"353":{"position":[[210,4]]},"452":{"position":[[214,4]]},"454":{"position":[[640,4]]},"464":{"position":[[96,4]]},"482":{"position":[[7997,4]]},"560":{"position":[[1465,4]]},"626":{"position":[[298,4]]},"663":{"position":[[1278,4]]},"703":{"position":[[213,4],[969,4]]},"757":{"position":[[608,4]]},"777":{"position":[[192,4]]},"781":{"position":[[290,4]]}}}],["bound",{"_index":753,"t":{"45":{"position":[[31460,5],[31499,5]]},"77":{"position":[[17,5]]},"85":{"position":[[1712,5]]},"89":{"position":[[3119,5]]},"155":{"position":[[2086,5],[2474,5]]},"422":{"position":[[395,5]]},"508":{"position":[[6712,5]]},"512":{"position":[[109,5],[280,5]]},"514":{"position":[[1437,5]]},"518":{"position":[[586,5]]},"522":{"position":[[65,5],[95,5],[6169,5]]},"661":{"position":[[408,5]]},"667":{"position":[[1030,5],[7206,5]]},"807":{"position":[[857,5]]},"826":{"position":[[381,5]]}}}],["branch",{"_index":1828,"t":{"424":{"position":[[1181,9]]},"789":{"position":[[309,6],[563,6],[641,7],[649,8],[703,6],[970,9],[1181,9],[1288,8],[1683,9],[1738,8],[2240,6],[2318,6],[2332,6],[3349,6],[3592,6],[3606,6],[3708,9],[4988,6],[5349,6],[5363,6],[7180,6],[7443,6],[7457,6],[7567,9],[8899,6],[9160,6],[9174,6],[10837,6],[11046,6],[11297,6],[11311,6]]},"791":{"position":[[75,7]]},"793":{"position":[[303,6]]},"795":{"position":[[262,6],[411,7],[11798,6],[12588,6],[13767,6],[15322,6],[16551,6],[17596,6]]},"797":{"position":[[777,8],[911,6],[1046,6],[1253,6],[1304,6],[1545,9],[2498,6],[2716,6],[2828,7],[2836,8],[2890,6],[2994,6],[3111,9],[3218,8],[3521,8],[3902,9],[3957,8],[11108,6],[11260,6],[11434,6],[12655,6],[12866,6],[13099,6],[14696,6],[14858,6],[15042,6],[16313,6],[16474,6],[16657,6],[18236,6],[18392,6],[18570,6]]},"801":{"position":[[106,6],[367,7],[375,8],[429,6],[533,6],[879,9],[1713,9],[1820,8],[2123,8],[2504,9],[2559,8],[4077,6],[4320,6],[4334,6],[4436,9],[4680,6],[4830,6],[4982,6],[5135,6],[5287,6],[5438,6],[5589,6],[5763,6],[6972,6],[7333,6],[7347,6],[7811,6],[8020,6],[8231,6],[8443,6],[8654,6],[8864,6],[9074,6],[9307,6],[10892,6],[11155,6],[11169,6],[11279,9],[11535,6],[11695,6],[11857,6],[12020,6],[12182,6],[12343,6],[12504,6],[12688,6],[13947,6],[14208,6],[14222,6],[14586,6],[14745,6],[14906,6],[15068,6],[15229,6],[15389,6],[15549,6],[15732,6],[17912,6],[19196,6],[19447,6],[19461,6],[19815,6],[19969,6],[20125,6],[20282,6],[20438,6],[20593,6],[20748,6],[20926,6]]},"803":{"position":[[299,6],[580,7],[588,8],[642,6],[746,6],[1255,9],[2180,9],[2287,8],[2590,8],[2971,9],[3026,8]]}}}],["branch'",{"_index":2656,"t":{"789":{"position":[[360,8],[401,8],[447,8]]}}}],["branch:east",{"_index":2708,"t":{"795":{"position":[[12653,12],[15396,12],[17524,11]]}}}],["branch:west",{"_index":2662,"t":{"789":{"position":[[3414,12],[3678,12],[7254,12],[7536,12],[10595,11],[10820,11]]},"797":{"position":[[11180,12],[11332,12],[11528,12],[14777,12],[14939,12],[15145,12],[17865,11],[17997,11],[18151,11]]},"801":{"position":[[4142,12],[4406,12],[4750,12],[4901,12],[5054,12],[5207,12],[5359,12],[5510,12],[5661,12],[5857,12],[10966,12],[11248,12],[11614,12],[11775,12],[11938,12],[12101,12],[12263,12],[12424,12],[12585,12],[12791,12],[17670,11],[17895,11],[18178,11],[18309,11],[18441,11],[18573,11],[18705,11],[18837,11],[18969,11],[19123,11]]}}}],["branch’",{"_index":2661,"t":{"789":{"position":[[2485,8]]}}}],["breadth",{"_index":1041,"t":{"155":{"position":[[859,7],[1827,8],[2448,8]]}}}],["break",{"_index":879,"t":{"107":{"position":[[71,5]]},"173":{"position":[[448,6],[497,6],[556,6]]},"548":{"position":[[1066,8]]},"699":{"position":[[54,5]]},"793":{"position":[[54,5]]}}}],["breviti",{"_index":1951,"t":{"480":{"position":[[2755,8]]},"717":{"position":[[633,8]]},"738":{"position":[[211,8]]},"813":{"position":[[249,8]]},"836":{"position":[[595,8]]}}}],["brew",{"_index":937,"t":{"113":{"position":[[1356,5],[1362,4]]},"115":{"position":[[0,4]]}}}],["bring",{"_index":2481,"t":{"728":{"position":[[22125,6]]},"836":{"position":[[94,8]]}}}],["broader",{"_index":71,"t":{"3":{"position":[[1014,7]]}}}],["browser",{"_index":2367,"t":{"705":{"position":[[274,7]]}}}],["budget",{"_index":1717,"t":{"382":{"position":[[734,6]]},"637":{"position":[[1159,9],[2388,9],[3993,9],[5272,9],[6373,9]]},"817":{"position":[[224,6],[399,6]]},"820":{"position":[[1774,6],[2592,9],[3769,9],[5223,7],[6383,8],[6926,9],[7291,6],[7376,7],[7515,8],[8323,8],[9420,8],[10798,8],[11952,8],[12330,6],[12880,10],[13059,8],[13102,7],[14008,9],[15181,9],[16631,7],[17787,8],[18326,9],[18687,6],[18768,7],[19665,8],[20758,8],[22132,8],[23282,8],[23656,6],[24202,10],[24373,8],[24416,7],[25284,8],[26379,8],[27755,8],[28907,8],[29283,6],[29831,10],[30005,8],[30048,7],[32505,8],[33598,8],[34972,8],[36122,8],[36496,6],[37042,10],[37213,8],[37256,7],[38124,8],[39218,8],[40593,8],[41744,8],[42119,6],[42666,10],[42839,8],[42882,7]]},"822":{"position":[[2091,7],[3113,6],[3192,9],[4730,6],[4863,9],[6576,6],[6664,7],[8095,6],[8169,8],[8909,9],[9612,6],[9944,6],[10026,7],[11131,8],[12228,8],[13606,8],[14760,8],[15138,6],[15688,10],[15867,8],[15910,7]]},"824":{"position":[[2820,6],[2904,9],[4198,6],[4336,9],[5903,6],[5996,7],[7281,6],[7360,8],[7989,9],[8487,6],[8685,6],[8772,7],[10042,8],[11142,8],[12523,8],[13680,8],[14061,6],[14614,10],[14794,8],[14837,7],[16042,6],[16102,8]]}}}],["build",{"_index":647,"t":{"45":{"position":[[4406,8],[5122,8],[7430,8]]},"81":{"position":[[48,5]]},"83":{"position":[[78,8]]},"85":{"position":[[2540,8]]},"87":{"position":[[2140,8]]},"91":{"position":[[1529,8]]},"173":{"position":[[5168,5]]},"181":{"position":[[29,5],[246,5]]},"185":{"position":[[130,8],[171,8]]},"323":{"position":[[384,5]]},"333":{"position":[[1320,8],[1402,5]]},"335":{"position":[[210,5]]},"341":{"position":[[36,8],[182,8],[218,5]]},"361":{"position":[[232,8]]},"386":{"position":[[998,8]]},"428":{"position":[[704,8]]},"478":{"position":[[4223,8]]},"480":{"position":[[3345,8]]},"611":{"position":[[177,5]]},"626":{"position":[[645,9]]},"695":{"position":[[95,8]]},"707":{"position":[[10443,5]]},"717":{"position":[[94,5]]},"738":{"position":[[82,5]]},"761":{"position":[[27,5]]},"789":{"position":[[95,8]]},"801":{"position":[[21345,5],[21507,5]]},"813":{"position":[[114,5]]},"836":{"position":[[252,5]]},"850":{"position":[[255,5]]}}}],["built",{"_index":1898,"t":{"470":{"position":[[260,5]]},"730":{"position":[[760,5]]},"779":{"position":[[178,5]]},"850":{"position":[[449,5]]}}}],["bulk",{"_index":1711,"t":{"380":{"position":[[379,5]]}}}],["bullet",{"_index":1001,"t":{"153":{"position":[[1275,6]]}}}],["busi",{"_index":1830,"t":{"428":{"position":[[98,8],[110,8]]},"836":{"position":[[29,10]]}}}],["c",{"_index":817,"t":{"89":{"position":[[2778,1],[2824,1]]},"327":{"position":[[987,2]]},"329":{"position":[[302,1]]},"369":{"position":[[12070,2]]},"375":{"position":[[12200,2]]},"695":{"position":[[2914,1],[3014,1],[3552,1],[3816,1],[4780,1],[5162,1],[6280,1],[6564,1],[7403,1],[7685,1],[10029,1],[10301,1]]},"697":{"position":[[265,2]]},"701":{"position":[[11413,2]]},"705":{"position":[[9880,2],[12691,1],[12781,1],[12870,1],[12898,1]]},"707":{"position":[[3091,1],[3355,1],[4319,1],[4701,1],[5819,1],[6103,1],[6942,1],[7224,1],[9568,1],[9840,1]]}}}],["c.locals(\"object",{"_index":1200,"t":{"173":{"position":[[4354,18]]}}}],["c.locals(\"object\").(str",{"_index":1207,"t":{"173":{"position":[[5307,28]]}}}],["c.locals(\"rel",{"_index":1198,"t":{"173":{"position":[[4131,20],[4175,20],[4221,20],[4260,20]]}}}],["c.locals(\"relation\").(str",{"_index":1206,"t":{"173":{"position":[[5268,30]]}}}],["c.locals(\"user\").(*jwt.token",{"_index":1167,"t":{"171":{"position":[[2395,29]]},"173":{"position":[[3705,29],[3945,29]]}}}],["c.locals(\"usernam",{"_index":1196,"t":{"173":{"position":[[4045,20]]}}}],["c.locals(\"username\").(str",{"_index":1205,"t":{"173":{"position":[[5227,30]]}}}],["c.method",{"_index":1197,"t":{"173":{"position":[[4104,12]]}}}],["c.next",{"_index":1201,"t":{"173":{"position":[[4416,8],[5670,8]]}}}],["c.params(\"docu",{"_index":1172,"t":{"171":{"position":[[2533,21]]},"173":{"position":[[3843,21],[4387,21]]}}}],["c.sendstring(c.params(\"docu",{"_index":1110,"t":{"169":{"position":[[1562,34]]}}}],["c.sendstring(nam",{"_index":1171,"t":{"171":{"position":[[2502,17]]},"173":{"position":[[3812,17]]}}}],["c571",{"_index":2457,"t":{"726":{"position":[[27904,4]]}}}],["cab",{"_index":2036,"t":{"524":{"position":[[64,3]]}}}],["cach",{"_index":1467,"t":{"222":{"position":[[784,5],[798,7]]}}}],["calendar",{"_index":563,"t":{"39":{"position":[[991,9]]}}}],["call",{"_index":215,"t":{"9":{"position":[[393,6]]},"35":{"position":[[2546,7],[4428,7],[5872,7]]},"43":{"position":[[970,7],[1970,7],[2944,7]]},"45":{"position":[[4901,6],[13765,7],[15116,7],[16186,7],[17926,4],[18141,7],[19959,7],[21310,7],[22380,7],[24235,4],[24482,7],[26334,7],[27739,7],[28851,7]]},"71":{"position":[[21,4]]},"73":{"position":[[28,4]]},"81":{"position":[[745,7]]},"83":{"position":[[3835,6]]},"89":{"position":[[3029,6],[3275,4]]},"133":{"position":[[7,7],[1180,7],[2117,7],[2808,7]]},"145":{"position":[[7,7],[1180,7],[2117,7],[2808,7]]},"171":{"position":[[14,4]]},"173":{"position":[[182,4],[697,6],[2613,4],[2653,4],[4943,7]]},"183":{"position":[[580,7],[1209,7],[2056,7],[2744,7],[2979,4],[3182,5]]},"185":{"position":[[928,7],[1698,7],[2784,7],[3846,7],[4108,4],[4311,5]]},"187":{"position":[[804,7],[1723,7],[2947,7],[4407,7],[4669,4],[4872,5]]},"200":{"position":[[1551,7],[3012,7],[4106,7]]},"202":{"position":[[7,4],[1603,7],[2951,7],[4018,7],[7349,7],[8699,7],[9768,7]]},"214":{"position":[[284,7]]},"238":{"position":[[213,5]]},"248":{"position":[[7,7],[1180,7],[2117,7],[2808,7]]},"254":{"position":[[351,5]]},"258":{"position":[[224,6]]},"265":{"position":[[311,4],[1893,7],[3231,7],[4288,7]]},"267":{"position":[[1567,7],[3023,7],[4112,7],[5750,4],[7309,7],[8648,7],[9706,7]]},"271":{"position":[[32,4]]},"275":{"position":[[114,7]]},"277":{"position":[[1152,7],[2089,7],[2780,7]]},"279":{"position":[[1304,5]]},"281":{"position":[[1033,4],[2174,6]]},"285":{"position":[[900,6],[932,6],[1349,6],[2904,7],[4248,7],[5311,7],[8541,7],[10039,7],[11170,7],[12857,6],[13001,6],[14570,7],[15918,7],[16985,7],[20174,7],[21524,7],[22593,7]]},"294":{"position":[[1812,7],[3272,7],[4365,7]]},"296":{"position":[[1647,7],[2996,7],[4064,7]]},"302":{"position":[[224,6],[283,6]]},"311":{"position":[[70,7],[1649,7],[3101,7],[4186,7],[7231,7],[8684,7],[9770,7],[11508,4],[13214,7],[14911,7],[16203,7]]},"313":{"position":[[462,6],[660,4]]},"321":{"position":[[17,4],[80,4]]},"323":{"position":[[120,4],[503,4]]},"325":{"position":[[0,4],[143,4]]},"347":{"position":[[306,6]]},"357":{"position":[[1784,7],[3140,7],[4215,7]]},"363":{"position":[[347,6]]},"369":{"position":[[127,6],[1743,7],[3092,7],[4160,7],[7352,7],[8700,7],[9767,7]]},"375":{"position":[[1878,7],[3398,7],[4551,7],[8038,7],[9387,7],[10455,7],[13852,7],[15201,7],[16269,7]]},"382":{"position":[[965,4],[2719,7],[4065,7],[5130,7]]},"384":{"position":[[779,4]]},"396":{"position":[[224,6]]},"402":{"position":[[1625,7],[3098,7],[4204,7]]},"404":{"position":[[1684,7],[3040,7],[4115,7],[7522,7],[8879,7],[9955,7]]},"416":{"position":[[647,5]]},"418":{"position":[[2109,4]]},"422":{"position":[[264,6],[633,6]]},"430":{"position":[[202,6]]},"432":{"position":[[56,6]]},"440":{"position":[[328,6],[356,6]]},"442":{"position":[[168,6]]},"444":{"position":[[1847,7],[3532,7],[4801,7],[8481,7],[9832,7],[10902,7]]},"446":{"position":[[1859,7],[3654,7],[5033,7]]},"448":{"position":[[1575,7],[2926,7],[3996,7]]},"454":{"position":[[491,6]]},"462":{"position":[[126,6],[1746,7],[3098,7],[4169,7],[7379,7],[8730,7],[9800,7]]},"466":{"position":[[1707,7],[3060,7],[4132,7],[7506,7],[8859,7],[9931,7]]},"472":{"position":[[266,5]]},"504":{"position":[[1586,7],[3045,7],[4137,7]]},"506":{"position":[[1668,7],[3207,7],[4379,7]]},"508":{"position":[[1757,7],[3113,7],[4188,7],[6476,6]]},"514":{"position":[[224,6]]},"522":{"position":[[1824,7],[3335,7],[4479,7]]},"524":{"position":[[1885,7],[3237,7],[4308,7]]},"530":{"position":[[227,6]]},"540":{"position":[[1597,7],[3058,7],[4152,7]]},"542":{"position":[[2007,7],[3545,7],[4716,7]]},"544":{"position":[[1819,7],[3177,7],[4254,7]]},"550":{"position":[[224,6],[1556,6]]},"554":{"position":[[616,6]]},"562":{"position":[[1957,7],[3612,7],[4851,7],[8413,7],[9762,7],[10830,7],[14408,7],[15757,7],[16825,7],[20096,7],[21447,7],[22517,7],[25721,7],[27071,7],[28140,7]]},"574":{"position":[[1727,7],[3298,7],[4453,7]]},"578":{"position":[[1730,7],[3297,7],[4448,7]]},"580":{"position":[[1693,7],[3153,7],[4246,7]]},"582":{"position":[[1571,7],[2908,7],[3964,7],[7085,7],[8422,7],[9478,7]]},"584":{"position":[[1568,7],[3020,7],[4105,7],[7146,7],[8484,7],[9541,7]]},"590":{"position":[[224,6]]},"599":{"position":[[13,6],[146,4],[1740,7],[3087,7],[4153,7]]},"606":{"position":[[12,6],[2035,7],[3479,7],[4598,7],[6632,5],[8172,7],[9577,7],[10675,7],[12613,5],[14163,7],[15578,7],[16686,7]]},"608":{"position":[[2120,7],[3446,7],[4447,7]]},"611":{"position":[[239,4],[299,5]]},"613":{"position":[[218,4],[1770,7],[3183,7],[4311,7],[5929,4],[6130,4],[7682,7],[9095,7],[10223,7],[11841,4]]},"618":{"position":[[1784,7],[3298,7],[4531,7]]},"637":{"position":[[1942,7],[3519,7],[4729,7]]},"639":{"position":[[1694,7],[3053,7],[4131,7]]},"645":{"position":[[1766,7],[3501,7],[4820,7]]},"647":{"position":[[1615,7],[2966,7],[4036,7]]},"649":{"position":[[1622,7],[3154,7],[4319,7],[7655,7],[9007,7],[10078,7],[13291,7],[14646,7],[15720,7]]},"667":{"position":[[2872,7],[4220,7],[5287,7],[9044,7],[10392,7],[11459,7],[15868,7],[17219,7],[18289,7],[22702,7],[24050,7],[25117,7],[28939,7],[30288,7],[31356,7]]},"669":{"position":[[2846,7],[4195,7],[5263,7],[9098,7],[10450,7],[11521,7],[15440,7],[16790,7],[17859,7],[21763,7],[23113,7],[24182,7]]},"679":{"position":[[2561,7],[3911,7],[4980,7],[8178,7],[9527,7],[10595,7]]},"681":{"position":[[1692,7],[3204,7],[4349,7],[7572,7],[8925,7],[9997,7]]},"683":{"position":[[1770,7],[3222,7],[4403,7],[7969,7],[9565,7],[10745,7],[14232,7],[15829,7],[17010,7],[20501,7],[21851,7],[22920,7],[26162,7],[27510,7],[28577,7]]},"689":{"position":[[484,4]]},"693":{"position":[[233,4]]},"703":{"position":[[6270,7],[7799,7],[8961,7]]},"705":{"position":[[469,6],[498,6],[793,5],[2689,7],[4246,7],[5436,7]]},"717":{"position":[[378,6]]},"724":{"position":[[470,4]]},"726":{"position":[[2500,7],[5101,7],[7090,7],[13358,7],[15322,7],[16821,7],[21425,7],[23319,7],[24748,7],[29752,7],[31101,7],[32169,7],[35512,7],[36862,7],[37931,7],[41132,7],[42485,7],[43557,7],[46775,7],[48129,7],[49202,7]]},"728":{"position":[[1795,7],[3145,7],[4214,7],[9710,7],[11056,7],[12121,7],[15636,7],[16991,7],[18065,7],[26053,7],[27407,7],[28480,7],[34292,7],[35637,7],[36701,7],[43827,7],[45172,7],[46236,7]]},"745":{"position":[[3289,7],[4757,7],[5858,7],[9011,7],[10362,7],[11432,7],[14663,7],[16131,7],[17232,7],[20342,7],[21693,7],[22763,7],[25969,7],[27321,7],[28392,7],[33702,7],[35053,7],[36123,7],[39328,7],[40679,7],[41749,7]]},"747":{"position":[[4047,7],[5803,7],[7143,7],[11172,7],[12525,7],[13597,7]]},"749":{"position":[[1787,7],[3279,7],[4404,7],[8060,7],[9584,7],[10741,7],[13933,7],[15284,7],[16354,7]]},"751":{"position":[[616,7],[4544,7],[6155,7],[7350,7],[11386,7],[12741,7],[13815,7],[18800,7],[20290,7],[21413,7]]},"771":{"position":[[1974,7],[3441,7],[4541,7],[7626,7],[9097,7],[10201,7],[13453,7],[15185,7],[16452,7],[20578,7],[21928,7],[22997,7],[26275,7],[27623,7],[28690,7]]},"773":{"position":[[4592,7],[6436,7],[7766,7],[11909,7],[13262,7],[14334,7]]},"775":{"position":[[4385,7],[5999,7],[7197,7],[11105,7],[13032,7],[14445,7],[19087,7],[20434,7],[21500,7]]},"777":{"position":[[4642,7],[6377,7],[7647,7],[11784,7],[13136,7],[14207,7]]},"781":{"position":[[253,6]]},"783":{"position":[[511,4]]},"787":{"position":[[234,4]]},"789":{"position":[[2449,4],[4585,7],[6749,7],[8399,7]]},"795":{"position":[[1926,7],[3272,7],[4337,7],[7618,7],[8968,7],[10037,7],[13365,7],[14892,7],[16052,7],[19250,7],[20597,7],[21663,7]]},"797":{"position":[[6037,7],[7379,7],[8440,7],[12240,7],[14253,7],[15801,7],[20538,7],[22247,7],[23540,7],[27328,7],[28674,7],[29739,7]]},"799":{"position":[[528,4],[581,4],[2790,7],[4554,7],[5902,7],[8077,6],[8106,6],[8401,5],[10192,7],[11726,7],[12992,7],[17119,7],[18654,7],[19921,7]]},"801":{"position":[[6569,7],[10461,7],[13447,7]]},"820":{"position":[[3293,7],[4764,7],[5868,7],[9039,7],[10393,7],[11466,7],[14709,7],[16176,7],[17276,7],[20381,7],[21731,7],[22800,7],[26001,7],[27353,7],[28424,7],[33221,7],[34571,7],[35640,7],[38840,7],[40191,7],[41261,7]]},"822":{"position":[[3893,7],[5858,7],[7309,7],[11847,7],[13201,7],[14274,7]]},"824":{"position":[[3605,7],[5331,7],[6641,7],[10763,7],[12120,7],[13196,7]]},"826":{"position":[[4651,7],[6609,7],[8102,7],[12434,7],[13792,7],[14869,7],[18194,7],[19554,7],[20633,7],[23893,7],[25255,7],[26336,7],[29683,7],[31043,7],[32122,7],[35380,7],[36740,7],[37819,7]]},"840":{"position":[[263,6]]},"842":{"position":[[893,6]]},"844":{"position":[[3590,7],[5116,7],[6275,7],[9552,7],[10908,7],[11983,7],[15301,7],[16827,7],[17986,7],[21220,7],[22576,7],[23651,7],[26970,7],[28333,7],[29415,7],[33389,7],[35283,7],[36712,7],[40924,7],[42280,7],[43355,7]]},"846":{"position":[[1631,7],[2982,7],[4052,7],[8912,7],[10262,7],[11331,7]]},"848":{"position":[[8584,7],[10393,7],[11737,7],[16104,7],[17699,7],[18927,7],[22591,7],[24289,7],[25571,7],[29340,7],[30953,7],[32150,7],[35767,7],[37264,7],[38394,7],[41637,7],[43117,7],[44230,7],[47561,7],[48909,7],[49976,7],[53247,7],[54610,7],[55692,7]]}}}],["camelcas",{"_index":845,"t":{"97":{"position":[[170,10]]}}}],["camera",{"_index":1213,"t":{"175":{"position":[[220,6]]},"755":{"position":[[219,6]]},"761":{"position":[[82,6]]}}}],["campaign",{"_index":2859,"t":{"840":{"position":[[669,9]]},"848":{"position":[[428,9],[597,8],[999,8],[1083,8],[6868,8],[34132,8],[34170,8],[40142,8]]}}}],["can't",{"_index":228,"t":{"9":{"position":[[875,5]]},"189":{"position":[[386,5]]},"313":{"position":[[691,5]]},"528":{"position":[[404,5]]}}}],["can_access",{"_index":218,"t":{"9":{"position":[[584,11]]}}}],["can_change_own",{"_index":1942,"t":{"480":{"position":[[2324,16],[3021,17]]},"482":{"position":[[9048,17],[9361,17],[9884,17],[10477,17]]},"484":{"position":[[2771,16],[3106,16],[3349,16],[3692,16]]}}}],["can_create_docu",{"_index":1943,"t":{"480":{"position":[[2348,19],[2441,19],[2696,21],[3138,20],[3261,20]]}}}],["can_create_fold",{"_index":1944,"t":{"480":{"position":[[2374,17],[2467,17],[3112,18],[3289,18]]}}}],["can_delet",{"_index":1888,"t":{"462":{"position":[[11710,10]]},"464":{"position":[[53,10],[318,11],[642,13]]},"466":{"position":[[957,13],[2053,13],[3429,13],[4972,10],[5656,13],[5680,12],[6755,13],[7851,13],[9227,13],[10770,10],[11453,13],[11477,12]]},"695":{"position":[[1228,11],[2400,13]]},"701":{"position":[[2191,13],[2470,13],[2787,13],[3231,10],[3718,13],[3742,12],[5886,13],[6166,13],[6484,13],[6930,10],[7419,13],[7443,12],[9586,13],[9866,13],[10184,13],[10630,10],[11119,13],[11143,12]]},"707":{"position":[[566,11],[2275,13]]}}}],["can_edit",{"_index":2284,"t":{"677":{"position":[[333,9],[472,11]]},"679":{"position":[[392,9],[712,11],[994,8],[7431,11],[8523,11],[9895,11],[11430,8],[12105,11],[12127,10]]},"695":{"position":[[1255,9],[2478,11]]},"707":{"position":[[593,9],[2353,11]]}}}],["can_read",{"_index":1755,"t":{"412":{"position":[[332,8],[1758,9],[2581,11],[2994,11]]},"416":{"position":[[1606,9],[2435,11],[2891,11]]}}}],["can_renam",{"_index":800,"t":{"87":{"position":[[207,11],[394,13],[796,11],[823,10],[944,10],[1810,10]]}}}],["can_shar",{"_index":776,"t":{"83":{"position":[[249,10],[544,10],[1079,12],[2401,12],[3996,10]]},"480":{"position":[[2275,9],[2968,10]]},"482":{"position":[[6929,10],[7331,10],[7491,9],[8373,9],[8851,9],[9222,9],[9666,10],[10259,10]]},"484":{"position":[[2625,9],[2950,9],[3203,9],[3526,9]]}}}],["can_view",{"_index":1941,"t":{"480":{"position":[[2308,8],[2392,8],[2986,9],[3166,9]]},"482":{"position":[[8120,9],[8512,9],[9721,9],[10314,9]]},"484":{"position":[[2723,8],[3048,8],[3301,8],[3634,8]]},"695":{"position":[[1279,9],[2553,11]]},"701":{"position":[[360,11],[637,11],[952,11],[1392,8],[1875,11],[1897,10],[4050,11],[4327,11],[4642,11],[5082,8],[5565,11],[5587,10],[7743,11],[8021,11],[8337,11],[8779,8],[9264,11],[9286,10]]},"703":{"position":[[2938,11],[3216,11],[3532,11],[3974,8],[4459,11],[4481,10],[10828,11],[11105,11],[11420,11],[11860,8],[12343,11],[12365,10]]},"705":{"position":[[7382,11],[7758,11],[8190,11],[8868,8],[9527,11],[9549,10],[10053,11],[10430,11],[10863,11],[11543,8],[12204,11],[12226,10]]},"707":{"position":[[617,9],[2428,11]]},"789":{"position":[[784,9],[861,9],[1577,11],[1898,11]]},"795":{"position":[[1182,11],[2271,11],[3640,11],[5169,8],[5838,11],[5860,10],[6874,11],[7967,11],[9340,11],[10877,8],[11558,11],[11580,10],[18505,11],[19595,11],[20965,11],[22496,8],[23167,11],[23189,10]]},"797":{"position":[[3058,9],[3796,11],[5292,11],[6377,11],[7742,11],[9263,8],[9919,11],[9941,10],[26584,11],[27673,11],[29042,11],[30571,8],[31240,11],[31262,10]]},"799":{"position":[[9279,11],[10537,11],[12094,11],[14012,8],[14960,11],[14982,10],[16205,11],[17464,11],[19022,11],[20942,8],[21892,11],[21914,10]]},"801":{"position":[[597,9],[674,9],[2398,11],[2719,11]]},"803":{"position":[[810,9],[887,9],[2865,11],[3186,11]]}}}],["can_writ",{"_index":1879,"t":{"454":{"position":[[318,9],[810,10],[1035,12]]},"462":{"position":[[997,12],[2092,12],[3467,12],[5008,9],[5690,12],[5713,11],[6630,12],[7724,12],[9098,12],[10637,9],[11316,12],[11339,11]]},"464":{"position":[[293,10],[566,12]]},"480":{"position":[[2298,9],[3003,10]]},"482":{"position":[[8601,10],[8990,10],[9829,10],[10422,10]]},"484":{"position":[[2674,9],[2999,9],[3252,9],[3585,9]]},"677":{"position":[[1056,10],[1196,12]]},"679":{"position":[[367,10],[636,12],[1813,12],[2906,12],[4279,12],[5816,9],[6493,12],[6516,11]]},"681":{"position":[[6824,12],[7920,12],[9296,12],[10839,9],[11525,12],[11548,11]]},"683":{"position":[[19753,12],[20846,12],[22219,12],[23756,9],[24433,12],[24456,11]]},"685":{"position":[[195,10],[335,12]]}}}],["can’t",{"_index":1772,"t":{"416":{"position":[[375,5]]}}}],["capac",{"_index":69,"t":{"3":{"position":[[986,8]]}}}],["captur",{"_index":1479,"t":{"224":{"position":[[109,8]]}}}],["carl",{"_index":1692,"t":{"363":{"position":[[433,6],[1410,4]]},"369":{"position":[[144,4],[11639,4],[11973,4],[12019,4]]},"375":{"position":[[69,4],[129,4],[197,4],[301,4],[1064,4],[2236,4],[3784,4],[5006,4],[6030,4],[6216,4],[6356,4],[6437,4],[6510,4]]},"454":{"position":[[583,4],[635,4],[1852,4],[2100,4]]},"462":{"position":[[143,4],[11580,5]]},"466":{"position":[[5844,4],[5918,4]]},"695":{"position":[[2966,4],[3766,4],[5112,4],[6514,4],[7635,4],[10251,4]]},"697":{"position":[[432,4]]},"701":{"position":[[7585,4],[9426,4]]},"705":{"position":[[12852,4],[12880,4]]},"707":{"position":[[3305,4],[4651,4],[6053,4],[7174,4],[9790,4]]}}}],["carolin",{"_index":2659,"t":{"789":{"position":[[2247,8],[3438,8],[5136,8],[7279,8],[8997,8],[11139,8]]},"795":{"position":[[6005,8]]},"801":{"position":[[4166,8],[7120,8],[10991,8],[14045,8],[19289,8]]}}}],["cascad",{"_index":2007,"t":{"498":{"position":[[393,9]]},"502":{"position":[[9,9]]},"504":{"position":[[16,9]]},"508":{"position":[[6079,9]]},"586":{"position":[[134,7]]}}}],["case",{"_index":150,"t":{"5":{"position":[[157,4]]},"45":{"position":[[6366,5],[11954,5],[31786,4]]},"85":{"position":[[1477,4]]},"87":{"position":[[753,4]]},"155":{"position":[[210,6]]},"173":{"position":[[407,4],[455,4],[504,4],[4119,4],[4162,4],[4206,4]]},"189":{"position":[[196,5]]},"198":{"position":[[130,4]]},"283":{"position":[[480,5]]},"313":{"position":[[482,4]]},"327":{"position":[[447,5],[790,5],[1170,5],[1803,5],[2163,4],[2364,5],[2753,5],[3130,4],[3470,5]]},"329":{"position":[[13,4]]},"333":{"position":[[1450,5],[1477,5]]},"335":{"position":[[39,5],[256,4]]},"418":{"position":[[2846,5]]},"420":{"position":[[132,5],[420,6]]},"422":{"position":[[762,4]]},"428":{"position":[[253,6],[367,6]]},"474":{"position":[[144,5]]},"476":{"position":[[417,6]]},"478":{"position":[[4350,5],[4581,5]]},"482":{"position":[[3053,5],[3067,4],[3103,4],[3246,5],[5935,5]]},"490":{"position":[[500,5]]},"520":{"position":[[104,6]]},"528":{"position":[[214,5]]},"536":{"position":[[54,5]]},"538":{"position":[[73,5]]},"546":{"position":[[260,5],[342,5]]},"608":{"position":[[466,5]]},"616":{"position":[[225,4]]},"626":{"position":[[211,4]]},"637":{"position":[[1088,4],[2317,4],[3922,4],[5201,4],[6302,4]]},"641":{"position":[[51,5],[94,4]]},"643":{"position":[[1162,5]]},"649":{"position":[[6017,5]]},"653":{"position":[[221,5]]},"667":{"position":[[33221,5]]},"671":{"position":[[182,5],[380,5]]},"683":{"position":[[6330,5]]},"689":{"position":[[21,5],[287,5]]},"695":{"position":[[2845,4]]},"705":{"position":[[201,5]]},"711":{"position":[[143,4]]},"717":{"position":[[340,4]]},"726":{"position":[[28236,5]]},"749":{"position":[[6208,5],[6383,5]]},"751":{"position":[[9524,4]]},"753":{"position":[[235,5]]},"783":{"position":[[71,5],[319,5]]},"789":{"position":[[2184,4]]},"799":{"position":[[200,4]]},"803":{"position":[[178,5]]},"848":{"position":[[964,5]]}}}],["catch",{"_index":1093,"t":{"169":{"position":[[855,5]]},"171":{"position":[[685,5],[1454,5]]},"173":{"position":[[623,5],[1533,5],[2442,5]]}}}],["categori",{"_index":1838,"t":{"430":{"position":[[215,9],[282,9],[411,8],[532,8],[691,10]]},"432":{"position":[[69,9],[136,9]]},"440":{"position":[[206,9],[319,8],[500,8],[585,8],[676,8],[767,8]]},"442":{"position":[[312,8],[545,10]]},"446":{"position":[[896,8],[1068,8],[2284,8],[2515,8],[4107,8],[4289,8],[5555,8],[5736,8],[7071,8],[7247,8]]}}}],["category:logo",{"_index":1864,"t":{"446":{"position":[[979,17],[1150,17],[2421,17],[2651,17],[4199,15],[4380,15],[5633,16],[5813,16],[6461,17],[6841,14],[6978,14],[7157,15],[7332,15]]},"448":{"position":[[851,16],[1945,16],[3320,16],[4471,16],[4846,14],[5393,18],[5566,16],[5609,15]]}}}],["category:logos\"},{\"user\":\"role:media",{"_index":1871,"t":{"446":{"position":[[6371,36]]}}}],["catherin",{"_index":2855,"t":{"840":{"position":[[144,9],[447,9]]},"842":{"position":[[717,9]]},"844":{"position":[[330,9],[13722,9],[14481,9],[15659,9],[17213,9],[18441,9],[19485,9],[25369,10]]},"848":{"position":[[852,9]]}}}],["caus",{"_index":1794,"t":{"418":{"position":[[3509,5]]},"484":{"position":[[3887,7]]},"799":{"position":[[634,6]]}}}],["caution",{"_index":818,"t":{"89":{"position":[[2937,7]]},"375":{"position":[[18083,7]]},"404":{"position":[[11677,7]]},"478":{"position":[[4186,7]]},"480":{"position":[[3308,7]]},"504":{"position":[[5664,7]]},"508":{"position":[[6378,7]]},"514":{"position":[[1587,7]]},"544":{"position":[[6162,7]]},"562":{"position":[[30216,7]]},"639":{"position":[[6274,7]]},"726":{"position":[[27547,7]]},"765":{"position":[[515,7]]},"840":{"position":[[966,7]]}}}],["cert",{"_index":1403,"t":{"214":{"position":[[727,5],[2176,5]]}}}],["cert=\"/users/myuser/key/server.crt",{"_index":1415,"t":{"214":{"position":[[1625,35],[3178,35]]}}}],["certain",{"_index":90,"t":{"3":{"position":[[1460,7]]},"17":{"position":[[138,7],[382,7]]},"45":{"position":[[17997,7],[31826,7]]},"71":{"position":[[92,7]]},"81":{"position":[[270,7]]},"89":{"position":[[2714,7]]},"97":{"position":[[2356,7]]},"127":{"position":[[94,7]]},"189":{"position":[[594,7]]},"317":{"position":[[537,7]]},"327":{"position":[[178,7],[571,7],[1017,7],[1998,7],[2983,7]]},"353":{"position":[[86,7],[161,7],[231,7]]},"355":{"position":[[890,7]]},"361":{"position":[[818,7]]},"363":{"position":[[2353,7]]},"367":{"position":[[645,7]]},"369":{"position":[[11529,7]]},"371":{"position":[[969,7]]},"380":{"position":[[127,7]]},"386":{"position":[[146,7],[281,7],[427,7],[591,7],[667,7],[742,7]]},"394":{"position":[[80,7]]},"440":{"position":[[263,7]]},"442":{"position":[[1203,7],[1230,7]]},"446":{"position":[[67,7]]},"452":{"position":[[461,7]]},"512":{"position":[[80,7]]},"528":{"position":[[612,7]]},"536":{"position":[[90,7],[157,7],[205,7]]},"542":{"position":[[132,7]]},"548":{"position":[[299,7],[1203,7]]},"597":{"position":[[69,7]]},"622":{"position":[[85,7]]},"653":{"position":[[165,7]]},"669":{"position":[[19924,7]]},"693":{"position":[[304,7],[913,7]]},"705":{"position":[[189,7]]},"709":{"position":[[197,7]]},"730":{"position":[[317,7]]},"732":{"position":[[473,7],[768,7],[1053,7]]},"745":{"position":[[31914,7]]},"751":{"position":[[16218,7]]},"757":{"position":[[1208,7]]},"783":{"position":[[130,7]]},"787":{"position":[[305,7],[915,7]]},"797":{"position":[[840,7]]},"805":{"position":[[316,7]]},"807":{"position":[[363,7],[637,7],[946,7],[1135,7]]},"815":{"position":[[322,7]]},"824":{"position":[[15584,7]]},"830":{"position":[[268,7],[367,7],[668,7]]},"848":{"position":[[251,7]]}}}],["certif",{"_index":1402,"t":{"214":{"position":[[543,11],[1063,11],[1335,11],[1977,11],[2588,11],[2860,11]]}}}],["certs')}/private.key",{"_index":1122,"t":{"171":{"position":[[436,23]]}}}],["certs')}/public.key",{"_index":1124,"t":{"171":{"position":[[514,22]]}}}],["chain",{"_index":2018,"t":{"508":{"position":[[6111,5]]},"544":{"position":[[5986,5]]},"562":{"position":[[12562,5],[29897,5]]}}}],["chang",{"_index":304,"t":{"19":{"position":[[242,6],[510,7]]},"109":{"position":[[110,8],[171,7]]},"222":{"position":[[1158,7]]},"228":{"position":[[264,6]]},"267":{"position":[[10,6]]},"271":{"position":[[46,7],[96,7],[278,8]]},"275":{"position":[[131,7]]},"279":{"position":[[27,7],[795,7],[1459,8],[2673,7],[3073,7],[3324,7],[3470,7],[3662,7]]},"281":{"position":[[925,7],[1826,7],[3569,7]]},"313":{"position":[[625,7],[735,7],[777,8]]},"323":{"position":[[16,8],[137,7],[248,7]]},"327":{"position":[[1759,7],[2195,7],[3154,7]]},"355":{"position":[[845,7]]},"375":{"position":[[17995,6]]},"390":{"position":[[146,7]]},"408":{"position":[[196,7],[660,7]]},"410":{"position":[[10,7],[414,6]]},"412":{"position":[[71,7],[3098,8]]},"418":{"position":[[1621,6],[1656,6],[2882,7]]},"420":{"position":[[325,7],[376,6],[560,7]]},"442":{"position":[[52,6],[1147,6]]},"476":{"position":[[2404,6],[2484,6]]},"478":{"position":[[1444,6],[1524,6],[3286,6],[3366,6]]},"480":{"position":[[1776,6],[1856,6]]},"482":{"position":[[9138,6]]},"484":{"position":[[1083,6]]},"502":{"position":[[1113,7]]},"508":{"position":[[26,7]]},"538":{"position":[[129,7]]},"548":{"position":[[1676,7],[1758,7]]},"584":{"position":[[5577,7]]},"620":{"position":[[236,6]]},"639":{"position":[[6200,7]]},"673":{"position":[[75,7],[160,8]]},"707":{"position":[[10419,7]]},"728":{"position":[[22882,7],[23165,7],[30946,6],[39953,7]]},"751":{"position":[[17234,8]]},"773":{"position":[[304,8],[408,6],[465,8]]},"775":{"position":[[728,7]]},"777":{"position":[[2385,7]]},"801":{"position":[[21483,7]]},"838":{"position":[[425,6],[512,8],[647,7]]},"846":{"position":[[6077,6]]}}}],["channel",{"_index":2195,"t":{"626":{"position":[[472,8],[481,8],[508,8]]},"830":{"position":[[276,8],[527,8]]},"836":{"position":[[557,7]]},"838":{"position":[[233,9],[686,9],[706,9],[897,8],[961,9],[978,9],[1003,9],[1032,8],[1054,9],[1064,7]]},"840":{"position":[[382,8],[540,9],[561,8],[697,8],[765,7],[919,8]]},"842":{"position":[[105,7],[674,8],[1801,8]]},"844":{"position":[[31231,8],[32328,8],[33756,8],[35678,8],[37176,8],[38880,8]]},"848":{"position":[[150,9],[259,8],[946,9],[1092,7],[1192,7],[1266,7],[1300,8],[1337,8],[1437,7],[1548,8],[1648,7],[1927,10],[2750,7],[2980,7],[3075,7],[3364,10],[4236,7],[4692,7],[5758,10],[6754,9],[6877,9],[14319,8],[14341,7],[14361,7],[27682,8],[34141,8]]},"852":{"position":[[65,8]]}}}],["channel:gener",{"_index":2899,"t":{"848":{"position":[[305,15],[637,15],[7666,19],[10855,17],[13622,15],[15296,17],[15393,19],[16543,17],[18166,17],[18272,17],[19463,17],[20484,15],[20592,17],[20868,15],[21810,19],[21880,19],[24836,17],[24916,17],[27213,15],[27329,15],[46025,15],[46834,18],[47925,18],[49297,18],[50818,15],[51532,18],[51570,17],[57812,15],[57853,15],[57888,15],[57929,15],[58541,15],[58584,15]]}}}],["channel:market",{"_index":688,"t":{"45":{"position":[[9096,17]]}}}],["channel:marketing_intern",{"_index":2905,"t":{"848":{"position":[[7756,30],[10955,28],[13758,26],[28537,30],[28618,30],[31393,28],[31484,28],[33730,26],[33857,26],[57964,26],[58016,26],[58061,26],[58113,26],[58160,26],[58214,26],[58262,26],[58316,26],[58620,26],[58674,26]]}}}],["channel:proj_marketing_campaign",{"_index":2900,"t":{"848":{"position":[[458,31],[7857,35],[11066,33],[13905,31],[35040,35],[37723,33],[39870,31],[40910,35],[43559,33],[45655,31],[51680,31],[52505,34],[53611,34],[54998,34],[56549,31],[57293,34],[57347,33],[58721,31],[58780,31]]}}}],["channel_archiv",{"_index":2060,"t":{"548":{"position":[[362,17]]}}}],["channels_admin",{"_index":2861,"t":{"842":{"position":[[963,15],[1092,15],[1297,17],[1488,17],[1816,16]]},"844":{"position":[[118,15],[294,14],[664,15],[869,17],[1060,17],[31302,17],[32401,17],[35759,17],[38583,14]]},"846":{"position":[[5971,14],[6319,14],[6445,15],[6509,14],[6700,17],[6904,16],[7118,17]]},"848":{"position":[[2309,16],[2579,16],[3825,16],[4095,16],[4571,15],[4635,14],[5110,17],[5314,16],[5528,17],[6219,16],[6489,16],[57731,14],[57788,15]]}}}],["charact",{"_index":1385,"t":{"212":{"position":[[3171,10],[3223,10],[3270,10]]},"408":{"position":[[887,9]]},"480":{"position":[[2539,11]]}}}],["characterist",{"_index":601,"t":{"45":{"position":[[544,16]]},"47":{"position":[[69,16]]},"191":{"position":[[1123,15]]},"195":{"position":[[45,15]]},"258":{"position":[[842,15]]},"262":{"position":[[45,15]]},"285":{"position":[[24554,15]]},"291":{"position":[[45,15]]},"302":{"position":[[1444,15]]},"308":{"position":[[45,15]]},"347":{"position":[[1255,15]]},"351":{"position":[[45,15]]},"363":{"position":[[1753,15]]},"367":{"position":[[45,15]]},"396":{"position":[[834,15]]},"398":{"position":[[45,15]]},"454":{"position":[[2741,15]]},"460":{"position":[[45,15]]},"492":{"position":[[1126,15]]},"496":{"position":[[45,15]]},"514":{"position":[[896,15]]},"518":{"position":[[45,15]]},"530":{"position":[[873,15]]},"534":{"position":[[45,15]]},"550":{"position":[[985,15]]},"554":{"position":[[45,15]]},"568":{"position":[[826,15]]},"572":{"position":[[45,15]]},"590":{"position":[[1297,15]]},"594":{"position":[[45,15]]},"628":{"position":[[1070,15]]},"632":{"position":[[45,15]]},"655":{"position":[[414,15]]},"659":{"position":[[45,15]]},"675":{"position":[[118,15]]}}}],["charl",{"_index":2394,"t":{"721":{"position":[[401,8],[811,7],[856,7],[914,7]]},"726":{"position":[[20604,7],[22150,7],[23974,7],[25470,7],[27140,7]]},"728":{"position":[[42165,7],[42210,7],[42268,7],[48473,7],[48506,7],[48555,7],[48591,7],[48643,7],[48673,7]]},"742":{"position":[[45,8]]},"747":{"position":[[3061,7],[4410,7],[6194,7],[7603,7],[9066,7]]},"765":{"position":[[146,7],[318,7]]},"773":{"position":[[992,8],[2498,7],[10342,7],[16083,7],[16659,7],[16697,7],[16841,7],[16883,7],[17039,7],[17074,7]]},"775":{"position":[[2707,7],[23840,7],[23878,7],[24022,7],[24064,7],[24220,7],[24255,7]]},"781":{"position":[[60,7]]},"817":{"position":[[97,8]]},"822":{"position":[[2828,7],[4268,7],[6261,7],[7781,7],[9647,7]]}}}],["charli",{"_index":2247,"t":{"667":{"position":[[13650,7],[14271,7],[19999,7],[26888,8]]}}}],["chart",{"_index":1069,"t":{"159":{"position":[[86,6],[165,5]]}}}],["chat",{"_index":2933,"t":{"850":{"position":[[712,4]]}}}],["check",{"_index":117,"t":{"3":{"position":[[1988,5],[3053,5]]},"17":{"position":[[337,8]]},"25":{"position":[[308,5]]},"29":{"position":[[589,5],[637,5],[863,6]]},"45":{"position":[[42,6],[124,6],[3475,7],[12149,5],[12937,5],[16943,5],[17631,6],[17661,5],[17889,5],[17907,5],[17946,5],[18061,5],[18153,5],[18201,5],[18368,5],[19131,5],[23137,5],[23825,6],[23855,5],[24153,5],[30785,5],[30887,5],[31173,5],[31222,5],[31414,5]]},"53":{"position":[[86,7]]},"71":{"position":[[2,5],[41,5]]},"75":{"position":[[52,5]]},"79":{"position":[[0,5]]},"89":{"position":[[3411,7]]},"91":{"position":[[1368,5]]},"93":{"position":[[1347,5]]},"95":{"position":[[1382,5]]},"99":{"position":[[0,5]]},"105":{"position":[[34,7]]},"107":{"position":[[96,6],[234,5]]},"109":{"position":[[217,6],[248,6],[621,5]]},"127":{"position":[[46,5]]},"131":{"position":[[24,5]]},"133":{"position":[[19,5]]},"135":{"position":[[3,5],[120,5],[1147,5]]},"137":{"position":[[78,6],[108,5],[127,5]]},"145":{"position":[[19,5]]},"149":{"position":[[78,6]]},"155":{"position":[[140,5],[707,5],[1432,5]]},"157":{"position":[[0,5]]},"165":{"position":[[296,6],[660,6]]},"173":{"position":[[187,5],[746,5],[1626,5],[2618,5],[2662,5],[4444,5],[5499,5]]},"179":{"position":[[684,6]]},"202":{"position":[[19,5],[778,5],[4772,5],[5454,6],[5484,5],[5705,5],[6522,5],[10524,5],[11210,6],[11241,5]]},"204":{"position":[[0,5]]},"220":{"position":[[42,5],[84,5]]},"222":{"position":[[772,5],[809,5]]},"232":{"position":[[0,5]]},"238":{"position":[[106,5]]},"240":{"position":[[0,5]]},"254":{"position":[[0,5]]},"256":{"position":[[198,5]]},"265":{"position":[[320,5],[1078,5],[5032,5],[5694,6],[5724,5]]},"267":{"position":[[5762,5],[6493,5],[10451,5],[11115,6],[11145,5]]},"269":{"position":[[0,5]]},"285":{"position":[[1340,5],[2083,5],[6061,5],[6735,6],[6760,5],[12848,5],[13745,5],[17739,5],[18421,6],[18451,5],[19347,5],[23349,5],[24035,6],[24066,5]]},"296":{"position":[[53,5],[821,5],[4819,5],[5503,6],[5533,5]]},"298":{"position":[[0,5]]},"315":{"position":[[0,5]]},"321":{"position":[[30,5],[85,6]]},"323":{"position":[[508,6]]},"327":{"position":[[408,5],[716,5],[1789,5],[2225,6],[2627,5],[2688,8],[3184,5],[3435,5],[3666,6]]},"357":{"position":[[185,6],[951,5],[4977,5],[5675,6],[5704,5]]},"359":{"position":[[0,5]]},"369":{"position":[[118,5],[217,5],[917,5],[4915,5],[5599,6],[5630,5],[6527,5],[10521,5],[11203,6],[11233,5]]},"375":{"position":[[3,5],[6428,5],[6491,5],[7212,5],[11210,5],[11894,6],[11924,5],[12235,5],[12304,5],[13026,5],[17024,5],[17708,6],[17739,5]]},"377":{"position":[[0,5]]},"382":{"position":[[974,5],[1065,5],[1896,5],[5882,5],[6560,6],[6590,5]]},"386":{"position":[[838,5],[1369,5]]},"394":{"position":[[207,6]]},"404":{"position":[[57,5],[851,5],[4877,5],[5575,6],[5604,5],[5847,5],[6688,5],[10718,5],[11418,6],[11447,5]]},"406":{"position":[[0,5]]},"408":{"position":[[1128,6]]},"420":{"position":[[498,7]]},"422":{"position":[[627,5]]},"424":{"position":[[435,7]]},"440":{"position":[[1044,5]]},"444":{"position":[[6953,5],[7653,5],[11659,5],[12347,6],[12377,5]]},"448":{"position":[[747,5],[4753,5],[5441,6],[5471,5],[5693,6]]},"450":{"position":[[0,5]]},"462":{"position":[[217,5],[917,5],[4927,5],[5617,6],[5648,5],[6551,5],[10557,5],[11245,6],[11275,5]]},"466":{"position":[[46,5],[877,5],[4891,5],[5583,6],[5614,5],[6676,5],[10690,5],[11382,6],[11412,5]]},"468":{"position":[[0,5]]},"472":{"position":[[354,6],[565,5],[647,5],[826,5],[928,5]]},"484":{"position":[[341,8],[485,5],[564,5]]},"486":{"position":[[147,5]]},"488":{"position":[[0,5]]},"498":{"position":[[743,5]]},"508":{"position":[[185,6],[924,5],[4950,5],[5648,6],[5677,5],[6049,5]]},"510":{"position":[[0,5]]},"524":{"position":[[51,5],[1056,5],[5066,5],[5756,6],[5785,5]]},"526":{"position":[[0,5]]},"536":{"position":[[411,8]]},"544":{"position":[[984,5],[5018,5],[5720,6],[5751,5]]},"546":{"position":[[0,5]]},"548":{"position":[[1166,5],[1247,5],[1413,6]]},"550":{"position":[[1566,5],[1779,5],[1801,5],[1830,5]]},"554":{"position":[[626,5],[839,5],[861,5],[890,5]]},"556":{"position":[[446,8]]},"562":{"position":[[169,5],[6848,6],[7587,5],[11585,5],[12269,6],[12298,5],[12891,6],[13582,5],[17580,5],[18264,6],[18293,5],[18519,6],[19268,5],[23274,5],[23962,6],[23993,5],[24894,5],[28896,5],[29582,6],[29613,5]]},"564":{"position":[[0,5]]},"582":{"position":[[757,5],[4707,5],[5367,6],[5398,5],[6271,5],[10221,5],[10881,6],[10912,5]]},"584":{"position":[[6331,5],[10285,5],[10947,6],[10978,5]]},"586":{"position":[[0,5]]},"588":{"position":[[65,6]]},"597":{"position":[[4,5]]},"599":{"position":[[0,5],[151,5],[916,5],[4906,5],[5586,6],[5615,5]]},"601":{"position":[[0,5]]},"622":{"position":[[0,5],[38,5]]},"624":{"position":[[0,5],[86,5],[139,5]]},"639":{"position":[[57,5],[858,5],[4896,5],[5600,6],[5635,5]]},"647":{"position":[[787,5],[4793,5],[5481,6],[5511,5]]},"649":{"position":[[6826,5],[10836,5],[11526,6],[11556,5],[12459,5],[16481,5],[17177,6],[17207,5]]},"651":{"position":[[0,5]]},"661":{"position":[[165,8]]},"667":{"position":[[1257,5],[2047,5],[6041,5],[6723,6],[6753,5],[7429,5],[8219,5],[12213,5],[12895,6],[12925,5],[14247,5],[15040,5],[19046,5],[19734,6],[19767,5],[21082,5],[21877,5],[25871,5],[26553,6],[26583,5],[27317,5],[28113,5],[32111,5],[32795,6],[32826,5]]},"669":{"position":[[1229,5],[2020,5],[6018,5],[6702,6],[6732,5],[7475,5],[8269,5],[12279,5],[12969,6],[13002,5],[13821,5],[14613,5],[18615,5],[19301,6],[19332,5],[20139,5],[20936,5],[24938,5],[25624,6],[25656,5]]},"671":{"position":[[0,5]]},"679":{"position":[[1734,5],[5736,5],[6422,6],[6452,5],[7352,5],[11350,5],[12034,6],[12064,5]]},"681":{"position":[[6003,5],[6742,5],[10756,5],[11448,6],[11481,5]]},"683":{"position":[[18971,5],[19674,5],[23676,5],[24362,6],[24392,5],[25337,5],[29331,5],[30013,6],[30043,5]]},"687":{"position":[[207,6]]},"693":{"position":[[213,5],[253,5],[490,5]]},"699":{"position":[[453,7]]},"701":{"position":[[197,7],[281,5],[1312,5],[1804,6],[1834,5],[2112,5],[3151,5],[3647,6],[3677,5],[3886,6],[3971,5],[5002,5],[5494,6],[5524,5],[5807,5],[6850,5],[7348,6],[7378,5],[7664,5],[8699,5],[9193,6],[9223,5],[9507,5],[10550,5],[11048,6],[11078,5]]},"703":{"position":[[2800,6],[2859,5],[3894,5],[4388,6],[4418,5],[10683,5],[10749,5],[11780,5],[12272,6],[12302,5]]},"705":{"position":[[463,5],[680,5],[787,5],[7303,5],[8788,5],[9456,6],[9486,5],[9974,5],[11463,5],[12133,6],[12163,5],[12521,5]]},"707":{"position":[[10284,5]]},"709":{"position":[[0,5],[350,5],[375,5]]},"726":{"position":[[28069,5],[28926,5],[32924,5],[33608,6],[33638,5],[34685,5],[38687,5],[39373,6],[39403,5],[40302,5],[44316,5],[45008,6],[45047,5],[45944,5],[49962,5],[50656,6],[50686,5]]},"728":{"position":[[968,5],[4970,5],[5656,6],[5686,5],[8887,5],[12873,5],[13551,6],[13581,5],[14804,5],[18826,5],[19522,6],[19561,5],[20213,5],[22814,6],[25222,5],[29240,5],[29934,6],[29973,5],[33470,5],[37452,5],[38128,6],[38158,5],[40109,5],[41801,6],[43005,5],[46987,5],[47663,6],[47693,5]]},"730":{"position":[[188,6]]},"745":{"position":[[1145,8],[8183,5],[12189,5],[12877,6],[12907,5],[19514,5],[23520,5],[24208,6],[24238,5],[25140,5],[29150,5],[29840,6],[29870,5],[32874,5],[36880,5],[37568,6],[37598,5],[38500,5],[42506,5],[43194,6],[43224,5]]},"747":{"position":[[10342,5],[14356,5],[15048,6],[15081,5]]},"749":{"position":[[6476,5],[13105,5],[17111,5],[17799,6],[17830,5]]},"751":{"position":[[9859,5],[10554,5],[14576,5],[15272,6],[15302,5]]},"767":{"position":[[161,7]]},"771":{"position":[[19751,5],[23753,5],[24439,6],[24469,5],[25450,5],[29444,5],[30126,6],[30156,5],[30372,5]]},"773":{"position":[[968,8],[11079,5],[15093,5],[15785,6],[15818,5],[16037,5]]},"775":{"position":[[18263,5],[22253,5],[22933,6],[22960,5]]},"777":{"position":[[10955,5],[14965,5],[15655,6],[15686,5]]},"783":{"position":[[110,5]]},"787":{"position":[[214,5],[254,5],[491,5]]},"789":{"position":[[2276,8],[2348,8],[2396,8],[3467,8],[3622,8],[3754,8],[5165,8],[5379,8],[5570,8],[7308,8],[7473,8],[7615,8],[9026,8],[9190,8],[9331,8],[11168,8],[11327,8],[11463,8]]},"793":{"position":[[430,7]]},"795":{"position":[[308,6],[1103,5],[5089,5],[5767,6],[5797,5],[6791,5],[10793,5],[11479,6],[11513,5],[11747,5],[18426,5],[22416,5],[23096,6],[23126,5]]},"797":{"position":[[4527,6],[5218,5],[9188,5],[9858,6],[9883,5],[25720,8],[26505,5],[30491,5],[31169,6],[31199,5]]},"799":{"position":[[522,5],[590,5],[8071,5],[8288,5],[8395,5],[9200,5],[13932,5],[14889,6],[14919,5],[16126,5],[20862,5],[21821,6],[21851,5]]},"801":{"position":[[4195,8],[4350,8],[4482,8],[7149,8],[7363,8],[7554,8],[11020,8],[11185,8],[11327,8],[14074,8],[14238,8],[14379,8],[19318,8],[19477,8],[19613,8],[21186,5]]},"805":{"position":[[0,5],[365,5]]},"820":{"position":[[1115,8],[8208,5],[12226,5],[12920,6],[12950,5],[19554,5],[23556,5],[24242,6],[24272,5],[25172,5],[29182,5],[29872,6],[29902,5],[32394,5],[36396,5],[37082,6],[37112,5],[38012,5],[42018,5],[42706,6],[42736,5]]},"822":{"position":[[11016,5],[15034,5],[15728,6],[15761,5]]},"824":{"position":[[9234,5],[9929,5],[13959,5],[14659,6],[14690,5]]},"826":{"position":[[11599,5],[15633,5],[16335,6],[16365,5],[17357,5],[21399,5],[22105,6],[22135,5],[23054,5],[27104,5],[27814,6],[27844,5],[28846,5],[32888,5],[33594,6],[33624,5],[34543,5],[38585,5],[39291,6],[39321,5]]},"842":{"position":[[430,7]]},"844":{"position":[[1351,8],[8719,5],[12745,5],[13443,6],[13472,5],[20387,5],[24413,5],[25111,6],[25146,5],[26130,5],[30184,5],[30896,6],[30931,5],[39356,5],[40091,5],[44117,5],[44815,6],[44844,5]]},"846":{"position":[[803,5],[4809,5],[5497,6],[5526,5],[8085,5],[12087,5],[12773,6],[12802,5],[13026,5]]},"848":{"position":[[207,5],[45923,5],[46736,5],[50730,5],[51412,6],[51443,5],[52407,5],[56461,5],[57173,6],[57204,5]]},"850":{"position":[[653,5]]}}}],["check('bob",{"_index":2072,"t":{"548":{"position":[[1449,12],[1505,12]]}}}],["check(us",{"_index":1727,"t":{"386":{"position":[[860,11]]}}}],["check*i",{"_index":2057,"t":{"544":{"position":[[215,9]]}}}],["checkauthor",{"_index":1192,"t":{"173":{"position":[[2629,18]]}}}],["checkauthorization(c",{"_index":1202,"t":{"173":{"position":[[4501,20]]}}}],["checki",{"_index":1884,"t":{"462":{"position":[[118,7]]}}}],["checklist",{"_index":1225,"t":{"185":{"position":[[368,10]]}}}],["chicago",{"_index":509,"t":{"39":{"position":[[64,8],[1012,8]]}}}],["child",{"_index":703,"t":{"45":{"position":[[11506,8]]},"83":{"position":[[1177,8],[1409,8],[1672,8],[2499,8],[2731,8],[2994,8]]},"87":{"position":[[312,8]]},"89":{"position":[[859,8],[1597,8],[3476,5]]},"91":{"position":[[309,8]]},"93":{"position":[[344,8]]},"97":{"position":[[494,5],[513,5],[618,5],[637,5],[687,5],[1188,8],[1292,8],[1998,8]]},"179":{"position":[[466,5]]},"333":{"position":[[476,5],[528,5]]},"355":{"position":[[409,8]]},"384":{"position":[[336,8]]},"412":{"position":[[2145,8],[2606,8]]},"416":{"position":[[1956,8],[2460,8]]},"430":{"position":[[740,8]]},"442":{"position":[[594,8]]},"454":{"position":[[2397,5],[2465,5]]},"456":{"position":[[53,5]]},"464":{"position":[[676,8]]},"482":{"position":[[5913,5]]},"502":{"position":[[608,8]]},"510":{"position":[[69,5]]},"560":{"position":[[1157,8]]},"576":{"position":[[366,8]]},"586":{"position":[[101,5],[178,5]]},"590":{"position":[[623,8]]},"643":{"position":[[446,8]]},"651":{"position":[[199,5],[249,5]]},"663":{"position":[[564,8]]},"667":{"position":[[375,8]]},"679":{"position":[[554,8]]},"695":{"position":[[2029,8]]},"703":{"position":[[1449,8],[1590,8],[1733,8]]},"707":{"position":[[809,8],[950,8],[1093,8],[1904,8]]},"728":{"position":[[8100,5],[19893,5],[21020,8],[23744,8],[31521,8],[39149,8]]},"730":{"position":[[244,5]]},"732":{"position":[[986,5]]},"745":{"position":[[30692,8],[30799,8],[30904,8],[31017,8],[31679,8]]},"747":{"position":[[1179,8],[1286,8],[1391,8],[1504,8]]},"749":{"position":[[44,6],[59,5]]},"751":{"position":[[1686,8],[1793,8],[1898,8],[2011,8],[15598,5],[15826,8],[23829,8],[23996,8],[24100,8],[24318,8],[24423,8]]},"773":{"position":[[1603,8],[1782,8],[1954,8]]},"775":{"position":[[1392,8],[1571,8],[1743,8]]},"777":{"position":[[1218,8],[1381,8],[1537,8]]},"789":{"position":[[1423,8]]},"797":{"position":[[1727,8],[3376,8],[3635,8]]},"801":{"position":[[1061,8],[1978,8],[2237,8]]},"803":{"position":[[1461,8],[2445,8],[2704,8]]},"807":{"position":[[1068,5]]},"820":{"position":[[30729,8],[30836,8],[30941,8]]},"822":{"position":[[838,8],[945,8],[1050,8]]},"824":{"position":[[920,8],[1027,8],[1132,8],[14989,5],[15194,8],[16999,8],[17163,8],[17379,8],[17596,8]]},"826":{"position":[[1081,8],[1245,8],[1461,8],[1678,8]]},"846":{"position":[[6731,8],[6842,8]]},"848":{"position":[[3475,8],[5141,8],[5252,8],[5869,8]]}}}],["children",{"_index":2833,"t":{"824":{"position":[[8913,9]]}}}],["choic",{"_index":353,"t":{"29":{"position":[[124,7]]}}}],["choos",{"_index":1628,"t":{"327":{"position":[[16,6]]},"643":{"position":[[1691,6]]},"667":{"position":[[950,6]]},"669":{"position":[[938,6]]}}}],["chronolog",{"_index":864,"t":{"103":{"position":[[145,13]]},"275":{"position":[[9,15]]}}}],["claim",{"_index":1168,"t":{"171":{"position":[[2425,6]]},"173":{"position":[[3735,6],[3975,6]]}}}],["claims[\"name\"].(str",{"_index":1170,"t":{"171":{"position":[[2471,23]]},"173":{"position":[[3781,23],[4021,23]]}}}],["clariti",{"_index":1909,"t":{"476":{"position":[[446,7]]}}}],["class",{"_index":450,"t":{"35":{"position":[[3834,5]]},"43":{"position":[[1451,5]]},"45":{"position":[[514,5],[14522,5],[20716,5],[27145,5]]},"47":{"position":[[39,5]]},"133":{"position":[[1523,5]]},"145":{"position":[[1523,5]]},"183":{"position":[[1537,5]]},"185":{"position":[[2265,5]]},"187":{"position":[[2428,5]]},"191":{"position":[[1088,5]]},"195":{"position":[[10,5]]},"200":{"position":[[2418,5]]},"202":{"position":[[2357,5],[8105,5]]},"248":{"position":[[1523,5]]},"258":{"position":[[807,5]]},"262":{"position":[[10,5]]},"265":{"position":[[2637,5]]},"267":{"position":[[2429,5],[8054,5]]},"277":{"position":[[1495,5]]},"285":{"position":[[3654,5],[9445,5],[15324,5],[20930,5],[24519,5]]},"291":{"position":[[10,5]]},"294":{"position":[[2678,5]]},"296":{"position":[[2402,5]]},"302":{"position":[[1409,5]]},"308":{"position":[[10,5]]},"311":{"position":[[2507,5],[8090,5],[14317,5]]},"347":{"position":[[1220,5]]},"351":{"position":[[10,5]]},"357":{"position":[[2546,5]]},"363":{"position":[[1718,5]]},"367":{"position":[[10,5]]},"369":{"position":[[2498,5],[8106,5]]},"375":{"position":[[2804,5],[8793,5],[14607,5]]},"382":{"position":[[3471,5]]},"396":{"position":[[799,5]]},"398":{"position":[[10,5]]},"402":{"position":[[2504,5]]},"404":{"position":[[2446,5],[8285,5]]},"444":{"position":[[2938,5],[9238,5]]},"446":{"position":[[3060,5]]},"448":{"position":[[2332,5]]},"454":{"position":[[2706,5]]},"460":{"position":[[10,5]]},"462":{"position":[[2504,5],[8136,5]]},"466":{"position":[[2466,5],[8265,5]]},"492":{"position":[[1091,5]]},"496":{"position":[[10,5]]},"504":{"position":[[2451,5]]},"506":{"position":[[2613,5]]},"508":{"position":[[2519,5]]},"514":{"position":[[861,5]]},"518":{"position":[[10,5]]},"522":{"position":[[2741,5]]},"524":{"position":[[2643,5]]},"530":{"position":[[838,5]]},"534":{"position":[[10,5]]},"540":{"position":[[2464,5]]},"542":{"position":[[2951,5]]},"544":{"position":[[2583,5]]},"550":{"position":[[950,5]]},"554":{"position":[[10,5]]},"562":{"position":[[3018,5],[9168,5],[15163,5],[20853,5],[26477,5]]},"568":{"position":[[791,5]]},"572":{"position":[[10,5]]},"574":{"position":[[2704,5]]},"578":{"position":[[2703,5]]},"580":{"position":[[2559,5]]},"582":{"position":[[2314,5],[7828,5]]},"584":{"position":[[2426,5],[7890,5]]},"590":{"position":[[1262,5]]},"594":{"position":[[10,5]]},"599":{"position":[[2493,5]]},"606":{"position":[[2885,5],[8983,5],[14984,5]]},"608":{"position":[[2852,5]]},"613":{"position":[[2589,5],[8501,5]]},"618":{"position":[[2704,5]]},"628":{"position":[[1035,5]]},"632":{"position":[[10,5]]},"637":{"position":[[2925,5]]},"639":{"position":[[2459,5]]},"645":{"position":[[2907,5]]},"647":{"position":[[2372,5]]},"649":{"position":[[2560,5],[8413,5],[14052,5]]},"655":{"position":[[379,5]]},"659":{"position":[[10,5]]},"667":{"position":[[3626,5],[9798,5],[16625,5],[23456,5],[29694,5]]},"669":{"position":[[3601,5],[9856,5],[16196,5],[22519,5]]},"675":{"position":[[83,5]]},"679":{"position":[[3317,5],[8933,5]]},"681":{"position":[[2610,5],[8331,5]]},"683":{"position":[[2628,5],[8971,5],[15235,5],[21257,5],[26916,5]]},"703":{"position":[[7205,5]]},"705":{"position":[[3652,5]]},"726":{"position":[[4507,5],[14728,5],[22725,5],[30507,5],[36268,5],[41891,5],[47535,5]]},"728":{"position":[[2551,5],[10462,5],[16397,5],[26813,5],[35043,5],[44578,5]]},"745":{"position":[[4163,5],[9768,5],[15537,5],[21099,5],[26727,5],[34459,5],[40085,5]]},"747":{"position":[[5209,5],[11931,5]]},"749":{"position":[[2685,5],[8990,5],[14690,5]]},"751":{"position":[[5561,5],[12147,5],[19696,5]]},"771":{"position":[[2847,5],[8503,5],[14591,5],[21334,5],[27029,5]]},"773":{"position":[[5842,5],[12668,5]]},"775":{"position":[[5405,5],[12438,5],[19840,5]]},"777":{"position":[[5783,5],[12542,5]]},"789":{"position":[[6155,5]]},"795":{"position":[[2678,5],[8374,5],[14298,5],[20003,5]]},"797":{"position":[[6785,5],[13659,5],[21653,5],[28080,5]]},"799":{"position":[[3960,5],[11132,5],[18060,5]]},"801":{"position":[[9867,5]]},"820":{"position":[[4170,5],[9799,5],[15582,5],[21137,5],[26759,5],[33977,5],[39597,5]]},"822":{"position":[[5264,5],[12607,5]]},"824":{"position":[[4737,5],[11526,5]]},"826":{"position":[[6015,5],[13198,5],[18960,5],[24661,5],[30449,5],[36146,5]]},"844":{"position":[[4522,5],[10314,5],[16233,5],[21982,5],[27739,5],[34689,5],[41686,5]]},"846":{"position":[[2388,5],[9668,5]]},"848":{"position":[[9799,5],[17105,5],[23695,5],[30359,5],[36670,5],[42523,5],[48315,5],[54016,5]]}}}],["classifi",{"_index":691,"t":{"45":{"position":[[9749,10]]}}}],["claus",{"_index":2111,"t":{"576":{"position":[[1172,7]]}}}],["clean",{"_index":2762,"t":{"799":{"position":[[606,5]]}}}],["cli",{"_index":189,"t":{"7":{"position":[[577,3]]},"9":{"position":[[309,3]]},"33":{"position":[[23,3],[1341,4]]},"35":{"position":[[732,3],[8464,4]]},"39":{"position":[[633,4]]},"43":{"position":[[23,3]]},"45":{"position":[[12276,3],[18470,3],[24824,3]]},"113":{"position":[[73,3],[904,4],[1316,3],[1785,3]]},"121":{"position":[[36,3]]},"129":{"position":[[23,3]]},"133":{"position":[[96,3]]},"135":{"position":[[102,3]]},"141":{"position":[[23,3]]},"145":{"position":[[96,3]]},"147":{"position":[[97,3]]},"183":{"position":[[92,3]]},"185":{"position":[[402,3]]},"187":{"position":[[278,3]]},"200":{"position":[[112,3]]},"202":{"position":[[117,3],[5861,3]]},"244":{"position":[[23,3]]},"248":{"position":[[96,3]]},"250":{"position":[[84,3]]},"252":{"position":[[239,3]]},"265":{"position":[[417,3]]},"267":{"position":[[133,3],[5832,3]]},"279":{"position":[[87,3],[1491,3]]},"281":{"position":[[1072,3],[2341,3]]},"285":{"position":[[1422,3],[7065,3],[13084,3],[18686,3]]},"294":{"position":[[374,3]]},"296":{"position":[[160,3]]},"311":{"position":[[219,3],[5800,3]]},"357":{"position":[[290,3]]},"369":{"position":[[256,3],[5866,3]]},"375":{"position":[[380,3],[6551,3],[12365,3]]},"382":{"position":[[1235,3]]},"402":{"position":[[174,3]]},"404":{"position":[[190,3],[6027,3]]},"422":{"position":[[1202,3]]},"444":{"position":[[243,3],[6992,3]]},"446":{"position":[[145,3]]},"448":{"position":[[86,3]]},"462":{"position":[[256,3],[5890,3]]},"466":{"position":[[216,3],[6015,3]]},"482":{"position":[[10631,3]]},"504":{"position":[[149,3]]},"506":{"position":[[151,3]]},"508":{"position":[[263,3]]},"522":{"position":[[335,3]]},"524":{"position":[[395,3]]},"540":{"position":[[158,3]]},"542":{"position":[[491,3]]},"544":{"position":[[323,3]]},"562":{"position":[[383,3],[6926,3],[12921,3],[18607,3],[24233,3]]},"574":{"position":[[237,3]]},"578":{"position":[[244,3]]},"580":{"position":[[255,3]]},"582":{"position":[[96,3],[5610,3]]},"584":{"position":[[138,3],[5670,3]]},"599":{"position":[[255,3]]},"606":{"position":[[505,3],[6661,3],[12642,3]]},"608":{"position":[[708,3]]},"613":{"position":[[246,3],[6158,3]]},"618":{"position":[[167,3]]},"637":{"position":[[387,3]]},"639":{"position":[[197,3]]},"645":{"position":[[112,3]]},"647":{"position":[[126,3]]},"649":{"position":[[112,3],[6165,3],[11798,3]]},"667":{"position":[[1386,3],[7558,3],[14379,3],[21216,3],[27452,3]]},"669":{"position":[[1359,3],[7608,3],[13952,3],[20275,3]]},"679":{"position":[[1073,3],[6691,3]]},"681":{"position":[[202,3],[6081,3]]},"683":{"position":[[172,3],[6454,3],[12716,3],[19013,3],[24676,3]]},"695":{"position":[[3186,3]]},"701":{"position":[[252,3],[2083,3],[3942,3],[5778,3],[7635,3],[9478,3]]},"703":{"position":[[2830,3],[4763,3],[10720,3]]},"705":{"position":[[1154,3],[7274,3],[9945,3]]},"707":{"position":[[2725,3]]},"726":{"position":[[216,3],[11534,3],[19671,3],[28265,3],[34024,3],[39641,3],[45283,3]]},"728":{"position":[[307,3],[8226,3],[14143,3],[24561,3],[32809,3],[42344,3]]},"745":{"position":[[1843,3],[7522,3],[13217,3],[18853,3],[24479,3],[32213,3],[37839,3]]},"747":{"position":[[2372,3],[9681,3]]},"749":{"position":[[317,3],[6558,3],[12444,3]]},"751":{"position":[[3014,3],[9893,3],[17332,3]]},"771":{"position":[[529,3],[6177,3],[11861,3],[19090,3],[24789,3]]},"773":{"position":[[2947,3],[10418,3]]},"775":{"position":[[2852,3],[9377,3],[17602,3]]},"777":{"position":[[3047,3],[10294,3]]},"789":{"position":[[2620,3]]},"795":{"position":[[442,3],[6130,3],[11860,3],[17765,3]]},"797":{"position":[[4557,3],[10367,3],[18910,3],[25844,3]]},"799":{"position":[[1107,3],[8539,3],[15465,3]]},"801":{"position":[[3348,3]]},"820":{"position":[[1844,3],[7547,3],[13264,3],[18893,3],[24511,3],[31733,3],[37351,3]]},"822":{"position":[[2127,3],[10355,3]]},"824":{"position":[[1960,3],[9268,3]]},"826":{"position":[[2833,3],[10938,3],[16696,3],[22393,3],[28185,3],[33882,3]]},"844":{"position":[[2086,3],[8058,3],[13797,3],[19726,3],[25469,3],[31635,3],[39430,3]]},"846":{"position":[[142,3],[7424,3]]},"848":{"position":[[6915,3],[14531,3],[20974,3],[27808,3],[34292,3],[40179,3],[46075,3],[51746,3]]}}}],["click",{"_index":349,"t":{"29":{"position":[[46,5],[132,5],[250,5],[336,5],[453,5],[561,5],[669,5],[792,5],[888,5],[1029,5],[1134,5],[1243,5]]},"161":{"position":[[115,5],[204,5]]},"179":{"position":[[85,5],[207,5],[324,5],[482,5],[615,5],[726,5],[802,5]]},"333":{"position":[[101,5],[206,5],[321,5],[451,5],[578,5],[682,5],[800,5],[909,5],[995,5],[1165,5],[1302,5],[1419,5],[1537,5],[1632,5]]},"337":{"position":[[98,5],[208,5],[315,5],[424,5]]},"339":{"position":[[98,5]]},"343":{"position":[[112,5],[212,5],[348,5],[454,5]]},"392":{"position":[[76,5],[157,5]]}}}],["client",{"_index":352,"t":{"29":{"position":[[76,6],[278,6],[313,6]]},"33":{"position":[[238,7],[524,7],[810,7],[1096,7]]},"35":{"position":[[960,7],[2138,7],[3943,7]]},"45":{"position":[[12515,7],[13357,7],[14631,7],[18709,7],[19551,7],[20825,7],[25063,7],[25926,7],[27254,7]]},"133":{"position":[[65,7],[233,7],[772,7],[1632,7]]},"145":{"position":[[65,7],[233,7],[772,7],[1632,7]]},"173":{"position":[[1133,6],[5182,8]]},"181":{"position":[[46,6],[256,7]]},"185":{"position":[[184,7]]},"187":{"position":[[45,6],[129,6],[213,6]]},"200":{"position":[[346,7],[1143,7],[2527,7]]},"202":{"position":[[356,7],[1195,7],[2466,7],[6100,7],[6941,7],[8214,7]]},"248":{"position":[[65,7],[233,7],[772,7],[1632,7]]},"265":{"position":[[656,7],[1485,7],[2746,7]]},"267":{"position":[[367,7],[1159,7],[2538,7],[6071,7],[6901,7],[8163,7]]},"277":{"position":[[41,7],[205,7],[744,7],[1604,7]]},"285":{"position":[[1661,7],[2496,7],[3763,7],[7299,7],[8133,7],[9554,7],[13323,7],[14162,7],[15433,7],[18925,7],[19766,7],[21039,7]]},"294":{"position":[[608,7],[1404,7],[2787,7]]},"296":{"position":[[399,7],[1239,7],[2511,7]]},"311":{"position":[[453,7],[1241,7],[2616,7],[6034,7],[6823,7],[8199,7],[11848,7],[12806,7],[14426,7]]},"357":{"position":[[529,7],[1376,7],[2655,7]]},"369":{"position":[[495,7],[1335,7],[2607,7],[6105,7],[6944,7],[8215,7]]},"375":{"position":[[614,7],[1470,7],[2913,7],[6790,7],[7630,7],[8902,7],[12604,7],[13444,7],[14716,7]]},"382":{"position":[[1474,7],[2311,7],[3580,7]]},"402":{"position":[[408,7],[1217,7],[2613,7]]},"404":{"position":[[429,7],[1276,7],[2555,7],[6266,7],[7114,7],[8394,7]]},"444":{"position":[[477,7],[1439,7],[3047,7],[7231,7],[8073,7],[9347,7]]},"446":{"position":[[379,7],[1451,7],[3169,7]]},"448":{"position":[[325,7],[1167,7],[2441,7]]},"462":{"position":[[495,7],[1338,7],[2613,7],[6129,7],[6971,7],[8245,7]]},"466":{"position":[[455,7],[1299,7],[2575,7],[6254,7],[7098,7],[8374,7]]},"504":{"position":[[383,7],[1178,7],[2560,7]]},"506":{"position":[[385,7],[1260,7],[2722,7]]},"508":{"position":[[502,7],[1349,7],[2628,7]]},"522":{"position":[[569,7],[1416,7],[2850,7]]},"524":{"position":[[634,7],[1477,7],[2752,7]]},"540":{"position":[[392,7],[1189,7],[2573,7]]},"542":{"position":[[725,7],[1599,7],[3060,7]]},"544":{"position":[[562,7],[1411,7],[2692,7]]},"562":{"position":[[617,7],[1549,7],[3127,7],[7165,7],[8005,7],[9277,7],[13160,7],[14000,7],[15272,7],[18846,7],[19688,7],[20962,7],[24472,7],[25313,7],[26586,7]]},"574":{"position":[[471,7],[1319,7],[2813,7]]},"578":{"position":[[478,7],[1322,7],[2812,7]]},"580":{"position":[[489,7],[1285,7],[2668,7]]},"582":{"position":[[335,7],[1163,7],[2423,7],[5849,7],[6677,7],[7937,7]]},"584":{"position":[[372,7],[1160,7],[2535,7],[5909,7],[6738,7],[7999,7]]},"599":{"position":[[494,7],[1332,7],[2602,7]]},"606":{"position":[[744,7],[1627,7],[2994,7],[6900,7],[7764,7],[9092,7],[12881,7],[13755,7],[15093,7]]},"608":{"position":[[947,7],[1712,7],[2961,7]]},"613":{"position":[[485,7],[1362,7],[2698,7],[6397,7],[7274,7],[8610,7]]},"618":{"position":[[406,7],[1376,7],[2813,7]]},"637":{"position":[[621,7],[1534,7],[3034,7]]},"639":{"position":[[436,7],[1286,7],[2568,7]]},"645":{"position":[[346,7],[1358,7],[3016,7]]},"647":{"position":[[365,7],[1207,7],[2481,7]]},"649":{"position":[[346,7],[1214,7],[2669,7],[6404,7],[7247,7],[8522,7],[12037,7],[12883,7],[14161,7]]},"667":{"position":[[1625,7],[2464,7],[3735,7],[7797,7],[8636,7],[9907,7],[14618,7],[15460,7],[16734,7],[21455,7],[22294,7],[23565,7],[27691,7],[28531,7],[29803,7]]},"669":{"position":[[1598,7],[2438,7],[3710,7],[7847,7],[8690,7],[9965,7],[14191,7],[15032,7],[16305,7],[20514,7],[21355,7],[22628,7]]},"679":{"position":[[1312,7],[2153,7],[3426,7],[6930,7],[7770,7],[9042,7]]},"681":{"position":[[436,7],[1284,7],[2719,7],[6320,7],[7164,7],[8440,7]]},"683":{"position":[[411,7],[1362,7],[2737,7],[6688,7],[7561,7],[9080,7],[12950,7],[13824,7],[15344,7],[19252,7],[20093,7],[21366,7],[24915,7],[25754,7],[27025,7]]},"703":{"position":[[4997,7],[5862,7],[7314,7]]},"705":{"position":[[1388,7],[2281,7],[3761,7]]},"726":{"position":[[450,7],[2092,7],[4616,7],[11768,7],[12950,7],[14837,7],[19905,7],[21017,7],[22834,7],[28504,7],[29344,7],[30616,7],[34263,7],[35104,7],[36377,7],[39880,7],[40724,7],[42000,7],[45522,7],[46367,7],[47644,7]]},"728":{"position":[[546,7],[1387,7],[2660,7],[8465,7],[9302,7],[10571,7],[14382,7],[15228,7],[16506,7],[24800,7],[25645,7],[26922,7],[33048,7],[33884,7],[35152,7],[42583,7],[43419,7],[44687,7]]},"745":{"position":[[2077,7],[2881,7],[4272,7],[7761,7],[8603,7],[9877,7],[13451,7],[14255,7],[15646,7],[19092,7],[19934,7],[21208,7],[24718,7],[25561,7],[26836,7],[32452,7],[33294,7],[34568,7],[38078,7],[38920,7],[40194,7]]},"747":{"position":[[2606,7],[3639,7],[5318,7],[9920,7],[10764,7],[12040,7]]},"749":{"position":[[551,7],[1379,7],[2794,7],[6792,7],[7652,7],[9099,7],[12683,7],[13525,7],[14799,7]]},"751":{"position":[[3248,7],[4136,7],[5670,7],[10132,7],[10978,7],[12256,7],[17566,7],[18392,7],[19805,7]]},"771":{"position":[[763,7],[1566,7],[2956,7],[6411,7],[7218,7],[8612,7],[12095,7],[13045,7],[14700,7],[19329,7],[20170,7],[21443,7],[25028,7],[25867,7],[27138,7]]},"773":{"position":[[3181,7],[4184,7],[5951,7],[10657,7],[11501,7],[12777,7]]},"775":{"position":[[3086,7],[3977,7],[5514,7],[9611,7],[10697,7],[12547,7],[17841,7],[18679,7],[19949,7]]},"777":{"position":[[3281,7],[4234,7],[5892,7],[10533,7],[11376,7],[12651,7]]},"789":{"position":[[2854,7],[4177,7],[6264,7]]},"795":{"position":[[681,7],[1518,7],[2787,7],[6369,7],[7210,7],[8483,7],[12094,7],[12957,7],[14407,7],[18004,7],[18842,7],[20112,7]]},"797":{"position":[[4796,7],[5629,7],[6894,7],[10601,7],[11832,7],[13768,7],[19144,7],[20130,7],[21762,7],[26083,7],[26920,7],[28189,7]]},"799":{"position":[[1341,7],[2382,7],[4069,7],[8778,7],[9784,7],[11241,7],[15704,7],[16711,7],[18169,7]]},"801":{"position":[[3582,7],[6161,7],[9976,7]]},"820":{"position":[[2078,7],[2885,7],[4279,7],[7786,7],[8631,7],[9908,7],[13498,7],[14301,7],[15691,7],[19132,7],[19973,7],[21246,7],[24750,7],[25593,7],[26868,7],[31972,7],[32813,7],[34086,7],[37590,7],[38432,7],[39706,7]]},"822":{"position":[[2361,7],[3485,7],[5373,7],[10594,7],[11439,7],[12716,7]]},"824":{"position":[[2194,7],[3197,7],[4846,7],[9507,7],[10355,7],[11635,7]]},"826":{"position":[[3067,7],[4243,7],[6124,7],[11177,7],[12026,7],[13307,7],[16935,7],[17786,7],[19069,7],[22632,7],[23485,7],[24770,7],[28424,7],[29275,7],[30558,7],[34121,7],[34972,7],[36255,7]]},"844":{"position":[[2320,7],[3182,7],[4631,7],[8297,7],[9144,7],[10423,7],[14031,7],[14893,7],[16342,7],[19965,7],[20812,7],[22091,7],[25708,7],[26562,7],[27848,7],[31869,7],[32981,7],[34798,7],[39669,7],[40516,7],[41795,7]]},"846":{"position":[[381,7],[1223,7],[2497,7],[7663,7],[8504,7],[9777,7]]},"848":{"position":[[7149,7],[8176,7],[9908,7],[14765,7],[15696,7],[17214,7],[21208,7],[22183,7],[23804,7],[28042,7],[28932,7],[30468,7],[34526,7],[35359,7],[36779,7],[40413,7],[41229,7],[42632,7],[46314,7],[47153,7],[48424,7],[51985,7],[52839,7],[54125,7]]}}}],["client_id",{"_index":1271,"t":{"187":{"position":[[3898,10]]}}}],["client_secret",{"_index":1273,"t":{"187":{"position":[[3942,14]]}}}],["clientcheckopt",{"_index":708,"t":{"45":{"position":[[13959,19],[15339,18],[20153,19],[21533,18]]},"135":{"position":[[324,19],[644,18]]},"202":{"position":[[1797,19],[3174,18],[7543,19],[8922,18]]},"265":{"position":[[2087,19],[3454,18]]},"267":{"position":[[7503,19],[8871,18]]},"285":{"position":[[3098,19],[4471,18],[14764,19],[16141,18],[20368,19],[21747,18]]},"296":{"position":[[1841,19],[3219,18]]},"357":{"position":[[1978,19],[3363,18]]},"369":{"position":[[1937,19],[3315,18],[7546,19],[8923,18]]},"375":{"position":[[8232,19],[9610,18],[14046,19],[15424,18]]},"382":{"position":[[2913,19],[4288,18]]},"404":{"position":[[1878,19],[3263,18],[7716,19],[9102,18]]},"444":{"position":[[8675,19],[10055,18]]},"448":{"position":[[1769,19],[3149,18]]},"462":{"position":[[1940,19],[3321,18],[7573,19],[8953,18]]},"466":{"position":[[1901,19],[3283,18],[7700,19],[9082,18]]},"508":{"position":[[1951,19],[3336,18]]},"524":{"position":[[2079,19],[3460,18]]},"544":{"position":[[2013,19],[3400,18]]},"562":{"position":[[8607,19],[9985,18],[14602,19],[15980,18],[20290,19],[21670,18],[25915,19],[27294,18]]},"582":{"position":[[1765,19],[3131,18],[7279,19],[8645,18]]},"584":{"position":[[7340,19],[8707,18]]},"599":{"position":[[1934,19],[3310,18]]},"613":{"position":[[3406,18],[9318,18]]},"639":{"position":[[1888,19],[3276,18]]},"647":{"position":[[1809,19],[3189,18]]},"649":{"position":[[7849,19],[9230,18],[13485,19],[14869,18]]},"667":{"position":[[3066,19],[4443,18],[9238,19],[10615,18],[16062,19],[17442,18],[22896,19],[24273,18],[29133,19],[30511,18]]},"669":{"position":[[3040,19],[4418,18],[9292,19],[10673,18],[15634,19],[17013,18],[21957,19],[23336,18]]},"679":{"position":[[2755,19],[4134,18],[8372,19],[9750,18]]},"681":{"position":[[7766,19],[9148,18]]},"683":{"position":[[20695,19],[22074,18],[26356,19],[27733,18]]},"701":{"position":[[486,19],[807,18],[2319,19],[2642,18],[4176,19],[4497,18],[6015,19],[6339,18],[7870,19],[8192,18],[9715,19],[10039,18]]},"703":{"position":[[3065,19],[3387,18],[10954,19],[11275,18]]},"705":{"position":[[7607,19],[8045,18],[10279,19],[10718,18]]},"726":{"position":[[29946,19],[31324,18],[35706,19],[37085,18],[41326,19],[42708,18],[46969,19],[48352,18]]},"728":{"position":[[1989,19],[3368,18],[9904,19],[11279,18],[15830,19],[17214,18],[26247,19],[27630,18],[34486,19],[35860,18],[44021,19],[45395,18]]},"745":{"position":[[9205,19],[10585,18],[20536,19],[21916,18],[26163,19],[27544,18],[33896,19],[35276,18],[39522,19],[40902,18]]},"747":{"position":[[11366,19],[12748,18]]},"749":{"position":[[14127,19],[15507,18]]},"751":{"position":[[11580,19],[12964,18]]},"771":{"position":[[20772,19],[22151,18],[26469,19],[27846,18]]},"773":{"position":[[12103,19],[13485,18]]},"775":{"position":[[19281,19],[20657,18]]},"777":{"position":[[11978,19],[13359,18]]},"795":{"position":[[2120,19],[3495,18],[7812,19],[9191,18],[19444,19],[20820,18]]},"797":{"position":[[6231,19],[7602,18],[27522,19],[28897,18]]},"799":{"position":[[10386,19],[11949,18],[17313,19],[18877,18]]},"820":{"position":[[9233,19],[10616,18],[20575,19],[21954,18],[26195,19],[27576,18],[33415,19],[34794,18],[39034,19],[40414,18]]},"822":{"position":[[12041,19],[13424,18]]},"824":{"position":[[10957,19],[12343,18]]},"826":{"position":[[12628,19],[14015,18],[18388,19],[19777,18],[24087,19],[25478,18],[29877,19],[31266,18],[35574,19],[36963,18]]},"844":{"position":[[9746,19],[11131,18],[21414,19],[22799,18],[27164,19],[28556,18],[41118,19],[42503,18]]},"846":{"position":[[1825,19],[3205,18],[9106,19],[10485,18]]},"848":{"position":[[47755,19],[49132,18],[53441,19],[54833,18]]}}}],["clientcheckrequest",{"_index":710,"t":{"45":{"position":[[14061,19],[15432,18],[16590,19],[20255,19],[21626,18],[22784,19]]},"135":{"position":[[426,19],[737,18],[982,19]]},"173":{"position":[[5201,19]]},"202":{"position":[[1899,19],[3267,18],[4422,19],[7645,19],[9015,18],[10172,19]]},"265":{"position":[[2189,19],[3547,18],[4692,19]]},"267":{"position":[[7605,19],[8964,18],[10110,19]]},"285":{"position":[[3200,19],[4564,18],[5715,19],[14866,19],[16234,18],[17389,19],[20470,19],[21840,18],[22997,19]]},"296":{"position":[[1943,19],[3312,18],[4468,19]]},"357":{"position":[[2080,19],[3456,18],[4619,19]]},"369":{"position":[[2039,19],[3408,18],[4564,19],[7648,19],[9016,18],[10171,19]]},"375":{"position":[[8334,19],[9703,18],[10859,19],[14148,19],[15517,18],[16673,19]]},"382":{"position":[[3015,19],[4381,18],[5534,19]]},"404":{"position":[[1980,19],[3356,18],[4519,19],[7818,19],[9195,18],[10359,19]]},"444":{"position":[[8777,19],[10148,18],[11306,19]]},"448":{"position":[[1871,19],[3242,18],[4400,19]]},"462":{"position":[[2042,19],[3414,18],[4573,19],[7675,19],[9046,18],[10204,19]]},"466":{"position":[[2003,19],[3376,18],[4536,19],[7802,19],[9175,18],[10335,19]]},"508":{"position":[[2053,19],[3429,18],[4592,19]]},"524":{"position":[[2181,19],[3553,18],[4712,19]]},"544":{"position":[[2115,19],[3493,18],[4658,19]]},"562":{"position":[[8709,19],[10078,18],[11234,19],[14704,19],[16073,18],[17229,19],[20392,19],[21763,18],[22921,19],[26017,19],[27387,18],[28544,19]]},"582":{"position":[[1867,19],[3224,18],[4368,19],[7381,19],[8738,18],[9882,19]]},"584":{"position":[[7442,19],[8800,18],[9945,19]]},"599":{"position":[[2036,19],[3403,18],[4557,19]]},"639":{"position":[[1990,19],[3369,18],[4535,19]]},"647":{"position":[[1911,19],[3282,18],[4440,19]]},"649":{"position":[[7951,19],[9323,18],[10482,19],[13587,19],[14962,18],[16124,19]]},"667":{"position":[[3168,19],[4536,18],[5691,19],[9340,19],[10708,18],[11863,19],[16164,19],[17535,18],[18693,19],[22998,19],[24366,18],[25521,19],[29235,19],[30604,18],[31760,19]]},"669":{"position":[[3142,19],[4511,18],[5667,19],[9394,19],[10766,18],[11925,19],[15736,19],[17106,18],[18263,19],[22059,19],[23429,18],[24586,19]]},"679":{"position":[[2857,19],[4227,18],[5384,19],[8474,19],[9843,18],[10999,19]]},"681":{"position":[[7868,19],[9241,18],[10401,19]]},"683":{"position":[[20797,19],[22167,18],[23324,19],[26458,19],[27826,18],[28981,19]]},"701":{"position":[[588,19],[900,18],[1146,19],[2421,19],[2735,18],[2983,19],[4278,19],[4590,18],[4836,19],[6117,19],[6432,18],[6681,19],[7972,19],[8285,18],[8532,19],[9817,19],[10132,18],[10381,19]]},"703":{"position":[[3167,19],[3480,18],[3727,19],[11056,19],[11368,18],[11614,19]]},"705":{"position":[[7709,19],[8138,18],[8513,19],[10381,19],[10811,18],[11187,19]]},"726":{"position":[[30048,19],[31417,18],[32573,19],[35808,19],[37178,18],[38335,19],[41428,19],[42801,18],[43961,19],[47071,19],[48445,18],[49606,19]]},"728":{"position":[[2091,19],[3461,18],[4618,19],[10006,19],[11372,18],[12525,19],[15932,19],[17307,18],[18469,19],[26349,19],[27723,18],[28884,19],[34588,19],[35953,18],[37105,19],[44123,19],[45488,18],[46640,19]]},"745":{"position":[[9307,19],[10678,18],[11836,19],[20638,19],[22009,18],[23167,19],[26265,19],[27637,18],[28796,19],[33998,19],[35369,18],[36527,19],[39624,19],[40995,18],[42153,19]]},"747":{"position":[[11468,19],[12841,18],[14001,19]]},"749":{"position":[[14229,19],[15600,18],[16758,19]]},"751":{"position":[[11682,19],[13057,18],[14219,19]]},"771":{"position":[[20874,19],[22244,18],[23401,19],[26571,19],[27939,18],[29094,19]]},"773":{"position":[[12205,19],[13578,18],[14738,19]]},"775":{"position":[[19383,19],[20750,18],[21904,19]]},"777":{"position":[[12080,19],[13452,18],[14611,19]]},"795":{"position":[[2222,19],[3588,18],[4741,19],[7914,19],[9284,18],[10441,19],[19546,19],[20913,18],[22067,19]]},"797":{"position":[[6333,19],[7695,18],[8844,19],[27624,19],[28990,18],[30143,19]]},"799":{"position":[[10488,19],[12042,18],[13396,19],[17415,19],[18970,18],[20325,19]]},"820":{"position":[[9335,19],[10709,18],[11870,19],[20677,19],[22047,18],[23204,19],[26297,19],[27669,18],[28828,19],[33517,19],[34887,18],[36044,19],[39136,19],[40507,18],[41665,19]]},"822":{"position":[[12143,19],[13517,18],[14678,19]]},"824":{"position":[[11059,19],[12436,18],[13600,19]]},"826":{"position":[[12730,19],[14108,18],[15273,19],[18490,19],[19870,18],[21037,19],[24189,19],[25571,18],[26740,19],[29979,19],[31359,18],[32526,19],[35676,19],[37056,18],[38223,19]]},"844":{"position":[[9848,19],[11224,18],[12387,19],[21516,19],[22892,18],[24055,19],[27266,19],[28649,18],[29819,19],[41220,19],[42596,18],[43759,19]]},"846":{"position":[[1927,19],[3298,18],[4456,19],[9208,19],[10578,18],[11735,19]]},"848":{"position":[[47857,19],[49225,18],[50380,19],[53543,19],[54926,18],[56096,19]]}}}],["clientconfigur",{"_index":455,"t":{"35":{"position":[[3992,21]]},"43":{"position":[[1520,21]]},"45":{"position":[[14680,21],[20874,21],[27303,21]]},"133":{"position":[[1681,21]]},"145":{"position":[[1681,21]]},"183":{"position":[[1606,21]]},"185":{"position":[[2334,21]]},"187":{"position":[[2497,21]]},"200":{"position":[[2576,21]]},"202":{"position":[[2515,21],[8263,21]]},"248":{"position":[[1681,21]]},"265":{"position":[[2795,21]]},"267":{"position":[[2587,21],[8212,21]]},"277":{"position":[[1653,21]]},"285":{"position":[[3812,21],[9603,21],[15482,21],[21088,21]]},"294":{"position":[[2836,21]]},"296":{"position":[[2560,21]]},"311":{"position":[[2665,21],[8248,21],[14475,21]]},"357":{"position":[[2704,21]]},"369":{"position":[[2656,21],[8264,21]]},"375":{"position":[[2962,21],[8951,21],[14765,21]]},"382":{"position":[[3629,21]]},"402":{"position":[[2662,21]]},"404":{"position":[[2604,21],[8443,21]]},"444":{"position":[[3096,21],[9396,21]]},"446":{"position":[[3218,21]]},"448":{"position":[[2490,21]]},"462":{"position":[[2662,21],[8294,21]]},"466":{"position":[[2624,21],[8423,21]]},"504":{"position":[[2609,21]]},"506":{"position":[[2771,21]]},"508":{"position":[[2677,21]]},"522":{"position":[[2899,21]]},"524":{"position":[[2801,21]]},"540":{"position":[[2622,21]]},"542":{"position":[[3109,21]]},"544":{"position":[[2741,21]]},"562":{"position":[[3176,21],[9326,21],[15321,21],[21011,21],[26635,21]]},"574":{"position":[[2862,21]]},"578":{"position":[[2861,21]]},"580":{"position":[[2717,21]]},"582":{"position":[[2472,21],[7986,21]]},"584":{"position":[[2584,21],[8048,21]]},"599":{"position":[[2651,21]]},"606":{"position":[[3043,21],[9141,21],[15142,21]]},"608":{"position":[[3010,21]]},"613":{"position":[[2747,21],[8659,21]]},"618":{"position":[[2862,21]]},"637":{"position":[[3083,21]]},"639":{"position":[[2617,21]]},"645":{"position":[[3065,21]]},"647":{"position":[[2530,21]]},"649":{"position":[[2718,21],[8571,21],[14210,21]]},"667":{"position":[[3784,21],[9956,21],[16783,21],[23614,21],[29852,21]]},"669":{"position":[[3759,21],[10014,21],[16354,21],[22677,21]]},"679":{"position":[[3475,21],[9091,21]]},"681":{"position":[[2768,21],[8489,21]]},"683":{"position":[[2786,21],[9129,21],[15393,21],[21415,21],[27074,21]]},"703":{"position":[[7363,21]]},"705":{"position":[[3810,21]]},"726":{"position":[[4665,21],[14886,21],[22883,21],[30665,21],[36426,21],[42049,21],[47693,21]]},"728":{"position":[[2709,21],[10620,21],[16555,21],[26971,21],[35201,21],[44736,21]]},"745":{"position":[[4321,21],[9926,21],[15695,21],[21257,21],[26885,21],[34617,21],[40243,21]]},"747":{"position":[[5367,21],[12089,21]]},"749":{"position":[[2843,21],[9148,21],[14848,21]]},"751":{"position":[[5719,21],[12305,21],[19854,21]]},"771":{"position":[[3005,21],[8661,21],[14749,21],[21492,21],[27187,21]]},"773":{"position":[[6000,21],[12826,21]]},"775":{"position":[[5563,21],[12596,21],[19998,21]]},"777":{"position":[[5941,21],[12700,21]]},"789":{"position":[[6313,21]]},"795":{"position":[[2836,21],[8532,21],[14456,21],[20161,21]]},"797":{"position":[[6943,21],[13817,21],[21811,21],[28238,21]]},"799":{"position":[[4118,21],[11290,21],[18218,21]]},"801":{"position":[[10025,21]]},"820":{"position":[[4328,21],[9957,21],[15740,21],[21295,21],[26917,21],[34135,21],[39755,21]]},"822":{"position":[[5422,21],[12765,21]]},"824":{"position":[[4895,21],[11684,21]]},"826":{"position":[[6173,21],[13356,21],[19118,21],[24819,21],[30607,21],[36304,21]]},"844":{"position":[[4680,21],[10472,21],[16391,21],[22140,21],[27897,21],[34847,21],[41844,21]]},"846":{"position":[[2546,21],[9826,21]]},"848":{"position":[[9957,21],[17263,21],[23853,21],[30517,21],[36828,21],[42681,21],[48473,21],[54174,21]]}}}],["clientcreatestorerequest(){nam",{"_index":576,"t":{"43":{"position":[[2215,31]]}}}],["clientcredentialsapiaudi",{"_index":1257,"t":{"187":{"position":[[2106,29]]}}}],["clientcredentialsapitokenissu",{"_index":1259,"t":{"187":{"position":[[2167,32]]}}}],["clientcredentialsclientid",{"_index":1253,"t":{"187":{"position":[[1988,26]]}}}],["clientcredentialsclientsecret",{"_index":1255,"t":{"187":{"position":[[2043,30]]}}}],["clientexpandopt",{"_index":2166,"t":{"613":{"position":[[1964,20],[7876,20]]}}}],["clientexpandrequest",{"_index":2167,"t":{"613":{"position":[[2067,20],[3499,19],[4715,20],[7979,20],[9411,19],[10627,20]]}}}],["clientid",{"_index":391,"t":{"35":{"position":[[792,8],[1972,8],[3634,8],[5346,8]]},"45":{"position":[[12347,8],[13191,8],[14322,8],[15660,8],[18541,8],[19385,8],[20516,8],[21854,8],[24895,8],[25760,8],[26945,8],[28325,8]]},"187":{"position":[[1088,9],[3357,8]]},"200":{"position":[[178,8],[977,8],[2218,8],[3580,8]]},"202":{"position":[[188,8],[1029,8],[2157,8],[3492,8],[5932,8],[6775,8],[7905,8],[9242,8]]},"265":{"position":[[488,8],[1319,8],[2437,8],[3762,8]]},"267":{"position":[[199,8],[993,8],[2229,8],[3586,8],[5903,8],[6735,8],[7854,8],[9180,8]]},"285":{"position":[[1493,8],[2330,8],[3454,8],[4785,8],[7131,8],[7967,8],[9245,8],[10644,8],[13155,8],[13996,8],[15124,8],[16459,8],[18757,8],[19600,8],[20730,8],[22067,8]]},"294":{"position":[[440,8],[1238,8],[2478,8],[3839,8]]},"296":{"position":[[231,8],[1073,8],[2202,8],[3538,8]]},"311":{"position":[[285,8],[1075,8],[2307,8],[3660,8],[5866,8],[6657,8],[7890,8],[9244,8],[11680,8],[12640,8],[14117,8],[15677,8]]},"357":{"position":[[361,8],[1210,8],[2346,8],[3689,8]]},"369":{"position":[[327,8],[1169,8],[2298,8],[3634,8],[5937,8],[6778,8],[7906,8],[9241,8]]},"375":{"position":[[446,8],[1304,8],[2604,8],[4025,8],[6622,8],[7464,8],[8593,8],[9929,8],[12436,8],[13278,8],[14407,8],[15743,8]]},"382":{"position":[[1306,8],[2145,8],[3271,8],[4604,8]]},"402":{"position":[[240,8],[1051,8],[2304,8],[3678,8]]},"404":{"position":[[261,8],[1110,8],[2246,8],[3589,8],[6098,8],[6948,8],[8085,8],[9429,8]]},"444":{"position":[[309,8],[1273,8],[2738,8],[4275,8],[7063,8],[7907,8],[9038,8],[10376,8]]},"446":{"position":[[211,8],[1285,8],[2860,8],[4507,8]]},"448":{"position":[[157,8],[1001,8],[2132,8],[3470,8]]},"462":{"position":[[327,8],[1172,8],[2304,8],[3643,8],[5961,8],[6805,8],[7936,8],[9274,8]]},"466":{"position":[[287,8],[1133,8],[2266,8],[3606,8],[6086,8],[6932,8],[8065,8],[9405,8]]},"504":{"position":[[215,8],[1012,8],[2251,8],[3611,8]]},"506":{"position":[[217,8],[1094,8],[2413,8],[3853,8]]},"508":{"position":[[334,8],[1183,8],[2319,8],[3662,8]]},"522":{"position":[[401,8],[1250,8],[2541,8],[3953,8]]},"524":{"position":[[466,8],[1311,8],[2443,8],[3782,8]]},"540":{"position":[[224,8],[1023,8],[2264,8],[3626,8]]},"542":{"position":[[557,8],[1433,8],[2751,8],[4190,8]]},"544":{"position":[[394,8],[1245,8],[2383,8],[3728,8]]},"562":{"position":[[449,8],[1383,8],[2818,8],[4325,8],[6997,8],[7839,8],[8968,8],[10304,8],[12992,8],[13834,8],[14963,8],[16299,8],[18678,8],[19522,8],[20653,8],[21991,8],[24304,8],[25147,8],[26277,8],[27614,8]]},"574":{"position":[[303,8],[1153,8],[2504,8],[3927,8]]},"578":{"position":[[310,8],[1156,8],[2503,8],[3922,8]]},"580":{"position":[[321,8],[1119,8],[2359,8],[3720,8]]},"582":{"position":[[167,8],[997,8],[2114,8],[3438,8],[5681,8],[6511,8],[7628,8],[8952,8]]},"584":{"position":[[204,8],[994,8],[2226,8],[3579,8],[5741,8],[6572,8],[7690,8],[9015,8]]},"599":{"position":[[326,8],[1166,8],[2293,8],[3627,8]]},"606":{"position":[[576,8],[1461,8],[2685,8],[4072,8],[6732,8],[7598,8],[8783,8],[10149,8],[12713,8],[13589,8],[14784,8],[16160,8]]},"608":{"position":[[779,8],[1546,8],[2652,8],[3921,8]]},"613":{"position":[[317,8],[1196,8],[2389,8],[3785,8],[6229,8],[7108,8],[8301,8],[9697,8]]},"618":{"position":[[238,8],[1210,8],[2504,8],[4005,8]]},"637":{"position":[[453,8],[1368,8],[2725,8],[4203,8]]},"639":{"position":[[268,8],[1120,8],[2259,8],[3605,8]]},"645":{"position":[[178,8],[1192,8],[2707,8],[4294,8]]},"647":{"position":[[197,8],[1041,8],[2172,8],[3510,8]]},"649":{"position":[[178,8],[1048,8],[2360,8],[3793,8],[6236,8],[7081,8],[8213,8],[9552,8],[11869,8],[12717,8],[13852,8],[15194,8]]},"667":{"position":[[1457,8],[2298,8],[3426,8],[4761,8],[7629,8],[8470,8],[9598,8],[10933,8],[14450,8],[15294,8],[16425,8],[17763,8],[21287,8],[22128,8],[23256,8],[24591,8],[27523,8],[28365,8],[29494,8],[30830,8]]},"669":{"position":[[1430,8],[2272,8],[3401,8],[4737,8],[7679,8],[8524,8],[9656,8],[10995,8],[14023,8],[14866,8],[15996,8],[17333,8],[20346,8],[21189,8],[22319,8],[23656,8]]},"679":{"position":[[1144,8],[1987,8],[3117,8],[4454,8],[6762,8],[7604,8],[8733,8],[10069,8]]},"681":{"position":[[268,8],[1118,8],[2410,8],[3823,8],[6152,8],[6998,8],[8131,8],[9471,8]]},"683":{"position":[[243,8],[1196,8],[2428,8],[3877,8],[6520,8],[7395,8],[8771,8],[10219,8],[12782,8],[13658,8],[15035,8],[16484,8],[19084,8],[19927,8],[21057,8],[22394,8],[24747,8],[25588,8],[26716,8],[28051,8]]},"703":{"position":[[4829,8],[5696,8],[7005,8],[8435,8]]},"705":{"position":[[1220,8],[2115,8],[3452,8],[4910,8]]},"726":{"position":[[282,8],[1926,8],[4307,8],[6564,8],[11600,8],[12784,8],[14528,8],[16295,8],[19737,8],[20851,8],[22525,8],[24222,8],[28336,8],[29178,8],[30307,8],[31643,8],[34095,8],[34938,8],[36068,8],[37405,8],[39712,8],[40558,8],[41691,8],[43031,8],[45354,8],[46201,8],[47335,8],[48676,8]]},"728":{"position":[[378,8],[1221,8],[2351,8],[3688,8],[8297,8],[9136,8],[10262,8],[11595,8],[14214,8],[15062,8],[16197,8],[17539,8],[24632,8],[25479,8],[26613,8],[27954,8],[32880,8],[33718,8],[34843,8],[36175,8],[42415,8],[43253,8],[44378,8],[45710,8]]},"745":{"position":[[1909,8],[2715,8],[3963,8],[5332,8],[7593,8],[8437,8],[9568,8],[10906,8],[13283,8],[14089,8],[15337,8],[16706,8],[18924,8],[19768,8],[20899,8],[22237,8],[24550,8],[25395,8],[26527,8],[27866,8],[32284,8],[33128,8],[34259,8],[35597,8],[37910,8],[38754,8],[39885,8],[41223,8]]},"747":{"position":[[2438,8],[3473,8],[5009,8],[6617,8],[9752,8],[10598,8],[11731,8],[13071,8]]},"749":{"position":[[383,8],[1213,8],[2485,8],[3878,8],[6624,8],[7486,8],[8790,8],[10215,8],[12515,8],[13359,8],[14490,8],[15828,8]]},"751":{"position":[[3080,8],[3970,8],[5361,8],[6824,8],[9964,8],[10812,8],[11947,8],[13289,8],[17398,8],[18226,8],[19496,8],[20887,8]]},"771":{"position":[[595,8],[1400,8],[2647,8],[4015,8],[6243,8],[7052,8],[8303,8],[9675,8],[11927,8],[12879,8],[14391,8],[15926,8],[19161,8],[20004,8],[21134,8],[22471,8],[24860,8],[25701,8],[26829,8],[28164,8]]},"773":{"position":[[3013,8],[4018,8],[5642,8],[7240,8],[10489,8],[11335,8],[12468,8],[13808,8]]},"775":{"position":[[2918,8],[3811,8],[5205,8],[6671,8],[9443,8],[10531,8],[12238,8],[13919,8],[17673,8],[18513,8],[19640,8],[20974,8]]},"777":{"position":[[3113,8],[4068,8],[5583,8],[7121,8],[10365,8],[11210,8],[12342,8],[13681,8]]},"789":{"position":[[2686,8],[4011,8],[5955,8],[7873,8]]},"795":{"position":[[513,8],[1352,8],[2478,8],[3811,8],[6201,8],[7044,8],[8174,8],[9511,8],[11926,8],[12791,8],[14098,8],[15526,8],[17836,8],[18676,8],[19803,8],[21137,8]]},"797":{"position":[[4628,8],[5463,8],[6585,8],[7914,8],[10433,8],[11666,8],[13459,8],[15275,8],[18976,8],[19964,8],[21453,8],[23014,8],[25915,8],[26754,8],[27880,8],[29213,8]]},"799":{"position":[[1173,8],[2216,8],[3760,8],[5376,8],[8610,8],[9618,8],[10932,8],[12466,8],[15536,8],[16545,8],[17860,8],[19395,8]]},"801":{"position":[[3414,8],[5995,8],[9667,8],[12921,8]]},"820":{"position":[[1910,8],[2719,8],[3970,8],[5342,8],[7618,8],[8465,8],[9599,8],[10940,8],[13330,8],[14135,8],[15382,8],[16750,8],[18964,8],[19807,8],[20937,8],[22274,8],[24582,8],[25427,8],[26559,8],[27898,8],[31804,8],[32647,8],[33777,8],[35114,8],[37422,8],[38266,8],[39397,8],[40735,8]]},"822":{"position":[[2193,8],[3319,8],[5064,8],[6783,8],[10426,8],[11273,8],[12407,8],[13748,8]]},"824":{"position":[[2026,8],[3031,8],[4537,8],[6115,8],[9339,8],[10189,8],[11326,8],[12670,8]]},"826":{"position":[[2899,8],[4077,8],[5815,8],[7576,8],[11009,8],[11860,8],[12998,8],[14343,8],[16767,8],[17620,8],[18760,8],[20107,8],[22464,8],[23319,8],[24461,8],[25810,8],[28256,8],[29109,8],[30249,8],[31596,8],[33953,8],[34806,8],[35946,8],[37293,8]]},"844":{"position":[[2152,8],[3016,8],[4322,8],[5749,8],[8129,8],[8978,8],[10114,8],[11457,8],[13863,8],[14727,8],[16033,8],[17460,8],[19797,8],[20646,8],[21782,8],[23125,8],[25540,8],[26396,8],[27539,8],[28889,8],[31701,8],[32815,8],[34489,8],[36186,8],[39501,8],[40350,8],[41486,8],[42829,8]]},"846":{"position":[[213,8],[1057,8],[2188,8],[3526,8],[7495,8],[8338,8],[9468,8],[10805,8]]},"848":{"position":[[6981,8],[8010,8],[9599,8],[11211,8],[14597,8],[15530,8],[16905,8],[18401,8],[21040,8],[22017,8],[23495,8],[25045,8],[27874,8],[28766,8],[30159,8],[31624,8],[34358,8],[35193,8],[36470,8],[37868,8],[40245,8],[41063,8],[42323,8],[43704,8],[46146,8],[46987,8],[48115,8],[49450,8],[51817,8],[52673,8],[53816,8],[55166,8]]}}}],["clientlistobjectsopt",{"_index":737,"t":{"45":{"position":[[26528,25],[27962,24]]},"147":{"position":[[350,25],[734,24]]},"200":{"position":[[3235,24]]},"250":{"position":[[705,24]]},"252":{"position":[[862,24]]},"267":{"position":[[3246,24]]},"285":{"position":[[10262,24]]},"294":{"position":[[3495,24]]},"311":{"position":[[3324,24],[8907,24],[15134,24]]},"375":{"position":[[3621,24]]},"402":{"position":[[3321,24]]},"422":{"position":[[1863,24]]},"444":{"position":[[3755,24]]},"446":{"position":[[3877,24]]},"504":{"position":[[3268,24]]},"506":{"position":[[3430,24]]},"522":{"position":[[3558,24]]},"540":{"position":[[3281,24]]},"542":{"position":[[3768,24]]},"562":{"position":[[3835,24]]},"574":{"position":[[3521,24]]},"578":{"position":[[3520,24]]},"580":{"position":[[3376,24]]},"584":{"position":[[3243,24]]},"618":{"position":[[1978,25],[3521,24]]},"637":{"position":[[3742,24]]},"645":{"position":[[3724,24]]},"649":{"position":[[3377,24]]},"681":{"position":[[3427,24]]},"683":{"position":[[9788,24],[16052,24]]},"695":{"position":[[5783,24]]},"703":{"position":[[8022,24]]},"705":{"position":[[4469,24]]},"707":{"position":[[5322,24]]},"726":{"position":[[5324,24],[15545,24],[23542,24]]},"745":{"position":[[4980,24],[16354,24]]},"747":{"position":[[6026,24]]},"749":{"position":[[3502,24],[9807,24]]},"751":{"position":[[6378,24],[20513,24]]},"771":{"position":[[3664,24],[9320,24],[15408,24]]},"773":{"position":[[6659,24]]},"775":{"position":[[6222,24],[13255,24]]},"777":{"position":[[6600,24]]},"789":{"position":[[6972,24]]},"795":{"position":[[15115,24]]},"797":{"position":[[14476,24],[22470,24]]},"799":{"position":[[4777,24]]},"801":{"position":[[10684,24]]},"820":{"position":[[4987,24],[16399,24]]},"822":{"position":[[6081,24]]},"824":{"position":[[5554,24]]},"826":{"position":[[6832,24]]},"844":{"position":[[5339,24],[17050,24],[35506,24]]},"848":{"position":[[10616,24],[17922,24],[24512,24],[31176,24],[37487,24],[43340,24]]}}}],["clientlistobjectsrequest",{"_index":738,"t":{"45":{"position":[[26636,25],[28061,24],[29255,25]]},"147":{"position":[[458,25],[833,24],[1124,25]]},"618":{"position":[[2086,25],[3620,24],[4935,25]]}}}],["clientreadchangesopt",{"_index":1540,"t":{"279":{"position":[[241,25],[532,24],[684,24],[1741,25],[2170,24],[2442,24]]},"281":{"position":[[1232,25],[1555,24],[1715,24],[2597,25],[3058,24],[3338,24]]}}}],["clientreadchangesrequest",{"_index":1542,"t":{"279":{"position":[[309,25],[484,24],[643,26],[1947,25],[2122,24],[2401,26]]},"281":{"position":[[1300,25],[1491,24],[2803,25],[2994,24]]}}}],["clientreadchangesrequest(\"fold",{"_index":1562,"t":{"281":{"position":[[1666,34],[3289,34]]}}}],["clientreadopt",{"_index":2139,"t":{"606":{"position":[[2229,19],[3702,17],[8366,19],[9800,17],[14357,19],[15801,17]]},"608":{"position":[[2314,19],[3669,17]]},"683":{"position":[[1964,19],[3445,17]]}}}],["clientreadrequest",{"_index":2140,"t":{"606":{"position":[[2257,18],[3738,19],[8394,18],[9836,19],[14385,18],[15837,19]]},"608":{"position":[[2342,18],[3705,19]]},"683":{"position":[[1992,18],[3481,19]]}}}],["clientsecret",{"_index":392,"t":{"35":{"position":[[805,12],[1985,12],[3647,12],[5359,12]]},"45":{"position":[[12360,12],[13204,12],[14335,12],[15673,12],[18554,12],[19398,12],[20529,12],[21867,12],[24908,12],[25773,12],[26958,12],[28338,12]]},"187":{"position":[[1125,13],[3421,12]]},"200":{"position":[[191,12],[990,12],[2231,12],[3593,12]]},"202":{"position":[[201,12],[1042,12],[2170,12],[3505,12],[5945,12],[6788,12],[7918,12],[9255,12]]},"265":{"position":[[501,12],[1332,12],[2450,12],[3775,12]]},"267":{"position":[[212,12],[1006,12],[2242,12],[3599,12],[5916,12],[6748,12],[7867,12],[9193,12]]},"285":{"position":[[1506,12],[2343,12],[3467,12],[4798,12],[7144,12],[7980,12],[9258,12],[10657,12],[13168,12],[14009,12],[15137,12],[16472,12],[18770,12],[19613,12],[20743,12],[22080,12]]},"294":{"position":[[453,12],[1251,12],[2491,12],[3852,12]]},"296":{"position":[[244,12],[1086,12],[2215,12],[3551,12]]},"311":{"position":[[298,12],[1088,12],[2320,12],[3673,12],[5879,12],[6670,12],[7903,12],[9257,12],[11693,12],[12653,12],[14130,12],[15690,12]]},"357":{"position":[[374,12],[1223,12],[2359,12],[3702,12]]},"369":{"position":[[340,12],[1182,12],[2311,12],[3647,12],[5950,12],[6791,12],[7919,12],[9254,12]]},"375":{"position":[[459,12],[1317,12],[2617,12],[4038,12],[6635,12],[7477,12],[8606,12],[9942,12],[12449,12],[13291,12],[14420,12],[15756,12]]},"382":{"position":[[1319,12],[2158,12],[3284,12],[4617,12]]},"402":{"position":[[253,12],[1064,12],[2317,12],[3691,12]]},"404":{"position":[[274,12],[1123,12],[2259,12],[3602,12],[6111,12],[6961,12],[8098,12],[9442,12]]},"444":{"position":[[322,12],[1286,12],[2751,12],[4288,12],[7076,12],[7920,12],[9051,12],[10389,12]]},"446":{"position":[[224,12],[1298,12],[2873,12],[4520,12]]},"448":{"position":[[170,12],[1014,12],[2145,12],[3483,12]]},"462":{"position":[[340,12],[1185,12],[2317,12],[3656,12],[5974,12],[6818,12],[7949,12],[9287,12]]},"466":{"position":[[300,12],[1146,12],[2279,12],[3619,12],[6099,12],[6945,12],[8078,12],[9418,12]]},"504":{"position":[[228,12],[1025,12],[2264,12],[3624,12]]},"506":{"position":[[230,12],[1107,12],[2426,12],[3866,12]]},"508":{"position":[[347,12],[1196,12],[2332,12],[3675,12]]},"522":{"position":[[414,12],[1263,12],[2554,12],[3966,12]]},"524":{"position":[[479,12],[1324,12],[2456,12],[3795,12]]},"540":{"position":[[237,12],[1036,12],[2277,12],[3639,12]]},"542":{"position":[[570,12],[1446,12],[2764,12],[4203,12]]},"544":{"position":[[407,12],[1258,12],[2396,12],[3741,12]]},"562":{"position":[[462,12],[1396,12],[2831,12],[4338,12],[7010,12],[7852,12],[8981,12],[10317,12],[13005,12],[13847,12],[14976,12],[16312,12],[18691,12],[19535,12],[20666,12],[22004,12],[24317,12],[25160,12],[26290,12],[27627,12]]},"574":{"position":[[316,12],[1166,12],[2517,12],[3940,12]]},"578":{"position":[[323,12],[1169,12],[2516,12],[3935,12]]},"580":{"position":[[334,12],[1132,12],[2372,12],[3733,12]]},"582":{"position":[[180,12],[1010,12],[2127,12],[3451,12],[5694,12],[6524,12],[7641,12],[8965,12]]},"584":{"position":[[217,12],[1007,12],[2239,12],[3592,12],[5754,12],[6585,12],[7703,12],[9028,12]]},"599":{"position":[[339,12],[1179,12],[2306,12],[3640,12]]},"606":{"position":[[589,12],[1474,12],[2698,12],[4085,12],[6745,12],[7611,12],[8796,12],[10162,12],[12726,12],[13602,12],[14797,12],[16173,12]]},"608":{"position":[[792,12],[1559,12],[2665,12],[3934,12]]},"613":{"position":[[330,12],[1209,12],[2402,12],[3798,12],[6242,12],[7121,12],[8314,12],[9710,12]]},"618":{"position":[[251,12],[1223,12],[2517,12],[4018,12]]},"637":{"position":[[466,12],[1381,12],[2738,12],[4216,12]]},"639":{"position":[[281,12],[1133,12],[2272,12],[3618,12]]},"645":{"position":[[191,12],[1205,12],[2720,12],[4307,12]]},"647":{"position":[[210,12],[1054,12],[2185,12],[3523,12]]},"649":{"position":[[191,12],[1061,12],[2373,12],[3806,12],[6249,12],[7094,12],[8226,12],[9565,12],[11882,12],[12730,12],[13865,12],[15207,12]]},"667":{"position":[[1470,12],[2311,12],[3439,12],[4774,12],[7642,12],[8483,12],[9611,12],[10946,12],[14463,12],[15307,12],[16438,12],[17776,12],[21300,12],[22141,12],[23269,12],[24604,12],[27536,12],[28378,12],[29507,12],[30843,12]]},"669":{"position":[[1443,12],[2285,12],[3414,12],[4750,12],[7692,12],[8537,12],[9669,12],[11008,12],[14036,12],[14879,12],[16009,12],[17346,12],[20359,12],[21202,12],[22332,12],[23669,12]]},"679":{"position":[[1157,12],[2000,12],[3130,12],[4467,12],[6775,12],[7617,12],[8746,12],[10082,12]]},"681":{"position":[[281,12],[1131,12],[2423,12],[3836,12],[6165,12],[7011,12],[8144,12],[9484,12]]},"683":{"position":[[256,12],[1209,12],[2441,12],[3890,12],[6533,12],[7408,12],[8784,12],[10232,12],[12795,12],[13671,12],[15048,12],[16497,12],[19097,12],[19940,12],[21070,12],[22407,12],[24760,12],[25601,12],[26729,12],[28064,12]]},"703":{"position":[[4842,12],[5709,12],[7018,12],[8448,12]]},"705":{"position":[[1233,12],[2128,12],[3465,12],[4923,12]]},"726":{"position":[[295,12],[1939,12],[4320,12],[6577,12],[11613,12],[12797,12],[14541,12],[16308,12],[19750,12],[20864,12],[22538,12],[24235,12],[28349,12],[29191,12],[30320,12],[31656,12],[34108,12],[34951,12],[36081,12],[37418,12],[39725,12],[40571,12],[41704,12],[43044,12],[45367,12],[46214,12],[47348,12],[48689,12]]},"728":{"position":[[391,12],[1234,12],[2364,12],[3701,12],[8310,12],[9149,12],[10275,12],[11608,12],[14227,12],[15075,12],[16210,12],[17552,12],[24645,12],[25492,12],[26626,12],[27967,12],[32893,12],[33731,12],[34856,12],[36188,12],[42428,12],[43266,12],[44391,12],[45723,12]]},"745":{"position":[[1922,12],[2728,12],[3976,12],[5345,12],[7606,12],[8450,12],[9581,12],[10919,12],[13296,12],[14102,12],[15350,12],[16719,12],[18937,12],[19781,12],[20912,12],[22250,12],[24563,12],[25408,12],[26540,12],[27879,12],[32297,12],[33141,12],[34272,12],[35610,12],[37923,12],[38767,12],[39898,12],[41236,12]]},"747":{"position":[[2451,12],[3486,12],[5022,12],[6630,12],[9765,12],[10611,12],[11744,12],[13084,12]]},"749":{"position":[[396,12],[1226,12],[2498,12],[3891,12],[6637,12],[7499,12],[8803,12],[10228,12],[12528,12],[13372,12],[14503,12],[15841,12]]},"751":{"position":[[3093,12],[3983,12],[5374,12],[6837,12],[9977,12],[10825,12],[11960,12],[13302,12],[17411,12],[18239,12],[19509,12],[20900,12]]},"771":{"position":[[608,12],[1413,12],[2660,12],[4028,12],[6256,12],[7065,12],[8316,12],[9688,12],[11940,12],[12892,12],[14404,12],[15939,12],[19174,12],[20017,12],[21147,12],[22484,12],[24873,12],[25714,12],[26842,12],[28177,12]]},"773":{"position":[[3026,12],[4031,12],[5655,12],[7253,12],[10502,12],[11348,12],[12481,12],[13821,12]]},"775":{"position":[[2931,12],[3824,12],[5218,12],[6684,12],[9456,12],[10544,12],[12251,12],[13932,12],[17686,12],[18526,12],[19653,12],[20987,12]]},"777":{"position":[[3126,12],[4081,12],[5596,12],[7134,12],[10378,12],[11223,12],[12355,12],[13694,12]]},"789":{"position":[[2699,12],[4024,12],[5968,12],[7886,12]]},"795":{"position":[[526,12],[1365,12],[2491,12],[3824,12],[6214,12],[7057,12],[8187,12],[9524,12],[11939,12],[12804,12],[14111,12],[15539,12],[17849,12],[18689,12],[19816,12],[21150,12]]},"797":{"position":[[4641,12],[5476,12],[6598,12],[7927,12],[10446,12],[11679,12],[13472,12],[15288,12],[18989,12],[19977,12],[21466,12],[23027,12],[25928,12],[26767,12],[27893,12],[29226,12]]},"799":{"position":[[1186,12],[2229,12],[3773,12],[5389,12],[8623,12],[9631,12],[10945,12],[12479,12],[15549,12],[16558,12],[17873,12],[19408,12]]},"801":{"position":[[3427,12],[6008,12],[9680,12],[12934,12]]},"820":{"position":[[1923,12],[2732,12],[3983,12],[5355,12],[7631,12],[8478,12],[9612,12],[10953,12],[13343,12],[14148,12],[15395,12],[16763,12],[18977,12],[19820,12],[20950,12],[22287,12],[24595,12],[25440,12],[26572,12],[27911,12],[31817,12],[32660,12],[33790,12],[35127,12],[37435,12],[38279,12],[39410,12],[40748,12]]},"822":{"position":[[2206,12],[3332,12],[5077,12],[6796,12],[10439,12],[11286,12],[12420,12],[13761,12]]},"824":{"position":[[2039,12],[3044,12],[4550,12],[6128,12],[9352,12],[10202,12],[11339,12],[12683,12]]},"826":{"position":[[2912,12],[4090,12],[5828,12],[7589,12],[11022,12],[11873,12],[13011,12],[14356,12],[16780,12],[17633,12],[18773,12],[20120,12],[22477,12],[23332,12],[24474,12],[25823,12],[28269,12],[29122,12],[30262,12],[31609,12],[33966,12],[34819,12],[35959,12],[37306,12]]},"844":{"position":[[2165,12],[3029,12],[4335,12],[5762,12],[8142,12],[8991,12],[10127,12],[11470,12],[13876,12],[14740,12],[16046,12],[17473,12],[19810,12],[20659,12],[21795,12],[23138,12],[25553,12],[26409,12],[27552,12],[28902,12],[31714,12],[32828,12],[34502,12],[36199,12],[39514,12],[40363,12],[41499,12],[42842,12]]},"846":{"position":[[226,12],[1070,12],[2201,12],[3539,12],[7508,12],[8351,12],[9481,12],[10818,12]]},"848":{"position":[[6994,12],[8023,12],[9612,12],[11224,12],[14610,12],[15543,12],[16918,12],[18414,12],[21053,12],[22030,12],[23508,12],[25058,12],[27887,12],[28779,12],[30172,12],[31637,12],[34371,12],[35206,12],[36483,12],[37881,12],[40258,12],[41076,12],[42336,12],[43717,12],[46159,12],[47000,12],[48128,12],[49463,12],[51830,12],[52686,12],[53829,12],[55179,12]]}}}],["clienttupl",{"_index":1302,"t":{"200":{"position":[[4546,12]]},"250":{"position":[[1110,12]]},"252":{"position":[[1270,12]]},"267":{"position":[[4554,12]]},"285":{"position":[[11610,12]]},"294":{"position":[[4807,12]]},"311":{"position":[[4626,12],[10212,12],[16643,12],[16774,12]]},"375":{"position":[[4991,12]]},"402":{"position":[[4644,12]]},"422":{"position":[[2285,12]]},"444":{"position":[[5241,12],[5367,12]]},"446":{"position":[[5473,12],[5653,12]]},"504":{"position":[[4577,12]]},"506":{"position":[[4819,12]]},"522":{"position":[[4919,12]]},"540":{"position":[[4592,12]]},"542":{"position":[[5156,12]]},"562":{"position":[[5291,12],[5400,12]]},"574":{"position":[[4893,12],[4962,12]]},"578":{"position":[[4888,12],[4955,12]]},"580":{"position":[[4686,12]]},"584":{"position":[[4547,12]]},"637":{"position":[[5169,12]]},"645":{"position":[[5260,12],[5399,12]]},"649":{"position":[[4761,12]]},"681":{"position":[[4789,12]]},"683":{"position":[[11185,12],[11265,12],[17452,12],[17532,12]]},"695":{"position":[[7056,12],[7197,12],[7338,12],[7479,12],[7620,12],[7761,12],[7870,12]]},"703":{"position":[[9401,12]]},"705":{"position":[[5878,12]]},"707":{"position":[[6595,12],[6736,12],[6877,12],[7018,12],[7159,12],[7300,12],[7409,12]]},"726":{"position":[[7530,12],[7678,12],[7826,12],[7990,12],[8150,12],[8326,12],[17261,12],[17416,12],[17575,12],[25188,12],[25326,12],[25455,12]]},"745":{"position":[[6298,12],[17672,12]]},"747":{"position":[[7583,12],[7730,12]]},"749":{"position":[[4844,12],[11181,12]]},"751":{"position":[[7790,12],[7874,12],[21853,12]]},"771":{"position":[[4981,12],[10641,12],[16892,12],[16975,12],[17062,12]]},"773":{"position":[[8206,12],[8286,12],[8360,12],[8443,12]]},"775":{"position":[[7637,12],[7731,12],[14885,12],[14990,12],[15095,12],[15188,12]]},"777":{"position":[[8087,12],[8171,12],[8259,12]]},"789":{"position":[[8839,12],[8982,12],[9131,12],[9316,12]]},"795":{"position":[[16492,12]]},"797":{"position":[[16241,12],[16403,12],[16564,12],[23980,12],[24136,12]]},"799":{"position":[[6344,12],[6527,12]]},"801":{"position":[[13887,12],[14030,12],[14179,12],[14364,12],[14516,12],[14674,12],[14834,12],[14996,12],[15158,12],[15319,12],[15479,12],[15639,12]]},"820":{"position":[[6308,12],[17716,12]]},"822":{"position":[[7749,12],[7877,12],[7951,12],[8028,12]]},"824":{"position":[[7081,12],[7214,12]]},"826":{"position":[[8542,12],[8685,12],[8860,12]]},"844":{"position":[[6715,12],[18426,12],[37152,12],[37297,12],[37428,12]]},"848":{"position":[[12177,12],[12277,12],[12388,12],[19367,12],[26011,12],[26195,12],[32590,12],[32679,12],[38834,12],[44670,12]]}}}],["clienttuplekey",{"_index":1294,"t":{"200":{"position":[[1885,18]]},"250":{"position":[[408,18]]},"252":{"position":[[565,18]]},"267":{"position":[[1902,18]]},"285":{"position":[[8875,18]]},"294":{"position":[[2147,18]]},"311":{"position":[[1983,18],[7566,18],[13548,18],[13744,18]]},"375":{"position":[[2212,18]]},"402":{"position":[[1959,18]]},"422":{"position":[[1549,18]]},"444":{"position":[[2181,18]]},"446":{"position":[[2193,18]]},"504":{"position":[[1920,18]]},"506":{"position":[[2002,18]]},"522":{"position":[[2158,18]]},"540":{"position":[[1931,18]]},"542":{"position":[[2341,18]]},"562":{"position":[[2291,18]]},"574":{"position":[[2061,18]]},"578":{"position":[[2064,18]]},"580":{"position":[[2027,18]]},"584":{"position":[[1903,18]]},"618":{"position":[[2186,18]]},"637":{"position":[[2276,18]]},"645":{"position":[[2100,18]]},"649":{"position":[[1957,18]]},"681":{"position":[[2026,18]]},"683":{"position":[[8303,18],[14567,18]]},"695":{"position":[[4324,18]]},"703":{"position":[[6604,18]]},"705":{"position":[[3024,18],[7809,18],[10481,18]]},"707":{"position":[[3863,18]]},"726":{"position":[[2834,18],[13692,18],[21759,18]]},"745":{"position":[[3623,18],[14997,18]]},"747":{"position":[[4381,18]]},"749":{"position":[[2121,18],[8394,18]]},"751":{"position":[[4878,18],[19134,18]]},"771":{"position":[[2308,18],[7960,18],[13787,18]]},"773":{"position":[[4926,18]]},"775":{"position":[[4719,18],[11439,18]]},"777":{"position":[[4976,18]]},"789":{"position":[[4919,18]]},"795":{"position":[[13699,18]]},"797":{"position":[[12574,18],[20872,18]]},"799":{"position":[[3125,18],[10592,18],[17519,18]]},"801":{"position":[[6903,18]]},"820":{"position":[[3627,18],[15043,18]]},"822":{"position":[[4227,18]]},"824":{"position":[[3939,18]]},"826":{"position":[[4985,18]]},"844":{"position":[[3924,18],[15635,18],[33723,18]]},"848":{"position":[[8918,18],[16438,18],[22925,18],[29674,18],[36101,18],[41971,18]]}}}],["clienttuplekey(user=\"user:ann",{"_index":2371,"t":{"705":{"position":[[8612,32],[11286,32]]},"799":{"position":[[13499,32],[13589,32],[20428,32],[20518,32]]}}}],["clienttuplekey(user=\"user:bob",{"_index":2182,"t":{"618":{"position":[[5034,31]]}}}],["clientwriteopt",{"_index":1292,"t":{"200":{"position":[[1745,19]]},"250":{"position":[[268,19]]},"252":{"position":[[424,19]]},"267":{"position":[[1761,19]]},"285":{"position":[[8735,19]]},"294":{"position":[[2006,19]]},"311":{"position":[[1843,19],[7425,19],[13408,19]]},"375":{"position":[[2072,19]]},"402":{"position":[[1819,19]]},"422":{"position":[[1409,19]]},"444":{"position":[[2041,19]]},"446":{"position":[[2053,19]]},"504":{"position":[[1780,19]]},"506":{"position":[[1862,19]]},"522":{"position":[[2018,19]]},"540":{"position":[[1791,19]]},"542":{"position":[[2201,19]]},"562":{"position":[[2151,19]]},"574":{"position":[[1921,19]]},"578":{"position":[[1924,19]]},"580":{"position":[[1887,19]]},"584":{"position":[[1762,19]]},"637":{"position":[[2136,19]]},"645":{"position":[[1960,19]]},"649":{"position":[[1816,19]]},"681":{"position":[[1886,19]]},"683":{"position":[[8163,19],[14426,19]]},"695":{"position":[[4184,19]]},"703":{"position":[[6464,19]]},"705":{"position":[[2883,19]]},"707":{"position":[[3723,19]]},"726":{"position":[[2694,19],[13552,19],[21619,19]]},"745":{"position":[[3483,19],[14857,19]]},"747":{"position":[[4241,19]]},"749":{"position":[[1981,19],[8254,19]]},"751":{"position":[[4738,19],[18994,19]]},"771":{"position":[[2168,19],[7820,19],[13647,19]]},"773":{"position":[[4786,19]]},"775":{"position":[[4579,19],[11299,19]]},"777":{"position":[[4836,19]]},"789":{"position":[[4779,19]]},"795":{"position":[[13559,19]]},"797":{"position":[[12434,19],[20732,19]]},"799":{"position":[[2984,19]]},"801":{"position":[[6763,19]]},"820":{"position":[[3487,19],[14903,19]]},"822":{"position":[[4087,19]]},"824":{"position":[[3799,19]]},"826":{"position":[[4845,19]]},"844":{"position":[[3784,19],[15495,19],[33583,19]]},"848":{"position":[[8778,19],[16298,19],[22785,19],[29534,19],[35961,19],[41831,19]]}}}],["clientwriterequest",{"_index":1299,"t":{"200":{"position":[[3334,20],[4517,19]]},"250":{"position":[[804,20],[1081,19]]},"252":{"position":[[961,20],[1239,19]]},"267":{"position":[[3345,20],[4523,19]]},"285":{"position":[[10361,20],[11581,19]]},"294":{"position":[[3594,20],[4776,19]]},"311":{"position":[[3423,20],[4597,19],[9006,20],[10181,19],[15233,20],[16614,19]]},"375":{"position":[[3720,20],[4962,19]]},"402":{"position":[[3420,20],[4615,19]]},"422":{"position":[[1962,20],[2256,19]]},"444":{"position":[[3854,20],[5212,19]]},"446":{"position":[[3976,20],[5444,19]]},"504":{"position":[[3367,20],[4548,19]]},"506":{"position":[[3529,20],[4790,19]]},"522":{"position":[[3657,20],[4890,19]]},"540":{"position":[[3380,20],[4563,19]]},"542":{"position":[[3867,20],[5127,19]]},"562":{"position":[[3934,20],[5262,19]]},"574":{"position":[[3620,20],[4864,19]]},"578":{"position":[[3619,20],[4859,19]]},"580":{"position":[[3475,20],[4657,19]]},"584":{"position":[[3342,20],[4516,19]]},"637":{"position":[[3841,20],[5140,19]]},"645":{"position":[[3823,20],[5231,19]]},"649":{"position":[[3476,20],[4730,19]]},"681":{"position":[[3526,20],[4760,19]]},"683":{"position":[[9887,20],[11156,19],[16151,20],[17421,19]]},"695":{"position":[[5882,20],[7027,19]]},"703":{"position":[[8121,20],[9372,19]]},"705":{"position":[[4568,20],[5847,19]]},"707":{"position":[[5421,20],[6566,19]]},"726":{"position":[[5423,20],[7501,19],[15644,20],[17232,19],[23641,20],[25159,19]]},"745":{"position":[[5079,20],[6269,19],[16453,20],[17643,19]]},"747":{"position":[[6125,20],[7554,19]]},"749":{"position":[[3601,20],[4815,19],[9906,20],[11152,19]]},"751":{"position":[[6477,20],[7761,19],[20612,20],[21824,19]]},"771":{"position":[[3763,20],[4952,19],[9419,20],[10612,19],[15507,20],[16863,19]]},"773":{"position":[[6758,20],[8177,19]]},"775":{"position":[[6321,20],[7608,19],[13354,20],[14856,19]]},"777":{"position":[[6699,20],[8058,19]]},"789":{"position":[[7071,20],[8810,19]]},"795":{"position":[[15214,20],[16463,19]]},"797":{"position":[[14575,20],[16212,19],[22569,20],[23951,19]]},"799":{"position":[[4876,20],[6313,19]]},"801":{"position":[[10783,20],[13858,19]]},"820":{"position":[[5086,20],[6279,19],[16498,20],[17687,19]]},"822":{"position":[[6180,20],[7720,19]]},"824":{"position":[[5653,20],[7052,19]]},"826":{"position":[[6931,20],[8513,19]]},"844":{"position":[[5438,20],[6686,19],[17149,20],[18397,19],[35605,20],[37123,19]]},"848":{"position":[[10715,20],[12148,19],[18021,20],[19338,19],[24611,20],[25982,19],[31275,20],[32561,19],[37586,20],[38805,19],[43439,20],[44641,19]]}}}],["close",{"_index":616,"t":{"45":{"position":[[3045,7]]},"81":{"position":[[476,7]]},"97":{"position":[[44,7]]},"153":{"position":[[1484,6]]},"183":{"position":[[3021,5]]},"185":{"position":[[4150,5]]},"187":{"position":[[4711,5]]},"728":{"position":[[22136,6]]}}}],["closer",{"_index":792,"t":{"85":{"position":[[1038,6]]}}}],["cloud",{"_index":531,"t":{"39":{"position":[[401,5]]}}}],["cmd",{"_index":1364,"t":{"212":{"position":[[1815,4],[4450,7]]}}}],["cncf",{"_index":547,"t":{"39":{"position":[[730,4]]}}}],["code",{"_index":179,"t":{"7":{"position":[[377,4]]},"9":{"position":[[125,4],[284,4]]},"39":{"position":[[645,4]]},"45":{"position":[[784,4],[1582,4],[18191,5],[24539,5]]},"113":{"position":[[320,5],[1249,5]]},"212":{"position":[[1532,4],[4179,4]]},"418":{"position":[[1668,4]]},"424":{"position":[[1033,4],[1164,4]]},"548":{"position":[[1671,4]]},"728":{"position":[[23245,4]]},"738":{"position":[[49,5]]}}}],["codifi",{"_index":1906,"t":{"472":{"position":[[1269,6]]},"474":{"position":[[41,9]]}}}],["collabor",{"_index":1969,"t":{"482":{"position":[[3148,11]]},"738":{"position":[[34,11]]},"813":{"position":[[46,11]]}}}],["collect",{"_index":1478,"t":{"224":{"position":[[26,9],[228,7]]},"226":{"position":[[20,9]]},"228":{"position":[[22,9]]},"380":{"position":[[30,10]]},"616":{"position":[[273,12]]}}}],["collector",{"_index":1481,"t":{"224":{"position":[[315,10]]}}}],["combin",{"_index":609,"t":{"45":{"position":[[1480,11],[4196,11],[4595,11]]},"51":{"position":[[28,11]]},"482":{"position":[[9908,9]]},"490":{"position":[[306,8]]},"728":{"position":[[47953,12]]},"797":{"position":[[1088,7],[2406,7]]}}}],["come",{"_index":1875,"t":{"448":{"position":[[5700,4]]},"749":{"position":[[6287,4]]},"826":{"position":[[425,4]]}}}],["command",{"_index":956,"t":{"113":{"position":[[1763,7]]},"121":{"position":[[14,7]]},"153":{"position":[[290,8]]},"212":{"position":[[1016,7],[2003,8],[2474,8],[3703,7],[4674,8],[5105,8]]},"214":{"position":[[1410,8],[2930,7]]},"238":{"position":[[146,8]]}}}],["comment",{"_index":608,"t":{"45":{"position":[[901,10],[1025,12],[1205,12],[1736,10],[2008,12],[2232,12],[6711,10],[6869,12],[7049,12],[7367,10]]},"359":{"position":[[142,10]]},"478":{"position":[[4498,7]]},"564":{"position":[[257,10]]},"807":{"position":[[541,10],[831,10]]},"815":{"position":[[188,10]]},"817":{"position":[[267,10],[498,7]]},"820":{"position":[[126,10],[477,10],[674,12],[897,12],[1747,9],[2556,12],[5186,12],[7267,9],[7477,9],[8287,12],[9384,12],[10761,12],[12306,9],[12991,12],[13014,11],[30512,10],[30565,9],[30810,12],[31003,11],[31194,12],[31630,11]]},"822":{"position":[[88,9],[547,10],[630,9],[919,12],[1112,11],[1391,12]]},"824":{"position":[[647,10],[730,9],[1001,12],[1194,11],[1546,12],[15102,9],[15256,11],[15721,13],[15785,11],[16661,10],[16707,9],[16769,9],[17353,12],[17510,11],[17658,11],[18145,12]]},"826":{"position":[[243,9],[735,10],[781,9],[851,9],[1435,12],[1592,11],[1740,11],[2227,12],[2717,10],[3681,7],[3760,12],[5232,7],[7169,7],[7256,12],[8730,7],[10196,9],[10539,7],[16648,7],[23133,12],[24238,12],[25623,12],[27184,9],[27885,12],[27908,11]]}}}],["common",{"_index":1663,"t":{"335":{"position":[[245,6]]},"482":{"position":[[1513,7],[7506,6]]}}}],["commonli",{"_index":1687,"t":{"361":{"position":[[590,8]]}}}],["commun",{"_index":550,"t":{"39":{"position":[[798,9]]},"212":{"position":[[606,13]]},"626":{"position":[[448,11]]},"830":{"position":[[54,13]]},"836":{"position":[[187,12]]},"850":{"position":[[110,13],[307,13]]}}}],["compani",{"_index":315,"t":{"19":{"position":[[603,7]]},"45":{"position":[[6429,7]]},"191":{"position":[[228,7],[353,7],[532,10],[843,10]]},"198":{"position":[[44,7],[214,7]]},"283":{"position":[[158,7]]},"440":{"position":[[383,7]]},"522":{"position":[[6830,7]]},"695":{"position":[[235,9],[278,9],[576,9]]},"783":{"position":[[488,7]]}}}],["company#employe",{"_index":1288,"t":{"191":{"position":[[434,18]]}}}],["company'",{"_index":1566,"t":{"283":{"position":[[202,9],[277,9]]}}}],["company:xyz",{"_index":1290,"t":{"200":{"position":[[62,12],[844,15],[3455,13],[5494,11]]},"202":{"position":[[5825,12]]},"380":{"position":[[593,11]]}}}],["company:xyz#employe",{"_index":1289,"t":{"198":{"position":[[259,23]]},"380":{"position":[[531,20]]}}}],["compar",{"_index":1383,"t":{"212":{"position":[[3092,8]]}}}],["compat",{"_index":1475,"t":{"222":{"position":[[1125,13]]},"679":{"position":[[57,10],[89,10]]},"681":{"position":[[30,10]]}}}],["compil",{"_index":767,"t":{"81":{"position":[[590,8]]},"113":{"position":[[1857,8]]},"123":{"position":[[17,8]]}}}],["complet",{"_index":631,"t":{"45":{"position":[[3824,10]]},"317":{"position":[[469,10]]},"478":{"position":[[1958,8]]},"482":{"position":[[2753,8],[2783,8],[9385,8],[9415,8]]},"486":{"position":[[161,8]]},"728":{"position":[[19797,9],[23118,11]]}}}],["complex",{"_index":1618,"t":{"317":{"position":[[95,7]]},"476":{"position":[[250,7]]},"779":{"position":[[209,7]]},"820":{"position":[[76,10]]},"844":{"position":[[61,11]]}}}],["compon",{"_index":1933,"t":{"480":{"position":[[88,9]]}}}],["compos",{"_index":749,"t":{"45":{"position":[[31018,8]]},"212":{"position":[[462,7],[2735,7],[3311,7],[5366,7]]}}}],["compose.yaml",{"_index":1359,"t":{"212":{"position":[[1575,12],[4222,12]]},"224":{"position":[[186,12]]}}}],["compris",{"_index":1691,"t":{"363":{"position":[[409,10]]}}}],["comput",{"_index":697,"t":{"45":{"position":[[10098,9]]},"69":{"position":[[272,9]]},"384":{"position":[[1121,11]]},"613":{"position":[[6011,12]]},"705":{"position":[[421,7]]},"728":{"position":[[22707,9]]},"730":{"position":[[514,8]]}}}],["computed_userset",{"_index":852,"t":{"97":{"position":[[521,16],[645,16],[746,16]]}}}],["computeduserset",{"_index":704,"t":{"45":{"position":[[11535,18]]},"83":{"position":[[1094,18],[1285,18],[1438,18],[1580,18],[1701,18],[1842,18],[2416,18],[2607,18],[2760,18],[2902,18],[3023,18],[3164,18]]},"87":{"position":[[341,18],[410,18]]},"89":{"position":[[967,18],[1705,18]]},"91":{"position":[[338,18]]},"93":{"position":[[357,18],[415,18]]},"95":{"position":[[443,18]]},"97":{"position":[[1217,18],[1321,18],[1428,18],[2027,18],[2134,18]]},"355":{"position":[[438,18]]},"373":{"position":[[673,18]]},"384":{"position":[[365,18]]},"412":{"position":[[2246,18],[2619,18],[2754,18]]},"416":{"position":[[2057,18],[2473,18],[2608,18]]},"430":{"position":[[769,18]]},"442":{"position":[[623,18]]},"454":{"position":[[1050,18]]},"464":{"position":[[581,18],[689,18],[823,18]]},"502":{"position":[[695,18]]},"560":{"position":[[1080,18],[1170,18],[1219,18]]},"576":{"position":[[466,18]]},"590":{"position":[[652,18]]},"643":{"position":[[542,18]]},"663":{"position":[[593,18]]},"667":{"position":[[404,18]]},"669":{"position":[[394,18]]},"677":{"position":[[486,18],[1211,18]]},"679":{"position":[[583,18],[651,18],[726,18]]},"685":{"position":[[350,18]]},"695":{"position":[[1934,18],[2113,18],[2259,18],[2332,18],[2416,18],[2492,18],[2567,18]]},"703":{"position":[[1478,18],[1619,18],[1746,18],[1822,18]]},"707":{"position":[[838,18],[979,18],[1106,18],[1182,18],[1809,18],[1917,18],[2052,18],[2198,18],[2291,18],[2367,18],[2442,18]]},"728":{"position":[[20119,18],[21116,18],[23840,18],[31617,18],[32015,18],[39245,18],[39769,18],[41070,18],[41393,18]]},"745":{"position":[[30721,18],[30828,18],[30933,18],[31046,18],[31708,18]]},"747":{"position":[[1208,18],[1315,18],[1420,18],[1533,18]]},"751":{"position":[[1715,18],[1822,18],[1927,18],[2040,18],[15912,18],[23878,18],[24025,18],[24129,18],[24202,18],[24347,18],[24452,18],[24522,18]]},"773":{"position":[[1632,18],[1683,18],[1811,18],[1862,18],[1983,18]]},"775":{"position":[[1421,18],[1472,18],[1600,18],[1651,18],[1772,18]]},"777":{"position":[[1231,18],[1282,18],[1394,18],[1445,18],[1550,18]]},"789":{"position":[[1300,18],[1436,18],[1501,18],[1591,18],[1985,18]]},"797":{"position":[[1823,18],[1977,18],[3230,18],[3389,18],[3533,18],[3648,18],[3713,18],[3810,18]]},"801":{"position":[[1157,18],[1311,18],[1832,18],[1991,18],[2135,18],[2250,18],[2315,18],[2412,18],[2806,18]]},"803":{"position":[[1557,18],[1711,18],[2299,18],[2458,18],[2602,18],[2717,18],[2782,18],[2879,18],[3273,18]]},"820":{"position":[[30758,18],[30865,18],[30970,18]]},"822":{"position":[[867,18],[974,18],[1079,18]]},"824":{"position":[[949,18],[1056,18],[1161,18],[15223,18],[15333,18],[17048,18],[17192,18],[17260,18],[17408,18],[17477,18],[17625,18],[17697,18]]},"826":{"position":[[1130,18],[1274,18],[1342,18],[1490,18],[1559,18],[1707,18],[1779,18]]},"846":{"position":[[6760,18],[6871,18],[6928,18]]},"848":{"position":[[3504,18],[5170,18],[5281,18],[5338,18],[5898,18]]}}}],["concentr",{"_index":807,"t":{"87":{"position":[[2157,10]]},"91":{"position":[[1546,10]]},"343":{"position":[[130,10]]},"345":{"position":[[53,10],[184,10]]},"355":{"position":[[61,10]]},"359":{"position":[[45,10]]},"386":{"position":[[519,10]]},"564":{"position":[[100,10],[156,10]]},"732":{"position":[[439,10],[569,10]]},"734":{"position":[[270,10]]},"745":{"position":[[30288,12]]},"757":{"position":[[421,10]]},"773":{"position":[[522,10]]},"807":{"position":[[329,10],[459,10]]},"809":{"position":[[270,10]]},"820":{"position":[[30328,12]]},"830":{"position":[[333,10],[556,10]]},"832":{"position":[[421,10]]},"846":{"position":[[6132,10]]}}}],["concept",{"_index":19,"t":{"3":{"position":[[252,8]]},"15":{"position":[[82,7]]},"27":{"position":[[147,8]]},"45":{"position":[[343,9],[3130,9]]},"79":{"position":[[97,8],[130,8]]},"81":{"position":[[1006,8]]},"99":{"position":[[114,8],[147,9]]},"191":{"position":[[83,8],[1068,9]]},"258":{"position":[[83,8],[787,9]]},"285":{"position":[[83,8],[24499,9]]},"302":{"position":[[83,8],[1389,9]]},"331":{"position":[[25,8]]},"347":{"position":[[74,8],[1200,9]]},"363":{"position":[[73,8],[1698,9]]},"396":{"position":[[83,8],[779,9]]},"406":{"position":[[76,8],[109,9]]},"430":{"position":[[73,8],[1383,8],[1426,8]]},"438":{"position":[[8,8]]},"450":{"position":[[196,9]]},"454":{"position":[[83,8],[2686,9]]},"488":{"position":[[76,8],[109,9]]},"492":{"position":[[83,8],[1071,9]]},"500":{"position":[[249,9]]},"510":{"position":[[93,9]]},"514":{"position":[[83,8],[841,9],[1479,7]]},"518":{"position":[[628,7]]},"530":{"position":[[83,8],[818,9]]},"536":{"position":[[285,7]]},"550":{"position":[[83,8],[930,9]]},"564":{"position":[[90,9]]},"568":{"position":[[83,8],[771,9]]},"590":{"position":[[83,8],[1242,9]]},"628":{"position":[[73,8],[1015,9]]},"655":{"position":[[74,8],[191,8],[359,9]]},"675":{"position":[[63,9]]},"691":{"position":[[63,9]]},"705":{"position":[[490,7]]},"713":{"position":[[83,8],[160,9],[223,8],[1018,8],[1066,8]]},"715":{"position":[[53,8]]},"717":{"position":[[370,7]]},"730":{"position":[[716,8]]},"732":{"position":[[559,9]]},"734":{"position":[[83,8],[160,9],[223,8],[758,8],[806,8]]},"736":{"position":[[53,8]]},"747":{"position":[[9478,8]]},"757":{"position":[[83,8],[160,9],[223,8],[1269,8],[1317,8]]},"759":{"position":[[53,8]]},"779":{"position":[[134,8]]},"785":{"position":[[63,9]]},"799":{"position":[[8098,7]]},"807":{"position":[[449,9]]},"809":{"position":[[83,8],[160,9],[223,8],[860,8],[907,8]]},"811":{"position":[[53,8]]},"822":{"position":[[10146,8]]},"832":{"position":[[83,8],[160,9],[223,8],[581,8],[629,8]]},"834":{"position":[[53,8]]},"850":{"position":[[56,9],[405,8]]}}}],["concepts/build",{"_index":1659,"t":{"333":{"position":[[1357,17]]}}}],["conceptu",{"_index":49,"t":{"3":{"position":[[750,14]]},"416":{"position":[[948,12]]}}}],["concern",{"_index":2898,"t":{"848":{"position":[[135,10]]}}}],["concis",{"_index":2801,"t":{"803":{"position":[[28,8]]}}}],["concret",{"_index":821,"t":{"89":{"position":[[3098,8]]},"422":{"position":[[374,8]]},"508":{"position":[[6556,8]]}}}],["concurr",{"_index":976,"t":{"151":{"position":[[258,11]]},"155":{"position":[[22,11],[364,11],[514,11],[567,10],[686,10],[2624,10],[2771,10]]}}}],["condit",{"_index":74,"t":{"3":{"position":[[1074,11],[1144,10],[1287,11],[1583,9],[1787,9],[2318,9],[2660,9]]},"5":{"position":[[460,11]]},"7":{"position":[[0,11],[330,11],[455,11],[632,11]]},"9":{"position":[[95,11],[179,11],[629,9]]},"39":{"position":[[661,11]]},"45":{"position":[[5622,10]]},"61":{"position":[[32,10]]},"81":{"position":[[297,10]]},"91":{"position":[[608,10]]},"93":{"position":[[685,10]]},"212":{"position":[[1922,10],[2211,10],[4593,10],[4862,10]]},"452":{"position":[[228,10]]},"476":{"position":[[1276,12]]},"478":{"position":[[291,12],[2046,10]]},"730":{"position":[[423,9]]},"732":{"position":[[721,9]]},"807":{"position":[[590,9]]},"830":{"position":[[621,9]]}}}],["confid",{"_index":897,"t":{"109":{"position":[[521,9]]}}}],["config",{"_index":1033,"t":{"155":{"position":[[554,6]]},"185":{"position":[[1100,7],[1925,7],[3003,6]]},"187":{"position":[[985,7],[1959,7],[3175,6]]},"210":{"position":[[581,6]]},"222":{"position":[[138,7]]}}}],["config.yaml",{"_index":1327,"t":{"210":{"position":[[44,11],[66,11]]},"214":{"position":[[623,11],[2057,11]]}}}],["configur",{"_index":355,"t":{"29":{"position":[[295,9],[354,9],[401,9]]},"31":{"position":[[29,9]]},"35":{"position":[[24,9],[628,9],[3972,13],[5472,13]]},"37":{"position":[[69,9]]},"43":{"position":[[1500,13],[2441,13]]},"45":{"position":[[674,13],[3347,13],[7299,13],[14660,13],[15786,13],[20854,13],[21980,13],[27283,13],[28451,13]]},"49":{"position":[[23,13]]},"81":{"position":[[14,13],[409,13]]},"83":{"position":[[116,13]]},"99":{"position":[[56,13]]},"105":{"position":[[252,13]]},"111":{"position":[[59,13],[106,13]]},"113":{"position":[[417,14]]},"129":{"position":[[211,10],[534,10],[857,10],[1180,10],[1475,10],[1736,10]]},"133":{"position":[[47,9],[1661,13],[2408,13]]},"141":{"position":[[211,10],[534,10],[857,10],[1180,10],[1475,10],[1736,10]]},"145":{"position":[[47,9],[1661,13],[2408,13]]},"151":{"position":[[112,9]]},"165":{"position":[[198,10],[562,10]]},"173":{"position":[[1107,9]]},"183":{"position":[[1586,13],[2335,13]]},"185":{"position":[[2314,13],[3437,13]]},"187":{"position":[[2477,13],[3998,13]]},"200":{"position":[[2556,13],[3706,13]]},"202":{"position":[[2495,13],[3618,13],[8243,13],[9368,13]]},"206":{"position":[[84,9]]},"208":{"position":[[324,13]]},"210":{"position":[[8,9],[214,13],[270,13],[526,14],[667,14],[720,13]]},"212":{"position":[[2808,9],[5436,9]]},"214":{"position":[[8,9],[227,9],[374,9],[525,9],[564,13],[796,9],[885,9],[988,14],[1040,9],[1143,9],[1240,9],[1718,9],[1959,9],[1998,13],[2245,9],[2329,9],[2409,9],[2513,14],[2565,9],[2668,9],[2765,9]]},"216":{"position":[[403,11]]},"220":{"position":[[11,10]]},"230":{"position":[[60,10]]},"244":{"position":[[211,10],[498,10],[785,10],[1072,10],[1331,10],[1592,10]]},"248":{"position":[[47,9],[1661,13],[2408,13]]},"265":{"position":[[2775,13],[3888,13]]},"267":{"position":[[2567,13],[3712,13],[8192,13],[9306,13]]},"273":{"position":[[207,10],[529,10],[851,10],[1138,10],[1397,10]]},"277":{"position":[[23,9],[1633,13],[2380,13]]},"285":{"position":[[3792,13],[4911,13],[9583,13],[10770,13],[15462,13],[16585,13],[21068,13],[22193,13]]},"294":{"position":[[2816,13],[3965,13]]},"296":{"position":[[2540,13],[3664,13]]},"311":{"position":[[2645,13],[3786,13],[8228,13],[9370,13],[14455,13],[15803,13]]},"357":{"position":[[2684,13],[3815,13]]},"369":{"position":[[2636,13],[3760,13],[8244,13],[9367,13]]},"375":{"position":[[2942,13],[4151,13],[8931,13],[10055,13],[14745,13],[15869,13]]},"377":{"position":[[145,13],[188,13]]},"382":{"position":[[3609,13],[4730,13]]},"402":{"position":[[2642,13],[3804,13]]},"404":{"position":[[2584,13],[3715,13],[8423,13],[9555,13]]},"406":{"position":[[201,13],[244,13]]},"430":{"position":[[1394,13],[1435,13]]},"438":{"position":[[17,13]]},"444":{"position":[[3076,13],[4401,13],[9376,13],[10502,13]]},"446":{"position":[[3198,13],[4633,13]]},"448":{"position":[[2470,13],[3596,13]]},"462":{"position":[[2642,13],[3769,13],[8274,13],[9400,13]]},"466":{"position":[[2604,13],[3732,13],[8403,13],[9531,13]]},"478":{"position":[[4080,13]]},"480":{"position":[[2782,13]]},"482":{"position":[[24,13],[7276,13],[8457,13],[8935,13],[9306,13]]},"488":{"position":[[124,13],[167,13]]},"490":{"position":[[322,10]]},"504":{"position":[[2589,13],[3737,13]]},"506":{"position":[[2751,13],[3979,13]]},"508":{"position":[[135,13],[2657,13],[3788,13]]},"522":{"position":[[2879,13],[4079,13]]},"524":{"position":[[2781,13],[3908,13]]},"526":{"position":[[145,13],[188,13]]},"540":{"position":[[2602,13],[3752,13]]},"542":{"position":[[3089,13],[4316,13]]},"544":{"position":[[2721,13],[3854,13]]},"562":{"position":[[3156,13],[4451,13],[9306,13],[10430,13],[15301,13],[16425,13],[20991,13],[22117,13],[26615,13],[27740,13]]},"574":{"position":[[2842,13],[4053,13]]},"578":{"position":[[2841,13],[4048,13]]},"580":{"position":[[2697,13],[3846,13]]},"582":{"position":[[2452,13],[3564,13],[7966,13],[9078,13]]},"584":{"position":[[2564,13],[3705,13],[8028,13],[9141,13]]},"599":{"position":[[2631,13],[3753,13]]},"606":{"position":[[3023,13],[4198,13],[9121,13],[10275,13],[15122,13],[16286,13]]},"608":{"position":[[2990,13],[4047,13]]},"613":{"position":[[2727,13],[3911,13],[8639,13],[9823,13]]},"618":{"position":[[2842,13],[4131,13]]},"620":{"position":[[138,10],[193,11],[255,14]]},"637":{"position":[[3063,13],[4329,13]]},"639":{"position":[[2597,13],[3731,13],[6186,13]]},"645":{"position":[[3045,13],[4420,13]]},"647":{"position":[[2510,13],[3636,13]]},"649":{"position":[[2698,13],[3919,13],[8551,13],[9678,13],[14190,13],[15320,13]]},"667":{"position":[[3764,13],[4887,13],[9936,13],[11059,13],[16763,13],[17889,13],[23594,13],[24717,13],[29832,13],[30956,13]]},"669":{"position":[[3739,13],[4863,13],[9994,13],[11121,13],[16334,13],[17459,13],[22657,13],[23782,13]]},"679":{"position":[[3455,13],[4580,13],[9071,13],[10195,13]]},"681":{"position":[[2748,13],[3949,13],[8469,13],[9597,13]]},"683":{"position":[[2766,13],[4003,13],[9109,13],[10345,13],[15373,13],[16610,13],[21395,13],[22520,13],[27054,13],[28177,13]]},"703":{"position":[[133,13],[7343,13],[8561,13]]},"705":{"position":[[3790,13],[5036,13]]},"713":{"position":[[1029,13],[1075,13]]},"726":{"position":[[4645,13],[6690,13],[14866,13],[16421,13],[22863,13],[24348,13],[30645,13],[31769,13],[36406,13],[37531,13],[42029,13],[43157,13],[47673,13],[48802,13]]},"728":{"position":[[170,13],[2689,13],[3814,13],[6050,13],[6509,13],[7119,13],[10600,13],[11721,13],[13902,13],[16535,13],[17665,13],[26951,13],[28080,13],[35181,13],[36301,13],[38518,10],[41765,13],[44716,13],[45836,13]]},"734":{"position":[[769,13],[815,13]]},"745":{"position":[[4301,13],[5458,13],[9906,13],[11032,13],[15675,13],[16832,13],[21237,13],[22363,13],[26865,13],[27992,13],[34597,13],[35723,13],[40223,13],[41349,13]]},"747":{"position":[[5347,13],[6743,13],[12069,13],[13197,13]]},"749":{"position":[[2823,13],[4004,13],[9128,13],[10341,13],[14828,13],[15954,13]]},"751":{"position":[[281,10],[5699,13],[6950,13],[9704,10],[12285,13],[13415,13],[19834,13],[21013,13]]},"757":{"position":[[1280,13],[1326,13]]},"771":{"position":[[2985,13],[4141,13],[8641,13],[9801,13],[14729,13],[16052,13],[21472,13],[22597,13],[27167,13],[28290,13]]},"773":{"position":[[478,14],[5980,13],[7366,13],[12806,13],[13934,13]]},"775":{"position":[[5543,13],[6797,13],[12576,13],[14045,13],[19978,13],[21100,13]]},"777":{"position":[[5921,13],[7247,13],[10256,14],[12680,13],[13807,13]]},"789":{"position":[[6293,13],[7999,13]]},"795":{"position":[[2816,13],[3937,13],[8512,13],[9637,13],[14436,13],[15652,13],[20141,13],[21263,13]]},"797":{"position":[[6923,13],[8040,13],[13797,13],[15401,13],[21791,13],[23140,13],[28218,13],[29339,13]]},"799":{"position":[[4098,13],[5502,13],[11270,13],[12592,13],[18198,13],[19521,13]]},"801":{"position":[[10005,13],[13047,13]]},"809":{"position":[[871,13],[916,13]]},"820":{"position":[[4308,13],[5468,13],[9937,13],[11066,13],[15720,13],[16876,13],[21275,13],[22400,13],[26897,13],[28024,13],[34115,13],[35240,13],[39735,13],[40861,13]]},"822":{"position":[[5402,13],[6909,13],[12745,13],[13874,13]]},"824":{"position":[[1837,13],[4875,13],[6241,13],[11664,13],[12796,13]]},"826":{"position":[[6153,13],[7702,13],[13336,13],[14469,13],[19098,13],[20233,13],[24799,13],[25936,13],[30587,13],[31722,13],[36284,13],[37419,13]]},"832":{"position":[[592,13],[638,13]]},"844":{"position":[[4660,13],[5875,13],[10452,13],[11583,13],[16371,13],[17586,13],[22120,13],[23251,13],[27877,13],[29015,13],[34827,13],[36312,13],[41824,13],[42955,13]]},"846":{"position":[[2526,13],[3652,13],[9806,13],[10931,13]]},"848":{"position":[[1613,13],[2710,13],[9937,13],[11337,13],[17243,13],[18527,13],[21669,13],[22960,13],[23833,13],[24686,13],[25171,13],[26037,13],[27367,13],[30497,13],[31750,13],[36808,13],[37994,13],[42661,13],[43830,13],[45952,13],[48453,13],[49576,13],[54154,13],[55292,13]]},"852":{"position":[[172,13],[331,14]]}}}],["configuration=credentialconfigur",{"_index":1266,"t":{"187":{"position":[[3757,38]]}}}],["configuration=credentialconfiguration(api_token=os.environ.get(fga_api_token",{"_index":1242,"t":{"185":{"position":[[3357,79]]}}}],["confirm",{"_index":2092,"t":{"562":{"position":[[12803,7]]},"683":{"position":[[18927,7]]},"761":{"position":[[332,12]]},"777":{"position":[[10083,8]]},"842":{"position":[[154,12]]}}}],["connect",{"_index":960,"t":{"125":{"position":[[171,7],[240,7],[322,7]]},"153":{"position":[[422,10],[483,11],[529,11],[643,10],[765,12],[1254,11],[1370,11],[1466,11],[1581,12],[1602,11],[1763,11]]},"167":{"position":[[256,7]]},"212":{"position":[[387,10]]},"228":{"position":[[546,11]]},"689":{"position":[[439,9]]},"705":{"position":[[225,9],[7166,10],[9836,10]]},"783":{"position":[[471,9]]},"789":{"position":[[342,9],[414,9]]},"791":{"position":[[156,10],[199,9],[278,10],[305,9]]},"797":{"position":[[4433,10],[19602,10],[19749,10],[20904,10],[21110,10],[22641,10],[22798,10],[24003,10],[24159,10],[25359,10],[25510,10]]},"799":{"position":[[323,7],[400,9],[982,10],[1047,10],[1827,10],[2001,10],[3184,10],[3417,10],[4976,10],[5160,10],[6394,10],[6577,10],[7731,10],[7909,10],[8420,10],[15348,10]]},"836":{"position":[[45,8]]}}}],["consid",{"_index":12,"t":{"3":{"position":[[143,10],[1238,8]]},"9":{"position":[[86,8],[435,8]]},"109":{"position":[[149,8]]},"153":{"position":[[1534,8],[1650,8]]},"155":{"position":[[342,8],[1338,8],[1544,8],[1713,8],[1959,8]]},"222":{"position":[[1102,10]]},"327":{"position":[[283,8]]},"418":{"position":[[2483,10]]},"420":{"position":[[444,8]]},"508":{"position":[[6547,8]]},"667":{"position":[[13487,10],[20293,10],[26921,10]]},"695":{"position":[[45,8],[78,8],[2829,11]]},"703":{"position":[[665,11]]},"751":{"position":[[9413,10],[9771,8]]},"789":{"position":[[45,8],[78,8],[2168,11]]},"824":{"position":[[9150,8]]},"848":{"position":[[1346,8]]}}}],["consider",{"_index":598,"t":{"45":{"position":[[142,13]]},"699":{"position":[[252,14]]},"703":{"position":[[2610,14]]},"793":{"position":[[374,13]]},"797":{"position":[[4337,14]]}}}],["consist",{"_index":333,"t":{"25":{"position":[[22,11]]},"45":{"position":[[8786,10],[8868,8]]},"65":{"position":[[32,10]]},"105":{"position":[[418,10]]},"191":{"position":[[1592,10]]},"195":{"position":[[514,10]]},"238":{"position":[[371,10]]},"258":{"position":[[1311,10]]},"262":{"position":[[514,10]]},"285":{"position":[[25023,10]]},"291":{"position":[[514,10]]},"300":{"position":[[178,11]]},"302":{"position":[[1913,10]]},"308":{"position":[[514,10]]},"313":{"position":[[96,12]]},"347":{"position":[[1724,10]]},"351":{"position":[[514,10]]},"363":{"position":[[2222,10]]},"367":{"position":[[514,10]]},"396":{"position":[[1303,10]]},"398":{"position":[[514,10]]},"408":{"position":[[1214,10]]},"454":{"position":[[3210,10]]},"460":{"position":[[514,10]]},"492":{"position":[[1595,10]]},"496":{"position":[[514,10]]},"514":{"position":[[1365,10]]},"518":{"position":[[514,10]]},"530":{"position":[[1342,10]]},"534":{"position":[[514,10]]},"550":{"position":[[1454,10]]},"554":{"position":[[514,10]]},"568":{"position":[[1295,10]]},"572":{"position":[[514,10]]},"590":{"position":[[1766,10]]},"594":{"position":[[514,10]]},"628":{"position":[[1539,10]]},"632":{"position":[[514,10]]},"655":{"position":[[883,10]]},"659":{"position":[[514,10]]},"675":{"position":[[587,10]]},"693":{"position":[[374,10]]},"787":{"position":[[375,10]]}}}],["consol",{"_index":928,"t":{"113":{"position":[[960,7]]}}}],["consolid",{"_index":2071,"t":{"548":{"position":[[1314,11]]}}}],["const",{"_index":395,"t":{"35":{"position":[[850,5],[985,5],[1373,5]]},"43":{"position":[[32,5],[135,5],[386,5]]},"45":{"position":[[12405,5],[12540,5],[12943,5],[18599,5],[18734,5],[19137,5],[24953,5],[25088,5],[25476,5]]},"109":{"position":[[1018,5]]},"133":{"position":[[123,5],[258,5]]},"135":{"position":[[126,5]]},"145":{"position":[[123,5],[258,5]]},"147":{"position":[[106,5]]},"169":{"position":[[593,5],[791,5]]},"171":{"position":[[246,5],[1155,5],[1209,5],[1264,5],[1390,5]]},"173":{"position":[[217,5],[840,5],[878,5],[1140,5],[1350,5],[2011,5],[2065,5],[2120,5],[2168,5],[2210,5],[2378,5]]},"183":{"position":[[96,5],[199,5]]},"185":{"position":[[406,5],[547,5]]},"187":{"position":[[282,5],[423,5]]},"200":{"position":[[236,5],[371,5]]},"202":{"position":[[246,5],[381,5],[784,5],[5990,5],[6125,5],[6528,5]]},"248":{"position":[[123,5],[258,5]]},"265":{"position":[[546,5],[681,5],[1084,5]]},"267":{"position":[[257,5],[392,5],[5961,5],[6096,5],[6499,5]]},"277":{"position":[[95,5],[230,5]]},"285":{"position":[[1551,5],[1686,5],[2089,5],[7189,5],[7324,5],[13213,5],[13348,5],[13751,5],[18815,5],[18950,5],[19353,5]]},"294":{"position":[[498,5],[633,5]]},"296":{"position":[[289,5],[424,5],[827,5]]},"311":{"position":[[343,5],[478,5],[5924,5],[6059,5],[11738,5],[11873,5]]},"357":{"position":[[419,5],[554,5],[957,5]]},"369":{"position":[[385,5],[520,5],[923,5],[5995,5],[6130,5],[6533,5]]},"375":{"position":[[504,5],[639,5],[6680,5],[6815,5],[7218,5],[12494,5],[12629,5],[13032,5]]},"382":{"position":[[1364,5],[1499,5],[1902,5]]},"402":{"position":[[298,5],[433,5]]},"404":{"position":[[319,5],[454,5],[857,5],[6156,5],[6291,5],[6694,5]]},"444":{"position":[[367,5],[502,5],[7121,5],[7256,5],[7659,5]]},"446":{"position":[[269,5],[404,5]]},"448":{"position":[[215,5],[350,5],[753,5]]},"462":{"position":[[385,5],[520,5],[923,5],[6019,5],[6154,5],[6557,5]]},"466":{"position":[[345,5],[480,5],[883,5],[6144,5],[6279,5],[6682,5]]},"504":{"position":[[273,5],[408,5]]},"506":{"position":[[275,5],[410,5]]},"508":{"position":[[392,5],[527,5],[930,5]]},"522":{"position":[[459,5],[594,5]]},"524":{"position":[[524,5],[659,5],[1062,5]]},"540":{"position":[[282,5],[417,5]]},"542":{"position":[[615,5],[750,5]]},"544":{"position":[[452,5],[587,5],[990,5]]},"562":{"position":[[507,5],[642,5],[7055,5],[7190,5],[7593,5],[13050,5],[13185,5],[13588,5],[18736,5],[18871,5],[19274,5],[24362,5],[24497,5],[24900,5]]},"574":{"position":[[361,5],[496,5]]},"578":{"position":[[368,5],[503,5]]},"580":{"position":[[379,5],[514,5]]},"582":{"position":[[225,5],[360,5],[763,5],[5739,5],[5874,5],[6277,5]]},"584":{"position":[[262,5],[397,5],[5799,5],[5934,5],[6337,5]]},"599":{"position":[[384,5],[519,5],[922,5]]},"606":{"position":[[634,5],[769,5],[1175,5],[6790,5],[6925,5],[7331,5],[12771,5],[12906,5],[13312,5]]},"608":{"position":[[837,5],[972,5],[1378,5]]},"613":{"position":[[375,5],[510,5],[898,5],[6287,5],[6422,5],[6810,5]]},"618":{"position":[[296,5],[431,5],[819,5]]},"637":{"position":[[511,5],[646,5]]},"639":{"position":[[326,5],[461,5],[864,5]]},"645":{"position":[[236,5],[371,5]]},"647":{"position":[[255,5],[390,5],[793,5]]},"649":{"position":[[236,5],[371,5],[6294,5],[6429,5],[6832,5],[11927,5],[12062,5],[12465,5]]},"667":{"position":[[1515,5],[1650,5],[2053,5],[7687,5],[7822,5],[8225,5],[14508,5],[14643,5],[15046,5],[21345,5],[21480,5],[21883,5],[27581,5],[27716,5],[28119,5]]},"669":{"position":[[1488,5],[1623,5],[2026,5],[7737,5],[7872,5],[8275,5],[14081,5],[14216,5],[14619,5],[20404,5],[20539,5],[20942,5]]},"679":{"position":[[1202,5],[1337,5],[1740,5],[6820,5],[6955,5],[7358,5]]},"681":{"position":[[326,5],[461,5],[6210,5],[6345,5],[6748,5]]},"683":{"position":[[301,5],[436,5],[842,5],[6578,5],[6713,5],[12840,5],[12975,5],[19142,5],[19277,5],[19680,5],[24805,5],[24940,5],[25343,5]]},"701":{"position":[[287,5],[2118,5],[3977,5],[5813,5],[7670,5],[9513,5]]},"703":{"position":[[2865,5],[4887,5],[5022,5],[10755,5]]},"705":{"position":[[1278,5],[1413,5],[7309,5],[9980,5]]},"726":{"position":[[340,5],[475,5],[11658,5],[11793,5],[19795,5],[19930,5],[28394,5],[28529,5],[28932,5],[34153,5],[34288,5],[34691,5],[39770,5],[39905,5],[40308,5],[45412,5],[45547,5],[45950,5]]},"728":{"position":[[436,5],[571,5],[974,5],[8355,5],[8490,5],[8893,5],[14272,5],[14407,5],[14810,5],[24690,5],[24825,5],[25228,5],[32938,5],[33073,5],[33476,5],[42473,5],[42608,5],[43011,5]]},"745":{"position":[[1967,5],[2102,5],[7651,5],[7786,5],[8189,5],[13341,5],[13476,5],[18982,5],[19117,5],[19520,5],[24608,5],[24743,5],[25146,5],[32342,5],[32477,5],[32880,5],[37968,5],[38103,5],[38506,5]]},"747":{"position":[[2496,5],[2631,5],[9810,5],[9945,5],[10348,5]]},"749":{"position":[[441,5],[576,5],[6682,5],[6817,5],[12573,5],[12708,5],[13111,5]]},"751":{"position":[[3138,5],[3273,5],[10022,5],[10157,5],[10560,5],[17456,5],[17591,5]]},"771":{"position":[[653,5],[788,5],[6301,5],[6436,5],[11985,5],[12120,5],[19219,5],[19354,5],[19757,5],[24918,5],[25053,5],[25456,5]]},"773":{"position":[[3071,5],[3206,5],[10547,5],[10682,5],[11085,5]]},"775":{"position":[[2976,5],[3111,5],[9501,5],[9636,5],[17731,5],[17866,5],[18269,5]]},"777":{"position":[[3171,5],[3306,5],[10423,5],[10558,5],[10961,5]]},"789":{"position":[[2744,5],[2879,5]]},"795":{"position":[[571,5],[706,5],[1109,5],[6259,5],[6394,5],[6797,5],[11984,5],[12119,5],[17894,5],[18029,5],[18432,5]]},"797":{"position":[[4686,5],[4821,5],[5224,5],[10491,5],[10626,5],[19034,5],[19169,5],[25973,5],[26108,5],[26511,5]]},"799":{"position":[[1231,5],[1366,5],[8668,5],[8803,5],[9206,5],[15594,5],[15729,5],[16132,5]]},"801":{"position":[[3472,5],[3607,5]]},"820":{"position":[[1968,5],[2103,5],[7676,5],[7811,5],[8214,5],[13388,5],[13523,5],[19022,5],[19157,5],[19560,5],[24640,5],[24775,5],[25178,5],[31862,5],[31997,5],[32400,5],[37480,5],[37615,5],[38018,5]]},"822":{"position":[[2251,5],[2386,5],[10484,5],[10619,5],[11022,5]]},"824":{"position":[[2084,5],[2219,5],[9397,5],[9532,5],[9935,5]]},"826":{"position":[[2957,5],[3092,5],[11067,5],[11202,5],[11605,5],[16825,5],[16960,5],[17363,5],[22522,5],[22657,5],[23060,5],[28314,5],[28449,5],[28852,5],[34011,5],[34146,5],[34549,5]]},"844":{"position":[[2210,5],[2345,5],[8187,5],[8322,5],[8725,5],[13921,5],[14056,5],[19855,5],[19990,5],[20393,5],[25598,5],[25733,5],[26136,5],[31759,5],[31894,5],[39559,5],[39694,5],[40097,5]]},"846":{"position":[[271,5],[406,5],[809,5],[7553,5],[7688,5],[8091,5]]},"848":{"position":[[7039,5],[7174,5],[14655,5],[14790,5],[21098,5],[21233,5],[27932,5],[28067,5],[34416,5],[34551,5],[40303,5],[40438,5],[46204,5],[46339,5],[46742,5],[51875,5],[52010,5],[52413,5]]}}}],["constantli",{"_index":308,"t":{"19":{"position":[[311,10]]}}}],["constrain",{"_index":89,"t":{"3":{"position":[[1443,11]]}}}],["consum",{"_index":1024,"t":{"155":{"position":[[256,9]]},"323":{"position":[[0,7]]}}}],["contain",{"_index":564,"t":{"41":{"position":[[33,8]]},"45":{"position":[[3494,8],[3558,7]]},"167":{"position":[[160,7]]},"208":{"position":[[47,10]]},"212":{"position":[[523,11],[628,10],[891,9],[1064,10],[3574,9],[3751,10]]},"214":{"position":[[1376,10],[2901,10]]},"279":{"position":[[1066,7],[1216,7]]},"384":{"position":[[818,7]]},"482":{"position":[[5625,11],[7664,8]]},"498":{"position":[[36,7],[200,10]]},"613":{"position":[[6096,7]]},"626":{"position":[[464,7],[494,7],[521,7],[549,7],[624,7]]},"661":{"position":[[459,8]]},"703":{"position":[[848,7]]},"815":{"position":[[287,7]]},"817":{"position":[[381,8]]}}}],["container_nam",{"_index":1361,"t":{"212":{"position":[[1661,15],[1979,15],[2283,15],[4301,15],[4650,15],[4934,15]]}}}],["content",{"_index":494,"t":{"35":{"position":[[7851,8]]},"43":{"position":[[3224,8]]},"45":{"position":[[17418,8],[23612,8],[30163,8]]},"135":{"position":[[1434,8]]},"147":{"position":[[1676,8]]},"153":{"position":[[209,10]]},"155":{"position":[[317,11]]},"200":{"position":[[5019,8]]},"202":{"position":[[5244,8],[10998,8]]},"250":{"position":[[1512,8]]},"252":{"position":[[1635,8]]},"265":{"position":[[5494,8]]},"267":{"position":[[5022,8],[10914,8]]},"279":{"position":[[992,8],[2870,8]]},"281":{"position":[[2037,8],[3780,8]]},"285":{"position":[[6529,8],[12119,8],[18211,8],[23823,8]]},"294":{"position":[[5279,8]]},"296":{"position":[[5292,8]]},"311":{"position":[[5090,8],[10677,8],[17287,8]]},"331":{"position":[[108,7]]},"335":{"position":[[115,7]]},"341":{"position":[[92,7]]},"357":{"position":[[5457,8]]},"369":{"position":[[5388,8],[10993,8]]},"375":{"position":[[5522,8],[11683,8],[17497,8]]},"382":{"position":[[6352,8]]},"390":{"position":[[86,7]]},"402":{"position":[[5129,8]]},"404":{"position":[[5357,8],[11199,8]]},"422":{"position":[[2594,8]]},"440":{"position":[[369,9],[662,7],[753,7]]},"444":{"position":[[5887,8],[12134,8]]},"446":{"position":[[6229,8]]},"448":{"position":[[5228,8]]},"462":{"position":[[5403,8],[11032,8]]},"466":{"position":[[5368,8],[11167,8]]},"504":{"position":[[5048,8]]},"506":{"position":[[5369,8]]},"508":{"position":[[5430,8]]},"522":{"position":[[5441,8]]},"524":{"position":[[5542,8]]},"540":{"position":[[5065,8]]},"542":{"position":[[5705,8]]},"544":{"position":[[5500,8]]},"562":{"position":[[5907,8],[12058,8],[18053,8],[23749,8],[29370,8]]},"574":{"position":[[5427,8]]},"578":{"position":[[5418,8]]},"580":{"position":[[5158,8]]},"582":{"position":[[5168,8],[10682,8]]},"584":{"position":[[5011,8],[10747,8]]},"599":{"position":[[5377,8]]},"606":{"position":[[5830,8],[11870,8],[17901,8]]},"608":{"position":[[5561,8]]},"613":{"position":[[5530,8],[11442,8]]},"618":{"position":[[5999,8]]},"624":{"position":[[26,7]]},"637":{"position":[[5757,8]]},"639":{"position":[[5379,8]]},"645":{"position":[[5956,8]]},"647":{"position":[[5268,8]]},"649":{"position":[[5304,8],[11312,8],[16960,8]]},"667":{"position":[[6513,8],[12685,8],[19521,8],[26343,8],[32584,8]]},"669":{"position":[[6491,8],[12755,8],[19089,8],[25412,8]]},"679":{"position":[[6210,8],[11823,8]]},"681":{"position":[[5312,8],[11233,8]]},"683":{"position":[[5650,8],[11744,8],[18012,8],[24150,8],[29803,8]]},"695":{"position":[[8209,8]]},"701":{"position":[[1600,8],[3441,8],[5290,8],[7141,8],[8988,8],[10841,8]]},"703":{"position":[[4183,8],[9941,8],[12068,8]]},"705":{"position":[[6446,8],[9139,8],[11815,8]]},"707":{"position":[[7748,8]]},"726":{"position":[[8892,8],[18136,8],[25993,8],[33397,8],[39161,8],[44793,8],[50440,8]]},"728":{"position":[[5444,8],[13343,8],[19305,8],[29718,8],[37921,8],[47456,8]]},"745":{"position":[[6778,8],[12664,8],[18152,8],[23995,8],[29626,8],[37355,8],[42981,8]]},"747":{"position":[[8300,8],[14833,8]]},"749":{"position":[[5348,8],[11716,8],[17586,8]]},"751":{"position":[[8364,8],[15055,8],[22355,8]]},"771":{"position":[[5460,8],[11124,8],[17538,8],[24227,8],[29916,8]]},"773":{"position":[[8915,8],[15570,8]]},"775":{"position":[[8214,8],[15677,8],[22724,8]]},"777":{"position":[[8736,8],[15441,8]]},"789":{"position":[[9864,8]]},"795":{"position":[[5559,8],[11267,8],[17030,8],[22887,8]]},"797":{"position":[[9654,8],[17165,8],[24650,8],[30961,8]]},"799":{"position":[[7069,8],[14500,8],[21431,8]]},"801":{"position":[[16240,8]]},"820":{"position":[[6791,8],[12704,8],[18195,8],[24030,8],[29658,8],[36870,8],[42493,8]]},"822":{"position":[[8577,8],[15512,8]]},"824":{"position":[[7768,8],[14440,8]]},"826":{"position":[[9411,8],[16115,8],[21883,8],[27590,8],[33372,8],[39069,8]]},"844":{"position":[[7252,8],[13225,8],[18963,8],[24893,8],[30671,8],[37957,8],[44597,8]]},"846":{"position":[[5284,8],[12561,8]]},"848":{"position":[[12900,8],[19973,8],[26671,8],[33166,8],[39343,8],[45162,8],[51202,8],[56948,8]]}}}],["context",{"_index":110,"t":{"3":{"position":[[1878,7],[2033,7],[2349,7],[2488,7],[2738,7],[3040,8]]},"9":{"position":[[227,7],[413,8]]},"35":{"position":[[6013,7]]},"45":{"position":[[16327,7],[22521,7],[28992,7],[30928,7],[31195,7],[31402,7]]},"75":{"position":[[93,7]]},"133":{"position":[[2949,7]]},"145":{"position":[[2949,7]]},"169":{"position":[[63,7],[932,7]]},"173":{"position":[[2761,9]]},"200":{"position":[[4247,7]]},"202":{"position":[[4159,7],[9909,7]]},"248":{"position":[[2949,7]]},"265":{"position":[[4429,7]]},"267":{"position":[[4253,7],[9847,7]]},"277":{"position":[[2921,7]]},"285":{"position":[[5452,7],[11311,7],[17126,7],[22734,7]]},"294":{"position":[[4506,7]]},"296":{"position":[[4205,7]]},"311":{"position":[[4327,7],[9911,7],[16344,7]]},"333":{"position":[[1218,7]]},"357":{"position":[[4356,7]]},"369":{"position":[[4301,7],[9908,7]]},"375":{"position":[[4692,7],[10596,7],[16410,7]]},"382":{"position":[[5271,7]]},"402":{"position":[[4345,7]]},"404":{"position":[[4256,7],[10096,7]]},"444":{"position":[[4942,7],[11043,7]]},"446":{"position":[[5174,7]]},"448":{"position":[[4137,7]]},"462":{"position":[[4310,7],[9941,7]]},"466":{"position":[[4273,7],[10072,7]]},"476":{"position":[[18,7]]},"504":{"position":[[4278,7]]},"506":{"position":[[4520,7]]},"508":{"position":[[4329,7]]},"522":{"position":[[4620,7]]},"524":{"position":[[4449,7]]},"540":{"position":[[4293,7]]},"542":{"position":[[4857,7]]},"544":{"position":[[4395,7]]},"562":{"position":[[4992,7],[10971,7],[16966,7],[22658,7],[28281,7]]},"574":{"position":[[4594,7]]},"578":{"position":[[4589,7]]},"580":{"position":[[4387,7]]},"582":{"position":[[4105,7],[9619,7]]},"584":{"position":[[4246,7],[9682,7]]},"599":{"position":[[4294,7]]},"606":{"position":[[4739,7],[10816,7],[16827,7]]},"608":{"position":[[4588,7]]},"613":{"position":[[4452,7],[10364,7]]},"618":{"position":[[4672,7]]},"637":{"position":[[4870,7]]},"639":{"position":[[4272,7]]},"645":{"position":[[4961,7]]},"647":{"position":[[4177,7]]},"649":{"position":[[4460,7],[10219,7],[15861,7]]},"655":{"position":[[999,7]]},"659":{"position":[[630,7]]},"667":{"position":[[5428,7],[11600,7],[18430,7],[25258,7],[31497,7]]},"669":{"position":[[5404,7],[11662,7],[18000,7],[24323,7]]},"679":{"position":[[5121,7],[10736,7]]},"681":{"position":[[4490,7],[10138,7]]},"683":{"position":[[4544,7],[10886,7],[17151,7],[23061,7],[28718,7]]},"689":{"position":[[198,7],[343,7],[751,8]]},"693":{"position":[[531,7]]},"695":{"position":[[782,7]]},"697":{"position":[[27,7],[131,7],[241,7],[349,7]]},"699":{"position":[[239,7],[402,8],[437,7]]},"701":{"position":[[11389,7]]},"703":{"position":[[96,8],[252,7],[509,7],[598,7],[2499,8],[2597,7],[2727,7],[4702,7],[5476,7],[6657,7],[8214,7],[9102,7],[9445,7],[10488,7]]},"705":{"position":[[252,8],[332,7],[760,7],[894,8],[1895,7],[3104,7],[4689,7],[5577,7],[5949,7],[6984,7],[7186,7],[9856,7],[12592,7]]},"726":{"position":[[7231,7],[16962,7],[24889,7],[32310,7],[38072,7],[43698,7],[49343,7]]},"728":{"position":[[4355,7],[12262,7],[18206,7],[28621,7],[36842,7],[46377,7]]},"745":{"position":[[5999,7],[11573,7],[17373,7],[22904,7],[28533,7],[36264,7],[41890,7]]},"747":{"position":[[7284,7],[13738,7]]},"749":{"position":[[4545,7],[10882,7],[16495,7]]},"751":{"position":[[7491,7],[13956,7],[21554,7]]},"771":{"position":[[4682,7],[10342,7],[16593,7],[23138,7],[28831,7]]},"773":{"position":[[7907,7],[14475,7]]},"775":{"position":[[7338,7],[14586,7],[21641,7]]},"777":{"position":[[7788,7],[14348,7]]},"783":{"position":[[375,7],[778,8]]},"787":{"position":[[533,7]]},"789":{"position":[[8540,7]]},"793":{"position":[[414,7]]},"795":{"position":[[4478,7],[10178,7],[16193,7],[21804,7]]},"797":{"position":[[1241,7],[2731,7],[4246,8],[8581,7],[15942,7],[23681,7],[29880,7]]},"799":{"position":[[272,7],[850,7],[6043,7],[8368,7],[13133,7],[20062,7]]},"801":{"position":[[13588,7]]},"820":{"position":[[6009,7],[11607,7],[17417,7],[22941,7],[28565,7],[35781,7],[41402,7]]},"822":{"position":[[7450,7],[14415,7]]},"824":{"position":[[6782,7],[13337,7]]},"826":{"position":[[8243,7],[15010,7],[20774,7],[26477,7],[32263,7],[37960,7]]},"844":{"position":[[6416,7],[12124,7],[18127,7],[23792,7],[29556,7],[36853,7],[43496,7]]},"846":{"position":[[4193,7],[11472,7]]},"848":{"position":[[11878,7],[19068,7],[25712,7],[32291,7],[38535,7],[44371,7],[50117,7],[55833,7]]}}}],["contextu",{"_index":748,"t":{"45":{"position":[[30815,10],[30835,10],[30996,10],[31134,10],[31326,10]]},"75":{"position":[[0,10]]},"333":{"position":[[1013,10],[1127,10]]},"689":{"position":[[240,10]]},"693":{"position":[[441,10]]},"699":{"position":[[128,10],[415,10]]},"705":{"position":[[505,11],[526,10]]},"707":{"position":[[10207,10],[10523,10]]},"709":{"position":[[219,10],[316,10]]},"783":{"position":[[149,10],[272,10]]},"787":{"position":[[442,10]]},"793":{"position":[[126,10],[392,10]]},"797":{"position":[[2636,10]]},"799":{"position":[[8113,11],[8134,10]]},"801":{"position":[[21109,10],[21425,10],[21587,10]]}}}],["contextual_tupl",{"_index":2178,"t":{"618":{"position":[[922,18],[5014,19],[5532,17],[6158,20],[6603,17]]},"705":{"position":[[7415,18],[8592,19],[8889,17],[9622,17],[10086,18],[11266,19],[11564,17],[12299,17]]},"799":{"position":[[9316,18],[13479,19],[14037,17],[15063,17],[16242,18],[20408,19],[20967,17],[21995,17]]}}}],["contextualtupl",{"_index":2179,"t":{"618":{"position":[[2168,17],[3707,16]]},"705":{"position":[[7791,17],[8225,16],[10463,17],[10898,16]]},"799":{"position":[[10574,17],[12133,16],[17501,17],[19061,16]]}}}],["continu",{"_index":1430,"t":{"218":{"position":[[8,10]]},"279":{"position":[[1226,12],[1255,12]]},"281":{"position":[[2140,12],[2243,12]]},"424":{"position":[[707,8]]},"482":{"position":[[2965,8]]},"484":{"position":[[4031,8]]},"486":{"position":[[267,8]]}}}],["continuation_token",{"_index":871,"t":{"103":{"position":[[329,19]]},"279":{"position":[[2484,19],[2908,23]]},"281":{"position":[[3380,19],[3837,21]]}}}],["continuationtoken",{"_index":1536,"t":{"279":{"position":[[115,17],[208,17],[1519,17],[1708,17],[1799,18],[2212,17]]},"281":{"position":[[1106,17],[1199,17],[2375,17],[2564,17],[2655,18],[3100,17]]}}}],["contoso",{"_index":796,"t":{"85":{"position":[[2254,7],[2410,7]]},"285":{"position":[[907,9],[1098,7],[7773,7],[8923,7],[10449,7],[11649,7],[12637,7]]},"484":{"position":[[1626,7],[2255,7]]},"667":{"position":[[20642,7],[20671,7]]},"742":{"position":[[163,7],[296,7],[457,7]]},"751":{"position":[[220,7],[232,7],[269,7],[2940,7],[2957,7],[17022,7],[17122,7]]}}}],["contoso/engin",{"_index":2494,"t":{"742":{"position":[[70,19],[256,19],[539,19]]},"747":{"position":[[3085,19],[3210,19],[4434,19],[4618,19],[6218,19],[6353,19],[7627,19],[7761,19],[9090,19],[9219,19]]}}}],["contoso/protocol",{"_index":2496,"t":{"742":{"position":[[118,17],[214,17]]},"749":{"position":[[7269,17],[8445,17],[9997,17],[11223,17],[12261,17]]}}}],["contoso/tool",{"_index":2498,"t":{"742":{"position":[[416,15]]},"747":{"position":[[3245,15],[4653,15],[6388,15],[7796,15],[9254,15]]},"751":{"position":[[2969,16]]}}}],["control",{"_index":21,"t":{"3":{"position":[[292,7]]},"21":{"position":[[21,8],[177,8]]},"155":{"position":[[1849,10]]},"470":{"position":[[37,7]]},"480":{"position":[[163,7]]},"767":{"position":[[70,7]]},"842":{"position":[[338,7]]}}}],["convert",{"_index":499,"t":{"35":{"position":[[8391,7]]},"97":{"position":[[135,10]]},"311":{"position":[[5704,7],[11518,8]]},"482":{"position":[[10585,7]]},"838":{"position":[[1017,7]]}}}],["copi",{"_index":1358,"t":{"212":{"position":[[1517,4],[4164,4]]},"214":{"position":[[1326,4],[2851,4]]}}}],["core",{"_index":1525,"t":{"256":{"position":[[139,4]]},"394":{"position":[[167,4]]},"482":{"position":[[3237,4]]},"717":{"position":[[253,5]]}}}],["correct",{"_index":296,"t":{"17":{"position":[[295,7]]},"508":{"position":[[152,7]]},"647":{"position":[[69,8]]},"681":{"position":[[6042,7]]},"683":{"position":[[18950,7]]},"703":{"position":[[244,7],[590,7]]},"705":{"position":[[959,7]]},"721":{"position":[[92,8]]},"728":{"position":[[46,7],[38553,7],[41782,7]]},"765":{"position":[[92,8]]},"773":{"position":[[1089,7]]},"799":{"position":[[560,7]]},"840":{"position":[[92,8]]},"846":{"position":[[62,7],[5848,7]]}}}],["correctli",{"_index":1285,"t":{"191":{"position":[[34,9]]},"258":{"position":[[34,9]]},"285":{"position":[[34,9],[12803,9]]},"302":{"position":[[34,9]]},"369":{"position":[[73,9]]},"396":{"position":[[34,9]]},"448":{"position":[[5748,10]]},"454":{"position":[[34,9]]},"462":{"position":[[73,9]]},"492":{"position":[[34,9]]},"514":{"position":[[34,9]]},"530":{"position":[[34,9]]},"550":{"position":[[34,9]]},"568":{"position":[[34,9]]},"590":{"position":[[34,9]]},"705":{"position":[[920,9]]},"713":{"position":[[34,9]]},"734":{"position":[[34,9]]},"757":{"position":[[34,9]]},"809":{"position":[[34,9]]},"832":{"position":[[34,9]]}}}],["correspond",{"_index":1788,"t":{"418":{"position":[[2528,13]]},"446":{"position":[[88,13]]}}}],["could_n",{"_index":519,"t":{"39":{"position":[[178,12]]}}}],["countri",{"_index":48,"t":{"3":{"position":[[733,9]]}}}],["cover",{"_index":2257,"t":{"667":{"position":[[26968,5]]}}}],["cpu",{"_index":1022,"t":{"155":{"position":[[188,3],[275,3]]}}}],["creat",{"_index":261,"t":{"15":{"position":[[107,7]]},"19":{"position":[[539,7]]},"29":{"position":[[150,6],[165,8]]},"33":{"position":[[202,7],[488,7],[774,7],[1060,7],[1346,7],[1627,7]]},"41":{"position":[[84,6]]},"43":{"position":[[2761,6],[3002,6],[3038,6],[3141,6]]},"45":{"position":[[3976,6]]},"101":{"position":[[56,7],[177,8]]},"107":{"position":[[412,7]]},"109":{"position":[[845,8]]},"153":{"position":[[353,8]]},"155":{"position":[[282,8]]},"173":{"position":[[26,6],[678,6],[2518,6]]},"181":{"position":[[114,7]]},"183":{"position":[[3203,9]]},"185":{"position":[[4332,9]]},"187":{"position":[[4893,9]]},"189":{"position":[[351,6]]},"212":{"position":[[567,6],[669,6],[718,7],[1027,6],[2888,6],[3359,6],[3411,7],[3714,6],[5516,6]]},"258":{"position":[[667,6],[701,6]]},"260":{"position":[[24,6],[58,6]]},"302":{"position":[[1174,6],[1208,6]]},"304":{"position":[[24,6],[58,6]]},"323":{"position":[[37,6],[481,8]]},"333":{"position":[[23,6],[977,7]]},"337":{"position":[[20,6],[130,6],[237,6],[346,6]]},"339":{"position":[[20,6]]},"345":{"position":[[455,6],[502,8]]},"353":{"position":[[284,7]]},"355":{"position":[[11,8]]},"357":{"position":[[5943,8]]},"375":{"position":[[18102,8]]},"386":{"position":[[1350,6]]},"404":{"position":[[11696,8]]},"418":{"position":[[3281,7]]},"428":{"position":[[162,6],[474,6]]},"430":{"position":[[1266,6]]},"436":{"position":[[24,6]]},"440":{"position":[[82,6],[302,7],[419,7]]},"442":{"position":[[152,6]]},"470":{"position":[[0,8]]},"476":{"position":[[1352,6],[1428,6],[1502,6],[1622,6]]},"478":{"position":[[489,6],[565,6],[639,6],[717,6],[2233,6],[2309,6],[2383,6],[2503,6]]},"480":{"position":[[724,6],[800,6],[874,6],[994,6],[2666,6]]},"482":{"position":[[50,6],[341,6],[3124,7],[3628,8],[4026,8],[4710,8],[5960,7]]},"484":{"position":[[1839,7],[2105,7],[2388,6],[2416,6],[3747,6]]},"486":{"position":[[424,8]]},"492":{"position":[[951,6],[985,6]]},"494":{"position":[[24,6],[58,6]]},"498":{"position":[[558,6],[639,6]]},"500":{"position":[[140,8]]},"504":{"position":[[47,6],[5767,8]]},"512":{"position":[[389,7]]},"514":{"position":[[721,6],[755,6],[1684,8]]},"516":{"position":[[24,6],[58,6]]},"522":{"position":[[22,6],[223,6]]},"528":{"position":[[369,6]]},"530":{"position":[[698,6],[732,6]]},"532":{"position":[[24,6],[58,6]]},"540":{"position":[[51,6]]},"542":{"position":[[339,6]]},"544":{"position":[[6181,8]]},"548":{"position":[[564,6],[617,6],[633,8],[713,8]]},"550":{"position":[[810,6],[844,6]]},"552":{"position":[[24,6],[58,6]]},"562":{"position":[[108,6],[220,6],[30319,8]]},"568":{"position":[[651,6],[685,6]]},"570":{"position":[[24,6],[58,6]]},"590":{"position":[[1122,6],[1156,6]]},"592":{"position":[[24,6],[58,6]]},"637":{"position":[[48,6],[136,6]]},"639":{"position":[[6293,8]]},"655":{"position":[[239,6],[273,6]]},"657":{"position":[[24,6],[58,6]]},"679":{"position":[[38,6]]},"681":{"position":[[56,6]]},"693":{"position":[[667,6]]},"713":{"position":[[326,6]]},"734":{"position":[[495,6]]},"745":{"position":[[240,6],[1783,6]]},"747":{"position":[[21,8],[2220,6]]},"751":{"position":[[9345,6],[17286,6]]},"757":{"position":[[300,6],[334,6],[1087,6]]},"787":{"position":[[669,6]]},"789":{"position":[[2385,7],[3659,7],[5416,7],[7510,7],[9227,7],[11364,7]]},"801":{"position":[[4387,7],[7400,7],[11222,7],[14275,7],[19514,7]]},"809":{"position":[[495,6]]},"820":{"position":[[325,6],[1784,6]]},"822":{"position":[[2010,6]]},"826":{"position":[[179,7]]},"832":{"position":[[300,6],[334,6]]},"838":{"position":[[988,6]]},"844":{"position":[[526,6],[2027,6]]}}}],["create_docu",{"_index":1950,"t":{"480":{"position":[[2721,17]]}}}],["create_stor",{"_index":581,"t":{"43":{"position":[[2738,15],[2966,14]]}}}],["createstor",{"_index":431,"t":{"35":{"position":[[2498,13],[4380,13],[5824,13]]},"43":{"position":[[918,15],[1918,15]]},"45":{"position":[[13717,13],[15068,13],[16138,13],[19911,13],[21262,13],[22332,13],[26286,13],[27691,13],[28803,13]]},"133":{"position":[[1132,13],[2069,13],[2760,13]]},"145":{"position":[[1132,13],[2069,13],[2760,13]]},"173":{"position":[[4891,15]]},"183":{"position":[[528,15],[1157,15],[2004,15],[2692,15]]},"185":{"position":[[876,15],[1646,15],[2732,15],[3794,15]]},"187":{"position":[[752,15],[1671,15],[2895,15],[4355,15]]},"200":{"position":[[1503,13],[2964,13],[4058,13]]},"202":{"position":[[1555,13],[2903,13],[3970,13],[7301,13],[8651,13],[9720,13]]},"248":{"position":[[1132,13],[2069,13],[2760,13]]},"265":{"position":[[1845,13],[3183,13],[4240,13]]},"267":{"position":[[1519,13],[2975,13],[4064,13],[7261,13],[8600,13],[9658,13]]},"277":{"position":[[1104,13],[2041,13],[2732,13]]},"285":{"position":[[2856,13],[4200,13],[5263,13],[8493,13],[9991,13],[11122,13],[14522,13],[15870,13],[16937,13],[20126,13],[21476,13],[22545,13]]},"294":{"position":[[1764,13],[3224,13],[4317,13]]},"296":{"position":[[1599,13],[2948,13],[4016,13]]},"311":{"position":[[1601,13],[3053,13],[4138,13],[7183,13],[8636,13],[9722,13],[13166,13],[14863,13],[16155,13]]},"357":{"position":[[1736,13],[3092,13],[4167,13]]},"369":{"position":[[1695,13],[3044,13],[4112,13],[7304,13],[8652,13],[9719,13]]},"375":{"position":[[1830,13],[3350,13],[4503,13],[7990,13],[9339,13],[10407,13],[13804,13],[15153,13],[16221,13]]},"382":{"position":[[2671,13],[4017,13],[5082,13]]},"402":{"position":[[1577,13],[3050,13],[4156,13]]},"404":{"position":[[1636,13],[2992,13],[4067,13],[7474,13],[8831,13],[9907,13]]},"444":{"position":[[1799,13],[3484,13],[4753,13],[8433,13],[9784,13],[10854,13]]},"446":{"position":[[1811,13],[3606,13],[4985,13]]},"448":{"position":[[1527,13],[2878,13],[3948,13]]},"462":{"position":[[1698,13],[3050,13],[4121,13],[7331,13],[8682,13],[9752,13]]},"466":{"position":[[1659,13],[3012,13],[4084,13],[7458,13],[8811,13],[9883,13]]},"504":{"position":[[1538,13],[2997,13],[4089,13]]},"506":{"position":[[1620,13],[3159,13],[4331,13]]},"508":{"position":[[1709,13],[3065,13],[4140,13]]},"522":{"position":[[1776,13],[3287,13],[4431,13]]},"524":{"position":[[1837,13],[3189,13],[4260,13]]},"540":{"position":[[1549,13],[3010,13],[4104,13]]},"542":{"position":[[1959,13],[3497,13],[4668,13]]},"544":{"position":[[1771,13],[3129,13],[4206,13]]},"562":{"position":[[1909,13],[3564,13],[4803,13],[8365,13],[9714,13],[10782,13],[14360,13],[15709,13],[16777,13],[20048,13],[21399,13],[22469,13],[25673,13],[27023,13],[28092,13]]},"574":{"position":[[1679,13],[3250,13],[4405,13]]},"578":{"position":[[1682,13],[3249,13],[4400,13]]},"580":{"position":[[1645,13],[3105,13],[4198,13]]},"582":{"position":[[1523,13],[2860,13],[3916,13],[7037,13],[8374,13],[9430,13]]},"584":{"position":[[1520,13],[2972,13],[4057,13],[7098,13],[8436,13],[9493,13]]},"599":{"position":[[1692,13],[3039,13],[4105,13]]},"606":{"position":[[1987,13],[3431,13],[4550,13],[8124,13],[9529,13],[10627,13],[14115,13],[15530,13],[16638,13]]},"608":{"position":[[2072,13],[3398,13],[4399,13]]},"613":{"position":[[1722,13],[3135,13],[4263,13],[7634,13],[9047,13],[10175,13]]},"618":{"position":[[1736,13],[3250,13],[4483,13]]},"637":{"position":[[1894,13],[3471,13],[4681,13]]},"639":{"position":[[1646,13],[3005,13],[4083,13]]},"645":{"position":[[1718,13],[3453,13],[4772,13]]},"647":{"position":[[1567,13],[2918,13],[3988,13]]},"649":{"position":[[1574,13],[3106,13],[4271,13],[7607,13],[8959,13],[10030,13],[13243,13],[14598,13],[15672,13]]},"667":{"position":[[2824,13],[4172,13],[5239,13],[8996,13],[10344,13],[11411,13],[15820,13],[17171,13],[18241,13],[22654,13],[24002,13],[25069,13],[28891,13],[30240,13],[31308,13]]},"669":{"position":[[2798,13],[4147,13],[5215,13],[9050,13],[10402,13],[11473,13],[15392,13],[16742,13],[17811,13],[21715,13],[23065,13],[24134,13]]},"679":{"position":[[2513,13],[3863,13],[4932,13],[8130,13],[9479,13],[10547,13]]},"681":{"position":[[1644,13],[3156,13],[4301,13],[7524,13],[8877,13],[9949,13]]},"683":{"position":[[1722,13],[3174,13],[4355,13],[7921,13],[9517,13],[10697,13],[14184,13],[15781,13],[16962,13],[20453,13],[21803,13],[22872,13],[26114,13],[27462,13],[28529,13]]},"703":{"position":[[6222,13],[7751,13],[8913,13]]},"705":{"position":[[2641,13],[4198,13],[5388,13]]},"726":{"position":[[2452,13],[5053,13],[7042,13],[13310,13],[15274,13],[16773,13],[21377,13],[23271,13],[24700,13],[29704,13],[31053,13],[32121,13],[35464,13],[36814,13],[37883,13],[41084,13],[42437,13],[43509,13],[46727,13],[48081,13],[49154,13]]},"728":{"position":[[1747,13],[3097,13],[4166,13],[9662,13],[11008,13],[12073,13],[15588,13],[16943,13],[18017,13],[26005,13],[27359,13],[28432,13],[34244,13],[35589,13],[36653,13],[43779,13],[45124,13],[46188,13]]},"745":{"position":[[3241,13],[4709,13],[5810,13],[8963,13],[10314,13],[11384,13],[14615,13],[16083,13],[17184,13],[20294,13],[21645,13],[22715,13],[25921,13],[27273,13],[28344,13],[33654,13],[35005,13],[36075,13],[39280,13],[40631,13],[41701,13]]},"747":{"position":[[3999,13],[5755,13],[7095,13],[11124,13],[12477,13],[13549,13]]},"749":{"position":[[1739,13],[3231,13],[4356,13],[8012,13],[9536,13],[10693,13],[13885,13],[15236,13],[16306,13]]},"751":{"position":[[4496,13],[6107,13],[7302,13],[11338,13],[12693,13],[13767,13],[18752,13],[20242,13],[21365,13]]},"771":{"position":[[1926,13],[3393,13],[4493,13],[7578,13],[9049,13],[10153,13],[13405,13],[15137,13],[16404,13],[20530,13],[21880,13],[22949,13],[26227,13],[27575,13],[28642,13]]},"773":{"position":[[4544,13],[6388,13],[7718,13],[11861,13],[13214,13],[14286,13]]},"775":{"position":[[4337,13],[5951,13],[7149,13],[11057,13],[12984,13],[14397,13],[19039,13],[20386,13],[21452,13]]},"777":{"position":[[4594,13],[6329,13],[7599,13],[11736,13],[13088,13],[14159,13]]},"789":{"position":[[4537,13],[6701,13],[8351,13]]},"795":{"position":[[1878,13],[3224,13],[4289,13],[7570,13],[8920,13],[9989,13],[13317,13],[14844,13],[16004,13],[19202,13],[20549,13],[21615,13]]},"797":{"position":[[5989,13],[7331,13],[8392,13],[12192,13],[14205,13],[15753,13],[20490,13],[22199,13],[23492,13],[27280,13],[28626,13],[29691,13]]},"799":{"position":[[2742,13],[4506,13],[5854,13],[10144,13],[11678,13],[12944,13],[17071,13],[18606,13],[19873,13]]},"801":{"position":[[6521,13],[10413,13],[13399,13]]},"820":{"position":[[3245,13],[4716,13],[5820,13],[8991,13],[10345,13],[11418,13],[14661,13],[16128,13],[17228,13],[20333,13],[21683,13],[22752,13],[25953,13],[27305,13],[28376,13],[33173,13],[34523,13],[35592,13],[38792,13],[40143,13],[41213,13]]},"822":{"position":[[3845,13],[5810,13],[7261,13],[11799,13],[13153,13],[14226,13]]},"824":{"position":[[3557,13],[5283,13],[6593,13],[10715,13],[12072,13],[13148,13]]},"826":{"position":[[4603,13],[6561,13],[8054,13],[12386,13],[13744,13],[14821,13],[18146,13],[19506,13],[20585,13],[23845,13],[25207,13],[26288,13],[29635,13],[30995,13],[32074,13],[35332,13],[36692,13],[37771,13]]},"844":{"position":[[3542,13],[5068,13],[6227,13],[9504,13],[10860,13],[11935,13],[15253,13],[16779,13],[17938,13],[21172,13],[22528,13],[23603,13],[26922,13],[28285,13],[29367,13],[33341,13],[35235,13],[36664,13],[40876,13],[42232,13],[43307,13]]},"846":{"position":[[1583,13],[2934,13],[4004,13],[8864,13],[10214,13],[11283,13]]},"848":{"position":[[8536,13],[10345,13],[11689,13],[16056,13],[17651,13],[18879,13],[22543,13],[24241,13],[25523,13],[29292,13],[30905,13],[32102,13],[35719,13],[37216,13],[38346,13],[41589,13],[43069,13],[44182,13],[47513,13],[48861,13],[49928,13],[53199,13],[54562,13],[55644,13]]}}}],["createstorerequest",{"_index":578,"t":{"43":{"position":[[2422,18],[2634,19],[2783,19]]}}}],["creation",{"_index":905,"t":{"109":{"position":[[770,8],[874,8]]},"317":{"position":[[414,8]]},"428":{"position":[[637,9]]}}}],["credenti",{"_index":1227,"t":{"185":{"position":[[1049,12],[1839,12],[2932,11],[2950,13],[3274,12],[3311,11],[3961,11],[3975,12]]},"187":{"position":[[52,11],[136,11],[925,12],[1864,12],[3095,11],[3113,13],[3664,12],[3701,11],[3715,12],[4522,11],[4536,12]]}}}],["credentialconfigur",{"_index":1240,"t":{"185":{"position":[[3287,23]]},"187":{"position":[[3677,23]]}}}],["credentials(method='api_token",{"_index":1241,"t":{"185":{"position":[[3325,31]]}}}],["credentials.config",{"_index":1233,"t":{"185":{"position":[[1933,20]]},"187":{"position":[[1967,20]]}}}],["credentials.credenti",{"_index":1231,"t":{"185":{"position":[[1852,25]]},"187":{"position":[[1877,25]]}}}],["credentials.credentialsmethodapitoken",{"_index":1232,"t":{"185":{"position":[[1886,38]]}}}],["credentials.credentialsmethodclientcredenti",{"_index":1252,"t":{"187":{"position":[[1911,47]]}}}],["credentialsconfig",{"_index":1237,"t":{"185":{"position":[[3016,19]]},"187":{"position":[[3188,19]]}}}],["credentialsmethod",{"_index":1226,"t":{"185":{"position":[[414,18],[491,18]]},"187":{"position":[[290,18],[367,18]]}}}],["credentialsmethod.apitoken",{"_index":1228,"t":{"185":{"position":[[1072,27],[2975,27]]}}}],["credentialsmethod.clientcredenti",{"_index":1247,"t":{"187":{"position":[[948,36],[3138,36]]}}}],["criteria",{"_index":1621,"t":{"317":{"position":[[545,8]]},"327":{"position":[[77,9]]},"329":{"position":[[164,8]]},"709":{"position":[[327,9]]},"732":{"position":[[825,8]]},"807":{"position":[[694,8]]},"830":{"position":[[725,8]]}}}],["crypto/rand",{"_index":1148,"t":{"171":{"position":[[1608,13]]},"173":{"position":[[2771,13]]}}}],["crypto/rsa",{"_index":1149,"t":{"171":{"position":[[1622,12]]},"173":{"position":[[2785,12]]}}}],["cup",{"_index":2392,"t":{"721":{"position":[[248,4],[264,7],[420,4]]},"726":{"position":[[12518,4],[14134,4],[16028,4],[17594,4],[19364,4],[20631,4],[22177,4],[24001,4],[25497,4],[27167,4]]}}}],["curl",{"_index":369,"t":{"33":{"position":[[27,4]]},"35":{"position":[[736,4],[7676,4]]},"43":{"position":[[27,4],[3185,4]]},"45":{"position":[[12280,4],[17258,4],[18174,5],[18474,4],[23452,4],[24522,5],[24828,4],[29996,4]]},"129":{"position":[[27,4]]},"133":{"position":[[100,4]]},"135":{"position":[[106,4],[1274,4]]},"141":{"position":[[27,4]]},"145":{"position":[[100,4]]},"147":{"position":[[101,4],[1509,4]]},"200":{"position":[[107,4],[4859,4]]},"202":{"position":[[121,4],[5084,4],[5865,4],[10838,4]]},"220":{"position":[[229,4],[239,4]]},"244":{"position":[[27,4]]},"248":{"position":[[100,4]]},"250":{"position":[[88,4],[1352,4]]},"252":{"position":[[243,4],[1475,4]]},"265":{"position":[[421,4],[5334,4]]},"267":{"position":[[128,4],[4862,4],[5836,4],[10754,4]]},"273":{"position":[[23,4]]},"277":{"position":[[72,4]]},"279":{"position":[[91,4],[830,4],[1495,4],[2708,4]]},"281":{"position":[[1076,4],[1875,4],[2345,4],[3618,4]]},"285":{"position":[[1426,4],[6369,4],[7060,4],[11959,4],[13088,4],[18051,4],[18690,4],[23663,4]]},"294":{"position":[[369,4],[5119,4]]},"296":{"position":[[164,4],[5132,4]]},"311":{"position":[[214,4],[4930,4],[5795,4],[10517,4],[11613,4],[17127,4]]},"357":{"position":[[294,4],[5297,4]]},"369":{"position":[[260,4],[5228,4],[5870,4],[10833,4]]},"375":{"position":[[375,4],[5362,4],[6555,4],[11523,4],[12369,4],[17337,4]]},"382":{"position":[[1239,4],[6192,4]]},"402":{"position":[[169,4],[4969,4]]},"404":{"position":[[194,4],[5197,4],[6031,4],[11039,4]]},"422":{"position":[[1197,4],[2434,4]]},"444":{"position":[[238,4],[5727,4],[6996,4],[11974,4]]},"446":{"position":[[140,4],[6069,4]]},"448":{"position":[[90,4],[5068,4]]},"462":{"position":[[260,4],[5243,4],[5894,4],[10872,4]]},"466":{"position":[[220,4],[5208,4],[6019,4],[11007,4]]},"504":{"position":[[144,4],[4888,4]]},"506":{"position":[[146,4],[5209,4]]},"508":{"position":[[267,4],[5270,4]]},"522":{"position":[[330,4],[5281,4]]},"524":{"position":[[399,4],[5382,4]]},"540":{"position":[[153,4],[4905,4]]},"542":{"position":[[486,4],[5545,4]]},"544":{"position":[[327,4],[5340,4]]},"562":{"position":[[378,4],[5747,4],[6930,4],[11898,4],[12925,4],[17893,4],[18611,4],[23589,4],[24237,4],[29210,4]]},"574":{"position":[[232,4],[5267,4]]},"578":{"position":[[239,4],[5258,4]]},"580":{"position":[[250,4],[4998,4]]},"582":{"position":[[100,4],[5008,4],[5614,4],[10522,4]]},"584":{"position":[[133,4],[4851,4],[5674,4],[10587,4]]},"599":{"position":[[259,4],[5217,4]]},"606":{"position":[[509,4],[5671,4],[6665,4],[11711,4],[12646,4],[17742,4]]},"608":{"position":[[712,4],[5402,4]]},"613":{"position":[[250,4],[5369,4],[6162,4],[11281,4]]},"618":{"position":[[171,4],[5832,4]]},"637":{"position":[[382,4],[5597,4]]},"639":{"position":[[201,4],[5219,4]]},"645":{"position":[[107,4],[5796,4]]},"647":{"position":[[130,4],[5108,4]]},"649":{"position":[[107,4],[5144,4],[6169,4],[11152,4],[11802,4],[16800,4]]},"667":{"position":[[1390,4],[6353,4],[7562,4],[12525,4],[14383,4],[19361,4],[21220,4],[26183,4],[27456,4],[32424,4]]},"669":{"position":[[1363,4],[6331,4],[7612,4],[12595,4],[13956,4],[18929,4],[20279,4],[25252,4]]},"679":{"position":[[1077,4],[6050,4],[6695,4],[11663,4]]},"681":{"position":[[197,4],[5152,4],[6085,4],[11073,4]]},"683":{"position":[[176,4],[5491,4],[6449,4],[11584,4],[12711,4],[17852,4],[19017,4],[23990,4],[24680,4],[29643,4]]},"695":{"position":[[3181,4],[8049,4]]},"701":{"position":[[256,4],[1440,4],[2087,4],[3281,4],[3946,4],[5130,4],[5782,4],[6981,4],[7639,4],[8828,4],[9482,4],[10681,4]]},"703":{"position":[[2834,4],[4023,4],[4758,4],[9781,4],[10724,4],[11908,4]]},"705":{"position":[[1149,4],[6286,4],[7278,4],[8979,4],[9949,4],[11655,4]]},"707":{"position":[[2720,4],[7588,4]]},"726":{"position":[[211,4],[8732,4],[11529,4],[17976,4],[19666,4],[25833,4],[28269,4],[33237,4],[34028,4],[39001,4],[39645,4],[44633,4],[45287,4],[50280,4]]},"728":{"position":[[311,4],[5284,4],[8230,4],[13183,4],[14147,4],[19145,4],[24565,4],[29558,4],[32813,4],[37761,4],[42348,4],[47296,4]]},"745":{"position":[[1838,4],[6618,4],[7526,4],[12504,4],[13212,4],[17992,4],[18857,4],[23835,4],[24483,4],[29466,4],[32217,4],[37195,4],[37843,4],[42821,4]]},"747":{"position":[[2367,4],[8140,4],[9685,4],[14673,4]]},"749":{"position":[[312,4],[5188,4],[6553,4],[11556,4],[12448,4],[17426,4]]},"751":{"position":[[3009,4],[8204,4],[9897,4],[14895,4],[17327,4],[22195,4]]},"771":{"position":[[524,4],[5300,4],[6172,4],[10964,4],[11856,4],[17378,4],[19094,4],[24067,4],[24793,4],[29756,4]]},"773":{"position":[[2942,4],[8755,4],[10422,4],[15410,4]]},"775":{"position":[[2847,4],[8054,4],[9372,4],[15517,4],[17606,4],[22564,4]]},"777":{"position":[[3042,4],[8576,4],[10298,4],[15281,4]]},"789":{"position":[[2615,4],[9704,4]]},"795":{"position":[[446,4],[5399,4],[6134,4],[11107,4],[11855,4],[16870,4],[17769,4],[22727,4]]},"797":{"position":[[4561,4],[9494,4],[10362,4],[17005,4],[18905,4],[24490,4],[25848,4],[30801,4]]},"799":{"position":[[1102,4],[6909,4],[8543,4],[14340,4],[15469,4],[21271,4]]},"801":{"position":[[3343,4],[16080,4]]},"820":{"position":[[1839,4],[6631,4],[7551,4],[12544,4],[13259,4],[18035,4],[18897,4],[23870,4],[24515,4],[29498,4],[31737,4],[36710,4],[37355,4],[42333,4]]},"822":{"position":[[2122,4],[8417,4],[10359,4],[15352,4]]},"824":{"position":[[1955,4],[7608,4],[9272,4],[14280,4]]},"826":{"position":[[2828,4],[9251,4],[10942,4],[15955,4],[16700,4],[21723,4],[22397,4],[27430,4],[28189,4],[33212,4],[33886,4],[38909,4]]},"844":{"position":[[2081,4],[7092,4],[8062,4],[13065,4],[13792,4],[18803,4],[19730,4],[24733,4],[25473,4],[30511,4],[31630,4],[37797,4],[39434,4],[44437,4]]},"846":{"position":[[146,4],[5124,4],[7428,4],[12401,4]]},"848":{"position":[[6910,4],[12740,4],[14526,4],[19813,4],[20969,4],[26511,4],[27803,4],[33006,4],[34287,4],[39183,4],[40174,4],[45002,4],[46079,4],[51042,4],[51750,4],[56788,4]]}}}],["current",{"_index":200,"t":{"9":{"position":[[38,7]]},"45":{"position":[[31734,9]]},"77":{"position":[[252,9]]},"89":{"position":[[176,7]]},"210":{"position":[[147,7]]},"222":{"position":[[844,9]]},"347":{"position":[[825,7]]},"353":{"position":[[9,7]]},"363":{"position":[[1029,7]]},"408":{"position":[[1072,7]]},"454":{"position":[[1473,7]]},"482":{"position":[[3421,7]]},"484":{"position":[[655,7]]},"574":{"position":[[8,7]]},"639":{"position":[[5897,7]]},"689":{"position":[[743,7]]},"703":{"position":[[75,7],[2569,7],[4681,7]]},"717":{"position":[[565,7]]},"726":{"position":[[27384,7]]},"749":{"position":[[6167,7]]},"783":{"position":[[770,7]]}}}],["current_tim",{"_index":103,"t":{"3":{"position":[[1687,12],[2118,12],[2197,12],[2379,16],[2531,12],[2757,16],[2911,12],[3020,12]]}}}],["custom",{"_index":1656,"t":{"333":{"position":[[927,6],[955,6]]},"428":{"position":[[40,6],[149,9],[179,6],[407,6]]},"440":{"position":[[99,6]]},"789":{"position":[[717,9],[749,8],[1372,11],[1483,10],[1754,11],[2263,8],[3454,8],[3530,11],[5152,8],[7295,8],[7379,11],[9013,8],[10708,8],[11155,8]]},"793":{"position":[[177,8]]},"795":{"position":[[124,8],[6054,8]]},"797":{"position":[[2548,8],[2589,10],[2904,9],[3016,8],[3302,11],[3695,10],[3973,11]]},"801":{"position":[[443,9],[555,8],[1904,11],[2297,10],[2575,11],[4182,8],[4258,11],[7136,8],[11007,8],[11091,11],[14061,8],[17783,8],[19305,8]]},"803":{"position":[[656,9],[768,8],[2371,11],[2764,10],[3042,11]]}}}],["customer'",{"_index":2655,"t":{"789":{"position":[[214,10],[323,10]]}}}],["d",{"_index":496,"t":{"35":{"position":[[7887,1]]},"43":{"position":[[3260,1]]},"45":{"position":[[17454,1],[23648,1],[30199,1]]},"135":{"position":[[1470,1]]},"147":{"position":[[1712,1]]},"200":{"position":[[5055,1]]},"202":{"position":[[5280,1],[11034,1]]},"212":{"position":[[745,1],[3438,1]]},"250":{"position":[[1548,1]]},"252":{"position":[[1671,1]]},"265":{"position":[[5530,1]]},"267":{"position":[[5058,1],[10950,1]]},"279":{"position":[[1028,1],[2906,1]]},"281":{"position":[[2073,1],[3816,1]]},"285":{"position":[[6565,1],[12155,1],[18247,1],[23859,1]]},"294":{"position":[[5315,1]]},"296":{"position":[[5328,1]]},"311":{"position":[[5126,1],[10713,1],[17323,1]]},"327":{"position":[[1968,2]]},"329":{"position":[[499,1]]},"357":{"position":[[5493,1]]},"369":{"position":[[5424,1],[11029,1]]},"375":{"position":[[5558,1],[11719,1],[17533,1]]},"382":{"position":[[6388,1]]},"402":{"position":[[5165,1]]},"404":{"position":[[5393,1],[11235,1]]},"422":{"position":[[2630,1]]},"444":{"position":[[5923,1],[12170,1]]},"446":{"position":[[6265,1]]},"448":{"position":[[5264,1]]},"462":{"position":[[5439,1],[11068,1]]},"466":{"position":[[5404,1],[11203,1]]},"504":{"position":[[5084,1]]},"506":{"position":[[5405,1]]},"508":{"position":[[5466,1]]},"522":{"position":[[5477,1]]},"524":{"position":[[5578,1]]},"540":{"position":[[5101,1]]},"542":{"position":[[5741,1]]},"544":{"position":[[5536,1]]},"562":{"position":[[5943,1],[12094,1],[18089,1],[23785,1],[29406,1]]},"574":{"position":[[5463,1]]},"578":{"position":[[5454,1]]},"580":{"position":[[5194,1]]},"582":{"position":[[5204,1],[10718,1]]},"584":{"position":[[5047,1],[10783,1]]},"599":{"position":[[5413,1]]},"606":{"position":[[5866,1],[11906,1],[17937,1]]},"608":{"position":[[5597,1]]},"613":{"position":[[5566,1],[11478,1]]},"618":{"position":[[6035,1]]},"637":{"position":[[5793,1]]},"639":{"position":[[5415,1]]},"645":{"position":[[5992,1]]},"647":{"position":[[5304,1]]},"649":{"position":[[5340,1],[11348,1],[16996,1]]},"667":{"position":[[6549,1],[12721,1],[19557,1],[26379,1],[32620,1]]},"669":{"position":[[6527,1],[12791,1],[19125,1],[25448,1]]},"679":{"position":[[6246,1],[11859,1]]},"681":{"position":[[5348,1],[11269,1]]},"683":{"position":[[11780,1],[18048,1],[24186,1],[29839,1]]},"695":{"position":[[8245,1]]},"701":{"position":[[1636,1],[3477,1],[5326,1],[7177,1],[9024,1],[10877,1]]},"703":{"position":[[4219,1],[9977,1],[12104,1]]},"705":{"position":[[6482,1],[9175,1],[11851,1]]},"707":{"position":[[7784,1]]},"726":{"position":[[8928,1],[18172,1],[26029,1],[33433,1],[39197,1],[44829,1],[50476,1]]},"728":{"position":[[5480,1],[13379,1],[19341,1],[29754,1],[37957,1],[47492,1]]},"745":{"position":[[6814,1],[12700,1],[18188,1],[24031,1],[29662,1],[37391,1],[43017,1]]},"747":{"position":[[8336,1],[14869,1]]},"749":{"position":[[5384,1],[11752,1],[17622,1]]},"751":{"position":[[8400,1],[15091,1],[22391,1]]},"771":{"position":[[5496,1],[11160,1],[17574,1],[24263,1],[29952,1]]},"773":{"position":[[8951,1],[15606,1]]},"775":{"position":[[8250,1],[15713,1],[22760,1]]},"777":{"position":[[8772,1],[15477,1]]},"789":{"position":[[9900,1]]},"795":{"position":[[5595,1],[11303,1],[17066,1],[22923,1]]},"797":{"position":[[9690,1],[17201,1],[24686,1],[30997,1]]},"799":{"position":[[7105,1],[14536,1],[21467,1]]},"801":{"position":[[16276,1]]},"820":{"position":[[6827,1],[12740,1],[18231,1],[24066,1],[29694,1],[36906,1],[42529,1]]},"822":{"position":[[8613,1],[15548,1]]},"824":{"position":[[7804,1],[14476,1]]},"826":{"position":[[9447,1],[16151,1],[21919,1],[27626,1],[33408,1],[39105,1]]},"844":{"position":[[7288,1],[13261,1],[18999,1],[24929,1],[30707,1],[37993,1],[44633,1]]},"846":{"position":[[5320,1],[12597,1]]},"848":{"position":[[12936,1],[20009,1],[26707,1],[33202,1],[39379,1],[45198,1],[51238,1],[56984,1]]}}}],["d3233a67938f",{"_index":641,"t":{"45":{"position":[[4284,12],[4798,13]]}}}],["dani",{"_index":2252,"t":{"667":{"position":[[20484,4],[21106,4],[26900,6]]}}}],["data",{"_index":158,"t":{"5":{"position":[[421,4]]},"25":{"position":[[270,4]]},"29":{"position":[[535,4]]},"35":{"position":[[3371,5]]},"41":{"position":[[61,5]]},"45":{"position":[[3439,4],[3601,4],[3735,4],[3895,4],[14154,5],[14246,4],[20348,5],[20440,4],[26721,5],[26829,4]]},"53":{"position":[[50,4]]},"111":{"position":[[209,4],[275,4]]},"135":{"position":[[509,5],[601,4]]},"147":{"position":[[543,5],[651,4]]},"157":{"position":[[87,4],[153,4]]},"173":{"position":[[5338,5]]},"177":{"position":[[138,4],[283,4]]},"200":{"position":[[2034,5]]},"202":{"position":[[1989,5],[2081,4],[7736,5],[7828,4]]},"212":{"position":[[137,5]]},"224":{"position":[[18,4]]},"226":{"position":[[50,4]]},"228":{"position":[[46,4]]},"236":{"position":[[129,4],[157,5],[171,4]]},"250":{"position":[[554,5]]},"252":{"position":[[711,5]]},"254":{"position":[[73,4]]},"265":{"position":[[2269,5],[2361,4]]},"267":{"position":[[2045,5],[7685,5],[7777,4]]},"279":{"position":[[337,5],[1975,5]]},"281":{"position":[[1344,5],[2847,5]]},"285":{"position":[[3285,5],[3377,4],[9061,5],[14956,5],[15048,4],[20561,5],[20653,4]]},"294":{"position":[[2294,5]]},"296":{"position":[[2033,5],[2125,4]]},"311":{"position":[[2123,5],[7706,5],[13933,5]]},"317":{"position":[[567,4]]},"323":{"position":[[659,4]]},"357":{"position":[[2178,5],[2270,4]]},"369":{"position":[[2130,5],[2222,4],[7738,5],[7830,4]]},"375":{"position":[[2420,5],[8424,5],[8516,4],[14239,5],[14331,4]]},"382":{"position":[[3103,5],[3195,4]]},"402":{"position":[[2120,5]]},"404":{"position":[[2078,5],[2170,4],[7916,5],[8008,4]]},"422":{"position":[[1712,5]]},"444":{"position":[[2554,5],[8870,5],[8962,4]]},"446":{"position":[[2676,5]]},"448":{"position":[[1964,5],[2056,4]]},"462":{"position":[[2136,5],[2228,4],[7768,5],[7860,4]]},"466":{"position":[[2098,5],[2190,4],[7896,5],[7988,4]]},"482":{"position":[[6830,4]]},"484":{"position":[[1333,5]]},"504":{"position":[[2067,5]]},"506":{"position":[[2229,5]]},"508":{"position":[[2151,5],[2243,4]]},"522":{"position":[[2357,5]]},"524":{"position":[[2275,5],[2367,4]]},"540":{"position":[[2080,5]]},"542":{"position":[[2567,5]]},"544":{"position":[[2215,5],[2307,4]]},"562":{"position":[[2634,5],[8800,5],[8892,4],[14794,5],[14886,4],[20485,5],[20577,4],[26109,5],[26201,4]]},"574":{"position":[[2320,5]]},"578":{"position":[[2319,5]]},"580":{"position":[[2175,5]]},"582":{"position":[[1946,5],[2038,4],[7460,5],[7552,4]]},"584":{"position":[[2042,5],[7521,5],[7613,4]]},"599":{"position":[[2125,5],[2217,4]]},"606":{"position":[[2394,5],[2492,4],[3880,4],[8492,5],[8590,4],[9957,4],[14493,5],[14591,4],[15968,4]]},"608":{"position":[[2479,5],[2577,4],[3847,4]]},"613":{"position":[[2218,5],[2318,4],[8130,5],[8230,4]]},"618":{"position":[[2280,5],[2388,4]]},"637":{"position":[[2541,5]]},"639":{"position":[[2091,5],[2183,4]]},"645":{"position":[[967,4],[2354,4],[2523,5],[4068,4],[5455,4],[6870,4]]},"647":{"position":[[2004,5],[2096,4]]},"649":{"position":[[823,4],[2007,4],[2176,5],[3567,4],[4802,4],[5832,4],[8044,5],[8136,4],[13684,5],[13776,4]]},"667":{"position":[[3258,5],[3350,4],[9430,5],[9522,4],[16257,5],[16349,4],[23088,5],[23180,4],[29326,5],[29418,4]]},"669":{"position":[[3232,5],[3324,4],[9487,5],[9579,4],[15827,5],[15919,4],[22151,5],[22243,4]]},"679":{"position":[[2949,5],[3041,4],[8565,5],[8657,4]]},"681":{"position":[[2226,5],[7963,5],[8055,4]]},"683":{"position":[[2013,5],[2111,4],[3561,4],[8587,5],[14851,5],[20889,5],[20981,4],[26547,5],[26639,4]]},"695":{"position":[[5632,5]]},"701":{"position":[[672,5],[764,4],[2507,5],[2599,4],[4362,5],[4454,4],[6203,5],[6295,4],[8056,5],[8148,4],[9903,5],[9995,4]]},"703":{"position":[[3251,5],[3343,4],[6821,5],[11140,5],[11232,4]]},"705":{"position":[[3268,5],[7910,5],[8002,4],[10582,5],[10674,4]]},"707":{"position":[[5171,5]]},"726":{"position":[[4123,5],[14344,5],[22341,5],[27969,5],[30139,5],[30231,4],[35899,5],[35991,4],[41523,5],[41615,4],[47167,5],[47259,4]]},"728":{"position":[[2178,5],[2270,4],[10093,5],[10185,4],[16028,5],[16120,4],[26445,5],[26537,4],[34675,5],[34767,4],[44210,5],[44302,4]]},"745":{"position":[[3779,5],[9400,5],[9492,4],[15153,5],[20731,5],[20823,4],[26358,5],[26450,4],[34091,5],[34183,4],[39717,5],[39809,4]]},"747":{"position":[[4825,5],[11563,5],[11655,4]]},"749":{"position":[[2301,5],[8606,5],[14322,5],[14414,4]]},"751":{"position":[[5177,5],[11774,5],[11866,4],[19312,5]]},"771":{"position":[[2463,5],[8119,5],[14207,5],[20966,5],[21058,4],[26660,5],[26752,4]]},"773":{"position":[[5458,5],[12300,5],[12392,4]]},"775":{"position":[[5021,5],[12054,5],[19472,5],[19564,4]]},"777":{"position":[[5399,5],[12173,5],[12265,4]]},"783":{"position":[[160,4]]},"789":{"position":[[5771,5]]},"795":{"position":[[2310,5],[2402,4],[8006,5],[8098,4],[13914,5],[19634,5],[19726,4]]},"797":{"position":[[6416,5],[6508,4],[13275,5],[21269,5],[27712,5],[27804,4]]},"799":{"position":[[484,4],[3576,5],[10764,5],[10856,4],[17691,5],[17783,4]]},"801":{"position":[[9483,5]]},"820":{"position":[[3786,5],[9431,5],[9523,4],[15198,5],[20769,5],[20861,4],[26390,5],[26482,4],[33609,5],[33701,4],[39229,5],[39321,4]]},"822":{"position":[[4880,5],[12239,5],[12331,4]]},"824":{"position":[[4353,5],[11153,5],[11245,4]]},"826":{"position":[[5631,5],[12830,5],[12922,4],[18591,5],[18683,4],[24293,5],[24385,4],[30080,5],[30172,4],[35777,5],[35869,4]]},"844":{"position":[[4138,5],[9946,5],[10038,4],[15849,5],[21614,5],[21706,4],[27370,5],[27462,4],[34305,5],[41318,5],[41410,4]]},"846":{"position":[[2019,5],[2111,4],[5869,4],[9300,5],[9392,4]]},"848":{"position":[[9415,5],[16721,5],[23311,5],[29975,5],[36286,5],[42139,5],[47946,5],[48038,4],[53648,5],[53740,4]]}}}],["data.allow",{"_index":1209,"t":{"173":{"position":[[5530,16]]}}}],["data.authorizationmodelid",{"_index":444,"t":{"35":{"position":[[3525,25]]}}}],["databas",{"_index":977,"t":{"153":{"position":[[67,8],[173,8],[230,9],[332,8],[413,8],[474,8],[520,8],[634,8],[1424,8],[1457,8]]},"155":{"position":[[91,8],[175,8],[308,8],[1053,8],[2235,8],[2373,8],[2680,8],[2845,8]]},"210":{"position":[[315,8]]},"212":{"position":[[2775,9],[2822,8],[5403,9],[5450,8]]},"238":{"position":[[307,8]]},"317":{"position":[[582,9],[664,8],[684,8]]},"321":{"position":[[70,9],[138,9]]},"323":{"position":[[435,8]]},"325":{"position":[[267,8]]},"327":{"position":[[115,8],[379,8],[2482,8]]},"329":{"position":[[45,8]]},"480":{"position":[[501,9]]}}}],["database'",{"_index":991,"t":{"153":{"position":[[750,10],[1018,10]]}}}],["datastor",{"_index":1332,"t":{"210":{"position":[[370,10]]},"212":{"position":[[1158,9],[1188,9],[1403,9],[1433,9],[3017,9],[3110,9],[3845,9],[3872,9],[4070,9],[4097,9]]},"220":{"position":[[137,9]]}}}],["date",{"_index":906,"t":{"109":{"position":[[779,4],[840,4],[883,4]]},"317":{"position":[[423,6]]},"673":{"position":[[306,5]]}}}],["david",{"_index":2856,"t":{"840":{"position":[[154,5],[596,5]]},"842":{"position":[[244,5],[786,5]]},"844":{"position":[[368,5],[31360,5],[32455,5],[33942,5],[35815,5],[37312,5],[39011,5],[45244,5],[45287,5],[45428,5],[45464,5],[45601,5],[45638,5]]},"846":{"position":[[13202,5],[13245,5],[13386,5],[13422,5],[13560,5],[13597,5]]},"848":{"position":[[288,5],[366,5],[441,5],[571,5],[1008,6],[40073,5],[46001,5],[51653,5],[58358,5],[58394,5],[58446,5],[58483,5],[58535,5],[58567,5],[58614,5],[58657,5],[58715,5],[58763,5]]}}}],["day",{"_index":56,"t":{"3":{"position":[[852,5]]}}}],["deb",{"_index":940,"t":{"113":{"position":[[1397,5],[1439,5]]},"117":{"position":[[13,5]]}}}],["debian",{"_index":945,"t":{"113":{"position":[[1491,7]]},"117":{"position":[[65,7]]}}}],["debug",{"_index":2164,"t":{"613":{"position":[[19,9]]}}}],["decid",{"_index":1748,"t":{"410":{"position":[[54,7]]},"548":{"position":[[1562,6]]},"781":{"position":[[165,7]]}}}],["decis",{"_index":15,"t":{"3":{"position":[[180,9]]},"45":{"position":[[276,9]]},"472":{"position":[[443,9]]},"705":{"position":[[981,9]]}}}],["declar",{"_index":26,"t":{"3":{"position":[[369,7]]},"169":{"position":[[650,7]]},"418":{"position":[[565,7]]}}}],["decor",{"_index":1173,"t":{"173":{"position":[[35,9],[687,9],[720,9]]}}}],["decreas",{"_index":1497,"t":{"228":{"position":[[387,8]]}}}],["deduc",{"_index":2486,"t":{"728":{"position":[[30415,7]]}}}],["deep",{"_index":1060,"t":{"155":{"position":[[2099,4]]}}}],["deeper",{"_index":2491,"t":{"730":{"position":[[683,6]]},"779":{"position":[[101,6]]},"850":{"position":[[372,6]]}}}],["def",{"_index":481,"t":{"35":{"position":[[6303,3]]},"43":{"position":[[2734,3]]}}}],["default",{"_index":403,"t":{"35":{"position":[[1091,8],[2281,8],[4111,8],[5596,8]]},"43":{"position":[[223,8],[701,8],[1649,8]]},"45":{"position":[[12646,8],[13500,8],[14799,8],[15910,8],[18840,8],[19694,8],[20993,8],[22104,8],[25194,8],[26069,8],[27422,8],[28575,8]]},"103":{"position":[[224,8]]},"113":{"position":[[540,8]]},"133":{"position":[[364,8],[915,8],[1800,8],[2532,8]]},"145":{"position":[[364,8],[915,8],[1800,8],[2532,8]]},"173":{"position":[[519,8],[1256,8],[4251,8],[4674,8]]},"183":{"position":[[313,8],[940,8],[1735,8],[2463,8],[3095,8]]},"185":{"position":[[661,8],[1429,8],[2463,8],[3565,8],[4224,8]]},"187":{"position":[[537,8],[1454,8],[2626,8],[4126,8],[4785,8]]},"200":{"position":[[477,8],[1286,8],[2695,8],[3830,8]]},"202":{"position":[[487,8],[1338,8],[2634,8],[3742,8],[6231,8],[7084,8],[8382,8],[9492,8]]},"208":{"position":[[316,7]]},"210":{"position":[[551,7]]},"212":{"position":[[103,8]]},"214":{"position":[[94,9]]},"216":{"position":[[240,7]]},"218":{"position":[[467,7]]},"222":{"position":[[672,7],[754,7]]},"224":{"position":[[39,7]]},"226":{"position":[[130,8]]},"228":{"position":[[82,8],[223,7],[522,7]]},"230":{"position":[[37,8],[211,9]]},"248":{"position":[[364,8],[915,8],[1800,8],[2532,8]]},"265":{"position":[[787,8],[1628,8],[2914,8],[4012,8]]},"267":{"position":[[498,8],[1302,8],[2706,8],[3836,8],[6202,8],[7044,8],[8331,8],[9430,8]]},"277":{"position":[[336,8],[887,8],[1772,8],[2504,8]]},"279":{"position":[[3220,7]]},"285":{"position":[[1792,8],[2639,8],[3931,8],[5035,8],[7430,8],[8276,8],[9722,8],[10894,8],[13454,8],[14305,8],[15601,8],[16709,8],[19056,8],[19909,8],[21207,8],[22317,8]]},"294":{"position":[[739,8],[1547,8],[2955,8],[4089,8]]},"296":{"position":[[530,8],[1382,8],[2679,8],[3788,8]]},"311":{"position":[[584,8],[1384,8],[2784,8],[3910,8],[6165,8],[6966,8],[8367,8],[9494,8],[11979,8],[12949,8],[14594,8],[15927,8]]},"357":{"position":[[660,8],[1519,8],[2823,8],[3939,8]]},"369":{"position":[[626,8],[1478,8],[2775,8],[3884,8],[6236,8],[7087,8],[8383,8],[9491,8]]},"375":{"position":[[745,8],[1613,8],[3081,8],[4275,8],[6921,8],[7773,8],[9070,8],[10179,8],[12735,8],[13587,8],[14884,8],[15993,8]]},"382":{"position":[[1605,8],[2454,8],[3748,8],[4854,8]]},"402":{"position":[[539,8],[1360,8],[2781,8],[3928,8]]},"404":{"position":[[560,8],[1419,8],[2723,8],[3839,8],[6397,8],[7257,8],[8562,8],[9679,8]]},"424":{"position":[[519,8],[777,7]]},"444":{"position":[[608,8],[1582,8],[3215,8],[4525,8],[7362,8],[8216,8],[9515,8],[10626,8]]},"446":{"position":[[510,8],[1594,8],[3337,8],[4757,8]]},"448":{"position":[[456,8],[1310,8],[2609,8],[3720,8]]},"462":{"position":[[626,8],[1481,8],[2781,8],[3893,8],[6260,8],[7114,8],[8413,8],[9524,8]]},"466":{"position":[[586,8],[1442,8],[2743,8],[3856,8],[6385,8],[7241,8],[8542,8],[9655,8]]},"504":{"position":[[514,8],[1321,8],[2728,8],[3861,8]]},"506":{"position":[[516,8],[1403,8],[2890,8],[4103,8]]},"508":{"position":[[633,8],[1492,8],[2796,8],[3912,8]]},"522":{"position":[[700,8],[1559,8],[3018,8],[4203,8]]},"524":{"position":[[765,8],[1620,8],[2920,8],[4032,8]]},"540":{"position":[[523,8],[1332,8],[2741,8],[3876,8]]},"542":{"position":[[856,8],[1742,8],[3228,8],[4440,8]]},"544":{"position":[[693,8],[1554,8],[2860,8],[3978,8]]},"562":{"position":[[748,8],[1692,8],[3295,8],[4575,8],[7296,8],[8148,8],[9445,8],[10554,8],[13291,8],[14143,8],[15440,8],[16549,8],[18977,8],[19831,8],[21130,8],[22241,8],[24603,8],[25456,8],[26754,8],[27864,8]]},"574":{"position":[[602,8],[1462,8],[2981,8],[4177,8]]},"578":{"position":[[609,8],[1465,8],[2980,8],[4172,8]]},"580":{"position":[[620,8],[1428,8],[2836,8],[3970,8]]},"582":{"position":[[466,8],[1306,8],[2591,8],[3688,8],[5980,8],[6820,8],[8105,8],[9202,8]]},"584":{"position":[[503,8],[1303,8],[2703,8],[3829,8],[6040,8],[6881,8],[8167,8],[9265,8]]},"599":{"position":[[625,8],[1475,8],[2770,8],[3877,8]]},"606":{"position":[[875,8],[1770,8],[3162,8],[4322,8],[7031,8],[7907,8],[9260,8],[10399,8],[13012,8],[13898,8],[15261,8],[16410,8]]},"608":{"position":[[1078,8],[1855,8],[3129,8],[4171,8]]},"613":{"position":[[616,8],[1505,8],[2866,8],[4035,8],[6528,8],[7417,8],[8778,8],[9947,8]]},"618":{"position":[[537,8],[1519,8],[2981,8],[4255,8]]},"620":{"position":[[89,8],[173,8],[247,7]]},"637":{"position":[[752,8],[1677,8],[3202,8],[4453,8]]},"639":{"position":[[567,8],[1429,8],[2736,8],[3855,8]]},"645":{"position":[[477,8],[1501,8],[3184,8],[4544,8]]},"647":{"position":[[496,8],[1350,8],[2649,8],[3760,8]]},"649":{"position":[[477,8],[1357,8],[2837,8],[4043,8],[6535,8],[7390,8],[8690,8],[9802,8],[12168,8],[13026,8],[14329,8],[15444,8]]},"667":{"position":[[1756,8],[2607,8],[3903,8],[5011,8],[7928,8],[8779,8],[10075,8],[11183,8],[14749,8],[15603,8],[16902,8],[18013,8],[21586,8],[22437,8],[23733,8],[24841,8],[27822,8],[28674,8],[29971,8],[31080,8]]},"669":{"position":[[1729,8],[2581,8],[3878,8],[4987,8],[7978,8],[8833,8],[10133,8],[11245,8],[14322,8],[15175,8],[16473,8],[17583,8],[20645,8],[21498,8],[22796,8],[23906,8]]},"679":{"position":[[1443,8],[2296,8],[3594,8],[4704,8],[7061,8],[7913,8],[9210,8],[10319,8]]},"681":{"position":[[567,8],[1427,8],[2887,8],[4073,8],[6451,8],[7307,8],[8608,8],[9721,8]]},"683":{"position":[[542,8],[1505,8],[2905,8],[4127,8],[6819,8],[7704,8],[9248,8],[10469,8],[13081,8],[13967,8],[15512,8],[16734,8],[19383,8],[20236,8],[21534,8],[22644,8],[25046,8],[25897,8],[27193,8],[28301,8]]},"703":{"position":[[5128,8],[6005,8],[7482,8],[8685,8]]},"705":{"position":[[1519,8],[2424,8],[3929,8],[5160,8]]},"726":{"position":[[581,8],[2235,8],[4784,8],[6814,8],[11899,8],[13093,8],[15005,8],[16545,8],[20036,8],[21160,8],[23002,8],[24472,8],[28635,8],[29487,8],[30784,8],[31893,8],[34394,8],[35247,8],[36545,8],[37655,8],[40011,8],[40867,8],[42168,8],[43281,8],[45653,8],[46510,8],[47812,8],[48926,8]]},"728":{"position":[[677,8],[1530,8],[2828,8],[3938,8],[8596,8],[9445,8],[10739,8],[11845,8],[14513,8],[15371,8],[16674,8],[17789,8],[24931,8],[25788,8],[27090,8],[28204,8],[33179,8],[34027,8],[35320,8],[36425,8],[42714,8],[43562,8],[44855,8],[45960,8]]},"745":{"position":[[2208,8],[3024,8],[4440,8],[5582,8],[7892,8],[8746,8],[10045,8],[11156,8],[13582,8],[14398,8],[15814,8],[16956,8],[19223,8],[20077,8],[21376,8],[22487,8],[24849,8],[25704,8],[27004,8],[28116,8],[32583,8],[33437,8],[34736,8],[35847,8],[38209,8],[39063,8],[40362,8],[41473,8]]},"747":{"position":[[2737,8],[3782,8],[5486,8],[6867,8],[10051,8],[10907,8],[12208,8],[13321,8]]},"749":{"position":[[682,8],[1522,8],[2962,8],[4128,8],[6923,8],[7795,8],[9267,8],[10465,8],[12814,8],[13668,8],[14967,8],[16078,8]]},"751":{"position":[[3379,8],[4279,8],[5838,8],[7074,8],[9352,8],[10263,8],[11121,8],[12424,8],[13539,8],[17697,8],[18535,8],[19973,8],[21137,8]]},"771":{"position":[[894,8],[1709,8],[3124,8],[4265,8],[6542,8],[7361,8],[8780,8],[9925,8],[12226,8],[13188,8],[14868,8],[16176,8],[19460,8],[20313,8],[21611,8],[22721,8],[25159,8],[26010,8],[27306,8],[28414,8]]},"773":{"position":[[3312,8],[4327,8],[6119,8],[7490,8],[10788,8],[11644,8],[12945,8],[14058,8]]},"775":{"position":[[3217,8],[4120,8],[5682,8],[6921,8],[9742,8],[10840,8],[12715,8],[14169,8],[17972,8],[18822,8],[20117,8],[21224,8]]},"777":{"position":[[3412,8],[4377,8],[6060,8],[7371,8],[10664,8],[11519,8],[12819,8],[13931,8]]},"789":{"position":[[2985,8],[4320,8],[6432,8],[8123,8]]},"795":{"position":[[812,8],[1661,8],[2955,8],[4061,8],[6500,8],[7353,8],[8651,8],[9761,8],[12225,8],[13100,8],[14575,8],[15776,8],[18135,8],[18985,8],[20280,8],[21387,8]]},"797":{"position":[[4927,8],[5772,8],[7062,8],[8164,8],[10732,8],[11975,8],[13936,8],[15525,8],[19275,8],[20273,8],[21930,8],[23264,8],[26214,8],[27063,8],[28357,8],[29463,8]]},"799":{"position":[[1472,8],[2525,8],[4237,8],[5626,8],[8909,8],[9927,8],[11409,8],[12716,8],[15835,8],[16854,8],[18337,8],[19645,8]]},"801":{"position":[[3713,8],[6304,8],[10144,8],[13171,8]]},"820":{"position":[[2209,8],[3028,8],[4447,8],[5592,8],[7917,8],[8774,8],[10076,8],[11190,8],[13629,8],[14444,8],[15859,8],[17000,8],[19263,8],[20116,8],[21414,8],[22524,8],[24881,8],[25736,8],[27036,8],[28148,8],[32103,8],[32956,8],[34254,8],[35364,8],[37721,8],[38575,8],[39874,8],[40985,8]]},"822":{"position":[[2492,8],[3628,8],[5541,8],[7033,8],[10725,8],[11582,8],[12884,8],[13998,8]]},"824":{"position":[[2325,8],[3340,8],[5014,8],[6365,8],[9638,8],[10498,8],[11803,8],[12920,8]]},"826":{"position":[[3198,8],[4386,8],[6292,8],[7826,8],[11308,8],[12169,8],[13475,8],[14593,8],[17066,8],[17929,8],[19237,8],[20357,8],[22763,8],[23628,8],[24938,8],[26060,8],[28555,8],[29418,8],[30726,8],[31846,8],[34252,8],[35115,8],[36423,8],[37543,8]]},"844":{"position":[[2451,8],[3325,8],[4799,8],[5999,8],[8428,8],[9287,8],[10591,8],[11707,8],[14162,8],[15036,8],[16510,8],[17710,8],[20096,8],[20955,8],[22259,8],[23375,8],[25839,8],[26705,8],[28016,8],[29139,8],[32000,8],[33124,8],[34966,8],[36436,8],[39800,8],[40659,8],[41963,8],[43079,8]]},"846":{"position":[[512,8],[1366,8],[2665,8],[3776,8],[7794,8],[8647,8],[9945,8],[11055,8]]},"848":{"position":[[7280,8],[8319,8],[10076,8],[11461,8],[14896,8],[15839,8],[17382,8],[18651,8],[21339,8],[22326,8],[23972,8],[25295,8],[28173,8],[29075,8],[30636,8],[31874,8],[34657,8],[35502,8],[36947,8],[38118,8],[40544,8],[41372,8],[42800,8],[43954,8],[46445,8],[47296,8],[48592,8],[49700,8],[52116,8],[52982,8],[54293,8],[55416,8]]}}}],["defin",{"_index":41,"t":{"3":{"position":[[578,8],[1532,6]]},"7":{"position":[[731,7]]},"9":{"position":[[577,6]]},"35":{"position":[[131,6],[153,6],[175,6],[1159,6],[2350,6],[4206,6],[5671,6]]},"43":{"position":[[290,6],[770,6],[1744,6]]},"45":{"position":[[505,6],[693,7],[872,6],[894,6],[919,6],[941,6],[1541,6],[1692,6],[1729,6],[1769,6],[1806,6],[1864,6],[2958,6],[4073,6],[5255,7],[5317,7],[6605,7],[6682,6],[6704,6],[6729,6],[6751,6],[7837,6],[11368,6],[11400,6],[12714,6],[13569,6],[14894,6],[15985,6],[18908,6],[19763,6],[21088,6],[22179,6],[25262,6],[26138,6],[27517,6],[28650,6]]},"47":{"position":[[30,6]]},"49":{"position":[[42,7]]},"51":{"position":[[89,6]]},"55":{"position":[[53,6]]},"59":{"position":[[23,7],[85,7]]},"83":{"position":[[198,6],[242,6],[267,6],[331,6],[362,6],[438,6],[537,6],[562,6],[626,6],[657,6],[733,6]]},"85":{"position":[[1097,6],[1394,7]]},"87":{"position":[[146,6],[168,6],[200,6],[666,7]]},"89":{"position":[[343,6],[404,6],[435,6],[1462,6],[2644,8]]},"91":{"position":[[193,6]]},"93":{"position":[[211,6]]},"95":{"position":[[278,6]]},"97":{"position":[[911,6],[932,6],[963,6],[1840,6]]},"113":{"position":[[609,6]]},"133":{"position":[[432,6],[984,6],[1895,6],[2607,6]]},"145":{"position":[[432,6],[984,6],[1895,6],[2607,6]]},"173":{"position":[[4743,6]]},"177":{"position":[[202,7]]},"183":{"position":[[381,6],[1009,6],[1830,6],[2538,6]]},"185":{"position":[[729,6],[1498,6],[2558,6],[3640,6]]},"187":{"position":[[605,6],[1523,6],[2721,6],[4201,6]]},"191":{"position":[[371,6],[419,6],[1228,7],[1290,7],[1496,6]]},"195":{"position":[[150,7],[212,7],[418,6]]},"200":{"position":[[545,6],[1355,6],[2790,6],[3905,6]]},"202":{"position":[[555,6],[1407,6],[2729,6],[3817,6],[6299,6],[7153,6],[8477,6],[9567,6]]},"210":{"position":[[570,7]]},"248":{"position":[[432,6],[984,6],[1895,6],[2607,6]]},"258":{"position":[[318,6],[947,7],[1009,7],[1215,6]]},"262":{"position":[[150,7],[212,7],[418,6]]},"265":{"position":[[855,6],[1697,6],[3009,6],[4087,6]]},"267":{"position":[[566,6],[1371,6],[2801,6],[3911,6],[6270,6],[7113,6],[8426,6],[9505,6]]},"277":{"position":[[404,6],[956,6],[1867,6],[2579,6]]},"281":{"position":[[109,6],[153,6],[207,6]]},"285":{"position":[[361,6],[407,6],[1860,6],[2708,6],[4026,6],[5110,6],[7498,6],[8345,6],[9817,6],[10969,6],[13522,6],[14374,6],[15696,6],[16784,6],[19124,6],[19978,6],[21302,6],[22392,6],[24659,7],[24721,7],[24927,6]]},"291":{"position":[[150,7],[212,7],[418,6]]},"294":{"position":[[807,6],[1616,6],[3050,6],[4164,6]]},"296":{"position":[[598,6],[1451,6],[2774,6],[3863,6]]},"302":{"position":[[397,6],[462,6],[486,6],[1549,7],[1611,7],[1817,6]]},"308":{"position":[[150,7],[212,7],[418,6]]},"311":{"position":[[652,6],[1453,6],[2879,6],[3985,6],[6233,6],[7035,6],[8462,6],[9569,6],[12047,6],[13018,6],[14689,6],[16002,6]]},"331":{"position":[[61,6],[334,8]]},"347":{"position":[[441,6],[463,6],[1360,7],[1422,7],[1628,6]]},"351":{"position":[[150,7],[212,7],[418,6]]},"355":{"position":[[89,8],[226,6],[258,6]]},"357":{"position":[[728,6],[1588,6],[2918,6],[4014,6]]},"363":{"position":[[500,6],[555,6],[1858,7],[1920,7],[2126,6]]},"367":{"position":[[150,7],[212,7],[418,6]]},"369":{"position":[[694,6],[1547,6],[2870,6],[3959,6],[6304,6],[7156,6],[8478,6],[9566,6]]},"371":{"position":[[271,6],[294,6],[349,6]]},"373":{"position":[[358,6],[381,6],[452,6]]},"375":{"position":[[813,6],[1682,6],[3176,6],[4350,6],[6989,6],[7842,6],[9165,6],[10254,6],[12803,6],[13656,6],[14979,6],[16068,6]]},"382":{"position":[[98,6],[144,6],[1673,6],[2523,6],[3843,6],[4929,6]]},"384":{"position":[[103,6],[137,6]]},"396":{"position":[[341,6],[363,6],[939,7],[1001,7],[1207,6]]},"398":{"position":[[150,7],[212,7],[418,6]]},"402":{"position":[[607,6],[1429,6],[2876,6],[4003,6]]},"404":{"position":[[628,6],[1488,6],[2818,6],[3914,6],[6465,6],[7326,6],[8657,6],[9754,6]]},"408":{"position":[[911,7]]},"412":{"position":[[147,6],[191,6],[213,6],[281,6],[303,6],[325,6],[1405,7],[1569,6],[1613,6],[1637,6],[1705,6],[1729,6],[1751,6]]},"414":{"position":[[368,7]]},"416":{"position":[[1267,6],[1389,6],[1433,6],[1457,6],[1539,6],[1563,6],[1599,6]]},"418":{"position":[[752,6],[823,6],[2389,7],[2585,8],[2794,7]]},"422":{"position":[[930,6],[968,6]]},"428":{"position":[[781,8]]},"430":{"position":[[551,6],[583,6]]},"442":{"position":[[331,6],[378,6],[435,6]]},"444":{"position":[[676,6],[1651,6],[3310,6],[4600,6],[7430,6],[8285,6],[9610,6],[10701,6]]},"446":{"position":[[578,6],[1663,6],[3432,6],[4832,6]]},"448":{"position":[[524,6],[1379,6],[2704,6],[3795,6]]},"454":{"position":[[752,6],[781,6],[803,6],[856,6],[2846,7],[2908,7],[3114,6]]},"460":{"position":[[150,7],[212,7],[418,6]]},"462":{"position":[[694,6],[1550,6],[2876,6],[3968,6],[6328,6],[7183,6],[8508,6],[9599,6]]},"464":{"position":[[235,6],[264,6],[286,6],[311,6],[387,6]]},"466":{"position":[[654,6],[1511,6],[2838,6],[3931,6],[6453,6],[7310,6],[8637,6],[9730,6]]},"470":{"position":[[340,8]]},"472":{"position":[[3,6],[746,7]]},"474":{"position":[[0,8],[354,8],[474,6]]},"476":{"position":[[474,8]]},"478":{"position":[[4048,8]]},"480":{"position":[[23,7],[2902,6],[2917,6],[2931,6],[2946,6],[2961,6],[2979,6],[2996,6],[3014,6],[3061,6],[3075,6],[3090,6],[3105,6],[3131,6],[3159,6],[3204,6],[3240,6],[3254,6],[3282,6]]},"482":{"position":[[514,6],[1132,6],[1453,7],[2866,6],[2931,8],[3174,8],[3860,6],[4547,6],[5305,7],[5348,6],[6139,6],[7324,6],[7558,7],[8505,6],[8983,6],[9354,6],[9507,6],[9549,6],[9592,6],[9635,6],[9659,6],[9714,6],[9822,6],[9877,6],[10033,6],[10100,6],[10142,6],[10185,6],[10228,6],[10252,6],[10307,6],[10415,6],[10470,6]]},"484":{"position":[[14,7],[1365,7]]},"486":{"position":[[28,8],[203,8]]},"492":{"position":[[386,6],[432,6],[1231,7],[1293,7],[1499,6]]},"496":{"position":[[150,7],[212,7],[418,6]]},"500":{"position":[[368,6],[414,6],[438,6]]},"502":{"position":[[172,6],[218,6],[242,6]]},"504":{"position":[[582,6],[1390,6],[2823,6],[3936,6]]},"506":{"position":[[584,6],[1472,6],[2985,6],[4178,6]]},"508":{"position":[[701,6],[1561,6],[2891,6],[3987,6]]},"514":{"position":[[331,6],[1001,7],[1063,7],[1269,6]]},"518":{"position":[[150,7],[212,7],[418,6]]},"522":{"position":[[768,6],[1628,6],[3113,6],[4278,6]]},"524":{"position":[[833,6],[1689,6],[3015,6],[4107,6]]},"530":{"position":[[346,6],[978,7],[1040,7],[1246,6]]},"534":{"position":[[150,7],[212,7],[418,6]]},"538":{"position":[[11,6],[225,6],[274,6]]},"540":{"position":[[591,6],[1401,6],[2836,6],[3951,6]]},"542":{"position":[[924,6],[1811,6],[3323,6],[4515,6]]},"544":{"position":[[761,6],[1623,6],[2955,6],[4053,6]]},"550":{"position":[[348,6],[369,6],[1090,7],[1152,7],[1358,6]]},"554":{"position":[[150,7],[212,7],[418,6]]},"556":{"position":[[414,6]]},"558":{"position":[[326,6],[347,6]]},"560":{"position":[[275,6],[798,6],[819,6],[841,6],[869,6]]},"562":{"position":[[816,6],[1761,6],[3390,6],[4650,6],[7364,6],[8217,6],[9540,6],[10629,6],[13359,6],[14212,6],[15535,6],[16624,6],[19045,6],[19900,6],[21225,6],[22316,6],[24671,6],[25525,6],[26849,6],[27939,6]]},"568":{"position":[[306,6],[931,7],[993,7],[1199,6]]},"572":{"position":[[150,7],[212,7],[418,6]]},"574":{"position":[[670,6],[1531,6],[3076,6],[4252,6]]},"576":{"position":[[131,6],[177,6],[216,6],[1031,7],[1082,7]]},"578":{"position":[[677,6],[1534,6],[3075,6],[4247,6]]},"580":{"position":[[688,6],[1497,6],[2931,6],[4045,6]]},"582":{"position":[[534,6],[1375,6],[2686,6],[3763,6],[6048,6],[6889,6],[8200,6],[9277,6]]},"584":{"position":[[571,6],[1372,6],[2798,6],[3904,6],[6108,6],[6950,6],[8262,6],[9340,6]]},"590":{"position":[[414,6],[436,6],[1402,7],[1464,7],[1670,6]]},"594":{"position":[[150,7],[212,7],[418,6]]},"599":{"position":[[693,6],[1544,6],[2865,6],[3952,6]]},"606":{"position":[[943,6],[1839,6],[3257,6],[4397,6],[7099,6],[7976,6],[9355,6],[10474,6],[13080,6],[13967,6],[15356,6],[16485,6]]},"608":{"position":[[1146,6],[1924,6],[3224,6],[4246,6]]},"613":{"position":[[684,6],[1574,6],[2961,6],[4110,6],[6596,6],[7486,6],[8873,6],[10022,6]]},"618":{"position":[[605,6],[1588,6],[3076,6],[4330,6]]},"626":{"position":[[325,7]]},"628":{"position":[[366,6],[410,6],[1175,7],[1237,7],[1443,6]]},"632":{"position":[[150,7],[212,7],[418,6]]},"635":{"position":[[199,6],[223,6],[267,6]]},"637":{"position":[[820,6],[1746,6],[3297,6],[4528,6]]},"639":{"position":[[635,6],[1498,6],[2831,6],[3930,6]]},"643":{"position":[[135,6],[166,6],[250,6],[1119,7],[1518,6],[1606,8]]},"645":{"position":[[545,6],[1570,6],[3279,6],[4619,6]]},"647":{"position":[[564,6],[1419,6],[2744,6],[3835,6]]},"649":{"position":[[545,6],[1426,6],[2932,6],[4118,6],[6603,6],[7459,6],[8785,6],[9877,6],[12236,6],[13095,6],[14424,6],[15519,6]]},"655":{"position":[[519,7],[581,7],[787,6]]},"659":{"position":[[150,7],[212,7],[418,6]]},"663":{"position":[[305,6],[358,6],[413,6]]},"667":{"position":[[116,6],[169,6],[224,6],[1824,6],[2676,6],[3998,6],[5086,6],[7996,6],[8848,6],[10170,6],[11258,6],[14817,6],[15672,6],[16997,6],[18088,6],[21654,6],[22506,6],[23828,6],[24916,6],[27890,6],[28743,6],[30066,6],[31155,6]]},"669":{"position":[[177,6],[199,6],[254,6],[1797,6],[2650,6],[3973,6],[5062,6],[8046,6],[8902,6],[10228,6],[11320,6],[14390,6],[15244,6],[16568,6],[17658,6],[20713,6],[21567,6],[22891,6],[23981,6]]},"675":{"position":[[223,7],[285,7],[491,6]]},"677":{"position":[[304,6],[326,6],[1027,6],[1049,6]]},"679":{"position":[[306,6],[328,6],[360,6],[385,6],[1511,6],[2365,6],[3689,6],[4779,6],[7129,6],[7982,6],[9305,6],[10394,6]]},"681":{"position":[[635,6],[1496,6],[2982,6],[4148,6],[6519,6],[7376,6],[8703,6],[9796,6]]},"683":{"position":[[610,6],[1574,6],[3000,6],[4202,6],[6887,6],[7773,6],[9343,6],[10544,6],[13149,6],[14036,6],[15607,6],[16809,6],[19451,6],[20305,6],[21629,6],[22719,6],[25114,6],[25966,6],[27288,6],[28376,6]]},"685":{"position":[[166,6],[188,6]]},"693":{"position":[[24,7],[86,7]]},"695":{"position":[[929,6],[951,6],[982,6],[1035,6],[1064,6],[1095,6],[1138,6],[1221,6],[1248,6],[1272,6]]},"703":{"position":[[1122,6],[1144,6],[1195,6],[1249,6],[1312,6],[5196,6],[6074,6],[7577,6],[8760,6]]},"705":{"position":[[1587,6],[2493,6],[4024,6],[5235,6]]},"707":{"position":[[129,6],[151,6],[202,6],[256,6],[319,6],[373,6],[402,6],[433,6],[476,6],[559,6],[586,6],[610,6]]},"724":{"position":[[662,6],[713,6],[775,6]]},"726":{"position":[[649,6],[2304,6],[4879,6],[6889,6],[11967,6],[13162,6],[15100,6],[16620,6],[20104,6],[21229,6],[23097,6],[24547,6],[28703,6],[29556,6],[30879,6],[31968,6],[34462,6],[35316,6],[36640,6],[37730,6],[40079,6],[40936,6],[42263,6],[43356,6],[45721,6],[46579,6],[47907,6],[49001,6]]},"728":{"position":[[745,6],[1599,6],[2923,6],[4013,6],[6138,6],[6169,6],[7202,6],[7233,6],[7275,6],[7337,6],[8664,6],[9514,6],[10834,6],[11920,6],[14581,6],[15440,6],[16769,6],[17864,6],[19966,6],[20838,6],[20869,6],[23389,6],[23420,6],[23497,6],[23559,6],[24999,6],[25857,6],[27185,6],[28279,6],[31110,6],[31141,6],[31225,6],[31259,6],[31336,6],[33247,6],[34096,6],[35415,6],[36500,6],[38960,6],[38991,6],[39534,6],[39565,6],[40638,6],[40669,6],[40743,6],[40777,6],[40854,6],[42782,6],[43631,6],[44950,6],[46035,6]]},"745":{"position":[[338,6],[360,6],[383,6],[405,6],[431,6],[1302,6],[2276,6],[3093,6],[4535,6],[5657,6],[7960,6],[8815,6],[10140,6],[11231,6],[13650,6],[14467,6],[15909,6],[17031,6],[19291,6],[20146,6],[21471,6],[22562,6],[24917,6],[25773,6],[27099,6],[28191,6],[30409,6],[30442,6],[30475,6],[30511,6],[30546,6],[31590,6],[32651,6],[33506,6],[34831,6],[35922,6],[38277,6],[39132,6],[40457,6],[41548,6]]},"747":{"position":[[387,6],[831,6],[877,6],[923,6],[972,6],[1020,6],[2805,6],[3851,6],[5581,6],[6942,6],[10119,6],[10976,6],[12303,6],[13396,6]]},"749":{"position":[[750,6],[1591,6],[3057,6],[4203,6],[6991,6],[7864,6],[9362,6],[10540,6],[12882,6],[13737,6],[15062,6],[16153,6]]},"751":{"position":[[992,6],[1329,6],[1375,6],[1421,6],[1470,6],[1518,6],[1552,6],[3447,6],[4348,6],[5933,6],[7149,6],[10331,6],[11190,6],[12519,6],[13614,6],[15667,6],[17765,6],[18604,6],[20068,6],[21212,6],[23169,6],[23244,6],[23313,6],[23404,6],[23471,6],[23559,6],[23616,6],[23645,6]]},"769":{"position":[[700,6],[733,6],[770,6]]},"771":{"position":[[962,6],[1778,6],[3219,6],[4340,6],[6610,6],[7430,6],[8875,6],[10000,6],[12294,6],[13257,6],[14963,6],[16251,6],[19528,6],[20382,6],[21706,6],[22796,6],[25227,6],[26079,6],[27401,6],[28489,6]]},"773":{"position":[[1197,6],[1221,6],[1251,6],[1314,6],[1381,6],[3380,6],[4396,6],[6214,6],[7565,6],[10856,6],[11713,6],[13040,6],[14133,6]]},"775":{"position":[[377,6],[401,6],[832,6],[879,6],[938,6],[1001,6],[1068,6],[1138,6],[1162,6],[3285,6],[4189,6],[5777,6],[6996,6],[9810,6],[10909,6],[12810,6],[14244,6],[18040,6],[18891,6],[20212,6],[21299,6]]},"777":{"position":[[688,6],[735,6],[794,6],[847,6],[904,6],[964,6],[988,6],[3480,6],[4446,6],[6155,6],[7446,6],[10732,6],[11588,6],[12914,6],[14006,6]]},"787":{"position":[[24,7],[86,7]]},"789":{"position":[[580,6],[634,6],[658,6],[710,6],[734,6],[777,6],[828,6],[854,6],[3053,6],[4389,6],[6527,6],[8198,6]]},"795":{"position":[[880,6],[1730,6],[3050,6],[4136,6],[6568,6],[7422,6],[8746,6],[9836,6],[12293,6],[13169,6],[14670,6],[15851,6],[18203,6],[19054,6],[20375,6],[21462,6]]},"797":{"position":[[280,6],[505,6],[1321,6],[1352,6],[1405,6],[1442,6],[2821,6],[2845,6],[2897,6],[2921,6],[3001,6],[3051,6],[4995,6],[5841,6],[7157,6],[8239,6],[10800,6],[12044,6],[14031,6],[15600,6],[19343,6],[20342,6],[22025,6],[23339,6],[26282,6],[27132,6],[28452,6],[29538,6]]},"799":{"position":[[1540,6],[2594,6],[4332,6],[5701,6],[8977,6],[9996,6],[11504,6],[12791,6],[15903,6],[16923,6],[18432,6],[19720,6]]},"801":{"position":[[123,6],[154,6],[207,6],[244,6],[360,6],[384,6],[436,6],[460,6],[540,6],[590,6],[641,6],[667,6],[728,6],[780,6],[3781,6],[6373,6],[10239,6],[13246,6]]},"803":{"position":[[273,6],[316,6],[336,6],[367,6],[420,6],[457,6],[573,6],[597,6],[649,6],[673,6],[753,6],[803,6],[854,6],[880,6],[941,6],[993,6]]},"820":{"position":[[427,6],[448,6],[470,6],[495,6],[1249,6],[2277,6],[3097,6],[4542,6],[5667,6],[7985,6],[8843,6],[10171,6],[11265,6],[13697,6],[14513,6],[15954,6],[17075,6],[19331,6],[20185,6],[21509,6],[22599,6],[24949,6],[25805,6],[27131,6],[28223,6],[30453,6],[30474,6],[30505,6],[30540,6],[32171,6],[33025,6],[34349,6],[35439,6],[37789,6],[38644,6],[39969,6],[41060,6]]},"822":{"position":[[458,6],[494,6],[540,6],[590,6],[662,6],[2560,6],[3697,6],[5636,6],[7108,6],[10793,6],[11651,6],[12979,6],[14073,6]]},"824":{"position":[[532,6],[558,6],[594,6],[640,6],[690,6],[2393,6],[3409,6],[5109,6],[6440,6],[9706,6],[10567,6],[11898,6],[12995,6],[15062,6],[16529,6],[16586,6],[16654,6],[16729,6],[16801,6],[16849,6]]},"826":{"position":[[603,6],[660,6],[728,6],[803,6],[883,6],[931,6],[3266,6],[4455,6],[6387,6],[7901,6],[11376,6],[12238,6],[13570,6],[14668,6],[17134,6],[17998,6],[19332,6],[20432,6],[22831,6],[23697,6],[25033,6],[26135,6],[28623,6],[29487,6],[30821,6],[31921,6],[34320,6],[35184,6],[36518,6],[37618,6]]},"842":{"position":[[1057,6],[1085,6],[1115,6],[1137,6]]},"844":{"position":[[629,6],[657,6],[687,6],[709,6],[1486,6],[2519,6],[3394,6],[4894,6],[6074,6],[8496,6],[9356,6],[10686,6],[11782,6],[14230,6],[15105,6],[16605,6],[17785,6],[20164,6],[21024,6],[22354,6],[23450,6],[25907,6],[26774,6],[28111,6],[29214,6],[32068,6],[33193,6],[35061,6],[36511,6],[39868,6],[40728,6],[42058,6],[43154,6]]},"846":{"position":[[580,6],[1435,6],[2760,6],[3851,6],[6410,6],[6438,6],[6484,6],[6540,6],[7862,6],[8716,6],[10040,6],[11130,6]]},"848":{"position":[[1666,6],[1703,6],[1810,6],[3093,6],[3130,6],[3237,6],[4536,6],[4564,6],[4610,6],[4666,6],[4710,6],[4747,6],[4854,6],[7348,6],[8388,6],[10171,6],[11536,6],[14964,6],[15908,6],[17477,6],[18726,6],[21407,6],[22395,6],[24067,6],[25370,6],[28241,6],[29144,6],[30731,6],[31949,6],[34725,6],[35571,6],[37042,6],[38193,6],[40612,6],[41441,6],[42895,6],[44029,6],[46513,6],[47365,6],[48687,6],[49775,6],[52184,6],[53051,6],[54388,6],[55491,6]]}}}],["definit",{"_index":604,"t":{"45":{"position":[[638,12],[658,10],[827,11],[1512,12],[5275,10],[5406,10],[5577,12],[5601,10],[7621,10],[8711,11],[10384,10],[11185,10],[11323,11]]},"49":{"position":[[7,10]]},"51":{"position":[[60,12]]},"59":{"position":[[43,10],[174,10]]},"61":{"position":[[11,10]]},"63":{"position":[[63,10]]},"83":{"position":[[3802,10],[3917,11]]},"85":{"position":[[67,10],[1383,10],[1833,10]]},"87":{"position":[[101,11],[655,10],[843,11],[1320,10]]},"91":{"position":[[512,10]]},"93":{"position":[[589,10]]},"95":{"position":[[616,10]]},"191":{"position":[[1248,10],[1379,10]]},"195":{"position":[[170,10],[301,10]]},"258":{"position":[[967,10],[1098,10]]},"262":{"position":[[170,10],[301,10]]},"267":{"position":[[5688,10]]},"285":{"position":[[24679,10],[24810,10]]},"291":{"position":[[170,10],[301,10]]},"302":{"position":[[1569,10],[1700,10]]},"308":{"position":[[170,10],[301,10]]},"347":{"position":[[1380,10],[1511,10]]},"351":{"position":[[170,10],[301,10]]},"353":{"position":[[22,11]]},"363":{"position":[[1878,10],[2009,10]]},"367":{"position":[[170,10],[301,10]]},"373":{"position":[[174,10]]},"386":{"position":[[15,11],[1046,10]]},"396":{"position":[[959,10],[1090,10]]},"398":{"position":[[170,10],[301,10]]},"416":{"position":[[79,12]]},"454":{"position":[[2866,10],[2997,10]]},"460":{"position":[[170,10],[301,10]]},"464":{"position":[[38,10]]},"482":{"position":[[68,10],[350,10],[1082,10],[1194,10],[1429,11],[2767,11],[2797,10],[3284,11],[3809,10],[3921,10],[4496,10],[4609,10],[6088,10],[6189,10],[6989,11],[7251,10],[7479,11],[7653,10],[8179,11],[8432,10],[8661,11],[8910,10],[9115,11],[9281,10],[9399,11],[9429,10],[9927,11]]},"492":{"position":[[1251,10],[1382,10]]},"496":{"position":[[170,10],[301,10]]},"498":{"position":[[371,10]]},"514":{"position":[[1021,10],[1152,10]]},"518":{"position":[[170,10],[301,10]]},"530":{"position":[[998,10],[1129,10]]},"534":{"position":[[170,10],[301,10]]},"550":{"position":[[1110,10],[1241,10]]},"554":{"position":[[170,10],[301,10]]},"562":{"position":[[18,11]]},"568":{"position":[[951,10],[1082,10]]},"572":{"position":[[170,10],[301,10]]},"590":{"position":[[1422,10],[1553,10]]},"594":{"position":[[170,10],[301,10]]},"628":{"position":[[1195,10],[1326,10]]},"632":{"position":[[170,10],[301,10]]},"635":{"position":[[100,10]]},"637":{"position":[[14,10]]},"655":{"position":[[539,10],[670,10],[1023,10]]},"659":{"position":[[170,10],[301,10],[654,10]]},"663":{"position":[[147,11],[1229,10],[1399,11]]},"667":{"position":[[7139,10],[7171,11],[13328,10],[13360,11],[20225,10],[20257,11]]},"669":{"position":[[922,11],[7135,10],[7167,11],[13412,10],[13444,11],[19800,10],[19832,11]]},"675":{"position":[[243,10],[374,10]]},"679":{"position":[[1003,11]]},"683":{"position":[[76,10]]},"693":{"position":[[44,10],[175,10]]},"703":{"position":[[367,12],[653,11],[755,11],[878,10],[1060,10],[2407,11]]},"745":{"position":[[30340,12],[32169,11]]},"775":{"position":[[307,10]]},"787":{"position":[[44,10],[175,10]]},"797":{"position":[[1265,10],[2534,10],[2764,10],[4160,10]]},"820":{"position":[[30380,12],[31689,11]]},"848":{"position":[[4249,10]]}}}],["degre",{"_index":1025,"t":{"155":{"position":[[298,6]]}}}],["delay",{"_index":1556,"t":{"279":{"position":[[3361,5]]}}}],["deleg",{"_index":2849,"t":{"838":{"position":[[223,9]]}}}],["delet",{"_index":328,"t":{"21":{"position":[[386,6]]},"101":{"position":[[95,7]]},"173":{"position":[[509,9],[4211,9]]},"252":{"position":[[3,6],[84,6],[272,8],[556,8],[984,7],[1259,10],[1413,6],[1673,12]]},"267":{"position":[[85,8],[804,8],[1893,8],[3368,7],[4543,10],[5060,12],[5401,6],[5460,8]]},"275":{"position":[[74,7]]},"279":{"position":[[1132,8],[3414,6]]},"283":{"position":[[720,6]]},"294":{"position":[[265,6],[1045,8],[2138,8],[3617,7],[4796,10],[5317,12],[5662,6],[5725,8]]},"296":{"position":[[37,8]]},"311":{"position":[[24,6],[5753,6],[6471,8],[7557,8],[9029,7],[10201,10],[10715,12],[11053,6],[11109,8],[11449,7],[12405,8],[13735,8],[15413,7],[16763,10],[17425,12],[17751,8]]},"408":{"position":[[949,7]]},"418":{"position":[[3321,6],[3487,6]]},"420":{"position":[[593,6]]},"452":{"position":[[193,6],[395,8],[486,8]]},"466":{"position":[[67,6],[5856,6]]},"560":{"position":[[558,7]]},"584":{"position":[[92,6],[809,8],[1894,8],[3365,7],[4536,10],[5049,12],[5386,6],[5441,8]]},"649":{"position":[[783,8],[1948,8],[3499,7],[4750,10],[5342,12],[5709,6],[5794,8]]},"683":{"position":[[13387,8],[14558,8],[16174,7],[17441,10],[18050,12],[18472,6],[18550,6],[18621,8],[18877,6]]},"695":{"position":[[654,9]]},"697":{"position":[[86,6],[195,7],[304,6],[413,7],[468,6]]},"699":{"position":[[201,6]]},"701":{"position":[[138,6],[2043,6],[5738,6],[9438,6]]},"705":{"position":[[1825,8],[1839,6],[3015,8],[3048,6],[4591,7],[4633,6],[5867,10],[5893,6],[6484,12],[6841,6],[6916,8],[6928,6],[12722,6],[12753,6],[12783,6],[12842,6],[12900,6]]},"751":{"position":[[17243,6]]},"799":{"position":[[1778,8],[3116,8],[4899,7],[6333,10],[7107,12],[7532,6],[7620,6],[7684,8]]}}}],["demo",{"_index":544,"t":{"39":{"position":[[594,4]]},"43":{"position":[[449,4],[2254,7],[2276,4],[2666,4],[2815,6],[3021,4],[3160,4],[3277,4]]},"171":{"position":[[1992,5]]},"173":{"position":[[3233,5]]}}}],["demo\"}).execut",{"_index":572,"t":{"43":{"position":[[1249,17]]}}}],["deni",{"_index":1654,"t":{"333":{"position":[[623,7]]},"369":{"position":[[11524,4]]},"373":{"position":[[81,7]]},"375":{"position":[[18024,4]]},"380":{"position":[[361,7]]},"777":{"position":[[508,6],[2682,7]]},"799":{"position":[[448,4],[15366,6]]}}}],["denot",{"_index":2028,"t":{"522":{"position":[[1026,7],[2189,7],[3728,7],[4941,7],[5958,7]]},"560":{"position":[[491,8]]}}}],["depart",{"_index":46,"t":{"3":{"position":[[705,13]]}}}],["depend",{"_index":1083,"t":{"167":{"position":[[371,9]]},"181":{"position":[[162,9]]},"327":{"position":[[52,7]]},"661":{"position":[[96,9]]},"689":{"position":[[328,7]]},"709":{"position":[[294,7]]},"783":{"position":[[120,6],[360,7]]}}}],["depends_on",{"_index":1372,"t":{"212":{"position":[[1900,11],[2190,11],[4574,11],[4841,11]]}}}],["deploy",{"_index":198,"t":{"7":{"position":[[784,6]]},"33":{"position":[[32,6],[318,6],[604,6],[890,6],[1176,6],[1476,6]]},"129":{"position":[[32,6],[355,6],[678,6],[1001,6],[1324,6],[1585,6]]},"141":{"position":[[32,6],[355,6],[678,6],[1001,6],[1324,6],[1585,6]]},"155":{"position":[[1071,10]]},"159":{"position":[[3,6]]},"165":{"position":[[11,6],[375,6]]},"218":{"position":[[55,12]]},"224":{"position":[[400,10]]},"226":{"position":[[475,11]]},"228":{"position":[[843,10]]},"244":{"position":[[32,6],[319,6],[606,6],[893,6],[1180,6],[1441,6]]},"273":{"position":[[28,6],[350,6],[672,6],[959,6],[1246,6]]}}}],["deprec",{"_index":827,"t":{"89":{"position":[[3318,10]]},"408":{"position":[[36,11]]},"424":{"position":[[23,11],[47,11]]}}}],["depth",{"_index":1058,"t":{"155":{"position":[[1806,5],[2035,5]]}}}],["describ",{"_index":660,"t":{"45":{"position":[[5718,10]]},"81":{"position":[[219,9],[500,9]]},"83":{"position":[[3718,9]]},"418":{"position":[[2674,9]]},"476":{"position":[[652,8],[1309,9]]},"482":{"position":[[1308,9],[6313,9]]},"558":{"position":[[42,9]]},"560":{"position":[[39,9]]},"637":{"position":[[173,10]]},"643":{"position":[[1728,8]]},"663":{"position":[[1164,9]]},"848":{"position":[[1491,10],[1533,10],[2738,9]]}}}],["descript",{"_index":1458,"t":{"222":{"position":[[442,11],[530,11]]},"476":{"position":[[1075,11]]}}}],["design",{"_index":265,"t":{"15":{"position":[[173,8]]},"412":{"position":[[926,9]]},"601":{"position":[[9,8],[101,8]]},"626":{"position":[[178,6]]},"769":{"position":[[324,12]]}}}],["despit",{"_index":1053,"t":{"155":{"position":[[1659,7]]},"777":{"position":[[12,7]]}}}],["detail",{"_index":1617,"t":{"315":{"position":[[168,7]]},"472":{"position":[[1020,8]]},"709":{"position":[[360,7]]},"717":{"position":[[161,9]]},"732":{"position":[[320,8]]},"738":{"position":[[128,9]]},"745":{"position":[[1238,7],[31553,7]]},"751":{"position":[[15528,7]]},"761":{"position":[[96,9]]},"805":{"position":[[350,7]]},"813":{"position":[[166,9]]},"820":{"position":[[1208,7],[31389,7]]},"824":{"position":[[14919,7]]},"836":{"position":[[297,9]]},"844":{"position":[[1444,7]]}}}],["detect",{"_index":893,"t":{"109":{"position":[[368,6]]},"726":{"position":[[28210,6]]}}}],["determin",{"_index":5,"t":{"3":{"position":[[64,9]]},"5":{"position":[[342,9]]},"17":{"position":[[102,11]]},"25":{"position":[[67,12]]},"45":{"position":[[52,11],[2831,13],[9183,13],[9651,13]]},"127":{"position":[[63,9]]},"139":{"position":[[70,9]]},"155":{"position":[[932,11]]},"472":{"position":[[375,9]]},"478":{"position":[[4383,11]]},"599":{"position":[[160,9]]},"745":{"position":[[1097,10]]},"749":{"position":[[6221,11]]},"751":{"position":[[9429,11]]},"820":{"position":[[1067,10]]},"844":{"position":[[1303,10]]}}}],["develop",{"_index":174,"t":{"7":{"position":[[270,9]]},"191":{"position":[[108,7]]},"216":{"position":[[33,11]]},"258":{"position":[[108,7]]},"285":{"position":[[108,7]]},"302":{"position":[[108,7]]},"347":{"position":[[99,7]]},"363":{"position":[[98,7]]},"396":{"position":[[108,7]]},"430":{"position":[[98,7]]},"454":{"position":[[108,7]]},"492":{"position":[[108,7]]},"514":{"position":[[108,7]]},"530":{"position":[[108,7]]},"536":{"position":[[6,7]]},"550":{"position":[[108,7]]},"568":{"position":[[108,7]]},"590":{"position":[[108,7]]},"628":{"position":[[98,7]]},"655":{"position":[[99,7]]},"673":{"position":[[29,12]]},"713":{"position":[[108,7]]},"734":{"position":[[108,7]]},"738":{"position":[[22,7]]},"757":{"position":[[108,7]]},"809":{"position":[[108,7]]},"832":{"position":[[108,7]]}}}],["development/prod",{"_index":634,"t":{"45":{"position":[[3941,18]]}}}],["devic",{"_index":2067,"t":{"548":{"position":[[914,6]]},"757":{"position":[[915,7],[1247,6]]},"761":{"position":[[284,6]]},"763":{"position":[[93,8],[165,8],[208,7],[236,6],[286,6],[339,6]]},"765":{"position":[[260,6],[309,6],[361,6],[388,6],[413,6],[426,6],[473,6],[500,6]]},"767":{"position":[[183,8]]},"769":{"position":[[90,8],[162,8],[253,6],[411,6],[474,8],[625,6],[683,6],[879,9]]},"771":{"position":[[67,6],[116,6],[228,7],[284,6],[445,6],[18873,7]]},"773":{"position":[[100,6],[695,6],[821,6],[1064,7],[1180,6],[1482,9],[2538,6],[2589,6],[2701,7]]},"775":{"position":[[27,8],[50,6],[92,6],[112,7],[140,6],[189,6],[241,7],[260,6],[326,6],[815,6],[1271,9],[9253,7],[17486,6],[17506,6]]},"777":{"position":[[671,6],[1097,9]]},"781":{"position":[[34,7]]}}}],["device:1",{"_index":2577,"t":{"771":{"position":[[491,9],[1270,12],[3893,10],[5950,8],[6140,8],[6922,12],[9553,10],[11622,8],[11823,9],[12602,12],[12679,12],[12749,12],[15637,10],[15724,10],[15804,10],[18173,8],[18296,8],[18412,8],[18955,9],[19002,9],[19057,9],[19859,11],[20952,11],[22326,11],[23851,8],[24579,11],[24610,10],[24756,9],[25555,11],[26646,11],[28018,11],[29539,8],[30260,11],[30291,10],[30464,8],[30510,8],[30550,8],[30596,8],[30636,8],[30686,8],[30730,8],[30780,8],[30824,8],[30867,8],[30903,8],[30946,8]]},"773":{"position":[[3685,12],[3749,12],[3822,12],[3888,12],[6885,10],[6959,10],[7042,10],[7118,10],[9599,8],[9709,8],[9828,8],[9940,8],[10364,8],[11190,11],[12286,11],[13663,11],[15194,8],[15931,11],[15962,10],[16145,8],[16191,8],[16231,8],[16277,8],[16317,8],[16367,8],[16411,8],[16461,8],[16505,8],[16548,8],[16584,8],[16627,8],[16667,8],[16716,8],[16758,8],[16806,8],[16849,8],[16902,8],[16948,8],[17000,8],[17047,8],[17093,8],[17131,8],[17176,8]]},"777":{"position":[[117,9],[397,9],[2452,8],[2748,8],[2807,9],[3789,12],[3867,12],[3938,12],[6830,10],[6918,10],[6999,10],[9375,8],[9499,8],[9616,8],[9961,8],[10047,8],[11064,11],[12159,11],[13535,11],[15064,8],[15797,11],[15828,10],[15998,8],[16049,8],[16093,8],[16137,8]]}}}],["device:2",{"_index":2621,"t":{"775":{"position":[[10140,12],[10318,12],[13506,10],[13704,10],[16469,8],[16739,8],[17548,8],[18368,11],[19458,11],[20829,11],[22348,8],[23067,11],[23098,10],[23331,8],[23377,8],[23416,8],[23462,8],[23501,8],[23551,8],[23594,8],[23644,8],[23687,8],[23730,8],[23766,8],[23809,8],[23848,8],[23897,8],[23939,8],[23987,8],[24030,8],[24083,8],[24129,8],[24181,8],[24228,8],[24274,8],[24312,8],[24357,8]]}}}],["device:3",{"_index":2622,"t":{"775":{"position":[[10235,12],[10401,12],[13611,10],[13797,10],[16610,8],[16868,8]]}}}],["device_group",{"_index":2611,"t":{"775":{"position":[[354,12],[441,15],[1115,12],[1935,15],[2064,15],[2373,15]]},"777":{"position":[[941,12],[1713,15],[1842,15],[1910,15]]}}}],["device_group#it_admin",{"_index":2612,"t":{"775":{"position":[[856,22]]},"777":{"position":[[712,22]]}}}],["device_group#security_guard",{"_index":2613,"t":{"775":{"position":[[909,28]]},"777":{"position":[[765,28]]}}}],["device_group:group1",{"_index":2614,"t":{"775":{"position":[[3593,23],[3670,23],[6451,21],[6538,21],[8791,19],[8914,19]]}}}],["device_group:group1#it_admin",{"_index":2623,"t":{"775":{"position":[[10256,31],[10339,31],[13640,31],[13733,31],[16701,28],[16830,28]]}}}],["device_group:group1#security_guard",{"_index":2620,"t":{"775":{"position":[[10066,37],[10161,37],[13430,37],[13535,37],[16419,34],[16560,34]]}}}],["device_manag",{"_index":1668,"t":{"345":{"position":[[395,15]]}}}],["device_renam",{"_index":1669,"t":{"345":{"position":[[415,15]]},"548":{"position":[[345,16]]},"769":{"position":[[565,15],[777,15],[982,17],[1211,17]]},"771":{"position":[[12723,17],[15777,17],[18397,14],[24723,14],[25529,17],[26620,17],[27991,17],[29524,14],[30197,17],[30225,16],[30833,14],[30879,15],[30912,14],[30958,15]]},"773":{"position":[[914,15],[1388,15],[1923,17],[2381,17],[16514,14],[16560,15],[16593,14],[16639,15],[17056,14],[17105,15],[17140,14],[17188,15]]},"775":{"position":[[1075,15],[1712,17],[2280,17],[23696,14],[23742,15],[23775,14],[23821,15],[24237,14],[24286,15],[24321,14],[24369,15]]},"777":{"position":[[487,15],[580,14],[911,15],[1506,17],[3912,17],[6972,17],[9601,14],[16102,14],[16149,15]]}}}],["dian",{"_index":2495,"t":{"742":{"position":[[95,6]]},"749":{"position":[[7247,5],[8423,5],[9975,5],[11201,5],[12239,5]]},"817":{"position":[[131,6],[371,5]]},"824":{"position":[[2644,5],[3963,5],[5717,5],[7096,5],[8505,5]]}}}],["diann",{"_index":2570,"t":{"765":{"position":[[154,6],[436,6]]},"773":{"position":[[1004,6],[2556,6],[16095,7],[16751,6],[16788,6],[16941,6],[16982,6],[17124,6],[17158,6]]},"775":{"position":[[2740,6],[17530,6],[18319,9],[19409,9],[20778,9],[22323,6],[22947,9],[22978,8],[23932,6],[23969,6],[24122,6],[24163,6],[24305,6],[24339,6]]},"781":{"position":[[72,6]]}}}],["dictat",{"_index":2017,"t":{"508":{"position":[[5973,7]]}}}],["didn't",{"_index":1930,"t":{"478":{"position":[[3770,6]]}}}],["differ",{"_index":615,"t":{"45":{"position":[[2936,9]]},"95":{"position":[[44,10],[389,13]]},"97":{"position":[[298,10]]},"181":{"position":[[228,9]]},"202":{"position":[[5717,9]]},"218":{"position":[[443,9]]},"373":{"position":[[619,13]]},"408":{"position":[[365,9]]},"418":{"position":[[1846,9],[2980,9]]},"428":{"position":[[510,9],[740,9]]},"482":{"position":[[5699,9]]},"560":{"position":[[382,9]]},"626":{"position":[[254,9]]},"641":{"position":[[141,9]]},"667":{"position":[[27039,6]]},"687":{"position":[[187,11]]},"705":{"position":[[68,9],[242,9],[264,9],[322,9],[837,9],[871,9]]},"724":{"position":[[41,9]]},"730":{"position":[[786,9]]},"745":{"position":[[13,9]]},"749":{"position":[[6391,9]]},"773":{"position":[[2727,9]]},"795":{"position":[[11788,9]]},"799":{"position":[[68,9]]},"850":{"position":[[475,9]]}}}],["difficulti",{"_index":40,"t":{"3":{"position":[[560,12]]}}}],["digit",{"_index":336,"t":{"25":{"position":[[126,7]]}}}],["direct",{"_index":504,"t":{"37":{"position":[[198,6]]},"45":{"position":[[4480,6],[5196,6],[7504,6],[8655,6],[9464,6],[9763,6],[9791,6],[9828,6],[10012,6],[10043,6],[10207,6],[10316,6],[10413,6],[12052,6]]},"69":{"position":[[2,6],[186,6],[217,6],[381,6]]},"79":{"position":[[144,6]]},"83":{"position":[[3866,6]]},"85":{"position":[[85,6],[722,6],[879,7],[1518,6],[1622,6],[2557,6]]},"87":{"position":[[978,6],[1035,6],[1248,6]]},"89":{"position":[[2421,7]]},"91":{"position":[[649,6],[1130,6]]},"95":{"position":[[711,6],[1601,6]]},"99":{"position":[[273,6]]},"258":{"position":[[628,6]]},"265":{"position":[[257,6]]},"267":{"position":[[5621,6]]},"269":{"position":[[68,6]]},"302":{"position":[[1135,6]]},"333":{"position":[[119,6]]},"343":{"position":[[0,6]]},"386":{"position":[[242,6],[1150,6],[1317,6]]},"450":{"position":[[123,6]]},"482":{"position":[[1752,6],[1857,6],[6508,6],[7427,6]]},"488":{"position":[[196,6]]},"492":{"position":[[912,6]]},"508":{"position":[[5985,6]]},"514":{"position":[[682,6]]},"530":{"position":[[659,6]]},"550":{"position":[[771,6],[1667,6],[1730,6]]},"554":{"position":[[727,6],[790,6]]},"556":{"position":[[309,6],[523,6]]},"560":{"position":[[182,6],[1514,6]]},"568":{"position":[[612,6]]},"590":{"position":[[1083,6]]},"643":{"position":[[1207,6],[1231,7],[1304,6]]},"647":{"position":[[5806,6]]},"653":{"position":[[138,6]]},"655":{"position":[[169,6],[200,6],[948,6],[1055,6]]},"659":{"position":[[579,6],[686,6]]},"661":{"position":[[0,6],[196,6]]},"663":{"position":[[0,6],[88,6],[206,6],[1301,6],[1462,6]]},"665":{"position":[[47,6]]},"667":{"position":[[1013,6],[7083,6],[13272,6],[13500,6],[13548,6],[20169,6],[20306,6],[26934,6],[27051,6],[33239,6]]},"669":{"position":[[61,6],[841,6],[1001,6],[7075,6],[13352,6],[19740,6],[19899,6]]},"671":{"position":[[46,6],[243,6],[499,6]]},"713":{"position":[[621,6],[685,6]]},"728":{"position":[[6593,6],[6641,6],[6825,6],[6856,6],[7004,6],[21449,6],[21600,6],[21780,6],[22384,6],[23095,6],[38373,6],[38610,6],[38823,6],[38867,6]]},"730":{"position":[[529,6],[618,6]]},"749":{"position":[[6248,6]]},"751":{"position":[[9815,6]]},"757":{"position":[[261,6],[664,6],[728,6]]},"773":{"position":[[47,6],[2762,6]]},"777":{"position":[[64,6],[243,6],[515,6],[2229,6],[2326,6],[2659,6],[2957,6],[10097,6],[10189,6]]},"822":{"position":[[1972,6]]},"824":{"position":[[9188,6]]},"832":{"position":[[261,6]]},"842":{"position":[[1863,6],[1933,6]]},"848":{"position":[[4342,6]]}}}],["directli",{"_index":551,"t":{"39":{"position":[[816,8]]},"43":{"position":[[3059,8]]},"45":{"position":[[7529,8],[7560,8],[7671,8],[8625,8],[10531,8],[10684,8],[10813,8]]},"63":{"position":[[2,8],[113,8]]},"81":{"position":[[761,8]]},"85":{"position":[[1964,8],[2112,8]]},"87":{"position":[[1095,8]]},"89":{"position":[[1334,8]]},"97":{"position":[[2405,8]]},"343":{"position":[[82,8]]},"355":{"position":[[748,8]]},"418":{"position":[[438,8]]},"482":{"position":[[2259,8],[2268,8],[7605,8]]},"502":{"position":[[983,8]]},"508":{"position":[[6623,8]]},"548":{"position":[[664,8]]},"558":{"position":[[102,8]]},"560":{"position":[[1635,9]]},"576":{"position":[[1102,9]]},"653":{"position":[[86,8],[405,8]]},"713":{"position":[[896,8]]},"745":{"position":[[31996,8]]},"747":{"position":[[746,8]]},"751":{"position":[[9634,9],[16299,8]]},"757":{"position":[[963,9]]},"771":{"position":[[378,9]]},"820":{"position":[[1658,8]]},"824":{"position":[[9026,9],[15670,8]]},"844":{"position":[[1898,8]]}}}],["directly_related_user_typ",{"_index":387,"t":{"35":{"position":[[422,30],[491,30],[559,30],[1678,30],[1747,30],[1815,30]]},"45":{"position":[[1148,30],[1220,30],[1289,30],[1357,30],[2131,30],[2247,30],[2360,30],[2472,30],[2683,30],[6992,30],[7064,30],[7133,30],[7201,30],[7989,30],[11657,30],[11726,30]]},"83":{"position":[[981,30],[1953,30],[2073,30],[2144,30],[2257,30],[3275,30],[3395,30],[3466,30],[3579,30]]},"85":{"position":[[1242,30]]},"87":{"position":[[500,30],[569,30]]},"89":{"position":[[659,30],[1086,30],[1157,30],[1817,30]]},"91":{"position":[[434,30]]},"93":{"position":[[511,30]]},"95":{"position":[[538,30]]},"97":{"position":[[1525,30],[1594,30],[1663,30],[2232,30]]},"191":{"position":[[631,30],[800,30]]},"258":{"position":[[512,30]]},"281":{"position":[[414,30],[579,30],[784,30]]},"285":{"position":[[605,30],[774,30]]},"302":{"position":[[665,30],[945,30],[1019,30]]},"347":{"position":[[686,30],[755,30]]},"355":{"position":[[560,30],[629,30]]},"363":{"position":[[752,30],[959,30]]},"371":{"position":[[574,30],[643,30],[850,30]]},"373":{"position":[[769,30],[838,30],[1045,30]]},"382":{"position":[[348,30],[517,30]]},"384":{"position":[[461,30],[571,30]]},"396":{"position":[[586,30],[655,30]]},"412":{"position":[[1998,30],[2358,30],[2429,30],[2866,30],[2937,30],[3008,30]]},"416":{"position":[[1809,30],[2169,30],[2240,30],[2720,30],[2791,30],[2905,30]]},"418":{"position":[[1020,30]]},"430":{"position":[[891,30],[960,30]]},"442":{"position":[[745,30],[858,30],[1071,30]]},"454":{"position":[[1153,30],[1230,30],[1403,30]]},"464":{"position":[[934,30],[1011,30],[1184,30]]},"492":{"position":[[627,30],[796,30]]},"500":{"position":[[633,30],[828,30],[899,30]]},"502":{"position":[[459,30],[793,30],[864,30]]},"514":{"position":[[530,30]]},"530":{"position":[[543,30]]},"538":{"position":[[471,30],[658,30]]},"550":{"position":[[586,30],[655,30]]},"558":{"position":[[564,30],[633,30]]},"560":{"position":[[1313,30],[1382,30]]},"568":{"position":[[496,30]]},"576":{"position":[[606,30],[673,30],[845,30]]},"590":{"position":[[762,30],[831,30]]},"628":{"position":[[607,30],[774,30]]},"635":{"position":[[490,30],[561,30],[728,30]]},"643":{"position":[[660,30],[729,30],[916,30]]},"663":{"position":[[715,30],[862,30],[1069,30]]},"667":{"position":[[526,30],[673,30],[880,30]]},"669":{"position":[[510,30],[717,30]]},"677":{"position":[[590,30],[1315,30]]},"679":{"position":[[830,30],[899,30]]},"685":{"position":[[454,30]]},"695":{"position":[[1544,30],[1622,30],[1699,30],[2670,30],[2748,30]]},"703":{"position":[[1976,30],[2054,30],[2136,30],[2214,30]]},"707":{"position":[[1336,30],[1414,30],[1496,30],[1574,30],[2545,30],[2623,30]]},"724":{"position":[[989,30],[1162,30],[1343,30]]},"728":{"position":[[6340,30],[6409,30],[7573,30],[7642,30],[7815,30],[8000,30],[21227,30],[21296,30],[23951,30],[24020,30],[24193,30],[24374,30],[31735,30],[31804,30],[32111,30],[32292,30],[39363,30],[39432,30],[39881,30],[41182,30],[41489,30],[41670,30]]},"745":{"position":[[731,30],[801,30],[870,30],[943,30],[1011,30],[1495,30],[31166,30],[31236,30],[31305,30],[31378,30],[31446,30],[31805,30]]},"747":{"position":[[573,30],[1653,30],[1765,30],[1876,30],[1991,30],[2101,30]]},"751":{"position":[[1173,30],[2185,30],[2297,30],[2408,30],[2523,30],[2633,30],[2743,30],[16013,30],[24682,30],[24844,30],[25005,30],[25170,30],[25330,30],[25490,30],[25699,30],[25780,30]]},"769":{"position":[[1070,30],[1154,30],[1231,30]]},"773":{"position":[[2083,30],[2160,30],[2240,30],[2324,30],[2401,30]]},"775":{"position":[[579,30],[656,30],[1872,30],[2001,30],[2139,30],[2223,30],[2300,30],[2511,30],[2588,30]]},"777":{"position":[[1650,30],[1779,30],[2048,30],[2125,30]]},"789":{"position":[[1082,30],[1695,30],[1768,30],[2092,30]]},"797":{"position":[[402,30],[635,30],[2096,30],[2184,30],[2276,30],[3914,30],[3987,30]]},"801":{"position":[[1430,30],[1518,30],[1610,30],[2516,30],[2589,30],[2913,30],[3081,30],[3254,30]]},"803":{"position":[[1182,30],[1819,30],[1897,30],[1985,30],[2077,30],[2983,30],[3056,30],[3380,30],[3548,30],[3721,30]]},"820":{"position":[[771,30],[840,30],[912,30],[981,30],[1377,30],[31068,30],[31137,30],[31209,30],[31278,30]]},"822":{"position":[[1177,30],[1290,30],[1406,30],[1519,30],[1730,30]]},"824":{"position":[[1260,30],[1332,30],[1445,30],[1561,30],[1674,30],[15431,30],[17859,30],[17931,30],[18044,30],[18160,30],[18273,30],[18484,30]]},"826":{"position":[[1941,30],[2013,30],[2126,30],[2242,30],[2355,30],[2602,30]]},"842":{"position":[[1431,30],[1508,30],[1577,30],[1645,30]]},"844":{"position":[[1003,30],[1080,30],[1149,30],[1217,30],[1615,30]]},"846":{"position":[[7061,30],[7138,30],[7207,30],[7275,30]]},"848":{"position":[[2094,30],[2168,30],[2438,30],[3610,30],[3684,30],[3954,30],[5471,30],[5548,30],[5617,30],[5685,30],[6004,30],[6078,30],[6348,30]]}}}],["directori",{"_index":1330,"t":{"210":{"position":[[163,11]]},"212":{"position":[[2709,9],[5340,9]]}}}],["disabl",{"_index":975,"t":{"151":{"position":[[230,7]]},"216":{"position":[[375,7]]},"218":{"position":[[85,9]]},"226":{"position":[[151,7]]},"228":{"position":[[70,8]]},"386":{"position":[[232,9]]},"653":{"position":[[128,9]]},"663":{"position":[[181,8]]},"665":{"position":[[37,9]]},"669":{"position":[[51,9],[19887,9]]}}}],["disadvantag",{"_index":2596,"t":{"773":{"position":[[261,14]]}}}],["disallow",{"_index":788,"t":{"85":{"position":[[905,12]]},"408":{"position":[[507,11]]},"424":{"position":[[97,8]]},"713":{"position":[[667,8]]},"728":{"position":[[38364,8],[38812,8]]},"757":{"position":[[710,8]]}}}],["disappear",{"_index":1913,"t":{"476":{"position":[[808,11]]}}}],["disassoci",{"_index":2236,"t":{"649":{"position":[[43,13]]}}}],["discard",{"_index":1645,"t":{"327":{"position":[[2724,10]]}}}],["discord",{"_index":248,"t":{"11":{"position":[[95,7]]},"410":{"position":[[382,7]]},"486":{"position":[[457,8]]}}}],["discov",{"_index":1915,"t":{"476":{"position":[[1023,8]]},"478":{"position":[[4667,8]]}}}],["discrep",{"_index":895,"t":{"109":{"position":[[402,13]]}}}],["discuss",{"_index":618,"t":{"45":{"position":[[3073,9]]},"728":{"position":[[38666,10]]}}}],["dish",{"_index":2393,"t":{"721":{"position":[[257,6],[429,6]]},"726":{"position":[[12527,6],[14143,6],[16037,6],[17603,6],[19373,6],[20640,6],[22186,6],[24010,6],[25506,6],[27176,6]]}}}],["disrupt",{"_index":2286,"t":{"679":{"position":[[17,11]]}}}],["dive",{"_index":2490,"t":{"730":{"position":[[678,4]]},"779":{"position":[[96,4]]},"850":{"position":[[367,4]]}}}],["divid",{"_index":998,"t":{"153":{"position":[[948,6]]}}}],["dnf",{"_index":950,"t":{"113":{"position":[[1562,3]]},"117":{"position":[[136,3]]}}}],["do",{"_index":886,"t":{"109":{"position":[[158,5]]},"153":{"position":[[1822,5]]},"751":{"position":[[16551,5]]},"824":{"position":[[15978,5]]}}}],["doc",{"_index":849,"t":{"97":{"position":[[409,5],[897,3],[1118,6],[1826,3],[1953,6],[2364,3],[2432,3],[2487,3],[2614,3]]},"281":{"position":[[193,3],[695,6]]},"424":{"position":[[837,4]]},"732":{"position":[[119,4]]},"751":{"position":[[16437,3]]},"824":{"position":[[15867,3]]},"836":{"position":[[428,5]]}}}],["doc'",{"_index":857,"t":{"97":{"position":[[2650,5]]}}}],["doc:budget",{"_index":1560,"t":{"279":{"position":[[3638,14]]}}}],["doc:plan",{"_index":1625,"t":{"323":{"position":[[281,12],[333,12],[369,14]]}}}],["docker",{"_index":166,"t":{"7":{"position":[[109,7],[117,6],[156,6]]},"113":{"position":[[1685,7],[1693,6],[1718,6]]},"119":{"position":[[0,6],[25,6]]},"161":{"position":[[52,6],[107,7]]},"206":{"position":[[65,7]]},"208":{"position":[[40,6],[86,6],[125,6],[171,6],[189,6]]},"212":{"position":[[448,6],[455,6],[654,6],[733,6],[1096,6],[1296,6],[1568,6],[2728,6],[3297,6],[3304,6],[3344,6],[3426,6],[3783,6],[3963,6],[4215,6],[5359,6]]},"214":{"position":[[605,6],[1318,7],[1369,6],[1419,6],[2039,6],[2843,7],[2894,6],[2938,6]]},"216":{"position":[[309,7]]},"218":{"position":[[294,7],[302,6],[548,6]]},"222":{"position":[[146,6],[282,6]]},"224":{"position":[[179,6],[272,6]]}}}],["docs_in_draft_statu",{"_index":219,"t":{"9":{"position":[[607,21]]}}}],["docs_in_draft_status(statu",{"_index":220,"t":{"9":{"position":[[639,28]]}}}],["document",{"_index":29,"t":{"3":{"position":[[410,8],[1513,8]]},"9":{"position":[[492,9],[558,8],[726,9],[800,10],[836,9],[998,9],[1164,10]]},"19":{"position":[[415,10],[525,9]]},"23":{"position":[[151,8]]},"35":{"position":[[112,8],[275,11],[1531,11]]},"45":{"position":[[614,8],[853,8],[972,11],[1673,8],[1955,11],[5491,8],[5789,8],[6387,8],[6580,9],[6663,8],[6816,11],[7320,8],[7794,9],[7818,8],[7893,11],[8176,8],[8405,9],[9275,14],[10555,8],[10708,8],[10838,8],[11349,8],[11456,11],[12108,9],[24731,8],[25568,11],[26707,11],[28136,11],[29741,8],[30269,11],[30503,11],[30539,10],[31432,14],[31834,8]]},"81":{"position":[[872,13]]},"83":{"position":[[518,8],[2374,11],[3776,9],[3903,8]]},"87":{"position":[[87,8],[127,8],[236,11],[641,8],[735,9],[1531,8],[1706,8],[1909,9],[2004,8]]},"89":{"position":[[385,8],[776,11],[1311,8],[1443,8],[1547,11],[2080,8],[2150,8],[2412,8],[2484,8],[2911,9]]},"91":{"position":[[174,8],[259,11]]},"93":{"position":[[192,8],[287,11]]},"95":{"position":[[259,8],[350,11]]},"137":{"position":[[137,13]]},"143":{"position":[[49,8]]},"147":{"position":[[14,9],[198,11],[529,11],[908,11],[1432,8],[1782,11],[1965,8]]},"149":{"position":[[151,13]]},"159":{"position":[[122,13]]},"167":{"position":[[47,9],[275,14],[361,9]]},"173":{"position":[[115,9],[813,9],[2729,9],[4342,11],[4373,11],[4487,8],[5621,10]]},"179":{"position":[[472,9]]},"189":{"position":[[401,8],[420,8]]},"191":{"position":[[270,8],[400,8],[704,11]]},"198":{"position":[[112,8]]},"236":{"position":[[239,13]]},"285":{"position":[[264,8],[388,8],[678,11],[923,8],[991,9],[1132,8]]},"294":{"position":[[75,10],[191,10]]},"327":{"position":[[2804,9],[2926,9]]},"329":{"position":[[543,10]]},"333":{"position":[[567,10]]},"345":{"position":[[129,8],[162,9]]},"347":{"position":[[199,8],[297,8],[371,9],[422,8],[564,11]]},"353":{"position":[[94,8],[142,9],[239,9]]},"355":{"position":[[207,8],[359,11],[712,8],[806,8],[898,8],[959,9]]},"361":{"position":[[138,9],[476,9]]},"363":{"position":[[198,8],[338,8],[481,8],[656,11],[1193,8]]},"369":{"position":[[173,9],[11464,8],[11573,8],[11704,9],[11827,8],[11915,8],[12007,8],[12061,8]]},"371":{"position":[[48,9],[158,8],[252,8],[450,11],[1008,9]]},"373":{"position":[[51,10],[339,8],[553,11]]},"375":{"position":[[170,9],[231,9],[1106,8],[2278,8],[3826,8],[5048,8],[6072,8],[6258,9],[6466,9],[12274,9]]},"382":{"position":[[125,8],[421,11],[741,8]]},"384":{"position":[[84,8],[260,11]]},"394":{"position":[[88,9]]},"396":{"position":[[231,8],[322,8],[464,11]]},"400":{"position":[[61,8]]},"412":{"position":[[262,8],[502,8],[786,8],[1038,8],[1098,8],[1686,8],[2502,11],[3206,8]]},"416":{"position":[[1013,8],[1322,9],[1520,8],[2356,11]]},"418":{"position":[[188,8],[367,9],[717,9],[804,8],[924,11],[1285,8],[1486,9],[1560,9],[2230,8]]},"452":{"position":[[202,8],[300,8],[345,8],[409,9],[516,9]]},"454":{"position":[[219,8],[381,9],[482,8],[682,9],[733,8],[957,11],[1629,8],[1760,8],[1885,8],[2321,9],[2504,10]]},"456":{"position":[[92,10]]},"462":{"position":[[173,9],[11543,8],[11658,8]]},"464":{"position":[[216,8],[488,11]]},"466":{"position":[[87,8],[183,9],[5876,8],[5982,9]]},"476":{"position":[[34,9],[1361,8],[1511,8],[1601,9],[1759,8],[1868,8],[1947,9],[2086,8],[2141,8],[2229,9],[2257,8],[2304,8],[2383,9],[2426,8],[2463,9]]},"478":{"position":[[407,8],[498,8],[648,8],[801,8],[910,8],[989,9],[1128,8],[1183,8],[1269,9],[1297,8],[1344,8],[1423,9],[1466,8],[1503,9],[2242,8],[2392,8],[2482,9],[2641,8],[2750,8],[2829,9],[2968,8],[3023,8],[3111,9],[3139,8],[3186,8],[3265,9],[3308,8],[3345,9],[3960,8],[4136,8]]},"480":{"position":[[733,8],[883,8],[973,9],[1131,8],[1240,8],[1319,9],[1458,8],[1513,8],[1601,9],[1629,8],[1676,8],[1755,9],[1798,8],[1835,9],[2259,8],[2675,9],[2883,8]]},"482":{"position":[[210,10],[2194,9],[2915,9],[3072,11],[3163,10],[3394,9],[3616,8],[3733,9],[3841,8],[3950,8],[3999,8],[4237,9],[4268,8],[4419,9],[4528,8],[4638,8],[4683,8],[4898,9],[5049,8],[5329,8],[5496,9],[5835,10],[5948,8],[6065,9],[6120,8],[6213,9],[6260,8],[7020,8],[7129,8],[7202,9],[7305,8],[7795,10],[7842,8],[7874,8],[7919,9],[8209,8],[8262,8],[8348,9],[8486,8],[8692,8],[8737,8],[8826,9],[8964,8],[9160,8],[9197,9],[9335,8],[9448,8],[9488,8],[9943,8],[10081,8]]},"484":{"position":[[1485,10]]},"490":{"position":[[225,9]]},"492":{"position":[[277,8],[413,8],[700,11]]},"498":{"position":[[44,9],[131,9],[211,9],[314,8],[357,8]]},"500":{"position":[[50,9],[221,9],[395,8],[706,11],[986,8],[1075,9]]},"502":{"position":[[48,9],[199,8],[532,11],[947,8],[1057,8],[1170,8],[1218,9]]},"506":{"position":[[885,8],[2076,8],[3643,8],[4884,8],[5949,8]]},"508":{"position":[[6311,8]]},"510":{"position":[[264,10],[328,9]]},"512":{"position":[[88,9],[316,8]]},"514":{"position":[[231,8],[312,8],[438,11]]},"520":{"position":[[204,8]]},"522":{"position":[[6466,10],[6529,13],[6842,9]]},"524":{"position":[[192,8],[344,9]]},"528":{"position":[[419,8],[438,8]]},"530":{"position":[[234,8],[327,8],[447,11]]},"536":{"position":[[213,9]]},"538":{"position":[[206,8],[375,11]]},"542":{"position":[[322,9]]},"546":{"position":[[210,9]]},"548":{"position":[[837,8]]},"566":{"position":[[339,9]]},"590":{"position":[[231,8],[395,8],[547,11],[944,8]]},"606":{"position":[[3809,12],[5483,9],[6224,12],[6254,11],[6578,8],[9886,12],[11523,9],[12222,12],[12252,11]]},"608":{"position":[[523,8],[3776,12],[5214,9],[5837,12],[5867,11]]},"613":{"position":[[12082,8]]},"618":{"position":[[910,11],[2156,11],[3694,12],[5521,8],[6105,11],[6454,11],[6490,10]]},"626":{"position":[[151,9]]},"628":{"position":[[198,8],[347,8],[511,11]]},"635":{"position":[[48,9],[86,8],[180,8],[368,11]]},"637":{"position":[[106,9]]},"639":{"position":[[6090,9]]},"663":{"position":[[286,8],[514,11],[1192,8],[1215,8]]},"667":{"position":[[97,8],[325,11],[1308,9],[7157,8],[7314,8],[7480,9],[13346,8],[13747,9],[14301,9],[20243,8],[20712,9],[21133,8],[27369,8],[33091,9],[33169,8],[33203,9],[33297,9]]},"669":{"position":[[158,8],[355,11],[1280,9],[7153,8],[7529,9],[13430,8],[13628,9],[13873,9],[19818,8],[20192,8]]},"677":{"position":[[4,8],[285,8],[419,11],[1008,8],[1143,11]]},"679":{"position":[[287,8],[478,11]]},"683":{"position":[[6336,8]]},"685":{"position":[[147,8],[282,11]]},"689":{"position":[[416,8]]},"732":{"position":[[193,9]]},"740":{"position":[[50,14]]},"745":{"position":[[30244,13]]},"783":{"position":[[448,8]]},"807":{"position":[[269,8],[289,8],[769,9],[1035,9],[1282,9]]},"809":{"position":[[702,9]]},"815":{"position":[[56,14],[214,9],[224,9],[295,9],[384,8],[408,9]]},"817":{"position":[[231,9],[406,8],[437,9]]},"820":{"position":[[293,8],[408,8],[596,11],[1230,8],[1281,11],[1493,8],[1606,8],[1708,10],[13226,9],[30284,13],[30434,8],[30654,11],[31413,8],[31557,8],[31618,8]]},"822":{"position":[[388,9],[439,8],[763,11]]},"824":{"position":[[108,10],[179,9],[317,8],[400,8],[438,9],[513,8],[547,10],[819,11],[1303,10],[8967,8],[9124,8],[9210,8],[15043,8],[15144,11],[15607,10],[15694,8],[16510,8],[16816,10],[16950,11],[17902,10]]},"826":{"position":[[193,9],[584,8],[898,10],[1032,11],[1984,10],[10906,8],[28153,8]]}}}],["document'",{"_index":813,"t":{"89":{"position":[[1403,10]]},"454":{"position":[[307,10]]},"482":{"position":[[5266,10],[6544,10]]},"667":{"position":[[33433,10],[33459,10]]},"669":{"position":[[89,10],[895,10]]}}}],["document.id",{"_index":235,"t":{"9":{"position":[[1034,12],[1087,12]]}}}],["document.statu",{"_index":237,"t":{"9":{"position":[[1057,15]]}}}],["document:${request.params.docu",{"_index":1181,"t":{"173":{"position":[[582,38]]}}}],["document:0001",{"_index":1974,"t":{"482":{"position":[[5133,16]]}}}],["document:1",{"_index":107,"t":{"3":{"position":[[1813,10],[1841,10],[2064,10],[2107,10],[2186,10],[2266,10],[2520,10],[2578,13],[2609,10]]},"484":{"position":[[1847,11],[1925,13],[1951,10],[2086,13],[2590,11],[2640,10],[2689,10],[2737,10],[2793,10],[2905,11],[2965,10],[3014,10],[3062,10],[3128,10]]}}}],["document:1#viewer@user:ann",{"_index":129,"t":{"3":{"position":[[2697,29]]}}}],["document:2",{"_index":1998,"t":{"484":{"position":[[2113,10],[2194,13],[2220,10],[2352,13],[3168,11],[3218,10],[3267,10],[3315,10],[3371,10],[3481,11],[3541,10],[3600,10],[3648,10],[3714,10]]}}}],["document:2021",{"_index":2803,"t":{"820":{"position":[[1760,13],[2577,14],[5208,14],[7277,13],[7501,13],[8308,14],[9405,14],[10783,14],[12316,13],[13044,14],[13087,14],[13993,14],[16616,14],[18673,13],[19650,14],[20743,14],[22117,14],[23642,13],[24358,14],[24401,14],[25269,14],[26364,14],[27740,14],[29269,13],[29990,14],[30033,14],[32490,14],[33583,14],[34957,14],[36482,13],[37198,14],[37241,14],[38109,14],[39203,14],[40578,14],[42105,13],[42824,14],[42867,14]]},"822":{"position":[[2077,13],[3099,13],[3177,14],[4716,13],[6562,13],[6649,14],[8081,13],[9598,13],[9930,13],[11116,14],[12213,14],[13591,14],[15124,13],[15852,14],[15895,14]]},"824":{"position":[[2665,13],[2738,14],[2768,13],[2806,13],[2835,14],[2889,14],[3984,13],[4146,13],[4184,13],[5738,13],[5820,14],[5851,13],[5889,13],[5925,14],[5981,14],[7117,13],[7229,13],[7267,13],[8338,13],[8443,13],[8473,13],[8526,13],[8633,13],[8671,13],[10027,14],[11127,14],[12508,14],[14047,13],[14779,14],[14822,14],[16028,13],[16087,14],[16141,14],[16288,14],[16361,14]]},"826":{"position":[[3538,13],[3615,14],[3692,13],[3781,14],[3852,13],[3927,14],[5030,13],[5243,13],[5462,13],[7016,13],[7102,14],[7180,13],[7278,14],[7350,13],[7434,14],[8578,13],[8741,13],[8910,13],[10067,13],[10206,13],[10331,13],[10392,13],[10550,13],[10714,13],[11695,14],[12796,14],[14178,14],[15719,13],[16451,14],[16502,14],[17454,14],[18557,14],[19941,14],[21486,13],[22223,14],[22274,14],[23154,14],[24259,14],[25645,14],[27194,13],[27938,14],[27989,14],[28943,14],[30046,14],[31430,14],[32975,13],[33712,14],[33763,14],[34640,14],[35743,14],[37127,14],[38672,13],[39409,14],[39460,14]]}}}],["document:budget",{"_index":1719,"t":{"382":{"position":[[810,18],[1035,16],[1993,18],[3082,18],[4452,18],[5969,15],[6678,18],[6716,17]]},"384":{"position":[[755,16]]}}}],["document:budget#read",{"_index":1725,"t":{"384":{"position":[[941,25],[999,25],[1085,25]]}}}],["document:budget#writ",{"_index":1726,"t":{"384":{"position":[[1146,24]]}}}],["document:compani",{"_index":2026,"t":{"522":{"position":[[282,16],[1104,17],[3815,17],[5915,16],[6908,17]]},"524":{"position":[[73,16],[1150,17],[2245,17],[3621,17],[5150,16],[5868,17],[5915,17]]}}}],["document:may_budget.doc",{"_index":2200,"t":{"637":{"position":[[214,24],[1223,27],[4066,25],[6250,23]]},"639":{"position":[[148,25],[960,26],[2062,26],[3445,26],[4988,23],[5728,26],[5774,25],[6010,24],[6153,24]]}}}],["document:meeting_not",{"_index":2059,"t":{"544":{"position":[[6086,22],[6139,22]]}}}],["document:meeting_notes.doc",{"_index":1673,"t":{"347":{"position":[[990,29]]},"357":{"position":[[74,27],[147,27],[211,27],[1047,29],[2146,29],[3526,29],[5063,26],[5791,29],[5840,28]]},"402":{"position":[[73,27],[903,30],[3538,28],[5613,26]]},"404":{"position":[[138,28],[947,29],[2046,29],[3426,29],[4963,26],[5691,29],[5740,28],[5888,28],[6784,29],[7884,29],[9265,29],[10804,26],[11534,29],[11583,28]]},"498":{"position":[[472,26],[716,26],[779,26]]},"506":{"position":[[96,26],[946,30],[3713,28],[5861,26]]},"508":{"position":[[212,27],[1020,29],[2119,29],[3499,29],[5036,26],[5764,29],[5813,28],[6017,27],[6201,26],[6260,26],[6351,26]]},"542":{"position":[[435,27],[1285,30],[4050,28],[6211,26]]},"544":{"position":[[166,26],[244,27],[1082,29],[2183,29],[3565,29],[5106,26],[5840,29],[5889,28]]}}}],["document:new",{"_index":645,"t":{"45":{"position":[[4351,12],[9402,13],[10341,12],[10619,13],[10764,13],[10912,13],[11142,12],[11917,13],[11999,12],[12214,12],[13034,13],[14128,13],[15503,13],[17030,12],[17749,13],[17792,13],[18425,12],[19228,13],[20322,13],[21697,13],[23224,12],[23943,13],[23986,13],[31843,12],[32032,13]]},"87":{"position":[[1366,12],[1468,12],[1595,13],[1644,12],[1770,13],[1839,12],[1940,12],[2068,13]]},"89":{"position":[[1942,12],[2227,13],[2548,13]]},"91":{"position":[[563,12],[692,12],[770,13],[819,12],[897,13],[1431,13]]},"93":{"position":[[640,12],[732,12],[810,13],[873,12],[961,13],[1410,13],[1488,12],[1570,12],[1671,13],[1733,12],[1843,13]]},"95":{"position":[[667,12],[744,12],[822,13],[878,12],[1012,13],[1445,13],[1523,12],[1634,12],[1735,13],[1782,12],[1858,13]]}}}],["document:otherdoc",{"_index":735,"t":{"45":{"position":[[25666,21],[26849,21],[28232,21],[29414,21],[29774,21],[30349,21],[30662,21]]},"147":{"position":[[296,21],[671,21],[1004,21],[1283,21],[1465,21],[1862,21],[1917,17]]},"618":{"position":[[1004,19],[1116,21],[2253,20],[2408,21],[3804,20],[3912,21],[5195,21],[5567,18],[5610,21],[6208,20],[6302,21],[6709,20],[6742,21]]}}}],["document:plan",{"_index":736,"t":{"45":{"position":[[25688,20],[26871,20],[28254,20],[29436,20],[29796,21],[30371,21],[30684,20]]},"147":{"position":[[318,20],[693,20],[1026,20],[1305,20],[1487,21],[1884,21],[1939,17]]},"198":{"position":[[135,19],[231,17],[315,20]]},"202":{"position":[[58,17],[875,20],[1966,20],[3338,20],[4859,17],[5572,20],[5612,19],[6620,20],[7713,20],[9087,20],[10612,17],[11330,20],[11370,19]]},"285":{"position":[[1205,20],[1380,18],[2175,20],[3262,20],[4630,20],[6143,17],[6843,20],[6883,19],[12888,18],[13842,20],[14933,20],[16305,20],[17826,17],[18539,20],[18579,19],[19445,20],[20538,20],[21912,20],[23437,17],[24155,20],[24195,19]]},"294":{"position":[[212,18]]},"296":{"position":[[76,18],[918,20],[2010,20],[3383,20],[4906,17],[5621,20],[5661,19]]},"363":{"position":[[1267,20]]},"369":{"position":[[1015,20],[2107,20],[3480,20],[5003,17],[5719,20],[5759,19],[6624,20],[7715,20],[9087,20],[10608,17],[11321,20],[11361,19]]},"375":{"position":[[90,17],[1165,21],[3894,19],[6001,17],[7309,20],[8401,20],[9774,20],[11297,17],[12012,20],[12052,19],[13124,20],[14216,20],[15589,20],[17112,17],[17828,20],[17868,19]]},"454":{"position":[[1699,20],[1825,20],[1949,20]]},"462":{"position":[[1018,20],[2113,20],[3489,20],[5018,17],[5743,20],[5783,19],[6651,20],[7745,20],[9120,20],[10647,17],[11369,20],[11409,19]]},"466":{"position":[[979,20],[2075,20],[3452,20],[4983,17],[5711,20],[5751,19],[6777,20],[7873,20],[9250,20],[10781,17],[11508,20],[11548,19]]},"590":{"position":[[335,18],[1007,20]]},"599":{"position":[[213,18],[1012,20],[2102,20],[3473,20],[4992,17],[5702,20],[5742,19],[5953,17]]},"606":{"position":[[12554,17],[15889,20],[17546,17],[18236,20],[18276,19]]},"608":{"position":[[564,18],[666,18],[5932,17],[6091,17]]},"613":{"position":[[183,18],[1008,20],[1048,19],[2156,20],[2196,19],[3591,19],[3630,19],[4764,20],[5147,17],[5776,20],[5816,19],[6920,20],[6960,19],[8068,20],[8108,19],[9503,19],[9542,19],[10676,20],[11059,17],[11688,20],[11728,19],[12016,17],[12119,17]]},"618":{"position":[[1138,20],[2430,20],[3934,20],[5217,20],[5632,21],[6324,21],[6764,20]]},"667":{"position":[[1141,17],[1216,20],[2144,20],[3235,20],[4607,20],[6128,17],[6841,20],[6881,19],[7064,18],[7275,17],[7388,20],[8316,20],[9407,20],[10779,20],[12300,17],[13013,20],[13053,19],[13253,18],[13901,20],[14077,18],[15140,20],[16234,20],[17609,20],[19136,17],[19858,20],[19898,19],[20150,18],[21043,20],[21974,20],[23065,20],[24437,20],[25958,17],[26671,20],[26711,19],[27201,18],[27278,20],[28211,20],[29303,20],[30676,20],[32199,17],[32915,20],[32955,19]]},"669":{"position":[[1113,17],[1188,20],[2117,20],[3209,20],[4582,20],[6105,17],[6820,20],[6860,19],[7056,18],[7361,18],[7434,20],[8369,20],[9464,20],[10840,20],[12369,17],[13093,20],[13133,19],[13333,18],[13780,20],[14711,20],[15804,20],[17178,20],[18703,17],[19421,20],[19461,19],[19721,18],[20022,18],[20100,20],[21035,20],[22128,20],[23502,20],[25027,17],[25746,20],[25786,19]]}}}],["document:pr",{"_index":1760,"t":{"412":{"position":[[590,19],[850,19],[1150,19]]},"416":{"position":[[224,19],[302,19]]},"418":{"position":[[244,19],[1346,19],[2291,19]]}}}],["document:pricing#view",{"_index":1775,"t":{"416":{"position":[[896,23]]}}}],["document:roadmap",{"_index":662,"t":{"45":{"position":[[5920,16],[6031,16],[6146,16],[6295,16],[6507,16]]},"677":{"position":[[805,19],[886,19]]},"679":{"position":[[229,16],[1834,19],[2927,19],[4301,19],[5826,16],[6546,19],[6585,18],[7451,19],[8543,19],[9916,19],[11439,16],[12156,19],[12195,18]]},"681":{"position":[[980,20],[3693,18],[5794,16],[6845,19],[7941,19],[9318,19],[10849,16],[11578,19],[11617,18]]},"683":{"position":[[7184,20],[7257,20],[10006,18],[10089,18],[12292,16],[12411,16],[13447,20],[13520,20],[16271,18],[16354,18],[18523,16],[18604,16],[19774,19],[20867,19],[22241,19],[23766,16],[24486,19],[24525,18],[25434,19],[26525,19],[27897,19],[29418,16],[30131,19],[30170,18]]}}}],["document:z",{"_index":962,"t":{"131":{"position":[[84,10]]},"135":{"position":[[68,10],[217,13],[493,13],[808,13],[1234,10]]},"246":{"position":[[83,10],[143,13]]},"250":{"position":[[176,14],[923,12],[1341,10]]},"252":{"position":[[140,10],[200,13],[332,14],[1081,12],[1464,10]]}}}],["document:{id",{"_index":1970,"t":{"482":{"position":[[4105,15],[4787,15],[6411,15],[6479,15]]}}}],["document’",{"_index":1777,"t":{"416":{"position":[[1221,10]]}}}],["doesn't",{"_index":1908,"t":{"476":{"position":[[222,7]]},"574":{"position":[[6361,7]]}}}],["domain",{"_index":612,"t":{"45":{"position":[[1847,6],[2174,9],[2290,9],[2403,9],[2515,9],[2589,9]]},"83":{"position":[[181,6],[887,9],[2016,9],[2207,9],[2320,9],[3338,9],[3529,9],[3642,9],[3757,7],[3790,6]]},"345":{"position":[[235,6]]},"357":{"position":[[6061,7]]},"375":{"position":[[18207,7]]},"404":{"position":[[11814,7]]},"504":{"position":[[5755,6]]},"514":{"position":[[1672,6]]},"544":{"position":[[6299,7]]},"546":{"position":[[229,6]]},"562":{"position":[[30307,6]]},"639":{"position":[[6411,7]]},"807":{"position":[[249,6]]},"815":{"position":[[268,6]]},"817":{"position":[[59,6],[90,6],[124,6],[160,6],[195,6],[327,7],[488,6]]},"822":{"position":[[224,7],[356,6],[645,6],[1240,9],[1353,9],[1469,9],[1582,9],[1636,9],[1817,8],[1923,6],[1992,7],[2019,7],[2856,6],[3081,6],[4296,6],[4698,6],[6289,6],[6544,6],[7809,6],[8063,6],[9675,6],[9912,6]]},"824":{"position":[[1395,9],[1508,9],[1624,9],[1737,9],[9047,6],[15494,9],[16832,6],[17994,9],[18107,9],[18223,9],[18336,9],[18390,9]]},"826":{"position":[[914,6],[2076,9],[2189,9],[2305,9],[2454,9],[2508,9],[2699,6],[16629,7],[28120,7]]}}}],["domain#memb",{"_index":611,"t":{"45":{"position":[[1707,15],[1747,15],[1784,15],[1820,15]]},"83":{"position":[[288,14],[384,14],[460,14],[583,14],[679,14],[755,14]]},"822":{"position":[[479,14],[516,14],[565,14],[612,14]]},"824":{"position":[[579,14],[616,14],[665,14],[712,14],[15084,14],[16550,14],[16608,14],[16679,14],[16751,14]]},"826":{"position":[[624,14],[682,14],[753,14],[833,14]]}}}],["domain/databas",{"_index":1921,"t":{"478":{"position":[[133,15]]}}}],["domain:auth0.com",{"_index":687,"t":{"45":{"position":[[9076,16]]}}}],["domain:xyz",{"_index":2816,"t":{"822":{"position":[[2912,14],[2976,14],[3043,14],[6354,12],[6428,12],[6505,12],[9257,10],[9367,10],[9480,10]]},"826":{"position":[[3666,10],[5217,10],[7154,10],[8715,10],[10524,10]]}}}],["domain:xyz#memb",{"_index":2817,"t":{"822":{"position":[[3128,20],[6598,20],[9573,17]]},"826":{"position":[[3729,20],[7224,20],[10178,17]]}}}],["don't",{"_index":138,"t":{"3":{"position":[[3002,5]]},"9":{"position":[[821,5]]},"107":{"position":[[52,5]]},"416":{"position":[[807,5]]},"472":{"position":[[299,5]]},"476":{"position":[[802,5]]},"482":{"position":[[7415,5]]},"484":{"position":[[3832,5]]},"560":{"position":[[1503,5]]}}}],["done",{"_index":725,"t":{"45":{"position":[[18046,4],[24381,4]]},"183":{"position":[[3032,4]]},"185":{"position":[[4161,4]]},"187":{"position":[[4722,4]]},"508":{"position":[[17,4]]},"703":{"position":[[2322,5]]},"751":{"position":[[9595,6]]},"775":{"position":[[17,4]]},"797":{"position":[[4105,5]]},"824":{"position":[[8987,6]]},"848":{"position":[[1569,4]]}}}],["don’t",{"_index":1771,"t":{"414":{"position":[[331,5]]},"418":{"position":[[2515,5]]}}}],["door",{"_index":2198,"t":{"626":{"position":[[664,5]]}}}],["dotnet",{"_index":926,"t":{"113":{"position":[[897,6],[909,6]]}}}],["doubt",{"_index":1012,"t":{"153":{"position":[[1737,6]]}}}],["down",{"_index":768,"t":{"81":{"position":[[599,4]]},"212":{"position":[[3182,5],[3234,5],[3281,5]]},"329":{"position":[[190,4],[318,4]]},"476":{"position":[[978,4],[2697,5]]},"478":{"position":[[1737,5],[3579,5]]},"480":{"position":[[2069,5]]},"484":{"position":[[2460,4]]},"548":{"position":[[1075,4]]},"699":{"position":[[72,4]]},"793":{"position":[[72,4]]}}}],["download",{"_index":943,"t":{"113":{"position":[[1426,8],[1840,8]]},"117":{"position":[[0,8]]},"123":{"position":[[0,8]]}}}],["downsid",{"_index":2483,"t":{"728":{"position":[[22640,9]]}}}],["downtim",{"_index":2281,"t":{"673":{"position":[[250,8]]}}}],["draft",{"_index":222,"t":{"9":{"position":[[688,7],[1075,8],[1119,6]]},"717":{"position":[[385,6],[502,6],[601,5]]},"719":{"position":[[408,5]]},"721":{"position":[[581,5],[726,5],[878,5]]},"726":{"position":[[1222,5],[1534,5],[3298,5],[3728,5],[5829,5],[6161,5],[7885,5],[8215,5],[10777,5],[11097,5]]},"728":{"position":[[41935,5],[42080,5],[42232,5]]}}}],["drastic",{"_index":1017,"t":{"153":{"position":[[1836,11]]}}}],["drive",{"_index":311,"t":{"19":{"position":[[370,6]]},"25":{"position":[[173,6]]},"45":{"position":[[32313,6]]},"87":{"position":[[2245,6]]},"89":{"position":[[3517,6]]},"327":{"position":[[2779,6],[2946,6]]},"329":{"position":[[508,6]]},"337":{"position":[[7,5]]},"359":{"position":[[99,5],[175,6]]},"361":{"position":[[496,6]]},"474":{"position":[[311,5]]},"476":{"position":[[1375,5],[1410,6],[1449,5],[1484,6],[2843,5]]},"478":{"position":[[512,5],[547,6],[586,5],[621,6],[1883,5],[2256,5],[2291,6],[2330,5],[2365,6],[3725,5],[3809,8],[3989,5],[4180,5]]},"480":{"position":[[747,5],[782,6],[821,5],[856,6],[2215,5],[2435,5],[3224,5]]},"482":{"position":[[2214,6],[5469,5],[5803,5],[6163,6],[6306,6],[6599,5],[7953,5]]},"484":{"position":[[1377,5]]},"486":{"position":[[41,5]]},"510":{"position":[[223,5]]},"546":{"position":[[163,5],[250,5]]},"564":{"position":[[214,5],[290,6]]},"807":{"position":[[47,5]]},"813":{"position":[[7,5],[143,5]]},"820":{"position":[[70,5],[30255,5]]},"822":{"position":[[7,5]]},"826":{"position":[[7,5]]}}}],["drive'",{"_index":2802,"t":{"813":{"position":[[301,7]]},"815":{"position":[[7,7]]}}}],["drive:{id",{"_index":1979,"t":{"482":{"position":[[6437,13]]}}}],["drop",{"_index":2002,"t":{"486":{"position":[[445,4]]}}}],["dropdown",{"_index":2559,"t":{"751":{"position":[[17225,8]]}}}],["dsl",{"_index":379,"t":{"35":{"position":[[71,3],[8439,4]]},"45":{"position":[[839,3],[1642,3],[3142,3],[6649,3],[7804,3],[11335,3]]},"81":{"position":[[355,3],[537,3],[650,3],[799,3]]},"83":{"position":[[140,3]]},"85":{"position":[[962,3],[1068,3]]},"87":{"position":[[113,3]]},"89":{"position":[[285,3],[1429,3]]},"91":{"position":[[30,4],[160,3]]},"93":{"position":[[38,4],[178,3]]},"95":{"position":[[39,4],[245,3]]},"97":{"position":[[211,3],[853,4],[1795,3]]},"191":{"position":[[312,3]]},"258":{"position":[[261,3]]},"281":{"position":[[52,3]]},"285":{"position":[[306,3]]},"302":{"position":[[350,3]]},"347":{"position":[[381,3]]},"355":{"position":[[166,3]]},"363":{"position":[[440,3]]},"371":{"position":[[211,3]]},"373":{"position":[[298,3]]},"382":{"position":[[43,3]]},"384":{"position":[[43,3]]},"396":{"position":[[281,3]]},"408":{"position":[[144,3],[755,3]]},"410":{"position":[[25,3],[93,4]]},"412":{"position":[[1512,3]]},"414":{"position":[[469,3]]},"416":{"position":[[1332,3]]},"418":{"position":[[580,3],[763,3]]},"430":{"position":[[485,3]]},"442":{"position":[[265,3]]},"454":{"position":[[692,3]]},"464":{"position":[[175,3]]},"482":{"position":[[10598,3]]},"492":{"position":[[328,3]]},"500":{"position":[[310,3]]},"502":{"position":[[114,3]]},"514":{"position":[[271,3]]},"530":{"position":[[286,3]]},"538":{"position":[[165,3]]},"550":{"position":[[292,3]]},"558":{"position":[[270,3]]},"560":{"position":[[742,3]]},"568":{"position":[[250,3]]},"576":{"position":[[75,3]]},"590":{"position":[[354,3]]},"628":{"position":[[306,3]]},"635":{"position":[[139,3]]},"643":{"position":[[76,3]]},"663":{"position":[[245,3]]},"667":{"position":[[56,3]]},"669":{"position":[[117,3]]},"677":{"position":[[254,3],[977,3]]},"679":{"position":[[256,3]]},"685":{"position":[[116,3]]},"695":{"position":[[865,3]]},"703":{"position":[[1085,3]]},"707":{"position":[[65,3]]},"724":{"position":[[603,3]]},"728":{"position":[[6106,3],[7143,3],[19933,3],[20806,3],[23330,3],[31051,3],[38928,3],[39502,3],[40579,3]]},"745":{"position":[[282,3],[1246,3],[30353,3],[31561,3]]},"747":{"position":[[341,3],[775,3]]},"751":{"position":[[938,3],[1283,3],[15638,3],[23113,3]]},"769":{"position":[[642,3]]},"773":{"position":[[1149,3]]},"775":{"position":[[340,3],[774,3]]},"777":{"position":[[630,3]]},"789":{"position":[[522,3]]},"797":{"position":[[247,3],[464,3],[1290,3],[2789,3]]},"801":{"position":[[65,3]]},"803":{"position":[[217,3]]},"820":{"position":[[367,3],[1216,3],[30393,3]]},"822":{"position":[[398,3]]},"824":{"position":[[472,3],[15029,3],[16469,3]]},"826":{"position":[[543,3]]},"842":{"position":[[996,3]]},"844":{"position":[[568,3],[1452,3]]},"846":{"position":[[6349,3]]},"848":{"position":[[1634,3],[3061,3],[4475,3]]}}}],["dsl’",{"_index":1750,"t":{"410":{"position":[[126,5]]}}}],["due",{"_index":794,"t":{"85":{"position":[[1507,3]]},"848":{"position":[[21658,3],[22949,3],[24675,3],[26026,3],[27356,3]]}}}],["durat",{"_index":86,"t":{"3":{"position":[[1355,9],[1675,9]]}}}],["dure",{"_index":148,"t":{"5":{"position":[[115,6]]},"39":{"position":[[752,6]]},"422":{"position":[[709,7]]},"689":{"position":[[592,6]]},"783":{"position":[[619,6]]},"789":{"position":[[424,6]]}}}],["dynam",{"_index":1657,"t":{"333":{"position":[[1115,7]]},"442":{"position":[[34,7]]},"709":{"position":[[305,7]]},"783":{"position":[[138,7]]}}}],["e",{"_index":586,"t":{"43":{"position":[[2919,2],[2989,2]]},"212":{"position":[[782,1],[808,1],[3472,1],[3502,1]]},"222":{"position":[[336,1]]},"327":{"position":[[2953,2]]},"329":{"position":[[600,1]]}}}],["e.g",{"_index":318,"t":{"21":{"position":[[96,5],[307,5]]},"35":{"position":[[1185,5],[2376,5],[4232,5],[5697,5],[6974,5],[7063,5],[7556,5],[7645,5]]},"43":{"position":[[316,5],[796,5],[1770,5]]},"45":{"position":[[3935,5],[4687,4],[4759,4],[4920,4],[8889,4],[9000,4],[9048,3],[10989,5],[12740,5],[13595,5],[14920,5],[16011,5],[16813,5],[16902,5],[17138,5],[17227,5],[18934,5],[19789,5],[21114,5],[22205,5],[23007,5],[23096,5],[23332,5],[23421,5],[25288,5],[26164,5],[27543,5],[28676,5],[29515,5],[29604,5],[29876,5],[29965,5]]},"85":{"position":[[273,5],[431,5],[628,5],[1794,5]]},"97":{"position":[[2628,5]]},"113":{"position":[[635,5]]},"133":{"position":[[458,5],[1010,5],[1921,5],[2633,5],[3193,5],[3310,5]]},"145":{"position":[[458,5],[1010,5],[1921,5],[2633,5],[3193,5],[3310,5]]},"173":{"position":[[4769,5]]},"179":{"position":[[443,4]]},"183":{"position":[[407,5],[1035,5],[1856,5],[2564,5]]},"185":{"position":[[755,5],[1524,5],[2584,5],[3666,5]]},"187":{"position":[[631,5],[1549,5],[2747,5],[4227,5]]},"200":{"position":[[571,5],[1381,5],[2816,5],[3931,5],[4739,5],[4828,5],[5273,5],[5362,5]]},"202":{"position":[[581,5],[1433,5],[2755,5],[3843,5],[4642,5],[4731,5],[4964,5],[5053,5],[6325,5],[7179,5],[8503,5],[9593,5],[10394,5],[10483,5],[10718,5],[10807,5]]},"210":{"position":[[826,4]]},"228":{"position":[[732,5]]},"248":{"position":[[458,5],[1010,5],[1921,5],[2633,5],[3193,5],[3310,5]]},"265":{"position":[[881,5],[1723,5],[3035,5],[4113,5],[4902,5],[4991,5],[5214,5],[5303,5]]},"267":{"position":[[592,5],[1397,5],[2827,5],[3937,5],[4742,5],[4831,5],[5271,5],[5360,5],[6296,5],[7139,5],[8452,5],[9531,5],[10321,5],[10410,5],[10634,5],[10723,5]]},"277":{"position":[[430,5],[982,5],[1893,5],[2605,5],[3193,5]]},"285":{"position":[[1886,5],[2734,5],[4052,5],[5136,5],[5931,5],[6020,5],[6249,5],[6338,5],[7524,5],[8371,5],[9843,5],[10995,5],[11839,5],[11928,5],[12371,5],[12460,5],[13548,5],[14400,5],[15722,5],[16810,5],[17609,5],[17698,5],[17931,5],[18020,5],[19150,5],[20004,5],[21328,5],[22418,5],[23219,5],[23308,5],[23543,5],[23632,5]]},"294":{"position":[[833,5],[1642,5],[3076,5],[4190,5],[4999,5],[5088,5],[5532,5],[5621,5]]},"296":{"position":[[624,5],[1477,5],[2800,5],[3889,5],[4689,5],[4778,5],[5012,5],[5101,5]]},"311":{"position":[[678,5],[1479,5],[2905,5],[4011,5],[4810,5],[4899,5],[5335,5],[5424,5],[6259,5],[7061,5],[8488,5],[9595,5],[10397,5],[10486,5],[10923,5],[11012,5],[12073,5],[13044,5],[14715,5],[16028,5],[17007,5],[17096,5]]},"323":{"position":[[256,5]]},"333":{"position":[[549,5],[775,5]]},"357":{"position":[[754,5],[1614,5],[2944,5],[4040,5],[4847,5],[4936,5],[5177,5],[5266,5]]},"361":{"position":[[633,5],[725,5]]},"369":{"position":[[720,5],[1573,5],[2896,5],[3985,5],[4785,5],[4874,5],[5108,5],[5197,5],[6330,5],[7182,5],[8504,5],[9592,5],[10391,5],[10480,5],[10713,5],[10802,5]]},"375":{"position":[[839,5],[1708,5],[3202,5],[4376,5],[5242,5],[5331,5],[5781,5],[5870,5],[7015,5],[7868,5],[9191,5],[10280,5],[11080,5],[11169,5],[11403,5],[11492,5],[12829,5],[13682,5],[15005,5],[16094,5],[16894,5],[16983,5],[17217,5],[17306,5]]},"382":{"position":[[1699,5],[2549,5],[3869,5],[4955,5],[5752,5],[5841,5],[6072,5],[6161,5]]},"402":{"position":[[633,5],[1455,5],[2902,5],[4029,5],[4849,5],[4938,5],[5395,5],[5484,5]]},"404":{"position":[[654,5],[1514,5],[2844,5],[3940,5],[4747,5],[4836,5],[5077,5],[5166,5],[6491,5],[7352,5],[8683,5],[9780,5],[10588,5],[10677,5],[10919,5],[11008,5]]},"412":{"position":[[1389,5]]},"418":{"position":[[138,5],[1981,5],[2164,4],[3069,5]]},"422":{"position":[[619,5]]},"444":{"position":[[702,5],[1677,5],[3336,5],[4626,5],[5607,5],[5696,5],[6220,5],[6309,5],[7456,5],[8311,5],[9636,5],[10727,5],[11529,5],[11618,5],[11854,5],[11943,5]]},"446":{"position":[[604,5],[1689,5],[3458,5],[4858,5],[5949,5],[6038,5],[6598,5],[6687,5]]},"448":{"position":[[550,5],[1405,5],[2730,5],[3821,5],[4623,5],[4712,5],[4948,5],[5037,5]]},"454":{"position":[[2486,5]]},"456":{"position":[[74,5]]},"462":{"position":[[720,5],[1576,5],[2902,5],[3994,5],[4797,5],[4886,5],[5123,5],[5212,5],[6354,5],[7209,5],[8534,5],[9625,5],[10427,5],[10516,5],[10752,5],[10841,5]]},"466":{"position":[[680,5],[1537,5],[2864,5],[3957,5],[4761,5],[4850,5],[5088,5],[5177,5],[6479,5],[7336,5],[8663,5],[9756,5],[10560,5],[10649,5],[10887,5],[10976,5]]},"480":{"position":[[2655,5]]},"482":{"position":[[1600,5]]},"504":{"position":[[608,5],[1416,5],[2849,5],[3962,5],[4768,5],[4857,5],[5300,5],[5389,5]]},"506":{"position":[[610,5],[1498,5],[3011,5],[4204,5],[5089,5],[5178,5],[5639,5],[5728,5]]},"508":{"position":[[727,5],[1587,5],[2917,5],[4013,5],[4820,5],[4909,5],[5150,5],[5239,5]]},"522":{"position":[[794,5],[1654,5],[3139,5],[4304,5],[5161,5],[5250,5],[5701,5],[5790,5]]},"524":{"position":[[859,5],[1715,5],[3041,5],[4133,5],[4936,5],[5025,5],[5262,5],[5351,5]]},"540":{"position":[[617,5],[1427,5],[2862,5],[3977,5],[4785,5],[4874,5],[5319,5],[5408,5]]},"542":{"position":[[950,5],[1837,5],[3349,5],[4541,5],[5425,5],[5514,5],[5982,5],[6071,5]]},"544":{"position":[[787,5],[1649,5],[2981,5],[4079,5],[4888,5],[4977,5],[5220,5],[5309,5]]},"562":{"position":[[842,5],[1787,5],[3416,5],[4676,5],[5627,5],[5716,5],[6222,5],[6311,5],[7390,5],[8243,5],[9566,5],[10655,5],[11455,5],[11544,5],[11778,5],[11867,5],[13385,5],[14238,5],[15561,5],[16650,5],[17450,5],[17539,5],[17773,5],[17862,5],[19071,5],[19926,5],[21251,5],[22342,5],[23144,5],[23233,5],[23469,5],[23558,5],[24697,5],[25551,5],[26875,5],[27965,5],[28766,5],[28855,5],[29090,5],[29179,5]]},"574":{"position":[[696,5],[1557,5],[3102,5],[4278,5],[5147,5],[5236,5],[5731,5],[5820,5]]},"578":{"position":[[703,5],[1560,5],[3101,5],[4273,5],[5138,5],[5227,5],[5718,5],[5807,5]]},"580":{"position":[[714,5],[1523,5],[2957,5],[4071,5],[4878,5],[4967,5],[5411,5],[5500,5]]},"582":{"position":[[560,5],[1401,5],[2712,5],[3789,5],[4577,5],[4666,5],[4888,5],[4977,5],[6074,5],[6915,5],[8226,5],[9303,5],[10091,5],[10180,5],[10402,5],[10491,5]]},"584":{"position":[[597,5],[1398,5],[2824,5],[3930,5],[4731,5],[4820,5],[5256,5],[5345,5],[6134,5],[6976,5],[8288,5],[9366,5],[10155,5],[10244,5],[10467,5],[10556,5]]},"599":{"position":[[719,5],[1570,5],[2891,5],[3978,5],[4776,5],[4865,5],[5097,5],[5186,5]]},"606":{"position":[[969,5],[1865,5],[3283,5],[4423,5],[5278,5],[5367,5],[5551,5],[5640,5],[7125,5],[8002,5],[9381,5],[10500,5],[11336,5],[11425,5],[11591,5],[11680,5],[13106,5],[13993,5],[15382,5],[16511,5],[17357,5],[17446,5],[17622,5],[17711,5]]},"608":{"position":[[1172,5],[1950,5],[3250,5],[4272,5],[5009,5],[5098,5],[5282,5],[5371,5]]},"613":{"position":[[710,5],[1600,5],[2987,5],[4136,5],[4937,5],[5026,5],[5249,5],[5338,5],[6622,5],[7512,5],[8899,5],[10048,5],[10849,5],[10938,5],[11161,5],[11250,5]]},"618":{"position":[[631,5],[1614,5],[3102,5],[4356,5],[5296,5],[5385,5],[5712,5],[5801,5]]},"637":{"position":[[846,5],[1772,5],[3323,5],[4554,5],[5477,5],[5566,5],[6026,5],[6115,5]]},"639":{"position":[[661,5],[1524,5],[2857,5],[3956,5],[4766,5],[4855,5],[5099,5],[5188,5]]},"645":{"position":[[571,5],[1596,5],[3305,5],[4645,5],[5676,5],[5765,5],[6307,5],[6396,5]]},"647":{"position":[[590,5],[1445,5],[2770,5],[3861,5],[4663,5],[4752,5],[4988,5],[5077,5]]},"649":{"position":[[571,5],[1452,5],[2958,5],[4144,5],[5024,5],[5113,5],[5579,5],[5668,5],[6629,5],[7485,5],[8811,5],[9903,5],[10706,5],[10795,5],[11032,5],[11121,5],[12262,5],[13121,5],[14450,5],[15545,5],[16351,5],[16440,5],[16680,5],[16769,5]]},"667":{"position":[[1850,5],[2702,5],[4024,5],[5112,5],[5911,5],[6000,5],[6233,5],[6322,5],[8022,5],[8874,5],[10196,5],[11284,5],[12083,5],[12172,5],[12405,5],[12494,5],[14843,5],[15698,5],[17023,5],[18114,5],[18916,5],[19005,5],[19241,5],[19330,5],[21680,5],[22532,5],[23854,5],[24942,5],[25741,5],[25830,5],[26063,5],[26152,5],[27916,5],[28769,5],[30092,5],[31181,5],[31981,5],[32070,5],[32304,5],[32393,5]]},"669":{"position":[[1823,5],[2676,5],[3999,5],[5088,5],[5888,5],[5977,5],[6211,5],[6300,5],[8072,5],[8928,5],[10254,5],[11346,5],[12149,5],[12238,5],[12475,5],[12564,5],[14416,5],[15270,5],[16594,5],[17684,5],[18485,5],[18574,5],[18809,5],[18898,5],[20739,5],[21593,5],[22917,5],[24007,5],[24808,5],[24897,5],[25132,5],[25221,5]]},"679":{"position":[[1537,5],[2391,5],[3715,5],[4805,5],[5606,5],[5695,5],[5930,5],[6019,5],[7155,5],[8008,5],[9331,5],[10420,5],[11220,5],[11309,5],[11543,5],[11632,5]]},"681":{"position":[[661,5],[1522,5],[3008,5],[4174,5],[5032,5],[5121,5],[5572,5],[5661,5],[6545,5],[7402,5],[8729,5],[9822,5],[10626,5],[10715,5],[10953,5],[11042,5]]},"683":{"position":[[636,5],[1600,5],[3026,5],[4228,5],[5151,5],[5240,5],[5371,5],[5460,5],[6913,5],[7799,5],[9369,5],[10570,5],[11464,5],[11553,5],[12073,5],[12162,5],[13175,5],[14062,5],[15633,5],[16835,5],[17732,5],[17821,5],[18342,5],[18431,5],[19477,5],[20331,5],[21655,5],[22745,5],[23546,5],[23635,5],[23870,5],[23959,5],[25140,5],[25992,5],[27314,5],[28402,5],[29201,5],[29290,5],[29523,5],[29612,5]]},"703":{"position":[[5222,5],[6100,5],[7603,5],[8786,5],[9661,5],[9750,5],[10205,5],[10294,5]]},"705":{"position":[[1613,5],[2519,5],[4050,5],[5261,5],[6166,5],[6255,5],[6711,5],[6800,5]]},"726":{"position":[[675,5],[2330,5],[4905,5],[6915,5],[8612,5],[8701,5],[9557,5],[9646,5],[11993,5],[13188,5],[15126,5],[16646,5],[17856,5],[17945,5],[18554,5],[18643,5],[20130,5],[21255,5],[23123,5],[24573,5],[25713,5],[25802,5],[26396,5],[26485,5],[28729,5],[29582,5],[30905,5],[31994,5],[32794,5],[32883,5],[33117,5],[33206,5],[34488,5],[35342,5],[36666,5],[37756,5],[38557,5],[38646,5],[38881,5],[38970,5],[40105,5],[40962,5],[42289,5],[43382,5],[44186,5],[44275,5],[44513,5],[44602,5],[45747,5],[46605,5],[47933,5],[49027,5],[49832,5],[49921,5],[50160,5],[50249,5]]},"728":{"position":[[771,5],[1625,5],[2949,5],[4039,5],[4840,5],[4929,5],[5164,5],[5253,5],[8690,5],[9540,5],[10860,5],[11946,5],[12743,5],[12832,5],[13063,5],[13152,5],[14607,5],[15466,5],[16795,5],[17890,5],[18696,5],[18785,5],[19025,5],[19114,5],[21826,4],[21973,4],[22436,4],[25025,5],[25883,5],[27211,5],[28305,5],[29110,5],[29199,5],[29438,5],[29527,5],[33273,5],[34122,5],[35441,5],[36526,5],[37322,5],[37411,5],[37641,5],[37730,5],[38677,4],[42808,5],[43657,5],[44976,5],[46061,5],[46857,5],[46946,5],[47176,5],[47265,5]]},"740":{"position":[[291,4]]},"745":{"position":[[2302,5],[3119,5],[4561,5],[5683,5],[6498,5],[6587,5],[7039,5],[7128,5],[7986,5],[8841,5],[10166,5],[11257,5],[12059,5],[12148,5],[12384,5],[12473,5],[13676,5],[14493,5],[15935,5],[17057,5],[17872,5],[17961,5],[18413,5],[18502,5],[19317,5],[20172,5],[21497,5],[22588,5],[23390,5],[23479,5],[23715,5],[23804,5],[24943,5],[25799,5],[27125,5],[28217,5],[29020,5],[29109,5],[29346,5],[29435,5],[32677,5],[33532,5],[34857,5],[35948,5],[36750,5],[36839,5],[37075,5],[37164,5],[38303,5],[39158,5],[40483,5],[41574,5],[42376,5],[42465,5],[42701,5],[42790,5]]},"747":{"position":[[2831,5],[3877,5],[5607,5],[6968,5],[8020,5],[8109,5],[8662,5],[8751,5],[10145,5],[11002,5],[12329,5],[13422,5],[14226,5],[14315,5],[14553,5],[14642,5]]},"749":{"position":[[776,5],[1617,5],[3083,5],[4229,5],[5068,5],[5157,5],[5633,5],[5722,5],[7017,5],[7890,5],[9388,5],[10566,5],[11436,5],[11525,5],[11980,5],[12069,5],[12908,5],[13763,5],[15088,5],[16179,5],[16981,5],[17070,5],[17306,5],[17395,5]]},"751":{"position":[[3473,5],[4374,5],[5959,5],[7175,5],[8084,5],[8173,5],[8708,5],[8797,5],[10357,5],[11216,5],[12545,5],[13640,5],[14446,5],[14535,5],[14775,5],[14864,5],[17791,5],[18630,5],[20094,5],[21238,5],[22075,5],[22164,5],[22638,5],[22727,5]]},"771":{"position":[[988,5],[1804,5],[3245,5],[4366,5],[5180,5],[5269,5],[5720,5],[5809,5],[6636,5],[7456,5],[8901,5],[10026,5],[10844,5],[10933,5],[11388,5],[11477,5],[12320,5],[13283,5],[14989,5],[16277,5],[17258,5],[17347,5],[17943,5],[18032,5],[18827,5],[19554,5],[20408,5],[21732,5],[22822,5],[23623,5],[23712,5],[23947,5],[24036,5],[25253,5],[26105,5],[27427,5],[28515,5],[29314,5],[29403,5],[29636,5],[29725,5]]},"773":{"position":[[313,4],[3406,5],[4422,5],[6240,5],[7591,5],[8635,5],[8724,5],[9372,5],[9461,5],[10882,5],[11739,5],[13066,5],[14159,5],[14963,5],[15052,5],[15290,5],[15379,5]]},"775":{"position":[[3311,5],[4215,5],[5803,5],[7022,5],[7934,5],[8023,5],[8561,5],[8650,5],[9836,5],[10935,5],[12836,5],[14270,5],[15397,5],[15486,5],[16217,5],[16306,5],[18066,5],[18917,5],[20238,5],[21325,5],[22123,5],[22212,5],[22444,5],[22533,5]]},"777":{"position":[[3506,5],[4472,5],[6181,5],[7472,5],[8456,5],[8545,5],[9144,5],[9233,5],[10758,5],[11614,5],[12940,5],[14032,5],[14835,5],[14924,5],[15161,5],[15250,5]]},"789":{"position":[[3079,5],[4415,5],[6553,5],[8224,5],[9584,5],[9673,5],[10367,5],[10456,5]]},"795":{"position":[[906,5],[1756,5],[3076,5],[4162,5],[4959,5],[5048,5],[5279,5],[5368,5],[6594,5],[7448,5],[8772,5],[9862,5],[10663,5],[10752,5],[10987,5],[11076,5],[12319,5],[13195,5],[14696,5],[15877,5],[16750,5],[16839,5],[17296,5],[17385,5],[18229,5],[19080,5],[20401,5],[21488,5],[22286,5],[22375,5],[22607,5],[22696,5]]},"797":{"position":[[5021,5],[5867,5],[7183,5],[8265,5],[9058,5],[9147,5],[9374,5],[9463,5],[10826,5],[12070,5],[14057,5],[15626,5],[16885,5],[16974,5],[17630,5],[17719,5],[19369,5],[20368,5],[22051,5],[23365,5],[24370,5],[24459,5],[24982,5],[25071,5],[26308,5],[27158,5],[28478,5],[29564,5],[30361,5],[30450,5],[30681,5],[30770,5]]},"799":{"position":[[296,4],[1566,5],[2620,5],[4358,5],[5727,5],[6789,5],[6878,5],[7402,5],[7491,5],[9003,5],[10022,5],[11530,5],[12817,5],[13802,5],[13891,5],[14220,5],[14309,5],[15929,5],[16949,5],[18458,5],[19746,5],[20732,5],[20821,5],[21151,5],[21240,5]]},"801":{"position":[[3807,5],[6399,5],[10265,5],[13272,5],[15960,5],[16049,5],[17442,5],[17531,5]]},"820":{"position":[[2303,5],[3123,5],[4568,5],[5693,5],[6511,5],[6600,5],[7055,5],[7144,5],[8011,5],[8869,5],[10197,5],[11291,5],[12096,5],[12185,5],[12424,5],[12513,5],[13723,5],[14539,5],[15980,5],[17101,5],[17915,5],[18004,5],[18455,5],[18544,5],[19357,5],[20211,5],[21535,5],[22625,5],[23426,5],[23515,5],[23750,5],[23839,5],[24975,5],[25831,5],[27157,5],[28249,5],[29052,5],[29141,5],[29378,5],[29467,5],[32197,5],[33051,5],[34375,5],[35465,5],[36266,5],[36355,5],[36590,5],[36679,5],[37815,5],[38670,5],[39995,5],[41086,5],[41888,5],[41977,5],[42213,5],[42302,5]]},"822":{"position":[[2586,5],[3723,5],[5662,5],[7134,5],[8297,5],[8386,5],[9038,5],[9127,5],[10819,5],[11677,5],[13005,5],[14099,5],[14904,5],[14993,5],[15232,5],[15321,5]]},"824":{"position":[[2419,5],[3435,5],[5135,5],[6466,5],[7488,5],[7577,5],[8118,5],[8207,5],[9732,5],[10593,5],[11924,5],[13021,5],[13829,5],[13918,5],[14160,5],[14249,5]]},"826":{"position":[[3292,5],[4481,5],[6413,5],[7927,5],[9131,5],[9220,5],[9849,5],[9938,5],[11402,5],[12264,5],[13596,5],[14694,5],[15503,5],[15592,5],[15835,5],[15924,5],[17160,5],[18024,5],[19358,5],[20458,5],[21269,5],[21358,5],[21603,5],[21692,5],[22857,5],[23723,5],[25059,5],[26161,5],[26974,5],[27063,5],[27310,5],[27399,5],[28649,5],[29513,5],[30847,5],[31947,5],[32758,5],[32847,5],[33092,5],[33181,5],[34346,5],[35210,5],[36544,5],[37644,5],[38455,5],[38544,5],[38789,5],[38878,5]]},"842":{"position":[[234,4]]},"844":{"position":[[2545,5],[3420,5],[4920,5],[6100,5],[6972,5],[7061,5],[7518,5],[7607,5],[8522,5],[9382,5],[10712,5],[11808,5],[12615,5],[12704,5],[12945,5],[13034,5],[14256,5],[15131,5],[16631,5],[17811,5],[18683,5],[18772,5],[19229,5],[19318,5],[20190,5],[21050,5],[22380,5],[23476,5],[24283,5],[24372,5],[24613,5],[24702,5],[25933,5],[26800,5],[28137,5],[29240,5],[30054,5],[30143,5],[30391,5],[30480,5],[32094,5],[33219,5],[35087,5],[36537,5],[37677,5],[37766,5],[38372,5],[38461,5],[39894,5],[40754,5],[42084,5],[43180,5],[43987,5],[44076,5],[44317,5],[44406,5]]},"846":{"position":[[606,5],[1461,5],[2786,5],[3877,5],[4679,5],[4768,5],[5004,5],[5093,5],[7888,5],[8742,5],[10066,5],[11156,5],[11957,5],[12046,5],[12281,5],[12370,5]]},"848":{"position":[[7374,5],[8414,5],[10197,5],[11562,5],[12620,5],[12709,5],[13382,5],[13471,5],[14990,5],[15934,5],[17503,5],[18752,5],[19693,5],[19782,5],[20247,5],[20336,5],[21433,5],[22421,5],[24093,5],[25396,5],[26391,5],[26480,5],[26995,5],[27084,5],[28267,5],[29170,5],[30757,5],[31975,5],[32886,5],[32975,5],[33512,5],[33601,5],[34751,5],[35597,5],[37068,5],[38219,5],[39063,5],[39152,5],[39633,5],[39722,5],[40638,5],[41467,5],[42921,5],[44055,5],[44882,5],[44971,5],[45435,5],[45524,5],[46539,5],[47391,5],[48713,5],[49801,5],[50600,5],[50689,5],[50922,5],[51011,5],[52210,5],[53077,5],[54414,5],[55517,5],[56331,5],[56420,5],[56668,5],[56757,5]]}}}],["each",{"_index":626,"t":{"45":{"position":[[3483,4]]},"83":{"position":[[3929,4]]},"101":{"position":[[116,4]]},"113":{"position":[[1113,4]]},"153":{"position":[[1144,4],[1385,4]]},"171":{"position":[[2040,4]]},"173":{"position":[[3281,4]]},"210":{"position":[[740,4]]},"222":{"position":[[1185,4]]},"313":{"position":[[519,4]]},"317":{"position":[[141,4]]},"321":{"position":[[107,4]]},"323":{"position":[[518,4]]},"345":{"position":[[537,4]]},"357":{"position":[[6016,4]]},"375":{"position":[[18162,4]]},"400":{"position":[[146,4]]},"404":{"position":[[11769,4]]},"418":{"position":[[2132,4]]},"480":{"position":[[0,4],[2840,4]]},"482":{"position":[[83,4],[301,4],[315,4],[3945,4],[4633,4]]},"504":{"position":[[5710,4]]},"514":{"position":[[1627,4]]},"544":{"position":[[6254,4]]},"562":{"position":[[30262,4]]},"639":{"position":[[6366,4]]},"705":{"position":[[311,4],[857,4],[941,4]]},"719":{"position":[[145,4]]},"728":{"position":[[20374,4]]},"740":{"position":[[231,5]]},"751":{"position":[[16742,4]]},"763":{"position":[[334,4]]},"797":{"position":[[202,4]]},"799":{"position":[[764,4]]},"803":{"position":[[140,4]]},"824":{"position":[[16173,4]]}}}],["earlier",{"_index":1820,"t":{"424":{"position":[[360,7]]},"726":{"position":[[33911,7]]},"728":{"position":[[38571,7]]},"775":{"position":[[17471,7]]},"846":{"position":[[33,8]]},"848":{"position":[[21700,8],[22991,8],[24717,8],[26068,8],[27398,8]]}}}],["easi",{"_index":1518,"t":{"236":{"position":[[311,4]]},"357":{"position":[[6130,4]]},"404":{"position":[[11883,4]]},"482":{"position":[[506,4]]},"504":{"position":[[5866,4]]},"514":{"position":[[1788,4]]},"544":{"position":[[6368,4]]},"562":{"position":[[30423,4]]},"639":{"position":[[6481,4]]}}}],["easier",{"_index":622,"t":{"45":{"position":[[3165,6]]},"81":{"position":[[680,6]]},"97":{"position":[[1755,6]]},"375":{"position":[[18289,6]]},"408":{"position":[[237,6]]},"482":{"position":[[3296,7]]},"726":{"position":[[27675,6]]},"763":{"position":[[200,7]]},"765":{"position":[[643,6]]},"840":{"position":[[1094,6]]}}}],["easili",{"_index":43,"t":{"3":{"position":[[632,6],[927,6]]},"125":{"position":[[164,6]]}}}],["east",{"_index":2706,"t":{"795":{"position":[[12578,4],[13757,4],[15312,4],[16541,4],[17586,4]]}}}],["ecosystem",{"_index":173,"t":{"7":{"position":[[257,9]]}}}],["edit",{"_index":320,"t":{"21":{"position":[[138,4]]},"45":{"position":[[6571,8]]},"353":{"position":[[215,4]]},"363":{"position":[[377,7],[1175,4]]},"369":{"position":[[163,4],[11674,4],[11692,7],[11906,4],[12052,4],[12089,4]]},"371":{"position":[[998,7]]},"373":{"position":[[43,7]]},"375":{"position":[[1085,7],[2257,7],[3805,7],[5027,7],[6051,7],[6249,4],[12219,4]]},"430":{"position":[[252,4],[309,4],[466,4]]},"432":{"position":[[106,4],[163,4]]},"440":{"position":[[469,4],[634,4]]},"446":{"position":[[871,4],[2259,4],[4082,4],[5530,4],[7046,4]]},"476":{"position":[[2250,4]]},"478":{"position":[[1290,4],[3132,4]]},"480":{"position":[[1622,4]]},"548":{"position":[[821,4]]},"560":{"position":[[552,5]]},"695":{"position":[[610,4]]}}}],["editor",{"_index":319,"t":{"21":{"position":[[123,6]]},"45":{"position":[[926,7],[1054,9],[1277,9],[1776,7],[2037,9],[2348,9],[5711,6],[5940,6],[6051,6],[6166,6],[6315,7],[6527,6],[6736,7],[6898,9],[7121,9],[7378,6],[9005,7],[9382,9],[11393,6],[11407,7],[11568,8],[11588,9],[11645,9],[11897,9],[12059,6],[31923,8],[32012,9]]},"87":{"position":[[153,7],[193,6],[219,6],[263,9],[374,8],[443,8],[488,9],[777,7],[876,7],[1180,6],[1458,6],[1505,6],[1575,9],[1880,6],[1930,6],[1977,6],[2048,9]]},"91":{"position":[[218,6],[371,8],[682,6],[750,9],[1203,9],[1246,6],[1343,6]]},"93":{"position":[[246,6],[448,8],[722,6],[790,9],[1211,8],[1298,6],[1560,6],[1651,9]]},"97":{"position":[[459,8],[674,8],[939,7],[988,6],[1165,9],[1354,8],[1582,9],[1865,6],[2060,8],[2494,6]]},"345":{"position":[[116,7],[346,7]]},"347":{"position":[[244,6],[356,6],[470,7],[617,9],[743,9],[970,9]]},"353":{"position":[[73,7],[301,7]]},"355":{"position":[[98,7],[251,6],[265,7],[471,8],[491,9],[617,9],[792,6],[863,6]]},"357":{"position":[[64,6]]},"359":{"position":[[130,7]]},"363":{"position":[[243,7],[507,7],[683,9],[740,9],[1247,9]]},"369":{"position":[[997,9],[2089,9],[3461,9],[4996,6],[5672,9],[5692,8],[6606,9],[7697,9],[9068,9],[10601,6],[11274,9],[11294,8]]},"371":{"position":[[301,7],[504,9],[631,9]]},"373":{"position":[[93,6],[188,7],[388,7],[607,9],[826,9]]},"375":{"position":[[148,6],[7291,9],[8383,9],[9755,9],[11290,6],[11965,9],[11985,8],[13106,9],[14198,9],[15570,9],[17105,6],[17781,9],[17801,8]]},"396":{"position":[[273,7],[370,7],[517,9],[643,9]]},"402":{"position":[[63,6],[885,9],[3519,9],[5606,6]]},"404":{"position":[[128,6],[929,9],[2028,9],[3407,9],[4956,6],[5644,9],[5664,8]]},"422":{"position":[[975,7],[993,6]]},"430":{"position":[[576,6],[590,7],[802,8],[822,9],[879,9]]},"440":{"position":[[601,6]]},"442":{"position":[[371,6],[385,7],[656,8],[676,9],[846,9]]},"446":{"position":[[954,9],[4173,9],[6828,6]]},"448":{"position":[[826,9],[1920,9],[3294,9],[4833,6],[5512,9],[5532,8]]},"476":{"position":[[1815,6],[1856,6],[2127,6],[2290,6]]},"478":{"position":[[857,6],[898,6],[1169,6],[1330,6],[2697,6],[2738,6],[3009,6],[3172,6]]},"480":{"position":[[1187,6],[1228,6],[1499,6],[1662,6],[2291,6],[2938,7]]},"482":{"position":[[4154,7],[4166,6],[4222,7],[4314,7],[4408,6],[4554,7],[4656,7],[4769,9],[4883,7],[5038,7],[5113,9],[5277,6],[7076,6],[7117,6],[7351,6],[7860,6],[8250,6],[8532,6],[8725,6],[8773,6],[9001,6],[9556,7],[9686,6],[9741,6],[9782,6],[9840,6],[10149,7],[10279,6],[10334,6],[10375,6],[10433,6]]},"484":{"position":[[2011,7],[2068,9]]},"490":{"position":[[182,6],[211,6]]},"492":{"position":[[270,6],[321,6],[393,7],[439,7],[558,9],[615,9],[727,9],[784,9]]},"498":{"position":[[77,6],[110,6],[161,7],[187,7],[334,6],[462,6],[517,6],[616,6],[769,6]]},"500":{"position":[[375,7],[445,7],[564,9],[621,9],[759,9],[887,9]]},"502":{"position":[[179,7],[249,7],[267,6],[390,9],[447,9],[585,9],[728,8],[852,9],[935,6],[1004,7],[1069,6],[1076,8],[1185,6],[1203,6]]},"504":{"position":[[98,6],[860,9],[3466,9],[5511,6]]},"506":{"position":[[19,6]]},"508":{"position":[[202,6],[1002,9],[2101,9],[3480,9],[5029,6],[5717,9],[5737,8],[6150,6],[6228,7],[6296,7],[6341,6]]},"510":{"position":[[287,7],[317,7]]},"530":{"position":[[278,7],[353,7],[474,9],[531,9]]},"536":{"position":[[184,6]]},"538":{"position":[[232,7],[402,9],[459,9]]},"542":{"position":[[424,7],[1267,9],[4031,9],[6204,6]]},"544":{"position":[[155,7],[234,6],[1064,9],[2165,9],[3546,9],[5099,6],[5793,9],[5813,8],[6075,7],[6129,6]]},"548":{"position":[[231,8]]},"564":{"position":[[245,7]]},"628":{"position":[[243,7],[373,7],[538,9],[595,9]]},"635":{"position":[[230,7],[421,9],[549,9]]},"639":{"position":[[6059,6],[6108,7],[6142,7]]},"663":{"position":[[351,6],[365,7],[626,8],[646,9],[850,9],[1259,6],[1374,7]]},"667":{"position":[[162,6],[176,7],[437,8],[457,9],[661,9],[27191,6],[27258,9],[33068,6],[33157,6],[33379,6],[33444,6]]},"669":{"position":[[192,6],[206,7],[427,8],[441,9],[498,9],[20012,6],[20080,9]]},"677":{"position":[[113,6],[134,6],[311,7],[343,6],[446,9],[533,8],[578,9],[731,6],[785,9],[866,9]]},"679":{"position":[[313,7],[353,6],[505,9],[616,8],[818,9]]},"681":{"position":[[921,6],[2085,6],[3625,6],[4839,6],[5857,6]]},"683":{"position":[[6349,6],[13429,9],[13502,9],[16252,9],[16335,9],[18516,6],[18597,6],[25416,9],[26507,9],[27878,9],[29411,6],[30084,9],[30104,8]]},"695":{"position":[[1145,7],[1265,6],[1289,6],[2006,9],[2539,8],[2614,8]]},"703":{"position":[[830,6]]},"707":{"position":[[483,7],[603,6],[627,6],[1881,9],[2414,8],[2489,8]]},"815":{"position":[[179,8]]}}}],["editor(",{"_index":1971,"t":{"482":{"position":[[4668,9]]}}}],["effect",{"_index":2242,"t":{"665":{"position":[[18,6]]},"669":{"position":[[41,6]]},"777":{"position":[[610,7],[10122,6]]}}}],["effort",{"_index":66,"t":{"3":{"position":[[958,7]]}}}],["emili",{"_index":2258,"t":{"667":{"position":[[27179,5],[27341,5],[33056,5],[33274,5],[33367,5]]},"777":{"position":[[2869,6],[2876,5],[9944,5],[10023,5],[15992,5],[16032,5],[16087,5],[16120,5]]},"840":{"position":[[160,5],[461,5],[742,5],[945,5]]},"842":{"position":[[731,5]]},"844":{"position":[[401,5],[31484,5],[32577,5],[34123,5],[35947,5],[37443,5],[39137,5]]},"848":{"position":[[866,6],[1108,5],[1208,5],[20923,5],[27742,6],[58154,5],[58197,5],[58256,5],[58299,5]]}}}],["employ",{"_index":18,"t":{"3":{"position":[[244,7]]}}}],["employe",{"_index":1287,"t":{"191":{"position":[[252,8],[378,9],[558,11],[617,11],[866,10]]},"198":{"position":[[25,8],[198,8]]},"200":{"position":[[50,8],[824,11],[3434,11],[5485,8]]},"202":{"position":[[5798,8]]},"283":{"position":[[135,8],[226,8]]},"380":{"position":[[608,8]]},"418":{"position":[[1463,9],[2340,11],[2358,8]]},"490":{"position":[[656,8],[701,8]]}}}],["employee’",{"_index":2314,"t":{"689":{"position":[[385,10]]},"783":{"position":[[417,10]]}}}],["empti",{"_index":1222,"t":{"183":{"position":[[3354,5]]},"185":{"position":[[4483,5]]},"187":{"position":[[5044,5]]},"608":{"position":[[6013,5]]},"751":{"position":[[17167,5]]}}}],["enabl",{"_index":216,"t":{"9":{"position":[[469,7]]},"109":{"position":[[66,7]]},"151":{"position":[[137,6]]},"185":{"position":[[307,6]]},"212":{"position":[[2646,6],[5277,6]]},"214":{"position":[[468,6],[713,8],[968,6],[1285,8],[1902,6],[2162,8],[2493,6],[2810,8]]},"216":{"position":[[216,7]]},"218":{"position":[[206,7],[264,7],[396,7],[642,7]]},"222":{"position":[[71,7],[578,7],[703,7],[790,7],[992,6],[1272,7]]},"226":{"position":[[517,6]]},"228":{"position":[[103,6],[566,6]]},"408":{"position":[[263,6]]},"418":{"position":[[1211,6]]},"440":{"position":[[66,6]]},"663":{"position":[[28,7]]},"665":{"position":[[25,8]]}}}],["enabled=fals",{"_index":1485,"t":{"226":{"position":[[179,13]]}}}],["enabled=tru",{"_index":1414,"t":{"214":{"position":[[1599,12],[3152,12]]},"228":{"position":[[132,12],[603,12]]}}}],["encod",{"_index":1790,"t":{"418":{"position":[[2965,6]]},"482":{"position":[[142,6]]}}}],["encompass",{"_index":1279,"t":{"189":{"position":[[220,9]]},"528":{"position":[[238,9]]}}}],["encount",{"_index":39,"t":{"3":{"position":[[549,10]]},"45":{"position":[[9299,9]]},"81":{"position":[[714,9]]},"508":{"position":[[6672,10]]},"536":{"position":[[40,9]]},"728":{"position":[[19850,11]]}}}],["end",{"_index":1661,"t":{"335":{"position":[[180,3],[187,3]]},"440":{"position":[[983,4]]},"721":{"position":[[443,3]]},"745":{"position":[[66,3],[97,3]]},"747":{"position":[[145,3],[176,3]]},"749":{"position":[[18054,3],[18074,5]]},"751":{"position":[[392,3],[423,3]]},"761":{"position":[[195,3]]},"773":{"position":[[937,3]]},"791":{"position":[[7,3]]},"820":{"position":[[160,3]]},"822":{"position":[[123,3],[154,3]]},"824":{"position":[[196,3],[227,3]]},"842":{"position":[[16,3]]},"844":{"position":[[157,3]]},"848":{"position":[[167,3]]}}}],["endpoint",{"_index":724,"t":{"45":{"position":[[17952,8],[18159,8],[18207,8],[24268,8],[24507,8],[24562,8]]},"71":{"position":[[47,8]]},"73":{"position":[[61,8]]},"103":{"position":[[98,8]]},"105":{"position":[[5,9]]},"155":{"position":[[1274,9],[1480,9]]},"220":{"position":[[48,8]]},"226":{"position":[[450,8]]},"228":{"position":[[306,8]]},"321":{"position":[[36,9]]},"323":{"position":[[25,8]]},"327":{"position":[[1767,9],[1880,8],[2203,9],[3162,9]]},"418":{"position":[[2042,9]]},"588":{"position":[[106,10]]},"597":{"position":[[24,8]]},"604":{"position":[[23,8]]},"616":{"position":[[30,8]]},"693":{"position":[[259,8]]},"707":{"position":[[10294,8],[10323,9],[10382,10],[10431,8]]},"787":{"position":[[260,8]]},"801":{"position":[[21196,8],[21225,9],[21284,10],[21333,8],[21495,8]]}}}],["enforc",{"_index":1746,"t":{"408":{"position":[[547,9]]}}}],["engin",{"_index":1280,"t":{"189":{"position":[[312,9]]},"210":{"position":[[381,7]]},"212":{"position":[[34,6],[89,6],[209,6],[306,6],[1168,6],[1413,6],[3120,8],[3855,6],[4080,6]]},"528":{"position":[[330,9]]},"689":{"position":[[543,8]]},"749":{"position":[[177,12],[6115,12]]},"783":{"position":[[570,8]]},"850":{"position":[[732,11]]}}}],["enough",{"_index":1003,"t":{"153":{"position":[[1335,6]]},"327":{"position":[[1593,7],[1844,7]]},"329":{"position":[[173,6],[451,6]]},"428":{"position":[[399,7]]},"749":{"position":[[6142,6]]},"848":{"position":[[21728,6],[23019,6],[24745,6],[26096,6],[27426,6]]}}}],["ensur",{"_index":284,"t":{"17":{"position":[[44,7]]},"105":{"position":[[373,6]]},"107":{"position":[[36,6]]},"109":{"position":[[444,6]]},"153":{"position":[[3,6],[309,6]]},"181":{"position":[[93,6]]},"408":{"position":[[1107,6]]},"440":{"position":[[1014,8]]},"448":{"position":[[3,6]]},"482":{"position":[[6535,6]]},"484":{"position":[[101,6],[633,6],[1160,6]]},"560":{"position":[[1564,6]]},"673":{"position":[[263,6]]},"679":{"position":[[106,7]]},"681":{"position":[[6035,6]]},"683":{"position":[[18897,6]]},"699":{"position":[[171,6]]},"701":{"position":[[108,6]]},"728":{"position":[[40520,6]]},"793":{"position":[[161,6]]},"795":{"position":[[108,6],[178,6]]},"848":{"position":[[45994,6]]}}}],["enter",{"_index":475,"t":{"35":{"position":[[6005,5]]},"45":{"position":[[16319,5],[22513,5],[28984,5]]},"133":{"position":[[2941,5]]},"145":{"position":[[2941,5]]},"200":{"position":[[4239,5]]},"202":{"position":[[4151,5],[9901,5]]},"248":{"position":[[2941,5]]},"265":{"position":[[4421,5]]},"267":{"position":[[4245,5],[9839,5]]},"277":{"position":[[2913,5]]},"285":{"position":[[5444,5],[11303,5],[17118,5],[22726,5]]},"294":{"position":[[4498,5]]},"296":{"position":[[4197,5]]},"311":{"position":[[4319,5],[9903,5],[16336,5]]},"357":{"position":[[4348,5]]},"369":{"position":[[4293,5],[9900,5]]},"375":{"position":[[4684,5],[10588,5],[16402,5]]},"382":{"position":[[5263,5]]},"402":{"position":[[4337,5]]},"404":{"position":[[4248,5],[10088,5]]},"444":{"position":[[4934,5],[11035,5]]},"446":{"position":[[5166,5]]},"448":{"position":[[4129,5]]},"462":{"position":[[4302,5],[9933,5]]},"466":{"position":[[4265,5],[10064,5]]},"504":{"position":[[4270,5]]},"506":{"position":[[4512,5]]},"508":{"position":[[4321,5]]},"522":{"position":[[4612,5]]},"524":{"position":[[4441,5]]},"540":{"position":[[4285,5]]},"542":{"position":[[4849,5]]},"544":{"position":[[4387,5]]},"562":{"position":[[4984,5],[10963,5],[16958,5],[22650,5],[28273,5]]},"574":{"position":[[4586,5]]},"578":{"position":[[4581,5]]},"580":{"position":[[4379,5]]},"582":{"position":[[4097,5],[9611,5]]},"584":{"position":[[4238,5],[9674,5]]},"599":{"position":[[4286,5]]},"606":{"position":[[4731,5],[10808,5],[16819,5]]},"608":{"position":[[4580,5]]},"613":{"position":[[4444,5],[10356,5]]},"618":{"position":[[4664,5]]},"637":{"position":[[4862,5]]},"639":{"position":[[4264,5]]},"645":{"position":[[4953,5]]},"647":{"position":[[4169,5]]},"649":{"position":[[4452,5],[10211,5],[15853,5]]},"667":{"position":[[5420,5],[11592,5],[18422,5],[25250,5],[31489,5]]},"669":{"position":[[5396,5],[11654,5],[17992,5],[24315,5]]},"679":{"position":[[5113,5],[10728,5]]},"681":{"position":[[4482,5],[10130,5]]},"683":{"position":[[4536,5],[10878,5],[17143,5],[23053,5],[28710,5]]},"703":{"position":[[9094,5]]},"705":{"position":[[5569,5]]},"726":{"position":[[7223,5],[16954,5],[24881,5],[32302,5],[38064,5],[43690,5],[49335,5]]},"728":{"position":[[4347,5],[12254,5],[18198,5],[28613,5],[36834,5],[46369,5]]},"745":{"position":[[5991,5],[11565,5],[17365,5],[22896,5],[28525,5],[36256,5],[41882,5]]},"747":{"position":[[7276,5],[13730,5]]},"749":{"position":[[4537,5],[10874,5],[16487,5]]},"751":{"position":[[7483,5],[13948,5],[21546,5]]},"771":{"position":[[4674,5],[10334,5],[16585,5],[23130,5],[28823,5]]},"773":{"position":[[7899,5],[14467,5]]},"775":{"position":[[2771,5],[7330,5],[14578,5],[21633,5],[23246,5]]},"777":{"position":[[7780,5],[14340,5]]},"789":{"position":[[8532,5]]},"795":{"position":[[4470,5],[10170,5],[16185,5],[21796,5]]},"797":{"position":[[8573,5],[15934,5],[23673,5],[29872,5]]},"799":{"position":[[6035,5],[13125,5],[20054,5]]},"801":{"position":[[13580,5]]},"820":{"position":[[6001,5],[11599,5],[17409,5],[22933,5],[28557,5],[35773,5],[41394,5]]},"822":{"position":[[7442,5],[14407,5]]},"824":{"position":[[6774,5],[13329,5]]},"826":{"position":[[8235,5],[15002,5],[20766,5],[26469,5],[32255,5],[37952,5]]},"844":{"position":[[6408,5],[12116,5],[18119,5],[23784,5],[29548,5],[36845,5],[43488,5]]},"846":{"position":[[4185,5],[11464,5]]},"848":{"position":[[11870,5],[19060,5],[25704,5],[32283,5],[38527,5],[44363,5],[50109,5],[55825,5]]}}}],["enterpris",{"_index":2384,"t":{"719":{"position":[[126,13],[428,10]]},"721":{"position":[[292,10]]},"726":{"position":[[1337,10],[1488,10],[1655,10],[3472,10],[3682,10],[3908,10],[5954,10],[6115,10],[6292,10],[8009,10],[8169,10],[8345,10],[10896,10],[11051,10],[11222,10],[12570,10],[14186,10],[16080,10],[17646,10],[19416,10]]},"836":{"position":[[534,10]]}}}],["entir",{"_index":1636,"t":{"327":{"position":[[1508,6],[2435,6],[2912,6]]},"476":{"position":[[914,6]]},"751":{"position":[[687,6]]}}}],["entiti",{"_index":52,"t":{"3":{"position":[[794,9]]},"29":{"position":[[185,6]]},"41":{"position":[[21,6]]},"45":{"position":[[3412,6],[4044,6],[4525,6]]},"53":{"position":[[23,6]]},"55":{"position":[[24,6]]},"57":{"position":[[13,6]]},"191":{"position":[[1150,6],[1440,6]]},"195":{"position":[[72,6],[362,6]]},"258":{"position":[[869,6],[1159,6]]},"262":{"position":[[72,6],[362,6]]},"285":{"position":[[24581,6],[24871,6]]},"291":{"position":[[72,6],[362,6]]},"302":{"position":[[1471,6],[1761,6]]},"308":{"position":[[72,6],[362,6]]},"347":{"position":[[1282,6],[1572,6]]},"351":{"position":[[72,6],[362,6]]},"363":{"position":[[1780,6],[2070,6]]},"367":{"position":[[72,6],[362,6]]},"396":{"position":[[861,6],[1151,6]]},"398":{"position":[[72,6],[362,6]]},"454":{"position":[[2768,6],[3058,6]]},"460":{"position":[[72,6],[362,6]]},"492":{"position":[[1153,6],[1443,6]]},"496":{"position":[[72,6],[362,6]]},"514":{"position":[[923,6],[1213,6]]},"518":{"position":[[72,6],[362,6]]},"530":{"position":[[900,6],[1190,6]]},"534":{"position":[[72,6],[362,6]]},"550":{"position":[[1012,6],[1302,6]]},"554":{"position":[[72,6],[362,6]]},"568":{"position":[[853,6],[1143,6]]},"572":{"position":[[72,6],[362,6]]},"590":{"position":[[1324,6],[1614,6]]},"594":{"position":[[72,6],[362,6]]},"628":{"position":[[1097,6],[1387,6]]},"632":{"position":[[72,6],[362,6]]},"655":{"position":[[441,6],[731,6]]},"659":{"position":[[72,6],[362,6]]},"675":{"position":[[145,6],[435,6]]}}}],["entitl",{"_index":830,"t":{"89":{"position":[[3574,13]]},"175":{"position":[[95,12],[117,12]]},"339":{"position":[[0,12]]},"641":{"position":[[65,13],[129,8]]},"651":{"position":[[117,12],[149,11]]},"671":{"position":[[153,12],[400,12]]},"711":{"position":[[36,12],[127,11]]},"717":{"position":[[148,12],[259,12],[685,13]]},"719":{"position":[[18,11],[341,11]]},"730":{"position":[[40,12]]}}}],["enumer",{"_index":1030,"t":{"155":{"position":[[490,10]]},"222":{"position":[[405,10]]},"480":{"position":[[2812,9]]}}}],["env",{"_index":590,"t":{"43":{"position":[[3093,3]]},"155":{"position":[[550,3]]},"228":{"position":[[496,3]]}}}],["environ",{"_index":365,"t":{"29":{"position":[[1121,12]]},"33":{"position":[[295,11],[581,11],[867,11],[1153,11],[1379,11],[1453,11],[1694,11]]},"35":{"position":[[3781,11]]},"43":{"position":[[1395,11]]},"45":{"position":[[3876,12],[14469,11],[20663,11],[27092,11]]},"111":{"position":[[312,11]]},"129":{"position":[[332,11],[655,11],[978,11],[1301,11],[1562,11],[1857,11]]},"133":{"position":[[1470,11]]},"141":{"position":[[332,11],[655,11],[978,11],[1301,11],[1562,11],[1857,11]]},"145":{"position":[[1470,11]]},"151":{"position":[[99,12]]},"157":{"position":[[74,12],[190,11],[274,11]]},"159":{"position":[[36,11]]},"165":{"position":[[352,11],[716,11]]},"183":{"position":[[1481,11]]},"185":{"position":[[202,11],[2209,11]]},"187":{"position":[[2372,11]]},"200":{"position":[[2365,11]]},"202":{"position":[[2304,11],[8052,11]]},"210":{"position":[[641,11]]},"212":{"position":[[1727,12],[2020,12],[2307,12],[4364,12],[4691,12],[4958,12]]},"214":{"position":[[583,11],[2017,11]]},"222":{"position":[[259,11]]},"224":{"position":[[279,11]]},"226":{"position":[[227,11],[343,11],[583,11]]},"228":{"position":[[173,11],[349,11],[628,11]]},"232":{"position":[[147,11]]},"240":{"position":[[103,12],[183,11]]},"244":{"position":[[296,11],[583,11],[870,11],[1157,11],[1418,11],[1677,11]]},"248":{"position":[[1470,11]]},"265":{"position":[[2584,11]]},"267":{"position":[[2376,11],[8001,11]]},"273":{"position":[[327,11],[649,11],[936,11],[1223,11],[1517,11]]},"277":{"position":[[1442,11]]},"285":{"position":[[3601,11],[9392,11],[15271,11],[20877,11]]},"294":{"position":[[2625,11]]},"296":{"position":[[2349,11]]},"311":{"position":[[2454,11],[8037,11],[14264,11]]},"333":{"position":[[1619,12]]},"357":{"position":[[2493,11]]},"369":{"position":[[2445,11],[8053,11]]},"375":{"position":[[2751,11],[8740,11],[14554,11]]},"382":{"position":[[3418,11]]},"392":{"position":[[63,12]]},"402":{"position":[[2451,11]]},"404":{"position":[[2393,11],[8232,11]]},"426":{"position":[[214,11]]},"444":{"position":[[2885,11],[9185,11]]},"446":{"position":[[3007,11]]},"448":{"position":[[2279,11]]},"462":{"position":[[2451,11],[8083,11]]},"466":{"position":[[2413,11],[8212,11]]},"504":{"position":[[2398,11]]},"506":{"position":[[2560,11]]},"508":{"position":[[2466,11]]},"522":{"position":[[2688,11]]},"524":{"position":[[2590,11]]},"540":{"position":[[2411,11]]},"542":{"position":[[2898,11]]},"544":{"position":[[2530,11]]},"562":{"position":[[2965,11],[9115,11],[15110,11],[20800,11],[26424,11]]},"574":{"position":[[2651,11]]},"578":{"position":[[2650,11]]},"580":{"position":[[2506,11]]},"582":{"position":[[2261,11],[7775,11]]},"584":{"position":[[2373,11],[7837,11]]},"599":{"position":[[2440,11]]},"606":{"position":[[2832,11],[8930,11],[14931,11]]},"608":{"position":[[2799,11]]},"613":{"position":[[2536,11],[8448,11]]},"618":{"position":[[2651,11]]},"637":{"position":[[2872,11]]},"639":{"position":[[2406,11]]},"645":{"position":[[2854,11]]},"647":{"position":[[2319,11]]},"649":{"position":[[2507,11],[8360,11],[13999,11]]},"667":{"position":[[3573,11],[9745,11],[16572,11],[23403,11],[29641,11]]},"669":{"position":[[3548,11],[9803,11],[16143,11],[22466,11]]},"679":{"position":[[3264,11],[8880,11]]},"681":{"position":[[2557,11],[8278,11]]},"683":{"position":[[2575,11],[8918,11],[15182,11],[21204,11],[26863,11]]},"687":{"position":[[336,11]]},"703":{"position":[[7152,11]]},"705":{"position":[[3599,11]]},"726":{"position":[[4454,11],[14675,11],[22672,11],[30454,11],[36215,11],[41838,11],[47482,11]]},"728":{"position":[[2498,11],[10409,11],[16344,11],[26760,11],[34990,11],[44525,11]]},"745":{"position":[[4110,11],[9715,11],[15484,11],[21046,11],[26674,11],[34406,11],[40032,11]]},"747":{"position":[[5156,11],[11878,11]]},"749":{"position":[[2632,11],[8937,11],[14637,11]]},"751":{"position":[[5508,11],[12094,11],[19643,11]]},"771":{"position":[[2794,11],[8450,11],[14538,11],[21281,11],[26976,11]]},"773":{"position":[[5789,11],[12615,11]]},"775":{"position":[[5352,11],[12385,11],[19787,11]]},"777":{"position":[[5730,11],[12489,11]]},"789":{"position":[[6102,11]]},"795":{"position":[[2625,11],[8321,11],[14245,11],[19950,11]]},"797":{"position":[[6732,11],[13606,11],[21600,11],[28027,11]]},"799":{"position":[[3907,11],[11079,11],[18007,11]]},"801":{"position":[[9814,11]]},"820":{"position":[[4117,11],[9746,11],[15529,11],[21084,11],[26706,11],[33924,11],[39544,11]]},"822":{"position":[[5211,11],[12554,11]]},"824":{"position":[[4684,11],[11473,11]]},"826":{"position":[[5962,11],[13145,11],[18907,11],[24608,11],[30396,11],[36093,11]]},"844":{"position":[[4469,11],[10261,11],[16180,11],[21929,11],[27686,11],[34636,11],[41633,11]]},"846":{"position":[[2335,11],[9615,11]]},"848":{"position":[[9746,11],[17052,11],[23642,11],[30306,11],[36617,11],[42470,11],[48262,11],[53963,11]]}}}],["environment.getenvironmentvariable(\"fga_api_audi",{"_index":1262,"t":{"187":{"position":[[3301,55]]}}}],["environment.getenvironmentvariable(\"fga_api_host",{"_index":457,"t":{"35":{"position":[[4141,51]]},"43":{"position":[[1679,51]]},"45":{"position":[[14829,51],[21023,51],[27452,51]]},"133":{"position":[[1830,51]]},"145":{"position":[[1830,51]]},"183":{"position":[[1765,51]]},"185":{"position":[[2493,51]]},"187":{"position":[[2656,51]]},"200":{"position":[[2725,51]]},"202":{"position":[[2664,51],[8412,51]]},"248":{"position":[[1830,51]]},"265":{"position":[[2944,51]]},"267":{"position":[[2736,51],[8361,51]]},"277":{"position":[[1802,51]]},"285":{"position":[[3961,51],[9752,51],[15631,51],[21237,51]]},"294":{"position":[[2985,51]]},"296":{"position":[[2709,51]]},"311":{"position":[[2814,51],[8397,51],[14624,51]]},"357":{"position":[[2853,51]]},"369":{"position":[[2805,51],[8413,51]]},"375":{"position":[[3111,51],[9100,51],[14914,51]]},"382":{"position":[[3778,51]]},"402":{"position":[[2811,51]]},"404":{"position":[[2753,51],[8592,51]]},"444":{"position":[[3245,51],[9545,51]]},"446":{"position":[[3367,51]]},"448":{"position":[[2639,51]]},"462":{"position":[[2811,51],[8443,51]]},"466":{"position":[[2773,51],[8572,51]]},"504":{"position":[[2758,51]]},"506":{"position":[[2920,51]]},"508":{"position":[[2826,51]]},"522":{"position":[[3048,51]]},"524":{"position":[[2950,51]]},"540":{"position":[[2771,51]]},"542":{"position":[[3258,51]]},"544":{"position":[[2890,51]]},"562":{"position":[[3325,51],[9475,51],[15470,51],[21160,51],[26784,51]]},"574":{"position":[[3011,51]]},"578":{"position":[[3010,51]]},"580":{"position":[[2866,51]]},"582":{"position":[[2621,51],[8135,51]]},"584":{"position":[[2733,51],[8197,51]]},"599":{"position":[[2800,51]]},"606":{"position":[[3192,51],[9290,51],[15291,51]]},"608":{"position":[[3159,51]]},"613":{"position":[[2896,51],[8808,51]]},"618":{"position":[[3011,51]]},"637":{"position":[[3232,51]]},"639":{"position":[[2766,51]]},"645":{"position":[[3214,51]]},"647":{"position":[[2679,51]]},"649":{"position":[[2867,51],[8720,51],[14359,51]]},"667":{"position":[[3933,51],[10105,51],[16932,51],[23763,51],[30001,51]]},"669":{"position":[[3908,51],[10163,51],[16503,51],[22826,51]]},"679":{"position":[[3624,51],[9240,51]]},"681":{"position":[[2917,51],[8638,51]]},"683":{"position":[[2935,51],[9278,51],[15542,51],[21564,51],[27223,51]]},"703":{"position":[[7512,51]]},"705":{"position":[[3959,51]]},"726":{"position":[[4814,51],[15035,51],[23032,51],[30814,51],[36575,51],[42198,51],[47842,51]]},"728":{"position":[[2858,51],[10769,51],[16704,51],[27120,51],[35350,51],[44885,51]]},"745":{"position":[[4470,51],[10075,51],[15844,51],[21406,51],[27034,51],[34766,51],[40392,51]]},"747":{"position":[[5516,51],[12238,51]]},"749":{"position":[[2992,51],[9297,51],[14997,51]]},"751":{"position":[[5868,51],[12454,51],[20003,51]]},"771":{"position":[[3154,51],[8810,51],[14898,51],[21641,51],[27336,51]]},"773":{"position":[[6149,51],[12975,51]]},"775":{"position":[[5712,51],[12745,51],[20147,51]]},"777":{"position":[[6090,51],[12849,51]]},"789":{"position":[[6462,51]]},"795":{"position":[[2985,51],[8681,51],[14605,51],[20310,51]]},"797":{"position":[[7092,51],[13966,51],[21960,51],[28387,51]]},"799":{"position":[[4267,51],[11439,51],[18367,51]]},"801":{"position":[[10174,51]]},"820":{"position":[[4477,51],[10106,51],[15889,51],[21444,51],[27066,51],[34284,51],[39904,51]]},"822":{"position":[[5571,51],[12914,51]]},"824":{"position":[[5044,51],[11833,51]]},"826":{"position":[[6322,51],[13505,51],[19267,51],[24968,51],[30756,51],[36453,51]]},"844":{"position":[[4829,51],[10621,51],[16540,51],[22289,51],[28046,51],[34996,51],[41993,51]]},"846":{"position":[[2695,51],[9975,51]]},"848":{"position":[[10106,51],[17412,51],[24002,51],[30666,51],[36977,51],[42830,51],[48622,51],[54323,51]]}}}],["environment.getenvironmentvariable(\"fga_api_schem",{"_index":456,"t":{"35":{"position":[[4028,53]]},"43":{"position":[[1556,53]]},"45":{"position":[[14716,53],[20910,53],[27339,53]]},"133":{"position":[[1717,53]]},"145":{"position":[[1717,53]]},"183":{"position":[[1642,53]]},"185":{"position":[[2370,53]]},"187":{"position":[[2533,53]]},"200":{"position":[[2612,53]]},"202":{"position":[[2551,53],[8299,53]]},"248":{"position":[[1717,53]]},"265":{"position":[[2831,53]]},"267":{"position":[[2623,53],[8248,53]]},"277":{"position":[[1689,53]]},"285":{"position":[[3848,53],[9639,53],[15518,53],[21124,53]]},"294":{"position":[[2872,53]]},"296":{"position":[[2596,53]]},"311":{"position":[[2701,53],[8284,53],[14511,53]]},"357":{"position":[[2740,53]]},"369":{"position":[[2692,53],[8300,53]]},"375":{"position":[[2998,53],[8987,53],[14801,53]]},"382":{"position":[[3665,53]]},"402":{"position":[[2698,53]]},"404":{"position":[[2640,53],[8479,53]]},"444":{"position":[[3132,53],[9432,53]]},"446":{"position":[[3254,53]]},"448":{"position":[[2526,53]]},"462":{"position":[[2698,53],[8330,53]]},"466":{"position":[[2660,53],[8459,53]]},"504":{"position":[[2645,53]]},"506":{"position":[[2807,53]]},"508":{"position":[[2713,53]]},"522":{"position":[[2935,53]]},"524":{"position":[[2837,53]]},"540":{"position":[[2658,53]]},"542":{"position":[[3145,53]]},"544":{"position":[[2777,53]]},"562":{"position":[[3212,53],[9362,53],[15357,53],[21047,53],[26671,53]]},"574":{"position":[[2898,53]]},"578":{"position":[[2897,53]]},"580":{"position":[[2753,53]]},"582":{"position":[[2508,53],[8022,53]]},"584":{"position":[[2620,53],[8084,53]]},"599":{"position":[[2687,53]]},"606":{"position":[[3079,53],[9177,53],[15178,53]]},"608":{"position":[[3046,53]]},"613":{"position":[[2783,53],[8695,53]]},"618":{"position":[[2898,53]]},"637":{"position":[[3119,53]]},"639":{"position":[[2653,53]]},"645":{"position":[[3101,53]]},"647":{"position":[[2566,53]]},"649":{"position":[[2754,53],[8607,53],[14246,53]]},"667":{"position":[[3820,53],[9992,53],[16819,53],[23650,53],[29888,53]]},"669":{"position":[[3795,53],[10050,53],[16390,53],[22713,53]]},"679":{"position":[[3511,53],[9127,53]]},"681":{"position":[[2804,53],[8525,53]]},"683":{"position":[[2822,53],[9165,53],[15429,53],[21451,53],[27110,53]]},"703":{"position":[[7399,53]]},"705":{"position":[[3846,53]]},"726":{"position":[[4701,53],[14922,53],[22919,53],[30701,53],[36462,53],[42085,53],[47729,53]]},"728":{"position":[[2745,53],[10656,53],[16591,53],[27007,53],[35237,53],[44772,53]]},"745":{"position":[[4357,53],[9962,53],[15731,53],[21293,53],[26921,53],[34653,53],[40279,53]]},"747":{"position":[[5403,53],[12125,53]]},"749":{"position":[[2879,53],[9184,53],[14884,53]]},"751":{"position":[[5755,53],[12341,53],[19890,53]]},"771":{"position":[[3041,53],[8697,53],[14785,53],[21528,53],[27223,53]]},"773":{"position":[[6036,53],[12862,53]]},"775":{"position":[[5599,53],[12632,53],[20034,53]]},"777":{"position":[[5977,53],[12736,53]]},"789":{"position":[[6349,53]]},"795":{"position":[[2872,53],[8568,53],[14492,53],[20197,53]]},"797":{"position":[[6979,53],[13853,53],[21847,53],[28274,53]]},"799":{"position":[[4154,53],[11326,53],[18254,53]]},"801":{"position":[[10061,53]]},"820":{"position":[[4364,53],[9993,53],[15776,53],[21331,53],[26953,53],[34171,53],[39791,53]]},"822":{"position":[[5458,53],[12801,53]]},"824":{"position":[[4931,53],[11720,53]]},"826":{"position":[[6209,53],[13392,53],[19154,53],[24855,53],[30643,53],[36340,53]]},"844":{"position":[[4716,53],[10508,53],[16427,53],[22176,53],[27933,53],[34883,53],[41880,53]]},"846":{"position":[[2582,53],[9862,53]]},"848":{"position":[[9993,53],[17299,53],[23889,53],[30553,53],[36864,53],[42717,53],[48509,53],[54210,53]]}}}],["environment.getenvironmentvariable(\"fga_api_token",{"_index":1238,"t":{"185":{"position":[[3049,51]]}}}],["environment.getenvironmentvariable(\"fga_api_token_issu",{"_index":1261,"t":{"187":{"position":[[3227,59]]}}}],["environment.getenvironmentvariable(\"fga_client_id",{"_index":1263,"t":{"187":{"position":[[3368,52]]}}}],["environment.getenvironmentvariable(\"fga_client_secret",{"_index":1264,"t":{"187":{"position":[[3436,56]]}}}],["environment.getenvironmentvariable(\"fga_model_id",{"_index":459,"t":{"35":{"position":[[4481,51]]},"43":{"position":[[2023,51]]},"45":{"position":[[15169,51],[21363,51],[27792,51]]},"133":{"position":[[2170,51]]},"145":{"position":[[2170,51]]},"183":{"position":[[2109,51]]},"185":{"position":[[2837,51]]},"187":{"position":[[3000,51]]},"200":{"position":[[3065,51]]},"202":{"position":[[3004,51],[8752,51]]},"248":{"position":[[2170,51]]},"265":{"position":[[3284,51]]},"267":{"position":[[3076,51],[8701,51]]},"277":{"position":[[2142,51]]},"285":{"position":[[4301,51],[10092,51],[15971,51],[21577,51]]},"294":{"position":[[3325,51]]},"296":{"position":[[3049,51]]},"311":{"position":[[3154,51],[8737,51],[14964,51]]},"357":{"position":[[3193,51]]},"369":{"position":[[3145,51],[8753,51]]},"375":{"position":[[3451,51],[9440,51],[15254,51]]},"382":{"position":[[4118,51]]},"402":{"position":[[3151,51]]},"404":{"position":[[3093,51],[8932,51]]},"444":{"position":[[3585,51],[9885,51]]},"446":{"position":[[3707,51]]},"448":{"position":[[2979,51]]},"462":{"position":[[3151,51],[8783,51]]},"466":{"position":[[3113,51],[8912,51]]},"504":{"position":[[3098,51]]},"506":{"position":[[3260,51]]},"508":{"position":[[3166,51]]},"522":{"position":[[3388,51]]},"524":{"position":[[3290,51]]},"540":{"position":[[3111,51]]},"542":{"position":[[3598,51]]},"544":{"position":[[3230,51]]},"562":{"position":[[3665,51],[9815,51],[15810,51],[21500,51],[27124,51]]},"574":{"position":[[3351,51]]},"578":{"position":[[3350,51]]},"580":{"position":[[3206,51]]},"582":{"position":[[2961,51],[8475,51]]},"584":{"position":[[3073,51],[8537,51]]},"599":{"position":[[3140,51]]},"606":{"position":[[3532,51],[9630,51],[15631,51]]},"608":{"position":[[3499,51]]},"613":{"position":[[3236,51],[9148,51]]},"618":{"position":[[3351,51]]},"637":{"position":[[3572,51]]},"639":{"position":[[3106,51]]},"645":{"position":[[3554,51]]},"647":{"position":[[3019,51]]},"649":{"position":[[3207,51],[9060,51],[14699,51]]},"667":{"position":[[4273,51],[10445,51],[17272,51],[24103,51],[30341,51]]},"669":{"position":[[4248,51],[10503,51],[16843,51],[23166,51]]},"679":{"position":[[3964,51],[9580,51]]},"681":{"position":[[3257,51],[8978,51]]},"683":{"position":[[3275,51],[9618,51],[15882,51],[21904,51],[27563,51]]},"703":{"position":[[7852,51]]},"705":{"position":[[4299,51]]},"726":{"position":[[5154,51],[15375,51],[23372,51],[31154,51],[36915,51],[42538,51],[48182,51]]},"728":{"position":[[3198,51],[11109,51],[17044,51],[27460,51],[35690,51],[45225,51]]},"745":{"position":[[4810,51],[10415,51],[16184,51],[21746,51],[27374,51],[35106,51],[40732,51]]},"747":{"position":[[5856,51],[12578,51]]},"749":{"position":[[3332,51],[9637,51],[15337,51]]},"751":{"position":[[6208,51],[12794,51],[20343,51]]},"771":{"position":[[3494,51],[9150,51],[15238,51],[21981,51],[27676,51]]},"773":{"position":[[6489,51],[13315,51]]},"775":{"position":[[6052,51],[13085,51],[20487,51]]},"777":{"position":[[6430,51],[13189,51]]},"789":{"position":[[6802,51]]},"795":{"position":[[3325,51],[9021,51],[14945,51],[20650,51]]},"797":{"position":[[7432,51],[14306,51],[22300,51],[28727,51]]},"799":{"position":[[4607,51],[11779,51],[18707,51]]},"801":{"position":[[10514,51]]},"820":{"position":[[4817,51],[10446,51],[16229,51],[21784,51],[27406,51],[34624,51],[40244,51]]},"822":{"position":[[5911,51],[13254,51]]},"824":{"position":[[5384,51],[12173,51]]},"826":{"position":[[6662,51],[13845,51],[19607,51],[25308,51],[31096,51],[36793,51]]},"844":{"position":[[5169,51],[10961,51],[16880,51],[22629,51],[28386,51],[35336,51],[42333,51]]},"846":{"position":[[3035,51],[10315,51]]},"848":{"position":[[10446,51],[17752,51],[24342,51],[31006,51],[37317,51],[43170,51],[48962,51],[54663,51]]}}}],["environment.getenvironmentvariable(\"fga_store_id",{"_index":458,"t":{"35":{"position":[[4300,51]]},"43":{"position":[[1838,51]]},"45":{"position":[[14988,51],[21182,51],[27611,51]]},"133":{"position":[[1989,51]]},"145":{"position":[[1989,51]]},"183":{"position":[[1924,51]]},"185":{"position":[[2652,51]]},"187":{"position":[[2815,51]]},"200":{"position":[[2884,51]]},"202":{"position":[[2823,51],[8571,51]]},"248":{"position":[[1989,51]]},"265":{"position":[[3103,51]]},"267":{"position":[[2895,51],[8520,51]]},"277":{"position":[[1961,51]]},"285":{"position":[[4120,51],[9911,51],[15790,51],[21396,51]]},"294":{"position":[[3144,51]]},"296":{"position":[[2868,51]]},"311":{"position":[[2973,51],[8556,51],[14783,51]]},"357":{"position":[[3012,51]]},"369":{"position":[[2964,51],[8572,51]]},"375":{"position":[[3270,51],[9259,51],[15073,51]]},"382":{"position":[[3937,51]]},"402":{"position":[[2970,51]]},"404":{"position":[[2912,51],[8751,51]]},"444":{"position":[[3404,51],[9704,51]]},"446":{"position":[[3526,51]]},"448":{"position":[[2798,51]]},"462":{"position":[[2970,51],[8602,51]]},"466":{"position":[[2932,51],[8731,51]]},"504":{"position":[[2917,51]]},"506":{"position":[[3079,51]]},"508":{"position":[[2985,51]]},"522":{"position":[[3207,51]]},"524":{"position":[[3109,51]]},"540":{"position":[[2930,51]]},"542":{"position":[[3417,51]]},"544":{"position":[[3049,51]]},"562":{"position":[[3484,51],[9634,51],[15629,51],[21319,51],[26943,51]]},"574":{"position":[[3170,51]]},"578":{"position":[[3169,51]]},"580":{"position":[[3025,51]]},"582":{"position":[[2780,51],[8294,51]]},"584":{"position":[[2892,51],[8356,51]]},"599":{"position":[[2959,51]]},"606":{"position":[[3351,51],[9449,51],[15450,51]]},"608":{"position":[[3318,51]]},"613":{"position":[[3055,51],[8967,51]]},"618":{"position":[[3170,51]]},"637":{"position":[[3391,51]]},"639":{"position":[[2925,51]]},"645":{"position":[[3373,51]]},"647":{"position":[[2838,51]]},"649":{"position":[[3026,51],[8879,51],[14518,51]]},"667":{"position":[[4092,51],[10264,51],[17091,51],[23922,51],[30160,51]]},"669":{"position":[[4067,51],[10322,51],[16662,51],[22985,51]]},"679":{"position":[[3783,51],[9399,51]]},"681":{"position":[[3076,51],[8797,51]]},"683":{"position":[[3094,51],[9437,51],[15701,51],[21723,51],[27382,51]]},"703":{"position":[[7671,51]]},"705":{"position":[[4118,51]]},"726":{"position":[[4973,51],[15194,51],[23191,51],[30973,51],[36734,51],[42357,51],[48001,51]]},"728":{"position":[[3017,51],[10928,51],[16863,51],[27279,51],[35509,51],[45044,51]]},"745":{"position":[[4629,51],[10234,51],[16003,51],[21565,51],[27193,51],[34925,51],[40551,51]]},"747":{"position":[[5675,51],[12397,51]]},"749":{"position":[[3151,51],[9456,51],[15156,51]]},"751":{"position":[[6027,51],[12613,51],[20162,51]]},"771":{"position":[[3313,51],[8969,51],[15057,51],[21800,51],[27495,51]]},"773":{"position":[[6308,51],[13134,51]]},"775":{"position":[[5871,51],[12904,51],[20306,51]]},"777":{"position":[[6249,51],[13008,51]]},"789":{"position":[[6621,51]]},"795":{"position":[[3144,51],[8840,51],[14764,51],[20469,51]]},"797":{"position":[[7251,51],[14125,51],[22119,51],[28546,51]]},"799":{"position":[[4426,51],[11598,51],[18526,51]]},"801":{"position":[[10333,51]]},"820":{"position":[[4636,51],[10265,51],[16048,51],[21603,51],[27225,51],[34443,51],[40063,51]]},"822":{"position":[[5730,51],[13073,51]]},"824":{"position":[[5203,51],[11992,51]]},"826":{"position":[[6481,51],[13664,51],[19426,51],[25127,51],[30915,51],[36612,51]]},"844":{"position":[[4988,51],[10780,51],[16699,51],[22448,51],[28205,51],[35155,51],[42152,51]]},"846":{"position":[[2854,51],[10134,51]]},"848":{"position":[[10265,51],[17571,51],[24161,51],[30825,51],[37136,51],[42989,51],[48781,51],[54482,51]]}}}],["equal",{"_index":990,"t":{"153":{"position":[[736,5],[968,7]]}}}],["equival",{"_index":620,"t":{"45":{"position":[[3110,10]]}}}],["erik",{"_index":2497,"t":{"742":{"position":[[141,5]]},"751":{"position":[[184,4],[327,4],[2923,4]]},"817":{"position":[[167,5]]},"826":{"position":[[28084,4]]}}}],["err",{"_index":426,"t":{"35":{"position":[[2174,3],[2693,3],[3234,3],[3310,3],[3338,4],[3387,3],[3488,3]]},"43":{"position":[[580,3],[1117,3],[1157,3],[1270,3]]},"45":{"position":[[13393,3],[13912,3],[14160,3],[19587,3],[20106,3],[20354,3],[25962,3],[26481,3],[26727,3]]},"113":{"position":[[432,3],[707,3]]},"133":{"position":[[808,3],[1327,3]]},"135":{"position":[[515,3]]},"145":{"position":[[808,3],[1327,3]]},"147":{"position":[[549,3]]},"169":{"position":[[861,5]]},"171":{"position":[[691,5],[1460,5],[2073,3],[2095,3],[2131,3],[2178,4]]},"173":{"position":[[629,5],[1539,5],[2448,5],[3314,3],[3336,3],[3372,3],[3419,4],[4553,3],[5090,3],[5344,3],[5421,3]]},"183":{"position":[[819,3],[1356,3]]},"185":{"position":[[1308,3],[2084,3]]},"187":{"position":[[1333,3],[2247,3]]},"200":{"position":[[1179,3],[1698,3],[2040,3],[2133,3]]},"202":{"position":[[1231,3],[1750,3],[1995,3],[6977,3],[7496,3],[7742,3]]},"248":{"position":[[808,3],[1327,3]]},"250":{"position":[[560,3],[653,3]]},"252":{"position":[[717,3],[810,3]]},"265":{"position":[[1521,3],[2040,3],[2275,3]]},"267":{"position":[[1195,3],[1714,3],[2051,3],[2144,3],[6937,3],[7456,3],[7691,3]]},"277":{"position":[[780,3],[1299,3]]},"279":{"position":[[343,3],[435,3],[1981,3],[2073,3]]},"281":{"position":[[1350,3],[1442,3],[2853,3],[2945,3]]},"285":{"position":[[2532,3],[3051,3],[3291,3],[8169,3],[8688,3],[9067,3],[9160,3],[14198,3],[14717,3],[14962,3],[19802,3],[20321,3],[20567,3]]},"294":{"position":[[1440,3],[1959,3],[2300,3],[2393,3]]},"296":{"position":[[1275,3],[1794,3],[2039,3]]},"311":{"position":[[1277,3],[1796,3],[2129,3],[2222,3],[6859,3],[7378,3],[7712,3],[7805,3],[12842,3],[13361,3],[13939,3],[14032,3]]},"357":{"position":[[1412,3],[1931,3],[2184,3]]},"369":{"position":[[1371,3],[1890,3],[2136,3],[6980,3],[7499,3],[7744,3]]},"375":{"position":[[1506,3],[2025,3],[2426,3],[2519,3],[7666,3],[8185,3],[8430,3],[13480,3],[13999,3],[14245,3]]},"382":{"position":[[2347,3],[2866,3],[3109,3]]},"402":{"position":[[1253,3],[1772,3],[2126,3],[2219,3]]},"404":{"position":[[1312,3],[1831,3],[2084,3],[7150,3],[7669,3],[7922,3]]},"422":{"position":[[1718,3],[1811,3]]},"444":{"position":[[1475,3],[1994,3],[2560,3],[2653,3],[8109,3],[8628,3],[8876,3]]},"446":{"position":[[1487,3],[2006,3],[2682,3],[2775,3]]},"448":{"position":[[1203,3],[1722,3],[1970,3]]},"462":{"position":[[1374,3],[1893,3],[2142,3],[7007,3],[7526,3],[7774,3]]},"466":{"position":[[1335,3],[1854,3],[2104,3],[7134,3],[7653,3],[7902,3]]},"504":{"position":[[1214,3],[1733,3],[2073,3],[2166,3]]},"506":{"position":[[1296,3],[1815,3],[2235,3],[2328,3]]},"508":{"position":[[1385,3],[1904,3],[2157,3]]},"522":{"position":[[1452,3],[1971,3],[2363,3],[2456,3]]},"524":{"position":[[1513,3],[2032,3],[2281,3]]},"540":{"position":[[1225,3],[1744,3],[2086,3],[2179,3]]},"542":{"position":[[1635,3],[2154,3],[2573,3],[2666,3]]},"544":{"position":[[1447,3],[1966,3],[2221,3]]},"562":{"position":[[1585,3],[2104,3],[2640,3],[2733,3],[8041,3],[8560,3],[8806,3],[14036,3],[14555,3],[14800,3],[19724,3],[20243,3],[20491,3],[25349,3],[25868,3],[26115,3]]},"574":{"position":[[1355,3],[1874,3],[2326,3],[2419,3]]},"578":{"position":[[1358,3],[1877,3],[2325,3],[2418,3]]},"580":{"position":[[1321,3],[1840,3],[2181,3],[2274,3]]},"582":{"position":[[1199,3],[1718,3],[1952,3],[6713,3],[7232,3],[7466,3]]},"584":{"position":[[1196,3],[1715,3],[2048,3],[2141,3],[6774,3],[7293,3],[7527,3]]},"599":{"position":[[1368,3],[1887,3],[2131,3]]},"606":{"position":[[1663,3],[2182,3],[2400,3],[7800,3],[8319,3],[8498,3],[13791,3],[14310,3],[14499,3]]},"608":{"position":[[1748,3],[2267,3],[2485,3]]},"613":{"position":[[1398,3],[1917,3],[2224,3],[7310,3],[7829,3],[8136,3]]},"618":{"position":[[1412,3],[1931,3],[2286,3]]},"637":{"position":[[1570,3],[2089,3],[2547,3],[2640,3]]},"639":{"position":[[1322,3],[1841,3],[2097,3]]},"645":{"position":[[1394,3],[1913,3],[2529,3],[2622,3]]},"647":{"position":[[1243,3],[1762,3],[2010,3]]},"649":{"position":[[1250,3],[1769,3],[2182,3],[2275,3],[7283,3],[7802,3],[8050,3],[12919,3],[13438,3],[13690,3]]},"667":{"position":[[2500,3],[3019,3],[3264,3],[8672,3],[9191,3],[9436,3],[15496,3],[16015,3],[16263,3],[22330,3],[22849,3],[23094,3],[28567,3],[29086,3],[29332,3]]},"669":{"position":[[2474,3],[2993,3],[3238,3],[8726,3],[9245,3],[9493,3],[15068,3],[15587,3],[15833,3],[21391,3],[21910,3],[22157,3]]},"679":{"position":[[2189,3],[2708,3],[2955,3],[7806,3],[8325,3],[8571,3]]},"681":{"position":[[1320,3],[1839,3],[2232,3],[2325,3],[7200,3],[7719,3],[7969,3]]},"683":{"position":[[1398,3],[1917,3],[2019,3],[7597,3],[8116,3],[8593,3],[8686,3],[13860,3],[14379,3],[14857,3],[14950,3],[20129,3],[20648,3],[20895,3],[25790,3],[26309,3],[26553,3]]},"695":{"position":[[5638,3],[5731,3]]},"701":{"position":[[678,3],[2513,3],[4368,3],[6209,3],[8062,3],[9909,3]]},"703":{"position":[[3257,3],[5898,3],[6417,3],[6827,3],[6920,3],[11146,3]]},"705":{"position":[[2317,3],[2836,3],[3274,3],[3367,3],[7916,3],[10588,3]]},"707":{"position":[[5177,3],[5270,3]]},"726":{"position":[[2128,3],[2647,3],[4129,3],[4222,3],[12986,3],[13505,3],[14350,3],[14443,3],[21053,3],[21572,3],[22347,3],[22440,3],[29380,3],[29899,3],[30145,3],[35140,3],[35659,3],[35905,3],[40760,3],[41279,3],[41529,3],[46403,3],[46922,3],[47173,3]]},"728":{"position":[[1423,3],[1942,3],[2184,3],[9338,3],[9857,3],[10099,3],[15264,3],[15783,3],[16034,3],[25681,3],[26200,3],[26451,3],[33920,3],[34439,3],[34681,3],[43455,3],[43974,3],[44216,3]]},"745":{"position":[[2917,3],[3436,3],[3785,3],[3878,3],[8639,3],[9158,3],[9406,3],[14291,3],[14810,3],[15159,3],[15252,3],[19970,3],[20489,3],[20737,3],[25597,3],[26116,3],[26364,3],[33330,3],[33849,3],[34097,3],[38956,3],[39475,3],[39723,3]]},"747":{"position":[[3675,3],[4194,3],[4831,3],[4924,3],[10800,3],[11319,3],[11569,3]]},"749":{"position":[[1415,3],[1934,3],[2307,3],[2400,3],[7688,3],[8207,3],[8612,3],[8705,3],[13561,3],[14080,3],[14328,3]]},"751":{"position":[[4172,3],[4691,3],[5183,3],[5276,3],[11014,3],[11533,3],[11780,3],[18428,3],[18947,3],[19318,3],[19411,3]]},"771":{"position":[[1602,3],[2121,3],[2469,3],[2562,3],[7254,3],[7773,3],[8125,3],[8218,3],[13081,3],[13600,3],[14213,3],[14306,3],[20206,3],[20725,3],[20972,3],[25903,3],[26422,3],[26666,3]]},"773":{"position":[[4220,3],[4739,3],[5464,3],[5557,3],[11537,3],[12056,3],[12306,3]]},"775":{"position":[[4013,3],[4532,3],[5027,3],[5120,3],[10733,3],[11252,3],[12060,3],[12153,3],[18715,3],[19234,3],[19478,3]]},"777":{"position":[[4270,3],[4789,3],[5405,3],[5498,3],[11412,3],[11931,3],[12179,3]]},"789":{"position":[[4213,3],[4732,3],[5777,3],[5870,3]]},"795":{"position":[[1554,3],[2073,3],[2316,3],[7246,3],[7765,3],[8012,3],[12993,3],[13512,3],[13920,3],[14013,3],[18878,3],[19397,3],[19640,3]]},"797":{"position":[[5665,3],[6184,3],[6422,3],[11868,3],[12387,3],[13281,3],[13374,3],[20166,3],[20685,3],[21275,3],[21368,3],[26956,3],[27475,3],[27718,3]]},"799":{"position":[[2418,3],[2937,3],[3582,3],[3675,3],[9820,3],[10339,3],[10770,3],[16747,3],[17266,3],[17697,3]]},"801":{"position":[[6197,3],[6716,3],[9489,3],[9582,3]]},"820":{"position":[[2921,3],[3440,3],[3792,3],[3885,3],[8667,3],[9186,3],[9437,3],[14337,3],[14856,3],[15204,3],[15297,3],[20009,3],[20528,3],[20775,3],[25629,3],[26148,3],[26396,3],[32849,3],[33368,3],[33615,3],[38468,3],[38987,3],[39235,3]]},"822":{"position":[[3521,3],[4040,3],[4886,3],[4979,3],[11475,3],[11994,3],[12245,3]]},"824":{"position":[[3233,3],[3752,3],[4359,3],[4452,3],[10391,3],[10910,3],[11159,3]]},"826":{"position":[[4279,3],[4798,3],[5637,3],[5730,3],[12062,3],[12581,3],[12836,3],[17822,3],[18341,3],[18597,3],[23521,3],[24040,3],[24299,3],[29311,3],[29830,3],[30086,3],[35008,3],[35527,3],[35783,3]]},"844":{"position":[[3218,3],[3737,3],[4144,3],[4237,3],[9180,3],[9699,3],[9952,3],[14929,3],[15448,3],[15855,3],[15948,3],[20848,3],[21367,3],[21620,3],[26598,3],[27117,3],[27376,3],[33017,3],[33536,3],[34311,3],[34404,3],[40552,3],[41071,3],[41324,3]]},"846":{"position":[[1259,3],[1778,3],[2025,3],[8540,3],[9059,3],[9306,3]]},"848":{"position":[[8212,3],[8731,3],[9421,3],[9514,3],[15732,3],[16251,3],[16727,3],[16820,3],[22219,3],[22738,3],[23317,3],[23410,3],[28968,3],[29487,3],[29981,3],[30074,3],[35395,3],[35914,3],[36292,3],[36385,3],[41265,3],[41784,3],[42145,3],[42238,3],[47189,3],[47708,3],[47952,3],[52875,3],[53394,3],[53654,3]]}}}],["error",{"_index":124,"t":{"3":{"position":[[2277,5],[2620,6]]},"35":{"position":[[2719,5],[3356,5],[3514,5]]},"43":{"position":[[1143,5],[1296,5]]},"45":{"position":[[13938,5],[20132,5],[26507,5]]},"89":{"position":[[3250,5],[3364,5]]},"113":{"position":[[733,5]]},"133":{"position":[[1353,5]]},"145":{"position":[[1353,5]]},"155":{"position":[[1321,5],[1527,5]]},"169":{"position":[[1547,5]]},"171":{"position":[[2077,5],[2379,5]]},"173":{"position":[[3318,5],[3689,5],[3899,5],[4534,5]]},"183":{"position":[[1382,5]]},"185":{"position":[[2110,5]]},"187":{"position":[[2273,5]]},"200":{"position":[[1724,5],[2159,5]]},"202":{"position":[[1776,5],[7522,5]]},"248":{"position":[[1353,5]]},"250":{"position":[[679,5]]},"252":{"position":[[836,5]]},"265":{"position":[[2066,5]]},"267":{"position":[[1740,5],[2170,5],[7482,5]]},"277":{"position":[[1325,5]]},"279":{"position":[[461,5],[1401,6],[2099,5]]},"281":{"position":[[1468,5],[2310,7],[2971,5]]},"285":{"position":[[3077,5],[8714,5],[9186,5],[14743,5],[20347,5]]},"294":{"position":[[1985,5],[2419,5]]},"296":{"position":[[1820,5]]},"311":{"position":[[1822,5],[2248,5],[7404,5],[7831,5],[13387,5],[14058,5]]},"357":{"position":[[1957,5]]},"369":{"position":[[1916,5],[7525,5]]},"375":{"position":[[2051,5],[2545,5],[8211,5],[14025,5]]},"382":{"position":[[2892,5]]},"402":{"position":[[1798,5],[2245,5]]},"404":{"position":[[1857,5],[7695,5]]},"412":{"position":[[3307,6]]},"422":{"position":[[575,5],[665,5],[1167,6],[1837,5]]},"444":{"position":[[2020,5],[2679,5],[8654,5]]},"446":{"position":[[2032,5],[2801,5]]},"448":{"position":[[1748,5]]},"462":{"position":[[1919,5],[7552,5]]},"466":{"position":[[1880,5],[7679,5]]},"504":{"position":[[1759,5],[2192,5]]},"506":{"position":[[1841,5],[2354,5]]},"508":{"position":[[1930,5],[6660,5]]},"522":{"position":[[1997,5],[2482,5]]},"524":{"position":[[2058,5]]},"540":{"position":[[1770,5],[2205,5]]},"542":{"position":[[2180,5],[2692,5]]},"544":{"position":[[1992,5]]},"562":{"position":[[2130,5],[2759,5],[8586,5],[14581,5],[20269,5],[25894,5]]},"574":{"position":[[1900,5],[2445,5]]},"578":{"position":[[1903,5],[2444,5]]},"580":{"position":[[1866,5],[2300,5]]},"582":{"position":[[1744,5],[7258,5]]},"584":{"position":[[1741,5],[2167,5],[7319,5]]},"599":{"position":[[1913,5]]},"606":{"position":[[2208,5],[8345,5],[14336,5]]},"608":{"position":[[2293,5]]},"613":{"position":[[1943,5],[7855,5]]},"618":{"position":[[1957,5]]},"637":{"position":[[2115,5],[2666,5]]},"639":{"position":[[1867,5]]},"645":{"position":[[1939,5],[2648,5]]},"647":{"position":[[1788,5]]},"649":{"position":[[1795,5],[2301,5],[7828,5],[13464,5]]},"667":{"position":[[3045,5],[9217,5],[16041,5],[22875,5],[29112,5]]},"669":{"position":[[3019,5],[9271,5],[15613,5],[21936,5]]},"679":{"position":[[2734,5],[8351,5]]},"681":{"position":[[1865,5],[2351,5],[7745,5]]},"683":{"position":[[1943,5],[8142,5],[8712,5],[14405,5],[14976,5],[20674,5],[26335,5]]},"695":{"position":[[5757,5]]},"703":{"position":[[6443,5],[6946,5]]},"705":{"position":[[2862,5],[3393,5]]},"707":{"position":[[5296,5]]},"726":{"position":[[2673,5],[4248,5],[13531,5],[14469,5],[21598,5],[22466,5],[29925,5],[35685,5],[41305,5],[46948,5]]},"728":{"position":[[1968,5],[9883,5],[15809,5],[26226,5],[34465,5],[44000,5]]},"745":{"position":[[3462,5],[3904,5],[9184,5],[14836,5],[15278,5],[20515,5],[26142,5],[33875,5],[39501,5]]},"747":{"position":[[4220,5],[4950,5],[11345,5]]},"749":{"position":[[1960,5],[2426,5],[8233,5],[8731,5],[14106,5]]},"751":{"position":[[4717,5],[5302,5],[11559,5],[18973,5],[19437,5]]},"771":{"position":[[2147,5],[2588,5],[7799,5],[8244,5],[13626,5],[14332,5],[20751,5],[26448,5]]},"773":{"position":[[4765,5],[5583,5],[12082,5]]},"775":{"position":[[4558,5],[5146,5],[11278,5],[12179,5],[19260,5]]},"777":{"position":[[4815,5],[5524,5],[11957,5]]},"789":{"position":[[4758,5],[5896,5]]},"795":{"position":[[2099,5],[7791,5],[13538,5],[14039,5],[19423,5]]},"797":{"position":[[6210,5],[12413,5],[13400,5],[20711,5],[21394,5],[27501,5]]},"799":{"position":[[2963,5],[3701,5],[10365,5],[17292,5]]},"801":{"position":[[6742,5],[9608,5]]},"820":{"position":[[3466,5],[3911,5],[9212,5],[14882,5],[15323,5],[20554,5],[26174,5],[33394,5],[39013,5]]},"822":{"position":[[4066,5],[5005,5],[12020,5]]},"824":{"position":[[3778,5],[4478,5],[10936,5]]},"826":{"position":[[4824,5],[5756,5],[12607,5],[18367,5],[24066,5],[29856,5],[35553,5]]},"844":{"position":[[3763,5],[4263,5],[9725,5],[15474,5],[15974,5],[21393,5],[27143,5],[33562,5],[34430,5],[41097,5]]},"846":{"position":[[1804,5],[9085,5]]},"848":{"position":[[8757,5],[9540,5],[16277,5],[16846,5],[22764,5],[23436,5],[29513,5],[30100,5],[35940,5],[36411,5],[41810,5],[42264,5],[47734,5],[53420,5]]}}}],["especi",{"_index":873,"t":{"105":{"position":[[141,10]]},"653":{"position":[[207,10]]}}}],["essenti",{"_index":1988,"t":{"484":{"position":[[1127,12]]}}}],["est",{"_index":558,"t":{"39":{"position":[[879,5]]}}}],["establish",{"_index":23,"t":{"3":{"position":[[311,9]]},"153":{"position":[[464,9],[507,12]]},"478":{"position":[[3897,11],[3934,9]]},"597":{"position":[[161,9]]},"599":{"position":[[35,9]]}}}],["etc",{"_index":340,"t":{"25":{"position":[[204,7]]},"89":{"position":[[3419,7]]},"317":{"position":[[451,5]]},"420":{"position":[[528,5]]},"482":{"position":[[630,4]]},"548":{"position":[[247,7],[380,7]]},"560":{"position":[[574,7]]},"753":{"position":[[119,4]]}}}],["etc/openfga",{"_index":1328,"t":{"210":{"position":[[106,12]]}}}],["europ",{"_index":2081,"t":{"562":{"position":[[295,7],[347,7],[6895,7],[12608,6],[12859,7],[18576,7],[29944,6]]}}}],["evalu",{"_index":4,"t":{"3":{"position":[[51,9],[1203,10],[2296,8],[2638,8]]},"89":{"position":[[3400,10]]},"107":{"position":[[275,10]]},"155":{"position":[[2635,11]]},"408":{"position":[[677,10]]},"420":{"position":[[479,10]]},"422":{"position":[[128,11],[295,9],[608,10]]},"424":{"position":[[118,10],[415,10],[1195,10]]},"508":{"position":[[6522,10]]},"703":{"position":[[476,9]]},"705":{"position":[[159,8]]},"799":{"position":[[159,8]]}}}],["even",{"_index":1683,"t":{"361":{"position":[[148,4]]},"369":{"position":[[11551,4]]},"386":{"position":[[177,4]]},"524":{"position":[[139,4]]},"639":{"position":[[5968,4]]},"649":{"position":[[6079,4]]},"667":{"position":[[13383,4],[26806,4]]},"669":{"position":[[6962,4],[13235,4]]},"701":{"position":[[11353,4]]},"728":{"position":[[39961,4]]},"824":{"position":[[132,4]]}}}],["event",{"_index":559,"t":{"39":{"position":[[936,7]]}}}],["eventu",{"_index":1751,"t":{"410":{"position":[[295,10]]}}}],["everyon",{"_index":656,"t":{"45":{"position":[[5050,9],[6447,8],[6480,8],[10653,8],[31895,8]]},"85":{"position":[[2094,8]]},"311":{"position":[[151,8],[12452,8],[13801,8],[15488,8],[16822,8],[17796,8]]},"333":{"position":[[736,8],[781,8]]},"512":{"position":[[351,8]]},"520":{"position":[[143,8]]},"667":{"position":[[7238,8],[13200,8]]},"669":{"position":[[1013,8],[7248,8],[7324,8],[13293,8]]},"728":{"position":[[21583,8]]},"807":{"position":[[931,8]]},"822":{"position":[[45,8]]},"826":{"position":[[408,10],[3817,8],[5427,8],[7315,8],[8875,8],[10679,8]]}}}],["everyth",{"_index":1982,"t":{"484":{"position":[[108,10]]},"719":{"position":[[378,10],[439,10]]},"726":{"position":[[33973,10]]},"765":{"position":[[374,10],[486,10]]}}}],["exact",{"_index":1535,"t":{"271":{"position":[[140,5]]},"279":{"position":[[3691,5]]},"661":{"position":[[281,5]]}}}],["examin",{"_index":2499,"t":{"745":{"position":[[1204,7],[31519,7]]},"820":{"position":[[1174,7],[31355,7]]},"844":{"position":[[1410,7]]}}}],["exampl",{"_index":81,"t":{"3":{"position":[[1261,8]]},"5":{"position":[[49,8]]},"9":{"position":[[426,8]]},"17":{"position":[[183,8]]},"19":{"position":[[344,7]]},"23":{"position":[[124,8]]},"35":{"position":[[3825,8],[3840,7]]},"45":{"position":[[561,8],[809,7],[1607,7],[4241,8],[4662,8],[5443,8],[5702,8],[8419,7],[11286,8],[14513,8],[14528,7],[18340,8],[20707,8],[20722,7],[24675,8],[27136,8],[27151,7],[31660,8],[31772,8]]},"77":{"position":[[178,8]]},"85":{"position":[[1016,8],[2508,9]]},"87":{"position":[[2106,9]]},"89":{"position":[[3436,9]]},"91":{"position":[[1495,9]]},"93":{"position":[[1876,9]]},"97":{"position":[[394,8]]},"109":{"position":[[938,8]]},"133":{"position":[[1514,8],[1529,7]]},"145":{"position":[[1514,8],[1529,7]]},"153":{"position":[[782,8],[1001,8]]},"169":{"position":[[79,8],[948,8]]},"175":{"position":[[42,8]]},"189":{"position":[[286,8]]},"200":{"position":[[2409,8],[2424,7]]},"202":{"position":[[2348,8],[2363,7],[8096,8],[8111,7]]},"218":{"position":[[282,8],[539,8]]},"224":{"position":[[210,7],[354,7]]},"226":{"position":[[370,8]]},"236":{"position":[[326,9]]},"248":{"position":[[1514,8],[1529,7]]},"265":{"position":[[2628,8],[2643,7]]},"267":{"position":[[2420,8],[2435,7],[8045,8],[8060,7]]},"277":{"position":[[1486,8],[1501,7]]},"285":{"position":[[3645,8],[3660,7],[9436,8],[9451,7],[15315,8],[15330,7],[20921,8],[20936,7]]},"294":{"position":[[2669,8],[2684,7]]},"296":{"position":[[2393,8],[2408,7]]},"311":{"position":[[97,8],[2498,8],[2513,7],[8081,8],[8096,7],[14308,8],[14323,7]]},"313":{"position":[[113,8],[702,8]]},"331":{"position":[[38,8]]},"345":{"position":[[83,8],[333,8]]},"357":{"position":[[2537,8],[2552,7],[6145,8]]},"361":{"position":[[97,8]]},"369":{"position":[[2489,8],[2504,7],[8097,8],[8112,7]]},"375":{"position":[[2795,8],[2810,7],[8784,8],[8799,7],[14598,8],[14613,7]]},"380":{"position":[[522,8]]},"382":{"position":[[3462,8],[3477,7]]},"384":{"position":[[902,8]]},"402":{"position":[[2495,8],[2510,7]]},"404":{"position":[[2437,8],[2452,7],[8276,8],[8291,7],[11898,8]]},"412":{"position":[[1011,8],[3167,8]]},"414":{"position":[[95,8],[460,8]]},"416":{"position":[[861,8]]},"428":{"position":[[87,8]]},"444":{"position":[[2929,8],[2944,7],[9229,8],[9244,7]]},"446":{"position":[[3051,8],[3066,7]]},"448":{"position":[[2323,8],[2338,7]]},"452":{"position":[[163,8]]},"462":{"position":[[2495,8],[2510,7],[8127,8],[8142,7]]},"466":{"position":[[2457,8],[2472,7],[8256,8],[8271,7]]},"472":{"position":[[714,8],[795,8],[1029,8]]},"474":{"position":[[335,8]]},"476":{"position":[[141,7]]},"478":{"position":[[4470,7]]},"482":{"position":[[560,8],[1990,8],[3754,7],[4440,7],[7513,7]]},"484":{"position":[[1297,8],[1513,7]]},"486":{"position":[[170,7]]},"490":{"position":[[167,8]]},"504":{"position":[[2442,8],[2457,7],[5881,8]]},"506":{"position":[[2604,8],[2619,7]]},"508":{"position":[[2510,8],[2525,7]]},"514":{"position":[[1803,8]]},"520":{"position":[[181,7]]},"522":{"position":[[2732,8],[2747,7]]},"524":{"position":[[2634,8],[2649,7]]},"528":{"position":[[304,8]]},"536":{"position":[[135,8]]},"540":{"position":[[2455,8],[2470,7]]},"542":{"position":[[154,8],[2942,8],[2957,7]]},"544":{"position":[[2574,8],[2589,7],[6383,8]]},"548":{"position":[[392,8],[775,8],[1381,8]]},"562":{"position":[[3009,8],[3024,7],[9159,8],[9174,7],[15154,8],[15169,7],[20844,8],[20859,7],[26468,8],[26483,7],[30438,8]]},"566":{"position":[[269,8]]},"574":{"position":[[2695,8],[2710,7]]},"576":{"position":[[1200,8]]},"578":{"position":[[2694,8],[2709,7]]},"580":{"position":[[2550,8],[2565,7]]},"582":{"position":[[2305,8],[2320,7],[7819,8],[7834,7]]},"584":{"position":[[2417,8],[2432,7],[7881,8],[7896,7]]},"586":{"position":[[344,7]]},"599":{"position":[[129,8],[2484,8],[2499,7]]},"606":{"position":[[381,8],[2876,8],[2891,7],[6482,8],[8974,8],[8989,7],[12469,8],[14975,8],[14990,7]]},"608":{"position":[[188,8],[2843,8],[2858,7]]},"613":{"position":[[116,8],[2580,8],[2595,7],[8492,8],[8507,7]]},"618":{"position":[[2695,8],[2710,7]]},"626":{"position":[[116,8],[439,8]]},"637":{"position":[[2916,8],[2931,7]]},"639":{"position":[[2450,8],[2465,7],[6496,8]]},"641":{"position":[[82,7]]},"645":{"position":[[2898,8],[2913,7]]},"647":{"position":[[2363,8],[2378,7]]},"649":{"position":[[2551,8],[2566,7],[8404,8],[8419,7],[14043,8],[14058,7]]},"667":{"position":[[3617,8],[3632,7],[9789,8],[9804,7],[16616,8],[16631,7],[20408,8],[23447,8],[23462,7],[26978,7],[29685,8],[29700,7]]},"669":{"position":[[3592,8],[3607,7],[9847,8],[9862,7],[16187,8],[16202,7],[22510,8],[22525,7]]},"671":{"position":[[475,7]]},"677":{"position":[[25,7]]},"679":{"position":[[170,7],[3308,8],[3323,7],[8924,8],[8939,7]]},"681":{"position":[[116,8],[2601,8],[2616,7],[8322,8],[8337,7]]},"683":{"position":[[2619,8],[2634,7],[8962,8],[8977,7],[15226,8],[15241,7],[21248,8],[21263,7],[26907,8],[26922,7]]},"689":{"position":[[373,8]]},"699":{"position":[[151,8]]},"703":{"position":[[7196,8],[7211,7]]},"705":{"position":[[3643,8],[3658,7]]},"717":{"position":[[349,8]]},"724":{"position":[[349,7]]},"726":{"position":[[4498,8],[4513,7],[14719,8],[14734,7],[22716,8],[22731,7],[27706,8],[30498,8],[30513,7],[36259,8],[36274,7],[41882,8],[41897,7],[47526,8],[47541,7]]},"728":{"position":[[2542,8],[2557,7],[10453,8],[10468,7],[16388,8],[16403,7],[26804,8],[26819,7],[35034,8],[35049,7],[44569,8],[44584,7]]},"745":{"position":[[4154,8],[4169,7],[9759,8],[9774,7],[15528,8],[15543,7],[21090,8],[21105,7],[26718,8],[26733,7],[34450,8],[34465,7],[40076,8],[40091,7]]},"747":{"position":[[5200,8],[5215,7],[11922,8],[11937,7]]},"749":{"position":[[2676,8],[2691,7],[8981,8],[8996,7],[14681,8],[14696,7]]},"751":{"position":[[5552,8],[5567,7],[12138,8],[12153,7],[19687,8],[19702,7]]},"771":{"position":[[2838,8],[2853,7],[8494,8],[8509,7],[14582,8],[14597,7],[21325,8],[21340,7],[27020,8],[27035,7]]},"773":{"position":[[656,8],[5833,8],[5848,7],[12659,8],[12674,7]]},"775":{"position":[[5396,8],[5411,7],[12429,8],[12444,7],[19831,8],[19846,7]]},"777":{"position":[[5774,8],[5789,7],[12533,8],[12548,7]]},"783":{"position":[[405,8]]},"789":{"position":[[6146,8],[6161,7]]},"795":{"position":[[2669,8],[2684,7],[8365,8],[8380,7],[14289,8],[14304,7],[19994,8],[20009,7]]},"797":{"position":[[6776,8],[6791,7],[13650,8],[13665,7],[21644,8],[21659,7],[28071,8],[28086,7]]},"799":{"position":[[3951,8],[3966,7],[11123,8],[11138,7],[18051,8],[18066,7]]},"801":{"position":[[9858,8],[9873,7]]},"820":{"position":[[4161,8],[4176,7],[9790,8],[9805,7],[15573,8],[15588,7],[21128,8],[21143,7],[26750,8],[26765,7],[33968,8],[33983,7],[39588,8],[39603,7]]},"822":{"position":[[5255,8],[5270,7],[12598,8],[12613,7]]},"824":{"position":[[4728,8],[4743,7],[11517,8],[11532,7]]},"826":{"position":[[6006,8],[6021,7],[13189,8],[13204,7],[18951,8],[18966,7],[24652,8],[24667,7],[30440,8],[30455,7],[36137,8],[36152,7]]},"844":{"position":[[4513,8],[4528,7],[10305,8],[10320,7],[16224,8],[16239,7],[21973,8],[21988,7],[27730,8],[27745,7],[34680,8],[34695,7],[41677,8],[41692,7]]},"846":{"position":[[2379,8],[2394,7],[9659,8],[9674,7]]},"848":{"position":[[9790,8],[9805,7],[17096,8],[17111,7],[23686,8],[23701,7],[30350,8],[30365,7],[36661,8],[36676,7],[42514,8],[42529,7],[48306,8],[48321,7],[54007,8],[54022,7]]}}}],["exampleapp",{"_index":573,"t":{"43":{"position":[[1439,11]]},"183":{"position":[[1525,11]]},"185":{"position":[[2253,11]]},"187":{"position":[[2416,11]]}}}],["except",{"_index":584,"t":{"43":{"position":[[2884,6]]},"183":{"position":[[3188,6]]},"185":{"position":[[4317,6]]},"187":{"position":[[4878,6]]},"424":{"position":[[1233,6]]},"777":{"position":[[2461,6]]}}}],["exchang",{"_index":1246,"t":{"187":{"position":[[237,8]]}}}],["exclud",{"_index":837,"t":{"95":{"position":[[173,8]]},"361":{"position":[[335,9]]},"363":{"position":[[2345,7]]},"367":{"position":[[637,7]]},"373":{"position":[[244,7]]}}}],["exclus",{"_index":836,"t":{"95":{"position":[[4,9],[219,9]]},"97":{"position":[[288,9]]},"153":{"position":[[85,11]]},"361":{"position":[[206,9]]},"363":{"position":[[2287,9],[2311,9]]},"367":{"position":[[579,9],[603,9]]},"373":{"position":[[222,9]]},"384":{"position":[[1317,11]]},"386":{"position":[[359,9],[1097,10]]}}}],["execut",{"_index":742,"t":{"45":{"position":[[26816,9]]},"147":{"position":[[638,9]]},"386":{"position":[[824,9]]},"606":{"position":[[1160,7],[7316,7],[13297,7]]},"608":{"position":[[1363,7]]},"618":{"position":[[2375,9]]},"683":{"position":[[827,7]]}}}],["exercis",{"_index":1934,"t":{"480":{"position":[[257,8]]},"486":{"position":[[16,8]]}}}],["exist",{"_index":597,"t":{"45":{"position":[[87,6],[2871,6],[9223,6],[9691,6],[9938,7],[10123,6],[10498,6],[11275,6],[11838,6],[12185,6],[18268,7],[30911,5]]},"69":{"position":[[112,7],[297,6]]},"75":{"position":[[76,5]]},"85":{"position":[[1944,6]]},"87":{"position":[[1439,7]]},"89":{"position":[[2015,7]]},"91":{"position":[[101,6],[640,6]]},"93":{"position":[[116,6]]},"95":{"position":[[115,6],[947,6]]},"109":{"position":[[273,8]]},"135":{"position":[[1701,6],[1747,6]]},"386":{"position":[[206,6]]},"390":{"position":[[162,8]]},"404":{"position":[[5978,5]]},"418":{"position":[[1743,8]]},"420":{"position":[[48,8]]},"454":{"position":[[3363,6]]},"460":{"position":[[667,6]]},"470":{"position":[[232,8]]},"472":{"position":[[64,8]]},"476":{"position":[[1691,8]]},"478":{"position":[[124,8],[2572,8]]},"480":{"position":[[1063,8]]},"548":{"position":[[1080,8]]},"556":{"position":[[382,8]]},"597":{"position":[[194,7]]},"608":{"position":[[427,6]]},"661":{"position":[[216,6]]},"667":{"position":[[33341,6]]},"673":{"position":[[174,8]]},"675":{"position":[[740,6]]},"677":{"position":[[686,8]]},"679":{"position":[[118,8]]},"683":{"position":[[18,8],[24645,7]]},"693":{"position":[[514,5]]},"703":{"position":[[349,8]]},"705":{"position":[[567,5],[733,5]]},"728":{"position":[[6751,7],[6922,6],[13861,7],[23236,8],[40221,5]]},"787":{"position":[[515,6]]},"799":{"position":[[8175,5],[8341,5]]}}}],["expand",{"_index":67,"t":{"3":{"position":[[969,6]]},"9":{"position":[[66,6]]},"105":{"position":[[55,7]]},"179":{"position":[[697,7]]},"279":{"position":[[3518,6]]},"384":{"position":[[788,6]]},"386":{"position":[[1164,6],[1484,6]]},"408":{"position":[[1142,6]]},"420":{"position":[[506,7]]},"424":{"position":[[443,7]]},"588":{"position":[[78,7]]},"608":{"position":[[107,6]]},"611":{"position":[[4,6],[244,6],[292,6]]},"613":{"position":[[0,6],[963,6],[2111,6],[3545,6],[5067,6],[5718,7],[5739,6],[6875,6],[8023,6],[9457,6],[10979,6],[11630,7],[11651,6]]},"622":{"position":[[11,6],[155,6]]},"624":{"position":[[220,6],[274,6]]},"687":{"position":[[220,6]]},"707":{"position":[[10365,6]]},"747":{"position":[[9597,6]]},"801":{"position":[[21267,6]]},"822":{"position":[[10271,6]]},"848":{"position":[[93,6]]}}}],["expandresponse({\"tre",{"_index":2171,"t":{"613":{"position":[[4850,28],[10762,28]]}}}],["expect",{"_index":506,"t":{"39":{"position":[[9,7]]},"375":{"position":[[6415,9],[12190,9]]},"440":{"position":[[1070,8]]},"448":{"position":[[49,13],[5716,7]]},"484":{"position":[[133,9],[731,8],[1188,6]]},"721":{"position":[[546,10],[601,10],[650,10],[691,10],[746,10],[796,10],[840,10],[898,10],[951,10]]},"724":{"position":[[249,7]]},"726":{"position":[[27539,7]]},"728":{"position":[[41900,10],[41955,10],[42004,10],[42045,10],[42100,10],[42150,10],[42194,10],[42252,10],[42305,10]]},"730":{"position":[[205,8]]},"783":{"position":[[87,8]]},"844":{"position":[[39397,9]]},"848":{"position":[[332,9],[501,9],[664,9]]}}}],["experiment",{"_index":1453,"t":{"222":{"position":[[37,12],[98,13],[124,13],[420,12],[854,12],[875,12],[999,12],[1045,16],[1062,12],[1233,12]]}}}],["experimentals=\"feature1",{"_index":1454,"t":{"222":{"position":[[205,24]]}}}],["explain",{"_index":151,"t":{"5":{"position":[[162,9]]},"13":{"position":[[13,8]]},"31":{"position":[[13,8]]},"41":{"position":[[191,8]]},"181":{"position":[[13,8]]},"206":{"position":[[13,8]]},"711":{"position":[[14,8]]},"732":{"position":[[14,8]]},"745":{"position":[[30221,8]]},"755":{"position":[[14,8]]},"807":{"position":[[14,8]]},"820":{"position":[[30261,8]]},"830":{"position":[[14,8]]}}}],["explicit",{"_index":1779,"t":{"418":{"position":[[506,8],[1377,8]]}}}],["explicitli",{"_index":1780,"t":{"418":{"position":[[741,10]]},"548":{"position":[[1236,10]]},"824":{"position":[[154,10]]}}}],["explor",{"_index":600,"t":{"45":{"position":[[419,7]]},"333":{"position":[[1456,7]]},"732":{"position":[[175,9]]},"753":{"position":[[133,7]]},"783":{"position":[[13,8]]}}}],["export",{"_index":591,"t":{"43":{"position":[[3109,6]]},"183":{"position":[[3037,6],[3129,6],[3251,6]]},"185":{"position":[[4166,6],[4258,6],[4380,6],[4489,6]]},"187":{"position":[[4727,6],[4819,6],[4941,6],[5050,6],[5100,6],[5142,6],[5178,6]]},"214":{"position":[[846,6],[920,6],[1003,6],[1085,6],[1180,6],[2295,6],[2364,6],[2444,6],[2528,6],[2610,6],[2705,6]]},"228":{"position":[[211,8]]}}}],["expos",{"_index":1429,"t":{"216":{"position":[[340,7]]},"222":{"position":[[598,8]]},"226":{"position":[[66,7],[119,7]]}}}],["express",{"_index":203,"t":{"9":{"position":[[164,11]]},"23":{"position":[[13,10]]},"384":{"position":[[1248,7],[1291,7]]},"416":{"position":[[653,11]]},"478":{"position":[[2068,11],[2200,11],[4724,11]]},"480":{"position":[[447,11],[620,11]]},"482":{"position":[[1538,7],[2475,7],[6951,7],[8141,7],[8623,7],[9077,7]]},"522":{"position":[[6218,11]]},"751":{"position":[[15616,7]]},"767":{"position":[[214,7]]},"773":{"position":[[567,7]]},"824":{"position":[[15007,7]]},"842":{"position":[[516,7],[830,7]]}}}],["extend",{"_index":521,"t":{"39":{"position":[[235,6]]},"699":{"position":[[281,9]]},"703":{"position":[[0,6]]},"793":{"position":[[310,6]]},"797":{"position":[[0,6]]},"803":{"position":[[191,6]]}}}],["extens",{"_index":208,"t":{"9":{"position":[[289,9]]},"39":{"position":[[650,10]]}}}],["extern",{"_index":1782,"t":{"418":{"position":[[1508,8]]}}}],["extract",{"_index":908,"t":{"109":{"position":[[862,7]]}}}],["eyjwayi6ikxbvevtvf9ou0nptkzjr19hdxromhn0b3jliiwic2sioiixem1qbxf3mwzlzextcuoyn01mdtdqtjh0cwgifq",{"_index":1551,"t":{"279":{"position":[[1539,99],[2232,99],[2504,99],[2932,99]]},"281":{"position":[[2395,99],[3120,99],[3400,99],[3859,99]]}}}],["f0c0",{"_index":650,"t":{"45":{"position":[[4719,4]]}}}],["fabrikam",{"_index":1994,"t":{"484":{"position":[[1739,8],[1986,8]]}}}],["facil",{"_index":1573,"t":{"283":{"position":[[458,11]]}}}],["facilit",{"_index":1425,"t":{"216":{"position":[[15,11]]},"408":{"position":[[723,10]]}}}],["fact",{"_index":2,"t":{"3":{"position":[[28,5]]},"256":{"position":[[374,5]]},"394":{"position":[[383,5]]},"745":{"position":[[30208,5]]},"820":{"position":[[30242,5]]},"846":{"position":[[6011,4]]}}}],["factor",{"_index":1046,"t":{"155":{"position":[[1010,7]]}}}],["fail",{"_index":125,"t":{"3":{"position":[[2285,7],[2627,7],[3091,5]]},"45":{"position":[[8578,5]]},"179":{"position":[[609,5]]},"256":{"position":[[209,5]]},"313":{"position":[[743,7]]},"394":{"position":[[219,5]]},"422":{"position":[[797,4]]},"484":{"position":[[3903,5]]},"705":{"position":[[180,5]]}}}],["failur",{"_index":1793,"t":{"418":{"position":[[3476,7]]}}}],["fairli",{"_index":1962,"t":{"482":{"position":[[1506,6]]}}}],["fake",{"_index":1990,"t":{"484":{"position":[[1328,4]]}}}],["fals",{"_index":123,"t":{"3":{"position":[[2243,5]]},"45":{"position":[[18298,5]]},"135":{"position":[[1712,5]]},"202":{"position":[[5760,6],[6718,5],[7846,5],[9186,5],[10330,5],[11449,5]]},"267":{"position":[[6678,5],[7795,5],[9124,5],[10257,5],[11332,5]]},"285":{"position":[[2273,5],[3395,5],[4729,5],[5867,5],[6962,5],[19543,5],[20671,5],[22011,5],[23155,5],[24274,5]]},"296":{"position":[[128,5],[1016,5],[2143,5],[3482,5],[4625,5],[5740,5]]},"375":{"position":[[7407,5],[8534,5],[9873,5],[11016,5],[12131,5],[12153,6]]},"404":{"position":[[5933,5],[6891,5],[8026,5],[9373,5],[10524,5],[11671,5]]},"466":{"position":[[6875,5],[8006,5],[9349,5],[10496,5],[11627,5]]},"562":{"position":[[13777,5],[14904,5],[16243,5],[17386,5],[18501,5]]},"584":{"position":[[6515,5],[7631,5],[8959,5],[10091,5],[11162,5]]},"649":{"position":[[7024,5],[8154,5],[9496,5],[10642,5],[11769,5]]},"669":{"position":[[1328,7],[2215,5],[3342,5],[4681,5],[5824,5],[6939,5],[7577,7],[8467,5],[9597,5],[10939,5],[12085,5],[13212,5],[13921,7],[14809,5],[15937,5],[17277,5],[18421,5],[19540,5]]},"683":{"position":[[25531,5],[26657,5],[27995,5],[29137,5],[30248,5]]},"701":{"position":[[5998,5],[6313,5],[6598,5],[6834,5],[7577,5],[7853,5],[8166,5],[8449,5],[8683,5],[9418,5],[9698,5],[10013,5],[10298,5],[10534,5],[11277,5]]},"703":{"position":[[3048,5],[3361,5],[3644,5],[3878,5],[4613,5]]},"705":{"position":[[10262,5],[10692,5],[11104,5],[11447,5],[12495,5]]},"726":{"position":[[34881,5],[36009,5],[37349,5],[38493,5],[39612,5]]},"728":{"position":[[9079,5],[10203,5],[11539,5],[12679,5],[13782,5],[15005,5],[16138,5],[17483,5],[18632,5],[19771,5]]},"745":{"position":[[25338,5],[26468,5],[27810,5],[28956,5],[30083,5]]},"771":{"position":[[25644,5],[26770,5],[28108,5],[29250,5],[30361,5]]},"777":{"position":[[11153,5],[12283,5],[13625,5],[14771,5],[15898,5]]},"795":{"position":[[18619,5],[19744,5],[21081,5],[22222,5],[23329,5]]},"797":{"position":[[5406,5],[6526,5],[7858,5],[8994,5],[10081,5]]},"799":{"position":[[16488,5],[17801,5],[19339,5],[20668,5],[22262,5]]},"820":{"position":[[25370,5],[26500,5],[27842,5],[28988,5],[30115,5]]},"826":{"position":[[17563,5],[18701,5],[20051,5],[21205,5],[22364,5],[29052,5],[30190,5],[31540,5],[32694,5],[33853,5],[34749,5],[35887,5],[37237,5],[38391,5],[39550,5]]},"844":{"position":[[26339,5],[27480,5],[28833,5],[29990,5],[31161,5]]},"846":{"position":[[1000,5],[2129,5],[3470,5],[4615,5],[5738,5]]},"848":{"position":[[46930,5],[48056,5],[49394,5],[50536,5],[51647,5]]}}}],["familiar",{"_index":774,"t":{"81":{"position":[[979,8]]},"191":{"position":[[56,8]]},"258":{"position":[[56,8]]},"285":{"position":[[56,8]]},"302":{"position":[[56,8]]},"347":{"position":[[47,8]]},"363":{"position":[[46,8]]},"396":{"position":[[56,8]]},"430":{"position":[[46,8]]},"454":{"position":[[56,8]]},"476":{"position":[[325,8]]},"492":{"position":[[56,8]]},"514":{"position":[[56,8]]},"530":{"position":[[56,8]]},"550":{"position":[[56,8]]},"568":{"position":[[56,8]]},"590":{"position":[[56,8]]},"628":{"position":[[46,8]]},"655":{"position":[[47,8]]},"675":{"position":[[27,8]]},"691":{"position":[[36,8]]},"693":{"position":[[587,8]]},"713":{"position":[[56,8]]},"734":{"position":[[56,8]]},"751":{"position":[[921,8]]},"757":{"position":[[56,8]]},"785":{"position":[[36,8]]},"787":{"position":[[589,8]]},"809":{"position":[[56,8]]},"832":{"position":[[56,8]]}}}],["far",{"_index":1976,"t":{"482":{"position":[[5741,4]]},"701":{"position":[[11296,4]]},"726":{"position":[[27333,3]]},"728":{"position":[[13791,3],[13928,4],[23203,3],[38397,4]]},"795":{"position":[[23348,4]]},"846":{"position":[[5900,4]]},"848":{"position":[[3,4]]}}}],["fastifi",{"_index":1073,"t":{"163":{"position":[[82,7]]},"169":{"position":[[104,7],[179,7],[234,7],[294,7],[306,7],[375,7],[383,7],[398,7],[431,7],[439,7],[454,7],[599,7]]},"171":{"position":[[117,7],[319,9],[882,9],[1161,7]]},"173":{"position":[[290,9],[1016,9],[1704,9],[2017,7]]}}}],["fastify.authent",{"_index":1136,"t":{"171":{"position":[[949,23]]},"173":{"position":[[1771,22]]}}}],["fastify.author",{"_index":1186,"t":{"173":{"position":[[1816,19]]}}}],["fastify.decorate('authent",{"_index":1128,"t":{"171":{"position":[[583,32]]}}}],["fastify.decorate('author",{"_index":1183,"t":{"173":{"position":[[1034,29]]}}}],["fastify.decorate('preauthor",{"_index":1177,"t":{"173":{"position":[[308,32]]}}}],["fastify.get",{"_index":1134,"t":{"171":{"position":[[900,12]]},"173":{"position":[[1722,12]]}}}],["fastify.get('/read/:docu",{"_index":1090,"t":{"169":{"position":[[668,30]]}}}],["fastify.listen(3000",{"_index":1092,"t":{"169":{"position":[[831,21]]},"171":{"position":[[1430,21]]},"173":{"position":[[2418,21]]}}}],["fastify.log.error(err",{"_index":1094,"t":{"169":{"position":[[869,23]]},"171":{"position":[[1468,23]]},"173":{"position":[[2456,23]]}}}],["fastify.preauthor",{"_index":1185,"t":{"173":{"position":[[1794,21]]}}}],["fastify.register(author",{"_index":1190,"t":{"173":{"position":[[2320,28]]}}}],["fastify.register(jwtauthent",{"_index":1145,"t":{"171":{"position":[[1307,34]]},"173":{"position":[[2253,34]]}}}],["fastify.register(preauthor",{"_index":1189,"t":{"173":{"position":[[2288,31]]}}}],["fastify.register(require('fastifi",{"_index":1118,"t":{"171":{"position":[[337,33]]}}}],["fastify.register(routeread",{"_index":1146,"t":{"171":{"position":[[1342,28]]},"173":{"position":[[2349,28]]}}}],["featur",{"_index":147,"t":{"5":{"position":[[90,8],[317,8]]},"7":{"position":[[683,8]]},"11":{"position":[[34,7]]},"39":{"position":[[611,8]]},"222":{"position":[[50,8],[888,8],[1012,8],[1075,7],[1246,7]]},"361":{"position":[[552,8]]},"474":{"position":[[413,7]]},"476":{"position":[[2,8],[149,7],[210,8],[379,7],[524,7],[643,8],[1067,7],[1294,7],[2670,7]]},"478":{"position":[[1710,7],[3552,7]]},"480":{"position":[[2042,7]]},"482":{"position":[[471,8],[1028,9],[2391,7],[3011,8]]},"484":{"position":[[81,7]]},"486":{"position":[[327,7]]},"490":{"position":[[955,8]]},"643":{"position":[[58,7],[117,7],[362,10],[987,7],[1097,8],[1146,8],[1500,8],[1552,7],[1615,7],[1668,8],[1801,7],[1894,8],[1956,8],[2031,7]]},"645":{"position":[[980,7],[2367,7],[4081,7],[5468,7],[6883,7]]},"649":{"position":[[836,7],[2020,7],[3580,7],[4815,7],[5845,7]]},"671":{"position":[[128,7],[455,7]]},"713":{"position":[[611,9],[878,7],[1009,8]]},"717":{"position":[[31,8],[317,7],[593,7]]},"719":{"position":[[175,9],[225,8],[301,8]]},"724":{"position":[[324,9],[427,7],[644,7],[876,10]]},"726":{"position":[[153,8],[951,7],[1090,7],[1242,7],[1390,7],[1554,7],[1721,7],[2909,7],[3107,7],[3318,7],[3525,7],[3748,7],[3974,7],[5538,7],[5687,7],[5849,7],[6007,7],[6181,7],[6358,7],[7596,7],[7744,7],[7905,7],[8062,7],[8235,7],[8411,7],[10498,7],[10641,7],[10797,7],[10949,7],[11117,7],[11288,7]]},"728":{"position":[[6071,7],[6120,7],[6201,10],[6530,7],[7184,7],[7434,10],[20774,8],[20820,7],[20936,10],[21380,7],[21741,7],[22200,7],[22428,7],[23006,8],[23371,7],[23660,10],[30713,8],[31092,7],[31437,10],[32454,7],[38654,7],[38942,7],[39065,10],[39516,7],[39629,10],[40620,7],[40930,10]]},"820":{"position":[[42,8]]},"826":{"position":[[19,7],[367,8]]}}}],["feature'",{"_index":2478,"t":{"728":{"position":[[21539,9]]}}}],["feature2",{"_index":1455,"t":{"222":{"position":[[230,9],[371,9]]}}}],["feature:data_preview",{"_index":2218,"t":{"645":{"position":[[1050,24],[4160,22],[6663,20]]},"647":{"position":[[884,23],[1978,23],[3353,23],[4880,20],[5599,23],[5642,22],[5767,20]]},"649":{"position":[[62,21],[906,24],[3659,22],[5773,20],[6058,20],[6923,23],[8018,23],[9394,23],[10923,20],[11644,23],[11687,22]]}}}],["feature:draft_pr",{"_index":2400,"t":{"726":{"position":[[1308,21],[1626,21],[5924,19],[6262,19],[10031,17],[10292,17]]},"728":{"position":[[48101,17],[48145,17],[48327,17],[48371,17],[48563,17],[48610,17]]}}}],["feature:i",{"_index":2479,"t":{"728":{"position":[[21883,11],[22106,11],[22491,11],[38770,11]]}}}],["feature:issu",{"_index":2398,"t":{"726":{"position":[[1017,18],[1156,18],[1462,18],[5613,16],[5762,16],[6088,16],[9785,14],[9908,14],[10163,14],[46050,17],[47147,17],[48525,17],[50058,14],[50792,17],[50829,16]]},"728":{"position":[[103,15],[258,14],[1065,17],[2158,17],[3532,17],[5057,14],[5774,17],[5811,16],[8170,14],[8984,17],[10073,17],[11443,17],[12960,14],[13669,17],[13706,16],[13978,15],[14052,14],[14910,17],[16008,17],[17387,17],[18922,14],[19658,17],[19695,16],[24505,14],[25328,17],[26425,17],[27803,17],[29336,14],[30070,17],[30107,16],[30334,15],[30481,15],[30561,14],[30625,14],[32760,14],[33567,17],[34655,17],[36024,17],[37539,14],[38246,17],[38283,16],[40079,14],[40138,14],[40487,16],[43102,17],[44190,17],[45559,17],[47074,14],[47781,17],[47818,16],[48025,14],[48066,14],[48251,14],[48292,14],[48481,14],[48525,14]]}}}],["feature:sso",{"_index":2402,"t":{"726":{"position":[[1793,15],[6439,13],[10424,11]]},"728":{"position":[[48182,11],[48220,11],[48409,11],[48447,11],[48651,11],[48692,11]]}}}],["februari",{"_index":1813,"t":{"424":{"position":[[3,8]]}}}],["fed",{"_index":2463,"t":{"726":{"position":[[33894,3]]}}}],["fedora",{"_index":949,"t":{"113":{"position":[[1549,7]]},"117":{"position":[[123,7]]}}}],["feed",{"_index":2572,"t":{"767":{"position":[[269,4]]},"842":{"position":[[571,4]]}}}],["feedback",{"_index":251,"t":{"11":{"position":[[135,9]]}}}],["feel",{"_index":1893,"t":{"470":{"position":[[79,4]]},"751":{"position":[[915,5]]}}}],["few",{"_index":1648,"t":{"329":{"position":[[215,3]]},"478":{"position":[[4346,3]]},"482":{"position":[[7391,3]]},"719":{"position":[[72,3]]},"726":{"position":[[33938,3]]}}}],["fga",{"_index":209,"t":{"9":{"position":[[305,3]]},"15":{"position":[[127,3]]},"19":{"position":[[120,3]]},"35":{"position":[[7094,3],[8460,3]]},"43":{"position":[[444,4],[1244,4],[2249,4],[2271,4],[2661,4],[2810,4],[2992,3],[3016,4],[3155,4],[3272,4]]},"45":{"position":[[339,3],[442,3],[3203,3],[16933,3],[23127,3],[29635,3]]},"105":{"position":[[353,4]]},"135":{"position":[[1137,3]]},"147":{"position":[[1326,3]]},"155":{"position":[[1096,3]]},"200":{"position":[[5393,3]]},"202":{"position":[[4762,3],[10514,3]]},"250":{"position":[[1242,3]]},"252":{"position":[[1403,3]]},"265":{"position":[[5022,3]]},"267":{"position":[[5391,3],[10441,3]]},"279":{"position":[[785,3],[2663,3]]},"281":{"position":[[1816,3],[3559,3]]},"285":{"position":[[6051,3],[12491,3],[17729,3],[23339,3]]},"294":{"position":[[5652,3]]},"296":{"position":[[4809,3]]},"311":{"position":[[5455,3],[11043,3]]},"357":{"position":[[4967,3]]},"369":{"position":[[4905,3],[10511,3]]},"375":{"position":[[5901,3],[11200,3],[17014,3]]},"382":{"position":[[5872,3]]},"402":{"position":[[5515,3]]},"404":{"position":[[4867,3],[10708,3]]},"422":{"position":[[2804,3]]},"444":{"position":[[6340,3],[6460,3],[11649,3]]},"446":{"position":[[6718,3],[6856,3]]},"448":{"position":[[4743,3]]},"462":{"position":[[4917,3],[10547,3]]},"466":{"position":[[4881,3],[10680,3]]},"482":{"position":[[10627,3],[10642,3]]},"504":{"position":[[5420,3]]},"506":{"position":[[5759,3]]},"508":{"position":[[4940,3]]},"522":{"position":[[5821,3]]},"524":{"position":[[5056,3]]},"540":{"position":[[5439,3]]},"542":{"position":[[6102,3]]},"544":{"position":[[5008,3]]},"562":{"position":[[6342,3],[6452,3],[11575,3],[17570,3],[23264,3],[28886,3]]},"574":{"position":[[5851,3],[5956,3]]},"578":{"position":[[5838,3],[5941,3]]},"580":{"position":[[5531,3]]},"582":{"position":[[4697,3],[10211,3]]},"584":{"position":[[5376,3],[10275,3]]},"599":{"position":[[4896,3]]},"606":{"position":[[5398,3],[11456,3],[17477,3]]},"608":{"position":[[5129,3]]},"613":{"position":[[5057,3],[10969,3]]},"618":{"position":[[5416,3]]},"637":{"position":[[6146,3]]},"639":{"position":[[4886,3]]},"645":{"position":[[6427,3],[6551,3]]},"647":{"position":[[4783,3]]},"649":{"position":[[5699,3],[10826,3],[16471,3]]},"667":{"position":[[6031,3],[12203,3],[19036,3],[25861,3],[32101,3]]},"669":{"position":[[6008,3],[12269,3],[18605,3],[24928,3]]},"679":{"position":[[5726,3],[11340,3]]},"681":{"position":[[5692,3],[10746,3]]},"683":{"position":[[5271,3],[12193,3],[12309,3],[18462,3],[18540,3],[23666,3],[29321,3]]},"695":{"position":[[8853,3],[8976,3],[9099,3],[9222,3],[9345,3],[9468,3],[9581,3]]},"701":{"position":[[1302,3],[3141,3],[4992,3],[6840,3],[8689,3],[10540,3]]},"703":{"position":[[3884,3],[10325,3],[11770,3]]},"705":{"position":[[6831,3],[8778,3],[11453,3]]},"707":{"position":[[8392,3],[8515,3],[8638,3],[8761,3],[8884,3],[9007,3],[9120,3]]},"726":{"position":[[9677,3],[9800,3],[9923,3],[10049,3],[10178,3],[10310,3],[18674,3],[18796,3],[18918,3],[26516,3],[26634,3],[26752,3],[32914,3],[38677,3],[44306,3],[49952,3]]},"728":{"position":[[4960,3],[12863,3],[18816,3],[29230,3],[37442,3],[46977,3]]},"745":{"position":[[7159,3],[12179,3],[18533,3],[23510,3],[29140,3],[36870,3],[42496,3]]},"747":{"position":[[8782,3],[8909,3],[14346,3]]},"749":{"position":[[5753,3],[12100,3],[17101,3]]},"751":{"position":[[8828,3],[8948,3],[14566,3],[22758,3]]},"771":{"position":[[5840,3],[11508,3],[18063,3],[18182,3],[18305,3],[23743,3],[29434,3]]},"773":{"position":[[9492,3],[9608,3],[9718,3],[9837,3],[15083,3]]},"775":{"position":[[8681,3],[8811,3],[16337,3],[16478,3],[16619,3],[16748,3],[22243,3]]},"777":{"position":[[9264,3],[9384,3],[9508,3],[14955,3]]},"789":{"position":[[10487,3],[10612,3],[10738,3],[10865,3]]},"795":{"position":[[5079,3],[10783,3],[17416,3],[22406,3]]},"797":{"position":[[9178,3],[17750,3],[17882,3],[18014,3],[25102,3],[25228,3],[30481,3]]},"799":{"position":[[7522,3],[7610,3],[13922,3],[20852,3]]},"801":{"position":[[17562,3],[17687,3],[17813,3],[17940,3],[18065,3],[18195,3],[18326,3],[18458,3],[18590,3],[18722,3],[18854,3],[18986,3]]},"820":{"position":[[7175,3],[12216,3],[18575,3],[23546,3],[29172,3],[36386,3],[42008,3]]},"822":{"position":[[9158,3],[9268,3],[9378,3],[9491,3],[15024,3]]},"824":{"position":[[8238,3],[8361,3],[13949,3]]},"826":{"position":[[9969,3],[10096,3],[10235,3],[15623,3],[21389,3],[27094,3],[32878,3],[38575,3]]},"844":{"position":[[7638,3],[12735,3],[19349,3],[24403,3],[30174,3],[38492,3],[38619,3],[38739,3],[44107,3]]},"846":{"position":[[4799,3],[12077,3]]},"848":{"position":[[13502,3],[13638,3],[13785,3],[20367,3],[27115,3],[27229,3],[33632,3],[33757,3],[39753,3],[45555,3],[50720,3],[56451,3]]},"850":{"position":[[699,5]]}}}],["fga.yaml",{"_index":193,"t":{"7":{"position":[[709,11]]}}}],["fga__linux_.apk",{"_index":954,"t":{"113":{"position":[[1652,32]]},"117":{"position":[[226,32]]}}}],["fga__linux_.deb",{"_index":948,"t":{"113":{"position":[[1516,32]]},"117":{"position":[[90,32]]}}}],["fga__linux_.rpm",{"_index":951,"t":{"113":{"position":[[1574,32]]},"117":{"position":[[148,32]]}}}],["fga_api_audience=your_api_audi",{"_index":1276,"t":{"187":{"position":[[5107,34]]}}}],["fga_api_host",{"_index":373,"t":{"33":{"position":[[130,12],[279,12],[416,12],[565,12],[702,12],[851,12],[988,12],[1137,12],[1274,12],[1574,12],[1678,12]]},"129":{"position":[[130,12],[316,12],[453,12],[639,12],[776,12],[962,12],[1099,12],[1285,12],[1422,12],[1683,12],[1841,12]]},"141":{"position":[[130,12],[316,12],[453,12],[639,12],[776,12],[962,12],[1099,12],[1285,12],[1422,12],[1683,12],[1841,12]]},"165":{"position":[[109,12],[319,12],[473,12],[683,12]]},"220":{"position":[[374,13]]},"244":{"position":[[130,12],[280,12],[417,12],[567,12],[704,12],[854,12],[991,12],[1141,12],[1278,12],[1539,12],[1661,12]]},"273":{"position":[[126,12],[311,12],[448,12],[633,12],[770,12],[920,12],[1057,12],[1207,12],[1344,12],[1501,12]]}}}],["fga_api_host/healthz",{"_index":1448,"t":{"220":{"position":[[251,21]]}}}],["fga_api_host/stor",{"_index":595,"t":{"43":{"position":[[3198,20]]}}}],["fga_api_token",{"_index":374,"t":{"33":{"position":[[159,14],[445,14],[731,14],[1017,14],[1303,14],[1603,14]]},"35":{"position":[[7775,15]]},"45":{"position":[[17342,15],[23536,15],[30087,15]]},"129":{"position":[[159,14],[482,14],[805,14],[1128,14],[1451,14],[1712,14]]},"135":{"position":[[1358,15]]},"141":{"position":[[159,14],[482,14],[805,14],[1128,14],[1451,14],[1712,14]]},"147":{"position":[[1600,15]]},"165":{"position":[[138,14],[502,14]]},"185":{"position":[[223,14]]},"200":{"position":[[4943,15]]},"202":{"position":[[5168,15],[10922,15]]},"244":{"position":[[159,14],[446,14],[733,14],[1020,14],[1307,14],[1568,14]]},"250":{"position":[[1436,15]]},"252":{"position":[[1559,15]]},"265":{"position":[[5418,15]]},"267":{"position":[[4946,15],[10838,15]]},"273":{"position":[[155,14],[477,14],[799,14],[1086,14],[1373,14]]},"279":{"position":[[916,15],[2794,15]]},"281":{"position":[[1961,15],[3704,15]]},"285":{"position":[[6453,15],[12043,15],[18135,15],[23747,15]]},"294":{"position":[[5203,15]]},"296":{"position":[[5216,15]]},"311":{"position":[[5014,15],[10601,15],[17211,15]]},"357":{"position":[[5381,15]]},"369":{"position":[[5312,15],[10917,15]]},"375":{"position":[[5446,15],[11607,15],[17421,15]]},"382":{"position":[[6276,15]]},"402":{"position":[[5053,15]]},"404":{"position":[[5281,15],[11123,15]]},"422":{"position":[[2518,15]]},"444":{"position":[[5811,15],[12058,15]]},"446":{"position":[[6153,15]]},"448":{"position":[[5152,15]]},"462":{"position":[[5327,15],[10956,15]]},"466":{"position":[[5292,15],[11091,15]]},"504":{"position":[[4972,15]]},"506":{"position":[[5293,15]]},"508":{"position":[[5354,15]]},"522":{"position":[[5365,15]]},"524":{"position":[[5466,15]]},"540":{"position":[[4989,15]]},"542":{"position":[[5629,15]]},"544":{"position":[[5424,15]]},"562":{"position":[[5831,15],[11982,15],[17977,15],[23673,15],[29294,15]]},"574":{"position":[[5351,15]]},"578":{"position":[[5342,15]]},"580":{"position":[[5082,15]]},"582":{"position":[[5092,15],[10606,15]]},"584":{"position":[[4935,15],[10671,15]]},"599":{"position":[[5301,15]]},"606":{"position":[[5754,15],[11794,15],[17825,15]]},"608":{"position":[[5485,15]]},"613":{"position":[[5454,15],[11366,15]]},"618":{"position":[[5923,15]]},"637":{"position":[[5681,15]]},"639":{"position":[[5303,15]]},"645":{"position":[[5880,15]]},"647":{"position":[[5192,15]]},"649":{"position":[[5228,15],[11236,15],[16884,15]]},"667":{"position":[[6437,15],[12609,15],[19445,15],[26267,15],[32508,15]]},"669":{"position":[[6415,15],[12679,15],[19013,15],[25336,15]]},"679":{"position":[[6134,15],[11747,15]]},"681":{"position":[[5236,15],[11157,15]]},"683":{"position":[[5574,15],[11668,15],[17936,15],[24074,15],[29727,15]]},"695":{"position":[[8133,15]]},"701":{"position":[[1524,15],[3365,15],[5214,15],[7065,15],[8912,15],[10765,15]]},"703":{"position":[[4107,15],[9865,15],[11992,15]]},"705":{"position":[[6370,15],[9063,15],[11739,15]]},"707":{"position":[[7672,15]]},"726":{"position":[[8816,15],[18060,15],[25917,15],[33321,15],[39085,15],[44717,15],[50364,15]]},"728":{"position":[[5368,15],[13267,15],[19229,15],[29642,15],[37845,15],[47380,15]]},"745":{"position":[[6702,15],[12588,15],[18076,15],[23919,15],[29550,15],[37279,15],[42905,15]]},"747":{"position":[[8224,15],[14757,15]]},"749":{"position":[[5272,15],[11640,15],[17510,15]]},"751":{"position":[[8288,15],[14979,15],[22279,15]]},"771":{"position":[[5384,15],[11048,15],[17462,15],[24151,15],[29840,15]]},"773":{"position":[[8839,15],[15494,15]]},"775":{"position":[[8138,15],[15601,15],[22648,15]]},"777":{"position":[[8660,15],[15365,15]]},"789":{"position":[[9788,15]]},"795":{"position":[[5483,15],[11191,15],[16954,15],[22811,15]]},"797":{"position":[[9578,15],[17089,15],[24574,15],[30885,15]]},"799":{"position":[[6993,15],[14424,15],[21355,15]]},"801":{"position":[[16164,15]]},"820":{"position":[[6715,15],[12628,15],[18119,15],[23954,15],[29582,15],[36794,15],[42417,15]]},"822":{"position":[[8501,15],[15436,15]]},"824":{"position":[[7692,15],[14364,15]]},"826":{"position":[[9335,15],[16039,15],[21807,15],[27514,15],[33296,15],[38993,15]]},"844":{"position":[[7176,15],[13149,15],[18887,15],[24817,15],[30595,15],[37881,15],[44521,15]]},"846":{"position":[[5208,15],[12485,15]]},"848":{"position":[[12824,15],[19897,15],[26595,15],[33090,15],[39267,15],[45086,15],[51126,15],[56872,15]]}}}],["fga_api_token=your_api_token",{"_index":1243,"t":{"185":{"position":[[4496,28]]}}}],["fga_api_token_issuer=your_api_token_issu",{"_index":1275,"t":{"187":{"position":[[5057,42]]}}}],["fga_client",{"_index":476,"t":{"35":{"position":[[6102,11]]},"43":{"position":[[2615,11]]},"45":{"position":[[16416,11],[22610,11],[29081,11]]},"133":{"position":[[3038,11]]},"145":{"position":[[3038,11]]},"183":{"position":[[2904,11]]},"185":{"position":[[4033,11]]},"187":{"position":[[4594,11]]},"200":{"position":[[4336,11]]},"202":{"position":[[4248,11],[9998,11]]},"248":{"position":[[3038,11]]},"265":{"position":[[4518,11]]},"267":{"position":[[4342,11],[9936,11]]},"277":{"position":[[3010,11]]},"285":{"position":[[5541,11],[11400,11],[17215,11],[22823,11]]},"294":{"position":[[4595,11]]},"296":{"position":[[4294,11]]},"311":{"position":[[4416,11],[10000,11],[16433,11]]},"357":{"position":[[4445,11]]},"369":{"position":[[4390,11],[9997,11]]},"375":{"position":[[4781,11],[10685,11],[16499,11]]},"382":{"position":[[5360,11]]},"402":{"position":[[4434,11]]},"404":{"position":[[4345,11],[10185,11]]},"444":{"position":[[5031,11],[11132,11]]},"446":{"position":[[5263,11]]},"448":{"position":[[4226,11]]},"462":{"position":[[4399,11],[10030,11]]},"466":{"position":[[4362,11],[10161,11]]},"504":{"position":[[4367,11]]},"506":{"position":[[4609,11]]},"508":{"position":[[4418,11]]},"522":{"position":[[4709,11]]},"524":{"position":[[4538,11]]},"540":{"position":[[4382,11]]},"542":{"position":[[4946,11]]},"544":{"position":[[4484,11]]},"562":{"position":[[5081,11],[11060,11],[17055,11],[22747,11],[28370,11]]},"574":{"position":[[4683,11]]},"578":{"position":[[4678,11]]},"580":{"position":[[4476,11]]},"582":{"position":[[4194,11],[9708,11]]},"584":{"position":[[4335,11],[9771,11]]},"599":{"position":[[4383,11]]},"606":{"position":[[4828,11],[10905,11],[16916,11]]},"608":{"position":[[4677,11]]},"613":{"position":[[4541,11],[10453,11]]},"618":{"position":[[4761,11]]},"637":{"position":[[4959,11]]},"639":{"position":[[4361,11]]},"645":{"position":[[5050,11]]},"647":{"position":[[4266,11]]},"649":{"position":[[4549,11],[10308,11],[15950,11]]},"667":{"position":[[5517,11],[11689,11],[18519,11],[25347,11],[31586,11]]},"669":{"position":[[5493,11],[11751,11],[18089,11],[24412,11]]},"679":{"position":[[5210,11],[10825,11]]},"681":{"position":[[4579,11],[10227,11]]},"683":{"position":[[4633,11],[10975,11],[17240,11],[23150,11],[28807,11]]},"703":{"position":[[9191,11]]},"705":{"position":[[5666,11]]},"726":{"position":[[7320,11],[17051,11],[24978,11],[32399,11],[38161,11],[43787,11],[49432,11]]},"728":{"position":[[4444,11],[12351,11],[18295,11],[28710,11],[36931,11],[46466,11]]},"745":{"position":[[6088,11],[11662,11],[17462,11],[22993,11],[28622,11],[36353,11],[41979,11]]},"747":{"position":[[7373,11],[13827,11]]},"749":{"position":[[4634,11],[10971,11],[16584,11]]},"751":{"position":[[7580,11],[14045,11],[21643,11]]},"771":{"position":[[4771,11],[10431,11],[16682,11],[23227,11],[28920,11]]},"773":{"position":[[7996,11],[14564,11]]},"775":{"position":[[7427,11],[14675,11],[21730,11]]},"777":{"position":[[7877,11],[14437,11]]},"789":{"position":[[8629,11]]},"795":{"position":[[4567,11],[10267,11],[16282,11],[21893,11]]},"797":{"position":[[8670,11],[16031,11],[23770,11],[29969,11]]},"799":{"position":[[6132,11],[13222,11],[20151,11]]},"801":{"position":[[13677,11]]},"820":{"position":[[6098,11],[11696,11],[17506,11],[23030,11],[28654,11],[35870,11],[41491,11]]},"822":{"position":[[7539,11],[14504,11]]},"824":{"position":[[6871,11],[13426,11]]},"826":{"position":[[8332,11],[15099,11],[20863,11],[26566,11],[32352,11],[38049,11]]},"844":{"position":[[6505,11],[12213,11],[18216,11],[23881,11],[29645,11],[36942,11],[43585,11]]},"846":{"position":[[4282,11],[11561,11]]},"848":{"position":[[11967,11],[19157,11],[25801,11],[32380,11],[38624,11],[44460,11],[50206,11],[55922,11]]}}}],["fga_client.check(bodi",{"_index":717,"t":{"45":{"position":[[16697,22],[22891,22]]},"135":{"position":[[1079,22]]},"202":{"position":[[4526,22],[10277,22]]},"265":{"position":[[4786,22]]},"267":{"position":[[10204,22]]},"285":{"position":[[5814,22],[17493,22],[23102,22]]},"296":{"position":[[4572,22]]},"357":{"position":[[4731,22]]},"369":{"position":[[4669,22],[10275,22]]},"375":{"position":[[10963,22],[16778,22]]},"382":{"position":[[5636,22]]},"404":{"position":[[4631,22],[10471,22]]},"444":{"position":[[11413,22]]},"448":{"position":[[4507,22]]},"462":{"position":[[4681,22],[10311,22]]},"466":{"position":[[4645,22],[10443,22]]},"508":{"position":[[4704,22]]},"524":{"position":[[4820,22]]},"544":{"position":[[4772,22]]},"562":{"position":[[11339,22],[17333,22],[23028,22],[28650,22]]},"582":{"position":[[4461,22],[9975,22]]},"584":{"position":[[10038,22]]},"599":{"position":[[4660,22]]},"639":{"position":[[4650,22]]},"647":{"position":[[4547,22]]},"649":{"position":[[10589,22],[16235,22]]},"667":{"position":[[5795,22],[11967,22],[18800,22],[25625,22],[31865,22]]},"669":{"position":[[5771,22],[12032,22],[18368,22],[24692,22]]},"679":{"position":[[5490,22],[11104,22]]},"681":{"position":[[10510,22]]},"683":{"position":[[23430,22],[29084,22]]},"701":{"position":[[1244,22],[3083,22],[4934,22],[6781,22],[8630,22],[10481,22]]},"703":{"position":[[3825,22],[11712,22]]},"705":{"position":[[8720,22],[11394,22]]},"726":{"position":[[32678,22],[38440,22],[44070,22],[49716,22]]},"728":{"position":[[4719,22],[12626,22],[18579,22],[28994,22],[37206,22],[46741,22]]},"745":{"position":[[11943,22],[23274,22],[28903,22],[36634,22],[42260,22]]},"747":{"position":[[14110,22]]},"749":{"position":[[16865,22]]},"751":{"position":[[14325,22]]},"771":{"position":[[23507,22],[29197,22]]},"773":{"position":[[14847,22]]},"775":{"position":[[22007,22]]},"777":{"position":[[14718,22]]},"795":{"position":[[4843,22],[10547,22],[22169,22]]},"797":{"position":[[8941,22],[30245,22]]},"799":{"position":[[13686,22],[20615,22]]},"820":{"position":[[11980,22],[23310,22],[28935,22],[36150,22],[41772,22]]},"822":{"position":[[14788,22]]},"824":{"position":[[13708,22]]},"826":{"position":[[15387,22],[21152,22],[26858,22],[32641,22],[38338,22]]},"844":{"position":[[12499,22],[24167,22],[29937,22],[43871,22]]},"846":{"position":[[4562,22],[11841,22]]},"848":{"position":[[50483,22],[56215,22]]}}}],["fga_client.clos",{"_index":479,"t":{"35":{"position":[[6180,18]]},"45":{"position":[[16494,18],[22688,18],[29159,18]]},"133":{"position":[[3116,18]]},"145":{"position":[[3116,18]]},"183":{"position":[[2999,18]]},"185":{"position":[[4128,18]]},"187":{"position":[[4689,18]]},"200":{"position":[[4414,18]]},"202":{"position":[[4326,18],[10076,18]]},"248":{"position":[[3116,18]]},"265":{"position":[[4596,18]]},"267":{"position":[[4420,18],[10014,18]]},"277":{"position":[[3088,18]]},"285":{"position":[[5619,18],[11478,18],[17293,18],[22901,18]]},"294":{"position":[[4673,18]]},"296":{"position":[[4372,18]]},"311":{"position":[[4494,18],[10078,18],[16511,18]]},"357":{"position":[[4523,18]]},"369":{"position":[[4468,18],[10075,18]]},"375":{"position":[[4859,18],[10763,18],[16577,18]]},"382":{"position":[[5438,18]]},"402":{"position":[[4512,18]]},"404":{"position":[[4423,18],[10263,18]]},"444":{"position":[[5109,18],[11210,18]]},"446":{"position":[[5341,18]]},"448":{"position":[[4304,18]]},"462":{"position":[[4477,18],[10108,18]]},"466":{"position":[[4440,18],[10239,18]]},"504":{"position":[[4445,18]]},"506":{"position":[[4687,18]]},"508":{"position":[[4496,18]]},"522":{"position":[[4787,18]]},"524":{"position":[[4616,18]]},"540":{"position":[[4460,18]]},"542":{"position":[[5024,18]]},"544":{"position":[[4562,18]]},"562":{"position":[[5159,18],[11138,18],[17133,18],[22825,18],[28448,18]]},"574":{"position":[[4761,18]]},"578":{"position":[[4756,18]]},"580":{"position":[[4554,18]]},"582":{"position":[[4272,18],[9786,18]]},"584":{"position":[[4413,18],[9849,18]]},"599":{"position":[[4461,18]]},"606":{"position":[[4906,18],[10983,18],[16994,18]]},"608":{"position":[[4755,18]]},"613":{"position":[[4619,18],[10531,18]]},"618":{"position":[[4839,18]]},"637":{"position":[[5037,18]]},"639":{"position":[[4439,18]]},"645":{"position":[[5128,18]]},"647":{"position":[[4344,18]]},"649":{"position":[[4627,18],[10386,18],[16028,18]]},"667":{"position":[[5595,18],[11767,18],[18597,18],[25425,18],[31664,18]]},"669":{"position":[[5571,18],[11829,18],[18167,18],[24490,18]]},"679":{"position":[[5288,18],[10903,18]]},"681":{"position":[[4657,18],[10305,18]]},"683":{"position":[[4711,18],[11053,18],[17318,18],[23228,18],[28885,18]]},"703":{"position":[[9269,18]]},"705":{"position":[[5744,18]]},"726":{"position":[[7398,18],[17129,18],[25056,18],[32477,18],[38239,18],[43865,18],[49510,18]]},"728":{"position":[[4522,18],[12429,18],[18373,18],[28788,18],[37009,18],[46544,18]]},"745":{"position":[[6166,18],[11740,18],[17540,18],[23071,18],[28700,18],[36431,18],[42057,18]]},"747":{"position":[[7451,18],[13905,18]]},"749":{"position":[[4712,18],[11049,18],[16662,18]]},"751":{"position":[[7658,18],[14123,18],[21721,18]]},"771":{"position":[[4849,18],[10509,18],[16760,18],[23305,18],[28998,18]]},"773":{"position":[[8074,18],[14642,18]]},"775":{"position":[[7505,18],[14753,18],[21808,18]]},"777":{"position":[[7955,18],[14515,18]]},"789":{"position":[[8707,18]]},"795":{"position":[[4645,18],[10345,18],[16360,18],[21971,18]]},"797":{"position":[[8748,18],[16109,18],[23848,18],[30047,18]]},"799":{"position":[[6210,18],[13300,18],[20229,18]]},"801":{"position":[[13755,18]]},"820":{"position":[[6176,18],[11774,18],[17584,18],[23108,18],[28732,18],[35948,18],[41569,18]]},"822":{"position":[[7617,18],[14582,18]]},"824":{"position":[[6949,18],[13504,18]]},"826":{"position":[[8410,18],[15177,18],[20941,18],[26644,18],[32430,18],[38127,18]]},"844":{"position":[[6583,18],[12291,18],[18294,18],[23959,18],[29723,18],[37020,18],[43663,18]]},"846":{"position":[[4360,18],[11639,18]]},"848":{"position":[[12045,18],[19235,18],[25879,18],[32458,18],[38702,18],[44538,18],[50284,18],[56000,18]]}}}],["fga_client.create_store(bodi",{"_index":580,"t":{"43":{"position":[[2698,29]]}}}],["fga_client.expand(bodi",{"_index":2170,"t":{"613":{"position":[[4804,23],[10716,23]]}}}],["fga_client.list_objects(bodi",{"_index":745,"t":{"45":{"position":[[29354,29]]},"147":{"position":[[1223,29]]},"618":{"position":[[5135,29]]}}}],["fga_client.read(bodi",{"_index":2148,"t":{"606":{"position":[[5030,21],[11088,21],[17109,21]]},"608":{"position":[[4879,21]]},"683":{"position":[[4779,21]]}}}],["fga_client.read_authorization_model",{"_index":478,"t":{"35":{"position":[[6135,38]]},"45":{"position":[[16449,38],[22643,38],[29114,38]]},"133":{"position":[[3071,38]]},"145":{"position":[[3071,38]]},"183":{"position":[[2937,38]]},"185":{"position":[[4066,38]]},"187":{"position":[[4627,38]]},"200":{"position":[[4369,38]]},"202":{"position":[[4281,38],[10031,38]]},"248":{"position":[[3071,38]]},"265":{"position":[[4551,38]]},"267":{"position":[[4375,38],[9969,38]]},"277":{"position":[[3043,38]]},"285":{"position":[[5574,38],[11433,38],[17248,38],[22856,38]]},"294":{"position":[[4628,38]]},"296":{"position":[[4327,38]]},"311":{"position":[[4449,38],[10033,38],[16466,38]]},"357":{"position":[[4478,38]]},"369":{"position":[[4423,38],[10030,38]]},"375":{"position":[[4814,38],[10718,38],[16532,38]]},"382":{"position":[[5393,38]]},"402":{"position":[[4467,38]]},"404":{"position":[[4378,38],[10218,38]]},"444":{"position":[[5064,38],[11165,38]]},"446":{"position":[[5296,38]]},"448":{"position":[[4259,38]]},"462":{"position":[[4432,38],[10063,38]]},"466":{"position":[[4395,38],[10194,38]]},"504":{"position":[[4400,38]]},"506":{"position":[[4642,38]]},"508":{"position":[[4451,38]]},"522":{"position":[[4742,38]]},"524":{"position":[[4571,38]]},"540":{"position":[[4415,38]]},"542":{"position":[[4979,38]]},"544":{"position":[[4517,38]]},"562":{"position":[[5114,38],[11093,38],[17088,38],[22780,38],[28403,38]]},"574":{"position":[[4716,38]]},"578":{"position":[[4711,38]]},"580":{"position":[[4509,38]]},"582":{"position":[[4227,38],[9741,38]]},"584":{"position":[[4368,38],[9804,38]]},"599":{"position":[[4416,38]]},"606":{"position":[[4861,38],[10938,38],[16949,38]]},"608":{"position":[[4710,38]]},"613":{"position":[[4574,38],[10486,38]]},"618":{"position":[[4794,38]]},"637":{"position":[[4992,38]]},"639":{"position":[[4394,38]]},"645":{"position":[[5083,38]]},"647":{"position":[[4299,38]]},"649":{"position":[[4582,38],[10341,38],[15983,38]]},"667":{"position":[[5550,38],[11722,38],[18552,38],[25380,38],[31619,38]]},"669":{"position":[[5526,38],[11784,38],[18122,38],[24445,38]]},"679":{"position":[[5243,38],[10858,38]]},"681":{"position":[[4612,38],[10260,38]]},"683":{"position":[[4666,38],[11008,38],[17273,38],[23183,38],[28840,38]]},"703":{"position":[[9224,38]]},"705":{"position":[[5699,38]]},"726":{"position":[[7353,38],[17084,38],[25011,38],[32432,38],[38194,38],[43820,38],[49465,38]]},"728":{"position":[[4477,38],[12384,38],[18328,38],[28743,38],[36964,38],[46499,38]]},"745":{"position":[[6121,38],[11695,38],[17495,38],[23026,38],[28655,38],[36386,38],[42012,38]]},"747":{"position":[[7406,38],[13860,38]]},"749":{"position":[[4667,38],[11004,38],[16617,38]]},"751":{"position":[[7613,38],[14078,38],[21676,38]]},"771":{"position":[[4804,38],[10464,38],[16715,38],[23260,38],[28953,38]]},"773":{"position":[[8029,38],[14597,38]]},"775":{"position":[[7460,38],[14708,38],[21763,38]]},"777":{"position":[[7910,38],[14470,38]]},"789":{"position":[[8662,38]]},"795":{"position":[[4600,38],[10300,38],[16315,38],[21926,38]]},"797":{"position":[[8703,38],[16064,38],[23803,38],[30002,38]]},"799":{"position":[[6165,38],[13255,38],[20184,38]]},"801":{"position":[[13710,38]]},"820":{"position":[[6131,38],[11729,38],[17539,38],[23063,38],[28687,38],[35903,38],[41524,38]]},"822":{"position":[[7572,38],[14537,38]]},"824":{"position":[[6904,38],[13459,38]]},"826":{"position":[[8365,38],[15132,38],[20896,38],[26599,38],[32385,38],[38082,38]]},"844":{"position":[[6538,38],[12246,38],[18249,38],[23914,38],[29678,38],[36975,38],[43618,38]]},"846":{"position":[[4315,38],[11594,38]]},"848":{"position":[[12000,38],[19190,38],[25834,38],[32413,38],[38657,38],[44493,38],[50239,38],[55955,38]]}}}],["fga_client.read_changes(bodi",{"_index":1546,"t":{"279":{"position":[[746,29],[2624,29]]},"281":{"position":[[1777,29],[3520,29]]}}}],["fga_client.write(bodi",{"_index":1305,"t":{"200":{"position":[[4649,22]]},"250":{"position":[[1210,22]]},"252":{"position":[[1371,22]]},"267":{"position":[[4652,22]]},"285":{"position":[[11749,22]]},"294":{"position":[[4909,22]]},"311":{"position":[[4720,22],[10307,22],[16917,22]]},"375":{"position":[[5152,22]]},"402":{"position":[[4759,22]]},"422":{"position":[[2402,22]]},"444":{"position":[[5517,22]]},"446":{"position":[[5859,22]]},"504":{"position":[[4678,22]]},"506":{"position":[[4999,22]]},"522":{"position":[[5071,22]]},"540":{"position":[[4695,22]]},"542":{"position":[[5335,22]]},"562":{"position":[[5537,22]]},"574":{"position":[[5057,22]]},"578":{"position":[[5048,22]]},"580":{"position":[[4788,22]]},"584":{"position":[[4641,22]]},"637":{"position":[[5387,22]]},"645":{"position":[[5586,22]]},"649":{"position":[[4934,22]]},"681":{"position":[[4942,22]]},"683":{"position":[[11374,22],[17642,22]]},"695":{"position":[[8017,22]]},"703":{"position":[[9571,22]]},"705":{"position":[[6076,22]]},"707":{"position":[[7556,22]]},"726":{"position":[[8522,22],[17766,22],[25623,22]]},"745":{"position":[[6408,22],[17782,22]]},"747":{"position":[[7930,22]]},"749":{"position":[[4978,22],[11346,22]]},"751":{"position":[[7994,22],[21985,22]]},"771":{"position":[[5090,22],[10754,22],[17168,22]]},"773":{"position":[[8545,22]]},"775":{"position":[[7844,22],[15307,22]]},"777":{"position":[[8366,22]]},"789":{"position":[[9494,22]]},"795":{"position":[[16660,22]]},"797":{"position":[[16795,22],[24280,22]]},"799":{"position":[[6699,22]]},"801":{"position":[[15870,22]]},"820":{"position":[[6421,22],[17825,22]]},"822":{"position":[[8207,22]]},"824":{"position":[[7398,22]]},"826":{"position":[[9041,22]]},"844":{"position":[[6882,22],[18593,22],[37587,22]]},"848":{"position":[[12530,22],[19603,22],[26301,22],[32796,22],[38973,22],[44792,22]]}}}],["fga_client_id=your_client_id",{"_index":1277,"t":{"187":{"position":[[5149,28]]}}}],["fga_client_instance.create_store(bodi",{"_index":583,"t":{"43":{"position":[[2845,38]]}}}],["fga_client_instance.write_authorization_model(json.loads(bodi",{"_index":484,"t":{"35":{"position":[[6786,63]]}}}],["fga_client_secret=your_client_secret",{"_index":1278,"t":{"187":{"position":[[5185,36]]}}}],["fga_model_id=your_model_id",{"_index":1221,"t":{"183":{"position":[[3258,26]]},"185":{"position":[[4387,26]]},"187":{"position":[[4948,26]]}}}],["fga_server_url",{"_index":377,"t":{"33":{"position":[[1435,14]]},"35":{"position":[[6920,14],[7009,14],[7502,14],[7591,14]]},"45":{"position":[[16759,14],[16848,14],[17084,14],[17173,14],[22953,14],[23042,14],[23278,14],[23367,14],[29461,14],[29550,14],[29822,14],[29911,14]]},"129":{"position":[[1544,14]]},"133":{"position":[[3139,14],[3256,14]]},"141":{"position":[[1544,14]]},"145":{"position":[[3139,14],[3256,14]]},"200":{"position":[[4685,14],[4774,14],[5219,14],[5308,14]]},"202":{"position":[[4588,14],[4677,14],[4910,14],[4999,14],[10340,14],[10429,14],[10664,14],[10753,14]]},"244":{"position":[[1400,14]]},"248":{"position":[[3139,14],[3256,14]]},"265":{"position":[[4848,14],[4937,14],[5160,14],[5249,14]]},"267":{"position":[[4688,14],[4777,14],[5217,14],[5306,14],[10267,14],[10356,14],[10580,14],[10669,14]]},"277":{"position":[[3139,14]]},"285":{"position":[[5877,14],[5966,14],[6195,14],[6284,14],[11785,14],[11874,14],[12317,14],[12406,14],[17555,14],[17644,14],[17877,14],[17966,14],[23165,14],[23254,14],[23489,14],[23578,14]]},"294":{"position":[[4945,14],[5034,14],[5478,14],[5567,14]]},"296":{"position":[[4635,14],[4724,14],[4958,14],[5047,14]]},"311":{"position":[[4756,14],[4845,14],[5281,14],[5370,14],[10343,14],[10432,14],[10869,14],[10958,14],[16953,14],[17042,14]]},"357":{"position":[[4793,14],[4882,14],[5123,14],[5212,14]]},"369":{"position":[[4731,14],[4820,14],[5054,14],[5143,14],[10337,14],[10426,14],[10659,14],[10748,14]]},"375":{"position":[[5188,14],[5277,14],[5727,14],[5816,14],[11026,14],[11115,14],[11349,14],[11438,14],[16840,14],[16929,14],[17163,14],[17252,14]]},"382":{"position":[[5698,14],[5787,14],[6018,14],[6107,14]]},"402":{"position":[[4795,14],[4884,14],[5341,14],[5430,14]]},"404":{"position":[[4693,14],[4782,14],[5023,14],[5112,14],[10534,14],[10623,14],[10865,14],[10954,14]]},"444":{"position":[[5553,14],[5642,14],[6166,14],[6255,14],[11475,14],[11564,14],[11800,14],[11889,14]]},"446":{"position":[[5895,14],[5984,14],[6544,14],[6633,14]]},"448":{"position":[[4569,14],[4658,14],[4894,14],[4983,14]]},"462":{"position":[[4743,14],[4832,14],[5069,14],[5158,14],[10373,14],[10462,14],[10698,14],[10787,14]]},"466":{"position":[[4707,14],[4796,14],[5034,14],[5123,14],[10506,14],[10595,14],[10833,14],[10922,14]]},"504":{"position":[[4714,14],[4803,14],[5246,14],[5335,14]]},"506":{"position":[[5035,14],[5124,14],[5585,14],[5674,14]]},"508":{"position":[[4766,14],[4855,14],[5096,14],[5185,14]]},"522":{"position":[[5107,14],[5196,14],[5647,14],[5736,14]]},"524":{"position":[[4882,14],[4971,14],[5208,14],[5297,14]]},"540":{"position":[[4731,14],[4820,14],[5265,14],[5354,14]]},"542":{"position":[[5371,14],[5460,14],[5928,14],[6017,14]]},"544":{"position":[[4834,14],[4923,14],[5166,14],[5255,14]]},"562":{"position":[[5573,14],[5662,14],[6168,14],[6257,14],[11401,14],[11490,14],[11724,14],[11813,14],[17396,14],[17485,14],[17719,14],[17808,14],[23090,14],[23179,14],[23415,14],[23504,14],[28712,14],[28801,14],[29036,14],[29125,14]]},"574":{"position":[[5093,14],[5182,14],[5677,14],[5766,14]]},"578":{"position":[[5084,14],[5173,14],[5664,14],[5753,14]]},"580":{"position":[[4824,14],[4913,14],[5357,14],[5446,14]]},"582":{"position":[[4523,14],[4612,14],[4834,14],[4923,14],[10037,14],[10126,14],[10348,14],[10437,14]]},"584":{"position":[[4677,14],[4766,14],[5202,14],[5291,14],[10101,14],[10190,14],[10413,14],[10502,14]]},"599":{"position":[[4722,14],[4811,14],[5043,14],[5132,14]]},"606":{"position":[[5224,14],[5313,14],[5497,14],[5586,14],[11282,14],[11371,14],[11537,14],[11626,14],[17303,14],[17392,14],[17568,14],[17657,14]]},"608":{"position":[[4955,14],[5044,14],[5228,14],[5317,14]]},"613":{"position":[[4883,14],[4972,14],[5195,14],[5284,14],[10795,14],[10884,14],[11107,14],[11196,14]]},"618":{"position":[[5242,14],[5331,14],[5658,14],[5747,14]]},"637":{"position":[[5423,14],[5512,14],[5972,14],[6061,14]]},"639":{"position":[[4712,14],[4801,14],[5045,14],[5134,14]]},"645":{"position":[[5622,14],[5711,14],[6253,14],[6342,14]]},"647":{"position":[[4609,14],[4698,14],[4934,14],[5023,14]]},"649":{"position":[[4970,14],[5059,14],[5525,14],[5614,14],[10652,14],[10741,14],[10978,14],[11067,14],[16297,14],[16386,14],[16626,14],[16715,14]]},"667":{"position":[[5857,14],[5946,14],[6179,14],[6268,14],[12029,14],[12118,14],[12351,14],[12440,14],[18862,14],[18951,14],[19187,14],[19276,14],[25687,14],[25776,14],[26009,14],[26098,14],[31927,14],[32016,14],[32250,14],[32339,14]]},"669":{"position":[[5834,14],[5923,14],[6157,14],[6246,14],[12095,14],[12184,14],[12421,14],[12510,14],[18431,14],[18520,14],[18755,14],[18844,14],[24754,14],[24843,14],[25078,14],[25167,14]]},"679":{"position":[[5552,14],[5641,14],[5876,14],[5965,14],[11166,14],[11255,14],[11489,14],[11578,14]]},"681":{"position":[[4978,14],[5067,14],[5518,14],[5607,14],[10572,14],[10661,14],[10899,14],[10988,14]]},"683":{"position":[[5097,14],[5186,14],[5317,14],[5406,14],[11410,14],[11499,14],[12019,14],[12108,14],[17678,14],[17767,14],[18288,14],[18377,14],[23492,14],[23581,14],[23816,14],[23905,14],[29147,14],[29236,14],[29469,14],[29558,14]]},"703":{"position":[[9607,14],[9696,14],[10151,14],[10240,14]]},"705":{"position":[[6112,14],[6201,14],[6657,14],[6746,14]]},"726":{"position":[[8558,14],[8647,14],[9503,14],[9592,14],[17802,14],[17891,14],[18500,14],[18589,14],[25659,14],[25748,14],[26342,14],[26431,14],[32740,14],[32829,14],[33063,14],[33152,14],[38503,14],[38592,14],[38827,14],[38916,14],[44132,14],[44221,14],[44459,14],[44548,14],[49778,14],[49867,14],[50106,14],[50195,14]]},"728":{"position":[[4786,14],[4875,14],[5110,14],[5199,14],[12689,14],[12778,14],[13009,14],[13098,14],[18642,14],[18731,14],[18971,14],[19060,14],[29056,14],[29145,14],[29384,14],[29473,14],[37268,14],[37357,14],[37587,14],[37676,14],[46803,14],[46892,14],[47122,14],[47211,14]]},"745":{"position":[[6444,14],[6533,14],[6985,14],[7074,14],[12005,14],[12094,14],[12330,14],[12419,14],[17818,14],[17907,14],[18359,14],[18448,14],[23336,14],[23425,14],[23661,14],[23750,14],[28966,14],[29055,14],[29292,14],[29381,14],[36696,14],[36785,14],[37021,14],[37110,14],[42322,14],[42411,14],[42647,14],[42736,14]]},"747":{"position":[[7966,14],[8055,14],[8608,14],[8697,14],[14172,14],[14261,14],[14499,14],[14588,14]]},"749":{"position":[[5014,14],[5103,14],[5579,14],[5668,14],[11382,14],[11471,14],[11926,14],[12015,14],[16927,14],[17016,14],[17252,14],[17341,14]]},"751":{"position":[[8030,14],[8119,14],[8654,14],[8743,14],[14392,14],[14481,14],[14721,14],[14810,14],[22021,14],[22110,14],[22584,14],[22673,14]]},"771":{"position":[[5126,14],[5215,14],[5666,14],[5755,14],[10790,14],[10879,14],[11334,14],[11423,14],[17204,14],[17293,14],[17889,14],[17978,14],[23569,14],[23658,14],[23893,14],[23982,14],[29260,14],[29349,14],[29582,14],[29671,14]]},"773":{"position":[[8581,14],[8670,14],[9318,14],[9407,14],[14909,14],[14998,14],[15236,14],[15325,14]]},"775":{"position":[[7880,14],[7969,14],[8507,14],[8596,14],[15343,14],[15432,14],[16163,14],[16252,14],[22069,14],[22158,14],[22390,14],[22479,14]]},"777":{"position":[[8402,14],[8491,14],[9090,14],[9179,14],[14781,14],[14870,14],[15107,14],[15196,14]]},"789":{"position":[[9530,14],[9619,14],[10313,14],[10402,14]]},"795":{"position":[[4905,14],[4994,14],[5225,14],[5314,14],[10609,14],[10698,14],[10933,14],[11022,14],[16696,14],[16785,14],[17242,14],[17331,14],[22232,14],[22321,14],[22553,14],[22642,14]]},"797":{"position":[[9004,14],[9093,14],[9320,14],[9409,14],[16831,14],[16920,14],[17576,14],[17665,14],[24316,14],[24405,14],[24928,14],[25017,14],[30307,14],[30396,14],[30627,14],[30716,14]]},"799":{"position":[[6735,14],[6824,14],[7348,14],[7437,14],[13748,14],[13837,14],[14166,14],[14255,14],[20678,14],[20767,14],[21097,14],[21186,14]]},"801":{"position":[[15906,14],[15995,14],[17388,14],[17477,14]]},"820":{"position":[[6457,14],[6546,14],[7001,14],[7090,14],[12042,14],[12131,14],[12370,14],[12459,14],[17861,14],[17950,14],[18401,14],[18490,14],[23372,14],[23461,14],[23696,14],[23785,14],[28998,14],[29087,14],[29324,14],[29413,14],[36212,14],[36301,14],[36536,14],[36625,14],[41834,14],[41923,14],[42159,14],[42248,14]]},"822":{"position":[[8243,14],[8332,14],[8984,14],[9073,14],[14850,14],[14939,14],[15178,14],[15267,14]]},"824":{"position":[[7434,14],[7523,14],[8064,14],[8153,14],[13775,14],[13864,14],[14106,14],[14195,14]]},"826":{"position":[[9077,14],[9166,14],[9795,14],[9884,14],[15449,14],[15538,14],[15781,14],[15870,14],[21215,14],[21304,14],[21549,14],[21638,14],[26920,14],[27009,14],[27256,14],[27345,14],[32704,14],[32793,14],[33038,14],[33127,14],[38401,14],[38490,14],[38735,14],[38824,14]]},"844":{"position":[[6918,14],[7007,14],[7464,14],[7553,14],[12561,14],[12650,14],[12891,14],[12980,14],[18629,14],[18718,14],[19175,14],[19264,14],[24229,14],[24318,14],[24559,14],[24648,14],[30000,14],[30089,14],[30337,14],[30426,14],[37623,14],[37712,14],[38318,14],[38407,14],[43933,14],[44022,14],[44263,14],[44352,14]]},"846":{"position":[[4625,14],[4714,14],[4950,14],[5039,14],[11903,14],[11992,14],[12227,14],[12316,14]]},"848":{"position":[[12566,14],[12655,14],[13328,14],[13417,14],[19639,14],[19728,14],[20193,14],[20282,14],[26337,14],[26426,14],[26941,14],[27030,14],[32832,14],[32921,14],[33458,14],[33547,14],[39009,14],[39098,14],[39579,14],[39668,14],[44828,14],[44917,14],[45381,14],[45470,14],[50546,14],[50635,14],[50868,14],[50957,14],[56277,14],[56366,14],[56614,14],[56703,14]]}}}],["fga_server_url/stores/$fga_store_id/author",{"_index":491,"t":{"35":{"position":[[7689,50]]}}}],["fga_server_url/stores/$fga_store_id/chang",{"_index":1547,"t":{"279":{"position":[[843,44],[2721,44]]},"281":{"position":[[1888,44],[3631,44]]}}}],["fga_server_url/stores/$fga_store_id/check",{"_index":721,"t":{"45":{"position":[[17271,42],[23465,42]]},"135":{"position":[[1287,42]]},"202":{"position":[[5097,42],[10851,42]]},"265":{"position":[[5347,42]]},"267":{"position":[[10767,42]]},"285":{"position":[[6382,42],[18064,42],[23676,42]]},"296":{"position":[[5145,42]]},"357":{"position":[[5310,42]]},"369":{"position":[[5241,42],[10846,42]]},"375":{"position":[[11536,42],[17350,42]]},"382":{"position":[[6205,42]]},"404":{"position":[[5210,42],[11052,42]]},"444":{"position":[[11987,42]]},"448":{"position":[[5081,42]]},"462":{"position":[[5256,42],[10885,42]]},"466":{"position":[[5221,42],[11020,42]]},"508":{"position":[[5283,42]]},"524":{"position":[[5395,42]]},"544":{"position":[[5353,42]]},"562":{"position":[[11911,42],[17906,42],[23602,42],[29223,42]]},"582":{"position":[[5021,42],[10535,42]]},"584":{"position":[[10600,42]]},"599":{"position":[[5230,42]]},"639":{"position":[[5232,42]]},"647":{"position":[[5121,42]]},"649":{"position":[[11165,42],[16813,42]]},"667":{"position":[[6366,42],[12538,42],[19374,42],[26196,42],[32437,42]]},"669":{"position":[[6344,42],[12608,42],[18942,42],[25265,42]]},"679":{"position":[[6063,42],[11676,42]]},"681":{"position":[[11086,42]]},"683":{"position":[[24003,42],[29656,42]]},"701":{"position":[[1453,42],[3294,42],[5143,42],[6994,42],[8841,42],[10694,42]]},"703":{"position":[[4036,42],[11921,42]]},"705":{"position":[[8992,42],[11668,42]]},"726":{"position":[[33250,42],[39014,42],[44646,42],[50293,42]]},"728":{"position":[[5297,42],[13196,42],[19158,42],[29571,42],[37774,42],[47309,42]]},"745":{"position":[[12517,42],[23848,42],[29479,42],[37208,42],[42834,42]]},"747":{"position":[[14686,42]]},"749":{"position":[[17439,42]]},"751":{"position":[[14908,42]]},"771":{"position":[[24080,42],[29769,42]]},"773":{"position":[[15423,42]]},"775":{"position":[[22577,42]]},"777":{"position":[[15294,42]]},"795":{"position":[[5412,42],[11120,42],[22740,42]]},"797":{"position":[[9507,42],[30814,42]]},"799":{"position":[[14353,42],[21284,42]]},"820":{"position":[[12557,42],[23883,42],[29511,42],[36723,42],[42346,42]]},"822":{"position":[[15365,42]]},"824":{"position":[[14293,42]]},"826":{"position":[[15968,42],[21736,42],[27443,42],[33225,42],[38922,42]]},"844":{"position":[[13078,42],[24746,42],[30524,42],[44450,42]]},"846":{"position":[[5137,42],[12414,42]]},"848":{"position":[[51055,42],[56801,42]]}}}],["fga_server_url/stores/$fga_store_id/expand",{"_index":2172,"t":{"613":{"position":[[5382,43],[11294,43]]}}}],["fga_server_url/stores/$fga_store_id/list",{"_index":746,"t":{"45":{"position":[[30009,41]]},"147":{"position":[[1522,41]]},"618":{"position":[[5845,41]]}}}],["fga_server_url/stores/$fga_store_id/read",{"_index":2150,"t":{"606":{"position":[[5684,41],[11724,41],[17755,41]]},"608":{"position":[[5415,41]]},"683":{"position":[[5504,41]]}}}],["fga_server_url/stores/$fga_store_id/writ",{"_index":1306,"t":{"200":{"position":[[4872,42]]},"250":{"position":[[1365,42]]},"252":{"position":[[1488,42]]},"267":{"position":[[4875,42]]},"285":{"position":[[11972,42]]},"294":{"position":[[5132,42]]},"311":{"position":[[4943,42],[10530,42],[17140,42]]},"375":{"position":[[5375,42]]},"402":{"position":[[4982,42]]},"422":{"position":[[2447,42]]},"444":{"position":[[5740,42]]},"446":{"position":[[6082,42]]},"504":{"position":[[4901,42]]},"506":{"position":[[5222,42]]},"522":{"position":[[5294,42]]},"540":{"position":[[4918,42]]},"542":{"position":[[5558,42]]},"562":{"position":[[5760,42]]},"574":{"position":[[5280,42]]},"578":{"position":[[5271,42]]},"580":{"position":[[5011,42]]},"584":{"position":[[4864,42]]},"637":{"position":[[5610,42]]},"645":{"position":[[5809,42]]},"649":{"position":[[5157,42]]},"681":{"position":[[5165,42]]},"683":{"position":[[11597,42],[17865,42]]},"695":{"position":[[8062,42]]},"703":{"position":[[9794,42]]},"705":{"position":[[6299,42]]},"707":{"position":[[7601,42]]},"726":{"position":[[8745,42],[17989,42],[25846,42]]},"745":{"position":[[6631,42],[18005,42]]},"747":{"position":[[8153,42]]},"749":{"position":[[5201,42],[11569,42]]},"751":{"position":[[8217,42],[22208,42]]},"771":{"position":[[5313,42],[10977,42],[17391,42]]},"773":{"position":[[8768,42]]},"775":{"position":[[8067,42],[15530,42]]},"777":{"position":[[8589,42]]},"789":{"position":[[9717,42]]},"795":{"position":[[16883,42]]},"797":{"position":[[17018,42],[24503,42]]},"799":{"position":[[6922,42]]},"801":{"position":[[16093,42]]},"820":{"position":[[6644,42],[18048,42]]},"822":{"position":[[8430,42]]},"824":{"position":[[7621,42]]},"826":{"position":[[9264,42]]},"844":{"position":[[7105,42],[18816,42],[37810,42]]},"848":{"position":[[12753,42],[19826,42],[26524,42],[33019,42],[39196,42],[45015,42]]}}}],["fga_server_url=https://api.fga.exampl",{"_index":1218,"t":{"183":{"position":[[3044,38]]},"185":{"position":[[4173,38]]},"187":{"position":[[4734,38]]}}}],["fga_store_id",{"_index":372,"t":{"33":{"position":[[116,13],[262,12],[402,13],[548,12],[688,13],[834,12],[974,13],[1120,12],[1260,13],[1418,12],[1560,13],[1661,12]]},"129":{"position":[[116,13],[299,12],[439,13],[622,12],[762,13],[945,12],[1085,13],[1268,12],[1408,13],[1527,12],[1669,13],[1824,12]]},"141":{"position":[[116,13],[299,12],[439,13],[622,12],[762,13],[945,12],[1085,13],[1268,12],[1408,13],[1527,12],[1669,13],[1824,12]]},"165":{"position":[[95,13],[336,12],[459,13],[700,12]]},"244":{"position":[[116,13],[263,12],[403,13],[550,12],[690,13],[837,12],[977,13],[1124,12],[1264,13],[1383,12],[1525,13],[1644,12]]},"273":{"position":[[112,13],[294,12],[434,13],[616,12],[756,13],[903,12],[1043,13],[1190,12],[1330,13],[1484,12]]}}}],["fga_store_id=$(fga",{"_index":592,"t":{"43":{"position":[[3116,18]]}}}],["fga_store_id=your_store_id",{"_index":1220,"t":{"183":{"position":[[3136,26]]},"185":{"position":[[4265,26]]},"187":{"position":[[4826,26]]}}}],["fgaclient",{"_index":400,"t":{"35":{"position":[[991,9],[2163,10],[4583,9]]},"43":{"position":[[569,10],[2125,9]]},"45":{"position":[[12546,9],[13382,10],[15271,9],[18740,9],[19576,10],[21465,9],[25094,9],[25951,10],[27894,9]]},"133":{"position":[[264,9],[797,10],[2272,9]]},"145":{"position":[[264,9],[797,10],[2272,9]]},"173":{"position":[[1146,9],[4542,10]]},"183":{"position":[[808,10],[2211,9]]},"185":{"position":[[1297,10],[3114,9]]},"187":{"position":[[1322,10],[3504,9]]},"200":{"position":[[377,9],[1168,10],[3167,9]]},"202":{"position":[[387,9],[1220,10],[3106,9],[6131,9],[6966,10],[8854,9]]},"248":{"position":[[264,9],[797,10],[2272,9]]},"265":{"position":[[687,9],[1510,10],[3386,9]]},"267":{"position":[[398,9],[1184,10],[3178,9],[6102,9],[6926,10],[8803,9]]},"277":{"position":[[236,9],[769,10],[2244,9]]},"285":{"position":[[1692,9],[2521,10],[4403,9],[7330,9],[8158,10],[10194,9],[13354,9],[14187,10],[16073,9],[18956,9],[19791,10],[21679,9]]},"294":{"position":[[639,9],[1429,10],[3427,9]]},"296":{"position":[[430,9],[1264,10],[3151,9]]},"311":{"position":[[484,9],[1266,10],[3256,9],[6065,9],[6848,10],[8839,9],[11879,9],[12831,10],[15066,9]]},"357":{"position":[[560,9],[1401,10],[3295,9]]},"369":{"position":[[526,9],[1360,10],[3247,9],[6136,9],[6969,10],[8855,9]]},"375":{"position":[[645,9],[1495,10],[3553,9],[6821,9],[7655,10],[9542,9],[12635,9],[13469,10],[15356,9]]},"382":{"position":[[1505,9],[2336,10],[4220,9]]},"402":{"position":[[439,9],[1242,10],[3253,9]]},"404":{"position":[[460,9],[1301,10],[3195,9],[6297,9],[7139,10],[9034,9]]},"444":{"position":[[508,9],[1464,10],[3687,9],[7262,9],[8098,10],[9987,9]]},"446":{"position":[[410,9],[1476,10],[3809,9]]},"448":{"position":[[356,9],[1192,10],[3081,9]]},"462":{"position":[[526,9],[1363,10],[3253,9],[6160,9],[6996,10],[8885,9]]},"466":{"position":[[486,9],[1324,10],[3215,9],[6285,9],[7123,10],[9014,9]]},"504":{"position":[[414,9],[1203,10],[3200,9]]},"506":{"position":[[416,9],[1285,10],[3362,9]]},"508":{"position":[[533,9],[1374,10],[3268,9]]},"522":{"position":[[600,9],[1441,10],[3490,9]]},"524":{"position":[[665,9],[1502,10],[3392,9]]},"540":{"position":[[423,9],[1214,10],[3213,9]]},"542":{"position":[[756,9],[1624,10],[3700,9]]},"544":{"position":[[593,9],[1436,10],[3332,9]]},"562":{"position":[[648,9],[1574,10],[3767,9],[7196,9],[8030,10],[9917,9],[13191,9],[14025,10],[15912,9],[18877,9],[19713,10],[21602,9],[24503,9],[25338,10],[27226,9]]},"574":{"position":[[502,9],[1344,10],[3453,9]]},"578":{"position":[[509,9],[1347,10],[3452,9]]},"580":{"position":[[520,9],[1310,10],[3308,9]]},"582":{"position":[[366,9],[1188,10],[3063,9],[5880,9],[6702,10],[8577,9]]},"584":{"position":[[403,9],[1185,10],[3175,9],[5940,9],[6763,10],[8639,9]]},"599":{"position":[[525,9],[1357,10],[3242,9]]},"606":{"position":[[775,9],[1652,10],[3634,9],[6931,9],[7789,10],[9732,9],[12912,9],[13780,10],[15733,9]]},"608":{"position":[[978,9],[1737,10],[3601,9]]},"613":{"position":[[516,9],[1387,10],[3338,9],[6428,9],[7299,10],[9250,9]]},"618":{"position":[[437,9],[1401,10],[3453,9]]},"637":{"position":[[652,9],[1559,10],[3674,9]]},"639":{"position":[[467,9],[1311,10],[3208,9]]},"645":{"position":[[377,9],[1383,10],[3656,9]]},"647":{"position":[[396,9],[1232,10],[3121,9]]},"649":{"position":[[377,9],[1239,10],[3309,9],[6435,9],[7272,10],[9162,9],[12068,9],[12908,10],[14801,9]]},"667":{"position":[[1656,9],[2489,10],[4375,9],[7828,9],[8661,10],[10547,9],[14649,9],[15485,10],[17374,9],[21486,9],[22319,10],[24205,9],[27722,9],[28556,10],[30443,9]]},"669":{"position":[[1629,9],[2463,10],[4350,9],[7878,9],[8715,10],[10605,9],[14222,9],[15057,10],[16945,9],[20545,9],[21380,10],[23268,9]]},"679":{"position":[[1343,9],[2178,10],[4066,9],[6961,9],[7795,10],[9682,9]]},"681":{"position":[[467,9],[1309,10],[3359,9],[6351,9],[7189,10],[9080,9]]},"683":{"position":[[442,9],[1387,10],[3377,9],[6719,9],[7586,10],[9720,9],[12981,9],[13849,10],[15984,9],[19283,9],[20118,10],[22006,9],[24946,9],[25779,10],[27665,9]]},"703":{"position":[[5028,9],[5887,10],[7954,9]]},"705":{"position":[[1419,9],[2306,10],[4401,9]]},"726":{"position":[[481,9],[2117,10],[5256,9],[11799,9],[12975,10],[15477,9],[19936,9],[21042,10],[23474,9],[28535,9],[29369,10],[31256,9],[34294,9],[35129,10],[37017,9],[39911,9],[40749,10],[42640,9],[45553,9],[46392,10],[48284,9]]},"728":{"position":[[577,9],[1412,10],[3300,9],[8496,9],[9327,10],[11211,9],[14413,9],[15253,10],[17146,9],[24831,9],[25670,10],[27562,9],[33079,9],[33909,10],[35792,9],[42614,9],[43444,10],[45327,9]]},"745":{"position":[[2108,9],[2906,10],[4912,9],[7792,9],[8628,10],[10517,9],[13482,9],[14280,10],[16286,9],[19123,9],[19959,10],[21848,9],[24749,9],[25586,10],[27476,9],[32483,9],[33319,10],[35208,9],[38109,9],[38945,10],[40834,9]]},"747":{"position":[[2637,9],[3664,10],[5958,9],[9951,9],[10789,10],[12680,9]]},"749":{"position":[[582,9],[1404,10],[3434,9],[6823,9],[7677,10],[9739,9],[12714,9],[13550,10],[15439,9]]},"751":{"position":[[3279,9],[4161,10],[6310,9],[10163,9],[11003,10],[12896,9],[17597,9],[18417,10],[20445,9]]},"771":{"position":[[794,9],[1591,10],[3596,9],[6442,9],[7243,10],[9252,9],[12126,9],[13070,10],[15340,9],[19360,9],[20195,10],[22083,9],[25059,9],[25892,10],[27778,9]]},"773":{"position":[[3212,9],[4209,10],[6591,9],[10688,9],[11526,10],[13417,9]]},"775":{"position":[[3117,9],[4002,10],[6154,9],[9642,9],[10722,10],[13187,9],[17872,9],[18704,10],[20589,9]]},"777":{"position":[[3312,9],[4259,10],[6532,9],[10564,9],[11401,10],[13291,9]]},"789":{"position":[[2885,9],[4202,10],[6904,9]]},"795":{"position":[[712,9],[1543,10],[3427,9],[6400,9],[7235,10],[9123,9],[12125,9],[12982,10],[15047,9],[18035,9],[18867,10],[20752,9]]},"797":{"position":[[4827,9],[5654,10],[7534,9],[10632,9],[11857,10],[14408,9],[19175,9],[20155,10],[22402,9],[26114,9],[26945,10],[28829,9]]},"799":{"position":[[1372,9],[2407,10],[4709,9],[8809,9],[9809,10],[11881,9],[15735,9],[16736,10],[18809,9]]},"801":{"position":[[3613,9],[6186,10],[10616,9]]},"820":{"position":[[2109,9],[2910,10],[4919,9],[7817,9],[8656,10],[10548,9],[13529,9],[14326,10],[16331,9],[19163,9],[19998,10],[21886,9],[24781,9],[25618,10],[27508,9],[32003,9],[32838,10],[34726,9],[37621,9],[38457,10],[40346,9]]},"822":{"position":[[2392,9],[3510,10],[6013,9],[10625,9],[11464,10],[13356,9]]},"824":{"position":[[2225,9],[3222,10],[5486,9],[9538,9],[10380,10],[12275,9]]},"826":{"position":[[3098,9],[4268,10],[6764,9],[11208,9],[12051,10],[13947,9],[16966,9],[17811,10],[19709,9],[22663,9],[23510,10],[25410,9],[28455,9],[29300,10],[31198,9],[34152,9],[34997,10],[36895,9]]},"844":{"position":[[2351,9],[3207,10],[5271,9],[8328,9],[9169,10],[11063,9],[14062,9],[14918,10],[16982,9],[19996,9],[20837,10],[22731,9],[25739,9],[26587,10],[28488,9],[31900,9],[33006,10],[35438,9],[39700,9],[40541,10],[42435,9]]},"846":{"position":[[412,9],[1248,10],[3137,9],[7694,9],[8529,10],[10417,9]]},"848":{"position":[[7180,9],[8201,10],[10548,9],[14796,9],[15721,10],[17854,9],[21239,9],[22208,10],[24444,9],[28073,9],[28957,10],[31108,9],[34557,9],[35384,10],[37419,9],[40444,9],[41254,10],[43272,9],[46345,9],[47178,10],[49064,9],[52016,9],[52864,10],[54765,9]]}}}],["fgaclient.check",{"_index":707,"t":{"45":{"position":[[12969,17],[19163,17]]},"135":{"position":[[152,17]]},"173":{"position":[[1376,17]]},"202":{"position":[[810,17],[6554,17]]},"265":{"position":[[1110,17]]},"267":{"position":[[6525,17]]},"285":{"position":[[2115,17],[13777,17],[19379,17]]},"296":{"position":[[853,17]]},"357":{"position":[[983,17]]},"369":{"position":[[949,17],[6559,17]]},"375":{"position":[[7244,17],[13058,17]]},"382":{"position":[[1928,17]]},"404":{"position":[[883,17],[6720,17]]},"444":{"position":[[7685,17]]},"448":{"position":[[779,17]]},"462":{"position":[[949,17],[6583,17]]},"466":{"position":[[909,17],[6708,17]]},"508":{"position":[[956,17]]},"524":{"position":[[1088,17]]},"544":{"position":[[1016,17]]},"562":{"position":[[7619,17],[13614,17],[19300,17],[24926,17]]},"582":{"position":[[789,17],[6303,17]]},"584":{"position":[[6363,17]]},"599":{"position":[[948,17]]},"639":{"position":[[890,17]]},"647":{"position":[[819,17]]},"649":{"position":[[6858,17],[12491,17]]},"667":{"position":[[2079,17],[8251,17],[15072,17],[21909,17],[28145,17]]},"669":{"position":[[2052,17],[8301,17],[14645,17],[20968,17]]},"679":{"position":[[1766,17],[7384,17]]},"681":{"position":[[6774,17]]},"683":{"position":[[19706,17],[25369,17]]},"701":{"position":[[313,17],[2144,17],[4003,17],[5839,17],[7696,17],[9539,17]]},"703":{"position":[[2891,17],[10781,17]]},"705":{"position":[[7335,17],[10006,17]]},"726":{"position":[[28958,17],[34717,17],[40334,17],[45976,17]]},"728":{"position":[[1000,17],[8919,17],[14836,17],[25254,17],[33502,17],[43037,17]]},"745":{"position":[[8215,17],[19546,17],[25172,17],[32906,17],[38532,17]]},"747":{"position":[[10374,17]]},"749":{"position":[[13137,17]]},"751":{"position":[[10586,17]]},"771":{"position":[[19783,17],[25482,17]]},"773":{"position":[[11111,17]]},"775":{"position":[[18295,17]]},"777":{"position":[[10987,17]]},"795":{"position":[[1135,17],[6823,17],[18458,17]]},"797":{"position":[[5250,17],[26537,17]]},"799":{"position":[[9232,17],[16158,17]]},"820":{"position":[[8240,17],[19586,17],[25204,17],[32426,17],[38044,17]]},"822":{"position":[[11048,17]]},"824":{"position":[[9961,17]]},"826":{"position":[[11631,17],[17389,17],[23086,17],[28878,17],[34575,17]]},"844":{"position":[[8751,17],[20419,17],[26162,17],[40123,17]]},"846":{"position":[[835,17],[8117,17]]},"848":{"position":[[46768,17],[52439,17]]}}}],["fgaclient.check(bodi",{"_index":712,"t":{"45":{"position":[[15551,21],[21745,21]]},"135":{"position":[[846,21]]},"202":{"position":[[3383,21],[9132,21]]},"265":{"position":[[3653,21]]},"267":{"position":[[9070,21]]},"285":{"position":[[4675,21],[16350,21],[21957,21]]},"296":{"position":[[3428,21]]},"357":{"position":[[3580,21]]},"369":{"position":[[3525,21],[9132,21]]},"375":{"position":[[9819,21],[15634,21]]},"382":{"position":[[4495,21]]},"404":{"position":[[3480,21],[9319,21]]},"444":{"position":[[10267,21]]},"448":{"position":[[3361,21]]},"462":{"position":[[3534,21],[9165,21]]},"466":{"position":[[3497,21],[9295,21]]},"508":{"position":[[3553,21]]},"524":{"position":[[3673,21]]},"544":{"position":[[3619,21]]},"562":{"position":[[10195,21],[16189,21],[21882,21],[27505,21]]},"582":{"position":[[3329,21],[8843,21]]},"584":{"position":[[8905,21]]},"599":{"position":[[3518,21]]},"639":{"position":[[3496,21]]},"647":{"position":[[3401,21]]},"649":{"position":[[9442,21],[15085,21]]},"667":{"position":[[4652,21],[10824,21],[17654,21],[24482,21],[30721,21]]},"669":{"position":[[4627,21],[10885,21],[17223,21],[23547,21]]},"679":{"position":[[4345,21],[9960,21]]},"681":{"position":[[9362,21]]},"683":{"position":[[22285,21],[27941,21]]},"701":{"position":[[1010,21],[2847,21],[4700,21],[6544,21],[8395,21],[10244,21]]},"703":{"position":[[3590,21],[11478,21]]},"705":{"position":[[8377,21],[11050,21]]},"726":{"position":[[31534,21],[37295,21],[42922,21],[48567,21]]},"728":{"position":[[3574,21],[11485,21],[17429,21],[27845,21],[36066,21],[45601,21]]},"745":{"position":[[10797,21],[22128,21],[27756,21],[35488,21],[41114,21]]},"747":{"position":[[12962,21]]},"749":{"position":[[15719,21]]},"751":{"position":[[13175,21]]},"771":{"position":[[22362,21],[28054,21]]},"773":{"position":[[13699,21]]},"775":{"position":[[20865,21]]},"777":{"position":[[13571,21]]},"795":{"position":[[3702,21],[9402,21],[21027,21]]},"797":{"position":[[7804,21],[29104,21]]},"799":{"position":[[12357,21],[19285,21]]},"820":{"position":[[10831,21],[22165,21],[27788,21],[35005,21],[40626,21]]},"822":{"position":[[13639,21]]},"824":{"position":[[12556,21]]},"826":{"position":[[14234,21],[19997,21],[25701,21],[31486,21],[37183,21]]},"844":{"position":[[11348,21],[23016,21],[28779,21],[42720,21]]},"846":{"position":[[3416,21],[10696,21]]},"848":{"position":[[49340,21],[55057,21]]}}}],["fgaclient.check(context.background()).body(body).options(options).execut",{"_index":711,"t":{"45":{"position":[[14167,75],[20361,75]]},"135":{"position":[[522,75]]},"202":{"position":[[2002,75],[7749,75]]},"265":{"position":[[2282,75]]},"267":{"position":[[7698,75]]},"285":{"position":[[3298,75],[14969,75],[20574,75]]},"296":{"position":[[2046,75]]},"357":{"position":[[2191,75]]},"369":{"position":[[2143,75],[7751,75]]},"375":{"position":[[8437,75],[14252,75]]},"382":{"position":[[3116,75]]},"404":{"position":[[2091,75],[7929,75]]},"444":{"position":[[8883,75]]},"448":{"position":[[1977,75]]},"462":{"position":[[2149,75],[7781,75]]},"466":{"position":[[2111,75],[7909,75]]},"508":{"position":[[2164,75]]},"524":{"position":[[2288,75]]},"544":{"position":[[2228,75]]},"562":{"position":[[8813,75],[14807,75],[20498,75],[26122,75]]},"582":{"position":[[1959,75],[7473,75]]},"584":{"position":[[7534,75]]},"599":{"position":[[2138,75]]},"639":{"position":[[2104,75]]},"647":{"position":[[2017,75]]},"649":{"position":[[8057,75],[13697,75]]},"667":{"position":[[3271,75],[9443,75],[16270,75],[23101,75],[29339,75]]},"669":{"position":[[3245,75],[9500,75],[15840,75],[22164,75]]},"679":{"position":[[2962,75],[8578,75]]},"681":{"position":[[7976,75]]},"683":{"position":[[20902,75],[26560,75]]},"701":{"position":[[685,75],[2520,75],[4375,75],[6216,75],[8069,75],[9916,75]]},"703":{"position":[[3264,75],[11153,75]]},"705":{"position":[[7923,75],[10595,75]]},"726":{"position":[[30152,75],[35912,75],[41536,75],[47180,75]]},"728":{"position":[[2191,75],[10106,75],[16041,75],[26458,75],[34688,75],[44223,75]]},"745":{"position":[[9413,75],[20744,75],[26371,75],[34104,75],[39730,75]]},"747":{"position":[[11576,75]]},"749":{"position":[[14335,75]]},"751":{"position":[[11787,75]]},"771":{"position":[[20979,75],[26673,75]]},"773":{"position":[[12313,75]]},"775":{"position":[[19485,75]]},"777":{"position":[[12186,75]]},"795":{"position":[[2323,75],[8019,75],[19647,75]]},"797":{"position":[[6429,75],[27725,75]]},"799":{"position":[[10777,75],[17704,75]]},"820":{"position":[[9444,75],[20782,75],[26403,75],[33622,75],[39242,75]]},"822":{"position":[[12252,75]]},"824":{"position":[[11166,75]]},"826":{"position":[[12843,75],[18604,75],[24306,75],[30093,75],[35790,75]]},"844":{"position":[[9959,75],[21627,75],[27383,75],[41331,75]]},"846":{"position":[[2032,75],[9313,75]]},"848":{"position":[[47959,75],[53661,75]]}}}],["fgaclient.clientwriterequest",{"_index":1293,"t":{"200":{"position":[[1847,29]]},"250":{"position":[[370,29]]},"252":{"position":[[526,29]]},"267":{"position":[[1863,29]]},"285":{"position":[[8837,29]]},"294":{"position":[[2108,29]]},"311":{"position":[[1945,29],[7527,29],[13510,29]]},"375":{"position":[[2174,29]]},"402":{"position":[[1921,29]]},"422":{"position":[[1511,29]]},"444":{"position":[[2143,29]]},"446":{"position":[[2155,29]]},"504":{"position":[[1882,29]]},"506":{"position":[[1964,29]]},"522":{"position":[[2120,29]]},"540":{"position":[[1893,29]]},"542":{"position":[[2303,29]]},"562":{"position":[[2253,29]]},"574":{"position":[[2023,29]]},"578":{"position":[[2026,29]]},"580":{"position":[[1989,29]]},"584":{"position":[[1864,29]]},"637":{"position":[[2238,29]]},"645":{"position":[[2062,29]]},"649":{"position":[[1918,29]]},"681":{"position":[[1988,29]]},"683":{"position":[[8265,29],[14528,29]]},"695":{"position":[[4286,29]]},"703":{"position":[[6566,29]]},"705":{"position":[[2985,29]]},"707":{"position":[[3825,29]]},"726":{"position":[[2796,29],[13654,29],[21721,29]]},"745":{"position":[[3585,29],[14959,29]]},"747":{"position":[[4343,29]]},"749":{"position":[[2083,29],[8356,29]]},"751":{"position":[[4840,29],[19096,29]]},"771":{"position":[[2270,29],[7922,29],[13749,29]]},"773":{"position":[[4888,29]]},"775":{"position":[[4681,29],[11401,29]]},"777":{"position":[[4938,29]]},"789":{"position":[[4881,29]]},"795":{"position":[[13661,29]]},"797":{"position":[[12536,29],[20834,29]]},"799":{"position":[[3086,29]]},"801":{"position":[[6865,29]]},"820":{"position":[[3589,29],[15005,29]]},"822":{"position":[[4189,29]]},"824":{"position":[[3901,29]]},"826":{"position":[[4947,29]]},"844":{"position":[[3886,29],[15597,29],[33685,29]]},"848":{"position":[[8880,29],[16400,29],[22887,29],[29636,29],[36063,29],[41933,29]]}}}],["fgaclient.createstore(context.background()).body(clientcreatestorerequest{nam",{"_index":571,"t":{"43":{"position":[[1164,79]]}}}],["fgaclient.createstore(new",{"_index":575,"t":{"43":{"position":[[2189,25]]}}}],["fgaclient.expand",{"_index":2165,"t":{"613":{"position":[[921,18],[6833,18]]}}}],["fgaclient.expand(bodi",{"_index":2169,"t":{"613":{"position":[[3674,22],[9586,22]]}}}],["fgaclient.expand(context.background()).body(requestbody).options(options).execut",{"_index":2168,"t":{"613":{"position":[[2231,83],[8143,83]]}}}],["fgaclient.listobject",{"_index":733,"t":{"45":{"position":[[25499,23]]},"147":{"position":[[129,23]]},"618":{"position":[[842,23]]}}}],["fgaclient.listobjects(bodi",{"_index":743,"t":{"45":{"position":[[28172,27]]},"147":{"position":[[944,27]]},"618":{"position":[[3852,27]]}}}],["fgaclient.listobjects(context.background",{"_index":739,"t":{"45":{"position":[[26734,44]]},"147":{"position":[[556,44]]},"618":{"position":[[2293,44]]}}}],["fgaclient.openfga.check(context.background()).body(body).execut",{"_index":1208,"t":{"173":{"position":[[5351,66]]}}}],["fgaclient.openfgaclient.writeauthorizationmodel(context.background()).body(body).execut",{"_index":443,"t":{"35":{"position":[[3394,90]]}}}],["fgaclient.read",{"_index":2132,"t":{"606":{"position":[[1200,16],[7356,16],[13337,16]]},"608":{"position":[[1403,16]]},"683":{"position":[[867,16]]}}}],["fgaclient.read(bodi",{"_index":2144,"t":{"606":{"position":[[3846,20],[9923,20],[15934,20]]},"608":{"position":[[3813,20]]},"683":{"position":[[3527,20]]}}}],["fgaclient.read(context.background()).body(requestbody).options(options).execut",{"_index":2143,"t":{"606":{"position":[[2407,81],[8505,81],[14506,81]]},"608":{"position":[[2492,81]]},"683":{"position":[[2026,81]]}}}],["fgaclient.readchang",{"_index":1539,"t":{"279":{"position":[[164,23],[1664,23]]},"281":{"position":[[1155,23],[2520,23]]}}}],["fgaclient.readchanges(bodi",{"_index":1544,"t":{"279":{"position":[[598,27],[2356,27]]},"281":{"position":[[1621,27],[3244,27]]}}}],["fgaclient.readchanges(context.background()).body(body).options(options).execut",{"_index":1543,"t":{"279":{"position":[[350,81],[1988,81]]},"281":{"position":[[1357,81],[2860,81]]}}}],["fgaclient.writ",{"_index":1291,"t":{"200":{"position":[[765,17]]},"250":{"position":[[99,17]]},"252":{"position":[[254,17]]},"267":{"position":[[786,17]]},"285":{"position":[[7718,17]]},"294":{"position":[[1027,17]]},"311":{"position":[[872,17],[6453,17],[12267,17]]},"375":{"position":[[1033,17]]},"402":{"position":[[827,17]]},"422":{"position":[[1223,17]]},"444":{"position":[[896,17]]},"446":{"position":[[798,17]]},"504":{"position":[[802,17]]},"506":{"position":[[804,17]]},"522":{"position":[[988,17]]},"540":{"position":[[811,17]]},"542":{"position":[[1144,17]]},"562":{"position":[[1036,17]]},"574":{"position":[[890,17]]},"578":{"position":[[897,17]]},"580":{"position":[[908,17]]},"584":{"position":[[791,17]]},"637":{"position":[[1040,17]]},"645":{"position":[[765,17]]},"649":{"position":[[765,17]]},"681":{"position":[[855,17]]},"683":{"position":[[7107,17],[13369,17]]},"695":{"position":[[3207,17]]},"703":{"position":[[5416,17]]},"705":{"position":[[1807,17]]},"707":{"position":[[2746,17]]},"726":{"position":[[869,17],[12187,17],[20324,17]]},"745":{"position":[[2496,17],[13870,17]]},"747":{"position":[[3025,17]]},"749":{"position":[[970,17],[7211,17]]},"751":{"position":[[3667,17],[17985,17]]},"771":{"position":[[1182,17],[6830,17],[12514,17]]},"773":{"position":[[3600,17]]},"775":{"position":[[3505,17],[10030,17]]},"777":{"position":[[3700,17]]},"789":{"position":[[3273,17]]},"795":{"position":[[12513,17]]},"797":{"position":[[11020,17],[19563,17]]},"799":{"position":[[1760,17]]},"801":{"position":[[4001,17]]},"820":{"position":[[2497,17],[13917,17]]},"822":{"position":[[2780,17]]},"824":{"position":[[2613,17]]},"826":{"position":[[3486,17]]},"844":{"position":[[2739,17],[14450,17],[32288,17]]},"848":{"position":[[7568,17],[15184,17],[21627,17],[28461,17],[34945,17],[40832,17]]}}}],["fgaclient.write(bodi",{"_index":1301,"t":{"200":{"position":[[3498,21]]},"250":{"position":[[965,21]]},"252":{"position":[[1123,21]]},"267":{"position":[[3504,21]]},"285":{"position":[[10562,21]]},"294":{"position":[[3757,21]]},"311":{"position":[[3578,21],[9162,21],[15595,21]]},"375":{"position":[[3943,21]]},"402":{"position":[[3596,21]]},"422":{"position":[[2140,21]]},"444":{"position":[[4193,21]]},"446":{"position":[[4425,21]]},"504":{"position":[[3529,21]]},"506":{"position":[[3771,21]]},"522":{"position":[[3871,21]]},"540":{"position":[[3544,21]]},"542":{"position":[[4108,21]]},"562":{"position":[[4243,21]]},"574":{"position":[[3845,21]]},"578":{"position":[[3840,21]]},"580":{"position":[[3638,21]]},"584":{"position":[[3497,21]]},"637":{"position":[[4121,21]]},"645":{"position":[[4212,21]]},"649":{"position":[[3711,21]]},"681":{"position":[[3741,21]]},"683":{"position":[[10137,21],[16402,21]]},"695":{"position":[[6911,21]]},"703":{"position":[[8353,21]]},"705":{"position":[[4828,21]]},"707":{"position":[[6450,21]]},"726":{"position":[[6482,21],[16213,21],[24140,21]]},"745":{"position":[[5250,21],[16624,21]]},"747":{"position":[[6535,21]]},"749":{"position":[[3796,21],[10133,21]]},"751":{"position":[[6742,21],[20805,21]]},"771":{"position":[[3933,21],[9593,21],[15844,21]]},"773":{"position":[[7158,21]]},"775":{"position":[[6589,21],[13837,21]]},"777":{"position":[[7039,21]]},"789":{"position":[[7791,21]]},"795":{"position":[[15444,21]]},"797":{"position":[[15193,21],[22932,21]]},"799":{"position":[[5294,21]]},"801":{"position":[[12839,21]]},"820":{"position":[[5260,21],[16668,21]]},"822":{"position":[[6701,21]]},"824":{"position":[[6033,21]]},"826":{"position":[[7494,21]]},"844":{"position":[[5667,21],[17378,21],[36104,21]]},"848":{"position":[[11129,21],[18319,21],[24963,21],[31542,21],[37786,21],[43622,21]]}}}],["fgaclient.write(context.background()).body(requestbody).options(options).execut",{"_index":1298,"t":{"200":{"position":[[2047,82]]},"250":{"position":[[567,82]]},"252":{"position":[[724,82]]},"267":{"position":[[2058,82]]},"285":{"position":[[9074,82]]},"294":{"position":[[2307,82]]},"311":{"position":[[2136,82],[7719,82],[13946,82]]},"375":{"position":[[2433,82]]},"402":{"position":[[2133,82]]},"422":{"position":[[1725,82]]},"444":{"position":[[2567,82]]},"446":{"position":[[2689,82]]},"504":{"position":[[2080,82]]},"506":{"position":[[2242,82]]},"522":{"position":[[2370,82]]},"540":{"position":[[2093,82]]},"542":{"position":[[2580,82]]},"562":{"position":[[2647,82]]},"574":{"position":[[2333,82]]},"578":{"position":[[2332,82]]},"580":{"position":[[2188,82]]},"584":{"position":[[2055,82]]},"637":{"position":[[2554,82]]},"645":{"position":[[2536,82]]},"649":{"position":[[2189,82]]},"681":{"position":[[2239,82]]},"683":{"position":[[8600,82],[14864,82]]},"695":{"position":[[5645,82]]},"703":{"position":[[6834,82]]},"705":{"position":[[3281,82]]},"707":{"position":[[5184,82]]},"726":{"position":[[4136,82],[14357,82],[22354,82]]},"745":{"position":[[3792,82],[15166,82]]},"747":{"position":[[4838,82]]},"749":{"position":[[2314,82],[8619,82]]},"751":{"position":[[5190,82],[19325,82]]},"771":{"position":[[2476,82],[8132,82],[14220,82]]},"773":{"position":[[5471,82]]},"775":{"position":[[5034,82],[12067,82]]},"777":{"position":[[5412,82]]},"789":{"position":[[5784,82]]},"795":{"position":[[13927,82]]},"797":{"position":[[13288,82],[21282,82]]},"799":{"position":[[3589,82]]},"801":{"position":[[9496,82]]},"820":{"position":[[3799,82],[15211,82]]},"822":{"position":[[4893,82]]},"824":{"position":[[4366,82]]},"826":{"position":[[5644,82]]},"844":{"position":[[4151,82],[15862,82],[34318,82]]},"848":{"position":[[9428,82],[16734,82],[23324,82],[29988,82],[36299,82],[42152,82]]}}}],["fgaclient.writeauthorizationmodel",{"_index":419,"t":{"35":{"position":[[1418,35]]}}}],["fgaclient.writeauthorizationmodel(bodi",{"_index":463,"t":{"35":{"position":[[5190,40]]}}}],["fiber",{"_index":1074,"t":{"163":{"position":[[93,6]]},"169":{"position":[[973,5],[1089,5]]}}}],["fiber.ctx",{"_index":1109,"t":{"169":{"position":[[1535,11]]},"171":{"position":[[2367,11]]},"173":{"position":[[3677,11],[3887,11],[4522,11]]}}}],["fiber.new",{"_index":1105,"t":{"169":{"position":[[1456,11]]},"171":{"position":[[1967,11]]},"173":{"position":[[3208,11]]}}}],["fiber.newerror(fiber.statusserviceunavail",{"_index":1203,"t":{"173":{"position":[[5110,46],[5441,46]]}}}],["fiber.newerror(fiber.statusunauthor",{"_index":1210,"t":{"173":{"position":[[5556,40]]}}}],["field",{"_index":758,"t":{"45":{"position":[[32211,6]]},"107":{"position":[[258,5],[365,5]]},"135":{"position":[[1658,5]]},"212":{"position":[[3074,6]]},"408":{"position":[[439,5],[861,5]]},"522":{"position":[[6287,6],[6379,6],[6635,6]]},"807":{"position":[[908,5]]}}}],["figur",{"_index":1963,"t":{"482":{"position":[[1890,6]]},"728":{"position":[[22763,6]]}}}],["file",{"_index":194,"t":{"7":{"position":[[721,4]]},"169":{"position":[[536,4]]},"189":{"position":[[502,4]]},"210":{"position":[[56,5],[228,4],[734,5]]},"212":{"position":[[1556,4],[4203,4]]},"214":{"position":[[578,4],[635,4],[1355,5],[2012,4],[2069,4],[2880,5]]},"224":{"position":[[199,4]]},"317":{"position":[[407,6]]},"528":{"position":[[520,4]]},"813":{"position":[[61,5]]},"822":{"position":[[35,4]]},"824":{"position":[[51,6]]},"826":{"position":[[50,4]]}}}],["filter",{"_index":232,"t":{"9":{"position":[[991,6]]},"317":{"position":[[286,6],[502,9],[651,7]]},"321":{"position":[[4,7],[46,6],[148,6],[212,8]]},"323":{"position":[[586,6]]},"325":{"position":[[96,6],[314,8]]},"327":{"position":[[1336,6]]},"418":{"position":[[2052,6]]},"616":{"position":[[247,9]]},"622":{"position":[[435,6]]},"683":{"position":[[6253,6]]}}}],["final",{"_index":1138,"t":{"171":{"position":[[1097,8]]},"173":{"position":[[1960,8]]},"212":{"position":[[1272,8],[2835,7],[3939,8],[5463,7]]},"327":{"position":[[748,5]]},"386":{"position":[[770,5]]},"440":{"position":[[873,8]]},"683":{"position":[[12643,8]]},"707":{"position":[[0,5]]},"775":{"position":[[17345,9]]},"801":{"position":[[0,5]]}}}],["find",{"_index":913,"t":{"113":{"position":[[85,4],[213,4]]},"386":{"position":[[1248,7],[1427,5]]},"416":{"position":[[3254,4]]},"478":{"position":[[156,4]]},"620":{"position":[[347,7]]},"728":{"position":[[6576,4],[30225,4]]},"771":{"position":[[18897,4]]},"777":{"position":[[2823,4]]}}}],["fine",{"_index":253,"t":{"13":{"position":[[37,4]]},"15":{"position":[[38,4]]},"19":{"position":[[0,4]]},"153":{"position":[[391,4]]},"175":{"position":[[173,4]]},"317":{"position":[[19,4]]},"548":{"position":[[1108,4],[1432,4]]},"779":{"position":[[37,4]]},"850":{"position":[[201,4],[672,4]]}}}],["finish",{"_index":1925,"t":{"478":{"position":[[1945,9]]},"486":{"position":[[137,9]]}}}],["first",{"_index":865,"t":{"103":{"position":[[176,5]]},"169":{"position":[[4,5]]},"173":{"position":[[11,6]]},"181":{"position":[[76,5]]},"212":{"position":[[539,5],[3322,5]]},"214":{"position":[[1763,5]]},"236":{"position":[[270,5]]},"277":{"position":[[0,5]]},"327":{"position":[[3647,5]]},"357":{"position":[[6081,5]]},"371":{"position":[[61,5]]},"375":{"position":[[18228,5]]},"404":{"position":[[11834,5]]},"464":{"position":[[4,5]]},"470":{"position":[[91,6]]},"478":{"position":[[2096,7],[2142,6]]},"504":{"position":[[5822,5]]},"514":{"position":[[1739,5]]},"544":{"position":[[6319,5]]},"562":{"position":[[30374,5]]},"613":{"position":[[212,5]]},"635":{"position":[[61,5]]},"639":{"position":[[6432,5]]},"705":{"position":[[991,6]]},"713":{"position":[[813,5]]},"726":{"position":[[28053,6]]},"745":{"position":[[30093,5]]},"757":{"position":[[856,5]]},"771":{"position":[[396,5],[18881,6]]},"777":{"position":[[2517,6]]},"799":{"position":[[544,5],[902,6]]},"820":{"position":[[30125,5]]},"826":{"position":[[440,6]]},"848":{"position":[[45976,6]]}}}],["fit",{"_index":1650,"t":{"329":{"position":[[461,3]]},"428":{"position":[[272,3]]}}}],["five",{"_index":780,"t":{"83":{"position":[[3939,4]]}}}],["flag",{"_index":1032,"t":{"155":{"position":[[545,4]]},"218":{"position":[[272,5],[529,5]]},"222":{"position":[[112,4],[433,6],[503,4],[1083,5],[1254,5]]},"226":{"position":[[316,4],[539,4]]},"228":{"position":[[315,4],[463,4],[616,4]]},"230":{"position":[[90,6]]},"424":{"position":[[302,4],[597,4],[1146,5]]}}}],["flatten",{"_index":842,"t":{"97":{"position":[[120,10]]}}}],["flatten/expand",{"_index":1624,"t":{"323":{"position":[[229,14]]}}}],["flattened/expand",{"_index":1626,"t":{"323":{"position":[[452,18]]}}}],["flexibl",{"_index":36,"t":{"3":{"position":[[501,8]]},"380":{"position":[[334,11]]}}}],["flight",{"_index":1065,"t":{"155":{"position":[[2500,6]]}}}],["flow",{"_index":1244,"t":{"187":{"position":[[64,5]]},"643":{"position":[[1923,4]]}}}],["focu",{"_index":1730,"t":{"390":{"position":[[29,5]]},"482":{"position":[[3223,5]]},"717":{"position":[[716,5]]},"738":{"position":[[295,5]]},"769":{"position":[[341,5]]},"771":{"position":[[402,5]]},"813":{"position":[[339,5]]},"820":{"position":[[25,5]]},"836":{"position":[[678,5]]},"838":{"position":[[19,5]]},"844":{"position":[[26,5]]}}}],["focus",{"_index":2382,"t":{"719":{"position":[[58,8],[273,8]]},"740":{"position":[[95,8]]},"815":{"position":[[101,8]]}}}],["folder",{"_index":32,"t":{"3":{"position":[[462,7],[696,8]]},"19":{"position":[[429,8]]},"23":{"position":[[188,7]]},"83":{"position":[[225,6],[353,8],[648,8],[1054,9],[2116,8],[3438,8],[3765,6],[3892,6]]},"89":{"position":[[326,6],[426,8],[565,9],[722,9],[1129,8],[1421,7],[2054,6],[2103,6],[2124,6],[2290,6],[2884,7],[2929,7]]},"97":{"position":[[804,6],[2663,7],[2688,6]]},"179":{"position":[[455,6]]},"281":{"position":[[136,6],[487,9],[1012,7],[1092,9],[1332,9],[1525,8],[1868,6],[2085,8],[2361,9],[2835,9],[3028,8],[3611,6],[3828,8]]},"327":{"position":[[2818,7]]},"333":{"position":[[555,7]]},"412":{"position":[[174,6],[525,6],[665,6],[1596,6],[1628,8],[1720,8],[2071,9],[2401,8],[2909,8]]},"416":{"position":[[439,7],[849,7],[938,6],[1049,8],[1416,6],[1448,8],[1554,8],[1882,9],[2212,8],[2763,8],[3155,6],[3369,6]]},"422":{"position":[[913,6]]},"454":{"position":[[2492,7]]},"456":{"position":[[80,7]]},"476":{"position":[[1437,6],[1525,6],[1561,7],[1573,6],[1631,6],[1643,6],[1679,7],[1700,6],[1732,7],[1976,6],[2060,7],[2506,6],[2541,7],[2721,6],[2757,7],[2807,6],[2821,7],[2856,7]]},"478":{"position":[[416,6],[574,6],[662,6],[698,7],[726,6],[738,6],[774,7],[1018,6],[1102,7],[1546,6],[1581,7],[1761,6],[1797,7],[1847,6],[1861,7],[1896,7],[2318,6],[2406,6],[2442,7],[2454,6],[2512,6],[2524,6],[2560,7],[2581,6],[2613,6],[2858,6],[2942,7],[3388,6],[3423,7],[3603,6],[3639,7],[3689,6],[3703,7],[3738,7],[3969,6],[4150,6]]},"480":{"position":[[809,6],[897,6],[933,7],[945,6],[1003,6],[1015,6],[1051,7],[1072,6],[1104,7],[1348,6],[1432,7],[1878,6],[1913,7],[2093,6],[2129,7],[2179,6],[2193,7],[2228,7],[2341,6],[3044,6]]},"482":{"position":[[2204,6],[5459,6],[5673,8],[5789,6],[6154,8],[6294,6],[6608,7],[7169,6],[7964,6],[9650,8],[10243,8]]},"484":{"position":[[1386,6]]},"486":{"position":[[51,6]]},"490":{"position":[[194,6],[239,6]]},"492":{"position":[[228,6],[369,6],[533,9]]},"498":{"position":[[23,7],[98,7],[149,7],[174,6],[303,6],[408,6]]},"500":{"position":[[37,6],[210,6],[351,6],[429,8],[539,9],[871,8]]},"502":{"position":[[37,6],[155,6],[233,8],[365,9],[836,8],[1141,6]]},"506":{"position":[[845,6],[2036,6],[3603,6],[4844,6],[5909,6]]},"508":{"position":[[6250,6]]},"510":{"position":[[245,7],[309,7]]},"626":{"position":[[127,6]]},"628":{"position":[[255,6],[393,6],[680,9]]},"635":{"position":[[20,6],[214,8],[250,6],[533,8],[634,9]]},"637":{"position":[[82,6],[1129,8],[2358,8],[3963,8],[5242,8],[6343,8]]},"807":{"position":[[1256,6],[1304,7]]},"809":{"position":[[671,6]]},"813":{"position":[[71,8]]},"815":{"position":[[275,7],[346,6],[401,6],[422,7]]},"817":{"position":[[351,7]]},"824":{"position":[[39,7],[83,7],[290,6]]},"826":{"position":[[58,6]]}}}],["folder#view",{"_index":810,"t":{"89":{"position":[[365,14]]}}}],["folder,folder#par",{"_index":1801,"t":{"422":{"position":[[945,22]]}}}],["folder/dr",{"_index":1919,"t":{"476":{"position":[[1908,12],[2190,12],[2344,12]]},"478":{"position":[[950,12],[1230,12],[1384,12],[2790,12],[3072,12],[3226,12]]},"480":{"position":[[1280,12],[1562,12],[1716,12]]},"482":{"position":[[8309,12],[8787,12]]}}}],["folder:budget",{"_index":2199,"t":{"637":{"position":[[184,14],[1177,17],[4018,17],[6228,14]]},"639":{"position":[[121,14],[914,17],[2016,17],[3397,17],[4966,14],[5614,17],[5653,16],[5980,14],[6119,14]]}}}],["folder:not",{"_index":2008,"t":{"498":{"position":[[527,13],[626,12],[688,12]]},"504":{"position":[[108,12],[878,16],[3485,14],[5518,12]]},"506":{"position":[[29,13],[68,12],[902,15],[3667,15],[5841,12]]},"508":{"position":[[6160,12],[6173,12]]}}}],["folder:plan",{"_index":814,"t":{"89":{"position":[[2169,18],[2352,18]]},"422":{"position":[[1312,19],[2093,17],[2915,15]]}}}],["folder:planning#editor",{"_index":682,"t":{"45":{"position":[[8446,22],[8967,22]]}}}],["folder:product\",\"relation\":\"viewer\",\"object\":\"document:roadmap",{"_index":683,"t":{"45":{"position":[[8507,65]]}}}],["folder:product#par",{"_index":1802,"t":{"422":{"position":[[1259,24],[2038,24],[2886,21]]}}}],["folder:sal",{"_index":1759,"t":{"412":{"position":[[542,15],[736,15]]},"416":{"position":[[176,15],[513,15],[3226,15]]}}}],["folder:{id",{"_index":1978,"t":{"482":{"position":[[6368,14]]}}}],["folder’",{"_index":1776,"t":{"416":{"position":[[1152,8]]}}}],["follow",{"_index":80,"t":{"3":{"position":[[1251,9],[1748,9],[1962,9],[2411,9]]},"7":{"position":[[291,9]]},"9":{"position":[[448,9]]},"27":{"position":[[4,9]]},"35":{"position":[[54,9]]},"37":{"position":[[19,9]]},"45":{"position":[[3037,7],[5814,10],[7714,9],[10468,9],[11308,9],[11809,9],[12128,9],[18353,9],[24688,9],[31948,9]]},"79":{"position":[[10,9]]},"85":{"position":[[1910,9]]},"87":{"position":[[1405,9]]},"89":{"position":[[1981,9]]},"91":{"position":[[598,9]]},"93":{"position":[[675,9],[1526,9]]},"95":{"position":[[913,9],[1561,9]]},"97":{"position":[[1784,10]]},"99":{"position":[[10,9]]},"109":{"position":[[976,10]]},"137":{"position":[[19,9]]},"149":{"position":[[19,9]]},"151":{"position":[[4,9]]},"155":{"position":[[65,8],[474,9]]},"157":{"position":[[10,9]]},"161":{"position":[[0,6]]},"169":{"position":[[155,9],[1022,9]]},"175":{"position":[[19,9]]},"181":{"position":[[133,9]]},"187":{"position":[[164,6]]},"189":{"position":[[478,9]]},"191":{"position":[[177,9],[932,10]]},"204":{"position":[[10,9]]},"208":{"position":[[58,6]]},"210":{"position":[[789,8]]},"214":{"position":[[1400,9],[2920,9]]},"222":{"position":[[389,9]]},"230":{"position":[[80,9]]},"232":{"position":[[10,9]]},"234":{"position":[[4,9]]},"236":{"position":[[319,6]]},"238":{"position":[[228,9]]},"240":{"position":[[10,9]]},"254":{"position":[[10,9]]},"258":{"position":[[177,9],[617,10]]},"265":{"position":[[118,8]]},"269":{"position":[[10,9]]},"281":{"position":[[21,9]]},"285":{"position":[[177,9],[1035,9]]},"298":{"position":[[10,9]]},"302":{"position":[[177,9],[311,8],[469,9],[784,10],[841,11],[931,11],[1124,10]]},"311":{"position":[[11579,10],[12305,9],[13579,9],[15304,9],[16665,9],[17593,9]]},"313":{"position":[[137,9],[185,9],[242,8],[295,11],[346,8]]},"315":{"position":[[10,9]]},"327":{"position":[[67,9],[296,9]]},"335":{"position":[[170,6]]},"347":{"position":[[875,9],[1064,10]]},"355":{"position":[[155,10]]},"357":{"position":[[256,10],[6138,6]]},"359":{"position":[[10,9]]},"361":{"position":[[415,9]]},"363":{"position":[[1079,9],[1562,10]]},"377":{"position":[[10,9]]},"382":{"position":[[12,9],[665,9]]},"384":{"position":[[12,9]]},"386":{"position":[[916,9]]},"388":{"position":[[8,9]]},"396":{"position":[[177,9],[760,10]]},"402":{"position":[[135,10]]},"404":{"position":[[106,10],[5857,10],[11891,6]]},"406":{"position":[[10,9]]},"410":{"position":[[225,9]]},"412":{"position":[[14,9]]},"416":{"position":[[26,9],[3073,9]]},"426":{"position":[[11,9]]},"430":{"position":[[350,9],[1063,10]]},"440":{"position":[[1027,9]]},"444":{"position":[[206,8],[6943,9]]},"450":{"position":[[10,9]]},"454":{"position":[[1523,9],[2370,10]]},"468":{"position":[[10,9]]},"478":{"position":[[4623,9]]},"482":{"position":[[2458,9],[4978,9],[6963,9],[7241,9],[8153,9],[8422,9],[8635,9],[8900,9],[9089,9],[9271,9]]},"484":{"position":[[2366,6],[3725,6]]},"488":{"position":[[10,9]]},"492":{"position":[[177,9],[901,10]]},"500":{"position":[[112,9]]},"502":{"position":[[103,10]]},"504":{"position":[[5874,6]]},"508":{"position":[[175,9]]},"510":{"position":[[10,9]]},"514":{"position":[[177,9],[671,10],[1796,6]]},"522":{"position":[[6298,9],[6646,9]]},"526":{"position":[[10,9]]},"528":{"position":[[496,9]]},"530":{"position":[[177,9],[648,10]]},"538":{"position":[[119,9]]},"542":{"position":[[350,9]]},"544":{"position":[[289,10],[6376,6]]},"546":{"position":[[10,9]]},"550":{"position":[[177,9],[760,10]]},"558":{"position":[[59,10]]},"560":{"position":[[56,10],[731,10]]},"562":{"position":[[12552,9],[12881,9],[29887,9],[30431,6]]},"564":{"position":[[10,9]]},"568":{"position":[[177,9],[601,10]]},"576":{"position":[[66,8]]},"578":{"position":[[94,9]]},"586":{"position":[[10,9]]},"590":{"position":[[177,9],[1072,10]]},"601":{"position":[[124,9]]},"606":{"position":[[6622,9],[12603,9]]},"608":{"position":[[456,9]]},"618":{"position":[[6641,9]]},"628":{"position":[[10,6],[879,10]]},"639":{"position":[[106,10],[6489,6]]},"643":{"position":[[1755,9]]},"645":{"position":[[53,9]]},"651":{"position":[[10,9]]},"655":{"position":[[158,10]]},"667":{"position":[[20453,9]]},"671":{"position":[[10,9]]},"675":{"position":[[45,9]]},"677":{"position":[[237,9]]},"687":{"position":[[11,9]]},"691":{"position":[[3,6]]},"695":{"position":[[58,9],[834,9],[3127,9]]},"701":{"position":[[187,9]]},"703":{"position":[[2790,9]]},"705":{"position":[[9660,9],[12337,9],[12536,9]]},"709":{"position":[[10,9]]},"721":{"position":[[8,9]]},"726":{"position":[[179,8],[11497,8],[19634,8],[27694,7]]},"728":{"position":[[8134,9],[24455,9],[32724,9],[38909,9],[39994,9],[40237,9]]},"742":{"position":[[18,9]]},"745":{"position":[[113,9],[251,9]]},"747":{"position":[[192,9],[2313,9]]},"749":{"position":[[6366,8],[18089,9]]},"751":{"position":[[439,9],[16807,10]]},"765":{"position":[[8,9],[119,9],[182,9],[662,7]]},"775":{"position":[[9307,9],[23189,9]]},"777":{"position":[[20,9],[2988,9]]},"785":{"position":[[3,6]]},"789":{"position":[[58,9],[492,9],[2561,9]]},"795":{"position":[[298,9]]},"797":{"position":[[4517,9],[18831,9]]},"799":{"position":[[15101,9],[22033,9]]},"805":{"position":[[10,9]]},"817":{"position":[[18,9]]},"820":{"position":[[200,9],[336,9],[31506,10]]},"822":{"position":[[170,9]]},"824":{"position":[[243,9],[1902,9],[16238,10]]},"826":{"position":[[2774,9]]},"828":{"position":[[19,9]]},"838":{"position":[[32,9]]},"840":{"position":[[8,9],[119,9],[199,9],[1113,7]]},"844":{"position":[[197,9],[537,9],[45097,11]]},"846":{"position":[[6172,9]]},"848":{"position":[[1588,9],[2776,9],[14473,9],[57465,9]]}}}],["followed_bi",{"_index":1595,"t":{"302":{"position":[[324,11],[493,12],[869,14],[1002,14]]},"313":{"position":[[399,14]]}}}],["fore",{"_index":2595,"t":{"771":{"position":[[30402,4]]}}}],["foreign",{"_index":1937,"t":{"480":{"position":[[483,7]]}}}],["forget",{"_index":1899,"t":{"472":{"position":[[81,6]]}}}],["form",{"_index":808,"t":{"89":{"position":[[8,4]]},"386":{"position":[[855,4]]},"482":{"position":[[1335,5],[1448,4]]},"484":{"position":[[865,6]]},"508":{"position":[[6581,4]]},"637":{"position":[[335,4]]},"848":{"position":[[14461,4]]}}}],["format",{"_index":783,"t":{"85":{"position":[[177,8]]},"226":{"position":[[55,6]]},"228":{"position":[[51,7]]},"230":{"position":[[103,7],[124,7],[163,7]]},"418":{"position":[[1774,7],[2462,7]]},"478":{"position":[[2088,7]]},"482":{"position":[[4050,6]]},"542":{"position":[[55,7]]},"747":{"position":[[9526,9]]},"822":{"position":[[10194,9]]}}}],["former",{"_index":2215,"t":{"643":{"position":[[1702,6]]}}}],["forth",{"_index":2493,"t":{"740":{"position":[[336,6]]}}}],["forward",{"_index":2482,"t":{"728":{"position":[[22358,7]]}}}],["found",{"_index":2188,"t":{"620":{"position":[[36,5]]},"667":{"position":[[20397,6]]},"751":{"position":[[15561,5]]},"824":{"position":[[14952,5]]}}}],["four",{"_index":671,"t":{"45":{"position":[[7343,4]]},"83":{"position":[[3728,4]]},"820":{"position":[[106,4]]},"844":{"position":[[92,4]]}}}],["fp",{"_index":1113,"t":{"171":{"position":[[252,2]]},"173":{"position":[[223,2],[846,2]]}}}],["fp(async",{"_index":1115,"t":{"171":{"position":[[301,8]]},"173":{"position":[[272,8],[998,8]]}}}],["framework",{"_index":360,"t":{"29":{"position":[[829,9],[877,10]]},"163":{"position":[[63,10]]},"167":{"position":[[74,10]]},"169":{"position":[[33,10],[112,10],[213,9],[564,9],[979,10],[1095,9]]}}}],["fred",{"_index":2262,"t":{"669":{"position":[[1093,4],[1253,4],[7020,4]]}}}],["free",{"_index":2383,"t":{"719":{"position":[[107,7],[361,4],[398,4]]},"721":{"position":[[178,4]]},"726":{"position":[[904,4],[2862,4],[5491,4],[7549,4],[10451,4],[12275,4],[13773,4],[15765,4],[17333,4],[19113,4]]}}}],["frequent",{"_index":985,"t":{"153":{"position":[[495,11],[1633,11]]},"442":{"position":[[59,11]]}}}],["friend",{"_index":1932,"t":{"478":{"position":[[4533,6],[4736,7]]}}}],["friendli",{"_index":500,"t":{"35":{"position":[[8430,8]]}}}],["frontend",{"_index":2381,"t":{"717":{"position":[[455,8]]}}}],["full",{"_index":2163,"t":{"611":{"position":[[187,4]]},"775":{"position":[[740,4]]}}}],["func",{"_index":424,"t":{"35":{"position":[[2065,4]]},"43":{"position":[[555,4]]},"45":{"position":[[13284,4],[19478,4],[25853,4]]},"113":{"position":[[403,4]]},"133":{"position":[[699,4]]},"145":{"position":[[699,4]]},"169":{"position":[[1435,4],[1523,4]]},"171":{"position":[[1946,4],[2355,4]]},"173":{"position":[[3187,4],[3665,4],[3867,4],[4496,4]]},"183":{"position":[[794,4]]},"185":{"position":[[1283,4]]},"187":{"position":[[1308,4]]},"200":{"position":[[1070,4]]},"202":{"position":[[1122,4],[6868,4]]},"248":{"position":[[699,4]]},"265":{"position":[[1412,4]]},"267":{"position":[[1086,4],[6828,4]]},"277":{"position":[[671,4]]},"285":{"position":[[2423,4],[8060,4],[14089,4],[19693,4]]},"294":{"position":[[1331,4]]},"296":{"position":[[1166,4]]},"311":{"position":[[1168,4],[6750,4],[12733,4]]},"357":{"position":[[1303,4]]},"369":{"position":[[1262,4],[6871,4]]},"375":{"position":[[1397,4],[7557,4],[13371,4]]},"382":{"position":[[2238,4]]},"402":{"position":[[1144,4]]},"404":{"position":[[1203,4],[7041,4]]},"444":{"position":[[1366,4],[8000,4]]},"446":{"position":[[1378,4]]},"448":{"position":[[1094,4]]},"462":{"position":[[1265,4],[6898,4]]},"466":{"position":[[1226,4],[7025,4]]},"504":{"position":[[1105,4]]},"506":{"position":[[1187,4]]},"508":{"position":[[1276,4]]},"522":{"position":[[1343,4]]},"524":{"position":[[1404,4]]},"540":{"position":[[1116,4]]},"542":{"position":[[1526,4]]},"544":{"position":[[1338,4]]},"562":{"position":[[1476,4],[7932,4],[13927,4],[19615,4],[25240,4]]},"574":{"position":[[1246,4]]},"578":{"position":[[1249,4]]},"580":{"position":[[1212,4]]},"582":{"position":[[1090,4],[6604,4]]},"584":{"position":[[1087,4],[6665,4]]},"599":{"position":[[1259,4]]},"606":{"position":[[1554,4],[7691,4],[13682,4]]},"608":{"position":[[1639,4]]},"613":{"position":[[1289,4],[7201,4]]},"618":{"position":[[1303,4]]},"637":{"position":[[1461,4]]},"639":{"position":[[1213,4]]},"645":{"position":[[1285,4]]},"647":{"position":[[1134,4]]},"649":{"position":[[1141,4],[7174,4],[12810,4]]},"667":{"position":[[2391,4],[8563,4],[15387,4],[22221,4],[28458,4]]},"669":{"position":[[2365,4],[8617,4],[14959,4],[21282,4]]},"679":{"position":[[2080,4],[7697,4]]},"681":{"position":[[1211,4],[7091,4]]},"683":{"position":[[1289,4],[7488,4],[13751,4],[20020,4],[25681,4]]},"703":{"position":[[5789,4]]},"705":{"position":[[2208,4]]},"726":{"position":[[2019,4],[12877,4],[20944,4],[29271,4],[35031,4],[40651,4],[46294,4]]},"728":{"position":[[1314,4],[9229,4],[15155,4],[25572,4],[33811,4],[43346,4]]},"745":{"position":[[2808,4],[8530,4],[14182,4],[19861,4],[25488,4],[33221,4],[38847,4]]},"747":{"position":[[3566,4],[10691,4]]},"749":{"position":[[1306,4],[7579,4],[13452,4]]},"751":{"position":[[4063,4],[10905,4],[18319,4]]},"771":{"position":[[1493,4],[7145,4],[12972,4],[20097,4],[25794,4]]},"773":{"position":[[4111,4],[11428,4]]},"775":{"position":[[3904,4],[10624,4],[18606,4]]},"777":{"position":[[4161,4],[11303,4]]},"789":{"position":[[4104,4]]},"795":{"position":[[1445,4],[7137,4],[12884,4],[18769,4]]},"797":{"position":[[5556,4],[11759,4],[20057,4],[26847,4]]},"799":{"position":[[2309,4],[9711,4],[16638,4]]},"801":{"position":[[6088,4]]},"820":{"position":[[2812,4],[8558,4],[14228,4],[19900,4],[25520,4],[32740,4],[38359,4]]},"822":{"position":[[3412,4],[11366,4]]},"824":{"position":[[3124,4],[10282,4]]},"826":{"position":[[4170,4],[11953,4],[17713,4],[23412,4],[29202,4],[34899,4]]},"844":{"position":[[3109,4],[9071,4],[14820,4],[20739,4],[26489,4],[32908,4],[40443,4]]},"846":{"position":[[1150,4],[8431,4]]},"848":{"position":[[8103,4],[15623,4],[22110,4],[28859,4],[35286,4],[41156,4],[47080,4],[52766,4]]}}}],["function",{"_index":1116,"t":{"171":{"position":[[310,8],[622,8],[873,8],[982,8]]},"173":{"position":[[281,8],[347,8],[1007,8],[1070,8],[1695,8],[1845,8]]},"327":{"position":[[1343,8]]}}}],["fundament",{"_index":1910,"t":{"476":{"position":[[457,11]]}}}],["further",{"_index":1968,"t":{"482":{"position":[[2666,7]]},"639":{"position":[[6178,7]]}}}],["futur",{"_index":280,"t":{"15":{"position":[[407,7]]},"472":{"position":[[178,7]]},"753":{"position":[[154,7]]}}}],["gabriel",{"_index":2267,"t":{"669":{"position":[[7499,7]]}}}],["gain",{"_index":1565,"t":{"283":{"position":[[175,5],[337,5]]}}}],["gamma",{"_index":2388,"t":{"721":{"position":[[143,5],[358,5]]},"726":{"position":[[12233,5],[13731,5],[15723,5],[17291,5],[19071,5],[20390,5],[21818,5],[23740,5],[25238,5],[26918,5]]}}}],["garden",{"_index":542,"t":{"39":{"position":[[539,6]]}}}],["gener",{"_index":1152,"t":{"171":{"position":[[1848,9],[1998,8]]},"173":{"position":[[3089,9],[3239,8]]},"185":{"position":[[58,8]]},"230":{"position":[[8,9]]},"472":{"position":[[543,7],[804,7],[1112,7]]},"484":{"position":[[463,7]]},"574":{"position":[[6254,8]]},"840":{"position":[[911,7]]},"842":{"position":[[270,9]]},"848":{"position":[[810,9],[970,8],[1257,8],[6818,9],[14310,8],[14332,8]]}}}],["get",{"_index":503,"t":{"37":{"position":[[114,7]]},"99":{"position":[[172,7]]},"109":{"position":[[737,7]]},"111":{"position":[[135,7]]},"153":{"position":[[1618,7]]},"333":{"position":[[0,7]]},"377":{"position":[[78,7]]},"406":{"position":[[134,7]]},"412":{"position":[[3299,7]]},"526":{"position":[[78,7]]},"751":{"position":[[9849,7]]},"824":{"position":[[9224,7]]}}}],["github",{"_index":249,"t":{"11":{"position":[[106,6]]},"89":{"position":[[3543,7]]},"113":{"position":[[236,6],[1336,7]]},"171":{"position":[[1904,6]]},"173":{"position":[[3145,6]]},"283":{"position":[[313,6]]},"337":{"position":[[116,6]]},"359":{"position":[[196,6],[273,7]]},"410":{"position":[[374,7]]},"510":{"position":[[366,6]]},"546":{"position":[[280,6],[331,6]]},"564":{"position":[[311,6],[388,7]]},"586":{"position":[[334,6]]},"711":{"position":[[69,6]]},"717":{"position":[[678,6]]},"719":{"position":[[87,6]]},"732":{"position":[[112,6],[1181,6]]},"738":{"position":[[0,6],[104,6]]},"745":{"position":[[0,6],[30214,6]]},"747":{"position":[[0,6]]},"749":{"position":[[0,6]]},"751":{"position":[[3,7],[694,6]]},"753":{"position":[[0,6]]}}}],["github'",{"_index":2380,"t":{"717":{"position":[[139,8],[331,8]]},"719":{"position":[[48,9],[332,8]]},"732":{"position":[[36,8]]},"738":{"position":[[256,8]]},"740":{"position":[[0,8]]}}}],["github.com/gofiber/fiber/v2",{"_index":1100,"t":{"169":{"position":[[1234,27],[1405,29]]},"171":{"position":[[1641,29]]},"173":{"position":[[2809,29]]}}}],["github.com/gofiber/jwt/v3",{"_index":1101,"t":{"169":{"position":[[1262,25]]},"171":{"position":[[1679,27]]},"173":{"position":[[2847,27]]}}}],["github.com/golang",{"_index":1102,"t":{"169":{"position":[[1288,17]]},"171":{"position":[[1707,18]]},"173":{"position":[[2875,18]]}}}],["github.com/openfga/cli@latest",{"_index":957,"t":{"113":{"position":[[1800,29]]},"121":{"position":[[51,29]]}}}],["github.com/openfga/go",{"_index":421,"t":{"35":{"position":[[2023,22]]},"43":{"position":[[483,22],[513,22]]},"45":{"position":[[13242,22],[19436,22],[25811,22]]},"113":{"position":[[286,21],[373,22]]},"133":{"position":[[657,22]]},"145":{"position":[[657,22]]},"173":{"position":[[2914,22],[2944,22]]},"183":{"position":[[727,22],[757,22]]},"185":{"position":[[1176,22],[1206,22],[1241,22]]},"187":{"position":[[1201,22],[1231,22],[1266,22]]},"200":{"position":[[1028,22]]},"202":{"position":[[1080,22],[6826,22]]},"248":{"position":[[657,22]]},"265":{"position":[[1370,22]]},"267":{"position":[[1044,22],[6786,22]]},"277":{"position":[[629,22]]},"285":{"position":[[2381,22],[8018,22],[14047,22],[19651,22]]},"294":{"position":[[1289,22]]},"296":{"position":[[1124,22]]},"311":{"position":[[1126,22],[6708,22],[12691,22]]},"357":{"position":[[1261,22]]},"369":{"position":[[1220,22],[6829,22]]},"375":{"position":[[1355,22],[7515,22],[13329,22]]},"382":{"position":[[2196,22]]},"402":{"position":[[1102,22]]},"404":{"position":[[1161,22],[6999,22]]},"444":{"position":[[1324,22],[7958,22]]},"446":{"position":[[1336,22]]},"448":{"position":[[1052,22]]},"462":{"position":[[1223,22],[6856,22]]},"466":{"position":[[1184,22],[6983,22]]},"504":{"position":[[1063,22]]},"506":{"position":[[1145,22]]},"508":{"position":[[1234,22]]},"522":{"position":[[1301,22]]},"524":{"position":[[1362,22]]},"540":{"position":[[1074,22]]},"542":{"position":[[1484,22]]},"544":{"position":[[1296,22]]},"562":{"position":[[1434,22],[7890,22],[13885,22],[19573,22],[25198,22]]},"574":{"position":[[1204,22]]},"578":{"position":[[1207,22]]},"580":{"position":[[1170,22]]},"582":{"position":[[1048,22],[6562,22]]},"584":{"position":[[1045,22],[6623,22]]},"599":{"position":[[1217,22]]},"606":{"position":[[1512,22],[7649,22],[13640,22]]},"608":{"position":[[1597,22]]},"613":{"position":[[1247,22],[7159,22]]},"618":{"position":[[1261,22]]},"637":{"position":[[1419,22]]},"639":{"position":[[1171,22]]},"645":{"position":[[1243,22]]},"647":{"position":[[1092,22]]},"649":{"position":[[1099,22],[7132,22],[12768,22]]},"667":{"position":[[2349,22],[8521,22],[15345,22],[22179,22],[28416,22]]},"669":{"position":[[2323,22],[8575,22],[14917,22],[21240,22]]},"679":{"position":[[2038,22],[7655,22]]},"681":{"position":[[1169,22],[7049,22]]},"683":{"position":[[1247,22],[7446,22],[13709,22],[19978,22],[25639,22]]},"703":{"position":[[5747,22]]},"705":{"position":[[2166,22]]},"726":{"position":[[1977,22],[12835,22],[20902,22],[29229,22],[34989,22],[40609,22],[46252,22]]},"728":{"position":[[1272,22],[9187,22],[15113,22],[25530,22],[33769,22],[43304,22]]},"745":{"position":[[2766,22],[8488,22],[14140,22],[19819,22],[25446,22],[33179,22],[38805,22]]},"747":{"position":[[3524,22],[10649,22]]},"749":{"position":[[1264,22],[7537,22],[13410,22]]},"751":{"position":[[4021,22],[10863,22],[18277,22]]},"771":{"position":[[1451,22],[7103,22],[12930,22],[20055,22],[25752,22]]},"773":{"position":[[4069,22],[11386,22]]},"775":{"position":[[3862,22],[10582,22],[18564,22]]},"777":{"position":[[4119,22],[11261,22]]},"789":{"position":[[4062,22]]},"795":{"position":[[1403,22],[7095,22],[12842,22],[18727,22]]},"797":{"position":[[5514,22],[11717,22],[20015,22],[26805,22]]},"799":{"position":[[2267,22],[9669,22],[16596,22]]},"801":{"position":[[6046,22]]},"820":{"position":[[2770,22],[8516,22],[14186,22],[19858,22],[25478,22],[32698,22],[38317,22]]},"822":{"position":[[3370,22],[11324,22]]},"824":{"position":[[3082,22],[10240,22]]},"826":{"position":[[4128,22],[11911,22],[17671,22],[23370,22],[29160,22],[34857,22]]},"844":{"position":[[3067,22],[9029,22],[14778,22],[20697,22],[26447,22],[32866,22],[40401,22]]},"846":{"position":[[1108,22],[8389,22]]},"848":{"position":[[8061,22],[15581,22],[22068,22],[28817,22],[35244,22],[41114,22],[47038,22],[52724,22]]}}}],["give",{"_index":1524,"t":{"254":{"position":[[118,4],[207,4]]},"265":{"position":[[29,4]]},"333":{"position":[[729,6]]},"562":{"position":[[257,5],[308,5]]},"566":{"position":[[135,6]]},"643":{"position":[[1913,4]]},"728":{"position":[[20731,4],[30970,4],[38540,4]]},"775":{"position":[[9185,4]]},"797":{"position":[[18864,4]]},"828":{"position":[[84,4]]}}}],["given",{"_index":227,"t":{"9":{"position":[[811,5]]},"45":{"position":[[24311,5],[24609,5]]},"73":{"position":[[104,5]]},"139":{"position":[[101,5]]},"317":{"position":[[259,6]]},"416":{"position":[[555,5]]},"476":{"position":[[884,5]]},"484":{"position":[[645,5]]},"562":{"position":[[12769,5],[30153,5]]},"711":{"position":[[179,5]]},"726":{"position":[[27346,5]]},"846":{"position":[[5883,5]]}}}],["global",{"_index":334,"t":{"25":{"position":[[34,6]]}}}],["go",{"_index":187,"t":{"7":{"position":[[511,2]]},"33":{"position":[[8,2]]},"35":{"position":[[717,2]]},"43":{"position":[[8,2]]},"45":{"position":[[12261,2],[18455,2],[24809,2]]},"83":{"position":[[66,2]]},"109":{"position":[[676,2]]},"113":{"position":[[58,2],[222,2],[276,2],[760,2],[1745,3],[1789,2]]},"121":{"position":[[40,2]]},"125":{"position":[[139,2],[154,2],[184,2]]},"129":{"position":[[8,2]]},"133":{"position":[[81,2]]},"135":{"position":[[87,2]]},"141":{"position":[[8,2]]},"145":{"position":[[81,2]]},"147":{"position":[[82,2]]},"165":{"position":[[8,2]]},"169":{"position":[[52,2],[1032,2],[1205,2],[1224,2]]},"171":{"position":[[110,2]]},"173":{"position":[[8,2],[5637,2]]},"183":{"position":[[77,2]]},"185":{"position":[[257,5],[387,2]]},"187":{"position":[[263,2]]},"200":{"position":[[92,2]]},"202":{"position":[[102,2],[5846,2]]},"214":{"position":[[418,5],[1852,5]]},"244":{"position":[[8,2]]},"248":{"position":[[81,2]]},"250":{"position":[[69,2]]},"252":{"position":[[224,2]]},"265":{"position":[[402,2]]},"267":{"position":[[113,2],[5817,2]]},"273":{"position":[[8,2]]},"277":{"position":[[57,2]]},"279":{"position":[[72,2],[1476,2]]},"281":{"position":[[1057,2],[2326,2]]},"285":{"position":[[1407,2],[7045,2],[13069,2],[18671,2]]},"294":{"position":[[354,2]]},"296":{"position":[[145,2]]},"311":{"position":[[199,2],[5780,2],[11598,2]]},"357":{"position":[[275,2]]},"369":{"position":[[241,2],[5851,2]]},"375":{"position":[[360,2],[6536,2],[12350,2]]},"382":{"position":[[1220,2]]},"402":{"position":[[154,2]]},"404":{"position":[[175,2],[6012,2]]},"422":{"position":[[1182,2]]},"442":{"position":[[22,5]]},"444":{"position":[[223,2],[6977,2]]},"446":{"position":[[125,2]]},"448":{"position":[[71,2]]},"452":{"position":[[21,5]]},"462":{"position":[[241,2],[5875,2]]},"466":{"position":[[201,2],[6000,2]]},"474":{"position":[[244,2]]},"482":{"position":[[284,5],[293,2]]},"504":{"position":[[129,2]]},"506":{"position":[[131,2]]},"508":{"position":[[248,2]]},"522":{"position":[[315,2]]},"524":{"position":[[380,2]]},"540":{"position":[[138,2]]},"542":{"position":[[471,2]]},"544":{"position":[[308,2]]},"562":{"position":[[363,2],[6911,2],[12906,2],[18592,2],[24218,2]]},"574":{"position":[[217,2]]},"578":{"position":[[224,2]]},"580":{"position":[[235,2]]},"582":{"position":[[81,2],[5595,2]]},"584":{"position":[[118,2],[5655,2]]},"599":{"position":[[240,2]]},"606":{"position":[[490,2],[6646,2],[12627,2]]},"608":{"position":[[693,2]]},"613":{"position":[[231,2],[6143,2]]},"618":{"position":[[152,2]]},"637":{"position":[[367,2]]},"639":{"position":[[182,2]]},"645":{"position":[[92,2]]},"647":{"position":[[111,2]]},"649":{"position":[[92,2],[6150,2],[11783,2]]},"667":{"position":[[1371,2],[7543,2],[14364,2],[21201,2],[27437,2]]},"669":{"position":[[1344,2],[7593,2],[13937,2],[20260,2]]},"679":{"position":[[1058,2],[6676,2]]},"681":{"position":[[182,2],[6066,2]]},"683":{"position":[[157,2],[6434,2],[12696,2],[18998,2],[24661,2]]},"695":{"position":[[36,5],[3166,2]]},"701":{"position":[[237,2],[2068,2],[3927,2],[5763,2],[7620,2],[9463,2]]},"703":{"position":[[2815,2],[4743,2],[10705,2]]},"705":{"position":[[1134,2],[7259,2],[9930,2]]},"707":{"position":[[2705,2]]},"724":{"position":[[25,5]]},"726":{"position":[[196,2],[11514,2],[19651,2],[28250,2],[34009,2],[39626,2],[45268,2]]},"728":{"position":[[292,2],[8211,2],[14128,2],[24546,2],[32794,2],[42329,2]]},"732":{"position":[[163,5]]},"745":{"position":[[1823,2],[7507,2],[13197,2],[18838,2],[24464,2],[32198,2],[37824,2]]},"747":{"position":[[2352,2],[9666,2]]},"749":{"position":[[297,2],[6538,2],[12429,2]]},"751":{"position":[[2994,2],[9878,2],[17312,2]]},"771":{"position":[[509,2],[6157,2],[11841,2],[19075,2],[24774,2]]},"773":{"position":[[2927,2],[10403,2]]},"775":{"position":[[2832,2],[9357,2],[17587,2]]},"777":{"position":[[3027,2],[10279,2]]},"789":{"position":[[36,5],[2600,2]]},"795":{"position":[[427,2],[6115,2],[11840,2],[17750,2]]},"797":{"position":[[4542,2],[10347,2],[18890,2],[25829,2]]},"799":{"position":[[1087,2],[8524,2],[15450,2]]},"801":{"position":[[3328,2]]},"820":{"position":[[1824,2],[7532,2],[13244,2],[18878,2],[24496,2],[31718,2],[37336,2]]},"822":{"position":[[2107,2],[10340,2]]},"824":{"position":[[1940,2],[9253,2]]},"826":{"position":[[2813,2],[10923,2],[16681,2],[22378,2],[28170,2],[33867,2]]},"844":{"position":[[2066,2],[8043,2],[13777,2],[19711,2],[25454,2],[31615,2],[39415,2]]},"846":{"position":[[127,2],[7409,2]]},"848":{"position":[[6895,2],[14511,2],[20954,2],[27788,2],[34272,2],[40159,2],[46060,2],[51731,2]]}}}],["go.mod",{"_index":922,"t":{"113":{"position":[[782,6]]}}}],["go.sum",{"_index":923,"t":{"113":{"position":[[793,6]]}}}],["goal",{"_index":230,"t":{"9":{"position":[[941,4]]},"728":{"position":[[198,5]]},"761":{"position":[[183,4]]},"769":{"position":[[175,4]]},"842":{"position":[[4,4]]}}}],["gofiber/fib",{"_index":1096,"t":{"169":{"position":[[1049,13]]}}}],["gofiber/jwt",{"_index":1097,"t":{"169":{"position":[[1116,11]]}}}],["golang",{"_index":274,"t":{"15":{"position":[[322,7]]},"169":{"position":[[1172,6]]}}}],["good",{"_index":309,"t":{"19":{"position":[[339,4]]},"109":{"position":[[486,4]]},"153":{"position":[[10,4]]},"224":{"position":[[349,4]]},"728":{"position":[[13798,5],[30505,5]]}}}],["googl",{"_index":310,"t":{"19":{"position":[[363,6]]},"25":{"position":[[165,7],[189,6]]},"45":{"position":[[32306,6]]},"87":{"position":[[2238,6]]},"89":{"position":[[3510,6]]},"327":{"position":[[2772,6],[2939,6]]},"329":{"position":[[501,6]]},"337":{"position":[[0,6]]},"359":{"position":[[92,6],[168,6]]},"361":{"position":[[489,6]]},"474":{"position":[[304,6]]},"510":{"position":[[216,6]]},"546":{"position":[[156,6],[243,6]]},"564":{"position":[[207,6],[283,6]]},"807":{"position":[[40,6]]},"813":{"position":[[0,6],[136,6],[294,6]]},"815":{"position":[[0,6]]},"820":{"position":[[63,6],[30248,6]]},"822":{"position":[[0,6]]},"826":{"position":[[0,6]]}}}],["google'",{"_index":332,"t":{"25":{"position":[[12,9]]}}}],["govern",{"_index":1834,"t":{"428":{"position":[[537,6]]},"695":{"position":[[306,8]]}}}],["gradual",{"_index":898,"t":{"109":{"position":[[568,7]]}}}],["graduat",{"_index":1570,"t":{"283":{"position":[[403,9]]}}}],["grain",{"_index":254,"t":{"13":{"position":[[42,7]]},"15":{"position":[[43,7]]},"19":{"position":[[5,7]]},"175":{"position":[[178,7]]},"317":{"position":[[24,7]]},"548":{"position":[[1113,7]]},"779":{"position":[[42,5]]},"850":{"position":[[206,5],[677,7]]}}}],["grant",{"_index":83,"t":{"3":{"position":[[1309,5],[1397,7]]},"5":{"position":[[99,8],[225,8]]},"19":{"position":[[44,5],[397,7],[448,7]]},"21":{"position":[[215,7],[248,7]]},"37":{"position":[[265,8]]},"189":{"position":[[36,5],[295,5],[441,8]]},"191":{"position":[[1013,5]]},"193":{"position":[[48,5]]},"256":{"position":[[36,5],[92,8]]},"258":{"position":[[732,5]]},"260":{"position":[[89,5]]},"269":{"position":[[107,8],[195,8]]},"285":{"position":[[24350,5]]},"287":{"position":[[48,5]]},"302":{"position":[[1239,5],[1334,5]]},"304":{"position":[[89,5]]},"306":{"position":[[24,5]]},"333":{"position":[[180,8],[281,5],[892,8]]},"347":{"position":[[1145,5]]},"349":{"position":[[48,5]]},"361":{"position":[[300,8]]},"363":{"position":[[1643,5]]},"365":{"position":[[48,5]]},"380":{"position":[[322,8],[349,8]]},"394":{"position":[[36,5],[122,8]]},"418":{"position":[[315,7]]},"428":{"position":[[214,5]]},"430":{"position":[[1154,5]]},"434":{"position":[[48,5]]},"452":{"position":[[617,8]]},"492":{"position":[[1016,5]]},"494":{"position":[[89,5]]},"510":{"position":[[384,5]]},"512":{"position":[[36,5],[183,5]]},"514":{"position":[[786,5]]},"516":{"position":[[89,5]]},"528":{"position":[[60,5],[313,5],[459,8]]},"530":{"position":[[763,5]]},"532":{"position":[[89,5]]},"546":{"position":[[287,8]]},"548":{"position":[[784,5],[846,5],[921,5]]},"550":{"position":[[875,5]]},"552":{"position":[[89,5]]},"560":{"position":[[352,7]]},"566":{"position":[[36,5]]},"568":{"position":[[716,5]]},"570":{"position":[[89,5]]},"590":{"position":[[1187,5]]},"592":{"position":[[89,5]]},"628":{"position":[[960,5]]},"630":{"position":[[48,5]]},"653":{"position":[[295,7]]},"655":{"position":[[304,5]]},"657":{"position":[[89,5]]},"695":{"position":[[713,6]]},"713":{"position":[[676,8],[905,7]]},"728":{"position":[[22166,5]]},"747":{"position":[[85,8]]},"757":{"position":[[365,5],[719,8],[989,7]]},"771":{"position":[[327,5]]},"832":{"position":[[365,5]]}}}],["grant_dur",{"_index":101,"t":{"3":{"position":[[1659,15],[1715,14],[1925,14],[2951,14]]}}}],["grant_tim",{"_index":100,"t":{"3":{"position":[[1636,11],[1702,10],[1890,10],[2938,10]]}}}],["granular",{"_index":2076,"t":{"556":{"position":[[151,8]]},"830":{"position":[[518,8]]}}}],["graph",{"_index":2157,"t":{"608":{"position":[[130,5]]},"611":{"position":[[192,5]]}}}],["greater",{"_index":1000,"t":{"153":{"position":[[1224,7]]}}}],["green",{"_index":1929,"t":{"478":{"position":[[2215,6]]},"480":{"position":[[536,6]]}}}],["grid",{"_index":2848,"t":{"836":{"position":[[545,4]]}}}],["group",{"_index":154,"t":{"5":{"position":[[250,5]]},"19":{"position":[[486,6]]},"45":{"position":[[4871,5]]},"85":{"position":[[313,5]]},"179":{"position":[[110,5],[200,6],[232,5],[317,6]]},"189":{"position":[[44,5],[148,5],[303,5]]},"191":{"position":[[957,7],[1002,6],[1019,6],[1583,8]]},"193":{"position":[[37,6],[54,6]]},"195":{"position":[[505,8]]},"204":{"position":[[54,6],[75,6],[117,7],[139,5],[177,5]]},"254":{"position":[[175,5],[214,5]]},"258":{"position":[[1302,8]]},"262":{"position":[[505,8]]},"281":{"position":[[93,5],[321,8],[622,8],[827,8]]},"283":{"position":[[68,5],[498,5],[710,6],[784,6]]},"285":{"position":[[13042,5],[24294,7],[24339,6],[24356,6],[24406,5],[24451,5],[25014,8]]},"287":{"position":[[37,6],[54,6]]},"289":{"position":[[31,5]]},"291":{"position":[[505,8]]},"298":{"position":[[54,6],[75,6],[117,7],[139,5],[173,5]]},"302":{"position":[[1904,8]]},"308":{"position":[[505,8]]},"333":{"position":[[229,6],[256,5],[314,6]]},"343":{"position":[[437,6]]},"347":{"position":[[1089,7],[1134,6],[1151,6],[1715,8]]},"349":{"position":[[37,6],[54,6]]},"351":{"position":[[505,8]]},"361":{"position":[[364,7],[719,5]]},"363":{"position":[[1587,7],[1632,6],[1649,6],[2213,8]]},"365":{"position":[[37,6],[54,6]]},"367":{"position":[[505,8]]},"380":{"position":[[91,5],[202,6]]},"384":{"position":[[1271,7]]},"388":{"position":[[58,5],[119,5]]},"396":{"position":[[1294,8]]},"398":{"position":[[505,8]]},"412":{"position":[[131,5],[407,5],[1072,6],[1134,5],[1553,5],[1905,8],[3232,6]]},"414":{"position":[[142,5],[660,5]]},"416":{"position":[[1296,5],[1373,5],[1716,8],[2303,8],[2854,8],[3122,5]]},"430":{"position":[[1143,6],[1160,6]]},"434":{"position":[[37,6],[54,6]]},"454":{"position":[[3201,8]]},"460":{"position":[[505,8]]},"468":{"position":[[88,6],[118,5]]},"476":{"position":[[1125,6]]},"482":{"position":[[605,8],[1797,5],[1841,7],[2702,6],[2945,7],[4918,5],[5202,7]]},"484":{"position":[[27,5]]},"490":{"position":[[572,7]]},"492":{"position":[[1586,8]]},"496":{"position":[[505,8]]},"514":{"position":[[1356,8]]},"518":{"position":[[505,8]]},"528":{"position":[[49,6],[66,6],[166,5],[321,5]]},"530":{"position":[[1333,8]]},"534":{"position":[[505,8]]},"536":{"position":[[68,5]]},"542":{"position":[[13,6]]},"546":{"position":[[50,6],[79,5],[135,6],[182,6]]},"548":{"position":[[172,5]]},"550":{"position":[[1445,8]]},"554":{"position":[[505,8]]},"568":{"position":[[1286,8]]},"572":{"position":[[505,8]]},"590":{"position":[[1757,8]]},"594":{"position":[[505,8]]},"628":{"position":[[904,7],[949,6],[966,6],[1530,8]]},"630":{"position":[[37,6],[54,6]]},"632":{"position":[[505,8]]},"651":{"position":[[289,6],[320,7]]},"655":{"position":[[874,8]]},"659":{"position":[[505,8]]},"675":{"position":[[578,8]]},"693":{"position":[[365,8]]},"709":{"position":[[50,6]]},"732":{"position":[[256,5],[304,6]]},"757":{"position":[[1031,7],[1076,6],[1116,6],[1216,5],[1262,6]]},"763":{"position":[[223,7],[243,7],[293,5],[353,6]]},"765":{"position":[[395,5],[507,5]]},"775":{"position":[[57,7],[99,6],[127,7],[147,6],[196,5],[267,6],[333,6],[2762,5]]},"781":{"position":[[20,5],[87,6]]},"787":{"position":[[366,8]]},"805":{"position":[[50,6]]},"807":{"position":[[138,5],[186,6]]},"830":{"position":[[163,5],[303,6]]}}}],["group#memb",{"_index":787,"t":{"85":{"position":[[673,12]]},"281":{"position":[[167,14],[221,14]]},"416":{"position":[[1115,12],[1479,13],[1585,13],[3297,12]]}}}],["group'",{"_index":1575,"t":{"283":{"position":[[576,7]]}}}],["group1",{"_index":2619,"t":{"775":{"position":[[9217,6]]}}}],["group:abc#memb",{"_index":1559,"t":{"279":{"position":[[3597,19]]}}}],["group:market",{"_index":784,"t":{"85":{"position":[[279,15]]}}}],["group:marketing#memb",{"_index":786,"t":{"85":{"position":[[634,22]]}}}],["group:sal",{"_index":1757,"t":{"412":{"position":[[467,14],[1202,14]]},"414":{"position":[[197,14],[720,14]]},"416":{"position":[[148,14]]}}}],["group:sales#memb",{"_index":1761,"t":{"412":{"position":[[682,21]]},"416":{"position":[[388,18],[459,21],[561,18],[670,18],[3172,21]]}}}],["groups/contain",{"_index":1953,"t":{"482":{"position":[[439,17]]}}}],["grow",{"_index":2097,"t":{"566":{"position":[[258,6]]},"574":{"position":[[6406,6]]}}}],["grpc",{"_index":972,"t":{"151":{"position":[[156,4]]},"208":{"position":[[295,4],[414,4]]},"210":{"position":[[833,4]]},"212":{"position":[[2574,4],[5205,4]]},"220":{"position":[[72,4],[234,4]]}}}],["grpc.health.v1.health/check",{"_index":1443,"t":{"220":{"position":[[90,28],[388,27]]}}}],["grpcurl",{"_index":1451,"t":{"220":{"position":[[355,7]]}}}],["guarante",{"_index":1470,"t":{"222":{"position":[[905,10]]}}}],["guard",{"_index":2565,"t":{"757":{"position":[[636,6],[1196,6],[1235,6]]},"763":{"position":[[37,6],[260,6],[312,6]]},"765":{"position":[[234,5],[340,5]]},"769":{"position":[[34,6],[305,5]]},"771":{"position":[[41,5],[134,6]]},"773":{"position":[[167,5],[335,6],[2519,6],[2607,6]]},"775":{"position":[[163,6],[215,6],[2729,6],[9207,6]]},"781":{"position":[[187,6]]}}}],["guest",{"_index":1690,"t":{"361":{"position":[[774,7]]},"838":{"position":[[111,6]]},"840":{"position":[[607,5]]},"842":{"position":[[797,5],[990,5],[1144,6],[1357,8],[1634,8],[1849,5],[1855,7]]},"844":{"position":[[142,7],[374,5],[716,6],[929,8],[1206,8],[31371,5],[31435,8],[32466,5],[32532,8],[33953,5],[35826,5],[35900,8],[37323,5],[38712,5],[39022,5],[45370,5],[45418,6],[45455,5],[45505,6]]},"846":{"position":[[6037,6],[6547,6],[6987,8],[7264,8],[13328,5],[13376,6],[13413,5],[13463,6]]},"848":{"position":[[377,5],[1017,5],[2411,7],[2681,7],[3927,7],[4197,7],[4673,6],[5397,8],[5674,8],[6321,7],[6591,7],[40084,5],[58385,5],[58435,6]]}}}],["guid",{"_index":16,"t":{"3":{"position":[[204,6]]},"27":{"position":[[42,5]]},"45":{"position":[[294,5]]},"81":{"position":[[951,5]]},"161":{"position":[[11,6],[65,5],[150,5]]},"189":{"position":[[8,5]]},"191":{"position":[[28,5]]},"256":{"position":[[8,5]]},"258":{"position":[[28,5]]},"283":{"position":[[8,5]]},"285":{"position":[[28,5]]},"300":{"position":[[8,5]]},"302":{"position":[[28,5]]},"315":{"position":[[218,6]]},"331":{"position":[[17,7]]},"341":{"position":[[17,6]]},"345":{"position":[[14,6]]},"347":{"position":[[26,6]]},"361":{"position":[[8,5]]},"363":{"position":[[22,6]]},"390":{"position":[[17,6]]},"394":{"position":[[8,5]]},"396":{"position":[[28,5]]},"428":{"position":[[8,5]]},"430":{"position":[[22,6]]},"440":{"position":[[225,6]]},"452":{"position":[[8,5]]},"454":{"position":[[28,5]]},"470":{"position":[[311,5]]},"472":{"position":[[318,5]]},"474":{"position":[[231,6]]},"490":{"position":[[8,5]]},"492":{"position":[[28,5]]},"512":{"position":[[8,5]]},"514":{"position":[[28,5]]},"520":{"position":[[12,7]]},"528":{"position":[[8,5]]},"530":{"position":[[28,5]]},"548":{"position":[[8,5]]},"550":{"position":[[28,5]]},"566":{"position":[[8,5]]},"568":{"position":[[28,5]]},"588":{"position":[[8,5]]},"590":{"position":[[28,5]]},"624":{"position":[[125,5],[192,5],[260,5],[335,5]]},"626":{"position":[[8,5]]},"628":{"position":[[22,6]]},"639":{"position":[[6267,6]]},"653":{"position":[[8,5]]},"655":{"position":[[26,6]]},"673":{"position":[[119,6]]},"675":{"position":[[5,5]]},"691":{"position":[[15,6]]},"695":{"position":[[22,6]]},"709":{"position":[[410,6]]},"713":{"position":[[28,5]]},"734":{"position":[[28,5]]},"757":{"position":[[28,5]]},"785":{"position":[[15,6]]},"789":{"position":[[22,6]]},"791":{"position":[[19,5]]},"797":{"position":[[10324,5]]},"803":{"position":[[22,5]]},"805":{"position":[[400,6]]},"809":{"position":[[28,5]]},"832":{"position":[[28,5]]}}}],["guidanc",{"_index":1020,"t":{"155":{"position":[[78,8],[1671,8]]},"618":{"position":[[134,9]]}}}],["guidelin",{"_index":970,"t":{"151":{"position":[[33,10]]},"153":{"position":[[610,10]]},"155":{"position":[[1196,11],[1974,11]]},"234":{"position":[[33,10]]}}}],["h",{"_index":492,"t":{"35":{"position":[[7750,1],[7849,1]]},"43":{"position":[[3222,1]]},"45":{"position":[[17317,1],[17416,1],[23511,1],[23610,1],[30062,1],[30161,1]]},"135":{"position":[[1333,1],[1432,1]]},"147":{"position":[[1575,1],[1674,1]]},"200":{"position":[[4918,1],[5017,1]]},"202":{"position":[[5143,1],[5242,1],[10897,1],[10996,1]]},"212":{"position":[[4482,3]]},"250":{"position":[[1411,1],[1510,1]]},"252":{"position":[[1534,1],[1633,1]]},"265":{"position":[[5393,1],[5492,1]]},"267":{"position":[[4921,1],[5020,1],[10813,1],[10912,1]]},"279":{"position":[[891,1],[990,1],[2769,1],[2868,1]]},"281":{"position":[[1936,1],[2035,1],[3679,1],[3778,1]]},"285":{"position":[[6428,1],[6527,1],[12018,1],[12117,1],[18110,1],[18209,1],[23722,1],[23821,1]]},"294":{"position":[[5178,1],[5277,1]]},"296":{"position":[[5191,1],[5290,1]]},"311":{"position":[[4989,1],[5088,1],[10576,1],[10675,1],[17186,1],[17285,1]]},"357":{"position":[[5356,1],[5455,1]]},"369":{"position":[[5287,1],[5386,1],[10892,1],[10991,1]]},"375":{"position":[[5421,1],[5520,1],[11582,1],[11681,1],[17396,1],[17495,1]]},"382":{"position":[[6251,1],[6350,1]]},"402":{"position":[[5028,1],[5127,1]]},"404":{"position":[[5256,1],[5355,1],[11098,1],[11197,1]]},"422":{"position":[[2493,1],[2592,1]]},"444":{"position":[[5786,1],[5885,1],[12033,1],[12132,1]]},"446":{"position":[[6128,1],[6227,1]]},"448":{"position":[[5127,1],[5226,1]]},"462":{"position":[[5302,1],[5401,1],[10931,1],[11030,1]]},"466":{"position":[[5267,1],[5366,1],[11066,1],[11165,1]]},"504":{"position":[[4947,1],[5046,1]]},"506":{"position":[[5268,1],[5367,1]]},"508":{"position":[[5329,1],[5428,1]]},"522":{"position":[[5340,1],[5439,1]]},"524":{"position":[[5441,1],[5540,1]]},"540":{"position":[[4964,1],[5063,1]]},"542":{"position":[[5604,1],[5703,1]]},"544":{"position":[[5399,1],[5498,1]]},"562":{"position":[[5806,1],[5905,1],[11957,1],[12056,1],[17952,1],[18051,1],[23648,1],[23747,1],[29269,1],[29368,1]]},"574":{"position":[[5326,1],[5425,1]]},"578":{"position":[[5317,1],[5416,1]]},"580":{"position":[[5057,1],[5156,1]]},"582":{"position":[[5067,1],[5166,1],[10581,1],[10680,1]]},"584":{"position":[[4910,1],[5009,1],[10646,1],[10745,1]]},"599":{"position":[[5276,1],[5375,1]]},"606":{"position":[[5729,1],[5828,1],[11769,1],[11868,1],[17800,1],[17899,1]]},"608":{"position":[[5460,1],[5559,1]]},"613":{"position":[[5429,1],[5528,1],[11341,1],[11440,1]]},"618":{"position":[[5898,1],[5997,1]]},"637":{"position":[[5656,1],[5755,1]]},"639":{"position":[[5278,1],[5377,1]]},"645":{"position":[[5855,1],[5954,1]]},"647":{"position":[[5167,1],[5266,1]]},"649":{"position":[[5203,1],[5302,1],[11211,1],[11310,1],[16859,1],[16958,1]]},"667":{"position":[[6412,1],[6511,1],[12584,1],[12683,1],[19420,1],[19519,1],[26242,1],[26341,1],[32483,1],[32582,1]]},"669":{"position":[[6390,1],[6489,1],[12654,1],[12753,1],[18988,1],[19087,1],[25311,1],[25410,1]]},"679":{"position":[[6109,1],[6208,1],[11722,1],[11821,1]]},"681":{"position":[[5211,1],[5310,1],[11132,1],[11231,1]]},"683":{"position":[[5549,1],[5648,1],[11643,1],[11742,1],[17911,1],[18010,1],[24049,1],[24148,1],[29702,1],[29801,1]]},"695":{"position":[[8108,1],[8207,1]]},"701":{"position":[[1499,1],[1598,1],[3340,1],[3439,1],[5189,1],[5288,1],[7040,1],[7139,1],[8887,1],[8986,1],[10740,1],[10839,1]]},"703":{"position":[[4082,1],[4181,1],[9840,1],[9939,1],[11967,1],[12066,1]]},"705":{"position":[[6345,1],[6444,1],[9038,1],[9137,1],[11714,1],[11813,1]]},"707":{"position":[[7647,1],[7746,1]]},"726":{"position":[[8791,1],[8890,1],[18035,1],[18134,1],[25892,1],[25991,1],[33296,1],[33395,1],[39060,1],[39159,1],[44692,1],[44791,1],[50339,1],[50438,1]]},"728":{"position":[[5343,1],[5442,1],[13242,1],[13341,1],[19204,1],[19303,1],[29617,1],[29716,1],[37820,1],[37919,1],[47355,1],[47454,1]]},"745":{"position":[[6677,1],[6776,1],[12563,1],[12662,1],[18051,1],[18150,1],[23894,1],[23993,1],[29525,1],[29624,1],[37254,1],[37353,1],[42880,1],[42979,1]]},"747":{"position":[[8199,1],[8298,1],[14732,1],[14831,1]]},"749":{"position":[[5247,1],[5346,1],[11615,1],[11714,1],[17485,1],[17584,1]]},"751":{"position":[[8263,1],[8362,1],[14954,1],[15053,1],[22254,1],[22353,1]]},"771":{"position":[[5359,1],[5458,1],[11023,1],[11122,1],[17437,1],[17536,1],[24126,1],[24225,1],[29815,1],[29914,1]]},"773":{"position":[[8814,1],[8913,1],[15469,1],[15568,1]]},"775":{"position":[[8113,1],[8212,1],[15576,1],[15675,1],[22623,1],[22722,1]]},"777":{"position":[[8635,1],[8734,1],[15340,1],[15439,1]]},"789":{"position":[[9763,1],[9862,1]]},"795":{"position":[[5458,1],[5557,1],[11166,1],[11265,1],[16929,1],[17028,1],[22786,1],[22885,1]]},"797":{"position":[[9553,1],[9652,1],[17064,1],[17163,1],[24549,1],[24648,1],[30860,1],[30959,1]]},"799":{"position":[[6968,1],[7067,1],[14399,1],[14498,1],[21330,1],[21429,1]]},"801":{"position":[[16139,1],[16238,1]]},"820":{"position":[[6690,1],[6789,1],[12603,1],[12702,1],[18094,1],[18193,1],[23929,1],[24028,1],[29557,1],[29656,1],[36769,1],[36868,1],[42392,1],[42491,1]]},"822":{"position":[[8476,1],[8575,1],[15411,1],[15510,1]]},"824":{"position":[[7667,1],[7766,1],[14339,1],[14438,1]]},"826":{"position":[[9310,1],[9409,1],[16014,1],[16113,1],[21782,1],[21881,1],[27489,1],[27588,1],[33271,1],[33370,1],[38968,1],[39067,1]]},"844":{"position":[[7151,1],[7250,1],[13124,1],[13223,1],[18862,1],[18961,1],[24792,1],[24891,1],[30570,1],[30669,1],[37856,1],[37955,1],[44496,1],[44595,1]]},"846":{"position":[[5183,1],[5282,1],[12460,1],[12559,1]]},"848":{"position":[[12799,1],[12898,1],[19872,1],[19971,1],[26570,1],[26669,1],[33065,1],[33164,1],[39242,1],[39341,1],[45061,1],[45160,1],[51101,1],[51200,1],[56847,1],[56946,1]]}}}],["hand",{"_index":804,"t":{"87":{"position":[[1231,4]]},"771":{"position":[[24698,5]]},"844":{"position":[[25393,5]]}}}],["handi",{"_index":2838,"t":{"826":{"position":[[433,6]]}}}],["handl",{"_index":64,"t":{"3":{"position":[[934,8]]},"35":{"position":[[2712,6],[3349,6],[3507,6]]},"43":{"position":[[1136,6],[1289,6]]},"45":{"position":[[13931,6],[20125,6],[26500,6]]},"113":{"position":[[726,6]]},"133":{"position":[[1346,6]]},"145":{"position":[[1346,6]]},"183":{"position":[[1375,6]]},"185":{"position":[[2103,6]]},"187":{"position":[[220,6],[2266,6]]},"200":{"position":[[1717,6],[2152,6]]},"202":{"position":[[1769,6],[7515,6]]},"248":{"position":[[1346,6]]},"250":{"position":[[672,6]]},"252":{"position":[[829,6]]},"265":{"position":[[2059,6]]},"267":{"position":[[1733,6],[2163,6],[7475,6]]},"277":{"position":[[1318,6]]},"279":{"position":[[454,6],[2092,6]]},"281":{"position":[[1461,6],[2964,6]]},"285":{"position":[[3070,6],[8707,6],[9179,6],[14736,6],[20340,6]]},"294":{"position":[[1978,6],[2412,6]]},"296":{"position":[[1813,6]]},"311":{"position":[[1815,6],[2241,6],[7397,6],[7824,6],[13380,6],[14051,6]]},"357":{"position":[[1950,6]]},"369":{"position":[[1909,6],[7518,6]]},"375":{"position":[[2044,6],[2538,6],[8204,6],[14018,6]]},"382":{"position":[[2885,6]]},"402":{"position":[[1791,6],[2238,6]]},"404":{"position":[[1850,6],[7688,6]]},"422":{"position":[[1830,6]]},"444":{"position":[[2013,6],[2672,6],[8647,6]]},"446":{"position":[[2025,6],[2794,6]]},"448":{"position":[[1741,6]]},"462":{"position":[[1912,6],[7545,6]]},"466":{"position":[[1873,6],[7672,6]]},"504":{"position":[[1752,6],[2185,6]]},"506":{"position":[[1834,6],[2347,6]]},"508":{"position":[[1923,6]]},"522":{"position":[[1990,6],[2475,6]]},"524":{"position":[[2051,6]]},"540":{"position":[[1763,6],[2198,6]]},"542":{"position":[[2173,6],[2685,6]]},"544":{"position":[[1985,6]]},"562":{"position":[[2123,6],[2752,6],[8579,6],[14574,6],[20262,6],[25887,6]]},"574":{"position":[[1893,6],[2438,6]]},"578":{"position":[[1896,6],[2437,6]]},"580":{"position":[[1859,6],[2293,6]]},"582":{"position":[[1737,6],[7251,6]]},"584":{"position":[[1734,6],[2160,6],[7312,6]]},"599":{"position":[[1906,6]]},"606":{"position":[[2201,6],[8338,6],[14329,6]]},"608":{"position":[[2286,6]]},"613":{"position":[[1936,6],[7848,6]]},"618":{"position":[[1950,6]]},"637":{"position":[[2108,6],[2659,6]]},"639":{"position":[[1860,6]]},"645":{"position":[[1932,6],[2641,6]]},"647":{"position":[[1781,6]]},"649":{"position":[[1788,6],[2294,6],[7821,6],[13457,6]]},"667":{"position":[[3038,6],[9210,6],[16034,6],[22868,6],[29105,6]]},"669":{"position":[[3012,6],[9264,6],[15606,6],[21929,6]]},"679":{"position":[[2727,6],[8344,6]]},"681":{"position":[[1858,6],[2344,6],[7738,6]]},"683":{"position":[[1936,6],[8135,6],[8705,6],[14398,6],[14969,6],[20667,6],[26328,6]]},"695":{"position":[[5750,6]]},"703":{"position":[[6436,6],[6939,6]]},"705":{"position":[[2855,6],[3386,6]]},"707":{"position":[[5289,6]]},"726":{"position":[[2666,6],[4241,6],[13524,6],[14462,6],[21591,6],[22459,6],[29918,6],[35678,6],[41298,6],[46941,6]]},"728":{"position":[[1961,6],[9876,6],[15802,6],[26219,6],[34458,6],[43993,6]]},"745":{"position":[[3455,6],[3897,6],[9177,6],[14829,6],[15271,6],[20508,6],[26135,6],[33868,6],[39494,6]]},"747":{"position":[[4213,6],[4943,6],[11338,6]]},"749":{"position":[[1953,6],[2419,6],[8226,6],[8724,6],[14099,6]]},"751":{"position":[[4710,6],[5295,6],[11552,6],[18966,6],[19430,6]]},"771":{"position":[[2140,6],[2581,6],[7792,6],[8237,6],[13619,6],[14325,6],[20744,6],[26441,6]]},"773":{"position":[[4758,6],[5576,6],[12075,6]]},"775":{"position":[[4551,6],[5139,6],[11271,6],[12172,6],[19253,6]]},"777":{"position":[[4808,6],[5517,6],[11950,6]]},"789":{"position":[[4751,6],[5889,6]]},"795":{"position":[[2092,6],[7784,6],[13531,6],[14032,6],[19416,6]]},"797":{"position":[[6203,6],[12406,6],[13393,6],[20704,6],[21387,6],[27494,6]]},"799":{"position":[[2956,6],[3694,6],[10358,6],[17285,6]]},"801":{"position":[[6735,6],[9601,6]]},"820":{"position":[[3459,6],[3904,6],[9205,6],[14875,6],[15316,6],[20547,6],[26167,6],[33387,6],[39006,6]]},"822":{"position":[[4059,6],[4998,6],[12013,6]]},"824":{"position":[[3771,6],[4471,6],[10929,6]]},"826":{"position":[[4817,6],[5749,6],[12600,6],[18360,6],[24059,6],[29849,6],[35546,6]]},"844":{"position":[[3756,6],[4256,6],[9718,6],[15467,6],[15967,6],[21386,6],[27136,6],[33555,6],[34423,6],[41090,6]]},"846":{"position":[[1797,6],[9078,6]]},"848":{"position":[[8750,6],[9533,6],[16270,6],[16839,6],[22757,6],[23429,6],[29506,6],[30093,6],[35933,6],[36404,6],[41803,6],[42257,6],[47727,6],[53413,6]]}}}],["happen",{"_index":882,"t":{"107":{"position":[[306,6]]},"271":{"position":[[109,8],[162,9]]},"279":{"position":[[40,8]]},"281":{"position":[[938,8]]},"420":{"position":[[153,6],[574,7]]},"799":{"position":[[717,9]]},"824":{"position":[[23,7]]}}}],["hard",{"_index":1901,"t":{"472":{"position":[[293,5]]}}}],["have",{"_index":197,"t":{"7":{"position":[[774,6]]},"109":{"position":[[644,6]]},"153":{"position":[[451,6],[1351,6]]},"285":{"position":[[1024,6]]},"313":{"position":[[0,6]]},"345":{"position":[[280,6],[304,6]]},"355":{"position":[[853,6],[915,6]]},"386":{"position":[[137,6],[418,6],[476,6],[582,6],[658,6]]},"420":{"position":[[616,6]]},"498":{"position":[[70,6]]},"548":{"position":[[1226,6]]},"580":{"position":[[100,6]]},"728":{"position":[[23086,6]]},"730":{"position":[[288,6],[340,6]]},"732":{"position":[[1024,6],[1076,6]]},"734":{"position":[[360,6]]},"751":{"position":[[1268,6]]},"757":{"position":[[511,6]]},"773":{"position":[[190,6]]},"777":{"position":[[600,6],[2476,6]]},"807":{"position":[[1106,6],[1158,6]]},"809":{"position":[[360,6]]},"832":{"position":[[511,6]]}}}],["haven't",{"_index":1991,"t":{"484":{"position":[[1357,7]]}}}],["header",{"_index":1236,"t":{"185":{"position":[[2065,6]]},"214":{"position":[[358,7]]}}}],["health",{"_index":1441,"t":{"220":{"position":[[35,6],[77,6]]}}}],["healthcheck",{"_index":1363,"t":{"212":{"position":[[1794,12],[4431,12]]}}}],["healthz",{"_index":1442,"t":{"220":{"position":[[57,8]]}}}],["helm",{"_index":1068,"t":{"159":{"position":[[81,4],[160,4]]}}}],["help",{"_index":623,"t":{"45":{"position":[[3221,4]]},"95":{"position":[[199,7]]},"105":{"position":[[363,5]]},"109":{"position":[[359,4]]},"177":{"position":[[13,5]]},"189":{"position":[[185,7]]},"283":{"position":[[522,7]]},"331":{"position":[[52,4]]},"482":{"position":[[525,4]]},"484":{"position":[[1151,4]]},"486":{"position":[[419,4]]},"528":{"position":[[203,7]]},"566":{"position":[[200,7]]},"626":{"position":[[196,7]]},"713":{"position":[[182,7]]},"715":{"position":[[12,7]]},"734":{"position":[[182,7]]},"736":{"position":[[12,7]]},"757":{"position":[[182,7]]},"759":{"position":[[12,7]]},"809":{"position":[[182,7]]},"811":{"position":[[12,7]]},"832":{"position":[[182,7]]},"834":{"position":[[12,7]]}}}],["henri",{"_index":2271,"t":{"669":{"position":[[13533,5],[13845,5],[19572,5]]}}}],["here",{"_index":523,"t":{"39":{"position":[[282,5],[453,5]]},"153":{"position":[[596,4]]},"155":{"position":[[1171,4]]},"187":{"position":[[188,4]]},"210":{"position":[[253,4]]},"214":{"position":[[352,5]]},"373":{"position":[[292,5]]},"482":{"position":[[7406,5]]},"643":{"position":[[1509,5]]},"667":{"position":[[26955,4]]},"713":{"position":[[448,4],[842,4]]},"732":{"position":[[334,4],[609,4],[850,4],[1135,4]]},"734":{"position":[[617,4]]},"757":{"position":[[586,4],[885,4],[1165,4]]},"797":{"position":[[10182,4]]},"807":{"position":[[208,4],[499,4],[719,4],[1021,4],[1217,4]]},"809":{"position":[[617,4]]},"830":{"position":[[198,4],[445,4]]},"840":{"position":[[441,5]]},"842":{"position":[[808,4]]}}}],["here'",{"_index":2837,"t":{"826":{"position":[[338,6]]}}}],["hierarch",{"_index":1062,"t":{"155":{"position":[[2192,12],[2297,12]]}}}],["hierarchi",{"_index":1061,"t":{"155":{"position":[[2119,9]]}}}],["high",{"_index":269,"t":{"15":{"position":[[219,4]]},"19":{"position":[[237,4]]},"153":{"position":[[1330,4]]},"155":{"position":[[293,4],[1185,4],[1636,4],[2139,4],[2571,4]]},"327":{"position":[[698,5],[869,4],[1839,4],[2044,5],[2864,5],[3029,5],[3116,5],[3282,4]]},"329":{"position":[[263,4],[295,4],[344,4],[479,4],[584,4],[589,4],[673,4],[678,4],[683,4]]},"620":{"position":[[490,5],[513,4],[620,5],[643,4]]}}}],["higher",{"_index":1505,"t":{"228":{"position":[[864,6],[937,6]]},"719":{"position":[[189,6]]}}}],["highli",{"_index":35,"t":{"3":{"position":[[494,6]]},"45":{"position":[[3703,6]]},"726":{"position":[[27576,6]]},"765":{"position":[[544,6]]},"840":{"position":[[995,6]]}}}],["highlight",{"_index":182,"t":{"7":{"position":[[416,12]]},"478":{"position":[[442,9],[2184,9]]},"480":{"position":[[517,9],[686,9]]}}}],["hilton",{"_index":541,"t":{"39":{"position":[[532,6]]}}}],["hire",{"_index":1564,"t":{"283":{"position":[[147,5]]}}}],["histogram",{"_index":1491,"t":{"226":{"position":[[528,10]]}}}],["home/.openfga",{"_index":1329,"t":{"210":{"position":[[119,14]]}}}],["honor",{"_index":2075,"t":{"548":{"position":[[1748,5]]}}}],["hook",{"_index":1132,"t":{"171":{"position":[[754,4],[1148,6]]},"173":{"position":[[1994,5]]}}}],["hope",{"_index":890,"t":{"109":{"position":[[323,6]]}}}],["hopefulli",{"_index":2543,"t":{"751":{"position":[[900,9]]},"753":{"position":[[166,9]]}}}],["host",{"_index":534,"t":{"39":{"position":[[465,4],[781,4]]}}}],["hour",{"_index":2317,"t":{"689":{"position":[[606,6]]},"783":{"position":[[633,6]]},"789":{"position":[[463,5],[2501,5]]},"795":{"position":[[23424,6]]},"797":{"position":[[10230,4],[10305,5],[11085,5],[11237,5],[12632,5],[12843,5],[14673,5],[14835,5],[16290,5],[16451,5],[18213,5],[18369,5]]},"801":{"position":[[4657,5],[4807,5],[4959,5],[5112,5],[5264,5],[5415,5],[5566,5],[7788,5],[7997,5],[8208,5],[8420,5],[8631,5],[8841,5],[9051,5],[11512,5],[11672,5],[11834,5],[11997,5],[12159,5],[12320,5],[12481,5],[14563,5],[14722,5],[14883,5],[15045,5],[15206,5],[15366,5],[15526,5],[19792,5],[19946,5],[20102,5],[20259,5],[20415,5],[20570,5],[20725,5]]}}}],["http",{"_index":270,"t":{"15":{"position":[[244,4]]},"35":{"position":[[1072,6],[1082,8],[1103,7],[2262,6],[2272,8],[2293,7],[4092,6],[4102,8],[4123,7],[5577,6],[5587,8],[5608,7]]},"43":{"position":[[235,7],[682,6],[692,8],[713,7],[1630,6],[1640,8],[1661,7]]},"45":{"position":[[12627,6],[12637,8],[12658,7],[13481,6],[13491,8],[13512,7],[14780,6],[14790,8],[14811,7],[15891,6],[15901,8],[15922,7],[18821,6],[18831,8],[18852,7],[19675,6],[19685,8],[19706,7],[20974,6],[20984,8],[21005,7],[22085,6],[22095,8],[22116,7],[25175,6],[25185,8],[25206,7],[26050,6],[26060,8],[26081,7],[27403,6],[27413,8],[27434,7],[28556,6],[28566,8],[28587,7]]},"113":{"position":[[552,7]]},"133":{"position":[[345,6],[355,8],[376,7],[896,6],[906,8],[927,7],[1781,6],[1791,8],[1812,7],[2513,6],[2523,8],[2544,7]]},"145":{"position":[[345,6],[355,8],[376,7],[896,6],[906,8],[927,7],[1781,6],[1791,8],[1812,7],[2513,6],[2523,8],[2544,7]]},"151":{"position":[[144,4]]},"173":{"position":[[80,4],[1237,6],[1247,8],[1268,7],[4085,4],[4655,6],[4665,8],[4686,7]]},"183":{"position":[[294,6],[304,8],[325,7],[921,6],[931,8],[952,7],[1716,6],[1726,8],[1747,7],[2444,6],[2454,8],[2475,7]]},"185":{"position":[[642,6],[652,8],[673,7],[1410,6],[1420,8],[1441,7],[2444,6],[2454,8],[2475,7],[3546,6],[3556,8],[3577,7]]},"187":{"position":[[518,6],[528,8],[549,7],[1435,6],[1445,8],[1466,7],[2607,6],[2617,8],[2638,7],[4107,6],[4117,8],[4138,7]]},"200":{"position":[[458,6],[468,8],[489,7],[1267,6],[1277,8],[1298,7],[2676,6],[2686,8],[2707,7],[3811,6],[3821,8],[3842,7]]},"202":{"position":[[468,6],[478,8],[499,7],[1319,6],[1329,8],[1350,7],[2615,6],[2625,8],[2646,7],[3723,6],[3733,8],[3754,7],[6212,6],[6222,8],[6243,7],[7065,6],[7075,8],[7096,7],[8363,6],[8373,8],[8394,7],[9473,6],[9483,8],[9504,7]]},"208":{"position":[[279,4],[378,4]]},"212":{"position":[[2531,4],[5162,4]]},"214":{"position":[[475,4],[702,5],[979,4],[1054,4],[1157,4],[1301,4],[1590,4],[1616,4],[1665,4],[1909,4],[2151,5],[2504,4],[2579,4],[2682,4],[2826,4],[3143,4],[3169,4],[3218,4]]},"220":{"position":[[30,4]]},"248":{"position":[[345,6],[355,8],[376,7],[896,6],[906,8],[927,7],[1781,6],[1791,8],[1812,7],[2513,6],[2523,8],[2544,7]]},"265":{"position":[[768,6],[778,8],[799,7],[1609,6],[1619,8],[1640,7],[2895,6],[2905,8],[2926,7],[3993,6],[4003,8],[4024,7]]},"267":{"position":[[479,6],[489,8],[510,7],[1283,6],[1293,8],[1314,7],[2687,6],[2697,8],[2718,7],[3817,6],[3827,8],[3848,7],[6183,6],[6193,8],[6214,7],[7025,6],[7035,8],[7056,7],[8312,6],[8322,8],[8343,7],[9411,6],[9421,8],[9442,7]]},"277":{"position":[[317,6],[327,8],[348,7],[868,6],[878,8],[899,7],[1753,6],[1763,8],[1784,7],[2485,6],[2495,8],[2516,7]]},"285":{"position":[[1773,6],[1783,8],[1804,7],[2620,6],[2630,8],[2651,7],[3912,6],[3922,8],[3943,7],[5016,6],[5026,8],[5047,7],[7411,6],[7421,8],[7442,7],[8257,6],[8267,8],[8288,7],[9703,6],[9713,8],[9734,7],[10875,6],[10885,8],[10906,7],[13435,6],[13445,8],[13466,7],[14286,6],[14296,8],[14317,7],[15582,6],[15592,8],[15613,7],[16690,6],[16700,8],[16721,7],[19037,6],[19047,8],[19068,7],[19890,6],[19900,8],[19921,7],[21188,6],[21198,8],[21219,7],[22298,6],[22308,8],[22329,7]]},"294":{"position":[[720,6],[730,8],[751,7],[1528,6],[1538,8],[1559,7],[2936,6],[2946,8],[2967,7],[4070,6],[4080,8],[4101,7]]},"296":{"position":[[511,6],[521,8],[542,7],[1363,6],[1373,8],[1394,7],[2660,6],[2670,8],[2691,7],[3769,6],[3779,8],[3800,7]]},"311":{"position":[[565,6],[575,8],[596,7],[1365,6],[1375,8],[1396,7],[2765,6],[2775,8],[2796,7],[3891,6],[3901,8],[3922,7],[6146,6],[6156,8],[6177,7],[6947,6],[6957,8],[6978,7],[8348,6],[8358,8],[8379,7],[9475,6],[9485,8],[9506,7],[11960,6],[11970,8],[11991,7],[12930,6],[12940,8],[12961,7],[14575,6],[14585,8],[14606,7],[15908,6],[15918,8],[15939,7]]},"357":{"position":[[641,6],[651,8],[672,7],[1500,6],[1510,8],[1531,7],[2804,6],[2814,8],[2835,7],[3920,6],[3930,8],[3951,7]]},"369":{"position":[[607,6],[617,8],[638,7],[1459,6],[1469,8],[1490,7],[2756,6],[2766,8],[2787,7],[3865,6],[3875,8],[3896,7],[6217,6],[6227,8],[6248,7],[7068,6],[7078,8],[7099,7],[8364,6],[8374,8],[8395,7],[9472,6],[9482,8],[9503,7]]},"375":{"position":[[726,6],[736,8],[757,7],[1594,6],[1604,8],[1625,7],[3062,6],[3072,8],[3093,7],[4256,6],[4266,8],[4287,7],[6902,6],[6912,8],[6933,7],[7754,6],[7764,8],[7785,7],[9051,6],[9061,8],[9082,7],[10160,6],[10170,8],[10191,7],[12716,6],[12726,8],[12747,7],[13568,6],[13578,8],[13599,7],[14865,6],[14875,8],[14896,7],[15974,6],[15984,8],[16005,7]]},"382":{"position":[[1586,6],[1596,8],[1617,7],[2435,6],[2445,8],[2466,7],[3729,6],[3739,8],[3760,7],[4835,6],[4845,8],[4866,7]]},"402":{"position":[[520,6],[530,8],[551,7],[1341,6],[1351,8],[1372,7],[2762,6],[2772,8],[2793,7],[3909,6],[3919,8],[3940,7]]},"404":{"position":[[541,6],[551,8],[572,7],[1400,6],[1410,8],[1431,7],[2704,6],[2714,8],[2735,7],[3820,6],[3830,8],[3851,7],[6378,6],[6388,8],[6409,7],[7238,6],[7248,8],[7269,7],[8543,6],[8553,8],[8574,7],[9660,6],[9670,8],[9691,7]]},"444":{"position":[[589,6],[599,8],[620,7],[1563,6],[1573,8],[1594,7],[3196,6],[3206,8],[3227,7],[4506,6],[4516,8],[4537,7],[7343,6],[7353,8],[7374,7],[8197,6],[8207,8],[8228,7],[9496,6],[9506,8],[9527,7],[10607,6],[10617,8],[10638,7]]},"446":{"position":[[491,6],[501,8],[522,7],[1575,6],[1585,8],[1606,7],[3318,6],[3328,8],[3349,7],[4738,6],[4748,8],[4769,7]]},"448":{"position":[[437,6],[447,8],[468,7],[1291,6],[1301,8],[1322,7],[2590,6],[2600,8],[2621,7],[3701,6],[3711,8],[3732,7]]},"462":{"position":[[607,6],[617,8],[638,7],[1462,6],[1472,8],[1493,7],[2762,6],[2772,8],[2793,7],[3874,6],[3884,8],[3905,7],[6241,6],[6251,8],[6272,7],[7095,6],[7105,8],[7126,7],[8394,6],[8404,8],[8425,7],[9505,6],[9515,8],[9536,7]]},"466":{"position":[[567,6],[577,8],[598,7],[1423,6],[1433,8],[1454,7],[2724,6],[2734,8],[2755,7],[3837,6],[3847,8],[3868,7],[6366,6],[6376,8],[6397,7],[7222,6],[7232,8],[7253,7],[8523,6],[8533,8],[8554,7],[9636,6],[9646,8],[9667,7]]},"504":{"position":[[495,6],[505,8],[526,7],[1302,6],[1312,8],[1333,7],[2709,6],[2719,8],[2740,7],[3842,6],[3852,8],[3873,7]]},"506":{"position":[[497,6],[507,8],[528,7],[1384,6],[1394,8],[1415,7],[2871,6],[2881,8],[2902,7],[4084,6],[4094,8],[4115,7]]},"508":{"position":[[614,6],[624,8],[645,7],[1473,6],[1483,8],[1504,7],[2777,6],[2787,8],[2808,7],[3893,6],[3903,8],[3924,7]]},"522":{"position":[[681,6],[691,8],[712,7],[1540,6],[1550,8],[1571,7],[2999,6],[3009,8],[3030,7],[4184,6],[4194,8],[4215,7]]},"524":{"position":[[746,6],[756,8],[777,7],[1601,6],[1611,8],[1632,7],[2901,6],[2911,8],[2932,7],[4013,6],[4023,8],[4044,7]]},"540":{"position":[[504,6],[514,8],[535,7],[1313,6],[1323,8],[1344,7],[2722,6],[2732,8],[2753,7],[3857,6],[3867,8],[3888,7]]},"542":{"position":[[837,6],[847,8],[868,7],[1723,6],[1733,8],[1754,7],[3209,6],[3219,8],[3240,7],[4421,6],[4431,8],[4452,7]]},"544":{"position":[[674,6],[684,8],[705,7],[1535,6],[1545,8],[1566,7],[2841,6],[2851,8],[2872,7],[3959,6],[3969,8],[3990,7]]},"562":{"position":[[729,6],[739,8],[760,7],[1673,6],[1683,8],[1704,7],[3276,6],[3286,8],[3307,7],[4556,6],[4566,8],[4587,7],[7277,6],[7287,8],[7308,7],[8129,6],[8139,8],[8160,7],[9426,6],[9436,8],[9457,7],[10535,6],[10545,8],[10566,7],[13272,6],[13282,8],[13303,7],[14124,6],[14134,8],[14155,7],[15421,6],[15431,8],[15452,7],[16530,6],[16540,8],[16561,7],[18958,6],[18968,8],[18989,7],[19812,6],[19822,8],[19843,7],[21111,6],[21121,8],[21142,7],[22222,6],[22232,8],[22253,7],[24584,6],[24594,8],[24615,7],[25437,6],[25447,8],[25468,7],[26735,6],[26745,8],[26766,7],[27845,6],[27855,8],[27876,7]]},"574":{"position":[[583,6],[593,8],[614,7],[1443,6],[1453,8],[1474,7],[2962,6],[2972,8],[2993,7],[4158,6],[4168,8],[4189,7]]},"578":{"position":[[590,6],[600,8],[621,7],[1446,6],[1456,8],[1477,7],[2961,6],[2971,8],[2992,7],[4153,6],[4163,8],[4184,7]]},"580":{"position":[[601,6],[611,8],[632,7],[1409,6],[1419,8],[1440,7],[2817,6],[2827,8],[2848,7],[3951,6],[3961,8],[3982,7]]},"582":{"position":[[447,6],[457,8],[478,7],[1287,6],[1297,8],[1318,7],[2572,6],[2582,8],[2603,7],[3669,6],[3679,8],[3700,7],[5961,6],[5971,8],[5992,7],[6801,6],[6811,8],[6832,7],[8086,6],[8096,8],[8117,7],[9183,6],[9193,8],[9214,7]]},"584":{"position":[[484,6],[494,8],[515,7],[1284,6],[1294,8],[1315,7],[2684,6],[2694,8],[2715,7],[3810,6],[3820,8],[3841,7],[6021,6],[6031,8],[6052,7],[6862,6],[6872,8],[6893,7],[8148,6],[8158,8],[8179,7],[9246,6],[9256,8],[9277,7]]},"599":{"position":[[606,6],[616,8],[637,7],[1456,6],[1466,8],[1487,7],[2751,6],[2761,8],[2782,7],[3858,6],[3868,8],[3889,7]]},"606":{"position":[[856,6],[866,8],[887,7],[1751,6],[1761,8],[1782,7],[3143,6],[3153,8],[3174,7],[4303,6],[4313,8],[4334,7],[7012,6],[7022,8],[7043,7],[7888,6],[7898,8],[7919,7],[9241,6],[9251,8],[9272,7],[10380,6],[10390,8],[10411,7],[12993,6],[13003,8],[13024,7],[13879,6],[13889,8],[13910,7],[15242,6],[15252,8],[15273,7],[16391,6],[16401,8],[16422,7]]},"608":{"position":[[1059,6],[1069,8],[1090,7],[1836,6],[1846,8],[1867,7],[3110,6],[3120,8],[3141,7],[4152,6],[4162,8],[4183,7]]},"613":{"position":[[597,6],[607,8],[628,7],[1486,6],[1496,8],[1517,7],[2847,6],[2857,8],[2878,7],[4016,6],[4026,8],[4047,7],[6509,6],[6519,8],[6540,7],[7398,6],[7408,8],[7429,7],[8759,6],[8769,8],[8790,7],[9928,6],[9938,8],[9959,7]]},"618":{"position":[[518,6],[528,8],[549,7],[1500,6],[1510,8],[1531,7],[2962,6],[2972,8],[2993,7],[4236,6],[4246,8],[4267,7]]},"637":{"position":[[733,6],[743,8],[764,7],[1658,6],[1668,8],[1689,7],[3183,6],[3193,8],[3214,7],[4434,6],[4444,8],[4465,7]]},"639":{"position":[[548,6],[558,8],[579,7],[1410,6],[1420,8],[1441,7],[2717,6],[2727,8],[2748,7],[3836,6],[3846,8],[3867,7]]},"645":{"position":[[458,6],[468,8],[489,7],[1482,6],[1492,8],[1513,7],[3165,6],[3175,8],[3196,7],[4525,6],[4535,8],[4556,7]]},"647":{"position":[[477,6],[487,8],[508,7],[1331,6],[1341,8],[1362,7],[2630,6],[2640,8],[2661,7],[3741,6],[3751,8],[3772,7]]},"649":{"position":[[458,6],[468,8],[489,7],[1338,6],[1348,8],[1369,7],[2818,6],[2828,8],[2849,7],[4024,6],[4034,8],[4055,7],[6516,6],[6526,8],[6547,7],[7371,6],[7381,8],[7402,7],[8671,6],[8681,8],[8702,7],[9783,6],[9793,8],[9814,7],[12149,6],[12159,8],[12180,7],[13007,6],[13017,8],[13038,7],[14310,6],[14320,8],[14341,7],[15425,6],[15435,8],[15456,7]]},"667":{"position":[[1737,6],[1747,8],[1768,7],[2588,6],[2598,8],[2619,7],[3884,6],[3894,8],[3915,7],[4992,6],[5002,8],[5023,7],[7909,6],[7919,8],[7940,7],[8760,6],[8770,8],[8791,7],[10056,6],[10066,8],[10087,7],[11164,6],[11174,8],[11195,7],[14730,6],[14740,8],[14761,7],[15584,6],[15594,8],[15615,7],[16883,6],[16893,8],[16914,7],[17994,6],[18004,8],[18025,7],[21567,6],[21577,8],[21598,7],[22418,6],[22428,8],[22449,7],[23714,6],[23724,8],[23745,7],[24822,6],[24832,8],[24853,7],[27803,6],[27813,8],[27834,7],[28655,6],[28665,8],[28686,7],[29952,6],[29962,8],[29983,7],[31061,6],[31071,8],[31092,7]]},"669":{"position":[[1710,6],[1720,8],[1741,7],[2562,6],[2572,8],[2593,7],[3859,6],[3869,8],[3890,7],[4968,6],[4978,8],[4999,7],[7959,6],[7969,8],[7990,7],[8814,6],[8824,8],[8845,7],[10114,6],[10124,8],[10145,7],[11226,6],[11236,8],[11257,7],[14303,6],[14313,8],[14334,7],[15156,6],[15166,8],[15187,7],[16454,6],[16464,8],[16485,7],[17564,6],[17574,8],[17595,7],[20626,6],[20636,8],[20657,7],[21479,6],[21489,8],[21510,7],[22777,6],[22787,8],[22808,7],[23887,6],[23897,8],[23918,7]]},"679":{"position":[[1424,6],[1434,8],[1455,7],[2277,6],[2287,8],[2308,7],[3575,6],[3585,8],[3606,7],[4685,6],[4695,8],[4716,7],[7042,6],[7052,8],[7073,7],[7894,6],[7904,8],[7925,7],[9191,6],[9201,8],[9222,7],[10300,6],[10310,8],[10331,7]]},"681":{"position":[[548,6],[558,8],[579,7],[1408,6],[1418,8],[1439,7],[2868,6],[2878,8],[2899,7],[4054,6],[4064,8],[4085,7],[6432,6],[6442,8],[6463,7],[7288,6],[7298,8],[7319,7],[8589,6],[8599,8],[8620,7],[9702,6],[9712,8],[9733,7]]},"683":{"position":[[523,6],[533,8],[554,7],[1486,6],[1496,8],[1517,7],[2886,6],[2896,8],[2917,7],[4108,6],[4118,8],[4139,7],[6800,6],[6810,8],[6831,7],[7685,6],[7695,8],[7716,7],[9229,6],[9239,8],[9260,7],[10450,6],[10460,8],[10481,7],[13062,6],[13072,8],[13093,7],[13948,6],[13958,8],[13979,7],[15493,6],[15503,8],[15524,7],[16715,6],[16725,8],[16746,7],[19364,6],[19374,8],[19395,7],[20217,6],[20227,8],[20248,7],[21515,6],[21525,8],[21546,7],[22625,6],[22635,8],[22656,7],[25027,6],[25037,8],[25058,7],[25878,6],[25888,8],[25909,7],[27174,6],[27184,8],[27205,7],[28282,6],[28292,8],[28313,7]]},"703":{"position":[[5109,6],[5119,8],[5140,7],[5986,6],[5996,8],[6017,7],[7463,6],[7473,8],[7494,7],[8666,6],[8676,8],[8697,7]]},"705":{"position":[[1500,6],[1510,8],[1531,7],[2405,6],[2415,8],[2436,7],[3910,6],[3920,8],[3941,7],[5141,6],[5151,8],[5172,7]]},"726":{"position":[[562,6],[572,8],[593,7],[2216,6],[2226,8],[2247,7],[4765,6],[4775,8],[4796,7],[6795,6],[6805,8],[6826,7],[11880,6],[11890,8],[11911,7],[13074,6],[13084,8],[13105,7],[14986,6],[14996,8],[15017,7],[16526,6],[16536,8],[16557,7],[20017,6],[20027,8],[20048,7],[21141,6],[21151,8],[21172,7],[22983,6],[22993,8],[23014,7],[24453,6],[24463,8],[24484,7],[28616,6],[28626,8],[28647,7],[29468,6],[29478,8],[29499,7],[30765,6],[30775,8],[30796,7],[31874,6],[31884,8],[31905,7],[34375,6],[34385,8],[34406,7],[35228,6],[35238,8],[35259,7],[36526,6],[36536,8],[36557,7],[37636,6],[37646,8],[37667,7],[39992,6],[40002,8],[40023,7],[40848,6],[40858,8],[40879,7],[42149,6],[42159,8],[42180,7],[43262,6],[43272,8],[43293,7],[45634,6],[45644,8],[45665,7],[46491,6],[46501,8],[46522,7],[47793,6],[47803,8],[47824,7],[48907,6],[48917,8],[48938,7]]},"728":{"position":[[658,6],[668,8],[689,7],[1511,6],[1521,8],[1542,7],[2809,6],[2819,8],[2840,7],[3919,6],[3929,8],[3950,7],[8577,6],[8587,8],[8608,7],[9426,6],[9436,8],[9457,7],[10720,6],[10730,8],[10751,7],[11826,6],[11836,8],[11857,7],[14494,6],[14504,8],[14525,7],[15352,6],[15362,8],[15383,7],[16655,6],[16665,8],[16686,7],[17770,6],[17780,8],[17801,7],[24912,6],[24922,8],[24943,7],[25769,6],[25779,8],[25800,7],[27071,6],[27081,8],[27102,7],[28185,6],[28195,8],[28216,7],[33160,6],[33170,8],[33191,7],[34008,6],[34018,8],[34039,7],[35301,6],[35311,8],[35332,7],[36406,6],[36416,8],[36437,7],[42695,6],[42705,8],[42726,7],[43543,6],[43553,8],[43574,7],[44836,6],[44846,8],[44867,7],[45941,6],[45951,8],[45972,7]]},"745":{"position":[[2189,6],[2199,8],[2220,7],[3005,6],[3015,8],[3036,7],[4421,6],[4431,8],[4452,7],[5563,6],[5573,8],[5594,7],[7873,6],[7883,8],[7904,7],[8727,6],[8737,8],[8758,7],[10026,6],[10036,8],[10057,7],[11137,6],[11147,8],[11168,7],[13563,6],[13573,8],[13594,7],[14379,6],[14389,8],[14410,7],[15795,6],[15805,8],[15826,7],[16937,6],[16947,8],[16968,7],[19204,6],[19214,8],[19235,7],[20058,6],[20068,8],[20089,7],[21357,6],[21367,8],[21388,7],[22468,6],[22478,8],[22499,7],[24830,6],[24840,8],[24861,7],[25685,6],[25695,8],[25716,7],[26985,6],[26995,8],[27016,7],[28097,6],[28107,8],[28128,7],[32564,6],[32574,8],[32595,7],[33418,6],[33428,8],[33449,7],[34717,6],[34727,8],[34748,7],[35828,6],[35838,8],[35859,7],[38190,6],[38200,8],[38221,7],[39044,6],[39054,8],[39075,7],[40343,6],[40353,8],[40374,7],[41454,6],[41464,8],[41485,7]]},"747":{"position":[[2718,6],[2728,8],[2749,7],[3763,6],[3773,8],[3794,7],[5467,6],[5477,8],[5498,7],[6848,6],[6858,8],[6879,7],[10032,6],[10042,8],[10063,7],[10888,6],[10898,8],[10919,7],[12189,6],[12199,8],[12220,7],[13302,6],[13312,8],[13333,7]]},"749":{"position":[[663,6],[673,8],[694,7],[1503,6],[1513,8],[1534,7],[2943,6],[2953,8],[2974,7],[4109,6],[4119,8],[4140,7],[6904,6],[6914,8],[6935,7],[7776,6],[7786,8],[7807,7],[9248,6],[9258,8],[9279,7],[10446,6],[10456,8],[10477,7],[12795,6],[12805,8],[12826,7],[13649,6],[13659,8],[13680,7],[14948,6],[14958,8],[14979,7],[16059,6],[16069,8],[16090,7]]},"751":{"position":[[3360,6],[3370,8],[3391,7],[4260,6],[4270,8],[4291,7],[5819,6],[5829,8],[5850,7],[7055,6],[7065,8],[7086,7],[10244,6],[10254,8],[10275,7],[11102,6],[11112,8],[11133,7],[12405,6],[12415,8],[12436,7],[13520,6],[13530,8],[13551,7],[17678,6],[17688,8],[17709,7],[18516,6],[18526,8],[18547,7],[19954,6],[19964,8],[19985,7],[21118,6],[21128,8],[21149,7]]},"771":{"position":[[875,6],[885,8],[906,7],[1690,6],[1700,8],[1721,7],[3105,6],[3115,8],[3136,7],[4246,6],[4256,8],[4277,7],[6523,6],[6533,8],[6554,7],[7342,6],[7352,8],[7373,7],[8761,6],[8771,8],[8792,7],[9906,6],[9916,8],[9937,7],[12207,6],[12217,8],[12238,7],[13169,6],[13179,8],[13200,7],[14849,6],[14859,8],[14880,7],[16157,6],[16167,8],[16188,7],[19441,6],[19451,8],[19472,7],[20294,6],[20304,8],[20325,7],[21592,6],[21602,8],[21623,7],[22702,6],[22712,8],[22733,7],[25140,6],[25150,8],[25171,7],[25991,6],[26001,8],[26022,7],[27287,6],[27297,8],[27318,7],[28395,6],[28405,8],[28426,7]]},"773":{"position":[[3293,6],[3303,8],[3324,7],[4308,6],[4318,8],[4339,7],[6100,6],[6110,8],[6131,7],[7471,6],[7481,8],[7502,7],[10769,6],[10779,8],[10800,7],[11625,6],[11635,8],[11656,7],[12926,6],[12936,8],[12957,7],[14039,6],[14049,8],[14070,7]]},"775":{"position":[[3198,6],[3208,8],[3229,7],[4101,6],[4111,8],[4132,7],[5663,6],[5673,8],[5694,7],[6902,6],[6912,8],[6933,7],[9723,6],[9733,8],[9754,7],[10821,6],[10831,8],[10852,7],[12696,6],[12706,8],[12727,7],[14150,6],[14160,8],[14181,7],[17953,6],[17963,8],[17984,7],[18803,6],[18813,8],[18834,7],[20098,6],[20108,8],[20129,7],[21205,6],[21215,8],[21236,7]]},"777":{"position":[[3393,6],[3403,8],[3424,7],[4358,6],[4368,8],[4389,7],[6041,6],[6051,8],[6072,7],[7352,6],[7362,8],[7383,7],[10645,6],[10655,8],[10676,7],[11500,6],[11510,8],[11531,7],[12800,6],[12810,8],[12831,7],[13912,6],[13922,8],[13943,7]]},"789":{"position":[[2966,6],[2976,8],[2997,7],[4301,6],[4311,8],[4332,7],[6413,6],[6423,8],[6444,7],[8104,6],[8114,8],[8135,7]]},"795":{"position":[[793,6],[803,8],[824,7],[1642,6],[1652,8],[1673,7],[2936,6],[2946,8],[2967,7],[4042,6],[4052,8],[4073,7],[6481,6],[6491,8],[6512,7],[7334,6],[7344,8],[7365,7],[8632,6],[8642,8],[8663,7],[9742,6],[9752,8],[9773,7],[12206,6],[12216,8],[12237,7],[13081,6],[13091,8],[13112,7],[14556,6],[14566,8],[14587,7],[15757,6],[15767,8],[15788,7],[18116,6],[18126,8],[18147,7],[18966,6],[18976,8],[18997,7],[20261,6],[20271,8],[20292,7],[21368,6],[21378,8],[21399,7]]},"797":{"position":[[4908,6],[4918,8],[4939,7],[5753,6],[5763,8],[5784,7],[7043,6],[7053,8],[7074,7],[8145,6],[8155,8],[8176,7],[10713,6],[10723,8],[10744,7],[11956,6],[11966,8],[11987,7],[13917,6],[13927,8],[13948,7],[15506,6],[15516,8],[15537,7],[19256,6],[19266,8],[19287,7],[20254,6],[20264,8],[20285,7],[21911,6],[21921,8],[21942,7],[23245,6],[23255,8],[23276,7],[26195,6],[26205,8],[26226,7],[27044,6],[27054,8],[27075,7],[28338,6],[28348,8],[28369,7],[29444,6],[29454,8],[29475,7]]},"799":{"position":[[1453,6],[1463,8],[1484,7],[2506,6],[2516,8],[2537,7],[4218,6],[4228,8],[4249,7],[5607,6],[5617,8],[5638,7],[8890,6],[8900,8],[8921,7],[9908,6],[9918,8],[9939,7],[11390,6],[11400,8],[11421,7],[12697,6],[12707,8],[12728,7],[15816,6],[15826,8],[15847,7],[16835,6],[16845,8],[16866,7],[18318,6],[18328,8],[18349,7],[19626,6],[19636,8],[19657,7]]},"801":{"position":[[3694,6],[3704,8],[3725,7],[6285,6],[6295,8],[6316,7],[10125,6],[10135,8],[10156,7],[13152,6],[13162,8],[13183,7]]},"820":{"position":[[2190,6],[2200,8],[2221,7],[3009,6],[3019,8],[3040,7],[4428,6],[4438,8],[4459,7],[5573,6],[5583,8],[5604,7],[7898,6],[7908,8],[7929,7],[8755,6],[8765,8],[8786,7],[10057,6],[10067,8],[10088,7],[11171,6],[11181,8],[11202,7],[13610,6],[13620,8],[13641,7],[14425,6],[14435,8],[14456,7],[15840,6],[15850,8],[15871,7],[16981,6],[16991,8],[17012,7],[19244,6],[19254,8],[19275,7],[20097,6],[20107,8],[20128,7],[21395,6],[21405,8],[21426,7],[22505,6],[22515,8],[22536,7],[24862,6],[24872,8],[24893,7],[25717,6],[25727,8],[25748,7],[27017,6],[27027,8],[27048,7],[28129,6],[28139,8],[28160,7],[32084,6],[32094,8],[32115,7],[32937,6],[32947,8],[32968,7],[34235,6],[34245,8],[34266,7],[35345,6],[35355,8],[35376,7],[37702,6],[37712,8],[37733,7],[38556,6],[38566,8],[38587,7],[39855,6],[39865,8],[39886,7],[40966,6],[40976,8],[40997,7]]},"822":{"position":[[2473,6],[2483,8],[2504,7],[3609,6],[3619,8],[3640,7],[5522,6],[5532,8],[5553,7],[7014,6],[7024,8],[7045,7],[10706,6],[10716,8],[10737,7],[11563,6],[11573,8],[11594,7],[12865,6],[12875,8],[12896,7],[13979,6],[13989,8],[14010,7]]},"824":{"position":[[2306,6],[2316,8],[2337,7],[3321,6],[3331,8],[3352,7],[4995,6],[5005,8],[5026,7],[6346,6],[6356,8],[6377,7],[9619,6],[9629,8],[9650,7],[10479,6],[10489,8],[10510,7],[11784,6],[11794,8],[11815,7],[12901,6],[12911,8],[12932,7]]},"826":{"position":[[3179,6],[3189,8],[3210,7],[4367,6],[4377,8],[4398,7],[6273,6],[6283,8],[6304,7],[7807,6],[7817,8],[7838,7],[11289,6],[11299,8],[11320,7],[12150,6],[12160,8],[12181,7],[13456,6],[13466,8],[13487,7],[14574,6],[14584,8],[14605,7],[17047,6],[17057,8],[17078,7],[17910,6],[17920,8],[17941,7],[19218,6],[19228,8],[19249,7],[20338,6],[20348,8],[20369,7],[22744,6],[22754,8],[22775,7],[23609,6],[23619,8],[23640,7],[24919,6],[24929,8],[24950,7],[26041,6],[26051,8],[26072,7],[28536,6],[28546,8],[28567,7],[29399,6],[29409,8],[29430,7],[30707,6],[30717,8],[30738,7],[31827,6],[31837,8],[31858,7],[34233,6],[34243,8],[34264,7],[35096,6],[35106,8],[35127,7],[36404,6],[36414,8],[36435,7],[37524,6],[37534,8],[37555,7]]},"844":{"position":[[2432,6],[2442,8],[2463,7],[3306,6],[3316,8],[3337,7],[4780,6],[4790,8],[4811,7],[5980,6],[5990,8],[6011,7],[8409,6],[8419,8],[8440,7],[9268,6],[9278,8],[9299,7],[10572,6],[10582,8],[10603,7],[11688,6],[11698,8],[11719,7],[14143,6],[14153,8],[14174,7],[15017,6],[15027,8],[15048,7],[16491,6],[16501,8],[16522,7],[17691,6],[17701,8],[17722,7],[20077,6],[20087,8],[20108,7],[20936,6],[20946,8],[20967,7],[22240,6],[22250,8],[22271,7],[23356,6],[23366,8],[23387,7],[25820,6],[25830,8],[25851,7],[26686,6],[26696,8],[26717,7],[27997,6],[28007,8],[28028,7],[29120,6],[29130,8],[29151,7],[31981,6],[31991,8],[32012,7],[33105,6],[33115,8],[33136,7],[34947,6],[34957,8],[34978,7],[36417,6],[36427,8],[36448,7],[39781,6],[39791,8],[39812,7],[40640,6],[40650,8],[40671,7],[41944,6],[41954,8],[41975,7],[43060,6],[43070,8],[43091,7]]},"846":{"position":[[493,6],[503,8],[524,7],[1347,6],[1357,8],[1378,7],[2646,6],[2656,8],[2677,7],[3757,6],[3767,8],[3788,7],[7775,6],[7785,8],[7806,7],[8628,6],[8638,8],[8659,7],[9926,6],[9936,8],[9957,7],[11036,6],[11046,8],[11067,7]]},"848":{"position":[[7261,6],[7271,8],[7292,7],[8300,6],[8310,8],[8331,7],[10057,6],[10067,8],[10088,7],[11442,6],[11452,8],[11473,7],[14877,6],[14887,8],[14908,7],[15820,6],[15830,8],[15851,7],[17363,6],[17373,8],[17394,7],[18632,6],[18642,8],[18663,7],[21320,6],[21330,8],[21351,7],[22307,6],[22317,8],[22338,7],[23953,6],[23963,8],[23984,7],[25276,6],[25286,8],[25307,7],[28154,6],[28164,8],[28185,7],[29056,6],[29066,8],[29087,7],[30617,6],[30627,8],[30648,7],[31855,6],[31865,8],[31886,7],[34638,6],[34648,8],[34669,7],[35483,6],[35493,8],[35514,7],[36928,6],[36938,8],[36959,7],[38099,6],[38109,8],[38130,7],[40525,6],[40535,8],[40556,7],[41353,6],[41363,8],[41384,7],[42781,6],[42791,8],[42812,7],[43935,6],[43945,8],[43966,7],[46426,6],[46436,8],[46457,7],[47277,6],[47287,8],[47308,7],[48573,6],[48583,8],[48604,7],[49681,6],[49691,8],[49712,7],[52097,6],[52107,8],[52128,7],[52963,6],[52973,8],[52994,7],[54274,6],[54284,8],[54305,7],[55397,6],[55407,8],[55428,7]]}}}],["http://localhost:3000/playground",{"_index":1428,"t":{"216":{"position":[[266,32]]}}}],["http://localhost:8080",{"_index":1219,"t":{"183":{"position":[[3107,21]]},"185":{"position":[[4236,21]]},"187":{"position":[[4797,21]]}}}],["https://api.fga.exampl",{"_index":409,"t":{"35":{"position":[[1218,24],[2409,24],[4265,24],[5730,24],[6980,24],[7069,24],[7562,24],[7651,24]]},"43":{"position":[[829,24],[1803,24]]},"45":{"position":[[12773,24],[13628,24],[14953,24],[16044,24],[16819,24],[16908,24],[17144,24],[17233,24],[18967,24],[19822,24],[21147,24],[22238,24],[23013,24],[23102,24],[23338,24],[23427,24],[25321,24],[26197,24],[27576,24],[28709,24],[29521,24],[29610,24],[29882,24],[29971,24]]},"133":{"position":[[491,24],[1043,24],[1954,24],[2666,24],[3199,24],[3316,24]]},"145":{"position":[[491,24],[1043,24],[1954,24],[2666,24],[3199,24],[3316,24]]},"173":{"position":[[4802,24]]},"183":{"position":[[440,24],[1068,24],[1889,24],[2597,24]]},"185":{"position":[[788,24],[1557,24],[2617,24],[3699,24]]},"187":{"position":[[664,24],[1582,24],[2780,24],[4260,24]]},"200":{"position":[[604,24],[1414,24],[2849,24],[3964,24],[4745,24],[4834,24],[5279,24],[5368,24]]},"202":{"position":[[614,24],[1466,24],[2788,24],[3876,24],[4648,24],[4737,24],[4970,24],[5059,24],[6358,24],[7212,24],[8536,24],[9626,24],[10400,24],[10489,24],[10724,24],[10813,24]]},"248":{"position":[[491,24],[1043,24],[1954,24],[2666,24],[3199,24],[3316,24]]},"265":{"position":[[914,24],[1756,24],[3068,24],[4146,24],[4908,24],[4997,24],[5220,24],[5309,24]]},"267":{"position":[[625,24],[1430,24],[2860,24],[3970,24],[4748,24],[4837,24],[5277,24],[5366,24],[6329,24],[7172,24],[8485,24],[9564,24],[10327,24],[10416,24],[10640,24],[10729,24]]},"277":{"position":[[463,24],[1015,24],[1926,24],[2638,24],[3199,24]]},"285":{"position":[[1919,24],[2767,24],[4085,24],[5169,24],[5937,24],[6026,24],[6255,24],[6344,24],[7557,24],[8404,24],[9876,24],[11028,24],[11845,24],[11934,24],[12377,24],[12466,24],[13581,24],[14433,24],[15755,24],[16843,24],[17615,24],[17704,24],[17937,24],[18026,24],[19183,24],[20037,24],[21361,24],[22451,24],[23225,24],[23314,24],[23549,24],[23638,24]]},"294":{"position":[[866,24],[1675,24],[3109,24],[4223,24],[5005,24],[5094,24],[5538,24],[5627,24]]},"296":{"position":[[657,24],[1510,24],[2833,24],[3922,24],[4695,24],[4784,24],[5018,24],[5107,24]]},"311":{"position":[[711,24],[1512,24],[2938,24],[4044,24],[4816,24],[4905,24],[5341,24],[5430,24],[6292,24],[7094,24],[8521,24],[9628,24],[10403,24],[10492,24],[10929,24],[11018,24],[12106,24],[13077,24],[14748,24],[16061,24],[17013,24],[17102,24]]},"357":{"position":[[787,24],[1647,24],[2977,24],[4073,24],[4853,24],[4942,24],[5183,24],[5272,24]]},"369":{"position":[[753,24],[1606,24],[2929,24],[4018,24],[4791,24],[4880,24],[5114,24],[5203,24],[6363,24],[7215,24],[8537,24],[9625,24],[10397,24],[10486,24],[10719,24],[10808,24]]},"375":{"position":[[872,24],[1741,24],[3235,24],[4409,24],[5248,24],[5337,24],[5787,24],[5876,24],[7048,24],[7901,24],[9224,24],[10313,24],[11086,24],[11175,24],[11409,24],[11498,24],[12862,24],[13715,24],[15038,24],[16127,24],[16900,24],[16989,24],[17223,24],[17312,24]]},"382":{"position":[[1732,24],[2582,24],[3902,24],[4988,24],[5758,24],[5847,24],[6078,24],[6167,24]]},"402":{"position":[[666,24],[1488,24],[2935,24],[4062,24],[4855,24],[4944,24],[5401,24],[5490,24]]},"404":{"position":[[687,24],[1547,24],[2877,24],[3973,24],[4753,24],[4842,24],[5083,24],[5172,24],[6524,24],[7385,24],[8716,24],[9813,24],[10594,24],[10683,24],[10925,24],[11014,24]]},"444":{"position":[[735,24],[1710,24],[3369,24],[4659,24],[5613,24],[5702,24],[6226,24],[6315,24],[7489,24],[8344,24],[9669,24],[10760,24],[11535,24],[11624,24],[11860,24],[11949,24]]},"446":{"position":[[637,24],[1722,24],[3491,24],[4891,24],[5955,24],[6044,24],[6604,24],[6693,24]]},"448":{"position":[[583,24],[1438,24],[2763,24],[3854,24],[4629,24],[4718,24],[4954,24],[5043,24]]},"462":{"position":[[753,24],[1609,24],[2935,24],[4027,24],[4803,24],[4892,24],[5129,24],[5218,24],[6387,24],[7242,24],[8567,24],[9658,24],[10433,24],[10522,24],[10758,24],[10847,24]]},"466":{"position":[[713,24],[1570,24],[2897,24],[3990,24],[4767,24],[4856,24],[5094,24],[5183,24],[6512,24],[7369,24],[8696,24],[9789,24],[10566,24],[10655,24],[10893,24],[10982,24]]},"504":{"position":[[641,24],[1449,24],[2882,24],[3995,24],[4774,24],[4863,24],[5306,24],[5395,24]]},"506":{"position":[[643,24],[1531,24],[3044,24],[4237,24],[5095,24],[5184,24],[5645,24],[5734,24]]},"508":{"position":[[760,24],[1620,24],[2950,24],[4046,24],[4826,24],[4915,24],[5156,24],[5245,24]]},"522":{"position":[[827,24],[1687,24],[3172,24],[4337,24],[5167,24],[5256,24],[5707,24],[5796,24]]},"524":{"position":[[892,24],[1748,24],[3074,24],[4166,24],[4942,24],[5031,24],[5268,24],[5357,24]]},"540":{"position":[[650,24],[1460,24],[2895,24],[4010,24],[4791,24],[4880,24],[5325,24],[5414,24]]},"542":{"position":[[983,24],[1870,24],[3382,24],[4574,24],[5431,24],[5520,24],[5988,24],[6077,24]]},"544":{"position":[[820,24],[1682,24],[3014,24],[4112,24],[4894,24],[4983,24],[5226,24],[5315,24]]},"562":{"position":[[875,24],[1820,24],[3449,24],[4709,24],[5633,24],[5722,24],[6228,24],[6317,24],[7423,24],[8276,24],[9599,24],[10688,24],[11461,24],[11550,24],[11784,24],[11873,24],[13418,24],[14271,24],[15594,24],[16683,24],[17456,24],[17545,24],[17779,24],[17868,24],[19104,24],[19959,24],[21284,24],[22375,24],[23150,24],[23239,24],[23475,24],[23564,24],[24730,24],[25584,24],[26908,24],[27998,24],[28772,24],[28861,24],[29096,24],[29185,24]]},"574":{"position":[[729,24],[1590,24],[3135,24],[4311,24],[5153,24],[5242,24],[5737,24],[5826,24]]},"578":{"position":[[736,24],[1593,24],[3134,24],[4306,24],[5144,24],[5233,24],[5724,24],[5813,24]]},"580":{"position":[[747,24],[1556,24],[2990,24],[4104,24],[4884,24],[4973,24],[5417,24],[5506,24]]},"582":{"position":[[593,24],[1434,24],[2745,24],[3822,24],[4583,24],[4672,24],[4894,24],[4983,24],[6107,24],[6948,24],[8259,24],[9336,24],[10097,24],[10186,24],[10408,24],[10497,24]]},"584":{"position":[[630,24],[1431,24],[2857,24],[3963,24],[4737,24],[4826,24],[5262,24],[5351,24],[6167,24],[7009,24],[8321,24],[9399,24],[10161,24],[10250,24],[10473,24],[10562,24]]},"599":{"position":[[752,24],[1603,24],[2924,24],[4011,24],[4782,24],[4871,24],[5103,24],[5192,24]]},"606":{"position":[[1002,24],[1898,24],[3316,24],[4456,24],[5284,24],[5373,24],[5557,24],[5646,24],[7158,24],[8035,24],[9414,24],[10533,24],[11342,24],[11431,24],[11597,24],[11686,24],[13139,24],[14026,24],[15415,24],[16544,24],[17363,24],[17452,24],[17628,24],[17717,24]]},"608":{"position":[[1205,24],[1983,24],[3283,24],[4305,24],[5015,24],[5104,24],[5288,24],[5377,24]]},"613":{"position":[[743,24],[1633,24],[3020,24],[4169,24],[4943,24],[5032,24],[5255,24],[5344,24],[6655,24],[7545,24],[8932,24],[10081,24],[10855,24],[10944,24],[11167,24],[11256,24]]},"618":{"position":[[664,24],[1647,24],[3135,24],[4389,24],[5302,24],[5391,24],[5718,24],[5807,24]]},"637":{"position":[[879,24],[1805,24],[3356,24],[4587,24],[5483,24],[5572,24],[6032,24],[6121,24]]},"639":{"position":[[694,24],[1557,24],[2890,24],[3989,24],[4772,24],[4861,24],[5105,24],[5194,24]]},"645":{"position":[[604,24],[1629,24],[3338,24],[4678,24],[5682,24],[5771,24],[6313,24],[6402,24]]},"647":{"position":[[623,24],[1478,24],[2803,24],[3894,24],[4669,24],[4758,24],[4994,24],[5083,24]]},"649":{"position":[[604,24],[1485,24],[2991,24],[4177,24],[5030,24],[5119,24],[5585,24],[5674,24],[6662,24],[7518,24],[8844,24],[9936,24],[10712,24],[10801,24],[11038,24],[11127,24],[12295,24],[13154,24],[14483,24],[15578,24],[16357,24],[16446,24],[16686,24],[16775,24]]},"667":{"position":[[1883,24],[2735,24],[4057,24],[5145,24],[5917,24],[6006,24],[6239,24],[6328,24],[8055,24],[8907,24],[10229,24],[11317,24],[12089,24],[12178,24],[12411,24],[12500,24],[14876,24],[15731,24],[17056,24],[18147,24],[18922,24],[19011,24],[19247,24],[19336,24],[21713,24],[22565,24],[23887,24],[24975,24],[25747,24],[25836,24],[26069,24],[26158,24],[27949,24],[28802,24],[30125,24],[31214,24],[31987,24],[32076,24],[32310,24],[32399,24]]},"669":{"position":[[1856,24],[2709,24],[4032,24],[5121,24],[5894,24],[5983,24],[6217,24],[6306,24],[8105,24],[8961,24],[10287,24],[11379,24],[12155,24],[12244,24],[12481,24],[12570,24],[14449,24],[15303,24],[16627,24],[17717,24],[18491,24],[18580,24],[18815,24],[18904,24],[20772,24],[21626,24],[22950,24],[24040,24],[24814,24],[24903,24],[25138,24],[25227,24]]},"679":{"position":[[1570,24],[2424,24],[3748,24],[4838,24],[5612,24],[5701,24],[5936,24],[6025,24],[7188,24],[8041,24],[9364,24],[10453,24],[11226,24],[11315,24],[11549,24],[11638,24]]},"681":{"position":[[694,24],[1555,24],[3041,24],[4207,24],[5038,24],[5127,24],[5578,24],[5667,24],[6578,24],[7435,24],[8762,24],[9855,24],[10632,24],[10721,24],[10959,24],[11048,24]]},"683":{"position":[[669,24],[1633,24],[3059,24],[4261,24],[5157,24],[5246,24],[5377,24],[5466,24],[6946,24],[7832,24],[9402,24],[10603,24],[11470,24],[11559,24],[12079,24],[12168,24],[13208,24],[14095,24],[15666,24],[16868,24],[17738,24],[17827,24],[18348,24],[18437,24],[19510,24],[20364,24],[21688,24],[22778,24],[23552,24],[23641,24],[23876,24],[23965,24],[25173,24],[26025,24],[27347,24],[28435,24],[29207,24],[29296,24],[29529,24],[29618,24]]},"703":{"position":[[5255,24],[6133,24],[7636,24],[8819,24],[9667,24],[9756,24],[10211,24],[10300,24]]},"705":{"position":[[1646,24],[2552,24],[4083,24],[5294,24],[6172,24],[6261,24],[6717,24],[6806,24]]},"726":{"position":[[708,24],[2363,24],[4938,24],[6948,24],[8618,24],[8707,24],[9563,24],[9652,24],[12026,24],[13221,24],[15159,24],[16679,24],[17862,24],[17951,24],[18560,24],[18649,24],[20163,24],[21288,24],[23156,24],[24606,24],[25719,24],[25808,24],[26402,24],[26491,24],[28762,24],[29615,24],[30938,24],[32027,24],[32800,24],[32889,24],[33123,24],[33212,24],[34521,24],[35375,24],[36699,24],[37789,24],[38563,24],[38652,24],[38887,24],[38976,24],[40138,24],[40995,24],[42322,24],[43415,24],[44192,24],[44281,24],[44519,24],[44608,24],[45780,24],[46638,24],[47966,24],[49060,24],[49838,24],[49927,24],[50166,24],[50255,24]]},"728":{"position":[[804,24],[1658,24],[2982,24],[4072,24],[4846,24],[4935,24],[5170,24],[5259,24],[8723,24],[9573,24],[10893,24],[11979,24],[12749,24],[12838,24],[13069,24],[13158,24],[14640,24],[15499,24],[16828,24],[17923,24],[18702,24],[18791,24],[19031,24],[19120,24],[25058,24],[25916,24],[27244,24],[28338,24],[29116,24],[29205,24],[29444,24],[29533,24],[33306,24],[34155,24],[35474,24],[36559,24],[37328,24],[37417,24],[37647,24],[37736,24],[42841,24],[43690,24],[45009,24],[46094,24],[46863,24],[46952,24],[47182,24],[47271,24]]},"745":{"position":[[2335,24],[3152,24],[4594,24],[5716,24],[6504,24],[6593,24],[7045,24],[7134,24],[8019,24],[8874,24],[10199,24],[11290,24],[12065,24],[12154,24],[12390,24],[12479,24],[13709,24],[14526,24],[15968,24],[17090,24],[17878,24],[17967,24],[18419,24],[18508,24],[19350,24],[20205,24],[21530,24],[22621,24],[23396,24],[23485,24],[23721,24],[23810,24],[24976,24],[25832,24],[27158,24],[28250,24],[29026,24],[29115,24],[29352,24],[29441,24],[32710,24],[33565,24],[34890,24],[35981,24],[36756,24],[36845,24],[37081,24],[37170,24],[38336,24],[39191,24],[40516,24],[41607,24],[42382,24],[42471,24],[42707,24],[42796,24]]},"747":{"position":[[2864,24],[3910,24],[5640,24],[7001,24],[8026,24],[8115,24],[8668,24],[8757,24],[10178,24],[11035,24],[12362,24],[13455,24],[14232,24],[14321,24],[14559,24],[14648,24]]},"749":{"position":[[809,24],[1650,24],[3116,24],[4262,24],[5074,24],[5163,24],[5639,24],[5728,24],[7050,24],[7923,24],[9421,24],[10599,24],[11442,24],[11531,24],[11986,24],[12075,24],[12941,24],[13796,24],[15121,24],[16212,24],[16987,24],[17076,24],[17312,24],[17401,24]]},"751":{"position":[[3506,24],[4407,24],[5992,24],[7208,24],[8090,24],[8179,24],[8714,24],[8803,24],[10390,24],[11249,24],[12578,24],[13673,24],[14452,24],[14541,24],[14781,24],[14870,24],[17824,24],[18663,24],[20127,24],[21271,24],[22081,24],[22170,24],[22644,24],[22733,24]]},"771":{"position":[[1021,24],[1837,24],[3278,24],[4399,24],[5186,24],[5275,24],[5726,24],[5815,24],[6669,24],[7489,24],[8934,24],[10059,24],[10850,24],[10939,24],[11394,24],[11483,24],[12353,24],[13316,24],[15022,24],[16310,24],[17264,24],[17353,24],[17949,24],[18038,24],[19587,24],[20441,24],[21765,24],[22855,24],[23629,24],[23718,24],[23953,24],[24042,24],[25286,24],[26138,24],[27460,24],[28548,24],[29320,24],[29409,24],[29642,24],[29731,24]]},"773":{"position":[[3439,24],[4455,24],[6273,24],[7624,24],[8641,24],[8730,24],[9378,24],[9467,24],[10915,24],[11772,24],[13099,24],[14192,24],[14969,24],[15058,24],[15296,24],[15385,24]]},"775":{"position":[[3344,24],[4248,24],[5836,24],[7055,24],[7940,24],[8029,24],[8567,24],[8656,24],[9869,24],[10968,24],[12869,24],[14303,24],[15403,24],[15492,24],[16223,24],[16312,24],[18099,24],[18950,24],[20271,24],[21358,24],[22129,24],[22218,24],[22450,24],[22539,24]]},"777":{"position":[[3539,24],[4505,24],[6214,24],[7505,24],[8462,24],[8551,24],[9150,24],[9239,24],[10791,24],[11647,24],[12973,24],[14065,24],[14841,24],[14930,24],[15167,24],[15256,24]]},"789":{"position":[[3112,24],[4448,24],[6586,24],[8257,24],[9590,24],[9679,24],[10373,24],[10462,24]]},"795":{"position":[[939,24],[1789,24],[3109,24],[4195,24],[4965,24],[5054,24],[5285,24],[5374,24],[6627,24],[7481,24],[8805,24],[9895,24],[10669,24],[10758,24],[10993,24],[11082,24],[12352,24],[13228,24],[14729,24],[15910,24],[16756,24],[16845,24],[17302,24],[17391,24],[18262,24],[19113,24],[20434,24],[21521,24],[22292,24],[22381,24],[22613,24],[22702,24]]},"797":{"position":[[5054,24],[5900,24],[7216,24],[8298,24],[9064,24],[9153,24],[9380,24],[9469,24],[10859,24],[12103,24],[14090,24],[15659,24],[16891,24],[16980,24],[17636,24],[17725,24],[19402,24],[20401,24],[22084,24],[23398,24],[24376,24],[24465,24],[24988,24],[25077,24],[26341,24],[27191,24],[28511,24],[29597,24],[30367,24],[30456,24],[30687,24],[30776,24]]},"799":{"position":[[1599,24],[2653,24],[4391,24],[5760,24],[6795,24],[6884,24],[7408,24],[7497,24],[9036,24],[10055,24],[11563,24],[12850,24],[13808,24],[13897,24],[14226,24],[14315,24],[15962,24],[16982,24],[18491,24],[19779,24],[20738,24],[20827,24],[21157,24],[21246,24]]},"801":{"position":[[3840,24],[6432,24],[10298,24],[13305,24],[15966,24],[16055,24],[17448,24],[17537,24]]},"820":{"position":[[2336,24],[3156,24],[4601,24],[5726,24],[6517,24],[6606,24],[7061,24],[7150,24],[8044,24],[8902,24],[10230,24],[11324,24],[12102,24],[12191,24],[12430,24],[12519,24],[13756,24],[14572,24],[16013,24],[17134,24],[17921,24],[18010,24],[18461,24],[18550,24],[19390,24],[20244,24],[21568,24],[22658,24],[23432,24],[23521,24],[23756,24],[23845,24],[25008,24],[25864,24],[27190,24],[28282,24],[29058,24],[29147,24],[29384,24],[29473,24],[32230,24],[33084,24],[34408,24],[35498,24],[36272,24],[36361,24],[36596,24],[36685,24],[37848,24],[38703,24],[40028,24],[41119,24],[41894,24],[41983,24],[42219,24],[42308,24]]},"822":{"position":[[2619,24],[3756,24],[5695,24],[7167,24],[8303,24],[8392,24],[9044,24],[9133,24],[10852,24],[11710,24],[13038,24],[14132,24],[14910,24],[14999,24],[15238,24],[15327,24]]},"824":{"position":[[2452,24],[3468,24],[5168,24],[6499,24],[7494,24],[7583,24],[8124,24],[8213,24],[9765,24],[10626,24],[11957,24],[13054,24],[13835,24],[13924,24],[14166,24],[14255,24]]},"826":{"position":[[3325,24],[4514,24],[6446,24],[7960,24],[9137,24],[9226,24],[9855,24],[9944,24],[11435,24],[12297,24],[13629,24],[14727,24],[15509,24],[15598,24],[15841,24],[15930,24],[17193,24],[18057,24],[19391,24],[20491,24],[21275,24],[21364,24],[21609,24],[21698,24],[22890,24],[23756,24],[25092,24],[26194,24],[26980,24],[27069,24],[27316,24],[27405,24],[28682,24],[29546,24],[30880,24],[31980,24],[32764,24],[32853,24],[33098,24],[33187,24],[34379,24],[35243,24],[36577,24],[37677,24],[38461,24],[38550,24],[38795,24],[38884,24]]},"844":{"position":[[2578,24],[3453,24],[4953,24],[6133,24],[6978,24],[7067,24],[7524,24],[7613,24],[8555,24],[9415,24],[10745,24],[11841,24],[12621,24],[12710,24],[12951,24],[13040,24],[14289,24],[15164,24],[16664,24],[17844,24],[18689,24],[18778,24],[19235,24],[19324,24],[20223,24],[21083,24],[22413,24],[23509,24],[24289,24],[24378,24],[24619,24],[24708,24],[25966,24],[26833,24],[28170,24],[29273,24],[30060,24],[30149,24],[30397,24],[30486,24],[32127,24],[33252,24],[35120,24],[36570,24],[37683,24],[37772,24],[38378,24],[38467,24],[39927,24],[40787,24],[42117,24],[43213,24],[43993,24],[44082,24],[44323,24],[44412,24]]},"846":{"position":[[639,24],[1494,24],[2819,24],[3910,24],[4685,24],[4774,24],[5010,24],[5099,24],[7921,24],[8775,24],[10099,24],[11189,24],[11963,24],[12052,24],[12287,24],[12376,24]]},"848":{"position":[[7407,24],[8447,24],[10230,24],[11595,24],[12626,24],[12715,24],[13388,24],[13477,24],[15023,24],[15967,24],[17536,24],[18785,24],[19699,24],[19788,24],[20253,24],[20342,24],[21466,24],[22454,24],[24126,24],[25429,24],[26397,24],[26486,24],[27001,24],[27090,24],[28300,24],[29203,24],[30790,24],[32008,24],[32892,24],[32981,24],[33518,24],[33607,24],[34784,24],[35630,24],[37101,24],[38252,24],[39069,24],[39158,24],[39639,24],[39728,24],[40671,24],[41500,24],[42954,24],[44088,24],[44888,24],[44977,24],[45441,24],[45530,24],[46572,24],[47424,24],[48746,24],[49834,24],[50606,24],[50695,24],[50928,24],[51017,24],[52243,24],[53110,24],[54447,24],[55550,24],[56337,24],[56426,24],[56674,24],[56763,24]]}}}],["https://api.openfga.exampl",{"_index":567,"t":{"43":{"position":[[353,28]]},"113":{"position":[[672,28]]}}}],["https://github.com/fullstorydev/grpcurl#instal",{"_index":1450,"t":{"220":{"position":[[302,52]]}}}],["hub",{"_index":1071,"t":{"159":{"position":[[148,3]]}}}],["hudson",{"_index":539,"t":{"39":{"position":[[513,6]]}}}],["human",{"_index":1709,"t":{"375":{"position":[[18244,5]]}}}],["hyphen",{"_index":1947,"t":{"480":{"position":[[2567,8]]}}}],["i.",{"_index":755,"t":{"45":{"position":[[31885,5]]},"210":{"position":[[136,6]]},"418":{"position":[[3251,6]]},"482":{"position":[[2081,6]]},"562":{"position":[[12704,4]]}}}],["id",{"_index":417,"t":{"35":{"position":[[1405,2],[1886,2],[8301,3]]},"43":{"position":[[394,3],[3082,2],[3180,4]]},"45":{"position":[[5874,2],[30649,2]]},"105":{"position":[[218,2],[241,2],[429,2]]},"107":{"position":[[27,2],[353,3]]},"109":{"position":[[808,2]]},"167":{"position":[[177,3]]},"171":{"position":[[1024,2]]},"173":{"position":[[1887,2]]},"212":{"position":[[3205,2]]},"234":{"position":[[174,2]]},"236":{"position":[[293,3]]},"238":{"position":[[52,2],[203,2],[360,3]]},"325":{"position":[[55,3],[129,3],[256,3]]},"327":{"position":[[1300,3],[1324,3],[1662,3],[1916,4],[2240,3]]},"357":{"position":[[6008,3],[6104,3]]},"375":{"position":[[18154,3]]},"384":{"position":[[880,3]]},"404":{"position":[[11761,3],[11857,3]]},"408":{"position":[[1100,2],[1198,3]]},"414":{"position":[[64,2]]},"418":{"position":[[2940,2]]},"482":{"position":[[1286,2],[1289,4],[1355,4],[6274,2],[6277,4]]},"504":{"position":[[5702,3],[5845,3]]},"514":{"position":[[1619,3],[1762,3]]},"544":{"position":[[6246,3],[6342,3]]},"562":{"position":[[30254,3],[30397,3]]},"578":{"position":[[203,3]]},"618":{"position":[[6600,2]]},"637":{"position":[[300,4]]},"639":{"position":[[6358,3],[6455,3]]},"661":{"position":[[379,2],[477,2]]}}}],["id=$fga_store_id",{"_index":718,"t":{"45":{"position":[[16957,16],[23151,16]]},"135":{"position":[[1161,16]]},"202":{"position":[[4786,16],[10538,16]]},"265":{"position":[[5046,16]]},"267":{"position":[[10465,16]]},"285":{"position":[[6075,16],[17753,16],[23363,16]]},"296":{"position":[[4833,16]]},"357":{"position":[[4991,16]]},"369":{"position":[[4929,16],[10535,16]]},"375":{"position":[[11224,16],[17038,16]]},"382":{"position":[[5896,16]]},"404":{"position":[[4891,16],[10732,16]]},"444":{"position":[[11673,16]]},"448":{"position":[[4767,16]]},"462":{"position":[[4941,16],[10571,16]]},"466":{"position":[[4905,16],[10704,16]]},"508":{"position":[[4964,16]]},"524":{"position":[[5080,16]]},"544":{"position":[[5032,16]]},"562":{"position":[[11599,16],[17594,16],[23288,16],[28910,16]]},"582":{"position":[[4721,16],[10235,16]]},"584":{"position":[[10299,16]]},"599":{"position":[[4920,16]]},"639":{"position":[[4910,16]]},"647":{"position":[[4807,16]]},"649":{"position":[[10850,16],[16495,16]]},"667":{"position":[[6055,16],[12227,16],[19060,16],[25885,16],[32125,16]]},"669":{"position":[[6032,16],[12293,16],[18629,16],[24952,16]]},"679":{"position":[[5750,16],[11364,16]]},"681":{"position":[[10770,16]]},"683":{"position":[[23690,16],[29345,16]]},"701":{"position":[[1326,16],[3165,16],[5016,16],[6864,16],[8713,16],[10564,16]]},"703":{"position":[[3908,16],[11794,16]]},"705":{"position":[[8802,16],[11477,16]]},"726":{"position":[[32938,16],[38701,16],[44330,16],[49976,16]]},"728":{"position":[[4984,16],[12887,16],[18840,16],[29254,16],[37466,16],[47001,16]]},"745":{"position":[[12203,16],[23534,16],[29164,16],[36894,16],[42520,16]]},"747":{"position":[[14370,16]]},"749":{"position":[[17125,16]]},"751":{"position":[[14590,16]]},"771":{"position":[[23767,16],[29458,16]]},"773":{"position":[[15107,16]]},"775":{"position":[[22267,16]]},"777":{"position":[[14979,16]]},"795":{"position":[[5103,16],[10807,16],[22430,16]]},"797":{"position":[[9202,16],[30505,16]]},"799":{"position":[[13946,16],[20876,16]]},"820":{"position":[[12240,16],[23570,16],[29196,16],[36410,16],[42032,16]]},"822":{"position":[[15048,16]]},"824":{"position":[[13973,16]]},"826":{"position":[[15647,16],[21413,16],[27118,16],[32902,16],[38599,16]]},"844":{"position":[[12759,16],[24427,16],[30198,16],[44131,16]]},"846":{"position":[[4823,16],[12101,16]]},"848":{"position":[[50744,16],[56475,16]]}}}],["id=${fga_store_id",{"_index":488,"t":{"35":{"position":[[7118,18]]},"45":{"position":[[29666,18]]},"147":{"position":[[1357,18]]},"200":{"position":[[5417,18]]},"250":{"position":[[1266,18]]},"252":{"position":[[1428,18]]},"267":{"position":[[5416,18]]},"279":{"position":[[811,18],[2689,18]]},"281":{"position":[[1842,18],[3585,18]]},"285":{"position":[[12515,18]]},"294":{"position":[[5677,18]]},"311":{"position":[[5479,18],[11068,18]]},"375":{"position":[[5925,18]]},"402":{"position":[[5539,18]]},"422":{"position":[[2828,18]]},"444":{"position":[[6364,18],[6484,18]]},"446":{"position":[[6742,18],[6880,18]]},"504":{"position":[[5444,18]]},"506":{"position":[[5783,18]]},"522":{"position":[[5845,18]]},"540":{"position":[[5463,18]]},"542":{"position":[[6126,18]]},"562":{"position":[[6366,18],[6476,18]]},"574":{"position":[[5875,18],[5980,18]]},"578":{"position":[[5862,18],[5965,18]]},"580":{"position":[[5555,18]]},"584":{"position":[[5401,18]]},"606":{"position":[[5421,18],[11479,18],[17500,18]]},"608":{"position":[[5152,18]]},"613":{"position":[[5082,18],[10994,18]]},"618":{"position":[[5447,18]]},"637":{"position":[[6170,18]]},"645":{"position":[[6451,18],[6575,18]]},"649":{"position":[[5724,18]]},"681":{"position":[[5716,18]]},"683":{"position":[[5294,18],[12217,18],[12333,18],[18487,18],[18565,18]]},"695":{"position":[[8877,18],[9000,18],[9123,18],[9246,18],[9369,18],[9492,18],[9605,18]]},"703":{"position":[[10349,18]]},"705":{"position":[[6856,18]]},"707":{"position":[[8416,18],[8539,18],[8662,18],[8785,18],[8908,18],[9031,18],[9144,18]]},"726":{"position":[[9701,18],[9824,18],[9947,18],[10073,18],[10202,18],[10334,18],[18698,18],[18820,18],[18942,18],[26540,18],[26658,18],[26776,18]]},"745":{"position":[[7183,18],[18557,18]]},"747":{"position":[[8806,18],[8933,18]]},"749":{"position":[[5777,18],[12124,18]]},"751":{"position":[[8852,18],[8972,18],[22782,18]]},"771":{"position":[[5864,18],[11532,18],[18087,18],[18206,18],[18329,18]]},"773":{"position":[[9516,18],[9632,18],[9742,18],[9861,18]]},"775":{"position":[[8705,18],[8835,18],[16361,18],[16502,18],[16643,18],[16772,18]]},"777":{"position":[[9288,18],[9408,18],[9532,18]]},"789":{"position":[[10511,18],[10636,18],[10762,18],[10889,18]]},"795":{"position":[[17440,18]]},"797":{"position":[[17774,18],[17906,18],[18038,18],[25126,18],[25252,18]]},"799":{"position":[[7547,18],[7635,18]]},"801":{"position":[[17586,18],[17711,18],[17837,18],[17964,18],[18089,18],[18219,18],[18350,18],[18482,18],[18614,18],[18746,18],[18878,18],[19010,18]]},"820":{"position":[[7199,18],[18599,18]]},"822":{"position":[[9182,18],[9292,18],[9402,18],[9515,18]]},"824":{"position":[[8262,18],[8385,18]]},"826":{"position":[[9993,18],[10120,18],[10259,18]]},"844":{"position":[[7662,18],[19373,18],[38516,18],[38643,18],[38763,18]]},"848":{"position":[[13526,18],[13662,18],[13809,18],[20391,18],[27139,18],[27253,18],[33656,18],[33781,18],[39777,18],[45579,18]]}}}],["id=1uhxcsutp0vkpysnkq1pbb1jezw",{"_index":719,"t":{"45":{"position":[[16982,30],[23176,30],[29693,30]]},"135":{"position":[[1186,30]]},"147":{"position":[[1384,30]]},"200":{"position":[[5444,30]]},"202":{"position":[[4811,30],[10563,30]]},"250":{"position":[[1293,30]]},"265":{"position":[[5071,30]]},"267":{"position":[[10490,30]]},"285":{"position":[[6100,30],[12542,30],[17778,30],[23388,30]]},"296":{"position":[[4858,30]]},"311":{"position":[[5506,30]]},"357":{"position":[[5016,30]]},"369":{"position":[[4954,30],[10560,30]]},"375":{"position":[[5952,30],[11249,30],[17063,30]]},"382":{"position":[[5921,30]]},"402":{"position":[[5566,30]]},"404":{"position":[[4916,30],[10757,30]]},"422":{"position":[[2855,30]]},"444":{"position":[[6391,30],[6511,30],[11698,30]]},"446":{"position":[[6769,30],[6907,30]]},"448":{"position":[[4792,30]]},"462":{"position":[[4966,30],[10596,30]]},"466":{"position":[[4930,30],[10729,30]]},"504":{"position":[[5471,30]]},"506":{"position":[[5810,30]]},"508":{"position":[[4989,30]]},"522":{"position":[[5872,30]]},"524":{"position":[[5105,30]]},"540":{"position":[[5490,30]]},"542":{"position":[[6153,30]]},"544":{"position":[[5057,30]]},"562":{"position":[[6393,30],[6503,30],[11624,30],[17619,30],[23313,30],[28935,30]]},"574":{"position":[[5902,30],[6007,30]]},"578":{"position":[[5889,30],[5992,30]]},"580":{"position":[[5582,30]]},"582":{"position":[[4746,30],[10260,30]]},"584":{"position":[[10324,30]]},"599":{"position":[[4945,30]]},"613":{"position":[[5109,30],[11021,30]]},"618":{"position":[[5474,30]]},"637":{"position":[[6197,30]]},"639":{"position":[[4935,30]]},"645":{"position":[[6478,30],[6602,30]]},"647":{"position":[[4832,30]]},"649":{"position":[[10875,30],[16520,30]]},"667":{"position":[[6080,30],[12252,30],[19085,30],[25910,30],[32150,30]]},"669":{"position":[[6057,30],[12318,30],[18654,30],[24977,30]]},"679":{"position":[[5775,30],[11389,30]]},"681":{"position":[[5743,30],[10795,30]]},"683":{"position":[[12244,30],[12360,30],[23715,30],[29370,30]]},"695":{"position":[[8904,30],[9027,30],[9150,30],[9273,30],[9396,30],[9519,30],[9632,30]]},"701":{"position":[[1351,30],[3190,30],[5041,30],[6889,30],[8738,30],[10589,30]]},"703":{"position":[[3933,30],[10376,30],[11819,30]]},"705":{"position":[[8827,30],[11502,30]]},"707":{"position":[[8443,30],[8566,30],[8689,30],[8812,30],[8935,30],[9058,30],[9171,30]]},"726":{"position":[[9728,30],[9851,30],[9974,30],[10100,30],[10229,30],[10361,30],[18725,30],[18847,30],[18969,30],[26567,30],[26685,30],[26803,30],[32963,30],[38726,30],[44355,30],[50001,30]]},"728":{"position":[[5009,30],[12912,30],[18865,30],[29279,30],[37491,30],[47026,30]]},"745":{"position":[[7210,30],[12228,30],[18584,30],[23559,30],[29189,30],[36919,30],[42545,30]]},"747":{"position":[[8833,30],[8960,30],[14395,30]]},"749":{"position":[[5804,30],[12151,30],[17150,30]]},"751":{"position":[[8879,30],[8999,30],[14615,30],[22809,30]]},"771":{"position":[[5891,30],[11559,30],[18114,30],[18233,30],[18356,30],[23792,30],[29483,30]]},"773":{"position":[[9543,30],[9659,30],[9769,30],[9888,30],[15132,30]]},"775":{"position":[[8732,30],[8862,30],[16388,30],[16529,30],[16670,30],[16799,30],[22292,30]]},"777":{"position":[[9315,30],[9435,30],[9559,30],[15004,30]]},"789":{"position":[[10538,30],[10663,30],[10789,30],[10916,30]]},"795":{"position":[[5128,30],[10832,30],[17467,30],[22455,30]]},"797":{"position":[[9227,30],[17801,30],[17933,30],[18065,30],[25153,30],[25279,30],[30530,30]]},"799":{"position":[[13971,30],[20901,30]]},"801":{"position":[[17613,30],[17738,30],[17864,30],[17991,30],[18116,30],[18246,30],[18377,30],[18509,30],[18641,30],[18773,30],[18905,30],[19037,30]]},"820":{"position":[[7226,30],[12265,30],[18626,30],[23595,30],[29221,30],[36435,30],[42057,30]]},"822":{"position":[[9209,30],[9319,30],[9429,30],[9542,30],[15073,30]]},"824":{"position":[[8289,30],[8412,30],[13998,30]]},"826":{"position":[[10020,30],[10147,30],[10286,30],[15672,30],[21438,30],[27143,30],[32927,30],[38624,30]]},"844":{"position":[[7689,30],[12784,30],[19400,30],[24452,30],[30223,30],[38543,30],[38670,30],[38790,30],[44156,30]]},"846":{"position":[[4848,30],[12126,30]]},"848":{"position":[[13553,30],[13689,30],[13836,30],[20418,30],[27166,30],[27280,30],[33683,30],[33808,30],[39804,30],[45606,30],[50769,30],[56500,30]]}}}],["idea",{"_index":2487,"t":{"728":{"position":[[38587,4]]}}}],["ideal",{"_index":1643,"t":{"327":{"position":[[2651,6]]}}}],["ident",{"_index":286,"t":{"17":{"position":[[61,9]]},"171":{"position":[[212,9]]}}}],["identifi",{"_index":636,"t":{"45":{"position":[[4225,11],[4621,10],[4675,11],[5830,10]]},"234":{"position":[[104,12]]},"236":{"position":[[43,12],[95,11]]},"375":{"position":[[18259,11]]},"380":{"position":[[506,11]]},"414":{"position":[[312,11]]},"416":{"position":[[2984,8]]},"478":{"position":[[78,8]]},"480":{"position":[[190,8]]},"482":{"position":[[108,11]]},"726":{"position":[[27620,12]]},"747":{"position":[[9645,12]]},"751":{"position":[[772,11]]},"765":{"position":[[588,12]]},"822":{"position":[[10319,12]]},"840":{"position":[[1039,12]]}}}],["idl",{"_index":1009,"t":{"153":{"position":[[1576,4],[1597,4]]}}}],["ignor",{"_index":2158,"t":{"608":{"position":[[283,6]]}}}],["il",{"_index":510,"t":{"39":{"position":[[73,3]]}}}],["illustr",{"_index":961,"t":{"127":{"position":[[18,10]]},"139":{"position":[[18,10]]},"163":{"position":[[18,10]]},"236":{"position":[[300,10]]},"242":{"position":[[18,10]]},"271":{"position":[[13,11]]},"357":{"position":[[6116,10]]},"404":{"position":[[11869,10]]},"412":{"position":[[56,10]]},"504":{"position":[[5852,10]]},"514":{"position":[[1774,10]]},"544":{"position":[[6354,10]]},"556":{"position":[[3,10]]},"562":{"position":[[30409,10]]},"639":{"position":[[6467,10]]},"665":{"position":[[3,10]]}}}],["imag",{"_index":1321,"t":{"208":{"position":[[178,6]]},"212":{"position":[[1642,6],[1949,6],[2253,6],[4286,6],[4620,6],[4904,6]]}}}],["imagin",{"_index":1561,"t":{"281":{"position":[[0,7]]},"294":{"position":[[0,7],[90,7]]},"382":{"position":[[0,7]]},"384":{"position":[[0,7]]},"440":{"position":[[776,7]]},"484":{"position":[[1502,7]]},"580":{"position":[[5,7]]},"777":{"position":[[296,7]]}}}],["immedi",{"_index":1555,"t":{"279":{"position":[[3332,12]]},"386":{"position":[[1459,11]]}}}],["immut",{"_index":361,"t":{"29":{"position":[[906,9],[972,9]]},"101":{"position":[[36,10]]},"726":{"position":[[27610,9]]},"765":{"position":[[578,9]]},"840":{"position":[[1029,9]]}}}],["impact",{"_index":988,"t":{"153":{"position":[[569,6]]},"155":{"position":[[431,8],[1252,9],[1458,9]]}}}],["implement",{"_index":201,"t":{"9":{"position":[[46,15]]},"29":{"position":[[1152,14]]},"109":{"position":[[558,9]]},"179":{"position":[[768,12]]},"187":{"position":[[115,11]]},"317":{"position":[[9,9]]},"327":{"position":[[1866,10]]},"361":{"position":[[524,12]]},"548":{"position":[[1006,12]]}}}],["impli",{"_index":692,"t":{"45":{"position":[[9773,8],[9802,7],[10086,7],[10217,7],[11116,7],[12035,7]]},"69":{"position":[[260,7],[391,7]]},"89":{"position":[[2666,7]]},"345":{"position":[[296,7]]},"355":{"position":[[907,7]]},"386":{"position":[[707,5]]},"418":{"position":[[1628,7]]},"472":{"position":[[759,7]]},"556":{"position":[[361,7],[534,7]]},"560":{"position":[[367,7]]},"599":{"position":[[5879,7]]},"639":{"position":[[5934,5]]},"667":{"position":[[33351,7]]},"713":{"position":[[787,5],[931,7]]},"728":{"position":[[6617,7],[6899,7],[7014,7],[30454,7],[30975,7]]},"730":{"position":[[332,7]]},"732":{"position":[[503,5],[948,7],[1068,7]]},"757":{"position":[[830,5]]},"773":{"position":[[219,8]]},"807":{"position":[[393,5],[815,7],[1150,7]]},"830":{"position":[[397,5]]},"846":{"position":[[5963,7]]},"848":{"position":[[2902,7],[2932,7],[21738,5],[23029,5],[24755,5],[26106,5],[27436,5]]}}}],["implicitli",{"_index":831,"t":{"91":{"position":[[1261,10]]},"357":{"position":[[124,10]]}}}],["import",{"_index":394,"t":{"35":{"position":[[835,6],[2012,6],[3677,6],[5386,6],[5396,6],[5408,6],[5451,6],[6259,6]]},"43":{"position":[[89,6],[466,6],[2296,6],[2306,6],[2349,6],[2415,6]]},"45":{"position":[[12390,6],[13231,6],[14365,6],[15700,6],[15710,6],[15722,6],[15765,6],[18584,6],[19425,6],[20559,6],[21894,6],[21904,6],[21916,6],[21959,6],[24938,6],[25800,6],[26988,6],[28365,6],[28375,6],[28387,6],[28430,6]]},"109":{"position":[[987,6]]},"113":{"position":[[326,6],[356,6],[1255,6],[1285,6]]},"133":{"position":[[108,6],[646,6],[1366,6],[2322,6],[2332,6],[2344,6],[2387,6]]},"145":{"position":[[108,6],[646,6],[1366,6],[2322,6],[2332,6],[2344,6],[2387,6]]},"169":{"position":[[1398,6]]},"171":{"position":[[1599,6]]},"173":{"position":[[935,6],[2752,6]]},"183":{"position":[[153,6],[705,6],[2261,6],[2271,6],[2314,6]]},"185":{"position":[[482,6],[1154,6],[3164,6],[3174,6],[3217,6],[3267,6]]},"187":{"position":[[358,6],[1179,6],[3554,6],[3564,6],[3607,6],[3657,6]]},"200":{"position":[[221,6],[1017,6],[2261,6],[3620,6],[3630,6],[3642,6],[3685,6]]},"202":{"position":[[231,6],[1069,6],[2200,6],[3532,6],[3542,6],[3554,6],[3597,6],[5975,6],[6815,6],[7948,6],[9282,6],[9292,6],[9304,6],[9347,6]]},"248":{"position":[[108,6],[646,6],[1366,6],[2322,6],[2332,6],[2344,6],[2387,6]]},"265":{"position":[[531,6],[1359,6],[2480,6],[3802,6],[3812,6],[3824,6],[3867,6]]},"267":{"position":[[242,6],[1033,6],[2272,6],[3626,6],[3636,6],[3648,6],[3691,6],[5946,6],[6775,6],[7897,6],[9220,6],[9230,6],[9242,6],[9285,6]]},"277":{"position":[[80,6],[618,6],[1338,6],[2294,6],[2304,6],[2316,6],[2359,6]]},"285":{"position":[[1536,6],[2370,6],[3497,6],[4825,6],[4835,6],[4847,6],[4890,6],[7174,6],[8007,6],[9288,6],[10684,6],[10694,6],[10706,6],[10749,6],[13198,6],[14036,6],[15167,6],[16499,6],[16509,6],[16521,6],[16564,6],[18800,6],[19640,6],[20773,6],[22107,6],[22117,6],[22129,6],[22172,6]]},"294":{"position":[[483,6],[1278,6],[2521,6],[3879,6],[3889,6],[3901,6],[3944,6]]},"296":{"position":[[274,6],[1113,6],[2245,6],[3578,6],[3588,6],[3600,6],[3643,6]]},"311":{"position":[[328,6],[1115,6],[2350,6],[3700,6],[3710,6],[3722,6],[3765,6],[5909,6],[6697,6],[7933,6],[9284,6],[9294,6],[9306,6],[9349,6],[11723,6],[12680,6],[14160,6],[15717,6],[15727,6],[15739,6],[15782,6]]},"357":{"position":[[404,6],[1250,6],[2389,6],[3729,6],[3739,6],[3751,6],[3794,6]]},"369":{"position":[[370,6],[1209,6],[2341,6],[3674,6],[3684,6],[3696,6],[3739,6],[5980,6],[6818,6],[7949,6],[9281,6],[9291,6],[9303,6],[9346,6]]},"375":{"position":[[489,6],[1344,6],[2647,6],[4065,6],[4075,6],[4087,6],[4130,6],[6665,6],[7504,6],[8636,6],[9969,6],[9979,6],[9991,6],[10034,6],[12479,6],[13318,6],[14450,6],[15783,6],[15793,6],[15805,6],[15848,6]]},"382":{"position":[[1349,6],[2185,6],[3314,6],[4644,6],[4654,6],[4666,6],[4709,6]]},"402":{"position":[[283,6],[1091,6],[2347,6],[3718,6],[3728,6],[3740,6],[3783,6]]},"404":{"position":[[304,6],[1150,6],[2289,6],[3629,6],[3639,6],[3651,6],[3694,6],[6141,6],[6988,6],[8128,6],[9469,6],[9479,6],[9491,6],[9534,6]]},"444":{"position":[[352,6],[1313,6],[2781,6],[4315,6],[4325,6],[4337,6],[4380,6],[7106,6],[7947,6],[9081,6],[10416,6],[10426,6],[10438,6],[10481,6]]},"446":{"position":[[254,6],[1325,6],[2903,6],[4547,6],[4557,6],[4569,6],[4612,6]]},"448":{"position":[[200,6],[1041,6],[2175,6],[3510,6],[3520,6],[3532,6],[3575,6]]},"462":{"position":[[370,6],[1212,6],[2347,6],[3683,6],[3693,6],[3705,6],[3748,6],[6004,6],[6845,6],[7979,6],[9314,6],[9324,6],[9336,6],[9379,6]]},"466":{"position":[[330,6],[1173,6],[2309,6],[3646,6],[3656,6],[3668,6],[3711,6],[6129,6],[6972,6],[8108,6],[9445,6],[9455,6],[9467,6],[9510,6]]},"474":{"position":[[403,9]]},"476":{"position":[[200,9],[289,9],[403,9],[424,9],[539,9]]},"478":{"position":[[4331,9]]},"480":{"position":[[78,9]]},"482":{"position":[[735,9],[1410,9],[2988,9],[3404,9],[5506,9],[7978,10]]},"484":{"position":[[57,9]]},"504":{"position":[[258,6],[1052,6],[2294,6],[3651,6],[3661,6],[3673,6],[3716,6]]},"506":{"position":[[260,6],[1134,6],[2456,6],[3893,6],[3903,6],[3915,6],[3958,6]]},"508":{"position":[[377,6],[1223,6],[2362,6],[3702,6],[3712,6],[3724,6],[3767,6]]},"522":{"position":[[444,6],[1290,6],[2584,6],[3993,6],[4003,6],[4015,6],[4058,6]]},"524":{"position":[[509,6],[1351,6],[2486,6],[3822,6],[3832,6],[3844,6],[3887,6]]},"540":{"position":[[267,6],[1063,6],[2307,6],[3666,6],[3676,6],[3688,6],[3731,6]]},"542":{"position":[[600,6],[1473,6],[2794,6],[4230,6],[4240,6],[4252,6],[4295,6]]},"544":{"position":[[437,6],[1285,6],[2426,6],[3768,6],[3778,6],[3790,6],[3833,6]]},"562":{"position":[[492,6],[1423,6],[2861,6],[4365,6],[4375,6],[4387,6],[4430,6],[7040,6],[7879,6],[9011,6],[10344,6],[10354,6],[10366,6],[10409,6],[13035,6],[13874,6],[15006,6],[16339,6],[16349,6],[16361,6],[16404,6],[18721,6],[19562,6],[20696,6],[22031,6],[22041,6],[22053,6],[22096,6],[24347,6],[25187,6],[26320,6],[27654,6],[27664,6],[27676,6],[27719,6]]},"574":{"position":[[346,6],[1193,6],[2547,6],[3967,6],[3977,6],[3989,6],[4032,6]]},"578":{"position":[[353,6],[1196,6],[2546,6],[3962,6],[3972,6],[3984,6],[4027,6]]},"580":{"position":[[364,6],[1159,6],[2402,6],[3760,6],[3770,6],[3782,6],[3825,6]]},"582":{"position":[[210,6],[1037,6],[2157,6],[3478,6],[3488,6],[3500,6],[3543,6],[5724,6],[6551,6],[7671,6],[8992,6],[9002,6],[9014,6],[9057,6]]},"584":{"position":[[247,6],[1034,6],[2269,6],[3619,6],[3629,6],[3641,6],[3684,6],[5784,6],[6612,6],[7733,6],[9055,6],[9065,6],[9077,6],[9120,6]]},"599":{"position":[[369,6],[1206,6],[2336,6],[3667,6],[3677,6],[3689,6],[3732,6]]},"606":{"position":[[619,6],[1501,6],[2728,6],[4112,6],[4122,6],[4134,6],[4177,6],[6775,6],[7638,6],[8826,6],[10189,6],[10199,6],[10211,6],[10254,6],[12756,6],[13629,6],[14827,6],[16200,6],[16210,6],[16222,6],[16265,6]]},"608":{"position":[[822,6],[1586,6],[2695,6],[3961,6],[3971,6],[3983,6],[4026,6]]},"613":{"position":[[360,6],[1236,6],[2432,6],[3825,6],[3835,6],[3847,6],[3890,6],[6272,6],[7148,6],[8344,6],[9737,6],[9747,6],[9759,6],[9802,6]]},"618":{"position":[[281,6],[1250,6],[2547,6],[4045,6],[4055,6],[4067,6],[4110,6]]},"637":{"position":[[496,6],[1408,6],[2768,6],[4243,6],[4253,6],[4265,6],[4308,6]]},"639":{"position":[[311,6],[1160,6],[2302,6],[3645,6],[3655,6],[3667,6],[3710,6],[5870,9]]},"645":{"position":[[221,6],[1232,6],[2750,6],[4334,6],[4344,6],[4356,6],[4399,6]]},"647":{"position":[[240,6],[1081,6],[2215,6],[3550,6],[3560,6],[3572,6],[3615,6]]},"649":{"position":[[221,6],[1088,6],[2403,6],[3833,6],[3843,6],[3855,6],[3898,6],[6279,6],[7121,6],[8256,6],[9592,6],[9602,6],[9614,6],[9657,6],[11912,6],[12757,6],[13895,6],[15234,6],[15244,6],[15256,6],[15299,6]]},"667":{"position":[[1500,6],[2338,6],[3469,6],[4801,6],[4811,6],[4823,6],[4866,6],[7672,6],[8510,6],[9641,6],[10973,6],[10983,6],[10995,6],[11038,6],[14493,6],[15334,6],[16468,6],[17803,6],[17813,6],[17825,6],[17868,6],[21330,6],[22168,6],[23299,6],[24631,6],[24641,6],[24653,6],[24696,6],[27566,6],[28405,6],[29537,6],[30870,6],[30880,6],[30892,6],[30935,6]]},"669":{"position":[[1473,6],[2312,6],[3444,6],[4777,6],[4787,6],[4799,6],[4842,6],[7722,6],[8564,6],[9699,6],[11035,6],[11045,6],[11057,6],[11100,6],[14066,6],[14906,6],[16039,6],[17373,6],[17383,6],[17395,6],[17438,6],[20389,6],[21229,6],[22362,6],[23696,6],[23706,6],[23718,6],[23761,6]]},"679":{"position":[[1187,6],[2027,6],[3160,6],[4494,6],[4504,6],[4516,6],[4559,6],[6805,6],[7644,6],[8776,6],[10109,6],[10119,6],[10131,6],[10174,6]]},"681":{"position":[[311,6],[1158,6],[2453,6],[3863,6],[3873,6],[3885,6],[3928,6],[6195,6],[7038,6],[8174,6],[9511,6],[9521,6],[9533,6],[9576,6]]},"683":{"position":[[286,6],[1236,6],[2471,6],[3917,6],[3927,6],[3939,6],[3982,6],[6563,6],[7435,6],[8814,6],[10259,6],[10269,6],[10281,6],[10324,6],[12825,6],[13698,6],[15078,6],[16524,6],[16534,6],[16546,6],[16589,6],[19127,6],[19967,6],[21100,6],[22434,6],[22444,6],[22456,6],[22499,6],[24790,6],[25628,6],[26759,6],[28091,6],[28101,6],[28113,6],[28156,6]]},"703":{"position":[[4872,6],[5736,6],[7048,6],[8475,6],[8485,6],[8497,6],[8540,6]]},"705":{"position":[[1263,6],[2155,6],[3495,6],[4950,6],[4960,6],[4972,6],[5015,6]]},"726":{"position":[[325,6],[1966,6],[4350,6],[6604,6],[6614,6],[6626,6],[6669,6],[11643,6],[12824,6],[14571,6],[16335,6],[16345,6],[16357,6],[16400,6],[19780,6],[20891,6],[22568,6],[24262,6],[24272,6],[24284,6],[24327,6],[28379,6],[29218,6],[30350,6],[31683,6],[31693,6],[31705,6],[31748,6],[34138,6],[34978,6],[36111,6],[37445,6],[37455,6],[37467,6],[37510,6],[39755,6],[40598,6],[41734,6],[43071,6],[43081,6],[43093,6],[43136,6],[45397,6],[46241,6],[47378,6],[48716,6],[48726,6],[48738,6],[48781,6]]},"728":{"position":[[421,6],[1261,6],[2394,6],[3728,6],[3738,6],[3750,6],[3793,6],[8340,6],[9176,6],[10305,6],[11635,6],[11645,6],[11657,6],[11700,6],[14257,6],[15102,6],[16240,6],[17579,6],[17589,6],[17601,6],[17644,6],[24675,6],[25519,6],[26656,6],[27994,6],[28004,6],[28016,6],[28059,6],[32923,6],[33758,6],[34886,6],[36215,6],[36225,6],[36237,6],[36280,6],[42458,6],[43293,6],[44421,6],[45750,6],[45760,6],[45772,6],[45815,6]]},"745":{"position":[[1952,6],[2755,6],[4006,6],[5372,6],[5382,6],[5394,6],[5437,6],[7636,6],[8477,6],[9611,6],[10946,6],[10956,6],[10968,6],[11011,6],[13326,6],[14129,6],[15380,6],[16746,6],[16756,6],[16768,6],[16811,6],[18967,6],[19808,6],[20942,6],[22277,6],[22287,6],[22299,6],[22342,6],[24593,6],[25435,6],[26570,6],[27906,6],[27916,6],[27928,6],[27971,6],[32327,6],[33168,6],[34302,6],[35637,6],[35647,6],[35659,6],[35702,6],[37953,6],[38794,6],[39928,6],[41263,6],[41273,6],[41285,6],[41328,6]]},"747":{"position":[[2481,6],[3513,6],[5052,6],[6657,6],[6667,6],[6679,6],[6722,6],[9795,6],[10638,6],[11774,6],[13111,6],[13121,6],[13133,6],[13176,6]]},"749":{"position":[[426,6],[1253,6],[2528,6],[3918,6],[3928,6],[3940,6],[3983,6],[6667,6],[7526,6],[8833,6],[10255,6],[10265,6],[10277,6],[10320,6],[12558,6],[13399,6],[14533,6],[15868,6],[15878,6],[15890,6],[15933,6]]},"751":{"position":[[3123,6],[4010,6],[5404,6],[6864,6],[6874,6],[6886,6],[6929,6],[10007,6],[10852,6],[11990,6],[13329,6],[13339,6],[13351,6],[13394,6],[17441,6],[18266,6],[19539,6],[20927,6],[20937,6],[20949,6],[20992,6]]},"771":{"position":[[638,6],[1440,6],[2690,6],[4055,6],[4065,6],[4077,6],[4120,6],[6286,6],[7092,6],[8346,6],[9715,6],[9725,6],[9737,6],[9780,6],[11970,6],[12919,6],[14434,6],[15966,6],[15976,6],[15988,6],[16031,6],[19204,6],[20044,6],[21177,6],[22511,6],[22521,6],[22533,6],[22576,6],[24903,6],[25741,6],[26872,6],[28204,6],[28214,6],[28226,6],[28269,6]]},"773":{"position":[[3056,6],[4058,6],[5685,6],[7280,6],[7290,6],[7302,6],[7345,6],[10532,6],[11375,6],[12511,6],[13848,6],[13858,6],[13870,6],[13913,6]]},"775":{"position":[[2961,6],[3851,6],[5248,6],[6711,6],[6721,6],[6733,6],[6776,6],[9486,6],[10571,6],[12281,6],[13959,6],[13969,6],[13981,6],[14024,6],[17716,6],[18553,6],[19683,6],[21014,6],[21024,6],[21036,6],[21079,6]]},"777":{"position":[[3156,6],[4108,6],[5626,6],[7161,6],[7171,6],[7183,6],[7226,6],[10408,6],[11250,6],[12385,6],[13721,6],[13731,6],[13743,6],[13786,6]]},"789":{"position":[[2729,6],[4051,6],[5998,6],[7913,6],[7923,6],[7935,6],[7978,6]]},"795":{"position":[[556,6],[1392,6],[2521,6],[3851,6],[3861,6],[3873,6],[3916,6],[6244,6],[7084,6],[8217,6],[9551,6],[9561,6],[9573,6],[9616,6],[11969,6],[12831,6],[14141,6],[15566,6],[15576,6],[15588,6],[15631,6],[17879,6],[18716,6],[19846,6],[21177,6],[21187,6],[21199,6],[21242,6]]},"797":{"position":[[4671,6],[5503,6],[6628,6],[7954,6],[7964,6],[7976,6],[8019,6],[10476,6],[11706,6],[13502,6],[15315,6],[15325,6],[15337,6],[15380,6],[19019,6],[20004,6],[21496,6],[23054,6],[23064,6],[23076,6],[23119,6],[25958,6],[26794,6],[27923,6],[29253,6],[29263,6],[29275,6],[29318,6]]},"799":{"position":[[1216,6],[2256,6],[3803,6],[5416,6],[5426,6],[5438,6],[5481,6],[8653,6],[9658,6],[10975,6],[12506,6],[12516,6],[12528,6],[12571,6],[15579,6],[16585,6],[17903,6],[19435,6],[19445,6],[19457,6],[19500,6]]},"801":{"position":[[3457,6],[6035,6],[9710,6],[12961,6],[12971,6],[12983,6],[13026,6]]},"820":{"position":[[1953,6],[2759,6],[4013,6],[5382,6],[5392,6],[5404,6],[5447,6],[7661,6],[8505,6],[9642,6],[10980,6],[10990,6],[11002,6],[11045,6],[13373,6],[14175,6],[15425,6],[16790,6],[16800,6],[16812,6],[16855,6],[19007,6],[19847,6],[20980,6],[22314,6],[22324,6],[22336,6],[22379,6],[24625,6],[25467,6],[26602,6],[27938,6],[27948,6],[27960,6],[28003,6],[31847,6],[32687,6],[33820,6],[35154,6],[35164,6],[35176,6],[35219,6],[37465,6],[38306,6],[39440,6],[40775,6],[40785,6],[40797,6],[40840,6]]},"822":{"position":[[2236,6],[3359,6],[5107,6],[6823,6],[6833,6],[6845,6],[6888,6],[10469,6],[11313,6],[12450,6],[13788,6],[13798,6],[13810,6],[13853,6]]},"824":{"position":[[2069,6],[3071,6],[4580,6],[6155,6],[6165,6],[6177,6],[6220,6],[9382,6],[10229,6],[11369,6],[12710,6],[12720,6],[12732,6],[12775,6]]},"826":{"position":[[2942,6],[4117,6],[5858,6],[7616,6],[7626,6],[7638,6],[7681,6],[11052,6],[11900,6],[13041,6],[14383,6],[14393,6],[14405,6],[14448,6],[16810,6],[17660,6],[18803,6],[20147,6],[20157,6],[20169,6],[20212,6],[22507,6],[23359,6],[24504,6],[25850,6],[25860,6],[25872,6],[25915,6],[28299,6],[29149,6],[30292,6],[31636,6],[31646,6],[31658,6],[31701,6],[33996,6],[34846,6],[35989,6],[37333,6],[37343,6],[37355,6],[37398,6]]},"844":{"position":[[2195,6],[3056,6],[4365,6],[5789,6],[5799,6],[5811,6],[5854,6],[8172,6],[9018,6],[10157,6],[11497,6],[11507,6],[11519,6],[11562,6],[13906,6],[14767,6],[16076,6],[17500,6],[17510,6],[17522,6],[17565,6],[19840,6],[20686,6],[21825,6],[23165,6],[23175,6],[23187,6],[23230,6],[25583,6],[26436,6],[27582,6],[28929,6],[28939,6],[28951,6],[28994,6],[31744,6],[32855,6],[34532,6],[36226,6],[36236,6],[36248,6],[36291,6],[39544,6],[40390,6],[41529,6],[42869,6],[42879,6],[42891,6],[42934,6]]},"846":{"position":[[256,6],[1097,6],[2231,6],[3566,6],[3576,6],[3588,6],[3631,6],[7538,6],[8378,6],[9511,6],[10845,6],[10855,6],[10867,6],[10910,6]]},"848":{"position":[[7024,6],[8050,6],[9642,6],[11251,6],[11261,6],[11273,6],[11316,6],[14640,6],[15570,6],[16948,6],[18441,6],[18451,6],[18463,6],[18506,6],[21083,6],[22057,6],[23538,6],[25085,6],[25095,6],[25107,6],[25150,6],[27917,6],[28806,6],[30202,6],[31664,6],[31674,6],[31686,6],[31729,6],[34401,6],[35233,6],[36513,6],[37908,6],[37918,6],[37930,6],[37973,6],[40288,6],[41103,6],[42366,6],[43744,6],[43754,6],[43766,6],[43809,6],[46189,6],[47027,6],[48158,6],[49490,6],[49500,6],[49512,6],[49555,6],[51860,6],[52713,6],[53859,6],[55206,6],[55216,6],[55228,6],[55271,6]]}}}],["impract",{"_index":1635,"t":{"327":{"position":[[1429,12]]}}}],["improv",{"_index":212,"t":{"9":{"position":[[353,7]]},"11":{"position":[[57,7]]},"107":{"position":[[206,7]]},"153":{"position":[[1848,7]]},"730":{"position":[[735,7]]},"779":{"position":[[153,7]]},"850":{"position":[[424,7]]}}}],["in",{"_index":525,"t":{"39":{"position":[[294,4]]}}}],["inadvert",{"_index":1708,"t":{"375":{"position":[[18010,13]]}}}],["inc",{"_index":2654,"t":{"789":{"position":[[139,4],[186,4]]}}}],["includ",{"_index":160,"t":{"7":{"position":[[36,8]]},"15":{"position":[[292,9]]},"45":{"position":[[31713,10]]},"77":{"position":[[231,10]]},"109":{"position":[[827,8]]},"155":{"position":[[1018,10]]},"212":{"position":[[50,10]]},"224":{"position":[[118,8]]},"236":{"position":[[112,7]]},"267":{"position":[[5719,7]]},"271":{"position":[[189,8],[264,7]]},"279":{"position":[[3563,8]]},"281":{"position":[[2130,7],[2193,7]]},"294":{"position":[[202,9]]},"420":{"position":[[160,8],[315,9]]},"476":{"position":[[1094,7]]},"611":{"position":[[33,10]]},"699":{"position":[[272,8]]},"719":{"position":[[209,7]]},"824":{"position":[[16338,10]]},"848":{"position":[[113,7],[1324,8]]}}}],["incom",{"_index":1147,"t":{"171":{"position":[[1571,8]]},"173":{"position":[[71,8]]}}}],["incompat",{"_index":1797,"t":{"420":{"position":[[89,17]]}}}],["incorrect",{"_index":2764,"t":{"799":{"position":[[686,9]]}}}],["incorrectli",{"_index":1795,"t":{"418":{"position":[[3549,12]]}}}],["increas",{"_index":902,"t":{"109":{"position":[[689,8]]},"153":{"position":[[1543,10],[1659,10]]},"155":{"position":[[1287,10],[1493,10]]},"228":{"position":[[375,8]]},"327":{"position":[[1396,10]]},"799":{"position":[[655,8]]}}}],["increment",{"_index":2724,"t":{"797":{"position":[[10214,10]]}}}],["inde",{"_index":2567,"t":{"761":{"position":[[363,6]]},"842":{"position":[[185,6]]}}}],["independ",{"_index":978,"t":{"153":{"position":[[182,13]]}}}],["index",{"_index":982,"t":{"153":{"position":[[341,7]]},"323":{"position":[[52,5],[690,5]]},"327":{"position":[[1748,5],[1927,5],[2184,5],[3143,5],[3246,6]]},"707":{"position":[[10475,6]]},"801":{"position":[[21377,6],[21539,6]]}}}],["indic",{"_index":665,"t":{"45":{"position":[[6173,10],[7635,8],[31815,8]]},"63":{"position":[[77,8]]},"85":{"position":[[194,10],[358,10],[515,10]]},"87":{"position":[[1017,10]]},"89":{"position":[[2857,8]]},"91":{"position":[[72,8],[961,9],[1089,10],[1213,10]]},"93":{"position":[[87,8],[1025,9]]},"95":{"position":[[86,8],[1124,9]]},"283":{"position":[[674,10],[738,8]]},"353":{"position":[[55,8],[187,8]]},"357":{"position":[[39,9]]},"359":{"position":[[116,8],[214,8]]},"369":{"position":[[11773,10],[11856,8],[11959,8]]},"371":{"position":[[951,10]]},"375":{"position":[[183,8],[287,8],[6342,8],[17974,10]]},"380":{"position":[[75,8]]},"402":{"position":[[35,8]]},"418":{"position":[[32,8]]},"442":{"position":[[1185,10]]},"450":{"position":[[146,8]]},"454":{"position":[[3339,8]]},"460":{"position":[[643,8]]},"490":{"position":[[36,8],[368,8],[627,8],[722,8],[883,8]]},"492":{"position":[[1710,8]]},"496":{"position":[[629,8]]},"498":{"position":[[427,8],[593,8],[674,8]]},"500":{"position":[[178,8],[1027,10]]},"506":{"position":[[54,8]]},"512":{"position":[[337,8],[400,8]]},"520":{"position":[[41,8],[129,8]]},"522":{"position":[[133,8]]},"544":{"position":[[39,10],[111,10]]},"550":{"position":[[1629,10],[1721,8]]},"554":{"position":[[689,10],[781,8]]},"560":{"position":[[319,8]]},"564":{"position":[[231,8],[329,8]]},"578":{"position":[[132,10]]},"626":{"position":[[397,8]]},"639":{"position":[[6222,8]]},"671":{"position":[[266,8]]},"675":{"position":[[716,8]]},"703":{"position":[[2683,9],[4663,10]]},"713":{"position":[[456,8],[850,8]]},"726":{"position":[[27738,10]]},"728":{"position":[[30812,9],[38479,10]]},"730":{"position":[[267,8],[436,8]]},"732":{"position":[[223,8],[342,8],[617,8],[734,8],[834,10],[858,8],[1003,8],[1143,8]]},"734":{"position":[[625,8]]},"751":{"position":[[2855,10]]},"757":{"position":[[594,8],[893,8],[1173,8]]},"777":{"position":[[2290,9]]},"797":{"position":[[1200,8],[4410,9]]},"807":{"position":[[105,8],[216,8],[510,8],[603,8],[703,10],[727,8],[917,8],[1085,8],[1228,8]]},"809":{"position":[[625,8],[799,8]]},"820":{"position":[[1462,9]]},"824":{"position":[[1865,8]]},"830":{"position":[[130,8],[206,8],[453,8],[634,8],[734,10]]},"842":{"position":[[1901,8]]},"844":{"position":[[1700,9]]},"848":{"position":[[4280,8],[6695,8],[20779,9],[20901,8]]}}}],["indirect",{"_index":805,"t":{"87":{"position":[[1259,8]]},"89":{"position":[[16,8]]},"663":{"position":[[1344,8]]},"667":{"position":[[1058,8],[26992,8]]},"669":{"position":[[1030,8],[19844,8]]}}}],["individu",{"_index":301,"t":{"19":{"position":[[50,10],[465,12]]},"343":{"position":[[94,10]]},"482":{"position":[[4127,10],[4809,10]]},"536":{"position":[[423,10]]},"618":{"position":[[6987,10]]},"653":{"position":[[98,10],[303,12],[417,11]]},"747":{"position":[[125,12],[9629,10]]},"822":{"position":[[10303,10]]}}}],["influenc",{"_index":2003,"t":{"490":{"position":[[420,9]]}}}],["info",{"_index":670,"t":{"45":{"position":[[7287,4]]},"83":{"position":[[3689,4]]},"85":{"position":[[918,4]]},"87":{"position":[[928,4]]},"91":{"position":[[926,4]]},"93":{"position":[[990,4]]},"95":{"position":[[1089,4]]},"151":{"position":[[223,6]]},"212":{"position":[[2992,4]]},"230":{"position":[[224,6]]},"313":{"position":[[442,4]]},"355":{"position":[[695,4]]},"408":{"position":[[0,4],[976,4]]},"410":{"position":[[277,4]]},"454":{"position":[[2221,4]]},"476":{"position":[[791,4]]},"480":{"position":[[2485,4]]},"500":{"position":[[965,4]]},"502":{"position":[[930,4]]},"608":{"position":[[5899,4]]},"663":{"position":[[1135,4]]},"667":{"position":[[13372,4],[13927,4],[26795,4]]},"669":{"position":[[783,4]]},"683":{"position":[[18837,4]]},"728":{"position":[[6471,4],[20183,4],[21358,4],[32358,4]]},"745":{"position":[[1561,4],[31867,4]]},"751":{"position":[[2817,4],[16171,4]]},"777":{"position":[[2191,4]]},"820":{"position":[[1439,4],[31344,4]]},"822":{"position":[[1796,4]]},"824":{"position":[[1784,4],[15537,4]]},"842":{"position":[[1711,4]]},"844":{"position":[[1677,4]]},"848":{"position":[[2701,4],[4217,4],[20769,4]]}}}],["inform",{"_index":502,"t":{"37":{"position":[[47,11]]},"45":{"position":[[4456,12],[5172,12],[7480,12],[9440,12],[24082,12],[30714,12],[31302,12],[32227,12]]},"81":{"position":[[109,7]]},"95":{"position":[[1050,12]]},"171":{"position":[[804,11]]},"210":{"position":[[601,11]]},"224":{"position":[[89,11]]},"234":{"position":[[117,11]]},"388":{"position":[[36,12]]},"400":{"position":[[105,11]]},"426":{"position":[[39,11]]},"624":{"position":[[43,11]]},"687":{"position":[[39,11]]},"701":{"position":[[86,11]]},"795":{"position":[[86,11]]},"828":{"position":[[47,12]]},"836":{"position":[[68,11]]},"846":{"position":[[6219,9]]}}}],["ingr",{"_index":2275,"t":{"669":{"position":[[19999,6],[20163,6]]}}}],["inherit",{"_index":803,"t":{"87":{"position":[[1141,9]]},"639":{"position":[[5940,11],[6047,7]]},"703":{"position":[[2339,7]]},"740":{"position":[[243,8],[303,7]]},"749":{"position":[[71,7]]},"797":{"position":[[4122,7]]}}}],["initi",{"_index":388,"t":{"35":{"position":[[741,10],[904,10],[1921,10],[2082,10],[3583,10],[3887,10],[5296,10]]},"45":{"position":[[12296,10],[12459,10],[13140,10],[13301,10],[14271,10],[14575,10],[15610,10],[18490,10],[18653,10],[19334,10],[19495,10],[20465,10],[20769,10],[21804,10],[24844,10],[25007,10],[25709,10],[25870,10],[26894,10],[27198,10],[28275,10]]},"133":{"position":[[177,10],[716,10],[1576,10]]},"145":{"position":[[177,10],[716,10],[1576,10]]},"200":{"position":[[127,10],[290,10],[926,10],[1087,10],[2167,10],[2471,10],[3530,10]]},"202":{"position":[[137,10],[300,10],[978,10],[1139,10],[2106,10],[2410,10],[3442,10],[5881,10],[6044,10],[6724,10],[6885,10],[7854,10],[8158,10],[9192,10]]},"248":{"position":[[177,10],[716,10],[1576,10]]},"265":{"position":[[437,10],[600,10],[1268,10],[1429,10],[2386,10],[2690,10],[3712,10]]},"267":{"position":[[148,10],[311,10],[942,10],[1103,10],[2178,10],[2482,10],[3536,10],[5852,10],[6015,10],[6684,10],[6845,10],[7803,10],[8107,10],[9130,10]]},"277":{"position":[[149,10],[688,10],[1548,10]]},"285":{"position":[[1442,10],[1605,10],[2279,10],[2440,10],[3403,10],[3707,10],[4735,10],[7080,10],[7243,10],[7916,10],[8077,10],[9194,10],[9498,10],[10594,10],[13104,10],[13267,10],[13945,10],[14106,10],[15073,10],[15377,10],[16409,10],[18706,10],[18869,10],[19549,10],[19710,10],[20679,10],[20983,10],[22017,10]]},"294":{"position":[[389,10],[552,10],[1187,10],[1348,10],[2427,10],[2731,10],[3789,10]]},"296":{"position":[[180,10],[343,10],[1022,10],[1183,10],[2151,10],[2455,10],[3488,10]]},"311":{"position":[[234,10],[397,10],[1024,10],[1185,10],[2256,10],[2560,10],[3610,10],[5815,10],[5978,10],[6606,10],[6767,10],[7839,10],[8143,10],[9194,10],[11629,10],[11792,10],[12589,10],[12750,10],[14066,10],[14370,10],[15627,10]]},"357":{"position":[[310,10],[473,10],[1159,10],[1320,10],[2295,10],[2599,10],[3639,10]]},"369":{"position":[[276,10],[439,10],[1118,10],[1279,10],[2247,10],[2551,10],[3584,10],[5886,10],[6049,10],[6727,10],[6888,10],[7855,10],[8159,10],[9191,10]]},"375":{"position":[[395,10],[558,10],[1253,10],[1414,10],[2553,10],[2857,10],[3975,10],[6571,10],[6734,10],[7413,10],[7574,10],[8542,10],[8846,10],[9879,10],[12385,10],[12548,10],[13227,10],[13388,10],[14356,10],[14660,10],[15693,10]]},"382":{"position":[[1255,10],[1418,10],[2094,10],[2255,10],[3220,10],[3524,10],[4554,10]]},"402":{"position":[[189,10],[352,10],[1000,10],[1161,10],[2253,10],[2557,10],[3628,10]]},"404":{"position":[[210,10],[373,10],[1059,10],[1220,10],[2195,10],[2499,10],[3539,10],[6047,10],[6210,10],[6897,10],[7058,10],[8034,10],[8338,10],[9379,10]]},"430":{"position":[[131,7]]},"444":{"position":[[258,10],[421,10],[1222,10],[1383,10],[2687,10],[2991,10],[4225,10],[7012,10],[7175,10],[7856,10],[8017,10],[8987,10],[9291,10],[10326,10]]},"446":{"position":[[160,10],[323,10],[1234,10],[1395,10],[2809,10],[3113,10],[4457,10]]},"448":{"position":[[106,10],[269,10],[950,10],[1111,10],[2081,10],[2385,10],[3420,10]]},"462":{"position":[[276,10],[439,10],[1121,10],[1282,10],[2253,10],[2557,10],[3593,10],[5910,10],[6073,10],[6754,10],[6915,10],[7885,10],[8189,10],[9224,10]]},"466":{"position":[[236,10],[399,10],[1082,10],[1243,10],[2215,10],[2519,10],[3556,10],[6035,10],[6198,10],[6881,10],[7042,10],[8014,10],[8318,10],[9355,10]]},"504":{"position":[[164,10],[327,10],[961,10],[1122,10],[2200,10],[2504,10],[3561,10]]},"506":{"position":[[166,10],[329,10],[1043,10],[1204,10],[2362,10],[2666,10],[3803,10]]},"508":{"position":[[283,10],[446,10],[1132,10],[1293,10],[2268,10],[2572,10],[3612,10]]},"522":{"position":[[350,10],[513,10],[1199,10],[1360,10],[2490,10],[2794,10],[3903,10]]},"524":{"position":[[415,10],[578,10],[1260,10],[1421,10],[2392,10],[2696,10],[3732,10]]},"540":{"position":[[173,10],[336,10],[972,10],[1133,10],[2213,10],[2517,10],[3576,10]]},"542":{"position":[[506,10],[669,10],[1382,10],[1543,10],[2700,10],[3004,10],[4140,10]]},"544":{"position":[[343,10],[506,10],[1194,10],[1355,10],[2332,10],[2636,10],[3678,10]]},"562":{"position":[[398,10],[561,10],[1332,10],[1493,10],[2767,10],[3071,10],[4275,10],[6946,10],[7109,10],[7788,10],[7949,10],[8917,10],[9221,10],[10254,10],[12941,10],[13104,10],[13783,10],[13944,10],[14912,10],[15216,10],[16249,10],[18627,10],[18790,10],[19471,10],[19632,10],[20602,10],[20906,10],[21941,10],[24253,10],[24416,10],[25096,10],[25257,10],[26226,10],[26530,10],[27564,10]]},"574":{"position":[[252,10],[415,10],[1102,10],[1263,10],[2453,10],[2757,10],[3877,10]]},"578":{"position":[[259,10],[422,10],[1105,10],[1266,10],[2452,10],[2756,10],[3872,10]]},"580":{"position":[[270,10],[433,10],[1068,10],[1229,10],[2308,10],[2612,10],[3670,10]]},"582":{"position":[[116,10],[279,10],[946,10],[1107,10],[2063,10],[2367,10],[3388,10],[5630,10],[5793,10],[6460,10],[6621,10],[7577,10],[7881,10],[8902,10]]},"584":{"position":[[153,10],[316,10],[943,10],[1104,10],[2175,10],[2479,10],[3529,10],[5690,10],[5853,10],[6521,10],[6682,10],[7639,10],[7943,10],[8965,10]]},"599":{"position":[[275,10],[438,10],[1115,10],[1276,10],[2242,10],[2546,10],[3577,10]]},"606":{"position":[[525,10],[688,10],[1410,10],[1571,10],[2634,10],[2938,10],[4022,10],[6681,10],[6844,10],[7547,10],[7708,10],[8732,10],[9036,10],[10099,10],[12662,10],[12825,10],[13538,10],[13699,10],[14733,10],[15037,10],[16110,10]]},"608":{"position":[[728,10],[891,10],[1495,10],[1656,10],[2601,10],[2905,10],[3871,10]]},"613":{"position":[[266,10],[429,10],[1145,10],[1306,10],[2338,10],[2642,10],[3735,10],[6178,10],[6341,10],[7057,10],[7218,10],[8250,10],[8554,10],[9647,10]]},"618":{"position":[[187,10],[350,10],[1159,10],[1320,10],[2453,10],[2757,10],[3955,10]]},"637":{"position":[[402,10],[565,10],[1317,10],[1478,10],[2674,10],[2978,10],[4153,10]]},"639":{"position":[[217,10],[380,10],[1069,10],[1230,10],[2208,10],[2512,10],[3555,10]]},"645":{"position":[[127,10],[290,10],[1141,10],[1302,10],[2656,10],[2960,10],[4244,10]]},"647":{"position":[[146,10],[309,10],[990,10],[1151,10],[2121,10],[2425,10],[3460,10]]},"649":{"position":[[127,10],[290,10],[997,10],[1158,10],[2309,10],[2613,10],[3743,10],[6185,10],[6348,10],[7030,10],[7191,10],[8162,10],[8466,10],[9502,10],[11818,10],[11981,10],[12666,10],[12827,10],[13801,10],[14105,10],[15144,10]]},"667":{"position":[[1406,10],[1569,10],[2247,10],[2408,10],[3375,10],[3679,10],[4711,10],[7578,10],[7741,10],[8419,10],[8580,10],[9547,10],[9851,10],[10883,10],[14399,10],[14562,10],[15243,10],[15404,10],[16374,10],[16678,10],[17713,10],[21236,10],[21399,10],[22077,10],[22238,10],[23205,10],[23509,10],[24541,10],[27472,10],[27635,10],[28314,10],[28475,10],[29443,10],[29747,10],[30780,10]]},"669":{"position":[[1379,10],[1542,10],[2221,10],[2382,10],[3350,10],[3654,10],[4687,10],[7628,10],[7791,10],[8473,10],[8634,10],[9605,10],[9909,10],[10945,10],[13972,10],[14135,10],[14815,10],[14976,10],[15945,10],[16249,10],[17283,10],[20295,10],[20458,10],[21138,10],[21299,10],[22268,10],[22572,10],[23606,10]]},"679":{"position":[[1093,10],[1256,10],[1936,10],[2097,10],[3066,10],[3370,10],[4404,10],[6711,10],[6874,10],[7553,10],[7714,10],[8682,10],[8986,10],[10019,10]]},"681":{"position":[[217,10],[380,10],[1067,10],[1228,10],[2359,10],[2663,10],[3773,10],[6101,10],[6264,10],[6947,10],[7108,10],[8080,10],[8384,10],[9421,10]]},"683":{"position":[[192,10],[355,10],[1145,10],[1306,10],[2377,10],[2681,10],[3827,10],[6469,10],[6632,10],[7344,10],[7505,10],[8720,10],[9024,10],[10169,10],[12731,10],[12894,10],[13607,10],[13768,10],[14984,10],[15288,10],[16434,10],[19033,10],[19196,10],[19876,10],[20037,10],[21006,10],[21310,10],[22344,10],[24696,10],[24859,10],[25537,10],[25698,10],[26665,10],[26969,10],[28001,10]]},"703":{"position":[[4778,10],[4941,10],[5645,10],[5806,10],[6954,10],[7258,10],[8385,10]]},"705":{"position":[[1169,10],[1332,10],[2064,10],[2225,10],[3401,10],[3705,10],[4860,10]]},"726":{"position":[[231,10],[394,10],[1875,10],[2036,10],[4256,10],[4560,10],[6514,10],[11549,10],[11712,10],[12733,10],[12894,10],[14477,10],[14781,10],[16245,10],[19686,10],[19849,10],[20800,10],[20961,10],[22474,10],[22778,10],[24172,10],[28285,10],[28448,10],[29127,10],[29288,10],[30256,10],[30560,10],[31593,10],[34044,10],[34207,10],[34887,10],[35048,10],[36017,10],[36321,10],[37355,10],[39661,10],[39824,10],[40507,10],[40668,10],[41640,10],[41944,10],[42981,10],[45303,10],[45466,10],[46150,10],[46311,10],[47284,10],[47588,10],[48626,10]]},"728":{"position":[[327,10],[490,10],[1170,10],[1331,10],[2300,10],[2604,10],[3638,10],[8246,10],[8409,10],[9085,10],[9246,10],[10211,10],[10515,10],[11545,10],[14163,10],[14326,10],[15011,10],[15172,10],[16146,10],[16450,10],[17489,10],[24581,10],[24744,10],[25428,10],[25589,10],[26562,10],[26866,10],[27904,10],[32829,10],[32992,10],[33667,10],[33828,10],[34792,10],[35096,10],[36125,10],[38451,7],[42364,10],[42527,10],[43202,10],[43363,10],[44327,10],[44631,10],[45660,10]]},"745":{"position":[[1858,10],[2021,10],[2664,10],[2825,10],[3912,10],[4216,10],[5282,10],[7542,10],[7705,10],[8386,10],[8547,10],[9517,10],[9821,10],[10856,10],[13232,10],[13395,10],[14038,10],[14199,10],[15286,10],[15590,10],[16656,10],[18873,10],[19036,10],[19717,10],[19878,10],[20848,10],[21152,10],[22187,10],[24499,10],[24662,10],[25344,10],[25505,10],[26476,10],[26780,10],[27816,10],[32233,10],[32396,10],[33077,10],[33238,10],[34208,10],[34512,10],[35547,10],[37859,10],[38022,10],[38703,10],[38864,10],[39834,10],[40138,10],[41173,10]]},"747":{"position":[[2387,10],[2550,10],[3422,10],[3583,10],[4958,10],[5262,10],[6567,10],[9701,10],[9864,10],[10547,10],[10708,10],[11680,10],[11984,10],[13021,10]]},"749":{"position":[[332,10],[495,10],[1162,10],[1323,10],[2434,10],[2738,10],[3828,10],[6573,10],[6736,10],[7435,10],[7596,10],[8739,10],[9043,10],[10165,10],[12464,10],[12627,10],[13308,10],[13469,10],[14439,10],[14743,10],[15778,10]]},"751":{"position":[[3029,10],[3192,10],[3919,10],[4080,10],[5310,10],[5614,10],[6774,10],[9913,10],[10076,10],[10761,10],[10922,10],[11896,10],[12200,10],[13239,10],[17347,10],[17510,10],[18175,10],[18336,10],[19445,10],[19749,10],[20837,10]]},"771":{"position":[[544,10],[707,10],[1349,10],[1510,10],[2596,10],[2900,10],[3965,10],[6192,10],[6355,10],[7001,10],[7162,10],[8252,10],[8556,10],[9625,10],[11876,10],[12039,10],[12828,10],[12989,10],[14340,10],[14644,10],[15876,10],[19110,10],[19273,10],[19953,10],[20114,10],[21083,10],[21387,10],[22421,10],[24809,10],[24972,10],[25650,10],[25811,10],[26778,10],[27082,10],[28114,10]]},"773":{"position":[[2962,10],[3125,10],[3967,10],[4128,10],[5591,10],[5895,10],[7190,10],[10438,10],[10601,10],[11284,10],[11445,10],[12417,10],[12721,10],[13758,10]]},"775":{"position":[[2867,10],[3030,10],[3760,10],[3921,10],[5154,10],[5458,10],[6621,10],[9392,10],[9555,10],[10480,10],[10641,10],[12187,10],[12491,10],[13869,10],[17622,10],[17785,10],[18462,10],[18623,10],[19589,10],[19893,10],[20924,10]]},"777":{"position":[[3062,10],[3225,10],[4017,10],[4178,10],[5532,10],[5836,10],[7071,10],[10314,10],[10477,10],[11159,10],[11320,10],[12291,10],[12595,10],[13631,10]]},"789":{"position":[[2635,10],[2798,10],[3960,10],[4121,10],[5904,10],[6208,10],[7823,10]]},"795":{"position":[[462,10],[625,10],[1301,10],[1462,10],[2427,10],[2731,10],[3761,10],[6150,10],[6313,10],[6993,10],[7154,10],[8123,10],[8427,10],[9461,10],[11875,10],[12038,10],[12740,10],[12901,10],[14047,10],[14351,10],[15476,10],[17785,10],[17948,10],[18625,10],[18786,10],[19752,10],[20056,10],[21087,10]]},"797":{"position":[[4577,10],[4740,10],[5412,10],[5573,10],[6534,10],[6838,10],[7864,10],[10382,10],[10545,10],[11615,10],[11776,10],[13408,10],[13712,10],[15225,10],[18925,10],[19088,10],[19913,10],[20074,10],[21402,10],[21706,10],[22964,10],[25864,10],[26027,10],[26703,10],[26864,10],[27829,10],[28133,10],[29163,10]]},"799":{"position":[[1122,10],[1285,10],[2165,10],[2326,10],[3709,10],[4013,10],[5326,10],[8559,10],[8722,10],[9567,10],[9728,10],[10881,10],[11185,10],[12416,10],[15485,10],[15648,10],[16494,10],[16655,10],[17809,10],[18113,10],[19345,10]]},"801":{"position":[[3363,10],[3526,10],[5944,10],[6105,10],[9616,10],[9920,10],[12871,10]]},"820":{"position":[[1859,10],[2022,10],[2668,10],[2829,10],[3919,10],[4223,10],[5292,10],[7567,10],[7730,10],[8414,10],[8575,10],[9548,10],[9852,10],[10890,10],[13279,10],[13442,10],[14084,10],[14245,10],[15331,10],[15635,10],[16700,10],[18913,10],[19076,10],[19756,10],[19917,10],[20886,10],[21190,10],[22224,10],[24531,10],[24694,10],[25376,10],[25537,10],[26508,10],[26812,10],[27848,10],[31753,10],[31916,10],[32596,10],[32757,10],[33726,10],[34030,10],[35064,10],[37371,10],[37534,10],[38215,10],[38376,10],[39346,10],[39650,10],[40685,10]]},"822":{"position":[[2142,10],[2305,10],[3268,10],[3429,10],[5013,10],[5317,10],[6733,10],[10375,10],[10538,10],[11222,10],[11383,10],[12356,10],[12660,10],[13698,10]]},"824":{"position":[[1975,10],[2138,10],[2980,10],[3141,10],[4486,10],[4790,10],[6065,10],[9288,10],[9451,10],[10138,10],[10299,10],[11275,10],[11579,10],[12620,10]]},"826":{"position":[[2848,10],[3011,10],[4026,10],[4187,10],[5764,10],[6068,10],[7526,10],[10958,10],[11121,10],[11809,10],[11970,10],[12947,10],[13251,10],[14293,10],[16716,10],[16879,10],[17569,10],[17730,10],[18709,10],[19013,10],[20057,10],[22413,10],[22576,10],[23268,10],[23429,10],[24410,10],[24714,10],[25760,10],[28205,10],[28368,10],[29058,10],[29219,10],[30198,10],[30502,10],[31546,10],[33902,10],[34065,10],[34755,10],[34916,10],[35895,10],[36199,10],[37243,10]]},"844":{"position":[[2101,10],[2264,10],[2965,10],[3126,10],[4271,10],[4575,10],[5699,10],[8078,10],[8241,10],[8927,10],[9088,10],[10063,10],[10367,10],[11407,10],[13812,10],[13975,10],[14676,10],[14837,10],[15982,10],[16286,10],[17410,10],[19746,10],[19909,10],[20595,10],[20756,10],[21731,10],[22035,10],[23075,10],[25489,10],[25652,10],[26345,10],[26506,10],[27488,10],[27792,10],[28839,10],[31650,10],[31813,10],[32764,10],[32925,10],[34438,10],[34742,10],[36136,10],[39450,10],[39613,10],[40299,10],[40460,10],[41435,10],[41739,10],[42779,10]]},"846":{"position":[[162,10],[325,10],[1006,10],[1167,10],[2137,10],[2441,10],[3476,10],[7444,10],[7607,10],[8287,10],[8448,10],[9417,10],[9721,10],[10755,10]]},"848":{"position":[[6930,10],[7093,10],[7959,10],[8120,10],[9548,10],[9852,10],[11161,10],[14546,10],[14709,10],[15479,10],[15640,10],[16854,10],[17158,10],[18351,10],[20989,10],[21152,10],[21966,10],[22127,10],[23444,10],[23748,10],[24995,10],[27823,10],[27986,10],[28715,10],[28876,10],[30108,10],[30412,10],[31574,10],[34307,10],[34470,10],[35142,10],[35303,10],[36419,10],[36723,10],[37818,10],[40194,10],[40357,10],[41012,10],[41173,10],[42272,10],[42576,10],[43654,10],[46095,10],[46258,10],[46936,10],[47097,10],[48064,10],[48368,10],[49400,10],[51766,10],[51929,10],[52622,10],[52783,10],[53765,10],[54069,10],[55116,10]]}}}],["inn",{"_index":543,"t":{"39":{"position":[[546,4]]}}}],["input",{"_index":1515,"t":{"236":{"position":[[79,5]]},"482":{"position":[[10575,6]]}}}],["insecur",{"_index":1500,"t":{"228":{"position":[[537,8]]}}}],["insid",{"_index":313,"t":{"19":{"position":[[587,6]]},"113":{"position":[[968,6]]},"171":{"position":[[816,6]]},"510":{"position":[[338,6]]},"807":{"position":[[1292,6]]},"809":{"position":[[712,6]]}}}],["inspir",{"_index":263,"t":{"15":{"position":[[144,8]]}}}],["instabl",{"_index":1473,"t":{"222":{"position":[[952,14]]}}}],["instagram",{"_index":1689,"t":{"361":{"position":[[639,9]]}}}],["instal",{"_index":351,"t":{"29":{"position":[[64,7],[83,7]]},"33":{"position":[[183,9],[469,9],[755,9],[1041,9],[1327,9]]},"113":{"position":[[16,7],[150,7],[267,8],[875,7],[990,7],[1090,7],[1207,8],[1221,7],[1347,8],[1367,7],[1508,7],[1566,7],[1792,7]]},"115":{"position":[[5,7]]},"117":{"position":[[82,7],[140,7]]},"121":{"position":[[43,7]]},"125":{"position":[[73,7]]},"129":{"position":[[183,9],[506,9],[829,9],[1152,9]]},"141":{"position":[[183,9],[506,9],[829,9],[1152,9]]},"165":{"position":[[162,9],[526,9]]},"169":{"position":[[21,7],[143,7],[367,7],[1010,7]]},"208":{"position":[[78,7],[109,11]]},"244":{"position":[[183,9],[470,9],[757,9],[1044,9]]},"273":{"position":[[179,9],[501,9],[823,9],[1110,9]]},"838":{"position":[[777,10]]}}}],["instanc",{"_index":25,"t":{"3":{"position":[[349,9]]},"33":{"position":[[42,8],[328,8],[614,8],[900,8],[1186,8],[1486,8]]},"35":{"position":[[6029,8]]},"45":{"position":[[16343,8],[22537,8],[29008,8]]},"129":{"position":[[42,8],[365,8],[688,8],[1011,8],[1334,8],[1595,8]]},"133":{"position":[[2965,8]]},"141":{"position":[[42,8],[365,8],[688,8],[1011,8],[1334,8],[1595,8]]},"145":{"position":[[2965,8]]},"153":{"position":[[904,9],[986,10],[1076,10],[1149,9]]},"165":{"position":[[21,8],[385,8]]},"200":{"position":[[4263,8]]},"202":{"position":[[4175,8],[9925,8]]},"212":{"position":[[236,8],[330,8]]},"216":{"position":[[188,9]]},"244":{"position":[[42,8],[329,8],[616,8],[903,8],[1190,8],[1451,8]]},"248":{"position":[[2965,8]]},"265":{"position":[[4445,8]]},"267":{"position":[[4269,8],[9863,8]]},"273":{"position":[[38,8],[360,8],[682,8],[969,8],[1256,8]]},"277":{"position":[[2937,8]]},"285":{"position":[[5468,8],[11327,8],[17142,8],[22750,8]]},"294":{"position":[[4522,8]]},"296":{"position":[[4221,8]]},"311":{"position":[[4343,8],[9927,8],[16360,8]]},"357":{"position":[[4372,8]]},"369":{"position":[[4317,8],[9924,8]]},"375":{"position":[[4708,8],[10612,8],[16426,8]]},"382":{"position":[[5287,8]]},"402":{"position":[[4361,8]]},"404":{"position":[[4272,8],[10112,8]]},"444":{"position":[[4958,8],[11059,8]]},"446":{"position":[[5190,8]]},"448":{"position":[[4153,8]]},"462":{"position":[[4326,8],[9957,8]]},"466":{"position":[[4289,8],[10088,8]]},"504":{"position":[[4294,8]]},"506":{"position":[[4536,8]]},"508":{"position":[[4345,8]]},"522":{"position":[[4636,8]]},"524":{"position":[[4465,8]]},"540":{"position":[[4309,8]]},"542":{"position":[[4873,8]]},"544":{"position":[[4411,8]]},"562":{"position":[[5008,8],[10987,8],[16982,8],[22674,8],[28297,8]]},"574":{"position":[[4610,8]]},"578":{"position":[[4605,8]]},"580":{"position":[[4403,8]]},"582":{"position":[[4121,8],[9635,8]]},"584":{"position":[[4262,8],[9698,8]]},"599":{"position":[[4310,8]]},"606":{"position":[[4755,8],[10832,8],[16843,8]]},"608":{"position":[[4604,8]]},"613":{"position":[[4468,8],[10380,8]]},"618":{"position":[[4688,8]]},"637":{"position":[[4886,8]]},"639":{"position":[[4288,8]]},"645":{"position":[[4977,8]]},"647":{"position":[[4193,8]]},"649":{"position":[[4476,8],[10235,8],[15877,8]]},"667":{"position":[[5444,8],[11616,8],[18446,8],[25274,8],[31513,8]]},"669":{"position":[[5420,8],[11678,8],[18016,8],[24339,8]]},"679":{"position":[[5137,8],[10752,8]]},"681":{"position":[[4506,8],[10154,8]]},"683":{"position":[[4560,8],[10902,8],[17167,8],[23077,8],[28734,8]]},"703":{"position":[[9118,8]]},"705":{"position":[[5593,8]]},"726":{"position":[[7247,8],[16978,8],[24905,8],[32326,8],[38088,8],[43714,8],[49359,8]]},"728":{"position":[[4371,8],[12278,8],[18222,8],[28637,8],[36858,8],[46393,8]]},"745":{"position":[[6015,8],[11589,8],[17389,8],[22920,8],[28549,8],[36280,8],[41906,8]]},"747":{"position":[[7300,8],[13754,8]]},"749":{"position":[[4561,8],[10898,8],[16511,8]]},"751":{"position":[[7507,8],[13972,8],[21570,8]]},"771":{"position":[[4698,8],[10358,8],[16609,8],[23154,8],[28847,8]]},"773":{"position":[[7923,8],[14491,8]]},"775":{"position":[[7354,8],[14602,8],[21657,8]]},"777":{"position":[[7804,8],[14364,8]]},"789":{"position":[[8556,8]]},"795":{"position":[[4494,8],[10194,8],[16209,8],[21820,8]]},"797":{"position":[[8597,8],[15958,8],[23697,8],[29896,8]]},"799":{"position":[[6059,8],[13149,8],[20078,8]]},"801":{"position":[[13604,8]]},"820":{"position":[[6025,8],[11623,8],[17433,8],[22957,8],[28581,8],[35797,8],[41418,8]]},"822":{"position":[[7466,8],[14431,8]]},"824":{"position":[[6798,8],[13353,8]]},"826":{"position":[[8259,8],[15026,8],[20790,8],[26493,8],[32279,8],[37976,8]]},"844":{"position":[[6432,8],[12140,8],[18143,8],[23808,8],[29572,8],[36869,8],[43512,8]]},"846":{"position":[[4209,8],[11488,8]]},"848":{"position":[[11894,8],[19084,8],[25728,8],[32307,8],[38551,8],[44387,8],[50133,8],[55849,8]]}}}],["instanti",{"_index":1087,"t":{"169":{"position":[[578,11]]}}}],["instead",{"_index":322,"t":{"21":{"position":[[186,7]]},"35":{"position":[[1207,7],[2398,7],[4254,7],[5719,7]]},"43":{"position":[[342,7],[818,7],[1792,7]]},"45":{"position":[[12762,7],[13617,7],[14942,7],[16033,7],[18956,7],[19811,7],[21136,7],[22227,7],[25310,7],[26186,7],[27565,7],[28698,7]]},"113":{"position":[[661,7]]},"133":{"position":[[480,7],[1032,7],[1943,7],[2655,7]]},"145":{"position":[[480,7],[1032,7],[1943,7],[2655,7]]},"173":{"position":[[4791,7]]},"183":{"position":[[429,7],[1057,7],[1878,7],[2586,7]]},"185":{"position":[[777,7],[1546,7],[2606,7],[3688,7]]},"187":{"position":[[653,7],[1571,7],[2769,7],[4249,7]]},"200":{"position":[[593,7],[1403,7],[2838,7],[3953,7]]},"202":{"position":[[603,7],[1455,7],[2777,7],[3865,7],[6347,7],[7201,7],[8525,7],[9615,7]]},"248":{"position":[[480,7],[1032,7],[1943,7],[2655,7]]},"265":{"position":[[903,7],[1745,7],[3057,7],[4135,7]]},"267":{"position":[[614,7],[1419,7],[2849,7],[3959,7],[6318,7],[7161,7],[8474,7],[9553,7]]},"277":{"position":[[452,7],[1004,7],[1915,7],[2627,7]]},"285":{"position":[[1908,7],[2756,7],[4074,7],[5158,7],[7546,7],[8393,7],[9865,7],[11017,7],[13570,7],[14422,7],[15744,7],[16832,7],[19172,7],[20026,7],[21350,7],[22440,7]]},"294":{"position":[[855,7],[1664,7],[3098,7],[4212,7]]},"296":{"position":[[646,7],[1499,7],[2822,7],[3911,7]]},"311":{"position":[[700,7],[1501,7],[2927,7],[4033,7],[6281,7],[7083,7],[8510,7],[9617,7],[12095,7],[13066,7],[14737,7],[16050,7]]},"355":{"position":[[0,7]]},"357":{"position":[[776,7],[1636,7],[2966,7],[4062,7]]},"369":{"position":[[742,7],[1595,7],[2918,7],[4007,7],[6352,7],[7204,7],[8526,7],[9614,7]]},"375":{"position":[[861,7],[1730,7],[3224,7],[4398,7],[7037,7],[7890,7],[9213,7],[10302,7],[12851,7],[13704,7],[15027,7],[16116,7]]},"382":{"position":[[1721,7],[2571,7],[3891,7],[4977,7]]},"402":{"position":[[655,7],[1477,7],[2924,7],[4051,7]]},"404":{"position":[[676,7],[1536,7],[2866,7],[3962,7],[6513,7],[7374,7],[8705,7],[9802,7]]},"418":{"position":[[2994,7]]},"422":{"position":[[96,7]]},"442":{"position":[[103,7]]},"444":{"position":[[724,7],[1699,7],[3358,7],[4648,7],[7478,7],[8333,7],[9658,7],[10749,7]]},"446":{"position":[[626,7],[1711,7],[3480,7],[4880,7]]},"448":{"position":[[572,7],[1427,7],[2752,7],[3843,7]]},"462":{"position":[[742,7],[1598,7],[2924,7],[4016,7],[6376,7],[7231,7],[8556,7],[9647,7]]},"466":{"position":[[702,7],[1559,7],[2886,7],[3979,7],[6501,7],[7358,7],[8685,7],[9778,7]]},"476":{"position":[[999,7]]},"504":{"position":[[630,7],[1438,7],[2871,7],[3984,7]]},"506":{"position":[[632,7],[1520,7],[3033,7],[4226,7]]},"508":{"position":[[749,7],[1609,7],[2939,7],[4035,7]]},"522":{"position":[[816,7],[1676,7],[3161,7],[4326,7]]},"524":{"position":[[881,7],[1737,7],[3063,7],[4155,7]]},"540":{"position":[[639,7],[1449,7],[2884,7],[3999,7]]},"542":{"position":[[972,7],[1859,7],[3371,7],[4563,7]]},"544":{"position":[[809,7],[1671,7],[3003,7],[4101,7]]},"548":{"position":[[1494,7]]},"560":{"position":[[263,8]]},"562":{"position":[[864,7],[1809,7],[3438,7],[4698,7],[7412,7],[8265,7],[9588,7],[10677,7],[13407,7],[14260,7],[15583,7],[16672,7],[19093,7],[19948,7],[21273,7],[22364,7],[24719,7],[25573,7],[26897,7],[27987,7]]},"574":{"position":[[718,7],[1579,7],[3124,7],[4300,7]]},"578":{"position":[[725,7],[1582,7],[3123,7],[4295,7]]},"580":{"position":[[736,7],[1545,7],[2979,7],[4093,7]]},"582":{"position":[[582,7],[1423,7],[2734,7],[3811,7],[6096,7],[6937,7],[8248,7],[9325,7]]},"584":{"position":[[619,7],[1420,7],[2846,7],[3952,7],[6156,7],[6998,7],[8310,7],[9388,7]]},"599":{"position":[[741,7],[1592,7],[2913,7],[4000,7]]},"606":{"position":[[991,7],[1887,7],[3305,7],[4445,7],[7147,7],[8024,7],[9403,7],[10522,7],[13128,7],[14015,7],[15404,7],[16533,7]]},"608":{"position":[[1194,7],[1972,7],[3272,7],[4294,7]]},"613":{"position":[[732,7],[1622,7],[3009,7],[4158,7],[6644,7],[7534,7],[8921,7],[10070,7]]},"618":{"position":[[653,7],[1636,7],[3124,7],[4378,7]]},"637":{"position":[[868,7],[1794,7],[3345,7],[4576,7]]},"639":{"position":[[683,7],[1546,7],[2879,7],[3978,7]]},"645":{"position":[[593,7],[1618,7],[3327,7],[4667,7]]},"647":{"position":[[612,7],[1467,7],[2792,7],[3883,7]]},"649":{"position":[[593,7],[1474,7],[2980,7],[4166,7],[6651,7],[7507,7],[8833,7],[9925,7],[12284,7],[13143,7],[14472,7],[15567,7]]},"667":{"position":[[1872,7],[2724,7],[4046,7],[5134,7],[8044,7],[8896,7],[10218,7],[11306,7],[14865,7],[15720,7],[17045,7],[18136,7],[21702,7],[22554,7],[23876,7],[24964,7],[27938,7],[28791,7],[30114,7],[31203,7]]},"669":{"position":[[1845,7],[2698,7],[4021,7],[5110,7],[8094,7],[8950,7],[10276,7],[11368,7],[14438,7],[15292,7],[16616,7],[17706,7],[20761,7],[21615,7],[22939,7],[24029,7]]},"679":{"position":[[1559,7],[2413,7],[3737,7],[4827,7],[7177,7],[8030,7],[9353,7],[10442,7]]},"681":{"position":[[683,7],[910,7],[1544,7],[2074,7],[3030,7],[3614,7],[4196,7],[4828,7],[5846,7],[6567,7],[7424,7],[8751,7],[9844,7]]},"683":{"position":[[658,7],[1622,7],[3048,7],[4250,7],[6935,7],[7821,7],[9391,7],[10592,7],[13197,7],[14084,7],[15655,7],[16857,7],[19499,7],[20353,7],[21677,7],[22767,7],[25162,7],[26014,7],[27336,7],[28424,7]]},"703":{"position":[[5244,7],[6122,7],[7625,7],[8808,7]]},"705":{"position":[[1635,7],[2541,7],[4072,7],[5283,7]]},"717":{"position":[[699,8]]},"726":{"position":[[697,7],[2352,7],[4927,7],[6937,7],[12015,7],[13210,7],[15148,7],[16668,7],[20152,7],[21277,7],[23145,7],[24595,7],[28751,7],[29604,7],[30927,7],[32016,7],[34510,7],[35364,7],[36688,7],[37778,7],[40127,7],[40984,7],[42311,7],[43404,7],[45769,7],[46627,7],[47955,7],[49049,7]]},"728":{"position":[[793,7],[1647,7],[2971,7],[4061,7],[8712,7],[9562,7],[10882,7],[11968,7],[14629,7],[15488,7],[16817,7],[17912,7],[22736,7],[25047,7],[25905,7],[27233,7],[28327,7],[31015,7],[33295,7],[34144,7],[35463,7],[36548,7],[42830,7],[43679,7],[44998,7],[46083,7]]},"738":{"position":[[278,8]]},"745":{"position":[[2324,7],[3141,7],[4583,7],[5705,7],[8008,7],[8863,7],[10188,7],[11279,7],[13698,7],[14515,7],[15957,7],[17079,7],[19339,7],[20194,7],[21519,7],[22610,7],[24965,7],[25821,7],[27147,7],[28239,7],[32699,7],[33554,7],[34879,7],[35970,7],[38325,7],[39180,7],[40505,7],[41596,7]]},"747":{"position":[[2853,7],[3899,7],[5629,7],[6990,7],[10167,7],[11024,7],[12351,7],[13444,7]]},"749":{"position":[[798,7],[1639,7],[3105,7],[4251,7],[7039,7],[7912,7],[9410,7],[10588,7],[12930,7],[13785,7],[15110,7],[16201,7]]},"751":{"position":[[3495,7],[4396,7],[5981,7],[7197,7],[10379,7],[11238,7],[12567,7],[13662,7],[17813,7],[18652,7],[20116,7],[21260,7]]},"771":{"position":[[1010,7],[1826,7],[3267,7],[4388,7],[6658,7],[7478,7],[8923,7],[10048,7],[12342,7],[13305,7],[15011,7],[16299,7],[19576,7],[20430,7],[21754,7],[22844,7],[25275,7],[26127,7],[27449,7],[28537,7]]},"773":{"position":[[109,7],[449,7],[2709,7],[3428,7],[4444,7],[6262,7],[7613,7],[10904,7],[11761,7],[13088,7],[14181,7]]},"775":{"position":[[3333,7],[4237,7],[5825,7],[7044,7],[9858,7],[10957,7],[12858,7],[14292,7],[17495,7],[18088,7],[18939,7],[20260,7],[21347,7]]},"777":{"position":[[3528,7],[4494,7],[6203,7],[7494,7],[10780,7],[11636,7],[12962,7],[14054,7]]},"789":{"position":[[3101,7],[4437,7],[6575,7],[8246,7]]},"795":{"position":[[928,7],[1778,7],[3098,7],[4184,7],[6616,7],[7470,7],[8794,7],[9884,7],[12341,7],[13217,7],[14718,7],[15899,7],[18251,7],[19102,7],[20423,7],[21510,7]]},"797":{"position":[[5043,7],[5889,7],[7205,7],[8287,7],[10848,7],[12092,7],[14079,7],[15648,7],[19391,7],[20390,7],[22073,7],[23387,7],[26330,7],[27180,7],[28500,7],[29586,7]]},"799":{"position":[[873,7],[1588,7],[2642,7],[4380,7],[5749,7],[9025,7],[10044,7],[11552,7],[12839,7],[15951,7],[16971,7],[18480,7],[19768,7]]},"801":{"position":[[3829,7],[6421,7],[10287,7],[13294,7]]},"813":{"position":[[322,8]]},"820":{"position":[[2325,7],[3145,7],[4590,7],[5715,7],[8033,7],[8891,7],[10219,7],[11313,7],[13745,7],[14561,7],[16002,7],[17123,7],[19379,7],[20233,7],[21557,7],[22647,7],[24997,7],[25853,7],[27179,7],[28271,7],[32219,7],[33073,7],[34397,7],[35487,7],[37837,7],[38692,7],[40017,7],[41108,7]]},"822":{"position":[[2608,7],[3745,7],[5684,7],[7156,7],[10841,7],[11699,7],[13027,7],[14121,7]]},"824":{"position":[[2441,7],[3457,7],[5157,7],[6488,7],[9754,7],[10615,7],[11946,7],[13043,7]]},"826":{"position":[[3314,7],[4503,7],[6435,7],[7949,7],[11424,7],[12286,7],[13618,7],[14716,7],[17182,7],[18046,7],[19380,7],[20480,7],[22879,7],[23745,7],[25081,7],[26183,7],[28671,7],[29535,7],[30869,7],[31969,7],[34368,7],[35232,7],[36566,7],[37666,7]]},"836":{"position":[[661,8]]},"844":{"position":[[2567,7],[3442,7],[4942,7],[6122,7],[8544,7],[9404,7],[10734,7],[11830,7],[14278,7],[15153,7],[16653,7],[17833,7],[20212,7],[21072,7],[22402,7],[23498,7],[25955,7],[26822,7],[28159,7],[29262,7],[32116,7],[33241,7],[35109,7],[36559,7],[39916,7],[40776,7],[42106,7],[43202,7]]},"846":{"position":[[628,7],[1483,7],[2808,7],[3899,7],[7910,7],[8764,7],[10088,7],[11178,7]]},"848":{"position":[[7396,7],[8436,7],[10219,7],[11584,7],[15012,7],[15956,7],[17525,7],[18774,7],[21455,7],[22443,7],[24115,7],[25418,7],[28289,7],[29192,7],[30779,7],[31997,7],[34773,7],[35619,7],[37090,7],[38241,7],[40660,7],[41489,7],[42943,7],[44077,7],[46561,7],[47413,7],[48735,7],[49823,7],[52232,7],[53099,7],[54436,7],[55539,7]]}}}],["institut",{"_index":2651,"t":{"781":{"position":[[227,10]]}}}],["instruct",{"_index":1072,"t":{"159":{"position":[[180,13]]},"187":{"position":[[175,12]]}}}],["integr",{"_index":180,"t":{"7":{"position":[[382,11]]},"9":{"position":[[130,11]]},"15":{"position":[[361,12]]},"29":{"position":[[810,9],[839,9]]},"163":{"position":[[36,9]]},"169":{"position":[[269,11]]},"175":{"position":[[73,11]]},"177":{"position":[[23,9]]}}}],["intellij",{"_index":930,"t":{"113":{"position":[[1059,8]]}}}],["intend",{"_index":1789,"t":{"418":{"position":[[2902,9],[3021,8]]}}}],["intens",{"_index":1023,"t":{"155":{"position":[[192,9]]}}}],["intent",{"_index":1764,"t":{"412":{"position":[[898,6]]}}}],["interact",{"_index":771,"t":{"81":{"position":[[808,11]]},"840":{"position":[[183,8]]}}}],["interest",{"_index":330,"t":{"21":{"position":[[460,10]]},"850":{"position":[[575,10]]}}}],["intern",{"_index":668,"t":{"45":{"position":[[6396,10]]},"689":{"position":[[512,8]]},"783":{"position":[[539,8]]},"789":{"position":[[369,8]]},"840":{"position":[[784,8]]},"848":{"position":[[1183,8],[6839,8],[27673,8],[27706,8]]}}}],["interpret",{"_index":1791,"t":{"418":{"position":[[3149,9],[3402,9],[3526,9]]}}}],["intersect",{"_index":833,"t":{"93":{"position":[[4,12],[43,12],[163,14],[326,15],[1245,12]]},"97":{"position":[[258,12],[271,12]]},"317":{"position":[[802,12]]},"323":{"position":[[79,12],[394,12]]},"384":{"position":[[1299,13]]},"386":{"position":[[343,12],[1111,12]]},"454":{"position":[[3275,12],[3302,12]]},"460":{"position":[[579,12],[606,12]]},"464":{"position":[[658,15]]},"675":{"position":[[652,12],[679,12]]},"703":{"position":[[170,12],[1431,15],[1715,15]]},"707":{"position":[[791,15],[1075,15]]},"797":{"position":[[1709,15],[3358,15]]},"801":{"position":[[1043,15],[1960,15]]},"803":{"position":[[1443,15],[2427,15]]}}}],["interv",{"_index":1367,"t":{"212":{"position":[[1855,9]]}}}],["introduc",{"_index":73,"t":{"3":{"position":[[1062,11]]},"109":{"position":[[427,12]]},"390":{"position":[[136,9]]},"408":{"position":[[172,10]]},"420":{"position":[[18,9],[363,10]]},"476":{"position":[[128,9]]},"536":{"position":[[271,9]]},"548":{"position":[[1279,9]]},"703":{"position":[[305,11]]},"730":{"position":[[704,11]]},"747":{"position":[[9453,10]]},"751":{"position":[[485,9]]},"779":{"position":[[23,10],[122,11]]},"797":{"position":[[716,9]]},"822":{"position":[[10121,10]]},"850":{"position":[[187,10],[393,11]]}}}],["introduct",{"_index":1983,"t":{"484":{"position":[[196,12]]}}}],["intuit",{"_index":770,"t":{"81":{"position":[[696,10]]},"745":{"position":[[30146,12]]},"820":{"position":[[30178,12]]}}}],["invalid",{"_index":1769,"t":{"412":{"position":[[3270,7]]},"418":{"position":[[2494,7]]},"420":{"position":[[402,8],[459,7],[641,7]]},"522":{"position":[[6318,8],[6338,7],[6418,7],[6666,8],[6686,7],[6767,7]]},"728":{"position":[[5954,8]]}}}],["investig",{"_index":2243,"t":{"665":{"position":[[102,11]]},"669":{"position":[[25,11]]}}}],["invit",{"_index":2852,"t":{"838":{"position":[[753,8],[1173,7]]},"840":{"position":[[585,7]]}}}],["invok",{"_index":366,"t":{"29":{"position":[[1220,8]]},"35":{"position":[[666,6]]},"111":{"position":[[284,8]]},"157":{"position":[[162,8]]},"173":{"position":[[735,6]]},"250":{"position":[[39,6]]},"252":{"position":[[38,6]]},"412":{"position":[[3319,8]]}}}],["involv",{"_index":1049,"t":{"155":{"position":[[1109,9],[2179,7],[2611,7]]},"333":{"position":[[1155,9]]},"386":{"position":[[1188,8]]},"408":{"position":[[867,8]]}}}],["iot",{"_index":832,"t":{"91":{"position":[[1639,4]]},"175":{"position":[[160,3],[207,3]]},"337":{"position":[[226,3]]},"671":{"position":[[320,3],[372,3]]},"755":{"position":[[55,3],[206,3]]},"761":{"position":[[69,3]]}}}],["ip",{"_index":53,"t":{"3":{"position":[[829,3]]},"5":{"position":[[213,2]]},"333":{"position":[[1087,2]]},"689":{"position":[[521,2]]},"783":{"position":[[190,2],[548,2]]},"793":{"position":[[358,2]]},"797":{"position":[[57,2],[169,3],[478,2],[535,3],[975,2],[1386,3],[2227,3],[4321,2],[4461,2],[10158,2],[11449,3],[15064,3],[18096,2],[18794,2],[19641,2],[19705,3],[20943,2],[22680,2],[22753,3],[24042,2],[25199,2],[25398,2]]},"799":{"position":[[212,2],[1021,2],[1866,2],[1930,3],[3223,2],[5015,2],[5088,3],[6433,2],[7581,2],[7770,2],[8447,2],[9384,3],[10658,3],[12229,3],[14071,2],[15168,3],[15373,2],[16310,3],[17585,3],[19157,3],[21001,2],[22100,3]]},"801":{"position":[[188,3],[753,2],[1561,3],[3154,3],[5778,3],[12710,3],[19068,2]]},"803":{"position":[[401,3],[966,2],[2028,3],[3621,3]]}}}],["isn't",{"_index":1674,"t":{"353":{"position":[[40,5]]}}}],["isol",{"_index":633,"t":{"45":{"position":[[3867,8]]}}}],["issu",{"_index":900,"t":{"109":{"position":[[658,6]]},"281":{"position":[[1023,7]]},"369":{"position":[[205,7]]},"375":{"position":[[6483,5],[12290,5]]},"416":{"position":[[750,5]]},"444":{"position":[[6931,7]]},"462":{"position":[[205,7]]},"606":{"position":[[6612,5],[12593,5]]},"703":{"position":[[2778,7]]},"719":{"position":[[366,6]]},"721":{"position":[[539,6],[684,6],[833,6]]},"726":{"position":[[944,6],[1083,6],[1383,6],[2902,6],[3100,6],[3518,6],[5531,6],[5680,6],[6000,6],[7589,6],[7737,6],[8055,6],[10491,6],[10634,6],[10942,6]]},"728":{"position":[[41893,6],[42038,6],[42187,6]]},"797":{"position":[[4505,7]]},"844":{"position":[[39350,5]]}}}],["issuer",{"_index":1417,"t":{"214":{"position":[[1793,6],[2103,7],[2117,7],[2402,6],[3091,7]]}}}],["issuer=\"oidc",{"_index":1423,"t":{"214":{"position":[[3078,12]]}}}],["it'",{"_index":214,"t":{"9":{"position":[[388,4]]},"153":{"position":[[362,4]]},"446":{"position":[[83,4]]}}}],["it_admin",{"_index":2597,"t":{"773":{"position":[[834,8],[1204,9],[1287,8],[1354,8],[1414,8],[1507,11],[1665,10],[1844,10],[2016,10],[2069,11],[2891,8],[3729,11],[3868,11],[6938,11],[7097,11],[9700,8],[9931,8]]},"775":{"position":[[384,9],[472,11],[565,11],[839,9],[974,8],[1041,8],[1101,8],[1145,9],[1296,11],[1454,10],[1633,10],[1805,10],[1858,11],[1963,10],[2404,11],[2497,11],[3650,11],[6517,11],[8905,8],[10298,11],[10381,11],[13683,11],[13776,11],[16730,8],[16859,8]]},"777":{"position":[[695,9],[820,8],[877,8],[927,8],[971,9],[1122,11],[1264,10],[1427,10],[1583,10],[1636,11],[1741,10],[1941,11],[2034,11],[2503,8],[2913,9]]}}}],["item",{"_index":1644,"t":{"327":{"position":[[2714,5]]},"482":{"position":[[8069,5]]}}}],["iter",{"_index":1574,"t":{"283":{"position":[[552,7]]},"331":{"position":[[283,9]]},"418":{"position":[[2408,9],[2813,9]]},"474":{"position":[[188,9],[259,9],[506,7]]},"476":{"position":[[579,7]]},"484":{"position":[[1215,8],[4044,9]]},"486":{"position":[[276,9]]},"711":{"position":[[223,7]]},"724":{"position":[[196,7]]},"726":{"position":[[27444,9]]},"730":{"position":[[135,7]]}}}],["itself",{"_index":1084,"t":{"169":{"position":[[223,6],[1105,6]]},"667":{"position":[[14224,7]]},"728":{"position":[[30741,7]]},"848":{"position":[[63,7]]}}}],["jane",{"_index":1904,"t":{"472":{"position":[[842,4],[944,4]]}}}],["java",{"_index":546,"t":{"39":{"position":[[692,4]]}}}],["javascript",{"_index":185,"t":{"7":{"position":[[488,10]]},"45":{"position":[[18095,11],[24436,11]]},"109":{"position":[[950,10]]},"125":{"position":[[95,10]]}}}],["job",{"_index":1984,"t":{"484":{"position":[[229,3]]}}}],["john",{"_index":1762,"t":{"412":{"position":[[758,4]]}}}],["join",{"_index":1568,"t":{"283":{"position":[[305,5]]},"838":{"position":[[1137,4]]}}}],["jonathan",{"_index":514,"t":{"39":{"position":[[118,8]]}}}],["jq",{"_index":593,"t":{"43":{"position":[[3174,2]]}}}],["json",{"_index":380,"t":{"35":{"position":[[75,4],[5403,4],[8375,4]]},"45":{"position":[[843,4],[1646,4],[2992,4],[6653,4],[7808,4],[11339,4],[15717,4],[21911,4],[28382,4]]},"81":{"position":[[367,4],[437,4],[574,4],[728,4]]},"83":{"position":[[144,4]]},"85":{"position":[[1072,4]]},"87":{"position":[[117,4]]},"89":{"position":[[289,4],[1433,4]]},"91":{"position":[[48,4],[164,4]]},"93":{"position":[[63,4],[182,4]]},"95":{"position":[[62,4],[249,4]]},"97":{"position":[[4,4],[198,4],[1036,5],[1799,4]]},"133":{"position":[[2339,4]]},"145":{"position":[[2339,4]]},"151":{"position":[[195,6]]},"191":{"position":[[316,4]]},"200":{"position":[[3637,4]]},"202":{"position":[[3549,4],[9299,4]]},"230":{"position":[[158,4]]},"248":{"position":[[2339,4]]},"258":{"position":[[265,4]]},"265":{"position":[[3819,4]]},"267":{"position":[[3643,4],[9237,4]]},"277":{"position":[[2311,4]]},"281":{"position":[[56,4]]},"285":{"position":[[310,4],[4842,4],[10701,4],[16516,4],[22124,4]]},"294":{"position":[[3896,4]]},"296":{"position":[[3595,4]]},"302":{"position":[[354,4]]},"311":{"position":[[3717,4],[9301,4],[15734,4]]},"347":{"position":[[385,4]]},"355":{"position":[[170,4]]},"357":{"position":[[3746,4]]},"363":{"position":[[444,4]]},"369":{"position":[[3691,4],[9298,4]]},"371":{"position":[[215,4]]},"373":{"position":[[302,4]]},"375":{"position":[[4082,4],[9986,4],[15800,4]]},"382":{"position":[[47,4],[4661,4]]},"384":{"position":[[47,4]]},"396":{"position":[[285,4]]},"402":{"position":[[3735,4]]},"404":{"position":[[3646,4],[9486,4]]},"412":{"position":[[1516,4]]},"414":{"position":[[473,4]]},"416":{"position":[[1336,4]]},"418":{"position":[[767,4]]},"430":{"position":[[489,4]]},"442":{"position":[[269,4]]},"444":{"position":[[4332,4],[10433,4]]},"446":{"position":[[4564,4]]},"448":{"position":[[3527,4]]},"454":{"position":[[696,4]]},"462":{"position":[[3700,4],[9331,4]]},"464":{"position":[[179,4]]},"466":{"position":[[3663,4],[9462,4]]},"482":{"position":[[10563,4],[10605,5]]},"492":{"position":[[332,4]]},"500":{"position":[[314,4]]},"502":{"position":[[118,4]]},"504":{"position":[[3668,4]]},"506":{"position":[[3910,4]]},"508":{"position":[[3719,4]]},"514":{"position":[[275,4]]},"522":{"position":[[4010,4]]},"524":{"position":[[3839,4]]},"530":{"position":[[290,4]]},"538":{"position":[[169,4]]},"540":{"position":[[3683,4]]},"542":{"position":[[4247,4]]},"544":{"position":[[3785,4]]},"550":{"position":[[296,4]]},"558":{"position":[[274,4]]},"560":{"position":[[746,4]]},"562":{"position":[[4382,4],[10361,4],[16356,4],[22048,4],[27671,4]]},"568":{"position":[[254,4]]},"574":{"position":[[3984,4]]},"576":{"position":[[79,4]]},"578":{"position":[[3979,4]]},"580":{"position":[[3777,4]]},"582":{"position":[[3495,4],[9009,4]]},"584":{"position":[[3636,4],[9072,4]]},"590":{"position":[[358,4]]},"599":{"position":[[3684,4]]},"606":{"position":[[4129,4],[10206,4],[16217,4]]},"608":{"position":[[3978,4]]},"613":{"position":[[3842,4],[9754,4]]},"618":{"position":[[4062,4]]},"628":{"position":[[310,4]]},"635":{"position":[[143,4]]},"637":{"position":[[4260,4]]},"639":{"position":[[3662,4]]},"643":{"position":[[80,4]]},"645":{"position":[[4351,4]]},"647":{"position":[[3567,4]]},"649":{"position":[[3850,4],[9609,4],[15251,4]]},"663":{"position":[[249,4]]},"667":{"position":[[60,4],[4818,4],[10990,4],[17820,4],[24648,4],[30887,4]]},"669":{"position":[[121,4],[4794,4],[11052,4],[17390,4],[23713,4]]},"677":{"position":[[258,4],[981,4]]},"679":{"position":[[260,4],[4511,4],[10126,4]]},"681":{"position":[[3880,4],[9528,4]]},"683":{"position":[[3934,4],[10276,4],[16541,4],[22451,4],[28108,4]]},"685":{"position":[[120,4]]},"695":{"position":[[869,4]]},"703":{"position":[[1089,4],[8492,4]]},"705":{"position":[[4967,4]]},"707":{"position":[[69,4]]},"724":{"position":[[607,4]]},"726":{"position":[[6621,4],[16352,4],[24279,4],[31700,4],[37462,4],[43088,4],[48733,4]]},"728":{"position":[[3745,4],[6110,4],[7147,4],[11652,4],[17596,4],[19937,4],[20810,4],[23334,4],[28011,4],[31055,4],[36232,4],[38932,4],[39506,4],[40583,4],[45767,4]]},"745":{"position":[[286,4],[1250,4],[5389,4],[10963,4],[16763,4],[22294,4],[27923,4],[30357,4],[31565,4],[35654,4],[41280,4]]},"747":{"position":[[345,4],[779,4],[6674,4],[13128,4]]},"749":{"position":[[3935,4],[10272,4],[15885,4]]},"751":{"position":[[942,4],[1287,4],[6881,4],[13346,4],[15642,4],[20944,4],[23117,4]]},"769":{"position":[[646,4]]},"771":{"position":[[4072,4],[9732,4],[15983,4],[22528,4],[28221,4]]},"773":{"position":[[1153,4],[7297,4],[13865,4]]},"775":{"position":[[344,4],[778,4],[6728,4],[13976,4],[21031,4]]},"777":{"position":[[634,4],[7178,4],[13738,4]]},"789":{"position":[[526,4],[7930,4]]},"795":{"position":[[3868,4],[9568,4],[15583,4],[21194,4]]},"797":{"position":[[251,4],[468,4],[1294,4],[2793,4],[7971,4],[15332,4],[23071,4],[29270,4]]},"799":{"position":[[5433,4],[12523,4],[19452,4]]},"801":{"position":[[69,4],[12978,4]]},"803":{"position":[[221,4]]},"820":{"position":[[371,4],[1220,4],[5399,4],[10997,4],[16807,4],[22331,4],[27955,4],[30397,4],[35171,4],[40792,4]]},"822":{"position":[[402,4],[6840,4],[13805,4]]},"824":{"position":[[476,4],[6172,4],[12727,4],[15033,4],[16473,4]]},"826":{"position":[[547,4],[7633,4],[14400,4],[20164,4],[25867,4],[31653,4],[37350,4]]},"842":{"position":[[1000,4]]},"844":{"position":[[572,4],[1456,4],[5806,4],[11514,4],[17517,4],[23182,4],[28946,4],[36243,4],[42886,4]]},"846":{"position":[[3583,4],[6353,4],[10862,4]]},"848":{"position":[[1638,4],[3065,4],[4479,4],[11268,4],[18458,4],[25102,4],[31681,4],[37925,4],[43761,4],[49507,4],[55223,4]]}}}],["json.unmarshal([]byte(writeauthorizationmodelrequeststr",{"_index":440,"t":{"35":{"position":[[3241,60]]}}}],["jsonserializer.deserialize(modeljson",{"_index":462,"t":{"35":{"position":[[5080,88]]}}}],["jwt",{"_index":643,"t":{"45":{"position":[[4322,3],[4837,3]]},"167":{"position":[[142,3]]},"169":{"position":[[314,3],[341,3],[406,3],[462,3],[1164,3],[1179,3],[1220,3]]},"171":{"position":[[97,4],[125,3],[158,3],[225,3],[371,6],[827,4],[1580,5],[2188,3]]},"173":{"position":[[2577,3],[3429,3],[3933,3]]}}}],["jwt/jwt/v4",{"_index":1103,"t":{"169":{"position":[[1306,10]]},"171":{"position":[[1726,11]]},"173":{"position":[[2894,11]]}}}],["jwtauthent",{"_index":1141,"t":{"171":{"position":[[1215,15]]},"173":{"position":[[2071,15]]}}}],["jwtware",{"_index":1150,"t":{"171":{"position":[[1671,7]]},"173":{"position":[[2839,7]]}}}],["keep",{"_index":1014,"t":{"153":{"position":[[1755,7]]},"300":{"position":[[160,4]]},"424":{"position":[[401,4]]},"726":{"position":[[27439,4]]},"728":{"position":[[151,4]]},"797":{"position":[[10314,4]]},"803":{"position":[[12,4]]},"820":{"position":[[3,4]]},"844":{"position":[[3,4]]}}}],["key",{"_index":843,"t":{"97":{"position":[[146,4]]},"171":{"position":[[1824,3],[1839,3],[1893,3],[2028,3]]},"173":{"position":[[3065,3],[3080,3],[3134,3],[3269,3]]},"185":{"position":[[26,3],[121,3]]},"210":{"position":[[346,3],[490,5],[842,3]]},"214":{"position":[[115,3],[158,3],[198,3],[259,3],[348,3],[393,5],[559,4],[679,5],[762,4],[914,5],[1166,3],[1351,3],[1993,4],[2211,4],[2358,5],[2438,5],[2691,3],[2876,3]]},"480":{"position":[[491,4]]},"482":{"position":[[7395,3]]},"606":{"position":[[1289,8],[2511,8],[3899,8],[5967,9],[7426,8],[8609,8],[9976,8],[11987,9],[13417,8],[14610,8],[15987,8],[18028,9]]},"683":{"position":[[900,8],[2130,8],[3580,8],[5707,9]]}}}],["key1",{"_index":1335,"t":{"210":{"position":[[496,8]]},"214":{"position":[[685,8]]}}}],["key2",{"_index":1336,"t":{"210":{"position":[[505,7]]},"214":{"position":[[694,7]]}}}],["key=\"/users/myuser/key/server.key",{"_index":1416,"t":{"214":{"position":[[1674,34],[3227,34]]}}}],["keyboard",{"_index":2640,"t":{"775":{"position":[[23260,8]]}}}],["keys=\"key1,key2",{"_index":1413,"t":{"214":{"position":[[1569,16]]}}}],["keyword",{"_index":1765,"t":{"412":{"position":[[1461,8]]},"464":{"position":[[162,7]]},"669":{"position":[[861,7]]}}}],["kind",{"_index":1778,"t":{"418":{"position":[[397,5],[1799,5]]}}}],["know",{"_index":225,"t":{"9":{"position":[[768,4],[827,4]]},"165":{"position":[[274,4],[638,4]]},"191":{"position":[[96,4],[923,4],[977,4]]},"193":{"position":[[12,4]]},"258":{"position":[[96,4],[608,4],[655,4]]},"260":{"position":[[12,4]]},"285":{"position":[[96,4],[24314,4],[24432,4]]},"287":{"position":[[12,4]]},"289":{"position":[[12,4]]},"302":{"position":[[96,4],[1115,4],[1162,4],[1322,4]]},"304":{"position":[[12,4]]},"306":{"position":[[12,4]]},"347":{"position":[[87,4],[1055,4],[1109,4]]},"349":{"position":[[12,4]]},"363":{"position":[[86,4],[1553,4],[1607,4]]},"365":{"position":[[12,4]]},"396":{"position":[[96,4],[751,4]]},"430":{"position":[[86,4],[1054,4],[1118,4],[1254,4]]},"434":{"position":[[12,4]]},"436":{"position":[[12,4]]},"454":{"position":[[96,4],[2361,4],[2424,4],[2572,4]]},"456":{"position":[[12,4]]},"458":{"position":[[12,4]]},"492":{"position":[[96,4],[892,4],[939,4]]},"494":{"position":[[12,4]]},"514":{"position":[[96,4],[662,4],[709,4]]},"516":{"position":[[12,4]]},"530":{"position":[[96,4],[639,4],[686,4]]},"532":{"position":[[12,4]]},"550":{"position":[[96,4],[751,4],[798,4]]},"552":{"position":[[12,4]]},"568":{"position":[[96,4],[592,4],[639,4]]},"570":{"position":[[12,4]]},"590":{"position":[[96,4],[1063,4],[1110,4]]},"592":{"position":[[12,4]]},"628":{"position":[[86,4],[870,4],[924,4]]},"630":{"position":[[12,4]]},"655":{"position":[[87,4],[149,4],[227,4]]},"657":{"position":[[12,4]]},"693":{"position":[[655,4],[828,4]]},"705":{"position":[[12,4]]},"713":{"position":[[96,4],[314,4],[655,4]]},"717":{"position":[[473,4],[549,5]]},"728":{"position":[[38508,5]]},"734":{"position":[[96,4],[308,4],[483,4]]},"757":{"position":[[96,4],[288,4],[459,4],[698,4],[1051,4]]},"787":{"position":[[657,4],[830,4]]},"799":{"position":[[12,4],[440,4]]},"809":{"position":[[96,4],[308,4],[483,4],[759,4]]},"824":{"position":[[451,4]]},"832":{"position":[[96,4],[288,4],[459,4]]}}}],["known",{"_index":1835,"t":{"428":{"position":[[584,5]]},"482":{"position":[[5854,5]]},"749":{"position":[[35,5]]}}}],["kubecon",{"_index":507,"t":{"39":{"position":[[45,7],[830,7]]}}}],["kubernet",{"_index":522,"t":{"39":{"position":[[259,11]]},"159":{"position":[[25,10]]},"161":{"position":[[133,10],[192,11]]}}}],["käldström",{"_index":517,"t":{"39":{"position":[[146,9]]}}}],["lack",{"_index":2554,"t":{"751":{"position":[[9322,4]]},"824":{"position":[[8853,4]]}}}],["languag",{"_index":272,"t":{"15":{"position":[[282,9]]},"29":{"position":[[107,8]]},"45":{"position":[[3361,9]]},"81":{"position":[[28,8],[423,9]]},"83":{"position":[[130,9]]},"99":{"position":[[70,8]]},"109":{"position":[[924,9]]},"111":{"position":[[73,8],[120,9]]},"377":{"position":[[159,8],[202,9]]},"406":{"position":[[215,8],[258,9]]},"430":{"position":[[1408,9],[1449,8]]},"438":{"position":[[31,8]]},"476":{"position":[[612,9],[706,9]]},"478":{"position":[[4094,9]]},"480":{"position":[[2796,8]]},"482":{"position":[[38,8],[7290,9],[8471,9],[8949,9],[9320,9]]},"484":{"position":[[1016,10]]},"488":{"position":[[138,8],[181,9]]},"526":{"position":[[159,8],[202,9]]},"643":{"position":[[1771,9]]},"713":{"position":[[1043,9],[1089,8]]},"734":{"position":[[783,9],[829,8]]},"757":{"position":[[1294,9],[1340,8]]},"809":{"position":[[885,9],[930,8]]},"832":{"position":[[606,9],[652,8]]}}}],["language#th",{"_index":2214,"t":{"643":{"position":[[1291,12]]}}}],["language'",{"_index":2358,"t":{"703":{"position":[[147,10]]}}}],["larg",{"_index":242,"t":{"9":{"position":[[1148,5]]},"153":{"position":[[1716,5]]},"420":{"position":[[625,5]]},"826":{"position":[[331,6]]}}}],["last",{"_index":866,"t":{"103":{"position":[[242,4]]},"107":{"position":[[407,4]]},"317":{"position":[[438,4]]},"478":{"position":[[4637,4]]},"747":{"position":[[9429,4]]},"822":{"position":[[10097,4]]}}}],["latenc",{"_index":268,"t":{"15":{"position":[[206,7]]},"107":{"position":[[218,7]]},"155":{"position":[[1304,7],[1510,7],[1649,9]]},"226":{"position":[[438,7]]},"799":{"position":[[667,7]]}}}],["later",{"_index":1554,"t":{"279":{"position":[[3199,5]]},"476":{"position":[[157,5],[587,6]]},"548":{"position":[[1556,5]]},"639":{"position":[[6261,5]]},"728":{"position":[[23027,5]]}}}],["latest",{"_index":545,"t":{"39":{"position":[[603,7]]},"103":{"position":[[207,6]]},"183":{"position":[[3328,6]]},"185":{"position":[[4457,6]]},"187":{"position":[[5018,6]]},"208":{"position":[[164,6]]},"238":{"position":[[333,6]]}}}],["latter",{"_index":2529,"t":{"749":{"position":[[6280,6]]}}}],["layer",{"_index":1099,"t":{"169":{"position":[[1154,5]]},"728":{"position":[[22676,5],[22792,5],[22925,5],[39978,5]]}}}],["lead",{"_index":1472,"t":{"222":{"position":[[937,4]]},"476":{"position":[[969,4]]},"667":{"position":[[20516,5],[20551,5],[20793,7]]}}}],["leads#memb",{"_index":2254,"t":{"667":{"position":[[20828,14]]}}}],["leaf",{"_index":1724,"t":{"384":{"position":[[851,4],[1025,7],[1111,7]]},"386":{"position":[[1357,4],[1393,4]]},"613":{"position":[[6002,8],[11914,8]]}}}],["learn",{"_index":244,"t":{"11":{"position":[[11,5]]},"25":{"position":[[367,5]]},"27":{"position":[[180,5]]},"29":{"position":[[937,5]]},"39":{"position":[[271,5],[442,5]]},"45":{"position":[[309,5],[3318,5]]},"79":{"position":[[106,5]]},"97":{"position":[[2705,5]]},"99":{"position":[[123,5],[188,5],[287,5]]},"111":{"position":[[0,5],[82,5],[237,5]]},"157":{"position":[[115,5],[227,5],[312,5]]},"177":{"position":[[80,5]]},"189":{"position":[[23,5]]},"191":{"position":[[1047,5]]},"193":{"position":[[82,5]]},"204":{"position":[[82,5],[156,5]]},"232":{"position":[[87,5]]},"240":{"position":[[136,5],[221,5]]},"254":{"position":[[99,5],[188,5],[286,5]]},"256":{"position":[[23,5]]},"258":{"position":[[766,5]]},"260":{"position":[[123,5]]},"269":{"position":[[82,5],[170,5],[258,5]]},"283":{"position":[[23,5]]},"285":{"position":[[24384,5],[24478,5]]},"287":{"position":[[82,5]]},"289":{"position":[[58,5]]},"298":{"position":[[82,5],[152,5]]},"300":{"position":[[23,5]]},"302":{"position":[[1273,5],[1368,5]]},"304":{"position":[[123,5]]},"306":{"position":[[58,5]]},"315":{"position":[[97,5]]},"331":{"position":[[188,5]]},"333":{"position":[[133,5],[236,5],[361,5],[490,5],[608,5],[714,5],[840,5],[940,5],[1053,5],[1226,5],[1336,5],[1565,5]]},"341":{"position":[[172,5]]},"343":{"position":[[21,5],[155,5],[261,5],[375,5]]},"345":{"position":[[28,5]]},"347":{"position":[[1179,5]]},"349":{"position":[[82,5]]},"363":{"position":[[1677,5]]},"365":{"position":[[82,5]]},"377":{"position":[[94,5],[168,5],[231,5]]},"392":{"position":[[20,5],[118,5]]},"394":{"position":[[23,5]]},"406":{"position":[[85,5],[150,5],[224,5]]},"426":{"position":[[92,5],[154,5]]},"428":{"position":[[21,5]]},"430":{"position":[[1188,5],[1370,5]]},"434":{"position":[[82,5]]},"436":{"position":[[128,5]]},"450":{"position":[[99,5],[237,5]]},"454":{"position":[[2515,5],[2665,5]]},"456":{"position":[[103,5]]},"458":{"position":[[105,5]]},"468":{"position":[[95,5],[159,5],[224,5]]},"482":{"position":[[2641,5],[5163,5]]},"488":{"position":[[85,5],[147,5],[210,5]]},"490":{"position":[[23,5]]},"492":{"position":[[1050,5]]},"494":{"position":[[123,5]]},"510":{"position":[[134,5]]},"512":{"position":[[23,5]]},"514":{"position":[[820,5]]},"516":{"position":[[123,5]]},"526":{"position":[[94,5],[168,5],[237,5]]},"528":{"position":[[23,5]]},"530":{"position":[[797,5]]},"532":{"position":[[123,5]]},"546":{"position":[[96,5]]},"548":{"position":[[23,5]]},"550":{"position":[[909,5]]},"552":{"position":[[123,5]]},"564":{"position":[[125,5]]},"566":{"position":[[23,5]]},"568":{"position":[[750,5]]},"570":{"position":[[123,5]]},"586":{"position":[[115,5],[237,5]]},"588":{"position":[[23,5]]},"590":{"position":[[1221,5]]},"592":{"position":[[123,5]]},"613":{"position":[[11988,5]]},"626":{"position":[[21,5]]},"628":{"position":[[994,5]]},"630":{"position":[[82,5]]},"651":{"position":[[130,5],[219,5],[296,5]]},"653":{"position":[[21,5]]},"655":{"position":[[338,5]]},"657":{"position":[[123,5]]},"671":{"position":[[219,5]]},"673":{"position":[[135,5]]},"687":{"position":[[105,5],[276,5]]},"693":{"position":[[771,5],[930,5]]},"709":{"position":[[106,5],[259,5]]},"711":{"position":[[105,5]]},"713":{"position":[[430,5],[824,5]]},"730":{"position":[[22,8]]},"732":{"position":[[217,5]]},"734":{"position":[[417,5],[599,5]]},"755":{"position":[[95,5]]},"757":{"position":[[399,5],[568,5],[867,5],[1147,5]]},"767":{"position":[[201,5]]},"787":{"position":[[773,5],[932,5]]},"805":{"position":[[101,5],[225,5]]},"807":{"position":[[99,5]]},"809":{"position":[[417,5],[599,5],[847,5]]},"830":{"position":[[117,5]]},"832":{"position":[[399,5],[568,5]]},"842":{"position":[[503,5]]},"850":{"position":[[240,7],[589,8]]}}}],["leav",{"_index":2001,"t":{"486":{"position":[[6,5]]},"611":{"position":[[258,6]]}}}],["left",{"_index":2644,"t":{"777":{"position":[[309,4]]}}}],["legaci",{"_index":2844,"t":{"830":{"position":[[467,6]]},"838":{"position":[[521,6]]},"840":{"position":[[290,6]]},"842":{"position":[[624,6],[1773,6]]},"844":{"position":[[2779,6],[3957,6],[5511,6],[6739,6],[7783,6]]}}}],["legacy_admin",{"_index":2860,"t":{"842":{"position":[[949,13],[1064,13],[1265,15],[1413,15],[1786,14]]},"844":{"position":[[103,14],[256,12],[636,13],[837,15],[985,15],[1987,12],[2850,15],[5590,15],[7729,12],[7996,12],[8797,15],[9896,15],[11275,15],[12824,12],[13512,15],[13538,14],[25408,12],[26214,15],[27320,15],[28706,15],[30269,12],[30977,15],[31003,14],[40169,15],[41268,15],[42647,15],[44196,12],[44884,15],[44910,14],[45171,12],[45226,13],[45271,12],[45328,13]]},"846":{"position":[[5935,12],[6284,13],[6417,13],[6471,12],[6527,12],[6668,15],[6793,14],[6961,14],[7043,15],[13129,12],[13184,13],[13229,12],[13286,13]]},"848":{"position":[[2256,14],[2526,14],[3772,14],[4042,14],[4543,13],[4597,12],[4653,12],[5078,15],[5203,14],[5371,14],[5453,15],[6166,14],[6436,14],[57547,12],[57602,13]]}}}],["length",{"_index":1382,"t":{"212":{"position":[[3059,6]]}}}],["less",{"_index":1506,"t":{"228":{"position":[[892,4]]},"380":{"position":[[306,4]]},"476":{"position":[[398,4]]}}}],["let",{"_index":1781,"t":{"418":{"position":[[1428,4]]},"482":{"position":[[3211,4]]},"728":{"position":[[22747,7]]}}}],["let'",{"_index":791,"t":{"85":{"position":[[1025,5]]},"212":{"position":[[470,5]]},"267":{"position":[[4,5]]},"285":{"position":[[6972,5]]},"375":{"position":[[6377,5]]},"430":{"position":[[156,5]]},"432":{"position":[[10,5]]},"472":{"position":[[1310,5]]},"478":{"position":[[436,5],[2178,5]]},"484":{"position":[[1496,5]]},"540":{"position":[[45,5]]},"562":{"position":[[102,5]]},"749":{"position":[[122,5]]},"751":{"position":[[9494,5]]},"777":{"position":[[2817,5]]},"795":{"position":[[23431,5]]},"820":{"position":[[31349,5]]},"822":{"position":[[2000,5]]},"844":{"position":[[45073,5]]}}}],["level",{"_index":1050,"t":{"155":{"position":[[1190,5]]},"230":{"position":[[177,6],[205,5]]},"333":{"position":[[406,5]]},"454":{"position":[[2620,5]]},"458":{"position":[[60,5]]},"740":{"position":[[237,5],[270,5]]},"745":{"position":[[34,6]]}}}],["leverag",{"_index":1676,"t":{"355":{"position":[[52,8]]},"504":{"position":[[3,8]]}}}],["librari",{"_index":909,"t":{"109":{"position":[[896,7]]}}}],["lifecycl",{"_index":2279,"t":{"673":{"position":[[7,9]]}}}],["likewis",{"_index":2241,"t":{"663":{"position":[[159,9]]},"771":{"position":[[11776,9]]}}}],["limit",{"_index":59,"t":{"3":{"position":[[869,7]]},"9":{"position":[[19,11]]},"151":{"position":[[270,6]]},"155":{"position":[[34,6],[376,6],[794,5],[867,5],[1037,7],[1739,6],[1782,8],[2013,6],[2426,6]]},"212":{"position":[[3040,6]]},"311":{"position":[[11405,5]]},"325":{"position":[[285,5]]},"327":{"position":[[1355,5]]},"452":{"position":[[452,8]]},"482":{"position":[[3541,5]]},"588":{"position":[[45,11]]},"838":{"position":[[139,7],[1232,8]]}}}],["link",{"_index":2038,"t":{"524":{"position":[[173,7]]},"732":{"position":[[128,5]]}}}],["linux",{"_index":939,"t":{"113":{"position":[[1391,5],[1614,6]]},"117":{"position":[[188,6]]}}}],["list",{"_index":223,"t":{"9":{"position":[[713,4]]},"29":{"position":[[697,4],[745,4]]},"45":{"position":[[5612,5],[24184,4],[24209,4],[24255,4],[24494,4],[24549,4],[24587,4],[29645,4],[30422,4]]},"61":{"position":[[22,5]]},"73":{"position":[[2,4],[48,4]]},"81":{"position":[[287,5]]},"95":{"position":[[238,6]]},"103":{"position":[[8,4],[195,4]]},"139":{"position":[[46,4]]},"143":{"position":[[24,4]]},"147":{"position":[[1336,4]]},"149":{"position":[[108,4],[134,4]]},"151":{"position":[[14,4]]},"155":{"position":[[588,4]]},"183":{"position":[[3221,6]]},"185":{"position":[[4350,6]]},"187":{"position":[[4911,6]]},"191":{"position":[[140,4]]},"222":{"position":[[690,4],[1221,4]]},"234":{"position":[[14,4]]},"258":{"position":[[140,4]]},"271":{"position":[[69,4]]},"275":{"position":[[33,4]]},"279":{"position":[[19,4]]},"281":{"position":[[917,4]]},"285":{"position":[[140,4]]},"302":{"position":[[140,4]]},"325":{"position":[[13,5],[40,4],[160,4],[189,4]]},"327":{"position":[[39,6],[754,4],[1197,4],[1285,4],[1515,4],[1568,4],[1654,4],[1901,4],[2232,4],[2796,4]]},"333":{"position":[[602,5],[659,4]]},"347":{"position":[[118,6]]},"363":{"position":[[117,6]]},"396":{"position":[[140,4]]},"408":{"position":[[1153,4]]},"416":{"position":[[3317,4]]},"420":{"position":[[273,4],[514,4]]},"430":{"position":[[117,6]]},"454":{"position":[[140,4]]},"468":{"position":[[188,6]]},"474":{"position":[[421,4],[443,4]]},"478":{"position":[[12,4],[1917,4],[1971,4],[3801,4],[3841,5],[3886,4],[4014,4]]},"480":{"position":[[295,4],[2250,4]]},"482":{"position":[[7703,4]]},"492":{"position":[[140,4]]},"514":{"position":[[140,4]]},"526":{"position":[[261,6]]},"530":{"position":[[140,4]]},"550":{"position":[[140,4]]},"568":{"position":[[140,4]]},"574":{"position":[[6382,4]]},"590":{"position":[[140,4]]},"608":{"position":[[6019,4]]},"616":{"position":[[56,4]]},"618":{"position":[[5426,4],[6374,4],[6815,4]]},"622":{"position":[[211,4],[351,4]]},"628":{"position":[[117,6]]},"655":{"position":[[118,6]]},"687":{"position":[[231,4]]},"713":{"position":[[140,4]]},"724":{"position":[[383,7]]},"728":{"position":[[47969,6]]},"734":{"position":[[140,4]]},"757":{"position":[[140,4]]},"809":{"position":[[140,4]]},"832":{"position":[[140,4]]},"838":{"position":[[70,4]]}}}],["list#::#,# - - + +

Search the documentation

- - + + \ No newline at end of file